import{m as e,n as t,r as n}from"./createLucideIcon-P71pXhjD.js";import{t as r}from"./button-6mRKmJ-z.js";import{t as i}from"./key-round-xChpzTF4.js";import{d as a}from"./app-AaPQHUQ2.js";import{t as o}from"./input-error-BiLRn-Z7.js";import{t as s}from"./react-G_MR5P73.js";import{t as c}from"./spinner-CW5Oo-WE.js";var l=n(),u=t();function d(e){let t=(0,l.c)(24),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{routes:d,label:p,loadingLabel:m,separator:h}=n,g;t[2]===d?g=t[3]:(g=d&&{routes:{options:d.options.url,submit:d.submit.url}},t[2]=d,t[3]=g);let _;t[4]===g?_=t[5]:(_={...g,onSuccess:f},t[4]=g,t[5]=_);let{verify:v,isLoading:y,error:b,isSupported:x}=s(_);if(!x)return null;let S;t[6]===y?S=t[7]:(S=y?(0,u.jsx)(c,{}):(0,u.jsx)(i,{className:`h-4 w-4`}),t[6]=y,t[7]=S);let C=y?m??`Authenticating...`:p??`Sign in with a passkey`,w;t[8]!==y||t[9]!==S||t[10]!==C||t[11]!==v?(w=(0,u.jsxs)(r,{type:`button`,variant:`outline`,className:`w-full`,onClick:v,disabled:y,children:[S,C]}),t[8]=y,t[9]=S,t[10]=C,t[11]=v,t[12]=w):w=t[12];let T;t[13]===b?T=t[14]:(T=b&&(0,u.jsx)(o,{message:b,className:`text-center`}),t[13]=b,t[14]=T);let E;t[15]!==w||t[16]!==T?(E=(0,u.jsxs)(`div`,{className:`grid gap-2`,children:[w,T]}),t[15]=w,t[16]=T,t[17]=E):E=t[17];let D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,u.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,u.jsx)(a,{className:`w-full`})}),t[18]=D):D=t[18];let O=h??`Or continue with email`,k;t[19]===O?k=t[20]:(k=(0,u.jsxs)(`div`,{className:`relative my-6`,children:[D,(0,u.jsx)(`div`,{className:`relative flex justify-center text-xs uppercase`,children:(0,u.jsx)(`span`,{className:`bg-background px-2 text-muted-foreground`,children:O})})]}),t[19]=O,t[20]=k);let A;return t[21]!==k||t[22]!==E?(A=(0,u.jsxs)(u.Fragment,{children:[E,k]}),t[21]=k,t[22]=E,t[23]=A):A=t[23],A}function f(t){e.visit(t.redirect??`/dashboard`)}export{d as t};