import{L}from"./LogoMain-DelLC8pV.js";import{I as T,k as n,l as D,Q as _,aE as F,o as x,A as V,a,w as t,$ as y,b as r,d as E,N as C,e as v,bJ as O,t as P,s as H,M as U,F as W,W as h,c as $,a9 as G,V as S,f as p,ae as w,af as q}from"./index-DGdp2baF.js";import{R as z}from"./ReCaptcha-DlrizQH_.js";import{F as j}from"./vee-validate.esm-ckbhZGBx.js";import{_ as J}from"./_plugin-vue_export-helper-DlAUqK2U.js";/* empty css                                                   */import{L as Q}from"./LoginImage-DvhVngFx.js";import"./customizer-Cu1vRDRR.js";const K={key:0,class:"mt-2"},X={class:"mt-5 text-right"},Y=T({__name:"AuthLogin",setup(I){const f=n(!1);let l=n(!1);const R=n(!1),c=n(!1),i=n(""),u=n(""),d=n("");D(()=>{const e=_();e.isRememberPwd&&(f.value=e.isRememberPwd,u.value=e.loginMsgmutations.username,i.value=e.loginMsgmutations.password,console.log("usersStore....",e.loginMsgmutations),console.log("username....",e.loginMsgmutations.username),console.log("password....",e.loginMsgmutations.password))});const b=F(),g=_();function k(e,{setErrors:s}){return l.value=!0,console.log(g),d.value||(l.value=!1,s({apiError:"Please verify reCaptcha"})),console.log("authStore.login....",u.value,i.value,d.value),b.login(u.value,i.value,d.value).then(o=>{o.code==200?(g.SET_SHOULD_DASHBOARD_NOTICE_Mutations(!0),M()):(s({apiError:o.msg}),l.value=!1)}).catch(function(o){s({apiError:o}),l.value=!1})}function M(){console.log("getCurrentMerchant"),b.currentMerchant().then(async e=>{console.log("getCurrentMerchant....",M),await g.SET_MERCHANT_INFO_MUTATIONS().then(()=>{if(console.log("res.data.login...",e.data.login),e.data.login){l.value=!1;const s=_();if(s.SET_lOGIN_MSG_MUTATIONS({username:u.value,password:i.value}),f.value==!0?s.SET_IS_REMEMBER_PWD(!0):s.SET_IS_REMEMBER_PWD(!1),console.log("res.data.login2...",e.data.login),sessionStorage.getItem("lastRoute")){let o=A(sessionStorage.getItem("lastRoute"));h.push(o)}else h.push("/affiliate")}})})}function A(e){return e.startsWith("/app")?e.slice(4):e}function N(){h.push("/auth/forgot-password")}const B=e=>(console.log("val....",e),d.value=e,e);return(e,s)=>(x(),V(W,null,[a(C(j),{onSubmit:k,class:"mt-7 loginForm"},{default:t(({errors:o})=>[a(y,{modelValue:u.value,"onUpdate:modelValue":s[0]||(s[0]=m=>u.value=m),label:"Email Address",class:"mt-4 mb-8",required:"",density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary"},null,8,["modelValue"]),a(y,{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=m=>i.value=m),label:"Password",required:"",density:"comfortable",variant:"outlined",color:"primary","hide-details":"auto","append-icon":c.value?"mdi-eye":"mdi-eye-off",type:c.value?"text":"password","onClick:append":s[2]||(s[2]=m=>c.value=!c.value),class:"pwdInput"},null,8,["modelValue","append-icon","type"]),r("div",{class:"d-sm-flex align-center mt-4 mb-4 mb-sm-0"},[r("div",{class:"ml-auto mb-4"},[r("a",{onClick:N,class:"text-secondary text-decoration-none cursor-pointer"},"Forgot password?")])]),a(z,{onGetChildren:B}),a(E,{color:"secondary",loading:C(l),block:"",class:"mt-2",variant:"flat",size:"large",disabled:R.value,type:"submit"},{default:t(()=>[v(" Sign In")]),_:1},8,["loading","disabled"]),o.apiError?(x(),V("div",K,[a(O,{color:"error"},{default:t(()=>[v(P(o.apiError),1)]),_:2},1024)])):H("",!0)]),_:1}),r("div",X,[a(U),a(E,{variant:"plain",to:"/register",class:"mt-2 text-capitalize mr-n2"},{default:t(()=>[v("Don't Have an account?")]),_:1})])],64))}}),Z=J(Y,[["__scopeId","data-v-1c6f1890"]]),ee={class:"pa-0 pa-sm-12"},ae=r("h2",{class:"text-secondary text-h2"},"Hi, Welcome Back",-1),te=r("h4",{class:"text-h4"},"Login in to your account",-1),de=T({__name:"LoginPage",setup(I){return(f,l)=>(x(),$(S,{class:"h-100vh","no-gutters":""},{default:t(()=>[a(p,{cols:"12",lg:"7",xl:"7",class:"d-flex align-center bg-lightprimary"},{default:t(()=>[a(G,null,{default:t(()=>[r("div",ee,[a(S,{justify:"center"},{default:t(()=>[a(p,{cols:"12",lg:"10",xl:"6",md:"7"},{default:t(()=>[a(w,{elevation:"0",class:"loginBox"},{default:t(()=>[a(w,{variant:"outlined"},{default:t(()=>[a(q,{class:"pa-9"},{default:t(()=>[a(S,null,{default:t(()=>[a(p,{cols:"12",md:"7",sm:"7","order-sm":"first",order:"last",class:"text-sm-start text-center"},{default:t(()=>[ae,te]),_:1}),a(p,{class:"text-sm-end text-center",sm:"5",cols:"12"},{default:t(()=>[a(L)]),_:1})]),_:1}),a(Z)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1}),a(Q)]),_:1}))}});export{de as default};