diff --git a/admin/dist/main.js b/admin/dist/main.js index c487f12..1c33191 100644 --- a/admin/dist/main.js +++ b/admin/dist/main.js @@ -5560,6 +5560,138 @@ eval("var isarray = __webpack_require__(/*! isarray */ \"./node_modules/react-ro /***/ }), +/***/ "./node_modules/react-tooltip/dist/index.es.js": +/*!*****************************************************!*\ + !*** ./node_modules/react-tooltip/dist/index.es.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\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 prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js\");\nfunction ___$insertStyle(css) {\n if (!css) {\n return;\n }\n if (typeof window === 'undefined') {\n return;\n }\n\n var style = document.createElement('style');\n\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n document.head.appendChild(style);\n return css;\n}\n\n\n\n\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nvar CONSTANT = {\n GLOBAL: {\n HIDE: \"__react_tooltip_hide_event\",\n REBUILD: \"__react_tooltip_rebuild_event\",\n SHOW: \"__react_tooltip_show_event\"\n }\n};\n\n/**\n * Static methods for react-tooltip\n */\n\nvar dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {\n // Compatible with IE\n // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work\n // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\n var event;\n\n if (typeof window.CustomEvent === \"function\") {\n event = new window.CustomEvent(eventName, {\n detail: opts\n });\n } else {\n event = document.createEvent(\"Event\");\n event.initEvent(eventName, false, true, opts);\n }\n\n window.dispatchEvent(event);\n};\n\nfunction staticMethods (target) {\n /**\n * Hide all tooltip\n * @trigger ReactTooltip.hide()\n */\n target.hide = function (target) {\n dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {\n target: target\n });\n };\n /**\n * Rebuild all tooltip\n * @trigger ReactTooltip.rebuild()\n */\n\n\n target.rebuild = function () {\n dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);\n };\n /**\n * Show specific tooltip\n * @trigger ReactTooltip.show()\n */\n\n\n target.show = function (target) {\n dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {\n target: target\n });\n };\n\n target.prototype.globalRebuild = function () {\n if (this.mount) {\n this.unbindListener();\n this.bindListener();\n }\n };\n\n target.prototype.globalShow = function (event) {\n if (this.mount) {\n var hasTarget = event && event.detail && event.detail.target && true || false; // Create a fake event, specific show will limit the type to `solid`\n // only `float` type cares e.clientX e.clientY\n\n this.showTooltip({\n currentTarget: hasTarget && event.detail.target\n }, true);\n }\n };\n\n target.prototype.globalHide = function (event) {\n if (this.mount) {\n var hasTarget = event && event.detail && event.detail.target && true || false;\n this.hideTooltip({\n currentTarget: hasTarget && event.detail.target\n }, hasTarget);\n }\n };\n}\n\n/**\n * Events that should be bound to the window\n */\nfunction windowListener (target) {\n target.prototype.bindWindowEvents = function (resizeHide) {\n // ReactTooltip.hide\n window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);\n window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild\n\n window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);\n window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show\n\n window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);\n window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize\n\n if (resizeHide) {\n window.removeEventListener(\"resize\", this.onWindowResize);\n window.addEventListener(\"resize\", this.onWindowResize, false);\n }\n };\n\n target.prototype.unbindWindowEvents = function () {\n window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);\n window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);\n window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);\n window.removeEventListener(\"resize\", this.onWindowResize);\n };\n /**\n * invoked by resize event of window\n */\n\n\n target.prototype.onWindowResize = function () {\n if (!this.mount) return;\n this.hideTooltip();\n };\n}\n\n/**\n * Custom events to control showing and hiding of tooltip\n *\n * @attributes\n * - `event` {String}\n * - `eventOff` {String}\n */\nvar checkStatus = function checkStatus(dataEventOff, e) {\n var show = this.state.show;\n var id = this.props.id;\n var isCapture = this.isCapture(e.currentTarget);\n var currentItem = e.currentTarget.getAttribute(\"currentItem\");\n if (!isCapture) e.stopPropagation();\n\n if (show && currentItem === \"true\") {\n if (!dataEventOff) this.hideTooltip(e);\n } else {\n e.currentTarget.setAttribute(\"currentItem\", \"true\");\n setUntargetItems(e.currentTarget, this.getTargetArray(id));\n this.showTooltip(e);\n }\n};\n\nvar setUntargetItems = function setUntargetItems(currentTarget, targetArray) {\n for (var i = 0; i < targetArray.length; i++) {\n if (currentTarget !== targetArray[i]) {\n targetArray[i].setAttribute(\"currentItem\", \"false\");\n } else {\n targetArray[i].setAttribute(\"currentItem\", \"true\");\n }\n }\n};\n\nvar customListeners = {\n id: \"9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf\",\n set: function set(target, event, listener) {\n if (this.id in target) {\n var map = target[this.id];\n map[event] = listener;\n } else {\n // this is workaround for WeakMap, which is not supported in older browsers, such as IE\n Object.defineProperty(target, this.id, {\n configurable: true,\n value: _defineProperty({}, event, listener)\n });\n }\n },\n get: function get(target, event) {\n var map = target[this.id];\n\n if (map !== undefined) {\n return map[event];\n }\n }\n};\nfunction customEvent (target) {\n target.prototype.isCustomEvent = function (ele) {\n var event = this.state.event;\n return event || !!ele.getAttribute(\"data-event\");\n };\n /* Bind listener for custom event */\n\n\n target.prototype.customBindListener = function (ele) {\n var _this = this;\n\n var _this$state = this.state,\n event = _this$state.event,\n eventOff = _this$state.eventOff;\n var dataEvent = ele.getAttribute(\"data-event\") || event;\n var dataEventOff = ele.getAttribute(\"data-event-off\") || eventOff;\n dataEvent.split(\" \").forEach(function (event) {\n ele.removeEventListener(event, customListeners.get(ele, event));\n var customListener = checkStatus.bind(_this, dataEventOff);\n customListeners.set(ele, event, customListener);\n ele.addEventListener(event, customListener, false);\n });\n\n if (dataEventOff) {\n dataEventOff.split(\" \").forEach(function (event) {\n ele.removeEventListener(event, _this.hideTooltip);\n ele.addEventListener(event, _this.hideTooltip, false);\n });\n }\n };\n /* Unbind listener for custom event */\n\n\n target.prototype.customUnbindListener = function (ele) {\n var _this$state2 = this.state,\n event = _this$state2.event,\n eventOff = _this$state2.eventOff;\n var dataEvent = event || ele.getAttribute(\"data-event\");\n var dataEventOff = eventOff || ele.getAttribute(\"data-event-off\");\n ele.removeEventListener(dataEvent, customListeners.get(ele, event));\n if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);\n };\n}\n\n/**\n * Util method to judge if it should follow capture model\n */\nfunction isCapture (target) {\n target.prototype.isCapture = function (currentTarget) {\n return currentTarget && currentTarget.getAttribute(\"data-iscapture\") === \"true\" || this.props.isCapture || false;\n };\n}\n\n/**\n * Util method to get effect\n */\nfunction getEffect (target) {\n target.prototype.getEffect = function (currentTarget) {\n var dataEffect = currentTarget.getAttribute(\"data-effect\");\n return dataEffect || this.props.effect || \"float\";\n };\n}\n\n/**\n * Util method to get effect\n */\n\nvar makeProxy = function makeProxy(e) {\n var proxy = {};\n\n for (var key in e) {\n if (typeof e[key] === \"function\") {\n proxy[key] = e[key].bind(e);\n } else {\n proxy[key] = e[key];\n }\n }\n\n return proxy;\n};\n\nvar bodyListener = function bodyListener(callback, options, e) {\n var _options$respectEffec = options.respectEffect,\n respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,\n _options$customEvent = options.customEvent,\n customEvent = _options$customEvent === void 0 ? false : _options$customEvent;\n var id = this.props.id;\n var tip = e.target.getAttribute(\"data-tip\") || null;\n var forId = e.target.getAttribute(\"data-for\") || null;\n var target = e.target;\n\n if (this.isCustomEvent(target) && !customEvent) {\n return;\n }\n\n var isTargetBelongsToTooltip = id == null && forId == null || forId === id;\n\n if (tip != null && (!respectEffect || this.getEffect(target) === \"float\") && isTargetBelongsToTooltip) {\n var proxy = makeProxy(e);\n proxy.currentTarget = target;\n callback(proxy);\n }\n};\n\nvar findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {\n var events = {};\n targetArray.forEach(function (target) {\n var event = target.getAttribute(dataAttribute);\n if (event) event.split(\" \").forEach(function (event) {\n return events[event] = true;\n });\n });\n return events;\n};\n\nvar getBody = function getBody() {\n return document.getElementsByTagName(\"body\")[0];\n};\n\nfunction bodyMode (target) {\n target.prototype.isBodyMode = function () {\n return !!this.props.bodyMode;\n };\n\n target.prototype.bindBodyListener = function (targetArray) {\n var _this = this;\n\n var _this$state = this.state,\n event = _this$state.event,\n eventOff = _this$state.eventOff,\n possibleCustomEvents = _this$state.possibleCustomEvents,\n possibleCustomEventsOff = _this$state.possibleCustomEventsOff;\n var body = getBody();\n var customEvents = findCustomEvents(targetArray, \"data-event\");\n var customEventsOff = findCustomEvents(targetArray, \"data-event-off\");\n if (event != null) customEvents[event] = true;\n if (eventOff != null) customEventsOff[eventOff] = true;\n possibleCustomEvents.split(\" \").forEach(function (event) {\n return customEvents[event] = true;\n });\n possibleCustomEventsOff.split(\" \").forEach(function (event) {\n return customEventsOff[event] = true;\n });\n this.unbindBodyListener(body);\n var listeners = this.bodyModeListeners = {};\n\n if (event == null) {\n listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});\n listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {\n respectEffect: true\n });\n listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});\n }\n\n for (var _event in customEvents) {\n listeners[_event] = bodyListener.bind(this, function (e) {\n var targetEventOff = e.currentTarget.getAttribute(\"data-event-off\") || eventOff;\n checkStatus.call(_this, targetEventOff, e);\n }, {\n customEvent: true\n });\n }\n\n for (var _event2 in customEventsOff) {\n listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {\n customEvent: true\n });\n }\n\n for (var _event3 in listeners) {\n body.addEventListener(_event3, listeners[_event3]);\n }\n };\n\n target.prototype.unbindBodyListener = function (body) {\n body = body || getBody();\n var listeners = this.bodyModeListeners;\n\n for (var event in listeners) {\n body.removeEventListener(event, listeners[event]);\n }\n };\n}\n\n/**\n * Tracking target removing from DOM.\n * It's necessary to hide tooltip when it's target disappears.\n * Otherwise, the tooltip would be shown forever until another target\n * is triggered.\n *\n * If MutationObserver is not available, this feature just doesn't work.\n */\n// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/\nvar getMutationObserverClass = function getMutationObserverClass() {\n return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;\n};\n\nfunction trackRemoval (target) {\n target.prototype.bindRemovalTracker = function () {\n var _this = this;\n\n var MutationObserver = getMutationObserverClass();\n if (MutationObserver == null) return;\n var observer = new MutationObserver(function (mutations) {\n for (var m1 = 0; m1 < mutations.length; m1++) {\n var mutation = mutations[m1];\n\n for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {\n var element = mutation.removedNodes[m2];\n\n if (element === _this.state.currentTarget) {\n _this.hideTooltip();\n\n return;\n }\n }\n }\n });\n observer.observe(window.document, {\n childList: true,\n subtree: true\n });\n this.removalTracker = observer;\n };\n\n target.prototype.unbindRemovalTracker = function () {\n if (this.removalTracker) {\n this.removalTracker.disconnect();\n this.removalTracker = null;\n }\n };\n}\n\n/**\n * Calculate the position of tooltip\n *\n * @params\n * - `e` {Event} the event of current mouse\n * - `target` {Element} the currentTarget of the event\n * - `node` {DOM} the react-tooltip object\n * - `place` {String} top / right / bottom / left\n * - `effect` {String} float / solid\n * - `offset` {Object} the offset to default position\n *\n * @return {Object}\n * - `isNewState` {Bool} required\n * - `newState` {Object}\n * - `position` {Object} {left: {Number}, top: {Number}}\n */\nfunction getPosition (e, target, node, place, desiredPlace, effect, offset) {\n var _getDimensions = getDimensions(node),\n tipWidth = _getDimensions.width,\n tipHeight = _getDimensions.height;\n\n var _getDimensions2 = getDimensions(target),\n targetWidth = _getDimensions2.width,\n targetHeight = _getDimensions2.height;\n\n var _getCurrentOffset = getCurrentOffset(e, target, effect),\n mouseX = _getCurrentOffset.mouseX,\n mouseY = _getCurrentOffset.mouseY;\n\n var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);\n\n var _calculateOffset = calculateOffset(offset),\n extraOffsetX = _calculateOffset.extraOffsetX,\n extraOffsetY = _calculateOffset.extraOffsetY;\n\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n\n var _getParent = getParent(node),\n parentTop = _getParent.parentTop,\n parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip\n\n\n var getTipOffsetLeft = function getTipOffsetLeft(place) {\n var offsetX = defaultOffset[place].l;\n return mouseX + offsetX + extraOffsetX;\n };\n\n var getTipOffsetRight = function getTipOffsetRight(place) {\n var offsetX = defaultOffset[place].r;\n return mouseX + offsetX + extraOffsetX;\n };\n\n var getTipOffsetTop = function getTipOffsetTop(place) {\n var offsetY = defaultOffset[place].t;\n return mouseY + offsetY + extraOffsetY;\n };\n\n var getTipOffsetBottom = function getTipOffsetBottom(place) {\n var offsetY = defaultOffset[place].b;\n return mouseY + offsetY + extraOffsetY;\n }; //\n // Functions to test whether the tooltip's sides are inside\n // the client window for a given orientation p\n //\n // _____________\n // | | <-- Right side\n // | p = 'left' |\\\n // | |/ |\\\n // |_____________| |_\\ <-- Mouse\n // / \\ |\n // |\n // |\n // Bottom side\n //\n\n\n var outsideLeft = function outsideLeft(p) {\n return getTipOffsetLeft(p) < 0;\n };\n\n var outsideRight = function outsideRight(p) {\n return getTipOffsetRight(p) > windowWidth;\n };\n\n var outsideTop = function outsideTop(p) {\n return getTipOffsetTop(p) < 0;\n };\n\n var outsideBottom = function outsideBottom(p) {\n return getTipOffsetBottom(p) > windowHeight;\n }; // Check whether the tooltip with orientation p is completely inside the client window\n\n\n var outside = function outside(p) {\n return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);\n };\n\n var inside = function inside(p) {\n return !outside(p);\n };\n\n var placesList = [\"top\", \"bottom\", \"left\", \"right\"];\n var insideList = [];\n\n for (var i = 0; i < 4; i++) {\n var p = placesList[i];\n\n if (inside(p)) {\n insideList.push(p);\n }\n }\n\n var isNewState = false;\n var newPlace;\n var shouldUpdatePlace = desiredPlace !== place;\n\n if (inside(desiredPlace) && shouldUpdatePlace) {\n isNewState = true;\n newPlace = desiredPlace;\n } else if (insideList.length > 0 && outside(desiredPlace) && outside(place)) {\n isNewState = true;\n newPlace = insideList[0];\n }\n\n if (isNewState) {\n return {\n isNewState: true,\n newState: {\n place: newPlace\n }\n };\n }\n\n return {\n isNewState: false,\n position: {\n left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),\n top: parseInt(getTipOffsetTop(place) - parentTop, 10)\n }\n };\n}\n\nvar getDimensions = function getDimensions(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n height = _node$getBoundingClie.height,\n width = _node$getBoundingClie.width;\n\n return {\n height: parseInt(height, 10),\n width: parseInt(width, 10)\n };\n}; // Get current mouse offset\n\n\nvar getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {\n var boundingClientRect = currentTarget.getBoundingClientRect();\n var targetTop = boundingClientRect.top;\n var targetLeft = boundingClientRect.left;\n\n var _getDimensions3 = getDimensions(currentTarget),\n targetWidth = _getDimensions3.width,\n targetHeight = _getDimensions3.height;\n\n if (effect === \"float\") {\n return {\n mouseX: e.clientX,\n mouseY: e.clientY\n };\n }\n\n return {\n mouseX: targetLeft + targetWidth / 2,\n mouseY: targetTop + targetHeight / 2\n };\n}; // List all possibility of tooltip final offset\n// This is useful in judging if it is necessary for tooltip to switch position when out of window\n\n\nvar getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {\n var top;\n var right;\n var bottom;\n var left;\n var disToMouse = 3;\n var triangleHeight = 2;\n var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip\n\n if (effect === \"float\") {\n top = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: -(tipHeight + disToMouse + triangleHeight),\n b: -disToMouse\n };\n bottom = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: disToMouse + cursorHeight,\n b: tipHeight + disToMouse + triangleHeight + cursorHeight\n };\n left = {\n l: -(tipWidth + disToMouse + triangleHeight),\n r: -disToMouse,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n right = {\n l: disToMouse,\n r: tipWidth + disToMouse + triangleHeight,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n } else if (effect === \"solid\") {\n top = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: -(targetHeight / 2 + tipHeight + triangleHeight),\n b: -(targetHeight / 2)\n };\n bottom = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: targetHeight / 2,\n b: targetHeight / 2 + tipHeight + triangleHeight\n };\n left = {\n l: -(tipWidth + targetWidth / 2 + triangleHeight),\n r: -(targetWidth / 2),\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n right = {\n l: targetWidth / 2,\n r: tipWidth + targetWidth / 2 + triangleHeight,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n }\n\n return {\n top: top,\n bottom: bottom,\n left: left,\n right: right\n };\n}; // Consider additional offset into position calculation\n\n\nvar calculateOffset = function calculateOffset(offset) {\n var extraOffsetX = 0;\n var extraOffsetY = 0;\n\n if (Object.prototype.toString.apply(offset) === \"[object String]\") {\n offset = JSON.parse(offset.toString().replace(/'/g, '\"'));\n }\n\n for (var key in offset) {\n if (key === \"top\") {\n extraOffsetY -= parseInt(offset[key], 10);\n } else if (key === \"bottom\") {\n extraOffsetY += parseInt(offset[key], 10);\n } else if (key === \"left\") {\n extraOffsetX -= parseInt(offset[key], 10);\n } else if (key === \"right\") {\n extraOffsetX += parseInt(offset[key], 10);\n }\n }\n\n return {\n extraOffsetX: extraOffsetX,\n extraOffsetY: extraOffsetY\n };\n}; // Get the offset of the parent elements\n\n\nvar getParent = function getParent(currentTarget) {\n var currentParent = currentTarget;\n\n while (currentParent) {\n if (window.getComputedStyle(currentParent).getPropertyValue(\"transform\") !== \"none\") break;\n currentParent = currentParent.parentElement;\n }\n\n var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;\n var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;\n return {\n parentTop: parentTop,\n parentLeft: parentLeft\n };\n};\n\n/**\n * To get the tooltip content\n * it may comes from data-tip or this.props.children\n * it should support multiline\n *\n * @params\n * - `tip` {String} value of data-tip\n * - `children` {ReactElement} this.props.children\n * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')\n *\n * @return\n * - String or react component\n */\nfunction getTipContent (tip, children, getContent, multiline) {\n if (children) return children;\n if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.\n\n if (getContent === null) return null; // Tip not exist and children is null or undefined\n\n var regexp = //;\n\n if (!multiline || multiline === \"false\" || !regexp.test(tip)) {\n // No trim(), so that user can keep their input\n return tip;\n } // Multiline tooltip content\n\n\n return tip.split(regexp).map(function (d, i) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n key: i,\n className: \"multi-line\"\n }, d);\n });\n}\n\n/**\n * Support aria- and role in ReactTooltip\n *\n * @params props {Object}\n * @return {Object}\n */\nfunction parseAria(props) {\n var ariaObj = {};\n Object.keys(props).filter(function (prop) {\n // aria-xxx and role is acceptable\n return /(^aria-\\w+$|^role$)/.test(prop);\n }).forEach(function (prop) {\n ariaObj[prop] = props[prop];\n });\n return ariaObj;\n}\n\n/**\n * Convert nodelist to array\n * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24\n * NodeLists are functions in Safari\n */\nfunction nodeListToArray (nodeList) {\n var length = nodeList.length;\n\n if (nodeList.hasOwnProperty) {\n return Array.prototype.slice.call(nodeList);\n }\n\n return new Array(length).fill().map(function (index) {\n return nodeList[index];\n });\n}\n\nfunction generateUUID() {\n return \"t\" + Object(uuid__WEBPACK_IMPORTED_MODULE_2__[\"v4\"])();\n}\n\n___$insertStyle(\".__react_component_tooltip {\\n border-radius: 3px;\\n display: inline-block;\\n font-size: 13px;\\n left: -999em;\\n opacity: 0;\\n padding: 8px 21px;\\n position: fixed;\\n pointer-events: none;\\n transition: opacity 0.3s ease-out;\\n top: -999em;\\n visibility: hidden;\\n z-index: 999;\\n}\\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\\n pointer-events: auto;\\n}\\n.__react_component_tooltip::before, .__react_component_tooltip::after {\\n content: \\\"\\\";\\n width: 0;\\n height: 0;\\n position: absolute;\\n}\\n.__react_component_tooltip.show {\\n opacity: 0.9;\\n margin-top: 0;\\n margin-left: 0;\\n visibility: visible;\\n}\\n.__react_component_tooltip.place-top::before {\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n bottom: -8px;\\n left: 50%;\\n margin-left: -10px;\\n}\\n.__react_component_tooltip.place-bottom::before {\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n top: -8px;\\n left: 50%;\\n margin-left: -10px;\\n}\\n.__react_component_tooltip.place-left::before {\\n border-top: 6px solid transparent;\\n border-bottom: 6px solid transparent;\\n right: -8px;\\n top: 50%;\\n margin-top: -5px;\\n}\\n.__react_component_tooltip.place-right::before {\\n border-top: 6px solid transparent;\\n border-bottom: 6px solid transparent;\\n left: -8px;\\n top: 50%;\\n margin-top: -5px;\\n}\\n.__react_component_tooltip .multi-line {\\n display: block;\\n padding: 2px 0;\\n text-align: center;\\n}\");\n\n/**\n * Default pop-up style values (text color, background color).\n */\nvar defaultColors = {\n \"dark\": {\n \"text\": \"#fff\",\n \"background\": \"#222\",\n \"border\": \"transparent\",\n \"arrow\": \"#222\"\n },\n \"success\": {\n \"text\": \"#fff\",\n \"background\": \"#8DC572\",\n \"border\": \"transparent\",\n \"arrow\": \"#8DC572\"\n },\n \"warning\": {\n \"text\": \"#fff\",\n \"background\": \"#F0AD4E\",\n \"border\": \"transparent\",\n \"arrow\": \"#F0AD4E\"\n },\n \"error\": {\n \"text\": \"#fff\",\n \"background\": \"#BE6464\",\n \"border\": \"transparent\",\n \"arrow\": \"#BE6464\"\n },\n \"info\": {\n \"text\": \"#fff\",\n \"background\": \"#337AB7\",\n \"border\": \"transparent\",\n \"arrow\": \"#337AB7\"\n },\n \"light\": {\n \"text\": \"#222\",\n \"background\": \"#fff\",\n \"border\": \"transparent\",\n \"arrow\": \"#fff\"\n }\n};\nfunction getDefaultPopupColors(type) {\n return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;\n}\n\n/**\n* Generates the specific tooltip style for use on render.\n*/\n\nfunction generateTooltipStyle(uuid, customColors, type, hasBorder) {\n return generateStyle(uuid, getPopupColors(customColors, type, hasBorder));\n}\n/**\n * Generates the tooltip style rules based on the element-specified \"data-type\" property.\n */\n\nfunction generateStyle(uuid, colors) {\n var textColor = colors.text;\n var backgroundColor = colors.background;\n var borderColor = colors.border;\n var arrowColor = colors.arrow;\n return \"\\n \\t.\".concat(uuid, \" {\\n\\t color: \").concat(textColor, \";\\n\\t background: \").concat(backgroundColor, \";\\n\\t border: 1px solid \").concat(borderColor, \";\\n \\t}\\n\\n \\t.\").concat(uuid, \".place-top {\\n margin-top: -10px;\\n }\\n .\").concat(uuid, \".place-top::before {\\n border-top: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-top::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n bottom: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-top-color: \").concat(arrowColor, \";\\n border-top-style: solid;\\n border-top-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-bottom {\\n margin-top: 10px;\\n }\\n .\").concat(uuid, \".place-bottom::before {\\n border-bottom: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-bottom::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n top: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-bottom-color: \").concat(arrowColor, \";\\n border-bottom-style: solid;\\n border-bottom-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-left {\\n margin-left: -10px;\\n }\\n .\").concat(uuid, \".place-left::before {\\n border-left: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-left::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n right: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-left-color: \").concat(arrowColor, \";\\n border-left-style: solid;\\n border-left-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-right {\\n margin-left: 10px;\\n }\\n .\").concat(uuid, \".place-right::before {\\n border-right: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-right::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n left: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-right-color: \").concat(arrowColor, \";\\n border-right-style: solid;\\n border-right-width: 6px;\\n }\\n \");\n}\n\nfunction getPopupColors(customColors, type, hasBorder) {\n var textColor = customColors.text;\n var backgroundColor = customColors.background;\n var borderColor = customColors.border;\n var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;\n var colors = getDefaultPopupColors(type);\n\n if (textColor) {\n colors.text = textColor;\n }\n\n if (backgroundColor) {\n colors.background = backgroundColor;\n }\n\n if (hasBorder) {\n if (borderColor) {\n colors.border = borderColor;\n } else {\n colors.border = type === \"light\" ? \"black\" : \"white\";\n }\n }\n\n if (arrowColor) {\n colors.arrow = arrowColor;\n }\n\n return colors;\n}\n\nvar _class, _class2, _temp;\n\nvar ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(ReactTooltip, _React$Component);\n\n _createClass(ReactTooltip, null, [{\n key: \"propTypes\",\n get: function get() {\n return {\n uuid: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any,\n place: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n type: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n effect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n offset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,\n multiline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n border: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n textColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n backgroundColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n borderColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n arrowColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n insecure: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n \"class\": prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n html: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n delayHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,\n delayUpdate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,\n delayShow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,\n event: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n eventOff: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n isCapture: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n globalEventOff: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n getContent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any,\n afterShow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,\n afterHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,\n overridePosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,\n disable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n scrollHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n resizeHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n wrapper: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n bodyMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n possibleCustomEvents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n possibleCustomEventsOff: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n clickable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool\n };\n }\n }]);\n\n function ReactTooltip(props) {\n var _this;\n\n _classCallCheck(this, ReactTooltip);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));\n _this.state = {\n uuid: props.uuid || generateUUID(),\n place: props.place || \"top\",\n // Direction of tooltip\n desiredPlace: props.place || \"top\",\n type: \"dark\",\n // Color theme of tooltip\n effect: \"float\",\n // float or fixed\n show: false,\n border: false,\n customColors: {},\n offset: {},\n extraClass: \"\",\n html: false,\n delayHide: 0,\n delayShow: 0,\n event: props.event || null,\n eventOff: props.eventOff || null,\n currentEvent: null,\n // Current mouse event\n currentTarget: null,\n // Current target of mouse event\n ariaProps: parseAria(props),\n // aria- and role attributes\n isEmptyTip: false,\n disable: false,\n possibleCustomEvents: props.possibleCustomEvents || \"\",\n possibleCustomEventsOff: props.possibleCustomEventsOff || \"\",\n originTooltip: null,\n isMultiline: false\n };\n\n _this.bind([\"showTooltip\", \"updateTooltip\", \"hideTooltip\", \"hideTooltipOnScroll\", \"getTooltipContent\", \"globalRebuild\", \"globalShow\", \"globalHide\", \"onWindowResize\", \"mouseOnToolTip\"]);\n\n _this.mount = true;\n _this.delayShowLoop = null;\n _this.delayHideLoop = null;\n _this.delayReshow = null;\n _this.intervalUpdateContent = null;\n return _this;\n }\n /**\n * For unify the bind and unbind listener\n */\n\n\n _createClass(ReactTooltip, [{\n key: \"bind\",\n value: function bind(methodArray) {\n var _this2 = this;\n\n methodArray.forEach(function (method) {\n _this2[method] = _this2[method].bind(_this2);\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props = this.props,\n insecure = _this$props.insecure,\n resizeHide = _this$props.resizeHide;\n this.bindListener(); // Bind listener for tooltip\n\n this.bindWindowEvents(resizeHide); // Bind global event for static method\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mount = false;\n this.clearTimer();\n this.unbindListener();\n this.removeScrollListener(this.state.currentTarget);\n this.unbindWindowEvents();\n }\n /**\n * Return if the mouse is on the tooltip.\n * @returns {boolean} true - mouse is on the tooltip\n */\n\n }, {\n key: \"mouseOnToolTip\",\n value: function mouseOnToolTip() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n /* old IE or Firefox work around */\n if (!this.tooltipRef.matches) {\n /* old IE work around */\n if (this.tooltipRef.msMatchesSelector) {\n this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;\n } else {\n /* old Firefox work around */\n this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;\n }\n }\n\n return this.tooltipRef.matches(\":hover\");\n }\n\n return false;\n }\n /**\n * Pick out corresponded target elements\n */\n\n }, {\n key: \"getTargetArray\",\n value: function getTargetArray(id) {\n var targetArray = [];\n var selector;\n\n if (!id) {\n selector = \"[data-tip]:not([data-for])\";\n } else {\n var escaped = id.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"');\n selector = \"[data-tip][data-for=\\\"\".concat(escaped, \"\\\"]\");\n } // Scan document for shadow DOM elements\n\n\n nodeListToArray(document.getElementsByTagName(\"*\")).filter(function (element) {\n return element.shadowRoot;\n }).forEach(function (element) {\n targetArray = targetArray.concat(nodeListToArray(element.shadowRoot.querySelectorAll(selector)));\n });\n return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));\n }\n /**\n * Bind listener to the target elements\n * These listeners used to trigger showing or hiding the tooltip\n */\n\n }, {\n key: \"bindListener\",\n value: function bindListener() {\n var _this3 = this;\n\n var _this$props2 = this.props,\n id = _this$props2.id,\n globalEventOff = _this$props2.globalEventOff,\n isCapture = _this$props2.isCapture;\n var targetArray = this.getTargetArray(id);\n targetArray.forEach(function (target) {\n if (target.getAttribute(\"currentItem\") === null) {\n target.setAttribute(\"currentItem\", \"false\");\n }\n\n _this3.unbindBasicListener(target);\n\n if (_this3.isCustomEvent(target)) {\n _this3.customUnbindListener(target);\n }\n });\n\n if (this.isBodyMode()) {\n this.bindBodyListener(targetArray);\n } else {\n targetArray.forEach(function (target) {\n var isCaptureMode = _this3.isCapture(target);\n\n var effect = _this3.getEffect(target);\n\n if (_this3.isCustomEvent(target)) {\n _this3.customBindListener(target);\n\n return;\n }\n\n target.addEventListener(\"mouseenter\", _this3.showTooltip, isCaptureMode);\n\n if (effect === \"float\") {\n target.addEventListener(\"mousemove\", _this3.updateTooltip, isCaptureMode);\n }\n\n target.addEventListener(\"mouseleave\", _this3.hideTooltip, isCaptureMode);\n });\n } // Global event to hide tooltip\n\n\n if (globalEventOff) {\n window.removeEventListener(globalEventOff, this.hideTooltip);\n window.addEventListener(globalEventOff, this.hideTooltip, isCapture);\n } // Track removal of targetArray elements from DOM\n\n\n this.bindRemovalTracker();\n }\n /**\n * Unbind listeners on target elements\n */\n\n }, {\n key: \"unbindListener\",\n value: function unbindListener() {\n var _this4 = this;\n\n var _this$props3 = this.props,\n id = _this$props3.id,\n globalEventOff = _this$props3.globalEventOff;\n\n if (this.isBodyMode()) {\n this.unbindBodyListener();\n } else {\n var targetArray = this.getTargetArray(id);\n targetArray.forEach(function (target) {\n _this4.unbindBasicListener(target);\n\n if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);\n });\n }\n\n if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);\n this.unbindRemovalTracker();\n }\n /**\n * Invoke this before bind listener and unmount the component\n * it is necessary to invoke this even when binding custom event\n * so that the tooltip can switch between custom and default listener\n */\n\n }, {\n key: \"unbindBasicListener\",\n value: function unbindBasicListener(target) {\n var isCaptureMode = this.isCapture(target);\n target.removeEventListener(\"mouseenter\", this.showTooltip, isCaptureMode);\n target.removeEventListener(\"mousemove\", this.updateTooltip, isCaptureMode);\n target.removeEventListener(\"mouseleave\", this.hideTooltip, isCaptureMode);\n }\n }, {\n key: \"getTooltipContent\",\n value: function getTooltipContent() {\n var _this$props4 = this.props,\n getContent = _this$props4.getContent,\n children = _this$props4.children; // Generate tooltip content\n\n var content;\n\n if (getContent) {\n if (Array.isArray(getContent)) {\n content = getContent[0] && getContent[0](this.state.originTooltip);\n } else {\n content = getContent(this.state.originTooltip);\n }\n }\n\n return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);\n }\n }, {\n key: \"isEmptyTip\",\n value: function isEmptyTip(placeholder) {\n return typeof placeholder === \"string\" && placeholder === \"\" || placeholder === null;\n }\n /**\n * When mouse enter, show the tooltip\n */\n\n }, {\n key: \"showTooltip\",\n value: function showTooltip(e, isGlobalCall) {\n if (isGlobalCall) {\n // Don't trigger other elements belongs to other ReactTooltip\n var targetArray = this.getTargetArray(this.props.id);\n var isMyElement = targetArray.some(function (ele) {\n return ele === e.currentTarget;\n });\n if (!isMyElement) return;\n } // Get the tooltip content\n // calculate in this phrase so that tip width height can be detected\n\n\n var _this$props5 = this.props,\n multiline = _this$props5.multiline,\n getContent = _this$props5.getContent;\n var originTooltip = e.currentTarget.getAttribute(\"data-tip\");\n var isMultiline = e.currentTarget.getAttribute(\"data-multiline\") || multiline || false; // If it is focus event or called by ReactTooltip.show, switch to `solid` effect\n\n var switchToSolid = e instanceof window.FocusEvent || isGlobalCall; // if it needs to skip adding hide listener to scroll\n\n var scrollHide = true;\n\n if (e.currentTarget.getAttribute(\"data-scroll-hide\")) {\n scrollHide = e.currentTarget.getAttribute(\"data-scroll-hide\") === \"true\";\n } else if (this.props.scrollHide != null) {\n scrollHide = this.props.scrollHide;\n } // Make sure the correct place is set\n\n\n var desiredPlace = e.currentTarget.getAttribute(\"data-place\") || this.props.place || \"top\";\n var effect = switchToSolid && \"solid\" || this.getEffect(e.currentTarget);\n var offset = e.currentTarget.getAttribute(\"data-offset\") || this.props.offset || {};\n var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);\n\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);\n }\n\n var place = result.isNewState ? result.newState.place : desiredPlace; // To prevent previously created timers from triggering\n\n this.clearTimer();\n var target = e.currentTarget;\n var reshowDelay = this.state.show ? target.getAttribute(\"data-delay-update\") || this.props.delayUpdate : 0;\n var self = this;\n\n var updateState = function updateState() {\n self.setState({\n originTooltip: originTooltip,\n isMultiline: isMultiline,\n desiredPlace: desiredPlace,\n place: place,\n type: target.getAttribute(\"data-type\") || self.props.type || \"dark\",\n customColors: {\n text: target.getAttribute(\"data-text-color\") || self.props.textColor || null,\n background: target.getAttribute(\"data-background-color\") || self.props.backgroundColor || null,\n border: target.getAttribute(\"data-border-color\") || self.props.borderColor || null,\n arrow: target.getAttribute(\"data-arrow-color\") || self.props.arrowColor || null\n },\n effect: effect,\n offset: offset,\n html: (target.getAttribute(\"data-html\") ? target.getAttribute(\"data-html\") === \"true\" : self.props.html) || false,\n delayShow: target.getAttribute(\"data-delay-show\") || self.props.delayShow || 0,\n delayHide: target.getAttribute(\"data-delay-hide\") || self.props.delayHide || 0,\n delayUpdate: target.getAttribute(\"data-delay-update\") || self.props.delayUpdate || 0,\n border: (target.getAttribute(\"data-border\") ? target.getAttribute(\"data-border\") === \"true\" : self.props.border) || false,\n extraClass: target.getAttribute(\"data-class\") || self.props[\"class\"] || self.props.className || \"\",\n disable: (target.getAttribute(\"data-tip-disable\") ? target.getAttribute(\"data-tip-disable\") === \"true\" : self.props.disable) || false,\n currentTarget: target\n }, function () {\n if (scrollHide) {\n self.addScrollListener(self.state.currentTarget);\n }\n\n self.updateTooltip(e);\n\n if (getContent && Array.isArray(getContent)) {\n self.intervalUpdateContent = setInterval(function () {\n if (self.mount) {\n var _getContent = self.props.getContent;\n var placeholder = getTipContent(originTooltip, \"\", _getContent[0](), isMultiline);\n var isEmptyTip = self.isEmptyTip(placeholder);\n self.setState({\n isEmptyTip: isEmptyTip\n });\n self.updatePosition();\n }\n }, getContent[1]);\n }\n });\n }; // If there is no delay call immediately, don't allow events to get in first.\n\n\n if (reshowDelay) {\n this.delayReshow = setTimeout(updateState, reshowDelay);\n } else {\n updateState();\n }\n }\n /**\n * When mouse hover, update tool tip\n */\n\n }, {\n key: \"updateTooltip\",\n value: function updateTooltip(e) {\n var _this5 = this;\n\n var _this$state = this.state,\n delayShow = _this$state.delayShow,\n disable = _this$state.disable;\n var afterShow = this.props.afterShow;\n var placeholder = this.getTooltipContent();\n var delayTime = parseInt(delayShow, 10);\n var eventTarget = e.currentTarget || e.target; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n\n if (this.mouseOnToolTip()) {\n return;\n } // if the tooltip is empty, disable the tooltip\n\n\n if (this.isEmptyTip(placeholder) || disable) {\n return;\n }\n\n var updateState = function updateState() {\n if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {\n var isInvisible = !_this5.state.show;\n\n _this5.setState({\n currentEvent: e,\n currentTarget: eventTarget,\n show: true\n }, function () {\n _this5.updatePosition();\n\n if (isInvisible && afterShow) {\n afterShow(e);\n }\n });\n }\n };\n\n clearTimeout(this.delayShowLoop);\n\n if (delayShow) {\n this.delayShowLoop = setTimeout(updateState, delayTime);\n } else {\n updateState();\n }\n }\n /*\n * If we're mousing over the tooltip remove it when we leave.\n */\n\n }, {\n key: \"listenForTooltipExit\",\n value: function listenForTooltipExit() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.addEventListener(\"mouseleave\", this.hideTooltip);\n }\n }\n }, {\n key: \"removeListenerForTooltipExit\",\n value: function removeListenerForTooltipExit() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.removeEventListener(\"mouseleave\", this.hideTooltip);\n }\n }\n /**\n * When mouse leave, hide tooltip\n */\n\n }, {\n key: \"hideTooltip\",\n value: function hideTooltip(e, hasTarget) {\n var _this6 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n isScroll: false\n };\n var disable = this.state.disable;\n var isScroll = options.isScroll;\n var delayHide = isScroll ? 0 : this.state.delayHide;\n var afterHide = this.props.afterHide;\n var placeholder = this.getTooltipContent();\n if (!this.mount) return;\n if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip\n\n if (hasTarget) {\n // Don't trigger other elements belongs to other ReactTooltip\n var targetArray = this.getTargetArray(this.props.id);\n var isMyElement = targetArray.some(function (ele) {\n return ele === e.currentTarget;\n });\n if (!isMyElement || !this.state.show) return;\n }\n\n var resetState = function resetState() {\n var isVisible = _this6.state.show; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n\n if (_this6.mouseOnToolTip()) {\n _this6.listenForTooltipExit();\n\n return;\n }\n\n _this6.removeListenerForTooltipExit();\n\n _this6.setState({\n show: false\n }, function () {\n _this6.removeScrollListener(_this6.state.currentTarget);\n\n if (isVisible && afterHide) {\n afterHide(e);\n }\n });\n };\n\n this.clearTimer();\n\n if (delayHide) {\n this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));\n } else {\n resetState();\n }\n }\n /**\n * When scroll, hide tooltip\n */\n\n }, {\n key: \"hideTooltipOnScroll\",\n value: function hideTooltipOnScroll(event, hasTarget) {\n this.hideTooltip(event, hasTarget, {\n isScroll: true\n });\n }\n /**\n * Add scroll event listener when tooltip show\n * automatically hide the tooltip when scrolling\n */\n\n }, {\n key: \"addScrollListener\",\n value: function addScrollListener(currentTarget) {\n var isCaptureMode = this.isCapture(currentTarget);\n window.addEventListener(\"scroll\", this.hideTooltipOnScroll, isCaptureMode);\n }\n }, {\n key: \"removeScrollListener\",\n value: function removeScrollListener(currentTarget) {\n var isCaptureMode = this.isCapture(currentTarget);\n window.removeEventListener(\"scroll\", this.hideTooltipOnScroll, isCaptureMode);\n } // Calculation the position\n\n }, {\n key: \"updatePosition\",\n value: function updatePosition() {\n var _this7 = this;\n\n var _this$state2 = this.state,\n currentEvent = _this$state2.currentEvent,\n currentTarget = _this$state2.currentTarget,\n place = _this$state2.place,\n desiredPlace = _this$state2.desiredPlace,\n effect = _this$state2.effect,\n offset = _this$state2.offset;\n var node = this.tooltipRef;\n var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);\n\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);\n }\n\n if (result.isNewState) {\n // Switch to reverse placement\n return this.setState(result.newState, function () {\n _this7.updatePosition();\n });\n } // Set tooltip position\n\n\n node.style.left = result.position.left + \"px\";\n node.style.top = result.position.top + \"px\";\n }\n /**\n * CLear all kinds of timeout of interval\n */\n\n }, {\n key: \"clearTimer\",\n value: function clearTimer() {\n clearTimeout(this.delayShowLoop);\n clearTimeout(this.delayHideLoop);\n clearTimeout(this.delayReshow);\n clearInterval(this.intervalUpdateContent);\n }\n }, {\n key: \"hasCustomColors\",\n value: function hasCustomColors() {\n var _this8 = this;\n\n return Boolean(Object.keys(this.state.customColors).find(function (color) {\n return color !== \"border\" && _this8.state.customColors[color];\n }) || this.state.border && this.state.customColors[\"border\"]);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this9 = this;\n\n var _this$state3 = this.state,\n extraClass = _this$state3.extraClass,\n html = _this$state3.html,\n ariaProps = _this$state3.ariaProps,\n disable = _this$state3.disable;\n var content = this.getTooltipContent();\n var isEmptyTip = this.isEmptyTip(content);\n var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);\n var tooltipClass = \"__react_component_tooltip\" + \" \".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? \" show\" : \"\") + (this.state.border ? \" border\" : \"\") + \" place-\".concat(this.state.place) + // top, bottom, left, right\n \" type-\".concat(this.hasCustomColors() ? \"custom\" : this.state.type) + ( // dark, success, warning, error, info, light, custom\n this.props.delayUpdate ? \" allow_hover\" : \"\") + (this.props.clickable ? \" allow_click\" : \"\");\n var Wrapper = this.props.wrapper;\n\n if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {\n Wrapper = ReactTooltip.defaultProps.wrapper;\n }\n\n var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(\" \");\n\n if (html) {\n var htmlContent = \"\".concat(content, \"\\n\");\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Wrapper, _extends({\n className: \"\".concat(wrapperClassName),\n id: this.props.id,\n ref: function ref(_ref) {\n return _this9.tooltipRef = _ref;\n }\n }, ariaProps, {\n \"data-id\": \"tooltip\",\n dangerouslySetInnerHTML: {\n __html: htmlContent\n }\n }));\n } else {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Wrapper, _extends({\n className: \"\".concat(wrapperClassName),\n id: this.props.id\n }, ariaProps, {\n ref: function ref(_ref2) {\n return _this9.tooltipRef = _ref2;\n },\n \"data-id\": \"tooltip\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"style\", {\n dangerouslySetInnerHTML: {\n __html: style\n }\n }), content);\n }\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var ariaProps = prevState.ariaProps;\n var newAriaProps = parseAria(nextProps);\n var isChanged = Object.keys(newAriaProps).some(function (props) {\n return newAriaProps[props] !== ariaProps[props];\n });\n\n if (!isChanged) {\n return null;\n }\n\n return _objectSpread2({}, prevState, {\n ariaProps: newAriaProps\n });\n }\n }]);\n\n return ReactTooltip;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component), _defineProperty(_class2, \"defaultProps\", {\n insecure: true,\n resizeHide: true,\n wrapper: \"div\",\n clickable: false\n}), _defineProperty(_class2, \"supportedWrappers\", [\"div\", \"span\"]), _defineProperty(_class2, \"displayName\", \"ReactTooltip\"), _temp)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReactTooltip);\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n\n return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (bytesToUuid);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js": +/*!********************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js ***! + \********************************************************************************/ +/*! exports provided: v1, v3, v4, v5 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _v1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v1.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v1\", function() { return _v1_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _v3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v3.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v3\", function() { return _v3_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _v4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./v4.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v4\", function() { return _v4_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _v5_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./v5.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v5\", function() { return _v5_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js": +/*!******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes == 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Array(msg.length);\n\n for (var i = 0; i < msg.length; i++) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var i;\n var x;\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n var hex;\n\n for (i = 0; i < length32; i += 8) {\n x = input[i >> 5] >>> i % 32 & 0xff;\n hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[(len + 64 >>> 9 << 4) + 14] = len;\n var i;\n var olda;\n var oldb;\n var oldc;\n var oldd;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (i = 0; i < x.length; i += 16) {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n var i;\n var output = [];\n output[(input.length >> 2) - 1] = undefined;\n\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0;\n }\n\n var length8 = input.length * 8;\n\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (md5);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js": +/*!******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (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 rng; });\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n// find the complete implementation of crypto (msCrypto) on IE11.\nvar getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);\nvar rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\nfunction rng() {\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n\n return getRandomValues(rnds8);\n}\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes == 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Array(msg.length);\n\n for (var i = 0; i < msg.length; i++) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var i = 0; i < N; i++) {\n M[i] = new Array(16);\n\n for (var j = 0; j < 16; j++) {\n M[i][j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];\n }\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var i = 0; i < N; i++) {\n var W = new Array(80);\n\n for (var t = 0; t < 16; t++) {\n W[t] = M[i][t];\n }\n\n for (var t = 16; t < 80; t++) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var t = 0; t < 80; t++) {\n var s = Math.floor(t / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (sha1);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bytesToUuid.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js\");\n\n // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : Object(_bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(b);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (v1);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _v35_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v35.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js\");\n/* harmony import */ var _md5_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./md5.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js\");\n\n\nvar v3 = Object(_v35_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('v3', 0x30, _md5_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (v3);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js": +/*!******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js ***! + \******************************************************************************/ +/*! exports provided: DNS, URL, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DNS\", function() { return DNS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"URL\", function() { return URL; });\n/* harmony import */ var _bytesToUuid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bytesToUuid.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js\");\n\n\nfunction uuidToBytes(uuid) {\n // Note: We assume we're being passed a valid uuid string\n var bytes = [];\n uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {\n bytes.push(parseInt(hex, 16));\n });\n return bytes;\n}\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = new Array(str.length);\n\n for (var i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n\n return bytes;\n}\n\nvar DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nvar URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (name, version, hashfunc) {\n var generateUUID = function generateUUID(value, namespace, buf, offset) {\n var off = buf && offset || 0;\n if (typeof value == 'string') value = stringToBytes(value);\n if (typeof namespace == 'string') namespace = uuidToBytes(namespace);\n if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');\n if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values'); // Per 4.3\n\n var bytes = hashfunc(namespace.concat(value));\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n for (var idx = 0; idx < 16; ++idx) {\n buf[off + idx] = bytes[idx];\n }\n }\n\n return buf || Object(_bytesToUuid_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(bytes);\n }; // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name;\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n});\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bytesToUuid.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js\");\n\n\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof options == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n\n options = options || {};\n var rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || Object(_bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(rnds);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (v4);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _v35_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v35.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js\");\n/* harmony import */ var _sha1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sha1.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js\");\n\n\nvar v5 = Object(_v35_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('v5', 0x50, _sha1_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (v5);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js?"); + +/***/ }), + /***/ "./node_modules/react/cjs/react.development.js": /*!*****************************************************!*\ !*** ./node_modules/react/cjs/react.development.js ***! @@ -5732,7 +5864,7 @@ eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\ /***/ (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 View404; });\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_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.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 _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\nvar View404 = /*#__PURE__*/function (_React$Component) {\n _inherits(View404, _React$Component);\n\n var _super = _createSuper(View404);\n\n function View404() {\n _classCallCheck(this, View404);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(View404, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-page\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h2\", {\n className: \"headline text-warning\"\n }, \"404\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"exclamation-triangle\",\n classes: \"text-warning\"\n }), \" Oops! Page not found.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"We could not find the page you were looking for. Meanwhile, you may \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"return to dashboard\"), \" or try using the search form.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"form\", {\n className: \"search-form\",\n onSubmit: function onSubmit(e) {\n return e.preventDefault();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"text\",\n name: \"search\",\n className: \"form-control\",\n placeholder: \"Search\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group-append\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"submit\",\n name: \"submit\",\n className: \"btn btn-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"search\"\n })))))));\n }\n }]);\n\n return View404;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/404.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return View404; });\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_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.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 _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\nvar View404 = /*#__PURE__*/function (_React$Component) {\n _inherits(View404, _React$Component);\n\n var _super = _createSuper(View404);\n\n function View404() {\n _classCallCheck(this, View404);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(View404, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-page\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h2\", {\n className: \"headline text-warning\"\n }, \"404\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"exclamation-triangle\",\n className: \"text-warning\"\n }), \" Oops! Page not found.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"We could not find the page you were looking for. Meanwhile, you may \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"return to dashboard\"), \" or try using the search form.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"form\", {\n className: \"search-form\",\n onSubmit: function onSubmit(e) {\n return e.preventDefault();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"text\",\n name: \"search\",\n className: \"form-control\",\n placeholder: \"Search\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group-append\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"submit\",\n name: \"submit\",\n className: \"btn btn-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"search\"\n })))))));\n }\n }]);\n\n return View404;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/404.js?"); /***/ }), @@ -5744,7 +5876,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 API; });\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-polyfill */ \"./node_modules/babel-polyfill/lib/index.js\");\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_polyfill__WEBPACK_IMPORTED_MODULE_0__);\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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\n\n\nvar API = /*#__PURE__*/function () {\n function API() {\n _classCallCheck(this, API);\n\n this.loggedIn = false;\n this.user = {};\n }\n\n _createClass(API, [{\n key: \"csrfToken\",\n value: function csrfToken() {\n return this.loggedIn ? this.user.session.csrf_token : null;\n }\n }, {\n key: \"apiCall\",\n value: function () {\n var _apiCall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(method, params) {\n var response;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n params = params || {};\n params.csrf_token = this.csrfToken();\n _context.next = 4;\n return fetch(\"/api/\" + method, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(params)\n });\n\n case 4:\n response = _context.sent;\n _context.next = 7;\n return response.json();\n\n case 7:\n return _context.abrupt(\"return\", _context.sent);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function apiCall(_x, _x2) {\n return _apiCall.apply(this, arguments);\n }\n\n return apiCall;\n }()\n }, {\n key: \"fetchUser\",\n value: function () {\n var _fetchUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var response, data;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return fetch(\"/api/user/info\");\n\n case 2:\n response = _context2.sent;\n _context2.next = 5;\n return response.json();\n\n case 5:\n data = _context2.sent;\n this.user = data[\"user\"];\n this.loggedIn = data[\"loggedIn\"];\n return _context2.abrupt(\"return\", data && data.success && data.loggedIn);\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function fetchUser() {\n return _fetchUser.apply(this, arguments);\n }\n\n return fetchUser;\n }()\n }, {\n key: \"logout\",\n value: function () {\n var _logout = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this.apiCall(\"user/logout\"));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function logout() {\n return _logout.apply(this, arguments);\n }\n\n return logout;\n }()\n }, {\n key: \"getNotifications\",\n value: function () {\n var _getNotifications = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this.apiCall(\"notifications/fetch\"));\n\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function getNotifications() {\n return _getNotifications.apply(this, arguments);\n }\n\n return getNotifications;\n }()\n }, {\n key: \"fetchUsers\",\n value: function () {\n var _fetchUsers = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {\n var pageNum,\n _args5 = arguments;\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n pageNum = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 1;\n return _context5.abrupt(\"return\", this.apiCall(\"user/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n function fetchUsers() {\n return _fetchUsers.apply(this, arguments);\n }\n\n return fetchUsers;\n }()\n }, {\n key: \"fetchGroups\",\n value: function () {\n var _fetchGroups = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {\n var pageNum,\n _args6 = arguments;\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n pageNum = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : 1;\n return _context6.abrupt(\"return\", this.apiCall(\"groups/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function fetchGroups() {\n return _fetchGroups.apply(this, arguments);\n }\n\n return fetchGroups;\n }()\n }]);\n\n return API;\n}();\n\n\n;\n\n//# sourceURL=webpack:///./src/api.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return API; });\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-polyfill */ \"./node_modules/babel-polyfill/lib/index.js\");\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_polyfill__WEBPACK_IMPORTED_MODULE_0__);\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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\n\n\nvar API = /*#__PURE__*/function () {\n function API() {\n _classCallCheck(this, API);\n\n this.loggedIn = false;\n this.user = {};\n }\n\n _createClass(API, [{\n key: \"csrfToken\",\n value: function csrfToken() {\n return this.loggedIn ? this.user.session.csrf_token : null;\n }\n }, {\n key: \"apiCall\",\n value: function () {\n var _apiCall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(method, params) {\n var response;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n params = params || {};\n params.csrf_token = this.csrfToken();\n _context.next = 4;\n return fetch(\"/api/\" + method, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(params)\n });\n\n case 4:\n response = _context.sent;\n _context.next = 7;\n return response.json();\n\n case 7:\n return _context.abrupt(\"return\", _context.sent);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function apiCall(_x, _x2) {\n return _apiCall.apply(this, arguments);\n }\n\n return apiCall;\n }()\n }, {\n key: \"fetchUser\",\n value: function () {\n var _fetchUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var response, data;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return fetch(\"/api/user/info\");\n\n case 2:\n response = _context2.sent;\n _context2.next = 5;\n return response.json();\n\n case 5:\n data = _context2.sent;\n this.user = data[\"user\"];\n this.loggedIn = data[\"loggedIn\"];\n return _context2.abrupt(\"return\", data && data.success && data.loggedIn);\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function fetchUser() {\n return _fetchUser.apply(this, arguments);\n }\n\n return fetchUser;\n }()\n }, {\n key: \"logout\",\n value: function () {\n var _logout = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this.apiCall(\"user/logout\"));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function logout() {\n return _logout.apply(this, arguments);\n }\n\n return logout;\n }()\n }, {\n key: \"getNotifications\",\n value: function () {\n var _getNotifications = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this.apiCall(\"notifications/fetch\"));\n\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function getNotifications() {\n return _getNotifications.apply(this, arguments);\n }\n\n return getNotifications;\n }()\n }, {\n key: \"fetchUsers\",\n value: function () {\n var _fetchUsers = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {\n var pageNum,\n _args5 = arguments;\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n pageNum = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 1;\n return _context5.abrupt(\"return\", this.apiCall(\"user/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n function fetchUsers() {\n return _fetchUsers.apply(this, arguments);\n }\n\n return fetchUsers;\n }()\n }, {\n key: \"fetchGroups\",\n value: function () {\n var _fetchGroups = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {\n var pageNum,\n _args6 = arguments;\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n pageNum = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : 1;\n return _context6.abrupt(\"return\", this.apiCall(\"groups/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function fetchGroups() {\n return _fetchGroups.apply(this, arguments);\n }\n\n return fetchGroups;\n }()\n }, {\n key: \"inviteUser\",\n value: function () {\n var _inviteUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(username, email) {\n return regeneratorRuntime.wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n return _context7.abrupt(\"return\", this.apiCall(\"user/invite\", {\n username: username,\n email: email\n }));\n\n case 1:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7, this);\n }));\n\n function inviteUser(_x3, _x4) {\n return _inviteUser.apply(this, arguments);\n }\n\n return inviteUser;\n }()\n }, {\n key: \"createUser\",\n value: function () {\n var _createUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(username, email, password, confirmPassword) {\n return regeneratorRuntime.wrap(function _callee8$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n return _context8.abrupt(\"return\", this.apiCall(\"user/create\", {\n username: username,\n email: email,\n password: password,\n confirmPassword: confirmPassword\n }));\n\n case 1:\n case \"end\":\n return _context8.stop();\n }\n }\n }, _callee8, this);\n }));\n\n function createUser(_x5, _x6, _x7, _x8) {\n return _createUser.apply(this, arguments);\n }\n\n return createUser;\n }()\n }]);\n\n return API;\n}();\n\n\n;\n\n//# sourceURL=webpack:///./src/api.js?"); /***/ }), @@ -5756,7 +5888,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 Alert; });\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n\n\nfunction Alert(props) {\n var onClose = props.onClose || function () {};\n\n var title = props.title || \"Untitled Alert\";\n var message = props.message || \"Alert message\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", {\n className: \"alert alert-danger alert-dismissible\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"button\", {\n type: \"button\",\n className: \"close\",\n \"data-dismiss\": \"alert\",\n \"aria-hidden\": \"true\",\n onClick: onClose\n }, \"\\xD7\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"h5\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n icon: \"ban\",\n classes: \"icon\"\n }), \" \", title), message);\n}\n\n//# sourceURL=webpack:///./src/elements/alert.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Alert; });\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n\n\nfunction Alert(props) {\n var onClose = props.onClose || function () {};\n\n var title = props.title || \"Untitled Alert\";\n var message = props.message || \"Alert message\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", {\n className: \"alert alert-danger alert-dismissible\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"button\", {\n type: \"button\",\n className: \"close\",\n \"data-dismiss\": \"alert\",\n \"aria-hidden\": \"true\",\n onClick: onClose\n }, \"\\xD7\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"h5\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n icon: \"ban\",\n className: \"icon\"\n }), \" \", title), message);\n}\n\n//# sourceURL=webpack:///./src/elements/alert.js?"); /***/ }), @@ -5780,7 +5912,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 Icon; });\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__);\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\n\nfunction Icon(props) {\n var classes = props.classes || [];\n classes = Array.isArray(classes) ? classes : classes.toString().split(\" \");\n var type = props.type || \"fas\";\n var icon = props.icon;\n classes.push(type);\n classes.push(\"fa-\" + icon);\n\n if (icon === \"spinner\") {\n classes.push(\"fa-spin\");\n }\n\n var newProps = _objectSpread(_objectSpread({}, props), {}, {\n className: classes.join(\" \")\n });\n\n delete newProps[\"classes\"];\n delete newProps[\"type\"];\n delete newProps[\"icon\"];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"i\", newProps);\n}\n\n//# sourceURL=webpack:///./src/elements/icon.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Icon; });\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__);\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\n\nfunction Icon(props) {\n var classes = props.className || [];\n classes = Array.isArray(classes) ? classes : classes.toString().split(\" \");\n var type = props.type || \"fas\";\n var icon = props.icon;\n classes.push(type);\n classes.push(\"fa-\" + icon);\n\n if (icon === \"spinner\") {\n classes.push(\"fa-spin\");\n }\n\n var newProps = _objectSpread(_objectSpread({}, props), {}, {\n className: classes.join(\" \")\n });\n\n delete newProps[\"type\"];\n delete newProps[\"icon\"];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"i\", newProps);\n}\n\n//# sourceURL=webpack:///./src/elements/icon.js?"); /***/ }), @@ -5838,7 +5970,7 @@ eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dis /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\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_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./include/adminlte.min.css */ \"./src/include/adminlte.min.css\");\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./include/index.css */ \"./src/include/index.css\");\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_include_index_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ \"./src/api.js\");\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./header.js */ \"./src/header.js\");\n/* harmony import */ var _sidebar_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sidebar.js */ \"./src/sidebar.js\");\n/* harmony import */ var _views_users_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./views/users.js */ \"./src/views/users.js\");\n/* harmony import */ var _views_overview_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./views/overview.js */ \"./src/views/overview.js\");\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var _elements_dialog__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./elements/dialog */ \"./src/elements/dialog.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _404__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./404 */ \"./src/404.js\");\n/* harmony import */ var _views_logs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./views/logs */ \"./src/views/logs.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 _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\n\n\nvar AdminDashboard = /*#__PURE__*/function (_React$Component) {\n _inherits(AdminDashboard, _React$Component);\n\n var _super = _createSuper(AdminDashboard);\n\n function AdminDashboard(props) {\n var _this;\n\n _classCallCheck(this, AdminDashboard);\n\n _this = _super.call(this, props);\n _this.api = new _api_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n _this.state = {\n loaded: false,\n dialog: {\n onClose: function onClose() {\n return _this.hideDialog();\n }\n },\n notifications: {}\n };\n _this.controlObj = {\n showDialog: _this.showDialog.bind(_assertThisInitialized(_this)),\n api: _this.api\n };\n return _this;\n }\n\n _createClass(AdminDashboard, [{\n key: \"onUpdate\",\n value: function onUpdate() {\n this.fetchNotifications();\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(message, title) {\n var props = {\n show: true,\n message: message,\n title: title\n };\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), props)\n }));\n }\n }, {\n key: \"hideDialog\",\n value: function hideDialog() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), {}, {\n show: false\n })\n }));\n }\n }, {\n key: \"fetchNotifications\",\n value: function fetchNotifications() {\n var _this2 = this;\n\n this.api.getNotifications().then(function (res) {\n if (!res.success) {\n _this2.showDialog(\"Error fetching notifications: \" + res.msg, \"Error fetching notifications\");\n } else {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n notifications: res.notifications\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this3 = this;\n\n this.api.fetchUser().then(function (Success) {\n if (!Success) {\n document.location = \"/admin\";\n } else {\n _this3.fetchNotifications();\n\n setInterval(_this3.onUpdate.bind(_this3), 60 * 1000);\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true\n }));\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, \"Loading\\u2026 \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n icon: \"spinner\"\n }));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"BrowserRouter\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_header_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidebar_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content-wrapper p-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"section\", {\n className: \"content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Switch\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_overview_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"/admin/users\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_users_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"/admin/logs\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_logs__WEBPACK_IMPORTED_MODULE_13__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"*\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_404__WEBPACK_IMPORTED_MODULE_12__[\"default\"], null))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_dialog__WEBPACK_IMPORTED_MODULE_10__[\"default\"], this.state.dialog))));\n }\n }]);\n\n return AdminDashboard;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(AdminDashboard, null), document.getElementById('root'));\n\n//# sourceURL=webpack:///./src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\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_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./include/adminlte.min.css */ \"./src/include/adminlte.min.css\");\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./include/index.css */ \"./src/include/index.css\");\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_include_index_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ \"./src/api.js\");\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./header.js */ \"./src/header.js\");\n/* harmony import */ var _sidebar_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sidebar.js */ \"./src/sidebar.js\");\n/* harmony import */ var _views_users_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./views/users.js */ \"./src/views/users.js\");\n/* harmony import */ var _views_overview_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./views/overview.js */ \"./src/views/overview.js\");\n/* harmony import */ var _views_adduser__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./views/adduser */ \"./src/views/adduser.js\");\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var _elements_dialog__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./elements/dialog */ \"./src/elements/dialog.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _404__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./404 */ \"./src/404.js\");\n/* harmony import */ var _views_logs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./views/logs */ \"./src/views/logs.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 _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\n\n\n\nvar AdminDashboard = /*#__PURE__*/function (_React$Component) {\n _inherits(AdminDashboard, _React$Component);\n\n var _super = _createSuper(AdminDashboard);\n\n function AdminDashboard(props) {\n var _this;\n\n _classCallCheck(this, AdminDashboard);\n\n _this = _super.call(this, props);\n _this.api = new _api_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n _this.state = {\n loaded: false,\n dialog: {\n onClose: function onClose() {\n return _this.hideDialog();\n }\n },\n notifications: {}\n };\n _this.controlObj = {\n showDialog: _this.showDialog.bind(_assertThisInitialized(_this)),\n api: _this.api\n };\n return _this;\n }\n\n _createClass(AdminDashboard, [{\n key: \"onUpdate\",\n value: function onUpdate() {\n this.fetchNotifications();\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(message, title) {\n var props = {\n show: true,\n message: message,\n title: title\n };\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), props)\n }));\n }\n }, {\n key: \"hideDialog\",\n value: function hideDialog() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), {}, {\n show: false\n })\n }));\n }\n }, {\n key: \"fetchNotifications\",\n value: function fetchNotifications() {\n var _this2 = this;\n\n this.api.getNotifications().then(function (res) {\n if (!res.success) {\n _this2.showDialog(\"Error fetching notifications: \" + res.msg, \"Error fetching notifications\");\n } else {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n notifications: res.notifications\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this3 = this;\n\n this.api.fetchUser().then(function (Success) {\n if (!Success) {\n document.location = \"/admin\";\n } else {\n _this3.fetchNotifications();\n\n setInterval(_this3.onUpdate.bind(_this3), 60 * 1000);\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true\n }));\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, \"Loading\\u2026 \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n icon: \"spinner\"\n }));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"BrowserRouter\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_header_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidebar_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content-wrapper p-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"section\", {\n className: \"content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Switch\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n path: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_overview_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n exact: true,\n path: \"/admin/users\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_users_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n exact: true,\n path: \"/admin/users/adduser\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_adduser__WEBPACK_IMPORTED_MODULE_9__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n path: \"/admin/logs\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_logs__WEBPACK_IMPORTED_MODULE_14__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n path: \"*\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_404__WEBPACK_IMPORTED_MODULE_13__[\"default\"], null))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_dialog__WEBPACK_IMPORTED_MODULE_11__[\"default\"], this.state.dialog))));\n }\n }]);\n\n return AdminDashboard;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(AdminDashboard, null), document.getElementById('root'));\n\n//# sourceURL=webpack:///./src/index.js?"); /***/ }), @@ -5850,7 +5982,19 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac /***/ (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 Sidebar; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n\n\n\nfunction Sidebar(props) {\n var parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n\n function onLogout() {\n parent.api.logout().then(function (obj) {\n if (obj.success) {\n document.location = \"/admin\";\n } else {\n parent.showDialog(\"Error logging out: \" + obj.msg, \"Error logging out\");\n }\n });\n }\n\n var menuItems = {\n \"dashboard\": {\n \"name\": \"Dashboard\",\n \"icon\": \"tachometer-alt\"\n },\n \"users\": {\n \"name\": \"Users & Groups\",\n \"icon\": \"users\"\n },\n \"settings\": {\n \"name\": \"Settings\",\n \"icon\": \"tools\"\n },\n \"logs\": {\n \"name\": \"Logs & Notifications\",\n \"icon\": \"file-medical-alt\"\n },\n \"help\": {\n \"name\": \"Help\",\n \"icon\": \"question-circle\"\n }\n };\n var numNotifications = Object.keys(props.notifications).length;\n\n if (numNotifications > 0) {\n if (numNotifications > 9) numNotifications = \"9+\";\n menuItems[\"logs\"][\"badge\"] = {\n type: \"warning\",\n value: numNotifications\n };\n }\n\n var li = [];\n\n for (var id in menuItems) {\n var obj = menuItems[id];\n var badge = obj.badge ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"right badge badge-\" + obj.badge.type\n }, obj.badge.value) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null);\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: id,\n className: \"nav-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"NavLink\"], {\n to: \"/admin/\" + id,\n className: \"nav-link\",\n activeClassName: \"active\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: obj.icon,\n classes: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, obj.name, badge))));\n }\n\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"nav-item\",\n key: \"logout\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n onClick: function onClick() {\n return onLogout();\n },\n className: \"nav-link\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"arrow-left\",\n classes: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Logout\"))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"aside\", {\n className: \"main-sidebar sidebar-dark-primary elevation-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"brand-link\",\n to: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"/img/icons/logo.png\",\n alt: \"Logo\",\n className: \"brand-image img-circle elevation-3\",\n style: {\n opacity: \".8\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"brand-text font-weight-light ml-2\"\n }, \"WebBase\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"sidebar os-host os-theme-light os-host-overflow os-host-overflow-y os-host-resize-disabled os-host-scrollbar-horizontal-hidden os-host-transition\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer-host\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\",\n style: {\n left: \"0px\",\n right: \"auto\"\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-size-auto-observer\",\n style: {\n height: \"calc(100% + 1px)\",\n float: \"left\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content-glue\",\n style: {\n margin: \"0px -8px\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-padding\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-viewport os-viewport-native-scrollbars-invisible\",\n style: {\n right: \"0px\",\n bottom: \"0px\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content\",\n style: {\n padding: \"0px 0px\",\n height: \"100%\",\n width: \"100%\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"user-panel mt-3 pb-3 mb-3 d-flex\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n className: \"d-block\"\n }, \"Logged in as: \", parent.api.user.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"nav\", {\n className: \"mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"nav nav-pills nav-sidebar flex-column\",\n \"data-widget\": \"treeview\",\n role: \"menu\",\n \"data-accordion\": \"false\"\n }, li)))))));\n}\n\n//# sourceURL=webpack:///./src/sidebar.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Sidebar; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n\n\n\nfunction Sidebar(props) {\n var parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n\n function onLogout() {\n parent.api.logout().then(function (obj) {\n if (obj.success) {\n document.location = \"/admin\";\n } else {\n parent.showDialog(\"Error logging out: \" + obj.msg, \"Error logging out\");\n }\n });\n }\n\n var menuItems = {\n \"dashboard\": {\n \"name\": \"Dashboard\",\n \"icon\": \"tachometer-alt\"\n },\n \"users\": {\n \"name\": \"Users & Groups\",\n \"icon\": \"users\"\n },\n \"settings\": {\n \"name\": \"Settings\",\n \"icon\": \"tools\"\n },\n \"logs\": {\n \"name\": \"Logs & Notifications\",\n \"icon\": \"file-medical-alt\"\n },\n \"help\": {\n \"name\": \"Help\",\n \"icon\": \"question-circle\"\n }\n };\n var numNotifications = Object.keys(props.notifications).length;\n\n if (numNotifications > 0) {\n if (numNotifications > 9) numNotifications = \"9+\";\n menuItems[\"logs\"][\"badge\"] = {\n type: \"warning\",\n value: numNotifications\n };\n }\n\n var li = [];\n\n for (var id in menuItems) {\n var obj = menuItems[id];\n var badge = obj.badge ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"right badge badge-\" + obj.badge.type\n }, obj.badge.value) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null);\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: id,\n className: \"nav-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"NavLink\"], {\n to: \"/admin/\" + id,\n className: \"nav-link\",\n activeClassName: \"active\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: obj.icon,\n className: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, obj.name, badge))));\n }\n\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"nav-item\",\n key: \"logout\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n onClick: function onClick() {\n return onLogout();\n },\n className: \"nav-link\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"arrow-left\",\n className: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Logout\"))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"aside\", {\n className: \"main-sidebar sidebar-dark-primary elevation-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"brand-link\",\n to: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"/img/icons/logo.png\",\n alt: \"Logo\",\n className: \"brand-image img-circle elevation-3\",\n style: {\n opacity: \".8\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"brand-text font-weight-light ml-2\"\n }, \"WebBase\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"sidebar os-host os-theme-light os-host-overflow os-host-overflow-y os-host-resize-disabled os-host-scrollbar-horizontal-hidden os-host-transition\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer-host\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\",\n style: {\n left: \"0px\",\n right: \"auto\"\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-size-auto-observer\",\n style: {\n height: \"calc(100% + 1px)\",\n float: \"left\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content-glue\",\n style: {\n margin: \"0px -8px\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-padding\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-viewport os-viewport-native-scrollbars-invisible\",\n style: {\n right: \"0px\",\n bottom: \"0px\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content\",\n style: {\n padding: \"0px 0px\",\n height: \"100%\",\n width: \"100%\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"user-panel mt-3 pb-3 mb-3 d-flex\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n className: \"d-block\"\n }, \"Logged in as: \", parent.api.user.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"nav\", {\n className: \"mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"nav nav-pills nav-sidebar flex-column\",\n \"data-widget\": \"treeview\",\n role: \"menu\",\n \"data-accordion\": \"false\"\n }, li)))))));\n}\n\n//# sourceURL=webpack:///./src/sidebar.js?"); + +/***/ }), + +/***/ "./src/views/adduser.js": +/*!******************************!*\ + !*** ./src/views/adduser.js ***! + \******************************/ +/*! exports provided: default */ +/***/ (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 CreateUser; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_4__ = __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 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 _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 _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\nvar CreateUser = /*#__PURE__*/function (_React$Component) {\n _inherits(CreateUser, _React$Component);\n\n var _super = _createSuper(CreateUser);\n\n function CreateUser(props) {\n var _this;\n\n _classCallCheck(this, CreateUser);\n\n _this = _super.call(this, props);\n _this.state = {\n errors: [],\n sendInvite: true\n };\n return _this;\n }\n\n _createClass(CreateUser, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this2.removeError(i);\n }\n }, _this2.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n var passwordForm = null;\n\n if (!this.state.sendInvite) {\n passwordForm = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"password\"\n }, \"Password\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"password\",\n className: \"form-control\",\n placeholder: \"Password\",\n id: \"password\",\n name: \"password\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"confirmPassword\"\n }, \"Confirm Password\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"password\",\n className: \"form-control\",\n placeholder: \"Confirm Password\",\n id: \"confirmPassword\",\n name: \"confirmPassword\"\n })));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Create a new user\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/users\"\n }, \"Users\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Add User\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6 p-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"form\", {\n role: \"form\",\n onSubmit: function onSubmit(e) {\n return _this2.submitForm(e);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"username\"\n }, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"text\",\n className: \"form-control\",\n placeholder: \"Enter username\",\n name: \"username\",\n id: \"username\",\n maxLength: 32\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"email\"\n }, \"E-Mail\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"email\",\n className: \"form-control\",\n placeholder: \"E-Mail address\",\n id: \"email\",\n name: \"email\",\n maxLength: 64\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n onChange: function onChange() {\n return _this2.onCheckboxChange();\n },\n id: \"sendInvite\",\n name: \"sendInvite\",\n defaultChecked: this.state.sendInvite\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n className: \"form-check-label\",\n htmlFor: \"sendInvite\"\n }, \"Send Invitation\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n icon: \"question-circle\",\n className: \"ml-2\",\n style: {\n \"color\": \"#0069d9\"\n },\n \"data-tip\": \"The user will receive an invitation token via email and can choose the password on his own.\",\n \"data-type\": \"info\",\n \"data-place\": \"right\",\n \"data-effect\": \"solid\"\n }))), passwordForm, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"submit\",\n className: \"btn btn-primary mt-2\"\n }, \"Submit\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_tooltip__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null));\n }\n }, {\n key: \"submitForm\",\n value: function submitForm(e) {\n e.preventDefault();\n }\n }, {\n key: \"onCheckboxChange\",\n value: function onCheckboxChange() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n sendInvite: !this.state.sendInvite\n }));\n }\n }]);\n\n return CreateUser;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/adduser.js?"); /***/ }), @@ -5886,7 +6030,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 UserOverview; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./src/global.js\");\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.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 _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\nvar UserOverview = /*#__PURE__*/function (_React$Component) {\n _inherits(UserOverview, _React$Component);\n\n var _super = _createSuper(UserOverview);\n\n function UserOverview(props) {\n var _this;\n\n _classCallCheck(this, UserOverview);\n\n _this = _super.call(this, props);\n _this.parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n _this.state = {\n loaded: false,\n users: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n groups: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n errors: []\n };\n return _this;\n }\n\n _createClass(UserOverview, [{\n key: \"fetchGroups\",\n value: function fetchGroups(page) {\n var _this2 = this;\n\n page = page || this.state.groups.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n groups: _objectSpread(_objectSpread({}, this.state.groups), {}, {\n data: {},\n page: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchGroups(page).then(function (res) {\n if (res.success) {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n groups: {\n data: res.groups,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n title: \"Error fetching groups\",\n message: res.msg\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n }\n\n if (!_this2.state.loaded) {\n _this2.fetchUsers(1);\n }\n });\n }\n }, {\n key: \"fetchUsers\",\n value: function fetchUsers(page) {\n var _this3 = this;\n\n page = page || this.state.users.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n users: _objectSpread(_objectSpread({}, this.state.users), {}, {\n data: {},\n pageCount: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchUsers(page).then(function (res) {\n if (res.success) {\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n users: {\n data: res.users,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this3.state.errors.slice();\n\n errors.push({\n title: \"Error fetching users\",\n message: res.msg\n });\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n errors: errors\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n loaded: false\n }));\n this.fetchGroups(1);\n }\n }, {\n key: \"removeError\",\n value: function removeError(i) {\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 key: \"render\",\n value: function render() {\n var _this4 = this;\n\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"text-center mt-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, \"Loading\\u2026\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"spinner\"\n })));\n }\n\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this4.removeError(i);\n }\n }, _this4.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Users & Groups\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Users\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createUserCard()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createGroupCard())))));\n }\n }, {\n key: \"createUserCard\",\n value: function createUserCard() {\n var _this5 = this;\n\n var userRows = [];\n\n for (var uid in this.state.users.data) {\n if (!this.state.users.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var user = this.state.users.data[uid];\n var groups = [];\n\n for (var groupId in user.groups) {\n if (user.groups.hasOwnProperty(groupId)) {\n var groupName = user.groups[groupId];\n var color = groupId === \"1\" ? \"danger\" : \"secondary\";\n groups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"span\", {\n key: \"group-\" + groupId,\n className: \"mr-1 badge badge-\" + color\n }, groupName));\n }\n }\n\n userRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"user-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, groups), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, Object(_global__WEBPACK_IMPORTED_MODULE_3__[\"getPeriodString\"])(user.registered_at))));\n }\n\n var pages = [];\n var previousDisabled = this.state.users.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.users.page >= this.state.users.pageCount ? \" disabled\" : \"\";\n\n var _loop2 = function _loop2(i) {\n var active = _this5.state.users.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.users.pageCount; i++) {\n _loop2(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Users\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this5.fetchUsers();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Email\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Registered\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, userRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.users.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page + 1);\n }\n }, \"Next\")))))));\n }\n }, {\n key: \"createGroupCard\",\n value: function createGroupCard() {\n var _this6 = this;\n\n var groupRows = [];\n\n for (var uid in this.state.groups.data) {\n if (!this.state.groups.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var group = this.state.groups.data[uid];\n groupRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"group-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.memberCount)));\n }\n\n var pages = [];\n var previousDisabled = this.state.groups.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.groups.page >= this.state.groups.pageCount ? \" disabled\" : \"\";\n\n var _loop3 = function _loop3(i) {\n var active = _this6.state.groups.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.groups.pageCount; i++) {\n _loop3(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this6.fetchGroups();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Members\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, groupRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.groups.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page + 1);\n }\n }, \"Next\")))))));\n }\n }]);\n\n return UserOverview;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/users.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return UserOverview; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./src/global.js\");\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.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 _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\nvar UserOverview = /*#__PURE__*/function (_React$Component) {\n _inherits(UserOverview, _React$Component);\n\n var _super = _createSuper(UserOverview);\n\n function UserOverview(props) {\n var _this;\n\n _classCallCheck(this, UserOverview);\n\n _this = _super.call(this, props);\n _this.parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n _this.state = {\n loaded: false,\n users: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n groups: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n errors: []\n };\n return _this;\n }\n\n _createClass(UserOverview, [{\n key: \"fetchGroups\",\n value: function fetchGroups(page) {\n var _this2 = this;\n\n page = page || this.state.groups.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n groups: _objectSpread(_objectSpread({}, this.state.groups), {}, {\n data: {},\n page: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchGroups(page).then(function (res) {\n if (res.success) {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n groups: {\n data: res.groups,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n title: \"Error fetching groups\",\n message: res.msg\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n }\n\n if (!_this2.state.loaded) {\n _this2.fetchUsers(1);\n }\n });\n }\n }, {\n key: \"fetchUsers\",\n value: function fetchUsers(page) {\n var _this3 = this;\n\n page = page || this.state.users.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n users: _objectSpread(_objectSpread({}, this.state.users), {}, {\n data: {},\n pageCount: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchUsers(page).then(function (res) {\n if (res.success) {\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n users: {\n data: res.users,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this3.state.errors.slice();\n\n errors.push({\n title: \"Error fetching users\",\n message: res.msg\n });\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n errors: errors\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n loaded: false\n }));\n this.fetchGroups(1);\n }\n }, {\n key: \"removeError\",\n value: function removeError(i) {\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 key: \"render\",\n value: function render() {\n var _this4 = this;\n\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"text-center mt-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, \"Loading\\u2026\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"spinner\"\n })));\n }\n\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this4.removeError(i);\n }\n }, _this4.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Users & Groups\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Users\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createUserCard()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createGroupCard())))));\n }\n }, {\n key: \"createUserCard\",\n value: function createUserCard() {\n var _this5 = this;\n\n var userRows = [];\n\n for (var uid in this.state.users.data) {\n if (!this.state.users.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var user = this.state.users.data[uid];\n var groups = [];\n\n for (var groupId in user.groups) {\n if (user.groups.hasOwnProperty(groupId)) {\n var groupName = user.groups[groupId];\n var color = groupId === \"1\" ? \"danger\" : \"secondary\";\n groups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"span\", {\n key: \"group-\" + groupId,\n className: \"mr-1 badge badge-\" + color\n }, groupName));\n }\n }\n\n userRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"user-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, groups), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, Object(_global__WEBPACK_IMPORTED_MODULE_3__[\"getPeriodString\"])(user.registered_at))));\n }\n\n var pages = [];\n var previousDisabled = this.state.users.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.users.page >= this.state.users.pageCount ? \" disabled\" : \"\";\n\n var _loop2 = function _loop2(i) {\n var active = _this5.state.users.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.users.pageCount; i++) {\n _loop2(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Users\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n to: \"/admin/users/adduser\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"plus\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this5.fetchUsers();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Email\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Registered\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, userRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.users.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page + 1);\n }\n }, \"Next\")))))));\n }\n }, {\n key: \"createGroupCard\",\n value: function createGroupCard() {\n var _this6 = this;\n\n var groupRows = [];\n\n for (var uid in this.state.groups.data) {\n if (!this.state.groups.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var group = this.state.groups.data[uid];\n groupRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"group-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.memberCount)));\n }\n\n var pages = [];\n var previousDisabled = this.state.groups.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.groups.page >= this.state.groups.pageCount ? \" disabled\" : \"\";\n\n var _loop3 = function _loop3(i) {\n var active = _this6.state.groups.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.groups.pageCount; i++) {\n _loop3(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n to: \"/admin/users/addgroup\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"plus\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this6.fetchGroups();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Members\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, groupRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.groups.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page + 1);\n }\n }, \"Next\")))))));\n }\n }]);\n\n return UserOverview;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/users.js?"); /***/ }) diff --git a/admin/package-lock.json b/admin/package-lock.json index 67c60de..3385aa5 100644 --- a/admin/package-lock.json +++ b/admin/package-lock.json @@ -10962,6 +10962,22 @@ } } }, + "react-tooltip": { + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-4.2.7.tgz", + "integrity": "sha512-z5T3gNplT76rkT7ZImfx/uXfBtS+x7+WK2H8MVZ5skSwETDDx0hs0+P0jwL5gYDaBvsZ7LYiCBzAOd3tN85CMA==", + "requires": { + "prop-types": "^15.7.2", + "uuid": "^7.0.3" + }, + "dependencies": { + "uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" + } + } + }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", diff --git a/admin/package.json b/admin/package.json index aa519e4..beaf129 100644 --- a/admin/package.json +++ b/admin/package.json @@ -10,7 +10,8 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "react-router-dom": "^5.2.0", - "react-scripts": "3.4.1" + "react-scripts": "3.4.1", + "react-tooltip": "^4.2.7" }, "scripts": { "build": "webpack --mode development && cp dist/main.js ../js/admin.min.js" diff --git a/admin/src/404.js b/admin/src/404.js index 801dbfc..b750029 100644 --- a/admin/src/404.js +++ b/admin/src/404.js @@ -8,7 +8,7 @@ export default class View404 extends React.Component {

404

- Oops! Page not found. + Oops! Page not found.

We could not find the page you were looking for. diff --git a/admin/src/api.js b/admin/src/api.js index 4529f89..cf54bdd 100644 --- a/admin/src/api.js +++ b/admin/src/api.js @@ -45,4 +45,12 @@ export default class API { async fetchGroups(pageNum = 1) { return this.apiCall("groups/fetch", { page: pageNum }); } + + async inviteUser(username, email) { + return this.apiCall("user/invite", { username: username, email: email }); + } + + async createUser(username, email, password, confirmPassword) { + return this.apiCall("user/create", { username: username, email: email, password: password, confirmPassword: confirmPassword }); + } }; \ No newline at end of file diff --git a/admin/src/elements/alert.js b/admin/src/elements/alert.js index ea1773f..e1bf417 100644 --- a/admin/src/elements/alert.js +++ b/admin/src/elements/alert.js @@ -11,7 +11,7 @@ export default function Alert(props) { return (

-
{title}
+
{title}
{message}
) diff --git a/admin/src/elements/icon.js b/admin/src/elements/icon.js index 44f01db..b9f8bb1 100644 --- a/admin/src/elements/icon.js +++ b/admin/src/elements/icon.js @@ -2,7 +2,7 @@ import * as React from "react"; export default function Icon(props) { - let classes = props.classes || []; + let classes = props.className || []; classes = Array.isArray(classes) ? classes : classes.toString().split(" "); let type = props.type || "fas"; let icon = props.icon; @@ -15,7 +15,6 @@ export default function Icon(props) { } let newProps = {...props, className: classes.join(" ") }; - delete newProps["classes"]; delete newProps["type"]; delete newProps["icon"]; diff --git a/admin/src/index.js b/admin/src/index.js index a32ef2b..2f5aba6 100644 --- a/admin/src/index.js +++ b/admin/src/index.js @@ -7,6 +7,7 @@ import Header from './header.js'; import Sidebar from './sidebar.js'; import UserOverview from './views/users.js'; import Overview from './views/overview.js' +import CreateUser from "./views/adduser"; import Icon from "./elements/icon"; import Dialog from "./elements/dialog"; import {BrowserRouter as Router, Route, Switch} from 'react-router-dom' @@ -77,7 +78,8 @@ class AdminDashboard extends React.Component {
- + + diff --git a/admin/src/sidebar.js b/admin/src/sidebar.js index 0d8fd1c..ad9d2b8 100644 --- a/admin/src/sidebar.js +++ b/admin/src/sidebar.js @@ -56,7 +56,7 @@ export default function Sidebar(props) { li.push(
  • -

    {obj.name}{badge}

    +

    {obj.name}{badge}

  • ); @@ -64,7 +64,7 @@ export default function Sidebar(props) { li.push(
  • onLogout()} className={"nav-link"}> - +

    Logout

  • ); diff --git a/admin/src/views/adduser.js b/admin/src/views/adduser.js new file mode 100644 index 0000000..b4be66b --- /dev/null +++ b/admin/src/views/adduser.js @@ -0,0 +1,103 @@ +import * as React from "react"; +import {Link} from "react-router-dom"; +import Alert from "../elements/alert"; +import Icon from "../elements/icon"; +import ReactTooltip from 'react-tooltip' + +export default class CreateUser extends React.Component { + + constructor(props) { + super(props); + this.state = { + errors: [], + sendInvite: true + } + } + + render() { + + let errors = []; + for (let i = 0; i < this.state.errors.length; i++) { + errors.push( this.removeError(i)} {...this.state.errors[i]}/>) + } + + let passwordForm = null; + if (!this.state.sendInvite) { + passwordForm =
    +
    + + +
    +
    + + +
    +
    + } + + return <> +
    +
    +
    +
    +

    Create a new user

    +
    +
    +
      +
    1. Home
    2. +
    3. Users
    4. +
    5. Add User
    6. +
    +
    +
    +
    +
    +
    + {errors} +
    +
    +
    this.submitForm(e)}> +
    + + +
    +
    + + +
    +
    + this.onCheckboxChange()} + id={"sendInvite"} name={"sendInvite"} defaultChecked={this.state.sendInvite}/> + +
    + {passwordForm} + +
    +
    +
    +
    + + ; + } + + submitForm(e) { + e.preventDefault(); + } + + onCheckboxChange() { + this.setState({ + ...this.state, + sendInvite: !this.state.sendInvite, + }); + } +} \ No newline at end of file diff --git a/admin/src/views/users.js b/admin/src/views/users.js index 1b9f770..4666dbf 100644 --- a/admin/src/views/users.js +++ b/admin/src/views/users.js @@ -193,6 +193,9 @@ export default class UserOverview extends React.Component {

    Users

    + + + this.fetchUsers()}> @@ -274,6 +277,9 @@ export default class UserOverview extends React.Component {

    Groups

    + + + this.fetchGroups()}> diff --git a/core/Api/User/Create.class.php b/core/Api/User/Create.class.php new file mode 100644 index 0000000..7880b6f --- /dev/null +++ b/core/Api/User/Create.class.php @@ -0,0 +1,31 @@ + new StringType('username', 32), + 'email' => new StringType('email', 64, true), + 'password' => new StringType('password'), + 'confirmPassword' => new StringType('confirmPassword'), + )); + $this->csrfTokenRequired = true; + $this->loginRequired = true; + $this->requiredGroup = USER_GROUP_ADMIN; + } + + public function execute($values = array()) { + if(!parent::execute($values)) { + return false; + } + + // TODO: + + return $this->success; + } +} \ No newline at end of file diff --git a/core/Api/User/Invite.class.php b/core/Api/User/Invite.class.php new file mode 100644 index 0000000..9a6b463 --- /dev/null +++ b/core/Api/User/Invite.class.php @@ -0,0 +1,29 @@ + new StringType('username', 32), + 'email' => new StringType('email', 64), + )); + $this->csrfTokenRequired = true; + $this->loginRequired = true; + $this->requiredGroup = USER_GROUP_ADMIN; + } + + public function execute($values = array()) { + if(!parent::execute($values)) { + return false; + } + + // TODO: + + return $this->success; + } +} \ No newline at end of file diff --git a/js/admin.min.js b/js/admin.min.js index c487f12..1c33191 100644 --- a/js/admin.min.js +++ b/js/admin.min.js @@ -5560,6 +5560,138 @@ eval("var isarray = __webpack_require__(/*! isarray */ \"./node_modules/react-ro /***/ }), +/***/ "./node_modules/react-tooltip/dist/index.es.js": +/*!*****************************************************!*\ + !*** ./node_modules/react-tooltip/dist/index.es.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\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 prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js\");\nfunction ___$insertStyle(css) {\n if (!css) {\n return;\n }\n if (typeof window === 'undefined') {\n return;\n }\n\n var style = document.createElement('style');\n\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n document.head.appendChild(style);\n return css;\n}\n\n\n\n\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nvar CONSTANT = {\n GLOBAL: {\n HIDE: \"__react_tooltip_hide_event\",\n REBUILD: \"__react_tooltip_rebuild_event\",\n SHOW: \"__react_tooltip_show_event\"\n }\n};\n\n/**\n * Static methods for react-tooltip\n */\n\nvar dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {\n // Compatible with IE\n // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work\n // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\n var event;\n\n if (typeof window.CustomEvent === \"function\") {\n event = new window.CustomEvent(eventName, {\n detail: opts\n });\n } else {\n event = document.createEvent(\"Event\");\n event.initEvent(eventName, false, true, opts);\n }\n\n window.dispatchEvent(event);\n};\n\nfunction staticMethods (target) {\n /**\n * Hide all tooltip\n * @trigger ReactTooltip.hide()\n */\n target.hide = function (target) {\n dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {\n target: target\n });\n };\n /**\n * Rebuild all tooltip\n * @trigger ReactTooltip.rebuild()\n */\n\n\n target.rebuild = function () {\n dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);\n };\n /**\n * Show specific tooltip\n * @trigger ReactTooltip.show()\n */\n\n\n target.show = function (target) {\n dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {\n target: target\n });\n };\n\n target.prototype.globalRebuild = function () {\n if (this.mount) {\n this.unbindListener();\n this.bindListener();\n }\n };\n\n target.prototype.globalShow = function (event) {\n if (this.mount) {\n var hasTarget = event && event.detail && event.detail.target && true || false; // Create a fake event, specific show will limit the type to `solid`\n // only `float` type cares e.clientX e.clientY\n\n this.showTooltip({\n currentTarget: hasTarget && event.detail.target\n }, true);\n }\n };\n\n target.prototype.globalHide = function (event) {\n if (this.mount) {\n var hasTarget = event && event.detail && event.detail.target && true || false;\n this.hideTooltip({\n currentTarget: hasTarget && event.detail.target\n }, hasTarget);\n }\n };\n}\n\n/**\n * Events that should be bound to the window\n */\nfunction windowListener (target) {\n target.prototype.bindWindowEvents = function (resizeHide) {\n // ReactTooltip.hide\n window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);\n window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild\n\n window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);\n window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show\n\n window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);\n window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize\n\n if (resizeHide) {\n window.removeEventListener(\"resize\", this.onWindowResize);\n window.addEventListener(\"resize\", this.onWindowResize, false);\n }\n };\n\n target.prototype.unbindWindowEvents = function () {\n window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);\n window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);\n window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);\n window.removeEventListener(\"resize\", this.onWindowResize);\n };\n /**\n * invoked by resize event of window\n */\n\n\n target.prototype.onWindowResize = function () {\n if (!this.mount) return;\n this.hideTooltip();\n };\n}\n\n/**\n * Custom events to control showing and hiding of tooltip\n *\n * @attributes\n * - `event` {String}\n * - `eventOff` {String}\n */\nvar checkStatus = function checkStatus(dataEventOff, e) {\n var show = this.state.show;\n var id = this.props.id;\n var isCapture = this.isCapture(e.currentTarget);\n var currentItem = e.currentTarget.getAttribute(\"currentItem\");\n if (!isCapture) e.stopPropagation();\n\n if (show && currentItem === \"true\") {\n if (!dataEventOff) this.hideTooltip(e);\n } else {\n e.currentTarget.setAttribute(\"currentItem\", \"true\");\n setUntargetItems(e.currentTarget, this.getTargetArray(id));\n this.showTooltip(e);\n }\n};\n\nvar setUntargetItems = function setUntargetItems(currentTarget, targetArray) {\n for (var i = 0; i < targetArray.length; i++) {\n if (currentTarget !== targetArray[i]) {\n targetArray[i].setAttribute(\"currentItem\", \"false\");\n } else {\n targetArray[i].setAttribute(\"currentItem\", \"true\");\n }\n }\n};\n\nvar customListeners = {\n id: \"9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf\",\n set: function set(target, event, listener) {\n if (this.id in target) {\n var map = target[this.id];\n map[event] = listener;\n } else {\n // this is workaround for WeakMap, which is not supported in older browsers, such as IE\n Object.defineProperty(target, this.id, {\n configurable: true,\n value: _defineProperty({}, event, listener)\n });\n }\n },\n get: function get(target, event) {\n var map = target[this.id];\n\n if (map !== undefined) {\n return map[event];\n }\n }\n};\nfunction customEvent (target) {\n target.prototype.isCustomEvent = function (ele) {\n var event = this.state.event;\n return event || !!ele.getAttribute(\"data-event\");\n };\n /* Bind listener for custom event */\n\n\n target.prototype.customBindListener = function (ele) {\n var _this = this;\n\n var _this$state = this.state,\n event = _this$state.event,\n eventOff = _this$state.eventOff;\n var dataEvent = ele.getAttribute(\"data-event\") || event;\n var dataEventOff = ele.getAttribute(\"data-event-off\") || eventOff;\n dataEvent.split(\" \").forEach(function (event) {\n ele.removeEventListener(event, customListeners.get(ele, event));\n var customListener = checkStatus.bind(_this, dataEventOff);\n customListeners.set(ele, event, customListener);\n ele.addEventListener(event, customListener, false);\n });\n\n if (dataEventOff) {\n dataEventOff.split(\" \").forEach(function (event) {\n ele.removeEventListener(event, _this.hideTooltip);\n ele.addEventListener(event, _this.hideTooltip, false);\n });\n }\n };\n /* Unbind listener for custom event */\n\n\n target.prototype.customUnbindListener = function (ele) {\n var _this$state2 = this.state,\n event = _this$state2.event,\n eventOff = _this$state2.eventOff;\n var dataEvent = event || ele.getAttribute(\"data-event\");\n var dataEventOff = eventOff || ele.getAttribute(\"data-event-off\");\n ele.removeEventListener(dataEvent, customListeners.get(ele, event));\n if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);\n };\n}\n\n/**\n * Util method to judge if it should follow capture model\n */\nfunction isCapture (target) {\n target.prototype.isCapture = function (currentTarget) {\n return currentTarget && currentTarget.getAttribute(\"data-iscapture\") === \"true\" || this.props.isCapture || false;\n };\n}\n\n/**\n * Util method to get effect\n */\nfunction getEffect (target) {\n target.prototype.getEffect = function (currentTarget) {\n var dataEffect = currentTarget.getAttribute(\"data-effect\");\n return dataEffect || this.props.effect || \"float\";\n };\n}\n\n/**\n * Util method to get effect\n */\n\nvar makeProxy = function makeProxy(e) {\n var proxy = {};\n\n for (var key in e) {\n if (typeof e[key] === \"function\") {\n proxy[key] = e[key].bind(e);\n } else {\n proxy[key] = e[key];\n }\n }\n\n return proxy;\n};\n\nvar bodyListener = function bodyListener(callback, options, e) {\n var _options$respectEffec = options.respectEffect,\n respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,\n _options$customEvent = options.customEvent,\n customEvent = _options$customEvent === void 0 ? false : _options$customEvent;\n var id = this.props.id;\n var tip = e.target.getAttribute(\"data-tip\") || null;\n var forId = e.target.getAttribute(\"data-for\") || null;\n var target = e.target;\n\n if (this.isCustomEvent(target) && !customEvent) {\n return;\n }\n\n var isTargetBelongsToTooltip = id == null && forId == null || forId === id;\n\n if (tip != null && (!respectEffect || this.getEffect(target) === \"float\") && isTargetBelongsToTooltip) {\n var proxy = makeProxy(e);\n proxy.currentTarget = target;\n callback(proxy);\n }\n};\n\nvar findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {\n var events = {};\n targetArray.forEach(function (target) {\n var event = target.getAttribute(dataAttribute);\n if (event) event.split(\" \").forEach(function (event) {\n return events[event] = true;\n });\n });\n return events;\n};\n\nvar getBody = function getBody() {\n return document.getElementsByTagName(\"body\")[0];\n};\n\nfunction bodyMode (target) {\n target.prototype.isBodyMode = function () {\n return !!this.props.bodyMode;\n };\n\n target.prototype.bindBodyListener = function (targetArray) {\n var _this = this;\n\n var _this$state = this.state,\n event = _this$state.event,\n eventOff = _this$state.eventOff,\n possibleCustomEvents = _this$state.possibleCustomEvents,\n possibleCustomEventsOff = _this$state.possibleCustomEventsOff;\n var body = getBody();\n var customEvents = findCustomEvents(targetArray, \"data-event\");\n var customEventsOff = findCustomEvents(targetArray, \"data-event-off\");\n if (event != null) customEvents[event] = true;\n if (eventOff != null) customEventsOff[eventOff] = true;\n possibleCustomEvents.split(\" \").forEach(function (event) {\n return customEvents[event] = true;\n });\n possibleCustomEventsOff.split(\" \").forEach(function (event) {\n return customEventsOff[event] = true;\n });\n this.unbindBodyListener(body);\n var listeners = this.bodyModeListeners = {};\n\n if (event == null) {\n listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});\n listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {\n respectEffect: true\n });\n listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});\n }\n\n for (var _event in customEvents) {\n listeners[_event] = bodyListener.bind(this, function (e) {\n var targetEventOff = e.currentTarget.getAttribute(\"data-event-off\") || eventOff;\n checkStatus.call(_this, targetEventOff, e);\n }, {\n customEvent: true\n });\n }\n\n for (var _event2 in customEventsOff) {\n listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {\n customEvent: true\n });\n }\n\n for (var _event3 in listeners) {\n body.addEventListener(_event3, listeners[_event3]);\n }\n };\n\n target.prototype.unbindBodyListener = function (body) {\n body = body || getBody();\n var listeners = this.bodyModeListeners;\n\n for (var event in listeners) {\n body.removeEventListener(event, listeners[event]);\n }\n };\n}\n\n/**\n * Tracking target removing from DOM.\n * It's necessary to hide tooltip when it's target disappears.\n * Otherwise, the tooltip would be shown forever until another target\n * is triggered.\n *\n * If MutationObserver is not available, this feature just doesn't work.\n */\n// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/\nvar getMutationObserverClass = function getMutationObserverClass() {\n return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;\n};\n\nfunction trackRemoval (target) {\n target.prototype.bindRemovalTracker = function () {\n var _this = this;\n\n var MutationObserver = getMutationObserverClass();\n if (MutationObserver == null) return;\n var observer = new MutationObserver(function (mutations) {\n for (var m1 = 0; m1 < mutations.length; m1++) {\n var mutation = mutations[m1];\n\n for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {\n var element = mutation.removedNodes[m2];\n\n if (element === _this.state.currentTarget) {\n _this.hideTooltip();\n\n return;\n }\n }\n }\n });\n observer.observe(window.document, {\n childList: true,\n subtree: true\n });\n this.removalTracker = observer;\n };\n\n target.prototype.unbindRemovalTracker = function () {\n if (this.removalTracker) {\n this.removalTracker.disconnect();\n this.removalTracker = null;\n }\n };\n}\n\n/**\n * Calculate the position of tooltip\n *\n * @params\n * - `e` {Event} the event of current mouse\n * - `target` {Element} the currentTarget of the event\n * - `node` {DOM} the react-tooltip object\n * - `place` {String} top / right / bottom / left\n * - `effect` {String} float / solid\n * - `offset` {Object} the offset to default position\n *\n * @return {Object}\n * - `isNewState` {Bool} required\n * - `newState` {Object}\n * - `position` {Object} {left: {Number}, top: {Number}}\n */\nfunction getPosition (e, target, node, place, desiredPlace, effect, offset) {\n var _getDimensions = getDimensions(node),\n tipWidth = _getDimensions.width,\n tipHeight = _getDimensions.height;\n\n var _getDimensions2 = getDimensions(target),\n targetWidth = _getDimensions2.width,\n targetHeight = _getDimensions2.height;\n\n var _getCurrentOffset = getCurrentOffset(e, target, effect),\n mouseX = _getCurrentOffset.mouseX,\n mouseY = _getCurrentOffset.mouseY;\n\n var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);\n\n var _calculateOffset = calculateOffset(offset),\n extraOffsetX = _calculateOffset.extraOffsetX,\n extraOffsetY = _calculateOffset.extraOffsetY;\n\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n\n var _getParent = getParent(node),\n parentTop = _getParent.parentTop,\n parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip\n\n\n var getTipOffsetLeft = function getTipOffsetLeft(place) {\n var offsetX = defaultOffset[place].l;\n return mouseX + offsetX + extraOffsetX;\n };\n\n var getTipOffsetRight = function getTipOffsetRight(place) {\n var offsetX = defaultOffset[place].r;\n return mouseX + offsetX + extraOffsetX;\n };\n\n var getTipOffsetTop = function getTipOffsetTop(place) {\n var offsetY = defaultOffset[place].t;\n return mouseY + offsetY + extraOffsetY;\n };\n\n var getTipOffsetBottom = function getTipOffsetBottom(place) {\n var offsetY = defaultOffset[place].b;\n return mouseY + offsetY + extraOffsetY;\n }; //\n // Functions to test whether the tooltip's sides are inside\n // the client window for a given orientation p\n //\n // _____________\n // | | <-- Right side\n // | p = 'left' |\\\n // | |/ |\\\n // |_____________| |_\\ <-- Mouse\n // / \\ |\n // |\n // |\n // Bottom side\n //\n\n\n var outsideLeft = function outsideLeft(p) {\n return getTipOffsetLeft(p) < 0;\n };\n\n var outsideRight = function outsideRight(p) {\n return getTipOffsetRight(p) > windowWidth;\n };\n\n var outsideTop = function outsideTop(p) {\n return getTipOffsetTop(p) < 0;\n };\n\n var outsideBottom = function outsideBottom(p) {\n return getTipOffsetBottom(p) > windowHeight;\n }; // Check whether the tooltip with orientation p is completely inside the client window\n\n\n var outside = function outside(p) {\n return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);\n };\n\n var inside = function inside(p) {\n return !outside(p);\n };\n\n var placesList = [\"top\", \"bottom\", \"left\", \"right\"];\n var insideList = [];\n\n for (var i = 0; i < 4; i++) {\n var p = placesList[i];\n\n if (inside(p)) {\n insideList.push(p);\n }\n }\n\n var isNewState = false;\n var newPlace;\n var shouldUpdatePlace = desiredPlace !== place;\n\n if (inside(desiredPlace) && shouldUpdatePlace) {\n isNewState = true;\n newPlace = desiredPlace;\n } else if (insideList.length > 0 && outside(desiredPlace) && outside(place)) {\n isNewState = true;\n newPlace = insideList[0];\n }\n\n if (isNewState) {\n return {\n isNewState: true,\n newState: {\n place: newPlace\n }\n };\n }\n\n return {\n isNewState: false,\n position: {\n left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),\n top: parseInt(getTipOffsetTop(place) - parentTop, 10)\n }\n };\n}\n\nvar getDimensions = function getDimensions(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n height = _node$getBoundingClie.height,\n width = _node$getBoundingClie.width;\n\n return {\n height: parseInt(height, 10),\n width: parseInt(width, 10)\n };\n}; // Get current mouse offset\n\n\nvar getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {\n var boundingClientRect = currentTarget.getBoundingClientRect();\n var targetTop = boundingClientRect.top;\n var targetLeft = boundingClientRect.left;\n\n var _getDimensions3 = getDimensions(currentTarget),\n targetWidth = _getDimensions3.width,\n targetHeight = _getDimensions3.height;\n\n if (effect === \"float\") {\n return {\n mouseX: e.clientX,\n mouseY: e.clientY\n };\n }\n\n return {\n mouseX: targetLeft + targetWidth / 2,\n mouseY: targetTop + targetHeight / 2\n };\n}; // List all possibility of tooltip final offset\n// This is useful in judging if it is necessary for tooltip to switch position when out of window\n\n\nvar getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {\n var top;\n var right;\n var bottom;\n var left;\n var disToMouse = 3;\n var triangleHeight = 2;\n var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip\n\n if (effect === \"float\") {\n top = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: -(tipHeight + disToMouse + triangleHeight),\n b: -disToMouse\n };\n bottom = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: disToMouse + cursorHeight,\n b: tipHeight + disToMouse + triangleHeight + cursorHeight\n };\n left = {\n l: -(tipWidth + disToMouse + triangleHeight),\n r: -disToMouse,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n right = {\n l: disToMouse,\n r: tipWidth + disToMouse + triangleHeight,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n } else if (effect === \"solid\") {\n top = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: -(targetHeight / 2 + tipHeight + triangleHeight),\n b: -(targetHeight / 2)\n };\n bottom = {\n l: -(tipWidth / 2),\n r: tipWidth / 2,\n t: targetHeight / 2,\n b: targetHeight / 2 + tipHeight + triangleHeight\n };\n left = {\n l: -(tipWidth + targetWidth / 2 + triangleHeight),\n r: -(targetWidth / 2),\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n right = {\n l: targetWidth / 2,\n r: tipWidth + targetWidth / 2 + triangleHeight,\n t: -(tipHeight / 2),\n b: tipHeight / 2\n };\n }\n\n return {\n top: top,\n bottom: bottom,\n left: left,\n right: right\n };\n}; // Consider additional offset into position calculation\n\n\nvar calculateOffset = function calculateOffset(offset) {\n var extraOffsetX = 0;\n var extraOffsetY = 0;\n\n if (Object.prototype.toString.apply(offset) === \"[object String]\") {\n offset = JSON.parse(offset.toString().replace(/'/g, '\"'));\n }\n\n for (var key in offset) {\n if (key === \"top\") {\n extraOffsetY -= parseInt(offset[key], 10);\n } else if (key === \"bottom\") {\n extraOffsetY += parseInt(offset[key], 10);\n } else if (key === \"left\") {\n extraOffsetX -= parseInt(offset[key], 10);\n } else if (key === \"right\") {\n extraOffsetX += parseInt(offset[key], 10);\n }\n }\n\n return {\n extraOffsetX: extraOffsetX,\n extraOffsetY: extraOffsetY\n };\n}; // Get the offset of the parent elements\n\n\nvar getParent = function getParent(currentTarget) {\n var currentParent = currentTarget;\n\n while (currentParent) {\n if (window.getComputedStyle(currentParent).getPropertyValue(\"transform\") !== \"none\") break;\n currentParent = currentParent.parentElement;\n }\n\n var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;\n var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;\n return {\n parentTop: parentTop,\n parentLeft: parentLeft\n };\n};\n\n/**\n * To get the tooltip content\n * it may comes from data-tip or this.props.children\n * it should support multiline\n *\n * @params\n * - `tip` {String} value of data-tip\n * - `children` {ReactElement} this.props.children\n * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')\n *\n * @return\n * - String or react component\n */\nfunction getTipContent (tip, children, getContent, multiline) {\n if (children) return children;\n if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.\n\n if (getContent === null) return null; // Tip not exist and children is null or undefined\n\n var regexp = //;\n\n if (!multiline || multiline === \"false\" || !regexp.test(tip)) {\n // No trim(), so that user can keep their input\n return tip;\n } // Multiline tooltip content\n\n\n return tip.split(regexp).map(function (d, i) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n key: i,\n className: \"multi-line\"\n }, d);\n });\n}\n\n/**\n * Support aria- and role in ReactTooltip\n *\n * @params props {Object}\n * @return {Object}\n */\nfunction parseAria(props) {\n var ariaObj = {};\n Object.keys(props).filter(function (prop) {\n // aria-xxx and role is acceptable\n return /(^aria-\\w+$|^role$)/.test(prop);\n }).forEach(function (prop) {\n ariaObj[prop] = props[prop];\n });\n return ariaObj;\n}\n\n/**\n * Convert nodelist to array\n * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24\n * NodeLists are functions in Safari\n */\nfunction nodeListToArray (nodeList) {\n var length = nodeList.length;\n\n if (nodeList.hasOwnProperty) {\n return Array.prototype.slice.call(nodeList);\n }\n\n return new Array(length).fill().map(function (index) {\n return nodeList[index];\n });\n}\n\nfunction generateUUID() {\n return \"t\" + Object(uuid__WEBPACK_IMPORTED_MODULE_2__[\"v4\"])();\n}\n\n___$insertStyle(\".__react_component_tooltip {\\n border-radius: 3px;\\n display: inline-block;\\n font-size: 13px;\\n left: -999em;\\n opacity: 0;\\n padding: 8px 21px;\\n position: fixed;\\n pointer-events: none;\\n transition: opacity 0.3s ease-out;\\n top: -999em;\\n visibility: hidden;\\n z-index: 999;\\n}\\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\\n pointer-events: auto;\\n}\\n.__react_component_tooltip::before, .__react_component_tooltip::after {\\n content: \\\"\\\";\\n width: 0;\\n height: 0;\\n position: absolute;\\n}\\n.__react_component_tooltip.show {\\n opacity: 0.9;\\n margin-top: 0;\\n margin-left: 0;\\n visibility: visible;\\n}\\n.__react_component_tooltip.place-top::before {\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n bottom: -8px;\\n left: 50%;\\n margin-left: -10px;\\n}\\n.__react_component_tooltip.place-bottom::before {\\n border-left: 10px solid transparent;\\n border-right: 10px solid transparent;\\n top: -8px;\\n left: 50%;\\n margin-left: -10px;\\n}\\n.__react_component_tooltip.place-left::before {\\n border-top: 6px solid transparent;\\n border-bottom: 6px solid transparent;\\n right: -8px;\\n top: 50%;\\n margin-top: -5px;\\n}\\n.__react_component_tooltip.place-right::before {\\n border-top: 6px solid transparent;\\n border-bottom: 6px solid transparent;\\n left: -8px;\\n top: 50%;\\n margin-top: -5px;\\n}\\n.__react_component_tooltip .multi-line {\\n display: block;\\n padding: 2px 0;\\n text-align: center;\\n}\");\n\n/**\n * Default pop-up style values (text color, background color).\n */\nvar defaultColors = {\n \"dark\": {\n \"text\": \"#fff\",\n \"background\": \"#222\",\n \"border\": \"transparent\",\n \"arrow\": \"#222\"\n },\n \"success\": {\n \"text\": \"#fff\",\n \"background\": \"#8DC572\",\n \"border\": \"transparent\",\n \"arrow\": \"#8DC572\"\n },\n \"warning\": {\n \"text\": \"#fff\",\n \"background\": \"#F0AD4E\",\n \"border\": \"transparent\",\n \"arrow\": \"#F0AD4E\"\n },\n \"error\": {\n \"text\": \"#fff\",\n \"background\": \"#BE6464\",\n \"border\": \"transparent\",\n \"arrow\": \"#BE6464\"\n },\n \"info\": {\n \"text\": \"#fff\",\n \"background\": \"#337AB7\",\n \"border\": \"transparent\",\n \"arrow\": \"#337AB7\"\n },\n \"light\": {\n \"text\": \"#222\",\n \"background\": \"#fff\",\n \"border\": \"transparent\",\n \"arrow\": \"#fff\"\n }\n};\nfunction getDefaultPopupColors(type) {\n return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;\n}\n\n/**\n* Generates the specific tooltip style for use on render.\n*/\n\nfunction generateTooltipStyle(uuid, customColors, type, hasBorder) {\n return generateStyle(uuid, getPopupColors(customColors, type, hasBorder));\n}\n/**\n * Generates the tooltip style rules based on the element-specified \"data-type\" property.\n */\n\nfunction generateStyle(uuid, colors) {\n var textColor = colors.text;\n var backgroundColor = colors.background;\n var borderColor = colors.border;\n var arrowColor = colors.arrow;\n return \"\\n \\t.\".concat(uuid, \" {\\n\\t color: \").concat(textColor, \";\\n\\t background: \").concat(backgroundColor, \";\\n\\t border: 1px solid \").concat(borderColor, \";\\n \\t}\\n\\n \\t.\").concat(uuid, \".place-top {\\n margin-top: -10px;\\n }\\n .\").concat(uuid, \".place-top::before {\\n border-top: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-top::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n bottom: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-top-color: \").concat(arrowColor, \";\\n border-top-style: solid;\\n border-top-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-bottom {\\n margin-top: 10px;\\n }\\n .\").concat(uuid, \".place-bottom::before {\\n border-bottom: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-bottom::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n top: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-bottom-color: \").concat(arrowColor, \";\\n border-bottom-style: solid;\\n border-bottom-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-left {\\n margin-left: -10px;\\n }\\n .\").concat(uuid, \".place-left::before {\\n border-left: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-left::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n right: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-left-color: \").concat(arrowColor, \";\\n border-left-style: solid;\\n border-left-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-right {\\n margin-left: 10px;\\n }\\n .\").concat(uuid, \".place-right::before {\\n border-right: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-right::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n left: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-right-color: \").concat(arrowColor, \";\\n border-right-style: solid;\\n border-right-width: 6px;\\n }\\n \");\n}\n\nfunction getPopupColors(customColors, type, hasBorder) {\n var textColor = customColors.text;\n var backgroundColor = customColors.background;\n var borderColor = customColors.border;\n var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;\n var colors = getDefaultPopupColors(type);\n\n if (textColor) {\n colors.text = textColor;\n }\n\n if (backgroundColor) {\n colors.background = backgroundColor;\n }\n\n if (hasBorder) {\n if (borderColor) {\n colors.border = borderColor;\n } else {\n colors.border = type === \"light\" ? \"black\" : \"white\";\n }\n }\n\n if (arrowColor) {\n colors.arrow = arrowColor;\n }\n\n return colors;\n}\n\nvar _class, _class2, _temp;\n\nvar ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(ReactTooltip, _React$Component);\n\n _createClass(ReactTooltip, null, [{\n key: \"propTypes\",\n get: function get() {\n return {\n uuid: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any,\n place: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n type: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n effect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n offset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,\n multiline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n border: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n textColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n backgroundColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n borderColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n arrowColor: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n insecure: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n \"class\": prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n html: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n delayHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,\n delayUpdate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,\n delayShow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,\n event: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n eventOff: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n isCapture: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n globalEventOff: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n getContent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any,\n afterShow: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,\n afterHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,\n overridePosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,\n disable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n scrollHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n resizeHide: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n wrapper: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n bodyMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,\n possibleCustomEvents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n possibleCustomEventsOff: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,\n clickable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool\n };\n }\n }]);\n\n function ReactTooltip(props) {\n var _this;\n\n _classCallCheck(this, ReactTooltip);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));\n _this.state = {\n uuid: props.uuid || generateUUID(),\n place: props.place || \"top\",\n // Direction of tooltip\n desiredPlace: props.place || \"top\",\n type: \"dark\",\n // Color theme of tooltip\n effect: \"float\",\n // float or fixed\n show: false,\n border: false,\n customColors: {},\n offset: {},\n extraClass: \"\",\n html: false,\n delayHide: 0,\n delayShow: 0,\n event: props.event || null,\n eventOff: props.eventOff || null,\n currentEvent: null,\n // Current mouse event\n currentTarget: null,\n // Current target of mouse event\n ariaProps: parseAria(props),\n // aria- and role attributes\n isEmptyTip: false,\n disable: false,\n possibleCustomEvents: props.possibleCustomEvents || \"\",\n possibleCustomEventsOff: props.possibleCustomEventsOff || \"\",\n originTooltip: null,\n isMultiline: false\n };\n\n _this.bind([\"showTooltip\", \"updateTooltip\", \"hideTooltip\", \"hideTooltipOnScroll\", \"getTooltipContent\", \"globalRebuild\", \"globalShow\", \"globalHide\", \"onWindowResize\", \"mouseOnToolTip\"]);\n\n _this.mount = true;\n _this.delayShowLoop = null;\n _this.delayHideLoop = null;\n _this.delayReshow = null;\n _this.intervalUpdateContent = null;\n return _this;\n }\n /**\n * For unify the bind and unbind listener\n */\n\n\n _createClass(ReactTooltip, [{\n key: \"bind\",\n value: function bind(methodArray) {\n var _this2 = this;\n\n methodArray.forEach(function (method) {\n _this2[method] = _this2[method].bind(_this2);\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props = this.props,\n insecure = _this$props.insecure,\n resizeHide = _this$props.resizeHide;\n this.bindListener(); // Bind listener for tooltip\n\n this.bindWindowEvents(resizeHide); // Bind global event for static method\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mount = false;\n this.clearTimer();\n this.unbindListener();\n this.removeScrollListener(this.state.currentTarget);\n this.unbindWindowEvents();\n }\n /**\n * Return if the mouse is on the tooltip.\n * @returns {boolean} true - mouse is on the tooltip\n */\n\n }, {\n key: \"mouseOnToolTip\",\n value: function mouseOnToolTip() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n /* old IE or Firefox work around */\n if (!this.tooltipRef.matches) {\n /* old IE work around */\n if (this.tooltipRef.msMatchesSelector) {\n this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;\n } else {\n /* old Firefox work around */\n this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;\n }\n }\n\n return this.tooltipRef.matches(\":hover\");\n }\n\n return false;\n }\n /**\n * Pick out corresponded target elements\n */\n\n }, {\n key: \"getTargetArray\",\n value: function getTargetArray(id) {\n var targetArray = [];\n var selector;\n\n if (!id) {\n selector = \"[data-tip]:not([data-for])\";\n } else {\n var escaped = id.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"');\n selector = \"[data-tip][data-for=\\\"\".concat(escaped, \"\\\"]\");\n } // Scan document for shadow DOM elements\n\n\n nodeListToArray(document.getElementsByTagName(\"*\")).filter(function (element) {\n return element.shadowRoot;\n }).forEach(function (element) {\n targetArray = targetArray.concat(nodeListToArray(element.shadowRoot.querySelectorAll(selector)));\n });\n return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));\n }\n /**\n * Bind listener to the target elements\n * These listeners used to trigger showing or hiding the tooltip\n */\n\n }, {\n key: \"bindListener\",\n value: function bindListener() {\n var _this3 = this;\n\n var _this$props2 = this.props,\n id = _this$props2.id,\n globalEventOff = _this$props2.globalEventOff,\n isCapture = _this$props2.isCapture;\n var targetArray = this.getTargetArray(id);\n targetArray.forEach(function (target) {\n if (target.getAttribute(\"currentItem\") === null) {\n target.setAttribute(\"currentItem\", \"false\");\n }\n\n _this3.unbindBasicListener(target);\n\n if (_this3.isCustomEvent(target)) {\n _this3.customUnbindListener(target);\n }\n });\n\n if (this.isBodyMode()) {\n this.bindBodyListener(targetArray);\n } else {\n targetArray.forEach(function (target) {\n var isCaptureMode = _this3.isCapture(target);\n\n var effect = _this3.getEffect(target);\n\n if (_this3.isCustomEvent(target)) {\n _this3.customBindListener(target);\n\n return;\n }\n\n target.addEventListener(\"mouseenter\", _this3.showTooltip, isCaptureMode);\n\n if (effect === \"float\") {\n target.addEventListener(\"mousemove\", _this3.updateTooltip, isCaptureMode);\n }\n\n target.addEventListener(\"mouseleave\", _this3.hideTooltip, isCaptureMode);\n });\n } // Global event to hide tooltip\n\n\n if (globalEventOff) {\n window.removeEventListener(globalEventOff, this.hideTooltip);\n window.addEventListener(globalEventOff, this.hideTooltip, isCapture);\n } // Track removal of targetArray elements from DOM\n\n\n this.bindRemovalTracker();\n }\n /**\n * Unbind listeners on target elements\n */\n\n }, {\n key: \"unbindListener\",\n value: function unbindListener() {\n var _this4 = this;\n\n var _this$props3 = this.props,\n id = _this$props3.id,\n globalEventOff = _this$props3.globalEventOff;\n\n if (this.isBodyMode()) {\n this.unbindBodyListener();\n } else {\n var targetArray = this.getTargetArray(id);\n targetArray.forEach(function (target) {\n _this4.unbindBasicListener(target);\n\n if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);\n });\n }\n\n if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);\n this.unbindRemovalTracker();\n }\n /**\n * Invoke this before bind listener and unmount the component\n * it is necessary to invoke this even when binding custom event\n * so that the tooltip can switch between custom and default listener\n */\n\n }, {\n key: \"unbindBasicListener\",\n value: function unbindBasicListener(target) {\n var isCaptureMode = this.isCapture(target);\n target.removeEventListener(\"mouseenter\", this.showTooltip, isCaptureMode);\n target.removeEventListener(\"mousemove\", this.updateTooltip, isCaptureMode);\n target.removeEventListener(\"mouseleave\", this.hideTooltip, isCaptureMode);\n }\n }, {\n key: \"getTooltipContent\",\n value: function getTooltipContent() {\n var _this$props4 = this.props,\n getContent = _this$props4.getContent,\n children = _this$props4.children; // Generate tooltip content\n\n var content;\n\n if (getContent) {\n if (Array.isArray(getContent)) {\n content = getContent[0] && getContent[0](this.state.originTooltip);\n } else {\n content = getContent(this.state.originTooltip);\n }\n }\n\n return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);\n }\n }, {\n key: \"isEmptyTip\",\n value: function isEmptyTip(placeholder) {\n return typeof placeholder === \"string\" && placeholder === \"\" || placeholder === null;\n }\n /**\n * When mouse enter, show the tooltip\n */\n\n }, {\n key: \"showTooltip\",\n value: function showTooltip(e, isGlobalCall) {\n if (isGlobalCall) {\n // Don't trigger other elements belongs to other ReactTooltip\n var targetArray = this.getTargetArray(this.props.id);\n var isMyElement = targetArray.some(function (ele) {\n return ele === e.currentTarget;\n });\n if (!isMyElement) return;\n } // Get the tooltip content\n // calculate in this phrase so that tip width height can be detected\n\n\n var _this$props5 = this.props,\n multiline = _this$props5.multiline,\n getContent = _this$props5.getContent;\n var originTooltip = e.currentTarget.getAttribute(\"data-tip\");\n var isMultiline = e.currentTarget.getAttribute(\"data-multiline\") || multiline || false; // If it is focus event or called by ReactTooltip.show, switch to `solid` effect\n\n var switchToSolid = e instanceof window.FocusEvent || isGlobalCall; // if it needs to skip adding hide listener to scroll\n\n var scrollHide = true;\n\n if (e.currentTarget.getAttribute(\"data-scroll-hide\")) {\n scrollHide = e.currentTarget.getAttribute(\"data-scroll-hide\") === \"true\";\n } else if (this.props.scrollHide != null) {\n scrollHide = this.props.scrollHide;\n } // Make sure the correct place is set\n\n\n var desiredPlace = e.currentTarget.getAttribute(\"data-place\") || this.props.place || \"top\";\n var effect = switchToSolid && \"solid\" || this.getEffect(e.currentTarget);\n var offset = e.currentTarget.getAttribute(\"data-offset\") || this.props.offset || {};\n var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);\n\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);\n }\n\n var place = result.isNewState ? result.newState.place : desiredPlace; // To prevent previously created timers from triggering\n\n this.clearTimer();\n var target = e.currentTarget;\n var reshowDelay = this.state.show ? target.getAttribute(\"data-delay-update\") || this.props.delayUpdate : 0;\n var self = this;\n\n var updateState = function updateState() {\n self.setState({\n originTooltip: originTooltip,\n isMultiline: isMultiline,\n desiredPlace: desiredPlace,\n place: place,\n type: target.getAttribute(\"data-type\") || self.props.type || \"dark\",\n customColors: {\n text: target.getAttribute(\"data-text-color\") || self.props.textColor || null,\n background: target.getAttribute(\"data-background-color\") || self.props.backgroundColor || null,\n border: target.getAttribute(\"data-border-color\") || self.props.borderColor || null,\n arrow: target.getAttribute(\"data-arrow-color\") || self.props.arrowColor || null\n },\n effect: effect,\n offset: offset,\n html: (target.getAttribute(\"data-html\") ? target.getAttribute(\"data-html\") === \"true\" : self.props.html) || false,\n delayShow: target.getAttribute(\"data-delay-show\") || self.props.delayShow || 0,\n delayHide: target.getAttribute(\"data-delay-hide\") || self.props.delayHide || 0,\n delayUpdate: target.getAttribute(\"data-delay-update\") || self.props.delayUpdate || 0,\n border: (target.getAttribute(\"data-border\") ? target.getAttribute(\"data-border\") === \"true\" : self.props.border) || false,\n extraClass: target.getAttribute(\"data-class\") || self.props[\"class\"] || self.props.className || \"\",\n disable: (target.getAttribute(\"data-tip-disable\") ? target.getAttribute(\"data-tip-disable\") === \"true\" : self.props.disable) || false,\n currentTarget: target\n }, function () {\n if (scrollHide) {\n self.addScrollListener(self.state.currentTarget);\n }\n\n self.updateTooltip(e);\n\n if (getContent && Array.isArray(getContent)) {\n self.intervalUpdateContent = setInterval(function () {\n if (self.mount) {\n var _getContent = self.props.getContent;\n var placeholder = getTipContent(originTooltip, \"\", _getContent[0](), isMultiline);\n var isEmptyTip = self.isEmptyTip(placeholder);\n self.setState({\n isEmptyTip: isEmptyTip\n });\n self.updatePosition();\n }\n }, getContent[1]);\n }\n });\n }; // If there is no delay call immediately, don't allow events to get in first.\n\n\n if (reshowDelay) {\n this.delayReshow = setTimeout(updateState, reshowDelay);\n } else {\n updateState();\n }\n }\n /**\n * When mouse hover, update tool tip\n */\n\n }, {\n key: \"updateTooltip\",\n value: function updateTooltip(e) {\n var _this5 = this;\n\n var _this$state = this.state,\n delayShow = _this$state.delayShow,\n disable = _this$state.disable;\n var afterShow = this.props.afterShow;\n var placeholder = this.getTooltipContent();\n var delayTime = parseInt(delayShow, 10);\n var eventTarget = e.currentTarget || e.target; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n\n if (this.mouseOnToolTip()) {\n return;\n } // if the tooltip is empty, disable the tooltip\n\n\n if (this.isEmptyTip(placeholder) || disable) {\n return;\n }\n\n var updateState = function updateState() {\n if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {\n var isInvisible = !_this5.state.show;\n\n _this5.setState({\n currentEvent: e,\n currentTarget: eventTarget,\n show: true\n }, function () {\n _this5.updatePosition();\n\n if (isInvisible && afterShow) {\n afterShow(e);\n }\n });\n }\n };\n\n clearTimeout(this.delayShowLoop);\n\n if (delayShow) {\n this.delayShowLoop = setTimeout(updateState, delayTime);\n } else {\n updateState();\n }\n }\n /*\n * If we're mousing over the tooltip remove it when we leave.\n */\n\n }, {\n key: \"listenForTooltipExit\",\n value: function listenForTooltipExit() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.addEventListener(\"mouseleave\", this.hideTooltip);\n }\n }\n }, {\n key: \"removeListenerForTooltipExit\",\n value: function removeListenerForTooltipExit() {\n var show = this.state.show;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.removeEventListener(\"mouseleave\", this.hideTooltip);\n }\n }\n /**\n * When mouse leave, hide tooltip\n */\n\n }, {\n key: \"hideTooltip\",\n value: function hideTooltip(e, hasTarget) {\n var _this6 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n isScroll: false\n };\n var disable = this.state.disable;\n var isScroll = options.isScroll;\n var delayHide = isScroll ? 0 : this.state.delayHide;\n var afterHide = this.props.afterHide;\n var placeholder = this.getTooltipContent();\n if (!this.mount) return;\n if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip\n\n if (hasTarget) {\n // Don't trigger other elements belongs to other ReactTooltip\n var targetArray = this.getTargetArray(this.props.id);\n var isMyElement = targetArray.some(function (ele) {\n return ele === e.currentTarget;\n });\n if (!isMyElement || !this.state.show) return;\n }\n\n var resetState = function resetState() {\n var isVisible = _this6.state.show; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n\n if (_this6.mouseOnToolTip()) {\n _this6.listenForTooltipExit();\n\n return;\n }\n\n _this6.removeListenerForTooltipExit();\n\n _this6.setState({\n show: false\n }, function () {\n _this6.removeScrollListener(_this6.state.currentTarget);\n\n if (isVisible && afterHide) {\n afterHide(e);\n }\n });\n };\n\n this.clearTimer();\n\n if (delayHide) {\n this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));\n } else {\n resetState();\n }\n }\n /**\n * When scroll, hide tooltip\n */\n\n }, {\n key: \"hideTooltipOnScroll\",\n value: function hideTooltipOnScroll(event, hasTarget) {\n this.hideTooltip(event, hasTarget, {\n isScroll: true\n });\n }\n /**\n * Add scroll event listener when tooltip show\n * automatically hide the tooltip when scrolling\n */\n\n }, {\n key: \"addScrollListener\",\n value: function addScrollListener(currentTarget) {\n var isCaptureMode = this.isCapture(currentTarget);\n window.addEventListener(\"scroll\", this.hideTooltipOnScroll, isCaptureMode);\n }\n }, {\n key: \"removeScrollListener\",\n value: function removeScrollListener(currentTarget) {\n var isCaptureMode = this.isCapture(currentTarget);\n window.removeEventListener(\"scroll\", this.hideTooltipOnScroll, isCaptureMode);\n } // Calculation the position\n\n }, {\n key: \"updatePosition\",\n value: function updatePosition() {\n var _this7 = this;\n\n var _this$state2 = this.state,\n currentEvent = _this$state2.currentEvent,\n currentTarget = _this$state2.currentTarget,\n place = _this$state2.place,\n desiredPlace = _this$state2.desiredPlace,\n effect = _this$state2.effect,\n offset = _this$state2.offset;\n var node = this.tooltipRef;\n var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);\n\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);\n }\n\n if (result.isNewState) {\n // Switch to reverse placement\n return this.setState(result.newState, function () {\n _this7.updatePosition();\n });\n } // Set tooltip position\n\n\n node.style.left = result.position.left + \"px\";\n node.style.top = result.position.top + \"px\";\n }\n /**\n * CLear all kinds of timeout of interval\n */\n\n }, {\n key: \"clearTimer\",\n value: function clearTimer() {\n clearTimeout(this.delayShowLoop);\n clearTimeout(this.delayHideLoop);\n clearTimeout(this.delayReshow);\n clearInterval(this.intervalUpdateContent);\n }\n }, {\n key: \"hasCustomColors\",\n value: function hasCustomColors() {\n var _this8 = this;\n\n return Boolean(Object.keys(this.state.customColors).find(function (color) {\n return color !== \"border\" && _this8.state.customColors[color];\n }) || this.state.border && this.state.customColors[\"border\"]);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this9 = this;\n\n var _this$state3 = this.state,\n extraClass = _this$state3.extraClass,\n html = _this$state3.html,\n ariaProps = _this$state3.ariaProps,\n disable = _this$state3.disable;\n var content = this.getTooltipContent();\n var isEmptyTip = this.isEmptyTip(content);\n var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);\n var tooltipClass = \"__react_component_tooltip\" + \" \".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? \" show\" : \"\") + (this.state.border ? \" border\" : \"\") + \" place-\".concat(this.state.place) + // top, bottom, left, right\n \" type-\".concat(this.hasCustomColors() ? \"custom\" : this.state.type) + ( // dark, success, warning, error, info, light, custom\n this.props.delayUpdate ? \" allow_hover\" : \"\") + (this.props.clickable ? \" allow_click\" : \"\");\n var Wrapper = this.props.wrapper;\n\n if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {\n Wrapper = ReactTooltip.defaultProps.wrapper;\n }\n\n var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(\" \");\n\n if (html) {\n var htmlContent = \"\".concat(content, \"\\n\");\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Wrapper, _extends({\n className: \"\".concat(wrapperClassName),\n id: this.props.id,\n ref: function ref(_ref) {\n return _this9.tooltipRef = _ref;\n }\n }, ariaProps, {\n \"data-id\": \"tooltip\",\n dangerouslySetInnerHTML: {\n __html: htmlContent\n }\n }));\n } else {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Wrapper, _extends({\n className: \"\".concat(wrapperClassName),\n id: this.props.id\n }, ariaProps, {\n ref: function ref(_ref2) {\n return _this9.tooltipRef = _ref2;\n },\n \"data-id\": \"tooltip\"\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"style\", {\n dangerouslySetInnerHTML: {\n __html: style\n }\n }), content);\n }\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var ariaProps = prevState.ariaProps;\n var newAriaProps = parseAria(nextProps);\n var isChanged = Object.keys(newAriaProps).some(function (props) {\n return newAriaProps[props] !== ariaProps[props];\n });\n\n if (!isChanged) {\n return null;\n }\n\n return _objectSpread2({}, prevState, {\n ariaProps: newAriaProps\n });\n }\n }]);\n\n return ReactTooltip;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component), _defineProperty(_class2, \"defaultProps\", {\n insecure: true,\n resizeHide: true,\n wrapper: \"div\",\n clickable: false\n}), _defineProperty(_class2, \"supportedWrappers\", [\"div\", \"span\"]), _defineProperty(_class2, \"displayName\", \"ReactTooltip\"), _temp)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReactTooltip);\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n\n return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (bytesToUuid);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js": +/*!********************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js ***! + \********************************************************************************/ +/*! exports provided: v1, v3, v4, v5 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _v1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v1.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v1\", function() { return _v1_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _v3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v3.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v3\", function() { return _v3_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _v4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./v4.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v4\", function() { return _v4_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _v5_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./v5.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"v5\", function() { return _v5_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/index.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js": +/*!******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes == 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Array(msg.length);\n\n for (var i = 0; i < msg.length; i++) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var i;\n var x;\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n var hex;\n\n for (i = 0; i < length32; i += 8) {\n x = input[i >> 5] >>> i % 32 & 0xff;\n hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[(len + 64 >>> 9 << 4) + 14] = len;\n var i;\n var olda;\n var oldb;\n var oldc;\n var oldd;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (i = 0; i < x.length; i += 16) {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n var i;\n var output = [];\n output[(input.length >> 2) - 1] = undefined;\n\n for (i = 0; i < output.length; i += 1) {\n output[i] = 0;\n }\n\n var length8 = input.length * 8;\n\n for (i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (md5);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js": +/*!******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (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 rng; });\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n// find the complete implementation of crypto (msCrypto) on IE11.\nvar getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);\nvar rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\nfunction rng() {\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n\n return getRandomValues(rnds8);\n}\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes == 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Array(msg.length);\n\n for (var i = 0; i < msg.length; i++) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var i = 0; i < N; i++) {\n M[i] = new Array(16);\n\n for (var j = 0; j < 16; j++) {\n M[i][j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];\n }\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var i = 0; i < N; i++) {\n var W = new Array(80);\n\n for (var t = 0; t < 16; t++) {\n W[t] = M[i][t];\n }\n\n for (var t = 16; t < 80; t++) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var t = 0; t < 80; t++) {\n var s = Math.floor(t / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (sha1);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bytesToUuid.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js\");\n\n // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : Object(_bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(b);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (v1);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v1.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _v35_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v35.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js\");\n/* harmony import */ var _md5_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./md5.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/md5.js\");\n\n\nvar v3 = Object(_v35_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('v3', 0x30, _md5_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (v3);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v3.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js": +/*!******************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js ***! + \******************************************************************************/ +/*! exports provided: DNS, URL, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DNS\", function() { return DNS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"URL\", function() { return URL; });\n/* harmony import */ var _bytesToUuid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bytesToUuid.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js\");\n\n\nfunction uuidToBytes(uuid) {\n // Note: We assume we're being passed a valid uuid string\n var bytes = [];\n uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {\n bytes.push(parseInt(hex, 16));\n });\n return bytes;\n}\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = new Array(str.length);\n\n for (var i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n\n return bytes;\n}\n\nvar DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nvar URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (name, version, hashfunc) {\n var generateUUID = function generateUUID(value, namespace, buf, offset) {\n var off = buf && offset || 0;\n if (typeof value == 'string') value = stringToBytes(value);\n if (typeof namespace == 'string') namespace = uuidToBytes(namespace);\n if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');\n if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values'); // Per 4.3\n\n var bytes = hashfunc(namespace.concat(value));\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n for (var idx = 0; idx < 16; ++idx) {\n buf[off + idx] = bytes[idx];\n }\n }\n\n return buf || Object(_bytesToUuid_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(bytes);\n }; // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name;\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n});\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bytesToUuid.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/bytesToUuid.js\");\n\n\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof options == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n\n options = options || {};\n var rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || Object(_bytesToUuid_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(rnds);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (v4);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v4.js?"); + +/***/ }), + +/***/ "./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _v35_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v35.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v35.js\");\n/* harmony import */ var _sha1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sha1.js */ \"./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/sha1.js\");\n\n\nvar v5 = Object(_v35_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('v5', 0x50, _sha1_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (v5);\n\n//# sourceURL=webpack:///./node_modules/react-tooltip/node_modules/uuid/dist/esm-browser/v5.js?"); + +/***/ }), + /***/ "./node_modules/react/cjs/react.development.js": /*!*****************************************************!*\ !*** ./node_modules/react/cjs/react.development.js ***! @@ -5732,7 +5864,7 @@ eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\ /***/ (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 View404; });\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_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.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 _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\nvar View404 = /*#__PURE__*/function (_React$Component) {\n _inherits(View404, _React$Component);\n\n var _super = _createSuper(View404);\n\n function View404() {\n _classCallCheck(this, View404);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(View404, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-page\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h2\", {\n className: \"headline text-warning\"\n }, \"404\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"exclamation-triangle\",\n classes: \"text-warning\"\n }), \" Oops! Page not found.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"We could not find the page you were looking for. Meanwhile, you may \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"return to dashboard\"), \" or try using the search form.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"form\", {\n className: \"search-form\",\n onSubmit: function onSubmit(e) {\n return e.preventDefault();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"text\",\n name: \"search\",\n className: \"form-control\",\n placeholder: \"Search\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group-append\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"submit\",\n name: \"submit\",\n className: \"btn btn-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"search\"\n })))))));\n }\n }]);\n\n return View404;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/404.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return View404; });\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_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.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 _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\nvar View404 = /*#__PURE__*/function (_React$Component) {\n _inherits(View404, _React$Component);\n\n var _super = _createSuper(View404);\n\n function View404() {\n _classCallCheck(this, View404);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(View404, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-page\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h2\", {\n className: \"headline text-warning\"\n }, \"404\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"error-content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"exclamation-triangle\",\n className: \"text-warning\"\n }), \" Oops! Page not found.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"We could not find the page you were looking for. Meanwhile, you may \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"return to dashboard\"), \" or try using the search form.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"form\", {\n className: \"search-form\",\n onSubmit: function onSubmit(e) {\n return e.preventDefault();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"text\",\n name: \"search\",\n className: \"form-control\",\n placeholder: \"Search\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"input-group-append\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"submit\",\n name: \"submit\",\n className: \"btn btn-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"search\"\n })))))));\n }\n }]);\n\n return View404;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/404.js?"); /***/ }), @@ -5744,7 +5876,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 API; });\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-polyfill */ \"./node_modules/babel-polyfill/lib/index.js\");\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_polyfill__WEBPACK_IMPORTED_MODULE_0__);\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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\n\n\nvar API = /*#__PURE__*/function () {\n function API() {\n _classCallCheck(this, API);\n\n this.loggedIn = false;\n this.user = {};\n }\n\n _createClass(API, [{\n key: \"csrfToken\",\n value: function csrfToken() {\n return this.loggedIn ? this.user.session.csrf_token : null;\n }\n }, {\n key: \"apiCall\",\n value: function () {\n var _apiCall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(method, params) {\n var response;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n params = params || {};\n params.csrf_token = this.csrfToken();\n _context.next = 4;\n return fetch(\"/api/\" + method, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(params)\n });\n\n case 4:\n response = _context.sent;\n _context.next = 7;\n return response.json();\n\n case 7:\n return _context.abrupt(\"return\", _context.sent);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function apiCall(_x, _x2) {\n return _apiCall.apply(this, arguments);\n }\n\n return apiCall;\n }()\n }, {\n key: \"fetchUser\",\n value: function () {\n var _fetchUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var response, data;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return fetch(\"/api/user/info\");\n\n case 2:\n response = _context2.sent;\n _context2.next = 5;\n return response.json();\n\n case 5:\n data = _context2.sent;\n this.user = data[\"user\"];\n this.loggedIn = data[\"loggedIn\"];\n return _context2.abrupt(\"return\", data && data.success && data.loggedIn);\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function fetchUser() {\n return _fetchUser.apply(this, arguments);\n }\n\n return fetchUser;\n }()\n }, {\n key: \"logout\",\n value: function () {\n var _logout = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this.apiCall(\"user/logout\"));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function logout() {\n return _logout.apply(this, arguments);\n }\n\n return logout;\n }()\n }, {\n key: \"getNotifications\",\n value: function () {\n var _getNotifications = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this.apiCall(\"notifications/fetch\"));\n\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function getNotifications() {\n return _getNotifications.apply(this, arguments);\n }\n\n return getNotifications;\n }()\n }, {\n key: \"fetchUsers\",\n value: function () {\n var _fetchUsers = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {\n var pageNum,\n _args5 = arguments;\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n pageNum = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 1;\n return _context5.abrupt(\"return\", this.apiCall(\"user/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n function fetchUsers() {\n return _fetchUsers.apply(this, arguments);\n }\n\n return fetchUsers;\n }()\n }, {\n key: \"fetchGroups\",\n value: function () {\n var _fetchGroups = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {\n var pageNum,\n _args6 = arguments;\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n pageNum = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : 1;\n return _context6.abrupt(\"return\", this.apiCall(\"groups/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function fetchGroups() {\n return _fetchGroups.apply(this, arguments);\n }\n\n return fetchGroups;\n }()\n }]);\n\n return API;\n}();\n\n\n;\n\n//# sourceURL=webpack:///./src/api.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return API; });\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-polyfill */ \"./node_modules/babel-polyfill/lib/index.js\");\n/* harmony import */ var babel_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_polyfill__WEBPACK_IMPORTED_MODULE_0__);\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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\n\n\nvar API = /*#__PURE__*/function () {\n function API() {\n _classCallCheck(this, API);\n\n this.loggedIn = false;\n this.user = {};\n }\n\n _createClass(API, [{\n key: \"csrfToken\",\n value: function csrfToken() {\n return this.loggedIn ? this.user.session.csrf_token : null;\n }\n }, {\n key: \"apiCall\",\n value: function () {\n var _apiCall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(method, params) {\n var response;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n params = params || {};\n params.csrf_token = this.csrfToken();\n _context.next = 4;\n return fetch(\"/api/\" + method, {\n method: 'post',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(params)\n });\n\n case 4:\n response = _context.sent;\n _context.next = 7;\n return response.json();\n\n case 7:\n return _context.abrupt(\"return\", _context.sent);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function apiCall(_x, _x2) {\n return _apiCall.apply(this, arguments);\n }\n\n return apiCall;\n }()\n }, {\n key: \"fetchUser\",\n value: function () {\n var _fetchUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var response, data;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return fetch(\"/api/user/info\");\n\n case 2:\n response = _context2.sent;\n _context2.next = 5;\n return response.json();\n\n case 5:\n data = _context2.sent;\n this.user = data[\"user\"];\n this.loggedIn = data[\"loggedIn\"];\n return _context2.abrupt(\"return\", data && data.success && data.loggedIn);\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function fetchUser() {\n return _fetchUser.apply(this, arguments);\n }\n\n return fetchUser;\n }()\n }, {\n key: \"logout\",\n value: function () {\n var _logout = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this.apiCall(\"user/logout\"));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function logout() {\n return _logout.apply(this, arguments);\n }\n\n return logout;\n }()\n }, {\n key: \"getNotifications\",\n value: function () {\n var _getNotifications = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this.apiCall(\"notifications/fetch\"));\n\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function getNotifications() {\n return _getNotifications.apply(this, arguments);\n }\n\n return getNotifications;\n }()\n }, {\n key: \"fetchUsers\",\n value: function () {\n var _fetchUsers = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {\n var pageNum,\n _args5 = arguments;\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n pageNum = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 1;\n return _context5.abrupt(\"return\", this.apiCall(\"user/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n function fetchUsers() {\n return _fetchUsers.apply(this, arguments);\n }\n\n return fetchUsers;\n }()\n }, {\n key: \"fetchGroups\",\n value: function () {\n var _fetchGroups = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {\n var pageNum,\n _args6 = arguments;\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n pageNum = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : 1;\n return _context6.abrupt(\"return\", this.apiCall(\"groups/fetch\", {\n page: pageNum\n }));\n\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function fetchGroups() {\n return _fetchGroups.apply(this, arguments);\n }\n\n return fetchGroups;\n }()\n }, {\n key: \"inviteUser\",\n value: function () {\n var _inviteUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(username, email) {\n return regeneratorRuntime.wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n return _context7.abrupt(\"return\", this.apiCall(\"user/invite\", {\n username: username,\n email: email\n }));\n\n case 1:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7, this);\n }));\n\n function inviteUser(_x3, _x4) {\n return _inviteUser.apply(this, arguments);\n }\n\n return inviteUser;\n }()\n }, {\n key: \"createUser\",\n value: function () {\n var _createUser = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(username, email, password, confirmPassword) {\n return regeneratorRuntime.wrap(function _callee8$(_context8) {\n while (1) {\n switch (_context8.prev = _context8.next) {\n case 0:\n return _context8.abrupt(\"return\", this.apiCall(\"user/create\", {\n username: username,\n email: email,\n password: password,\n confirmPassword: confirmPassword\n }));\n\n case 1:\n case \"end\":\n return _context8.stop();\n }\n }\n }, _callee8, this);\n }));\n\n function createUser(_x5, _x6, _x7, _x8) {\n return _createUser.apply(this, arguments);\n }\n\n return createUser;\n }()\n }]);\n\n return API;\n}();\n\n\n;\n\n//# sourceURL=webpack:///./src/api.js?"); /***/ }), @@ -5756,7 +5888,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 Alert; });\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n\n\nfunction Alert(props) {\n var onClose = props.onClose || function () {};\n\n var title = props.title || \"Untitled Alert\";\n var message = props.message || \"Alert message\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", {\n className: \"alert alert-danger alert-dismissible\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"button\", {\n type: \"button\",\n className: \"close\",\n \"data-dismiss\": \"alert\",\n \"aria-hidden\": \"true\",\n onClick: onClose\n }, \"\\xD7\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"h5\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n icon: \"ban\",\n classes: \"icon\"\n }), \" \", title), message);\n}\n\n//# sourceURL=webpack:///./src/elements/alert.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Alert; });\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n\n\nfunction Alert(props) {\n var onClose = props.onClose || function () {};\n\n var title = props.title || \"Untitled Alert\";\n var message = props.message || \"Alert message\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", {\n className: \"alert alert-danger alert-dismissible\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"button\", {\n type: \"button\",\n className: \"close\",\n \"data-dismiss\": \"alert\",\n \"aria-hidden\": \"true\",\n onClick: onClose\n }, \"\\xD7\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"h5\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n icon: \"ban\",\n className: \"icon\"\n }), \" \", title), message);\n}\n\n//# sourceURL=webpack:///./src/elements/alert.js?"); /***/ }), @@ -5780,7 +5912,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 Icon; });\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__);\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\n\nfunction Icon(props) {\n var classes = props.classes || [];\n classes = Array.isArray(classes) ? classes : classes.toString().split(\" \");\n var type = props.type || \"fas\";\n var icon = props.icon;\n classes.push(type);\n classes.push(\"fa-\" + icon);\n\n if (icon === \"spinner\") {\n classes.push(\"fa-spin\");\n }\n\n var newProps = _objectSpread(_objectSpread({}, props), {}, {\n className: classes.join(\" \")\n });\n\n delete newProps[\"classes\"];\n delete newProps[\"type\"];\n delete newProps[\"icon\"];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"i\", newProps);\n}\n\n//# sourceURL=webpack:///./src/elements/icon.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Icon; });\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__);\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\n\nfunction Icon(props) {\n var classes = props.className || [];\n classes = Array.isArray(classes) ? classes : classes.toString().split(\" \");\n var type = props.type || \"fas\";\n var icon = props.icon;\n classes.push(type);\n classes.push(\"fa-\" + icon);\n\n if (icon === \"spinner\") {\n classes.push(\"fa-spin\");\n }\n\n var newProps = _objectSpread(_objectSpread({}, props), {}, {\n className: classes.join(\" \")\n });\n\n delete newProps[\"type\"];\n delete newProps[\"icon\"];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"i\", newProps);\n}\n\n//# sourceURL=webpack:///./src/elements/icon.js?"); /***/ }), @@ -5838,7 +5970,7 @@ eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dis /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\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_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./include/adminlte.min.css */ \"./src/include/adminlte.min.css\");\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./include/index.css */ \"./src/include/index.css\");\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_include_index_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ \"./src/api.js\");\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./header.js */ \"./src/header.js\");\n/* harmony import */ var _sidebar_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sidebar.js */ \"./src/sidebar.js\");\n/* harmony import */ var _views_users_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./views/users.js */ \"./src/views/users.js\");\n/* harmony import */ var _views_overview_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./views/overview.js */ \"./src/views/overview.js\");\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var _elements_dialog__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./elements/dialog */ \"./src/elements/dialog.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _404__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./404 */ \"./src/404.js\");\n/* harmony import */ var _views_logs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./views/logs */ \"./src/views/logs.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 _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\n\n\nvar AdminDashboard = /*#__PURE__*/function (_React$Component) {\n _inherits(AdminDashboard, _React$Component);\n\n var _super = _createSuper(AdminDashboard);\n\n function AdminDashboard(props) {\n var _this;\n\n _classCallCheck(this, AdminDashboard);\n\n _this = _super.call(this, props);\n _this.api = new _api_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n _this.state = {\n loaded: false,\n dialog: {\n onClose: function onClose() {\n return _this.hideDialog();\n }\n },\n notifications: {}\n };\n _this.controlObj = {\n showDialog: _this.showDialog.bind(_assertThisInitialized(_this)),\n api: _this.api\n };\n return _this;\n }\n\n _createClass(AdminDashboard, [{\n key: \"onUpdate\",\n value: function onUpdate() {\n this.fetchNotifications();\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(message, title) {\n var props = {\n show: true,\n message: message,\n title: title\n };\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), props)\n }));\n }\n }, {\n key: \"hideDialog\",\n value: function hideDialog() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), {}, {\n show: false\n })\n }));\n }\n }, {\n key: \"fetchNotifications\",\n value: function fetchNotifications() {\n var _this2 = this;\n\n this.api.getNotifications().then(function (res) {\n if (!res.success) {\n _this2.showDialog(\"Error fetching notifications: \" + res.msg, \"Error fetching notifications\");\n } else {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n notifications: res.notifications\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this3 = this;\n\n this.api.fetchUser().then(function (Success) {\n if (!Success) {\n document.location = \"/admin\";\n } else {\n _this3.fetchNotifications();\n\n setInterval(_this3.onUpdate.bind(_this3), 60 * 1000);\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true\n }));\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, \"Loading\\u2026 \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n icon: \"spinner\"\n }));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"BrowserRouter\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_header_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidebar_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content-wrapper p-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"section\", {\n className: \"content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Switch\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_overview_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"/admin/users\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_users_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"/admin/logs\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_logs__WEBPACK_IMPORTED_MODULE_13__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__[\"Route\"], {\n path: \"*\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_404__WEBPACK_IMPORTED_MODULE_12__[\"default\"], null))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_dialog__WEBPACK_IMPORTED_MODULE_10__[\"default\"], this.state.dialog))));\n }\n }]);\n\n return AdminDashboard;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(AdminDashboard, null), document.getElementById('root'));\n\n//# sourceURL=webpack:///./src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\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_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./include/adminlte.min.css */ \"./src/include/adminlte.min.css\");\n/* harmony import */ var _include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_include_adminlte_min_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./include/index.css */ \"./src/include/index.css\");\n/* harmony import */ var _include_index_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_include_index_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ \"./src/api.js\");\n/* harmony import */ var _header_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./header.js */ \"./src/header.js\");\n/* harmony import */ var _sidebar_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sidebar.js */ \"./src/sidebar.js\");\n/* harmony import */ var _views_users_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./views/users.js */ \"./src/views/users.js\");\n/* harmony import */ var _views_overview_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./views/overview.js */ \"./src/views/overview.js\");\n/* harmony import */ var _views_adduser__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./views/adduser */ \"./src/views/adduser.js\");\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var _elements_dialog__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./elements/dialog */ \"./src/elements/dialog.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _404__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./404 */ \"./src/404.js\");\n/* harmony import */ var _views_logs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./views/logs */ \"./src/views/logs.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 _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\n\n\n\nvar AdminDashboard = /*#__PURE__*/function (_React$Component) {\n _inherits(AdminDashboard, _React$Component);\n\n var _super = _createSuper(AdminDashboard);\n\n function AdminDashboard(props) {\n var _this;\n\n _classCallCheck(this, AdminDashboard);\n\n _this = _super.call(this, props);\n _this.api = new _api_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n _this.state = {\n loaded: false,\n dialog: {\n onClose: function onClose() {\n return _this.hideDialog();\n }\n },\n notifications: {}\n };\n _this.controlObj = {\n showDialog: _this.showDialog.bind(_assertThisInitialized(_this)),\n api: _this.api\n };\n return _this;\n }\n\n _createClass(AdminDashboard, [{\n key: \"onUpdate\",\n value: function onUpdate() {\n this.fetchNotifications();\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(message, title) {\n var props = {\n show: true,\n message: message,\n title: title\n };\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), props)\n }));\n }\n }, {\n key: \"hideDialog\",\n value: function hideDialog() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n dialog: _objectSpread(_objectSpread({}, this.state.dialog), {}, {\n show: false\n })\n }));\n }\n }, {\n key: \"fetchNotifications\",\n value: function fetchNotifications() {\n var _this2 = this;\n\n this.api.getNotifications().then(function (res) {\n if (!res.success) {\n _this2.showDialog(\"Error fetching notifications: \" + res.msg, \"Error fetching notifications\");\n } else {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n notifications: res.notifications\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this3 = this;\n\n this.api.fetchUser().then(function (Success) {\n if (!Success) {\n document.location = \"/admin\";\n } else {\n _this3.fetchNotifications();\n\n setInterval(_this3.onUpdate.bind(_this3), 60 * 1000);\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true\n }));\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"b\", null, \"Loading\\u2026 \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n icon: \"spinner\"\n }));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"BrowserRouter\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_header_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidebar_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({}, this.controlObj, {\n notifications: this.state.notifications\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"content-wrapper p-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"section\", {\n className: \"content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Switch\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n path: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_overview_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n exact: true,\n path: \"/admin/users\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_users_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n exact: true,\n path: \"/admin/users/adduser\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_adduser__WEBPACK_IMPORTED_MODULE_9__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n path: \"/admin/logs\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_views_logs__WEBPACK_IMPORTED_MODULE_14__[\"default\"], this.controlObj)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_12__[\"Route\"], {\n path: \"*\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_404__WEBPACK_IMPORTED_MODULE_13__[\"default\"], null))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_dialog__WEBPACK_IMPORTED_MODULE_11__[\"default\"], this.state.dialog))));\n }\n }]);\n\n return AdminDashboard;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(AdminDashboard, null), document.getElementById('root'));\n\n//# sourceURL=webpack:///./src/index.js?"); /***/ }), @@ -5850,7 +5982,19 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac /***/ (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 Sidebar; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n\n\n\nfunction Sidebar(props) {\n var parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n\n function onLogout() {\n parent.api.logout().then(function (obj) {\n if (obj.success) {\n document.location = \"/admin\";\n } else {\n parent.showDialog(\"Error logging out: \" + obj.msg, \"Error logging out\");\n }\n });\n }\n\n var menuItems = {\n \"dashboard\": {\n \"name\": \"Dashboard\",\n \"icon\": \"tachometer-alt\"\n },\n \"users\": {\n \"name\": \"Users & Groups\",\n \"icon\": \"users\"\n },\n \"settings\": {\n \"name\": \"Settings\",\n \"icon\": \"tools\"\n },\n \"logs\": {\n \"name\": \"Logs & Notifications\",\n \"icon\": \"file-medical-alt\"\n },\n \"help\": {\n \"name\": \"Help\",\n \"icon\": \"question-circle\"\n }\n };\n var numNotifications = Object.keys(props.notifications).length;\n\n if (numNotifications > 0) {\n if (numNotifications > 9) numNotifications = \"9+\";\n menuItems[\"logs\"][\"badge\"] = {\n type: \"warning\",\n value: numNotifications\n };\n }\n\n var li = [];\n\n for (var id in menuItems) {\n var obj = menuItems[id];\n var badge = obj.badge ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"right badge badge-\" + obj.badge.type\n }, obj.badge.value) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null);\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: id,\n className: \"nav-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"NavLink\"], {\n to: \"/admin/\" + id,\n className: \"nav-link\",\n activeClassName: \"active\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: obj.icon,\n classes: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, obj.name, badge))));\n }\n\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"nav-item\",\n key: \"logout\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n onClick: function onClick() {\n return onLogout();\n },\n className: \"nav-link\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"arrow-left\",\n classes: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Logout\"))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"aside\", {\n className: \"main-sidebar sidebar-dark-primary elevation-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"brand-link\",\n to: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"/img/icons/logo.png\",\n alt: \"Logo\",\n className: \"brand-image img-circle elevation-3\",\n style: {\n opacity: \".8\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"brand-text font-weight-light ml-2\"\n }, \"WebBase\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"sidebar os-host os-theme-light os-host-overflow os-host-overflow-y os-host-resize-disabled os-host-scrollbar-horizontal-hidden os-host-transition\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer-host\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\",\n style: {\n left: \"0px\",\n right: \"auto\"\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-size-auto-observer\",\n style: {\n height: \"calc(100% + 1px)\",\n float: \"left\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content-glue\",\n style: {\n margin: \"0px -8px\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-padding\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-viewport os-viewport-native-scrollbars-invisible\",\n style: {\n right: \"0px\",\n bottom: \"0px\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content\",\n style: {\n padding: \"0px 0px\",\n height: \"100%\",\n width: \"100%\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"user-panel mt-3 pb-3 mb-3 d-flex\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n className: \"d-block\"\n }, \"Logged in as: \", parent.api.user.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"nav\", {\n className: \"mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"nav nav-pills nav-sidebar flex-column\",\n \"data-widget\": \"treeview\",\n role: \"menu\",\n \"data-accordion\": \"false\"\n }, li)))))));\n}\n\n//# sourceURL=webpack:///./src/sidebar.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Sidebar; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n\n\n\nfunction Sidebar(props) {\n var parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n\n function onLogout() {\n parent.api.logout().then(function (obj) {\n if (obj.success) {\n document.location = \"/admin\";\n } else {\n parent.showDialog(\"Error logging out: \" + obj.msg, \"Error logging out\");\n }\n });\n }\n\n var menuItems = {\n \"dashboard\": {\n \"name\": \"Dashboard\",\n \"icon\": \"tachometer-alt\"\n },\n \"users\": {\n \"name\": \"Users & Groups\",\n \"icon\": \"users\"\n },\n \"settings\": {\n \"name\": \"Settings\",\n \"icon\": \"tools\"\n },\n \"logs\": {\n \"name\": \"Logs & Notifications\",\n \"icon\": \"file-medical-alt\"\n },\n \"help\": {\n \"name\": \"Help\",\n \"icon\": \"question-circle\"\n }\n };\n var numNotifications = Object.keys(props.notifications).length;\n\n if (numNotifications > 0) {\n if (numNotifications > 9) numNotifications = \"9+\";\n menuItems[\"logs\"][\"badge\"] = {\n type: \"warning\",\n value: numNotifications\n };\n }\n\n var li = [];\n\n for (var id in menuItems) {\n var obj = menuItems[id];\n var badge = obj.badge ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"right badge badge-\" + obj.badge.type\n }, obj.badge.value) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null);\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: id,\n className: \"nav-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"NavLink\"], {\n to: \"/admin/\" + id,\n className: \"nav-link\",\n activeClassName: \"active\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: obj.icon,\n className: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, obj.name, badge))));\n }\n\n li.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n className: \"nav-item\",\n key: \"logout\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n onClick: function onClick() {\n return onLogout();\n },\n className: \"nav-link\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"arrow-left\",\n className: \"nav-icon\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"p\", null, \"Logout\"))));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"aside\", {\n className: \"main-sidebar sidebar-dark-primary elevation-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"brand-link\",\n to: \"/admin/dashboard\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: \"/img/icons/logo.png\",\n alt: \"Logo\",\n className: \"brand-image img-circle elevation-3\",\n style: {\n opacity: \".8\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"brand-text font-weight-light ml-2\"\n }, \"WebBase\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"sidebar os-host os-theme-light os-host-overflow os-host-overflow-y os-host-resize-disabled os-host-scrollbar-horizontal-hidden os-host-transition\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer-host\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\",\n style: {\n left: \"0px\",\n right: \"auto\"\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-size-auto-observer\",\n style: {\n height: \"calc(100% + 1px)\",\n float: \"left\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-resize-observer observed\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content-glue\",\n style: {\n margin: \"0px -8px\"\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-padding\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-viewport os-viewport-native-scrollbars-invisible\",\n style: {\n right: \"0px\",\n bottom: \"0px\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"os-content\",\n style: {\n padding: \"0px 0px\",\n height: \"100%\",\n width: \"100%\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"user-panel mt-3 pb-3 mb-3 d-flex\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"#\",\n className: \"d-block\"\n }, \"Logged in as: \", parent.api.user.name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"nav\", {\n className: \"mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"nav nav-pills nav-sidebar flex-column\",\n \"data-widget\": \"treeview\",\n role: \"menu\",\n \"data-accordion\": \"false\"\n }, li)))))));\n}\n\n//# sourceURL=webpack:///./src/sidebar.js?"); + +/***/ }), + +/***/ "./src/views/adduser.js": +/*!******************************!*\ + !*** ./src/views/adduser.js ***! + \******************************/ +/*! exports provided: default */ +/***/ (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 CreateUser; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_4__ = __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 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 _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 _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\nvar CreateUser = /*#__PURE__*/function (_React$Component) {\n _inherits(CreateUser, _React$Component);\n\n var _super = _createSuper(CreateUser);\n\n function CreateUser(props) {\n var _this;\n\n _classCallCheck(this, CreateUser);\n\n _this = _super.call(this, props);\n _this.state = {\n errors: [],\n sendInvite: true\n };\n return _this;\n }\n\n _createClass(CreateUser, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this2.removeError(i);\n }\n }, _this2.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n var passwordForm = null;\n\n if (!this.state.sendInvite) {\n passwordForm = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"mt-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"password\"\n }, \"Password\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"password\",\n className: \"form-control\",\n placeholder: \"Password\",\n id: \"password\",\n name: \"password\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"confirmPassword\"\n }, \"Confirm Password\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"password\",\n className: \"form-control\",\n placeholder: \"Confirm Password\",\n id: \"confirmPassword\",\n name: \"confirmPassword\"\n })));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Create a new user\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/users\"\n }, \"Users\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Add User\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6 p-3\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"form\", {\n role: \"form\",\n onSubmit: function onSubmit(e) {\n return _this2.submitForm(e);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"username\"\n }, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"text\",\n className: \"form-control\",\n placeholder: \"Enter username\",\n name: \"username\",\n id: \"username\",\n maxLength: 32\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-group\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n htmlFor: \"email\"\n }, \"E-Mail\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"email\",\n className: \"form-control\",\n placeholder: \"E-Mail address\",\n id: \"email\",\n name: \"email\",\n maxLength: 64\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"form-check\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"input\", {\n type: \"checkbox\",\n className: \"form-check-input\",\n onChange: function onChange() {\n return _this2.onCheckboxChange();\n },\n id: \"sendInvite\",\n name: \"sendInvite\",\n defaultChecked: this.state.sendInvite\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"label\", {\n className: \"form-check-label\",\n htmlFor: \"sendInvite\"\n }, \"Send Invitation\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n icon: \"question-circle\",\n className: \"ml-2\",\n style: {\n \"color\": \"#0069d9\"\n },\n \"data-tip\": \"The user will receive an invitation token via email and can choose the password on his own.\",\n \"data-type\": \"info\",\n \"data-place\": \"right\",\n \"data-effect\": \"solid\"\n }))), passwordForm, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"submit\",\n className: \"btn btn-primary mt-2\"\n }, \"Submit\"))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_tooltip__WEBPACK_IMPORTED_MODULE_4__[\"default\"], null));\n }\n }, {\n key: \"submitForm\",\n value: function submitForm(e) {\n e.preventDefault();\n }\n }, {\n key: \"onCheckboxChange\",\n value: function onCheckboxChange() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n sendInvite: !this.state.sendInvite\n }));\n }\n }]);\n\n return CreateUser;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/adduser.js?"); /***/ }), @@ -5886,7 +6030,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 UserOverview; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./src/global.js\");\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.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 _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\nvar UserOverview = /*#__PURE__*/function (_React$Component) {\n _inherits(UserOverview, _React$Component);\n\n var _super = _createSuper(UserOverview);\n\n function UserOverview(props) {\n var _this;\n\n _classCallCheck(this, UserOverview);\n\n _this = _super.call(this, props);\n _this.parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n _this.state = {\n loaded: false,\n users: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n groups: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n errors: []\n };\n return _this;\n }\n\n _createClass(UserOverview, [{\n key: \"fetchGroups\",\n value: function fetchGroups(page) {\n var _this2 = this;\n\n page = page || this.state.groups.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n groups: _objectSpread(_objectSpread({}, this.state.groups), {}, {\n data: {},\n page: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchGroups(page).then(function (res) {\n if (res.success) {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n groups: {\n data: res.groups,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n title: \"Error fetching groups\",\n message: res.msg\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n }\n\n if (!_this2.state.loaded) {\n _this2.fetchUsers(1);\n }\n });\n }\n }, {\n key: \"fetchUsers\",\n value: function fetchUsers(page) {\n var _this3 = this;\n\n page = page || this.state.users.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n users: _objectSpread(_objectSpread({}, this.state.users), {}, {\n data: {},\n pageCount: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchUsers(page).then(function (res) {\n if (res.success) {\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n users: {\n data: res.users,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this3.state.errors.slice();\n\n errors.push({\n title: \"Error fetching users\",\n message: res.msg\n });\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n errors: errors\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n loaded: false\n }));\n this.fetchGroups(1);\n }\n }, {\n key: \"removeError\",\n value: function removeError(i) {\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 key: \"render\",\n value: function render() {\n var _this4 = this;\n\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"text-center mt-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, \"Loading\\u2026\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"spinner\"\n })));\n }\n\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this4.removeError(i);\n }\n }, _this4.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Users & Groups\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Users\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createUserCard()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createGroupCard())))));\n }\n }, {\n key: \"createUserCard\",\n value: function createUserCard() {\n var _this5 = this;\n\n var userRows = [];\n\n for (var uid in this.state.users.data) {\n if (!this.state.users.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var user = this.state.users.data[uid];\n var groups = [];\n\n for (var groupId in user.groups) {\n if (user.groups.hasOwnProperty(groupId)) {\n var groupName = user.groups[groupId];\n var color = groupId === \"1\" ? \"danger\" : \"secondary\";\n groups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"span\", {\n key: \"group-\" + groupId,\n className: \"mr-1 badge badge-\" + color\n }, groupName));\n }\n }\n\n userRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"user-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, groups), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, Object(_global__WEBPACK_IMPORTED_MODULE_3__[\"getPeriodString\"])(user.registered_at))));\n }\n\n var pages = [];\n var previousDisabled = this.state.users.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.users.page >= this.state.users.pageCount ? \" disabled\" : \"\";\n\n var _loop2 = function _loop2(i) {\n var active = _this5.state.users.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.users.pageCount; i++) {\n _loop2(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Users\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this5.fetchUsers();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Email\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Registered\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, userRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.users.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page + 1);\n }\n }, \"Next\")))))));\n }\n }, {\n key: \"createGroupCard\",\n value: function createGroupCard() {\n var _this6 = this;\n\n var groupRows = [];\n\n for (var uid in this.state.groups.data) {\n if (!this.state.groups.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var group = this.state.groups.data[uid];\n groupRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"group-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.memberCount)));\n }\n\n var pages = [];\n var previousDisabled = this.state.groups.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.groups.page >= this.state.groups.pageCount ? \" disabled\" : \"\";\n\n var _loop3 = function _loop3(i) {\n var active = _this6.state.groups.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.groups.pageCount; i++) {\n _loop3(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this6.fetchGroups();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Members\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, groupRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.groups.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page + 1);\n }\n }, \"Next\")))))));\n }\n }]);\n\n return UserOverview;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/users.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return UserOverview; });\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 _elements_icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./src/global.js\");\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.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 _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\nvar UserOverview = /*#__PURE__*/function (_React$Component) {\n _inherits(UserOverview, _React$Component);\n\n var _super = _createSuper(UserOverview);\n\n function UserOverview(props) {\n var _this;\n\n _classCallCheck(this, UserOverview);\n\n _this = _super.call(this, props);\n _this.parent = {\n showDialog: props.showDialog || function () {},\n api: props.api\n };\n _this.state = {\n loaded: false,\n users: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n groups: {\n data: {},\n page: 1,\n pageCount: 1,\n totalCount: 0\n },\n errors: []\n };\n return _this;\n }\n\n _createClass(UserOverview, [{\n key: \"fetchGroups\",\n value: function fetchGroups(page) {\n var _this2 = this;\n\n page = page || this.state.groups.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n groups: _objectSpread(_objectSpread({}, this.state.groups), {}, {\n data: {},\n page: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchGroups(page).then(function (res) {\n if (res.success) {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n groups: {\n data: res.groups,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n title: \"Error fetching groups\",\n message: res.msg\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n }\n\n if (!_this2.state.loaded) {\n _this2.fetchUsers(1);\n }\n });\n }\n }, {\n key: \"fetchUsers\",\n value: function fetchUsers(page) {\n var _this3 = this;\n\n page = page || this.state.users.page;\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n users: _objectSpread(_objectSpread({}, this.state.users), {}, {\n data: {},\n pageCount: 1,\n totalCount: 0\n })\n }));\n this.parent.api.fetchUsers(page).then(function (res) {\n if (res.success) {\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n users: {\n data: res.users,\n pageCount: res.pageCount,\n page: page,\n totalCount: res.totalCount\n }\n }));\n } else {\n var errors = _this3.state.errors.slice();\n\n errors.push({\n title: \"Error fetching users\",\n message: res.msg\n });\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n loaded: true,\n errors: errors\n }));\n }\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n loaded: false\n }));\n this.fetchGroups(1);\n }\n }, {\n key: \"removeError\",\n value: function removeError(i) {\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 key: \"render\",\n value: function render() {\n var _this4 = this;\n\n if (!this.state.loaded) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"text-center mt-4\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, \"Loading\\u2026\\xA0\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"spinner\"\n })));\n }\n\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this4.removeError(i);\n }\n }, _this4.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Users & Groups\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Users\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createUserCard()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6\"\n }, this.createGroupCard())))));\n }\n }, {\n key: \"createUserCard\",\n value: function createUserCard() {\n var _this5 = this;\n\n var userRows = [];\n\n for (var uid in this.state.users.data) {\n if (!this.state.users.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var user = this.state.users.data[uid];\n var groups = [];\n\n for (var groupId in user.groups) {\n if (user.groups.hasOwnProperty(groupId)) {\n var groupName = user.groups[groupId];\n var color = groupId === \"1\" ? \"danger\" : \"secondary\";\n groups.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"span\", {\n key: \"group-\" + groupId,\n className: \"mr-1 badge badge-\" + color\n }, groupName));\n }\n }\n\n userRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"user-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, user.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, groups), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, Object(_global__WEBPACK_IMPORTED_MODULE_3__[\"getPeriodString\"])(user.registered_at))));\n }\n\n var pages = [];\n var previousDisabled = this.state.users.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.users.page >= this.state.users.pageCount ? \" disabled\" : \"\";\n\n var _loop2 = function _loop2(i) {\n var active = _this5.state.users.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.users.pageCount; i++) {\n _loop2(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Users\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n to: \"/admin/users/adduser\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"plus\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this5.fetchUsers();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Username\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Email\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Registered\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, userRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.users.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this5.fetchUsers(_this5.state.users.page + 1);\n }\n }, \"Next\")))))));\n }\n }, {\n key: \"createGroupCard\",\n value: function createGroupCard() {\n var _this6 = this;\n\n var groupRows = [];\n\n for (var uid in this.state.groups.data) {\n if (!this.state.groups.data.hasOwnProperty(uid)) {\n continue;\n }\n\n var group = this.state.groups.data[uid];\n groupRows.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", {\n key: \"group-\" + uid\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"td\", null, group.memberCount)));\n }\n\n var pages = [];\n var previousDisabled = this.state.groups.page === 1 ? \" disabled\" : \"\";\n var nextDisabled = this.state.groups.page >= this.state.groups.pageCount ? \" disabled\" : \"\";\n\n var _loop3 = function _loop3(i) {\n var active = _this6.state.groups.page === i ? \" active\" : \"\";\n pages.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n key: \"page-\" + i,\n className: \"page-item\" + active\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(i);\n }\n }, i)));\n };\n\n for (var i = 1; i <= this.state.groups.pageCount; i++) {\n _loop3(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header border-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Groups\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_2__[\"Link\"], {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n to: \"/admin/users/addgroup\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"plus\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n href: \"#\",\n className: \"btn btn-tool btn-sm\",\n onClick: function onClick() {\n return _this6.fetchGroups();\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n icon: \"sync\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body table-responsive p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"table\", {\n className: \"table table-striped table-valign-middle\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Name\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"th\", null, \"Members\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"tbody\", null, groupRows)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"nav\", {\n className: \"row m-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 pl-3 pt-3 pb-3 text-muted\"\n }, \"Total: \", this.state.groups.totalCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-6 p-0\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"pagination p-2 m-0 justify-content-end\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + previousDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page - 1);\n }\n }, \"Previous\")), pages, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"page-item\" + nextDisabled\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"a\", {\n className: \"page-link\",\n href: \"#\",\n onClick: function onClick() {\n return _this6.fetchGroups(_this6.state.groups.page + 1);\n }\n }, \"Next\")))))));\n }\n }]);\n\n return UserOverview;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/users.js?"); /***/ })