import{_ as v}from"./InputError.vue_vue_type_script_setup_true_lang-DdeTGBeo.js";import{_ as y}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-BbjSNLws.js";import{_ as V}from"./Input.vue_vue_type_script_setup_true_lang-C7QVdt1n.js";import{_ as B,a as j,b as E}from"./PinInputSlot.vue_vue_type_script_setup_true_lang-Bedq0drf.js";import{_ as F}from"./AuthLayout.vue_vue_type_script_setup_true_lang-BdrbOdWi.js";import{s as g}from"./index-C0lT1AXe.js";import{d as A,c as x,A as b,g as f,o as d,w as a,e as n,b as o,u as t,h as N,j as h,m as C,a as R,F as P,B as q,i as k,t as w}from"./app-D_cNhTOt.js";import"./useForwardExpose-4P0NPntM.js";import"./VisuallyHidden-V0BOAZdg.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./VisuallyHiddenInput-t2vCllEx.js";import"./index-Z7dItZLR.js";const D={class:"space-y-6"},I=["value"],L={class:"flex flex-col items-center justify-center space-y-3 text-center"},M={class:"flex w-full items-center justify-center"},S={class:"text-center text-sm text-muted-foreground"},U=["onClick"],z={class:"text-center text-sm text-muted-foreground"},G=["onClick"],ae=A({__name:"TwoFactorChallenge",setup(H){const l=x(()=>r.value?{title:"Recovery Code",description:"Please confirm access to your account by entering one of your emergency recovery codes.",toggleText:"login using an authentication code"}:{title:"Authentication Code",description:"Enter the authentication code provided by your authenticator application.",toggleText:"login using a recovery code"}),r=b(!1),p=_=>{r.value=!r.value,_(),s.value=[]},s=b([]),$=x(()=>s.value.join(""));return(_,e)=>(d(),f(F,{title:l.value.title,description:l.value.description},{default:a(()=>[n(t(N),{title:"Two-Factor Authentication"}),o("div",D,[r.value?(d(),f(t(h),C({key:1},t(g).form(),{class:"space-y-4","reset-on-error":""}),{default:a(({errors:i,processing:u,clearErrors:c})=>[n(t(V),{name:"recovery_code",type:"text",placeholder:"Enter recovery code",autofocus:r.value,required:""},null,8,["autofocus"]),n(v,{message:i.recovery_code},null,8,["message"]),n(t(y),{type:"submit",class:"w-full",disabled:u},{default:a(()=>[...e[4]||(e[4]=[k("Continue",-1)])]),_:1},8,["disabled"]),o("div",z,[e[5]||(e[5]=o("span",null,"or you can ",-1)),o("button",{type:"button",class:"text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",onClick:()=>p(c)},w(l.value.toggleText),9,G)])]),_:1},16)):(d(),f(t(h),C({key:0},t(g).form(),{class:"space-y-4","reset-on-error":"",onError:e[1]||(e[1]=i=>s.value=[])}),{default:a(({errors:i,processing:u,clearErrors:c})=>[o("input",{type:"hidden",name:"code",value:$.value},null,8,I),o("div",L,[o("div",M,[n(t(B),{id:"otp",placeholder:"○",modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=m=>s.value=m),type:"number",otp:""},{default:a(()=>[n(t(j),null,{default:a(()=>[(d(),R(P,null,q(6,(m,T)=>n(t(E),{key:m,index:T,disabled:u,autofocus:""},null,8,["index","disabled"])),64))]),_:2},1024)]),_:2},1032,["modelValue"])]),n(v,{message:i.code},null,8,["message"])]),n(t(y),{type:"submit",class:"w-full",disabled:u},{default:a(()=>[...e[2]||(e[2]=[k("Continue",-1)])]),_:1},8,["disabled"]),o("div",S,[e[3]||(e[3]=o("span",null,"or you can ",-1)),o("button",{type:"button",class:"text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",onClick:()=>p(c)},w(l.value.toggleText),9,U)])]),_:1},16))])]),_:1},8,["title","description"]))}});export{ae as default};
