PageSourceSearch

https://estaie.com/build/assets/LoginEmailPhone-BX0x54tk.js

js estaie.com collected 2026-10-01 16:37:45 UTC 5,157 bytes, 1 lines download raw bytes

1import{L,e as _,x as V,H as U,d as f,o as p,a,n as i,u as o,t as d,f as b,g as T,F as C,h as B,c as D,w as H,I as v,N as M,b as y,J as h,ah as P,k as G}from"./app-BvX0wXJU.js";import{u as j}from"./useLocale-BkHdFk5i.js";import{A as q,a as S,F as x,r as n}from"./store-6rA-1QnX.js";import I from"./country_phone_codes-C3Q5OVnP.js";import{_ as W}from"./AuthTypeButton-Dnw9_2_V.js";import{r as z,O as Y}from"./url-B08cuRnd.js";import{u as J}from"./useAnalytics-C27pRcT6.js";import{E as $}from"./events-F68Qreji.js";const K=["dir"],Q=["dir"],X={class:"flex mb-4 border border-gray-300 rounded-lg overflow-hidden"},Z={key:0},ee=["placeholder"],te={key:1},oe={class:"flex mb-2"},fe={__name:"LoginEmailPhone",setup(ne){const{isRTL:l}=j(),{trackEvent:w}=J(),u=L(q);_(I);const c=_(!1);_(I[0].dial_code);const s=L({email:"",phone_number:""}),m=_({OTP:!1,PASSWORD:!1}),E=()=>{Object.keys(m.value).forEach(e=>m.value[e]=!1)},k=V(()=>Object.values(u).find(e=>e.active)),A=()=>{Object.values(u).forEach(e=>{e.active=!e.active,n.setField(e.slug,""),s[e.slug]=""})},F=()=>{s.email=s.phone_number="";let e=!1;return u.EMAIL.active&&!n.email&&(s.email="auth.this_field_is_required",e=!0),u.PHONE_NUMBER.active&&!n.phone_number&&(s.phone_number="auth.this_field_is_required",e=!0),e},N=e=>{if(F())return;n.action=x.LOGIN,n.identifier=k.value.slug,w($.LOGIN_LINK,{method:n.identifier,screen_name:"login_modal"}),w(n.identifier==="email"?$.AUTH_EMAIL:$.AUTH_PHONE,{method:n.identifier,screen_name:"login_modal",login_method:e});let t={otp:Y,password:z}[e];m.value[e.toUpperCase()]=!0,G.post(t,{identifier:n.identifier,email:n.email||null,phone_number:n.phone_number||null}).then(g=>{E();let r=e==="otp"?x.OTP_VERIFICATION:x.PASSWORD_LOGIN;S.setForm(r)}).catch(g=>{s[n.identifier]=g.response.data.message,E()})},R=()=>{setTimeout(()=>{const e=document.querySelector(".vti__dropdown-list");e&&(e.style.top="-200px")},5)};return(e,t)=>{const g=U("vue-tel-input");return p(),f(C,null,[a("div",{class:"relative flex justify-center items-center pb-4 mx-3",dir:o(l)?"rtl":"ltr"},[a("button",{onClick:t[0]||(t[0]=r=>e.$emit("close")),class:i(["absolute text-gray-400 hover:text-gray-600 text-3xl",[o(l)?"right-0":"left-0"]])},"×",2),a("h2",{class:i(["text-lg font-normal text-center",[o(l)?"font-somar":"font-alexandria"]])},d(e.$t("auth.log_in")),3)],8,K),t[11]||(t[11]=a("hr",null,null,-1)),a("div",{class:"mt-5",dir:o(l)?"rtl":"ltr"},[a("p",{class:i(["text-2xl font-medium mb-2",[o(l)?"text-right font-somar":"text-left font-alexandria"]])},d(e.$t("auth.welcome")),3),a("p",{class:i(["text-sm text-gray-600 mb-4",[o(l)?"text-right font-somar":"text-left font-alexandria"]])},[T(d(e.$t("auth.don't_have_an_account"))+" ",1),a("span",{onClick:t[1]||(t[1]=r=>o(S).setForm(o(x).SIGN_UP)),class:"text-[#8c2ee0] font-medium cursor-pointer hover:underline"},d(e.$t("auth.sign_up")),1)],2),a("div",X,[(p(!0),f(C,null,B(u,(r,O)=>(p(),D(W,{key:O,active:u[O].active,onClick:t[2]||(t[2]=re=>A())},{default:H(()=>[T(d(e.$t(u[O].text)),1)]),_:2},1032,["active"]))),128))]),u.EMAIL.active?(p(),f("div",Z,[v(a("input",{"onUpdate:modelValue":t[3]||(t[3]=r=>o(n).email=r),type:"email",placeholder:e.$t("auth.email"),class:i(["w-full px-4 py-3 mb-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500",[{"ring-1 ring-red-600 border-red-600 ring-offset-0":s.email},o(l)?"text-right font-somar":"text-left font-alexandria"]])},null,10,ee),[[M,o(n).email]]),s.email?(p(),f("p",{key:0,class:i(["text-md text-red-600 mb-3",[o(l)?"text-right font-somar":"text-left font-alexandria"]])},d(e.$t(s.email)),3)):b("",!0)])):b("",!0),u.PHONE_NUMBER.active?(p(),f("div",te,[a("div",oe,[y(g,{class:i(["w-full !border-gray-300 !rounded-md z-50 capitalize",{"!border-purple-500 !ring-purple-500 select-focus":c.value}]),modelValue:o(n).phone_number,"onUpdate:modelValue":t[4]||(t[4]=r=>o(n).phone_number=r),mode:"international",inputOptions:{name:"phone_number",placeholder:e.$t("auth.whatsapp_number"),styleClasses:"py-2.5 !rounded-r-md !border-purple-500 !ring-purple-500 ",required:!0},onFocus:t[5]||(t[5]=r=>c.value=!0),onBlur:t[6]||(t[6]=r=>c.value=!1),onOpen:R,onClose:t[7]||(t[7]=r=>c.value=!1),onCountryChanged:t[8]||(t[8]=r=>o(n).phone_code=r.dialCode)},null,8,["modelValue","inputOptions","class"])]),s.phone_number?(p(),f("p",{key:0,class:i(["text-md text-red-600 mb-2",[o(l)?"text-right font-somar":"text-left font-alexandria"]
1])},d(e.$t(s.phone_number)),3)):b("",!0)])):b("",!0),a("button",{class:i(["w-full bg-[#8c2ee0] text-white font-medium py-3 rounded-lg mb-2 hover:opacity-90 transition",[o(l)?"font-somar":"font-alexandria"]]),onClick:t[9]||(t[9]=r=>N("otp"))},[v(y(P,null,null,512),[[h,m.value.OTP]]),v(a("span",null,d(e.$t("auth.log_in_via_otp")),513),[[h,!m.value.OTP]])],2),a("button",{class:i(["w-full text-[#8c2ee0] font-medium py-3 border border-purple-500 rounded-lg mb-4 hover:bg-purple-50 transition",[o(l)?"font-somar":"font-alexandria"]]),onClick:t[10]||(t[10]=r=>N("password"))},[v(y(P,null,null,512),[[h,m.value.PASSWORD]]),v(a("span",null,d(e.$t("auth.log_in_via_password")),513),[[h,!m.value.PASSWORD]])],2)],8,Q)],64)}}};export{fe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.