{"version":3,"sources":["helpers/authUtils.js","redux/auth/actions.js","services/baseService.js","constants/actionTypes.js","routes.js","App.js","serviceWorker.js","redux/auth/reducers.js","redux/reducers.js","redux/auth/saga.js","redux/sagas.js","redux/store.js","index.js"],"names":["__webpack_require__","d","__webpack_exports__","isUserAuthenticated","getLoggedInUser","getUserPicture","getUserMenus","jwt_decode__WEBPACK_IMPORTED_MODULE_0__","jwt_decode__WEBPACK_IMPORTED_MODULE_0___default","n","react_cookie__WEBPACK_IMPORTED_MODULE_1__","user","decoded","jwtDecode","token","currentTime","Date","now","exp","console","warn","Cookies","get","JSON","parse","UserPicture","localStorage","getItem","userMenu","loginUser","loginUserSuccess","loginUserFailed","registerUserSuccess","registerUserFailed","logoutUser","forgetPasswordSuccess","forgetPasswordFailed","_constants_actionTypes__WEBPACK_IMPORTED_MODULE_0__","username","password","type","LOGIN_USER","payload","LOGIN_USER_SUCCESS","error","LOGIN_USER_FAILED","REGISTER_USER_SUCCESS","REGISTER_USER_FAILED","history","LOGOUT_USER","passwordResetStatus","FORGET_PASSWORD_SUCCESS","FORGET_PASSWORD_FAILED","FetchData","FetchDataEHS","RequestMethod","RequestData","Type","arguments","length","undefined","reqBody","FormData","append","stringify","fetch","body","method","headers","_token","then","response","status","json","catch","REGISTER_USER","FORGET_PASSWORD","NotAuthorized","React","lazy","e","bind","Login","Promise","all","Logout","Home","OutBreakDashboard","COVIDdDashboard","EHSCOVIDdDashboard","EHSCOVIDDasboardKenya","AddCOVIDCase","AddEmpCOVIDCase","Screening","Reporting","ReportingTable","ReportingLab","ReportingTableLab","CasesList","PositiveAdmList","NegativeAdmList","PosToNegAdmList","SuspectedAdmList","EmergencyAdmList","PositiveDiscList","NegativeDiscList","PosToNegDiscList","DepartedList","DeathList","ReceivedSpecList","PositiveSpecList","NegativeSpecList","ExtPositiveSpecList","PendingSpecList","StudentPositiveAdmList","StudentNegativeAdmList","StudentPosToNegAdmList","StudentSuspectedAdmList","StudentEmergencyAdmList","StudentPositiveDiscList","StudentNegativeDiscList","StudentPosToNegDiscList","StudentDepartedList","StudentDeathList","StudentPositiveSpecList","StudentNegativeSpecList","StudentSpecimenActiveQuarantineList","StudentSpecimenRecoveredList","StudentLabSuspected","StudentLabExpected","StudentActiveScreening","StudentFitForCampus","StudentUnFitForWork","ScreeningPassFit","ScreeningPassUnFit","ScreeningPassExpired","StdScreeningPassFit","StdScreeningPassUnFit","OutbreakDetails","EmployeePositiveAdmList","EmployeeNegativeAdmList","EmployeePosToNegAdmList","EmployeeSuspectedAdmList","EmployeeDependentAdmList","EmployeeEmergencyAdmList","EmployeePositiveDiscList","EmployeeNegativeDiscList","EmployeePosToNegDiscList","EmployeeDepartedList","EmployeeDeathList","EmployeePositiveSpecList","EmployeeNegativeSpecList","EmployeeSpecimenActiveQuarantineList","EmployeeSpecimenRecoveredList","EmployeeLabSuspected","EmployeeLabExpected","EmployeeActiveScreening","EmployeeFitForCampus","EmployeeUnFitForWork","EmployeeActiveScreeningKenya","EmployeeFitForCampusKenya","EmployeeUnFitForWorkKenya","SHSCOVIDdDashboard","AddRESEmpCovidCase","PrivateRoute","_ref","Component","component","roles","menuMap","name","rest","Object","objectWithoutProperties","react_default","a","createElement","react_router","assign","render","props","_rest","objectSpread","path","formAction","reportingOption","isAuthTokenValid","log","to","pathname","state","from","location","find","includes","reportingData","formData","data","getUserMenu","routes","route","Route","exact","loading","NonAuthLayout","Loadable","loader","loaded","default","AuthLayout","withLayout","WrappedComponent","HOC","_Component","classCallCheck","this","possibleConstructorReturn","getPrototypeOf","apply","inherits","createClass","key","value","connect","App","getLayout","_this2","react_router_dom","Fragment","map","index","Layout","react","fallback","isAuthenticated","Auth","Boolean","window","hostname","match","INIT_STATE","action","combineReducers","login","logout","register","forgetPassword","watchLoginUser","watchLogoutUser","watchRegisterUser","watchForgetPassword","authSaga","fetchJSON","url","options","setSession","cookies","menuList","set","remove","setUserPicture","setItem","setUserMenus","UserMenu","_usermenus","menu","i","OptionLabel","_ref$payload","ResponseResult","ResponseMessage","responseMod","message","regenerator_default","wrap","_context","prev","next","call","UserID","Password","sent","LoginStatus","Mnemonic","Name","Role","Speciality","UserPictureExists","menus","DivisionId","ResourceEntity","SubDivisionDesc","SubDivisionId","EmployeeID","EmployeeNumber","put","t0","t1","abrupt","stop","_marked","_ref2","_context2","push","_marked2","_ref3","_ref3$payload","fullname","email","_response","_message","_context3","Content-Type","_marked3","_ref4","_response2","_message2","_context4","_marked4","_context5","takeEvery","_marked5","_context6","_marked6","_context7","_marked7","_context8","_marked8","_context9","fork","_marked9","rootSaga","getState","sagas_marked","sagaMiddleware","createSagaMiddleware","middlewares","ReactDOM","es","store","initialState","composeEnhancers","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","createStore","reducers","applyMiddleware","run","sagas","configureStore","src_App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"0FAAAA,EAAAC,EAAAC,EAAA,sBAAAC,IAAAH,EAAAC,EAAAC,EAAA,sBAAAE,IAAAJ,EAAAC,EAAAC,EAAA,sBAAAG,IAAAL,EAAAC,EAAAC,EAAA,sBAAAI,IAAA,IAAAC,EAAAP,EAAA,IAAAQ,EAAAR,EAAAS,EAAAF,GAAAG,EAAAV,EAAA,IAMMG,GANNH,EAAA,IAM4B,WAC1B,IAAMW,EAAOP,IAEb,IAAKO,EACH,OAAO,EAET,IAAMC,EAAUC,IAAUF,EAAKG,OACzBC,EAAcC,KAAKC,MAAQ,IACjC,QAAIL,EAAQM,IAAMH,KAChBI,QAAQC,KAAK,yBACN,KASLhB,EAAkB,WACtB,IACMO,GADU,IAAIU,KACCC,IAAI,QACzB,OAAOX,EAAuB,iBAARA,EAAmBA,EAAOY,KAAKC,MAAMb,GAAS,MAYhEN,EAAiB,WACrB,IAAMoB,EAAcC,aAAaC,QAAQ,eACzC,MAA6B,iBAAfF,EAA0BA,EAAc,IAGlDnB,EAAe,WAKnB,IACMsB,GADU,IAAIP,KACKC,IAAI,YAC7B,OAAIM,GAOI,uCC1DV5B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D,EAAA/C,MAAA,OACL,OADK+C,EAAA/C,KAAA,EACC2C,aAAUrP,KAAe0K,IAD1B,wBAAA+E,EAAAzB,SAAA0B,IAIA,SAAU3E,KAAV,OAAAuB,GAAAlG,EAAAmG,KAAA,SAAAoD,GAAA,cAAAA,EAAAlD,KAAAkD,EAAAjD,MAAA,OACL,OADKiD,EAAAjD,KAAA,EACC2C,aAAUpP,KAAiB0K,IAD5B,wBAAAgF,EAAA3B,SAAA4B,IAIP,SAAU5E,KAAV,OAAAsB,GAAAlG,EAAAmG,KAAA,SAAAsD,GAAA,cAAAA,EAAApD,KAAAoD,EAAAnD,MAAA,OACE,OADFmD,EAAAnD,KAAA,EACQjM,aAAI,CACRqP,aAAKlF,IACLkF,aAAKjF,IACLiF,aAAKhF,IACLgF,aAAK/E,MALT,wBAAA8E,EAAA7B,SAAA+B,IASe/E,uBCrPUgF,IAAV,SAAUA,GAASC,GAAnB,OAAA3D,GAAAlG,EAAAmG,KAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,OACX,OADWF,EAAAE,KAAA,EACLjM,aAAI,CACNuK,OAFO,wBAAAwB,EAAAwB,SAAAkC,ICCf,IAAMC,GAAiBC,eACjBC,GAAc,CAACF,ICGrBG,IAAS9J,OAAOL,EAAAC,EAAAC,cAACkK,EAAA,EAAD,CAAUC,MDDnB,SAAwBC,GAC3B,IAAMC,EAAmBxG,OAAOyG,sCAAwCC,KAElEJ,EAAQK,aACVC,GACAL,EACAC,EACIK,KAAehI,WAAf,EAAmBsH,MAI3B,OADAF,GAAea,IAAIC,IACZT,ECVsBU,IAC7B/K,EAAAC,EAAAC,cAAC8K,GAAD,OACSC,SAASC,eAAe,SNsH/B,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM7R,KAAK,SAAA8R,GACjCA,EAAaC","file":"static/js/main.da6b67d6.chunk.js","sourcesContent":["import jwtDecode from \"jwt-decode\";\nimport { Cookies } from \"react-cookie\";\nimport DateFormat from \"dateformat\";\n/**\n * Checks if user is authenticated\n */\nconst isUserAuthenticated = () => {\n const user = getLoggedInUser();\n\n if (!user) {\n return false;\n }\n const decoded = jwtDecode(user.token);\n const currentTime = Date.now() / 1000;\n if (decoded.exp < currentTime) {\n console.warn(\"access token expired\");\n return false;\n } else {\n return true;\n }\n};\n\n/**\n * Returns the logged in user\n */\nconst getLoggedInUser = () => {\n const cookies = new Cookies();\n const user = cookies.get(\"user\");\n return user ? (typeof user == \"object\" ? user : JSON.parse(user)) : null;\n};\n\nconst getRefreshDateTime = () => {\n // let refreshDateTime = \"\";\n // setInterval(() => {\n // refreshDateTime = DateFormat(new Date(), \"mmm dd, yyyy hh:MM tt\");\n // console.log(\"authutil refresh funciton called.....\", refreshDateTime);\n // }, 60000);\n // return refreshDateTime ? refreshDateTime : null;\n};\n\nconst getUserPicture = () => {\n const UserPicture = localStorage.getItem(\"UserPicture\");\n return typeof UserPicture == \"string\" ? UserPicture : \"\";\n};\n\nconst getUserMenus = () => {\n // const UserMenu = localStorage.getItem(\"UserMenu\");\n // console.log(\"getUserMenus: \", typeof UserMenu);\n // return typeof UserMenu == \"object\" ? UserMenu : [];\n\n const cookies = new Cookies();\n const userMenu = cookies.get(\"UserMenu\");\n if (userMenu) {\n //var result = Object.keys(userMenu).map(function (key) {\n // return [userMenu[key].OptionLabel];\n //});\n return userMenu\n }\n\n return null;\n //return result\n // ? typeof result == \"object\"\n // ? result\n // : JSON.parse(result)\n // : null;\n};\n\nexport {\n isUserAuthenticated,\n getLoggedInUser,\n getUserPicture,\n getRefreshDateTime,\n getUserMenus,\n};\n","// @flow\nimport {\n LOGIN_USER,\n LOGIN_USER_SUCCESS,\n LOGIN_USER_FAILED,\n LOGOUT_USER,\n REGISTER_USER,\n REGISTER_USER_SUCCESS,\n REGISTER_USER_FAILED,\n FORGET_PASSWORD,\n FORGET_PASSWORD_SUCCESS,\n FORGET_PASSWORD_FAILED\n} from \"../../constants/actionTypes\";\n\ntype AuthAction = { type: string, payload: {} | string };\n\nexport const loginUser = (username: string, password: string): AuthAction => ({\n type: LOGIN_USER,\n payload: { username, password }\n});\n\nexport const loginUserSuccess = (user: string): AuthAction => ({\n type: LOGIN_USER_SUCCESS,\n payload: user\n});\n\nexport const loginUserFailed = (error: string): AuthAction => ({\n type: LOGIN_USER_FAILED,\n payload: error\n});\n\nexport const registerUser = (\n fullname: string,\n email: string,\n password: string\n): AuthAction => ({\n type: REGISTER_USER,\n payload: { fullname, email, password }\n});\n\nexport const registerUserSuccess = (user: {}): AuthAction => ({\n type: REGISTER_USER_SUCCESS,\n payload: user\n});\n\nexport const registerUserFailed = (error: string): AuthAction => ({\n type: REGISTER_USER_FAILED,\n payload: error\n});\n\nexport const logoutUser = (history: any): AuthAction => ({\n type: LOGOUT_USER,\n payload: { history }\n});\n\nexport const forgetPassword = (username: string): AuthAction => ({\n type: FORGET_PASSWORD,\n payload: { username }\n});\n\nexport const forgetPasswordSuccess = (\n passwordResetStatus: string\n): AuthAction => ({\n type: FORGET_PASSWORD_SUCCESS,\n payload: passwordResetStatus\n});\n\nexport const forgetPasswordFailed = (error: string): AuthAction => ({\n type: FORGET_PASSWORD_FAILED,\n payload: error\n});\n","const baseURL = \"https://idrsapi.aku.edu/api\";\r\n//const baseURL = \"http://localhost:3315/api\";\r\nconst ServiceToken =\r\n \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJBY2Nlc3NEYXRlVGltZSI6NjM2ODYyNjYwNzMyMzIxMTU4LCJBcHBsaWNhdGlvbklEIjoiT05FVElNRVRPS0VOIiwiVG9rZW5OYXR1cmUiOiJOIiwiVG9rZW5OZWVkIjoiT25lVGltZVRva2VuQ2FsbCIsIlRva2VuS2V5IjoiMXFhejNlZGM1dGhuN3VqbTJ3ZGM0cmdiMGlodjc4Zng1ZXN6In0.vMtFFSEtO_CGIe5_y_jsCqcOk1SjAz7E8YY6ESbVadY\";\r\n\r\nconst baseURLEHS = \"https://ehsliveapi.aku.edu/api\";\r\n//const baseURLEHS = \"\";\r\nconst ServiceTokenEHS =\r\n \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJKV1RTZWNyZXRLZXkiOiJHUURzdGNLc3gwTkhqUE91WE9ZZzVNYmVKMVhUMHVGaXdEVnZWQnJrTW5NIiwiQVBQIjoiRUhTIn0.FnFfCEGEN1o-Oj71a1_t8phbV5hzL19FqURXQ2R8VUU\";\r\n\r\nexport let FetchData = (RequestMethod, RequestData, Type = \"\") => {\r\n var reqBody = new FormData();\r\n reqBody.append(\"RequestMethod\", RequestMethod);\r\n\r\n if (Type == \"string\") {\r\n reqBody.append(\"RequestData\", RequestData);\r\n } else {\r\n reqBody.append(\"RequestData\", JSON.stringify(RequestData));\r\n }\r\n // return $.ajax({\r\n // type: \"POST\",\r\n // beforeSend: function(request) {\r\n // request.setRequestHeader(\"_token\", ServiceToken);\r\n // },\r\n // url: baseURL,\r\n // data: reqBody,\r\n // processData: false,\r\n // contentType: false\r\n // });\r\n\r\n const options = {\r\n body: reqBody,\r\n method: \"POST\",\r\n headers: {\r\n _token: ServiceToken,\r\n },\r\n };\r\n\r\n return fetch(baseURL, options)\r\n .then((response) => {\r\n if (!response.status === 200) {\r\n throw response.json();\r\n }\r\n return response.json();\r\n })\r\n .then((json) => {\r\n return json;\r\n })\r\n .catch((error) => {\r\n throw error;\r\n });\r\n};\r\n\r\nexport let FetchDataEHS = (RequestMethod, RequestData, Type = \"\") => {\r\n var reqBody = new FormData();\r\n reqBody.append(\"RequestMethod\", RequestMethod);\r\n\r\n if (Type == \"string\") {\r\n reqBody.append(\"RequestData\", RequestData);\r\n } else {\r\n reqBody.append(\"RequestData\", JSON.stringify(RequestData));\r\n }\r\n\r\n const options = {\r\n body: reqBody,\r\n method: \"POST\",\r\n headers: {\r\n _token: ServiceTokenEHS,\r\n },\r\n };\r\n\r\n return fetch(baseURLEHS, options)\r\n .then((response) => {\r\n if (!response.status === 200) {\r\n throw response.json();\r\n }\r\n return response.json();\r\n })\r\n .then((json) => {\r\n return json;\r\n })\r\n .catch((error) => {\r\n throw error;\r\n });\r\n};\r\n","/* AUTH */\nexport const LOGIN_USER = 'LOGIN_USER';\nexport const LOGIN_USER_SUCCESS = 'LOGIN_USER_SUCCESS';\nexport const LOGIN_USER_FAILED = 'LOGIN_USER_FAILED';\nexport const REGISTER_USER = 'REGISTER_USER';\nexport const REGISTER_USER_SUCCESS = 'REGISTER_USER_SUCCESS';\nexport const REGISTER_USER_FAILED = 'REGISTER_USER_FAILED';\nexport const LOGOUT_USER = 'LOGOUT_USER';\nexport const FORGET_PASSWORD = 'FORGET_PASSWORD';\nexport const FORGET_PASSWORD_SUCCESS = 'FORGET_PASSWORD_SUCCESS';\nexport const FORGET_PASSWORD_FAILED = 'FORGET_PASSWORD_FAILED';","import React from \"react\";\nimport { Redirect } from \"react-router-dom\";\nimport { Route } from \"react-router-dom\";\n\nimport {\n isUserAuthenticated,\n getLoggedInUser,\n getUserMenus,\n} from \"./helpers/authUtils\";\n\nconst NotAuthorized = React.lazy(() =>\n import(\"./components/breastTumor/notAuthorized.jsx\")\n);\n// auth\nconst Login = React.lazy(() => import(\"./pages/auth/Login\"));\nconst Logout = React.lazy(() => import(\"./pages/auth/Logout\"));\n\n//Covid'19 Components\nconst Home = React.lazy(() => import(\"./components/home/home.jsx\"));\nconst OutBreakDashboard = React.lazy(() =>\n import(\"./components/coronaVirus/OutBreakDashboard.jsx\")\n);\nconst COVIDdDashboard = React.lazy(() =>\n import(\"./components/coronaVirus/covidDashboard.jsx\")\n);\nconst EHSCOVIDdDashboard = React.lazy(() =>\n import(\"./components/coronaVirus/ehsCovidDashboard.jsx\")\n);\nconst EHSCOVIDDasboardKenya = React.lazy(() =>\n import(\"./components/coronaVirus/ehsCovidDashboardKenya.jsx\")\n);\nconst AddCOVIDCase = React.lazy(() =>\n import(\"./components/coronaVirus/addCovidCase.jsx\")\n);\nconst AddEmpCOVIDCase = React.lazy(() =>\n import(\"./components/coronaVirus/addEmpCovidCase.jsx\")\n);\nconst Screening = React.lazy(() =>\n import(\"./components/coronaVirus/screening.jsx\")\n);\nconst Reporting = React.lazy(() =>\n import(\"./components/coronaVirus/reporting.jsx\")\n);\nconst ReportingTable = React.lazy(() =>\n import(\"./components/coronaVirus/reportingTable.jsx\")\n);\nconst ReportingLab = React.lazy(() =>\n import(\"./components/coronaVirus/reportingLab.jsx\")\n);\nconst ReportingTableLab = React.lazy(() =>\n import(\"./components/coronaVirus/reportingTableLab.jsx\")\n);\nconst CasesList = React.lazy(() =>\n import(\"./components/coronaVirus/totalCasesList.jsx\")\n);\n\n/////////////////////////////////////////////////////////////\nconst PositiveAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/positiveCasesList.jsx\")\n);\nconst NegativeAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/negativeCasesList.jsx\")\n);\nconst PosToNegAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/positiveToNegativeAdmittedList.jsx\")\n);\nconst SuspectedAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/suspectedAdmittedList.jsx\")\n);\nconst EmergencyAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/emergencyCasesList.jsx\")\n);\n\nconst PositiveDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/positiveCasesDischarged.jsx\")\n);\nconst NegativeDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/negativeDischargedList.jsx\")\n);\nconst PosToNegDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/positiveToNegativeDischargedList.jsx\")\n);\nconst DepartedList = React.lazy(() =>\n import(\"./components/coronaVirus/departedCasesList.jsx\")\n);\nconst DeathList = React.lazy(() =>\n import(\"./components/coronaVirus/deathCasesList.jsx\")\n);\n\nconst ReceivedSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/specimenSentList.jsx\")\n);\nconst PositiveSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/specimenPositiveList.jsx\")\n);\nconst NegativeSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/specimenNegativeList.jsx\")\n);\nconst ExtPositiveSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/externalPositiveList.jsx\")\n);\nconst PendingSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/specimenPendingList.jsx\")\n);\n\n//////Students Dashboard Routes\nconst StudentPositiveAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/stdPositiveCasesList\")\n);\nconst StudentNegativeAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/stdNegativeCasesList\")\n);\nconst StudentPosToNegAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/stdPositiveToNegativeAdmittedList.jsx\")\n);\nconst StudentSuspectedAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/stdSuspectedAdmittedList.jsx\")\n);\nconst StudentEmergencyAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/stdEmergencyCasesList.jsx\")\n);\n\nconst StudentPositiveDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/stdPositiveCasesDischarged.jsx\")\n);\nconst StudentNegativeDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/stdNegativeDischargedList.jsx\")\n);\nconst StudentPosToNegDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/stdPositiveToNegativeDischargedList.jsx\")\n);\nconst StudentDepartedList = React.lazy(() =>\n import(\"./components/coronaVirus/stdDepartedCasesList.jsx\")\n);\nconst StudentDeathList = React.lazy(() =>\n import(\"./components/coronaVirus/stdDeathCasesList.jsx\")\n);\nconst StudentPositiveSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/stdSpecimenPositiveList.jsx\")\n);\nconst StudentNegativeSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/stdSpecimenNegativeList.jsx\")\n);\nconst StudentSpecimenActiveQuarantineList = React.lazy(() =>\n import(\"./components/coronaVirus/stdSpecimenActiveQuarantineList.jsx\")\n);\nconst StudentSpecimenRecoveredList = React.lazy(() =>\n import(\"./components/coronaVirus//stdSpecimenRecoveredList.jsx\")\n);\nconst StudentLabSuspected = React.lazy(() =>\n import(\"./components/coronaVirus/stdSpecimenSuspected.jsx\")\n);\nconst StudentLabExpected = React.lazy(() =>\n import(\"./components/coronaVirus/stdSpecimenExpected.jsx\")\n);\n\nconst StudentActiveScreening = React.lazy(() =>\n import(\"./components/coronaVirus/stdActiveScreening.jsx\")\n);\nconst StudentFitForCampus = React.lazy(() =>\n import(\"./components/coronaVirus/stdFitForCampus.jsx\")\n);\nconst StudentUnFitForWork = React.lazy(() =>\n import(\"./components/coronaVirus/stdUnFitForWork.jsx\")\n);\n\n//////\n\nconst ScreeningPassFit = React.lazy(() =>\n import(\"./components/coronaVirus/screeningPassFit.jsx\")\n);\nconst ScreeningPassUnFit = React.lazy(() =>\n import(\"./components/coronaVirus/screeningPassUnfit.jsx\")\n);\nconst ScreeningPassExpired = React.lazy(() =>\n import(\"./components/coronaVirus/screeningPassExpired.jsx\")\n);\n\n///Student Passes\nconst StdScreeningPassFit = React.lazy(() =>\n import(\"./components/coronaVirus/stdScreeningPassFit.jsx\")\n);\nconst StdScreeningPassUnFit = React.lazy(() =>\n import(\"./components/coronaVirus/stdScreeningPassUnfit.jsx\")\n);\n///\n////////Outbreak Routes\nconst OutbreakDetails = React.lazy(() =>\n import(\"./components/coronaVirus/OutbreakDetails\")\n);\n\n////////Employee Dashboard Routes\nconst EmployeePositiveAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/empPositiveCasesList\")\n);\nconst EmployeeNegativeAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/empNegativeCasesList\")\n);\nconst EmployeePosToNegAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/empPositiveToNegativeAdmittedList.jsx\")\n);\nconst EmployeeSuspectedAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/empSuspectedAdmittedList.jsx\")\n);\n\nconst EmployeeDependentAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/empDependentAdmittedList.jsx\")\n);\nconst EmployeeEmergencyAdmList = React.lazy(() =>\n import(\"./components/coronaVirus/empEmergencyCasesList.jsx\")\n);\n\nconst EmployeePositiveDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/empPositiveCasesDischarged.jsx\")\n);\nconst EmployeeNegativeDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/empNegativeDischargedList.jsx\")\n);\nconst EmployeePosToNegDiscList = React.lazy(() =>\n import(\"./components/coronaVirus/empPositiveToNegativeDischargedList.jsx\")\n);\nconst EmployeeDepartedList = React.lazy(() =>\n import(\"./components/coronaVirus/empDepartedCasesList.jsx\")\n);\nconst EmployeeDeathList = React.lazy(() =>\n import(\"./components/coronaVirus/empDeathCasesList.jsx\")\n);\nconst EmployeePositiveSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/empSpecimenPositiveList.jsx\")\n);\nconst EmployeeNegativeSpecList = React.lazy(() =>\n import(\"./components/coronaVirus/empSpecimenNegativeList.jsx\")\n);\nconst EmployeeSpecimenActiveQuarantineList = React.lazy(() =>\n import(\"./components/coronaVirus/empSpecimenActiveQuarantineList.jsx\")\n);\nconst EmployeeSpecimenRecoveredList = React.lazy(() =>\n import(\"./components/coronaVirus//empSpecimenRecoveredList.jsx\")\n);\nconst EmployeeLabSuspected = React.lazy(() =>\n import(\"./components/coronaVirus/empSpecimenSuspected.jsx\")\n);\nconst EmployeeLabExpected = React.lazy(() =>\n import(\"./components/coronaVirus/empSpecimenExpected.jsx\")\n);\n\nconst EmployeeActiveScreening = React.lazy(() =>\n import(\"./components/coronaVirus/empActiveScreening.jsx\")\n);\nconst EmployeeFitForCampus = React.lazy(() =>\n import(\"./components/coronaVirus/empFitForCampus.jsx\")\n);\nconst EmployeeUnFitForWork = React.lazy(() =>\n import(\"./components/coronaVirus/empUnFitForWork.jsx\")\n);\n\nconst EmployeeActiveScreeningKenya = React.lazy(() =>\n import(\"./components/coronaVirus/empActiveScreeningKenya.jsx\")\n);\nconst EmployeeFitForCampusKenya = React.lazy(() =>\n import(\"./components/coronaVirus/empFitForCampusKenya.jsx\")\n);\nconst EmployeeUnFitForWorkKenya = React.lazy(() =>\n import(\"./components/coronaVirus/empUnFitForWorkKenya.jsx\")\n);\nconst SHSCOVIDdDashboard = React.lazy(() =>\n import(\"./components/coronaVirus/shsCovidDashboard.jsx\")\n);\nconst AddRESEmpCovidCase = React.lazy(() =>\n import(\"./components/coronaVirus/addRESEmpCovidCase.jsx\")\n);\n\n// handle auth and authorization\n\nconst PrivateRoute = ({\n component: Component,\n roles,\n name,\n menuMap,\n ...rest\n}) => (\n {\n const { path, formAction, reportingOption } = { ...rest };\n const loggedInUser = getLoggedInUser();\n const isAuthTokenValid = isUserAuthenticated();\n\n console.log(\"path: \", path);\n console.log(\"menuMap: \", menuMap);\n console.log(\"roles: \", roles);\n console.log(\"loggedInUser.Role: \", getUserMenus());\n\n if (!isAuthTokenValid) {\n // not logged in so redirect to login page with the return url\n return (\n \n );\n }\n\n // check if route is restricted by role\n // if (roles && roles.indexOf(loggedInUser.Role) === -1) {\n // // role not authorised so redirect to home page\n // return ;\n // }\n\n if (menuMap) {\n let userMenus = getUserMenus();\n let _menu = userMenus.find((a) => menuMap.includes(a[0]));\n if (!_menu) {\n return ;\n }\n }\n let reportingData = {};\n if (props.history.location.location) {\n let { state } = props.history.location.location;\n reportingData = state;\n }\n\n let model = {};\n let formData = {};\n\n if (props.location.state) {\n formData = props.location.state.data;\n }\n\n props.location.state = formAction\n ? { data: formData ? formData : model, formAction }\n : props.location.state;\n\n props.location.state = reportingOption\n ? { reportingData, reportingOption }\n : props.location.state;\n\n // authorised so return component\n return ;\n }}\n />\n);\nlet getUserMenu = getUserMenus();\ngetUserMenu = getUserMenu ? getUserMenu : null;\n// length = getUserMenu ? getUserMenu.length : null;\n\nconst routes = [\n // auth and account\n { path: \"/login\", name: \"Login\", component: Login, route: Route },\n { path: \"/logout\", name: \"Logout\", component: Logout, route: Route },\n {\n path: \"/\",\n exact: true,\n name: \"Home\",\n component: Home,\n route: PrivateRoute,\n },\n //Custom\n {\n path: \"/notAuthorized\",\n name: \"Not Authorized\",\n component: NotAuthorized,\n route: PrivateRoute,\n },\n\n //Covid'19 Redirects\n {\n path: \"/home\",\n name: \"Home\",\n component: Home,\n route: PrivateRoute,\n },\n {\n path: \"/OutBreakDashboard\",\n name: \"OutBreak Dashboard\",\n component: OutBreakDashboard,\n menuMap: \"mnuOutBreakDashboard\",\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"DASH\",\n // \"OUTBREAKDASH\",\n // \"KEHSDASHBOARD\"\n // ]\n },\n {\n path: \"/covidDashboard\",\n name: \"COVID Dashboard\",\n component: COVIDdDashboard,\n menuMap: \"mnuPUIDashboard\",\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"OUTBREAKDASH\",\n // \"MGMNTDASHBOARD\",\n // \"PUIPORTING\",\n // \"PUIDASHBOARD\",\n // \"DASH\",\n // \"PUIEHSDEPTDASH\",\n // ],\n },\n {\n path: \"/ehsCovidDashboard\",\n name: \"EHS COVID Dashboard\",\n component: EHSCOVIDdDashboard,\n menuMap: \"mnuEHSDashboard\",\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"OUTBREAKDASH\",\n // \"EHSDASHBOARD\",\n // \"MGMNTDASHBOARD\",\n // \"DASH\",\n // \"EHSSCRNDASH\",\n // \"EHSRESDASHBOARD\",\n // \"EHSSCRRESDASH\",\n // \"EHSDEPSCRESDASH\",\n // \"EHSDEPRESDASH\",\n // \"EHSPGMRESDASH\",\n // \"EHSPGMSCRESDASH\",\n // \"PUIEHSDEPTDASH\",\n // ],\n },\n {\n path: \"/shsCovidDashboard\",\n name: \"SHS COVID Dashboard\",\n component: SHSCOVIDdDashboard,\n menuMap: \"mnuSTSDashboard\",\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"OUTBREAKDASH\",\n // \"STSDASHBOARD\",\n // \"EHSSTDSCRDASHA\",\n // \"EHSSTDSCRDASHMH\",\n // \"EHSSTDSCRDASHFH\"\n // ],\n },\n {\n path: \"/ehsCovidDashboardKenya\",\n name: \"EHS COVID Dashboard\",\n component: EHSCOVIDDasboardKenya,\n menuMap: \"mnuKEHSDashboard\",\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\", \"KEHSDASHBOARD\"],\n },\n {\n path: \"/addCase\",\n name: \"Add COVID'19 Case\",\n formAction: \"AddForm\",\n component: AddCOVIDCase,\n menuMap: \"mnuPUIScreening\",\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"OUTBREAKDASH\",\n // \"PUISCRNNING\",\n // \"PUIPORTING\",\n // \"EHSSCRRESDASH\",\n // \"EHSANDPUIFORM\",\n // // \"PUIEHSDEPTDASH\",\n // ],\n },\n {\n path: \"/addEmployeeCase\",\n name: \"Add Employee COVID'19 Case\",\n formAction: \"AddForm\",\n component: AddEmpCOVIDCase,\n menuMap: [\"mnuEHSScreening\", \"mnuRESScreening\"],\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"OUTBREAKDASH\",\n // \"EHSSCREENING\",\n // \"EHSSCRNDASH\",\n // \"EHSSCRRESDASH\",\n // \"EHSANDPUIFORM\",\n // \"KEHSDASHBOARD\",\n // \"EHSDEPSCRESDASH\",\n // \"EHSPGMSCRESDASH\",\n // \"PUIEHSDEPTDASH\",\n // \"STSDASHBOARD\",\n // \"EHSSTDSCRDASHA\",\n // \"EHSSTDSCRDASHMH\",\n // \"EHSSTDSCRDASHFH\"\n // ],\n },\n\n //RESScreeing\n {\n path: \"/addRESEmployeeCase\",\n name: \"Resctricted Screening\",\n formAction: \"AddForm\",\n component: AddRESEmpCovidCase,\n menuMap: \"mnuRESScreening\",\n route: PrivateRoute,\n },\n\n {\n path: \"/labReporting\",\n name: \"LAB Reporting\",\n component: ReportingLab,\n reportingOption: \"LABReporting\",\n menuMap: \"mnuLABReporting\",\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\",\"LABREPORTING\"],\n },\n {\n path: \"/dipheReporting\",\n name: \"DIPHE Reporting\",\n component: Reporting,\n reportingOption: \"DIPHEReporting\",\n menuMap: \"mnuDIPHEReporting\",\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\",\"PUIPORTING\", \"PUIEHSDEPTDASH\"],\n },\n {\n path: \"/reportingtableLab\",\n name: \"Reporting Table Lab\",\n component: ReportingTableLab,\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\",\"LABREPORTING\", \"PUIPORTING\"],\n },\n {\n path: \"/reportingtable\",\n name: \"Reporting Table\",\n component: ReportingTable,\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\",\"LABREPORTING\", \"PUIPORTING\"],\n },\n {\n path: \"/casesList\",\n name: \"Cases List\",\n component: CasesList,\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\",\"PUISCRNNING\", \"PUIPORTING\", \"EHSANDPUIFORM\"],\n },\n {\n path: \"/editCase\",\n name: \"Edit COVID'19 Case\",\n component: AddCOVIDCase,\n formAction: \"EditForm\",\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\", \"PUISCRNNING\", \"PUIPORTING\", \"EHSANDPUIFORM\"],\n },\n {\n path: \"/viewCase\",\n name: \"View COVID'19 Case\",\n component: AddCOVIDCase,\n formAction: \"ViewForm\",\n route: PrivateRoute,\n // roles: [\"ADMIN\", \"OUTBREAKDASH\", \"PUISCRNNING\", \"PUIPORTING\", \"EHSANDPUIFORM\"],\n },\n {\n path: \"/screening\",\n name: \"Screening\",\n component: Screening,\n route: PrivateRoute,\n // roles: [\n // \"ADMIN\",\n // \"OUTBREAKDASH\",\n // \"PUISCRNNING\",\n // \"PUIPORTING\",\n // \"EHSANDPUIFORM\",\n // \"KEHSDASHBOARD\",\n // \"EHSDEPSCRESDASH\",\n // \"PUIEHSDEPTDASH\",\n // \"STSDASHBOARD\"\n // ],\n },\n\n ///////////////////Child Routes Defined Below//////////////////////////\n {\n path: \"/positiveadmitted\",\n name: \"Positive Cases List\",\n component: PositiveAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/negativeadmitted\",\n name: \"Negative Cases List\",\n component: NegativeAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/positivetonegativeadmitted\",\n name: \"Positive Cases List\",\n component: PosToNegAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/suspectedadmitted\",\n name: \"Negative Cases List\",\n component: SuspectedAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/emergencyadmitted\",\n name: \"Negative Cases List\",\n component: EmergencyAdmList,\n route: PrivateRoute,\n },\n\n {\n path: \"/positivedischarged\",\n name: \"Positive Cases List\",\n component: PositiveDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/negativedischarged\",\n name: \"Negative Cases List\",\n component: NegativeDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/positivetonegativedischarged\",\n name: \"Positive Cases List\",\n component: PosToNegDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/departed\",\n name: \"Negative Cases List\",\n component: DepartedList,\n route: PrivateRoute,\n },\n {\n path: \"/death\",\n name: \"Negative Cases List\",\n component: DeathList,\n route: PrivateRoute,\n },\n\n {\n path: \"/receivedspecimen\",\n name: \"Positive Cases List\",\n component: ReceivedSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/positivespecimen\",\n name: \"Negative Cases List\",\n component: PositiveSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/negativespecimen\",\n name: \"Positive Cases List\",\n component: NegativeSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/externalpositive\",\n name: \"Negative Cases List\",\n component: ExtPositiveSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/pendingspecimen\",\n name: \"Negative Cases List\",\n component: PendingSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/passfit\",\n name: \"Pass Fit\",\n component: ScreeningPassFit,\n route: PrivateRoute,\n },\n {\n path: \"/passunfit\",\n name: \"Pass UnFit\",\n component: ScreeningPassUnFit,\n route: PrivateRoute,\n },\n {\n path: \"/screeningexpired\",\n name: \"Pass Expired\",\n component: ScreeningPassExpired,\n route: PrivateRoute,\n },\n //Student Screening Passes Route\n {\n path: \"/stdpassfit\",\n name: \"Pass Fit\",\n component: StdScreeningPassFit,\n route: PrivateRoute,\n },\n {\n path: \"/stdpassunfit\",\n name: \"Pass UnFit\",\n component: StdScreeningPassUnFit,\n route: PrivateRoute,\n },\n /////\n\n //////Outbreak\n {\n path: \"/OutbreakDetails\",\n name: \"OutbreakDetails\",\n component: OutbreakDetails,\n route: PrivateRoute,\n },\n\n //////EMPDashboardRoute\n {\n path: \"/emppositiveadmitted\",\n name: \"Employee Positive Cases List\",\n component: EmployeePositiveAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/empnegativeadmitted\",\n name: \"Employee Negative Cases List\",\n component: EmployeeNegativeAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/emppositivetonegativeadmitted\",\n name: \"Employee Positive Cases List\",\n component: EmployeePosToNegAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/empsuspectedadmitted\",\n name: \"Employee Negative Cases List\",\n component: EmployeeSuspectedAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/empdependentadmitted\",\n name: \"Employee's Dependent Cases List\",\n component: EmployeeDependentAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/empemergencyadmitted\",\n name: \"Employee Negative Cases List\",\n component: EmployeeEmergencyAdmList,\n route: PrivateRoute,\n },\n\n {\n path: \"/emppositivedischarged\",\n name: \"Employee Positive Cases List\",\n component: EmployeePositiveDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/empnegativedischarged\",\n name: \"Employee Negative Cases List\",\n component: EmployeeNegativeDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/emppositivetonegativedischarged\",\n name: \"Employee Positive Cases List\",\n component: EmployeePosToNegDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/empdeparted\",\n name: \"Employee Negative Cases List\",\n component: EmployeeDepartedList,\n route: PrivateRoute,\n },\n {\n path: \"/empdeath\",\n name: \"Employee Negative Cases List\",\n component: EmployeeDeathList,\n route: PrivateRoute,\n },\n {\n path: \"/empactivequarantine\",\n name: \"Employee Negative Cases List\",\n component: EmployeeSpecimenActiveQuarantineList,\n route: PrivateRoute,\n },\n {\n path: \"/empspecimenrecovered\",\n name: \"Employee Specimen Recovered List\",\n component: EmployeeSpecimenRecoveredList,\n route: PrivateRoute,\n },\n\n {\n path: \"/emppositivespecimen\",\n name: \"Employee Positive Cases List\",\n component: EmployeePositiveSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/empnegativespecimen\",\n name: \"Employee Negative Cases List\",\n component: EmployeeNegativeSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/emplabsuspected\",\n name: \"Employee Negative Cases List\",\n component: EmployeeLabSuspected,\n route: PrivateRoute,\n },\n {\n path: \"/emplabexpected\",\n name: \"Employee Negative Cases List\",\n component: EmployeeLabExpected,\n route: PrivateRoute,\n },\n\n {\n path: \"/empactivescreening\",\n name: \"Employee Negative Cases List\",\n component: EmployeeActiveScreening,\n route: PrivateRoute,\n },\n {\n path: \"/empfitforcampus\",\n name: \"Employee Negative Cases List\",\n component: EmployeeFitForCampus,\n route: PrivateRoute,\n },\n {\n path: \"/empunfitforwork\",\n name: \"Employee Negative Cases List\",\n component: EmployeeUnFitForWork,\n route: PrivateRoute,\n },\n //////KENYA DASHBOARD ROUTES\n {\n path: \"/empactivescreeningkenya\",\n name: \"Employee Negative Cases List\",\n component: EmployeeActiveScreeningKenya,\n route: PrivateRoute,\n },\n {\n path: \"/empfitforcampuskenya\",\n name: \"Employee Negative Cases List\",\n component: EmployeeFitForCampusKenya,\n route: PrivateRoute,\n },\n {\n path: \"/empunfitforworkkenya\",\n name: \"Employee Negative Cases List\",\n component: EmployeeUnFitForWorkKenya,\n route: PrivateRoute,\n },\n /////////END\n\n ////Student Dashboard Routes\n {\n path: \"/stdpositiveadmitted\",\n name: \"Student Positive Cases List\",\n component: StudentPositiveAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/stdnegativeadmitted\",\n name: \"Student Negative Cases List\",\n component: StudentNegativeAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/stdpositivetonegativeadmitted\",\n name: \"Student Positive Cases List\",\n component: StudentPosToNegAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/stdsuspectedadmitted\",\n name: \"Student Negative Cases List\",\n component: StudentSuspectedAdmList,\n route: PrivateRoute,\n },\n {\n path: \"/stdemergencyadmitted\",\n name: \"Student Negative Cases List\",\n component: StudentEmergencyAdmList,\n route: PrivateRoute,\n },\n\n {\n path: \"/stdpositivedischarged\",\n name: \"Student Positive Cases List\",\n component: StudentPositiveDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/stdnegativedischarged\",\n name: \"Student Negative Cases List\",\n component: StudentNegativeDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/stdpositivetonegativedischarged\",\n name: \"Student Positive Cases List\",\n component: StudentPosToNegDiscList,\n route: PrivateRoute,\n },\n {\n path: \"/stddeparted\",\n name: \"Student Negative Cases List\",\n component: StudentDepartedList,\n route: PrivateRoute,\n },\n {\n path: \"/stddeath\",\n name: \"Student Negative Cases List\",\n component: StudentDeathList,\n route: PrivateRoute,\n },\n {\n path: \"/stdactivequarantine\",\n name: \"Student Negative Cases List\",\n component: StudentSpecimenActiveQuarantineList,\n route: PrivateRoute,\n },\n {\n path: \"/stdspecimenrecovered\",\n name: \"Student Specimen Recovered List\",\n component: StudentSpecimenRecoveredList,\n route: PrivateRoute,\n },\n\n {\n path: \"/stdpositivespecimen\",\n name: \"Student Positive Cases List\",\n component: StudentPositiveSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/stdnegativespecimen\",\n name: \"Student Negative Cases List\",\n component: StudentNegativeSpecList,\n route: PrivateRoute,\n },\n {\n path: \"/stdlabsuspected\",\n name: \"Student Negative Cases List\",\n component: StudentLabSuspected,\n route: PrivateRoute,\n },\n {\n path: \"/stdlabexpected\",\n name: \"Student Negative Cases List\",\n component: StudentLabExpected,\n route: PrivateRoute,\n },\n\n {\n path: \"/stdactivescreening\",\n name: \"Student Negative Cases List\",\n component: StudentActiveScreening,\n route: PrivateRoute,\n },\n {\n path: \"/stdfitforcampus\",\n name: \"Student Negative Cases List\",\n component: StudentFitForCampus,\n route: PrivateRoute,\n },\n {\n path: \"/stdunfitforwork\",\n name: \"Student Negative Cases List\",\n component: StudentUnFitForWork,\n route: PrivateRoute,\n },\n\n /////End\n];\n\nexport { routes, PrivateRoute };\n","import React, { Component, Suspense } from \"react\";\nimport { BrowserRouter } from \"react-router-dom\";\nimport { connect } from \"react-redux\";\nimport Loadable from \"react-loadable\";\n\nimport { routes } from \"./routes\";\n\n// setup fake backend\n//import { configureFakeBackend } from \"./helpers\";\nimport { isUserAuthenticated } from \"./helpers/authUtils\";\n\n// Themes\nimport \"./assets/scss/DefaultTheme.scss\";\n\n// Lazy loading and code splitting -\n// Derieved idea from https://blog.logrocket.com/lazy-loading-components-in-react-16-6-6cea535c0b52\nconst loading = () =>
;\n\n// All layouts/containers\nconst NonAuthLayout = Loadable({\n loader: () => import(\"./components/NonAuthLayout\"),\n render(loaded, props) {\n let Component = loaded.default;\n return ;\n },\n loading,\n});\n\nconst AuthLayout = Loadable({\n loader: () => import(\"./components/AuthLayout\"),\n render(loaded, props) {\n let Component = loaded.default;\n return ;\n },\n loading,\n});\n\n// configure fake backend\n//configureFakeBackend();\n\n/**\n * Exports the component with layout wrapped to it\n * @param {} WrappedComponent\n */\nconst withLayout = (WrappedComponent) => {\n const HOC = class extends Component {\n render() {\n return ;\n }\n };\n\n return connect()(HOC);\n};\n\n/**\n * Main app component\n */\nclass App extends Component {\n /**\n * Returns the layout component based on different properties\n * @param {*} props\n */\n getLayout = () => {\n console.log(\"AMQ logs here\", isUserAuthenticated())\n return isUserAuthenticated() ? AuthLayout : NonAuthLayout;\n };\n\n render() {\n console.log(routes);\n return (\n // rendering the router with layout\n \n \n {routes.map((route, index) => {\n return (\n {\n const Layout = this.getLayout();\n return (\n \n \n \n \n \n );\n })}\n />\n );\n })}\n \n \n );\n }\n}\n\nconst mapStateToProps = (state) => {\n return {\n isAuthenticated: state.Auth.isAuthenticated,\n };\n};\n\nexport default connect(mapStateToProps, null)(App);\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","// @flow\nimport {\n LOGIN_USER,\n LOGIN_USER_SUCCESS,\n LOGIN_USER_FAILED,\n LOGOUT_USER,\n REGISTER_USER,\n REGISTER_USER_SUCCESS,\n REGISTER_USER_FAILED,\n FORGET_PASSWORD,\n FORGET_PASSWORD_SUCCESS,\n FORGET_PASSWORD_FAILED\n} from '../../constants/actionTypes';\n\nimport { getLoggedInUser } from '../../helpers/authUtils';\n\nconst INIT_STATE = {\n user: getLoggedInUser(),\n loading: false\n};\n\ntype AuthAction = { type: string, payload: {} | string };\ntype State = { user?: {} | null, loading?: boolean, +value?: boolean };\n\nconst Auth = (state:State = INIT_STATE, action: AuthAction) => {\n switch (action.type) {\n case LOGIN_USER:\n return { ...state, loading: true };\n case LOGIN_USER_SUCCESS:\n return { ...state, user: action.payload, loading: false, error: null };\n case LOGIN_USER_FAILED:\n return { ...state, error: action.payload, loading: false };\n case REGISTER_USER:\n return { ...state, loading: true };\n case REGISTER_USER_SUCCESS:\n return { ...state, user: action.payload, loading: false, error: null };\n case REGISTER_USER_FAILED:\n return { ...state, error: action.payload, loading: false };\n case LOGOUT_USER:\n return { ...state, user: null };\n case FORGET_PASSWORD:\n return { ...state, loading: true };\n case FORGET_PASSWORD_SUCCESS:\n return { ...state, passwordResetStatus: action.payload, loading: false, error: null };\n case FORGET_PASSWORD_FAILED:\n return { ...state, error: action.payload, loading: false };\n default: return { ...state };\n }\n}\n\nexport default Auth;","import { combineReducers } from 'redux';\nimport Auth from './auth/reducers';\n\nexport default combineReducers({\n Auth\n});","// @flow\r\nimport { Cookies } from \"react-cookie\";\r\nimport { all, call, fork, put, takeEvery } from \"redux-saga/effects\";\r\nimport { FetchData } from \"../../services/baseService\";\r\n\r\nimport {\r\n LOGIN_USER,\r\n LOGOUT_USER,\r\n REGISTER_USER,\r\n FORGET_PASSWORD,\r\n} from \"../../constants/actionTypes\";\r\n\r\nimport {\r\n loginUserSuccess,\r\n loginUserFailed,\r\n registerUserSuccess,\r\n registerUserFailed,\r\n forgetPasswordSuccess,\r\n forgetPasswordFailed,\r\n} from \"./actions\";\r\n\r\n/**\r\n * Fetch data from given url\r\n * @param {*} url\r\n * @param {*} options\r\n */\r\nconst fetchJSON = (url, options = {}) => {\r\n // url =\r\n // \"http://userauthserviceuat.aku.edu/api/AuthenticateUser?UserName=abdulmujeeb.qureshi&Password=123Mujeeb23f&Application=HHFWEB&WebUrl=localhost\";\r\n // console.log(\"url: \", url);\r\n // console.log(\"options: \", options);\r\n //return fetch(url, options)\r\n return fetch(url, options)\r\n .then((response) => {\r\n if (!response.status === 200) {\r\n throw response.json();\r\n }\r\n return response.json();\r\n })\r\n .then((json) => {\r\n return json;\r\n })\r\n .catch((error) => {\r\n console.log(\"response error: \", error);\r\n throw error;\r\n });\r\n};\r\n\r\n/**\r\n * Sets the session\r\n * @param {*} user\r\n */\r\nconst setSession = (user) => {\r\n let cookies = new Cookies();\r\n if (user) \r\n {\r\n user.menuList = [];\r\n cookies.set(\"user\", JSON.stringify(user), { path: \"/\" });\r\n }\r\n else{\r\n cookies.remove(\"user\");\r\n } \r\n};\r\n\r\nconst setUserPicture = (UserPicture) => {\r\n localStorage.setItem(\"UserPicture\", UserPicture);\r\n};\r\nconst setUserMenus = (UserMenu) => {\r\n console.log(\"setUserMenus: \", UserMenu);\r\n console.log(\"setUserMenus type: \", typeof UserMenu);\r\n //localStorage.setItem(\"UserMenu\", UserMenu);\r\n\r\n let cookies = new Cookies();\r\n if (UserMenu) \r\n {\r\n let _usermenus = UserMenu.map((menu,i)=>[menu.OptionLabel])\r\n console.log(\"_usermenus\",_usermenus)\r\n cookies.remove(\"UserMenu\");\r\n cookies.set(\"UserMenu\", _usermenus, { path: \"/\" });\r\n }\r\n else{\r\n cookies.remove(\"UserMenu\");\r\n } \r\n};\r\n/**\r\n * Login the user\r\n * @param {*} payload - username and password\r\n */\r\nfunction* login({ payload: { username, password } }) {\r\n //const options = {\r\n // body: JSON.stringify({\r\n // UserName: username,\r\n // Password: password,\r\n // Application: \"HHFWEB\",\r\n // WebUrl: \"localhost\"\r\n // }),\r\n // body: JSON.stringify({ username, password }),\r\n // method: \"POST\",\r\n // headers: { \"Content-Type\": \"application/json\" }\r\n //};\r\n\r\n try {\r\n const response = yield call(FetchData, \"CovidManager.SignIn\", {\r\n UserID: username,\r\n Password: password,\r\n });\r\n\r\n const { ResponseResult, ResponseMessage } = response;\r\n console.log(\"response: \", response);\r\n if (ResponseResult != null && ResponseResult.UserID != null) {\r\n let responseMod = {\r\n LoginStatus: ResponseResult.LoginStatus,\r\n Mnemonic: ResponseResult.Mnemonic,\r\n Name: ResponseResult.Name,\r\n Role: ResponseResult.Role,\r\n Speciality: ResponseResult.Speciality,\r\n UserID: ResponseResult.UserID,\r\n UserPictureExists: ResponseResult.UserPictureExists,\r\n menuList: ResponseResult.menus,\r\n DivisionId: ResponseResult.DivisionId,\r\n ResourceEntity: ResponseResult.ResourceEntity,\r\n SubDivisionDesc: ResponseResult.SubDivisionDesc,\r\n SubDivisionId: ResponseResult.SubDivisionId,\r\n EmployeeID : ResponseResult.EmployeeNumber,\r\n token:\r\n \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJ3d3cuYWt1LmVkdSIsInN1YiI6Im1ubUBtbm0uY29tIiwiaXNzIjoiTW5NIn0.PRbF6RNmjYm7ai8jQNShBmyDLlZfIWv2Z6V2KosJgjE\",\r\n };\r\n console.log(\"Login result \", ResponseResult);\r\n setSession(responseMod);\r\n setUserPicture(ResponseResult.UserPicture);\r\n setUserMenus(ResponseResult.menus);\r\n yield put(loginUserSuccess(responseMod));\r\n } else {\r\n console.log(\"login failed....\");\r\n yield put(loginUserFailed(ResponseMessage));\r\n }\r\n } catch (error) {\r\n let message;\r\n switch (error.status) {\r\n case 500:\r\n message = \"Internal Server Error\";\r\n break;\r\n case 401:\r\n message = \"Invalid credentials\";\r\n break;\r\n default:\r\n message = error;\r\n }\r\n yield put(loginUserFailed(message));\r\n setSession(null);\r\n }\r\n}\r\n\r\n/**\r\n * Logout the user\r\n * @param {*} param0\r\n */\r\nfunction* logout({ payload: { history } }) {\r\n try {\r\n setSession(null);\r\n yield call(() => {\r\n history.push(\"/login\");\r\n });\r\n } catch (error) {}\r\n}\r\n\r\n/**\r\n * Register the user\r\n */\r\nfunction* register({ payload: { fullname, email, password } }) {\r\n const options = {\r\n body: JSON.stringify({ fullname, email, password }),\r\n method: \"POST\",\r\n headers: { \"Content-Type\": \"application/json\" },\r\n };\r\n\r\n try {\r\n const response = yield call(fetchJSON, \"/users/register\", options);\r\n yield put(registerUserSuccess(response));\r\n } catch (error) {\r\n let message;\r\n switch (error.status) {\r\n case 500:\r\n message = \"Internal Server Error\";\r\n break;\r\n case 401:\r\n message = \"Invalid credentials\";\r\n break;\r\n default:\r\n message = error;\r\n }\r\n yield put(registerUserFailed(message));\r\n }\r\n}\r\n\r\n/**\r\n * forget password\r\n */\r\nfunction* forgetPassword({ payload: { username } }) {\r\n const options = {\r\n body: JSON.stringify({ username }),\r\n method: \"POST\",\r\n headers: { \"Content-Type\": \"application/json\" },\r\n };\r\n\r\n try {\r\n const response = yield call(fetchJSON, \"/users/password-reset\", options);\r\n yield put(forgetPasswordSuccess(response.message));\r\n } catch (error) {\r\n let message;\r\n switch (error.status) {\r\n case 500:\r\n message = \"Internal Server Error\";\r\n break;\r\n case 401:\r\n message = \"Invalid credentials\";\r\n break;\r\n default:\r\n message = error;\r\n }\r\n yield put(forgetPasswordFailed(message));\r\n }\r\n}\r\n\r\nexport function* watchLoginUser(): any {\r\n yield takeEvery(LOGIN_USER, login);\r\n}\r\n\r\nexport function* watchLogoutUser(): any {\r\n yield takeEvery(LOGOUT_USER, logout);\r\n}\r\n\r\nexport function* watchRegisterUser(): any {\r\n yield takeEvery(REGISTER_USER, register);\r\n}\r\n\r\nexport function* watchForgetPassword(): any {\r\n yield takeEvery(FORGET_PASSWORD, forgetPassword);\r\n}\r\n\r\nfunction* authSaga(): any {\r\n yield all([\r\n fork(watchLoginUser),\r\n fork(watchLogoutUser),\r\n fork(watchRegisterUser),\r\n fork(watchForgetPassword),\r\n ]);\r\n}\r\n\r\nexport default authSaga;\r\n","import { all } from 'redux-saga/effects';\nimport authSaga from './auth/saga';\n\n\nexport default function* rootSaga(getState) {\n yield all([\n authSaga(),\n ]);\n}\n","import { createStore, applyMiddleware, compose } from 'redux';\nimport createSagaMiddleware from \"redux-saga\";\nimport reducers from './reducers';\nimport sagas from \"./sagas\";\n\nconst sagaMiddleware = createSagaMiddleware();\nconst middlewares = [sagaMiddleware];\n\nexport function configureStore(initialState) {\n const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n\n const store = createStore(\n reducers,\n initialState,\n composeEnhancers(\n applyMiddleware(...middlewares)\n ),\n );\n sagaMiddleware.run(sagas);\n return store;\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nimport { Provider } from 'react-redux';\nimport { configureStore } from './redux/store';\n\n\nReactDOM.render(\n \n, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}