(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{972:function(e,t,r){"use strict";r.r(t);var o=r(263),n=r(264),c=r(51),l=r(581),d=r(586),m=r(638),f=r(260),v=r(580),$=r(578),w=r(566),O=r(781),h=(r(7),r(46),r(9),r(8),r(3),r(11),r(10),r(12),r(13)),j=r(1),y=(r(55),r(21),r(53),r(36)),x=r(595),_=r.n(x),k=r(28);function P(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}var C={name:"Register",data:function(){return{mdiChevronRight:k.r,loading:!1,user:{},valid:!0}},validate:function(e){return e.store.state.settings.allow_registration},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?P(Object(source),!0).forEach((function(t){Object(j.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):P(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,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,o,n;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,o=r&&r.is_admin&&r.is_active,e.$root.$message(o?"register.first_user":"register.complete",{color:"success"}),e.$router.replace("/"),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(3),n=_()(t.t0,"response.data.errors[0].message",String(t.t0)),e.$root.$message(n,{color:"error"});case 17:e.loading=!1;case 18:case"end":return t.stop()}}),t,null,[[3,13]])})))()}},head:function(){return{title:this.settings.title+" - "+this.$t("common.register")}}},R=C,D=r(24),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(n.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(o.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}}]);