text: (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{118:function(e,t,n){"use strict";var a=n(325),o="Copy to clipboard: #{key}, Enter";e.exports=function(e,t){var n,r,i,s,l,c,u=!1;t||(t={}),n=t.debug||!1;try{if(i=a(),s=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(n){n.stopPropagation(),t.format&&(n.preventDefault(),n.clipboardData.clearData(),n.clipboardData.setData(t.format,e))}),document.body.appendChild(c),s.selectNodeContents(c),l.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),u=!0}catch(p){n&&console.error("unable to copy using clipboardData: ",p),n&&console.error("falling back to prompt"),r=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:o),window.prompt(r,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(s):l.removeAllRanges()),c&&document.body.removeChild(c),i()}return u}},18:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var a=n(2),o=n(3),r=n(6),i=n(4),s=n(5),l=n(0),c=n.n(l),u=n(20),p=(n(25),function(e){function t(){var e,n;Object(a.a)(this,t);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(n=Object(r.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(s)))).state={open:!1},n.onMousedown=function(e){!n._node.contains(e.target)&&n.setState({open:!1})},n.onKeydown=function(e){27===e.which&&n.setState({open:!1})},n.toggle=function(){n.setState(function(e){return{open:!e.open}})},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onMousedown,!1),document.addEventListener("keydown",this.onKeydown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onMousedown,!1),document.removeEventListener("keydown",this.onKeydown,!1)}},{key:"render",value:function(){var e=this;return c.a.createElement("div",{className:"nav-menu",ref:function(t){return e._node=t}},c.a.createElement(u.CSSTransition,{classNames:"menu-options",in:this.state.open,timeout:150},c.a.createElement("ul",{className:"menu-options"},c.a.createElement("li",null,c.a.createElement("a",{href:"/admin"},"Activity Dashboard")),c.a.createElement("li",null,c.a.createElement("a",{href:"/admin/users"},"User Management")),c.a.createElement("li",null,c.a.createElement("a",{href:"/admin/authorities"},"Authority Management")),c.a.createElement("li",null,c.a.createElement("a",{href:"/admin/maintenance"},"Maintenance")))),c.a.createElement("div",{className:"tab",onClick:this.toggle},c.a.createElement("span",{className:"icon"},"\uf0c9")))}}]),t}(l.Component))},21:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var a=n(2),o=n(3),r=n(6),i=n(4),s=n(5),l=n(0),c=n.n(l),u=function(e){function t(){return Object(a.a)(this,t),Object(r.a)(this,Object(i.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(o.a)(t,[{key:"render",value:function(){return c.a.createElement("dl",null,c.a.createElement("dt",null,c.a.createElement("label",{htmlFor:this.props.name},this.props.label)),c.a.createElement("dd",null,c.a.createElement("input",{type:"text",id:this.props.name,name:this.props.name,autoComplete:"off",readOnly:this.props.readOnly,value:this.props.value,onChange:this.props.onChange})))}}]),t}(l.Component)},25:function(e,t,n){},28:function(e,t,n){"use strict";n.d(t,"a",function(){return f});var a=n(2),o=n(3),r=n(6),i=n(4),s=n(5),l=n(0),c=n.n(l),u=n(11),p=n(24),d=n.n(p),m=(n(69),function(e){function t(){var e,n;Object(a.a)(this,t);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(n=Object(r.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(s)))).onKeydown=function(e){27===e.which&&n.props.onNo()},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.onKeydown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.onKeydown,!1)}},{key:"render",value:function(){var e=this.props.type?"confirm-prompt ".concat(this.props.type.toLowerCase()):"confirm-prompt";return c.a.createElement("div",{className:"clicktrap"},c.a.createElement(d.a,{handle:".confirm-prompt-header"},c.a.createElement("div",{className:e},c.a.createElement("div",{className:"confirm-prompt-header"},c.a.createElement("h1",{className:"title"},this.props.title)),c.a.createElement("div",{className:"confirm-prompt-body"},c.a.createElement("p",{className:"message"},this.props.message),c.a.createElement("p",{className:"buttons"},c.a.createElement("button",{className:"btn small yes",onClick:this.props.onYes},"YES"),c.a.createElement("button",{className:"btn small outline no",onClick:this.props.onNo},"NO"))))))}}]),t}(l.Component));function f(e){var t=document.createElement("div");t.setAttribute("id","confirm-prompt-root"),document.body.append(t);Object(u.render)(c.a.createElement(m,{title:e.title,type:e.type,message:e.message,onYes:function(){t.remove(),e.onConfirm()},onNo:function(){t.remove(),e.onCancel&&e.onCancel()}}),t)}},324:function(e,t,n){e.exports=n(338)},325:function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],a=0;a<e.rangeCount;a++)n.push(e.getRangeAt(a));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},326:function(e,t,n){},327:function(e,t,n){},328:function(e,t,n){},329:function(e,t,n){},338:function(e,t,n){"use strict";n.r(t);var a=n(2),o=n(3),r=n(6),i=n(4),s=n(5),l=n(0),c=n.n(l),u=n(11),p=n(9),d=n.n(p),m=n(18),f=n(118),h=n.n(f),g=n(28),v=n(34),y=function(e){function t(){return Object(a.a)(this,t),Object(r.a)(this,Object(i.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(o.a)(t,[{key:"render",value:function(){return c.a.createElement("dl",null,c.a.createElement("dt",null,c.a.createElement("label",{htmlFor:this.props.name},this.props.label)),c.a.createElement("dd",null,c.a.createElement("input",{type:"checkbox",id:this.props.name,name:this.props.name,value:this.props.checked,checked:this.props.checked,onChange:this.props.onChange}),c.a.createElement("label",{htmlFor:this.props.name})))}}]),t}(l.Component),b=n(21),P=(n(326),function(e){function t(){var e,n;Object(a.a)(this,t);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(n=Object(r.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(s)))).state={quota:n.props.quota,is_admin:n.props.isAdmin},n.handleChangeQuota=function(e){n.setState({quota:e.target.value})},n.handleSetAdmin=function(e){n.setState({is_admin:e.target.checked})},n.onResetPassword=function(e){Object(g.a)({title:"Reset Password",type:"warning",message:"Are you sure? This is not reversible.",onConfirm:function(){return d.a.post("/admin/user/".concat(n.props.username,"/reset")).then(function(e){h()(e.data.temporary),alert("Password reset to: ".concat(e.data.temporary,". Password copied to clipboard!"))})}})},n.onSave=function(e){e.preventDefault(),n.props.onSave({quota:parseInt(n.state.quota),is_admin:n.state.is_admin})},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"componentWillReceiveProps",value:function(e){e.quota===this.state.quota&&e.is_admin===this.state.isAdmin||this.setState({quota:e.quota,is_admin:e.is_admin})}},{key:"formatURL",value:function(e){return e.replace(/^https?:\/\//i,"")}},{key:"render",value:function(){return c.a.createElement(v.a,{className:"user-details",title:"User Details",onClose:this.props.onCancel},c.a.createElement("div",{className:"identity"},c.a.createElement("div",{className:"basics"},c.a.createElement("h1",null,this.props.real_name?this.props.real_name:this.props.username),c.a.createElement("p",{className:"member-since"},"Joined on ",new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"short",day:"2-digit"}).format(new Date(this.props.member_since)))),c.a.createElement("div",{className:"extended"},this.props.bio&&c.a.createElement("p",{className:"bio"},this.props.bio),this.props.website&&c.a.createElement("p",{className:"homepage"},c.a.createElement("a",{href:this.props.website},this.formatURL(this.props.website))))),c.a.createElement("div",{className:"user-settings"},c.a.createElement("form",{className:"crud",onSubmit:this.onSave},c.a.createElement(b.a,{name:"quota",label:"Quota (MB)",value:this.state.quota,onChange:this.handleChangeQuota}),c.a.createElement(y,{name:"is_admin",label:"System Administrator",checked:this.state.is_admin,onChange:this.handleSetAdmin}))),c.a.createElement("div",{className:"footer"},c.a.createElement("button",{className:"btn small red delete",onClick:this.props.onDeleteUser},c.a.createElement("span",{className:"icon"},"\uf1f8")," Delete This Account"),c.a.createElement("button",{className:"btn small red outline reset",onClick:this.onResetPassword},"Reset Password"),c.a.createElement("button",{className:"btn small outline",onClick:this.props.onCancel},c.a.createElement("span",{className:"icon"},"\uf00d")," Cancel"),c.a.createElement("button",{className:"btn small",onClick:this.onSave},c.a.createElement("span",{className:"icon"},"\uf00c")," Save")))}}]),t}(l.Component)),C=n(8),w=n.n(C),E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};function T(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}var N={get:function(e,t,n){if(!t)return e;var a=S(t),o=void 0;try{o=a.reduce(function(e,t){return e[t]},e)}catch(r){}return"undefined"!==typeof o?o:n},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=arguments[2],a=S(t),o=void 0,r=e;for(;(o=a.shift())&&a.length;)r[o]||(r[o]={}),r=r[o];return r[o]=n,e},takeRight:function(e,t){var n=t>e.length?0:e.length-t;return e.slice(n)},last:function(e){return e[e.length-1]},orderBy:function(e,t,n,a){return e.sort(function(e,o){for(var r=0;r<t.length;r+=1){var i=t[r],s=!1===n[r]||"desc"===n[r],l=i(e,o);if(l)return s?-l:l}return n[0]?e[a]-o[a]:o[a]-e[a]})},range:function(e){for(var t=[],n=0;n<e;n+=1)t.push(e);return t},remove:function(e,t){return e.filter(function(n,a){var o=t(n);return!!o&&(e.splice(a,1),!0)})},clone:function(e){try{return JSON.parse(JSON.stringify(e,function(e,t){return"function"===typeof t?t.toString():t}))}catch(t){return e}},getFirstDefined:function(){for(var e=0;e<arguments.length;e+=1)if("undefined"!==typeof(arguments.length<=e?void 0:arguments[e]))return arguments.length<=e?void 0:arguments[e]},sum:function(e){return e.reduce(function(e,t){return e+t},0)},makeTemplateComponent:function(e,t){if(!t)throw new Error("No displayName found for template component:",e);var n=function(t){var n=t.children,a=t.className,o=T(t,["children","className"]);return c.a.createElement("div",E({className:w()(e,a)},o),n)};return n.displayName=t,n},groupBy:function(e,t){return e.reduce(function(e,n,a){var o="function"===typeof t?t(n,a):n[t];return e[o]=x(e[o])?e[o]:[],e[o].push(n),e},{})},isArray:x,splitProps:function(e){var t=e.className,n=e.style,a=T(e,["className","style"]);return{className:t,style:n,rest:a||{}}},compactObject:function(e){var t={};e&&Object.keys(e).map(function(n){return Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&"undefined"!==typeof e[n]&&(t[n]=e[n]),!0});return t},isSortingDesc:function(e){return!("desc"!==e.sort&&!0!==e.desc&&!1!==e.asc)},normalizeComponent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"===typeof e?c.a.createElement(e,t):n},asPx:function(e){return e=Number(e),Number.isNaN(e)?null:e+"px"}};function x(e){return Array.isArray(e)}function S(e){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(x(t))for(var a=0;a<t.length;a+=1)e(t[a],n);else n.push(t);return n}(e).join(".").replace(/\[/g,".").replace(/\]/g,"").split(".")}var O=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();var D=function(e){return function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,e),O(n,[{key:"componentWillMount",value:function(){this.setStateWithData(this.getDataModel(this.getResolvedState(),!0))}},{key:"componentDidMount",value:function(){this.fireFetchData()}},{key:"componentWillReceiveProps",value:function(e,t){var n=this.getResolvedState(),a=this.getResolvedState(e,t);["sorted","filtered","resized","expanded"].forEach(function(e){var t="default"+(e.charAt(0).toUpperCase()+e.slice(1));JSON.stringify(n[t])!==JSON.stringify(a[t])&&(a[e]=a[t])});["sortable","filterable","resizable"].forEach(function(e){if(n[e]!==a[e]){var t=e.replace("able","")+"ed",o="default"+(t.charAt(0).toUpperCase()+t.slice(1));a[t]=a[o]}}),n.data===a.data&&n.columns===a.columns&&n.pivotBy===a.pivotBy&&n.sorted===a.sorted&&n.filtered===a.filtered||this.setStateWithData(this.getDataModel(a,n.data!==a.data))}},{key:"setStateWithData",value:function(e,t){var n=this,a=this.getResolvedState(),o=this.getResolvedState({},e),r=o.freezeWhenExpanded;if(o.frozen=!1,r)for(var i=Object.keys(o.expanded),s=0;s<i.length;s+=1)if(o.expanded[i[s]]){o.frozen=!0;break}return(a.frozen&&!o.frozen||a.sorted!==o.sorted||a.filtered!==o.filtered||a.showFilters!==o.showFilters||!o.frozen&&a.resolvedData!==o.resolvedData)&&((a.sorted!==o.sorted&&this.props.collapseOnSortingChange||a.filtered!==o.filtered||a.showFilters!==o.showFilters||a.sortedData&&!o.frozen&&a.resolvedData!==o.resolvedData&&this.props.collapseOnDataChange)&&(o.expanded={}),Object.assign(o,this.getSortedData(o))),a.filtered!==o.filtered&&(o.page=0),o.sortedData&&(o.pages=o.manual?o.pages:Math.ceil(o.sortedData.length/o.pageSize),o.page=o.manual?o.page:Math.max(o.page>=o.pages?o.pages-1:o.page,0)),this.setState(o,function(){t&&t(),a.page===o.page&&a.pageSize===o.pageSize&&a.sorted===o.sorted&&a.filtered===o.filtered||n.fireFetchData()})}}]),n}()},z=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,o=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(l){o=!0,r=l}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},j=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var F=function(e){return function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,e),j(n,[{key:"getResolvedState",value:function(e,t){return k({},N.compactObject(this.state),N.compactObject(this.props),N.compactObject(t),N.compactObject(e))}},{key:"getDataModel",value:function(e,t){var n=this,a=e.columns,o=e.pivotBy,r=void 0===o?[]:o,i=e.data,s=e.resolveData,l=e.pivotIDKey,u=e.pivotValKey,p=e.subRowsKey,d=e.aggregatedKey,m=e.nestingLevelKey,f=e.originalKey,h=e.indexKey,g=e.groupedByPivotKey,v=e.SubComponent,y=!1;a.forEach(function(e){e.columns&&(y=!0)});var b=[].concat(R(a)),P=a.find(function(e){return e.expander||e.columns&&e.columns.some(function(e){return e.expander})});P&&!P.expander&&(P=P.columns.find(function(e){return e.expander})),v&&!P&&(b=[P={expander:!0}].concat(R(b)));var C=[],w=function(e,t){var a=function(e,t){var a=void 0;if((a=e.expander?k({},n.props.column,n.props.expanderDefaults,e):k({},n.props.column,e)).maxWidth<a.minWidth&&(a.minWidth=a.maxWidth),t&&(a.parentColumn=t),"string"===typeof a.accessor){a.id=a.id||a.accessor;var o=a.accessor;return a.accessor=function(e){return N.get(e,o)},a}if(a.accessor&&!a.id)throw console.warn(a),new Error("A column id is required if using a non-string accessor for column above.");return a.accessor||(a.accessor=function(){}),a}(e,t);return C.push(a),a},E=b.map(function(e){return e.columns?k({},e,{columns:e.columns.map(function(t){return w(t,e)})}):w(e)}).slice(),T=[],x=(E=(E=E.map(function(e){if(e.columns){var t=e.columns.filter(function(e){return!(r.indexOf(e.id)>-1)&&N.getFirstDefined(e.show,!0)});return k({},e,{columns:t})}return e})).filter(function(e){return e.columns?e.columns.length:!(r.indexOf(e.id)>-1)&&N.getFirstDefined(e.show,!0)})).findIndex(function(e){return e.pivot});if(r.length){var S=[];r.forEach(function(e){var t=C.find(function(t){return t.id===e});t&&S.push(t)});var O=S.reduce(function(e,t){return e&&e===t.parentColumn&&t.parentColumn},S[0].parentColumn),D=y&&O.Header,j={Header:D=D||function(){return c.a.createElement("strong",null,"Pivoted")},columns:S.map(function(e){return k({},n.props.pivotDefaults,e,{pivoted:!0})})};x>=0?(j=k({},E[x],j),E.splice(x,1,j)):E.unshift(j)}var F=[],W=[],M=function(e,t){F.push(k({},n.props.column,t,{columns:e})),W=[]};E.forEach(function(e){if(e.columns)return T=T.concat(e.columns),W.length>0&&M(W),void M(e.columns,e);T.push(e),W.push(e)}),y&&W.length>0&&M(W);var A=this.resolvedData;this.resolvedData&&!t||(A=s(i),this.resolvedData=A),A=A.map(function(e,t){return function e(t,n){var a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(_(a={},f,t),_(a,h,n),_(a,p,t[p]),_(a,m,o),a);return C.forEach(function(e){e.expander||(r[e.id]=e.accessor(t))}),r[p]&&(r[p]=r[p].map(function(t,n){return e(t,n,o+1)})),r}(e,t)});var K=T.filter(function(e){return!e.expander&&e.aggregate});if(r.length){A=function e(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(a===n.length)return t;var o=Object.entries(N.groupBy(t,n[a])).map(function(e){var t,o=z(e,2),r=o[0],i=o[1];return _(t={},l,n[a]),_(t,u,r),_(t,n[a],r),_(t,p,i),_(t,m,a),_(t,g,!0),t});return o=o.map(function(t){var o,r=e(t[p],n,a+1);return k({},t,(_(o={},p,r),_(o,d,!0),o),function(e){var t={};return K.forEach(function(n){var a=e.map(function(e){return e[n.id]});t[n.id]=n.aggregate(a,e)}),t}(r))})}(A,r)}return k({},e,{resolvedData:A,allVisibleColumns:T,headerGroups:F,allDecoratedColumns:C,hasHeaderGroups:y})}},{key:"getSortedData",value:function(e){var t=e.manual,n=e.sorted,a=e.filtered,o=e.defaultFilterMethod,r=e.resolvedData,i=e.allVisibleColumns,s=e.allDecoratedColumns,l={};return s.filter(function(e){return e.sortMethod}).forEach(function(e){l[e.id]=e.sortMethod}),{sortedData:t?r:this.sortData(this.filterData(r,a,o,i),n,l)}}},{key:"fireFetchData",value:function(){var e=k({},this.getResolvedState(),{page:this.getStateOrProp("page"),pageSize:this.getStateOrProp("pageSize"),filter:this.getStateOrProp("filter")});this.props.onFetchData(e,this)}},{key:"getPropOrState",value:function(e){return N.getFirstDefined(this.props[e],this.state[e])}},{key:"getStateOrProp",value:function(e){return N.getFirstDefined(this.state[e],this.props[e])}},{key:"filterData",value:function(e,t,n,a){var o=this,r=e;return t.length&&(r=(r=t.reduce(function(e,t){var o=a.find(function(e){return e.id===t.id});if(!o||!1===o.filterable)return e;var r=o.filterMethod||n;return o.filterAll?r(t,e,o):e.filter(function(e){return r(t,e,o)})},r)).map(function(e){return e[o.props.subRowsKey]?k({},e,_({},o.props.subRowsKey,o.filterData(e[o.props.subRowsKey],t,n,a))):e}).filter(function(e){return!e[o.props.subRowsKey]||e[o.props.subRowsKey].length>0})),r}},{key:"sortData",value:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.length)return e;var o=(this.props.orderByMethod||N.orderBy)(e,t.map(function(e){return a[e.id]?function(t,n){return a[e.id](t[e.id],n[e.id],e.desc)}:function(t,a){return n.props.defaultSortMethod(t[e.id],a[e.id],e.desc)}}),t.map(function(e){return!e.desc}),this.props.indexKey);return o.forEach(function(e){e[n.props.subRowsKey]&&(e[n.props.subRowsKey]=n.sortData(e[n.props.subRowsKey],t,a))}),o}},{key:"getMinRows",value:function(){return N.getFirstDefined(this.props.minRows,this.getStateOrProp("pageSize"))}},{key:"onPageChange",value:function(e){var t=this.props,n=t.onPageChange,a=t.collapseOnPageChange,o={page:e};a&&(o.expanded={}),this.setStateWithData(o,function(){return n&&n(e)})}},{key:"onPageSizeChange",value:function(e){var t=this.props.onPageSizeChange,n=this.getResolvedState(),a=n.pageSize*n.page,o=Math.floor(a/e);this.setStateWithData({pageSize:e,page:o},function(){return t&&t(e,o)})}},{key:"sortColumn",value:function(e,t){var n=this.getResolvedState(),a=n.sorted,o=n.skipNextSort,r=n.defaultSortDesc,i=Object.prototype.hasOwnProperty.call(e,"defaultSortDesc")?e.defaultSortDesc:r,s=!i;if(o)this.setStateWithData({skipNextSort:!1});else{var l=this.props.onSortedChange,c=N.clone(a||[]).map(function(e){return e.desc=N.isSortingDesc(e),e});if(N.isArray(e)){var u=c.findIndex(function(t){return t.id===e[0].id});if(u>-1)c[u].desc===s?t?c.splice(u,e.length):e.forEach(function(e,t){c[u+t].desc=i}):e.forEach(function(e,t){c[u+t].desc=s}),t||(c=c.slice(u,e.length));else c=t?c.concat(e.map(function(e){return{id:e.id,desc:i}})):e.map(function(e){return{id:e.id,desc:i}})}else{var p=c.findIndex(function(t){return t.id===e.id});if(p>-1){var d=c[p];d.desc===s?t?c.splice(p,1):(d.desc=i,c=[d]):(d.desc=s,t||(c=[d]))}else t?c.push({id:e.id,desc:i}):c=[{id:e.id,desc:i}]}this.setStateWithData({page:!a.length&&c.length||!t?0:this.state.page,sorted:c},function(){return l&&l(c,e,t)})}}},{key:"filterColumn",value:function(e,t){var n=this.getResolvedState().filtered,a=this.props.onFilteredChange,o=(n||[]).filter(function(t){return t.id!==e.id});""!==t&&o.push({id:e.id,value:t}),this.setStateWithData({filtered:o},function(){return a&&a(o,e,t)})}},{key:"resizeColumnStart",value:function(e,t,n){var a=this;e.stopPropagation();var o=e.target.parentElement.getBoundingClientRect().width,r=void 0;r=n?e.changedTouches[0].pageX:e.pageX,this.trapEvents=!0,this.setStateWithData({currentlyResizing:{id:t.id,startX:r,parentWidth:o}},function(){n?(document.addEventListener("touchmove",a.resizeColumnMoving),document.addEventListener("touchcancel",a.resizeColumnEnd),document.addEventListener("touchend",a.resizeColumnEnd)):(document.addEventListener("mousemove",a.resizeColumnMoving),document.addEventListener("mouseup",a.resizeColumnEnd),document.addEventListener("mouseleave",a.resizeColumnEnd))})}},{key:"resizeColumnMoving",value:function(e){e.stopPropagation();var t=this.props,n=t.onResizedChange,a=t.column,o=this.getResolvedState(),r=o.resized,i=o.currentlyResizing,s=o.columns.find(function(e){return e.accessor===i.id}),l=s?s.minResizeWidth:a.minResizeWidth,c=r.filter(function(e){return e.id!==i.id}),u=void 0;"touchmove"===e.type?u=e.changedTouches[0].pageX:"mousemove"===e.type&&(u=e.pageX);var p=Math.max(i.parentWidth+u-i.startX,l);c.push({id:i.id,value:p}),this.setStateWithData({resized:c},function(){return n&&n(c,e)})}},{key:"resizeColumnEnd",value:function(e){e.stopPropagation();var t="touchend"===e.type||"touchcancel"===e.type;t&&(document.removeEventListener("touchmove",this.resizeColumnMoving),document.removeEventListener("touchcancel",this.resizeColumnEnd),document.removeEventListener("touchend",this.resizeColumnEnd)),document.removeEventListener("mousemove",this.resizeColumnMoving),document.removeEventListener("mouseup",this.resizeColumnEnd),document.removeEventListener("mouseleave",this.resizeColumnEnd),t||this.setStateWithData({skipNextSort:!0,currentlyResizing:!1})}}]),n}()},W=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};var A=function(e){return c.a.createElement("button",M({type:"button"},e,{className:"-btn"}),e.children)},K=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getSafePage=n.getSafePage.bind(n),n.changePage=n.changePage.bind(n),n.applyPage=n.applyPage.bind(n),n.state={page:e.page},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,l["Component"]),W(t,[{key:"componentWillReceiveProps",value:function(e){this.props.page!==e.page&&this.setState({page:e.page})}},{key:"getSafePage",value:function(e){return Number.isNaN(e)&&(e=this.props.page),Math.min(Math.max(e,0),this.props.pages-1)}},{key:"changePage",value:function(e){e=this.getSafePage(e),this.setState({page:e}),this.props.page!==e&&this.props.onPageChange(e)}},{key:"applyPage",value:function(e){e&&e.preventDefault();var t=this.state.page;this.changePage(""===t?this.props.page:t)}},{key:"getPageJumpProperties",value:function(){var e=this;return{onKeyPress:function(t){13!==t.which&&13!==t.keyCode||e.applyPage()},onBlur:this.applyPage,value:""===this.state.page?"":this.state.page+1,onChange:function(t){var n=t.target.value,a=n-1;if(""===n)return e.setState({page:n});e.setState({page:e.getSafePage(a)})},inputType:""===this.state.page?"text":"number",pageJumpText:this.props.pageJumpText}}},{key:"render",value:function(){var e=this,t=this.props,n=t.pages,a=t.page,o=t.showPageSizeOptions,r=t.pageSizeOptions,i=t.pageSize,s=t.showPageJump,l=t.canPrevious,u=t.canNext,p=t.onPageSizeChange,d=t.className,m=t.PreviousComponent,f=t.NextComponent,h=t.renderPageJump,g=t.renderCurrentPage,v=t.renderTotalPagesCount,y=t.renderPageSizeOptions;return c.a.createElement("div",{className:w()(d,"-pagination"),style:this.props.style},c.a.createElement("div",{className:"-previous"},c.a.createElement(m,{onClick:function(){l&&e.changePage(a-1)},disabled:!l},this.props.previousText)),c.a.createElement("div",{className:"-center"},c.a.createElement("span",{className:"-pageInfo"},this.props.pageText," ",s?h(this.getPageJumpProperties()):g(a)," ",this.props.ofText," ",v(n)),o&&y({pageSize:i,rowsSelectorText:this.props.rowsSelectorText,pageSizeOptions:r,onPageSizeChange:p,rowsText:this.props.rowsText})),c.a.createElement("div",{className:"-next"},c.a.createElement(f,{onClick:function(){u&&e.changePage(a+1)},disabled:!u},this.props.nextText)))}}]),t}();K.defaultProps={PreviousComponent:A,NextComponent:A,renderPageJump:function(e){var t=e.onChange,n=e.value,a=e.onBlur,o=e.onKeyPress,r=e.inputType,i=e.pageJumpText;return c.a.createElement("div",{className:"-pageJump"},c.a.createElement("input",{"aria-label":i,type:r,onChange:t,value:n,onBlur:a,onKeyPress:o}))},renderCurrentPage:function(e){return c.a.createElement("span",{className:"-currentPage"},e+1)},renderTotalPagesCount:function(e){return c.a.createElement("span",{className:"-totalPages"},e||1)},renderPageSizeOptions:function(e){var t=e.pageSize,n=e.pageSizeOptions,a=e.rowsSelectorText,o=e.onPageSizeChange,r=e.rowsText;return c.a.createElement("span",{className:"select-wrap -pageSizeOptions"},c.a.createElement("select",{"aria-label":a,onChange:function(e){return o(Number(e.target.value))},value:t},n.map(function(e,t){return c.a.createElement("option",{key:t,value:e},e+" "+r)})))}};var L=K,B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};function U(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}var G=function(){return{}},I={data:[],resolveData:function(e){return e},loading:!1,showPagination:!0,showPaginationTop:!1,showPaginationBottom:!0,showPageSizeOptions:!0,pageSizeOptions:[5,10,20,25,50,100],defaultPage:0,defaultPageSize:20,showPageJump:!0,collapseOnSortingChange:!0,collapseOnPageChange:!0,collapseOnDataChange:!0,freezeWhenExpanded:!1,sortable:!0,multiSort:!0,resizable:!0,filterable:!1,defaultSortDesc:!1,defaultSorted:[],defaultFiltered:[],defaultResized:[],defaultExpanded:{},defaultFilterMethod:function(e,t,n){var a=e.pivotId||e.id;return void 0===t[a]||String(t[a]).startsWith(e.value)},defaultSortMethod:function(e,t,n){return t=null===t||void 0===t?"":t,(e="string"===typeof(e=null===e||void 0===e?"":e)?e.toLowerCase():e)>(t="string"===typeof t?t.toLowerCase():t)?1:e<t?-1:0},onPageChange:void 0,onPageSizeChange:void 0,onSortedChange:void 0,onFilteredChange:void 0,onResizedChange:void 0,onExpandedChange:void 0,pivotBy:void 0,pivotValKey:"_pivotVal",pivotIDKey:"_pivotID",subRowsKey:"_subRows",aggregatedKey:"_aggregated",nestingLevelKey:"_nestingLevel",originalKey:"_original",indexKey:"_index",groupedByPivotKey:"_groupedByPivot",onFetchData:function(){return null},className:"",style:{},getProps:G,getTableProps:G,getTheadGroupProps:G,getTheadGroupTrProps:G,getTheadGroupThProps:G,getTheadProps:G,getTheadTrProps:G,getTheadThProps:G,getTheadFilterProps:G,getTheadFilterTrProps:G,getTheadFilterThProps:G,getTbodyProps:G,getTrGroupProps:G,getTrProps:G,getTdProps:G,getTfootProps:G,getTfootTrProps:G,getTfootTdProps:G,getPaginationProps:G,getLoadingProps:G,getNoDataProps:G,getResizerProps:G,column:{Cell:void 0,Header:void 0,Footer:void 0,Aggregated:void 0,Pivot:void 0,PivotValue:void 0,Expander:void 0,Filter:void 0,Placeholder:void 0,sortable:void 0,resizable:void 0,filterable:void 0,show:!0,minWidth:100,minResizeWidth:11,className:"",style:{},getProps:G,aggregate:void 0,headerClassName:"",headerStyle:{},getHeaderProps:G,footerClassName:"",footerStyle:{},getFooterProps:G,filterMethod:void 0,filterAll:!1,sortMethod:void 0},expanderDefaults:{sortable:!1,resizable:!1,filterable:!1,width:35},pivotDefaults:{},previousText:"Previous",nextText:"Next",loadingText:"Loading...",noDataText:"No rows found",pageText:"Page",ofText:"of",rowsText:"rows",pageJumpText:"jump to page",rowsSelectorText:"rows per page",TableComponent:function(e){var t=e.children,n=e.className,a=U(e,["children","className"]);return c.a.createElement("div",B({className:w()("rt-table",n),role:"grid"},a),t)},TheadComponent:N.makeTemplateComponent("rt-thead","Thead"),TbodyComponent:N.makeTemplateComponent("rt-tbody","Tbody"),TrGroupComponent:function(e){var t=e.children,n=e.className,a=U(e,["children","className"]);return c.a.createElement("div",B({className:w()("rt-tr-group",n),role:"rowgroup"},a),t)},TrComponent:function(e){var t=e.children,n=e.className,a=U(e,["children","className"]);return c.a.createElement("div",B({className:w()("rt-tr",n),role:"row"},a),t)},ThComponent:function(e){var t=e.toggleSort,n=e.className,a=e.children,o=U(e,["toggleSort","className","children"]);return c.a.createElement("div",B({className:w()("rt-th",n),onClick:function(e){return t&&t(e)},role:"columnheader",tabIndex:"-1"},o),a)},TdComponent:function(e){e.toggleSort;var t=e.className,n=e.children,a=U(e,["toggleSort","className","children"]);return c.a.createElement("div",B({className:w()("rt-td",t),role:"gridcell"},a),n)},TfootComponent:N.makeTemplateComponent("rt-tfoot","Tfoot"),FilterComponent:function(e){var t=e.filter,n=e.onChange,a=e.column;return c.a.createElement("input",{type:"text",style:{width:"100%"},placeholder:a.Placeholder,value:t?t.value:"",onChange:function(e){return n(e.target.value)}})},ExpanderComponent:function(e){var t=e.isExpanded;return c.a.createElement("div",{className:w()("rt-expander",t&&"-open")},"\u2022")},PivotValueComponent:function(e){var t=e.subRows,n=e.value;return c.a.createElement("span",null,n," ",t&&"("+t.length+")")},AggregatedComponent:function(e){var t=e.subRows,n=e.column,a=t.filter(function(e){return"undefined"!==typeof e[n.id]}).map(function(e,a){return c.a.createElement("span",{key:a},e[n.id],a<t.length-1?", ":"")});return c.a.createElement("span",null,a)},PivotComponent:void 0,PaginationComponent:L,PreviousComponent:void 0,NextComponent:void 0,LoadingComponent:function(e){var t=e.className,n=e.loading,a=e.loadingText,o=U(e,["className","loading","loadingText"]);return c.a.createElement("div",B({className:w()("-loading",{"-active":n},t)},o),c.a.createElement("div",{className:"-loading-inner"},a))},NoDataComponent:N.makeTemplateComponent("rt-noData","NoData"),ResizerComponent:N.makeTemplateComponent("rt-resizer","Resizer"),PadRowComponent:function(){return c.a.createElement("span",null,"\xa0")}},J=n(1),H=n.n(J),V={data:H.a.any,loading:H.a.bool,showPagination:H.a.bool,showPaginationTop:H.a.bool,showPaginationBottom:H.a.bool,showPageSizeOptions:H.a.bool,pageSizeOptions:H.a.array,defaultPageSize:H.a.number,showPageJump:H.a.bool,collapseOnSortingChange:H.a.bool,collapseOnPageChange:H.a.bool,collapseOnDataChange:H.a.bool,freezeWhenExpanded:H.a.bool,sortable:H.a.bool,resizable:H.a.bool,filterable:H.a.bool,defaultSortDesc:H.a.bool,defaultSorted:H.a.array,defaultFiltered:H.a.array,defaultResized:H.a.array,defaultExpanded:H.a.object,defaultFilterMethod:H.a.func,defaultSortMethod:H.a.func,onPageChange:H.a.func,onPageSizeChange:H.a.func,onSortedChange:H.a.func,onFilteredChange:H.a.func,onResizedChange:H.a.func,onExpandedChange:H.a.func,pivotBy:H.a.array,pivotValKey:H.a.string,pivotIDKey:H.a.string,subRowsKey:H.a.string,aggregatedKey:H.a.string,nestingLevelKey:H.a.string,originalKey:H.a.string,indexKey:H.a.string,groupedByPivotKey:H.a.string,onFetchData:H.a.func,className:H.a.string,style:H.a.object,getProps:H.a.func,getTableProps:H.a.func,getTheadGroupProps:H.a.func,getTheadGroupTrProps:H.a.func,getTheadGroupThProps:H.a.func,getTheadProps:H.a.func,getTheadTrProps:H.a.func,getTheadThProps:H.a.func,getTheadFilterProps:H.a.func,getTheadFilterTrProps:H.a.func,getTheadFilterThProps:H.a.func,getTbodyProps:H.a.func,getTrGroupProps:H.a.func,getTrProps:H.a.func,getTdProps:H.a.func,getTfootProps:H.a.func,getTfootTrProps:H.a.func,getTfootTdProps:H.a.func,getPaginationProps:H.a.func,getLoadingProps:H.a.func,getNoDataProps:H.a.func,getResizerProps:H.a.func,columns:H.a.arrayOf(H.a.shape({Cell:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),Header:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),Footer:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),Aggregated:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),Pivot:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),PivotValue:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),Expander:H.a.oneOfType([H.a.element,H.a.string,H.a.func]),Filter:H.a.oneOfType([H.a.element,H.a.func]),sortable:H.a.bool,resizable:H.a.bool,filterable:H.a.bool,show:H.a.bool,minWidth:H.a.number,minResizeWidth:H.a.number,className:H.a.string,style:H.a.object,getProps:H.a.func,aggregate:H.a.func,headerClassName:H.a.string,headerStyle:H.a.object,getHeaderProps:H.a.func,footerClassName:H.a.string,footerStyle:H.a.object,getFooterProps:H.a.func,filterMethod:H.a.func,filterAll:H.a.bool,sortMethod:H.a.func})),expanderDefaults:H.a.shape({sortable:H.a.bool,resizable:H.a.bool,filterable:H.a.bool,width:H.a.number}),pivotDefaults:H.a.object,previousText:H.a.node,nextText:H.a.node,loadingText:H.a.node,noDataText:H.a.node,pageText:H.a.node,ofText:H.a.node,rowsText:H.a.node,pageJumpText:H.a.node,rowsSelectorText:H.a.node,TableComponent:H.a.oneOfType([H.a.func,H.a.element]),TheadComponent:H.a.oneOfType([H.a.func,H.a.element]),TbodyComponent:H.a.oneOfType([H.a.func,H.a.element]),TrGroupComponent:H.a.oneOfType([H.a.func,H.a.element]),TrComponent:H.a.oneOfType([H.a.func,H.a.element]),ThComponent:H.a.oneOfType([H.a.func,H.a.element]),TdComponent:H.a.oneOfType([H.a.func,H.a.element]),TfootComponent:H.a.oneOfType([H.a.func,H.a.element]),FilterComponent:H.a.oneOfType([H.a.func,H.a.element]),ExpanderComponent:H.a.oneOfType([H.a.func,H.a.element]),PivotValueComponent:H.a.oneOfType([H.a.func,H.a.element]),AggregatedComponent:H.a.oneOfType([H.a.func,H.a.element]),PivotComponent:H.a.oneOfType([H.a.func,H.a.element]),PaginationComponent:H.a.oneOfType([H.a.func,H.a.element]),PreviousComponent:H.a.oneOfType([H.a.func,H.a.element]),NextComponent:H.a.oneOfType([H.a.func,H.a.element]),LoadingComponent:H.a.oneOfType([H.a.func,H.a.element]),NoDataComponent:H.a.oneOfType([H.a.func,H.a.element]),ResizerComponent:H.a.oneOfType([H.a.func,H.a.element]),PadRowComponent:H.a.oneOfType([H.a.func,H.a.element])},q=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,o=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(l){o=!0,r=l}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Q=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();var Y=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.getResolvedState=n.getResolvedState.bind(n),n.getDataModel=n.getDataModel.bind(n),n.getSortedData=n.getSortedData.bind(n),n.fireFetchData=n.fireFetchData.bind(n),n.getPropOrState=n.getPropOrState.bind(n),n.getStateOrProp=n.getStateOrProp.bind(n),n.filterData=n.filterData.bind(n),n.sortData=n.sortData.bind(n),n.getMinRows=n.getMinRows.bind(n),n.onPageChange=n.onPageChange.bind(n),n.onPageSizeChange=n.onPageSizeChange.bind(n),n.sortColumn=n.sortColumn.bind(n),n.filterColumn=n.filterColumn.bind(n),n.resizeColumnStart=n.resizeColumnStart.bind(n),n.resizeColumnEnd=n.resizeColumnEnd.bind(n),n.resizeColumnMoving=n.resizeColumnMoving.bind(n),n.state={page:e.defaultPage,pageSize:e.defaultPageSize,sorted:e.defaultSorted,expanded:e.defaultExpanded,filtered:e.defaultFiltered,resized:e.defaultResized,currentlyResizing:!1,skipNextSort:!1},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,F(D(l["Component"]))),Q(t,[{key:"render",value:function(){var e=this,t=this.getResolvedState(),n=t.children,a=t.className,o=t.style,r=t.getProps,i=t.getTableProps,s=t.getTheadGroupProps,l=t.getTheadGroupTrProps,u=t.getTheadGroupThProps,p=t.getTheadProps,d=t.getTheadTrProps,m=t.getTheadThProps,f=t.getTheadFilterProps,h=t.getTheadFilterTrProps,g=t.getTheadFilterThProps,v=t.getTbodyProps,y=t.getTrGroupProps,b=t.getTrProps,P=t.getTdProps,C=t.getTfootProps,E=t.getTfootTrProps,T=t.getTfootTdProps,x=t.getPaginationProps,S=t.getLoadingProps,O=t.getNoDataProps,D=t.getResizerProps,z=t.showPagination,k=t.showPaginationTop,j=t.showPaginationBottom,_=t.manual,R=t.loadingText,F=t.noDataText,W=t.sortable,M=t.multiSort,A=t.resizable,K=t.filterable,L=t.pivotIDKey,B=t.pivotValKey,U=t.pivotBy,G=t.subRowsKey,J=t.aggregatedKey,H=t.originalKey,V=t.indexKey,Q=t.groupedByPivotKey,Y=t.loading,Z=t.pageSize,$=t.page,ee=t.sorted,te=t.filtered,ne=t.resized,ae=t.expanded,oe=t.pages,re=t.onExpandedChange,ie=t.TableComponent,se=t.TheadComponent,le=t.TbodyComponent,ce=t.TrGroupComponent,ue=t.TrComponent,pe=t.ThComponent,de=t.TdComponent,me=t.TfootComponent,fe=t.PaginationComponent,he=t.LoadingComponent,ge=t.SubComponent,ve=t.NoDataComponent,ye=t.ResizerComponent,be=t.ExpanderComponent,Pe=t.PivotValueComponent,Ce=t.PivotComponent,we=t.AggregatedComponent,Ee=t.FilterComponent,Te=t.PadRowComponent,Ne=t.resolvedData,xe=t.allVisibleColumns,Se=t.headerGroups,Oe=t.hasHeaderGroups,De=t.sortedData,ze=t.currentlyResizing,ke=Z*$,je=ke+Z,_e=_?Ne:De.slice(ke,je),Re=this.getMinRows(),Fe=N.range(Math.max(Re-_e.length,0)),We=xe.some(function(e){return e.Footer}),Me=K||xe.some(function(e){return e.filterable}),Ae=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return[t.map(function(t,o){var r=X({},t,{_viewIndex:a+=1}),i=n.concat([o]);if(r[G]&&N.get(ae,i)){var s=e(r[G],i,a),l=q(s,2);r[G]=l[0],a=l[1]}return r}),a]}(_e),Ke=q(Ae,1);_e=Ke[0];var Le=$>0,Be=$+1<oe,Ue=N.sum(xe.map(function(e){var t=ne.find(function(t){return t.id===e.id})||{};return N.getFirstDefined(t.value,e.width,e.minWidth)})),Ge=-1,Ie=X({},t,{startRow:ke,endRow:je,pageRows:_e,minRows:Re,padRows:Fe,hasColumnFooter:We,canPrevious:Le,canNext:Be,rowMinWidth:Ue}),Je=N.splitProps(r(Ie,void 0,void 0,this)),He=N.splitProps(i(Ie,void 0,void 0,this)),Ve=N.splitProps(v(Ie,void 0,void 0,this)),qe=S(Ie,void 0,void 0,this),Xe=O(Ie,void 0,void 0,this),Qe=function(t,n){var a=function(e){return(ne.find(function(t){return t.id===e.id})||{}).value},o=N.sum(t.columns.map(function(e){return e.width||a(e)?0:e.minWidth})),r=N.sum(t.columns.map(function(e){return N.getFirstDefined(a(e),e.width,e.minWidth)})),i=N.sum(t.columns.map(function(e){return N.getFirstDefined(a(e),e.width,e.maxWidth)})),s=N.splitProps(u(Ie,void 0,t,e)),l=N.splitProps(t.getHeaderProps(Ie,void 0,t,e)),p=[t.headerClassName,s.className,l.className],d=X({},t.headerStyle,s.style,l.style),m=X({},s.rest,l.rest),f={flex:o+" 0 auto",width:N.asPx(r),maxWidth:N.asPx(i)};return c.a.createElement(pe,X({key:n+"-"+t.id,className:w()(p),style:X({},d,f)},m),N.normalizeComponent(t.Header,{data:De,column:t}))},Ye=function(t,n){var a=ne.find(function(e){return e.id===t.id})||{},o=ee.find(function(e){return e.id===t.id}),r="function"===typeof t.show?t.show():t.show,i=N.getFirstDefined(a.value,t.width,t.minWidth),s=N.getFirstDefined(a.value,t.width,t.maxWidth),l=N.splitProps(m(Ie,void 0,t,e)),u=N.splitProps(t.getHeaderProps(Ie,void 0,t,e)),p=[t.headerClassName,l.className,u.className],d=X({},t.headerStyle,l.style,u.style),f=X({},l.rest,u.rest),h=N.getFirstDefined(t.resizable,A,!1),g=h?c.a.createElement(ye,X({onMouseDown:function(n){return e.resizeColumnStart(n,t,!1)},onTouchStart:function(n){return e.resizeColumnStart(n,t,!0)}},D("finalState",void 0,t,e))):null,v=N.getFirstDefined(t.sortable,W,!1);return c.a.createElement(pe,X({key:n+"-"+t.id,className:w()(p,h&&"rt-resizable-header",o?o.desc?"-sort-desc":"-sort-asc":"",v&&"-cursor-pointer",!r&&"-hidden",U&&U.slice(0,-1).includes(t.id)&&"rt-header-pivot"),style:X({},d,{flex:i+" 0 auto",width:N.asPx(i),maxWidth:N.asPx(s)}),toggleSort:function(n){v&&e.sortColumn(t,!!M&&n.shiftKey)}},f),c.a.createElement("div",{className:w()(h&&"rt-resizable-header-content")},N.normalizeComponent(t.Header,{data:De,column:t})),g)},Ze=function(t,n){var a=ne.find(function(e){return e.id===t.id})||{},o=N.getFirstDefined(a.value,t.width,t.minWidth),r=N.getFirstDefined(a.value,t.width,t.maxWidth),i=N.splitProps(g(Ie,void 0,t,e)),s=N.splitProps(t.getHeaderProps(Ie,void 0,t,e)),l=[t.headerClassName,i.className,s.className],u=X({},t.headerStyle,i.style,s.style),p=X({},i.rest,s.rest),d=te.find(function(e){return e.id===t.id}),m=t.Filter||Ee,f=N.getFirstDefined(t.filterable,K,!1);return c.a.createElement(pe,X({key:n+"-"+t.id,className:w()(l),style:X({},u,{flex:o+" 0 auto",width:N.asPx(o),maxWidth:N.asPx(r)})},p),f?N.normalizeComponent(m,{column:t,filter:d,onChange:function(n){return e.filterColumn(t,n)}},I.column.Filter):null)},$e=function(t,n){var a=ne.find(function(e){return e.id===t.id})||{},o="function"===typeof t.show?t.show():t.show,r=N.getFirstDefined(a.value,t.width,t.minWidth),i=r,s=N.getFirstDefined(a.value,t.width,t.maxWidth),l=N.splitProps(P(Ie,void 0,t,e)),u=N.splitProps(t.getProps(Ie,void 0,t,e)),p=[l.className,t.className,u.className],d=X({},l.style,t.style,u.style);return c.a.createElement(de,X({key:n+"-"+t.id,className:w()(p,!o&&"hidden"),style:X({},d,{flex:i+" 0 auto",width:N.asPx(r),maxWidth:N.asPx(s)})},l.rest),N.normalizeComponent(Te))},et=function(t,n){var a=y(Ie,void 0,void 0,e),o=N.splitProps(b(Ie,void 0,void 0,e));return c.a.createElement(ce,X({key:"pad-"+n},a),c.a.createElement(ue,{className:w()("-padRow",(_e.length+n)%2?"-even":"-odd",o.className),style:o.style||{}},xe.map($e)))},tt=function(t,n){var a=ne.find(function(e){return e.id===t.id})||{},o="function"===typeof t.show?t.show():t.show,r=N.getFirstDefined(a.value,t.width,t.minWidth),i=N.getFirstDefined(a.value,t.width,t.maxWidth),s=N.splitProps(T(Ie,void 0,void 0,e)),l=N.splitProps(t.getProps(Ie,void 0,t,e)),u=N.splitProps(t.getFooterProps(Ie,void 0,t,e)),p=[s.className,t.className,l.className,u.className],d=X({},s.style,t.style,l.style,u.style);return c.a.createElement(de,X({key:n+"-"+t.id,className:w()(p,!o&&"hidden"),style:X({},d,{flex:r+" 0 auto",width:N.asPx(r),maxWidth:N.asPx(i)})},l.rest,s.rest,u.rest),N.normalizeComponent(t.Footer,{data:De,column:t}))},nt=function(n){var a=N.splitProps(x(Ie,void 0,void 0,e));return c.a.createElement(fe,X({},t,{pages:oe,canPrevious:Le,canNext:Be,onPageChange:e.onPageChange,onPageSizeChange:e.onPageSizeChange,className:a.className,style:a.style,isTop:n},a.rest))},at=function(){return c.a.createElement("div",X({className:w()("ReactTable",a,Je.className),style:X({},o,Je.style)},Je.rest),z&&k?c.a.createElement("div",{className:"pagination-top"},nt(!0)):null,c.a.createElement(ie,X({className:w()(He.className,ze?"rt-resizing":""),style:He.style},He.rest),Oe?function(){var t=N.splitProps(s(Ie,void 0,void 0,e)),n=N.splitProps(l(Ie,void 0,void 0,e));return c.a.createElement(se,X({className:w()("-headerGroups",t.className),style:X({},t.style,{minWidth:Ue+"px"})},t.rest),c.a.createElement(ue,X({className:n.className,style:n.style},n.rest),Se.map(Qe)))}():null,function(){var t=N.splitProps(p(Ie,void 0,void 0,e)),n=N.splitProps(d(Ie,void 0,void 0,e));return c.a.createElement(se,X({className:w()("-header",t.className),style:X({},t.style,{minWidth:Ue+"px"})},t.rest),c.a.createElement(ue,X({className:n.className,style:n.style},n.rest),xe.map(Ye)))}(),Me?function(){var t=N.splitProps(f(Ie,void 0,void 0,e)),n=N.splitProps(h(Ie,void 0,void 0,e));return c.a.createElement(se,X({className:w()("-filters",t.className),style:X({},t.style,{minWidth:Ue+"px"})},t.rest),c.a.createElement(ue,X({className:n.className,style:n.style},n.rest),xe.map(Ze)))}():null,c.a.createElement(le,X({className:w()(Ve.className),style:X({},Ve.style,{minWidth:Ue+"px"})},Ve.rest),_e.map(function(t,n){return function t(n,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r={original:n[H],row:n,index:n[V],viewIndex:Ge+=1,pageSize:Z,page:$,level:o.length,nestingPath:o.concat([a]),aggregated:n[J],groupedByPivot:n[Q],subRows:n[G]},i=N.get(ae,r.nestingPath),s=y(Ie,r,void 0,e),l=N.splitProps(b(Ie,r,void 0,e));return c.a.createElement(ce,X({key:r.nestingPath.join("_")},s),c.a.createElement(ue,X({className:w()(l.className,n._viewIndex%2?"-even":"-odd"),style:l.style},l.rest),xe.map(function(t,a){var o=ne.find(function(e){return e.id===t.id})||{},s="function"===typeof t.show?t.show():t.show,l=N.getFirstDefined(o.value,t.width,t.minWidth),u=N.getFirstDefined(o.value,t.width,t.maxWidth),p=N.splitProps(P(Ie,r,t,e)),d=N.splitProps(t.getProps(Ie,r,t,e)),m=[p.className,t.className,d.className],f=X({},p.style,t.style,d.style),h=X({},r,{isExpanded:i,column:X({},t),value:r.row[t.id],pivoted:t.pivoted,expander:t.expander,resized:ne,show:s,width:l,maxWidth:u,tdProps:p,columnProps:d,classes:m,styles:f}),g=h.value,v=void 0,y=void 0,b=void 0,C=N.normalizeComponent(t.Cell,h,g),E=t.Aggregated||(t.aggregate?t.Cell:we),T=t.Expander||be,x=t.PivotValue||Pe,S=Ce||function(e){return c.a.createElement("div",null,c.a.createElement(T,e),c.a.createElement(x,e))},O=t.Pivot||S;(h.pivoted||h.expander)&&(h.expandable=!0,v=!0,!h.pivoted||h.subRows||ge||(h.expandable=!1)),h.pivoted?(y=r.row[L]===t.id&&h.subRows,b=U.indexOf(t.id)>U.indexOf(r.row[L])&&h.subRows,C=y?N.normalizeComponent(O,X({},h,{value:n[B]}),n[B]):b?N.normalizeComponent(E,h,g):null):h.aggregated&&(C=N.normalizeComponent(E,h,g)),h.expander&&(C=N.normalizeComponent(T,h,n[B]),U&&(h.groupedByPivot&&(C=null),h.subRows||ge||(C=null)));var D=v?function(t){var n=N.clone(ae);return n=i?N.set(n,h.nestingPath,!1):N.set(n,h.nestingPath,{}),e.setStateWithData({expanded:n},function(){return re&&re(n,h.nestingPath,t)})}:function(){},z={onClick:D};return p.rest.onClick&&(z.onClick=function(e){p.rest.onClick(e,function(){return D(e)})}),d.rest.onClick&&(z.onClick=function(e){d.rest.onClick(e,function(){return D(e)})}),c.a.createElement(de,X({key:a+"-"+t.id,className:w()(m,!h.expandable&&!s&&"hidden",h.expandable&&"rt-expandable",(y||b)&&"rt-pivot"),style:X({},f,{flex:l+" 0 auto",width:N.asPx(l),maxWidth:N.asPx(u)})},p.rest,d.rest,z),C)})),r.subRows&&i&&r.subRows.map(function(e,n){return t(e,n,r.nestingPath)}),ge&&!r.subRows&&i&&ge(r,function(){var e=N.clone(ae);N.set(e,r.nestingPath,!1)}))}(t,n)}),Fe.map(et)),We?function(){var t=N.splitProps(C(Ie,void 0,void 0,e)),n=N.splitProps(E(Ie,void 0,void 0,e));return c.a.createElement(me,X({className:t.className,style:X({},t.style,{minWidth:Ue+"px"})},t.rest),c.a.createElement(ue,X({className:w()(n.className),style:n.style},n.rest),xe.map(tt)))}():null),z&&j?c.a.createElement("div",{className:"pagination-bottom"},nt(!1)):null,!_e.length&&c.a.createElement(ve,Xe,N.normalizeComponent(F)),c.a.createElement(he,X({loading:Y,loadingText:R},qe)))};return n?n(Ie,at,this):at()}}]),t}();Y.propTypes=V,Y.defaultProps=I;var Z=Y,$=n(48),ee=function(e){return c.a.createElement("button",e,e.children)},te=function(e){function t(e){var n;return Object(a.a)(this,t),(n=Object(r.a)(this,Object(i.a)(t).call(this))).filterPages=function(e,t){return e.filter(function(e){return e<=t})},n.getVisiblePages=function(e,t){return t<7?n.filterPages([1,2,3,4,5,6],t):e%5>=0&&e>4&&e+2<t?[1,e-1,e,e+1,t]:e%5>=0&&e>4&&e+2>=t?[1,t-3,t-2,t-1,t]:[1,2,3,4,5,t]},n.changePage=n.changePage.bind(Object($.a)(n)),n.state={visiblePages:n.getVisiblePages(null,e.pages)},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"componentWillReceiveProps",value:function(e){this.props.pages!==e.pages&&this.setState({visiblePages:this.getVisiblePages(null,e.pages)}),this.changePage(e.page+1)}},{key:"changePage",value:function(e){if(e!==this.props.page+1){var t=this.getVisiblePages(e,this.props.pages);this.setState({visiblePages:this.filterPages(t,this.props.pages)}),this.props.onPageChange(e-1)}}},{key:"render",value:function(){var e=this,t=this.props.PageButtonComponent,n=void 0===t?ee:t,a=this.state.visiblePages,o=this.props.page+1;return c.a.createElement("div",{className:"Table__pagination"},c.a.createElement("div",{className:"Table__prevPageWrapper"},c.a.createElement(n,{className:"Table__pageButton",onClick:function(){1!==o&&e.changePage(o-1)},disabled:1===o},this.props.previousText)),c.a.createElement("div",{className:"Table__visiblePagesWrapper"},a.map(function(t,a,r){return c.a.createElement(n,{key:t,className:o===t?"Table__pageButton Table__pageButton--active":"Table__pageButton",onClick:e.changePage.bind(null,t)},r[a-1]+2<t?"...".concat(t):t)})),c.a.createElement("div",{className:"Table__nextPageWrapper"},c.a.createElement(n,{className:"Table__pageButton",onClick:function(){o!==e.props.pages&&e.changePage(o+1)},disabled:o===this.props.pages},this.props.nextText)))}}]),t}(c.a.Component),ne=(n(327),n(328),function(e){function t(){var e,n;Object(a.a)(this,t);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(n=Object(r.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(s)))).state={loading:!0,total_pages:-1,current_page:0,page_size:15,users:[]},n.onFetchData=function(e,t){n.setState({loading:!0});var a=n.state.page_size*e.page,o=n.state.page_size,r=e.sorted&&e.sorted[0],i=r?r.id:"member_since",s=r&&r.desc?"desc":"asc",l="/admin/users.json?offset=".concat(a,"&size=").concat(o,"&sortBy=").concat(i,"&sortOrder=").concat(s);d.a.get(l).then(function(e){n.setState({loading:!1,users:e.data.items,total_pages:Math.ceil(e.data.total/n.state.page_size)})})},n.onRowClick=function(e){n.props.onSelectUser(e)},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"render",value:function(){var e=this;return c.a.createElement(Z,{PaginationComponent:te,className:"user-table",columns:[{Header:"Username",accessor:"username"},{Header:"E-Mail",accessor:"email"},{Header:"Real Name",accessor:"real_name"},{Header:"Member since",accessor:"member_since"},{Header:"Quota",accessor:"quota"}],defaultPageSize:this.state.page_size,data:this.state.users,pages:this.state.total_pages,resizable:!1,loading:this.state.loading,manual:!0,onFetchData:this.onFetchData,getTdProps:function(t,n){return{onClick:function(){e.onRowClick(n.original)}}}})}}]),t}(l.Component));n(329);n.d(t,"default",function(){return ae});var ae=function(e){function t(){var e,n;Object(a.a)(this,t);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(n=Object(r.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(s)))).state={selected_user:null},n.selectUser=function(e){n.setState({selected_user:e})},n.deselectUser=function(){n.setState({selected_user:null})},n.saveUserSettings=function(e){d.a.put("/admin/user/".concat(n.state.selected_user.username),e).then(function(e){n.setState({selected_user:null},function(){return window.location.reload()})})},n.deleteUser=function(){Object(g.a)({title:"Delete Account",message:"This operation is not reversible. Are your sure?",type:"WARNING",onConfirm:function(){d.a.delete("/admin/user/".concat(n.state.selected_user.username)).then(function(e){n.setState({selected_user:null},function(){return window.location.reload()})})},onCancel:function(){}})},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"render",value:function(){return c.a.createElement(c.a.Fragment,null,c.a.createElement(m.a,null),c.a.createElement("h1",{className:"page-title"},"User Management"),c.a.createElement(ne,{onSelectUser:this.selectUser}),this.state.selected_user&&c.a.createElement(P,{username:this.state.selected_user.username,real_name:this.state.selected_user.real_name,member_since:this.state.selected_user.member_since,bio:this.state.selected_user.bio,website:this.state.selected_user.website,quota:this.state.selected_user.quota,isAdmin:this.state.selected_user.is_admin,onCancel:this.deselectUser,onSave:this.saveUserSettings,onDeleteUser:this.deleteUser}))}}]),t}(l.Component);Object(u.render)(c.a.createElement(ae,null),document.getElementById("app"))},34:function(e,t,n){"use strict";n.d(t,"a",function(){return d});var a=n(2),o=n(3),r=n(6),i=n(4),s=n(5),l=n(0),c=n.n(l),u=n(24),p=n.n(u),d=(n(50),function(e){function t(){var e,n;Object(a.a)(this,t);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(n=Object(r.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(s)))).onKeydown=function(e){27===e.which&&n.props.onClose()},n}return Object(s.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.onKeydown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.onKeydown,!1)}},{key:"render",value:function(){return c.a.createElement("div",{className:"clicktrap ".concat(this.props.className)},c.a.createElement("div",{className:"modal-wrapper"},c.a.createElement(p.a,{handle:this.props.handle||".modal-header"},c.a.createElement("div",{className:"modal"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h1",{className:"title"},this.props.title),c.a.createElement("button",{className:"close nostyle",onClick:this.props.onClose},"\ue897")),c.a.createElement("div",{className:"modal-body"},this.props.children)))))}}]),t}(l.Component))},50:function(e,t,n){},69:function(e,t,n){},8:function(e,t,n){var a;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var r=typeof a;if("string"===r||"number"===r)e.push(a);else if(Array.isArray(a)&&a.length){var i=o.apply(null,a);i&&e.push(i)}else if("object"===r)for(var s in a)n.call(a,s)&&a[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(a=function(){return o}.apply(t,[]))||(e.exports=a)}()}},[[324,9,0,2]]]);
  //# sourceMappingURL=users.2e66c223.chunk.js.map