PageSourceSearch

https://mstudio.ai/build/assets/ResetPasswordPage.DsvSllN3.js

js mstudio.ai collected 2026-10-05 12:17:51 UTC 6,654 bytes, 1 lines download raw bytes

1import{r as g}from"./rolldown-runtime.C1f3BsDW.js";import{t as c}from"./inertia.BE4YqsTM.js";import"./http.DWpeO7Ui.js";import{Gr as q,Jt as p,Qr as F,_r as T,yr as z}from"./icons.ChOq_Y4q.js";import{t as B}from"./react-core.CAMe6Z4j.js";import"./utils.CgzVjNgC.js";import"./state.L8kQliOB.js";import{i as U,k as m}from"./entry-client.DX3aUoe5.js";import{n as w}from"./input.GzdAc1Aj.js";import"./dist.DxccqHSW.js";import{t as j}from"./label.D8t8fk_6.js";import{t as u}from"./SEO.gPDL2mFy.js";import{t as D}from"./logo.7ZVhR9ER.js";import{t as x}from"./Card.CbhBZ5MF.js";var r=g(F(),1),e=g(B(),1),O=[{label:"8+ characters",test:s=>s.length>=8},{label:"Uppercase letter",test:s=>/[A-Z]/.test(s)},{label:"Lowercase letter",test:s=>/[a-z]/.test(s)},{label:"Number",test:s=>/[0-9]/.test(s)}],Y=s=>s.length<8?"Password must be at least 8 characters":/[A-Z]/.test(s)?/[a-z]/.test(s)?/[0-9]/.test(s)?null:"Password must contain at least one number":"Password must contain at least one lowercase letter":"Password must contain at least one uppercase letter";const Z=()=>{const{resetPassword:s,isLoading:l,error:f,clearError:b}=U(),[o,v]=(0,r.useState)(""),[d,N]=(0,r.useState)(""),[y,P]=(0,r.useState)(!1),[h,i]=(0,r.useState)(""),[k,C]=(0,r.useState)(!1),[S,_]=(0,r.useState)(""),[L,R]=(0,r.useState)(""),[E,I]=(0,r.useState)(!1);(0,r.useEffect)(()=>{const t=new URLSearchParams(window.location.search),n=t.get("token"),a=t.get("email");!n||!a?I(!0):(_(n),R(a))},[]);const A=async t=>{if(t.preventDefault(),i(""),b(),!o||!d){i("Fill in every field.");return}if(o!==d){i("Passwords do not match");return}const n=Y(o);if(n){i(n);return}try{await s(S,L,o,d),C(!0)}catch(a){i(a instanceof Error?a.message:"Could not reset your password. Try again.")}};return E?(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen bg-background flex items-center justify-center p-6",children:[(0,e.jsx)(u,{title:"Invalid reset link",noIndex:!0}),(0,e.jsx)("div",{className:"w-full max-w-md animate-fade-in",children:(0,e.jsxs)(x,{variant:"default",padding:"lg",className:"border-border/50 text-center",children:[(0,e.jsx)("div",{className:"flex justify-center mb-6",children:(0,e.jsx)("div",{className:"h-16 w-16 rounded-full bg-destructive/10 flex items-center justify-center",children:(0,e.jsx)(z,{className:"h-8 w-8 text-destructive","aria-hidden":"true"})})}),(0,e.jsx)("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Invalid reset link"}),(0,e.jsx)("p",{className:"text-muted-foreground mb-6",children:"This password reset link is invalid or has expired. Request a new one."}),(0,e.jsx)(m,{className:"w-full",asChild:!0,children:(0,e.jsx)(c,{href:"/forgot-password",children:"Request a new link"})})]})})]}):k?(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen bg-background flex items-center justify-center p-6",children:[(0,e.jsx)(u,{title:"Password reset complete",noIndex:!0}),(0,e.jsx)("div",{className:"w-full max-w-md animate-fade-in",children:(0,e.jsxs)(x,{variant:"default",padding:"lg",className:"border-border/50 text-center",children:[(0,e.jsx)("div",{className:"flex justify-center mb-6",children:(0,e.jsx)("div",{className:"h-16 w-16 rounded-full bg-success/10 flex items-center justify-center",children:(0,e.jsx)(T,{className:"h-8 w-8 text-success","aria-hidden":"true"})})}),(0,e.jsx)("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Password reset complete"}),(0,e.jsx)("p",{className:"text-muted-foreground mb-6",children:"Your password is reset. You can now log in with your new password."}),(0,e.jsx)(m,{className:"w-full",asChild:!0,children:(0,e.jsx)(c,{href:"/login",children:"Log in"})})]})})]}):(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen bg-background flex items-center justify-center p-6",children:[(0,e.jsx)(u,{title:"Reset password",noIndex:!0}),(0,e.jsxs)("div",{className:"w-full max-w-md animate-fade-in",children:[(0,e.jsx)("div",{className:"flex justify-center mb-8",children:(0,e.jsx)("a",{href:"/",children:(0,e.jsx)(D,{className:"size-8"})})}),(0,e.jsxs)(x,{variant:"default",padding:"lg",className:"border-border/50",children:[(0,e.jsxs)("div",{className:"text-center mb-8",children:[(0,e.jsx)("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Reset your password"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"Enter your new password below."})]}),(0,e.jsxs)("form",{onSubmit:A,className:"space-y-5",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(j,{htmlFor:"password",children:"New Password"}),(0,e.jsx)(w,{id:"password",type:"password",revealable:!0,name:"password",placeholder:"Create a strong password…",autoComplete:"new-password",value:o,onChange:t=>v(t.target.value),onFocus:()=>P(!0),icon:(0,e.jsx)(p,{className:"h-4 w-4","aria-hidden":"true"}),disabled:l}),y&&(0,e.jsx)("div",{className:"grid grid-cols-2 gap-1 pt-1","aria-label":"Password requirements",children:O.map(({label:t,test:n})=>{const a=n(o);return(0,e.jsxs)("div",{className:`flex items-center gap-1.5 text-xs transition-colors ${a?"text-success":"text-muted-foreground"}`,children:[(0,e.jsx)("div",{className:`h-1.5 w-1.5 rounded-full shrink-0 transition-colors ${a?"bg-success":"bg-muted-foreground
1/40"}`}),t]},t)})})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(j,{htmlFor:"password_confirmation",children:"Confirm new password"}),(0,e.jsx)(w,{id:"password_confirmation",type:"password",revealable:!0,name:"password_confirmation",placeholder:"Confirm your password…",autoComplete:"new-password",value:d,onChange:t=>N(t.target.value),icon:(0,e.jsx)(p,{className:"h-4 w-4","aria-hidden":"true"}),disabled:l})]}),(h||f)&&(0,e.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-destructive/10 border border-destructive/20",role:"status","aria-live":"polite",children:[(0,e.jsx)("div",{className:"h-2 w-2 rounded-full bg-destructive"}),(0,e.jsx)("p",{className:"text-sm text-destructive",children:h||f})]}),(0,e.jsx)(m,{type:"submit",className:"w-full",size:"lg",disabled:l,isLoading:l,children:"Reset password"})]}),(0,e.jsxs)("p",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Remember your password?"," ",(0,e.jsx)(c,{href:"/login",className:"text-primary hover:text-primary/80 font-medium transition-colors",children:"Log in"})]})]}),(0,e.jsx)("div",{className:"mt-8 text-center",children:(0,e.jsxs)("a",{href:"/",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,e.jsx)(q,{className:"h-4 w-4","aria-hidden":"true"}),"Back to home"]})})]})]})};var ae=Z;export{Z as ResetPasswordPage,ae 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.