"use strict";(self["webpackChunksortinghat_ui"]=self["webpackChunksortinghat_ui"]||[]).push([[174],{82174:(e,r,n)=>{n.r(r),n.d(r,{default:()=>W});var t=n(20641),s=n(90033),a=n(53751),o=n(31969),u=n(13892),l=n(4189),i=n(91606),d=n(85832),c=n(30697),f=n(1560),p=n(98477),m=n(43948);function w(e,r,n,w,b,g){return(0,t.uX)(),(0,t.Wv)(p.Y,{class:"d-flex align-center"},{default:(0,t.k6)((function(){return[(0,t.bF)(l.J,{class:"mx-auto pa-7",width:"500"},{default:(0,t.k6)((function(){return[(0,t.bF)(i.r,{class:"display-1 mb-2"},{default:(0,t.k6)((function(){return r[3]||(r[3]=[(0,t.eW)("Welcome")])})),_:1}),(0,t.bF)(d.Z,{class:"mb-3"},{default:(0,t.k6)((function(){return r[4]||(r[4]=[(0,t.eW)("Please log in to continue")])})),_:1}),(0,t.bF)(c.O,null,{default:(0,t.k6)((function(){return[(0,t.bF)(f.n,{ref:"form"},{default:(0,t.k6)((function(){return[(0,t.bF)(m.W,{modelValue:e.username,"onUpdate:modelValue":r[0]||(r[0]=function(r){return e.username=r}),label:"Username",id:"username",outlined:"",dense:""},null,8,["modelValue"]),(0,t.bF)(m.W,{modelValue:e.password,"onUpdate:modelValue":r[1]||(r[1]=function(r){return e.password=r}),label:"Password",id:"password","append-icon":e.showPassword?"mdi-eye":"mdi-eye-off",type:e.showPassword?"text":"password",outlined:"",dense:"","onClick:append":r[2]||(r[2]=function(r){return e.showPassword=!e.showPassword})},null,8,["modelValue","append-icon","type"]),e.errorMessage?((0,t.uX)(),(0,t.Wv)(o.l,{key:0,text:"",type:"error"},{default:(0,t.k6)((function(){return[(0,t.eW)((0,s.v_)(e.errorMessage),1)]})),_:1})):(0,t.Q3)("",!0),(0,t.bF)(u.D,{color:"primary",size:"default",variant:"flat",block:"",disabled:g.disableSubmit,onClick:(0,a.D$)(g.submit,["prevent"])},{default:(0,t.k6)((function(){return r[5]||(r[5]=[(0,t.eW)(" Log in ")])})),_:1},8,["disabled","onClick"])]})),_:1},512)]})),_:1})]})),_:1})]})),_:1})}var b=n(14048),g=n(30388),h=n(41034),k=(n(28706),n(44114),n(66278));const v={name:"Login",data:function(){return{username:"",password:"",showPassword:!1,errorMessage:""}},computed:{disableSubmit:function(){return this.username.length<3||this.password.length<3}},methods:(0,h.A)((0,h.A)({},(0,k.i0)(["login"])),{},{submit:function(){var e=this;return(0,g.A)((0,b.A)().mark((function r(){var n,t;return(0,b.A)().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,n={username:e.username,password:e.password},r.next=4,e.login(n);case 4:t=r.sent,t&&(e.$router.push(e.$route.query.redirect||"/"),e.$logger.info("Log in user ".concat(e.username))),r.next=12;break;case 8:r.prev=8,r.t0=r["catch"](0),e.errorMessage=e.$getErrorMessage(r.t0),e.$logger.error("Error logging in user ".concat(e.username,": ").concat(r.t0));case 12:case"end":return r.stop()}}),r,null,[[0,8]])})))()}})};var _=n(64621);const y=(0,_.A)(v,[["render",w]]),W=y}}]);
//# sourceMappingURL=174.0b7419e8.js.map