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

/***/ 263:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(319);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(5).default
module.exports.__inject__ = function (context) {
  add("932b2322", content, true, context)
};

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(263);
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 319:
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(4);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".admin-users__user-table{box-shadow:0 0 0 0 transparent,0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);padding:0 1rem .5rem;border-radius:1rem;margin-top:2rem;width:100%;overflow:hidden;position:relative;border-collapse:collapse;background:var(--color-shade-0)}.admin-users__user-table--header{background-color:var(--color-shade-2)}.admin-users__user-table--join__date{text-align:center;white-space:nowrap}.admin-users__user-table td,.admin-users__user-table th{padding-left:1rem;padding-right:1rem;height:50px}.admin-users__user-table td{padding-top:.75rem;padding-bottom:.75rem}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;


/***/ }),

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

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

// CONCATENATED MODULE: D:/Projects/vindigo/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!D:/Projects/vindigo/node_modules/nuxt/node_modules/@nuxt/components/dist/loader.js??ref--0-0!D:/Projects/vindigo/node_modules/vue-loader/lib??vue-loader-options!./pages/admin/users/index.vue?vue&type=template&id=44a5555f&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"admin-users"},[_vm._ssrNode("<table class=\"admin-users__user-table container\">","</table>",[_vm._ssrNode("<tr class=\"admin-users__user-table--header\"><th style=\"text-align: left; width: 0\">\n\t\t\t\tID\n\t\t\t</th> <th style=\"text-align: left; width: 0\">\n\t\t\t\tUsername\n\t\t\t</th> <th style=\"text-align: left\">\n\t\t\t\tEmail\n\t\t\t</th> <th style=\"text-align: center; width: 0; white-space: nowrap;\">\n\t\t\t\tCreation Date\n\t\t\t</th> <th style=\"text-align: center; width: 0; white-space: nowrap;\"></th></tr> "),_vm._l((_vm.users),function(user){return _vm._ssrNode("<tr>","</tr>",[_vm._ssrNode("<td>"+_vm._ssrEscape("\n\t\t\t\t"+_vm._s(user.id)+"\n\t\t\t")+"</td> <td>"+_vm._ssrEscape("\n\t\t\t\t"+_vm._s(user.username)+"\n\t\t\t")+"</td> <td>"+_vm._ssrEscape("\n\t\t\t\t"+_vm._s(user.email)+"\n\t\t\t")+"</td> <td class=\"admin-users__user-table--join__date\">"+_vm._ssrEscape("\n\t\t\t\t"+_vm._s(_vm.joinDate(user))+"\n\t\t\t")+"</td> "),_vm._ssrNode("<td>","</td>",[_c('w-button',{staticStyle:{"font-size":"1rem","line-height":"1.5rem"},attrs:{"bg-color":"transparent","color":"primary"},on:{"click":function($event){return _vm.$router.push(("/admin/users/" + (user.id) + "/edit"))}}},[_vm._v("\n\t\t\t\t\tEdit\t\n\t\t\t\t")])],1)],2)}),_vm._ssrNode(" "),_vm._ssrNode("<tr style=\"text-align: center\">","</tr>",[_vm._ssrNode("<td></td> <td></td> "),_vm._ssrNode("<td>","</td>",[_c('w-button',{attrs:{"color":"white","bg-color":"primary"},on:{"click":function($event){_vm.createUserDialog = true}}},[_c('w-icon',{staticStyle:{"padding-right":"5px"}},[_vm._v("\n\t\t\t\t\t\tmdi mdi-plus\n\t\t\t\t\t")]),_vm._v("\n\n\t\t\t\t\tCreate New User\n\t\t\t\t")],1)],1)],2)],2),_vm._ssrNode(" "),_c('w-dialog',{attrs:{"dialog-class":"simple-dialog","width":"600"},model:{value:(_vm.createUserDialog),callback:function ($$v) {_vm.createUserDialog=$$v},expression:"createUserDialog"}},[_c('div',[_c('VindiTitle',{staticStyle:{"padding-bottom":"20px"},attrs:{"icon":"mdi mdi-account-plus"}},[_vm._v("\n\t\t\t\tCreate New User\n\t\t\t")]),_vm._v(" "),_c('w-input',{staticStyle:{"padding-bottom":"20px"},attrs:{"placeholder":_vm.$t('GENERAL_EMAIL'),"autocomplete":"sign-up email","name":"email"},model:{value:(_vm.newUserEmail),callback:function ($$v) {_vm.newUserEmail=$$v},expression:"newUserEmail"}}),_vm._v(" "),_c('w-input',{staticStyle:{"padding-bottom":"20px"},attrs:{"placeholder":_vm.$t('GENERAL_FULL_NAME'),"autocomplete":"sign-up name","name":"name"},model:{value:(_vm.newUserFullName),callback:function ($$v) {_vm.newUserFullName=$$v},expression:"newUserFullName"}}),_vm._v(" "),_c('w-input',{attrs:{"placeholder":_vm.$t('SIGNIN_PASSWORD'),"autocomplete":"sign-up password","password-reveal":"","type":"password","name":"password"},model:{value:(_vm.newUserPassword),callback:function ($$v) {_vm.newUserPassword=$$v},expression:"newUserPassword"}})],1),_vm._v(" "),_c('VindiSpacer'),_vm._v(" "),_c('w-button',{attrs:{"round":"","color":"white","bg-color":"primary","type":"submit","width":"100%","height":"32","loading":_vm.isLoading},on:{"click":_vm.registerUser}},[_vm._v("\n\t\t\tCreate\n\t\t")])],1)],2)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/admin/users/index.vue?vue&type=template&id=44a5555f&

// EXTERNAL MODULE: external "vue"
var external_vue_ = __webpack_require__(0);
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);

// EXTERNAL MODULE: external "dayjs"
var external_dayjs_ = __webpack_require__(3);
var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_);

// CONCATENATED MODULE: ./assets/query/admin/adminListUsers.gql
/* harmony default export */ var adminListUsers = ("# > profileEssentials\r\n\r\nquery AdminListUsers {\r\n\tallUsers {\r\n\t\t...ProfileEssentials\r\n\t\tcreatedAt\r\n\t\temail\r\n\t}\r\n}");
// CONCATENATED MODULE: ./assets/query/admin/adminCreateUser.gql
/* harmony default export */ var adminCreateUser = ("mutation AdminCreateUser($details: UserRegistration!, $verify: Boolean!) {\r\n\tcreateUser(details: $details, verify: $verify) {\r\n\t\tid\r\n\t}\r\n}");
// CONCATENATED MODULE: D:/Projects/vindigo/node_modules/babel-loader/lib??ref--13-0!D:/Projects/vindigo/node_modules/ts-loader??ref--13-1!D:/Projects/vindigo/node_modules/nuxt/node_modules/@nuxt/components/dist/loader.js??ref--0-0!D:/Projects/vindigo/node_modules/vue-loader/lib??vue-loader-options!./pages/admin/users/index.vue?vue&type=script&lang=ts&
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function (resolve) {
      resolve(value);
    });
  }

  return new (P || (P = Promise))(function (resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }

    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }

    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }

    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
};





/* harmony default export */ var usersvue_type_script_lang_ts_ = (external_vue_default.a.extend({
  name: 'AdminUsersPage',
  middleware: "admin",
  data: () => ({
    users: [],
    createUserDialog: false,
    isLoading: false,
    newUserEmail: '',
    newUserFullName: '',
    newUserPassword: ''
  }),

  created() {
    return __awaiter(this, void 0, void 0, function* () {
      // assign active / anon users
      this.users = (yield this.$api.query(adminListUsers)).allUsers;
    });
  },

  methods: {
    joinDate(user) {
      return external_dayjs_default()(parseInt(user.createdAt)).format(this.$t("DATE_TIME_FORMAT"));
    },

    registerUser() {
      return __awaiter(this, void 0, void 0, function* () {
        if (!this.newUserFullName || !this.newUserEmail || !this.newUserPassword) {
          this.$waveui.notify(this.$t('NOTIFICATION_BLANK_FIELDS'), "error");
          return;
        }

        this.isLoading = true;
        const res = yield this.$api.query(adminCreateUser, {
          details: {
            fullname: this.newUserFullName,
            email: this.newUserEmail,
            password: this.newUserPassword,
            remember: false
          },
          verify: false
        });
        const user = res.createUser;

        if (!user) {
          this.$waveui.notify(this.$t('NOTIFICATION_INVALID_DETAILS'), 'error');
        } else {
          this.$waveui.notify({
            message: 'User creation successful',
            success: true
          });
          this.$router.push(`/admin/users/${user.id}/edit`);
        }

        this.isLoading = false;
        this.createUserDialog = false;
      });
    }

  }
}));
// CONCATENATED MODULE: ./pages/admin/users/index.vue?vue&type=script&lang=ts&
 /* harmony default export */ var admin_usersvue_type_script_lang_ts_ = (usersvue_type_script_lang_ts_); 
// EXTERNAL MODULE: D:/Projects/vindigo/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);

// CONCATENATED MODULE: ./pages/admin/users/index.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(318)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  admin_usersvue_type_script_lang_ts_,
  render,
  staticRenderFns,
  false,
  injectStyles,
  null,
  "663ec6f5"
  
)

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

/* nuxt-component-imports */
installComponents(component, {VindiTitle: __webpack_require__(69).default,VindiSpacer: __webpack_require__(11).default})


/***/ })

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