exports.ids = [26];
exports.modules = {

/***/ 139:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/Register.vue?vue&type=template&id=5c443762&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',[_c('v-row',{staticClass:"mt-5",attrs:{"align":"center","justify":"center"}},[_c('v-col',{attrs:{"cols":"12","md":"6","lg":"5","xl":"4"}},[_c('v-card',[_c('v-card-title',[_vm._v(_vm._s(_vm.$t('common.register')))]),_c('v-card-text',[_c('p',{domProps:{"innerHTML":_vm._s(_vm.$t('register.description'))}}),_c('v-form',{ref:"form",model:{value:(_vm.valid),callback:function ($$v) {_vm.valid=$$v},expression:"valid"}},[_c('v-text-field',{ref:"email",attrs:{"type":"email","rules":_vm.$validators.email,"label":_vm.$t("common.email"),"autocomplete":"email"},model:{value:(_vm.user.email),callback:function ($$v) {_vm.$set(_vm.user, "email", $$v)},expression:"user.email"}}),_c('v-text-field',{attrs:{"type":"password","rules":_vm.$validators.password,"label":_vm.$t('common.password')},model:{value:(_vm.user.password),callback:function ($$v) {_vm.$set(_vm.user, "password", $$v)},expression:"user.password"}}),_c('v-textarea',{attrs:{"rules":[_vm.$validators.required(_vm.$t('common.description'))],"label":_vm.$t('common.description')},model:{value:(_vm.user.description),callback:function ($$v) {_vm.$set(_vm.user, "description", $$v)},expression:"user.description"}})],1)],1),_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{"disabled":!_vm.valid || _vm.loading,"loading":_vm.loading,"color":"primary"},on:{"click":_vm.register}},[_vm._v(_vm._s(_vm.$t('common.send'))),_c('v-icon',[_vm._v("mdi-chevron-right")])],1)],1)],1)],1)],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/Register.vue?vue&type=template&id=5c443762&lang=pug&

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(3);

// EXTERNAL MODULE: external "lodash/get"
var get_ = __webpack_require__(59);
var get_default = /*#__PURE__*/__webpack_require__.n(get_);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./pages/Register.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//


/* harmony default export */ var Registervue_type_script_lang_js_ = ({
  name: 'Register',

  data() {
    return {
      loading: false,
      user: {},
      valid: true
    };
  },

  // https://nuxtjs.org/api/pages-validate/
  // If the validate method does not return true, Nuxt.js will automatically load the 404 error page.
  validate({
    store
  }) {
    return store.state.settings.allow_registration;
  },

  computed: { ...Object(external_vuex_["mapState"])(['settings']) // disabled () {
    //   if (process.server) { return false }
    //   return !this.user.password || !this.user.email || !this.user.description
    // }

  },

  mounted() {
    this.$refs.email.focus();
  },

  methods: {
    async register() {
      const valid = this.$refs.form.validate();

      if (!valid) {
        return;
      }

      try {
        this.loading = true;
        const user = await this.$axios.$post('/user/register', this.user); // this is the first user registered

        const first_user = user && user.is_admin && user.is_active;
        this.$root.$message(first_user ? 'register.first_user' : 'register.complete');
        this.$router.replace('/');
      } catch (e) {
        const error = get_default()(e, 'response.data.errors[0].message', String(e));
        this.$root.$message(error, {
          color: 'error'
        });
      }

      this.loading = false;
    }

  },

  head() {
    return {
      title: this.settings.title + ' - ' + this.$t('common.register')
    };
  }

});
// CONCATENATED MODULE: ./pages/Register.vue?vue&type=script&lang=js&
 /* harmony default export */ var pages_Registervue_type_script_lang_js_ = (Registervue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./pages/Register.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  pages_Registervue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "26905232"
  
)

/* harmony default export */ var Register = __webpack_exports__["default"] = (component.exports);

/***/ })

};;
//# sourceMappingURL=Register.js.map