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C,cAAeH,QAASjF,EAAAA,cAACuE,EAAa,WAKlDc,EAAAA,WAAoBC,SAASC,eAAe,SAEpDC,OACHxF,EAAAA,cAACyF,EAAAA,EAAa,KACZzF,EAAAA,cAAC0F,EAAAA,EAAO,KACN1F,EAAAA,cAAC2F,EAAAA,EAAc,CAACd,OAAQA,M","sources":["webpack://ebr/./client/utils/validators.ts","webpack://ebr/./client/hooks/useForm.ts","webpack://ebr/./client/components/shared/OrganizationalUnitGate/index.tsx?8d78","webpack://ebr/./client/components/shared/OrganizationalUnitGate/index.tsx","webpack://ebr/./client/components/modules/Login/Form.tsx?bd51","webpack://ebr/./client/components/modules/Login/Form.tsx","webpack://ebr/./client/components/modules/Login/index.tsx","webpack://ebr/./client/apis/passwordsApi.ts","webpack://ebr/./client/components/modules/Login/ForgotPassword.tsx?1145","webpack://ebr/./client/components/modules/Login/ForgotPassword.tsx","webpack://ebr/./client/components/modules/Login/PasswordReset.tsx?3237","webpack://ebr/./client/components/modules/Login/PasswordReset.tsx","webpack://ebr/./client/entries/login.tsx"],"sourcesContent":["const emailValidator = (value: string) => /^[^@]+@[^@]+$/i.test(value)\n\nconst presenceValidator = (value: unknown) =>\n value !== undefined && value !== null && `${value}`.trim().length !== 0\npresenceValidator.required = true\n\nconst confirmationValidatorGenerator =\n (k1: keyof T, k2: keyof T): ((values: T) => boolean) =>\n (values: T) =>\n values[k1] === values[k2]\n\nconst greaterThanValidatorGenerator = (threshold: number) => (value: string) =>\n parseFloat(value) > threshold\n\nconst moneyValidator = (amount: string) => /^\\d+(\\.\\d{2})?$/.test(amount)\n\nexport {\n emailValidator,\n presenceValidator,\n confirmationValidatorGenerator,\n greaterThanValidatorGenerator,\n moneyValidator,\n}\n","import { CheckboxProps, SelectProps, TextFieldProps } from '@mui/material'\nimport { DatePickerProps } from '@mui/x-date-pickers'\nimport React, { FormEvent, useState } from 'react'\n\nimport { FormConfirmationDialogProps } from 'components/shared/FormConfirmationsDialog'\nimport omit from 'utils/omit'\n\nexport interface Validator {\n // message is the message that the user will see if the value is invalid\n message: string\n // validators validate a specific attribute and return true if the value is valid\n validator?: ((_: V) => boolean) & { required?: boolean }\n // conditionals get passed all the values in order to validate that a value is valid\n // depending on another value in the form\n conditional?: (_: T) => boolean\n}\n\nexport type Validations = Partial<{\n [K in keyof T]: Validator[]\n}>\n\nexport type ValueFormatter = (_: T) => T\n\nexport type ValueFormatters = Partial<{\n [K in keyof T]: ValueFormatter\n}>\n\ntype Errors = Partial<{\n [K in keyof T]: string\n}>\n\nexport type FormConfirmation = (_: T) => string | null | undefined\n\nconst initialFormConfirmationDialogProps: FormConfirmationDialogProps = {\n onConfirm: () => {},\n onCancel: () => {},\n messages: [],\n}\n\nconst useForm = , SKeys extends KeysOfValue>(\n initialValues: T,\n {\n validations = {},\n valueFormatters = {},\n confirmations = [],\n includeWhitespaceKeys = [],\n afterChange = () => {},\n }: {\n validations?: Validations\n // value formatters get ran when the value changes allowing you to alter the value\n valueFormatters?: ValueFormatters\n // form confirmations allow you to add messages to a FormConfirmationDialog\n // depending on the values submitted by passing the returned formConfirmationDialogProps\n // to the FormConfirmationDialog component\n confirmations?: FormConfirmation[]\n // include whitespace keys specifies the keys whose values you do no want trimmed\n includeWhitespaceKeys?: SKeys[]\n afterChange?: () => void\n } = {},\n) => {\n const [values, setValues] = useState(initialValues)\n const [errors, setErrors] = useState>({})\n const [formConfirmationDialogProps, setFormConfirmationDialogProps] =\n useState(initialFormConfirmationDialogProps)\n\n type IncludeWhitespace = {\n [key in SKeys]: true\n }\n const includeWhitespace = {} as IncludeWhitespace\n includeWhitespaceKeys.forEach((key) => {\n includeWhitespace[key] = true\n })\n\n const normalizeValues = (rawValues: T): T => {\n const vals = {} as T\n Object.entries(rawValues).forEach(([key, value]) => {\n let v = value\n if (typeof v === 'string' && !includeWhitespace[key]) {\n v = v.trim()\n }\n vals[key] = v\n })\n return vals\n }\n\n type TKeysContainingValue = {\n [K in Keys]: T[K] extends TCondition ? K : never\n }[Keys]\n\n const validationError = (\n name: K,\n value: V = undefined,\n ): string | null => {\n const failedValidation = (validations[name] || []).find((validation) => {\n const val = value === undefined ? values[name] : value\n if (validation.validator && !validation.validator(val)) return true\n if (validation.conditional) return !validation.conditional(normalizeValues(values))\n\n return false\n })\n\n return failedValidation?.message || null\n }\n\n const validateAll = () => {\n const currentErrors = {}\n\n Object.keys(validations).forEach((name) => {\n const error = validationError(name as Keys)\n if (error) currentErrors[name] = error\n })\n\n setErrors(currentErrors)\n return Object.keys(currentErrors).length === 0\n }\n\n const validate = (name: K, value: V) => {\n const error = validationError(name, value)\n if (error) {\n setErrors({ ...errors, [name]: error })\n return false\n }\n\n setErrors(omit(errors, name))\n return true\n }\n\n const isRequired = (name: K) =>\n (validations[name] || []).some(({ validator }) => validator?.required)\n\n const onChange = (name: K, value: V) => {\n const formatter = valueFormatters[name]\n const val = formatter ? formatter(value) : value\n setValues({ ...values, [name]: val })\n if (errors[name]) validate(name, val)\n afterChange()\n }\n\n const onBlur =\n (name: K) =>\n () =>\n validate(name, values[name])\n\n const checkboxProps = >(name: K): CheckboxProps => ({\n id: name,\n checked: values[name] as boolean,\n required: isRequired(name),\n onChange: ({ target: { checked } }) => onChange(name, checked as T[K]),\n })\n\n const textFieldProps = >(name: K): TextFieldProps => ({\n id: name,\n value: values[name],\n error: !!errors[name],\n helperText: errors[name],\n required: isRequired(name),\n onChange: ({ target: { value } }) => onChange(name, value as T[K]),\n onBlur: onBlur(name),\n })\n\n const selectProps = >(\n name: K,\n ): SelectProps => ({\n id: name,\n value: values[name],\n error: !!errors[name],\n required: isRequired(name),\n onChange: ({ target: { value } }) => onChange(name, value as T[K]),\n onBlur: onBlur(name),\n })\n\n const datePickerProps = >(\n name: K,\n ): DatePickerProps => ({\n value: values[name] as Date,\n slotProps: {\n textField: {\n required: isRequired(name),\n error: !!errors[name],\n helperText: errors[name],\n onBlur: onBlur(name),\n },\n },\n onChange: (value) => onChange(name, value as T[K]),\n })\n\n const handleFormSubmit =\n (onSuccess: (_: T) => void): React.FormEventHandler =>\n (event: FormEvent) => {\n event.preventDefault()\n\n if (validateAll()) {\n const normalizedValues = normalizeValues(values)\n if (confirmations.length > 0) {\n const confirmationMessages: string[] = []\n confirmations.forEach((confirmation) => {\n const message = confirmation(normalizedValues)\n if (!message) return\n\n confirmationMessages.push(message)\n })\n\n if (confirmationMessages.length > 0) {\n setFormConfirmationDialogProps({\n messages: confirmationMessages,\n onCancel: () => {\n setFormConfirmationDialogProps(initialFormConfirmationDialogProps)\n },\n onConfirm: () => {\n onSuccess(normalizedValues)\n setFormConfirmationDialogProps(initialFormConfirmationDialogProps)\n },\n })\n\n return\n }\n }\n\n onSuccess(normalizedValues)\n }\n }\n\n const resetForm = () => {\n setValues(initialValues)\n setErrors({})\n }\n\n return {\n checkboxProps,\n textFieldProps,\n handleFormSubmit,\n selectProps,\n datePickerProps,\n values,\n errors,\n resetForm,\n formConfirmationDialogProps,\n }\n}\n\nexport default useForm\n","function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e{let{types,...props}=_ref;const{organizationalUnitType}=useAppConfig();return/*#__PURE__*/React.createElement(PromiseGate,_extends({},props,{promise:()=>Promise.resolve(types.includes(organizationalUnitType)),deps:types}));};export default OrganizationalUnitGate;","import React from 'react'\n\nimport PromiseGate, { PromiseGateProps } from 'components/shared/PromiseGate'\nimport useAppConfig from 'hooks/useAppConfig'\n\nexport interface OrganizationalUnitGateProps extends Omit {\n types: string[]\n}\n\nconst OrganizationalUnitGate = ({ types, ...props }: OrganizationalUnitGateProps) => {\n const { organizationalUnitType } = useAppConfig()\n\n return (\n Promise.resolve(types.includes(organizationalUnitType))}\n deps={types}\n />\n )\n}\n\nexport default OrganizationalUnitGate\n","function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e{const{textFieldProps,checkboxProps,handleFormSubmit}=useForm(initialValues,{validations});const[{status,error,response},loginAction]=usePromise(loginApi.login);if(status.isResolved){const path=response?.data?.user?.homePath||'/';return/*#__PURE__*/React.createElement(Redirect,{to:path,replace:true});}return/*#__PURE__*/React.createElement(Box,{maxWidth:\"750px\",margin:\"1em auto\",component:Paper},/*#__PURE__*/React.createElement(\"form\",{onSubmit:handleFormSubmit(loginAction)},/*#__PURE__*/React.createElement(Stack,{padding:2,spacing:2},/*#__PURE__*/React.createElement(TextField,_extends({label:\"Email\"},textFieldProps('email'))),/*#__PURE__*/React.createElement(TextField,_extends({label:\"Password\",type:\"password\"},textFieldProps('password'))),/*#__PURE__*/React.createElement(FormGroup,null,/*#__PURE__*/React.createElement(FormControlLabel,{control:/*#__PURE__*/React.createElement(Checkbox,checkboxProps('rememberMe')),label:\"Remember me\"})),/*#__PURE__*/React.createElement(Button,{type:\"submit\",variant:\"contained\",disabled:status.isPending},\"Login\"),error&&/*#__PURE__*/React.createElement(Alert,{severity:\"error\"},error),/*#__PURE__*/React.createElement(Box,{sx:{textAlign:'center',pt:1}},/*#__PURE__*/React.createElement(Link,{to:PATHS.forgotPassword,component:RouterLink,variant:\"caption\"},\"Forgot password?\")))));};export default Form;","import { Button, Checkbox, TextField } from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport FormGroup from '@mui/material/FormGroup'\nimport Link from '@mui/material/Link'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/material/Stack'\nimport React from 'react'\nimport { Link as RouterLink } from 'react-router-dom'\n\nimport loginApi from 'apis/sessions/loginApi'\nimport Redirect from 'components/shared/Redirect'\nimport PATHS from 'constants/paths'\nimport useForm, { Validations } from 'hooks/useForm'\nimport usePromise from 'hooks/usePromise'\nimport { emailValidator, presenceValidator } from 'utils/validators'\n\nconst initialValues = {\n email: '',\n password: '',\n rememberMe: false,\n}\n\nconst validations: Validations = {\n email: [\n { validator: presenceValidator, message: 'Email is missing' },\n { validator: emailValidator, message: 'Email is not valid' },\n ],\n password: [{ validator: presenceValidator, message: 'Password is missing' }],\n rememberMe: [],\n}\n\nconst Form = () => {\n const { textFieldProps, checkboxProps, handleFormSubmit } = useForm(initialValues, {\n validations,\n })\n const [{ status, error, response }, loginAction] = usePromise(loginApi.login)\n\n if (status.isResolved) {\n const path = response?.data?.user?.homePath || '/'\n return \n }\n\n return (\n \n
\n \n \n \n \n }\n label=\"Remember me\"\n />\n \n \n {error && {error}}\n \n \n Forgot password?\n \n \n \n
\n
\n )\n}\n\nexport default Form\n","import Box from '@mui/material/Box'\nimport Paper from '@mui/material/Paper'\nimport Typography from '@mui/material/Typography'\nimport React from 'react'\n\nimport OrganizationalUnitGate from 'components/shared/OrganizationalUnitGate'\nimport Redirect from 'components/shared/Redirect'\nimport useAppConfig from 'hooks/useAppConfig'\n\nimport Form from './Form'\n\nconst Login = () => {\n const { user } = useAppConfig()\n\n if (user) return \n\n return (\n \n \n Looks like you’re not logged in yet.\n \n \n Please log in through your member online portal to access this page.\n \n \n }\n >\n
\n \n )\n}\n\nexport default Login\n","import ApiService from 'apis/apiService'\n\nexport interface GenerateResetPasswordTokenParams {\n email: string\n}\n\nconst generateResetPassword = ({ email }: GenerateResetPasswordTokenParams) =>\n ApiService.post('/api/users/password', { user: { email } })\n\nexport interface ResetPasswordParams {\n password: string\n passwordConfirmation: string\n resetPasswordToken: string\n}\n\nconst resetPassword = ({\n password,\n passwordConfirmation,\n resetPasswordToken,\n}: ResetPasswordParams) =>\n ApiService.put('/api/users/password', {\n user: { password, passwordConfirmation, resetPasswordToken },\n })\n\nexport default { generateResetPassword, resetPassword }\n","function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e{const{textFieldProps,handleFormSubmit}=useForm(initialValues,{validations});const[{status,response,error},loginAction]=usePromise(passwordsApi.generateResetPassword);const successMessage=response?.data?.message;return/*#__PURE__*/React.createElement(Box,{maxWidth:\"500px\",margin:\"1em auto\",component:Paper},/*#__PURE__*/React.createElement(Button,{to:PATHS.forgotPassword,component:RouterLink},/*#__PURE__*/React.createElement(ChevronLeft,{sx:{verticalAlign:'middle'}}),\"Back\"),/*#__PURE__*/React.createElement(\"form\",{onSubmit:handleFormSubmit(loginAction)},/*#__PURE__*/React.createElement(Stack,{padding:2,spacing:2},/*#__PURE__*/React.createElement(TextField,_extends({label:\"Email\"},textFieldProps('email'))),/*#__PURE__*/React.createElement(Button,{type:\"submit\",variant:\"contained\",disabled:status.isPending},\"Reset password\"),error&&/*#__PURE__*/React.createElement(Alert,{severity:\"error\"},error),!!successMessage&&/*#__PURE__*/React.createElement(Alert,{severity:\"success\"},successMessage))));};export default ForgotPassword;","import ChevronLeft from '@mui/icons-material/ChevronLeft'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\nimport React from 'react'\nimport { Link as RouterLink } from 'react-router-dom'\n\nimport passwordsApi from 'apis/passwordsApi'\nimport PATHS from 'constants/paths'\nimport useForm, { Validations } from 'hooks/useForm'\nimport usePromise from 'hooks/usePromise'\nimport { emailValidator, presenceValidator } from 'utils/validators'\n\nconst initialValues = {\n email: '',\n}\n\nconst validations: Validations = {\n email: [\n { validator: presenceValidator, message: 'Email is missing' },\n { validator: emailValidator, message: 'Email is not valid' },\n ],\n}\n\nconst ForgotPassword = () => {\n const { textFieldProps, handleFormSubmit } = useForm(initialValues, {\n validations,\n })\n const [{ status, response, error }, loginAction] = usePromise(passwordsApi.generateResetPassword)\n\n const successMessage = response?.data?.message\n\n return (\n \n \n \n \n \n \n {error && {error}}\n {!!successMessage && {successMessage}}\n \n \n \n )\n}\n\nexport default ForgotPassword\n","function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e{const[searchParams]=useSearchParams();const{textFieldProps,handleFormSubmit}=useForm({...initialValues,resetPasswordToken:searchParams.get('reset_password_token')},{validations});const[{status,error},action]=usePromise(passwordsApi.resetPassword);if(status.isResolved&&!status.isError){return/*#__PURE__*/React.createElement(Box,{maxWidth:\"500px\",margin:\"1em auto\",component:Paper},/*#__PURE__*/React.createElement(Alert,{severity:\"success\"},\"Password updated successfully. Please\",' ',/*#__PURE__*/React.createElement(Link,{to:PATHS.login,component:RouterLink},\"login\"),\".\"));}return/*#__PURE__*/React.createElement(Box,{maxWidth:\"500px\",margin:\"1em auto\",component:Paper},/*#__PURE__*/React.createElement(\"form\",{onSubmit:handleFormSubmit(action)},/*#__PURE__*/React.createElement(Stack,{padding:2,spacing:2},/*#__PURE__*/React.createElement(TextField,_extends({label:\"Password\",type:\"password\"},textFieldProps('password'))),/*#__PURE__*/React.createElement(TextField,_extends({label:\"Password Confirmation\",type:\"password\"},textFieldProps('passwordConfirmation'))),/*#__PURE__*/React.createElement(Button,{type:\"submit\",variant:\"contained\",disabled:status.isPending},\"Update password\"),error&&/*#__PURE__*/React.createElement(Alert,{severity:\"error\"},error))));};export default PasswordReset;","import { Button, TextField } from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Link from '@mui/material/Link'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/material/Stack'\nimport React from 'react'\nimport { Link as RouterLink, useSearchParams } from 'react-router-dom'\n\nimport passwordsApi from 'apis/passwordsApi'\nimport PATHS from 'constants/paths'\nimport useForm, { Validations } from 'hooks/useForm'\nimport usePromise from 'hooks/usePromise'\nimport { presenceValidator } from 'utils/validators'\n\nconst initialValues = {\n password: '',\n passwordConfirmation: '',\n resetPasswordToken: '',\n}\n\nconst validations: Validations = {\n password: [{ validator: presenceValidator, message: 'Password is missing' }],\n passwordConfirmation: [\n { validator: presenceValidator, message: 'Password confirmation is missing' },\n ],\n}\n\nconst PasswordReset = () => {\n const [searchParams] = useSearchParams()\n\n const { textFieldProps, handleFormSubmit } = useForm(\n {\n ...initialValues,\n resetPasswordToken: searchParams.get('reset_password_token'),\n },\n {\n validations,\n },\n )\n const [{ status, error }, action] = usePromise(passwordsApi.resetPassword)\n\n if (status.isResolved && !status.isError) {\n return (\n \n \n Password updated successfully. Please{' '}\n \n login\n \n .\n \n \n )\n }\n return (\n \n
\n \n \n \n \n {error && {error}}\n \n
\n
\n )\n}\n\nexport default PasswordReset\n","import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport {\n createBrowserRouter,\n createRoutesFromElements,\n Route,\n RouterProvider,\n} from 'react-router-dom'\n\nimport Login from 'components/modules/Login'\nimport ForgotPassword from 'components/modules/Login/ForgotPassword'\nimport PasswordReset from 'components/modules/Login/PasswordReset'\nimport BaseApp from 'components/shared/BaseApp'\nimport ErrorBoundary from 'components/shared/ErrorBoundary'\nimport Layout from 'components/shared/Layout'\nimport PATHS from 'constants/paths'\n\nconst router = createBrowserRouter(\n createRoutesFromElements(\n }>\n } />\n } />\n } />\n ,\n ),\n)\n\nconst root = ReactDOM.createRoot(document.getElementById('root'))\n\nroot.render(\n \n \n \n \n ,\n)\n"],"names":["emailValidator","value","test","presenceValidator","undefined","trim","length","required","confirmationValidatorGenerator","k1","k2","values","greaterThanValidatorGenerator","threshold","parseFloat","moneyValidator","amount","initialFormConfirmationDialogProps","onConfirm","onCancel","messages","initialValues","arguments","validations","valueFormatters","confirmations","includeWhitespaceKeys","afterChange","useState","setValues","errors","setErrors","formConfirmationDialogProps","setFormConfirmationDialogProps","includeWhitespace","forEach","key","normalizeValues","rawValues","vals","Object","entries","_ref","v","validationError","name","failedValidation","find","validation","val","validator","conditional","message","validate","error","omit","isRequired","some","_ref2","onChange","formatter","onBlur","checkboxProps","id","checked","_ref3","textFieldProps","helperText","_ref4","handleFormSubmit","onSuccess","event","preventDefault","currentErrors","keys","normalizedValues","confirmationMessages","confirmation","push","validateAll","selectProps","_ref5","datePickerProps","slotProps","textField","resetForm","_extends","assign","bind","n","e","t","r","hasOwnProperty","call","apply","types","props","organizationalUnitType","useAppConfig","React","PromiseGate","promise","Promise","resolve","includes","deps","email","password","rememberMe","Form","useForm","usePromise","loginApi","login","status","response","loginAction","isResolved","path","data","user","homePath","Redirect","to","replace","Box","maxWidth","margin","component","Paper","onSubmit","Stack","padding","spacing","TextField","label","type","FormGroup","FormControlLabel","control","Checkbox","Button","variant","disabled","isPending","Alert","severity","sx","textAlign","pt","Link","PATHS","forgotPassword","RouterLink","Login","OrganizationalUnitGate","fallback","p","Typography","gutterBottom","ApiService","post","passwordConfirmation","resetPasswordToken","put","ForgotPassword","passwordsApi","successMessage","ChevronLeft","verticalAlign","PasswordReset","searchParams","useSearchParams","get","action","isError","router","createBrowserRouter","createRoutesFromElements","Route","element","Layout","footer","resetPassword","ReactDOM","document","getElementById","render","ErrorBoundary","BaseApp","RouterProvider"],"sourceRoot":""}