(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{948:function(e,t,r){"use strict";r.r(t);var n=r(262),o=r(263),c=r(54),l=r(588),d=r(592),m=r(635),f=r(259),v=r(587),$=r(585),w=r(141),O=r(584),h=(r(7),r(49),r(8),r(12),r(13),r(9),r(3),r(10),r(11)),j=r(1),y=(r(48),r(22),r(57),r(29)),_=r(601),x=r.n(_),k=r(25);function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var C={name:"Register",data:function(){return{mdiChevronRight:k.v,loading:!1,user:{},valid:!0}},validate:function(e){return e.store.state.settings.allow_registration},computed:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){Object(j.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},Object(y.d)(["settings"])),mounted:function(){this.$refs.email.focus()},methods:{register:function(){var e=this;return Object(h.a)(regeneratorRuntime.mark((function t(){var r,n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.$refs.form.validate()){t.next=3;break}return t.abrupt("return");case 3:return t.prev=3,e.loading=!0,t.next=7,e.$axios.$post("/user/register",e.user);case 7:r=t.sent,n=r&&r.is_admin&&r.is_active,e.$root.$message(n?"register.first_user":"register.complete",{color:"success"}),e.$router.replace("/"),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(3),o=x()(t.t0,"response.data.errors[0].message",String(t.t0)),e.$root.$message(o,{color:"error"});case 17:e.loading=!1;case 18:case"end":return t.stop()}}),t,null,[[3,13]])})))()}},head:function(){return{htmlAttrs:{lang:this.settings.instance_locale},title:this.settings.title+" - "+this.$t("common.register")}}},R=C,D=r(26),component=Object(D.a)(R,(function(){var e=this,t=e._self._c;return t(d.a,{staticClass:"pa-0 pa-md-3"},[t(v.a,{staticClass:"mt-md-5 ma-0",attrs:{align:"center",justify:"center"}},[t(l.a,{staticClass:"pa-0 pa-md-3",attrs:{cols:"12",md:"6",lg:"5",xl:"4"}},[t(o.a,[t(c.d,[e._v(e._s(e.$t("common.register")))]),t(c.c,[t("p",{domProps:{innerHTML:e._s(e.$t("register.description"))}}),t(m.a,{ref:"form",model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[t(w.a,{ref:"email",attrs:{type:"email",rules:e.$validators.email,label:e.$t("common.email"),autocomplete:"email"},model:{value:e.user.email,callback:function(t){e.$set(e.user,"email",t)},expression:"user.email"}}),t(w.a,{attrs:{type:"password",rules:e.$validators.password,label:e.$t("common.password")},model:{value:e.user.password,callback:function(t){e.$set(e.user,"password",t)},expression:"user.password"}}),t(O.a,{attrs:{rules:[e.$validators.required(e.$t("common.description"))],label:e.$t("common.description")},model:{value:e.user.description,callback:function(t){e.$set(e.user,"description",t)},expression:"user.description"}})],1)],1),t(c.a,[t($.a),t(n.a,{attrs:{outlined:"",disabled:!e.valid||e.loading,loading:e.loading,color:"primary"},on:{click:e.register}},[e._v(e._s(e.$t("common.send"))),t(f.a,{domProps:{textContent:e._s(e.mdiChevronRight)}})],1)],1)],1)],1)],1)],1)}),[],!1,null,null,null);t.default=component.exports}}]);