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

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

"use strict";
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31);
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39);
// Mixins



/* @vue/component */

/* harmony default export */ __webpack_exports__["a"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__[/* provide */ "b"])('form')
/* @vue/component */).extend({
  name: 'v-form',
  provide() {
    return {
      form: this
    };
  },
  inheritAttrs: false,
  props: {
    disabled: Boolean,
    lazyValidation: Boolean,
    readonly: Boolean,
    value: Boolean
  },
  data: () => ({
    inputs: [],
    watchers: [],
    errorBag: {}
  }),
  watch: {
    errorBag: {
      handler(val) {
        const errors = Object.values(val).includes(true);
        this.$emit('input', !errors);
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    watchInput(input) {
      const watcher = input => {
        return input.$watch('hasError', val => {
          this.$set(this.errorBag, input._uid, val);
        }, {
          immediate: true
        });
      };
      const watchers = {
        _uid: input._uid,
        valid: () => {},
        shouldValidate: () => {}
      };
      if (this.lazyValidation) {
        // Only start watching inputs if we need to
        watchers.shouldValidate = input.$watch('shouldValidate', val => {
          if (!val) return; // Only watch if we're not already doing it

          if (this.errorBag.hasOwnProperty(input._uid)) return;
          watchers.valid = watcher(input);
        });
      } else {
        watchers.valid = watcher(input);
      }
      return watchers;
    },
    /** @public */
    validate() {
      return this.inputs.filter(input => !input.validate(true)).length === 0;
    },
    /** @public */
    reset() {
      this.inputs.forEach(input => input.reset());
      this.resetErrorBag();
    },
    resetErrorBag() {
      if (this.lazyValidation) {
        // Account for timeout in validatable
        setTimeout(() => {
          this.errorBag = {};
        }, 0);
      }
    },
    /** @public */
    resetValidation() {
      this.inputs.forEach(input => input.resetValidation());
      this.resetErrorBag();
    },
    register(input) {
      this.inputs.push(input);
      this.watchers.push(this.watchInput(input));
    },
    unregister(input) {
      const found = this.inputs.find(i => i._uid === input._uid);
      if (!found) return;
      const unwatch = this.watchers.find(i => i._uid === found._uid);
      if (unwatch) {
        unwatch.valid();
        unwatch.shouldValidate();
      }
      this.watchers = this.watchers.filter(i => i._uid !== found._uid);
      this.inputs = this.inputs.filter(i => i._uid !== found._uid);
      this.$delete(this.errorBag, found._uid);
    }
  },
  render(h) {
    return h('form', {
      staticClass: 'v-form',
      attrs: {
        novalidate: true,
        ...this.attrs$
      },
      on: {
        submit: e => this.$emit('submit', e)
      }
    }, this.$slots.default);
  }
}));

/***/ }),

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

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

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VBtn/VBtn.js
var VBtn = __webpack_require__(87);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VCard/VCard.js
var VCard = __webpack_require__(88);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VCard/index.js
var components_VCard = __webpack_require__(14);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VCol.js
var VCol = __webpack_require__(226);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VContainer.js + 1 modules
var VContainer = __webpack_require__(230);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VForm/VForm.js
var VForm = __webpack_require__(253);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VIcon/VIcon.js
var VIcon = __webpack_require__(86);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VRow.js
var VRow = __webpack_require__(225);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VSpacer.js
var VSpacer = __webpack_require__(223);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VTextField/VTextField.js + 3 modules
var VTextField = __webpack_require__(47);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VTextarea/VTextarea.js
var VTextarea = __webpack_require__(222);

// CONCATENATED MODULE: ./node_modules/vuetify-loader/lib/loader.js??ref--4!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./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=26f1726d&lang=pug














var Registervue_type_template_id_26f1726d_lang_pug_render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c(VContainer["a" /* default */], {
    staticClass: "pa-0 pa-md-3"
  }, [_c(VRow["a" /* default */], {
    staticClass: "mt-md-5 ma-0",
    attrs: {
      "align": "center",
      "justify": "center"
    }
  }, [_c(VCol["a" /* default */], {
    staticClass: "pa-0 pa-md-3",
    attrs: {
      "cols": "12",
      "md": "6",
      "lg": "5",
      "xl": "4"
    }
  }, [_c(VCard["a" /* default */], [_c(components_VCard["d" /* VCardTitle */], [_vm._v(_vm._s(_vm.$t('common.register')))]), _c(components_VCard["c" /* VCardText */], [_c('p', {
    domProps: {
      "innerHTML": _vm._s(_vm.$t('register.description'))
    }
  }), _c(VForm["a" /* default */], {
    ref: "form",
    model: {
      value: _vm.valid,
      callback: function ($$v) {
        _vm.valid = $$v;
      },
      expression: "valid"
    }
  }, [_c(VTextField["a" /* default */], {
    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(VTextField["a" /* default */], {
    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(VTextarea["a" /* default */], {
    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(components_VCard["a" /* VCardActions */], [_c(VSpacer["a" /* default */]), _c(VBtn["a" /* default */], {
    attrs: {
      "outlined": "",
      "disabled": !_vm.valid || _vm.loading,
      "loading": _vm.loading,
      "color": "primary"
    },
    on: {
      "click": _vm.register
    }
  }, [_vm._v(_vm._s(_vm.$t('common.send'))), _c(VIcon["a" /* default */], {
    domProps: {
      "textContent": _vm._s(_vm.mdiChevronRight)
    }
  })], 1)], 1)], 1)], 1)], 1)], 1);
};
var staticRenderFns = [];

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

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

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

// EXTERNAL MODULE: external "@mdi/js"
var js_ = __webpack_require__(6);

// 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 {
      mdiChevronRight: js_["mdiChevronRight"],
      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'])
  },
  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', {
          color: 'success'
        });
        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 {
      htmlAttrs: {
        lang: this.settings.instance_locale
      },
      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__(7);

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





/* normalize component */

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

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

/***/ })

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