From f5d0f140456ead25e0e8142d2c17d6d720bf4418 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Thu, 24 May 2018 12:28:18 +0200 Subject: Fix the navigation component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- settings/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'settings/js/main.js') diff --git a/settings/js/main.js b/settings/js/main.js index 2fd827feae3..43ab5dbc6f0 100644 --- a/settings/js/main.js +++ b/settings/js/main.js @@ -40,7 +40,7 @@ var n="undefined"!=typeof window&&"undefined"!=typeof document,r=["Edge","Triden * vue-router v3.0.1 * (c) 2017 Evan You * @license MIT - */function f(t,e){0}function p(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}var d={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,i=e.parent,o=e.data;o.routerView=!0;for(var s=i.$createElement,a=n.name,u=i.$route,c=i._routerViewCache||(i._routerViewCache={}),l=0,f=!1;i&&i._routerRoot!==i;)i.$vnode&&i.$vnode.data.routerView&&l++,i._inactive&&(f=!0),i=i.$parent;if(o.routerViewDepth=l,f)return s(c[a],o,r);var p=u.matched[l];if(!p)return c[a]=null,s();var d=c[a]=p.components[a];o.registerRouteInstance=function(t,e){var n=p.instances[a];(e&&n!==t||!e&&n===t)&&(p.instances[a]=e)},(o.hook||(o.hook={})).prepatch=function(t,e){p.instances[a]=e.componentInstance};var h=o.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}(u,p.props&&p.props[a]);if(h){h=o.props=function(t,e){for(var n in e)t[n]=e[n];return t}({},h);var v=o.attrs=o.attrs||{};for(var m in h)d.props&&m in d.props||(v[m]=h[m],delete h[m])}return s(d,o,r)}};var h=/[!'()*]/g,v=function(t){return"%"+t.charCodeAt(0).toString(16)},m=/%2C/g,g=function(t){return encodeURIComponent(t).replace(h,v).replace(m,",")},y=decodeURIComponent;function b(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=y(n.shift()),i=n.length>0?y(n.join("=")):null;void 0===e[r]?e[r]=i:Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]}),e):e}function _(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return g(e);if(Array.isArray(n)){var r=[];return n.forEach(function(t){void 0!==t&&(null===t?r.push(g(e)):r.push(g(e)+"="+g(t)))}),r.join("&")}return g(e)+"="+g(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var w=/\/?$/;function x(t,e,n,r){var i=r&&r.options.stringifyQuery,o=e.query||{};try{o=O(o)}catch(t){}var s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:C(e,i),matched:t?function(t){var e=[];for(;t;)e.unshift(t),t=t.parent;return e}(t):[]};return n&&(s.redirectedFrom=C(n,i)),Object.freeze(s)}function O(t){if(Array.isArray(t))return t.map(O);if(t&&"object"==typeof t){var e={};for(var n in t)e[n]=O(t[n]);return e}return t}var S=x(null,{path:"/"});function C(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var i=t.hash;return void 0===i&&(i=""),(n||"/")+(e||_)(r)+i}function k(t,e){return e===S?t===e:!!e&&(t.path&&e.path?t.path.replace(w,"")===e.path.replace(w,"")&&t.hash===e.hash&&E(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&E(t.query,e.query)&&E(t.params,e.params)))}function E(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(n){var r=t[n],i=e[n];return"object"==typeof r&&"object"==typeof i?E(r,i):String(r)===String(i)})}var A,$=[String,Object],L=[String,Array],T={name:"router-link",props:{to:{type:$,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:L,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,i=n.resolve(this.to,r,this.append),o=i.location,s=i.route,a=i.href,u={},c=n.options.linkActiveClass,l=n.options.linkExactActiveClass,f=null==c?"router-link-active":c,p=null==l?"router-link-exact-active":l,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=o.path?x(null,o,null,n):s;u[h]=k(r,v),u[d]=this.exact?u[h]:function(t,e){return 0===t.path.replace(w,"/").indexOf(e.path.replace(w,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=function(t){P(t)&&(e.replace?n.replace(o):n.push(o))},g={click:P};Array.isArray(this.event)?this.event.forEach(function(t){g[t]=m}):g[this.event]=m;var y={class:u};if("a"===this.tag)y.on=g,y.attrs={href:a};else{var b=function t(e){if(e)for(var n,r=0;r=0&&(e=t.slice(r),t=t.slice(0,r));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(i.path||""),u=e&&e.path||"/",c=a.path?M(a.path,u,n||i.append):u,l=function(t,e,n){void 0===e&&(e={});var r,i=n||b;try{r=i(t||"")}catch(t){r={}}for(var o in e)r[o]=e[o];return r}(a.query,i.query,r&&r.options.parseQuery),f=i.hash||a.hash;return f&&"#"!==f.charAt(0)&&(f="#"+f),{_normalized:!0,path:c,query:l,hash:f}}function rt(t,e){for(var n in e)t[n]=e[n];return t}function it(t,e){var n=et(t),r=n.pathList,i=n.pathMap,o=n.nameMap;function s(t,n,s){var a=nt(t,n,!1,e),c=a.name;if(c){var l=o[c];if(!l)return u(null,a);var f=l.regex.keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof a.params&&(a.params={}),n&&"object"==typeof n.params)for(var p in n.params)!(p in a.params)&&f.indexOf(p)>-1&&(a.params[p]=n.params[p]);if(l)return a.path=tt(l.path,a.params),u(l,a,s)}else if(a.path){a.params={};for(var d=0;d=t.length?n():t[i]?e(t[i],function(){r(i+1)}):r(i+1)};r(0)}function Ot(t){return function(e,n,r){var i=!1,o=0,s=null;St(t,function(t,e,n,a){if("function"==typeof t&&void 0===t.cid){i=!0,o++;var u,c=Et(function(e){var i;((i=e).__esModule||kt&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:A.extend(e),n.components[a]=e,--o<=0&&r()}),l=Et(function(t){var e="Failed to resolve async component "+a+": "+t;s||(s=p(t)?t:new Error(e),r(s))});try{u=t(c,l)}catch(t){l(t)}if(u)if("function"==typeof u.then)u.then(c,l);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,l)}}}),i||r()}}function St(t,e){return Ct(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function Ct(t){return Array.prototype.concat.apply([],t)}var kt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Et(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var At=function(t,e){this.router=t,this.base=function(t){if(!t)if(N){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=S,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function $t(t,e,n,r){var i=St(t,function(t,r,i,o){var s=function(t,e){"function"!=typeof t&&(t=A.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(function(t){return n(t,r,i,o)}):n(s,r,i,o)});return Ct(r?i.reverse():i)}function Lt(t,e){if(e)return function(){return t.apply(e,arguments)}}At.prototype.listen=function(t){this.cb=t},At.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},At.prototype.onError=function(t){this.errorCbs.push(t)},At.prototype.transitionTo=function(t,e,n){var r=this,i=this.router.match(t,this.current);this.confirmTransition(i,function(){r.updateRoute(i),e&&e(i),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(t){t(i)}))},function(t){n&&n(t),t&&!r.ready&&(r.ready=!0,r.readyErrorCbs.forEach(function(e){e(t)}))})},At.prototype.confirmTransition=function(t,e,n){var r=this,i=this.current,o=function(t){p(t)&&(r.errorCbs.length?r.errorCbs.forEach(function(e){e(t)}):(f(),console.error(t))),n&&n(t)};if(k(t,i)&&t.matched.length===i.matched.length)return this.ensureURL(),o();var s=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n=0?e.slice(0,n):e)+"#"+t}function It(t){vt?_t(Ut(t)):window.location.hash=t}function Ft(t){vt?wt(Ut(t)):window.location.replace(Ut(t))}var Rt=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){e.index=n,e.updateRoute(r)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(At),Dt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=it(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!vt&&!1!==t.fallback,this.fallback&&(e="hash"),N||(e="abstract"),this.mode=e,e){case"history":this.history=new Tt(this,t.base);break;case"hash":this.history=new jt(this,t.base,this.fallback);break;case"abstract":this.history=new Rt(this,t.base);break;default:0}},Bt={currentRoute:{configurable:!0}};function Gt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Dt.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},Bt.currentRoute.get=function(){return this.history&&this.history.current},Dt.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var n=this.history;if(n instanceof Tt)n.transitionTo(n.getCurrentLocation());else if(n instanceof jt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},Dt.prototype.beforeEach=function(t){return Gt(this.beforeHooks,t)},Dt.prototype.beforeResolve=function(t){return Gt(this.resolveHooks,t)},Dt.prototype.afterEach=function(t){return Gt(this.afterHooks,t)},Dt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Dt.prototype.onError=function(t){this.history.onError(t)},Dt.prototype.push=function(t,e,n){this.history.push(t,e,n)},Dt.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},Dt.prototype.go=function(t){this.history.go(t)},Dt.prototype.back=function(){this.go(-1)},Dt.prototype.forward=function(){this.go(1)},Dt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},Dt.prototype.resolve=function(t,e,n){var r=nt(t,e||this.history.current,n,this),i=this.match(r,e),o=i.redirectedFrom||i.fullPath;return{location:r,route:i,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?U(t+"/"+r):r}(this.history.base,o,this.mode),normalizedTo:r,resolved:i}},Dt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==S&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Dt.prototype,Bt),Dt.install=j,Dt.version="3.0.1",N&&window.Vue&&window.Vue.use(Dt);var Vt=Dt,Ht=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",[t.item.href?n("a",{attrs:{href:t.item.href?t.item.href:"#"},on:{click:t.item.action}},[n("span",{class:t.item.icon}),t._v(" "),t.item.text?n("span",[t._v(t._s(t.item.text))]):t.item.longtext?n("p",[t._v(t._s(t.item.longtext))]):t._e()]):t.item.action?n("button",{on:{click:t.item.action}},[n("span",{class:t.item.icon}),t._v(" "),t.item.text?n("span",[t._v(t._s(t.item.text))]):t.item.longtext?n("p",[t._v(t._s(t.item.longtext))]):t._e()]):n("span",[n("span",{class:t.item.icon}),t._v(" "),t.item.text?n("span",[t._v(t._s(t.item.text))]):t.item.longtext?n("p",[t._v(t._s(t.item.longtext))]):t._e()])])};Ht._withStripped=!0;var qt=u({props:["item"]},Ht,[],!1,null,null,null);qt.options.__file="src/components/popoverMenu/popoverItem.vue";var zt={name:"popoverMenu",props:["menu"],components:{popoverItem:qt.exports}},Wt=function(){var t=this.$createElement,e=this._self._c||t;return e("ul",this._l(this.menu,function(t,n){return e("popover-item",{key:n,attrs:{item:t}})}))};Wt._withStripped=!0;var Kt=u(zt,Wt,[],!1,null,null,null);Kt.options.__file="src/components/popoverMenu.vue";var Yt=Kt.exports,Qt=r(52),Jt=r.n(Qt),Xt={name:"navigationItem",props:["item"],components:{popoverMenu:Yt},directives:{ClickOutside:Jt.a},data:function(){return{openedMenu:!1}},methods:{showMenu:function(){this.openedMenu=!0},hideMenu:function(){this.openedMenu=!1},toggleCollapse:function(){i.a.set(this.item,"opened",!this.item.opened||!this.item.opened)},cancelEdit:function(){Array.isArray(this.item.classes)&&(this.item.classes=this.item.classes.filter(function(t){return"editing"!==t}))}},mounted:function(){this.popupItem=this.$el}},Zt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("router-link",{class:[{"icon-loading-small":t.item.loading,open:t.item.opened,collapsible:t.item.collapsible&&t.item.children&&t.item.children.length>0},t.item.classes],attrs:{to:t.item.router,tag:"li",id:t.item.id,exact:""}},[t.item.bullet?n("div",{staticClass:"app-navigation-entry-bullet",style:{backgroundColor:t.item.bullet}}):t._e(),t._v(" "),n("a",{class:t.item.icon,attrs:{href:t.item.href?t.item.href:"#"},on:{click:t.toggleCollapse}},[t.item.iconUrl?n("img",{attrs:{alt:t.item.text,src:t.item.iconUrl}}):t._e(),t._v("\n\t\t"+t._s(t.item.text)+"\n\t")]),t._v(" "),t.item.utils?n("div",{staticClass:"app-navigation-entry-utils"},[n("ul",[Number.isInteger(t.item.utils.counter)?n("li",{staticClass:"app-navigation-entry-utils-counter"},[t._v(t._s(t.item.utils.counter))]):t._e(),t._v(" "),t.item.utils.actions&&1===t.item.utils.actions.length&&Number.isInteger(t.item.utils.counter)?n("li",{staticClass:"app-navigation-entry-utils-menu-button"},[n("button",{class:t.item.utils.actions[0].icon,attrs:{title:t.item.utils.actions[0].text},on:{click:t.item.utils.actions[0].action}})]):t.item.utils.actions&&2===t.item.utils.actions.length&&!Number.isInteger(t.item.utils.counter)?t._l(t.item.utils.actions,function(t){return n("li",{key:t.action,staticClass:"app-navigation-entry-utils-menu-button"},[n("button",{class:t.icon,attrs:{title:t.text},on:{click:t.action}})])}):t.item.utils.actions&&t.item.utils.actions.length>1&&(Number.isInteger(t.item.utils.counter)||t.item.utils.actions.length>2)?n("li",{staticClass:"app-navigation-entry-utils-menu-button"},[n("button",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],on:{click:t.showMenu}})]):t._e()],2)]):t._e(),t._v(" "),t.item.utils&&t.item.utils.actions&&t.item.utils.actions.length>1&&(Number.isInteger(t.item.utils.counter)||t.item.utils.actions.length>2)?n("div",{staticClass:"app-navigation-entry-menu",class:{open:t.openedMenu}},[n("popover-menu",{attrs:{menu:t.item.utils.actions}})],1):t._e(),t._v(" "),t.item.undo?n("div",{staticClass:"app-navigation-entry-deleted"},[n("div",{staticClass:"app-navigation-entry-deleted-description"},[t._v(t._s(t.item.undo.text))]),t._v(" "),n("button",{staticClass:"app-navigation-entry-deleted-button icon-history",attrs:{title:t.t("settings","Undo")}})]):t._e(),t._v(" "),t.item.edit?n("div",{staticClass:"app-navigation-entry-edit"},[n("form",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.item.text,expression:"item.text"}],attrs:{type:"text"},domProps:{value:t.item.text},on:{input:function(e){e.target.composing||t.$set(t.item,"text",e.target.value)}}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}}),t._v(" "),n("input",{staticClass:"icon-close",attrs:{type:"submit",value:""},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.cancelEdit(e)}}})])]):t._e(),t._v(" "),t.item.children?n("ul",t._l(t.item.children,function(t,e){return n("navigation-item",{key:e,attrs:{item:t}})})):t._e()])};Zt._withStripped=!0;var te=u(Xt,Zt,[],!1,null,null,null);te.options.__file="src/components/appNavigation/navigationItem.vue";var ee={name:"appNavigation",props:["menu"],components:{navigationItem:te.exports}},ne=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"icon-loading":t.menu.loading},attrs:{id:"app-navigation"}},[t.menu.new?n("div",{staticClass:"app-navigation-new"},[n("button",{class:t.menu.new.icon,attrs:{type:"button",id:t.menu.new.id},on:{click:t.menu.new.action}},[t._v(t._s(t.menu.new.text))])]):t._e(),t._v(" "),n("ul",{attrs:{id:t.menu.id}},t._l(t.menu.items,function(t,e){return n("navigation-item",{key:e,attrs:{item:t}})})),t._v(" "),n("div",{attrs:{id:"app-settings"}},[n("div",{attrs:{id:"app-settings-header"}},[n("button",{staticClass:"settings-button",attrs:{"data-apps-slide-toggle":"#app-settings-content"}},[t._v(t._s(t.t("settings","Settings")))])]),t._v(" "),n("div",{attrs:{id:"app-settings-content"}},[t._t("settings-content")],2)])])};ne._withStripped=!0;var re=u(ee,ne,[],!1,null,null,null);re.options.__file="src/components/appNavigation.vue";var ie=re.exports,oe=r(38),se=r.n(oe),ae=r(107),ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i.a.use(ae.a);var ce={name:"userRow",props:["user","settings","groups","subAdminsGroups","quotaOptions","showConfig","languages"],components:{popoverMenu:Yt,Multiselect:se.a},directives:{ClickOutside:Jt.a},mounted:function(){},data:function(){return{rand:parseInt(1e3*Math.random()),openedMenu:!1,loading:{all:!1,displayName:!1,password:!1,mailAddress:!1,groups:!1,subadmins:!1,quota:!1,delete:!1,disable:!1,languages:!1}}},computed:{userActions:function(){return[{icon:"icon-delete",text:t("settings","Delete user"),action:this.deleteUser},{icon:this.user.enabled?"icon-close":"icon-add",text:this.user.enabled?t("settings","Disable user"):t("settings","Enable user"),action:this.enableDisableUser}]},userGroups:function(){var t=this,e=this.groups.filter(function(e){return t.user.groups.includes(e.id)});return e},userSubAdminsGroups:function(){var t=this,e=this.subAdminsGroups.filter(function(e){return t.user.subadmin.includes(e.id)});return e},usedQuota:function(){var t=this.user.quota.quota;t>0?t=Math.min(100,Math.round(this.user.quota.used/t*100)):t=95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1));return isNaN(t)?0:t},userQuota:function(){if(this.user.quota.quota>0){var t=OC.Util.humanFileSize(this.user.quota.quota),e=this.quotaOptions.find(function(e){return e.id===t});return e||{id:t,label:t}}return 0===this.user.quota.quota||"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage:function(){var t=this,e=this.languages[0].languages.concat(this.languages[1].languages).find(function(e){return e.code===t.user.language});return"object"!==(void 0===e?"undefined":ue(e))&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&e}},methods:{toggleMenu:function(){this.openedMenu=!this.openedMenu},hideMenu:function(){this.openedMenu=!1},generateAvatar:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;return OC.generateUrl("/avatar/{user}/{size}?v={version}",{user:t,size:e,version:oc_userconfig.avatar.version})},formatGroupsTitle:function(t){return t.map(function(t){return t.name}).slice(2).join(", ")},deleteUser:function(){var t=this;this.loading.delete=!0,this.loading.all=!0;var e=this.user.id;return this.$store.dispatch("deleteUser",{userid:e}).then(function(){t.loading.delete=!1,t.loading.all=!1})},enableDisableUser:function(){var t=this;this.loading.delete=!0,this.loading.all=!0;var e=this.user.id,n=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:e,enabled:n}).then(function(){t.loading.delete=!1,t.loading.all=!1})},updateDisplayName:function(){var t=this,e=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:e}).then(function(){t.loading.displayName=!1,t.$refs.displayName.value=e})},updatePassword:function(){var t=this,e=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:e}).then(function(){t.loading.password=!1,t.$refs.password.value=""})},updateEmail:function(){var t=this,e=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:e}).then(function(){t.loading.mailAddress=!1,t.$refs.mailAddress.value=e})},createGroup:function(t){var e=this;return this.loading={groups:!0,subadmins:!0},this.$store.dispatch("addGroup",t).then(function(){e.loading={groups:!1,subadmins:!1};var n=e.user.id;e.$store.dispatch("addUserGroup",{userid:n,gid:t})}),this.$store.getters.getGroups[this.groups.length]},addUserGroup:function(t){var e=this;this.loading.groups=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("addUserGroup",{userid:n,gid:r}).then(function(){return e.loading.groups=!1})},removeUserGroup:function(t){var e=this;this.loading.groups=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("removeUserGroup",{userid:n,gid:r}).then(function(){e.loading.groups=!1,e.$route.params.selectedGroup===r&&e.$store.commit("deleteUser",n)})},addUserSubAdmin:function(t){var e=this;this.loading.subadmins=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("addUserSubAdmin",{userid:n,gid:r}).then(function(){return e.loading.subadmins=!1})},removeUserSubAdmin:function(t){var e=this;this.loading.subadmins=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("removeUserSubAdmin",{userid:n,gid:r}).then(function(){return e.loading.subadmins=!1})},setUserQuota:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";return this.loading.quota=!0,e=e.id?e.id:e,this.$store.dispatch("setUserData",{userid:this.user.id,key:"quota",value:e}).then(function(){return t.loading.quota=!1}),e},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return 0===e?this.setUserQuota("none"):null!==e&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))},setUserLanguage:function(t){var e=this;return this.loading.languages=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"language",value:t.code}).then(function(){return e.loading.languages=!1}),t}}},le=function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1===Object.keys(t.user).length?n("div",{staticClass:"row"},[n("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable}},[t.loading.delete||t.loading.disable?t._e():n("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,32),srcset:t.generateAvatar(t.user.id,64)+" 2x, "+t.generateAvatar(t.user.id,128)+" 4x"}})]),t._v(" "),n("div",{staticClass:"name"},[t._v(t._s(t.user.id))]),t._v(" "),n("div",{staticClass:"obfuscated"},[t._v(t._s(t.t("settings","You do not have permissions to see the details of this user")))])]):n("div",{staticClass:"row",class:{disabled:t.loading.delete||t.loading.disable}},[n("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable}},[t.loading.delete||t.loading.disable?t._e():n("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,32),srcset:t.generateAvatar(t.user.id,64)+" 2x, "+t.generateAvatar(t.user.id,128)+" 4x"}})]),t._v(" "),n("div",{staticClass:"name"},[t._v(t._s(t.user.id))]),t._v(" "),n("form",{staticClass:"displayName",class:{"icon-loading-small":t.loading.displayName},on:{submit:function(e){return e.preventDefault(),t.updateDisplayName(e)}}},[n("input",{ref:"displayName",attrs:{id:"displayName"+t.user.id+t.rand,type:"text",disabled:t.loading.displayName||t.loading.all,autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},domProps:{value:t.user.displayname}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),t._v(" "),t.settings.canChangePassword?n("form",{staticClass:"password",class:{"icon-loading-small":t.loading.password},on:{submit:function(e){return e.preventDefault(),t.updatePassword(e)}}},[n("input",{ref:"password",attrs:{id:"password"+t.user.id+t.rand,type:"password",required:"",disabled:t.loading.password||t.loading.all,minlength:t.minPasswordLength,value:"",placeholder:t.t("settings","New password"),autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]):n("div"),t._v(" "),n("form",{staticClass:"mailAddress",class:{"icon-loading-small":t.loading.mailAddress},on:{submit:function(e){return e.preventDefault(),t.updateEmail(e)}}},[n("input",{ref:"mailAddress",attrs:{id:"mailAddress"+t.user.id+t.rand,type:"email",disabled:t.loading.mailAddress||t.loading.all,autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},domProps:{value:t.user.email}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),t._v(" "),n("div",{staticClass:"groups",class:{"icon-loading-small":t.loading.groups}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userGroups,options:t.groups,disabled:t.loading.groups||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Add user in group"),label:"name","track-by":"id",limit:2,multiple:!0,taggable:t.settings.isAdmin,closeOnSelect:!1},on:{tag:t.createGroup,select:t.addUserGroup,remove:t.removeUserGroup}},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.formatGroupsTitle(t.userGroups),expression:"formatGroupsTitle(userGroups)",modifiers:{auto:!0}}],staticClass:"multiselect__limit",attrs:{slot:"limit"},slot:"limit"},[t._v("+"+t._s(t.userGroups.length-2))]),t._v(" "),n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?n("div",{staticClass:"subadmins",class:{"icon-loading-small":t.loading.subadmins}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userSubAdminsGroups,options:t.subAdminsGroups,disabled:t.loading.subadmins||t.loading.all,placeholder:t.t("settings","Set user as admin for"),label:"name","track-by":"id",limit:2,multiple:!0,closeOnSelect:!1},on:{select:t.addUserSubAdmin,remove:t.removeUserSubAdmin}},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.formatGroupsTitle(t.userSubAdminsGroups),expression:"formatGroupsTitle(userSubAdminsGroups)",modifiers:{auto:!0}}],staticClass:"multiselect__limit",attrs:{slot:"limit"},slot:"limit"},[t._v("+"+t._s(t.userSubAdminsGroups.length-2))]),t._v(" "),n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),n("div",{staticClass:"quota",class:{"icon-loading-small":t.loading.quota}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userQuota,options:t.quotaOptions,disabled:t.loading.quota||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Select user quota"),label:"label","track-by":"id",allowEmpty:!1,taggable:!0},on:{tag:t.validateQuota,input:t.setUserQuota}}),t._v(" "),n("progress",{staticClass:"quota-user-progress",class:{warn:t.usedQuota>80},attrs:{max:"100"},domProps:{value:t.usedQuota}})],1),t._v(" "),t.showConfig.showLanguages?n("div",{staticClass:"languages",class:{"icon-loading-small":t.loading.languages}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userLanguage,options:t.languages,disabled:t.loading.languages||t.loading.all,placeholder:t.t("settings","No language set"),label:"name","track-by":"code",allowEmpty:!1,"group-values":"languages","group-label":"label"},on:{input:t.setUserLanguage}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?n("div",{staticClass:"storageLocation"},[t._v(t._s(t.user.storageLocation))]):t._e(),t._v(" "),t.showConfig.showUserBackend?n("div",{staticClass:"userBackend"},[t._v(t._s(t.user.backend))]):t._e(),t._v(" "),t.showConfig.showLastLogin?n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.user.lastLogin>0?t.OC.Util.formatDate(t.user.lastLogin):"",expression:"user.lastLogin>0 ? OC.Util.formatDate(user.lastLogin) : ''",modifiers:{auto:!0}}],staticClass:"lastLogin"},[t._v("\n\t\t"+t._s(t.user.lastLogin>0?t.OC.Util.relativeModifiedDate(t.user.lastLogin):t.t("settings","Never"))+"\n\t")]):t._e(),t._v(" "),n("div",{staticClass:"userActions"},[t.OC.currentUser===t.user.id||"admin"===t.user.id||t.loading.all?t._e():n("div",{staticClass:"toggleUserActions"},[n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",on:{click:t.toggleMenu}}),t._v(" "),n("div",{staticClass:"popovermenu",class:{open:t.openedMenu}},[n("popover-menu",{attrs:{menu:t.userActions}})],1)])])])};le._withStripped=!0;var fe=u(ce,le,[],!1,null,null,null);fe.options.__file="src/components/userList/userRow.vue";var pe=fe.exports,de=r(106),he=r.n(de),ve={name:"userList",props:["users","showConfig","selectedGroup"],components:{userRow:pe,Multiselect:se.a,InfiniteLoading:he.a},data:function(){var e={id:"none",label:t("settings","Unlimited")},n={id:"default",label:t("settings","Default quota")};return{unlimitedQuota:e,defaultQuota:n,loading:!1,scrolled:!1,newUser:{id:"",displayName:"",password:"",mailAddress:"",groups:[],subAdminsGroups:[],quota:n,language:{code:"en",name:t("settings","Default language")}}}},mounted:function(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),i.a.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.$route.params.selectedGroup)},computed:{settings:function(){return this.$store.getters.getServerData},filteredUsers:function(){if("disabled"===this.selectedGroup){var t=this.users.filter(function(t){return!1===t.enabled});return 0===t.length&&this.$refs.infiniteLoading&&this.$refs.infiniteLoading.isComplete&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.$emit("$InfiniteLoading:reset")),t}return settings.isAdmin?this.users.filter(function(t){return!1!==t.enabled}):this.users.filter(function(t){return!1!==t.enabled&&t.id!==oc_current_user})},groups:function(){return this.$store.getters.getGroups.filter(function(t){return"disabled"!==t.id}).sort(function(t,e){return t.name.localeCompare(e.name)})},subAdminsGroups:function(){return this.$store.getters.getSubadminGroups},quotaOptions:function(){var t=this.settings.quotaPreset.reduce(function(t,e){return t.concat({id:e,label:e})},[]);return t.unshift(this.unlimitedQuota),t.unshift(this.defaultQuota),t},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},languages:function(){return Array({label:t("settings","Common languages"),languages:this.settings.languages.commonlanguages},{label:t("settings","All languages"),languages:this.settings.languages.languages})}},watch:{selectedGroup:function(t,e){this.$store.commit("resetUsers"),this.$refs.infiniteLoading.$emit("$InfiniteLoading:reset"),this.setNewUserDefaultGroup(t)}},methods:{onScroll:function(t){this.scrolled=t.target.scrollTop>0},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return null!==e&&e>0?(t=OC.Util.humanFileSize(OC.Util.computerFileSize(t)),this.newUser.quota={id:t,label:t}):this.newUser.quota=this.quotaOptions[0]},infiniteHandler:function(t){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:""}).then(function(e){e?t.loaded():t.complete()})},resetForm:function(){Object.assign(this.newUser,this.$options.data.call(this).newUser),this.loading=!1},createUser:function(){var t=this;this.loading=!0,this.$store.dispatch("addUser",{userid:this.newUser.id,password:this.newUser.password,email:this.newUser.mailAddress,groups:this.newUser.groups.map(function(t){return t.id}),subadmin:this.newUser.subAdminsGroups.map(function(t){return t.id}),quota:this.newUser.quota.id,language:this.newUser.language.code}).then(function(){return t.resetForm()}).catch(function(){return t.loading=!1})},setNewUserDefaultGroup:function(t){if(t&&t.length>0){var e=this.groups.find(function(e){return e.id===t});if(e)return void(this.newUser.groups=[e])}this.newUser.groups=[]}}},me=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"user-list-grid",attrs:{id:"app-content"},on:{"&scroll":function(e){return t.onScroll(e)}}},[n("div",{staticClass:"row",class:{sticky:t.scrolled&&!t.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[n("div",{staticClass:"avatar",attrs:{id:"headerAvatar"}}),t._v(" "),n("div",{staticClass:"name",attrs:{id:"headerName"}},[t._v(t._s(t.t("settings","Username")))]),t._v(" "),n("div",{staticClass:"displayName",attrs:{id:"headerDisplayName"}},[t._v(t._s(t.t("settings","Full name")))]),t._v(" "),n("div",{staticClass:"password",attrs:{id:"headerPassword"}},[t._v(t._s(t.t("settings","Password")))]),t._v(" "),n("div",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[t._v(t._s(t.t("settings","Email")))]),t._v(" "),n("div",{staticClass:"groups",attrs:{id:"headerGroups"}},[t._v(t._s(t.t("settings","Groups")))]),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?n("div",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[t._v(t._s(t.t("settings","Group admin for")))]):t._e(),t._v(" "),n("div",{staticClass:"quota",attrs:{id:"headerQuota"}},[t._v(t._s(t.t("settings","Quota")))]),t._v(" "),t.showConfig.showLanguages?n("div",{staticClass:"languages",attrs:{id:"headerLanguages"}},[t._v(t._s(t.t("settings","Languages")))]):t._e(),t._v(" "),t.showConfig.showStoragePath?n("div",{staticClass:"headerStorageLocation storageLocation"},[t._v(t._s(t.t("settings","Storage location")))]):t._e(),t._v(" "),t.showConfig.showUserBackend?n("div",{staticClass:"headerUserBackend userBackend"},[t._v(t._s(t.t("settings","User backend")))]):t._e(),t._v(" "),t.showConfig.showLastLogin?n("div",{staticClass:"headerLastLogin lastLogin"},[t._v(t._s(t.t("settings","Last login")))]):t._e(),t._v(" "),n("div",{staticClass:"userActions"})]),t._v(" "),n("form",{directives:[{name:"show",rawName:"v-show",value:t.showConfig.showNewUserForm,expression:"showConfig.showNewUserForm"}],staticClass:"row",class:{sticky:t.scrolled&&t.showConfig.showNewUserForm},attrs:{id:"new-user",disabled:t.loading},on:{submit:function(e){return e.preventDefault(),t.createUser(e)}}},[n("div",{class:t.loading?"icon-loading-small":"icon-add"}),t._v(" "),n("div",{staticClass:"name"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.id,expression:"newUser.id"}],attrs:{id:"newusername",type:"text",required:"",placeholder:t.t("settings","User name"),name:"username",autocomplete:"off",autocapitalize:"none",autocorrect:"off",pattern:"[a-zA-Z0-9 _\\.@\\-']+"},domProps:{value:t.newUser.id},on:{input:function(e){e.target.composing||t.$set(t.newUser,"id",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"displayName"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.displayName,expression:"newUser.displayName"}],attrs:{id:"newdisplayname",type:"text",placeholder:t.t("settings","Display name"),name:"displayname",autocomplete:"off",autocapitalize:"none",autocorrect:"off"},domProps:{value:t.newUser.displayName},on:{input:function(e){e.target.composing||t.$set(t.newUser,"displayName",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"password"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.password,expression:"newUser.password"}],attrs:{id:"newuserpassword",type:"password",required:""===t.newUser.mailAddress,placeholder:t.t("settings","Password"),name:"password",autocomplete:"new-password",autocapitalize:"none",autocorrect:"off",minlength:t.minPasswordLength},domProps:{value:t.newUser.password},on:{input:function(e){e.target.composing||t.$set(t.newUser,"password",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"mailAddress"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.mailAddress,expression:"newUser.mailAddress"}],attrs:{id:"newemail",type:"email",required:""===t.newUser.password,placeholder:t.t("settings","Mail address"),name:"email",autocomplete:"off",autocapitalize:"none",autocorrect:"off"},domProps:{value:t.newUser.mailAddress},on:{input:function(e){e.target.composing||t.$set(t.newUser,"mailAddress",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"groups"},[t.settings.isAdmin?t._e():n("input",{attrs:{type:"text",tabindex:"-1",id:"newgroups",required:!t.settings.isAdmin},domProps:{value:t.newUser.groups}}),t._v(" "),n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.groups,placeholder:t.t("settings","Add user in group"),label:"name","track-by":"id",multiple:!0,"close-on-select":!1,allowEmpty:t.settings.isAdmin},model:{value:t.newUser.groups,callback:function(e){t.$set(t.newUser,"groups",e)},expression:"newUser.groups"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?n("div",{staticClass:"subadmins"},[n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.subAdminsGroups,placeholder:t.t("settings","Set user as admin for"),label:"name","track-by":"id",multiple:!0,"close-on-select":!1},model:{value:t.newUser.subAdminsGroups,callback:function(e){t.$set(t.newUser,"subAdminsGroups",e)},expression:"newUser.subAdminsGroups"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),n("div",{staticClass:"quota"},[n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.quotaOptions,placeholder:t.t("settings","Select user quota"),label:"label","track-by":"id",allowEmpty:!1,taggable:!0},on:{tag:t.validateQuota},model:{value:t.newUser.quota,callback:function(e){t.$set(t.newUser,"quota",e)},expression:"newUser.quota"}})],1),t._v(" "),t.showConfig.showLanguages?n("div",{staticClass:"languages"},[n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.languages,placeholder:t.t("settings","Default language"),label:"name","track-by":"code",allowEmpty:!1,"group-values":"languages","group-label":"label"},model:{value:t.newUser.language,callback:function(e){t.$set(t.newUser,"language",e)},expression:"newUser.language"}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?n("div",{staticClass:"storageLocation"}):t._e(),t._v(" "),t.showConfig.showUserBackend?n("div",{staticClass:"userBackend"}):t._e(),t._v(" "),t.showConfig.showLastLogin?n("div",{staticClass:"lastLogin"}):t._e(),t._v(" "),n("div",{staticClass:"userActions"},[n("input",{staticClass:"button primary icon-checkmark-white has-tooltip",attrs:{type:"submit",id:"newsubmit",value:"",title:t.t("settings","Add a new user")}}),t._v(" "),n("input",{staticClass:"button icon-close has-tooltip",attrs:{type:"reset",id:"newreset",value:"",title:t.t("settings","Cancel and reset the form")},on:{click:t.resetForm}})])]),t._v(" "),t._l(t.filteredUsers,function(e,r){return n("user-row",{key:r,attrs:{user:e,settings:t.settings,showConfig:t.showConfig,groups:t.groups,subAdminsGroups:t.subAdminsGroups,quotaOptions:t.quotaOptions,languages:t.languages}})}),t._v(" "),n("infinite-loading",{ref:"infiniteLoading",on:{infinite:t.infiniteHandler}},[n("div",{attrs:{slot:"spinner"},slot:"spinner"},[n("div",{staticClass:"users-icon-loading icon-loading"})]),t._v(" "),n("div",{attrs:{slot:"no-more"},slot:"no-more"},[n("div",{staticClass:"users-list-end"},[t._v("— "+t._s(t.t("settings","no more results"))+" —")])]),t._v(" "),n("div",{attrs:{slot:"no-results"},slot:"no-results"},[n("div",{attrs:{id:"emptycontent"}},[n("div",{staticClass:"icon-contacts-dark"}),t._v(" "),n("h2",[t._v(t._s(t.t("settings","No users in here")))])])])])],2)};me._withStripped=!0;var ge=u(ve,me,[],!1,null,null,null);ge.options.__file="src/components/userList.vue";var ye=ge.exports,be=r(76),_e=r.n(be),we=r(39),xe=r.n(we),Oe={headers:{requesttoken:document.getElementsByTagName("head")[0].getAttribute("data-requesttoken")}},Se=function(t){return t.replace(/\/$/,"")},Ce=function(){return new Promise(function(e,n){var r=void 0,i=setTimeout(function(){clearTimeout(r),document.getElementsByClassName("oc-dialog-close").length>0&&document.getElementsByClassName("oc-dialog-close")[0].click(),OC.Notification.showTemporary(t("settings","You did not enter the password in time")),n("Password request cancelled")},7e3);OC.PasswordConfirmation.requirePasswordConfirmation(),function t(){OC.PasswordConfirmation.requiresPasswordConfirmation()?r=setTimeout(t,500):(clearTimeout(r),clearTimeout(i),e())}()})},ke=function(t){return xe.a.get(Se(t),Oe).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},Ee=function(t,e){return xe.a.post(Se(t),e,Oe).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},Ae=function(t,e){return xe.a.put(Se(t),e,Oe).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},$e=function(t,e){return xe.a.delete(Se(t),{data:e,headers:Oe.headers}).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i.a.use(_e.a),i.a.use(_e.a);var Te={name:"Users",props:["selectedGroup"],components:{appNavigation:ie,userList:ye,Multiselect:se.a},beforeMount:function(){this.$store.commit("initGroups",{groups:this.$store.getters.getServerData.groups,orderBy:this.$store.getters.getServerData.sortGroups,userCount:this.$store.getters.getServerData.userCount}),this.$store.dispatch("getPasswordPolicyMinLength")},data:function(){return{unlimitedQuota:{id:"default",label:t("settings","Unlimited")},selectedQuota:!1,showConfig:{showStoragePath:!1,showUserBackend:!1,showLastLogin:!1,showNewUserForm:!1,showLanguages:!1}}},methods:{toggleNewUserMenu:function(){this.showConfig.showNewUserForm=!this.showConfig.showNewUserForm,this.showConfig.showNewUserForm&&i.a.nextTick(function(){window.newusername.focus()})},getLocalstorage:function(t){var e=this.$localStorage.get(t);return this.showConfig[t]=null!==e?"true"===e:this.showConfig[t],this.showConfig[t]},setLocalStorage:function(t,e){return this.showConfig[t]=e,this.$localStorage.set(t,e),e},removeGroup:function(e){var n=this;OC.dialogs.confirm(t("settings","You are about to remove the group {group}. The users will NOT be deleted.",{group:e}),t("settings","Please confirm the group removal "),function(t){t&&n.$store.dispatch("removeGroup",e)})},setDefaultQuota:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.$store.dispatch("setAppConfig",{app:"files",key:"default_quota",value:e.id?e.id:e}).then(function(){"object"!==(void 0===e?"undefined":Le(e))&&(e={id:e,label:e}),t.defaultQuota=e})},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return 0===e?this.setDefaultQuota("none"):null!==e&&this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))}},computed:{users:function(){return this.$store.getters.getUsers},loading:function(){return 0===Object.keys(this.users).length},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},showLanguages:{get:function(){return this.getLocalstorage("showLanguages")},set:function(t){this.setLocalStorage("showLanguages",t)}},showLastLogin:{get:function(){return this.getLocalstorage("showLastLogin")},set:function(t){this.setLocalStorage("showLastLogin",t)}},showUserBackend:{get:function(){return this.getLocalstorage("showUserBackend")},set:function(t){this.setLocalStorage("showUserBackend",t)}},showStoragePath:{get:function(){return this.getLocalstorage("showStoragePath")},set:function(t){this.setLocalStorage("showStoragePath",t)}},userCount:function(){return this.$store.getters.getUserCount},settings:function(){return this.$store.getters.getServerData},quotaOptions:function(){var t=this.settings.quotaPreset.reduce(function(t,e){return t.concat({id:e,label:e})},[]);return t.unshift(this.unlimitedQuota),t},defaultQuota:{get:function(){return!1!==this.selectedQuota?this.selectedQuota:OC.Util.computerFileSize(this.settings.defaultQuota)>0?{id:this.settings.defaultQuota,label:this.settings.defaultQuota}:this.unlimitedQuota},set:function(t){this.selectedQuota=t}},menu:function(){var e=this,n=this.$store.getters.getGroups,r=(n=(n=Array.isArray(n)?n:[]).map(function(n){var r={};if(r.id=n.id.replace(" ","_"),r.classes=[],r.router={name:"group",params:{selectedGroup:n.id}},r.text=n.name,r.utils={counter:n.usercount-n.disabled},"admin"!==r.id&&"disabled"!==r.id&&e.settings.isAdmin){var i=e;r.utils.actions=[{icon:"icon-delete",text:t("settings","Remove group"),action:function(){i.removeGroup(n.id)}}]}return r})).find(function(t){return"admin"==t.id}),i=n.findIndex(function(t){return"disabled"==t.id}),o=n[i];return r&&r.text&&(r.text=t("settings","Admins")),o&&o.text&&(o.text=t("settings","Disabled users"),0===o.utils.counter&&n.splice(i,1)),n.unshift({id:"everyone",classes:[],router:{name:"users"},text:t("settings","Everyone"),utils:{counter:this.userCount}}),{id:"usergrouplist",new:{id:"new-user-button",text:t("settings","New user"),icon:"icon-add",action:this.toggleNewUserMenu},items:n}}}},Pe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("app-navigation",{attrs:{menu:t.menu}},[n("template",{slot:"settings-content"},[n("div",[n("p",[t._v(t._s(t.t("settings","Default quota :")))]),t._v(" "),n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.defaultQuota,options:t.quotaOptions,"tag-placeholder":"create",placeholder:t.t("settings","Select default quota"),label:"label","track-by":"id",allowEmpty:!1,taggable:!0},on:{tag:t.validateQuota,input:t.setDefaultQuota}})],1),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showLanguages,expression:"showLanguages"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showLanguages"},domProps:{checked:Array.isArray(t.showLanguages)?t._i(t.showLanguages,null)>-1:t.showLanguages},on:{change:function(e){var n=t.showLanguages,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showLanguages=n.concat([null])):o>-1&&(t.showLanguages=n.slice(0,o).concat(n.slice(o+1)))}else t.showLanguages=i}}}),t._v(" "),n("label",{attrs:{for:"showLanguages"}},[t._v(t._s(t.t("settings","Show Languages")))])]),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showLastLogin,expression:"showLastLogin"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showLastLogin"},domProps:{checked:Array.isArray(t.showLastLogin)?t._i(t.showLastLogin,null)>-1:t.showLastLogin},on:{change:function(e){var n=t.showLastLogin,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showLastLogin=n.concat([null])):o>-1&&(t.showLastLogin=n.slice(0,o).concat(n.slice(o+1)))}else t.showLastLogin=i}}}),t._v(" "),n("label",{attrs:{for:"showLastLogin"}},[t._v(t._s(t.t("settings","Show last login")))])]),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showUserBackend,expression:"showUserBackend"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showUserBackend"},domProps:{checked:Array.isArray(t.showUserBackend)?t._i(t.showUserBackend,null)>-1:t.showUserBackend},on:{change:function(e){var n=t.showUserBackend,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showUserBackend=n.concat([null])):o>-1&&(t.showUserBackend=n.slice(0,o).concat(n.slice(o+1)))}else t.showUserBackend=i}}}),t._v(" "),n("label",{attrs:{for:"showUserBackend"}},[t._v(t._s(t.t("settings","Show user backend")))])]),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showStoragePath,expression:"showStoragePath"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showStoragePath"},domProps:{checked:Array.isArray(t.showStoragePath)?t._i(t.showStoragePath,null)>-1:t.showStoragePath},on:{change:function(e){var n=t.showStoragePath,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showStoragePath=n.concat([null])):o>-1&&(t.showStoragePath=n.slice(0,o).concat(n.slice(o+1)))}else t.showStoragePath=i}}}),t._v(" "),n("label",{attrs:{for:"showStoragePath"}},[t._v(t._s(t.t("settings","Show storage path")))])])])],2),t._v(" "),n("user-list",{attrs:{users:t.users,showConfig:t.showConfig,selectedGroup:t.selectedGroup}})],1)};Pe._withStripped=!0;var je=u(Te,Pe,[],!1,null,null,null);je.options.__file="src/views/Users.vue";var Ne=je.exports;i.a.use(Vt);var Me=new Vt({mode:"history",base:OC.generateUrl(""),linkActiveClass:"active",routes:[{path:"/:index(index.php/)?settings/users",component:Ne,props:!0,name:"users",children:[{path:":selectedGroup",name:"group",component:Ne}]}]}),Ue=function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}},Ie="undefined"!=typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__; + */function f(t,e){0}function p(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}var d={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,i=e.parent,o=e.data;o.routerView=!0;for(var s=i.$createElement,a=n.name,u=i.$route,c=i._routerViewCache||(i._routerViewCache={}),l=0,f=!1;i&&i._routerRoot!==i;)i.$vnode&&i.$vnode.data.routerView&&l++,i._inactive&&(f=!0),i=i.$parent;if(o.routerViewDepth=l,f)return s(c[a],o,r);var p=u.matched[l];if(!p)return c[a]=null,s();var d=c[a]=p.components[a];o.registerRouteInstance=function(t,e){var n=p.instances[a];(e&&n!==t||!e&&n===t)&&(p.instances[a]=e)},(o.hook||(o.hook={})).prepatch=function(t,e){p.instances[a]=e.componentInstance};var h=o.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}(u,p.props&&p.props[a]);if(h){h=o.props=function(t,e){for(var n in e)t[n]=e[n];return t}({},h);var v=o.attrs=o.attrs||{};for(var m in h)d.props&&m in d.props||(v[m]=h[m],delete h[m])}return s(d,o,r)}};var h=/[!'()*]/g,v=function(t){return"%"+t.charCodeAt(0).toString(16)},m=/%2C/g,g=function(t){return encodeURIComponent(t).replace(h,v).replace(m,",")},y=decodeURIComponent;function b(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=y(n.shift()),i=n.length>0?y(n.join("=")):null;void 0===e[r]?e[r]=i:Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]}),e):e}function _(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return g(e);if(Array.isArray(n)){var r=[];return n.forEach(function(t){void 0!==t&&(null===t?r.push(g(e)):r.push(g(e)+"="+g(t)))}),r.join("&")}return g(e)+"="+g(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var w=/\/?$/;function x(t,e,n,r){var i=r&&r.options.stringifyQuery,o=e.query||{};try{o=O(o)}catch(t){}var s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:C(e,i),matched:t?function(t){var e=[];for(;t;)e.unshift(t),t=t.parent;return e}(t):[]};return n&&(s.redirectedFrom=C(n,i)),Object.freeze(s)}function O(t){if(Array.isArray(t))return t.map(O);if(t&&"object"==typeof t){var e={};for(var n in t)e[n]=O(t[n]);return e}return t}var S=x(null,{path:"/"});function C(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var i=t.hash;return void 0===i&&(i=""),(n||"/")+(e||_)(r)+i}function k(t,e){return e===S?t===e:!!e&&(t.path&&e.path?t.path.replace(w,"")===e.path.replace(w,"")&&t.hash===e.hash&&E(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&E(t.query,e.query)&&E(t.params,e.params)))}function E(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(n){var r=t[n],i=e[n];return"object"==typeof r&&"object"==typeof i?E(r,i):String(r)===String(i)})}var A,$=[String,Object],L=[String,Array],T={name:"router-link",props:{to:{type:$,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:L,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,i=n.resolve(this.to,r,this.append),o=i.location,s=i.route,a=i.href,u={},c=n.options.linkActiveClass,l=n.options.linkExactActiveClass,f=null==c?"router-link-active":c,p=null==l?"router-link-exact-active":l,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=o.path?x(null,o,null,n):s;u[h]=k(r,v),u[d]=this.exact?u[h]:function(t,e){return 0===t.path.replace(w,"/").indexOf(e.path.replace(w,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=function(t){P(t)&&(e.replace?n.replace(o):n.push(o))},g={click:P};Array.isArray(this.event)?this.event.forEach(function(t){g[t]=m}):g[this.event]=m;var y={class:u};if("a"===this.tag)y.on=g,y.attrs={href:a};else{var b=function t(e){if(e)for(var n,r=0;r=0&&(e=t.slice(r),t=t.slice(0,r));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(i.path||""),u=e&&e.path||"/",c=a.path?M(a.path,u,n||i.append):u,l=function(t,e,n){void 0===e&&(e={});var r,i=n||b;try{r=i(t||"")}catch(t){r={}}for(var o in e)r[o]=e[o];return r}(a.query,i.query,r&&r.options.parseQuery),f=i.hash||a.hash;return f&&"#"!==f.charAt(0)&&(f="#"+f),{_normalized:!0,path:c,query:l,hash:f}}function rt(t,e){for(var n in e)t[n]=e[n];return t}function it(t,e){var n=et(t),r=n.pathList,i=n.pathMap,o=n.nameMap;function s(t,n,s){var a=nt(t,n,!1,e),c=a.name;if(c){var l=o[c];if(!l)return u(null,a);var f=l.regex.keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof a.params&&(a.params={}),n&&"object"==typeof n.params)for(var p in n.params)!(p in a.params)&&f.indexOf(p)>-1&&(a.params[p]=n.params[p]);if(l)return a.path=tt(l.path,a.params),u(l,a,s)}else if(a.path){a.params={};for(var d=0;d=t.length?n():t[i]?e(t[i],function(){r(i+1)}):r(i+1)};r(0)}function Ot(t){return function(e,n,r){var i=!1,o=0,s=null;St(t,function(t,e,n,a){if("function"==typeof t&&void 0===t.cid){i=!0,o++;var u,c=Et(function(e){var i;((i=e).__esModule||kt&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:A.extend(e),n.components[a]=e,--o<=0&&r()}),l=Et(function(t){var e="Failed to resolve async component "+a+": "+t;s||(s=p(t)?t:new Error(e),r(s))});try{u=t(c,l)}catch(t){l(t)}if(u)if("function"==typeof u.then)u.then(c,l);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,l)}}}),i||r()}}function St(t,e){return Ct(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function Ct(t){return Array.prototype.concat.apply([],t)}var kt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Et(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var At=function(t,e){this.router=t,this.base=function(t){if(!t)if(N){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=S,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function $t(t,e,n,r){var i=St(t,function(t,r,i,o){var s=function(t,e){"function"!=typeof t&&(t=A.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(function(t){return n(t,r,i,o)}):n(s,r,i,o)});return Ct(r?i.reverse():i)}function Lt(t,e){if(e)return function(){return t.apply(e,arguments)}}At.prototype.listen=function(t){this.cb=t},At.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},At.prototype.onError=function(t){this.errorCbs.push(t)},At.prototype.transitionTo=function(t,e,n){var r=this,i=this.router.match(t,this.current);this.confirmTransition(i,function(){r.updateRoute(i),e&&e(i),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(t){t(i)}))},function(t){n&&n(t),t&&!r.ready&&(r.ready=!0,r.readyErrorCbs.forEach(function(e){e(t)}))})},At.prototype.confirmTransition=function(t,e,n){var r=this,i=this.current,o=function(t){p(t)&&(r.errorCbs.length?r.errorCbs.forEach(function(e){e(t)}):(f(),console.error(t))),n&&n(t)};if(k(t,i)&&t.matched.length===i.matched.length)return this.ensureURL(),o();var s=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n=0?e.slice(0,n):e)+"#"+t}function It(t){vt?_t(Ut(t)):window.location.hash=t}function Ft(t){vt?wt(Ut(t)):window.location.replace(Ut(t))}var Rt=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){e.index=n,e.updateRoute(r)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(At),Dt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=it(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!vt&&!1!==t.fallback,this.fallback&&(e="hash"),N||(e="abstract"),this.mode=e,e){case"history":this.history=new Tt(this,t.base);break;case"hash":this.history=new jt(this,t.base,this.fallback);break;case"abstract":this.history=new Rt(this,t.base);break;default:0}},Bt={currentRoute:{configurable:!0}};function Gt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Dt.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},Bt.currentRoute.get=function(){return this.history&&this.history.current},Dt.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var n=this.history;if(n instanceof Tt)n.transitionTo(n.getCurrentLocation());else if(n instanceof jt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},Dt.prototype.beforeEach=function(t){return Gt(this.beforeHooks,t)},Dt.prototype.beforeResolve=function(t){return Gt(this.resolveHooks,t)},Dt.prototype.afterEach=function(t){return Gt(this.afterHooks,t)},Dt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Dt.prototype.onError=function(t){this.history.onError(t)},Dt.prototype.push=function(t,e,n){this.history.push(t,e,n)},Dt.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},Dt.prototype.go=function(t){this.history.go(t)},Dt.prototype.back=function(){this.go(-1)},Dt.prototype.forward=function(){this.go(1)},Dt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},Dt.prototype.resolve=function(t,e,n){var r=nt(t,e||this.history.current,n,this),i=this.match(r,e),o=i.redirectedFrom||i.fullPath;return{location:r,route:i,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?U(t+"/"+r):r}(this.history.base,o,this.mode),normalizedTo:r,resolved:i}},Dt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==S&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Dt.prototype,Bt),Dt.install=j,Dt.version="3.0.1",N&&window.Vue&&window.Vue.use(Dt);var Vt=Dt,Ht=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",[t.item.href?n("a",{attrs:{href:t.item.href?t.item.href:"#"},on:{click:t.item.action}},[n("span",{class:t.item.icon}),t._v(" "),t.item.text?n("span",[t._v(t._s(t.item.text))]):t.item.longtext?n("p",[t._v(t._s(t.item.longtext))]):t._e()]):t.item.action?n("button",{on:{click:t.item.action}},[n("span",{class:t.item.icon}),t._v(" "),t.item.text?n("span",[t._v(t._s(t.item.text))]):t.item.longtext?n("p",[t._v(t._s(t.item.longtext))]):t._e()]):n("span",[n("span",{class:t.item.icon}),t._v(" "),t.item.text?n("span",[t._v(t._s(t.item.text))]):t.item.longtext?n("p",[t._v(t._s(t.item.longtext))]):t._e()])])};Ht._withStripped=!0;var qt=u({props:["item"]},Ht,[],!1,null,null,null);qt.options.__file="src/components/popoverMenu/popoverItem.vue";var zt={name:"popoverMenu",props:["menu"],components:{popoverItem:qt.exports}},Wt=function(){var t=this.$createElement,e=this._self._c||t;return e("ul",this._l(this.menu,function(t,n){return e("popover-item",{key:n,attrs:{item:t}})}))};Wt._withStripped=!0;var Kt=u(zt,Wt,[],!1,null,null,null);Kt.options.__file="src/components/popoverMenu.vue";var Yt=Kt.exports,Qt=r(52),Jt=r.n(Qt),Xt={name:"navigationItem",props:["item"],components:{popoverMenu:Yt},directives:{ClickOutside:Jt.a},data:function(){return{openedMenu:!1}},methods:{showMenu:function(){this.openedMenu=!0},hideMenu:function(){this.openedMenu=!1},toggleCollapse:function(){i.a.set(this.item,"opened",!this.item.opened||!this.item.opened)},cancelEdit:function(){Array.isArray(this.item.classes)&&(this.item.classes=this.item.classes.filter(function(t){return"editing"!==t}))},navElement:function(t){return t.href?{is:"li"}:{is:"router-link",tag:"li",to:t.router,exact:!0}}},mounted:function(){this.popupItem=this.$el}},Zt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nav-element",t._b({class:[{"icon-loading-small":t.item.loading,open:t.item.opened,collapsible:t.item.collapsible&&t.item.children&&t.item.children.length>0},t.item.classes],attrs:{id:t.item.id}},"nav-element",t.navElement(t.item),!1),[t.item.bullet?n("div",{staticClass:"app-navigation-entry-bullet",style:{backgroundColor:t.item.bullet}}):t._e(),t._v(" "),n("a",{class:t.item.icon,attrs:{href:t.item.href?t.item.href:"#"},on:{click:t.toggleCollapse}},[t.item.iconUrl?n("img",{attrs:{alt:t.item.text,src:t.item.iconUrl}}):t._e(),t._v("\n\t\t"+t._s(t.item.text)+"\n\t")]),t._v(" "),t.item.utils?n("div",{staticClass:"app-navigation-entry-utils"},[n("ul",[Number.isInteger(t.item.utils.counter)?n("li",{staticClass:"app-navigation-entry-utils-counter"},[t._v(t._s(t.item.utils.counter))]):t._e(),t._v(" "),t.item.utils.actions&&1===t.item.utils.actions.length&&Number.isInteger(t.item.utils.counter)?n("li",{staticClass:"app-navigation-entry-utils-menu-button"},[n("button",{class:t.item.utils.actions[0].icon,attrs:{title:t.item.utils.actions[0].text},on:{click:t.item.utils.actions[0].action}})]):t.item.utils.actions&&2===t.item.utils.actions.length&&!Number.isInteger(t.item.utils.counter)?t._l(t.item.utils.actions,function(t){return n("li",{key:t.action,staticClass:"app-navigation-entry-utils-menu-button"},[n("button",{class:t.icon,attrs:{title:t.text},on:{click:t.action}})])}):t.item.utils.actions&&t.item.utils.actions.length>1&&(Number.isInteger(t.item.utils.counter)||t.item.utils.actions.length>2)?n("li",{staticClass:"app-navigation-entry-utils-menu-button"},[n("button",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],on:{click:t.showMenu}})]):t._e()],2)]):t._e(),t._v(" "),t.item.utils&&t.item.utils.actions&&t.item.utils.actions.length>1&&(Number.isInteger(t.item.utils.counter)||t.item.utils.actions.length>2)?n("div",{staticClass:"app-navigation-entry-menu",class:{open:t.openedMenu}},[n("popover-menu",{attrs:{menu:t.item.utils.actions}})],1):t._e(),t._v(" "),t.item.undo?n("div",{staticClass:"app-navigation-entry-deleted"},[n("div",{staticClass:"app-navigation-entry-deleted-description"},[t._v(t._s(t.item.undo.text))]),t._v(" "),n("button",{staticClass:"app-navigation-entry-deleted-button icon-history",attrs:{title:t.t("settings","Undo")}})]):t._e(),t._v(" "),t.item.edit?n("div",{staticClass:"app-navigation-entry-edit"},[n("form",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.item.text,expression:"item.text"}],attrs:{type:"text"},domProps:{value:t.item.text},on:{input:function(e){e.target.composing||t.$set(t.item,"text",e.target.value)}}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}}),t._v(" "),n("input",{staticClass:"icon-close",attrs:{type:"submit",value:""},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.cancelEdit(e)}}})])]):t._e(),t._v(" "),t.item.children?n("ul",t._l(t.item.children,function(t,e){return n("navigation-item",{key:e,attrs:{item:t}})})):t._e()])};Zt._withStripped=!0;var te=u(Xt,Zt,[],!1,null,null,null);te.options.__file="src/components/appNavigation/navigationItem.vue";var ee={name:"appNavigation",props:["menu"],components:{navigationItem:te.exports}},ne=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"icon-loading":t.menu.loading},attrs:{id:"app-navigation"}},[t.menu.new?n("div",{staticClass:"app-navigation-new"},[n("button",{class:t.menu.new.icon,attrs:{type:"button",id:t.menu.new.id},on:{click:t.menu.new.action}},[t._v(t._s(t.menu.new.text))])]):t._e(),t._v(" "),n("ul",{attrs:{id:t.menu.id}},t._l(t.menu.items,function(t,e){return n("navigation-item",{key:e,attrs:{item:t}})})),t._v(" "),n("div",{attrs:{id:"app-settings"}},[n("div",{attrs:{id:"app-settings-header"}},[n("button",{staticClass:"settings-button",attrs:{"data-apps-slide-toggle":"#app-settings-content"}},[t._v(t._s(t.t("settings","Settings")))])]),t._v(" "),n("div",{attrs:{id:"app-settings-content"}},[t._t("settings-content")],2)])])};ne._withStripped=!0;var re=u(ee,ne,[],!1,null,null,null);re.options.__file="src/components/appNavigation.vue";var ie=re.exports,oe=r(38),se=r.n(oe),ae=r(107),ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i.a.use(ae.a);var ce={name:"userRow",props:["user","settings","groups","subAdminsGroups","quotaOptions","showConfig","languages"],components:{popoverMenu:Yt,Multiselect:se.a},directives:{ClickOutside:Jt.a},mounted:function(){},data:function(){return{rand:parseInt(1e3*Math.random()),openedMenu:!1,loading:{all:!1,displayName:!1,password:!1,mailAddress:!1,groups:!1,subadmins:!1,quota:!1,delete:!1,disable:!1,languages:!1}}},computed:{userActions:function(){return[{icon:"icon-delete",text:t("settings","Delete user"),action:this.deleteUser},{icon:this.user.enabled?"icon-close":"icon-add",text:this.user.enabled?t("settings","Disable user"):t("settings","Enable user"),action:this.enableDisableUser}]},userGroups:function(){var t=this,e=this.groups.filter(function(e){return t.user.groups.includes(e.id)});return e},userSubAdminsGroups:function(){var t=this,e=this.subAdminsGroups.filter(function(e){return t.user.subadmin.includes(e.id)});return e},usedQuota:function(){var t=this.user.quota.quota;t>0?t=Math.min(100,Math.round(this.user.quota.used/t*100)):t=95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1));return isNaN(t)?0:t},userQuota:function(){if(this.user.quota.quota>0){var t=OC.Util.humanFileSize(this.user.quota.quota),e=this.quotaOptions.find(function(e){return e.id===t});return e||{id:t,label:t}}return 0===this.user.quota.quota||"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage:function(){var t=this,e=this.languages[0].languages.concat(this.languages[1].languages).find(function(e){return e.code===t.user.language});return"object"!==(void 0===e?"undefined":ue(e))&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&e}},methods:{toggleMenu:function(){this.openedMenu=!this.openedMenu},hideMenu:function(){this.openedMenu=!1},generateAvatar:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;return OC.generateUrl("/avatar/{user}/{size}?v={version}",{user:t,size:e,version:oc_userconfig.avatar.version})},formatGroupsTitle:function(t){return t.map(function(t){return t.name}).slice(2).join(", ")},deleteUser:function(){var t=this;this.loading.delete=!0,this.loading.all=!0;var e=this.user.id;return this.$store.dispatch("deleteUser",{userid:e}).then(function(){t.loading.delete=!1,t.loading.all=!1})},enableDisableUser:function(){var t=this;this.loading.delete=!0,this.loading.all=!0;var e=this.user.id,n=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:e,enabled:n}).then(function(){t.loading.delete=!1,t.loading.all=!1})},updateDisplayName:function(){var t=this,e=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:e}).then(function(){t.loading.displayName=!1,t.$refs.displayName.value=e})},updatePassword:function(){var t=this,e=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:e}).then(function(){t.loading.password=!1,t.$refs.password.value=""})},updateEmail:function(){var t=this,e=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:e}).then(function(){t.loading.mailAddress=!1,t.$refs.mailAddress.value=e})},createGroup:function(t){var e=this;return this.loading={groups:!0,subadmins:!0},this.$store.dispatch("addGroup",t).then(function(){e.loading={groups:!1,subadmins:!1};var n=e.user.id;e.$store.dispatch("addUserGroup",{userid:n,gid:t})}),this.$store.getters.getGroups[this.groups.length]},addUserGroup:function(t){var e=this;this.loading.groups=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("addUserGroup",{userid:n,gid:r}).then(function(){return e.loading.groups=!1})},removeUserGroup:function(t){var e=this;this.loading.groups=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("removeUserGroup",{userid:n,gid:r}).then(function(){e.loading.groups=!1,e.$route.params.selectedGroup===r&&e.$store.commit("deleteUser",n)})},addUserSubAdmin:function(t){var e=this;this.loading.subadmins=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("addUserSubAdmin",{userid:n,gid:r}).then(function(){return e.loading.subadmins=!1})},removeUserSubAdmin:function(t){var e=this;this.loading.subadmins=!0;var n=this.user.id,r=t.id;return this.$store.dispatch("removeUserSubAdmin",{userid:n,gid:r}).then(function(){return e.loading.subadmins=!1})},setUserQuota:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";return this.loading.quota=!0,e=e.id?e.id:e,this.$store.dispatch("setUserData",{userid:this.user.id,key:"quota",value:e}).then(function(){return t.loading.quota=!1}),e},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return 0===e?this.setUserQuota("none"):null!==e&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))},setUserLanguage:function(t){var e=this;return this.loading.languages=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"language",value:t.code}).then(function(){return e.loading.languages=!1}),t}}},le=function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1===Object.keys(t.user).length?n("div",{staticClass:"row"},[n("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable}},[t.loading.delete||t.loading.disable?t._e():n("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,32),srcset:t.generateAvatar(t.user.id,64)+" 2x, "+t.generateAvatar(t.user.id,128)+" 4x"}})]),t._v(" "),n("div",{staticClass:"name"},[t._v(t._s(t.user.id))]),t._v(" "),n("div",{staticClass:"obfuscated"},[t._v(t._s(t.t("settings","You do not have permissions to see the details of this user")))])]):n("div",{staticClass:"row",class:{disabled:t.loading.delete||t.loading.disable}},[n("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable}},[t.loading.delete||t.loading.disable?t._e():n("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,32),srcset:t.generateAvatar(t.user.id,64)+" 2x, "+t.generateAvatar(t.user.id,128)+" 4x"}})]),t._v(" "),n("div",{staticClass:"name"},[t._v(t._s(t.user.id))]),t._v(" "),n("form",{staticClass:"displayName",class:{"icon-loading-small":t.loading.displayName},on:{submit:function(e){return e.preventDefault(),t.updateDisplayName(e)}}},[n("input",{ref:"displayName",attrs:{id:"displayName"+t.user.id+t.rand,type:"text",disabled:t.loading.displayName||t.loading.all,autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},domProps:{value:t.user.displayname}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),t._v(" "),t.settings.canChangePassword?n("form",{staticClass:"password",class:{"icon-loading-small":t.loading.password},on:{submit:function(e){return e.preventDefault(),t.updatePassword(e)}}},[n("input",{ref:"password",attrs:{id:"password"+t.user.id+t.rand,type:"password",required:"",disabled:t.loading.password||t.loading.all,minlength:t.minPasswordLength,value:"",placeholder:t.t("settings","New password"),autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]):n("div"),t._v(" "),n("form",{staticClass:"mailAddress",class:{"icon-loading-small":t.loading.mailAddress},on:{submit:function(e){return e.preventDefault(),t.updateEmail(e)}}},[n("input",{ref:"mailAddress",attrs:{id:"mailAddress"+t.user.id+t.rand,type:"email",disabled:t.loading.mailAddress||t.loading.all,autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},domProps:{value:t.user.email}}),t._v(" "),n("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),t._v(" "),n("div",{staticClass:"groups",class:{"icon-loading-small":t.loading.groups}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userGroups,options:t.groups,disabled:t.loading.groups||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Add user in group"),label:"name","track-by":"id",limit:2,multiple:!0,taggable:t.settings.isAdmin,closeOnSelect:!1},on:{tag:t.createGroup,select:t.addUserGroup,remove:t.removeUserGroup}},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.formatGroupsTitle(t.userGroups),expression:"formatGroupsTitle(userGroups)",modifiers:{auto:!0}}],staticClass:"multiselect__limit",attrs:{slot:"limit"},slot:"limit"},[t._v("+"+t._s(t.userGroups.length-2))]),t._v(" "),n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?n("div",{staticClass:"subadmins",class:{"icon-loading-small":t.loading.subadmins}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userSubAdminsGroups,options:t.subAdminsGroups,disabled:t.loading.subadmins||t.loading.all,placeholder:t.t("settings","Set user as admin for"),label:"name","track-by":"id",limit:2,multiple:!0,closeOnSelect:!1},on:{select:t.addUserSubAdmin,remove:t.removeUserSubAdmin}},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.formatGroupsTitle(t.userSubAdminsGroups),expression:"formatGroupsTitle(userSubAdminsGroups)",modifiers:{auto:!0}}],staticClass:"multiselect__limit",attrs:{slot:"limit"},slot:"limit"},[t._v("+"+t._s(t.userSubAdminsGroups.length-2))]),t._v(" "),n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),n("div",{staticClass:"quota",class:{"icon-loading-small":t.loading.quota}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userQuota,options:t.quotaOptions,disabled:t.loading.quota||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Select user quota"),label:"label","track-by":"id",allowEmpty:!1,taggable:!0},on:{tag:t.validateQuota,input:t.setUserQuota}}),t._v(" "),n("progress",{staticClass:"quota-user-progress",class:{warn:t.usedQuota>80},attrs:{max:"100"},domProps:{value:t.usedQuota}})],1),t._v(" "),t.showConfig.showLanguages?n("div",{staticClass:"languages",class:{"icon-loading-small":t.loading.languages}},[n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userLanguage,options:t.languages,disabled:t.loading.languages||t.loading.all,placeholder:t.t("settings","No language set"),label:"name","track-by":"code",allowEmpty:!1,"group-values":"languages","group-label":"label"},on:{input:t.setUserLanguage}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?n("div",{staticClass:"storageLocation"},[t._v(t._s(t.user.storageLocation))]):t._e(),t._v(" "),t.showConfig.showUserBackend?n("div",{staticClass:"userBackend"},[t._v(t._s(t.user.backend))]):t._e(),t._v(" "),t.showConfig.showLastLogin?n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.user.lastLogin>0?t.OC.Util.formatDate(t.user.lastLogin):"",expression:"user.lastLogin>0 ? OC.Util.formatDate(user.lastLogin) : ''",modifiers:{auto:!0}}],staticClass:"lastLogin"},[t._v("\n\t\t"+t._s(t.user.lastLogin>0?t.OC.Util.relativeModifiedDate(t.user.lastLogin):t.t("settings","Never"))+"\n\t")]):t._e(),t._v(" "),n("div",{staticClass:"userActions"},[t.OC.currentUser===t.user.id||"admin"===t.user.id||t.loading.all?t._e():n("div",{staticClass:"toggleUserActions"},[n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",on:{click:t.toggleMenu}}),t._v(" "),n("div",{staticClass:"popovermenu",class:{open:t.openedMenu}},[n("popover-menu",{attrs:{menu:t.userActions}})],1)])])])};le._withStripped=!0;var fe=u(ce,le,[],!1,null,null,null);fe.options.__file="src/components/userList/userRow.vue";var pe=fe.exports,de=r(106),he=r.n(de),ve={name:"userList",props:["users","showConfig","selectedGroup"],components:{userRow:pe,Multiselect:se.a,InfiniteLoading:he.a},data:function(){var e={id:"none",label:t("settings","Unlimited")},n={id:"default",label:t("settings","Default quota")};return{unlimitedQuota:e,defaultQuota:n,loading:!1,scrolled:!1,newUser:{id:"",displayName:"",password:"",mailAddress:"",groups:[],subAdminsGroups:[],quota:n,language:{code:"en",name:t("settings","Default language")}}}},mounted:function(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),i.a.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.$route.params.selectedGroup)},computed:{settings:function(){return this.$store.getters.getServerData},filteredUsers:function(){if("disabled"===this.selectedGroup){var t=this.users.filter(function(t){return!1===t.enabled});return 0===t.length&&this.$refs.infiniteLoading&&this.$refs.infiniteLoading.isComplete&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.$emit("$InfiniteLoading:reset")),t}return settings.isAdmin?this.users.filter(function(t){return!1!==t.enabled}):this.users.filter(function(t){return!1!==t.enabled&&t.id!==oc_current_user})},groups:function(){return this.$store.getters.getGroups.filter(function(t){return"disabled"!==t.id}).sort(function(t,e){return t.name.localeCompare(e.name)})},subAdminsGroups:function(){return this.$store.getters.getSubadminGroups},quotaOptions:function(){var t=this.settings.quotaPreset.reduce(function(t,e){return t.concat({id:e,label:e})},[]);return t.unshift(this.unlimitedQuota),t.unshift(this.defaultQuota),t},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},languages:function(){return Array({label:t("settings","Common languages"),languages:this.settings.languages.commonlanguages},{label:t("settings","All languages"),languages:this.settings.languages.languages})}},watch:{selectedGroup:function(t,e){this.$store.commit("resetUsers"),this.$refs.infiniteLoading.$emit("$InfiniteLoading:reset"),this.setNewUserDefaultGroup(t)}},methods:{onScroll:function(t){this.scrolled=t.target.scrollTop>0},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return null!==e&&e>0?(t=OC.Util.humanFileSize(OC.Util.computerFileSize(t)),this.newUser.quota={id:t,label:t}):this.newUser.quota=this.quotaOptions[0]},infiniteHandler:function(t){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:""}).then(function(e){e?t.loaded():t.complete()})},resetForm:function(){Object.assign(this.newUser,this.$options.data.call(this).newUser),this.loading=!1},createUser:function(){var t=this;this.loading=!0,this.$store.dispatch("addUser",{userid:this.newUser.id,password:this.newUser.password,email:this.newUser.mailAddress,groups:this.newUser.groups.map(function(t){return t.id}),subadmin:this.newUser.subAdminsGroups.map(function(t){return t.id}),quota:this.newUser.quota.id,language:this.newUser.language.code}).then(function(){return t.resetForm()}).catch(function(){return t.loading=!1})},setNewUserDefaultGroup:function(t){if(t&&t.length>0){var e=this.groups.find(function(e){return e.id===t});if(e)return void(this.newUser.groups=[e])}this.newUser.groups=[]}}},me=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"user-list-grid",attrs:{id:"app-content"},on:{"&scroll":function(e){return t.onScroll(e)}}},[n("div",{staticClass:"row",class:{sticky:t.scrolled&&!t.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[n("div",{staticClass:"avatar",attrs:{id:"headerAvatar"}}),t._v(" "),n("div",{staticClass:"name",attrs:{id:"headerName"}},[t._v(t._s(t.t("settings","Username")))]),t._v(" "),n("div",{staticClass:"displayName",attrs:{id:"headerDisplayName"}},[t._v(t._s(t.t("settings","Full name")))]),t._v(" "),n("div",{staticClass:"password",attrs:{id:"headerPassword"}},[t._v(t._s(t.t("settings","Password")))]),t._v(" "),n("div",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[t._v(t._s(t.t("settings","Email")))]),t._v(" "),n("div",{staticClass:"groups",attrs:{id:"headerGroups"}},[t._v(t._s(t.t("settings","Groups")))]),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?n("div",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[t._v(t._s(t.t("settings","Group admin for")))]):t._e(),t._v(" "),n("div",{staticClass:"quota",attrs:{id:"headerQuota"}},[t._v(t._s(t.t("settings","Quota")))]),t._v(" "),t.showConfig.showLanguages?n("div",{staticClass:"languages",attrs:{id:"headerLanguages"}},[t._v(t._s(t.t("settings","Languages")))]):t._e(),t._v(" "),t.showConfig.showStoragePath?n("div",{staticClass:"headerStorageLocation storageLocation"},[t._v(t._s(t.t("settings","Storage location")))]):t._e(),t._v(" "),t.showConfig.showUserBackend?n("div",{staticClass:"headerUserBackend userBackend"},[t._v(t._s(t.t("settings","User backend")))]):t._e(),t._v(" "),t.showConfig.showLastLogin?n("div",{staticClass:"headerLastLogin lastLogin"},[t._v(t._s(t.t("settings","Last login")))]):t._e(),t._v(" "),n("div",{staticClass:"userActions"})]),t._v(" "),n("form",{directives:[{name:"show",rawName:"v-show",value:t.showConfig.showNewUserForm,expression:"showConfig.showNewUserForm"}],staticClass:"row",class:{sticky:t.scrolled&&t.showConfig.showNewUserForm},attrs:{id:"new-user",disabled:t.loading},on:{submit:function(e){return e.preventDefault(),t.createUser(e)}}},[n("div",{class:t.loading?"icon-loading-small":"icon-add"}),t._v(" "),n("div",{staticClass:"name"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.id,expression:"newUser.id"}],attrs:{id:"newusername",type:"text",required:"",placeholder:t.t("settings","User name"),name:"username",autocomplete:"off",autocapitalize:"none",autocorrect:"off",pattern:"[a-zA-Z0-9 _\\.@\\-']+"},domProps:{value:t.newUser.id},on:{input:function(e){e.target.composing||t.$set(t.newUser,"id",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"displayName"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.displayName,expression:"newUser.displayName"}],attrs:{id:"newdisplayname",type:"text",placeholder:t.t("settings","Display name"),name:"displayname",autocomplete:"off",autocapitalize:"none",autocorrect:"off"},domProps:{value:t.newUser.displayName},on:{input:function(e){e.target.composing||t.$set(t.newUser,"displayName",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"password"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.password,expression:"newUser.password"}],attrs:{id:"newuserpassword",type:"password",required:""===t.newUser.mailAddress,placeholder:t.t("settings","Password"),name:"password",autocomplete:"new-password",autocapitalize:"none",autocorrect:"off",minlength:t.minPasswordLength},domProps:{value:t.newUser.password},on:{input:function(e){e.target.composing||t.$set(t.newUser,"password",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"mailAddress"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.mailAddress,expression:"newUser.mailAddress"}],attrs:{id:"newemail",type:"email",required:""===t.newUser.password,placeholder:t.t("settings","Mail address"),name:"email",autocomplete:"off",autocapitalize:"none",autocorrect:"off"},domProps:{value:t.newUser.mailAddress},on:{input:function(e){e.target.composing||t.$set(t.newUser,"mailAddress",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"groups"},[t.settings.isAdmin?t._e():n("input",{attrs:{type:"text",tabindex:"-1",id:"newgroups",required:!t.settings.isAdmin},domProps:{value:t.newUser.groups}}),t._v(" "),n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.groups,placeholder:t.t("settings","Add user in group"),label:"name","track-by":"id",multiple:!0,"close-on-select":!1,allowEmpty:t.settings.isAdmin},model:{value:t.newUser.groups,callback:function(e){t.$set(t.newUser,"groups",e)},expression:"newUser.groups"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?n("div",{staticClass:"subadmins"},[n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.subAdminsGroups,placeholder:t.t("settings","Set user as admin for"),label:"name","track-by":"id",multiple:!0,"close-on-select":!1},model:{value:t.newUser.subAdminsGroups,callback:function(e){t.$set(t.newUser,"subAdminsGroups",e)},expression:"newUser.subAdminsGroups"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),n("div",{staticClass:"quota"},[n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.quotaOptions,placeholder:t.t("settings","Select user quota"),label:"label","track-by":"id",allowEmpty:!1,taggable:!0},on:{tag:t.validateQuota},model:{value:t.newUser.quota,callback:function(e){t.$set(t.newUser,"quota",e)},expression:"newUser.quota"}})],1),t._v(" "),t.showConfig.showLanguages?n("div",{staticClass:"languages"},[n("multiselect",{staticClass:"multiselect-vue",attrs:{options:t.languages,placeholder:t.t("settings","Default language"),label:"name","track-by":"code",allowEmpty:!1,"group-values":"languages","group-label":"label"},model:{value:t.newUser.language,callback:function(e){t.$set(t.newUser,"language",e)},expression:"newUser.language"}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?n("div",{staticClass:"storageLocation"}):t._e(),t._v(" "),t.showConfig.showUserBackend?n("div",{staticClass:"userBackend"}):t._e(),t._v(" "),t.showConfig.showLastLogin?n("div",{staticClass:"lastLogin"}):t._e(),t._v(" "),n("div",{staticClass:"userActions"},[n("input",{staticClass:"button primary icon-checkmark-white has-tooltip",attrs:{type:"submit",id:"newsubmit",value:"",title:t.t("settings","Add a new user")}}),t._v(" "),n("input",{staticClass:"button icon-close has-tooltip",attrs:{type:"reset",id:"newreset",value:"",title:t.t("settings","Cancel and reset the form")},on:{click:t.resetForm}})])]),t._v(" "),t._l(t.filteredUsers,function(e,r){return n("user-row",{key:r,attrs:{user:e,settings:t.settings,showConfig:t.showConfig,groups:t.groups,subAdminsGroups:t.subAdminsGroups,quotaOptions:t.quotaOptions,languages:t.languages}})}),t._v(" "),n("infinite-loading",{ref:"infiniteLoading",on:{infinite:t.infiniteHandler}},[n("div",{attrs:{slot:"spinner"},slot:"spinner"},[n("div",{staticClass:"users-icon-loading icon-loading"})]),t._v(" "),n("div",{attrs:{slot:"no-more"},slot:"no-more"},[n("div",{staticClass:"users-list-end"},[t._v("— "+t._s(t.t("settings","no more results"))+" —")])]),t._v(" "),n("div",{attrs:{slot:"no-results"},slot:"no-results"},[n("div",{attrs:{id:"emptycontent"}},[n("div",{staticClass:"icon-contacts-dark"}),t._v(" "),n("h2",[t._v(t._s(t.t("settings","No users in here")))])])])])],2)};me._withStripped=!0;var ge=u(ve,me,[],!1,null,null,null);ge.options.__file="src/components/userList.vue";var ye=ge.exports,be=r(76),_e=r.n(be),we=r(39),xe=r.n(we),Oe={headers:{requesttoken:document.getElementsByTagName("head")[0].getAttribute("data-requesttoken")}},Se=function(t){return t.replace(/\/$/,"")},Ce=function(){return new Promise(function(e,n){var r=void 0,i=setTimeout(function(){clearTimeout(r),document.getElementsByClassName("oc-dialog-close").length>0&&document.getElementsByClassName("oc-dialog-close")[0].click(),OC.Notification.showTemporary(t("settings","You did not enter the password in time")),n("Password request cancelled")},7e3);OC.PasswordConfirmation.requirePasswordConfirmation(),function t(){OC.PasswordConfirmation.requiresPasswordConfirmation()?r=setTimeout(t,500):(clearTimeout(r),clearTimeout(i),e())}()})},ke=function(t){return xe.a.get(Se(t),Oe).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},Ee=function(t,e){return xe.a.post(Se(t),e,Oe).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},Ae=function(t,e){return xe.a.put(Se(t),e,Oe).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},$e=function(t,e){return xe.a.delete(Se(t),{data:e,headers:Oe.headers}).then(function(t){return Promise.resolve(t)}).catch(function(t){return Promise.reject(t)})},Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i.a.use(_e.a),i.a.use(_e.a);var Te={name:"Users",props:["selectedGroup"],components:{appNavigation:ie,userList:ye,Multiselect:se.a},beforeMount:function(){this.$store.commit("initGroups",{groups:this.$store.getters.getServerData.groups,orderBy:this.$store.getters.getServerData.sortGroups,userCount:this.$store.getters.getServerData.userCount}),this.$store.dispatch("getPasswordPolicyMinLength")},data:function(){return{unlimitedQuota:{id:"default",label:t("settings","Unlimited")},selectedQuota:!1,showConfig:{showStoragePath:!1,showUserBackend:!1,showLastLogin:!1,showNewUserForm:!1,showLanguages:!1}}},methods:{toggleNewUserMenu:function(){this.showConfig.showNewUserForm=!this.showConfig.showNewUserForm,this.showConfig.showNewUserForm&&i.a.nextTick(function(){window.newusername.focus()})},getLocalstorage:function(t){var e=this.$localStorage.get(t);return this.showConfig[t]=null!==e?"true"===e:this.showConfig[t],this.showConfig[t]},setLocalStorage:function(t,e){return this.showConfig[t]=e,this.$localStorage.set(t,e),e},removeGroup:function(e){var n=this;OC.dialogs.confirm(t("settings","You are about to remove the group {group}. The users will NOT be deleted.",{group:e}),t("settings","Please confirm the group removal "),function(t){t&&n.$store.dispatch("removeGroup",e)})},setDefaultQuota:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.$store.dispatch("setAppConfig",{app:"files",key:"default_quota",value:e.id?e.id:e}).then(function(){"object"!==(void 0===e?"undefined":Le(e))&&(e={id:e,label:e}),t.defaultQuota=e})},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return 0===e?this.setDefaultQuota("none"):null!==e&&this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))}},computed:{users:function(){return this.$store.getters.getUsers},loading:function(){return 0===Object.keys(this.users).length},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},showLanguages:{get:function(){return this.getLocalstorage("showLanguages")},set:function(t){this.setLocalStorage("showLanguages",t)}},showLastLogin:{get:function(){return this.getLocalstorage("showLastLogin")},set:function(t){this.setLocalStorage("showLastLogin",t)}},showUserBackend:{get:function(){return this.getLocalstorage("showUserBackend")},set:function(t){this.setLocalStorage("showUserBackend",t)}},showStoragePath:{get:function(){return this.getLocalstorage("showStoragePath")},set:function(t){this.setLocalStorage("showStoragePath",t)}},userCount:function(){return this.$store.getters.getUserCount},settings:function(){return this.$store.getters.getServerData},quotaOptions:function(){var t=this.settings.quotaPreset.reduce(function(t,e){return t.concat({id:e,label:e})},[]);return t.unshift(this.unlimitedQuota),t},defaultQuota:{get:function(){return!1!==this.selectedQuota?this.selectedQuota:OC.Util.computerFileSize(this.settings.defaultQuota)>0?{id:this.settings.defaultQuota,label:this.settings.defaultQuota}:this.unlimitedQuota},set:function(t){this.selectedQuota=t}},menu:function(){var e=this,n=this.$store.getters.getGroups,r=(n=(n=Array.isArray(n)?n:[]).map(function(n){var r={};if(r.id=n.id.replace(" ","_"),r.router={name:"group",params:{selectedGroup:n.id}},r.text=n.name,r.utils={counter:n.usercount-n.disabled},"admin"!==r.id&&"disabled"!==r.id&&e.settings.isAdmin){var i=e;r.utils.actions=[{icon:"icon-delete",text:t("settings","Remove group"),action:function(){i.removeGroup(n.id)}}]}return r})).find(function(t){return"admin"==t.id}),i=n.findIndex(function(t){return"disabled"==t.id}),o=n[i];return r&&r.text&&(r.text=t("settings","Admins")),o&&o.text&&(o.text=t("settings","Disabled users"),0===o.utils.counter&&n.splice(i,1)),n.unshift({id:"everyone",router:{name:"users"},text:t("settings","Everyone"),utils:{counter:this.userCount}}),{id:"usergrouplist",new:{id:"new-user-button",text:t("settings","New user"),icon:"icon-add",action:this.toggleNewUserMenu},items:n}}}},Pe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("app-navigation",{attrs:{menu:t.menu}},[n("template",{slot:"settings-content"},[n("div",[n("p",[t._v(t._s(t.t("settings","Default quota :")))]),t._v(" "),n("multiselect",{staticClass:"multiselect-vue",attrs:{value:t.defaultQuota,options:t.quotaOptions,"tag-placeholder":"create",placeholder:t.t("settings","Select default quota"),label:"label","track-by":"id",allowEmpty:!1,taggable:!0},on:{tag:t.validateQuota,input:t.setDefaultQuota}})],1),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showLanguages,expression:"showLanguages"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showLanguages"},domProps:{checked:Array.isArray(t.showLanguages)?t._i(t.showLanguages,null)>-1:t.showLanguages},on:{change:function(e){var n=t.showLanguages,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showLanguages=n.concat([null])):o>-1&&(t.showLanguages=n.slice(0,o).concat(n.slice(o+1)))}else t.showLanguages=i}}}),t._v(" "),n("label",{attrs:{for:"showLanguages"}},[t._v(t._s(t.t("settings","Show Languages")))])]),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showLastLogin,expression:"showLastLogin"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showLastLogin"},domProps:{checked:Array.isArray(t.showLastLogin)?t._i(t.showLastLogin,null)>-1:t.showLastLogin},on:{change:function(e){var n=t.showLastLogin,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showLastLogin=n.concat([null])):o>-1&&(t.showLastLogin=n.slice(0,o).concat(n.slice(o+1)))}else t.showLastLogin=i}}}),t._v(" "),n("label",{attrs:{for:"showLastLogin"}},[t._v(t._s(t.t("settings","Show last login")))])]),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showUserBackend,expression:"showUserBackend"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showUserBackend"},domProps:{checked:Array.isArray(t.showUserBackend)?t._i(t.showUserBackend,null)>-1:t.showUserBackend},on:{change:function(e){var n=t.showUserBackend,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showUserBackend=n.concat([null])):o>-1&&(t.showUserBackend=n.slice(0,o).concat(n.slice(o+1)))}else t.showUserBackend=i}}}),t._v(" "),n("label",{attrs:{for:"showUserBackend"}},[t._v(t._s(t.t("settings","Show user backend")))])]),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.showStoragePath,expression:"showStoragePath"}],staticClass:"checkbox",attrs:{type:"checkbox",id:"showStoragePath"},domProps:{checked:Array.isArray(t.showStoragePath)?t._i(t.showStoragePath,null)>-1:t.showStoragePath},on:{change:function(e){var n=t.showStoragePath,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.showStoragePath=n.concat([null])):o>-1&&(t.showStoragePath=n.slice(0,o).concat(n.slice(o+1)))}else t.showStoragePath=i}}}),t._v(" "),n("label",{attrs:{for:"showStoragePath"}},[t._v(t._s(t.t("settings","Show storage path")))])])])],2),t._v(" "),n("user-list",{attrs:{users:t.users,showConfig:t.showConfig,selectedGroup:t.selectedGroup}})],1)};Pe._withStripped=!0;var je=u(Te,Pe,[],!1,null,null,null);je.options.__file="src/views/Users.vue";var Ne=je.exports;i.a.use(Vt);var Me=new Vt({mode:"history",base:OC.generateUrl(""),linkActiveClass:"active",routes:[{path:"/:index(index.php/)?settings/users",component:Ne,props:!0,name:"users",children:[{path:":selectedGroup",name:"group",component:Ne}]}]}),Ue=function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}},Ie="undefined"!=typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__; /** * vuex v3.0.1 * (c) 2017 Evan You -- cgit v1.2.3