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AAA,QAAMM,UAAW,QAAQkH,EAAAA,GAAgBiC,cAAchK,SAAC,UARzC,IAUN,C,2DCpBjB,MAMA,EANkBD,IAAwD,IAArDC,SAAU+E,EAAI,QAAEnE,GAAU,KAASR,GAAYL,EAClE,OAAKa,GAEEL,EAAAA,EAAAA,KAAA,QAAMM,UAAU,wBAAuBb,SAAE+E,IAF3B,IAEuC,C","sources":["components/forms/SubmitButton.jsx","components/forms/ErrorMessage.jsx","hooks/useAuthentication.js","components/forms/FormTextField.jsx","components/forms/FormFieldContainer.jsx","pages/GuestPage.jsx","components/CopyrightFooter.jsx","pages/auth/LoginPage.jsx","components/forms/Form.jsx","components/forms/FormLabel.jsx","components/forms/FieldInfo.jsx"],"sourcesContent":["import LoadingButton from \"../buttons/LoadingButton\";\r\nimport React from \"react\";\r\nimport { useFormikContext } from \"formik\";\r\n\r\nconst SubmitButton = ({\r\n children: title = \"Submit\",\r\n color,\r\n loading,\r\n ...otherProps\r\n}) => {\r\n const { handleSubmit } = useFormikContext();\r\n\r\n return (\r\n \r\n {title}\r\n \r\n );\r\n};\r\n\r\nexport default SubmitButton;\r\n","import React from \"react\";\r\n\r\nconst AppErrorMessage = ({ error, visible, ...otherProps }) => {\r\n // hide the control\r\n if (!visible) return null;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default AppErrorMessage;\r\n","import { StatusCodes } from \"http-status-codes\";\r\nimport { useContext } from \"react\";\r\nimport { LocalStorageKeys } from \"../constants/storageKeys\";\r\nimport { AuthContext } from \"../context/contextProvider\";\r\nimport Services from \"../services/services\";\r\n\r\nconst useAuthentication = () => {\r\n const {\r\n setBranchModules,\r\n setBranchSettings,\r\n setCurrentUser,\r\n setCurrentClient,\r\n } = useContext(AuthContext);\r\n\r\n const logIn = async (credentialsPayload) => {\r\n const response = await Services.api.auth.token(credentialsPayload);\r\n\r\n if (response.ok && response.status === StatusCodes.OK) {\r\n if (response.data?.access_token) {\r\n const userResponse = await Services.api.account.me();\r\n\r\n if (userResponse.ok) {\r\n setCurrentUser(\r\n Services.localStorage.getProperty(LocalStorageKeys.currentUser)\r\n );\r\n setCurrentClient(\r\n Services.localStorage.getProperty(LocalStorageKeys.currentClient)\r\n );\r\n }\r\n\r\n return userResponse;\r\n }\r\n }\r\n\r\n return response;\r\n };\r\n\r\n const logOut = async () => {\r\n setCurrentClient(null);\r\n setCurrentUser(null);\r\n setBranchSettings(null);\r\n setBranchModules(null);\r\n\r\n const response = await Services.api.auth.logOut();\r\n\r\n return response;\r\n };\r\n\r\n return { logIn, logOut };\r\n};\r\n\r\nexport default useAuthentication;\r\n","import { Form, InputGroup } from \"react-bootstrap\";\r\n\r\nimport AppErrorMessage from \"./ErrorMessage\";\r\nimport AppFormLabel from \"./FormLabel\";\r\nimport { ElementSize } from \"../../constants/enums\";\r\nimport FieldInfo from \"./FieldInfo\";\r\nimport FormFieldContainer from \"./FormFieldContainer\";\r\nimport React from \"react\";\r\nimport { useField } from \"formik\";\r\nimport { useFormikContext } from \"formik\";\r\n\r\nconst FormTextField = ({\r\n className,\r\n disabled = false,\r\n hasFloatingLabel,\r\n icon,\r\n info,\r\n label = null,\r\n LabelComponent,\r\n onChange = () => { },\r\n onIconClick = () => { },\r\n placeholder,\r\n required,\r\n size = ElementSize.md,\r\n labelLight = false,\r\n visible = true,\r\n ...otherProps\r\n}) => {\r\n const [field] = useField(otherProps);\r\n field.onChange = handleTextChange;\r\n\r\n const formik = useFormikContext();\r\n const { errors, handleBlur, setFieldValue, touched, values } = formik;\r\n\r\n if (!visible) return null;\r\n\r\n const classes = `form-control-${size} ${className ?? \"\"}`.trim();\r\n\r\n\r\n \r\n /**\r\n * for nested JSON: \r\n * for example , if we have json values from formik like \r\n * {\r\n * aaa:{\r\n * bbb:{\r\n * ccc:{} \r\n * } \r\n * }\r\n * }\r\n * \r\n * then the passin field.name should be in array [\"aaa\",\"bbb\",\"ccc\"] \r\n * order matters\r\n * for local name tag, would be \"aaa.bbb.ccc\"\r\n * \r\n */\r\n let localName = null;\r\n let localValue = values;\r\n if (Array.isArray(field.name)){\r\n localName = field.name.join('.');\r\n for(let i=0; i< field.name.length; i++){\r\n localValue = localValue[field.name[i]];\r\n }\r\n }else{\r\n localName = field.name;\r\n localValue = values[field.name];\r\n }\r\n\r\n function handleTextChange(event) {\r\n const text = event.target.value;\r\n setFieldValue(localName, text);\r\n onChange(text, formik);\r\n }\r\n\r\n /*\r\n * make sure that we can still click a button while focus is \r\n * on a textfield\r\n */\r\n const customHandleBlur = (event) => {\r\n if (event.relatedTarget == null) {\r\n event.target.focus();\r\n }\r\n }\r\n\r\n return (\r\n \r\n \r\n {LabelComponent}\r\n \r\n \r\n {icon && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n
\r\n {info}\r\n\r\n {/* {JSON.stringify(values, null, 4)} */}\r\n
\r\n );\r\n};\r\n\r\nexport default FormTextField;\r\n","import React from \"react\";\r\n\r\nconst FormFieldContainer = ({ children, ...otherProps }) => {\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n};\r\n\r\nexport default FormFieldContainer;\r\n","import React from \"react\";\r\n\r\nconst GuestPage = ({ children: content, ...otherProps }) => {\r\n return
{content}
;\r\n};\r\n\r\nexport default GuestPage;\r\n","import React from \"react\";\r\n\r\nconst CopyrightFooter = () => {\r\n return (\r\n

\r\n © Copyright North Star Systems {new Date().getFullYear()}. All Rights\r\n Reserved.\r\n

\r\n );\r\n};\r\n\r\nexport default CopyrightFooter;\r\n","import * as Yup from \"yup\";\r\n\r\nimport React, { useEffect, useState } from \"react\";\r\n\r\nimport { StatusCodes } from \"http-status-codes\";\r\nimport { FormGroup } from \"react-bootstrap\";\r\nimport { Link, useLocation } from \"react-router-dom\";\r\nimport logo from \"../../assets/img/LiveDispatchLogo.png\";\r\nimport CopyrightFooter from \"../../components/CopyrightFooter\";\r\nimport AppForm from \"../../components/forms/Form\";\r\nimport AppFormLabel from \"../../components/forms/FormLabel\";\r\nimport FormTextField from \"../../components/forms/FormTextField\";\r\nimport SubmitButton from \"../../components/forms/SubmitButton\";\r\nimport { AppRoutes } from \"../../constants/appRoutes\";\r\nimport { ThemeColorsEnum } from \"../../constants/enums\";\r\nimport useAuthentication from \"../../hooks/useAuthentication\";\r\nimport Services from \"../../services/services\";\r\nimport GuestPage from \"../GuestPage\";\r\n\r\nlet validationSchema = Yup.object().shape({\r\n username: Yup.string().required().label(\"Username\"),\r\n password: Yup.string().required().label(\"Password\"),\r\n});\r\n\r\nconst LoginPage = () => {\r\n const [apiError, setApiError] = useState();\r\n const [busy, setBusy] = useState(false);\r\n const [twoFARequired, setTwoFARequired] = useState(false);\r\n\r\n const authentication = useAuthentication();\r\n const { search: queryParams } = useLocation();\r\n\r\n const urlParams = new URLSearchParams(queryParams);\r\n\r\n const unauthorized =\r\n urlParams.get(\"status\") === StatusCodes.UNAUTHORIZED.toString();\r\n const reasonPhrase = urlParams.get(\"reasonPhrase\");\r\n\r\n if (twoFARequired)\r\n validationSchema = validationSchema.concat(\r\n Yup.object({\r\n authKey: Yup.string().required().min(1).label(\"Security code\"),\r\n })\r\n );\r\n\r\n useEffect(() => {\r\n if (unauthorized)\r\n Services.utility.toast(\r\n reasonPhrase ?? \"Your session expired.\",\r\n ThemeColorsEnum.warning\r\n );\r\n }, [unauthorized]);\r\n\r\n const handleSubmit = async ({ username, password, authKey }) => {\r\n const payload = {\r\n username,\r\n password,\r\n ...(twoFARequired && { authKey }),\r\n };\r\n\r\n setBusy(true);\r\n const response = await authentication.logIn(payload);\r\n setBusy(false);\r\n\r\n switch (response.status) {\r\n case StatusCodes.ACCEPTED:\r\n Services.utility.toast(\r\n \"The security code was sent to your email and it will expire in a few minutes.\"\r\n );\r\n return setTwoFARequired(true); // TWO-FA code required\r\n\r\n case StatusCodes.NOT_FOUND:\r\n return setApiError(\"Invalid credentials.\");\r\n\r\n case StatusCodes.BAD_REQUEST:\r\n case StatusCodes.TOO_MANY_REQUESTS:\r\n return setApiError(Services.log.extractErrorMessage(response));\r\n\r\n case StatusCodes.OK:\r\n return setApiError(\"\"); // SUCCESS\r\n // return (window.location = AppRoutes.dashboard);\r\n\r\n case StatusCodes.UNAUTHORIZED:\r\n case StatusCodes.FORBIDDEN:\r\n return setApiError(Services.log.extractErrorMessage(response));\r\n\r\n default:\r\n return setApiError(response.problem);\r\n }\r\n };\r\n\r\n return (\r\n \r\n
\r\n \r\n \"Porto\r\n \r\n\r\n
\r\n
\r\n

\r\n \r\n Sign In\r\n

\r\n
\r\n
\r\n \r\n \r\n \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t }\r\n required\r\n size=\"lg\"\r\n className=\"form-control-login\"\r\n />\r\n \r\n \r\n
\r\n }\r\n name=\"password\"\r\n size=\"lg\"\r\n type=\"password\"\r\n className=\"form-control-login\"\r\n />\r\n \r\n\r\n {twoFARequired && (\r\n \r\n \r\n\r\n
\r\n The security code was sent to your email and it will expire\r\n in a few minutes.\r\n
\r\n
\r\n )}\r\n\r\n
\r\n
\r\n {/*
\r\n \r\n \r\n
*/}\r\n \r\n Forgot Password?\r\n \r\n
\r\n\r\n
\r\n \r\n Sign In\r\n
\r\n
\r\n\r\n {apiError &&

{apiError}

}\r\n\r\n {/* \r\n or\r\n */}\r\n\r\n {/*
\r\n \r\n Connect with \r\n \r\n \r\n Connect with \r\n \r\n
*/}\r\n\r\n {/*

\r\n Don't have an account yet?\r\n Sign Up!\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 LoginPage;\r\n","import { Col, Row } from \"react-bootstrap\";\r\n\r\nimport { Formik } from \"formik\";\r\nimport React from \"react\";\r\n\r\nconst AppForm = ({\r\n enableReinitialize = true,\r\n initialValues,\r\n onSubmit = () => {},\r\n validationSchema,\r\n ...otherProps\r\n}) => {\r\n return (\r\n \r\n {(props) => (\r\n
\r\n
{otherProps.children}
\r\n {(!process.env.NODE_ENV ||\r\n process.env.NODE_ENV === \"development\") && (\r\n
\r\n \r\n \r\n Values: {JSON.stringify(props.values, null, 2)}\r\n \r\n \r\n \r\n \r\n Errors: {JSON.stringify(props.errors, null, 2)}\r\n \r\n \r\n
\r\n )}\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default AppForm;\r\n","import { Form } from \"react-bootstrap\";\r\nimport React from \"react\";\r\nimport { ThemeColorsEnum } from \"../../constants/enums\";\r\n\r\nconst AppFormLabel = ({\r\n label,\r\n required,\r\n styleType,\r\n className,\r\n visible = true,\r\n ...otherProps\r\n}) => {\r\n if (!visible) return null;\r\n if (className) className = `${className} text-${styleType}`;\t\r\n else className = `text-${styleType}`;\r\n\r\n return (\r\n \r\n {label}\r\n {required && (\r\n *\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default AppFormLabel;\r\n","import React from \"react\";\r\n\r\nconst FieldInfo = ({ children: text, visible = true, ...otherProps }) => {\r\n if (!visible) return null;\r\n\r\n return {text};\r\n};\r\n\r\nexport default FieldInfo;\r\n"],"names":["_ref","children","title","color","loading","otherProps","handleSubmit","useFormikContext","_jsx","LoadingButton","type","onClick","error","visible","className","useAuthentication","setBranchModules","setBranchSettings","setCurrentUser","setCurrentClient","useContext","AuthContext","logIn","async","response","Services","api","auth","token","credentialsPayload","_response$data","ok","status","StatusCodes","OK","data","access_token","userResponse","account","me","localStorage","getProperty","LocalStorageKeys","currentUser","currentClient","logOut","disabled","hasFloatingLabel","icon","info","label","LabelComponent","onChange","onIconClick","placeholder","required","size","ElementSize","md","labelLight","field","useField","handleTextChange","formik","errors","handleBlur","setFieldValue","touched","values","classes","trim","localName","localValue","Array","isArray","name","join","i","length","event","text","target","value","_jsxs","FormFieldContainer","AppFormLabel","InputGroup","Form","Control","onBlur","relatedTarget","focus","AppErrorMessage","FieldInfo","content","CopyrightFooter","Date","getFullYear","validationSchema","Yup","shape","username","password","LoginPage","apiError","setApiError","useState","busy","setBusy","twoFARequired","setTwoFARequired","authentication","search","queryParams","useLocation","urlParams","URLSearchParams","unauthorized","get","UNAUTHORIZED","toString","reasonPhrase","concat","authKey","min","useEffect","utility","toast","ThemeColorsEnum","warning","GuestPage","href","src","logo","height","alt","AppForm","initialValues","onSubmit","payload","ACCEPTED","NOT_FOUND","BAD_REQUEST","TOO_MANY_REQUESTS","log","extractErrorMessage","FORBIDDEN","problem","FormGroup","FormTextField","Link","to","AppRoutes","forgotPassword","SubmitButton","enableReinitialize","Formik","validateOnChange","props","styleType","Label","danger"],"sourceRoot":""}