File: /home/dmstechonline/whatsapp.dmstech.online/public/build/assets/Login-6a3868f6.js
import{r as $,T as H,q as j,R as B,G as F,c as n,a as e,j as d,g as h,u as s,t as l,h as g,k as R,n as y,b as f,d as z,K as _,o as i,i as w}from"./app-884e4ce3.js";import{_ as k}from"./FormInput-ab713954.js";import{u as N,a as L}from"./ReCaptcha-55f58cbf.js";import{l as S}from"./index-ff0eb693.js";import{u as q}from"./useRtl-295d8c04.js";const T={class:"flex h-screen justify-center"},U={class:"flex justify-center"},Z={class:"w-[20em] mt-40"},D={class:"flex justify-center mb-5"},E=["src","alt"],K={key:1,class:"text-2xl mb-2"},P={class:"text-2xl text-center"},G={class:"text-center text-sm text-slate-500"},O={class:"mt-5 space-y-4"},Q={key:0,class:"form-error text-[#b91c1c] text-xs"},I={class:"flex items-center justify-between mt-5"},J={class:"flex items-start"},W={class:"ml-3 text-sm"},X={for:"remember",class:"text-gray-500 dark:text-gray-300"},Y={class:"mt-6"},ee={key:0,type:"submit",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full"},te={key:1,type:"button",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full flex justify-center"},ae={key:0,class:"flex justify-center my-6"},se={class:"text-sm text-gray-500 px-4 text-center"},oe={class:"flex justify-center gap-4"},re={key:0,href:"/social-login/facebook",class:"border rounded-full p-2 cursor-pointer"},ne={key:1,href:"/social-login/google",class:"border rounded-full p-2 cursor-pointer"},fe={__name:"Login",props:["flash","config","companyConfig"],setup(C){const{rtlClass:V,isRtl:le}=q(),r=C,u=$(!1),o=H({email:null,password:null,recaptcha_response:null}),c=a=>{const t=r.config.find(m=>m.key===a);return t?t.value:""},A=async a=>{if(u.value=!0,c("recaptcha_active")==="1"){const t=await M();o.recaptcha_response=t}o.post("/login",{onSuccess:()=>o.reset(),onFinish:()=>{u.value=!1}})},M=()=>new Promise(a=>{grecaptcha.ready(()=>{grecaptcha.execute(c("recaptcha_site_key"),{action:"submit"}).then(t=>{a(t)})})});return j(()=>{c("recaptcha_active")==="1"&&N(c("recaptcha_site_key"))}),B(()=>{L(c("recaptcha_site_key"))}),F(()=>[_().props.flash,{deep:!0}],()=>{_().props.flash.status!=null&&S(_().props.flash.status.message,{autoClose:3e3})}),(a,t)=>{var m,x,v,b;return i(),n("div",{class:y(s(V))},[e("div",T,[e("div",U,[e("div",Z,[e("div",D,[d(s(w),{href:"/"},{default:h(()=>[r.companyConfig.logo?(i(),n("img",{key:0,class:"max-w-[180px]",src:"/media/"+r.companyConfig.logo,alt:r.companyConfig.company_name},null,8,E)):(i(),n("h4",K,l(r.companyConfig.company_name),1))]),_:1})]),e("h1",P,l(a.$t("Login to your account")),1),e("div",G,[g(l(a.$t("Don't have an account?"))+" ",1),d(s(w),{href:"signup",class:"text-sm text-primary-600 dark:text-primary-500 border-b hover:border-gray-500"},{default:h(()=>[g(l(a.$t("Create one here")),1)]),_:1})]),e("form",{onSubmit:t[2]||(t[2]=R(p=>A(),["prevent"])),class:"mt-5"},[e("div",O,[d(k,{modelValue:s(o).email,"onUpdate:modelValue":t[0]||(t[0]=p=>s(o).email=p),name:a.$t("Email"),error:s(o).errors.email,type:"email",class:y("col-span-3")},null,8,["modelValue","name","error"]),d(k,{modelValue:s(o).password,"onUpdate:modelValue":t[1]||(t[1]=p=>s(o).password=p),name:a.$t("Password"),error:s(o).errors.password,type:"password",class:y("col-span-3")},null,8,["modelValue","name","error"]),s(o).errors.recaptcha_response?(i(),n("div",Q,l(s(o).errors.recaptcha_response),1)):f("",!0)]),e("div",I,[e("div",J,[t[3]||(t[3]=e("div",{class:"flex items-center h-5"},[e("input",{id:"remember","aria-describedby":"remember",type:"checkbox",class:"w-4 h-4 border border-gray-300 rounded bg-gray-50 focus:ring-3 focus:ring-primary-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-primary-600 dark:ring-offset-gray-800"})],-1)),e("div",W,[e("label",X,l(a.$t("Remember me")),1)])]),d(s(w),{href:"/forgot-password",class:"text-sm text-primary-600 dark:text-primary-500 border-b hover:border-gray-500"},{default:h(()=>[g(l(a.$t("Forgot password?")),1)]),_:1})]),e("div",Y,[u.value?(i(),n("button",te,t[4]||(t[4]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"}),e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})])],-1)]))):(i(),n("button",ee,l(a.$t("Login to your account")),1))])],32),((m=r.companyConfig)==null?void 0:m.allow_facebook_login)==="1"||((x=r.companyConfig)==null?void 0:x.allow_google_login)==="1"?(i(),n("div",ae,[e("span",se,l(a.$t("Or continue with")),1)])):f("",!0),e("div",oe,[((v=r.companyConfig)==null?void 0:v.allow_facebook_login)==="1"?(i(),n("a",re,t[5]||(t[5]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 256 256"},[e("path",{fill:"#1877F2",d:"M256 128C256 57.308 198.692 0 128 0C57.308 0 0 57.307 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.347-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.958 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445"}),e("path",{fill:"#FFF",d:"m177.825 165l5.675-37H148v-24.01C148 93.866 152.959 84 168.86 84H185V52.5S170.352 50 156.347 50C127.11 50 108 67.72 108 99.8V128H75.5v37H108v89.445A128.959 128.959 0 0 0 128 256a128.9 128.9 0 0 0 20-1.555V165h29.825"})],-1)]))):f("",!0),((b=r.companyConfig)==null?void 0:b.allow_google_login)==="1"?(i(),n("a",ne,t[6]||(t[6]=[z('<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 128 128"><path fill="#fff" d="M44.59 4.21a63.28 63.28 0 0 0 4.33 120.9a67.6 67.6 0 0 0 32.36.35a57.13 57.13 0 0 0 25.9-13.46a57.44 57.44 0 0 0 16-26.26a74.33 74.33 0 0 0 1.61-33.58H65.27v24.69h34.47a29.72 29.72 0 0 1-12.66 19.52a36.16 36.16 0 0 1-13.93 5.5a41.29 41.29 0 0 1-15.1 0A37.16 37.16 0 0 1 44 95.74a39.3 39.3 0 0 1-14.5-19.42a38.31 38.31 0 0 1 0-24.63a39.25 39.25 0 0 1 9.18-14.91A37.17 37.17 0 0 1 76.13 27a34.28 34.28 0 0 1 13.64 8q5.83-5.8 11.64-11.63c2-2.09 4.18-4.08 6.15-6.22A61.22 61.22 0 0 0 87.2 4.59a64 64 0 0 0-42.61-.38z"></path><path fill="#e33629" d="M44.59 4.21a64 64 0 0 1 42.61.37a61.22 61.22 0 0 1 20.35 12.62c-2 2.14-4.11 4.14-6.15 6.22Q95.58 29.23 89.77 35a34.28 34.28 0 0 0-13.64-8a37.17 37.17 0 0 0-37.46 9.74a39.25 39.25 0 0 0-9.18 14.91L8.76 35.6A63.53 63.53 0 0 1 44.59 4.21z"></path><path fill="#f8bd00" d="M3.26 51.5a62.93 62.93 0 0 1 5.5-15.9l20.73 16.09a38.31 38.31 0 0 0 0 24.63q-10.36 8-20.73 16.08a63.33 63.33 0 0 1-5.5-40.9z"></path><path fill="#587dbd" d="M65.27 52.15h59.52a74.33 74.33 0 0 1-1.61 33.58a57.44 57.44 0 0 1-16 26.26c-6.69-5.22-13.41-10.4-20.1-15.62a29.72 29.72 0 0 0 12.66-19.54H65.27c-.01-8.22 0-16.45 0-24.68z"></path><path fill="#319f43" d="M8.75 92.4q10.37-8 20.73-16.08A39.3 39.3 0 0 0 44 95.74a37.16 37.16 0 0 0 14.08 6.08a41.29 41.29 0 0 0 15.1 0a36.16 36.16 0 0 0 13.93-5.5c6.69 5.22 13.41 10.4 20.1 15.62a57.13 57.13 0 0 1-25.9 13.47a67.6 67.6 0 0 1-32.36-.35a63 63 0 0 1-23-11.59A63.73 63.73 0 0 1 8.75 92.4z"></path></svg>',1)]))):f("",!0)])])])])],2)}}};export{fe as default};