diff --git a/core/Configuration/CreateDatabase.class.php b/core/Configuration/CreateDatabase.class.php
index e06b842..d18bce5 100755
--- a/core/Configuration/CreateDatabase.class.php
+++ b/core/Configuration/CreateDatabase.class.php
@@ -224,7 +224,7 @@ class CreateDatabase {
private static function MessageResetPassword() : string {
return "Hello {{username}},
" .
- "you requested a password reset on {{sitename}}. Please click on the following link to " .
+ "you requested a password reset on {{site_name}}. Please click on the following link to " .
"choose a new password. If this request was not intended, you can simply ignore the email. The Link is valid for one hour:
" .
"{{link}}
" .
"Best Regards
" .
diff --git a/js/admin.min.js b/js/admin.min.js
index e6edf1b..336b696 100644
--- a/js/admin.min.js
+++ b/js/admin.min.js
@@ -11463,7 +11463,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Settings; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.js\");\n/* harmony import */ var react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-collapse/lib/Collapse */ \"./node_modules/react-collapse/lib/Collapse.js\");\n/* harmony import */ var react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! draft-js */ \"./node_modules/draft-js/lib/Draft.js\");\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(draft_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-draft-wysiwyg */ \"./node_modules/react-draft-wysiwyg/dist/react-draft-wysiwyg.js\");\n/* harmony import */ var react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var draftjs_to_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! draftjs-to-html */ \"./node_modules/draftjs-to-html/lib/draftjs-to-html.js\");\n/* harmony import */ var draftjs_to_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(draftjs_to_html__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var html_to_draftjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! html-to-draftjs */ \"./node_modules/html-to-draftjs/dist/html-to-draftjs.js\");\n/* harmony import */ var html_to_draftjs__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(html_to_draftjs__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var sanitize_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! sanitize-html */ \"./node_modules/sanitize-html/dist/sanitize-html.js\");\n/* harmony import */ var sanitize_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(sanitize_html__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var react_draft_wysiwyg_dist_react_draft_wysiwyg_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-draft-wysiwyg/dist/react-draft-wysiwyg.css */ \"./node_modules/react-draft-wysiwyg/dist/react-draft-wysiwyg.css\");\n/* harmony import */ var react_draft_wysiwyg_dist_react_draft_wysiwyg_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_draft_wysiwyg_dist_react_draft_wysiwyg_css__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-tooltip */ \"./node_modules/react-tooltip/dist/index.es.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Settings = /*#__PURE__*/function (_React$Component) {\n _inherits(Settings, _React$Component);\n\n var _super = _createSuper(Settings);\n\n function Settings(props) {\n var _this;\n\n _classCallCheck(this, Settings);\n\n _this = _super.call(this, props);\n _this.state = {\n errors: [],\n settings: {},\n general: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n keys: [\"site_name\", \"base_url\", \"user_registration_enabled\"]\n },\n mail: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n isSending: false,\n test_email: \"\",\n unsavedMailSettings: false,\n keys: [\"mail_enabled\", \"mail_host\", \"mail_port\", \"mail_username\", \"mail_password\", \"mail_from\"]\n },\n messages: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n editor: draft_js__WEBPACK_IMPORTED_MODULE_5__[\"EditorState\"].createEmpty(),\n isEditing: null,\n keys: [\"message_confirm_email\", \"message_accept_invite\", \"message_reset_password\"]\n },\n recaptcha: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n keys: [\"recaptcha_enabled\", \"recaptcha_public_key\", \"recaptcha_private_key\"]\n },\n uncategorised: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n settings: []\n }\n };\n _this.parent = {\n api: props.api,\n showDialog: props.showDialog\n };\n _this.hiddenKeys = [\"recaptcha_private_key\", \"mail_password\", \"jwt_secret\"];\n return _this;\n }\n\n _createClass(Settings, [{\n key: \"isDefaultKey\",\n value: function isDefaultKey(key) {\n key = key.trim();\n return this.state.general.keys.includes(key) || this.state.mail.keys.includes(key) || this.state.messages.keys.includes(key) || this.state.recaptcha.keys.includes(key) || this.hiddenKeys.includes(key);\n }\n }, {\n key: \"getUncategorisedValues\",\n value: function getUncategorisedValues(res) {\n var uncategorised = [];\n\n for (var key in res.settings) {\n if (res.settings.hasOwnProperty(key) && !this.isDefaultKey(key)) {\n uncategorised.push({\n key: key,\n value: res.settings[key]\n });\n }\n }\n\n return uncategorised;\n }\n }, {\n key: \"onDeleteUncategorisedProp\",\n value: function onDeleteUncategorisedProp(index) {\n if (index < 0 || index >= this.state.uncategorised.settings.length) {\n return;\n }\n\n var props = this.state.uncategorised.settings.slice();\n props.splice(index, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n uncategorised: _objectSpread(_objectSpread({}, this.state.uncategorised), {}, {\n settings: props\n })\n }));\n }\n }, {\n key: \"onChangeUncategorisedValue\",\n value: function onChangeUncategorisedValue(event, index, isKey) {\n if (index < 0 || index >= this.state.uncategorised.settings.length) {\n return;\n }\n\n var props = this.state.uncategorised.settings.slice();\n\n if (isKey) {\n props[index].key = event.target.value;\n } else {\n props[index].value = event.target.value;\n }\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n uncategorised: _objectSpread(_objectSpread({}, this.state.uncategorised), {}, {\n settings: props\n })\n }));\n }\n }, {\n key: \"onAddUncategorisedProperty\",\n value: function onAddUncategorisedProperty() {\n var props = this.state.uncategorised.settings.slice();\n props.push({\n key: \"\",\n value: \"\"\n });\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n uncategorised: _objectSpread(_objectSpread({}, this.state.uncategorised), {}, {\n settings: props\n })\n }));\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.parent.api.getSettings().then(function (res) {\n if (res.success) {\n var newState = _objectSpread(_objectSpread({}, _this2.state), {}, {\n settings: res.settings,\n uncategorised: _objectSpread(_objectSpread({}, _this2.state.uncategorised), {}, {\n settings: _this2.getUncategorisedValues(res)\n })\n });\n\n _this2.setState(newState);\n } else {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n title: \"Error fetching settings\",\n message: res.msg\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n }\n });\n }\n }, {\n key: \"removeError\",\n value: function removeError(i) {\n var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (category) {\n if (i >= 0 && i < this.state[category].alerts.length) {\n var alerts = this.state[category].alerts.slice();\n alerts.splice(i, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n alerts: alerts\n }))));\n }\n } else {\n if (i >= 0 && i < this.state.errors.length) {\n var errors = this.state.errors.slice();\n errors.splice(i, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n errors: errors\n }));\n }\n }\n }\n }, {\n key: \"toggleCollapse\",\n value: function toggleCollapse(category) {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isOpen: !this.state[category].isOpen\n }))));\n }\n }, {\n key: \"createCard\",\n value: function createCard(category, color, icon, title, content) {\n var _this3 = this;\n\n var alerts = [];\n\n var _loop = function _loop(i) {\n alerts.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_alert__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _extends({\n key: \"alert-\" + i,\n onClose: function onClose() {\n return _this3.removeError(i, category);\n }\n }, _this3.state[category].alerts[i])));\n };\n\n for (var i = 0; i < this.state[category].alerts.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card card-\" + color,\n key: \"card-\" + category\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card-header\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this3.toggleCollapse(category);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h4\", {\n className: \"card-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n className: \"mr-2\",\n icon: icon,\n type: icon === \"google\" ? \"fab\" : \"fas\"\n }), title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"btn btn-tool btn-sm\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: this.state[category].isOpen ? \"angle-up\" : \"angle-down\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3__[\"Collapse\"], {\n isOpened: this.state[category].isOpen\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-12 col-lg-6\"\n }, alerts, content, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-secondary\",\n onClick: function onClick() {\n return _this3.onReset(category);\n },\n disabled: this.state[category].isResetting || this.state[category].isSaving\n }, this.state[category].isResetting ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Resetting\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"circle-notch\"\n })) : \"Reset\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-success ml-2\",\n onClick: function onClick() {\n return _this3.onSave(category);\n },\n disabled: this.state[category].isResetting || this.state[category].isSaving\n }, this.state[category].isSaving ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Saving\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"circle-notch\"\n })) : \"Save\")))))));\n }\n }, {\n key: \"createGeneralForm\",\n value: function createGeneralForm() {\n var _this$state$settings$, _this$state$settings$2, _this$state$settings$3;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"site_name\"\n }, \"Site Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$ = this.state.settings[\"site_name\"]) !== null && _this$state$settings$ !== void 0 ? _this$state$settings$ : \"\",\n placeholder: \"Enter a title\",\n name: \"site_name\",\n id: \"site_name\",\n onChange: this.onChangeValue.bind(this)\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"base_url\"\n }, \"Base URL\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$2 = this.state.settings[\"base_url\"]) !== null && _this$state$settings$2 !== void 0 ? _this$state$settings$2 : \"\",\n placeholder: \"Enter a url\",\n name: \"base_url\",\n id: \"base_url\",\n onChange: this.onChangeValue.bind(this)\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"user_registration_enabled\"\n }, \"User Registration\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n name: \"user_registration_enabled\",\n id: \"user_registration_enabled\",\n checked: ((_this$state$settings$3 = this.state.settings[\"user_registration_enabled\"]) !== null && _this$state$settings$3 !== void 0 ? _this$state$settings$3 : \"0\") === \"1\",\n onChange: this.onChangeValue.bind(this)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"form-check-label\",\n htmlFor: \"user_registration_enabled\"\n }, \"Allow anyone to register an account\"))));\n }\n }, {\n key: \"createMailForm\",\n value: function createMailForm() {\n var _this$state$settings$4,\n _this$state$settings$5,\n _this$state$settings$6,\n _this$state$settings$7,\n _this$state$settings$8,\n _this$state$settings$9,\n _this$state$settings$10,\n _this$state$settings$11,\n _this$state$settings$12,\n _this$state$settings$13,\n _this$state$settings$14,\n _this4 = this,\n _this$state$settings$15,\n _this$state$settings$16;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n name: \"mail_enabled\",\n id: \"mail_enabled\",\n checked: ((_this$state$settings$4 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$4 !== void 0 ? _this$state$settings$4 : \"0\") === \"1\",\n onChange: this.onChangeValue.bind(this)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"form-check-label\",\n htmlFor: \"mail_enabled\"\n }, \"Enable E-Mail service\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"hr\", {\n className: \"m-3\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_username\"\n }, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"hashtag\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$5 = this.state.settings[\"mail_username\"]) !== null && _this$state$settings$5 !== void 0 ? _this$state$settings$5 : \"\",\n placeholder: \"Enter a username\",\n name: \"mail_username\",\n id: \"mail_username\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$6 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$6 !== void 0 ? _this$state$settings$6 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_password\",\n className: \"mt-2\"\n }, \"Password\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"key\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"password\",\n className: \"form-control\",\n value: (_this$state$settings$7 = this.state.settings[\"mail_password\"]) !== null && _this$state$settings$7 !== void 0 ? _this$state$settings$7 : \"\",\n placeholder: \"(unchanged)\",\n name: \"mail_password\",\n id: \"mail_password\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$8 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$8 !== void 0 ? _this$state$settings$8 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_from\",\n className: \"mt-2\"\n }, \"Sender Email Address\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, \"@\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n className: \"form-control\",\n value: (_this$state$settings$9 = this.state.settings[\"mail_from\"]) !== null && _this$state$settings$9 !== void 0 ? _this$state$settings$9 : \"\",\n placeholder: \"Enter a email address\",\n name: \"mail_from\",\n id: \"mail_from\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$10 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$10 !== void 0 ? _this$state$settings$10 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_host\",\n className: \"mt-2\"\n }, \"SMTP Host\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"project-diagram\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$11 = this.state.settings[\"mail_host\"]) !== null && _this$state$settings$11 !== void 0 ? _this$state$settings$11 : \"\",\n placeholder: \"e.g. smtp.example.com\",\n name: \"mail_host\",\n id: \"mail_host\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$12 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$12 !== void 0 ? _this$state$settings$12 : \"0\") !== \"1\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_port\",\n className: \"mt-2\"\n }, \"SMTP Port\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"project-diagram\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"number\",\n className: \"form-control\",\n value: parseInt((_this$state$settings$13 = this.state.settings[\"mail_port\"]) !== null && _this$state$settings$13 !== void 0 ? _this$state$settings$13 : \"25\"),\n placeholder: \"smtp port\",\n name: \"mail_port\",\n id: \"mail_port\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$14 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$14 !== void 0 ? _this$state$settings$14 : \"0\") !== \"1\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"mt-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_from\",\n className: \"mt-2\"\n }, \"Send Test E-Mail\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, \"@\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n className: \"form-control\",\n value: this.state.mail.test_email,\n placeholder: \"Enter a email address\",\n onChange: function onChange(e) {\n return _this4.setState(_objectSpread(_objectSpread({}, _this4.state), {}, {\n mail: _objectSpread(_objectSpread({}, _this4.state.mail), {}, {\n test_email: e.target.value\n })\n }));\n },\n disabled: ((_this$state$settings$15 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$15 !== void 0 ? _this$state$settings$15 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group form-inline mt-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-info col-2\",\n onClick: function onClick() {\n return _this4.onSendTestMail();\n },\n disabled: ((_this$state$settings$16 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$16 !== void 0 ? _this$state$settings$16 : \"0\") !== \"1\" || this.state.mail.isSending\n }, this.state.mail.isSending ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Sending\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"circle-notch\"\n })) : \"Send Mail\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-10\"\n }, this.state.mail.unsavedMailSettings ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"text-red\"\n }, \"You need to save your mail settings first.\") : null))));\n }\n }, {\n key: \"getMessagesForm\",\n value: function getMessagesForm() {\n var _this5 = this;\n\n var editor = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6__[\"Editor\"], {\n editorState: this.state.messages.editor,\n onEditorStateChange: this.onEditorStateChange.bind(this)\n });\n var messageTemplates = {\n \"message_confirm_email\": \"Confirm E-Mail Message\",\n \"message_accept_invite\": \"Accept Invitation Message\",\n \"message_reset_password\": \"Reset Password Message\"\n };\n var formGroups = [];\n\n var _loop2 = function _loop2(key) {\n var title = messageTemplates[key];\n\n if (_this5.state.messages.isEditing === key) {\n formGroups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\",\n key: \"group-\" + key\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: key\n }, title, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n id: \"tooltip-\" + key\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"times\",\n className: \"ml-2 text-danger\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this5.closeEditor(false);\n },\n \"data-type\": \"error\",\n \"data-tip\": \"Discard Changes\",\n \"data-place\": \"top\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-\" + key\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"check\",\n className: \"ml-2 text-success\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this5.closeEditor(true);\n },\n \"data-type\": \"success\",\n \"data-tip\": \"Save Changes\",\n \"data-place\": \"top\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-\" + key\n })), editor));\n } else {\n var _this5$state$settings;\n\n formGroups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\",\n key: \"group-\" + key\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n id: \"tooltip-\" + key\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: key\n }, title, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"pencil-alt\",\n className: \"ml-2\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this5.openEditor(key);\n },\n \"data-type\": \"info\",\n \"data-tip\": \"Edit Template\",\n \"data-place\": \"top\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-\" + key\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"p-2 text-black\",\n style: {\n backgroundColor: \"#d2d6de\"\n },\n dangerouslySetInnerHTML: {\n __html: sanitize_html__WEBPACK_IMPORTED_MODULE_9___default()((_this5$state$settings = _this5.state.settings[key]) !== null && _this5$state$settings !== void 0 ? _this5$state$settings : \"\")\n }\n })));\n }\n };\n\n for (var key in messageTemplates) {\n _loop2(key);\n }\n\n return formGroups;\n }\n }, {\n key: \"getRecaptchaForm\",\n value: function getRecaptchaForm() {\n var _this$state$settings$17, _this$state$settings$18, _this$state$settings$19, _this$state$settings$20, _this$state$settings$21;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n name: \"recaptcha_enabled\",\n id: \"recaptcha_enabled\",\n checked: ((_this$state$settings$17 = this.state.settings[\"recaptcha_enabled\"]) !== null && _this$state$settings$17 !== void 0 ? _this$state$settings$17 : \"0\") === \"1\",\n onChange: this.onChangeValue.bind(this)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"form-check-label\",\n htmlFor: \"recaptcha_enabled\"\n }, \"Enable Google's reCaptcha\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"hr\", {\n className: \"m-2\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"recaptcha_public_key\",\n className: \"mt-2\"\n }, \"reCaptcha Site Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"unlock\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$18 = this.state.settings[\"recaptcha_public_key\"]) !== null && _this$state$settings$18 !== void 0 ? _this$state$settings$18 : \"\",\n placeholder: \"Enter site key\",\n name: \"recaptcha_public_key\",\n id: \"recaptcha_public_key\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$19 = this.state.settings[\"recaptcha_enabled\"]) !== null && _this$state$settings$19 !== void 0 ? _this$state$settings$19 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"recaptcha_private_key\",\n className: \"mt-2\"\n }, \"reCaptcha Secret Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group mb-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"lock\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"password\",\n className: \"form-control\",\n value: (_this$state$settings$20 = this.state.settings[\"recaptcha_private_key\"]) !== null && _this$state$settings$20 !== void 0 ? _this$state$settings$20 : \"\",\n placeholder: \"(unchanged)\",\n name: \"recaptcha_private_key\",\n id: \"mail_password\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$21 = this.state.settings[\"recaptcha_enabled\"]) !== null && _this$state$settings$21 !== void 0 ? _this$state$settings$21 : \"0\") !== \"1\"\n })));\n }\n }, {\n key: \"getUncategorizedForm\",\n value: function getUncategorizedForm() {\n var _this6 = this;\n\n var tr = [];\n\n var _loop3 = function _loop3(i) {\n var key = _this6.state.uncategorised.settings[i].key;\n var value = _this6.state.uncategorised.settings[i].value;\n tr.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tr\", {\n key: \"uncategorised-\" + i,\n className: i % 2 === 0 ? \"even\" : \"odd\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"form-control\",\n type: \"text\",\n value: key,\n maxLength: 32,\n placeholder: \"Key\",\n onChange: function onChange(e) {\n return _this6.onChangeUncategorisedValue(e, i, true);\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"form-control\",\n type: \"text\",\n value: value,\n placeholder: \"value\",\n onChange: function onChange(e) {\n return _this6.onChangeUncategorisedValue(e, i, false);\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", {\n className: \"text-center align-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n id: \"tooltip-uncategorised-\" + i\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"trash\",\n className: \"text-danger\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this6.onDeleteUncategorisedProp(i);\n },\n \"data-type\": \"error\",\n \"data-tip\": \"Delete property\",\n \"data-place\": \"right\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-uncategorised-\" + i\n }))));\n };\n\n for (var i = 0; i < this.state.uncategorised.settings.length; i++) {\n _loop3(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"table\", {\n className: \"table table-bordered table-hover dataTable dtr-inline\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null, \"Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null, \"Value\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", {\n className: \"text-center\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"tools\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tbody\", null, tr)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"mt-2 mb-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-info\",\n onClick: function onClick() {\n return _this6.onAddUncategorisedProperty();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"plus\",\n className: \"mr-2\"\n }), \" Add property\")));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this7 = this;\n\n var errors = [];\n\n var _loop4 = function _loop4(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_alert__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this7.removeError(\"errors\", i);\n }\n }, _this7.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop4(i);\n }\n\n var categories = {\n \"general\": {\n color: \"primary\",\n icon: \"cogs\",\n title: \"General Settings\",\n content: this.createGeneralForm()\n },\n \"mail\": {\n color: \"warning\",\n icon: \"envelope\",\n title: \"Mail Settings\",\n content: this.createMailForm()\n },\n \"messages\": {\n color: \"info\",\n icon: \"copy\",\n title: \"Message Templates\",\n content: this.getMessagesForm()\n },\n \"recaptcha\": {\n color: \"danger\",\n icon: \"google\",\n title: \"Google reCaptcha\",\n content: this.getRecaptchaForm()\n },\n \"uncategorised\": {\n color: \"secondary\",\n icon: \"stream\",\n title: \"Uncategorised\",\n content: this.getUncategorizedForm()\n }\n };\n var cards = [];\n\n for (var name in categories) {\n var category = categories[name];\n cards.push(this.createCard(name, category.color, category.icon, category.title, category.content));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Settings\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Settings\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, cards)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], null));\n }\n }, {\n key: \"onEditorStateChange\",\n value: function onEditorStateChange(editorState) {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n messages: _objectSpread(_objectSpread({}, this.state.messages), {}, {\n editor: editorState\n })\n }));\n }\n }, {\n key: \"onChangeValue\",\n value: function onChangeValue(event) {\n var target = event.target;\n var name = target.name;\n var type = target.type;\n var value = target.value;\n\n if (type === \"checkbox\") {\n value = event.target.checked ? \"1\" : \"0\";\n }\n\n var changedMailSettings = false;\n\n if (this.state.mail.keys.includes(name)) {\n changedMailSettings = true;\n }\n\n var newState = _objectSpread(_objectSpread({}, this.state), {}, {\n settings: _objectSpread(_objectSpread({}, this.state.settings), {}, _defineProperty({}, name, value))\n });\n\n if (changedMailSettings) {\n newState.mail = _objectSpread(_objectSpread({}, this.state.mail), {}, {\n unsavedMailSettings: true\n });\n }\n\n this.setState(newState);\n }\n }, {\n key: \"onReset\",\n value: function onReset(category) {\n var _this8 = this;\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isResetting: true\n }))));\n this.parent.api.getSettings().then(function (res) {\n if (!res.success) {\n var alerts = _this8.state[category].alerts.slice();\n\n alerts.push({\n title: \"Error fetching settings\",\n message: res.msg\n });\n\n _this8.setState(_objectSpread(_objectSpread({}, _this8.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, _this8.state[category]), {}, {\n alerts: alerts,\n isResetting: false\n }))));\n } else {\n var newState = _objectSpread({}, _this8.state);\n\n var categoryUpdated = _objectSpread(_objectSpread({}, _this8.state[category]), {}, {\n isResetting: false\n });\n\n var newSettings = _objectSpread({}, _this8.state.settings);\n\n if (category === \"uncategorised\") {\n categoryUpdated.settings = _this8.getUncategorisedValues(res);\n\n for (var key in res.settings) {\n if (res.settings.hasOwnProperty(key) && !_this8.isDefaultKey(key)) {\n var _res$settings$key;\n\n newSettings[key] = (_res$settings$key = res.settings[key]) !== null && _res$settings$key !== void 0 ? _res$settings$key : \"\";\n }\n }\n } else {\n var _iterator = _createForOfIteratorHelper(_this8.state[category].keys),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _res$settings$_key;\n\n var _key = _step.value;\n newSettings[_key] = (_res$settings$_key = res.settings[_key]) !== null && _res$settings$_key !== void 0 ? _res$settings$_key : \"\";\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (category === \"mail\") {\n categoryUpdated.unsavedMailSettings = false;\n } else if (category === \"messages\") {\n categoryUpdated.isEditing = null;\n }\n }\n\n newState.settings = newSettings;\n newState[category] = categoryUpdated;\n\n _this8.setState(newState);\n }\n });\n }\n }, {\n key: \"onSave\",\n value: function onSave(category) {\n var _this9 = this;\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isSaving: true\n }))));\n\n if (category === \"messages\" && this.state.messages.isEditing) {\n this.closeEditor(true, function () {\n return _this9.onSave(category);\n });\n }\n\n var values = {};\n\n if (category === \"uncategorised\") {\n var _iterator2 = _createForOfIteratorHelper(this.state.uncategorised.settings),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var prop = _step2.value;\n\n if (prop.key) {\n values[prop.key] = prop.value;\n\n if (this.isDefaultKey(prop.key)) {\n this.parent.showDialog(\"You cannot use this key as property key: \" + prop.key, \"System specific key\");\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isSaving: false\n }))));\n return;\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n for (var key in this.state.settings) {\n if (this.state.settings.hasOwnProperty(key) && !this.isDefaultKey(key) && !values.hasOwnProperty(key)) {\n values[key] = null;\n }\n }\n } else {\n var _iterator3 = _createForOfIteratorHelper(this.state[category].keys),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _key2 = _step3.value;\n\n if (this.hiddenKeys.includes(_key2) && !this.state.settings[_key2]) {\n continue;\n }\n\n values[_key2] = this.state.settings[_key2];\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n\n this.parent.api.saveSettings(values).then(function (res) {\n var alerts = _this9.state[category].alerts.slice();\n\n var categoryUpdated = _objectSpread(_objectSpread({}, _this9.state[category]), {}, {\n isSaving: false\n });\n\n if (!res.success) {\n alerts.push({\n title: \"Error fetching settings\",\n message: res.msg\n });\n } else {\n alerts.push({\n title: \"Success\",\n message: \"Settings were successfully saved.\",\n type: \"success\"\n });\n if (category === \"mail\") categoryUpdated.unsavedMailSettings = false;\n\n _this9.setState(_objectSpread(_objectSpread({}, _this9.state), {}, _defineProperty({}, category, categoryUpdated)));\n }\n\n categoryUpdated.alerts = alerts;\n\n _this9.setState(_objectSpread(_objectSpread({}, _this9.state), {}, _defineProperty({}, category, categoryUpdated)));\n });\n }\n }, {\n key: \"onSendTestMail\",\n value: function onSendTestMail() {\n var _this10 = this;\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n mail: _objectSpread(_objectSpread({}, this.state.mail), {}, {\n isSending: true\n })\n }));\n console.log(this.state.mail);\n this.parent.api.sendTestMail(this.state.mail.test_email).then(function (res) {\n var alerts = _this10.state.mail.alerts.slice();\n\n var newState = _objectSpread(_objectSpread({}, _this10.state.mail), {}, {\n isSending: false\n });\n\n if (!res.success) {\n alerts.push({\n title: \"Error sending email\",\n message: res.msg\n });\n } else {\n alerts.push({\n title: \"Success!\",\n message: \"E-Mail was successfully sent, check your inbox.\",\n type: \"success\"\n });\n newState.test_email = \"\";\n }\n\n newState.alerts = alerts;\n\n _this10.setState(_objectSpread(_objectSpread({}, _this10.state), {}, {\n mail: newState\n }));\n });\n }\n }, {\n key: \"closeEditor\",\n value: function closeEditor(save) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (this.state.messages.isEditing) {\n var key = this.state.messages.isEditing;\n\n var newState = _objectSpread(_objectSpread({}, this.state), {}, {\n messages: _objectSpread(_objectSpread({}, this.state.messages), {}, {\n isEditing: null\n })\n });\n\n if (save) {\n newState.settings = _objectSpread(_objectSpread({}, this.state.settings), {}, _defineProperty({}, key, draftjs_to_html__WEBPACK_IMPORTED_MODULE_7___default()(Object(draft_js__WEBPACK_IMPORTED_MODULE_5__[\"convertToRaw\"])(this.state.messages.editor.getCurrentContent()))));\n }\n\n callback = callback || function () {};\n\n this.setState(newState, callback);\n }\n }\n }, {\n key: \"openEditor\",\n value: function openEditor(message) {\n var _this$state$settings$22;\n\n this.closeEditor(true);\n var contentBlock = html_to_draftjs__WEBPACK_IMPORTED_MODULE_8___default()((_this$state$settings$22 = this.state.settings[message]) !== null && _this$state$settings$22 !== void 0 ? _this$state$settings$22 : \"\");\n\n if (contentBlock) {\n var contentState = draft_js__WEBPACK_IMPORTED_MODULE_5__[\"ContentState\"].createFromBlockArray(contentBlock.contentBlocks);\n var editorState = draft_js__WEBPACK_IMPORTED_MODULE_5__[\"EditorState\"].createWithContent(contentState);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n messages: _objectSpread(_objectSpread({}, this.state.messages), {}, {\n isEditing: message,\n editor: editorState\n })\n }));\n }\n }\n }]);\n\n return Settings;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n\n//# sourceURL=webpack:///./src/views/settings.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Settings; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.js\");\n/* harmony import */ var react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-collapse/lib/Collapse */ \"./node_modules/react-collapse/lib/Collapse.js\");\n/* harmony import */ var react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! draft-js */ \"./node_modules/draft-js/lib/Draft.js\");\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(draft_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-draft-wysiwyg */ \"./node_modules/react-draft-wysiwyg/dist/react-draft-wysiwyg.js\");\n/* harmony import */ var react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var draftjs_to_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! draftjs-to-html */ \"./node_modules/draftjs-to-html/lib/draftjs-to-html.js\");\n/* harmony import */ var draftjs_to_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(draftjs_to_html__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var html_to_draftjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! html-to-draftjs */ \"./node_modules/html-to-draftjs/dist/html-to-draftjs.js\");\n/* harmony import */ var html_to_draftjs__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(html_to_draftjs__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var sanitize_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! sanitize-html */ \"./node_modules/sanitize-html/dist/sanitize-html.js\");\n/* harmony import */ var sanitize_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(sanitize_html__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var react_draft_wysiwyg_dist_react_draft_wysiwyg_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-draft-wysiwyg/dist/react-draft-wysiwyg.css */ \"./node_modules/react-draft-wysiwyg/dist/react-draft-wysiwyg.css\");\n/* harmony import */ var react_draft_wysiwyg_dist_react_draft_wysiwyg_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_draft_wysiwyg_dist_react_draft_wysiwyg_css__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-tooltip */ \"./node_modules/react-tooltip/dist/index.es.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Settings = /*#__PURE__*/function (_React$Component) {\n _inherits(Settings, _React$Component);\n\n var _super = _createSuper(Settings);\n\n function Settings(props) {\n var _this;\n\n _classCallCheck(this, Settings);\n\n _this = _super.call(this, props);\n _this.state = {\n errors: [],\n settings: {},\n general: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n keys: [\"site_name\", \"base_url\", \"user_registration_enabled\"]\n },\n mail: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n isSending: false,\n test_email: \"\",\n unsavedMailSettings: false,\n keys: [\"mail_enabled\", \"mail_host\", \"mail_port\", \"mail_username\", \"mail_password\", \"mail_from\"]\n },\n messages: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n editor: draft_js__WEBPACK_IMPORTED_MODULE_5__[\"EditorState\"].createEmpty(),\n isEditing: null,\n keys: [\"message_confirm_email\", \"message_accept_invite\", \"message_reset_password\"]\n },\n recaptcha: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n keys: [\"recaptcha_enabled\", \"recaptcha_public_key\", \"recaptcha_private_key\"]\n },\n uncategorised: {\n alerts: [],\n isOpen: true,\n isSaving: false,\n isResetting: false,\n settings: []\n }\n };\n _this.parent = {\n api: props.api,\n showDialog: props.showDialog\n };\n _this.hiddenKeys = [\"recaptcha_private_key\", \"mail_password\", \"jwt_secret\"];\n return _this;\n }\n\n _createClass(Settings, [{\n key: \"isDefaultKey\",\n value: function isDefaultKey(key) {\n key = key.trim();\n return this.state.general.keys.includes(key) || this.state.mail.keys.includes(key) || this.state.messages.keys.includes(key) || this.state.recaptcha.keys.includes(key) || this.hiddenKeys.includes(key);\n }\n }, {\n key: \"getUncategorisedValues\",\n value: function getUncategorisedValues(res) {\n var uncategorised = [];\n\n for (var key in res.settings) {\n if (res.settings.hasOwnProperty(key) && !this.isDefaultKey(key)) {\n uncategorised.push({\n key: key,\n value: res.settings[key]\n });\n }\n }\n\n return uncategorised;\n }\n }, {\n key: \"onDeleteUncategorisedProp\",\n value: function onDeleteUncategorisedProp(index) {\n if (index < 0 || index >= this.state.uncategorised.settings.length) {\n return;\n }\n\n var props = this.state.uncategorised.settings.slice();\n props.splice(index, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n uncategorised: _objectSpread(_objectSpread({}, this.state.uncategorised), {}, {\n settings: props\n })\n }));\n }\n }, {\n key: \"onChangeUncategorisedValue\",\n value: function onChangeUncategorisedValue(event, index, isKey) {\n if (index < 0 || index >= this.state.uncategorised.settings.length) {\n return;\n }\n\n var props = this.state.uncategorised.settings.slice();\n\n if (isKey) {\n props[index].key = event.target.value;\n } else {\n props[index].value = event.target.value;\n }\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n uncategorised: _objectSpread(_objectSpread({}, this.state.uncategorised), {}, {\n settings: props\n })\n }));\n }\n }, {\n key: \"onAddUncategorisedProperty\",\n value: function onAddUncategorisedProperty() {\n var props = this.state.uncategorised.settings.slice();\n props.push({\n key: \"\",\n value: \"\"\n });\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n uncategorised: _objectSpread(_objectSpread({}, this.state.uncategorised), {}, {\n settings: props\n })\n }));\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.parent.api.getSettings().then(function (res) {\n if (res.success) {\n var newState = _objectSpread(_objectSpread({}, _this2.state), {}, {\n settings: res.settings,\n uncategorised: _objectSpread(_objectSpread({}, _this2.state.uncategorised), {}, {\n settings: _this2.getUncategorisedValues(res)\n })\n });\n\n _this2.setState(newState);\n } else {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n title: \"Error fetching settings\",\n message: res.msg\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n }\n });\n }\n }, {\n key: \"removeError\",\n value: function removeError(i) {\n var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (category) {\n if (i >= 0 && i < this.state[category].alerts.length) {\n var alerts = this.state[category].alerts.slice();\n alerts.splice(i, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n alerts: alerts\n }))));\n }\n } else {\n if (i >= 0 && i < this.state.errors.length) {\n var errors = this.state.errors.slice();\n errors.splice(i, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n errors: errors\n }));\n }\n }\n }\n }, {\n key: \"toggleCollapse\",\n value: function toggleCollapse(category) {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isOpen: !this.state[category].isOpen\n }))));\n }\n }, {\n key: \"createCard\",\n value: function createCard(category, color, icon, title, content) {\n var _this3 = this;\n\n var alerts = [];\n\n var _loop = function _loop(i) {\n alerts.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_alert__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _extends({\n key: \"alert-\" + i,\n onClose: function onClose() {\n return _this3.removeError(i, category);\n }\n }, _this3.state[category].alerts[i])));\n };\n\n for (var i = 0; i < this.state[category].alerts.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card card-\" + color,\n key: \"card-\" + category\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card-header\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this3.toggleCollapse(category);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h4\", {\n className: \"card-title\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n className: \"mr-2\",\n icon: icon,\n type: icon === \"google\" ? \"fab\" : \"fas\"\n }), title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"btn btn-tool btn-sm\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: this.state[category].isOpen ? \"angle-up\" : \"angle-down\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_collapse_lib_Collapse__WEBPACK_IMPORTED_MODULE_3__[\"Collapse\"], {\n isOpened: this.state[category].isOpen\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"card-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-12 col-lg-6\"\n }, alerts, content, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-secondary\",\n onClick: function onClick() {\n return _this3.onReset(category);\n },\n disabled: this.state[category].isResetting || this.state[category].isSaving\n }, this.state[category].isResetting ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Resetting\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"circle-notch\"\n })) : \"Reset\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-success ml-2\",\n onClick: function onClick() {\n return _this3.onSave(category);\n },\n disabled: this.state[category].isResetting || this.state[category].isSaving\n }, this.state[category].isSaving ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Saving\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"circle-notch\"\n })) : \"Save\")))))));\n }\n }, {\n key: \"createGeneralForm\",\n value: function createGeneralForm() {\n var _this$state$settings$, _this$state$settings$2, _this$state$settings$3;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"site_name\"\n }, \"Site Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$ = this.state.settings[\"site_name\"]) !== null && _this$state$settings$ !== void 0 ? _this$state$settings$ : \"\",\n placeholder: \"Enter a title\",\n name: \"site_name\",\n id: \"site_name\",\n onChange: this.onChangeValue.bind(this)\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"base_url\"\n }, \"Base URL\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$2 = this.state.settings[\"base_url\"]) !== null && _this$state$settings$2 !== void 0 ? _this$state$settings$2 : \"\",\n placeholder: \"Enter a url\",\n name: \"base_url\",\n id: \"base_url\",\n onChange: this.onChangeValue.bind(this)\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"user_registration_enabled\"\n }, \"User Registration\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n name: \"user_registration_enabled\",\n id: \"user_registration_enabled\",\n checked: ((_this$state$settings$3 = this.state.settings[\"user_registration_enabled\"]) !== null && _this$state$settings$3 !== void 0 ? _this$state$settings$3 : \"0\") === \"1\",\n onChange: this.onChangeValue.bind(this)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"form-check-label\",\n htmlFor: \"user_registration_enabled\"\n }, \"Allow anyone to register an account\"))));\n }\n }, {\n key: \"createMailForm\",\n value: function createMailForm() {\n var _this$state$settings$4,\n _this$state$settings$5,\n _this$state$settings$6,\n _this$state$settings$7,\n _this$state$settings$8,\n _this$state$settings$9,\n _this$state$settings$10,\n _this$state$settings$11,\n _this$state$settings$12,\n _this$state$settings$13,\n _this$state$settings$14,\n _this4 = this,\n _this$state$settings$15,\n _this$state$settings$16;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n name: \"mail_enabled\",\n id: \"mail_enabled\",\n checked: ((_this$state$settings$4 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$4 !== void 0 ? _this$state$settings$4 : \"0\") === \"1\",\n onChange: this.onChangeValue.bind(this)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"form-check-label\",\n htmlFor: \"mail_enabled\"\n }, \"Enable E-Mail service\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"hr\", {\n className: \"m-3\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_username\"\n }, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"hashtag\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$5 = this.state.settings[\"mail_username\"]) !== null && _this$state$settings$5 !== void 0 ? _this$state$settings$5 : \"\",\n placeholder: \"Enter a username\",\n name: \"mail_username\",\n id: \"mail_username\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$6 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$6 !== void 0 ? _this$state$settings$6 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_password\",\n className: \"mt-2\"\n }, \"Password\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"key\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"password\",\n className: \"form-control\",\n value: (_this$state$settings$7 = this.state.settings[\"mail_password\"]) !== null && _this$state$settings$7 !== void 0 ? _this$state$settings$7 : \"\",\n placeholder: \"(unchanged)\",\n name: \"mail_password\",\n id: \"mail_password\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$8 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$8 !== void 0 ? _this$state$settings$8 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_from\",\n className: \"mt-2\"\n }, \"Sender Email Address\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, \"@\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n className: \"form-control\",\n value: (_this$state$settings$9 = this.state.settings[\"mail_from\"]) !== null && _this$state$settings$9 !== void 0 ? _this$state$settings$9 : \"\",\n placeholder: \"Enter a email address\",\n name: \"mail_from\",\n id: \"mail_from\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$10 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$10 !== void 0 ? _this$state$settings$10 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_host\",\n className: \"mt-2\"\n }, \"SMTP Host\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"project-diagram\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$11 = this.state.settings[\"mail_host\"]) !== null && _this$state$settings$11 !== void 0 ? _this$state$settings$11 : \"\",\n placeholder: \"e.g. smtp.example.com\",\n name: \"mail_host\",\n id: \"mail_host\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$12 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$12 !== void 0 ? _this$state$settings$12 : \"0\") !== \"1\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_port\",\n className: \"mt-2\"\n }, \"SMTP Port\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"project-diagram\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"number\",\n className: \"form-control\",\n value: parseInt((_this$state$settings$13 = this.state.settings[\"mail_port\"]) !== null && _this$state$settings$13 !== void 0 ? _this$state$settings$13 : \"25\"),\n placeholder: \"smtp port\",\n name: \"mail_port\",\n id: \"mail_port\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$14 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$14 !== void 0 ? _this$state$settings$14 : \"0\") !== \"1\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"mt-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"mail_from\",\n className: \"mt-2\"\n }, \"Send Test E-Mail\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, \"@\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n className: \"form-control\",\n value: this.state.mail.test_email,\n placeholder: \"Enter a email address\",\n onChange: function onChange(e) {\n return _this4.setState(_objectSpread(_objectSpread({}, _this4.state), {}, {\n mail: _objectSpread(_objectSpread({}, _this4.state.mail), {}, {\n test_email: e.target.value\n })\n }));\n },\n disabled: ((_this$state$settings$15 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$15 !== void 0 ? _this$state$settings$15 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group form-inline mt-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-info col-2\",\n onClick: function onClick() {\n return _this4.onSendTestMail();\n },\n disabled: ((_this$state$settings$16 = this.state.settings[\"mail_enabled\"]) !== null && _this$state$settings$16 !== void 0 ? _this$state$settings$16 : \"0\") !== \"1\" || this.state.mail.isSending\n }, this.state.mail.isSending ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Sending\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"circle-notch\"\n })) : \"Send Mail\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-10\"\n }, this.state.mail.unsavedMailSettings ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"text-red\"\n }, \"You need to save your mail settings first.\") : null))));\n }\n }, {\n key: \"getMessagesForm\",\n value: function getMessagesForm() {\n var _this5 = this;\n\n var editor = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_draft_wysiwyg__WEBPACK_IMPORTED_MODULE_6__[\"Editor\"], {\n editorState: this.state.messages.editor,\n onEditorStateChange: this.onEditorStateChange.bind(this)\n });\n var messageTemplates = {\n \"message_confirm_email\": \"Confirm E-Mail Message\",\n \"message_accept_invite\": \"Accept Invitation Message\",\n \"message_reset_password\": \"Reset Password Message\"\n };\n var formGroups = [];\n\n var _loop2 = function _loop2(key) {\n var title = messageTemplates[key];\n\n if (_this5.state.messages.isEditing === key) {\n formGroups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\",\n key: \"group-\" + key\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: key\n }, title, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n id: \"tooltip-\" + key\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"times\",\n className: \"ml-2 text-danger\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this5.closeEditor(false);\n },\n \"data-type\": \"error\",\n \"data-tip\": \"Discard Changes\",\n \"data-place\": \"top\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-\" + key\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"check\",\n className: \"ml-2 text-success\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this5.closeEditor(true);\n },\n \"data-type\": \"success\",\n \"data-tip\": \"Save Changes\",\n \"data-place\": \"top\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-\" + key\n })), editor));\n } else {\n var _this5$state$settings;\n\n formGroups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group\",\n key: \"group-\" + key\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n id: \"tooltip-\" + key\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: key\n }, title, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"pencil-alt\",\n className: \"ml-2\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this5.openEditor(key);\n },\n \"data-type\": \"info\",\n \"data-tip\": \"Edit Template\",\n \"data-place\": \"top\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-\" + key\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"p-2 text-black\",\n style: {\n backgroundColor: \"#d2d6de\"\n },\n dangerouslySetInnerHTML: {\n __html: sanitize_html__WEBPACK_IMPORTED_MODULE_9___default()((_this5$state$settings = _this5.state.settings[key]) !== null && _this5$state$settings !== void 0 ? _this5$state$settings : \"\")\n }\n })));\n }\n };\n\n for (var key in messageTemplates) {\n _loop2(key);\n }\n\n return formGroups;\n }\n }, {\n key: \"getRecaptchaForm\",\n value: function getRecaptchaForm() {\n var _this$state$settings$17, _this$state$settings$18, _this$state$settings$19, _this$state$settings$20, _this$state$settings$21;\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-group mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n name: \"recaptcha_enabled\",\n id: \"recaptcha_enabled\",\n checked: ((_this$state$settings$17 = this.state.settings[\"recaptcha_enabled\"]) !== null && _this$state$settings$17 !== void 0 ? _this$state$settings$17 : \"0\") === \"1\",\n onChange: this.onChangeValue.bind(this)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n className: \"form-check-label\",\n htmlFor: \"recaptcha_enabled\"\n }, \"Enable Google's reCaptcha\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"hr\", {\n className: \"m-2\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"recaptcha_public_key\",\n className: \"mt-2\"\n }, \"reCaptcha Site Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"unlock\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n className: \"form-control\",\n value: (_this$state$settings$18 = this.state.settings[\"recaptcha_public_key\"]) !== null && _this$state$settings$18 !== void 0 ? _this$state$settings$18 : \"\",\n placeholder: \"Enter site key\",\n name: \"recaptcha_public_key\",\n id: \"recaptcha_public_key\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$19 = this.state.settings[\"recaptcha_enabled\"]) !== null && _this$state$settings$19 !== void 0 ? _this$state$settings$19 : \"0\") !== \"1\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"recaptcha_private_key\",\n className: \"mt-2\"\n }, \"reCaptcha Secret Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group mb-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"input-group-prepend\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"input-group-text\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"lock\"\n }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"password\",\n className: \"form-control\",\n value: (_this$state$settings$20 = this.state.settings[\"recaptcha_private_key\"]) !== null && _this$state$settings$20 !== void 0 ? _this$state$settings$20 : \"\",\n placeholder: \"(unchanged)\",\n name: \"recaptcha_private_key\",\n id: \"mail_password\",\n onChange: this.onChangeValue.bind(this),\n disabled: ((_this$state$settings$21 = this.state.settings[\"recaptcha_enabled\"]) !== null && _this$state$settings$21 !== void 0 ? _this$state$settings$21 : \"0\") !== \"1\"\n })));\n }\n }, {\n key: \"getUncategorizedForm\",\n value: function getUncategorizedForm() {\n var _this6 = this;\n\n var tr = [];\n\n var _loop3 = function _loop3(i) {\n var key = _this6.state.uncategorised.settings[i].key;\n var value = _this6.state.uncategorised.settings[i].value;\n tr.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tr\", {\n key: \"uncategorised-\" + i,\n className: i % 2 === 0 ? \"even\" : \"odd\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"form-control\",\n type: \"text\",\n value: key,\n maxLength: 32,\n placeholder: \"Key\",\n onChange: function onChange(e) {\n return _this6.onChangeUncategorisedValue(e, i, true);\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"form-control\",\n type: \"text\",\n value: value,\n placeholder: \"value\",\n onChange: function onChange(e) {\n return _this6.onChangeUncategorisedValue(e, i, false);\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"td\", {\n className: \"text-center align-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n id: \"tooltip-uncategorised-\" + i\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"trash\",\n className: \"text-danger\",\n style: {\n cursor: \"pointer\"\n },\n onClick: function onClick() {\n return _this6.onDeleteUncategorisedProp(i);\n },\n \"data-type\": \"error\",\n \"data-tip\": \"Delete property\",\n \"data-place\": \"right\",\n \"data-effect\": \"solid\",\n \"data-for\": \"tooltip-uncategorised-\" + i\n }))));\n };\n\n for (var i = 0; i < this.state.uncategorised.settings.length; i++) {\n _loop3(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"table\", {\n className: \"table table-bordered table-hover dataTable dtr-inline\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null, \"Key\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", null, \"Value\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"th\", {\n className: \"text-center\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"tools\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"tbody\", null, tr)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"mt-2 mb-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: \"btn btn-info\",\n onClick: function onClick() {\n return _this6.onAddUncategorisedProperty();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n icon: \"plus\",\n className: \"mr-2\"\n }), \" Add property\")));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this7 = this;\n\n var errors = [];\n\n var _loop4 = function _loop4(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_alert__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this7.removeError(\"errors\", i);\n }\n }, _this7.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop4(i);\n }\n\n var categories = {\n \"general\": {\n color: \"primary\",\n icon: \"cogs\",\n title: \"General Settings\",\n content: this.createGeneralForm()\n },\n \"mail\": {\n color: \"warning\",\n icon: \"envelope\",\n title: \"Mail Settings\",\n content: this.createMailForm()\n },\n \"messages\": {\n color: \"info\",\n icon: \"copy\",\n title: \"Message Templates\",\n content: this.getMessagesForm()\n },\n \"recaptcha\": {\n color: \"danger\",\n icon: \"google\",\n title: \"Google reCaptcha\",\n content: this.getRecaptchaForm()\n },\n \"uncategorised\": {\n color: \"secondary\",\n icon: \"stream\",\n title: \"Uncategorised\",\n content: this.getUncategorizedForm()\n }\n };\n var cards = [];\n\n for (var name in categories) {\n var category = categories[name];\n cards.push(this.createCard(name, category.color, category.icon, category.title, category.content));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Settings\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Settings\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, cards)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_tooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"], null));\n }\n }, {\n key: \"onEditorStateChange\",\n value: function onEditorStateChange(editorState) {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n messages: _objectSpread(_objectSpread({}, this.state.messages), {}, {\n editor: editorState\n })\n }));\n }\n }, {\n key: \"onChangeValue\",\n value: function onChangeValue(event) {\n var target = event.target;\n var name = target.name;\n var type = target.type;\n var value = target.value;\n\n if (type === \"checkbox\") {\n value = event.target.checked ? \"1\" : \"0\";\n }\n\n var changedMailSettings = false;\n\n if (this.state.mail.keys.includes(name)) {\n changedMailSettings = true;\n }\n\n var newState = _objectSpread(_objectSpread({}, this.state), {}, {\n settings: _objectSpread(_objectSpread({}, this.state.settings), {}, _defineProperty({}, name, value))\n });\n\n if (changedMailSettings) {\n newState.mail = _objectSpread(_objectSpread({}, this.state.mail), {}, {\n unsavedMailSettings: true\n });\n }\n\n this.setState(newState);\n }\n }, {\n key: \"onReset\",\n value: function onReset(category) {\n var _this8 = this;\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isResetting: true\n }))));\n this.parent.api.getSettings().then(function (res) {\n if (!res.success) {\n var alerts = _this8.state[category].alerts.slice();\n\n alerts.push({\n title: \"Error fetching settings\",\n message: res.msg\n });\n\n _this8.setState(_objectSpread(_objectSpread({}, _this8.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, _this8.state[category]), {}, {\n alerts: alerts,\n isResetting: false\n }))));\n } else {\n var newState = _objectSpread({}, _this8.state);\n\n var categoryUpdated = _objectSpread(_objectSpread({}, _this8.state[category]), {}, {\n isResetting: false\n });\n\n var newSettings = _objectSpread({}, _this8.state.settings);\n\n if (category === \"uncategorised\") {\n categoryUpdated.settings = _this8.getUncategorisedValues(res);\n\n for (var key in res.settings) {\n if (res.settings.hasOwnProperty(key) && !_this8.isDefaultKey(key)) {\n var _res$settings$key;\n\n newSettings[key] = (_res$settings$key = res.settings[key]) !== null && _res$settings$key !== void 0 ? _res$settings$key : \"\";\n }\n }\n } else {\n var _iterator = _createForOfIteratorHelper(_this8.state[category].keys),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _res$settings$_key;\n\n var _key = _step.value;\n newSettings[_key] = (_res$settings$_key = res.settings[_key]) !== null && _res$settings$_key !== void 0 ? _res$settings$_key : \"\";\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (category === \"mail\") {\n categoryUpdated.unsavedMailSettings = false;\n } else if (category === \"messages\") {\n categoryUpdated.isEditing = null;\n }\n }\n\n newState.settings = newSettings;\n newState[category] = categoryUpdated;\n\n _this8.setState(newState);\n }\n });\n }\n }, {\n key: \"onSave\",\n value: function onSave(category) {\n var _this9 = this;\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isSaving: true\n }))));\n\n if (category === \"messages\" && this.state.messages.isEditing) {\n this.closeEditor(true, function () {\n return _this9.onSave(category);\n });\n }\n\n var values = {};\n\n if (category === \"uncategorised\") {\n var _iterator2 = _createForOfIteratorHelper(this.state.uncategorised.settings),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var prop = _step2.value;\n\n if (prop.key) {\n values[prop.key] = prop.value;\n\n if (this.isDefaultKey(prop.key)) {\n this.parent.showDialog(\"You cannot use this key as property key: \" + prop.key, \"System specific key\");\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, _defineProperty({}, category, _objectSpread(_objectSpread({}, this.state[category]), {}, {\n isSaving: false\n }))));\n return;\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n for (var key in this.state.settings) {\n if (this.state.settings.hasOwnProperty(key) && !this.isDefaultKey(key) && !values.hasOwnProperty(key)) {\n values[key] = null;\n }\n }\n } else {\n var _iterator3 = _createForOfIteratorHelper(this.state[category].keys),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _key2 = _step3.value;\n\n if (this.hiddenKeys.includes(_key2) && !this.state.settings[_key2]) {\n continue;\n }\n\n values[_key2] = this.state.settings[_key2];\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n\n this.parent.api.saveSettings(values).then(function (res) {\n var alerts = _this9.state[category].alerts.slice();\n\n var categoryUpdated = _objectSpread(_objectSpread({}, _this9.state[category]), {}, {\n isSaving: false\n });\n\n if (!res.success) {\n alerts.push({\n title: \"Error saving settings\",\n message: res.msg\n });\n } else {\n alerts.push({\n title: \"Success\",\n message: \"Settings were successfully saved.\",\n type: \"success\"\n });\n if (category === \"mail\") categoryUpdated.unsavedMailSettings = false;\n\n _this9.setState(_objectSpread(_objectSpread({}, _this9.state), {}, _defineProperty({}, category, categoryUpdated)));\n }\n\n categoryUpdated.alerts = alerts;\n\n _this9.setState(_objectSpread(_objectSpread({}, _this9.state), {}, _defineProperty({}, category, categoryUpdated)));\n });\n }\n }, {\n key: \"onSendTestMail\",\n value: function onSendTestMail() {\n var _this10 = this;\n\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n mail: _objectSpread(_objectSpread({}, this.state.mail), {}, {\n isSending: true\n })\n }));\n console.log(this.state.mail);\n this.parent.api.sendTestMail(this.state.mail.test_email).then(function (res) {\n var alerts = _this10.state.mail.alerts.slice();\n\n var newState = _objectSpread(_objectSpread({}, _this10.state.mail), {}, {\n isSending: false\n });\n\n if (!res.success) {\n alerts.push({\n title: \"Error sending email\",\n message: res.msg\n });\n } else {\n alerts.push({\n title: \"Success!\",\n message: \"E-Mail was successfully sent, check your inbox.\",\n type: \"success\"\n });\n newState.test_email = \"\";\n }\n\n newState.alerts = alerts;\n\n _this10.setState(_objectSpread(_objectSpread({}, _this10.state), {}, {\n mail: newState\n }));\n });\n }\n }, {\n key: \"closeEditor\",\n value: function closeEditor(save) {\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (this.state.messages.isEditing) {\n var key = this.state.messages.isEditing;\n\n var newState = _objectSpread(_objectSpread({}, this.state), {}, {\n messages: _objectSpread(_objectSpread({}, this.state.messages), {}, {\n isEditing: null\n })\n });\n\n if (save) {\n newState.settings = _objectSpread(_objectSpread({}, this.state.settings), {}, _defineProperty({}, key, draftjs_to_html__WEBPACK_IMPORTED_MODULE_7___default()(Object(draft_js__WEBPACK_IMPORTED_MODULE_5__[\"convertToRaw\"])(this.state.messages.editor.getCurrentContent()))));\n }\n\n callback = callback || function () {};\n\n this.setState(newState, callback);\n }\n }\n }, {\n key: \"openEditor\",\n value: function openEditor(message) {\n var _this$state$settings$22;\n\n this.closeEditor(true);\n var contentBlock = html_to_draftjs__WEBPACK_IMPORTED_MODULE_8___default()((_this$state$settings$22 = this.state.settings[message]) !== null && _this$state$settings$22 !== void 0 ? _this$state$settings$22 : \"\");\n\n if (contentBlock) {\n var contentState = draft_js__WEBPACK_IMPORTED_MODULE_5__[\"ContentState\"].createFromBlockArray(contentBlock.contentBlocks);\n var editorState = draft_js__WEBPACK_IMPORTED_MODULE_5__[\"EditorState\"].createWithContent(contentState);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n messages: _objectSpread(_objectSpread({}, this.state.messages), {}, {\n isEditing: message,\n editor: editorState\n })\n }));\n }\n }\n }]);\n\n return Settings;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n\n//# sourceURL=webpack:///./src/views/settings.js?");
/***/ }),
diff --git a/src/src/views/settings.js b/src/src/views/settings.js
index daf6124..bff2a10 100644
--- a/src/src/views/settings.js
+++ b/src/src/views/settings.js
@@ -666,7 +666,7 @@ export default class Settings extends React.Component {
let categoryUpdated = {...this.state[category], isSaving: false};
if (!res.success) {
- alerts.push({title: "Error fetching settings", message: res.msg});
+ alerts.push({title: "Error saving settings", message: res.msg});
} else {
alerts.push({title: "Success", message: "Settings were successfully saved.", type: "success"});
if (category === "mail") categoryUpdated.unsavedMailSettings = false;