text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-65ce8718"],{a55b:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-layout",{attrs:{"align-center":"","justify-center":"","fill-height":""}},[n("v-card",{attrs:{width:"350px"}},[n("v-card-title",{staticStyle:{"justify-content":"center"}},[t._v("Авторизация")]),n("v-card-text",[n("v-form",{ref:"form",model:{value:t.valid,callback:function(e){t.valid=e},expression:"valid"}},[n("v-text-field",{attrs:{required:"",rules:[function(t){return!!t||"Логин не должен быть пустым"}],label:"Логин"},model:{value:t.login,callback:function(e){t.login=e},expression:"login"}}),n("v-text-field",{attrs:{type:"password",required:"",rules:[function(t){return!!t||"Пароль не должен быть пустым"}],label:"Пароль"},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}}),t.auth?t._e():n("span",{staticClass:"red--text"},[t._v("Логин/пароль введены неверно!")])],1)],1),n("v-card-actions",[n("v-spacer"),n("v-btn",{attrs:{color:"primary",text:"",disabled:!t.valid,loading:t.isLoading},on:{click:function(e){return t.signin()}}},[t._v("Войти")])],1)],1)],1)},i=[],a=n("1da1"),s=(n("96cf"),n("e9c4"),n("ba6a")),o=n("44c2"),u={name:"Login",data:function(){return{valid:!0,auth:!0,isLoading:!1,login:"",password:""}},methods:{signin:function(){var t=this;return Object(a["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,s["a"].post("/users/login",{user:{login:t.login,password:t.password}}).then(function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o["a"].setCookie("user",JSON.stringify({token:n.data.user.token})),t.$store.dispatch("userLogin",!0),t.$store.dispatch("setToken",n.data.user.token),e.next=5,t.$store.dispatch("getStateDeamon");case 5:t.auth=!0,t.$router.push("/");case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.auth=!1}));case 3:t.isLoading=!1;case 4:case"end":return e.stop()}}),e)})))()}}},c=u,d=n("2877"),l=n("6544"),f=n.n(l),h=n("8336"),p=n("b0af"),v=n("99d9"),g=n("5530"),m=(n("caad"),n("2532"),n("07ac"),n("4de4"),n("d3b7"),n("159b"),n("7db0"),n("58df")),w=n("7e2b"),b=n("3206"),_=Object(m["a"])(w["a"],Object(b["b"])("form")).extend({name:"v-form",provide:function(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:function(){return{inputs:[],watchers:[],errorBag:{}}},watch:{errorBag:{handler:function(t){var e=Object.values(t).includes(!0);this.$emit("input",!e)},deep:!0,immediate:!0}},methods:{watchInput:function(t){var e=this,n=function(t){return t.$watch("hasError",(function(n){e.$set(e.errorBag,t._uid,n)}),{immediate:!0})},r={_uid:t._uid,valid:function(){},shouldValidate:function(){}};return this.lazyValidation?r.shouldValidate=t.$watch("shouldValidate",(function(i){i&&(e.errorBag.hasOwnProperty(t._uid)||(r.valid=n(t)))})):r.valid=n(t),r},validate:function(){return 0===this.inputs.filter((function(t){return!t.validate(!0)})).length},reset:function(){this.inputs.forEach((function(t){return t.reset()})),this.resetErrorBag()},resetErrorBag:function(){var t=this;this.lazyValidation&&setTimeout((function(){t.errorBag={}}),0)},resetValidation:function(){this.inputs.forEach((function(t){return t.resetValidation()})),this.resetErrorBag()},register:function(t){this.inputs.push(t),this.watchers.push(this.watchInput(t))},unregister:function(t){var e=this.inputs.find((function(e){return e._uid===t._uid}));if(e){var n=this.watchers.find((function(t){return t._uid===e._uid}));n&&(n.valid(),n.shouldValidate()),this.watchers=this.watchers.filter((function(t){return t._uid!==e._uid})),this.inputs=this.inputs.filter((function(t){return t._uid!==e._uid})),this.$delete(this.errorBag,e._uid)}}},render:function(t){var e=this;return t("form",{staticClass:"v-form",attrs:Object(g["a"])({novalidate:!0},this.attrs$),on:{submit:function(t){return e.$emit("submit",t)}}},this.$slots.default)}}),V=n("a722"),x=n("2fa4"),y=n("8654"),k=Object(d["a"])(c,r,i,!1,null,null,null);e["default"]=k.exports;f()(k,{VBtn:h["a"],VCard:p["a"],VCardActions:v["a"],VCardText:v["b"],VCardTitle:v["c"],VForm:_,VLayout:V["a"],VSpacer:x["a"],VTextField:y["a"]})},a722:function(t,e,n){"use strict";n("20f6");var r=n("e8f2");e["a"]=Object(r["a"])("layout")}}]);
  //# sourceMappingURL=chunk-65ce8718.0dd9595e.js.map