1import{V as T,a1 as V,W as F,r as s,j as e,z as B,av as k,m as c,aB as G,h as D,ar as y,aC as O,aq as W,p as $,a5 as I}from"./index-BZEGDzsY-v2.js";import{L as M}from"./loader-circle-BqoOPIM8-v2.js";function K(){const{verifyResetCode:d,confirmReset:N,error:U,clearError:n}=T(),x=V(),i=F(),[u,v]=s.useState(null),[C,P]=s.useState(null),[S,m]=s.useState(!0),[h,f]=s.useState(null),[t,E]=s.useState(""),[b,L]=s.useState(""),[o,z]=s.useState(!1),[p,g]=s.useState(!1),[R,q]=s.useState(!1),[w,l]=s.useState(null);s.useEffect(()=>{const a=new URLSearchParams(x.search).get("oobCode");if(!a){f("Invalid or missing password reset link. Please request a new one."),m(!1);return}v(a),(async()=>{try{const j=await d(a);P(j)}catch{f("This link has expired or has already been used. Please request a new password reset.")}finally{m(!1)}})()},[x,d]);const A=async r=>{if(r.preventDefault(),l(null),t.length<6){l("Password must be at least 6 characters long.");return}if(t!==b){l("Passwords do not match.");return}if(u){g(!0);try{await N(u,t),q(!0),setTimeout(()=>i("/login"),5e3)}catch(a){(a==null?void 0:a.code)==="auth/invalid-action-code"?l("This reset link has expired or has already been used. Please request a new one."):(a==null?void 0:a.code)==="auth/weak-password"?l("The new password is too weak. Please choose a stronger password."):l("Failed to reset password. Please try again or request a new link.")}finally{g(!1)}}};return S?e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-white dark:bg-[#050505] px-6",children:[e.jsx(B,{}),e.jsx("p",{className:"mt-4 text-slate-500 dark:text-slate-400 font-medium animate-pulse",children:"Verifying reset link..."})]}):h?e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-white dark:bg-[#050505] px-6 text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-red-500/10 rounded-[28px] flex items-center justify-center mb-6",children:e.jsx(k,{size:40,className:"text-red-500"})}),e.jsx("h1",{className:"text-2xl font-black text-slate-900 dark:text-white mb-2",children:"Verification Failed"}),e.jsx("p",{className:"text-slate-500 dark:text-slate-400 max-w-sm mb-8 font-medium",children:h}),e.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:[e.jsx("button",{onClick:()=>{n(),i("/forgot-password")},className:"w-full px-8 py-4 bg-blue-600 text-white rounded-2xl font-black shadow-lg shadow-blue-600/20 active:scale-95 transition-all",children:"Request New Link"}),e.jsx("button",{onClick:()=>{n(),i("/login")},className:"w-full px-8 py-4 bg-slate-100 dark:bg-white/5 text-slate-600 dark:text-slate-300 rounded-2xl font-black active:scale-95 transition-all",children:"Back to Login"})]})]}):e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-white dark:bg-[#050505] px-6 relative overflow-hidden py-12",children:[e.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-blue-500/5 rounded-full blur-[120px] pointer-events-none"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-indigo-500/5 rounded-full blur-[120px] pointer-events-none"}),e.jsxs(c.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center max-w-md w-full relative z-10",children:[e.jsxs("div",{className:"mb-8 flex flex-col items-center",children:[e.jsx("div",{className:"w-16 h-16 bg-white dark:bg-slate-900 rounded-[20px] flex items-center justify-center mb-4 border border-slate-200/80 dark:border-white/10 shadow-sm p-2 overflow-hidden",children:e.jsx(G,{sizeClassName:"w-12 h-12",imageClassName:"scale-125"})}),e.jsx("h2",{className:"text-2xl font-black tracking-tighter text-blue-600 dark:text-blue-400",children:e.jsx("span",{translate:"no",className:"notranslate",children:"Atharv Gyan"})}),e.jsx("div",{className:"h-1 w-12 bg-blue-600 rounded-full mt-1 opacity-50"})]}),R?e.jsxs(c.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"space-y-6",children:[e.jsx("div",{className:"w-20 h-20 bg-emerald-500/10 rounded-[28px] flex items-center justify-center mx-auto mb-6",children:e.jsx(D,{size:40,className:"text-emerald-500"})}),e.jsx("h1",{className:"text-3xl font-black text-slate-900 dark:text-white mb-2 tracking-tight",children:"Password Reset!"}),e.jsx("p",{className:"text-slate-500 dark:text-slate-400 mb-8 font-medium text-sm leading-relaxed",children:"Your password has been successfully updated. Redirecting you to login in a few seconds..."}),e.jsx("button",{onClick:()=>{n(),i("/login")},className:"w-full py-4 bg-emerald-600 text-white rounded-2xl font-black text-lg shadow-xl shadow-emerald-600/20 transition-all active:scale-95",children:"Go to Login"})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-black text-slate-900 dark:text-white mb-2 tracking-tight",children:"Create New Password"}),e.jsxs("p",{className:"text-slate-500 dark:text-slate-400 mb-8 font-medium text-sm leading-relaxed",children:["Account: ",e.jsx("span",{className:"text-blue-600 font-bold",children:C}),e.jsx("br",{}),"Choose a strong password to secure your account."]}),e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(y,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:20}),e.jsx("input",{type:o?"text":"password",placeholder:"New Password",required:!0,value:t,onChange:r=>E(r.target.value),className:"w-full pl-12 pr-12 py-4 bg-slate-50 dark:bg-white/5 border border-slate-200 dark:border-white/10 rounded-2xl focus:ring-2 focus:ring-blue-500 outline-none transition-all text-slate-900 dark:text-white font-medium"}),e.jsx("button",{type:"button",onClick:()=>z(!o),className:"absolute right-4 top-1/2 -translate-y-1/2 text-slate-400",children:o?e.jsx(O,{size:20}):e.jsx(W,{size:18})})]}),t&&e.jsxs("div",{className:"px-1 space-y-1.5",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Security Strength"}),e.jsx("span",{className:`text-[10px] font-black uppercase tracking-widest ${t.length<6?"text-red-500":t.length<10?"text-amber-500":"text-emerald-500"}`,children:t.length<6?"Weak":t.length<10?"Medium":"Strong"})]}
1),e.jsx("div",{className:"h-1 w-full bg-slate-100 dark:bg-white/5 rounded-full overflow-hidden",children:e.jsx(c.div,{initial:{width:0},animate:{width:t.length<6?"33.33%":t.length<10?"66.66%":"100%"},className:`h-full transition-colors ${t.length<6?"bg-red-500":t.length<10?"bg-amber-500":"bg-emerald-500"}`})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:20}),e.jsx("input",{type:o?"text":"password",placeholder:"Confirm New Password",required:!0,value:b,onChange:r=>L(r.target.value),className:"w-full pl-12 pr-12 py-4 bg-slate-50 dark:bg-white/5 border border-slate-200 dark:border-white/10 rounded-2xl focus:ring-2 focus:ring-blue-500 outline-none transition-all text-slate-900 dark:text-white font-medium"})]}),w&&e.jsxs(c.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"p-4 bg-red-50 dark:bg-red-500/10 border border-red-200 dark:border-red-500/20 rounded-2xl text-red-600 dark:text-red-400 text-xs font-bold text-left flex items-start gap-2",children:[e.jsx(k,{size:14,className:"shrink-0 mt-0.5"}),e.jsx("p",{children:w})]}),e.jsx("button",{type:"submit",disabled:p,className:"w-full py-4 bg-blue-600 disabled:opacity-50 text-white rounded-2xl font-black text-lg shadow-xl shadow-blue-600/20 transition-all active:scale-95 flex items-center justify-center gap-2",children:p?e.jsx(M,{className:"animate-spin",size:20}):e.jsxs(e.Fragment,{children:[e.jsx($,{size:20}),"Reset Password"]})})]})]}),e.jsx("div",{className:"pt-8",children:e.jsxs("button",{onClick:()=>{n(),i("/login")},className:"inline-flex items-center gap-2 text-slate-400 font-black text-xs uppercase tracking-widest transition-colors",children:[e.jsx(I,{size:14}),"Back to Login"]})})]}),e.jsx("div",{className:"absolute bottom-8 left-0 right-0 text-center",children:e.jsx("p",{className:"text-[10px] font-black text-slate-300 dark:text-slate-700 uppercase tracking-[0.4em]",children:"Atharv Gyan Excellence"})})]})}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.