import{An as e,Bt as t,Ct as n,Et as r,Ht as i,Mt as a,Nn as o,On as s,Qt as c,Tt as l,Zt as u,_n as d,_t as f,an as p,dn as m,en as h,jn as g,jt as _,on as v,rn as y,wn as b}from"./app-4kCgdoJR.js";var x={class:`mb-4 text-sm text-gray-600 dark:text-gray-400`},S={key:0},C={key:1},w={class:`mt-4 flex items-center justify-end`},T={__name:`TwoFactorChallenge`,setup(T){let E=s(!1),D=i({code:``,recovery_code:``}),O=s(null),k=s(null),A=async()=>{E.value^=!0,await m(),E.value?(O.value.focus(),D.code=``):(k.value.focus(),D.recovery_code=``)},j=()=>{D.post(route(`two-factor.login`))};return(i,s)=>(d(),y(c,null,[v(e(t),{title:i.$t(`Two-factor Confirmation`)},null,8,[`title`]),v(a,null,{logo:b(()=>[v(_)]),default:b(()=>[h(`div`,x,[E.value?(d(),y(c,{key:1},[p(o(i.$t(`Please confirm access to your account by entering one of your emergency recovery codes.`)),1)],64)):(d(),y(c,{key:0},[p(o(i.$t(`Please confirm access to your account by entering the authentication code provided by your authenticator application.`)),1)],64))]),h(`form`,{onSubmit:u(j,[`prevent`])},[E.value?(d(),y(`div`,C,[v(f,{for:`recovery_code`,value:i.$t(`Recovery Code`)},null,8,[`value`]),v(n,{type:`text`,id:`recovery_code`,ref_key:`recoveryCodeInput`,ref:O,class:`mt-1 block w-full`,autocomplete:`one-time-code`,modelValue:e(D).recovery_code,"onUpdate:modelValue":s[1]||=t=>e(D).recovery_code=t},null,8,[`modelValue`]),v(r,{class:`mt-2`,message:e(D).errors.recovery_code},null,8,[`message`])])):(d(),y(`div`,S,[v(f,{for:`code`,value:i.$t(`Code`)},null,8,[`value`]),v(n,{id:`code`,autofocus:``,type:`text`,ref_key:`codeInput`,ref:k,modelValue:e(D).code,"onUpdate:modelValue":s[0]||=t=>e(D).code=t,inputmode:`numeric`,class:`mt-1 block w-full`,autocomplete:`one-time-code`},null,8,[`modelValue`]),v(r,{class:`mt-2`,message:e(D).errors.code},null,8,[`message`])])),h(`div`,w,[h(`button`,{type:`button`,class:`cursor-pointer text-sm text-gray-600 underline hover:text-gray-900 dark:text-gray-400`,onClick:u(A,[`prevent`])},[E.value?(d(),y(c,{key:1},[p(o(i.$t(`Use an authentication code`)),1)],64)):(d(),y(c,{key:0},[p(o(i.$t(`Use a recovery code`)),1)],64))]),v(l,{class:g([`ms-4`,{"opacity-25":e(D).processing}]),disabled:e(D).processing},{default:b(()=>[p(o(i.$t(`Log in`)),1)]),_:1},8,[`class`,`disabled`])])],32)]),_:1})],64))}};export{T as default};