=> {\r\n const isFboUser = !!migrationToken && isFboMigrationTokenValid\r\n const isOnboardingInvitation = !!onboardingCodeParam\r\n if (\r\n (isFboUser && (!migrationToken || !tenantParam)) ||\r\n (isOnboardingInvitation && (!onboardingCodeParam || !tenantParam)) ||\r\n !emailParam\r\n ) {\r\n rollbarInstance.error(\r\n `Missing required params on complete registration: \r\n migrationToken: ${migrationToken}, emailParam: ${emailParam}, tenantParam: ${tenantParam}, onboardingCodeParam: ${onboardingCodeParam}`\r\n )\r\n return throwError(() => t('common.alert.somethingWrong'))\r\n }\r\n\r\n const email = decodeURIComponent(emailParam)\r\n\r\n return forkJoin([\r\n authService.initialLogin(values.password),\r\n from(getRecaptchaToken()),\r\n ]).pipe(\r\n switchMap(([, recaptcha]) => {\r\n return isFboUser || isOnboardingInvitation\r\n ? // Execute activateFboUserMapping, setUserRegisteredOn and verifyEmail in sequence to avoid concurrency issue\r\n // start with of(null) to initiate the concatMap chain\r\n of(null).pipe(\r\n concatMap(() =>\r\n authService.activateFboUserMapping(\r\n migrationToken,\r\n onboardingCodeParam,\r\n emailParam,\r\n recaptcha.activateFboMappingToken,\r\n tenantParam\r\n )\r\n ),\r\n concatMap(() => authService.setUserRegisteredOn()),\r\n concatMap(() =>\r\n authService.verifyEmail({\r\n email,\r\n migrationToken,\r\n onboardingCode: onboardingCodeParam,\r\n })\r\n ),\r\n // collect all emitted values and emits them after all operations have completed\r\n toArray()\r\n )\r\n : of(null)\r\n }),\r\n switchMap(() => of({ clientPortalRedirectionEnabled: true }))\r\n )\r\n },\r\n [\r\n emailParam,\r\n getRecaptchaToken,\r\n isFboMigrationTokenValid,\r\n migrationToken,\r\n onboardingCodeParam,\r\n t,\r\n tenantParam,\r\n ]\r\n )\r\n\r\n if (environment.IS_FBO_INVITATION_SIGNUP_MAINTENANCE_ENABLED === 'true') {\r\n return (\r\n \r\n \r\n \r\n {t('form.completeRegistration.maintenanceContent')}\r\n \r\n
\r\n )\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n {t('common.preps.for')} \r\n \r\n {emailParam} \r\n \r\n \r\n {error && (\r\n \r\n {errorString}\r\n \r\n )}\r\n {/* We wait until the user and his attributes are set\r\n before showing the form since they are required to send a change password request. */}\r\n {showChangeForm && (\r\n \r\n )}\r\n
\r\n ) as ReactElement\r\n}\r\n","import React, { FC, useMemo } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Link as RouterLink } from 'react-router-dom'\r\nimport { useObservable } from 'rxjs-hooks'\r\n\r\nimport { Link, Stack, Typography } from '@mui/material'\r\nimport {\r\n ClientNames,\r\n CompanyNames,\r\n IClientSettings,\r\n useClientService,\r\n} from '@procom-labs/common'\r\n\r\nexport const TermsAndConditions: FC = () => {\r\n const { t } = useTranslation()\r\n\r\n const clientService = useClientService()\r\n\r\n const clientSettings: IClientSettings | null = useObservable(\r\n () => clientService.clientSetting$\r\n )\r\n\r\n const displayClientConnections = useMemo(\r\n () =>\r\n clientSettings?.common.name === ClientNames.KPMG\r\n ? CompanyNames.ClientConnections\r\n : '',\r\n [clientSettings?.common.name]\r\n )\r\n\r\n return (\r\n \r\n \r\n {t('footer.agreement', {\r\n companyName: displayClientConnections,\r\n })}\r\n \r\n \r\n \r\n {t('footer.terms')}\r\n \r\n {t('footer.and')}\r\n \r\n {t('footer.privacyPolicy')}\r\n \r\n \r\n \r\n )\r\n}\r\n","import React, { ReactElement, useEffect, useRef, useState } from 'react'\r\nimport { Field, Form, Formik } from 'formik'\r\nimport { TextField } from 'formik-mui'\r\nimport { useTranslation } from 'react-i18next'\r\nimport {\r\n Link as RouterLink,\r\n useNavigate,\r\n useSearchParams,\r\n} from 'react-router-dom'\r\nimport { combineLatest, EMPTY, from, of, Subscription, switchMap } from 'rxjs'\r\nimport * as Yup from 'yup'\r\n\r\nimport CloseIcon from '@mui/icons-material/Close'\r\nimport { LoadingButton } from '@mui/lab'\r\nimport {\r\n Box,\r\n Button,\r\n DialogActions,\r\n DialogContent,\r\n DialogContentText,\r\n DialogTitle,\r\n IconButton,\r\n Link,\r\n Typography,\r\n} from '@mui/material'\r\nimport { GorillaAlert, GorillaDialog } from '@procom-labs/atoms'\r\nimport {\r\n errorToString,\r\n gtmEvents,\r\n gtmEventsPrefix,\r\n RecaptchaActions,\r\n} from '@procom-labs/common'\r\n\r\nimport {\r\n useAuthService,\r\n useRecaptcha,\r\n useTrackingWrapper,\r\n} from '@auth-portal/hooks'\r\n\r\nimport { Header } from './header'\r\nimport { TermsAndConditions } from './terms-and-conditions'\r\n\r\ninterface FormValues {\r\n email: string\r\n}\r\n\r\nconst initialValues: FormValues = {\r\n email: '',\r\n}\r\n\r\nexport const ResetPasswordForm: React.FC<{}> = () => {\r\n const navigate = useNavigate()\r\n const [searchParams] = useSearchParams()\r\n const email = searchParams.get('email')\r\n const [errorString, setErrorString] = useState(undefined)\r\n const [formValues, setFormValues] = useState(initialValues)\r\n const [showFeedbackDialog, setShowFeedbackDialog] = useState(false)\r\n\r\n const [submitIsLoading, setSubmitIsLoading] = useState(false)\r\n const { t } = useTranslation('main')\r\n const error = !!errorString\r\n const subscriptionRef = useRef()\r\n const { track } = useTrackingWrapper()\r\n\r\n const authService = useAuthService()\r\n\r\n const { getRecaptchaToken } = useRecaptcha()\r\n\r\n useEffect(() => {\r\n if (email) {\r\n setFormValues({ email })\r\n }\r\n }, [email])\r\n\r\n const validationSchema = Yup.object().shape({\r\n email: Yup.string()\r\n .required(t('form.email.requiredError'))\r\n .email(t('form.email.invalidError')),\r\n })\r\n\r\n const handleSubmit = (values: any, actions: any): void => {\r\n setSubmitIsLoading(true)\r\n\r\n subscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.GetAnonymousUserInfo)\r\n )\r\n .pipe(\r\n switchMap((token) => authService.getPasswordInfo(values.email, token)),\r\n switchMap((data) => {\r\n return combineLatest([\r\n of(data),\r\n from(getRecaptchaToken(RecaptchaActions.RequestResetPassword)),\r\n ])\r\n }),\r\n switchMap(([data, token]) => {\r\n if (!data.hasPasswordExpired) {\r\n return authService.requestPasswordReset(values.email, token)\r\n }\r\n if (data.hasContractorProfile && data.hasPasswordExpired) {\r\n navigate('/reset-expired-password', {\r\n state: {\r\n email,\r\n code: data?.code,\r\n },\r\n replace: true,\r\n })\r\n }\r\n return EMPTY\r\n })\r\n )\r\n .subscribe({\r\n complete: () => {\r\n track({\r\n eventName: gtmEvents.FormResetPassword,\r\n submissionStatus: 'true',\r\n email,\r\n })\r\n setShowFeedbackDialog(true)\r\n actions.resetForm()\r\n },\r\n error: (err) => {\r\n setErrorString(errorToString(err))\r\n track({\r\n eventName: `${gtmEventsPrefix.Notification}${gtmEvents.FormResetPassword}`,\r\n submissionStatus: 'false',\r\n email,\r\n errorMessage: errorToString(err),\r\n })\r\n },\r\n })\r\n\r\n subscriptionRef.current.add(() => {\r\n setSubmitIsLoading(false)\r\n actions.setSubmitting(false)\r\n })\r\n }\r\n\r\n const closeFeedbackDialog = (): void => {\r\n setShowFeedbackDialog(false)\r\n }\r\n\r\n useEffect(() => {\r\n return () => {\r\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\r\n subscriptionRef.current.unsubscribe()\r\n subscriptionRef.current = null\r\n }\r\n }\r\n }, [])\r\n\r\n return (\r\n <>\r\n \r\n {error && (\r\n \r\n {errorString}\r\n \r\n )}\r\n \r\n\r\n \r\n {() => {\r\n return (\r\n \r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n
\r\n \r\n \r\n \r\n {t('form.reset.dialog.title')}\r\n \r\n theme.palette.grey[500],\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n {t('form.reset.dialog.dsc')}\r\n \r\n \r\n \r\n navigate('/')}>\r\n {t('form.reset.backLoginBtn')}\r\n \r\n\r\n \r\n {t('common.btn.okay')}\r\n \r\n \r\n \r\n >\r\n ) as ReactElement\r\n}\r\n","import React, { useContext } from 'react';\nimport { InjectableContexts, useWindowedObservable } from '@procom-labs/common';\nimport { AlertContext } from '../contexts';\nexport var useAlert = function() {\n var context = useWindowedObservable(InjectableContexts.Alert);\n return useContext(context !== null && context !== void 0 ? context : AlertContext);\n};\n","export default __webpack_public_path__ + \"static/media/verify-email.571ee543829e010e275e4b76ba9507e5.svg\";","import React, { useCallback, useEffect, useRef, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useLocation, useNavigate, useSearchParams } from 'react-router-dom'\r\nimport { catchError, EMPTY, Subscription, switchMap } from 'rxjs'\r\n\r\nimport { Box, Button, Stack, Typography } from '@mui/material'\r\nimport { Preloader } from '@procom-labs/atoms'\r\nimport { ClientQueryParams, LoginTypes } from '@procom-labs/common'\r\nimport { useAlert } from '@procom-labs/molecules'\r\n\r\nimport VerifySVG from '@auth-portal/assets/verify-email.svg'\r\nimport { Logo } from '@auth-portal/components/logo'\r\nimport { useAuthService } from '@auth-portal/hooks'\r\nimport { ProtectedLinksEnum } from '@auth-portal/routes/routes.enum'\r\n\r\ntype initialState = {\r\n state: {\r\n token: string | null\r\n }\r\n}\r\n\r\nexport const VerifyEmail: React.FC<{}> = () => {\r\n const authService = useAuthService()\r\n\r\n const { t } = useTranslation('main')\r\n const [searchParams] = useSearchParams()\r\n\r\n const { state } = useLocation() as initialState\r\n const [message, setMessage] = useState(String)\r\n const { addAlert } = useAlert()\r\n\r\n const emailParam = searchParams.get('email')\r\n const codeParam = searchParams.get('code')\r\n const loginType = searchParams.get(ClientQueryParams.loginType)\r\n const subscriptionRef = useRef()\r\n const navigate = useNavigate()\r\n const [isLoading, setIsLoading] = useState(false)\r\n\r\n useEffect(() => {\r\n if (loginType) {\r\n localStorage.setItem(ClientQueryParams.loginType, loginType)\r\n authService.setLoginType()\r\n }\r\n\r\n if (emailParam && codeParam) {\r\n authService\r\n .verifyEmail({ email: emailParam, confirmationCode: codeParam })\r\n .pipe(\r\n switchMap(() => authService.refreshUserSessionInfo()),\r\n catchError(() => EMPTY)\r\n )\r\n .subscribe({\r\n next: (idToken) => {\r\n if (\r\n loginType?.toLowerCase() ===\r\n LoginTypes.GorillaResume.toLowerCase() &&\r\n idToken\r\n ) {\r\n authService.redirectToClientPortal({\r\n emailVerified: 'true',\r\n })\r\n }\r\n },\r\n complete() {\r\n setMessage(t('form.verifyEmail.verified'))\r\n navigate(\r\n `/?${new URLSearchParams({\r\n emailVerified: 'true',\r\n loginType: loginType ?? LoginTypes.Client,\r\n })}`,\r\n { replace: true }\r\n )\r\n },\r\n })\r\n }\r\n })\r\n\r\n const handleSendVerification = useCallback(() => {\r\n if (state?.token) {\r\n setIsLoading(true)\r\n subscriptionRef.current = authService\r\n .resendEmailVerification(\r\n ProtectedLinksEnum.Dashboard,\r\n LoginTypes.Client,\r\n true,\r\n state.token\r\n )\r\n .subscribe({\r\n complete: () => {\r\n setIsLoading(false)\r\n addAlert({\r\n severity: 'success',\r\n message: t('form.login.verifyEmail.alert'),\r\n })\r\n },\r\n error: () => {\r\n setIsLoading(false)\r\n addAlert({\r\n message: t('common.alert.somethingWrong'),\r\n severity: 'error',\r\n horizontal: 'left',\r\n })\r\n },\r\n })\r\n }\r\n }, [addAlert, state?.token, t])\r\n\r\n useEffect(() => {\r\n return () => {\r\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\r\n subscriptionRef.current.unsubscribe()\r\n subscriptionRef.current = null\r\n }\r\n }\r\n }, [])\r\n\r\n if (!codeParam)\r\n return (\r\n \r\n \r\n \r\n {t('form.login.verifyEmail.title')}\r\n \r\n \r\n \r\n \r\n \r\n {t('form.login.verifyEmail.text1')} {emailParam} .{' '}\r\n {t('form.login.verifyEmail.text2')}\r\n \r\n \r\n {t('form.login.verifyEmail.resendBtn')}\r\n \r\n \r\n {t('form.login.verifyEmail.contactBtn')}\r\n \r\n \r\n )\r\n\r\n if (!message) return \r\n\r\n return (\r\n \r\n )\r\n}\r\n","import { ClientNames } from '../../enums';\nexport var DEMO_CLIENTS = [\n ClientNames.Demo.toString(),\n ClientNames.DemoCorp.toString(),\n ClientNames.DemoClient.toString(),\n ClientNames.GwDemoClient.toString(),\n ClientNames.GorillaWorks.toString()\n];\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction _array_without_holes(arr) {\n if (Array.isArray(arr)) return _array_like_to_array(arr);\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _iterable_to_array(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _non_iterable_spread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction _to_consumable_array(arr) {\n return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();\n}\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nimport * as Yup from 'yup';\nexport var isValidEmail = function(str) {\n return /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(str);\n};\nexport var validEmailRegex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i;\nexport var validEmailDomainRegex = /^[A-Z0-9.-]+\\.[A-Z]{2,}$/i;\n// Only accept valid emails that have a domain different from gmail, hotmail, icloud, and outlook.\nexport var nonPersonalEmailRegex = /^[A-Z0-9._%+-]+@(?!gmail\\.|hotmail\\.|icloud\\.|outlook\\.)[A-Z0-9.-]+\\.[A-Z]{2,4}$/i;\n// Only accept letters (including French accents), dash, and apostrophes\nexport var validFirstNameRegex = /^([a-zA-Z-À-ÿ]|'|-)+$/;\n// Accept letters (including French accents), dash, apostrophes and spaces\nexport var validLastNameRegex = /^[a-zA-ZÀ-ÿ]+(?:['\\s-][a-zA-ZÀ-ÿ]+)*$/;\n// Accept letters (including French accents), dash, apostrophes and spaces\nexport var validTitleRegex = /[a-zA-Z\\-'\\S]+/g;\n// Should have minimum 6 characters, 1 number, 1 lowercase and 1 uppercase letter\nexport var validPasswordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.{6,})/;\n// Should have minimum 6 characters, 1 number and 1 special character\nexport var validPasswordSpecialCharRegex = /^(?=.*\\d)(?=.*[!@#$%^&*()_?,./\\\\|]).{6,}$/;\n// Accept dates in the format MM/DD/YYYY\nexport var validMedDateRegex = /^(0[1-9]|1[0-2])\\/(0[1-9]|1\\d|2\\d|3[01])\\/\\d{4}$/;\nexport var acceptedImgTypes = 'image/jpeg, image/jpg, image/png';\nexport var validateSIN = function(sin) {\n if (!sin || (sin === null || sin === void 0 ? void 0 : sin.charAt(0)) === '0' || (sin === null || sin === void 0 ? void 0 : sin.charAt(0)) === '8') {\n return false;\n }\n var sum = 0;\n for(var i = 0; i < sin.length; i += 1){\n var n = parseInt(sin.charAt(i), 10);\n if (i % 2 === 0) {\n sum += n;\n } else {\n var x = 2 * n;\n sum += x > 9 ? x - 9 : x;\n }\n }\n return sum % 10 === 0;\n};\nexport var validateSSN = function(ssn) {\n // Check if the SSN is 9 digits long\n if (!ssn || ssn.length !== 9) {\n return false;\n }\n // Check if the SSN is in the correct format\n var regex = /^(?!000|666)[0-8][0-9]{2}(?!00)[0-9]{2}(?!0000)[0-9]{4}$/;\n return regex.test(ssn);\n};\nfunction generateFormFields() {\n for(var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++){\n keys[_key] = arguments[_key];\n }\n return Object.fromEntries(keys.map(function(k) {\n return [\n k,\n ''\n ];\n }));\n}\nvar extraValidationDefault = {\n subjectMaxLimit: 100\n};\nexport var basicUserInfoFormValidation = function(i18n, fields, extraValidation) {\n var _extraValidation_subjectMaxLimit;\n var subjectMaxLimit = (_extraValidation_subjectMaxLimit = extraValidation === null || extraValidation === void 0 ? void 0 : extraValidation.subjectMaxLimit) !== null && _extraValidation_subjectMaxLimit !== void 0 ? _extraValidation_subjectMaxLimit : extraValidationDefault.subjectMaxLimit;\n var formFields = {\n firstName: Yup.string().max(50, i18n.t('common.form.firstName.maxError')).required(i18n.t('common.form.firstName.requiredError')).matches(validFirstNameRegex, i18n.t('common.form.firstName.matchesError')),\n lastName: Yup.string().max(100, i18n.t('common.form.lastName.maxError')).required(i18n.t('common.form.lastName.requiredError')).matches(validLastNameRegex, i18n.t('common.form.lastName.matchesError')),\n subject: Yup.string().min(2, i18n.t('common.form.errors.minError', {\n count: 2\n })).max(subjectMaxLimit, i18n.t('common.form.errors.maxError', {\n count: subjectMaxLimit\n })).required(i18n.t('common.form.errors.requiredError', {\n label: i18n.t('common.form.subject.label').toLowerCase()\n })).matches(validTitleRegex, i18n.t('common.form.subject.matchesError')),\n textarea: Yup.string().min(2, i18n.t('common.form.errors.minError', {\n count: 2\n })).required(i18n.t('common.form.errors.requiredError', {\n label: i18n.t('common.form.description.label').toLowerCase()\n })),\n email: Yup.string().required(i18n.t('common.form.email.requiredError')).test('email-domain', i18n.t('common.form.email.sameDomain'), function() {\n var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '';\n var _extraValidation_email, _extraValidation_email1;\n return !(extraValidation === null || extraValidation === void 0 ? void 0 : (_extraValidation_email = extraValidation.email) === null || _extraValidation_email === void 0 ? void 0 : _extraValidation_email.sameDomain) ? true : !value.includes('@') && (extraValidation === null || extraValidation === void 0 ? void 0 : (_extraValidation_email1 = extraValidation.email) === null || _extraValidation_email1 === void 0 ? void 0 : _extraValidation_email1.sameDomain);\n }),\n password: Yup.string().required(i18n.t('common.form.password.error')),\n phoneNumberCognito: Yup.string().required(i18n.t('common.form.phone.requiredError')).min(12, i18n.t('common.form.phone.invalidError'))\n };\n var formFieldsFiltered = generateFormFields.apply(void 0, _to_consumable_array(fields));\n fields.forEach(function(field) {\n formFieldsFiltered[field] = formFields[field];\n });\n return _object_spread({}, formFieldsFiltered);\n};\nexport var locationValidation = Yup.object().shape({\n addressLine1: Yup.string().nullable(),\n addressLine2: Yup.string().nullable(),\n city: Yup.string().nullable(),\n province: Yup.string().nullable(),\n postalCode: Yup.string().ensure().nullable(),\n countryCode: Yup.string().nullable(),\n country: Yup.string().nullable(),\n latitude: Yup.string().nullable(),\n longitude: Yup.string().nullable()\n}).nullable();\nexport var validateDemoPortalEmailDomain = function(value, allowedDomains) {\n var shouldValidate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;\n if (!value || !shouldValidate) return true;\n try {\n var emailDomain = value.split('@')[1];\n return emailDomain && allowedDomains ? allowedDomains.includes(emailDomain) : false;\n } catch (err) {\n return false;\n }\n};\n","import React from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Link as RouterLink } from 'react-router-dom'\r\n\r\nimport { Link as MuiLink, Stack, Typography } from '@mui/material'\r\n\r\nexport const LoginLink: React.FC = () => {\r\n const { t } = useTranslation('main')\r\n\r\n return (\r\n \r\n \r\n <>\r\n {t('footer.haveLogin')}\r\n \r\n {t('footer.haveLoginLink')}\r\n \r\n >\r\n \r\n \r\n )\r\n}\r\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\r\nimport { Field, Form, Formik } from 'formik'\r\nimport { CheckboxWithLabel, TextField } from 'formik-mui'\r\nimport { useGoogleReCaptcha } from 'react-google-recaptcha-v3'\r\nimport { useTranslation } from 'react-i18next'\r\nimport {\r\n Link as RouterLink,\r\n useNavigate,\r\n useSearchParams,\r\n} from 'react-router-dom'\r\nimport { combineLatest, EMPTY, from, of, Subscription, switchMap } from 'rxjs'\r\nimport { useObservable } from 'rxjs-hooks'\r\nimport * as Yup from 'yup'\r\n\r\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack'\r\nimport CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'\r\nimport CloseIcon from '@mui/icons-material/Close'\r\nimport VisibilityIcon from '@mui/icons-material/Visibility'\r\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff'\r\nimport { LoadingButton } from '@mui/lab'\r\nimport {\r\n Box,\r\n Button,\r\n FormControl,\r\n FormHelperText,\r\n IconButton,\r\n InputAdornment,\r\n Link as MuiLink,\r\n Stack,\r\n Typography,\r\n} from '@mui/material'\r\nimport { GorillaAlert } from '@procom-labs/atoms'\r\nimport {\r\n AuthProfileType,\r\n ClientNames,\r\n CompanyNames,\r\n DEMO_CLIENTS,\r\n errorToString,\r\n getClientName,\r\n gtmEvents,\r\n gtmEventsPrefix,\r\n HTTPResponseStatus,\r\n IClientSettings,\r\n RecaptchaActions,\r\n useClientService,\r\n useRollbarInstance,\r\n useSubjectSelector,\r\n validateDemoPortalEmailDomain,\r\n} from '@procom-labs/common'\r\nimport { useAlert } from '@procom-labs/molecules'\r\n\r\nimport { authStore } from '@auth-portal/store'\r\nimport { IUserClaimProfile, IUserSignUp } from '@auth-portal/types'\r\n\r\nimport {\r\n useAuthService,\r\n useLoginTypes,\r\n useRecaptcha,\r\n useTrackingWrapper,\r\n} from '../hooks'\r\nimport { Header } from './header'\r\nimport { LoginLink } from './login-link'\r\n\r\nconst initialCredentials: IUserSignUp = {\r\n email: '',\r\n password: '',\r\n confirmPassword: '',\r\n TncAndPrivacyPolicy: false,\r\n}\r\n\r\nconst InitialUser: IUserClaimProfile = {\r\n email: '',\r\n isExistingUser: false,\r\n}\r\nexport const SignupForm: React.FC<{}> = () => {\r\n const rollbarInstance = useRollbarInstance()\r\n const authService = useAuthService()\r\n const clientService = useClientService()\r\n const { addAlert } = useAlert()\r\n const [userClaimingProfile, setUserClaimingProfile] =\r\n useState(InitialUser)\r\n const [isClaimingProfile, setIsClaimingProfile] = useState(false)\r\n const { t } = useTranslation('main')\r\n const { executeRecaptcha } = useGoogleReCaptcha()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const [credentials, setCredentials] =\r\n useState(initialCredentials)\r\n const [showPassword, setShowPassword] = useState(false)\r\n const [errorString, setErrorString] = useState(undefined)\r\n const error = !!errorString\r\n const subscriptionRef = useRef()\r\n const { track } = useTrackingWrapper()\r\n const [searchParams] = useSearchParams()\r\n const navigate = useNavigate()\r\n\r\n const { siteConfig } = useSubjectSelector(authStore, ['siteConfig'])\r\n const { isGorillaResumeLogin: isResumePortalSignup } = useLoginTypes()\r\n\r\n const clientSettings: IClientSettings | null = useObservable(\r\n () => clientService.clientSetting$\r\n )\r\n\r\n const shouldValidateEmailDomain = useMemo(() => {\r\n const clientName = getClientName()\r\n return DEMO_CLIENTS.includes(clientName)\r\n }, [])\r\n\r\n const campaignId = searchParams.get('campaignId')\r\n const validate = Yup.object().shape({\r\n email: Yup.string()\r\n .required(t('form.email.requiredError'))\r\n .email(t('form.email.invalidError'))\r\n .test(\r\n 'domain-validation',\r\n t('common.form.email.domainNotAllowed'),\r\n (value) =>\r\n validateDemoPortalEmailDomain(\r\n value,\r\n siteConfig?.companyInternalEmailDomains,\r\n shouldValidateEmailDomain\r\n )\r\n ),\r\n password: Yup.string()\r\n .required(t('form.changePassword.requiredError'))\r\n .min(6, t('form.passwordValidation.min6Characters'))\r\n .matches(/[A-Z]+/, t('form.passwordValidation.min1CapitalLetter'))\r\n .matches(/[a-z]+/, t('form.passwordValidation.min1LowerCaseLetter'))\r\n .matches(/\\d+/, t('form.passwordValidation.min1Number')),\r\n confirmPassword: Yup.string()\r\n .required(t('form.confirmPasswordValidation.requiredField'))\r\n .oneOf(\r\n [Yup.ref('password'), null],\r\n t('form.passwordValidation.passwordMustMatch')\r\n ),\r\n TncAndPrivacyPolicy: Yup.bool().oneOf(\r\n [true],\r\n t('form.contractorSignup.required')\r\n ),\r\n })\r\n\r\n const displayClientConnections = useMemo(\r\n () =>\r\n clientSettings?.common.name === ClientNames.KPMG\r\n ? CompanyNames.ClientConnections\r\n : '',\r\n [clientSettings?.common.name]\r\n )\r\n\r\n const userId = searchParams.get('code')\r\n\r\n useEffect(() => {\r\n let subscription = new Subscription()\r\n\r\n if (!siteConfig) {\r\n subscription = authService.getSiteConfigurationByOriginBase().subscribe()\r\n }\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [siteConfig])\r\n\r\n useEffect(() => {\r\n const subscription = new Subscription()\r\n\r\n if (userId && executeRecaptcha) {\r\n subscription.add(\r\n from(getRecaptchaToken(RecaptchaActions.Signup))\r\n .pipe(\r\n switchMap((token) =>\r\n authService.getUserEmailById(`${userId}`, token)\r\n )\r\n )\r\n .subscribe({\r\n next: ({ data }) => {\r\n if (data?.isExistingUser) {\r\n from(getRecaptchaToken(RecaptchaActions.ClaimContractorProfile))\r\n .pipe(\r\n switchMap((token) =>\r\n authService.claimContractorProfile(userId, token)\r\n )\r\n )\r\n .subscribe({})\r\n addAlert({\r\n severity: 'warning',\r\n message: t('form.login.alerts.claimedProfileExists'),\r\n })\r\n navigate(`/?email=${data.email}`)\r\n } else {\r\n setUserClaimingProfile(data)\r\n setIsClaimingProfile(true)\r\n }\r\n },\r\n })\r\n )\r\n }\r\n return () => {\r\n if (subscription && subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [addAlert, executeRecaptcha, getRecaptchaToken, navigate, t, userId])\r\n\r\n const handleSubmit = (values: any, actions: any): void => {\r\n const { email, password } = values\r\n\r\n const userEmail =\r\n userClaimingProfile.email.trim().length === 0\r\n ? email\r\n : userClaimingProfile.email\r\n\r\n subscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.GetAnonymousUserInfo)\r\n )\r\n .pipe(\r\n switchMap((token) => authService.getPasswordInfo(userEmail, token)),\r\n switchMap((data) => {\r\n return combineLatest([\r\n of(data),\r\n from(getRecaptchaToken(RecaptchaActions.Signup)),\r\n ])\r\n }),\r\n switchMap(([data, token]) => {\r\n if (!data.hasPasswordExpired) {\r\n return authService.signUp(\r\n userEmail,\r\n password,\r\n userId,\r\n isClaimingProfile,\r\n token,\r\n campaignId || null,\r\n isResumePortalSignup\r\n ? AuthProfileType.GorillaResumeUser\r\n : AuthProfileType.Contractor\r\n )\r\n }\r\n navigate('/reset-expired-password', {\r\n state: {\r\n email,\r\n code: data?.code,\r\n },\r\n replace: true,\r\n })\r\n return EMPTY\r\n })\r\n )\r\n\r\n .subscribe({\r\n error: (err) => {\r\n const { status } = err.response\r\n let errorMessage = ''\r\n\r\n if (status === HTTPResponseStatus.UnprocessableEntity) {\r\n setErrorString(\r\n t('common.alert.emailExist', {\r\n email,\r\n })\r\n )\r\n\r\n errorMessage = t('common.alert.emailExist')\r\n rollbarInstance.error('This email already exists')\r\n actions.setErrors({ email: t('form.verifyEmail.emailExist') })\r\n } else {\r\n setErrorString(errorToString(t('somethingWrong')))\r\n errorMessage = t('somethingWrong')\r\n }\r\n\r\n track({\r\n eventName: `${gtmEventsPrefix.Notification}${gtmEvents.FormSignUpEmail}`,\r\n submissionStatus: 'false',\r\n email,\r\n errorMessage,\r\n })\r\n },\r\n })\r\n subscriptionRef.current.add(() => actions.setSubmitting(false))\r\n }\r\n\r\n useEffect(() => {\r\n return () => {\r\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\r\n subscriptionRef.current.unsubscribe()\r\n subscriptionRef.current = null\r\n }\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n if (userClaimingProfile.email)\r\n setCredentials({\r\n ...initialCredentials,\r\n email: userClaimingProfile.email,\r\n })\r\n }, [userClaimingProfile.email])\r\n\r\n const handleGoBack = useCallback(() => {\r\n navigate(-1)\r\n }, [navigate])\r\n\r\n return (\r\n <>\r\n \r\n {({ values, touched, errors, isSubmitting }) => {\r\n const isFormFilled =\r\n !!values.email &&\r\n !!values.password &&\r\n !!values.confirmPassword &&\r\n values.TncAndPrivacyPolicy\r\n\r\n return (\r\n <>\r\n {error && (\r\n \r\n \r\n {t('form.login.heading')}\r\n \r\n setErrorString('')}\r\n sx={{ color: (theme) => theme.palette.common.white }}\r\n >\r\n \r\n \r\n >\r\n }\r\n >\r\n {errorString}\r\n \r\n )}\r\n \r\n\r\n \r\n >\r\n )\r\n }}\r\n \r\n >\r\n )\r\n}\r\n","export default __webpack_public_path__ + \"static/media/facebook.09ce2980607072276cc5d0521eaec15e.svg\";","export default __webpack_public_path__ + \"static/media/google.86682d98ec7253f9f5e8e3dfef6541cf.svg\";","export default __webpack_public_path__ + \"static/media/linkedin.e4a53b6e851f3cd89f73d5c158a98739.svg\";","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { useMemo } from 'react';\nimport { Box, IconButton, Link, Stack, styled, Typography, useTheme } from '@mui/material';\nimport { SocialLoginType, useIsClientFlexTrack } from '@procom-labs/common';\nimport FacebookSvg from '@common-assets/svg/social/facebook.svg';\nimport GoogleSvg from '@common-assets/svg/social/google.svg';\nimport LinkedInSvg from '@common-assets/svg/social/linkedin.svg';\nvar SocialButton = styled(Link, {})(function() {\n return {\n cursor: 'pointer',\n width: '40px',\n height: '40px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n };\n});\nexport var SocialMediaButtonGroup = function(param) {\n var storageUrl = param.storageUrl, handleClick = param.handleClick, _param_socialLoginTypes = param.socialLoginTypes, socialLoginTypes = _param_socialLoginTypes === void 0 ? [\n SocialLoginType.Google,\n SocialLoginType.Facebook,\n SocialLoginType.Linkedin\n ] : _param_socialLoginTypes;\n var theme = useTheme();\n var isClientFlexTrack = useIsClientFlexTrack();\n var filteredSocialLoginTypes = isClientFlexTrack ? socialLoginTypes.filter(function(type) {\n return type !== SocialLoginType.Linkedin;\n }) : socialLoginTypes;\n var socialList = useMemo(function() {\n return [\n {\n name: SocialLoginType.Google,\n svg: /*#__PURE__*/ _jsx(\"svg\", {\n \"data-src\": GoogleSvg,\n \"data-loading\": \"lazy\",\n style: {\n fill: theme.palette.primary.main\n }\n })\n },\n {\n name: SocialLoginType.Facebook,\n svg: /*#__PURE__*/ _jsx(\"svg\", {\n \"data-src\": FacebookSvg,\n \"data-loading\": \"lazy\",\n style: {\n fill: theme.palette.primary.main\n }\n })\n },\n {\n name: SocialLoginType.Linkedin,\n svg: /*#__PURE__*/ _jsx(\"svg\", {\n \"data-src\": LinkedInSvg,\n \"data-loading\": \"lazy\",\n style: {\n fill: theme.palette.primary.main\n }\n })\n }\n ];\n }, [\n theme.palette.primary.main\n ]);\n return /*#__PURE__*/ _jsx(Stack, {\n direction: \"row\",\n spacing: 2.5,\n justifyContent: \"center\",\n children: filteredSocialLoginTypes.map(function(socialLoginType) {\n return /*#__PURE__*/ _jsx(SocialButton, {\n onClick: function() {\n return handleClick(socialLoginType);\n },\n sx: _object_spread({}, socialLoginType === SocialLoginType.Microsoft && {\n flex: 1,\n textDecoration: 'unset'\n }),\n children: socialLoginType !== SocialLoginType.Microsoft ? socialList.map(function(socialListItem) {\n if (socialListItem.name === socialLoginType) {\n return /*#__PURE__*/ _jsx(IconButton, {\n children: socialListItem.svg\n }, socialListItem.name);\n }\n return null;\n }) : /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(Box, {\n component: \"img\",\n alt: socialLoginType,\n src: \"\".concat(storageUrl, \"/procom-portal-assets/icons/\").concat(socialLoginType.toLocaleLowerCase(), \".png\")\n }),\n /*#__PURE__*/ _jsx(Typography, {\n component: \"p\",\n variant: \"subtitle1\",\n ml: 1,\n children: \"Microsoft 365\"\n })\n ]\n })\n }, socialLoginType);\n })\n });\n};\n","import React, { useCallback, useMemo } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useSearchParams } from 'react-router-dom'\r\n\r\nimport { Box, Typography } from '@mui/material'\r\nimport {\r\n openPopupWindow,\r\n popupWindowNames,\r\n SocialLoginType,\r\n SocialRoutes,\r\n useSubjectSelector,\r\n} from '@procom-labs/common'\r\nimport { SocialMediaButtonGroup } from '@procom-labs/molecules'\r\n\r\nimport { environment } from '@auth-portal/environment'\r\nimport { authStore } from '@auth-portal/store'\r\nimport { SocialLoginContext } from '@auth-portal/types'\r\n\r\nexport const SocialMediaLogin: React.FC<{\r\n context: SocialLoginContext\r\n}> = ({ context }) => {\r\n const [searchParams] = useSearchParams()\r\n const { t } = useTranslation('main')\r\n const campaignId = searchParams.get('campaignId')\r\n\r\n const { authConfigOptions } = useSubjectSelector(authStore, [\r\n 'authConfigOptions',\r\n ])\r\n\r\n const socialLoginTypes = useMemo(() => {\r\n if (authConfigOptions) {\r\n const { socialMediaOptions } = authConfigOptions\r\n return socialMediaOptions.map(\r\n (option) => SocialLoginType[option as keyof typeof SocialLoginType]\r\n )\r\n }\r\n return []\r\n }, [authConfigOptions])\r\n\r\n const handleSocialMediaLogin = useCallback(\r\n (socialLoginType: SocialLoginType) => {\r\n localStorage.setItem('socialLoginContext', context)\r\n localStorage.setItem('socialLoginType', socialLoginType)\r\n\r\n const state = window.btoa(\r\n encodeURIComponent(\r\n JSON.stringify({\r\n campaignId: campaignId || '',\r\n })\r\n )\r\n )\r\n\r\n const socialLinkHref =\r\n socialLoginType === SocialLoginType.Linkedin\r\n ? `${\r\n environment.LINKEDIN.AUTH_URL\r\n }/authorization?response_type=code&client_id=${\r\n environment.LINKEDIN.CLIENT_ID\r\n }&redirect_uri=${encodeURIComponent(\r\n window.location.origin\r\n )}/signin-linkedin-callback&scope=r_liteprofile%20r_emailaddress%20w_member_social&state=${state}`\r\n : // eslint-disable-next-line max-len\r\n `${environment.cognito.AWS_AUTH_URL}/oauth2/authorize?client_id=${environment.cognito.AWS_CLIENT_ID}&response_type=code&scope=email+openid+phone+profile&redirect_uri=${window.location.origin}/${SocialRoutes.SocialCallbackURL}&identity_provider=${socialLoginType}&state=${state}`\r\n\r\n openPopupWindow(socialLinkHref, popupWindowNames.SocialLogin)\r\n },\r\n [campaignId, context]\r\n )\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {authConfigOptions?.isEmailLoginAllowed &&\r\n socialLoginTypes.length > 0 && (\r\n \r\n {t('form.contractorSignup.or')}\r\n \r\n )}\r\n >\r\n )\r\n}\r\n","import React, { useEffect, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Link, useSearchParams } from 'react-router-dom'\r\n\r\nimport { Box, Button, Typography } from '@mui/material'\r\nimport { GorillaAlert } from '@procom-labs/atoms'\r\nimport { useRollbarInstance } from '@procom-labs/common'\r\n\r\nimport { SocialLoginContext } from '@auth-portal/types'\r\n\r\nimport { Header } from './header'\r\nimport { LoginLink } from './login-link'\r\nimport { SocialMediaLogin } from './social-media-login'\r\nimport { TermsAndConditions } from './terms-and-conditions'\r\n\r\nexport const SignupMethods: React.FC<{}> = () => {\r\n const rollbarInstance = useRollbarInstance()\r\n\r\n const { t } = useTranslation('main')\r\n const [errorString, setErrorString] = useState(undefined)\r\n const [searchParams] = useSearchParams()\r\n const campaignId = searchParams.get('campaignId')\r\n\r\n useEffect(() => {\r\n const signupFailed = searchParams.get('error') === 'signupFailed'\r\n const loginFailed = searchParams.get('error') === 'loginFailed'\r\n const invalidEmailDomain =\r\n searchParams.get('error') === 'invalidEmailDomain'\r\n\r\n if (signupFailed) {\r\n rollbarInstance.error('Error: The sign up failed.')\r\n setErrorString(t('common.alert.somethingWrong'))\r\n }\r\n if (loginFailed) {\r\n rollbarInstance.error('Error: The login failed.')\r\n setErrorString(t('common.alert.somethingWrong'))\r\n }\r\n if (invalidEmailDomain) {\r\n rollbarInstance.error('Error: The email domain is invalid.')\r\n setErrorString(t('form.login.alerts.invalidEmailDomain'))\r\n }\r\n }, [searchParams, t])\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {t('form.createAccount.headingWithSocial')}\r\n \r\n {errorString && (\r\n \r\n {errorString}\r\n \r\n )}\r\n\r\n \r\n \r\n {t('form.email.label')}\r\n \r\n \r\n\r\n \r\n {t('form.contractorSignup.or')}\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n >\r\n )\r\n}\r\n","import React, { useCallback, useEffect } from 'react'\r\nimport { useGoogleReCaptcha } from 'react-google-recaptcha-v3'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate, useSearchParams } from 'react-router-dom'\r\nimport { concat, from, Subscription, switchMap } from 'rxjs'\r\n\r\nimport { Typography } from '@mui/material'\r\nimport { Preloader } from '@procom-labs/atoms'\r\nimport {\r\n ClientQueryParams,\r\n CommonMessages,\r\n RecaptchaActions,\r\n useRollbarInstance,\r\n} from '@procom-labs/common'\r\n\r\nimport { Header } from '@auth-portal/components/header'\r\nimport { environment } from '@auth-portal/environment'\r\nimport { useAuthService } from '@auth-portal/hooks'\r\n\r\nexport const ActivateFboInvitation: React.FC<{}> = () => {\r\n const [searchParams] = useSearchParams()\r\n const { t } = useTranslation('main')\r\n const navigate = useNavigate()\r\n\r\n const authService = useAuthService()\r\n const rollbarInstance = useRollbarInstance()\r\n\r\n const { executeRecaptcha } = useGoogleReCaptcha()\r\n const emailParam = searchParams.get('email')\r\n const migrationToken = searchParams.get('migrationToken')\r\n const tenantParam = searchParams.get('tenant')\r\n const onboardingCodeParam = searchParams.get('onboardingCode')\r\n const destinationUrlParam = searchParams.get('destinationURL')\r\n\r\n const getRecaptchaToken = useCallback(async (): Promise => {\r\n if (!executeRecaptcha) {\r\n throw new Error('executeRecaptcha is not ready')\r\n }\r\n try {\r\n return await executeRecaptcha(RecaptchaActions.ActivateFboMapping)\r\n } catch (e: any) {\r\n rollbarInstance.error(e)\r\n return ''\r\n }\r\n }, [executeRecaptcha])\r\n\r\n useEffect(() => {\r\n let subscription = new Subscription()\r\n if (\r\n emailParam &&\r\n tenantParam &&\r\n executeRecaptcha &&\r\n (migrationToken || onboardingCodeParam)\r\n ) {\r\n const email = decodeURIComponent(emailParam)\r\n\r\n subscription = from(getRecaptchaToken())\r\n .pipe(\r\n switchMap((token) =>\r\n concat(\r\n authService.activateFboUserMapping(\r\n migrationToken,\r\n onboardingCodeParam,\r\n email,\r\n token,\r\n tenantParam\r\n ),\r\n authService.verifyEmail({\r\n email,\r\n migrationToken,\r\n onboardingCode: onboardingCodeParam,\r\n })\r\n )\r\n )\r\n )\r\n .subscribe({\r\n complete: () => {\r\n if (destinationUrlParam) {\r\n localStorage.setItem(\r\n ClientQueryParams.destinationURL,\r\n destinationUrlParam\r\n )\r\n }\r\n navigate('/')\r\n },\r\n error: (err) => {\r\n rollbarInstance.error(err)\r\n navigate(`/?error=${CommonMessages.SomethingWrong}`)\r\n },\r\n })\r\n }\r\n\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [\r\n executeRecaptcha,\r\n getRecaptchaToken,\r\n navigate,\r\n emailParam,\r\n migrationToken,\r\n ])\r\n\r\n if (environment.IS_FBO_INVITATION_SIGNUP_MAINTENANCE_ENABLED === 'true') {\r\n return (\r\n \r\n \r\n \r\n {t('form.completeRegistration.maintenanceContent')}\r\n \r\n
\r\n )\r\n }\r\n\r\n return \r\n}\r\n","export default __webpack_public_path__ + \"static/media/not-found.ce1061c5632d070072fd8bd1ed48c49c.svg\";","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button, Grid, Stack, Typography } from '@mui/material';\nimport NotFoundSVG from '@common-assets/svg/not-found.svg';\nexport var PageNotFoundContent = function(param) {\n var _param_showHomeButton = param.showHomeButton, showHomeButton = _param_showHomeButton === void 0 ? true : _param_showHomeButton;\n var t = useTranslation('main').t;\n return /*#__PURE__*/ _jsxs(Stack, {\n sx: {\n minHeight: '70vh',\n justifyContent: 'center',\n alignItems: 'center'\n },\n spacing: 5,\n children: [\n /*#__PURE__*/ _jsx(Grid, {\n container: true,\n item: true,\n xs: 12,\n justifyContent: \"center\",\n alignItems: \"center\",\n children: /*#__PURE__*/ _jsx(\"svg\", {\n style: {\n height: 300,\n width: 384\n },\n \"data-src\": NotFoundSVG,\n \"data-loading\": \"lazy\"\n })\n }),\n showHomeButton && /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(Typography, {\n variant: \"subtitle1\",\n paragraph: true,\n children: t('organisms.pageNotExist')\n }),\n /*#__PURE__*/ _jsx(Button, {\n href: \"/\",\n variant: \"contained\",\n size: \"large\",\n sx: {\n '&:hover': {\n color: '#fff'\n }\n },\n children: t('organisms.backToHomeBtn')\n })\n ]\n })\n ]\n });\n};\n","import React from 'react'\r\nimport { PageNotFoundContent } from '@procom-labs/organisms'\r\nimport { LegalDocumentLayout } from '@auth-portal/components/legal-document-layout'\r\n\r\nexport const PageNotFound: React.FC = () => {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _object_spread_props(target, source) {\n source = source != null ? source : {};\n if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { GorillaAlert } from '../gorilla';\nexport var AlertMessage = function(param) {\n var text = param.text, _param_severity = param.severity, severity = _param_severity === void 0 ? 'error' : _param_severity, sx = param.sx, onClose = param.onClose, children = param.children;\n return /*#__PURE__*/ _jsx(_Fragment, {\n children: /*#__PURE__*/ _jsxs(GorillaAlert, _object_spread_props(_object_spread({\n severity: severity,\n sx: _object_spread({\n mb: 3\n }, sx)\n }, onClose ? {\n onClose: function() {\n if (onClose) onClose();\n }\n } : {}), {\n children: [\n text && text,\n children\n ]\n }))\n });\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport ReactCodeInput from 'react-verification-code-input';\nimport { Box, useTheme } from '@mui/material';\nexport var DigitalCodeInput = function(param) {\n var isVerifying = param.isVerifying, handleVerifyCode = param.handleVerifyCode;\n var theme = useTheme();\n return /*#__PURE__*/ _jsx(Box, {\n sx: {\n '& .code-input-ctn': {\n maxWidth: 200,\n margin: 'auto'\n }\n },\n children: /*#__PURE__*/ _jsx(Box, {\n sx: {\n '.code-input-ctn': {\n width: '100% !important',\n div: {\n display: 'flex',\n columnGap: 1,\n input: {\n flexBasis: 0,\n flexGrow: 1,\n borderRadius: '4px',\n fontFamily: 'inherit',\n width: '100% !important',\n caretColor: 'currentColor',\n border: \"solid 3px \".concat(theme.palette.primary.light),\n '&:focus': {\n border: \"solid 3px \".concat(theme.palette.primary.main)\n },\n '&:focus + input': {\n borderLeft: \"solid 3px \".concat(theme.palette.primary.light)\n }\n }\n },\n 'div[class*=\"styles_loading\"]': {\n height: '54px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n }\n }\n },\n children: /*#__PURE__*/ _jsx(ReactCodeInput, {\n autoFocus: true,\n className: \"code-input-ctn\",\n loading: isVerifying,\n onComplete: handleVerifyCode,\n fields: 4\n })\n })\n });\n};\n","import React, { useCallback, useState } from 'react'\r\nimport { Form, Formik } from 'formik'\r\nimport { Trans, useTranslation } from 'react-i18next'\r\nimport { Link as RouterLink } from 'react-router-dom'\r\nimport { from } from 'rxjs'\r\n\r\nimport { Box, Button, Divider, Link, Typography } from '@mui/material'\r\nimport { AlertMessage } from '@procom-labs/atoms'\r\nimport { EmailSupportLinks, RecaptchaActions } from '@procom-labs/common'\r\nimport { DigitalCodeInput, useAlert } from '@procom-labs/molecules'\r\n\r\nimport { useAuthService, useRecaptcha } from '@auth-portal/hooks'\r\n\r\ninterface FormValues {\r\n verificationCode: string\r\n}\r\n\r\nconst defaultValues: FormValues = {\r\n verificationCode: '',\r\n}\r\n\r\nconst MAX_LOGIN_ATTEMPTS = 1\r\n\r\nexport const VerifyDigitalCode: React.FC<{ email: string }> = ({ email }) => {\r\n const { t } = useTranslation('main')\r\n const { addAlert } = useAlert()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n\r\n const authService = useAuthService()\r\n\r\n const [initialValues] = useState(defaultValues)\r\n const [otp, setOtp] = useState('')\r\n const [isVerifying, setIsVerifying] = useState(false)\r\n\r\n const handleGenerateOtp = useCallback(\r\n (code: string) => {\r\n from(getRecaptchaToken(RecaptchaActions.CodeSignIn)).subscribe({\r\n next: (token) => {\r\n authService.handleOtpSignIn(code, email, token).subscribe({\r\n next: () => {\r\n authService.redirectToClientPortal({\r\n isOtpLogin: true,\r\n })\r\n },\r\n })\r\n },\r\n })\r\n },\r\n [authService, email, getRecaptchaToken]\r\n )\r\n\r\n const handleVerifyCode = useCallback(\r\n (code: string) => {\r\n setIsVerifying(true)\r\n setOtp(code)\r\n from(getRecaptchaToken(RecaptchaActions.RequestResetPassword)).subscribe({\r\n next: (token) => {\r\n authService.validateOtpSignIn(email, code, token).subscribe({\r\n next: (response) => {\r\n if (response.hasCodeExpired) {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.codeExpired'),\r\n })\r\n } else if (response.hasReachedMaxAttempts) {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.maxAttempts', {\r\n hour: MAX_LOGIN_ATTEMPTS,\r\n }),\r\n })\r\n } else if (response.isCodeValid) {\r\n handleGenerateOtp(code)\r\n } else {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.invalidCode'),\r\n })\r\n }\r\n setIsVerifying(false)\r\n },\r\n error: (error) => {\r\n setIsVerifying(false)\r\n addAlert({\r\n severity: 'error',\r\n message: error.message,\r\n })\r\n },\r\n })\r\n },\r\n })\r\n },\r\n [addAlert, email, getRecaptchaToken, handleGenerateOtp, t]\r\n )\r\n\r\n const handleSubmit = useCallback(() => {\r\n handleVerifyCode(otp)\r\n }, [otp, handleVerifyCode])\r\n\r\n return (\r\n <>\r\n \r\n {t('organisms.mfaLoginCodeVerification.heading')}\r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n {t(`common.alert.verifyDigitalCode`, { email })}\r\n \r\n \r\n\r\n \r\n {() => (\r\n \r\n )}\r\n \r\n \r\n \r\n {t('organisms.mfaLoginCodeVerification.havingTrouble')}\r\n \r\n {t('organisms.mfaLoginCodeVerification.contactUs')}\r\n \r\n \r\n \r\n >\r\n )\r\n}\r\n","export var FormErrorType = /*#__PURE__*/ function(FormErrorType) {\n FormErrorType[\"requiredWithLabel\"] = \"requiredWithLabel\";\n return FormErrorType;\n}({});\nexport var ColumnStateNames = /*#__PURE__*/ function(ColumnStateNames) {\n ColumnStateNames[\"Closed\"] = \"closed\";\n ColumnStateNames[\"Opened\"] = \"opened\";\n return ColumnStateNames;\n}({});\n","import React, { useMemo } from 'react';\nimport { get } from 'lodash-es';\nimport { useTranslation } from 'react-i18next';\nimport { FormErrorType } from '@procom-labs/common';\nexport var useHookFieldError = function(fieldState, label, nestedFieldName) {\n var t = useTranslation('main').t;\n return useMemo(function() {\n var hasErr = Boolean(fieldState.invalid && fieldState.error);\n var errText;\n if (hasErr) {\n var fieldError = nestedFieldName ? get(fieldState.error, nestedFieldName) : fieldState.error;\n if ((fieldError === null || fieldError === void 0 ? void 0 : fieldError.message) === FormErrorType.requiredWithLabel) {\n errText = t('common.validations.requiredFieldError', {\n label: label\n });\n } else {\n errText = (fieldError === null || fieldError === void 0 ? void 0 : fieldError.message) || '';\n }\n }\n return errText;\n }, [\n fieldState.invalid,\n fieldState.error,\n nestedFieldName,\n t,\n label\n ]);\n};\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _object_spread_props(target, source) {\n source = source != null ? source : {};\n if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction _object_without_properties(source, excluded) {\n if (source == null) return {};\n var target = _object_without_properties_loose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _object_without_properties_loose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { useController } from 'react-hook-form';\nimport { FormControl, FormLabel, TextField, Tooltip } from '@mui/material';\nimport { useHookFieldError } from '../../hooks';\nexport var TextHookField = function(_param) {\n var name = _param.name, control = _param.control, InputLabelProps = _param.InputLabelProps, _param_fullWidth = _param.fullWidth, fullWidth = _param_fullWidth === void 0 ? true : _param_fullWidth, _param_allowOnlyDigits = _param.allowOnlyDigits, allowOnlyDigits = _param_allowOnlyDigits === void 0 ? false : _param_allowOnlyDigits, _param_allowCharOnly = _param.allowCharOnly, allowCharOnly = _param_allowCharOnly === void 0 ? false : _param_allowCharOnly, _param_maxDecimalPlaces = _param.maxDecimalPlaces, maxDecimalPlaces = _param_maxDecimalPlaces === void 0 ? 0 : _param_maxDecimalPlaces, _param_digitCount = _param.digitCount, digitCount = _param_digitCount === void 0 ? 0 : _param_digitCount, helperText = _param.helperText, defaultValue = _param.defaultValue, _param_customLabel = _param.customLabel, customLabel = _param_customLabel === void 0 ? true : _param_customLabel, displayValue = _param.displayValue, label = _param.label, disabled = _param.disabled, restProps = _object_without_properties(_param, [\n \"name\",\n \"control\",\n \"InputLabelProps\",\n \"fullWidth\",\n \"allowOnlyDigits\",\n \"allowCharOnly\",\n \"maxDecimalPlaces\",\n \"digitCount\",\n \"helperText\",\n \"defaultValue\",\n \"customLabel\",\n \"displayValue\",\n \"label\",\n \"disabled\"\n ]);\n var _useController = useController({\n name: name,\n control: control,\n defaultValue: defaultValue\n }), _useController_field = _useController.field, ref = _useController_field.ref, onChange = _useController_field.onChange, onBlur = _useController_field.onBlur, value = _useController_field.value, fieldState = _useController.fieldState, restField = _object_without_properties(_useController.field, [\n \"ref\",\n \"onChange\",\n \"onBlur\",\n \"value\"\n ]);\n var inputTextRef = useRef(null);\n var _useState = _sliced_to_array(useState(false), 2), isTooltipVisible = _useState[0], setIsTooltipVisible = _useState[1];\n var errText = useHookFieldError(fieldState, label);\n var handleChange = useCallback(function(e) {\n var targetValue = '';\n if (allowOnlyDigits) {\n targetValue = String(e.target.value).replace(/\\D/g, '');\n } else if (allowCharOnly) {\n targetValue = e.target.value.replace(/\\d/g, '');\n } else {\n targetValue = e.target.value;\n }\n if (restProps.onChange) {\n restProps.onChange(e);\n }\n if (targetValue && maxDecimalPlaces) {\n var pattern = new RegExp(\"^\\\\d+(\\\\.\\\\d{0,\".concat(maxDecimalPlaces, \"})?$\"));\n return pattern.test(targetValue) ? onChange(targetValue !== null && targetValue !== void 0 ? targetValue : null) : null;\n }\n if (targetValue && digitCount) {\n var pattern1 = new RegExp(\"^\\\\d{0,\".concat(digitCount, \"}$\"));\n return pattern1.test(targetValue) ? onChange(targetValue !== null && targetValue !== void 0 ? targetValue : null) : null;\n }\n if (restProps.type === 'number') {\n return onChange(targetValue || null);\n }\n return onChange(targetValue);\n }, [\n allowOnlyDigits,\n allowCharOnly,\n restProps,\n maxDecimalPlaces,\n digitCount,\n onChange\n ]);\n var handleBlur = useCallback(function(e) {\n var _restProps_onBlur;\n if (value && restProps.type !== 'number') {\n onChange(value === null || value === void 0 ? void 0 : value.trim());\n }\n onBlur();\n (_restProps_onBlur = restProps.onBlur) === null || _restProps_onBlur === void 0 ? void 0 : _restProps_onBlur.call(restProps, e);\n }, [\n onBlur,\n onChange,\n restProps,\n value\n ]);\n var handleWheel = useCallback(function(e) {\n var target = e.target;\n if (target.type === 'number') {\n target.blur();\n }\n }, []);\n useEffect(function() {\n var text = inputTextRef.current;\n if (text) {\n var isOverflowing = text.scrollWidth > text.offsetWidth;\n setIsTooltipVisible(isOverflowing);\n }\n }, [\n value\n ]);\n var _ref;\n return /*#__PURE__*/ _jsxs(FormControl, {\n disabled: disabled,\n required: restProps.required,\n fullWidth: fullWidth,\n error: !!(fieldState.invalid && errText),\n children: [\n customLabel && label ? /*#__PURE__*/ _jsx(FormLabel, {\n sx: InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.sx,\n htmlFor: name,\n children: label\n }) : null,\n /*#__PURE__*/ _jsx(Tooltip, {\n title: isTooltipVisible ? value : '',\n children: /*#__PURE__*/ _jsx(TextField, _object_spread_props(_object_spread({\n id: name,\n fullWidth: fullWidth\n }, restProps, restField), {\n label: !customLabel ? label : '',\n value: (_ref = displayValue !== null && displayValue !== void 0 ? displayValue : value) !== null && _ref !== void 0 ? _ref : '',\n onChange: handleChange,\n onBlur: handleBlur,\n InputProps: _object_spread({\n readOnly: disabled,\n 'aria-disabled': disabled\n }, restProps.InputProps),\n InputLabelProps: _object_spread_props(_object_spread({}, InputLabelProps), {\n shrink: (InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.shrink) === false ? undefined : true\n }),\n error: !!(fieldState.invalid && errText),\n helperText: errText !== null && errText !== void 0 ? errText : helperText,\n inputRef: function(input) {\n inputTextRef.current = input;\n ref(input);\n },\n onWheelCapture: handleWheel\n }))\n })\n ]\n });\n};\n","export var LocalStorageAttributes = /*#__PURE__*/ function(LocalStorageAttributes) {\n LocalStorageAttributes[\"IsResumeCopilotConsentGiven\"] = \"isResumeCopilotConsentGiven\";\n return LocalStorageAttributes;\n}({});\nvar LoginTypeAllowedAttributes = {\n Contractor: [\n 'isResumeCopilotConsentGiven'\n ],\n Client: [\n ''\n ],\n Employer: [\n ''\n ],\n Customer: [\n ''\n ],\n Support: [\n ''\n ],\n GorillaResume: [\n ''\n ]\n};\nvar isAttributeExists = function(attribute) {\n var _LoginTypeAllowedAttributes_loginType;\n var loginType = localStorage.getItem('loginType');\n return (_LoginTypeAllowedAttributes_loginType = LoginTypeAllowedAttributes[loginType]) === null || _LoginTypeAllowedAttributes_loginType === void 0 ? void 0 : _LoginTypeAllowedAttributes_loginType.includes(attribute);\n};\nexport var setProtectedLocalStorageAttribute = function(attribute, value) {\n if (isAttributeExists(attribute)) {\n localStorage.setItem(attribute, value);\n }\n};\nexport var removeProtectedLocalStorageAttribute = function(attribute) {\n if (isAttributeExists(attribute)) {\n localStorage.removeItem(attribute);\n }\n};\n","import React, { FC, useEffect, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useSearchParams } from 'react-router-dom'\r\n\r\nimport CloseIcon from '@mui/icons-material/Close'\r\nimport { AlertProps } from '@mui/lab'\r\nimport { AlertTitle, IconButton } from '@mui/material'\r\nimport { GorillaAlert } from '@procom-labs/atoms'\r\nimport {\r\n CommonMessages,\r\n LocalStorageAttributes,\r\n removeProtectedLocalStorageAttribute,\r\n} from '@procom-labs/common'\r\n\r\ninterface ICustomProps extends AlertProps {\r\n handleAlertClose?: () => void\r\n}\r\nconst CustomAlert: FC = React.memo(\r\n ({ handleAlertClose, children, ...props }) => {\r\n const { t } = useTranslation('main')\r\n\r\n return (\r\n \r\n \r\n \r\n ) : null\r\n }\r\n >\r\n {children}\r\n \r\n )\r\n }\r\n)\r\n\r\nexport const ScreenAlert: FC = () => {\r\n const [searchParams] = useSearchParams()\r\n const { t } = useTranslation('main')\r\n\r\n const [userHasLoggedOut, setUserHasLoggedOut] = useState(false)\r\n const [userSessionExpired, setUserSessionExpired] = useState(false)\r\n const [userNotAllowed, setUserNotAllowed] = useState(false)\r\n const [userHasAccount, setUserHasAccount] = useState(false)\r\n const [emailVerified, setEmailVerified] = useState(false)\r\n const [newPassword, setNewPassword] = useState(false)\r\n const [errorString, setErrorString] = useState(undefined)\r\n\r\n useEffect(() => {\r\n if (searchParams.get('accountExists')) setUserHasAccount(true)\r\n if (searchParams.get('emailVerified')) setEmailVerified(true)\r\n if (searchParams.get('new-password')) setNewPassword(true)\r\n\r\n if (searchParams.get('logout')) setUserHasLoggedOut(true)\r\n else if (searchParams.get('sessionExpired')) {\r\n removeProtectedLocalStorageAttribute(\r\n LocalStorageAttributes.IsResumeCopilotConsentGiven\r\n )\r\n setUserSessionExpired(true)\r\n } else if (searchParams.get('notAllowed')) setUserNotAllowed(true)\r\n\r\n const errorParam = searchParams.get('error') || ''\r\n if (\r\n [\r\n CommonMessages.SomethingWrong.toString(),\r\n CommonMessages.LoginFailed.toString(),\r\n ].includes(errorParam)\r\n ) {\r\n setErrorString(t('common.alert.somethingWrong'))\r\n }\r\n if (errorParam === CommonMessages.InvalidEmailDomain.toString()) {\r\n setErrorString(t('form.login.alerts.invalidEmailDomain'))\r\n }\r\n }, [t, searchParams])\r\n\r\n return (\r\n <>\r\n {emailVerified && (\r\n \r\n {t('form.login.alerts.verified')}\r\n \r\n )}\r\n\r\n {userHasLoggedOut && (\r\n setUserHasLoggedOut(false)}\r\n >\r\n {t('form.login.alerts.logout')}\r\n \r\n )}\r\n\r\n {userNotAllowed && (\r\n setUserNotAllowed(false)}\r\n >\r\n {t('form.login.alerts.notAllowed')}\r\n \r\n )}\r\n\r\n {userSessionExpired && (\r\n \r\n {t('form.login.alerts.sessionExpired')}\r\n \r\n )}\r\n\r\n {newPassword && (\r\n \r\n {t('form.login.alerts.resetPassword')}\r\n \r\n )}\r\n\r\n {!!errorString && (\r\n \r\n {errorString}\r\n \r\n )}\r\n\r\n {userHasAccount && (\r\n \r\n {t('form.login.alerts.accountExistsTitle')} \r\n {t('form.login.alerts.accountExists')}\r\n \r\n )}\r\n >\r\n )\r\n}\r\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction _object_without_properties(source, excluded) {\n if (source == null) return {};\n var target = _object_without_properties_loose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _object_without_properties_loose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport MaskedInput from 'react-text-mask';\nvar defaultMask = [\n '(',\n /[1-9]/,\n /\\d/,\n /\\d/,\n ')',\n ' ',\n /\\d/,\n /\\d/,\n /\\d/,\n '-',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/\n];\nexport var PhoneInput = /*#__PURE__*/ React.forwardRef(function(_param, inputRef) {\n var maskArray = _param.maskArray, inputProps = _object_without_properties(_param, [\n \"maskArray\"\n ]);\n return /*#__PURE__*/ _jsx(MaskedInput, _object_spread({\n ref: function(ref) {\n inputRef(ref ? ref.inputElement : null);\n },\n mask: maskArray || defaultMask\n }, inputProps));\n});\n","import React from 'react'\r\nimport { useFormContext } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nimport { LoadingButton } from '@mui/lab'\r\nimport { Grid, InputAdornment } from '@mui/material'\r\nimport { PhoneInput, TextHookField } from '@procom-labs/molecules'\r\n\r\nimport { Header } from '@auth-portal/components/header'\r\nimport { LandingFormValues } from '@auth-portal/types'\r\n\r\nexport const HmCreationForm: React.FC<{\r\n isLoading: boolean\r\n}> = ({ isLoading }) => {\r\n const { t } = useTranslation('main')\r\n const {\r\n control,\r\n formState: { isSubmitting },\r\n } = useFormContext()\r\n return (\r\n \r\n \r\n\r\n \r\n \r\n\r\n +1,\r\n }}\r\n InputLabelProps={{\r\n shrink: false,\r\n }}\r\n />\r\n\r\n \r\n {t('common.btn.submit')}\r\n \r\n \r\n )\r\n}\r\n","export var SubmissionTrackingStatus = /*#__PURE__*/ function(SubmissionTrackingStatus) {\n SubmissionTrackingStatus[\"Submitted\"] = \"true\";\n SubmissionTrackingStatus[\"Failed\"] = \"false\";\n return SubmissionTrackingStatus;\n}({});\n","import {\r\n gtmEvents,\r\n ITrackingPanel,\r\n SubmissionTrackingStatus,\r\n} from '@procom-labs/common'\r\n\r\nimport { ISsoLoginTrackingData } from '@auth-portal/types'\r\nimport { AccountInfo } from '@azure/msal-browser'\r\n\r\nexport const ssoLoginTrackingDate = (\r\n account: AccountInfo,\r\n submissionStatus = SubmissionTrackingStatus.Submitted,\r\n trackingProps: ITrackingPanel = {}\r\n): ISsoLoginTrackingData => {\r\n const {\r\n isGTMTracking = true,\r\n isMixPanelTracking = true,\r\n isTrackingEnabled = true,\r\n } = trackingProps\r\n return {\r\n eventName: gtmEvents.FormMsSSOLogin,\r\n submissionStatus,\r\n email: account.username,\r\n name: account.name ?? '',\r\n loginType: 'MS_SSO_Login',\r\n isGTMTracking,\r\n isMixPanelTracking,\r\n isTrackingEnabled,\r\n }\r\n}\r\n","import { useCallback } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { from, interval, Observable, switchMap, takeWhile, tap } from 'rxjs'\r\n\r\nimport {\r\n errorToString,\r\n SubmissionTrackingStatus,\r\n UnProtectedLinksEnum,\r\n useSubscriptionRef,\r\n} from '@procom-labs/common'\r\n\r\nimport { loginRequest } from '@auth-portal/config'\r\nimport { ssoLoginTrackingDate } from '@auth-portal/util/get-tracking-data'\r\nimport { useMsal } from '@azure/msal-react'\r\n\r\nimport { useAuthService } from './use-auth-service'\r\nimport { useTrackingWrapper } from './use-tracking-wrapper'\r\n\r\ntype HandleErrorMessageType = (error?: string) => void\r\ninterface IMsSsoLoginResult {\r\n handleMsSsoLogin: (\r\n handleErrorMessages?: HandleErrorMessageType\r\n ) => Promise\r\n handleMsSsoRedirect: () => Observable<{\r\n idToken?: string\r\n responseReceived: boolean\r\n }>\r\n}\r\n\r\nexport const useMsSsoLogin = (): IMsSsoLoginResult => {\r\n const { t } = useTranslation('main')\r\n const { instance, accounts } = useMsal()\r\n const navigate = useNavigate()\r\n\r\n const authService = useAuthService()\r\n\r\n const { track } = useTrackingWrapper()\r\n const ssoLoginSubscriptionRef = useSubscriptionRef()\r\n\r\n const handleMsSsoLogin = useCallback(\r\n async (handleErrorMessages?: HandleErrorMessageType): Promise => {\r\n handleErrorMessages?.(undefined)\r\n if (accounts.length === 1) {\r\n try {\r\n const tokenResponse = await instance.acquireTokenSilent({\r\n ...loginRequest,\r\n account: accounts[0],\r\n })\r\n const { idToken } = tokenResponse\r\n if (idToken) {\r\n ssoLoginSubscriptionRef.current = authService\r\n .microsoftSSOLogin(idToken)\r\n .subscribe({\r\n complete: () => track(ssoLoginTrackingDate(accounts[0])),\r\n })\r\n }\r\n } catch (tokenSilentError) {\r\n track({\r\n ...ssoLoginTrackingDate(\r\n accounts[0],\r\n SubmissionTrackingStatus.Failed\r\n ),\r\n errorMessage: errorToString(tokenSilentError),\r\n })\r\n handleErrorMessages?.(t('somethingWrong')) // setting error message in login-form\r\n navigate(UnProtectedLinksEnum.Login)\r\n }\r\n } else {\r\n await instance.loginRedirect(loginRequest)\r\n }\r\n },\r\n [accounts, instance, ssoLoginSubscriptionRef, track, t, navigate]\r\n )\r\n\r\n const handleRedirectResponse = useCallback((): Observable<{\r\n idToken?: string\r\n responseReceived: boolean\r\n }> => {\r\n return from(\r\n (async (): Promise<{ idToken?: string; responseReceived: boolean }> => {\r\n try {\r\n const response = await instance.handleRedirectPromise()\r\n if (response) {\r\n const { idToken } = response\r\n if (idToken) {\r\n return { idToken, responseReceived: true }\r\n }\r\n }\r\n return { responseReceived: false }\r\n } catch (error) {\r\n return { responseReceived: false }\r\n }\r\n })()\r\n )\r\n }, [instance])\r\n\r\n const handleMsSsoRedirect = useCallback((): Observable<{\r\n idToken?: string\r\n responseReceived: boolean\r\n }> => {\r\n // sometime microsoft redirect user to fallback screen before token is available, so we need to check for token in interval\r\n return interval(1000).pipe(\r\n switchMap(() => handleRedirectResponse()),\r\n takeWhile(({ responseReceived }) => !responseReceived, true),\r\n tap(({ idToken, responseReceived }) => {\r\n if (responseReceived && idToken) {\r\n ssoLoginSubscriptionRef.current = authService\r\n .microsoftSSOLogin(idToken)\r\n .subscribe({\r\n complete: () => track(ssoLoginTrackingDate(accounts[0])),\r\n })\r\n }\r\n })\r\n )\r\n }, [accounts, handleRedirectResponse, ssoLoginSubscriptionRef, track])\r\n\r\n return {\r\n handleMsSsoLogin,\r\n handleMsSsoRedirect,\r\n }\r\n}\r\n","import { FC, memo, useCallback } from 'react'\r\n\r\nimport { Box, Stack, Typography } from '@mui/material'\r\nimport {\r\n errorToString,\r\n gtmEvents,\r\n SocialLoginType,\r\n SubmissionTrackingStatus,\r\n} from '@procom-labs/common'\r\n\r\nimport { environment } from '@auth-portal/environment'\r\nimport { useTrackingWrapper } from '@auth-portal/hooks'\r\nimport { useMsSsoLogin } from '@auth-portal/hooks/use-ms-sso-login'\r\n\r\ninterface IMicrosoftLoginButtonProps {\r\n handleError?: (errorMessage: string | undefined) => void\r\n}\r\n\r\nconst loginButtonText = 'Microsoft 365'\r\n\r\nexport const MicrosoftLoginButton: FC = memo(\r\n ({ handleError }) => {\r\n const { track } = useTrackingWrapper()\r\n const { handleMsSsoLogin } = useMsSsoLogin()\r\n\r\n const handleClick = useCallback(async () => {\r\n try {\r\n await handleMsSsoLogin(handleError)\r\n } catch (error) {\r\n track({\r\n eventName: gtmEvents.FormMsSSOLogin,\r\n submissionStatus: SubmissionTrackingStatus.Failed,\r\n loginType: 'MS_SSO_Login',\r\n isGTMTracking: true,\r\n isMixPanelTracking: true,\r\n isTrackingEnabled: true,\r\n errorMessage: errorToString(error),\r\n })\r\n }\r\n }, [track, handleError, handleMsSsoLogin])\r\n\r\n return (\r\n \r\n \r\n \r\n {loginButtonText}\r\n \r\n \r\n )\r\n }\r\n)\r\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _object_spread_props(target, source) {\n source = source != null ? source : {};\n if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction _object_without_properties(source, excluded) {\n if (source == null) return {};\n var target = _object_without_properties_loose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _object_without_properties_loose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useCallback } from 'react';\nimport { useController } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { FormControl, FormControlLabel, FormHelperText, FormLabel, Radio, RadioGroup, Stack, styled, Typography } from '@mui/material';\nimport { stringToBoolean } from '@procom-labs/common';\nimport { useHookFieldError } from '../../hooks';\n// Todo: Move to shared location\nvar CustomFormLabel = styled(FormLabel)(function(param) {\n var theme = param.theme;\n return {\n color: theme.palette.text.primary,\n marginBottom: '1rem'\n };\n});\nexport var RadioGroupValueType = /*#__PURE__*/ function(RadioGroupValueType) {\n RadioGroupValueType[\"String\"] = \"string\";\n RadioGroupValueType[\"Number\"] = \"number\";\n RadioGroupValueType[\"Boolean\"] = \"boolean\";\n return RadioGroupValueType;\n}({});\nexport var RadioGroupOptions = /*#__PURE__*/ function(RadioGroupOptions) {\n RadioGroupOptions[\"Yes\"] = \"common.inputs.yes\";\n RadioGroupOptions[\"No\"] = \"common.inputs.no\";\n return RadioGroupOptions;\n}({});\nexport var radioGroupDefaultOptions = [\n {\n label: \"common.inputs.yes\",\n value: true\n },\n {\n label: \"common.inputs.no\",\n value: false\n }\n];\nexport var RadioGroupHookInput = function(_param) {\n var control = _param.control, name = _param.name, label = _param.label, onChange = _param.onChange, _param_required = _param.required, required = _param_required === void 0 ? true : _param_required, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_options = _param.options, options = _param_options === void 0 ? radioGroupDefaultOptions : _param_options, _param_valueType = _param.valueType, valueType = _param_valueType === void 0 ? \"boolean\" : _param_valueType, formLabelSx = _param.formLabelSx, defaultValue = _param.defaultValue, _param_helperTextEnabled = _param.helperTextEnabled, helperTextEnabled = _param_helperTextEnabled === void 0 ? true : _param_helperTextEnabled, radioSx = _param.radioSx, rest = _object_without_properties(_param, [\n \"control\",\n \"name\",\n \"label\",\n \"onChange\",\n \"required\",\n \"disabled\",\n \"options\",\n \"valueType\",\n \"formLabelSx\",\n \"defaultValue\",\n \"helperTextEnabled\",\n \"radioSx\"\n ]);\n var t = useTranslation().t;\n var _useController = useController({\n name: name,\n control: control,\n defaultValue: defaultValue\n }), ref = _useController.field.ref, fieldState = _useController.fieldState, restField = _object_without_properties(_useController.field, [\n \"ref\"\n ]);\n var errText = useHookFieldError(fieldState, label);\n var handleChange = useCallback(function(event, value) {\n var val = value;\n if (valueType === \"boolean\") {\n val = stringToBoolean(value);\n } else if (valueType === \"number\") {\n val = +value;\n }\n if (onChange) {\n onChange(event, val);\n } else {\n restField.onChange(val);\n }\n restField.onBlur();\n }, [\n onChange,\n restField,\n valueType\n ]);\n return /*#__PURE__*/ _jsxs(FormControl, {\n required: required,\n error: !!(fieldState.invalid && fieldState.error),\n children: [\n label ? /*#__PURE__*/ _jsx(CustomFormLabel, {\n className: \"remove-focus\",\n sx: _object_spread({}, formLabelSx),\n id: \"\".concat(name, \"-label\"),\n children: label\n }) : null,\n /*#__PURE__*/ _jsx(RadioGroup, _object_spread_props(_object_spread({}, restField, rest), {\n \"aria-labelledby\": \"\".concat(name, \"-label\"),\n \"aria-disabled\": disabled,\n value: restField.value === undefined ? null : restField.value,\n onChange: handleChange,\n ref: ref,\n children: options.map(function(opt, index) {\n var _opt_disabled;\n return /*#__PURE__*/ _jsx(FormControlLabel, {\n value: opt.value,\n label: /*#__PURE__*/ _jsxs(Stack, {\n direction: \"column\",\n children: [\n /*#__PURE__*/ _jsx(Typography, {\n variant: \"body1\",\n color: \"inherit\",\n children: t(opt.label)\n }),\n opt.subLabel ? /*#__PURE__*/ _jsx(Typography, {\n variant: \"body2\",\n sx: {\n color: 'text.secondary'\n },\n children: opt.subLabel\n }) : null\n ]\n }),\n control: /*#__PURE__*/ _jsx(Radio, {\n required: required,\n sx: radioSx\n }),\n disabled: (_opt_disabled = opt.disabled) !== null && _opt_disabled !== void 0 ? _opt_disabled : disabled,\n sx: _object_spread({}, formLabelSx)\n }, index);\n })\n })),\n helperTextEnabled && errText ? /*#__PURE__*/ _jsx(FormHelperText, {\n children: errText\n }) : null\n ]\n });\n};\n","import React from 'react'\r\nimport { useFormContext } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nimport { LoadingButton } from '@mui/lab'\r\nimport { Grid, InputAdornment } from '@mui/material'\r\nimport { IAccountType } from '@procom-labs/common'\r\nimport {\r\n PhoneInput,\r\n RadioGroupHookInput,\r\n RadioGroupInputOption,\r\n RadioGroupValueType,\r\n TextHookField,\r\n} from '@procom-labs/molecules'\r\n\r\nimport { Header } from '@auth-portal/components/header'\r\nimport { useLoginTypes } from '@auth-portal/hooks'\r\nimport { LandingFormValues } from '@auth-portal/types'\r\n\r\nconst AccountTypeOptions: RadioGroupInputOption[] = [\r\n {\r\n label: 'form.createAccount.client',\r\n value: IAccountType.Client,\r\n },\r\n {\r\n label: 'form.createAccount.contractor',\r\n value: IAccountType.Contractor,\r\n },\r\n]\r\n\r\nexport const ProfileSelectionForm: React.FC<{ isLoading: boolean }> = ({\r\n isLoading,\r\n}) => {\r\n const { t } = useTranslation('main')\r\n\r\n const {\r\n control,\r\n watch,\r\n formState: { isSubmitting },\r\n } = useFormContext()\r\n\r\n const { isClientLogin } = useLoginTypes()\r\n\r\n const accountType = watch('accountType')\r\n\r\n return (\r\n \r\n \r\n\r\n {isClientLogin && (\r\n \r\n )}\r\n\r\n {accountType && (\r\n <>\r\n \r\n \r\n {accountType === IAccountType.Client && (\r\n <>\r\n +1\r\n ),\r\n }}\r\n InputLabelProps={{\r\n shrink: false,\r\n }}\r\n required\r\n />\r\n \r\n >\r\n )}\r\n >\r\n )}\r\n\r\n \r\n {t('common.btn.continue')}\r\n \r\n \r\n )\r\n}\r\n","import React, { useCallback, useEffect, useMemo, useState } from 'react'\r\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\nimport {\r\n createSearchParams,\r\n useLocation,\r\n useNavigate,\r\n useSearchParams,\r\n} from 'react-router-dom'\r\nimport { finalize, from, switchMap } from 'rxjs'\r\nimport * as yup from 'yup'\r\n\r\nimport { LoadingButton } from '@mui/lab'\r\nimport { Button, Grid, Typography } from '@mui/material'\r\nimport {\r\n AuthProfileType,\r\n ClientQueryParams,\r\n CreateContactPayload,\r\n DEMO_CLIENTS,\r\n DomainDetectionErrors,\r\n errorToString,\r\n getClientCode,\r\n getClientName,\r\n getClientPortalHost,\r\n getVendorCode,\r\n HTTPResponseStatus,\r\n IAccountType,\r\n RecaptchaActions,\r\n useSubjectSelector,\r\n useSubscriptionRef,\r\n validateDemoPortalEmailDomain,\r\n validFirstNameRegex,\r\n validLastNameRegex,\r\n} from '@procom-labs/common'\r\nimport { TextHookField, useAlert } from '@procom-labs/molecules'\r\n\r\nimport { ScreenAlert } from '@auth-portal/components/alert'\r\nimport { Header } from '@auth-portal/components/header'\r\nimport { HmCreationForm } from '@auth-portal/components/hm-creation-form'\r\nimport { MicrosoftLoginButton } from '@auth-portal/components/ms-ss-login-button'\r\nimport { SocialMediaLogin } from '@auth-portal/components/social-media-login'\r\nimport { TermsAndConditions } from '@auth-portal/components/terms-and-conditions'\r\nimport { environment } from '@auth-portal/environment'\r\nimport {\r\n useAuthService,\r\n useIsMsMultiTenantClient,\r\n useIsUserCreationAllowed,\r\n useLoginTypes,\r\n useRecaptcha,\r\n} from '@auth-portal/hooks'\r\nimport { authStore } from '@auth-portal/store'\r\nimport {\r\n FlowRequestType,\r\n LandingFormValues,\r\n SignUpRoutes,\r\n SocialLoginContext,\r\n UserExistResponse,\r\n} from '@auth-portal/types'\r\nimport { getCallbackURL, getOriginBaseUrl } from '@auth-portal/util'\r\nimport { yupResolver } from '@hookform/resolvers/yup'\r\n\r\nimport { ProfileSelectionForm } from './profile-selection-form'\r\n\r\nconst PublicDomainNotAllowed = 'PublicDomainNotAllowed'\r\n\r\nconst FboMaintenance: React.FC = () => {\r\n const { t } = useTranslation('main')\r\n return (\r\n \r\n \r\n \r\n {t('form.completeRegistration.maintenanceContent')}\r\n \r\n
\r\n )\r\n}\r\n\r\nexport const LandingForm: React.FC = () => {\r\n const { addAlert } = useAlert()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const navigate = useNavigate()\r\n const location = useLocation()\r\n const { t, i18n } = useTranslation('main')\r\n\r\n const authService = useAuthService()\r\n const { authConfigOptions } = useSubjectSelector(authStore, [\r\n 'authConfigOptions',\r\n ])\r\n\r\n const [searchParams] = useSearchParams()\r\n const requestType = searchParams.get('requestType')\r\n const emailParam = searchParams.get('email')\r\n const migrationTokenParam = searchParams.get('migrationToken')\r\n const sourceParam = searchParams.get('source')\r\n const tenantParam = searchParams.get('tenant')\r\n const onboardingCodeParam = searchParams.get('onboardingCode')\r\n const isContractorInvite = searchParams.get('isContractorInvite')\r\n const isAnonymousShare = searchParams.get('isAnonymousShare')\r\n const anonymousToken = searchParams.get('token')\r\n const loginTypeParam = searchParams.get(ClientQueryParams.loginType)\r\n const isFboInvite = migrationTokenParam && sourceParam && tenantParam\r\n\r\n const [isLoading, setIsLoading] = useState(false)\r\n const [isDomainDetected, setIsDomainDetected] = useState(false)\r\n const [isMultiSelect, setIsMultiSelect] = useState(false)\r\n const [isFboMigrationTokenValid, setIsFboMigrationTokenValid] =\r\n useState(false)\r\n\r\n const validateSubscriptionRef = useSubscriptionRef()\r\n const publicDomainSubscriptionRef = useSubscriptionRef()\r\n const userSubscriptionRef = useSubscriptionRef()\r\n const otpSubscriptionRef = useSubscriptionRef()\r\n const createSubscriptionRef = useSubscriptionRef()\r\n const fboInviteSubscriptionRef = useSubscriptionRef()\r\n\r\n const { loginType, siteConfig } = useSubjectSelector(authStore, [\r\n 'loginType',\r\n 'siteConfig',\r\n ])\r\n\r\n const { isContractorLogin, isClientLogin, isGorillaResumeLogin } =\r\n useLoginTypes()\r\n\r\n const getProfileType = useCallback((): AuthProfileType | string => {\r\n if (isContractorLogin) return AuthProfileType.Contractor\r\n if (isGorillaResumeLogin) return AuthProfileType.GorillaResumeUser\r\n return ''\r\n }, [isContractorLogin, isGorillaResumeLogin])\r\n\r\n const isUserCreationAllowed = useIsUserCreationAllowed()\r\n const isMSMultiTenantClient = useIsMsMultiTenantClient()\r\n const isProfileAllowedToEnterEmail = authConfigOptions?.isEmailLoginAllowed\r\n\r\n const shouldValidateEmailDomain = useMemo(() => {\r\n const clientName = getClientName()\r\n return DEMO_CLIENTS.includes(clientName)\r\n }, [])\r\n\r\n const validationSchema = useMemo(\r\n () =>\r\n yup.object({\r\n firstName: yup\r\n .string()\r\n .required(t('form.createAccount.firstNameError'))\r\n .matches(\r\n validFirstNameRegex,\r\n t('form.createAccount.lastNameValidation')\r\n ),\r\n lastName: yup\r\n .string()\r\n .required(t('form.createAccount.lastNameError'))\r\n .matches(\r\n validLastNameRegex,\r\n t('form.createAccount.lastNameValidation')\r\n ),\r\n email: yup\r\n .string()\r\n .test(\r\n 'domain-validation',\r\n t('common.form.email.domainNotAllowed'),\r\n (value) => {\r\n if (isGorillaResumeLogin) {\r\n return true\r\n }\r\n return validateDemoPortalEmailDomain(\r\n value,\r\n siteConfig?.companyInternalEmailDomains,\r\n shouldValidateEmailDomain\r\n )\r\n }\r\n ),\r\n }),\r\n [t, shouldValidateEmailDomain, siteConfig, isGorillaResumeLogin]\r\n )\r\n\r\n const formInstance = useForm({\r\n resolver: yupResolver(validationSchema),\r\n ...(shouldValidateEmailDomain\r\n ? {\r\n mode: 'onBlur',\r\n reValidateMode: 'onBlur',\r\n }\r\n : {}),\r\n })\r\n const { control, handleSubmit, setValue, formState } = formInstance\r\n\r\n const email = useWatch({ control, name: 'email' })\r\n const vendorCode = getVendorCode()\r\n\r\n const handleErrorMessages = useCallback(\r\n (errorMessage) => {\r\n addAlert({\r\n severity: 'error',\r\n message: errorMessage,\r\n })\r\n },\r\n [addAlert]\r\n )\r\n\r\n const handleSendOtp = useCallback(\r\n (userResponse: UserExistResponse | null, isNewUser: boolean = false) => {\r\n otpSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.RequestResetPassword)\r\n )\r\n .pipe(\r\n switchMap((recaptcha) =>\r\n authService.generateSignInOtp(\r\n decodeURIComponent(email),\r\n recaptcha,\r\n i18n.language\r\n )\r\n ),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: () => {\r\n if (userResponse) {\r\n const user: UserExistResponse = {\r\n ...userResponse,\r\n profileType: loginType?.toLowerCase() ?? '',\r\n onboardingParam: onboardingCodeParam,\r\n migrationToken: migrationTokenParam,\r\n isFboMigrationTokenValid,\r\n tenantParam,\r\n isNewUser: isNewUser ? 'true' : 'false',\r\n firstLogin: isNewUser ? 'true' : 'false',\r\n }\r\n navigate(\r\n {\r\n pathname: SignUpRoutes.ValidateSignIn,\r\n search: `${createSearchParams({\r\n email,\r\n })}`,\r\n },\r\n {\r\n state: user, // passing user info to login screen\r\n }\r\n )\r\n }\r\n },\r\n error: (error) => {\r\n handleErrorMessages(errorToString(error.message))\r\n },\r\n })\r\n },\r\n [\r\n email,\r\n navigate,\r\n loginType,\r\n getRecaptchaToken,\r\n i18n.language,\r\n otpSubscriptionRef,\r\n tenantParam,\r\n onboardingCodeParam,\r\n migrationTokenParam,\r\n isFboMigrationTokenValid,\r\n handleErrorMessages,\r\n ]\r\n )\r\n\r\n const handleDomainDetection = useCallback(\r\n (emailDomain: string) => {\r\n validateSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.ValidateEmailDomain)\r\n )\r\n .pipe(\r\n switchMap((token) =>\r\n authService.handleCheckClientDomain(\r\n emailDomain,\r\n token,\r\n vendorCode,\r\n getClientCode()\r\n )\r\n ),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n if (response) {\r\n setIsDomainDetected(true)\r\n // If it's not loginRedirect and doesn't have email in params already, then add it\r\n navigate(\r\n {\r\n pathname: location.pathname,\r\n search: !emailParam\r\n ? `${createSearchParams({\r\n email: emailDomain,\r\n })}`\r\n : location.search,\r\n },\r\n {\r\n replace: false,\r\n }\r\n )\r\n } else {\r\n setIsMultiSelect(true)\r\n }\r\n },\r\n error: (error) => {\r\n let message = t('somethingWrong')\r\n const { data } = error.response\r\n if (\r\n data.message === DomainDetectionErrors.ClientCreateNotAllowed ||\r\n data.message === DomainDetectionErrors.ClientSignupNotAllowed\r\n ) {\r\n message = t('form.createAccount.errors.domainAccountsNotAllowed')\r\n }\r\n addAlert({\r\n message,\r\n severity: 'error',\r\n })\r\n },\r\n })\r\n },\r\n [\r\n t,\r\n navigate,\r\n emailParam,\r\n vendorCode,\r\n addAlert,\r\n location.pathname,\r\n location.search,\r\n getRecaptchaToken,\r\n validateSubscriptionRef,\r\n ]\r\n )\r\n\r\n const handlePublicDomainCheck = useCallback(\r\n (emailDomain: string) => {\r\n setIsLoading(true)\r\n publicDomainSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.ValidateEmailDomain)\r\n )\r\n .pipe(\r\n switchMap((token) =>\r\n authService.handlePublicDomainCheck(emailDomain, token)\r\n )\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n if (response) {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.createAccount.errors.publicDomainNotAllowed'),\r\n })\r\n setIsLoading(false)\r\n } else {\r\n handleDomainDetection(emailDomain)\r\n }\r\n },\r\n error: () => {\r\n // For some reason if public domain check fails, still proceed with client detection\r\n handleDomainDetection(emailDomain)\r\n },\r\n })\r\n },\r\n [\r\n t,\r\n addAlert,\r\n getRecaptchaToken,\r\n publicDomainSubscriptionRef,\r\n handleDomainDetection,\r\n ]\r\n )\r\n\r\n const handleUserVerification = useCallback(() => {\r\n if (shouldValidateEmailDomain && formState.errors.email) return\r\n if (email) {\r\n setIsLoading(true)\r\n userSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.GetAnonymousUserInfo)\r\n )\r\n .pipe(\r\n switchMap((token) => authService.getIfUserExist(email, token)),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n if (response) {\r\n handleSendOtp(response)\r\n }\r\n },\r\n error: (error) => {\r\n const { status } = error.response\r\n if (status === HTTPResponseStatus.NotFound) {\r\n if (isClientLogin) {\r\n // HM Signup Flow\r\n handlePublicDomainCheck(email)\r\n } else if (\r\n isUserCreationAllowed &&\r\n (isContractorLogin || isGorillaResumeLogin)\r\n ) {\r\n // Contractor | GorillaResume\r\n setIsMultiSelect(true)\r\n } else {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.accountDoesNotExist'),\r\n })\r\n }\r\n }\r\n },\r\n })\r\n }\r\n }, [\r\n t,\r\n email,\r\n addAlert,\r\n isClientLogin,\r\n isContractorLogin,\r\n isGorillaResumeLogin,\r\n handleSendOtp,\r\n getRecaptchaToken,\r\n userSubscriptionRef,\r\n isUserCreationAllowed,\r\n handlePublicDomainCheck,\r\n formState.errors.email,\r\n shouldValidateEmailDomain,\r\n ])\r\n\r\n const onSubmit = useCallback(\r\n (data: LandingFormValues) => {\r\n setIsLoading(true)\r\n const { firstName, lastName, phoneNumber, companyName, accountType } =\r\n data\r\n\r\n let payload: CreateContactPayload = {\r\n email: data.email ?? emailParam,\r\n lastName,\r\n firstName,\r\n phoneNumber: accountType === IAccountType.Contractor ? '' : phoneNumber,\r\n recaptchaToken: '', // Populated in pipe\r\n requestType: requestType ?? FlowRequestType.signup,\r\n language: i18n.language,\r\n vendorCode: getVendorCode(),\r\n callbackUrl: getCallbackURL(),\r\n originBase: getOriginBaseUrl(),\r\n authPortalBase: window.location.origin,\r\n clientCode: getClientCode(getClientPortalHost()) ?? '',\r\n profileType: getProfileType(),\r\n }\r\n\r\n createSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.Signup)\r\n )\r\n .pipe(\r\n switchMap((token) => {\r\n payload = {\r\n ...payload,\r\n recaptchaToken: token,\r\n companyName:\r\n accountType === IAccountType.Client ? companyName : '',\r\n }\r\n return authService.createContactWithoutPassword(\r\n payload,\r\n accountType ?? IAccountType.Client\r\n )\r\n }),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n // Contractor | GorillaResume\r\n if (accountType && accountType !== IAccountType.Client) {\r\n handleSendOtp(\r\n {\r\n ...response,\r\n } as UserExistResponse,\r\n true\r\n )\r\n } else {\r\n navigate(\r\n {\r\n pathname: SignUpRoutes.ValidateSignIn,\r\n search: `${createSearchParams({\r\n email,\r\n })}`,\r\n },\r\n {\r\n state: {\r\n id: response.id,\r\n firstName,\r\n lastName,\r\n phoneNumber,\r\n profileType: loginType?.toLowerCase(),\r\n } as UserExistResponse,\r\n }\r\n )\r\n }\r\n },\r\n error: (error) => {\r\n const { data: errData } = error.response\r\n let message = t('somethingWrong')\r\n\r\n if (errData.message === PublicDomainNotAllowed) {\r\n message = t('publicDomainsNotAllowed')\r\n } else if (\r\n errData.message ===\r\n DomainDetectionErrors.ClientCreateNotAllowed ||\r\n errData.message === DomainDetectionErrors.ClientSignupNotAllowed\r\n ) {\r\n message = t('form.createAccount.errors.domainAccountsNotAllowed')\r\n }\r\n\r\n addAlert({\r\n message,\r\n severity: 'error',\r\n })\r\n },\r\n })\r\n },\r\n [\r\n t,\r\n email,\r\n navigate,\r\n addAlert,\r\n emailParam,\r\n i18n.language,\r\n getRecaptchaToken,\r\n handleSendOtp,\r\n requestType,\r\n loginType,\r\n getProfileType,\r\n createSubscriptionRef,\r\n ]\r\n )\r\n\r\n const handleKeyDown = useCallback(\r\n (event) => {\r\n if (event.key === 'Enter') {\r\n event.preventDefault()\r\n handleUserVerification()\r\n }\r\n },\r\n [handleUserVerification]\r\n )\r\n\r\n const handleFboInvite = useCallback(\r\n (migrationToken: string, source: string) => {\r\n if (migrationToken && source) {\r\n setIsLoading(true)\r\n fboInviteSubscriptionRef.current = authService\r\n .getUserMigrationInfo(migrationToken, source)\r\n .subscribe({\r\n next: (response: any) => {\r\n setIsLoading(false)\r\n const { data: migrationData } = response\r\n if (!migrationData.isMigrated) {\r\n // Throw error if the FBO user is not migrated yet\r\n handleErrorMessages(\r\n t('fboUserInvitation.theUserIsNotMigratedYet')\r\n )\r\n setIsFboMigrationTokenValid(false)\r\n } else if (migrationData.isActivated) {\r\n // Throw error if the FBO user has been activated\r\n handleErrorMessages(\r\n t('fboUserInvitation.theUserHasBeenActivated')\r\n )\r\n setIsFboMigrationTokenValid(false)\r\n } else {\r\n // Now the FBO migration info is valid.\r\n setIsFboMigrationTokenValid(true)\r\n }\r\n },\r\n error: (err: any) => {\r\n setIsLoading(false)\r\n handleErrorMessages(errorToString(err.response.data))\r\n },\r\n })\r\n }\r\n },\r\n [t, handleErrorMessages, fboInviteSubscriptionRef]\r\n )\r\n\r\n // OB + Contractor + GorillaResume\r\n useEffect(() => {\r\n if (emailParam) {\r\n setValue('email', emailParam)\r\n\r\n // Recruiter invite contractor\r\n // CS invite contractor\r\n // GorillaResume invite user\r\n if (isContractorInvite || onboardingCodeParam || isGorillaResumeLogin) {\r\n handleUserVerification()\r\n }\r\n }\r\n }, [\r\n emailParam,\r\n onboardingCodeParam,\r\n handleUserVerification,\r\n isContractorInvite,\r\n setValue,\r\n isGorillaResumeLogin,\r\n ])\r\n\r\n // FBO - Invitation\r\n useEffect(() => {\r\n const isFboInvitation = migrationTokenParam && sourceParam && tenantParam\r\n if (isFboInvitation) {\r\n handleFboInvite(migrationTokenParam, sourceParam)\r\n }\r\n }, [migrationTokenParam, handleFboInvite, sourceParam, tenantParam])\r\n\r\n // FBO - Handle token validated\r\n useEffect(() => {\r\n if (isFboMigrationTokenValid) {\r\n handleUserVerification()\r\n }\r\n }, [isFboMigrationTokenValid, handleUserVerification])\r\n\r\n useEffect(() => {\r\n if (isClientLogin) {\r\n setValue('accountType', IAccountType.Client)\r\n } else if (isContractorLogin) {\r\n setValue('accountType', IAccountType.Contractor)\r\n } else if (isGorillaResumeLogin) {\r\n setValue('accountType', IAccountType.GorillaResume)\r\n }\r\n }, [isClientLogin, isContractorLogin, isGorillaResumeLogin, setValue])\r\n\r\n // Note: this should not be necessary if all pages comes through initial-route first\r\n useEffect(() => {\r\n if (loginTypeParam && loginTypeParam.toLowerCase() !== loginType) {\r\n localStorage.setItem(ClientQueryParams.loginType, loginTypeParam)\r\n authService.setLoginType()\r\n }\r\n }, [loginTypeParam, loginType])\r\n\r\n // Anonymous share - Redirection\r\n useEffect(() => {\r\n if (isAnonymousShare && anonymousToken) {\r\n authService.redirectToClientPortal({\r\n isAnonymousShare: true,\r\n token: anonymousToken,\r\n })\r\n }\r\n }, [isAnonymousShare, anonymousToken])\r\n\r\n useEffect(() => {\r\n const subscription = authService\r\n .getSiteConfigurationByOriginBase()\r\n .subscribe()\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [])\r\n\r\n if (\r\n isFboInvite &&\r\n environment.IS_FBO_INVITATION_SIGNUP_MAINTENANCE_ENABLED === 'true'\r\n ) {\r\n return \r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import React, { useCallback, useEffect, useMemo, useState } from 'react'\r\nimport { useGoogleReCaptcha } from 'react-google-recaptcha-v3'\r\nimport { FormProvider, useForm } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\nimport {\r\n Link as RouterLink,\r\n useNavigate,\r\n useSearchParams,\r\n} from 'react-router-dom'\r\nimport { concat, finalize, from, Subscription, switchMap } from 'rxjs'\r\nimport * as Yup from 'yup'\r\n\r\nimport CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'\r\nimport { LoadingButton } from '@mui/lab'\r\nimport { FormHelperText, Grid, Link, Stack, Typography } from '@mui/material'\r\nimport {\r\n AwsErrorCodes,\r\n RecaptchaActions,\r\n useRollbarInstance,\r\n useSubscriptionRef,\r\n} from '@procom-labs/common'\r\nimport { TextHookField, useAlert } from '@procom-labs/molecules'\r\n\r\nimport { Header } from '@auth-portal/components/header'\r\nimport { VerifyDigitalCode } from '@auth-portal/components/verify-digital-code'\r\nimport { useAuthService, useRecaptcha } from '@auth-portal/hooks'\r\nimport { FlowRequestType, IInitialAuthentication } from '@auth-portal/types'\r\nimport { yupResolver } from '@hookform/resolvers/yup'\r\n\r\ninterface FormValues {\r\n email: string\r\n password: string\r\n confirmPassword: string\r\n}\r\n\r\nexport const SignupCompleteForm: React.FC = () => {\r\n const { executeRecaptcha } = useGoogleReCaptcha()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const { t, i18n } = useTranslation('main')\r\n const [searchParams] = useSearchParams()\r\n const { addAlert } = useAlert()\r\n const navigate = useNavigate()\r\n\r\n const authService = useAuthService()\r\n const rollbarInstance = useRollbarInstance()\r\n\r\n const [isRecaptchaReady, setIsRecaptchaReady] = useState(false)\r\n const [isLoading, setIsLoading] = useState(false)\r\n const [isOtpValid, setIsOtpValid] = useState(false)\r\n const [showOtpVerifyScreen, setShowOtpVerifyScreen] = useState(false)\r\n\r\n const emailParam = decodeURIComponent(searchParams.get('email') ?? '')\r\n const idParam = searchParams.get('id')\r\n const token = searchParams.get('token')\r\n const otp = searchParams.get('otp')\r\n const requestType = searchParams.get('requestType')\r\n\r\n const resendSubscriptionRef = useSubscriptionRef()\r\n const otpSubscriptionRef = useSubscriptionRef()\r\n const resetOtpSubscriptionRef = useSubscriptionRef()\r\n const submitSubscriptionRef = useSubscriptionRef()\r\n\r\n const commonPasswordSchema = useMemo(\r\n () =>\r\n Yup.string()\r\n .required('form.login.password.requiredError')\r\n .min(6, t('form.passwordValidation.min6Characters'))\r\n .matches(/\\d+/, t('form.passwordValidation.min1Number'))\r\n .matches(/[A-Z]+/, t('form.passwordValidation.min1CapitalLetter'))\r\n .matches(/[a-z]+/, t('form.passwordValidation.min1LowerCaseLetter')),\r\n [t]\r\n )\r\n\r\n const passwordValidationSchema = useMemo(\r\n () =>\r\n Yup.object().shape({\r\n password: commonPasswordSchema,\r\n confirmPassword: commonPasswordSchema.oneOf(\r\n [Yup.ref('password')],\r\n t('form.passwordValidation.passwordNotMatch')\r\n ),\r\n }),\r\n [t, commonPasswordSchema]\r\n )\r\n\r\n const formInstance = useForm({\r\n defaultValues: {\r\n email: emailParam,\r\n password: '',\r\n confirmPassword: '',\r\n },\r\n mode: 'onChange',\r\n resolver: yupResolver(passwordValidationSchema),\r\n })\r\n\r\n const {\r\n control,\r\n handleSubmit,\r\n formState: { isSubmitting },\r\n } = formInstance\r\n\r\n const handleGoBack = useCallback(() => {\r\n navigate('/', {\r\n replace: true,\r\n })\r\n }, [navigate])\r\n\r\n const onSubmit = useCallback(\r\n (data: FormValues) => {\r\n setIsLoading(true)\r\n if (emailParam && idParam) {\r\n setIsLoading(true)\r\n const email = emailParam\r\n const code = idParam\r\n submitSubscriptionRef.current = authService\r\n .initialLogin(data.password)\r\n .pipe(\r\n switchMap(() =>\r\n concat(\r\n authService.setUserRegisteredOn(),\r\n authService.verifyEmail({\r\n email,\r\n onboardingCode: code,\r\n })\r\n )\r\n ),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: () => {\r\n authService.redirectToClientPortal()\r\n },\r\n error: () => {\r\n addAlert({\r\n severity: 'error',\r\n message: t('somethingWrong'),\r\n })\r\n },\r\n })\r\n }\r\n },\r\n [emailParam, idParam, submitSubscriptionRef, addAlert, t]\r\n )\r\n\r\n const handleResendLink = useCallback(\r\n (email: string, tempPassword: string) => {\r\n resendSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.ResendInvitation)\r\n )\r\n .pipe(\r\n switchMap((recaptcha) => {\r\n return authService.resendUserInvitation(\r\n email,\r\n recaptcha,\r\n null,\r\n null,\r\n tempPassword\r\n )\r\n })\r\n )\r\n .subscribe({\r\n next: () => {\r\n addAlert({\r\n message: t('common.cognitoErrors.inviteExpired'),\r\n severity: 'error',\r\n })\r\n },\r\n error: () => {\r\n addAlert({\r\n message: t('somethingWrong'),\r\n severity: 'error',\r\n })\r\n handleGoBack()\r\n },\r\n })\r\n },\r\n [resendSubscriptionRef, getRecaptchaToken, addAlert, t, handleGoBack]\r\n )\r\n\r\n const handleAuthentication = useCallback(\r\n (initialAuthentication: IInitialAuthentication): Subscription => {\r\n return authService\r\n .authenticate({\r\n username: initialAuthentication.email,\r\n password: initialAuthentication.oneTimeCode,\r\n context: 'complete-registration',\r\n })\r\n .subscribe({\r\n error: (err) => {\r\n rollbarInstance.error(err)\r\n if (err.code === AwsErrorCodes.NotAuthorizedException) {\r\n handleResendLink(\r\n initialAuthentication.email,\r\n initialAuthentication.oneTimeCode\r\n )\r\n } else {\r\n handleGoBack()\r\n }\r\n },\r\n })\r\n },\r\n [handleGoBack, handleResendLink]\r\n )\r\n\r\n const handleOtpSignIn = useCallback(() => {\r\n if (isOtpValid) {\r\n otpSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.CodeSignIn)\r\n )\r\n .pipe(\r\n switchMap((recaptcha) =>\r\n authService.handleOtpSignIn(otp ?? '', emailParam, recaptcha)\r\n )\r\n )\r\n .subscribe({\r\n next: () => {\r\n authService.redirectToClientPortal({\r\n isOtpLogin: true,\r\n })\r\n },\r\n error: () => {\r\n addAlert({\r\n message: t('somethingWrong'),\r\n severity: 'error',\r\n })\r\n },\r\n })\r\n } else {\r\n // Generate Otp and redirect to verify otp screen\r\n resetOtpSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.RequestResetPassword)\r\n )\r\n .pipe(\r\n switchMap((recaptcha) =>\r\n authService.generateSignInOtp(emailParam, recaptcha, i18n.language)\r\n )\r\n )\r\n .subscribe({\r\n next: () => {\r\n setShowOtpVerifyScreen(true)\r\n },\r\n error: () => {\r\n addAlert({\r\n message: t('somethingWrong'),\r\n severity: 'error',\r\n })\r\n },\r\n })\r\n }\r\n }, [\r\n isOtpValid,\r\n otpSubscriptionRef,\r\n getRecaptchaToken,\r\n otp,\r\n emailParam,\r\n addAlert,\r\n t,\r\n resetOtpSubscriptionRef,\r\n i18n.language,\r\n ])\r\n\r\n // UseEffect - Wait for recaptcha to be ready before using\r\n useEffect(() => {\r\n if (executeRecaptcha) {\r\n setIsRecaptchaReady(true)\r\n }\r\n }, [executeRecaptcha])\r\n\r\n // UseEffect - Validate cognito token\r\n useEffect(() => {\r\n const subscription = new Subscription()\r\n if (emailParam && token && isRecaptchaReady) {\r\n const initialAuthentication: IInitialAuthentication = {\r\n email: emailParam,\r\n oneTimeCode: decodeURIComponent(token),\r\n }\r\n subscription.add(handleAuthentication(initialAuthentication))\r\n }\r\n\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [emailParam, token, isRecaptchaReady])\r\n\r\n // UseEffect - Validate Otp code\r\n useEffect(() => {\r\n const subscription = new Subscription()\r\n if (emailParam) {\r\n setIsLoading(true)\r\n subscription.add(\r\n from(getRecaptchaToken(RecaptchaActions.RequestResetPassword))\r\n .pipe(\r\n switchMap((recaptcha) =>\r\n authService.validateOtpSignIn(emailParam, otp ?? '', recaptcha)\r\n ),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n setIsOtpValid(\r\n response.isCodeValid &&\r\n !response.hasCodeExpired &&\r\n !response.hasReachedMaxAttempts\r\n )\r\n },\r\n error: () => {\r\n // Silent process\r\n // TODO: case specific handle message\r\n },\r\n })\r\n )\r\n }\r\n\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [emailParam, otp, getRecaptchaToken])\r\n\r\n // UseEffect - Trigger otp sign in if otp is valid and request type is loginRedirect\r\n useEffect(() => {\r\n if (isOtpValid && requestType === FlowRequestType.loginRedirect) {\r\n handleOtpSignIn()\r\n }\r\n }, [isOtpValid, requestType, handleOtpSignIn])\r\n\r\n return (\r\n \r\n \r\n\r\n {!showOtpVerifyScreen ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n )}\r\n \r\n )\r\n}\r\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _object_spread_props(target, source) {\n source = source != null ? source : {};\n if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction _object_without_properties(source, excluded) {\n if (source == null) return {};\n var target = _object_without_properties_loose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for(i = 0; i < sourceSymbolKeys.length; i++){\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _object_without_properties_loose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for(i = 0; i < sourceKeys.length; i++){\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { Button } from '@mui/material';\nexport var LinkButton = function(_param) {\n var children = _param.children, sx = _param.sx, _param_underline = _param.underline, underline = _param_underline === void 0 ? true : _param_underline, rest = _object_without_properties(_param, [\n \"children\",\n \"sx\",\n \"underline\"\n ]);\n return /*#__PURE__*/ _jsx(Button, _object_spread_props(_object_spread({\n disableRipple: true,\n disableFocusRipple: true,\n sx: _object_spread({\n p: 0,\n fontWeight: 400,\n textTransform: 'none',\n textDecoration: underline ? 'solid 1px underline' : 'none',\n '&:hover': {\n fontWeight: 500,\n backgroundColor: 'transparent',\n textDecoration: 'solid 1px underline'\n }\n }, sx)\n }, rest), {\n children: children\n }));\n};\n","import React, { FC, useCallback } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nimport VisibilityIcon from '@mui/icons-material/Visibility'\r\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff'\r\nimport { IconButton, InputAdornment } from '@mui/material'\r\n\r\nexport const CommonEndAdornment: FC<{\r\n showPassword: boolean\r\n handleShowPassword: () => void\r\n}> = React.memo(({ showPassword, handleShowPassword }) => {\r\n const { t } = useTranslation('main')\r\n const handleStrayClicks = useCallback(\r\n (event: React.MouseEvent): void => {\r\n event.preventDefault()\r\n },\r\n []\r\n )\r\n return (\r\n \r\n \r\n {showPassword ? : }\r\n \r\n \r\n )\r\n})\r\n","import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'\r\nimport { useFormContext, useWatch } from 'react-hook-form'\r\nimport { TFuncKey, Trans, useTranslation } from 'react-i18next'\r\nimport { finalize, from, switchMap } from 'rxjs'\r\nimport * as Yup from 'yup'\r\n\r\nimport { LoadingButton } from '@mui/lab'\r\nimport { FormGroup, Stack, Typography } from '@mui/material'\r\nimport { AlertMessage } from '@procom-labs/atoms'\r\nimport { RecaptchaActions, useSubscriptionRef } from '@procom-labs/common'\r\nimport {\r\n DigitalCodeInput,\r\n TextHookField,\r\n useAlert,\r\n} from '@procom-labs/molecules'\r\n\r\nimport { RenderCheckbox } from '@auth-portal/components/password-validation'\r\nimport { useAuthService, useRecaptcha } from '@auth-portal/hooks'\r\nimport { ValidateSignInFormValues, ValidationType } from '@auth-portal/types'\r\nimport {\r\n DefaultPasswordValidationState,\r\n passwordValidations,\r\n} from '@auth-portal/util'\r\n\r\nimport { CommonEndAdornment } from './common-end-adornment'\r\n\r\nexport const PasswordCreateScreen: FC<{\r\n isLoading: boolean\r\n}> = ({ isLoading }) => {\r\n const { addAlert } = useAlert()\r\n const authService = useAuthService()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const { t, i18n } = useTranslation('main')\r\n\r\n const resendOtpSubscriptionRef = useSubscriptionRef()\r\n const verifyCodeSubscriptionRef = useSubscriptionRef()\r\n\r\n const [showPassword, setShowPassword] = useState(false)\r\n const [isVerifying, setIsVerifying] = useState(false)\r\n const [isOtpValid, setIsOtpValid] = useState(false)\r\n const [passwordValidation, setPasswordValidation] = useState<\r\n ValidationType[]\r\n >(DefaultPasswordValidationState)\r\n\r\n const isValidPasswords = useMemo(\r\n () => passwordValidation.every((validation) => validation.valid),\r\n [passwordValidation]\r\n )\r\n\r\n const { control, setValue } = useFormContext()\r\n\r\n const email = useWatch({ control, name: 'email' })\r\n const password = useWatch({ control, name: 'password' })\r\n const confirmPassword = useWatch({ control, name: 'confirmPassword' })\r\n\r\n const handleShowPassword = useCallback(() => {\r\n setShowPassword((prev) => !prev)\r\n }, [])\r\n\r\n const handleResendOtp = useCallback(() => {\r\n resendOtpSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.RequestResetPassword)\r\n )\r\n .pipe(\r\n switchMap((recaptcha) =>\r\n authService.generateSignInOtp(\r\n decodeURIComponent(email),\r\n recaptcha,\r\n i18n.language\r\n )\r\n ),\r\n finalize(() => setIsVerifying(false))\r\n )\r\n .subscribe({\r\n next: () => {\r\n addAlert({\r\n severity: 'info',\r\n message: `${t(\r\n 'form.alerts.codeExpired'\r\n )} New code has been sent to your email`,\r\n })\r\n },\r\n })\r\n }, [\r\n t,\r\n email,\r\n addAlert,\r\n i18n.language,\r\n getRecaptchaToken,\r\n resendOtpSubscriptionRef,\r\n ])\r\n\r\n const handleVerifyCode = useCallback(\r\n (code: string) => {\r\n setIsVerifying(true)\r\n setIsOtpValid(false)\r\n setValue('otp', code)\r\n verifyCodeSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.RequestResetPassword)\r\n )\r\n .pipe(\r\n switchMap((token) =>\r\n authService.validateOtpSignIn(email, code, token)\r\n ),\r\n finalize(() => setIsVerifying(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n if (response.isCodeValid) {\r\n setIsOtpValid(true)\r\n } else if (response.hasCodeExpired) {\r\n handleResendOtp()\r\n } else if (response.hasReachedMaxAttempts) {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.maxAttempts', {\r\n hour: 3,\r\n }),\r\n })\r\n } else {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.invalidCode'),\r\n })\r\n }\r\n },\r\n error: (error) => {\r\n setIsOtpValid(false)\r\n addAlert({\r\n severity: 'error',\r\n message: error.message,\r\n })\r\n },\r\n })\r\n },\r\n [\r\n t,\r\n email,\r\n addAlert,\r\n setValue,\r\n getRecaptchaToken,\r\n handleResendOtp,\r\n verifyCodeSubscriptionRef,\r\n ]\r\n )\r\n\r\n const validatePassword = useCallback(() => {\r\n if (!password) {\r\n setPasswordValidation(\r\n passwordValidation.map((item) => ({ ...item, valid: false }))\r\n )\r\n return\r\n }\r\n\r\n const validationMap: Partial<\r\n Record Promise>\r\n > = {\r\n [passwordValidations.Min6Characters]: (pass: string) =>\r\n Yup.string().min(6).isValid(pass),\r\n [passwordValidations.Min1number]: (pass: string) =>\r\n Yup.string().matches(/\\d+/).isValid(pass),\r\n [passwordValidations.Min1CapitalLetter]: (pass: string) =>\r\n Yup.string()\r\n .matches(/[A-Z]+/)\r\n .isValid(pass),\r\n [passwordValidations.Min1LowerCaseLetter]: (pass: string) =>\r\n Yup.string()\r\n .matches(/[a-z]+/)\r\n .isValid(pass),\r\n [passwordValidations.PasswordMatch]: (pass: string) =>\r\n Yup.string().oneOf([confirmPassword]).isValid(pass),\r\n }\r\n\r\n Promise.all(\r\n passwordValidation.map(async (item) => {\r\n const validationFunction = item.transKey\r\n ? validationMap[item.transKey]\r\n : () => Promise.resolve(false)\r\n\r\n const result = validationFunction\r\n ? await validationFunction(password)\r\n : false\r\n\r\n return {\r\n ...item,\r\n valid: result,\r\n }\r\n })\r\n ).then((newValidation) => {\r\n setPasswordValidation(newValidation)\r\n })\r\n }, [password, confirmPassword, passwordValidation])\r\n\r\n useEffect(() => {\r\n validatePassword()\r\n }, [password, confirmPassword])\r\n\r\n return (\r\n \r\n \r\n {t('organisms.mfaLoginCodeVerification.heading')}\r\n \r\n\r\n \r\n\r\n \r\n ),\r\n }}\r\n />\r\n\r\n \r\n {passwordValidation.map((validation) =>\r\n validation.transKey !== passwordValidations.PasswordMatch ? (\r\n \r\n ) : (\r\n ''\r\n )\r\n )}\r\n \r\n\r\n \r\n ),\r\n }}\r\n />\r\n\r\n \r\n {passwordValidation.map((validation) =>\r\n validation.transKey === passwordValidations.PasswordMatch ? (\r\n \r\n ) : (\r\n ''\r\n )\r\n )}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n {t('form.createAccount.headings.enterCodeToVerify')}\r\n \r\n \r\n\r\n \r\n {t('common.btn.submit')}\r\n \r\n \r\n )\r\n}\r\n","import React, { FC, useCallback, useState } from 'react'\r\nimport { useFormContext, useWatch } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Link as RouterLink } from 'react-router-dom'\r\n\r\nimport { LoadingButton } from '@mui/lab'\r\nimport { Link, Stack, Typography } from '@mui/material'\r\nimport { TextHookField } from '@procom-labs/molecules'\r\n\r\nimport { ValidateSignInFormValues } from '@auth-portal/types'\r\n\r\nimport { CommonEndAdornment } from './common-end-adornment'\r\n\r\nexport const PasswordValidateScreen: FC<{\r\n isLoading: boolean\r\n}> = ({ isLoading }) => {\r\n const { t } = useTranslation('main')\r\n const [showPassword, setShowPassword] = useState(false)\r\n\r\n const { control } = useFormContext()\r\n\r\n const email = useWatch({ control, name: 'email' })\r\n\r\n const handleShowPassword = useCallback(() => {\r\n setShowPassword((prev) => !prev)\r\n }, [])\r\n\r\n return (\r\n \r\n \r\n\r\n \r\n ),\r\n }}\r\n />\r\n\r\n \r\n \r\n \r\n {t('form.login.forgotPassword')}\r\n \r\n \r\n \r\n\r\n \r\n {t('common.btn.submit')}\r\n \r\n \r\n )\r\n}\r\n","import React, { useCallback, useState } from 'react'\r\nimport { Form, Formik } from 'formik'\r\nimport { useFormContext } from 'react-hook-form'\r\nimport { Trans, useTranslation } from 'react-i18next'\r\nimport { useLocation, useSearchParams } from 'react-router-dom'\r\nimport { concatMap, from, of, switchMap } from 'rxjs'\r\n\r\nimport { Button, Typography } from '@mui/material'\r\nimport { AlertMessage } from '@procom-labs/atoms'\r\nimport { RecaptchaActions, useSubscriptionRef } from '@procom-labs/common'\r\nimport { DigitalCodeInput, useAlert } from '@procom-labs/molecules'\r\n\r\nimport { useAuthService, useRecaptcha } from '@auth-portal/hooks'\r\nimport { UserExistResponse } from '@auth-portal/types'\r\n\r\ninterface FormValues {\r\n verificationCode: string\r\n}\r\n\r\nconst defaultValues: FormValues = {\r\n verificationCode: '',\r\n}\r\n\r\nconst MAX_LOGIN_ATTEMPTS = 1\r\n\r\nexport const VerifyOtpLogin: React.FC<{}> = () => {\r\n const { addAlert } = useAlert()\r\n const { t } = useTranslation('main')\r\n const [searchParams] = useSearchParams()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const authService = useAuthService()\r\n\r\n const location = useLocation()\r\n const userResponse = location.state as UserExistResponse\r\n\r\n const handleSignInSubscriptionRef = useSubscriptionRef()\r\n const handleVerifyCodeSubscriptionRef = useSubscriptionRef()\r\n\r\n const email = searchParams.get('email')\r\n const isNewUser = (searchParams.get('isNewUser') ?? '') === 'true'\r\n const firstLogin = (searchParams.get('firstLogin') ?? '') === 'true'\r\n\r\n const [otp, setOtp] = useState('')\r\n const [isVerifying, setIsVerifying] = useState(false)\r\n\r\n const { setValue } = useFormContext()\r\n\r\n const handleGenerateOtp = useCallback(\r\n (code: string) => {\r\n if (!email) return\r\n\r\n const {\r\n onboardingParam,\r\n migrationToken,\r\n isFboMigrationTokenValid,\r\n tenantParam,\r\n } = userResponse\r\n const isFboUser = migrationToken && isFboMigrationTokenValid\r\n const isOnboardingInvite = onboardingParam\r\n\r\n handleSignInSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.CodeSignIn)\r\n )\r\n .pipe(\r\n switchMap((token) =>\r\n authService.handleOtpSignIn(code, email, token).pipe(\r\n concatMap(() =>\r\n from(getRecaptchaToken(RecaptchaActions.ActivateFboMapping))\r\n ),\r\n concatMap((fboMappingToken) => {\r\n return isFboUser || isOnboardingInvite\r\n ? authService.activateFboUserMapping(\r\n migrationToken,\r\n onboardingParam,\r\n email,\r\n fboMappingToken,\r\n tenantParam\r\n )\r\n : of(null)\r\n })\r\n )\r\n )\r\n )\r\n .subscribe({\r\n next: () => {\r\n authService.redirectToClientPortal({\r\n isOtpLogin: true,\r\n ...(isNewUser && { newAccount: 'true' }),\r\n ...(firstLogin && { firstLogin: 'true' }),\r\n })\r\n },\r\n })\r\n },\r\n [\r\n getRecaptchaToken,\r\n email,\r\n isNewUser,\r\n firstLogin,\r\n userResponse,\r\n handleSignInSubscriptionRef,\r\n ]\r\n )\r\n\r\n const handleVerifyCode = useCallback(\r\n (code: string) => {\r\n if (!email) return\r\n setIsVerifying(true)\r\n setOtp(code)\r\n setValue('otp', code)\r\n handleVerifyCodeSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.RequestResetPassword)\r\n ).subscribe({\r\n next: (token) => {\r\n authService.validateOtpSignIn(email, code, token).subscribe({\r\n next: (response) => {\r\n if (response.hasCodeExpired) {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.codeExpired'),\r\n })\r\n } else if (response.hasReachedMaxAttempts) {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.maxAttempts', {\r\n hour: MAX_LOGIN_ATTEMPTS,\r\n }),\r\n })\r\n } else if (response.isCodeValid) {\r\n handleGenerateOtp(code)\r\n } else {\r\n addAlert({\r\n severity: 'error',\r\n message: t('form.alerts.invalidCode'),\r\n })\r\n }\r\n setIsVerifying(false)\r\n },\r\n error: (error) => {\r\n setIsVerifying(false)\r\n addAlert({\r\n severity: 'error',\r\n message: error.message,\r\n })\r\n },\r\n })\r\n },\r\n })\r\n },\r\n [\r\n t,\r\n email,\r\n addAlert,\r\n getRecaptchaToken,\r\n handleGenerateOtp,\r\n setOtp,\r\n setValue,\r\n handleVerifyCodeSubscriptionRef,\r\n ]\r\n )\r\n\r\n const handleSubmit = useCallback(() => {\r\n handleVerifyCode(otp)\r\n }, [otp, handleVerifyCode])\r\n\r\n return (\r\n <>\r\n \r\n {t('organisms.mfaLoginCodeVerification.heading')}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n {t('form.createAccount.headings.enterCodeToVerify')}\r\n \r\n\r\n \r\n {() => (\r\n \r\n )}\r\n \r\n >\r\n )\r\n}\r\n","import React, { FC, useCallback, useEffect, useState } from 'react'\r\nimport { FormProvider, useForm } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\nimport {\r\n Link as RouterLink,\r\n useLocation,\r\n useNavigate,\r\n useSearchParams,\r\n} from 'react-router-dom'\r\nimport {\r\n catchError,\r\n concatMap,\r\n EMPTY,\r\n finalize,\r\n from,\r\n of,\r\n Subscription,\r\n switchMap,\r\n} from 'rxjs'\r\n\r\nimport { Grid, Link, Typography } from '@mui/material'\r\nimport { LinkButton } from '@procom-labs/atoms'\r\nimport {\r\n AuthProfileType,\r\n CreateContactPayload,\r\n getClientCode,\r\n getClientPortalHost,\r\n getVendorCode,\r\n gtmEvents,\r\n IAccountType,\r\n LoginTypes,\r\n RecaptchaActions,\r\n useMfaStore,\r\n useSubjectSelector,\r\n useSubscriptionRef,\r\n} from '@procom-labs/common'\r\nimport { useAlert } from '@procom-labs/molecules'\r\n\r\nimport { BaseLayout } from '@auth-portal/components/base-layout'\r\nimport { Header } from '@auth-portal/components/header'\r\nimport {\r\n PasswordCreateScreen,\r\n PasswordValidateScreen,\r\n} from '@auth-portal/components/password'\r\nimport { VerifyOtpLogin } from '@auth-portal/components/verify-otp-login'\r\nimport {\r\n useAuthService,\r\n useIsUserCreationAllowed,\r\n useRecaptcha,\r\n useTrackingWrapper,\r\n} from '@auth-portal/hooks'\r\nimport { authStore } from '@auth-portal/store'\r\nimport {\r\n AwsUserStatusTypes,\r\n ClientUserCreateResponse,\r\n FlowRequestType,\r\n UserExistResponse,\r\n ValidateSignInFormValues,\r\n} from '@auth-portal/types'\r\nimport { getCallbackURL, getOriginBaseUrl } from '@auth-portal/util'\r\n\r\nexport const ValidateSignIn: FC<{}> = () => {\r\n const { addAlert } = useAlert()\r\n const navigate = useNavigate()\r\n const authService = useAuthService()\r\n const mfaStore = useMfaStore()\r\n const location = useLocation()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const [searchParams] = useSearchParams()\r\n const { t, i18n } = useTranslation('main')\r\n\r\n const userResponse = location.state as UserExistResponse\r\n const profileType = userResponse?.profileType ?? ''\r\n const isContractor = profileType === LoginTypes.Contractor.toLowerCase()\r\n const isGorilla = profileType === LoginTypes.GorillaResume.toLowerCase()\r\n const isClient = profileType === LoginTypes.Client.toLowerCase()\r\n\r\n const isUserCreationAllowed = useIsUserCreationAllowed()\r\n const { track } = useTrackingWrapper()\r\n\r\n const { isMfaCodeRequested, siteConfig } = useSubjectSelector(authStore, [\r\n 'isMfaCodeRequested',\r\n 'siteConfig',\r\n ])\r\n\r\n const email = searchParams.get('email') ?? ''\r\n const isNewUser = (userResponse?.isNewUser ?? '') === 'true'\r\n const firstLogin = (userResponse?.firstLogin ?? '') === 'true'\r\n\r\n const [isOtpOption, setIsOtpOption] = useState(true)\r\n const [isLoading, setIsLoading] = useState(false)\r\n const [isCognitoUserExists, setIsCognitoUserExists] = useState(false)\r\n const [cognitoUserStatus, setCognitoUserStatus] = useState([])\r\n const [isCognitoUserCheckLoading, setIsCognitoUserCheckLoading] =\r\n useState(true)\r\n\r\n const isCognitoUserConfirmed = cognitoUserStatus.includes(\r\n AwsUserStatusTypes.CONFIRMED\r\n )\r\n\r\n const isUserWithoutPassword = !isCognitoUserExists || !isCognitoUserConfirmed\r\n\r\n const afterLoginSubscriptionRef = useSubscriptionRef()\r\n const handleSubmitSubscriptionRef = useSubscriptionRef()\r\n\r\n const formInstance = useForm({\r\n defaultValues: { email },\r\n })\r\n const { handleSubmit } = formInstance\r\n\r\n const getProfileType = useCallback((): AuthProfileType | string => {\r\n if (isContractor) return AuthProfileType.Contractor\r\n if (isGorilla) return AuthProfileType.GorillaResumeUser\r\n return ''\r\n }, [isContractor, isGorilla])\r\n\r\n const handleLoginAfterAccountCreate = useCallback(\r\n (password: string, response: ClientUserCreateResponse) => {\r\n const {\r\n onboardingParam,\r\n migrationToken,\r\n isFboMigrationTokenValid,\r\n tenantParam,\r\n } = userResponse\r\n const isFboUser = migrationToken && isFboMigrationTokenValid\r\n const isOnboardingInvite = onboardingParam\r\n\r\n afterLoginSubscriptionRef.current = authService\r\n .authenticate({\r\n password,\r\n username: email,\r\n context: 'complete-registration',\r\n queryParams: {\r\n isPendingCognitoProcess: true,\r\n newAccount: isNewUser ? 'true' : 'false',\r\n firstLogin: firstLogin ? 'true' : 'false',\r\n },\r\n })\r\n .pipe(\r\n switchMap(() =>\r\n from(getRecaptchaToken(RecaptchaActions.ActivateFboMapping)).pipe(\r\n concatMap((token) => {\r\n return isFboUser || isOnboardingInvite\r\n ? authService.activateFboUserMapping(\r\n migrationToken,\r\n onboardingParam,\r\n email,\r\n token,\r\n tenantParam\r\n )\r\n : of(null)\r\n }),\r\n concatMap(() => authService.setUserRegisteredOn()),\r\n concatMap(() =>\r\n authService.verifyEmail({\r\n email,\r\n migrationToken,\r\n onboardingCode: onboardingParam ?? response.id,\r\n })\r\n )\r\n )\r\n ),\r\n finalize(() => setIsLoading(false)),\r\n catchError(() => {\r\n setIsLoading(false)\r\n return EMPTY\r\n })\r\n )\r\n .subscribe({\r\n next: () => {\r\n authService.redirectToClientPortal()\r\n },\r\n })\r\n },\r\n [\r\n email,\r\n isNewUser,\r\n firstLogin,\r\n userResponse,\r\n getRecaptchaToken,\r\n afterLoginSubscriptionRef,\r\n ]\r\n )\r\n\r\n const handleCreateAccount = useCallback(\r\n (data: ValidateSignInFormValues) => {\r\n let payload: CreateContactPayload = {\r\n email,\r\n password: data.password,\r\n firstName: userResponse?.firstName ?? '',\r\n lastName: userResponse?.lastName ?? '',\r\n phoneNumber: userResponse?.phoneNumber ?? '',\r\n recaptchaToken: '',\r\n requestType: FlowRequestType.signup,\r\n language: i18n.language,\r\n vendorCode: getVendorCode(),\r\n callbackUrl: getCallbackURL(),\r\n originBase: getOriginBaseUrl(),\r\n authPortalBase: window.location.origin,\r\n clientCode: getClientCode(getClientPortalHost()) ?? '',\r\n profileType: getProfileType(),\r\n }\r\n\r\n handleSubmitSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.Signup)\r\n )\r\n .pipe(\r\n switchMap((token) => {\r\n payload = {\r\n ...payload,\r\n recaptchaToken: token,\r\n }\r\n return authService.createContactWithoutPassword(\r\n payload,\r\n isClient ? IAccountType.Client : IAccountType.Contractor // Adjust this\r\n )\r\n }),\r\n catchError(() => {\r\n setIsLoading(false)\r\n return EMPTY\r\n }),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n handleLoginAfterAccountCreate(data.password, response)\r\n },\r\n })\r\n },\r\n [\r\n email,\r\n i18n.language,\r\n isClient,\r\n userResponse?.firstName,\r\n userResponse?.lastName,\r\n userResponse?.phoneNumber,\r\n getProfileType,\r\n getRecaptchaToken,\r\n handleSubmitSubscriptionRef,\r\n handleLoginAfterAccountCreate,\r\n ]\r\n )\r\n\r\n const handleSetPermanentPassword = useCallback(\r\n (data: ValidateSignInFormValues) => {\r\n const {\r\n onboardingParam,\r\n migrationToken,\r\n isFboMigrationTokenValid,\r\n tenantParam,\r\n } = userResponse\r\n const isFboUser = migrationToken && isFboMigrationTokenValid\r\n const isOnboardingInvite = onboardingParam\r\n\r\n handleSubmitSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.CodeSignIn)\r\n )\r\n .pipe(\r\n switchMap((token) => {\r\n return authService\r\n .createPasswordWithCodeSignIn(\r\n data.otp,\r\n email,\r\n token,\r\n data.password\r\n )\r\n .pipe(\r\n concatMap(() =>\r\n from(getRecaptchaToken(RecaptchaActions.ActivateFboMapping))\r\n ),\r\n concatMap((fboMappingToken) => {\r\n return isFboUser || isOnboardingInvite\r\n ? authService.activateFboUserMapping(\r\n migrationToken,\r\n onboardingParam,\r\n email,\r\n fboMappingToken,\r\n tenantParam\r\n )\r\n : of(null)\r\n })\r\n )\r\n }),\r\n finalize(() => setIsLoading(false))\r\n )\r\n .subscribe({\r\n next: () => {\r\n authService.redirectToClientPortal({\r\n isOtpLogin: true,\r\n ...(isNewUser && { newAccount: 'true' }),\r\n ...(firstLogin && { firstLogin: 'true' }),\r\n })\r\n },\r\n })\r\n },\r\n [\r\n email,\r\n firstLogin,\r\n isNewUser,\r\n userResponse,\r\n getRecaptchaToken,\r\n handleSubmitSubscriptionRef,\r\n ]\r\n )\r\n\r\n const handleAuthenticate = useCallback(\r\n (data: ValidateSignInFormValues) => {\r\n handleSubmitSubscriptionRef.current = authService\r\n .authenticate({\r\n username: email,\r\n password: data.password,\r\n })\r\n .pipe(finalize(() => setIsLoading(false)))\r\n .subscribe({\r\n next: (response) => {\r\n const mfaType = response?.mfaType\r\n if (mfaType) mfaStore.dispatch({ mfaType })\r\n },\r\n error: (error) => {\r\n addAlert({\r\n severity: 'error',\r\n message: error.message,\r\n })\r\n },\r\n complete: () => {\r\n track({\r\n eventName: gtmEvents.FormLogin,\r\n submissionStatus: 'true',\r\n email,\r\n })\r\n },\r\n })\r\n },\r\n [email, addAlert, track, handleSubmitSubscriptionRef]\r\n )\r\n\r\n const onSubmit = useCallback(\r\n (data: ValidateSignInFormValues) => {\r\n setIsLoading(true)\r\n if (isCognitoUserExists) {\r\n // Case 1 : Login via Cognito Password\r\n if (isCognitoUserConfirmed) {\r\n handleAuthenticate(data)\r\n } else {\r\n // case 2: Set permanent password for this existing cognito user\r\n handleSetPermanentPassword(data)\r\n }\r\n } else {\r\n // !isCognitoUserExists\r\n // Case 3 : Create Cognito user and login\r\n handleCreateAccount(data)\r\n }\r\n },\r\n [\r\n isCognitoUserExists,\r\n isCognitoUserConfirmed,\r\n handleCreateAccount,\r\n handleAuthenticate,\r\n handleSetPermanentPassword,\r\n ]\r\n )\r\n\r\n useEffect(() => {\r\n // Redirect to mfa if login via password\r\n if (isMfaCodeRequested && isCognitoUserExists && isCognitoUserConfirmed)\r\n navigate('/login-mfa')\r\n }, [\r\n isMfaCodeRequested,\r\n navigate,\r\n isCognitoUserExists,\r\n isCognitoUserConfirmed,\r\n ])\r\n\r\n // UseEffect - Check if user exists in cognito\r\n useEffect(() => {\r\n const subscription = new Subscription()\r\n if (email) {\r\n subscription.add(\r\n from(getRecaptchaToken(RecaptchaActions.GetAnonymousUserInfo))\r\n .pipe(\r\n switchMap((token) =>\r\n authService.getIfUserExist(email, token, 'true')\r\n ),\r\n finalize(() => setIsCognitoUserCheckLoading(false))\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n if (response) {\r\n setIsCognitoUserExists(true)\r\n const awsUserStatuses: string[] = []\r\n if (response.userStatus) {\r\n response.userStatus.forEach((status) =>\r\n awsUserStatuses.push(status)\r\n )\r\n }\r\n setCognitoUserStatus(awsUserStatuses)\r\n }\r\n },\r\n })\r\n )\r\n }\r\n return () => {\r\n if (subscription != null && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [email, getRecaptchaToken])\r\n\r\n // SiteConfig if not already loaded\r\n useEffect(() => {\r\n const subscription = new Subscription()\r\n if (!siteConfig) {\r\n subscription.add(\r\n authService.getSiteConfigurationByOriginBase().subscribe()\r\n )\r\n }\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [siteConfig])\r\n\r\n return (\r\n \r\n \r\n \r\n {isOtpOption ? (\r\n <>\r\n \r\n \r\n {t('form.contractorSignup.or')}\r\n \r\n\r\n setIsOtpOption(false)}\r\n underline={false}\r\n sx={{\r\n textOverflow: 'wrap',\r\n whiteSpace: 'normal',\r\n wordWrap: 'break-word',\r\n }}\r\n >\r\n {!isCognitoUserCheckLoading && (\r\n \r\n {isUserWithoutPassword && isUserCreationAllowed\r\n ? t('form.login.password.setupPassword')\r\n : t('form.login.password.loginWithPassword')}\r\n \r\n )}\r\n \r\n >\r\n ) : (\r\n \r\n )}\r\n \r\n\r\n \r\n \r\n \r\n {t('form.reset.backLoginBtn')}\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { useEffect, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useSearchParams } from 'react-router-dom'\r\nimport { from, switchMap } from 'rxjs'\r\n\r\nimport { Preloader } from '@procom-labs/atoms'\r\nimport {\r\n AuthProfileType,\r\n IAccountType,\r\n LoginTypes,\r\n RecaptchaActions,\r\n useSubscriptionRef,\r\n VendorCodes,\r\n} from '@procom-labs/common'\r\nimport { useAlert } from '@procom-labs/molecules'\r\n\r\nimport { BaseLayout } from '@auth-portal/components/base-layout'\r\nimport { VerifyDigitalCode } from '@auth-portal/components/verify-digital-code'\r\nimport { useAuthService, useRecaptcha } from '@auth-portal/hooks'\r\nimport { getCallbackURL, getOriginBaseUrl } from '@auth-portal/util'\r\n\r\nexport const SignupGorillaResumeOtp = () => {\r\n const { t, i18n } = useTranslation('main')\r\n const authService = useAuthService()\r\n const { addAlert } = useAlert()\r\n const [searchParams] = useSearchParams()\r\n const emailParam = searchParams.get('email')\r\n const signUpSubscriptionRef = useSubscriptionRef()\r\n const { getRecaptchaToken } = useRecaptcha()\r\n const [showVerifyCodeScreen, setShowVerifyCodeScreen] = useState(false)\r\n\r\n useEffect(() => {\r\n if (!emailParam || showVerifyCodeScreen) return\r\n signUpSubscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.Signup)\r\n )\r\n .pipe(\r\n switchMap((recaptcha) =>\r\n // Create the GorillaResume user\r\n authService.createContactWithoutPassword(\r\n {\r\n email: emailParam,\r\n vendorCode: VendorCodes.GW,\r\n clientCode: null,\r\n language: i18n.language,\r\n authPortalBase: window.location.origin,\r\n callbackUrl: getCallbackURL(),\r\n originBase: getOriginBaseUrl(),\r\n firstName: '',\r\n lastName: '',\r\n recaptchaToken: recaptcha,\r\n portalType: LoginTypes.GorillaResume,\r\n profileType: AuthProfileType.GorillaResumeUser,\r\n },\r\n IAccountType.GorillaResume\r\n )\r\n ),\r\n switchMap(() =>\r\n from(getRecaptchaToken(RecaptchaActions.RequestResetPassword))\r\n ),\r\n switchMap((token) =>\r\n // Generate the OTP\r\n authService.generateSignInOtp(\r\n decodeURIComponent(emailParam),\r\n token,\r\n i18n.language\r\n )\r\n )\r\n )\r\n .subscribe({\r\n complete: () => {\r\n setShowVerifyCodeScreen(true)\r\n },\r\n error: () => {\r\n addAlert({\r\n message: t('common.alert.somethingWrong'),\r\n severity: 'error',\r\n horizontal: 'left',\r\n })\r\n },\r\n })\r\n })\r\n\r\n if (showVerifyCodeScreen && emailParam) {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n return \r\n}\r\n","import React from 'react'\r\n\r\nimport { BaseLayout, SignupCompleteForm } from '@auth-portal/components'\r\n\r\nexport const SignupComplete: React.FC = () => {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import React, { ReactElement } from 'react'\r\n\r\nimport { ActivateFboInvitation } from '@auth-portal/components'\r\n\r\nconst ActivateFboInvitationRoute: React.FC<{}> = () =>\r\n ( ) as ReactElement\r\n\r\nexport default ActivateFboInvitationRoute\r\n","export var PageTypes = /*#__PURE__*/ function(PageTypes) {\n PageTypes[\"Dashboard\"] = \"Dashboard\";\n PageTypes[\"LandingPages\"] = \"Landing Pages\";\n PageTypes[\"Login\"] = \"Login\";\n PageTypes[\"Register\"] = \"Register\";\n PageTypes[\"ForgotPassword\"] = \"Forget Password\";\n PageTypes[\"BuildProfile\"] = \"Build Profile\";\n PageTypes[\"SearchJobs\"] = \"Search Jobs\";\n PageTypes[\"Jobs\"] = \"Jobs\";\n PageTypes[\"JobDetails\"] = \"Job Details\";\n PageTypes[\"TermUse\"] = \"Terms of Use\";\n PageTypes[\"PrivacyPolicy\"] = \"Privacy Policy\";\n PageTypes[\"ClientDocs\"] = \"Documents\";\n PageTypes[\"Logout\"] = \"Log out\";\n PageTypes[\"Search\"] = \"Search\";\n PageTypes[\"AllJobs\"] = \"All Jobs\";\n PageTypes[\"RecommendedJobs\"] = \"Recommended Jobs\";\n PageTypes[\"MyJobs\"] = \"My Jobs\";\n PageTypes[\"AccountSettings\"] = \"Account Settings\";\n PageTypes[\"ChangePassword\"] = \"Change Password\";\n PageTypes[\"UploadResume\"] = \"Upload Resume\";\n PageTypes[\"Verify\"] = \"Verify\";\n PageTypes[\"WorkPreference\"] = \"Work Preference\";\n PageTypes[\"CommunicationPreference\"] = \"Communication Preference\";\n PageTypes[\"JobExperience\"] = \"Job Experience\";\n PageTypes[\"ExploreJobs\"] = \"Explore Jobs\";\n PageTypes[\"Recommended\"] = \"Recommended\";\n PageTypes[\"WorkOrders\"] = \"Work Orders\";\n PageTypes[\"Timesheets\"] = \"Timesheets\";\n PageTypes[\"Payment\"] = \"Payment\";\n PageTypes[\"Transaction\"] = \"Transaction\";\n PageTypes[\"Expenses\"] = \"Expenses\";\n PageTypes[\"EmployerJobs\"] = \"Employer Jobs\";\n PageTypes[\"EmployerJobDetail\"] = \"Employer Job detail\";\n PageTypes[\"EmployerJobsNewJob\"] = \"Employer New Job\";\n PageTypes[\"EmployerJobEdit\"] = \"Employer Edit Job\";\n PageTypes[\"EmployerJobAddCandidate\"] = \"Employer Job Add Candidate\";\n PageTypes[\"Candidates\"] = \"Candidates\";\n PageTypes[\"CandidateDetail\"] = \"Candidate Detail\";\n PageTypes[\"JobApply\"] = \"Job Apply\";\n PageTypes[\"TalentPools\"] = \"TalentPools\";\n PageTypes[\"TalentPoolDetails\"] = \"TalentPoolDetails\";\n PageTypes[\"ClientJobCreate\"] = \"Client Job Create\";\n PageTypes[\"ClientJobEdit\"] = \"Client Job Edit\";\n PageTypes[\"BullhornJobGenerator\"] = \"Bullhorn Job Generator\";\n PageTypes[\"ResumeCopilot\"] = \"Resume Copilot\";\n PageTypes[\"CandidateViewResume\"] = \"Candidate View Resume\";\n PageTypes[\"CandidateViewDocuments\"] = \"Candidate View Documents\";\n PageTypes[\"CandidateViewNotes\"] = \"Candidate View Notes\";\n PageTypes[\"CandidateViewTimeLine\"] = \"Candidate View Timeline\";\n return PageTypes;\n}({});\n","import React, { ReactElement } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nimport { PageTypes, useGtmVpv } from '@procom-labs/common'\r\n\r\nimport { BaseLayout, ChangePasswordForm } from '@auth-portal/components'\r\n\r\nconst ChangePasswordRoute: React.FC<{}> = () => {\r\n const { t } = useTranslation('main')\r\n useGtmVpv({\r\n pageType: PageTypes.ChangePassword,\r\n pageTitle: t('form.changePassword.title', { lng: 'en' }),\r\n })\r\n\r\n return (\r\n \r\n \r\n \r\n ) as ReactElement\r\n}\r\nexport default ChangePasswordRoute\r\n","import { useCallback, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useGTMDispatch } from '@elgorditosalsero/react-gtm-hook';\n// Send Google Tag Manager Virtual Page View\nexport var useGtmVpv = function(param) {\n var pageType = param.pageType, pageTitle = param.pageTitle, pageURISuffix = param.pageURISuffix, _param_cancelEvent = param.cancelEvent, cancelEvent = _param_cancelEvent === void 0 ? false : _param_cancelEvent;\n var sendDataToGTM = useGTMDispatch();\n var i18n = useTranslation('main').i18n;\n useEffect(function() {\n var suffixString = pageURISuffix ? \"/\".concat(pageURISuffix) : '';\n if (!cancelEvent) sendDataToGTM({\n event: 'VPV',\n pageURL: \"\".concat(window.location.origin).concat(window.location.pathname).concat(suffixString),\n pageDOM: window.location.origin,\n pageURI: \"\".concat(window.location.pathname).concat(suffixString),\n pageType: pageType,\n pageTitle: pageTitle,\n language: i18n.language\n });\n }, [\n cancelEvent,\n i18n.language,\n pageTitle,\n pageType,\n pageURISuffix,\n sendDataToGTM\n ]);\n};\nexport var useGtmVpvCallback = function() {\n var sendDataToGTM = useGTMDispatch();\n var i18n = useTranslation('main').i18n;\n var sendToGtmVpv = useCallback(function(param) {\n var pageType = param.pageType, pageTitle = param.pageTitle, pageURISuffix = param.pageURISuffix;\n var suffixString = pageURISuffix ? \"/\".concat(pageURISuffix) : '';\n sendDataToGTM({\n event: 'VPV',\n pageURL: \"\".concat(window.location.origin).concat(window.location.pathname).concat(suffixString),\n pageDOM: window.location.origin,\n pageURI: \"\".concat(window.location.pathname).concat(suffixString),\n pageType: pageType,\n pageTitle: pageTitle,\n language: i18n.language\n });\n }, [\n i18n.language,\n sendDataToGTM\n ]);\n return {\n sendToGtmVpv: sendToGtmVpv\n };\n};\n","import React, { ReactElement } from 'react'\r\n\r\nimport { BaseLayout, CompleteRegistrationForm } from '@auth-portal/components'\r\n\r\nconst CompleteRegistration: React.FC = () =>\r\n (\r\n \r\n \r\n \r\n ) as ReactElement\r\n\r\nexport default CompleteRegistration\r\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nimport { useCallback, useEffect, useRef, useState } from 'react';\nexport var useCounter = function() {\n var counterTimeout = useRef();\n var _useState = _sliced_to_array(useState(0), 2), counter = _useState[0], setCounter = _useState[1];\n var initCounter = useCallback(function(param) {\n var _param_count = param.count, count = _param_count === void 0 ? 30 : _param_count, _param_interval = param.interval, interval = _param_interval === void 0 ? 1000 : _param_interval;\n setCounter(count);\n counterTimeout.current = setInterval(function() {\n setCounter(function(val) {\n return val - 1;\n });\n }, interval);\n }, []);\n var resetCounter = useCallback(function() {\n setCounter(0);\n clearInterval(counterTimeout.current);\n counterTimeout.current = undefined;\n }, []);\n useEffect(function() {\n if (!counter && counterTimeout.current) {\n resetCounter();\n }\n }, [\n counter,\n resetCounter\n ]);\n useEffect(function() {\n return function() {\n if (counterTimeout.current) {\n resetCounter();\n }\n };\n }, [\n resetCounter\n ]);\n return {\n initCounter: initCounter,\n counter: counter,\n resetCounter: resetCounter\n };\n};\n","/* eslint-disable no-underscore-dangle */ function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nfunction _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useField } from 'formik';\nimport { useTranslation } from 'react-i18next';\nimport ReactCodeInput from 'react-verification-code-input';\nimport CheckCircleIcon from '@mui/icons-material/CheckCircle';\nimport CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';\nimport { Box, FormControl, FormHelperText, FormLabel, Grid, Typography, useTheme } from '@mui/material';\nimport { LinkButton } from '@procom-labs/atoms';\nimport { errorToString, useCounter } from '@procom-labs/common';\nimport { useAlert } from '../../hooks';\nexport var OtpInput = function(param) {\n var name = param.name, label = param.label, sendCode = param.sendCode, verifyCode = param.verifyCode, showValidationIcon = param.showValidationIcon, _param_fields = param.fields, fields = _param_fields === void 0 ? 6 : _param_fields, sx = param.sx, width = param.width, sendCodeOnInitialLoad = param.sendCodeOnInitialLoad;\n var theme = useTheme();\n var addAlert = useAlert().addAlert;\n var t = useTranslation('main').t;\n var _useField = _sliced_to_array(useField(name), 3), field = _useField[0], meta = _useField[1], helpers = _useField[2];\n var _useCounter = useCounter(), initCounter = _useCounter.initCounter, counter = _useCounter.counter;\n var _useState = _sliced_to_array(useState(false), 2), isVerifying = _useState[0], setIsVerifying = _useState[1];\n var codeRef = useRef(null);\n var subscriptionRef = useRef();\n var values = useMemo(function() {\n return field.value ? field.value.split('') : [];\n }, [\n field.value\n ]);\n var handleChange = useCallback(function() {\n if (meta.error) {\n helpers.setError('');\n }\n }, [\n helpers,\n meta.error\n ]);\n var clearSubscription = useCallback(function() {\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\n subscriptionRef.current.unsubscribe();\n subscriptionRef.current = null;\n }\n }, []);\n var handleSendCode = useCallback(function() {\n if (sendCode) {\n var _codeRef_current;\n setIsVerifying(true);\n handleChange();\n clearSubscription();\n (_codeRef_current = codeRef.current) === null || _codeRef_current === void 0 ? void 0 : _codeRef_current.__clearvalues__();\n subscriptionRef.current = sendCode().subscribe({\n complete: function() {\n initCounter({});\n },\n error: function(err) {\n var errorDesc = typeof err === 'string' ? errorToString(err) : err.message;\n addAlert({\n severity: 'error',\n message: errorDesc || 'Request failed'\n });\n }\n });\n subscriptionRef.current.add(function() {\n return setIsVerifying(false);\n });\n }\n }, [\n addAlert,\n clearSubscription,\n handleChange,\n initCounter,\n sendCode\n ]);\n var handleVerifyCode = useCallback(function(code) {\n var _subscriptionRef_current;\n if (!meta.touched) {\n helpers.setTouched(true);\n }\n setIsVerifying(true);\n clearSubscription();\n subscriptionRef.current = verifyCode(code).subscribe({\n next: function(param) {\n var isCodeValid = param.isCodeValid, hasCodeExpired = param.hasCodeExpired, hasReachedMaxAttempts = param.hasReachedMaxAttempts;\n if (isCodeValid) {\n helpers.setValue(code);\n } else {\n var _codeRef_current;\n if (hasCodeExpired) {\n handleSendCode();\n helpers.setError(t('common.inputs.otp.codeExpired'));\n } else if (hasReachedMaxAttempts) {\n helpers.setError(t('common.inputs.otp.maxAttempts'));\n } else {\n helpers.setError(t('common.inputs.otp.invalidCode'));\n }\n (_codeRef_current = codeRef.current) === null || _codeRef_current === void 0 ? void 0 : _codeRef_current.__clearvalues__();\n }\n },\n error: function(err) {\n var _codeRef_current;\n var errorDesc = typeof err === 'string' ? errorToString(err) : err.message;\n addAlert({\n severity: 'error',\n message: errorDesc || 'Request failed'\n });\n helpers.setTouched(false);\n (_codeRef_current = codeRef.current) === null || _codeRef_current === void 0 ? void 0 : _codeRef_current.__clearvalues__();\n }\n });\n (_subscriptionRef_current = subscriptionRef.current) === null || _subscriptionRef_current === void 0 ? void 0 : _subscriptionRef_current.add(function() {\n return setIsVerifying(false);\n });\n }, [\n addAlert,\n clearSubscription,\n handleSendCode,\n helpers,\n meta.touched,\n t,\n verifyCode\n ]);\n useEffect(function() {\n if (sendCode && sendCodeOnInitialLoad) {\n handleSendCode();\n }\n return clearSubscription;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useEffect(function() {\n return function() {\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\n subscriptionRef.current.unsubscribe();\n subscriptionRef.current = null;\n }\n };\n }, []);\n return /*#__PURE__*/ _jsxs(Box, {\n sx: _object_spread({}, sx),\n children: [\n /*#__PURE__*/ _jsxs(FormControl, {\n fullWidth: true,\n error: !!(!isVerifying && meta.touched && meta.error),\n sx: {\n '.code-input-ctn': {\n width: width !== null && width !== void 0 ? width : '100% !important',\n div: {\n display: 'flex',\n columnGap: 1,\n input: {\n flexBasis: 0,\n flexGrow: 1,\n borderRadius: '4px',\n fontFamily: 'inherit',\n width: '100% !important',\n caretColor: 'currentColor',\n border: \"solid 3px \".concat(theme.palette.primary.light),\n '&:focus': {\n border: \"solid 3px \".concat(theme.palette.primary.main)\n },\n '&:focus + input': {\n borderLeft: \"solid 3px \".concat(theme.palette.primary.light)\n }\n }\n },\n 'div[class*=\"styles_loading\"]': {\n height: '54px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n }\n }\n },\n children: [\n label ? /*#__PURE__*/ _jsx(FormLabel, {\n sx: {\n marginBottom: 2\n },\n children: label\n }) : null,\n /*#__PURE__*/ _jsx(ReactCodeInput, {\n autoFocus: true,\n className: \"code-input-ctn\",\n ref: codeRef,\n values: values,\n loading: isVerifying,\n onChange: handleChange,\n onComplete: handleVerifyCode,\n fields: fields\n }),\n showValidationIcon && /*#__PURE__*/ _jsxs(Grid, {\n mt: 2,\n container: true,\n flexWrap: \"nowrap\",\n columnGap: 1,\n alignItems: \"center\",\n children: [\n field.value ? /*#__PURE__*/ _jsx(CheckCircleIcon, {\n color: \"success\"\n }) : /*#__PURE__*/ _jsx(CheckCircleOutlineIcon, {}),\n /*#__PURE__*/ _jsx(Typography, {\n variant: \"caption\",\n children: t('common.inputs.otp.validation')\n })\n ]\n }),\n !isVerifying && meta.touched && meta.error && /*#__PURE__*/ _jsx(FormHelperText, {\n children: meta.error\n })\n ]\n }),\n !field.value && sendCode && /*#__PURE__*/ _jsxs(Grid, {\n item: true,\n container: true,\n xs: 12,\n mt: 3.2,\n mb: 2.2,\n columnGap: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n children: [\n /*#__PURE__*/ _jsx(Typography, {\n variant: \"body2\",\n color: \"text.secondary\",\n children: t('common.inputs.otp.noCode')\n }),\n /*#__PURE__*/ _jsx(LinkButton, {\n disabled: isVerifying || counter > 0,\n underline: false,\n onClick: handleSendCode,\n sx: {\n display: 'flex',\n alignItems: 'center'\n },\n children: /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n t('common.inputs.otp.resendBtn'),\n counter > 0 && /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n t('common.inputs.otp.resendIn'),\n \" \",\n counter\n ]\n })\n ]\n })\n })\n ]\n })\n ]\n });\n};\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\r\nimport { Field, Form, Formik } from 'formik'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useLocation, useSearchParams } from 'react-router-dom'\r\nimport { from, Subscription, switchMap } from 'rxjs'\r\nimport * as yup from 'yup'\r\n\r\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward'\r\nimport CheckCircleIcon from '@mui/icons-material/CheckCircle'\r\nimport CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'\r\nimport InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'\r\nimport VisibilityIcon from '@mui/icons-material/Visibility'\r\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff'\r\nimport {\r\n Button,\r\n CircularProgress as CircularProgressIcon,\r\n Grid,\r\n IconButton,\r\n InputAdornment,\r\n TextField,\r\n Typography,\r\n} from '@mui/material'\r\nimport { GorillaAlert } from '@procom-labs/atoms'\r\nimport {\r\n errorToString,\r\n HTTPResponseStatus,\r\n RecaptchaActions,\r\n} from '@procom-labs/common'\r\nimport { OtpInput, useAlert } from '@procom-labs/molecules'\r\n\r\nimport { useAuthService, useRecaptcha } from '../hooks'\r\n\r\ntype ExpiredPasswordPayload = {\r\n email: string\r\n password: string\r\n confirmPassword: string\r\n verificationCode: string\r\n}\r\n\r\ntype ExpiredPasswordParams = {\r\n email: string\r\n code: string\r\n}\r\n\r\nexport const ExpiredPasswordForm: React.FC<{}> = () => {\r\n const { addAlert } = useAlert()\r\n const { t } = useTranslation('main')\r\n\r\n const { state } = useLocation()\r\n\r\n const [searchParams] = useSearchParams()\r\n const paramEmail = searchParams.get('email')\r\n const paramCode = searchParams.get('code')\r\n\r\n const authService = useAuthService()\r\n\r\n const { email, code } = state\r\n ? (state as ExpiredPasswordParams)\r\n : { email: paramEmail || '', code: paramCode || '' }\r\n\r\n const subscriptionRef = useRef()\r\n\r\n const [meta, setMeta] = useState({\r\n showPassword: false,\r\n showConfirmPassword: false,\r\n })\r\n\r\n const { getRecaptchaToken, executeRecaptcha } = useRecaptcha()\r\n\r\n const initialValue: ExpiredPasswordPayload = useMemo(\r\n () => ({\r\n email,\r\n password: '',\r\n confirmPassword: '',\r\n verificationCode: '',\r\n }),\r\n [email]\r\n )\r\n\r\n const validationSchema = useMemo(\r\n () =>\r\n yup.object({\r\n codeVerified: yup.boolean().oneOf([true], 'Verification required'),\r\n password: yup\r\n .string()\r\n .required(t('form.changePassword.requiredError'))\r\n .min(6, t('form.passwordValidation.min6Characters'))\r\n .matches(/[A-Z]+/, t('form.passwordValidation.min1CapitalLetter'))\r\n .matches(/[a-z]+/, t('form.passwordValidation.min1LowerCaseLetter'))\r\n .matches(/\\d+/, t('form.passwordValidation.min1Number')),\r\n confirmPassword: yup\r\n .string()\r\n .required()\r\n .oneOf(\r\n [yup.ref('password'), null],\r\n t('form.passwordValidation.passwordMustMatch')\r\n ),\r\n }),\r\n [t]\r\n )\r\n\r\n const handleSubmit = (values: ExpiredPasswordPayload, actions: any): void => {\r\n actions.setSubmitting(false)\r\n subscriptionRef.current = from(getRecaptchaToken(RecaptchaActions.Signup))\r\n .pipe(\r\n switchMap((token: string) => {\r\n return authService.migrateSignUp(\r\n values.email,\r\n values.password,\r\n token,\r\n values.verificationCode,\r\n code\r\n )\r\n })\r\n )\r\n .subscribe({\r\n error: (error) => {\r\n const { status } = error.response\r\n addAlert({\r\n severity: 'error',\r\n message:\r\n status === HTTPResponseStatus.UnprocessableEntity\r\n ? t('common.alert.emailExist', {\r\n email,\r\n })\r\n : errorToString(error),\r\n })\r\n },\r\n })\r\n subscriptionRef.current.add(() => actions.setSubmitting(false))\r\n }\r\n\r\n const handleShowPassword = useCallback(\r\n () =>\r\n setMeta((obj) => ({\r\n ...obj,\r\n showPassword: !obj.showPassword,\r\n })),\r\n []\r\n )\r\n\r\n const handleShowConfirmPassword = useCallback(\r\n () =>\r\n setMeta((obj) => ({\r\n ...obj,\r\n showConfirmPassword: !obj.showConfirmPassword,\r\n })),\r\n []\r\n )\r\n\r\n const handleVerifyCode = useCallback(\r\n (otpCode: string) =>\r\n from(getRecaptchaToken(RecaptchaActions.RequestResetPassword)).pipe(\r\n switchMap((token: string) =>\r\n authService.validateVerficationCode(code, otpCode, token)\r\n )\r\n ),\r\n [getRecaptchaToken, code]\r\n )\r\n\r\n const handleSendCode = useCallback(() => {\r\n return from(getRecaptchaToken(RecaptchaActions.RequestResetPassword)).pipe(\r\n switchMap((token: string) => authService.sendVerficationCode(code, token))\r\n )\r\n }, [getRecaptchaToken, code])\r\n\r\n useEffect(() => {\r\n return () => {\r\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\r\n subscriptionRef.current.unsubscribe()\r\n subscriptionRef.current = null\r\n }\r\n }\r\n }, [])\r\n\r\n if (executeRecaptcha) {\r\n return (\r\n \r\n \r\n \r\n \r\n {t('form.expiredPassword.for')} \r\n \r\n \r\n {email}\r\n \r\n \r\n ,\r\n }}\r\n sx={{\r\n alignItems: 'center',\r\n borderRadius: '10px',\r\n maxWidth: 400,\r\n }}\r\n >\r\n \r\n {t('common.inputs.otp.alert')}\r\n \r\n \r\n \r\n\r\n \r\n {({ values, isSubmitting, errors, dirty }) => {\r\n return (\r\n \r\n \r\n {!values.verificationCode ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n \r\n {({ field }: any) => (\r\n \r\n \r\n {meta.showPassword ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n ),\r\n }}\r\n />\r\n )}\r\n \r\n \r\n \r\n {errors.password || !dirty ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n {t('form.passwordValidation.passwordValidation')}\r\n \r\n \r\n \r\n \r\n {({ field }: any) => (\r\n \r\n \r\n {meta.showConfirmPassword ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n ),\r\n }}\r\n />\r\n )}\r\n \r\n \r\n \r\n {errors.confirmPassword || !dirty ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n {t('form.passwordValidation.passwordMustMatch')}\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n\r\n \r\n \r\n ) : (\r\n \r\n )\r\n }\r\n disabled={isSubmitting || !values.verificationCode}\r\n >\r\n {t('common.btn.login')}\r\n \r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n )\r\n }\r\n return null\r\n}\r\n","import { BaseLayout, Header } from '@auth-portal/components'\r\nimport { ExpiredPasswordForm } from '@auth-portal/components/expired-password-form'\r\nimport React from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nexport const ExpiredPasswordRoute: React.FC<{}> = () => {\r\n const { t } = useTranslation('main')\r\n\r\n return (\r\n \r\n \r\n \r\n\r\n \r\n
\r\n \r\n )\r\n}\r\n","import React, { useCallback, useEffect, useMemo } from 'react'\r\nimport { useNavigate, useSearchParams } from 'react-router-dom'\r\n\r\nimport {\r\n ClientQueryParams,\r\n useRollbarInstance,\r\n useSubscriptionRef,\r\n} from '@procom-labs/common'\r\n\r\nimport { useAuthService } from '@auth-portal/hooks'\r\n\r\nconst InitialRoute: React.FC<{}> = () => {\r\n const rollbarInstance = useRollbarInstance()\r\n const navigate = useNavigate()\r\n const [searchParams] = useSearchParams()\r\n const userInfosSubscriptionRef = useSubscriptionRef()\r\n const authPortalRoute = searchParams.get(ClientQueryParams.authPortalRoute)\r\n\r\n const authService = useAuthService()\r\n\r\n const isGetUserEnabled = useMemo(\r\n () =>\r\n !!authPortalRoute &&\r\n !['verifyEmail', 'activateFboInvitation'].includes(authPortalRoute),\r\n [authPortalRoute]\r\n )\r\n\r\n const saveClientPortalParams = useCallback(\r\n (params: string[]): void => {\r\n params.forEach((param) => {\r\n const paramValue = searchParams.get(param)\r\n const searchParam = paramValue ? decodeURIComponent(paramValue) : null\r\n // We delete every stored params to make sure they are no leftovers from the last login attempt\r\n localStorage.removeItem(param)\r\n\r\n if (searchParam) localStorage.setItem(param, searchParam)\r\n })\r\n },\r\n [searchParams]\r\n )\r\n\r\n useEffect(() => {\r\n searchParams.delete('lang')\r\n }, [])\r\n\r\n const paramsRoute = useMemo(\r\n () =>\r\n Object.fromEntries(\r\n Array.from(searchParams.entries()).filter(\r\n ([key]) => !Object.keys(ClientQueryParams).includes(key)\r\n )\r\n ),\r\n [searchParams]\r\n )\r\n\r\n const redirectToInitialRoute = useCallback(() => {\r\n const route = searchParams.get(ClientQueryParams.authPortalRoute)\r\n const redirectToParam = route ? decodeURIComponent(route) : null\r\n\r\n if (redirectToParam) {\r\n const code = searchParams.get('code') || ''\r\n const token = searchParams.get('token') || ''\r\n const email = searchParams.get('email') || ''\r\n const loginType = searchParams.get(ClientQueryParams.loginType) || ''\r\n\r\n // Every requested pages goes through this route first.\r\n // Then if a callbackURL is valid, the user is redirect to a route that match the redirectToParam.\r\n const routesMapping: any = {\r\n changePassword: {\r\n pathname: '/change-password',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n })}`,\r\n },\r\n login: {\r\n pathname: '/',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n })}`,\r\n },\r\n signup: {\r\n pathname: '/signup',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n loginType,\r\n })}`,\r\n },\r\n signupEmail: {\r\n pathname: '/signup-email',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n loginType,\r\n })}`,\r\n },\r\n completeRegistration: {\r\n pathname: '/complete-registration',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n })}`,\r\n },\r\n verifyEmail: {\r\n pathname: '/verify-email',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n loginType,\r\n })}`,\r\n state: {\r\n token,\r\n },\r\n },\r\n activateFboInvitation: {\r\n pathname: '/activate-fbo-invitation',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n })}`,\r\n },\r\n resetExpiredPassword: {\r\n pathname: '/reset-expired-password',\r\n state: {\r\n code,\r\n email,\r\n },\r\n },\r\n welcome: {\r\n pathname: '/welcome',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n loginType,\r\n })}`,\r\n },\r\n resetPassword: {\r\n pathname: '/reset-password',\r\n search: `?${new URLSearchParams({\r\n ...paramsRoute,\r\n email,\r\n })}`,\r\n },\r\n }\r\n\r\n if (email) {\r\n rollbarInstance.configure({\r\n payload: {\r\n person: { id: email, email }, // id is same as email to avoid TS error\r\n },\r\n })\r\n }\r\n const routeMapped = routesMapping[redirectToParam]\r\n navigate(routeMapped, {\r\n replace: true,\r\n state: routeMapped?.state,\r\n })\r\n }\r\n }, [navigate, paramsRoute, searchParams])\r\n\r\n useEffect(() => {\r\n saveClientPortalParams(Object.values(ClientQueryParams))\r\n if (isGetUserEnabled) {\r\n userInfosSubscriptionRef.current = authService\r\n .refreshUserSessionInfo()\r\n .subscribe({\r\n next: ({ idToken }) =>\r\n authService.redirectToClientPortal({ token: idToken }),\r\n })\r\n\r\n // When getUserInfosAndRedirect completes or throw an error (meaning no valid user), we redirect the user to the requested route\r\n userInfosSubscriptionRef.current.add(() => redirectToInitialRoute())\r\n } else {\r\n redirectToInitialRoute()\r\n }\r\n }, [\r\n isGetUserEnabled,\r\n redirectToInitialRoute,\r\n saveClientPortalParams,\r\n userInfosSubscriptionRef,\r\n ])\r\n\r\n return null\r\n}\r\n\r\nexport default InitialRoute\r\n","import React, { ReactElement } from 'react'\r\n\r\nimport { BaseLayout, LandingForm } from '@auth-portal/components'\r\n\r\nconst LoginPage: React.FC<{}> = () => {\r\n return (\r\n \r\n \r\n \r\n ) as ReactElement\r\n}\r\n\r\nexport default LoginPage\r\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nfunction _async_to_generator(fn) {\n return function() {\n var self = this, args = arguments;\n return new Promise(function(resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\nfunction _ts_generator(thisArg, body) {\n var f, y, t, g, _ = {\n label: 0,\n sent: function() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n };\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() {\n return this;\n }), g;\n function verb(n) {\n return function(v) {\n return step([\n n,\n v\n ]);\n };\n }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while(_)try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [\n op[0] & 2,\n t.value\n ];\n switch(op[0]){\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n case 5:\n _.label++;\n y = op[1];\n op = [\n 0\n ];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [\n 6,\n e\n ];\n y = 0;\n } finally{\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nimport { useCallback } from 'react';\nimport { useGoogleReCaptcha } from 'react-google-recaptcha-v3';\nimport { useRollbarInstance } from './use-configs';\nexport var useRecaptcha = function() {\n var rollbarInstance = useRollbarInstance();\n var executeRecaptcha = useGoogleReCaptcha().executeRecaptcha;\n var getRecaptchaToken = useCallback(/*#__PURE__*/ function() {\n var _ref = _async_to_generator(function(action) {\n var e;\n return _ts_generator(this, function(_state) {\n switch(_state.label){\n case 0:\n if (!executeRecaptcha) {\n throw new Error('executeRecaptcha is not ready');\n }\n _state.label = 1;\n case 1:\n _state.trys.push([\n 1,\n 3,\n ,\n 4\n ]);\n return [\n 4,\n executeRecaptcha(action)\n ];\n case 2:\n return [\n 2,\n _state.sent()\n ];\n case 3:\n e = _state.sent();\n rollbarInstance.error(e);\n return [\n 2,\n ''\n ];\n case 4:\n return [\n 2\n ];\n }\n });\n });\n return function(action) {\n return _ref.apply(this, arguments);\n };\n }(), [\n executeRecaptcha,\n rollbarInstance\n ]);\n return {\n executeRecaptcha: executeRecaptcha,\n getRecaptchaToken: getRecaptchaToken\n };\n};\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _object_spread(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n return target;\n}\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useMemo } from 'react';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { EMPTY, from, switchMap, tap } from 'rxjs';\nimport { useObservable } from 'rxjs-hooks';\nimport { Box, Divider, Link, Typography } from '@mui/material';\nimport { AlertMessage, LinkButton } from '@procom-labs/atoms';\nimport { EmailSupportLinks, LoginTypes, mfaCodeVerificationLens, MfaTypes, RecaptchaActions, useAuthService, useMfaService, useMfaStore, useRecaptcha, useSubjectSelector, useSubscriptionRef } from '@procom-labs/common';\nimport { OtpInput, useAlert } from '@procom-labs/molecules';\nexport var MfaLoginCodeVerification = function(param) {\n var currentCognitoUserEmail = param.currentCognitoUserEmail, _param_showEmail = param.showEmail, showEmail = _param_showEmail === void 0 ? true : _param_showEmail, loginType = param.loginType;\n var authService = useAuthService();\n var mfaService = useMfaService();\n var mfaStore = useMfaStore();\n var contactUsLink = useMemo(function() {\n return (loginType === null || loginType === void 0 ? void 0 : loginType.toLowerCase()) === LoginTypes.Client.toLowerCase() ? \"mailto:\".concat(EmailSupportLinks.GorillaWorks) : \"mailto:\".concat(EmailSupportLinks.ClientConnections);\n }, [\n loginType\n ]);\n var t = useTranslation('main').t;\n var addAlert = useAlert().addAlert;\n var getRecaptchaToken = useRecaptcha().getRecaptchaToken;\n var currentCognitoUser = useObservable(function() {\n return authService.currentCognitoUser$;\n });\n var _useSubjectSelector = useSubjectSelector(mfaStore, [\n 'preferredMfaMethod',\n 'mfaType'\n ]), preferredMfaMethod = _useSubjectSelector.preferredMfaMethod, mfaType = _useSubjectSelector.mfaType;\n var subscrptionRef = useSubscriptionRef();\n var cognitoUserHasMultipleMfaMethods = useObservable(function() {\n return authService.cognitoUserHasMultipleMfaMethods$;\n });\n var handleVerifyCode = useCallback(function(otpCode) {\n return from(getRecaptchaToken(RecaptchaActions.Mfa)).pipe(switchMap(function() {\n if (currentCognitoUser && currentCognitoUserEmail) return mfaService.handleSendMfaCode({\n code: otpCode,\n currentCognitoUserEmail: currentCognitoUserEmail,\n currentCognitoUser: currentCognitoUser\n });\n return EMPTY;\n }));\n }, [\n currentCognitoUser,\n currentCognitoUserEmail,\n getRecaptchaToken,\n mfaService\n ]);\n var handleSelectMfaMethod = useCallback(function(type) {\n if (currentCognitoUserEmail) {\n return authService.authenticate({\n username: currentCognitoUserEmail,\n password: authService.currentCognitoUserPasswordSubject.value\n }).pipe(switchMap(function() {\n if (type) return mfaService.handleSelectMfaType({\n mfaType: type,\n currentCognitoUser: authService.currentCognitoUserSubject.value || currentCognitoUser,\n currentCognitoUserEmail: currentCognitoUserEmail\n });\n return EMPTY;\n }));\n }\n return EMPTY;\n }, [\n authService,\n currentCognitoUser,\n currentCognitoUserEmail,\n mfaService\n ]);\n var handleSelectMfaMethodSubscription = useCallback(function(type) {\n var showAlert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n subscrptionRef.current = handleSelectMfaMethod(type).subscribe({\n next: function() {\n if (showAlert) addAlert({\n severity: 'success',\n message: t('common.mfa.alerts.mfaMethodChanged', {\n mfaMethod: t(\"common.mfa.types.\".concat(type.toLowerCase()))\n })\n });\n }\n });\n }, [\n addAlert,\n handleSelectMfaMethod,\n t,\n subscrptionRef\n ]);\n useEffect(function() {\n var subscription = null;\n if (currentCognitoUserEmail && currentCognitoUser && !preferredMfaMethod && cognitoUserHasMultipleMfaMethods) {\n subscription = mfaService.getPreferredMfaMethod(currentCognitoUserEmail).pipe(tap(function(type) {\n mfaStore.dispatch({\n mfaType: type\n });\n handleSelectMfaMethodSubscription(type);\n })).subscribe();\n }\n return function() {\n if (subscription && !subscription.closed) {\n subscription.unsubscribe();\n subscription = null;\n }\n };\n }, [\n currentCognitoUser,\n cognitoUserHasMultipleMfaMethods,\n currentCognitoUserEmail,\n handleSelectMfaMethodSubscription,\n mfaService,\n mfaStore,\n preferredMfaMethod\n ]);\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(Typography, {\n variant: \"h5\",\n component: \"h1\",\n sx: {\n textAlign: 'center',\n marginBlockEnd: 2\n },\n children: t('organisms.mfaLoginCodeVerification.heading')\n }),\n showEmail ? /*#__PURE__*/ _jsx(Typography, {\n variant: \"body2\",\n sx: {\n textAlign: 'center',\n marginBlockEnd: 2\n },\n children: /*#__PURE__*/ _jsx(Trans, {\n i18nKey: \"organisms.mfaLoginCodeVerification.subHeading\",\n values: {\n email: currentCognitoUserEmail\n }\n })\n }) : null,\n mfaType && /*#__PURE__*/ _jsx(AlertMessage, {\n severity: \"info\",\n sx: {\n marginBlockEnd: 4\n },\n children: t(\"organisms.mfaLoginCodeVerification.info.\".concat(mfaType.toLowerCase()))\n }),\n /*#__PURE__*/ _jsx(Divider, {\n sx: {\n marginBlockEnd: 4,\n width: '100%'\n }\n }),\n /*#__PURE__*/ _jsx(OtpInput, _object_spread({\n name: mfaCodeVerificationLens.verificationCode.$key(),\n verifyCode: handleVerifyCode,\n sx: {\n '& .code-input-ctn': {\n maxWidth: 250,\n margin: 'auto'\n },\n '& .MuiFormHelperText-root': {\n textAlign: 'center'\n },\n marginBlockEnd: 4\n }\n }, mfaType === MfaTypes.SMS ? {\n sendCode: function() {\n return handleSelectMfaMethod(MfaTypes.SMS);\n }\n } : {})),\n cognitoUserHasMultipleMfaMethods && preferredMfaMethod && /*#__PURE__*/ _jsx(Box, {\n sx: {\n textAlign: 'center',\n marginBlockEnd: 6\n },\n children: preferredMfaMethod === MfaTypes.Authenticator ? /*#__PURE__*/ _jsx(LinkButton, {\n onClick: function() {\n return handleSelectMfaMethodSubscription(MfaTypes.SMS, true);\n },\n children: t('organisms.mfaLoginCodeVerification.mfaMethodUnavailable.totp')\n }) : /*#__PURE__*/ _jsx(LinkButton, {\n onClick: function() {\n return handleSelectMfaMethodSubscription(MfaTypes.Authenticator, true);\n },\n children: t('organisms.mfaLoginCodeVerification.mfaMethodUnavailable.sms')\n })\n }),\n /*#__PURE__*/ _jsx(Box, {\n sx: {\n textAlign: 'center',\n marginBlockEnd: 6\n },\n children: /*#__PURE__*/ _jsxs(Typography, {\n variant: \"body2\",\n sx: {\n marginBlockEnd: 2\n },\n children: [\n t('organisms.mfaLoginCodeVerification.havingTrouble'),\n /*#__PURE__*/ _jsx(Link, {\n href: contactUsLink,\n children: t('organisms.mfaLoginCodeVerification.contactUs')\n })\n ]\n })\n })\n ]\n });\n};\n","import { FC, useCallback, useEffect } from 'react'\r\nimport { Form, Formik } from 'formik'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Link, useNavigate } from 'react-router-dom'\r\nimport * as Yup from 'yup'\r\n\r\nimport { Button } from '@mui/material'\r\nimport { useSubjectSelector } from '@procom-labs/common'\r\nimport { MfaLoginCodeVerification } from '@procom-labs/organisms'\r\n\r\nimport { BaseLayout, Header } from '@auth-portal/components'\r\nimport { useAuthService } from '@auth-portal/hooks'\r\nimport { authStore } from '@auth-portal/store'\r\n\r\nconst initialValues = {\r\n verificationCode: '',\r\n}\r\n\r\nexport const LoginMfa: FC = () => {\r\n const navigate = useNavigate()\r\n const { t } = useTranslation('main')\r\n\r\n const authService = useAuthService()\r\n\r\n const { loginType } = useSubjectSelector(authStore, ['loginType'])\r\n\r\n const { currentCognitoUserEmail, isCognitoUserSessionExpired } =\r\n useSubjectSelector(authStore, [\r\n 'currentCognitoUserEmail',\r\n 'isCognitoUserSessionExpired',\r\n ])\r\n\r\n const validationSchema = Yup.object().shape({\r\n verificationCode: Yup.string().required(t('common.form.code.error')),\r\n })\r\n\r\n const handleSubmit = useCallback(() => {}, [])\r\n\r\n useEffect(() => {\r\n if (isCognitoUserSessionExpired) {\r\n authStore.setCognitoUserSession(false)\r\n navigate('/?sessionExpired=true')\r\n }\r\n }, [isCognitoUserSessionExpired, navigate])\r\n\r\n const handleResetCognito = useCallback(() => {\r\n authService.resetCognito()\r\n }, [])\r\n\r\n return (\r\n \r\n <>\r\n \r\n \r\n \r\n \r\n >\r\n \r\n )\r\n}\r\n","import { useCallback, useEffect } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nimport { useTrackingWrapper } from './use-tracking-wrapper'\r\n\r\ninterface IUseGtmVpv {\r\n pageType: string\r\n pageTitle: string\r\n}\r\n\r\n// Send Google Tag Manager Virtual Page View\r\nexport const useGtmVpv = ({ pageType, pageTitle }: IUseGtmVpv): void => {\r\n const { track } = useTrackingWrapper()\r\n const { i18n } = useTranslation('main')\r\n\r\n useEffect(() => {\r\n track({\r\n eventName: 'VPV',\r\n pageURL: window.location.origin + window.location.pathname,\r\n pageDOM: window.location.origin,\r\n pageURI: window.location.pathname,\r\n pageType,\r\n pageTitle,\r\n language: i18n.language,\r\n })\r\n }, [i18n.language, pageTitle, pageType, track])\r\n}\r\n\r\nexport const useGtmVpvCallback = (): {\r\n sendToGtmVpv: ({ pageType, pageTitle }: IUseGtmVpv) => void\r\n} => {\r\n const { track } = useTrackingWrapper()\r\n const { i18n } = useTranslation('main')\r\n\r\n const sendToGtmVpv = useCallback(\r\n ({ pageType, pageTitle }: IUseGtmVpv) => {\r\n track({\r\n eventName: 'VPV',\r\n pageURL: window.location.origin + window.location.pathname,\r\n pageDOM: window.location.origin,\r\n pageURI: window.location.pathname,\r\n pageType,\r\n pageTitle,\r\n language: i18n.language,\r\n })\r\n },\r\n [i18n.language, track]\r\n )\r\n\r\n return { sendToGtmVpv }\r\n}\r\n","import React, { useEffect } from 'react'\r\nimport { useNavigate } from 'react-router-dom'\r\n\r\nimport { PageTypes } from '@procom-labs/common'\r\n\r\nimport { useAuthService } from '@auth-portal/hooks'\r\nimport { useGtmVpv } from '@auth-portal/hooks/use-gtm-vpv'\r\n\r\nconst Logout: React.FC<{}> = () => {\r\n const navigate = useNavigate()\r\n const authService = useAuthService()\r\n\r\n useGtmVpv({\r\n pageType: PageTypes.Logout,\r\n pageTitle: PageTypes.Logout,\r\n })\r\n\r\n useEffect(() => {\r\n const subscription = authService.logout().subscribe()\r\n subscription.add(() => {\r\n const searchParams = new URLSearchParams(window.location.search)\r\n navigate(`/initial-auth-route?${searchParams}`)\r\n })\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [navigate])\r\n\r\n return null\r\n}\r\n\r\nexport default Logout\r\n","import { FC, useCallback, useEffect, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate } from 'react-router-dom'\r\n\r\nimport { Box } from '@mui/material'\r\nimport {\r\n errorToString,\r\n SubmissionTrackingStatus,\r\n UnProtectedLinksEnum,\r\n} from '@procom-labs/common'\r\n\r\nimport { useTrackingWrapper } from '@auth-portal/hooks'\r\nimport { useMsSsoLogin } from '@auth-portal/hooks/use-ms-sso-login'\r\nimport { ssoLoginTrackingDate } from '@auth-portal/util/get-tracking-data'\r\nimport { useMsal } from '@azure/msal-react'\r\n\r\nexport const MsSsoCallBack: FC = () => {\r\n const navigate = useNavigate()\r\n const { t } = useTranslation('main')\r\n const { accounts } = useMsal()\r\n const { handleMsSsoRedirect } = useMsSsoLogin()\r\n const { track } = useTrackingWrapper()\r\n const [errorString, setErrorString] = useState(undefined)\r\n const handleErrorMessages = useCallback(\r\n (errorMessage: string | undefined) => {\r\n setErrorString(errorMessage)\r\n },\r\n []\r\n )\r\n\r\n useEffect(() => {\r\n const subscription = handleMsSsoRedirect().subscribe({\r\n error: (err) => {\r\n track({\r\n ...ssoLoginTrackingDate(accounts[0], SubmissionTrackingStatus.Failed),\r\n errorMessage: errorToString(err),\r\n })\r\n handleErrorMessages?.(t('somethingWrong'))\r\n navigate(UnProtectedLinksEnum.Login)\r\n },\r\n })\r\n return () => {\r\n subscription.unsubscribe()\r\n }\r\n }, [accounts, handleErrorMessages, handleMsSsoRedirect, navigate, t, track])\r\n\r\n return (\r\n \r\n {t('form.login.verifyEmail.redirectLoading')}\r\n {errorString && (\r\n \r\n {errorString}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { Box, styled } from '@mui/material';\nimport { GorillaGrid } from '@procom-labs/atoms';\nvar Header = styled('div')(function(param) {\n var theme = param.theme;\n return _define_property({\n borderBottom: 'none',\n marginBottom: 16\n }, theme.breakpoints.up('sm'), {\n marginBottom: 24\n });\n});\nexport var LegalDocuments = function(param) {\n var children = param.children;\n return /*#__PURE__*/ _jsx(GorillaGrid, {\n isGlassMode: true,\n isThemeBackgroundApplied: true,\n sx: {\n borderRadius: '20px',\n pl: {\n xs: 1,\n sm: 2,\n md: 8\n },\n pr: {\n xs: 1,\n sm: 2,\n md: 15\n }\n },\n children: /*#__PURE__*/ _jsx(Header, {\n children: /*#__PURE__*/ _jsx(Box, {\n children: children\n })\n })\n });\n};\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Suspense, useEffect, useMemo, useState } from 'react';\nimport Parse from 'html-react-parser';\nimport { useTranslation } from 'react-i18next';\nimport { catchError, from, map } from 'rxjs';\nimport { useObservable } from 'rxjs-hooks';\nimport { Preloader } from '@procom-labs/atoms';\nimport { ClientNames, PreferredLanguageType, toKebabCase, useClientService } from '@procom-labs/common';\nimport { LegalDocuments } from './legal-documents';\nvar style = \"\";\nvar getPrivacyFetchRequest = function(clientName, lang) {\n return from(import(\"../../assets/html/\".concat(clientName, \"/privacy-policy-\").concat(lang)));\n};\nexport var PrivacyPolicyPage = /*#__PURE__*/ React.memo(function(param) {\n var handleBack = param.handleBack, lang = param.lang;\n var i18n = useTranslation('main').i18n;\n var clientService = useClientService();\n var _useState = _sliced_to_array(useState(''), 2), content = _useState[0], setContent = _useState[1];\n var clientName = useObservable(function() {\n return clientService.clientSetting$.pipe(map(function(settings) {\n return settings ? toKebabCase(settings.common.name) : null;\n }));\n }, null);\n var localLng = useMemo(function() {\n var _i18n_language;\n return lang || ((_i18n_language = i18n.language) === null || _i18n_language === void 0 ? void 0 : _i18n_language.toLowerCase()) || PreferredLanguageType.EN;\n }, [\n lang,\n i18n.language\n ]);\n var parsedHtml = useMemo(function() {\n return (content === null || content === void 0 ? void 0 : content.trim()) ? Parse(style + content) : '';\n }, [\n content\n ]);\n useEffect(function() {\n var subscription = null;\n if (clientName) {\n subscription = getPrivacyFetchRequest(clientName, localLng).pipe(catchError(function() {\n return getPrivacyFetchRequest(ClientNames.Procom.toLowerCase(), localLng);\n })).subscribe({\n next: function(value) {\n setContent(value.PrivacyPolicy);\n },\n error: function() {\n return setContent('');\n }\n });\n }\n return function() {\n if (subscription && !subscription.closed) {\n subscription.unsubscribe();\n }\n };\n }, [\n clientName,\n localLng\n ]);\n if (content) {\n return /*#__PURE__*/ _jsx(Suspense, {\n fallback: /*#__PURE__*/ _jsx(Preloader, {\n center: true\n }),\n children: /*#__PURE__*/ _jsx(LegalDocuments, {\n handleBack: handleBack,\n children: parsedHtml\n })\n });\n }\n return null;\n});\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useLocation } from 'react-router-dom';\nimport { Box, Link, Typography } from '@mui/material';\nimport { FrictionLessViewNoAccessContent } from '@procom-labs/common';\nexport var Footer = function(param) {\n var _param_showLinks = param.showLinks, showLinks = _param_showLinks === void 0 ? true : _param_showLinks;\n var t = useTranslation('main').t;\n var location = useLocation();\n var isFrictionLessView = location.pathname === FrictionLessViewNoAccessContent;\n return /*#__PURE__*/ _jsx(Box, {\n sx: {\n width: '100%',\n position: 'sticky',\n margin: 0,\n height: {\n xs: 'fit-content',\n md: 54\n },\n paddingBottom: 0,\n flexDirection: {\n xs: 'column',\n md: 'row'\n }\n },\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n children: /*#__PURE__*/ _jsx(Box, {\n display: \"flex\",\n alignItems: \"center\",\n columnGap: 1,\n sx: {\n marginLeft: {\n md: 9,\n xl: 12\n },\n marginBlock: {\n md: 2\n }\n },\n children: showLinks && !isFrictionLessView && /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(Link, {\n href: \"/terms-of-use\",\n target: \"_blank\",\n variant: \"caption\",\n children: t('common.footer.termsOfUse')\n }),\n /*#__PURE__*/ _jsx(Typography, {\n display: \"inline\",\n variant: \"h5\",\n sx: {\n marginTop: '2px',\n color: function(theme) {\n return theme.palette.grey[500];\n }\n },\n children: '\\u2022'\n }),\n /*#__PURE__*/ _jsx(Link, {\n href: \"/privacy-policy\",\n target: \"_blank\",\n variant: \"caption\",\n children: t('common.footer.privacyPolicy')\n })\n ]\n })\n })\n });\n};\n","import React, { ReactElement } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { useObservable } from 'rxjs-hooks'\r\n\r\nimport { Grid } from '@mui/material'\r\nimport {\r\n IClientSettings,\r\n IPrivacyPolicyURL,\r\n PageTypes,\r\n useClientService,\r\n} from '@procom-labs/common'\r\nimport {\r\n Footer,\r\n PrivacyPolicyPage as PrivacyPolicyDetail,\r\n} from '@procom-labs/organisms'\r\n\r\nimport { LegalDocumentLayout } from '@auth-portal/components'\r\nimport { useGtmVpv } from '@auth-portal/hooks/use-gtm-vpv'\r\n\r\nconst PrivacyPolicyPage: React.FC = () => {\r\n const navigate = useNavigate()\r\n\r\n const { i18n, t } = useTranslation('main')\r\n\r\n const clientService = useClientService()\r\n\r\n const localLng = i18n.language?.toLowerCase()\r\n\r\n const clientSettings: IClientSettings | null = useObservable(\r\n () => clientService.clientSetting$\r\n )\r\n\r\n useGtmVpv({\r\n pageType: PageTypes.PrivacyPolicy,\r\n pageTitle: PageTypes.PrivacyPolicy,\r\n })\r\n\r\n if (clientSettings?.common.privacyPolicyURL && localLng) {\r\n window.location.href =\r\n clientSettings.common.privacyPolicyURL[\r\n localLng as keyof IPrivacyPolicyURL\r\n ]\r\n return null\r\n }\r\n return (\r\n \r\n \r\n navigate(`/`)} />\r\n \r\n \r\n \r\n ) as ReactElement\r\n}\r\n\r\nexport default PrivacyPolicyPage\r\n","import React, { ReactElement } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nimport { PageTypes } from '@procom-labs/common'\r\n\r\nimport { BaseLayout, ResetPasswordForm } from '@auth-portal/components'\r\nimport { useGtmVpv } from '@auth-portal/hooks/use-gtm-vpv'\r\n\r\nconst ResetPassword: React.FC = () => {\r\n const { t } = useTranslation('main')\r\n useGtmVpv({\r\n pageType: PageTypes.ForgotPassword,\r\n pageTitle: t('form.reset.title', { lng: 'en' }),\r\n })\r\n\r\n return (\r\n \r\n \r\n \r\n ) as ReactElement\r\n}\r\n\r\nexport default ResetPassword\r\n","import React, { useEffect } from 'react'\r\nimport { useNavigate, useSearchParams } from 'react-router-dom'\r\nimport { Subscription } from 'rxjs'\r\n\r\nimport { useAuthService } from '@auth-portal/hooks'\r\nimport { FailedSocialLoginCallbackUrl } from '@auth-portal/util'\r\n\r\nconst SignInLinkedinCallback: React.FC<{}> = () => {\r\n const [searchParams] = useSearchParams()\r\n const navigate = useNavigate()\r\n const stateParam = searchParams.get('state')\r\n\r\n const authService = useAuthService()\r\n\r\n const state: {\r\n campaignId: string\r\n } | null = stateParam\r\n ? JSON.parse(decodeURIComponent(window.atob(stateParam))) // Decode needed for special chars\r\n : null\r\n useEffect(() => {\r\n const code = searchParams.get('code')\r\n const subscription = new Subscription()\r\n\r\n if (code)\r\n subscription.add(\r\n authService.linkedinLogin(code, state?.campaignId || null).subscribe()\r\n )\r\n else navigate(FailedSocialLoginCallbackUrl())\r\n\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [navigate, searchParams, state?.campaignId])\r\n\r\n return null\r\n}\r\n\r\nexport default SignInLinkedinCallback\r\n","import React, { useEffect } from 'react'\r\nimport { useNavigate, useSearchParams } from 'react-router-dom'\r\nimport { Subscription } from 'rxjs'\r\n\r\nimport { useAuthService } from '@auth-portal/hooks'\r\nimport { FailedSocialLoginCallbackUrl } from '@auth-portal/util'\r\n\r\nconst SignInSocialCallback: React.FC<{}> = () => {\r\n const [searchParams] = useSearchParams()\r\n const navigate = useNavigate()\r\n const stateParam = searchParams.get('state')\r\n\r\n const authService = useAuthService()\r\n\r\n const state: {\r\n campaignId: string\r\n } | null = stateParam\r\n ? JSON.parse(decodeURIComponent(window.atob(stateParam))) // Decode needed for special chars\r\n : null\r\n\r\n useEffect(() => {\r\n const code = searchParams.get('code')\r\n const subscription = new Subscription()\r\n if (code) {\r\n subscription.add(\r\n authService\r\n .getSocialLoginAwsToken(code, state?.campaignId || null)\r\n .subscribe()\r\n )\r\n } else {\r\n navigate(FailedSocialLoginCallbackUrl())\r\n }\r\n\r\n return () => {\r\n if (subscription && !subscription.closed) {\r\n subscription.unsubscribe()\r\n }\r\n }\r\n }, [navigate, searchParams, state?.campaignId])\r\n\r\n return null\r\n}\r\n\r\nexport default SignInSocialCallback\r\n","export var EntityTypes = /*#__PURE__*/ function(EntityTypes) {\n EntityTypes[\"ClientJob\"] = \"ClientJob\";\n EntityTypes[\"TalentPool\"] = \"TalentPool\";\n EntityTypes[\"OnboardingRequest\"] = \"OnboardingRequest\";\n EntityTypes[\"OnboardingPackage\"] = \"OnboardingPackage\";\n return EntityTypes;\n}({});\nexport var CollaboratorTypes = /*#__PURE__*/ function(CollaboratorTypes) {\n CollaboratorTypes[\"Collaborator\"] = \"Collaborator\";\n CollaboratorTypes[\"Guest\"] = \"Guest\";\n CollaboratorTypes[\"AccountManager\"] = \"AccountManager\";\n return CollaboratorTypes;\n}({});\n","import React, { useCallback, useEffect, useRef, useState } from 'react'\r\nimport { Field, Form, Formik, FormikHelpers } from 'formik'\r\nimport { TextField } from 'formik-mui'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate, useSearchParams } from 'react-router-dom'\r\nimport { EMPTY, from, map, Subscription, switchMap, tap } from 'rxjs'\r\nimport { useObservable } from 'rxjs-hooks'\r\nimport * as Yup from 'yup'\r\n\r\nimport VisibilityIcon from '@mui/icons-material/Visibility'\r\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff'\r\nimport { LoadingButton } from '@mui/lab'\r\nimport {\r\n AlertTitle,\r\n FormControl,\r\n FormControlLabel,\r\n FormGroup,\r\n Grid,\r\n IconButton,\r\n InputAdornment,\r\n Radio,\r\n Stack,\r\n Typography,\r\n} from '@mui/material'\r\nimport { GorillaAlert, Preloader } from '@procom-labs/atoms'\r\nimport {\r\n EntityTypes,\r\n RecaptchaActions,\r\n useClientService,\r\n useRollbarInstance,\r\n validFirstNameRegex,\r\n validLastNameRegex,\r\n validPasswordRegex,\r\n} from '@procom-labs/common'\r\nimport { useAlert } from '@procom-labs/molecules'\r\n\r\nimport { Header } from '@auth-portal/components'\r\nimport { useAuthService, useRecaptcha } from '@auth-portal/hooks'\r\nimport { IClientPortalSignup, ValidationType } from '@auth-portal/types'\r\nimport {\r\n DefaultPasswordValidationState,\r\n passwordValidations,\r\n} from '@auth-portal/util'\r\n\r\nimport {\r\n RenderCheckbox,\r\n validatePassword,\r\n} from '../components/password-validation'\r\n\r\nexport const ClientSignup: React.FC<{}> = () => {\r\n const { t } = useTranslation('main')\r\n\r\n const rollbarInstance = useRollbarInstance()\r\n const authService = useAuthService()\r\n const clientService = useClientService()\r\n\r\n const rememberMeStorageKey = useObservable(\r\n () =>\r\n clientService.clientName$.pipe(\r\n map((name) => `${name ? name.toLowerCase() : 'portal'}.rememberme`)\r\n ),\r\n ''\r\n )\r\n const subscriptionRef = useRef()\r\n\r\n const [initialCredentials] = useState({\r\n firstName: '',\r\n lastName: '',\r\n password: '',\r\n confirmPassword: '',\r\n rememberMe: false,\r\n })\r\n\r\n const [passwordValidation, setPasswordValidation] = useState<\r\n ValidationType[]\r\n >(DefaultPasswordValidationState)\r\n\r\n const [showPassword, setShowPassword] = useState(false)\r\n const [showPasswordValidation, setShowPasswordValidation] = useState(false)\r\n const [showConfirmPasswordValidation, setShowConfirmPasswordValidation] =\r\n useState(false)\r\n\r\n const [searchParams] = useSearchParams()\r\n const email = searchParams.get('email')\r\n const { executeRecaptcha, getRecaptchaToken } = useRecaptcha()\r\n const code = searchParams.get('code')\r\n const { addAlert } = useAlert()\r\n const initialSignup = searchParams.get('initialSignup')\r\n const [isLoading, setIsLoading] = useState(false)\r\n const navigate = useNavigate()\r\n\r\n const accessExpired = searchParams.get('accessExpired')\r\n const entityType = searchParams.get('entityType')\r\n\r\n const validate = Yup.object().shape({\r\n firstName: Yup.string()\r\n .required(t('common.form.firstName.requiredError'))\r\n .matches(validFirstNameRegex, t('common.form.firstName.matchesError')),\r\n lastName: Yup.string()\r\n .required(t('common.form.lastName.requiredError'))\r\n .matches(validLastNameRegex, t('common.form.lastName.matchesError')),\r\n\r\n password: Yup.string()\r\n .required(t('form.changePassword.requiredError'))\r\n .matches(\r\n validPasswordRegex,\r\n t('form.passwordValidation.passwordNotStrong')\r\n ),\r\n confirmPassword: Yup.string()\r\n .required(t('form.passwordValidation.confirmPassword'))\r\n .oneOf(\r\n [Yup.ref('password'), null],\r\n t('form.passwordValidation.passwordNotMatch')\r\n ),\r\n })\r\n\r\n const passwordValidate = (values: IClientPortalSignup): void => {\r\n validatePassword(\r\n values || initialCredentials,\r\n passwordValidation,\r\n setPasswordValidation\r\n )\r\n }\r\n\r\n const handleSubmit = useCallback(\r\n (values: IClientPortalSignup, actions: FormikHelpers): void => {\r\n const decodedEmail = decodeURIComponent(email || '')\r\n\r\n if (values.rememberMe) {\r\n localStorage.setItem(rememberMeStorageKey, decodedEmail || '')\r\n }\r\n\r\n subscriptionRef.current = authService\r\n .initialLogin(values.password)\r\n .pipe(\r\n switchMap((idToken) =>\r\n authService.registerCollaborator(\r\n values.firstName,\r\n values.lastName,\r\n idToken\r\n )\r\n )\r\n )\r\n .subscribe({\r\n next: () => {\r\n actions.setSubmitting(false)\r\n authService\r\n .setUserRegisteredOn()\r\n .pipe(\r\n tap(() => {\r\n authService.redirectToClientPortal()\r\n })\r\n )\r\n .subscribe()\r\n },\r\n error: (e) => {\r\n actions.setSubmitting(false)\r\n rollbarInstance.error(e)\r\n },\r\n })\r\n },\r\n [email, rememberMeStorageKey]\r\n )\r\n\r\n const handleInitialSignup = useCallback(\r\n (values) => {\r\n if (email) {\r\n const decodedEmail = decodeURIComponent(email || '')\r\n\r\n if (values.rememberMe) {\r\n localStorage.setItem(rememberMeStorageKey, decodedEmail || '')\r\n }\r\n\r\n subscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.Signup)\r\n )\r\n .pipe(\r\n switchMap((recaptchaToken) =>\r\n authService.clientSignup(\r\n decodedEmail,\r\n values.firstName,\r\n values.lastName,\r\n values.password,\r\n recaptchaToken\r\n )\r\n )\r\n )\r\n .subscribe({\r\n error: () => {\r\n addAlert({\r\n message: t('common.alert.somethingWrong'),\r\n severity: 'error',\r\n })\r\n },\r\n })\r\n }\r\n },\r\n [addAlert, email, getRecaptchaToken, rememberMeStorageKey, t]\r\n )\r\n\r\n useEffect(() => {\r\n if (email && code && !initialSignup && executeRecaptcha) {\r\n setIsLoading(true)\r\n const decodedEmail = decodeURIComponent(email)\r\n const decodedCode = decodeURIComponent(code)\r\n subscriptionRef.current = from(\r\n getRecaptchaToken(RecaptchaActions.GetAnonymousUserInfo)\r\n )\r\n .pipe(\r\n switchMap((recaptchaToken) => {\r\n return authService.getCollaboratorInfo(recaptchaToken, decodedEmail)\r\n }),\r\n switchMap((data) => {\r\n if (!data.isProfileClaimed) {\r\n return authService.authenticate({\r\n username: decodedEmail,\r\n password: decodedCode,\r\n context: 'complete-registration',\r\n })\r\n }\r\n navigate('/?accountExists=true')\r\n return EMPTY\r\n })\r\n )\r\n .subscribe({\r\n complete: () => {\r\n setIsLoading(false)\r\n },\r\n error: (err) => {\r\n setIsLoading(false)\r\n rollbarInstance.error(err)\r\n addAlert({\r\n message: t('common.alert.somethingWrong'),\r\n severity: 'error',\r\n })\r\n },\r\n })\r\n }\r\n return () => {\r\n if (subscriptionRef.current && !subscriptionRef.current.closed) {\r\n subscriptionRef.current.unsubscribe()\r\n subscriptionRef.current = null\r\n }\r\n }\r\n }, [\r\n addAlert,\r\n code,\r\n email,\r\n executeRecaptcha,\r\n getRecaptchaToken,\r\n initialSignup,\r\n navigate,\r\n t,\r\n ])\r\n\r\n if (isLoading) {\r\n return \r\n }\r\n return (\r\n \r\n {accessExpired && (\r\n \r\n \r\n {entityType === EntityTypes.ClientJob &&\r\n t('form.createAccount.alert.accessExpiredTitle')}\r\n {entityType === EntityTypes.TalentPool &&\r\n t('form.createAccount.alert.accessExpiredTitleTalentList')}\r\n \r\n {t('form.createAccount.alert.accessExpiredSubtitle')}\r\n \r\n )}\r\n \r\n\r\n \r\n {({\r\n values,\r\n setFieldValue,\r\n isValid,\r\n errors,\r\n touched,\r\n isSubmitting,\r\n }) => {\r\n return (\r\n <>\r\n \r\n >\r\n )\r\n }}\r\n \r\n \r\n )\r\n}\r\n","import React, { useEffect } from 'react'\r\nimport { useSearchParams } from 'react-router-dom'\r\n\r\nimport {\r\n ClientQueryParams,\r\n getVendorCode,\r\n LoginTypes,\r\n PageTypes,\r\n useSubjectSelector,\r\n VendorCodes,\r\n} from '@procom-labs/common'\r\n\r\nimport { BaseLayout, SignupMethods } from '@auth-portal/components'\r\nimport { useAuthService } from '@auth-portal/hooks'\r\nimport { useGtmVpv } from '@auth-portal/hooks/use-gtm-vpv'\r\nimport { ClientSignup } from '@auth-portal/routes/signup-client'\r\nimport { authStore } from '@auth-portal/store'\r\n\r\nconst ContractorSignup: React.FC = () => {\r\n const [searchParams] = useSearchParams()\r\n const loginTypeParam = searchParams.get(ClientQueryParams.loginType)\r\n\r\n const authService = useAuthService()\r\n\r\n const { loginType } = useSubjectSelector(authStore, ['loginType'])\r\n\r\n useGtmVpv({\r\n pageType: PageTypes.Register,\r\n pageTitle: PageTypes.Register,\r\n })\r\n useEffect(() => {\r\n if (\r\n loginTypeParam &&\r\n loginTypeParam.toLowerCase() !== loginType?.toLowerCase()\r\n ) {\r\n localStorage.setItem(ClientQueryParams.loginType, loginTypeParam)\r\n authService.setLoginType()\r\n }\r\n }, [loginType, loginTypeParam])\r\n\r\n if (\r\n loginType?.toLowerCase() === LoginTypes.Client.toLowerCase() ||\r\n ![\r\n VendorCodes.PCGL,\r\n VendorCodes.DEMO,\r\n VendorCodes.DEMOSANDBOX,\r\n VendorCodes.GW,\r\n ].includes(getVendorCode())\r\n ) {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default ContractorSignup\r\n","import React, { ReactElement } from 'react'\r\n\r\nimport { PageTypes } from '@procom-labs/common'\r\n\r\nimport { BaseLayout, SignupForm } from '@auth-portal/components'\r\nimport { useGtmVpv } from '@auth-portal/hooks/use-gtm-vpv'\r\n\r\nconst SignupWithEmail: React.FC = () => {\r\n useGtmVpv({\r\n pageType: PageTypes.Register,\r\n pageTitle: PageTypes.Register,\r\n })\r\n return (\r\n \r\n \r\n \r\n ) as ReactElement\r\n}\r\nexport default SignupWithEmail\r\n","function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nfunction _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { Suspense, useEffect, useMemo, useState } from 'react';\nimport Parse from 'html-react-parser';\nimport { useTranslation } from 'react-i18next';\nimport { catchError, from, map } from 'rxjs';\nimport { useObservable } from 'rxjs-hooks';\nimport { Preloader } from '@procom-labs/atoms';\nimport { ClientNames, PreferredLanguageType, toKebabCase, useClientService } from '@procom-labs/common';\nimport { LegalDocuments } from './legal-documents';\nvar style = \"\";\nvar getTermFetchRequest = function(clientName, lang) {\n return from(import(\"../../assets/html/\".concat(clientName, \"/terms-of-use-\").concat(lang)));\n};\nexport var TermsOfUsePage = function(param) {\n var handleBack = param.handleBack, lang = param.lang;\n var i18n = useTranslation('main').i18n;\n var clientService = useClientService();\n var _useState = _sliced_to_array(useState(''), 2), content = _useState[0], setContent = _useState[1];\n var clientName = useObservable(function() {\n return clientService.clientSetting$.pipe(map(function(settings) {\n return settings ? toKebabCase(settings.common.name) : null;\n }));\n }, null);\n var localLng = useMemo(function() {\n var _i18n_language;\n return lang || ((_i18n_language = i18n.language) === null || _i18n_language === void 0 ? void 0 : _i18n_language.toLowerCase()) || PreferredLanguageType.EN;\n }, [\n lang,\n i18n.language\n ]);\n var parsedHtml = useMemo(function() {\n return (content === null || content === void 0 ? void 0 : content.trim()) ? Parse(style + content) : '';\n }, [\n content\n ]);\n useEffect(function() {\n var subscription = null;\n if (clientName) {\n subscription = getTermFetchRequest(clientName, localLng).pipe(catchError(function() {\n return getTermFetchRequest(ClientNames.Procom.toLowerCase(), localLng);\n })).subscribe({\n next: function(value) {\n setContent(value.TermsOfUse);\n },\n error: function() {\n return setContent('');\n }\n });\n }\n return function() {\n if (subscription && !subscription.closed) {\n subscription.unsubscribe();\n }\n };\n }, [\n clientName,\n localLng\n ]);\n if (content) {\n return /*#__PURE__*/ _jsx(Suspense, {\n fallback: /*#__PURE__*/ _jsx(Preloader, {\n center: true\n }),\n children: /*#__PURE__*/ _jsx(LegalDocuments, {\n handleBack: handleBack,\n children: parsedHtml\n })\n });\n }\n return null;\n};\n","import React, { ReactElement } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { useObservable } from 'rxjs-hooks'\r\n\r\nimport { Grid } from '@mui/material'\r\nimport {\r\n IClientSettings,\r\n PageTypes,\r\n useClientService,\r\n} from '@procom-labs/common'\r\nimport {\r\n Footer,\r\n TermsOfUsePage as TermsOfUseDetail,\r\n} from '@procom-labs/organisms'\r\n\r\nimport { LegalDocumentLayout } from '@auth-portal/components'\r\nimport { useGtmVpv } from '@auth-portal/hooks/use-gtm-vpv'\r\n\r\nconst TermsOfUsePage: React.FC = () => {\r\n const navigate = useNavigate()\r\n const { t } = useTranslation('main')\r\n\r\n const clientService = useClientService()\r\n\r\n const clientSettings: IClientSettings | null = useObservable(\r\n () => clientService.clientSetting$\r\n )\r\n\r\n useGtmVpv({\r\n pageType: PageTypes.TermUse,\r\n pageTitle: PageTypes.TermUse,\r\n })\r\n\r\n return (\r\n \r\n \r\n navigate(`/`)} />\r\n \r\n \r\n \r\n ) as ReactElement\r\n}\r\n\r\nexport default TermsOfUsePage\r\n","import React, { ReactElement } from 'react'\r\n\r\nimport { BaseLayout, VerifyEmail } from '@auth-portal/components'\r\n\r\nconst VerifyEmailRoute: React.FC<{}> = () =>\r\n (\r\n \r\n \r\n \r\n ) as ReactElement\r\n\r\nexport default VerifyEmailRoute\r\n","import { FC } from 'react'\r\nimport { Navigate, Route, Routes } from 'react-router-dom'\r\n\r\nimport {\r\n getVendorCode,\r\n useIsClientHCMWorks,\r\n VendorCodes,\r\n} from '@procom-labs/common'\r\nimport {\r\n AlertContextProvider,\r\n NewAppVersionPrompt,\r\n} from '@procom-labs/molecules'\r\n\r\nimport { PageNotFound, ValidateSignIn } from '@auth-portal/components'\r\nimport { SignupGorillaResumeOtp } from '@auth-portal/components/signup-gorillaresume-otp'\r\nimport { SignupComplete } from '@auth-portal/routes/signup-complete'\r\nimport { SignUpRoutes } from '@auth-portal/types'\r\n\r\nimport ActivateFboInvitationRoute from './activate-fbo-invitation-route'\r\nimport ChangePasswordRoute from './change-password-route'\r\nimport CompleteRegistration from './complete-registration'\r\nimport { ExpiredPasswordRoute } from './expired-password-route'\r\nimport InitialRoute from './initial-route'\r\nimport Login from './login'\r\nimport { LoginMfa } from './login-mfa'\r\nimport Logout from './logout'\r\nimport { MsSsoCallBack } from './ms-sso-callback'\r\nimport PrivacyPolicy from './privacy-policy'\r\nimport ResetPassword from './reset-password'\r\nimport SignInLinkedinCallback from './signin-linkedin-callback'\r\nimport SignInSocialCallback from './signin-social-callback'\r\nimport ContractorSignup from './signup'\r\nimport ContractorSignupWithEmail from './signup-with-email'\r\nimport TermsOfUse from './terms-of-use'\r\nimport VerifyEmailRoute from './verify-email-route'\r\n\r\nexport const AppRoutes: FC = () => {\r\n const isClientHCMWorks = useIsClientHCMWorks()\r\n\r\n const isVendorAllowed = [\r\n VendorCodes.PCGL,\r\n VendorCodes.DEMO,\r\n VendorCodes.DEMOSANDBOX,\r\n VendorCodes.GW,\r\n ].includes(getVendorCode())\r\n\r\n return (\r\n \r\n \r\n \r\n } />\r\n } />\r\n } />\r\n\r\n } />\r\n } />\r\n }\r\n />\r\n }\r\n />\r\n } />\r\n } />\r\n } />\r\n } />\r\n : \r\n }\r\n />\r\n \r\n ) : (\r\n \r\n )\r\n }\r\n />\r\n\r\n }\r\n />\r\n }\r\n />\r\n }\r\n />\r\n }\r\n />\r\n }\r\n />\r\n }\r\n />\r\n } />\r\n } />\r\n \r\n \r\n )\r\n}\r\n","/* eslint-disable no-param-reassign */\r\nimport { AxiosRequestConfig } from 'axios'\r\nimport Axios from 'axios-observable'\r\n\r\nimport { PerformanceTrackingService } from '@procom-labs/common'\r\n\r\nimport { environment } from '@auth-portal/environment'\r\n\r\nexport const axios = Axios.create({\r\n baseURL: environment.AUTH_API_URL,\r\n})\r\n\r\nfunction requestInterceptor(config: AxiosRequestConfig): AxiosRequestConfig {\r\n const lng = localStorage.getItem('i18nextLng') || 'en'\r\n const performanceTrackingService = PerformanceTrackingService.getOrCreate()\r\n\r\n if (environment.ENABLE_PERFORMANCE_TRACKING === 'true') {\r\n const metadataPerfTracking =\r\n performanceTrackingService.getRequestPerfTracking(config)\r\n if (metadataPerfTracking) config.metadataPerfTracking = metadataPerfTracking\r\n }\r\n config.headers = {\r\n 'Accept-Language': lng,\r\n Accept: (config.headers && config.headers.Accept) || 'application/json',\r\n 'Content-Type':\r\n (config.headers && config.headers['Content-Type']) || 'application/json',\r\n ...config.headers,\r\n }\r\n return config\r\n}\r\n\r\naxios.interceptors.request.use(requestInterceptor)\r\n","import { FC, useEffect } from 'react'\r\n\r\nimport {\r\n errorToString,\r\n gtmEvents,\r\n SubmissionTrackingStatus,\r\n} from '@procom-labs/common'\r\n\r\nimport { msalInstance } from '@auth-portal/config'\r\nimport { useTrackingWrapper } from '@auth-portal/hooks'\r\nimport {\r\n AuthenticationResult,\r\n EventMessage,\r\n EventType,\r\n} from '@azure/msal-browser'\r\nimport { MsalProvider } from '@azure/msal-react'\r\n\r\nexport const MSALProvider: FC = ({ children }) => {\r\n const { track } = useTrackingWrapper()\r\n\r\n useEffect(() => {\r\n let callBackId: string | null = null\r\n const initializeMsal = async (): Promise => {\r\n try {\r\n await msalInstance.initialize()\r\n const accounts = msalInstance.getAllAccounts()\r\n if (accounts.length > 0) {\r\n msalInstance.setActiveAccount(accounts[0])\r\n }\r\n\r\n callBackId = msalInstance.addEventCallback((event: EventMessage) => {\r\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload) {\r\n const payload = event.payload as AuthenticationResult\r\n const { account } = payload\r\n msalInstance.setActiveAccount(account)\r\n }\r\n })\r\n } catch (error) {\r\n track({\r\n eventName: gtmEvents.InitializingMsSsoLogin,\r\n submissionStatus: SubmissionTrackingStatus.Failed,\r\n loginType: 'MS_SSO_Login',\r\n isGTMTracking: true,\r\n isMixPanelTracking: true,\r\n isTrackingEnabled: true,\r\n errorMessage: errorToString(error),\r\n })\r\n }\r\n }\r\n initializeMsal()\r\n\r\n return () => {\r\n if (callBackId) msalInstance.removeEventCallback(callBackId)\r\n }\r\n }, [track])\r\n return {children} \r\n}\r\n","import { FC, Suspense, useEffect, useMemo } from 'react'\r\nimport { GoogleReCaptchaProvider } from 'react-google-recaptcha-v3'\r\nimport { BrowserRouter, useSearchParams } from 'react-router-dom'\r\n\r\nimport { CssBaseline, ThemeProvider } from '@mui/material'\r\nimport { InputGlobalStyles, Preloader } from '@procom-labs/atoms'\r\nimport {\r\n AppTypes,\r\n ClientQueryParams,\r\n getClientPortalHost,\r\n InjectableConfig,\r\n InjectableServices,\r\n PaletteModeCode,\r\n setInitialVendorCode,\r\n useThemeService,\r\n WindowedObservable,\r\n} from '@procom-labs/common'\r\nimport { RollbarProvider } from '@procom-labs/molecules'\r\n\r\nimport { AppRoutes } from './routes'\r\n\r\nimport 'external-svg-loader'\r\nimport './style/main.scss'\r\n\r\nimport { environment } from './environment'\r\nimport i18n from './i18n'\r\nimport { axios } from './lib'\r\nimport { MSALProvider } from './providers/msal.provider'\r\nimport { AuthService } from './services'\r\n\r\nnew WindowedObservable(InjectableConfig.Axios).publish(axios)\r\nnew WindowedObservable(InjectableConfig.I18n).publish(i18n)\r\nnew WindowedObservable(InjectableServices.AuthService).publish(\r\n new AuthService()\r\n)\r\n\r\nconst AppThemeProvider: FC<{}> = ({ children }) => {\r\n const [searchParams] = useSearchParams()\r\n const themeService = useThemeService()\r\n\r\n const queryThemeMode = searchParams.get(ClientQueryParams.themeMode)\r\n const localThemeMode = localStorage.getItem(ClientQueryParams.themeMode)\r\n\r\n const themeMode = queryThemeMode ?? localThemeMode\r\n\r\n const appTheme = useMemo(() => {\r\n return themeService.initializeBaseTheme(\r\n getClientPortalHost(),\r\n AppTypes.auth,\r\n !!themeMode,\r\n themeMode as PaletteModeCode\r\n )\r\n }, [themeMode])\r\n\r\n useEffect(() => {\r\n if (queryThemeMode) {\r\n localStorage.setItem(ClientQueryParams.themeMode, queryThemeMode)\r\n }\r\n }, [queryThemeMode])\r\n\r\n return {children} \r\n}\r\n\r\nconst App: FC<{}> = () => {\r\n setInitialVendorCode()\r\n return (\r\n \r\n \r\n \r\n }>\r\n \r\n {InputGlobalStyles}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default App\r\n","import { getClientPortalHost } from './get-client-portal-host';\nimport { getClientVendorCode } from './get-client-vendor-code';\nexport var setInitialVendorCode = function() {\n var clientPortalHost = getClientPortalHost();\n var vendorCode = getClientVendorCode(clientPortalHost || window.location.hostname);\n sessionStorage.setItem('VendorCode', vendorCode);\n};\n","import { ReportHandler } from 'web-vitals'\r\n\r\nconst reportWebVitals = (onPerfEntry?: ReportHandler): void => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry)\r\n getFID(onPerfEntry)\r\n getFCP(onPerfEntry)\r\n getLCP(onPerfEntry)\r\n getTTFB(onPerfEntry)\r\n })\r\n }\r\n}\r\n\r\nexport default reportWebVitals\r\n","import React from 'react'\r\nimport ReactDOM from 'react-dom'\r\n\r\nimport { GTMProvider } from '@elgorditosalsero/react-gtm-hook'\r\n\r\nimport 'vendorMfe/common'\r\n\r\nimport App from './App'\r\nimport { environment } from './environment'\r\nimport reportWebVitals from './reportWebVitals'\r\n\r\nimport './i18n'\r\n\r\nconst gtmParams = { id: environment.GTM_KEY }\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n)\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals()\r\n","var map = {\n\t\"./bmo/terms-of-use-en\": [\n\t\t1197,\n\t\t197\n\t],\n\t\"./bmo/terms-of-use-en.js\": [\n\t\t1197,\n\t\t197\n\t],\n\t\"./bmo/terms-of-use-fr\": [\n\t\t3368,\n\t\t368\n\t],\n\t\"./bmo/terms-of-use-fr.js\": [\n\t\t3368,\n\t\t368\n\t],\n\t\"./bridge-view/privacy-policy-en\": [\n\t\t8993,\n\t\t993\n\t],\n\t\"./bridge-view/privacy-policy-en.js\": [\n\t\t8993,\n\t\t993\n\t],\n\t\"./bridge-view/privacy-policy-fr\": [\n\t\t4852,\n\t\t852\n\t],\n\t\"./bridge-view/privacy-policy-fr.js\": [\n\t\t4852,\n\t\t852\n\t],\n\t\"./bridge-view/terms-of-use-en\": [\n\t\t2653,\n\t\t653\n\t],\n\t\"./bridge-view/terms-of-use-en.js\": [\n\t\t2653,\n\t\t653\n\t],\n\t\"./bridge-view/terms-of-use-fr\": [\n\t\t735,\n\t\t735\n\t],\n\t\"./bridge-view/terms-of-use-fr.js\": [\n\t\t735,\n\t\t735\n\t],\n\t\"./cenovus/privacy-policy-en\": [\n\t\t8123,\n\t\t123\n\t],\n\t\"./cenovus/privacy-policy-en.js\": [\n\t\t8123,\n\t\t123\n\t],\n\t\"./cenovus/privacy-policy-fr\": [\n\t\t3035,\n\t\t35\n\t],\n\t\"./cenovus/privacy-policy-fr.js\": [\n\t\t3035,\n\t\t35\n\t],\n\t\"./cenovus/terms-of-use-en\": [\n\t\t6097,\n\t\t97\n\t],\n\t\"./cenovus/terms-of-use-en.js\": [\n\t\t6097,\n\t\t97\n\t],\n\t\"./cenovus/terms-of-use-fr\": [\n\t\t5584,\n\t\t584\n\t],\n\t\"./cenovus/terms-of-use-fr.js\": [\n\t\t5584,\n\t\t584\n\t],\n\t\"./demo-corp/privacy-policy-en\": [\n\t\t4529,\n\t\t529\n\t],\n\t\"./demo-corp/privacy-policy-en.js\": [\n\t\t4529,\n\t\t529\n\t],\n\t\"./demo-corp/privacy-policy-fr\": [\n\t\t9892,\n\t\t892\n\t],\n\t\"./demo-corp/privacy-policy-fr.js\": [\n\t\t9892,\n\t\t892\n\t],\n\t\"./demo-corp/terms-of-use-en\": [\n\t\t7690,\n\t\t690\n\t],\n\t\"./demo-corp/terms-of-use-en.js\": [\n\t\t7690,\n\t\t690\n\t],\n\t\"./demo-corp/terms-of-use-fr\": [\n\t\t3769,\n\t\t769\n\t],\n\t\"./demo-corp/terms-of-use-fr.js\": [\n\t\t3769,\n\t\t769\n\t],\n\t\"./flextrack/privacy-policy-en\": [\n\t\t7215,\n\t\t215\n\t],\n\t\"./flextrack/privacy-policy-en.js\": [\n\t\t7215,\n\t\t215\n\t],\n\t\"./flextrack/privacy-policy-fr\": [\n\t\t8094,\n\t\t94\n\t],\n\t\"./flextrack/privacy-policy-fr.js\": [\n\t\t8094,\n\t\t94\n\t],\n\t\"./flextrack/terms-of-use-en\": [\n\t\t9485,\n\t\t485\n\t],\n\t\"./flextrack/terms-of-use-en.js\": [\n\t\t9485,\n\t\t485\n\t],\n\t\"./flextrack/terms-of-use-fr\": [\n\t\t4406,\n\t\t406\n\t],\n\t\"./flextrack/terms-of-use-fr.js\": [\n\t\t4406,\n\t\t406\n\t],\n\t\"./gorilla-works/privacy-policy-en\": [\n\t\t7469,\n\t\t991\n\t],\n\t\"./gorilla-works/privacy-policy-en.js\": [\n\t\t7469,\n\t\t991\n\t],\n\t\"./gorilla-works/privacy-policy-fr\": [\n\t\t6966,\n\t\t966\n\t],\n\t\"./gorilla-works/privacy-policy-fr.js\": [\n\t\t6966,\n\t\t966\n\t],\n\t\"./gorilla-works/terms-of-use-en\": [\n\t\t7087,\n\t\t87\n\t],\n\t\"./gorilla-works/terms-of-use-en.js\": [\n\t\t7087,\n\t\t87\n\t],\n\t\"./gorilla-works/terms-of-use-fr\": [\n\t\t7614,\n\t\t614\n\t],\n\t\"./gorilla-works/terms-of-use-fr.js\": [\n\t\t7614,\n\t\t614\n\t],\n\t\"./hcm-works/privacy-policy-en\": [\n\t\t6351,\n\t\t351\n\t],\n\t\"./hcm-works/privacy-policy-en.js\": [\n\t\t6351,\n\t\t351\n\t],\n\t\"./hcm-works/privacy-policy-fr\": [\n\t\t174,\n\t\t174\n\t],\n\t\"./hcm-works/privacy-policy-fr.js\": [\n\t\t174,\n\t\t174\n\t],\n\t\"./hcm-works/terms-of-use-en\": [\n\t\t2116,\n\t\t116\n\t],\n\t\"./hcm-works/terms-of-use-en.js\": [\n\t\t2116,\n\t\t116\n\t],\n\t\"./hcm-works/terms-of-use-fr\": [\n\t\t3212,\n\t\t212\n\t],\n\t\"./hcm-works/terms-of-use-fr.js\": [\n\t\t3212,\n\t\t212\n\t],\n\t\"./kpmg/diversity-survey-en\": [\n\t\t9713,\n\t\t713\n\t],\n\t\"./kpmg/diversity-survey-en.js\": [\n\t\t9713,\n\t\t713\n\t],\n\t\"./procom-team/privacy-policy-en\": [\n\t\t3709,\n\t\t709\n\t],\n\t\"./procom-team/privacy-policy-en.js\": [\n\t\t3709,\n\t\t709\n\t],\n\t\"./procom-team/privacy-policy-fr\": [\n\t\t6561,\n\t\t41\n\t],\n\t\"./procom-team/privacy-policy-fr.js\": [\n\t\t6561,\n\t\t41\n\t],\n\t\"./procom-team/terms-of-use-en\": [\n\t\t3832,\n\t\t832\n\t],\n\t\"./procom-team/terms-of-use-en.js\": [\n\t\t3832,\n\t\t832\n\t],\n\t\"./procom-team/terms-of-use-fr\": [\n\t\t9138,\n\t\t138\n\t],\n\t\"./procom-team/terms-of-use-fr.js\": [\n\t\t9138,\n\t\t138\n\t],\n\t\"./procom/privacy-policy-en\": [\n\t\t1319,\n\t\t319\n\t],\n\t\"./procom/privacy-policy-en.js\": [\n\t\t1319,\n\t\t319\n\t],\n\t\"./procom/privacy-policy-fr\": [\n\t\t8932,\n\t\t932\n\t],\n\t\"./procom/privacy-policy-fr.js\": [\n\t\t8932,\n\t\t932\n\t],\n\t\"./procom/terms-of-use-en\": [\n\t\t5484,\n\t\t484\n\t],\n\t\"./procom/terms-of-use-en.js\": [\n\t\t5484,\n\t\t484\n\t],\n\t\"./procom/terms-of-use-fr\": [\n\t\t8719,\n\t\t719\n\t],\n\t\"./procom/terms-of-use-fr.js\": [\n\t\t8719,\n\t\t719\n\t],\n\t\"./softchoice/privacy-policy-en\": [\n\t\t7858,\n\t\t858\n\t],\n\t\"./softchoice/privacy-policy-en.js\": [\n\t\t7858,\n\t\t858\n\t],\n\t\"./softchoice/privacy-policy-fr\": [\n\t\t8137,\n\t\t137\n\t],\n\t\"./softchoice/privacy-policy-fr.js\": [\n\t\t8137,\n\t\t137\n\t],\n\t\"./softchoice/terms-of-use-en\": [\n\t\t7949,\n\t\t949\n\t],\n\t\"./softchoice/terms-of-use-en.js\": [\n\t\t7949,\n\t\t949\n\t],\n\t\"./softchoice/terms-of-use-fr\": [\n\t\t496,\n\t\t496\n\t],\n\t\"./softchoice/terms-of-use-fr.js\": [\n\t\t496,\n\t\t496\n\t],\n\t\"./symbiotic/privacy-policy-en\": [\n\t\t1348,\n\t\t348\n\t],\n\t\"./symbiotic/privacy-policy-en.js\": [\n\t\t1348,\n\t\t348\n\t],\n\t\"./symbiotic/privacy-policy-fr\": [\n\t\t7005,\n\t\t5\n\t],\n\t\"./symbiotic/privacy-policy-fr.js\": [\n\t\t7005,\n\t\t5\n\t],\n\t\"./symbiotic/terms-of-use-en\": [\n\t\t3416,\n\t\t416\n\t],\n\t\"./symbiotic/terms-of-use-en.js\": [\n\t\t3416,\n\t\t416\n\t],\n\t\"./symbiotic/terms-of-use-fr\": [\n\t\t788,\n\t\t788\n\t],\n\t\"./symbiotic/terms-of-use-fr.js\": [\n\t\t788,\n\t\t788\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = function() { return Object.keys(map); };\nwebpackAsyncContext.id = 5768;\nmodule.exports = webpackAsyncContext;"],"names":["_define_property","obj","key","value","Object","defineProperty","enumerable","configurable","writable","_object_spread","target","i","arguments","length","source","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","forEach","StyledBox","styled","Box","shouldForwardProp","prop","param","center","height","display","alignItems","justifyContent","minHeight","undefined","Preloader","sx","_jsx","className","children","CircularProgress","variant","defaultProps","InputGlobalStyles","GlobalStyles","styles","theme","fontSize","lineHeight","marginBottom","spacing","a","color","textDecoration","padding","paddingLeft","overflowY","overflowX","position","paddingInline","breakpoints","up","top","_defineProperties","props","descriptor","BaseConfigService","config","instance","Constructor","TypeError","_class_call_check","this","WindowedObservable","InjectableConfig","getLastEvent","initializeEnv","envKey","initializeAxios","axiosKey","fboAxiosKey","initializeFboAxios","protoProps","staticProps","get","rollbarConfig","fboAxiosConfig","axiosConfig","environmentConfig","appType","AppTypes","configKey","config$","mfeType","Error","Axios","publish","prototype","_call_super","_this","derived","args","_get_prototype_of","self","call","Symbol","constructor","_type_of","ReferenceError","_assert_this_initialized","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","apply","o","setPrototypeOf","getPrototypeOf","__proto__","_set_prototype_of","p","result","Boolean","valueOf","_","AppService","subClass","superClass","create","_inherits","observable","InjectableServices","state","baseURL","axios","pipe","map","response","_response_data","data","buildNumber","PaletteModeCode","deepMergeObjects","obj1","obj2","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","Array","isArray","values","err","return","TERMS_OF_USE_AND_PRIVACY_POLICY_EFFECTIVE_DATE","ProcomSettings","common","name","effectiveDate","defaultThemeMode","guestClient","light","guestAuth","BmoSettings","privacyPolicyURL","en","fr","authenticated","DemoCorpSettings","ImageExtensions","CenovusSettings","logo","imgExtension","PNG","KpmgSettings","HcmWorksSettings","ProcomTeamSettings","assetClient","ClientCodes","FlextrackSettings","EySettings","ClientNames","GorillaWorksSettings","SymbioticSettings","SoftchoiceSettings","BridgeViewSettings","DemoSettings","DemoClientSettings","SiteList","vendorCode","VendorCodes","code","domains","hostname","authHostname","domainType","ClientDomainType","authPortalUrl","homepageAnonymousUsersUrl","settings","gtmEvents","gtmEventsPrefix","HTTPResponseStatus","ProfileCompletionStatus","AuthProfileType","AuthSignupType","DomainDetectionErrors","popupWindowNames","ActivityType","AuthErrorCodes","StorageKeys","_create_class","LocalStorage","storageKey","checkExpiry","rawValue","localStorage","getItem","JSON","parse","isExpired","setItem","stringify","removeItem","v","expiredTime","Date","getTime","SessionStorage","sessionStorage","authStorage","Token","guestSessionStorage","restrictedViewStorage","RestrictedGuest","restrictedViewSessionStorage","fboAuthStorage","FboToken","siteConfigStorage","SiteConfig","SuperSubject","subject","BehaviorSubject","observable$","asObservable","set","toKebabCase","str","match","x","toLowerCase","join","_object_spread_props","getOwnPropertyDescriptors","defineProperties","object","enumerableOnly","symbols","push","compose","parent","child","$key","kebabCase","seprator","$get","s","$set","y","lensProp","toString","lensIndex","xs","old","ci","idLens","MfaTypes","MfaFlows","mfaCodeVerificationLens","lensProxy","Proxy","Number","getLoginType","profile","Recruiter","LoginTypes","Contractor","ClientService","AppSupport","GorillaResumeUser","getClientCode","clientPortalBase","_SiteList_find","hostName","window","location","portal","some","domain","getOriginBase","originBaseParam","URLSearchParams","search","origin","decodeURIComponent","URL","getClientPortalHost","_SiteList_flatMap_find","find","getClientVendorCode","getVendorCode","vendorCodeFromStorage","clientPortalHost","getAuthPortalUrl","errorToString","e","left","right","hasInstance","message","openPopupWindow","href","title","leftPosition","screen","width","topPosition","open","closePopupWindow","reload","opener","close","themeModeStorage","ThemeModeStorage","userId","parseValue","getParsedValue","_valueList_indexOfLargestValue","userValue","themeMode","valueList","indexOfLargestValue","reduce","maxIndex","currentValue","currentIndex","array","_array_maxIndex","timeStamp","_this_getParsedValue","getClientName","AwsErrorCodes","AwsErrors","errorCode","NotAuthorizedException","context","errorMessage","LimitExceededException","PasswordResetRequiredException","ExpiredCodeException","TooManyRequestsException","InvalidPasswordException","UserNotFoundException","UsernameExistsException","AwsService","error","i18n","awsError","ae","t","awsService","OnboardingService","dashboardMetaSubject","baseEndpoint","environment","ONBOARDING_API_URL","axiosPerfTracking","DefaultPerformanceData","url","startTime","httpVerb","instanceUiId","requestSource","PerformanceTrackingService","method","metadataPerfTracking","toISOString","toUpperCase","storeFboData","isError","_authStoredData_user","_authStoredData_supportUserId","authStoredData","endTime","duration","now","httpStatusCode","status","portalUserId","user","id","userProfileId","profileId","exception","portalImpersonatorUserId","supportUserId","doSendPerfTracking","perfTrackingData","perfTrackingUrl","FBO_PERFORMANCE_URL","post","subscribe","_this_rollbar","rollbar","_array_like_to_array","arr","len","arr2","_object_without_properties","excluded","sourceKeys","indexOf","_object_without_properties_loose","sourceSymbolKeys","propertyIsEnumerable","_sliced_to_array","_array_with_holes","_i","_s","_e","_arr","_n","_d","_iterable_to_array_limit","minLen","n","slice","from","test","_unsupported_iterable_to_array","_non_iterable_rest","gtmSocialEvent","dataLayer","event","submissionStatus","email","loginWith","gtmInitialLoginEvent","currentLoginType","currentProfileType","InitialLogin","portalType","AuthService","authDataSubject","currentUserSubject","currentCognitoUserSubject","isMfaCodeRequestedSubject","cognitoUserHasMultipleMfaMethodsSubject","currentUserProfileSubject","currentUserHiringManagersSubject","nationalAccountManagerSubject","clientListSubject","isLoadingSubject","isUserPermissionLoadingSubject","userPermissionsSubject","refreshPermissionSubject","enablePerformanceTracking","performanceTrackingService","sendPerfTracking","ENABLE_PERFORMANCE_TRACKING","getRequestPerfTracking","headers","storedData","isResumeApp","guestSessionData","restrictedViewData","isClientApp","token","authorization","allowedPathname","pathname","includes","Accept","lang","suppress401Redirect","Promise","reject","authData","refreshToken","retry","isAuthRefreshing","resolve","failedRequestList","requestConfig","cancelToken","refreshAuth","switchMap","processFailedRequestList","request","resp","logout","to","mode","loginType","pool","CognitoUserPool","UserPoolId","cognito","AWS_USERPOOL_ID","ClientId","AWS_CLIENT_ID","AUTH_API_URL","awsClientId","awsAuthUrl","AWS_AUTH_URL","linkedinAuthUrl","LINKEDIN","AUTH_URL","linkedinClientId","CLIENT_ID","isResumeCopilotFeatureEnabled","IS_RESUME_COPILOT_FEATURE_ENABLED","accountEndpoint","clientEndpoint","userDetailEndpoint","siteConfigSubject","siteConfig$","interceptors","use","handleRequestInterceptor","handleResponse","handleResponseError","i18nConfig","_this_siteConfigSubject_value","fboTenantName","userObject","isHubSite","clientCode","userProfile","profiles","profileType","currentProfile","displayName","preferredLanguage","configure","payload","person","language","changeLanguage","clear","isMfaEnabled","structuredClone","currentUser","contractorProfileCompletionStatus","Completed","cognitoToken","encodeURIComponent","ClientQueryParams","clearRestrictedViewStorage","setAuthStorage","catchError","throwError","finalize","recaptchaToken","originBase","of","isUserExist","isPasswordSet","skipDiversitySurvey","signupType","Email","hasRestrictedAccess","refreshTokenExpiredTime","_authStoredData_sendbirdAppId","_authStoredData_firstLogin","isNewVendorClientContractorUser","sendbirdAppId","firstLogin","fetchUserInfo","authorize","body","grant_type","client_id","redirect_uri","SocialRoutes","socialLogin","cognitoAccessToken","access_token","tokenType","token_type","cognitoIdToken","id_token","Authorization","accessToken","tap","Notification","FormLogin","socialLinkHref","SocialLoginType","SocialLogin","authorizationCode","redirectUri","logoutParams","_this_currentUserSubject_value","params","authPortalRoute","callbackURL","destinationURL","trackActivity","Logout","complete","authPortalBaseUrl","Observable","observer","takeWhile","closed","authUser","handleFetchUserInfo","AuthPortalRouteMaps","customParams","_this_guestSessionStorage","guestSessionStorageValue","setCurrentUser","_ref","_authData_user","isAccessRestricted","returnNationalAm","messageBody","entityId","entityType","updateCurrent","put","cognitoSession","isNewUser","sendGtmEvent","username","getIdToken","getJwtToken","SignUp","Login","dataUser","stack","SignUpFailed","LoginFailed","translateAWSErrors","mfaType","Authenticator","password","currentCognitoUserPasswordSubject","SMS","CognitoUser","Username","Pool","clientName","userAuthDetails","Password","ClientMetadata","authDetails","AuthenticationDetails","authenticateUser","onSuccess","handleCognitoUserOnSuccess","onFailure","handleCognitoUserOnFailure","totpRequired","handleCognitoUserTotpRequired","mfaRequired","handleCognitoUserMfaRequired","newPasswordRequired","NewPasswordRequired","selectMFAType","fileId","responseType","catchAwsErrors","_authData_supportUserId","optionalParams","isOtp","OtpRequest","verificationCode","userData","authPortalBase","isCodeValid","hasCodeExpired","isSuccess","OtpVerification","authenticate","_error_response_data","_error_response","delete","forkJoin","userPermissions","onboardingMeta","onboardingService","getOnboardingDashboardMeta","_param","_this_currentUser","isJobEnabled","rest","isOnboardingEnabled","isEmailVerified","hasOnboardingList","isOnboardingActive","hasPackageInProgress","hasSurvey","hasPendingReview","hasCompletedPackageEndDateNotExceeded","hasCustomInformationRequestInProgress","hasBankingChangeRequestInProgress","hasCompletedInformationRequestEndDateNotExceeded","hasOfferInformationRequestInProgress","hasOfferAmendments","isNewItemAvailable","isDueDatesUpdated","isResumeCopilotEnabled","isOnboardingPendingReviewEnabled","refreshPermission$","creationToken","navigator","sendBeacon","activityType","newCPUser","recipientEmail","recipientName","useSessionStorage","currentCognitoUser","getUserAttributes","attributes","updateAttributes","cognitoErrorCode","clientSettingSubject","clientNameSubject","clientLoginTypeSubject","appTypeSubject","backDropLoadingSubject","$favicons","document","querySelectorAll","$favicon","_$favicon_getAttribute","setAttribute","_this_clientSettingSubject_value_common_logo","_this_clientSettingSubject","_this_clientSettingSubject1","_this_clientSettingSubject_value_common_logo_assetClient","placeholder","replace","getAttribute","queryString","clientLoginType","updateFavicon","translations","BaseSubjectStore","fields","newState","initializeState","defaultValue","getDefaultValue","dispatch","MfaStore","InjectableStores","isUserMfaSettingsUpdated","userMfaDetails","userMfaPhoneNumber","mfaFlow","preferredMfaMethod","isCognitoUserValid","showAuthenticatorAppDescription","showMfaPhoneAlert","UserStore","emailSearchFilter","isLoading","isSubmitting","accountSettingsFormProp","workSettingsFormProp","userAvatarFormProp","userList","impersonatedUser","userAvatar","isUserMfaModalOpened","isMfaRequiredModalOpened","isSelectImpersonationProfileModalOpened","UserService","getOrCreate","userStore","userProfileData","authService","formData","_to_consumable_array","_array_without_holes","iter","_iterable_to_array","_non_iterable_spread","_PALETTE_common","_PALETTE_text","_PALETTE_primary","MfaService","mfaStore","mfaSettingsReset","setIsMfaCodeRequested","mfaDetails","_mfaDetails_find","phoneNumber","item","userService","currentCognitoUserEmail","mfaTypeCognito","sendMFASelectionAnswer","session","_param_isEnabled","isEnabled","mfaMethodRequested","cognitoMfaSettings","sms","PreferredMfa","Enabled","totp","mfaSettings","hasMfaMethodRequested","_item_type","type","isAuthenticatorEnabled","_settings_type","isPreferred","_item_type1","_item_type2","_item_type3","updateMfaSettings","setUserMfaPreference","updateUserMfaDetails","updateCurrentUserMfaStatus","Disable","deviceName","verifySoftwareToken","associateSoftwareToken","associateSecretCode","secretCode","_this_mfaStore_mfaType","_MfaTypes_Authenticator","sendMFACode","resetMfaType","getDarkThemeConfig","paletteModeCode","dark","layout","palette","action","disabled","disabledBackground","black","white","purple","offWhite","glass","glassOnGlass","jobColumnStatusHeader","lightOrange","orange","pink","darkGray","primary","main","contrastText","secondary","warning","info","success","text","iconDisabled","divider","background","default","paper","candidatesFunnel","new","shortlist","interview","offer","rejected","candidatesSource","directlyApplied","recruiterAdded","aiMatched","managerAdded","jobsFunnel","active","paused","draft","alertOutlined","bgSuccess","bgWarning","bgError","onePager","skillsProgress","skillsProgressBg","jobsProgress","jobsProgressBg","boxBg","consultantList","statusChips","selected","border","entityPanel","sidebar","activeState","drawerBackground","chevronIcon","components","MuiAlert","styleOverrides","standard","backgroundColor","MuiSwitch","root","borderColor","opacity","thumb","track","MuiPaper","boxShadow","backdropFilter","MuiFormHelperText","MuiFormLabel","hover","gorillaResume","ai","button","gray","dark2","warningLight","beige","outline","MuiInputBase","switchBase","marginLeft","MuiDialog","borderRadius","BackdropProps","style","fill","MuiOutlinedInput","notchedOutline","borderWidth","standardError","alpha","standardInfo","standardWarning","standardSuccess","getLightThemeConfig","purpleLight","smokeWhite","logoMode","MuiLinearProgress","PALETTE","BREAKPOINTS","sm","md","lg","xl","k2","k4","MIXINS","toolbar","menuButton","paddingBottom","paddingRight","flexDirection","marginRight","minWidth","transition","transform","menuButtonLabel","textTransform","borderBottom","baseThemeConfig","typography","fontFamily","htmlFontSize","h2","fontWeight","h2Bold800","h4","h5Bold700","h6","h6Bold800","h22","h22Bold800","h30","h30Bold800","subtitle1","subtitle1Bold","subtitle1Label","body1","body1Bold","body1Bold500","body1Bold700","body2","body2Bold","body2Bolder","body3","shape","radius","small","normal","larger","large","mixins","MuiCssBaseline","boxSizing","scrollbarColor","scrollbarWidth","Values","all","index","assign","getColorShadeLabel","weight","rgb","marginTop","margin","whiteSpace","MuiButton","size","ownerState","textUnderlineOffset","sizeSmall","sizeMedium","sizeLarge","MuiToggleButton","letterSpacing","paddingTop","MuiMenu","MuiMenuItem","MuiContainer","disableGutters","MuiAppBar","MuiAvatar","MuiDialogActions","MuiCard","MuiFormControlLabel","asterisk","MuiAutocomplete","option","MuiFormControl","rowGap","cursor","WebkitTextFillColor","WebkitBoxShadow","input","MuiInputAdornment","MuiSelect","icon","_obj","down","flexWrap","outlinedError","filledSuccess","MuiChip","label","MuiAccordion","MuiAccordionSummary","borderBottomColor","MuiTabs","MuiTab","ThemeService","baseThemeModeSubject","printTheme","themeMap","clientSettings","forceCreate","themeConfig","themeKey","themeOptions","getThemeConfig","createTheme","baseTheme","isAuthenticated","userThemeMode","appThemeConfig","clientThemeConfig","clientVendorCode","_portal_settings_defaultThemeMode","_portal_settings_defaultThemeMode1","_portal_settings_defaultThemeMode2","responsiveFontSizes","UtilsService","jobEndpoint","JOB_API_URL","functionInput","useAuthService","useState","useClientService","useThemeService","RollbarProvider","useLocation","_useState","enabled","Rollbar","rollbarInstance","useEffect","_Fragment","useIsClientByClientCode","clientCodeToMatch","Alert","React","ref","elevation","AlertContext","createContext","initialAlertState","autoHide","vertical","horizontal","severity","timeout","AlertContextProvider","alert","setAlert","removeAlert","useCallback","prev","addAlert","contextValue","useMemo","snackBarprops","autoHideDuration","anchorOrigin","onClose","InjectableContexts","_jsxs","Provider","Snackbar","zIndex","mt","AlertTitle","excludedProps","WithGorillaInnerTheme","Component","StyledComponent","isThemeBackgroundApplied","forwardRef","clientService","themeService","useTheme","useObservableEagerState","clientSetting$","isGorillaTheme","appType$","useIsGorillaTheme","isDarkMode","isGlassMode","isLightMode","isModeChanged","innerTheme","getOrCreateTheme","forceCreateTheme","componentProps","ThemeProvider","GorillaDialog","Dialog","AuthStore","menuItemList","useMfaStore","useLoadMfePaths","authStore","enabledPaths","setEnabledPaths","filterFunc","mfePortal","subscription","menuItemList$","pathList","_item_to","path","every","a1","b1","unsubscribe","useSubscriptionRef","subscriptionRef","useRef","current","appBuildDataChannel","BroadcastChannel","allMfeTypes","MfeTypes","useAppReloadRequired","sendDataToGTM","useGTMDispatch","appService","mfeEnabledPaths","isReloadRequired","setIsReloadRequired","isStreamingRef","isOtherStreamingRef","joinedStreamListRef","enabledPathListRef","appSessionIdRef","Math","random","deltaStreamRef","trackCallError","appKey","eventName","CallingNewBuildNumberApi","handleNewBuildEvent","buildDataList","buildMap","getAppBuildData","currentBuildId","buildId","streamAppBuildData","appSessionId","postMessage","_enabledPathListRef_current","remoteMfeMap","enabledPathList","requestList","_remoteMfeMap_appKey","_buildMap_appKey","hasEnabledPaths","baseUrl","_buildMap_appKey1","itemList","findIndex","innerItem","getAppVersion","interval","timer","setTimeout","isDifferent","clearTimeout","addEventListener","_joinedStreamListRef_current","targetSessionId","_data_sharedJoinedStreamList","sharedJoinedStreamList","_joinedStreamListRef_current1","handleBeforeUnload","joinedStreamList","removeEventListener","CloseIconButton","MuiIconButton","ModalCloseButton","handleClose","iconSx","useTranslation","onClick","CloseIcon","NewAppVersionPrompt","isPostponed","setIsPostponed","_useState1","setOpen","handleLaterBtnClick","reason","PostponeReceivingNewBuildNumber","OpenReloadingDialogForNewBuildNumber","disableEscapeKeyDown","maxWidth","PaperProps","paddingY","paddingX","DialogContent","mb","Stack","direction","Typography","gutterBottom","component","textAlign","DialogActions","Button","useSubjectSelector","stateStore","stateValue","getStateValue","sta","setState","normalizedKeys","normalizedKeysJoin","keysArray","split","observableMap","select","sub","combineLatest","currentCognitoUserPassword","currentOtpUser","currentUserSession","currentUserSocialSession","isCognitoUserSessionExpired","isMfaCodeRequested","siteConfig","authConfigOptions","userAttribute","options","isSessionExpired","isRequested","updatedState","ClientPortalBanner","desktopView","useMediaQuery","pl","Trans","i18nKey","OuterMost","Banner","useObservable","clientName$","isClientPortal","GorillaGrid","Grid","useWindowedObservable","stateKey","useRollbarInstance","useRecaptcha","executeRecaptcha","useGoogleReCaptcha","getRecaptchaToken","TrackingContext","mapper","VendorNames","_process_env_ENABLE_DATA_TRACKING","_process_env_ENABLE_PERFORMANCE_TRACKING","_process_env_FILE_STORAGE_URL","_process_env_GTM_KEY","_process_env_IS_ERROR_BOUNDARY_ENABLED","_process_env_IS_RESUME_COPILOT_FEATURE_ENABLED","_process_env_MIXPANEL_TOKEN","_process_env_LINKEDIN_CLIENT_ID","_process_env_ROLLBAR_ACCESS_TOKEN","_process_env_ROLLBAR_ENABLED","_process_env_ROLLBAR_ENVIRONMENT","useTrackingEvent","commonProperties","currentUser$","currentUserProfile$","currentUserProfile","_currentUser_id","_currentUserProfile_vendorCode","_mapVendorCodeToName","_currentUserProfile_profileType","_currentUserProfile_clientName","_currentUserProfile_clientCode","_document_title","vendorName","$page_title","useCommonTrackData","sendDatToMixPanel","useContext","useMixPanelTracking","mixPanelTracking","mixPanelProperties","properties","gtmTracking","gtmProperties","trackData","_param_isGTMTracking","isGTMTracking","_param_isMixPanelTracking","isMixPanelTracking","isTrackingEnabled","filteredRest","commonDevEnv","process","ENABLE_DATA_TRACKING","FBO_API_URL","FBO_WEB_URL","FILE_STORAGE_URL","GTM_KEY","GOOGLE_MAPS_API_KEY","IS_ERROR_BOUNDARY_ENABLED","MIXPANEL_TOKEN","PANDA_DOC_WEB_URL","SYNC_FUSION_EDITOR_KEY","SYNC_FUSION_EDITOR_SERVICE_URL","TALENT_POOL_API_URL","TINY_MCE_API_KEY","LINKEDIN_CLIENT_ID","captureUncaught","ROLLBAR_CAPTURE_UNCAUGHT","captureUnhandledRejections","ROLLBAR_CAPTURE_UNHANDLED","ROLLBAR_ACCESS_TOKEN","ROLLBAR_ENABLED","ROLLBAR_ENVIRONMENT","GOOGLE_RECAPTCHA_KEY","BLOB_STORAGE_URL","MAP_FBO_USER_SERVICE_API_ID","MAP_FBO_USER_SERVICE_API_KEY","MAP_FBO_USER_SERVICE_BASE_URL","ENABLE_CONTRACTOR_LOGIN","ENABLE_CLIENT_PORTAL_SIGNUP","EY_DEMO_USER","EY_DEMO_LOGO","EY_CONTRACTOR_MANAGEMENT_URL","MS_SSO_CLIENT_ID","MS_SSO_AUTHORITY","IS_FBO_INVITATION_SIGNUP_MAINTENANCE_ENABLED","useTrackingWrapper","IAccountType","msalConfig","auth","clientId","authority","navigateToLoginRequestUrl","cache","cacheLocation","BrowserCacheLocation","storeAuthStateInCookie","loginRequest","scopes","prompt","msalInstance","PublicClientApplication","ClientPortalProtectedLinksEnum","UnProtectedLinksEnum","FailedSocialLoginCallbackUrl","socialLoginContext","InvalidEmailDomain","getClientHostURL","host","getCallbackURL","getOriginBaseUrl","getDestinationURL","passwordValidations","DefaultPasswordValidationState","transKey","valid","client","contractor","employer","gorillaresume","customer","support","PreferredLanguageType","initReactI18next","LanguageDetector","HttpApi","init","returnEmptyString","supportedLngs","detection","order","lookupQuerystring","caches","ns","fallbackLng","EN","backend","loadPath","react","useSuspense","localStorageValues","callbackUrl","cognitoUserHasMultipleMfaMethods$","currentCognitoUser$","ACCOUNT_ENDPOINT","SiteConfigurationEndPoint","handleCodeSignIn","setCurrentOtpUser","catchErrorWrapper","getMappedAuthOptions","authConfig","LoginTypeUniversalMapper","setAuthConfigOptions","includeCognitoUser","accountType","Client","queryParams","setCurrentUserSession","isPendingFlow","redirectToClientPortal","resetCognito","setCognitoUserSession","setCurrentCognitoUserPassword","idToken","setCurrentUserSocialSession","newAccount","getUsername","setCurrentCognitoUserEmail","userAttributes","email_verified","setUserAttributes","updateState","firstName","lastName","confirmationCode","completeNewPasswordChallenge","getSignInUserSession","UserId","IsClaimingProfile","RecaptchaToken","CampaignId","ProfileType","clientInfo","isGorillaResumeUser","PortalType","VendorCode","ClientCode","OriginBase","CallbackURL","DestinationURL","AuthPortalBase","FormSignUpEmail","campaignId","setCognitoSignInUserSession","refresh_token","EMPTY","getCurrentUser","signOut","LoginType","userEmailVerification","migrationToken","onboardingCode","catchAwsError","OSApiId","OSApiKey","customQueryParams","isOtpLogin","isAnonymousShare","isOptUserSubject","callbackHref","fboMigrationToken","portalCode","destinationUrl","setSiteConfig","ProtectedLinksEnum","callBackUrl","getSession","socialLoginTokens","newUserSession","CognitoUserSession","AccessToken","CognitoAccessToken","IdToken","CognitoIdToken","RefreshToken","CognitoRefreshToken","decodePayload","setSignInUserSession","mappings","Name","Value","cognitoUserSession","useLoginTypes","isContractorLogin","isClientLogin","isCustomerLogin","isGorillaResumeLogin","useIsUserCreationAllowed","isUserCreationAllowed","SignUpRoutes","SocialLoginContext","LogoSizeOptions","FeatureFlagStore","featureFlags","flags","featureFlagStore","FeatureFlagNames","FlowRequestType","AwsUserStatusTypes","loginToProfileTypeMap","Map","HiringManager","AccountManager","ResourceManager","useIsMsMultiTenantClient","utilsService","setFeatureFlags","useSearchParams","searchParams","isMSMultiTenantClient","setIsMSMultiTenantClient","loginTypeParam","Subscription","getVendorFeatureFlags","flag","featureName","MS_SSO_Multitenant","isMSMultiTenant","eligibleProfileTypes","userLoginType","modifiedUserLoginType","charAt","profileTypes","shouldShowMsSsoButton","LangBtnSx","LanguageSwitcher","isFrenchSelected","FR","handleLanguage","then","resaveClientSettings","Disclaimer","justifyItems","Footer","Link","RouterLink","innerGridStyles","pb","my","BaseLayout","isDesktop","brandLogoSrc","BrandLogoDarkSvg","BrandLogoSvg","getSettings","setLoginType","container","overflow","authPortalBackgroundSvg","backgroundSize","pr","bottom","src","alt","PortalToolbar","_param_height","restProps","trigger","useScrollTrigger","disableHysteresis","threshold","Toolbar","ClientPortalBackground","clientPortalBackgroundSvg","LogoWrapper","_param_isAuthenticated","logoWrapperStyles","clientPortalHostname","authPortalHostname","clientProperty","getClientDomainProperty","styledLogoComponent","elem","Dashboard","ClientLogoSizes","XLarge","clientSettingName","LogoSizes","Small","Medium","MediumToLarge","Large","Logo","svgSx","logoHref","_clientSettings_common_logo","_clientSettings_common_logo1","_clientSettings_common_logo_assetClient","useObservableState","themePalette","useClientLogo","effectiveSize","clientLogoSize","logoSize","logoConfig","SVG","objectFit","objectPosition","IMG","renderLogo","AppBar","LegalDocumentLayout","subTitle","isMobile","px","columnGap","noWrap","marginBlock","paddingBlock","Divider","orientation","flexItem","Select","onChange","val","MenuItem","ListItemText","WithGorillaAlert","GorillaAlert","currentTheme","baseThemeMode$","tabIndex","validatePassword","passwordValidation","setPasswordValidation","validation","Yup","min","isValid","matches","oneOf","confirmPassword","validationMap","validationFunction","RenderCheckbox","control","Checkbox","CheckCircleOutline","checkedIcon","CheckCircle","checked","disableRipple","FormControlLabel","initialCredentials","ChangePassword","submitRequest","submitLabel","gtmEvent","submitIsLoading","setSubmitIsLoading","credentials","showPassword","setShowPassword","errorString","setErrorString","handleMouseDownPassword","preventDefault","Formik","initialValues","validate","errors","passwordValidate","onSubmit","clientPortalRedirectionEnabled","add","submitForm","touched","disableSubmit","Form","onKeyDown","Field","TextField","InputLabelProps","shrink","fullWidth","InputProps","autoComplete","endAdornment","InputAdornment","IconButton","onMouseDown","edge","VisibilityOff","Visibility","FormGroup","endIcon","ArrowForward","Header","memo","heading","description","align","ChangePasswordForm","navigate","useNavigate","paramCode","paramEmail","handleSubmit","changePassword","FormChangePassword","CompleteRegistrationForm","showChangeForm","emailParam","migrationTokenParam","sourceParam","tenantParam","onboardingCodeParam","isFboMigrationTokenValid","setIsFboMigrationTokenValid","setMigrationToken","recaptcha","resendInvitationToken","activateFboMappingToken","RecaptchaActions","resendUserInvitation","decodedEmail","handleAuthentication","initialAuthentication","oneTimeCode","getUserMigrationInfo","migrationData","isMigrated","isActivated","isFboUser","isOnboardingInvitation","initialLogin","concatMap","activateFboUserMapping","setUserRegisteredOn","verifyEmail","toArray","TermsAndConditions","displayClientConnections","CompanyNames","companyName","ResetPasswordForm","formValues","setFormValues","showFeedbackDialog","setShowFeedbackDialog","validationSchema","required","closeFeedbackDialog","actions","getPasswordInfo","hasPasswordExpired","hasContractorProfile","requestPasswordReset","FormResetPassword","resetForm","setSubmitting","enableReinitialize","noValidate","underline","LoadingButton","loading","DialogTitle","grey","Close","DialogContentText","autoFocus","useAlert","VerifyEmail","String","setMessage","codeParam","setIsLoading","refreshUserSessionInfo","emailVerified","handleSendVerification","resendEmailVerification","gap","VerifySVG","DEMO_CLIENTS","validFirstNameRegex","validLastNameRegex","validPasswordRegex","addressLine1","nullable","addressLine2","city","province","postalCode","ensure","countryCode","country","latitude","longitude","validateDemoPortalEmailDomain","allowedDomains","shouldValidate","emailDomain","LoginLink","pt","TncAndPrivacyPolicy","InitialUser","isExistingUser","SignupForm","userClaimingProfile","setUserClaimingProfile","isClaimingProfile","setIsClaimingProfile","setCredentials","isResumePortalSignup","shouldValidateEmailDomain","companyInternalEmailDomains","getSiteConfigurationByOriginBase","getUserEmailById","claimContractorProfile","handleGoBack","userEmail","trim","signUp","setErrors","validateOnBlur","validateOnChange","isFormFilled","FormControl","FormHelperText","ml","mr","CheckboxWithLabel","Label","startIcon","ArrowBack","SocialButton","SocialMediaButtonGroup","storageUrl","handleClick","_param_socialLoginTypes","socialLoginTypes","filteredSocialLoginTypes","socialList","svg","GoogleSvg","FacebookSvg","LinkedInSvg","socialLoginType","flex","socialListItem","toLocaleLowerCase","SocialMediaLogin","socialMediaOptions","handleSocialMediaLogin","btoa","isEmailLoginAllowed","SignupMethods","signupFailed","loginFailed","invalidEmailDomain","Signup","ActivateFboInvitation","destinationUrlParam","CommonMessages","PageNotFoundContent","_param_showHomeButton","showHomeButton","NotFoundSVG","paragraph","PageNotFound","AlertMessage","_param_severity","DigitalCodeInput","isVerifying","handleVerifyCode","div","flexBasis","flexGrow","caretColor","borderLeft","ReactCodeInput","onComplete","defaultValues","VerifyDigitalCode","otp","setOtp","setIsVerifying","handleGenerateOtp","handleOtpSignIn","validateOtpSignIn","hasReachedMaxAttempts","hour","marginBlockEnd","EmailSupportLinks","FormErrorType","useHookFieldError","fieldState","nestedFieldName","errText","invalid","fieldError","requiredWithLabel","TextHookField","_param_fullWidth","_param_allowOnlyDigits","allowOnlyDigits","_param_allowCharOnly","allowCharOnly","_param_maxDecimalPlaces","maxDecimalPlaces","_param_digitCount","digitCount","helperText","_param_customLabel","customLabel","displayValue","_useController","useController","_useController_field","field","onBlur","restField","inputTextRef","isTooltipVisible","setIsTooltipVisible","handleChange","targetValue","RegExp","handleBlur","_restProps_onBlur","handleWheel","blur","isOverflowing","scrollWidth","offsetWidth","FormLabel","htmlFor","Tooltip","readOnly","inputRef","onWheelCapture","LocalStorageAttributes","LoginTypeAllowedAttributes","Employer","Customer","Support","GorillaResume","isAttributeExists","attribute","_LoginTypeAllowedAttributes_loginType","CustomAlert","handleAlertClose","ScreenAlert","userHasLoggedOut","setUserHasLoggedOut","userSessionExpired","setUserSessionExpired","userNotAllowed","setUserNotAllowed","userHasAccount","setUserHasAccount","setEmailVerified","newPassword","setNewPassword","IsResumeCopilotConsentGiven","errorParam","defaultMask","PhoneInput","maskArray","inputProps","MaskedInput","inputElement","mask","HmCreationForm","useFormContext","formState","inputComponent","startAdornment","SubmissionTrackingStatus","ssoLoginTrackingDate","account","Submitted","trackingProps","FormMsSSOLogin","useMsSsoLogin","useMsal","accounts","ssoLoginSubscriptionRef","handleMsSsoLogin","handleErrorMessages","acquireTokenSilent","tokenResponse","microsoftSSOLogin","Failed","loginRedirect","handleRedirectResponse","handleRedirectPromise","responseReceived","handleMsSsoRedirect","MicrosoftLoginButton","handleError","CustomFormLabel","RadioGroupValueType","radioGroupDefaultOptions","RadioGroupHookInput","_param_required","_param_disabled","_param_options","_param_valueType","valueType","formLabelSx","_param_helperTextEnabled","helperTextEnabled","radioSx","stringToBoolean","RadioGroup","opt","_opt_disabled","subLabel","Radio","AccountTypeOptions","ProfileSelectionForm","watch","row","FboMaintenance","LandingForm","requestType","isContractorInvite","anonymousToken","isFboInvite","isDomainDetected","setIsDomainDetected","isMultiSelect","setIsMultiSelect","validateSubscriptionRef","publicDomainSubscriptionRef","userSubscriptionRef","otpSubscriptionRef","createSubscriptionRef","fboInviteSubscriptionRef","getProfileType","isProfileAllowedToEnterEmail","yup","formInstance","useForm","resolver","yupResolver","reValidateMode","setValue","useWatch","handleSendOtp","userResponse","generateSignInOtp","onboardingParam","ValidateSignIn","createSearchParams","handleDomainDetection","handleCheckClientDomain","ClientCreateNotAllowed","ClientSignupNotAllowed","handlePublicDomainCheck","handleUserVerification","getIfUserExist","signup","createContactWithoutPassword","errData","handleKeyDown","handleFboInvite","FormProvider","SignupCompleteForm","isRecaptchaReady","setIsRecaptchaReady","isOtpValid","setIsOtpValid","showOtpVerifyScreen","setShowOtpVerifyScreen","idParam","resendSubscriptionRef","resetOtpSubscriptionRef","submitSubscriptionRef","commonPasswordSchema","passwordValidationSchema","handleResendLink","tempPassword","LinkButton","_param_underline","disableFocusRipple","CommonEndAdornment","handleShowPassword","handleStrayClicks","PasswordCreateScreen","resendOtpSubscriptionRef","verifyCodeSubscriptionRef","isValidPasswords","handleResendOtp","pass","newValidation","marginX","PasswordValidateScreen","VerifyOtpLogin","handleSignInSubscriptionRef","handleVerifyCodeSubscriptionRef","isOnboardingInvite","fboMappingToken","isContractor","isGorilla","isClient","isOtpOption","setIsOtpOption","isCognitoUserExists","setIsCognitoUserExists","cognitoUserStatus","setCognitoUserStatus","isCognitoUserCheckLoading","setIsCognitoUserCheckLoading","isCognitoUserConfirmed","CONFIRMED","isUserWithoutPassword","afterLoginSubscriptionRef","handleSubmitSubscriptionRef","handleLoginAfterAccountCreate","isPendingCognitoProcess","handleCreateAccount","handleSetPermanentPassword","createPasswordWithCodeSignIn","handleAuthenticate","awsUserStatuses","userStatus","textOverflow","wordWrap","mx","SignupGorillaResumeOtp","signUpSubscriptionRef","showVerifyCodeScreen","setShowVerifyCodeScreen","SignupComplete","PageTypes","pageType","pageTitle","pageURISuffix","_param_cancelEvent","cancelEvent","suffixString","pageURL","pageDOM","pageURI","useGtmVpv","lng","OtpInput","sendCode","verifyCode","showValidationIcon","_param_fields","sendCodeOnInitialLoad","_useField","useField","meta","helpers","_useCounter","counterTimeout","counter","setCounter","initCounter","_param_count","count","_param_interval","setInterval","resetCounter","clearInterval","useCounter","codeRef","setError","clearSubscription","handleSendCode","_codeRef_current","__clearvalues__","errorDesc","_subscriptionRef_current","setTouched","CheckCircleIcon","CheckCircleOutlineIcon","ExpiredPasswordForm","showConfirmPassword","setMeta","initialValue","codeVerified","handleShowConfirmPassword","otpCode","validateVerficationCode","sendVerficationCode","iconMapping","InfoOutlined","migrateSignUp","validateOnMount","dirty","ExpiredPasswordRoute","userInfosSubscriptionRef","isGetUserEnabled","saveClientPortalParams","paramValue","searchParam","paramsRoute","fromEntries","entries","redirectToInitialRoute","route","redirectToParam","routesMapping","login","signupEmail","completeRegistration","activateFboInvitation","resetExpiredPassword","welcome","resetPassword","routeMapped","asyncGeneratorStep","gen","_next","_throw","arg","_ts_generator","thisArg","f","g","sent","trys","ops","verb","op","pop","step","fn","_state","MfaLoginCodeVerification","_param_showEmail","showEmail","mfaService","contactUsLink","_useSubjectSelector","subscrptionRef","cognitoUserHasMultipleMfaMethods","handleSendMfaCode","handleSelectMfaMethod","handleSelectMfaType","handleSelectMfaMethodSubscription","showAlert","mfaMethod","getPreferredMfaMethod","LoginMfa","handleResetCognito","MsSsoCallBack","LegalDocuments","getPrivacyFetchRequest","PrivacyPolicyPage","handleBack","content","setContent","localLng","_i18n_language","parsedHtml","Parse","PrivacyPolicy","Suspense","fallback","_param_showLinks","showLinks","isFrictionLessView","ForgotPassword","stateParam","atob","linkedinLogin","getSocialLoginAwsToken","EntityTypes","ClientSignup","rememberMeStorageKey","rememberMe","showPasswordValidation","setShowPasswordValidation","showConfirmPasswordValidation","setShowConfirmPasswordValidation","initialSignup","accessExpired","registerCollaborator","handleInitialSignup","clientSignup","decodedCode","getCollaboratorInfo","isProfileClaimed","ClientJob","TalentPool","setFieldValue","onFocus","componentsProps","Register","getTermFetchRequest","TermsOfUsePage","TermsOfUse","TermUse","AppRoutes","isClientHCMWorks","isVendorAllowed","Routes","Route","element","Navigate","SignupResumeOtp","MSALProvider","callBackId","initializeMsal","initialize","getAllAccounts","setActiveAccount","addEventCallback","eventType","EventType","InitializingMsSsoLogin","removeEventCallback","AppThemeProvider","queryThemeMode","localThemeMode","appTheme","initializeBaseTheme","setInitialVendorCode","reCaptchaKey","BrowserRouter","CssBaseline","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","gtmParams","ReactDOM","GTMProvider","getElementById","reportWebVitals","webpackAsyncContext","req","__webpack_require__","ids","module","exports"],"sourceRoot":""}