(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-684897df"],{"052a":function(e,s,t){"use strict";var a=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{attrs:{id:"text-field"}},[t("span",{staticClass:"title"},[e._v(e._s(e.name))]),e.description&&""!==e.description?t("span",{staticClass:"description"},[e._v(e._s(e.description))]):e._e(),t("input",{ref:"field",attrs:{type:"text",autocomplete:"false",required:e.required},domProps:{value:e.value},on:{input:function(s){return e.update()},change:e.change}})])},i=[],r={name:"text-field",props:{name:String,description:String,value:String,required:{type:Boolean,default:!1}},methods:{update(){this.$emit("input",this.$refs.field.value)},change(){this.$emit("change",this.$refs.field.value)}}},n=r,o=(t("bcae"),t("2877")),u=Object(o["a"])(n,a,i,!1,null,"4930ba7f",null);s["a"]=u.exports},"5e50":function(e,s,t){},"6e0f":function(e,s,t){},a31d:function(e,s,t){"use strict";var a=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{attrs:{id:"password-field"}},[t("span",{staticClass:"title"},[e._v(e._s(e.name))]),e.description&&""!==e.description?t("span",{staticClass:"description"},[e._v(e._s(e.description))]):e._e(),t("input",{ref:"field",attrs:{type:"password",autocomplete:"false",required:e.required},domProps:{value:e.value},on:{input:function(s){return e.update()},change:e.change}})])},i=[],r={name:"password-field",props:{name:String,description:String,value:String,required:{type:Boolean,default:!1}},methods:{update(){this.$emit("input",this.$refs.field.value)},change(){this.$emit("change",this.$refs.field.value)}}},n=r,o=(t("be4b"),t("2877")),u=Object(o["a"])(n,a,i,!1,null,"9ee25cee",null);s["a"]=u.exports},b3b1:function(e,s,t){"use strict";t.r(s);var a=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{attrs:{id:"profile"}},[t("div",{staticClass:"content"},[t("form",{staticClass:"form",attrs:{autocomplete:"false",method:"post",action:"/profile"},on:{submit:function(s){return s.preventDefault(),e.saveUser()}}},[t("input",{staticClass:"hidden-submit",attrs:{type:"submit",value:"submit"}}),t("h2",[e._v(e._s(e.$t("id")))]),t("p",[e._v("\n                "+e._s(e.$t("id_message"))+"\n            ")]),t("text-field",{attrs:{name:e.$t("name"),required:!0},model:{value:e.name,callback:function(s){e.name=s},expression:"name"}}),t("h2",[e._v(e._s(e.$t("security")))]),t("p",[e._v("\n                "+e._s(e.$t("security_message"))+"\n            ")]),e.errors.length>0?t("div",{staticClass:"errors"},e._l(e.errors,function(s,a){return t("span",{key:a},[e._v(e._s(s))])}),0):e._e(),t("password-field",{attrs:{name:e.$t("password")},model:{value:e.password,callback:function(s){e.password=s},expression:"password"}}),t("password-field",{attrs:{name:e.$t("reenter_password")},model:{value:e.challenge,callback:function(s){e.challenge=s},expression:"challenge"}}),t("div",{staticClass:"action"},[t("div",{staticClass:"button button-primary",on:{click:function(s){return e.saveUser()}}},[e._v(e._s(e.$t("save_changes")))])])],1)])])},i=[],r=(t("2ef0"),t("052a")),n=t("a31d"),o={name:"profile",components:{"text-field":r["a"],"password-field":n["a"]},data(){return{id:-1,name:"",username:"",admin:!1,password:"",challenge:"",errors:[]}},computed:{user(){return this.$store.state.user}},async mounted(){this.errors=[],this.id=this.user.id,this.name=this.user.name,this.username=this.user.username,this.admin=this.user.admin,this.password="",this.challenge=""},methods:{async saveUser(){this.errors=[],""===this.name&&(this.name=this.username),""===this.password&&""===this.challenge||this.strongPassword()||this.errors.push(this.$t("password_weak")),""===this.password&&""===this.challenge||this.password===this.challenge||this.errors.push(this.$t("password_mismatch")),0===this.errors.length&&(await this.api.post(`/user/${this.id}`,{name:this.name,username:this.username,password:""!==this.password?this.password:null,admin:this.admin})).success&&this.$router.push({path:"/login",query:{url:"/profile"}})},strongPassword(){return/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&*()]).{8,}/.test(this.password)}}},u=o,l=(t("cce0"),t("2877")),c=Object(l["a"])(u,a,i,!1,null,"12e34357",null);s["default"]=c.exports},b802:function(e,s,t){},bcae:function(e,s,t){"use strict";var a=t("6e0f"),i=t.n(a);i.a},be4b:function(e,s,t){"use strict";var a=t("b802"),i=t.n(a);i.a},cce0:function(e,s,t){"use strict";var a=t("5e50"),i=t.n(a);i.a}}]);
//# sourceMappingURL=chunk-684897df.90bbd721.js.map