Commit e7319387 authored by Mathias Engelbrecht Pilegård's avatar Mathias Engelbrecht Pilegård
Browse files

Merge branch 'addLogin' into 'master'

Add login

See merge request au593919/pipit!1
parents 0d588800 2c3853a1
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n // Submit ok modal\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);\n const submitOkModalRef = useRef(null);\n\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form\n\n\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => {\n showForgotPasswordForm(!forgotPasswordFormVisibilityState);\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n useEffect(() => {\n const pageClickEvent = e => {\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\n toggleSubmitOkModalVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (submitOkModalVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [submitOkModalVisibilityState]);\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = () => {\n fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error: something went wrong\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n toggleSubmitOkModalVisible();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 7\n }, this), submitOkModalVisibilityState && /*#__PURE__*/_jsxDEV(MessageModal, {\n ref: submitOkModalRef,\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"JewdldMzKvoWUXPBjhAQ4J+HRI8=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","submitOkModalVisibilityState","showSubmitOkModal","submitOkModalRef","toggleSubmitOkModalVisible","forgotPasswordFormVisibilityState","showForgotPasswordForm","forgotPasswordFormRef","toggleForgotPasswordFormVisible","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","fetch","serviceAPI","ForgotPasswordURL","then","res","ok","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDR,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMS,gBAAgB,GAAGR,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMS,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJgC,CAMhC;;;AACA,QAAM,CAACI,iCAAD,EAAoCC,sBAApC,IAA8DZ,QAAQ,CAAC,KAAD,CAA5E;AACA,QAAMa,qBAAqB,GAAGZ,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMa,+BAA+B,GAAG,MAAM;AAC5CF,IAAAA,sBAAsB,CAAC,CAACD,iCAAF,CAAtB;AACD,GAFD;;AAIA,QAAM,CAACI,QAAD,EAAWC,WAAX,IAA0BhB,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMiB,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CAAC,CAACC,MAAF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A,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,EA+BGV,4BAA4B,iBAC3B,QAAC,YAAD;AAAc,MAAA,GAAG,EAAEE,gBAAnB;AAAqC,MAAA,aAAa,EAAE,kBAApD;AAAwE,MAAA,WAAW,EAAE;AAArF;AAAA;AAAA;AAAA;AAAA,YAhCJ;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CApHD;;GAAMH,mB;;KAAAA,mB;AAsHN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = () => {\r\n // Submit ok modal\r\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)\r\n const submitOkModalRef = useRef(null)\r\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)\r\n\r\n // Forgot password form\r\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => {\r\n showForgotPasswordForm(!forgotPasswordFormVisibilityState)\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (submitOkModalVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [submitOkModalVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = () => {\r\n fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error: something went wrong\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n {submitOkModalVisibilityState && (\r\n <MessageModal ref={submitOkModalRef} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n )}\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"import compareAscending from './_compareAscending.js';\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n\n\n return object.index - other.index;\n}\n\nexport default compareMultiple;","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/node_modules/lodash-es/_compareMultiple.js"],"names":["compareAscending","compareMultiple","object","other","orders","index","objCriteria","criteria","othCriteria","length","ordersLength","result","order"],"mappings":"AAAA,OAAOA,gBAAP,MAA6B,wBAA7B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,eAAT,CAAyBC,MAAzB,EAAiCC,KAAjC,EAAwCC,MAAxC,EAAgD;AAC9C,MAAIC,KAAK,GAAG,CAAC,CAAb;AAAA,MACIC,WAAW,GAAGJ,MAAM,CAACK,QADzB;AAAA,MAEIC,WAAW,GAAGL,KAAK,CAACI,QAFxB;AAAA,MAGIE,MAAM,GAAGH,WAAW,CAACG,MAHzB;AAAA,MAIIC,YAAY,GAAGN,MAAM,CAACK,MAJ1B;;AAMA,SAAO,EAAEJ,KAAF,GAAUI,MAAjB,EAAyB;AACvB,QAAIE,MAAM,GAAGX,gBAAgB,CAACM,WAAW,CAACD,KAAD,CAAZ,EAAqBG,WAAW,CAACH,KAAD,CAAhC,CAA7B;;AACA,QAAIM,MAAJ,EAAY;AACV,UAAIN,KAAK,IAAIK,YAAb,EAA2B;AACzB,eAAOC,MAAP;AACD;;AACD,UAAIC,KAAK,GAAGR,MAAM,CAACC,KAAD,CAAlB;AACA,aAAOM,MAAM,IAAIC,KAAK,IAAI,MAAT,GAAkB,CAAC,CAAnB,GAAuB,CAA3B,CAAb;AACD;AACF,GAhB6C,CAiB9C;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAOV,MAAM,CAACG,KAAP,GAAeF,KAAK,CAACE,KAA5B;AACD;;AAED,eAAeJ,eAAf","sourcesContent":["import compareAscending from './_compareAscending.js';\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nexport default compareMultiple;\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"import _default from './Container';\nexport { _default as default };","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/node_modules/semantic-ui-react/dist/es/elements/Container/index.js"],"names":["_default","default"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,aAArB;AACA,SAASA,QAAQ,IAAIC,OAArB","sourcesContent":["import _default from './Container';\nexport { _default as default };"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n // Submit ok modal\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);\n const submitOkModalRef = useRef(null);\n\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form\n\n\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => {\n showForgotPasswordForm(!forgotPasswordFormVisibilityState);\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n useEffect(() => {\n const pageClickEvent = e => {\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\n toggleSubmitOkModalVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (submitOkModalVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [submitOkModalVisibilityState]);\n const userInputData = JSON.stringify({\n firstname: '',\n lastname: '',\n email: `${username}`,\n password: ''\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = () => {\n fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error: something went wrong\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n toggleSubmitOkModalVisible();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${submitOkModalVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: submitOkModalRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"submitOkModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Email submitted!\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 125,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: \"Ok\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 128,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"JewdldMzKvoWUXPBjhAQ4J+HRI8=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","PasswordForgotModal","submitOkModalVisibilityState","showSubmitOkModal","submitOkModalRef","toggleSubmitOkModalVisible","forgotPasswordFormVisibilityState","showForgotPasswordForm","forgotPasswordFormRef","toggleForgotPasswordFormVisible","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","stringify","firstname","lastname","email","password","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","fetch","serviceAPI","ForgotPasswordURL","then","res","ok","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDP,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMQ,gBAAgB,GAAGP,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMQ,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJgC,CAMhC;;;AACA,QAAM,CAACI,iCAAD,EAAoCC,sBAApC,IAA8DX,QAAQ,CAAC,KAAD,CAA5E;AACA,QAAMY,qBAAqB,GAAGX,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMY,+BAA+B,GAAG,MAAM;AAC5CF,IAAAA,sBAAsB,CAAC,CAACD,iCAAF,CAAtB;AACD,GAFD;;AAIA,QAAM,CAACI,QAAD,EAAWC,WAAX,IAA0Bf,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMgB,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIAjB,EAAAA,SAAS,CAAC,MAAM;A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,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eAiCE;AAAK,MAAA,SAAS,EAAG,SAAQV,4BAA4B,GAAG,QAAH,GAAc,UAAW,EAA9E;AAAA,6BACE;AAAK,QAAA,GAAG,EAAEE,gBAAV;AAA4B,QAAA,SAAS,EAAC,eAAtC;AAAA,+BACE;AAAK,UAAA,SAAS,EAAC,eAAf;AAAA,kCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF,eAKE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjCF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkDD,CAnID;;GAAMH,mB;;KAAAA,mB;AAqIN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\n\r\nconst PasswordForgotModal = () => {\r\n // Submit ok modal\r\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)\r\n const submitOkModalRef = useRef(null)\r\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)\r\n\r\n // Forgot password form\r\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => {\r\n showForgotPasswordForm(!forgotPasswordFormVisibilityState)\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (submitOkModalVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [submitOkModalVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: '',\r\n lastname: '',\r\n email: `${username}`,\r\n password: ''\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = () => {\r\n fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error: something went wrong\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* SubmitOk modal */}\r\n <div className={`modal ${submitOkModalVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={submitOkModalRef} className=\"modal-content\">\r\n <div className=\"submitOkModal\">\r\n <h2>Email submitted!</h2>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = ({\n userInfo\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const accessToken = oktaAuth.getAccessToken();\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const [confirmNewPassword, setConfirmNewPassword] = useState(null);\n\n const handleOldPasswordChange = e => {\n setOldPassword(e.target.value);\n };\n\n const handleNewPasswordChange = e => {\n setNewPassword(e.target.value);\n };\n\n const handleConfirmNewPasswordChange = e => {\n setConfirmNewPassword(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n oldPassword: `${oldPassword}`,\n newPassword: `${newPassword}`\n });\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: userInputData\n };\n\n const handleChangePasswordFormSubmit = e => {\n e.preventDefault();\n\n if (!oldPassword || !newPassword || !confirmNewPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmNewPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(newPassword == confirmNewPassword)) {\n window.alert(\"Passwords do not match\");\n return;\n } else {\n fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Old password is not correct\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n setSubmitOkMessageModalState(true);\n }\n });\n }\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"oldPassword\",\n type: \"password\",\n value: oldPassword,\n onChange: handleOldPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"newPassword\",\n type: \"password\",\n value: newPassword,\n onChange: handleNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"confirmNewPassword\",\n type: \"password\",\n value: confirmNewPassword,\n onChange: handleConfirmNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 126,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(MessageModal, {\n removeModal: () => setSubmitOkMessageModalState(false),\n headerMessage: \"Password has been changed\",\n bodyMessage: \"You can now sign in using your new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 132,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"IFh0de2or+oR0L9rclAKOf5gZnU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","MessageModal","config","ChangePassword","userInfo","authState","oktaAuth","accessToken","getAccessToken","submitOkMessageModalState","setSubmitOkMessageModalState","oldPassword","setOldPassword","newPassword","setNewPassword","confirmNewPassword","setConfirmNewPassword","handleOldPasswordChange","e","target","value","handleNewPasswordChange","handleConfirmNewPasswordChange","userInputData","JSON","stringify","email","ChangePasswordRequestOptions","method","headers","Authorization","body","handleChangePasswordFormSubmit","preventDefault","window","alert","length","fetch","serviceAPI","changePasswordURL","then","res","ok","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,cAAc,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkB;AAAA;;AACvC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAA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AA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAwDE;AAAK,MAAA,SAAS,EAAG,SAAQb,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,2BAArF;AAAkH,QAAA,WAAW,EAAE;AAA/H;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAxDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA8DD,CAlID;;GAAMP,c;UAC4BJ,W;;;KAD5BI,c;AAoIN,eAAeA,cAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\nimport config from '../../config';\r\n\r\nconst ChangePassword = ({ userInfo }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const accessToken = oktaAuth.getAccessToken();\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n const [confirmNewPassword, setConfirmNewPassword] = useState(null)\r\n\r\n const handleOldPasswordChange = (e) => {\r\n setOldPassword(e.target.value)\r\n }\r\n\r\n const handleNewPasswordChange = (e) => {\r\n setNewPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmNewPasswordChange = (e) => {\r\n setConfirmNewPassword(e.target.value);\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${userInfo && userInfo.email}`,\r\n oldPassword: `${oldPassword}`,\r\n newPassword: `${newPassword}`\r\n })\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: userInputData\r\n }\r\n\r\n const handleChangePasswordFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!oldPassword || !newPassword || !confirmNewPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmNewPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(newPassword == confirmNewPassword)) {\r\n window.alert(\"Passwords do not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Old password is not correct\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n setSubmitOkMessageModalState(true)\r\n }\r\n })\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input\r\n id=\"oldPassword\" type=\"password\"\r\n value={oldPassword}\r\n onChange={handleOldPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input\r\n id=\"newPassword\" type=\"password\"\r\n value={newPassword}\r\n onChange={handleNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input\r\n id=\"confirmNewPassword\" type=\"password\"\r\n value={confirmNewPassword}\r\n onChange={handleConfirmNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Password has been changed\"} bodyMessage={\"You can now sign in using your new password\"} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"export default {\n oidc: {\n clientId: '0oa1f4zfeiiZPB6DF5d7',\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\n redirectUri: 'localhost:3000/login/callback',\n scopes: ['openid', 'profile', 'email'],\n pkce: true\n }\n};","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/config.js"],"names":["oidc","clientId","issuer","redirectUri","scopes","pkce"],"mappings":"AAAA,eAAe;AACbA,EAAAA,IAAI,EAAE;AACJC,IAAAA,QAAQ,EAAE,sBADN;AAEJC,IAAAA,MAAM,EAAE,8CAFJ;AAGJC,IAAAA,WAAW,EAAE,+BAHT;AAIJC,IAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,SAAX,EAAsB,OAAtB,CAJJ;AAKJC,IAAAA,IAAI,EAAE;AALF;AADO,CAAf","sourcesContent":["export default {\r\n oidc: {\r\n clientId: '0oa1f4zfeiiZPB6DF5d7',\r\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\r\n redirectUri: 'localhost:3000/login/callback',\r\n scopes: ['openid', 'profile', 'email'],\r\n pkce: true\r\n }\r\n};"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"import isSymbol from './isSymbol.js';\n/** Used as references for various `Number` constants. */\n\nvar INFINITY = 1 / 0;\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n\n var result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result;\n}\n\nexport default toKey;","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/node_modules/lodash-es/_toKey.js"],"names":["isSymbol","INFINITY","toKey","value","result"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,eAArB;AAEA;;AACA,IAAIC,QAAQ,GAAG,IAAI,CAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,KAAT,CAAeC,KAAf,EAAsB;AACpB,MAAI,OAAOA,KAAP,IAAgB,QAAhB,IAA4BH,QAAQ,CAACG,KAAD,CAAxC,EAAiD;AAC/C,WAAOA,KAAP;AACD;;AACD,MAAIC,MAAM,GAAID,KAAK,GAAG,EAAtB;AACA,SAAQC,MAAM,IAAI,GAAV,IAAkB,IAAID,KAAL,IAAe,CAACF,QAAlC,GAA8C,IAA9C,GAAqDG,MAA5D;AACD;;AAED,eAAeF,KAAf","sourcesContent":["import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"import baseForOwn from './_baseForOwn.js';\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n\nfunction baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function (value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n}\n\nexport default baseInverter;","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/node_modules/lodash-es/_baseInverter.js"],"names":["baseForOwn","baseInverter","object","setter","iteratee","accumulator","value","key"],"mappings":"AAAA,OAAOA,UAAP,MAAuB,kBAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT,CAAsBC,MAAtB,EAA8BC,MAA9B,EAAsCC,QAAtC,EAAgDC,WAAhD,EAA6D;AAC3DL,EAAAA,UAAU,CAACE,MAAD,EAAS,UAASI,KAAT,EAAgBC,GAAhB,EAAqBL,MAArB,EAA6B;AAC9CC,IAAAA,MAAM,CAACE,WAAD,EAAcD,QAAQ,CAACE,KAAD,CAAtB,EAA+BC,GAA/B,EAAoCL,MAApC,CAAN;AACD,GAFS,CAAV;AAGA,SAAOG,WAAP;AACD;;AAED,eAAeJ,YAAf","sourcesContent":["import baseForOwn from './_baseForOwn.js';\n\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n}\n\nexport default baseInverter;\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"import getNative from './_getNative.js';\nimport root from './_root.js';\n/* Built-in method references that are verified to be native. */\n\nvar WeakMap = getNative(root, 'WeakMap');\nexport default WeakMap;","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/node_modules/lodash-es/_WeakMap.js"],"names":["getNative","root","WeakMap"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,iBAAtB;AACA,OAAOC,IAAP,MAAiB,YAAjB;AAEA;;AACA,IAAIC,OAAO,GAAGF,SAAS,CAACC,IAAD,EAAO,SAAP,CAAvB;AAEA,eAAeC,OAAf","sourcesContent":["import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n toggleForgotPasswordFormVisible();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(MessageModal, {\n removeModal: () => setSubmitOkMessageModalState(false),\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"g4WkMIawwrBahYMYonVecg/0JA0=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","forgotPasswordFormVisibilityState","setForgotPasswordFormVisibilityState","forgotPasswordFormRef","toggleForgotPasswordFormVisible","submitOkMessageModalState","setSubmitOkMessageModalState","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC,QAAM,CAACC,iCAAD,EAAoCC,oCAApC,IAA4ER,QAAQ,CAAC,KAAD,CAA1F;AACA,QAAMS,qBAAqB,GAAGR,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMS,+BAA+B,GAAG,MAAMF,oCAAoC,CAAC,CAACD,iCAAF,CAAlF;;AAEA,QAAM,CAACI,yBAAD,EAA4BC,4BAA5B,IAA4DZ,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;;AACA,QAAMe,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIAhB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config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = () => {\r\n const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)\r\n\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n toggleForgotPasswordFormVisible()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const removeAccountRequestOptions = {\n method: 'DELETE',\n body: userInfo && JSON.stringify({\n email: `${userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(userInfo);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {// oktaAuth.signOut()\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: \"Yes\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAAP;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,yBAAyB,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AAAA;;AACjF,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BV,QAAQ,CAAC,IAAD,CAAxC;;AAEA,QAAMW,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIAd,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACQ,SAAS,CAACO,eAAf,EAAgC;AAC9B;AACAJ,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACO,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BP,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AAA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAkBD,CAjED;;GAAMrB,yB;UAC4BF,W;;;KAD5BE,yB;AAmEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n body:\r\n userInfo && (\r\n JSON.stringify(\r\n {\r\n email: `${userInfo.email}`,\r\n }\r\n )\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(userInfo)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n // oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useInput } from '../../../util/useInput';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n value: firstName,\n bind: bindFirstName,\n reset: resetFirstName\n } = useInput('');\n const {\n value: lastName,\n bind: bindLastName,\n reset: resetLastName\n } = useInput('');\n const {\n value: email,\n bind: bindEmail,\n reset: resetEmail\n } = useInput('');\n const {\n value: password,\n bind: bindPassword,\n reset: resetPassword\n } = useInput('');\n const user = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: user\n }).then(response => {\n if (!response.ok) {\n return Promise.reject();\n }\n\n return response.json();\n });\n alert(`Submitting user `);\n resetFirstName();\n resetLastName();\n resetEmail();\n resetPassword();\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Fist name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindFirstName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindLastName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindEmail\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\",\n ...bindPassword\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"qBcPMosoFn1+k0tawoNFrCnYMDg=\", false, function () {\n return [useInput, useInput, useInput, useInput];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useInput","NavLink","config","SignUp","value","firstName","bind","bindFirstName","reset","resetFirstName","lastName","bindLastName","resetLastName","email","bindEmail","resetEmail","password","bindPassword","resetPassword","user","JSON","stringify","FirstName","LastName","Email","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","method","headers","body","then","response","ok","Promise","reject","json","alert"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,KAAK,EAAEC,SAAT;AAAoBC,IAAAA,IAAI,EAAEC,aAA1B;AAAyCC,IAAAA,KAAK,EAAEC;AAAhD,MAAmET,QAAQ,CAAC,EAAD,CAAjF;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAEM,QAAT;AAAmBJ,IAAAA,IAAI,EAAEK,YAAzB;AAAuCH,IAAAA,KAAK,EAAEI;AAA9C,MAAgEZ,QAAQ,CAAC,EAAD,CAA9E;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAES,KAAT;AAAgBP,IAAAA,IAAI,EAAEQ,SAAtB;AAAiCN,IAAAA,KAAK,EAAEO;AAAxC,MAAuDf,QAAQ,CAAC,EAAD,CAArE;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAEY,QAAT;AAAmBV,IAAAA,IAAI,EAAEW,YAAzB;AAAuCT,IAAAA,KAAK,EAAEU;AAA9C,MAAgElB,QAAQ,CAAC,EAAD,CAA9E;AAEA,QAAMmB,IAAI,GAAGC,IAAI,CAACC,SAAL,CAAe;AAC1BC,IAAAA,SAAS,EAAG,GAAEjB,SAAU,EADE;AAE1BkB,IAAAA,QAAQ,EAAG,GAAEb,QAAS,EAFI;AAG1Bc,IAAAA,KAAK,EAAG,GAAEX,KAAM,EAHU;AA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,YAAA,IAAI,EAAC,MADP;AAAA,eACkBI;AADlB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF,eAUE;AAAA,4CAEE;AACE,YAAA,IAAI,EAAC,MADP;AAAA,eACkBG;AADlB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAVF,eAeE;AAAA,+CAEE;AACE,YAAA,IAAI,EAAC,UADP;AAAA,eACsBG;AADtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF,eAoBE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBApBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eA2BE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cA3BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA6CD,CA9ED;;GAAMd,M;UACqEH,Q,EACHA,Q,EACTA,Q,EACSA,Q;;;KAJlEG,M;AAgFN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useInput } from '../../../util/useInput'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { value: firstName, bind: bindFirstName, reset: resetFirstName } = useInput('')\r\n const { value: lastName, bind: bindLastName, reset: resetLastName } = useInput('')\r\n const { value: email, bind: bindEmail, reset: resetEmail } = useInput('')\r\n const { value: password, bind: bindPassword, reset: resetPassword } = useInput('')\r\n\r\n const user = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n fetch(config.serviceAPI.createNewUserURL, {\r\n method: 'POST',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: user,\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n return Promise.reject();\r\n }\r\n return response.json();\r\n })\r\n alert(`Submitting user `);\r\n resetFirstName()\r\n resetLastName()\r\n resetEmail()\r\n resetPassword()\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n Fist name:\r\n <input type=\"text\" {...bindFirstName} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" {...bindLastName} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" {...bindEmail} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" {...bindPassword} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = ({\n removeFormModal\n}) => {\n _s();\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n removeFormModal();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-background\",\n onClick: e => removeFormModal(),\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"ccs9TXv4Z39DCQsrqL8dXg2nBZI=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","removeFormModal","submitOkMessageModalState","setSubmitOkMessageModalState","stopProp","e","stopPropagation","username","setUsername","handleUsernameChange","target","value","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,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AAA;AAAA;AAAA,gBADF,eAEE;AAAM,UAAA,QAAQ,EAAEkB,oBAAhB;AAAA,kCACE;AAAA,8CAEE;AACE,cAAA,EAAE,EAAC,OADL;AACa,cAAA,IAAI,EAAC,MADlB;AAEE,cAAA,KAAK,EAAEZ,QAFT;AAGE,cAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAQE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA,sDAEE,QAAC,eAAD;AAAiB,cAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAyBD,CAhED;;GAAMT,mB;;KAAAA,mB;AAkEN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = ({ removeFormModal }) => {\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n removeFormModal()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div className=\"modal-background\" onClick={e => removeFormModal()}>\r\n <div className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n {/* <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div> */}\r\n </div>\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\updateUserData\\\\UpdateUserData.js\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport UpdateUserDataModal from '../../components/updateUserData/updateUserDataModal/UpdateUserDataModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst UpdateUserData = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false);\n\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setName(userInfo.name);\n userInfo && setEmail(userInfo.email);\n }, [userInfo]);\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleUpdateUserDataModalState,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? name : \"Fetching name\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? email : \"Fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(UpdateUserDataModal, {\n removeModal: () => setUpdateUserDataModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 5\n }, this);\n};\n\n_s(UpdateUserData, \"TVJKyWZdBHB4T7R5lFB40t17n2E=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = UpdateUserData;\nexport default UpdateUserData;\n\nvar _c;\n\n$RefreshReg$(_c, \"UpdateUserData\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/updateUserData/UpdateUserData.js"],"names":["React","useEffect","useState","FontAwesomeIcon","useOktaAuth","UpdateUserDataModal","UpdateUserData","authState","oktaAuth","userInfo","setUserInfo","name","setName","email","setEmail","updateUserDataModalState","setUpdateUserDataModalState","toggleUpdateUserDataModalState","isAuthenticated","getUser","then","info"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,mBAAP,MAAgC,yEAAhC;;;AAEA,MAAMC,cAAc,GAAG,MAAM;AAAA;;AAC3B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BR,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAM,CAACS,IAAD,EAAOC,OAAP,IAAkBV,QAAQ,CAAC,EAAD,CAAhC;AACA,QAAM,CAACW,KAAD,EAAQC,QAAR,IAAoBZ,QAAQ,CAAC,EAAD,CAAlC;AAEA,QAAM,CAACa,wBAAD,EAA2BC,2BAA3B,IAA0Dd,QAAQ,CAAC,KAAD,CAAxE;;AACA,QAAMe,8BAA8B,GAAG,MAAMD,2BAA2B,CAAC,CAACD,wBAAF,CAAxE;;AAEAd,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACM,SAAS,CAACW,eAAf,EAAgC;AAC9B;AACAR,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO,IAAIH,SAAS,CAACW,eAAV,IAA6BH,wBAAwB,IAAI,KAA7D,EAAoE;AACzEP,MAAAA,QAAQ,CAACW,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BX,QAAAA,WAAW,CAACW,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAACd,SAAD,EAAYC,QAAZ,EAAsBO,wBAAtB,CATM,CAAT,CAV2B,CAmB0B;;A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,6BACE,QAAC,mBAAD;AAAqB,QAAA,WAAW,EAAE,MAAMC,2BAA2B,CAAC,KAAD;AAAnE;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAzBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA+BD,CA9DD;;GAAMV,c;UAC4BF,W;;;KAD5BE,c;AAgEN,eAAeA,cAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport UpdateUserDataModal from '../../components/updateUserData/updateUserDataModal/UpdateUserDataModal';\r\n\r\nconst UpdateUserData = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [name, setName] = useState('')\r\n const [email, setEmail] = useState('');\r\n\r\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false)\r\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState)\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setName(userInfo.name)\r\n )\r\n\r\n userInfo && (\r\n setEmail(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n return (\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button onClick={toggleUpdateUserDataModalState}>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? name : \"Fetching name\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? email : \"Fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n <div className={`modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`}>\r\n <UpdateUserDataModal removeModal={() => setUpdateUserDataModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default UpdateUserData\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getUnhandledProps } from '../../lib';\nimport TableHeader from './TableHeader';\n/**\n * A table can have a footer.\n */\n\nfunction TableFooter(props) {\n var as = props.as;\n var rest = getUnhandledProps(TableFooter, props);\n return /*#__PURE__*/React.createElement(TableHeader, _extends({}, rest, {\n as: as\n }));\n}\n\nTableFooter.handledProps = [\"as\"];\nTableFooter.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType\n} : {};\nTableFooter.defaultProps = {\n as: 'tfoot'\n};\nexport default TableFooter;","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/node_modules/semantic-ui-react/dist/es/collections/Table/TableFooter.js"],"names":["_extends","PropTypes","React","getUnhandledProps","TableHeader","TableFooter","props","as","rest","createElement","handledProps","propTypes","process","env","NODE_ENV","elementType","defaultProps"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,iBAAT,QAAkC,WAAlC;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA;AACA;AACA;;AAEA,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AAC1B,MAAIC,EAAE,GAAGD,KAAK,CAACC,EAAf;AACA,MAAIC,IAAI,GAAGL,iBAAiB,CAACE,WAAD,EAAcC,KAAd,CAA5B;AACA,SAAO,aAAaJ,KAAK,CAACO,aAAN,CAAoBL,WAApB,EAAiCJ,QAAQ,CAAC,EAAD,EAAKQ,IAAL,EAAW;AACtED,IAAAA,EAAE,EAAEA;AADkE,GAAX,CAAzC,CAApB;AAGD;;AAEDF,WAAW,CAACK,YAAZ,GAA2B,CAAC,IAAD,CAA3B;AACAL,WAAW,CAACM,SAAZ,GAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GAAwC;AAC9D;AACAP,EAAAA,EAAE,EAAEN,SAAS,CAACc;AAFgD,CAAxC,GAGpB,EAHJ;AAIAV,WAAW,CAACW,YAAZ,GAA2B;AACzBT,EAAAA,EAAE,EAAE;AADqB,CAA3B;AAGA,eAAeF,WAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { getUnhandledProps } from '../../lib';\nimport TableHeader from './TableHeader';\n/**\n * A table can have a footer.\n */\n\nfunction TableFooter(props) {\n var as = props.as;\n var rest = getUnhandledProps(TableFooter, props);\n return /*#__PURE__*/React.createElement(TableHeader, _extends({}, rest, {\n as: as\n }));\n}\n\nTableFooter.handledProps = [\"as\"];\nTableFooter.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType\n} : {};\nTableFooter.defaultProps = {\n as: 'tfoot'\n};\nexport default TableFooter;"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment