1import{c as h,j as t,s as l}from"./main-B85zqRjd.js";import{d as E,a as i,L as y}from"./vendor-react-Bjxsyr_G.js";import{I as A}from"./Input-D8QKTzdn.js";import{B as D}from"./Button-xfGKx8Ra.js";import{c as b,a as v}from"./vendor-forms-Chlqk9RW.js";import{D as F}from"./vendor-redux-CkTbKByD.js";import{c as N,v as G}from"./validation-g0OSJvn7.js";import{u as P,i as j}from"./vendor-i18n-CmmgQqfv.js";const f=b().shape({email:v().trim().email().required()}),I={email:""},O={email:"FORGOT_PASSWORD.YOUR_EMAIL"};function K(){const p=E(),{t:s}=P(),r=F(),[x,{isLoading:c}]=h(),[o,R]=i.useState(I),[T,m]=i.useState({}),[d,u]=i.useState(!1),S=i.useMemo(()=>N(f,O,m),[]),g=i.useCallback((a,n)=>{const e={...o,[a]:n};R(e),S(a,e)},[o,S]),_=async()=>{const{isValid:a,errors:n}=await G(f,o,{labelKeys:O,abortEarly:!1});if(m(n),!!a)try{u(!0);const e=await x({email:o.email}).unwrap();e.code==="200"&&(r(l({notification:"PASSWORD.SENT",notificationColor:"green",forTranslation:!0})),p("/login")),e.code==="404"&&r(l({notification:"FORGOT_PASSWORD.USER_DOES_NOT_EXIST_MASSAGE",notificationColor:"red",forTranslation:!0}))}catch(e){r(l({notification:typeof e=="string"?e:"FORGOT_PASSWORD.USER_DOES_NOT_EXIST_MASSAGE",notificationColor:"red",forTranslation:!0}))}finally{u(!1)}};return t.jsxs("div",{className:"w-full max-w-[770px] mx-auto",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"font-bold text-[14px] leading-5 text-[var(--mdn-text-strong)]",children:s("FORGOT_PASSWORD.FORGOT_PASSWORD")}),j.exists("FORGOT_PASSWORD.SUBTITLE")&&t.jsx("p",{className:"mt-2 text-[13px] leading-5 text-[var(--mdn-text-secondary)]",children:s("FORGOT_PASSWORD.SUBTITLE")})]}),t.jsxs("form",{className:"mt-6 space-y-6",onSubmit:a=>{a.preventDefault(),_()},noValidate:!0,children:[t.jsx(A,{placeholder:s("FORGOT_PASSWORD.YOUR_EMAIL"),name:"email",type:"email",value:o.email,onChange:a=>g("email",a.target.value),autoComplete:"email",error:T.email,inputClassName:"h-14"}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(y,{to:"/login",className:"underline text-[14.4px] font-normal leading-[21.6px] text-[var(--mdn-text-secondary)]",style:{fontFamily:"Roboto, sans-serif"},children:s("FORGOT_PASSWORD.BACK_TO_LOGIN")}),t.jsx(D,{type:"submit",disabled:d||c,loading:d||c,children:s("LOGIN.SUBMIT")})]})]})]})}export{K 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.