import{c as I,j as t,F as N,H as y}from"./app-BiexncSX.js";import{B as F}from"./button-Cwvd_D5X.js";import{C as v}from"./checkbox-bf04Eqki.js";import{I as h}from"./input-C7geQw3H.js";import{L as u}from"./label-BACPLsln.js";import{S as L}from"./spinner-BshPoFqP.js";import{A as S}from"./auth-layout-c0K9oGz2.js";import{q as _,r as q}from"./index-DDBh_SM-.js";import{r as E}from"./index-CnKF3dz0.js";import{I as j}from"./input-error-BizLhD6E.js";import{T as g}from"./text-link-CyXb2ykj.js";/* empty css            */import"./utils-DvRnx1Xn.js";import"./check-Do_LJdyj.js";import"./createLucideIcon-CiyItOCI.js";import"./index-BKRdUh5V.js";import"./index-Crj9qdjp.js";import"./index-BxgPClSG.js";import"./index-CqDcnRSI.js";import"./index-Dql7-O7m.js";import"./index-BLf-KPWz.js";import"./loader-circle-C36m3ppM.js";import"./index-mwCShWhl.js";const s=r=>({url:s.url(r),method:"post"});s.definition={methods:["post"],url:"/login"};s.url=r=>s.definition.url+_(r);s.post=r=>({url:s.url(r),method:"post"});const b=r=>({action:s.url(r),method:"post"});b.post=r=>({action:s.url(r),method:"post"});s.form=b;Object.assign(s,s);function ee(r){const e=I.c(11),{status:m,canResetPassword:c,canRegister:p}=r;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(y,{title:"Log in"}),e[0]=i):i=e[0];let l,n;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.form(),n=["password"],e[1]=l,e[2]=n):(l=e[1],n=e[2]);let o;e[3]!==p||e[4]!==c?(o=t.jsx(N,{...l,resetOnSuccess:n,className:"flex flex-col gap-6",children:w=>{const{processing:x,errors:f}=w;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-6",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(u,{htmlFor:"email",children:"Email address"}),t.jsx(h,{id:"email",type:"email",name:"email",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"email",placeholder:"email@example.com"}),t.jsx(j,{message:f.email})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx(u,{htmlFor:"password",children:"Password"}),c&&t.jsx(g,{href:E(),className:"ml-auto text-sm",tabIndex:5,children:"Forgot password?"})]}),t.jsx(h,{id:"password",type:"password",name:"password",required:!0,tabIndex:2,autoComplete:"current-password",placeholder:"Password"}),t.jsx(j,{message:f.password})]}),t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(v,{id:"remember",name:"remember",tabIndex:3}),t.jsx(u,{htmlFor:"remember",children:"Remember me"})]}),t.jsxs(F,{type:"submit",className:"mt-4 w-full",tabIndex:4,disabled:x,"data-test":"login-button",children:[x&&t.jsx(L,{}),"Log in"]})]}),p&&t.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",t.jsx(g,{href:q(),tabIndex:5,children:"Sign up"})]})]})}}),e[3]=p,e[4]=c,e[5]=o):o=e[5];let a;e[6]!==m?(a=m&&t.jsx("div",{className:"mb-4 text-center text-sm font-medium text-green-600",children:m}),e[6]=m,e[7]=a):a=e[7];let d;return e[8]!==o||e[9]!==a?(d=t.jsxs(S,{title:"Log in to your account",description:"Enter your email and password below to log in",children:[i,o,a]}),e[8]=o,e[9]=a,e[10]=d):d=e[10],d}export{ee as default};
