import{d as C,p as _,w as S,W as D,C as $,c as b,o as w,b as s,a as u,j as c,t as a,u as t,P as f,e as k,g as V,v as M,J as A,ai as F,f as y}from"./app-BidmlC59.js";import{_ as N}from"./AuthLayout.vue_vue_type_script_setup_true_lang-CPjzewGg.js";import{_ as T}from"./NumInput.vue_vue_type_script_setup_true_lang-CS-UhFwo.js";import{u as B}from"./useRandomStr-7r5tQ8Eq.js";import"./useToastify-Bhe2cyz3.js";import"./useHexToRgb-Crf73LpK.js";/* empty css            */const I=(h,n,d)=>{var m=h*1e3;let r=()=>{var i=new Date().getTime(),l=m-i,g=Math.floor(l%(1e3*60*60)/(1e3*60)),e=Math.floor(l%(1e3*60)/1e3);n.value=("0"+g).slice(-2)+":"+("0"+e).slice(-2),l<0&&(clearInterval(v),n.value="00:00"),Math.floor(l/1e3)<60&&(d.value=!0)};r();var v=setInterval(r,1e3)},L={class:"auth-container"},P={class:"logo-container"},R=["src","alt"],U={key:1},W={class:"card shadow-1"},j={class:"card-body"},E={class:"auth-title lts-05"},J={class:"timer"},q=["textContent"],z=["disabled"],G={class:"send-again"},H={class:"form-element-row mb-3"},K=["disabled"],O={class:"form-element-row"},Q={class:"edit-phone lts-05"},X={class:"auth-footer"},ne=C({layout:N,__name:"Verify",props:{phone:{},remaining:{},prev:{}},setup(h){const n=h,d=_(""),m=_(!1);I(n.remaining,d,m),S(d,e=>{e==="00:00"&&D.get(route("login"))});const r=$({phone:n.phone,prev:n.prev}),v=()=>{r.post(route("login.process"),{preserveState:!1,replace:!0})};let i=_();const l=$({code:null,phone:n.phone,prev:n.prev}),g=()=>{l.transform(e=>({code:i.value,phone:e.phone,prev:n.prev})).post(route("login.do"),{replace:!0})};return(e,o)=>(w(),b("div",L,[s("div",P,[u(t(f),{class:"logo",href:e.route("index")},{default:c(()=>[e.$page.props.appLogo!=null?(w(),b("img",{key:0,src:e.$page.props.appLogo,alt:e.$page.props.appFullName},null,8,R)):(w(),b("span",U,a(e.$t("messages.word.logo")),1))]),_:1},8,["href"])]),s("div",W,[s("div",j,[s("div",E,a(e.$t("messages.sentence.enter_authentication_code")),1),s("form",{class:"d-block",onSubmit:k(v,["prevent"])},[s("div",J,[s("span",{textContent:a(d.value)},null,8,q),V(s("input",{type:"hidden",name:"phone","onUpdate:modelValue":o[0]||(o[0]=p=>t(r).phone=p),disabled:t(r).processing},null,8,z),[[M,t(r).phone]]),s("div",G,[V(s("button",{class:"link"},a(e.$t("messages.sentence.send_again")),513),[[A,m.value]])])])],32),s("form",{onSubmit:o[2]||(o[2]=k(p=>g(),["prevent"])),class:"auth-form"},[u(T,{class:"token-input mb-4 mt-3",placeholder:"- - - - -",type:"tel",inputmode:"numeric",autocomplete:"off",name:t(B)(15),maxlength:"5",modelValue:t(i),"onUpdate:modelValue":o[1]||(o[1]=p=>F(i)?i.value=p:i=p),autofocus:""},null,8,["name","modelValue"]),s("div",H,[s("button",{class:"btn btn-primary",type:"submit",disabled:t(l).processing},a(e.$t("messages.word.continue")),9,K)]),s("div",O,[s("div",Q,[u(t(f),{href:e.route("login",{prev:e.prev}),class:"link"},{default:c(()=>[o[3]||(o[3]=s("i",{class:"ri-pencil-line"},null,-1)),y(" "+a(e.$t("messages.sentence.edit_phone_number")),1)]),_:1},8,["href"])])])],32)])]),s("div",X,[u(t(f),{href:e.route("index"),class:"lts-05"},{default:c(()=>[y(a(e.$t("messages.sentence.home_page")),1)]),_:1},8,["href"]),o[4]||(o[4]=s("span",null,null,-1)),u(t(f),{href:e.route("main.products.index"),class:"lts-05"},{default:c(()=>[y(a(e.$t("messages.sentence.product_archive")),1)]),_:1},8,["href"])])]))}});export{ne as default};
