PageSourceSearch

https://maigon.ai/assets/ResetPassword-rca-yD5b.js

js maigon.ai collected 2026-10-02 01:12:50 UTC 7,186 bytes, 1 lines download raw bytes

1import{r as l,u as D,a as I,aT as z,b as q,j as e,B as U}from"./index-DuPzfAWx.js";import{I as w}from"./input-CcEGO1n2.js";import{L as b}from"./label-BJXX8ykR.js";import{L as M}from"./LocalizedLink-Cns-yZwL.js";import{L as O}from"./Logo-9g9nzmtd.js";import{L as j}from"./lock-C0lcDzgA.js";import{E as N,a as y}from"./eye-rKyuiJ7D.js";import{C as Z}from"./circle-check-big-D3DQ3FbH.js";import{C as $}from"./circle-alert-BDKyk_OH.js";function ee(){const[x,v]=l.useState(""),[m,C]=l.useState(""),[u,k]=l.useState(!1),[h,L]=l.useState(!1),[f,g]=l.useState(!1),[r,a]=l.useState(null),[n,P]=l.useState(!1),{updatePassword:S,session:c,authStatus:p}=D(),E=I(),[i]=z(),{t:s}=q();l.useEffect(()=>{const t=new URLSearchParams(window.location.hash.substring(1)),d=i.get("access_token")??t.get("access_token"),o=i.get("refresh_token")??t.get("refresh_token"),R=i.get("type")??t.get("type"),_=!!(i.get("code")||i.get("token_hash")),F=!!(c!=null&&c.access_token),T=!!(d&&o||R==="recovery"||_||F);p==="initializing"||p==="authenticating"||P(!T)},[p,i,c==null?void 0:c.access_token]);const A=t=>t.length<8?s("auth.common.passwordErrors.tooShort"):/(?=.*[a-z])/.test(t)?/(?=.*[A-Z])/.test(t)?/(?=.*\d)/.test(t)?null:s("auth.common.passwordErrors.noNumber"):s("auth.common.passwordErrors.noUppercase"):s("auth.common.passwordErrors.noLowercase"),B=async t=>{if(t.preventDefault(),a(null),n){a({type:"error",text:s("auth.reset.invalidLink")});return}if(x!==m){a({type:"error",text:s("auth.common.passwordErrors.mismatch")});return}const d=A(x);if(d){a({type:"error",text:d});return}g(!0);try{const o=await S(x);o.success?(a({type:"success",text:o.message}),setTimeout(()=>{E("/signin",{state:{message:s("auth.reset.successMessage")}})},2e3)):a({type:"error",text:o.message})}catch(o){a({type:"error",text:o.message||s("auth.common.unexpectedError")})}finally{g(!1)}};return e.jsx("div",{className:"min-h-screen bg-[#F9F8F8] flex items-center justify-center p-4 lg:p-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-8 lg:gap-[212px] w-full max-w-[1200px]",children:[e.jsxs("div",{className:"hidden lg:flex flex-col items-start gap-[75px] w-full lg:w-[474px] order-2 lg:order-1",children:[e.jsx("div",{className:"flex p-2.5 justify-center items-center gap-2.5 self-stretch",children:e.jsx("h1",{className:"text-[#313832] text-center font-lora text-4xl lg:text-[64px] font-medium leading-tight lg:leading-[90px]",children:s("auth.reset.title")})}),e.jsx("div",{className:"flex p-2.5 justify-center items-center gap-2.5",children:e.jsx("p",{className:"text-[#4B5563] text-center font-roboto text-base font-normal leading-6 tracking-[0.16px]",children:s("auth.reset.subtitle")})})]}),e.jsxs("div",{className:"flex w-full lg:w-[448px] py-14 flex-col items-center gap-12 lg:gap-8 order-1 lg:order-2",children:[e.jsx("div",{className:"w-full max-w-md mb-12 lg:mb-8",children:e.jsx(O,{size:"xl"})}),e.jsx("div",{className:"flex justify-center items-center self-stretch relative",children:e.jsxs("form",{onSubmit:B,className:"flex w-full lg:w-[448px] flex-col items-start gap-6 relative",children:[e.jsxs("div",{className:"flex w-full flex-col items-start gap-1",children:[e.jsx("div",{className:"flex h-5 py-[1.5px] pb-0.5 items-center self-stretch",children:e.jsx(b,{htmlFor:"password",className:"text-[#4B5563] font-roboto text-xs font-medium leading-5",children:s("auth.reset.newPassword")})}),e.jsxs("div",{className:"h-[50px] self-stretch relative",children:[e.jsx("div",{className:"inline-flex h-[50px] py-[15px] pl-3 pr-0 flex-col justify-center items-center flex-shrink-0 absolute left-0 top-0 w-8",children:e.jsx(j,{className:"w-5 h-5 text-[#9CA3AF]"})}),e.jsx(w,{id:"password",type:u?"text":"password",placeholder:"••••••••",value:x,onChange:t=>{v(t.target.value),r&&a(null)},className:"flex w-full h-[50px] py-[13px] pr-[50px] pl-[41px] items-center rounded-lg border border-[#D1D5DB] bg-white/80 text-base placeholder:text-[#CCC] font-roboto",required:!0}),e.jsx("button",{type:"button",onClick:()=>k(!u),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-[#9CA3AF] hover:text-[#6B7280]",children:u?e.jsx(N,{className:"w-5 h-5"}):e.jsx(y,{className:"w-5 h-5"})})]})]}),e.jsxs("div",{className:"flex w-full flex-col items-start gap-1",children:[e.jsx("div",{className:"flex h-5 py-[1.5px] pb-0.5 items-center self-stretch",children:e.jsx(b,{htmlFor:"confirmPassword",className:"text-[#4B5563] font-roboto text-xs font-medium leading-5",children:s("auth.reset.confirmNewPassword")})}),e.jsxs("div",{className:"h-[50px] self-stretch relative",children:[e.jsx("div",{className:"inline-flex h-[50px] py-[15px] pl-3 pr-0 flex-col justify-center items-center flex-shrink-0 absolute left-0 top-0 w-8",children:e.jsx(j,{className:"w-5 h-5 text-[#9CA3AF]"})}),e.jsx(w,{id:"confirmPassword",type:h?"text":"password",placeholder:"••••••••",value:m,onChange:t=>{C(t.target.value),r&&a(null)},className:"flex w-full h-[50px] py-[13px] pr-[50px] pl-[41px] items-center rounded-lg border border-[#D1D5DB] bg-white/80 text-base placeholder:text-[#CCC] font-roboto",required:!0}),e.jsx("button",{type:"button",onClick:()=>L(!h),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-[#9CA3AF] hover:text-[#6B7280]",children:h?e.jsx(N,{className:"w-5 h-5"}):e.jsx(y,{className:"w-5 h-5"})})]})]}),e.jsxs("div",{className:"w-full p-3 bg-blue-50 border border-blue-200 rounded-lg",children:[e.jsx("p",{className:"text-blue-800 text-xs font-medium mb-2",children:s("auth.common.passwordRequirementsTitle")}),e.jsxs("ul",{className:"text-blue-700 text-xs space-y-1",children:[e.jsxs("li",{children:["• ",s("auth.common.passwordRules.length")]}),e.jsxs("li",{children:["• ",s("auth.common.passwordRules.uppercase")]}),e.jsxs("li",{children:["• ",s("auth.common.passwordRules.lowercase")]}),e.jsxs("li",{children:["• ",s("auth.common.passwordRules.number")]})]})]}),(n||r)&&e.jsxs("div",{className:`flex items-center gap-3 p-4 rounded-lg border w-full ${n?"bg-red-50 border-red-200 text-red-800":(r==null?void 0:r.type)==="success"?"bg-green-50 border-green-200 text-green-800":"bg-red-50 border-red-200 text-red-800"}`,children:[!n&&(r==null?void 0:r.type)==="success"?e.jsx(Z,{className:"w-5 h-5 text-green-600 flex-shrink-0"}):e.jsx($,{className:"w-5 h-5 text-red-600 flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium",children:n?s("auth.reset.invalidLink"):r==null?void 0:r.text})]}),e.jsx("div",{className:"flex w-full h-[50px]",children:e.jsx(U,{type:"submit",disabled:f||n||!x||!m,className:"flex h-[50px] py-[15.5px] justify-center items-center w-full rounded-lg border border-transparent bg-[#9A7C7C] shadow-[0_1px_2px_0_rgba(0,0,0,0.05)] hover:bg-[#9A7C7C]/90 disabled:opacity-70 disabled:cursor-not-allowed",children:e.jsx("span",{className:"text-white text-center font-inter text-sm font-normal leading-6",children:s(f?"auth.reset.submitting":"auth.reset.submit")})})}),e.jsx("div",{className:"flex w-full justify-center",children:e.jsx(M,{to:"/signin",className:"text-[#9A7C7C] font-inter text-sm font-medium hover:underline",children:s("auth.common.backToSignIn")})})]})})]})]})})}export{ee 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.