{"version":3,"sources":["config.js","views/Auth/utils/axiosHeaders.js","views/Auth/UserService.js","views/Auth/actions/types.js","polyfill.js","views/Auth/reducers/authReducer.js","views/Auth/reducers/index.js","store.js","views/Auth/utils/authProvider.js","App.js","serviceWorker.js","assets/icons/sygnet.js","assets/icons/index.js","assets/icons/logo.js","assets/icons/logo-negative.js","index.js","views/Auth/actions/authActions.js"],"names":["apiHostName","host","authority","setAuthHeader","token","axios","defaults","headers","common","config","client_id","redirect_uri","response_type","scope","post_logout_redirect_uri","userManager","UserManager","loadUserFromStorage","store","getUser","user","dispatch","storeUserError","storeUser","console","error","signinRedirectCallback","signoutRedirectCallback","clearStaleState","removeUser","STORE_USER","USER_SIGNED_OUT","USER_EXPIRED","STORE_USER_ERROR","LOADING_USER","window","CustomEvent","event","params","bubbles","cancelable","detail","undefined","evt","document","createEvent","initCustomEvent","prototype","Event","initialState","isLoadingUser","combineReducers","auth","state","action","type","payload","composeEnhancers","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","createStore","rootReducer","AuthProvider","manager","children","useRef","useEffect","current","onUserLoaded","log","onUserUnloaded","onAccessTokenExpiring","onAccessTokenExpired","onUserSignedOut","events","addUserLoaded","addUserUnloaded","addAccessTokenExpiring","addAccessTokenExpired","addUserSignedOut","removeUserLoaded","removeUserUnloaded","removeAccessTokenExpiring","removeAccessTokenExpired","removeUserSignedOut","React","Children","only","loading","className","Login","lazy","SigninOidc","SignoutOidc","Page404","Page500","TheLayout","App","Suspense","fallback","exact","path","name","render","props","Boolean","location","hostname","match","icons","Object","assign","sygnet","logo","logoNegative","cilAlignCenter","cilAlignLeft","cilAlignRight","cilApplicationsSettings","cilArrowRight","cilArrowTop","cilAsterisk","cilBan","cilBasket","cilBell","cilBold","cilBookmark","cilCalculator","cilCalendar","cilCloudDownload","cilChartPie","cilCheck","cilChevronBottom","cilChevronLeft","cilChevronRight","cilChevronTop","cilCircle","cilCheckCircle","cilCode","cilCommentSquare","cilCreditCard","cilCursor","cilCursorMove","cilDrop","cilDollar","cilEnvelopeClosed","cilEnvelopeLetter","cilEnvelopeOpen","cilEuro","cilGlobeAlt","cilGrid","cilFile","cilFullscreen","cilFullscreenExit","cilGraph","cilHome","cilInbox","cilIndentDecrease","cilIndentIncrease","cilInputPower","cilItalic","cilJustifyCenter","cilJustifyLeft","cilLaptop","cilLayers","cilLightbulb","cilList","cilListNumbered","cilListRich","cilLocationPin","cilLockLocked","cilMagnifyingGlass","cilMap","cilMoon","cilNotes","cilOptions","cilPaperclip","cilPaperPlane","cilPencil","cilPeople","cilPhone","cilPrint","cilPuzzle","cilSave","cilScrubber","cilSettings","cilShare","cilShareAll","cilShareBoxed","cilShieldAlt","cilSpeech","cilSpeedometer","cilSpreadsheet","cilStar","cilSun","cilTags","cilTask","cilTrash","cilUnderline","cilUser","cilUserFemale","cilUserFollow","cilUserUnfollow","cilX","cilXCircle","cilWarning","cilStorage","cilFolderOpen","cilBlind","cilBuilding","cifUs","cifBr","cifIn","cifFr","cifEs","cifPl","cibSkype","cibFacebook","cibTwitter","cibLinkedin","cibFlickr","cibTumblr","cibXing","cibGithub","cibStackoverflow","cibYoutube","cibDribbble","cibInstagram","cibPinterest","cibVk","cibYahoo","cibBehance","cibReddit","cibVimeo","cibCcMastercard","cibCcVisa","cibStripe","cibPaypal","cibGooglePay","cibCcAmex","ReactDOM","getElementById","navigator","serviceWorker","ready","then","registration","unregister","id_token"],"mappings":";0HAAA,sGAGO,IAAMA,EAAc,gCAEdC,EAAO,wBAEPC,EAAY,iC,iCCPzB,wDAEO,SAASC,EAAcC,GAC5BC,IAAMC,SAASC,QAAQC,OAAvB,cAAiDJ,EAAQ,UAAYA,EAAQ,K,u9MCC/E,IAAMK,EAAS,CACXP,UAAWA,IACXQ,UAAW,yBACXC,aAAcV,IAAO,eACrBW,cAAe,OACfC,MAAO,yEACPC,yBAA0Bb,IAAO,iBAG/Bc,EAAc,IAAIC,cAAYP,GAE7B,SAAeQ,EAAtB,kC,4CAAO,WAAmCC,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ACAC,iBACAC,aACAC,aACAC,mBACAC,uBACAC,cACAC,aACAC,cACAC,uBACAC,uBACAC,mBACAC,eACAC,sBACAC,oBACAC,eACAC,eACAC,kBACAC,aACAC,qBACAC,iBACAC,oBACAC,mBACAC,wBACAC,YACAC,aACAC,cACAC,gBACAC,kBACAC,mBACAC,eACAC,eACAC,cACAC,cACAC,eACAC,aACAC,iBACAC,iBACAC,cACAC,iBACAC,mBACAC,kBACAC,eACAC,oBACAC,oBACAC,aACAC,YACAC,aACAC,aACAC,cACAC,kBACAC,aACAC,mBACAC,mBACAC,qBACAC,UACAC,gBACAC,gBACAC,gBACAC,mBACAC,cACAC,kBACC,CACDC,WACAC,WACAC,WACAC,WACAC,WACAC,YACC,CACDC,aACAC,gBACAC,eACAC,gBACAC,cACAC,cACAC,YACAC,cACAC,qBACAC,eACAC,gBACAC,iBACAC,iBACAC,UACAC,aACAC,eACAC,cACAC,aACAC,oBACAC,cACAC,cACAC,cACAC,iBACAC,gBG9PF1J,IAAMwB,MAAQA,GAEdmI,IAASzI,OACP,kBAAC,IAAD,CAAUrF,MAAOA,GACf,kBAAC,EAAD,OAEF0B,SAASqM,eAAe,SLsGpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,iB,gCM3HnB,yFASO,SAAShO,EAAUH,GAGxB,OADAjB,YAAciB,EAAKoO,UACZ,CACLjM,KAAMzB,IACN0B,QAASpC,GAUN,SAASE,IACd,MAAO,CACLiC,KAAMtB,Q","file":"static/js/main.fda17cf0.chunk.js","sourcesContent":["// export const apiHostName = 'http://192.168.0.102:5001';\r\n// export const apiHostName = `${window.location.protocol}//${window.location.hostname}:5001`;\r\n// export const apiHostName = 'https://localhost:44347';\r\nexport const apiHostName = 'http://api.mansurtraders.info';\r\n\r\nexport const host = 'http://localhost:3008'\r\nexport const adminApiUrl = \"http://localhost:8083\";\r\nexport const authority = \"http://api.mansurtraders.info\";\r\n\r\nexport const incidentsFolder = \"incidents\"\r\n","import axios from 'axios'\r\n\r\nexport function setAuthHeader(token) {\r\n axios.defaults.headers.common['Authorization'] = token ? 'Bearer ' + token : ''\r\n // let userFromStorage = JSON.parse(localStorage.getItem(\"user\"));\r\n // axios.defaults.headers.common['Authorization'] = userFromStorage.access_token\r\n}","import { UserManager } from 'oidc-client';\r\nimport { host, authority } from '../../config';\r\nimport { storeUser, storeUserError } from './actions/authActions';\r\n\r\nconst config = {\r\n authority: authority,\r\n client_id: \"ThreatLibraryWebClient\",\r\n redirect_uri: host + \"/signin-oidc\",\r\n response_type: \"code\",\r\n scope: \"openid profile IDMSCoreApi IDMSClaims roles skoruba_identity_admin_api\",\r\n post_logout_redirect_uri: host + \"/signout-oidc\",\r\n};\r\n\r\nconst userManager = new UserManager(config)\r\n\r\nexport async function loadUserFromStorage(store) {\r\n try {\r\n let user = await userManager.getUser()\r\n if (!user) { return store.dispatch(storeUserError()) }\r\n store.dispatch(storeUser(user))\r\n } catch (e) {\r\n console.error(`User not found: ${e}`)\r\n store.dispatch(storeUserError())\r\n }\r\n}\r\n\r\nexport function setUser() {\r\n userManager.getUser().then(function (user) {\r\n localStorage.setItem(\"user\", JSON.stringify(user));\r\n // storeUser(user);\r\n })\r\n}\r\n\r\nexport function getUserFromStorage() {\r\n return JSON.parse(localStorage.getItem(\"user\"));\r\n}\r\n\r\nexport function signinRedirect() {\r\n return userManager.signinRedirect()\r\n}\r\n\r\nexport function signinRedirectCallback() {\r\n return userManager.signinRedirectCallback()\r\n}\r\n\r\nexport async function signoutRedirect(id_token) {\r\n userManager.clearStaleState()\r\n userManager.removeUser()\r\n return window.location = config.authority + \"/connect/endsession?id_token_hint=\" + id_token + \"&post_logout_redirect_uri\" + config.post_logout_redirect_uri;\r\n // return userManager.signoutRedirect()\r\n}\r\n\r\nexport function signoutRedirectCallback() {\r\n // localStorage.clear();\r\n userManager.clearStaleState()\r\n userManager.removeUser()\r\n return userManager.signoutRedirectCallback()\r\n}\r\n\r\nexport default userManager\r\n","export const STORE_USER = 'STORE_USER'\r\nexport const USER_SIGNED_OUT = 'USER_SIGNED_OUT'\r\nexport const USER_EXPIRED = 'USER_EXPIRED'\r\nexport const STORE_USER_ERROR = 'STORE_USER_ERROR'\r\nexport const LOADING_USER = 'LOADING_USER'\r\n","/*\r\n* required polyfills\r\n*/\r\nimport \"core-js\";\r\nimport 'core-js/features/set/map';\r\nimport 'core-js/features/map';\r\n\r\n/** IE9, IE10 and IE11 requires all of the following polyfills. **/\r\n// import 'core-js/es6/symbol'\r\n// import 'core-js/es6/object'\r\n// import 'core-js/es6/function'\r\n// import 'core-js/es6/parse-int'\r\n// import 'core-js/es6/parse-float'\r\n// import 'core-js/es6/number'\r\n// import 'core-js/es6/math'\r\n// import 'core-js/es6/string'\r\n// import 'core-js/es6/date'\r\n// import 'core-js/es6/array'\r\n// import 'core-js/es6/regexp'\r\n// import 'core-js/es6/map'\r\n// import 'core-js/es6/weak-map'\r\n// import 'core-js/es6/set'\r\n// import 'core-js/es7/object'\r\n\r\n/** IE10 and IE11 requires the following for the Reflect API. */\r\n// import 'core-js/es6/reflect'\r\n\r\n/** Evergreen browsers require these. **/\r\n// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.\r\n// import 'core-js/es7/reflect'\r\n\r\n// CustomEvent() constructor functionality in IE9, IE10, IE11\r\n(function () {\r\n\r\n if ( typeof window.CustomEvent === \"function\" ) return false\r\n\r\n function CustomEvent ( event, params ) {\r\n params = params || { bubbles: false, cancelable: false, detail: undefined }\r\n var evt = document.createEvent( 'CustomEvent' )\r\n evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail )\r\n return evt\r\n }\r\n\r\n CustomEvent.prototype = window.Event.prototype\r\n\r\n window.CustomEvent = CustomEvent\r\n})()\r\n","import {\r\n USER_SIGNED_OUT,\r\n STORE_USER_ERROR,\r\n USER_EXPIRED,\r\n STORE_USER,\r\n LOADING_USER\r\n} from '../actions/types'\r\n\r\nconst initialState = {\r\n user: null,\r\n isLoadingUser: false\r\n};\r\n\r\nexport default function (state = initialState, action) {\r\n switch (action.type) {\r\n case STORE_USER:\r\n return {\r\n ...state,\r\n isLoadingUser: false,\r\n user: action.payload\r\n }\r\n case LOADING_USER:\r\n return {\r\n ...state,\r\n isLoadingUser: true\r\n }\r\n case USER_EXPIRED:\r\n case STORE_USER_ERROR:\r\n case USER_SIGNED_OUT:\r\n return {\r\n ...state,\r\n user: null,\r\n isLoadingUser: false\r\n }\r\n default:\r\n return state\r\n }\r\n}","import { combineReducers } from 'redux';\r\nimport authReducer from './authReducer';\r\n\r\nexport default combineReducers({\r\n auth: authReducer\r\n})\r\n","// import { createStore } from 'redux'\r\n\r\n// const initialState = {\r\n// sidebarShow: 'responsive'\r\n// }\r\n\r\n// const changeState = (state = initialState, { type, ...rest }) => {\r\n// switch (type) {\r\n// case 'set':\r\n// return {...state, ...rest }\r\n// default:\r\n// return state\r\n// }\r\n// }\r\n\r\n// const store = createStore(changeState)\r\n// export default store\r\n\r\nimport { createStore, compose } from 'redux';\r\nimport rootReducer from './views/Auth/reducers'\r\n\r\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\r\nconst initialState = {}\r\n\r\nconst store = createStore(\r\n rootReducer,\r\n initialState,\r\n composeEnhancers()\r\n)\r\n\r\nexport default store;","import React, { useEffect, useRef } from 'react';\r\nimport { storeUser } from '../actions/authActions'\r\nimport { setAuthHeader } from './axiosHeaders';\r\n\r\nexport default function AuthProvider({ userManager: manager, store, children }) {\r\n\r\n let userManager = useRef();\r\n\r\n useEffect(() => {\r\n userManager.current = manager\r\n\r\n const onUserLoaded = (user) => {\r\n console.log(`user loaded: ${user}`)\r\n store.dispatch(storeUser(user))\r\n }\r\n\r\n const onUserUnloaded = () => {\r\n setAuthHeader(null)\r\n console.log(`user unloaded`)\r\n }\r\n\r\n const onAccessTokenExpiring = () => {\r\n console.log(`user token expiring`)\r\n }\r\n\r\n const onAccessTokenExpired = () => {\r\n console.log(`user token expired`)\r\n }\r\n\r\n const onUserSignedOut = () => {\r\n console.log(`user signed out`)\r\n }\r\n\r\n // events for user\r\n userManager.current.events.addUserLoaded(onUserLoaded)\r\n userManager.current.events.addUserUnloaded(onUserUnloaded)\r\n userManager.current.events.addAccessTokenExpiring(onAccessTokenExpiring)\r\n userManager.current.events.addAccessTokenExpired(onAccessTokenExpired)\r\n userManager.current.events.addUserSignedOut(onUserSignedOut)\r\n\r\n // Specify how to clean up after this effect:\r\n return function cleanup() {\r\n userManager.current.events.removeUserLoaded(onUserLoaded);\r\n userManager.current.events.removeUserUnloaded(onUserUnloaded);\r\n userManager.current.events.removeAccessTokenExpiring(onAccessTokenExpiring)\r\n userManager.current.events.removeAccessTokenExpired(onAccessTokenExpired)\r\n userManager.current.events.removeUserSignedOut(onUserSignedOut)\r\n };\r\n }, [manager, store]);\r\n\r\n return (\r\n React.Children.only(children)\r\n )\r\n}","import React, { useEffect } from 'react';\r\nimport { HashRouter as Router, Route, Switch } from 'react-router-dom';\r\nimport './scss/style.scss';\r\n\r\nimport { Provider } from 'react-redux';\r\nimport store from './store';\r\nimport userManager, { loadUserFromStorage } from './views/Auth/UserService';\r\nimport AuthProvider from './views/Auth/utils/authProvider'\r\n// import PrivateRoute from './views/Auth/utils/protectedRoute'\r\n\r\n// React Notification\r\nimport 'react-notifications/lib/notifications.css';\r\nimport { NotificationContainer } from 'react-notifications';\r\n\r\n\r\nconst loading = (\r\n