1import{r as i,j as o}from"./vendor-CsU8PxtL.js";import{S as g,C as u,h,P as e,T as s,R as v}from"./index-Hb-QEWeL.js";import{s as C}from"./supabaseClient-jSFfprWL.js";import{g as t}from"./ui-BKMfFSo-.js";import{u as I}from"./i18n-BQf3qJp9.js";import{d as P}from"./router-CLZz2qll.js";import"./wix-mc1Ndo1N.js";import"./supabase-C6pgQ0vL.js";const w=t.div.withConfig({displayName:"ForgotPassword__FormContainer",componentId:"sc-j62w11-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;max-width:400px;width:100%;padding:0 1rem;"]),F=t.form.withConfig({displayName:"ForgotPassword__Form",componentId:"sc-j62w11-1"})(["width:100%;display:flex;flex-direction:column;gap:1rem;"]),S=t.div.withConfig({displayName:"ForgotPassword__InputGroup",componentId:"sc-j62w11-2"})(["display:flex;flex-direction:column;align-items:flex-start;width:100%;"]),k=t.label.withConfig({displayName:"ForgotPassword__Label",componentId:"sc-j62w11-3"})(["font-size:0.875rem;font-weight:600;color:var(--color-black);margin-bottom:0.5rem;"]),E=t.input.withConfig({displayName:"ForgotPassword__Input",componentId:"sc-j62w11-4"})(["width:100%;padding:0.85rem 1rem;border:2px solid var(--color-gray-light,#e0e0e0);border-radius:8px;font-size:1rem;transition:border-color 0.2s ease;box-sizing:border-box;&:focus{outline:none;border-color:var(--color-primary);}&::placeholder{color:var(--color-gray,#999);}"]),$=t.span.withConfig({displayName:"ForgotPassword__ErrorText",componentId:"sc-j62w11-5"})(["color:var(--color-error,#dc3545);font-size:0.8rem;margin-top:0.25rem;text-align:left;"]),T=t.button.withConfig({displayName:"ForgotPassword__SubmitButton",componentId:"sc-j62w11-6"})(["background:var(--color-primary);color:var(--color-white);border:2px solid var(--color-primary);padding:0.85rem 1.5rem;border-radius:25000px;font-size:0.875rem;font-weight:600;cursor:pointer;transition:0.2s ease;margin-top:0.5rem;&:hover:not(:disabled){background:var(--color-secondary);border-color:var(--color-secondary);color:var(--color-white);}&:disabled{opacity:0.6;cursor:not-allowed;}@media (max-width:768px){padding:0.75rem 1.5rem;font-size:0.9rem;}"]),N=t.div.withConfig({displayName:"ForgotPassword__IconContainer",componentId:"sc-j62w11-7"})(["display:flex;align-items:center;justify-content:center;width:60px;height:60px;border-radius:50%;background:var(--color-primary);margin:0 auto;"]),z=t.div.withConfig({displayName:"ForgotPassword__CheckIcon",componentId:"sc-j62w11-8"})(["color:var(--color-white);font-size:2.25rem;font-weight:600;line-height:1;"]),R=t.a.withConfig({displayName:"ForgotPassword__ContactLink",componentId:"sc-j62w11-9"})(["color:var(--color-primary);text-decoration:none;font-weight:600;&:hover{text-decoration:underline;}"]),D=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,U=()=>{const{t:r}=I(),[f]=P(),[x,b]=i.useState("form"),[a,j]=i.useState(f.get("email")??""),[m,n]=i.useState(),[c,p]=i.useState(!1),_=async l=>{l.preventDefault();const d=a.trim();if(!d){n(r("forgot_password.validations.required"));return}if(!D.test(d)){n(r("forgot_password.validations.invalid"));return}n(void 0),p(!0);const y=`${window.location.origin}${v.AUTH_RESET_PASSWORD}`;await C.auth.resetPasswordForEmail(d,{redirectTo:y}),p(!1),b("success")};return x==="success"?o.jsx(g,{backgroundColor:"--color-white",color:"--color-black",paddingTop:"2rem",paddingBottom:"2rem",children:o.jsx(u,{children:o.jsx(h,{$direction:"column",$align:"center",$justify:"center",children:o.jsxs(w,{children:[o.jsx(N,{children:o.jsx(z,{children:"â"})}),o.jsx(e,{top:"1.5rem",bottom:"0.75rem"}),o.jsx(s.Title,{$color:"--color-primary",children:r("forgot_password.success.title")}),o.jsx(e,{top:"1rem",bottom:"1rem"}),o.jsx(s.Description,{$color:"--color-black",children:r("forgot_password.success.description",{email:a})})]})})})}):o.jsx(g,{backgroundColor:"--color-white",color:"--color-black",paddingTop:"2rem",paddingBottom:"2rem",children:o.jsx(u,{children:o.jsx(h,{$direction:"column",$align:"center",$justify:"center",children:o.jsxs(w,{children:[o.jsx(s.Title,{$color:"--color-primary",children:r("forgot_password.title")}),o.jsx(e,{top:"1rem",bottom:"1.5rem"}),o.jsx(s.Description,{$color:"--color-black",children:r("forgot_password.description")}),o.jsx(e,{top:"1.5rem",bottom:"0"}),o.jsxs(F,{onSubmit:_,children:[o.jsxs(S,{children:[o.jsx(k,{htmlFor:"email",children:r("forgot_password.email")}),o.jsx(E,{id:"email",type:"email",value:a,onChange:l=>j(l.target.value),placeholder:r("forgot_password.inputs.email.placeholder"),disabled:c,autoComplete:"email"}),m&&o.jsx($,{children:m})]}
1),o.jsx(T,{type:"submit",disabled:c,children:c?"...":r("forgot_password.submit")})]}),o.jsx(e,{top:"2rem",bottom:"0"}),o.jsxs(s.Description,{$color:"--color-black",children:[r("forgot_password.need_assistance")," ",o.jsxs(R,{href:"mailto:[email protected]",children:[r("forgot_password.contact_us")," [email protected]"]})]})]})})})})};export{U 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.