{"version":3,"sources":["utils/janioDash.js","components/common/InputField.js","images/janio-main-logo.svg","components/common/auth/Signin.js"],"names":["forEach","obj","callback","Array","isArray","Object","keys","key","has","property","hasOwnProperty","arr","isEmpty","includes","length","filter","map","remove","i","item","splice","indexOf","times","n","result","push","some","isEqual","lodashIsEqual","debounce","lodashDebounce","lodashThrottle","InputField","props","handleOnChange","e","_","onChange","setState","typed","handleKeyUp","onKeyUp","state","this","fieldName","name","type","stateValue","optional","disabled","placeholder","errorMessage","error","message","className","id","rows","value","role","Component","connect","module","exports","Signin","handleLogin","clearAuthErrors","clicked","signinUser","username","password","history","target","keyCode","which","src","img","alt","bind","onClick","to","auth"],"mappings":"oHAAA,mbAIaA,EAAU,SAACC,EAAKC,GAE3B,IAAKD,GAAwB,kBAATA,EAClB,MAAO,GAELE,MAAMC,QAAQH,GAChBA,EAAID,QAAQE,GAEZG,OAAOC,KAAKL,GAAKD,SAAQ,SAAAO,GACvBL,EAASD,EAAIM,GAAMA,OAKZC,EAAM,SAACP,EAAKQ,GAEvB,OAAOR,EAAIS,eAAeD,IAGfL,EAAU,SAACO,GACtB,SAAKA,GAAwB,kBAATA,IAGbR,MAAMC,QAAQO,IAGVC,EAAU,SAACX,GAEtB,OAAKA,IAAQ,CAAC,SAAS,UAAUY,gBAAgBZ,MAG7CI,OAAOC,KAAKL,GAAKa,OAAS,IAOnBC,EAAS,SAACd,EAAKC,GAC1B,OAAKD,GAAwB,kBAATA,EAGhBE,MAAMC,QAAQH,GACTA,EAAIc,OAAOb,GAEXG,OAAOC,KAAKL,GAAKc,QAAO,SAAAR,GAC7B,OAAOL,EAASD,EAAIM,GAAMA,MANrB,IAWES,EAAM,SAACf,EAAKC,GAEvB,OAAKD,GAAwB,kBAATA,EAGhBE,MAAMC,QAAQH,GACTA,EAAIe,IAAId,GAERG,OAAOC,KAAKL,GAAKe,KAAI,SAAAT,GAC1B,OAAOL,EAASD,EAAIM,GAAMA,MANrB,IAWEU,EAAS,SAAChB,EAAKC,G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AEqC,SAA8B,KAAZrC,EAAEsC,OACpB9B,KAAKD,MAAM0B,SAAStD,OAAS,GAAK6B,KAAKD,MAAM2B,SAASvD,OAAS,GACjE6B,KAAKqB,gB,+BAeT,OACE,yBAAKV,UAAU,yCACb,yBAAKA,UAAU,sEACb,yBACAoB,IAAKC,IACLrB,UAAU,0CACVsB,IAAI,MAIN,yBAAKtB,UAAU,yCAEb,yBAAKA,UAAU,iBAEf,yBAAKA,UAAU,wCACb,kBAAC,IAAD,CAAYV,UAAU,gBAAgBC,KAAK,WAAWC,KAAK,QAAQC,WAAYJ,KAAKD,MAAM0B,SAAU/B,SAAUM,KAAKT,eAAe2C,KAAKlC,MAAOF,QAASE,KAAKH,YAAYqC,KAAKlC,QAC7K,kBAAC,IAAD,CAAYC,UAAU,WAAWC,KAAK,WAAWC,KAAK,WAAWC,WAAYJ,KAAKD,MAAM2B,SAAUhC,SAAUM,KAAKT,eAAe2C,KAAKlC,MAAOF,QAASE,KAAKH,YAAYqC,KAAKlC,QAGzKA,KAAKD,MAAMU,MACX,yBAAKE,UAAU,0BAA0BI,KAAK,SAA9C,wCAIA,KAICf,KAAKD,MAAMwB,QAOZ,4BACApB,KAAK,SACLQ,UAAU,iDACVwB,QAASnC,KAAKqB,YACdf,UAAU,GAJV,iBANA,4BAAQH,KAAK,SACbQ,UAAU,6CACVwB,QAASnC,KAAKqB,aAFd,sBAcF,kBAAC,IAAD,CAASe,GAAG,kBAAkBzB,UAAU,2CACtC,yBAAKA,UAAU,qBAAf,4B,GAjGOK,aAgHNC,uBANf,YACE,MAAQ,CACNR,MAF6B,EAAP4B,KAEV5B,SAIwB,CACtCe,eACAF,qBAFaL,CAGZG","file":"static/js/Signin.94f34e36.chunk.js","sourcesContent":["import lodashIsEqual from 'lodash.isequal';\nimport lodashDebounce from 'lodash.debounce';\nimport lodashThrottle from 'lodash.throttle';\n\nexport const forEach = (obj, callback) => {\n //forEach iterates thru array and also objects\n if (!obj || (typeof(obj) !== 'object')){\n return []\n }\n if (Array.isArray(obj)){\n obj.forEach(callback)\n }else{\n Object.keys(obj).forEach(key=>{\n callback(obj[key], key)\n })\n }\n}\n\nexport const has = (obj, property) => {\n //has checks if object has a direct property\n return obj.hasOwnProperty(property)\n}\n\nexport const isArray = (arr) => {\n if (!arr || (typeof(arr) !== 'object')){\n return false\n }\n return Array.isArray(arr)\n}\n\nexport const isEmpty = (obj) => {\n // note this method only checks for empty objects, strings and arrays, does not check for sets or maps\n if (!obj || !['object','string'].includes(typeof(obj))){\n return true\n }\n if (Object.keys(obj).length > 0){\n return false\n }else{\n return true\n }\n}\n\nexport const filter = (obj, callback) => {\n if (!obj || (typeof(obj) !== 'object')){\n return []\n }\n if (Array.isArray(obj)){\n return obj.filter(callback)\n }else{\n return Object.keys(obj).filter(key=>{\n return callback(obj[key], key)\n })\n }\n}\n\nexport const map = (obj, callback) => {\n // map iterates thru array and objects as well\n if (!obj || (typeof(obj) !== 'object')){\n return []\n }\n if (Array.isArray(obj)){\n return obj.map(callback)\n }else{\n return Object.keys(obj).map(key=>{\n return callback(obj[key], key)\n })\n }\n}\n\nexport const remove = (obj, callback) => {\n //remove element from array based on callback\n if (!obj || (typeof(obj) !== 'object')){\n return []\n }\n for (let i = obj.length - 1; i >= 0; --i){\n let item = obj[i]\n if (callback(item)){\n obj.splice(obj.indexOf(item),1)\n }\n }\n return obj\n}\n\nexport const times = (n, callback) => {\n // times executes a function n times returns the array of results\n let arr = []\n for (;arr.length < n;){\n let result = callback()\n arr.push(result)\n }\n return arr\n}\n\nexport const includes = (obj, item) => {\n // includes checks if value is in array, obj value or substring\n if (!obj || !['object','string'].includes(typeof(obj))){\n return false\n }\n if (typeof(obj) ==='object' && !Array.isArray(obj)){\n return Object.keys(obj).some(key => (obj[key]===item))\n }else{\n return obj.includes(item)\n }\n}\n\nexport const get = (obj, path, defaultValue) => {\n return String(path).split('.').reduce((acc, v) => {\n try {\n acc = acc[v] || defaultValue\n } catch (e) {\n return defaultValue\n }\n return acc\n }, obj)\n}\n\n// methods still using lodash isEqual, throttle, debounce\nexport const isEqual = lodashIsEqual\nexport const debounce = lodashDebounce\nexport const throttle = lodashThrottle\n\n\n// console.log(`empty --> isEmpty([1,2,3])`,isEmpty([1,2,3]))\n// console.log(`empty --> isEmpty({})`,isEmpty({}))\n// console.log('times --> times(3,()=>{return 1+1})', times(3,()=>{return 1+1}))\n// console.log(\"get --> get({r:5}, 'r', 34)\", get({r:5}, 'r', 34))\n// console.log(\"get --> get({r:5}, 'rx', 34)\", get({r:5}, 'rx', 34))\n// console.log(\"includes --> includes('Hello world','wor')\",includes('Hello world','wor'))\n// let test = {hi:1, bye:'hello'}\n// console.log(filter(test, (value,key)=>{\n// return value === 'hello'}))\n// console.log(filter([1,2,3,4,5], (item,i)=>{return item>3}))\n// test = {hi:'hello', bye:'bye'}\n// console.log(\"map map(newtest, (val,key)=>{return `${key}-${val}`})\", map(test, (val,key)=>{return `${key}-${val}`}))\n// test = [1,2,3,1,3,4]\n// console.log('remove',remove(test, item=>item<3))","import React, { Component } from \"react\";\nimport { connect } from \"react-redux\";\nimport * as _ from \"../../utils/janioDash\";\n\nclass InputField extends Component {\n constructor(props) {\n super(props);\n this.state = {\n typed: false,\n };\n }\n\n handleOnChange = (e) => {\n if (_.has(this.props, \"onChange\")) {\n this.props.onChange(e);\n this.setState({\n typed: true,\n });\n }\n };\n\n handleKeyUp = (e) => {\n if (_.has(this.props, \"onKeyUp\")) {\n this.props.onKeyUp(e);\n this.setState({\n typed: true,\n });\n }\n };\n\n render() {\n const { fieldName, name, type, stateValue, optional, disabled, placeholder, errorMessage } = this.props;\n\n let error = false;\n if (!optional) {\n error = !stateValue || stateValue.length === 0;\n }\n\n let message = `Please enter ${fieldName}`;\n if (errorMessage) {\n message = errorMessage;\n }\n\n return (\n
\n
\n \n {type === \"textarea\" ? (\n this.handleOnChange(e)}\n />\n ) : (\n this.handleOnChange(e)}\n onKeyUp={(e) => this.handleKeyUp(e)}\n />\n )}\n
\n\n {(error && this.state.typed && !optional) || errorMessage ? (\n
\n {message}\n
\n ) : null}\n
\n );\n }\n}\n\nfunction mapStateToProps() {\n return {};\n}\n\nexport default connect(mapStateToProps, {})(InputField);\n","module.exports = __webpack_public_path__ + \"static/media/janio-main-logo.bf8101f3.svg\";","import React, { Component } from \"react\";\nimport { connect } from \"react-redux\";\nimport {NavLink} from 'react-router-dom';\nimport {\n signinUser,\n clearAuthErrors\n} from '../../../actions/commonActions/authActions';\nimport { history } from \"../../../utils/historyUtils\";\n\nimport InputField from '../../common/InputField';\n\nimport img from '../../../images/janio-main-logo.svg';\n\nclass Signin extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: false,\n clicked: false,\n\n username: '',\n password: '',\n };\n }\n\n componentDidMount() {\n\n }\n\n componentDidUpdate() {\n if (this.props.error !== this.state.error) {\n this.setState({\n error: this.props.error,\n clicked: false\n });\n }\n }\n\n handleOnChange(e) {\n this.props.clearAuthErrors();\n this.setState({\n clicked: false\n });\n\n const { name, value } = e.target;\n this.setState({ [name]: value });\n }\n\n handleKeyUp(e) {\n if (e.keyCode === 13 || e.which === 13) {\n if (this.state.username.length > 0 && this.state.password.length > 0) {\n this.handleLogin();\n }\n }\n }\n\n handleLogin = () => {\n this.props.clearAuthErrors();\n this.setState({\n clicked: true\n });\n\n this.props.signinUser(this.state.username, this.state.password, history);\n }\n\n render() {\n return (\n
\n
\n \n
\n\n
\n\n
\n\n
\n \n \n\n {\n this.state.error ?\n
\n Wrong username/password combination.\n
\n :\n null\n }\n\n {\n !this.state.clicked ?\n \n :\n \n Logging In...\n \n }\n \n
forgot password?
\n
\n
\n
\n
\n );\n }\n}\n\nfunction mapStateToProps({auth}) {\n return ({\n error: auth.error\n });\n}\n\nexport default connect(mapStateToProps, {\n signinUser,\n clearAuthErrors\n})(Signin);\n"],"sourceRoot":""}