1import{aF as j,a7 as F,u as l,aB as y,b1 as S,r as m,w as v,x as I,j as s,g as b}from"./index-DeSf6SGG.js";import{c as L,h as c,e as C,F as d,g as E}from"./object-BTAsHKtB.js";import{F as k}from"./FormLayout-Tn-9sxDL.js";import{L as z}from"./Layout-WvF2u-To.js";import{L as p}from"./Link-DqxDjFep.js";import"./errors-translation-GdLMd7G8.js";import"./logo-CxLB8LeI.js";const e=b("SignIn");function A(){const r=j(),h=F(),t=l(y),n=l(S).get("username")??"",{from:i="/"}=h.state||{},g=m.useCallback((x,f)=>t.signIn(x).then(()=>{v.event("login",{method:"onsite"}),r(i,{replace:!0})}).catch(a=>{let o="";throw a.code==="unauthorized"?o=e("Invalid username or password"):o=a.message,I.error(o),f.setFieldValue("password","",!1),a}),[t,i,r]),w=m.useMemo(()=>L().shape({username:c().required(e("Please enter your e-mail")).email(e("Invalid e-mail address")),password:c().required(e("Please enter your password"))}),[]),u=!!n;return s.jsx(z,{title:e("Log in"),children:s.jsx(C,{onSubmit:g,initialValues:{username:n,password:""},validationSchema:w,name:"log-in",children:s.jsxs(k,{children:[s.jsx(d,{name:"username",type:"email",label:e("E-mail"),autoFocus:!u}),s.jsx(d,{name:"password",type:"password",label:e("Password"),autoFocus:u,autoComplete:"current-password"}),s.jsx(E,{type:"submit",variant:"primary",size:"lg",fullSize:!0,isIgnoreValidation:!0,children:e("Continue")}),s.jsx(p,{href:"/reset-password",children:e("Forgot your password?")}),s.jsxs("div",{children:[s.jsx("span",{children:e("New to FINEX?")})," ",s.jsx(p,{href:"/sign-up",children:e("Create an account")}
1)]})]})})})}export{A as SignIn,A as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.