1import{w as P,a as j,u as y,b as v,r as N,j as s}from"./chunk-OIYGIGL5-gwPc8tBz.js";import{C as b}from"./client-only-DX6BhWFv.js";import{t as R}from"./index-DvWKkjq7.js";import{B as E,L as C}from"./button-C-rmsvyO.js";import{u as I,I as f}from"./navigation-BVMU57in.js";import{G as z}from"./error-boundary-wmm73Qsd.js";import{b as B,g as S}from"./use-auth-mutations-DhV-tzHK.js";import{u as q,g as D,a as k,b as w,p as h,c as F}from"./user-validation-216L9Wf3.js";import"./index-BnGtwJ93.js";import"./cx-JWMrrZN5.js";import"./bundle-mjs-BWt8Cp2A.js";import"./is-react-component-CT1NlcGF.js";import"./tooltip-BIt4K4VP.js";import"./misc-abrRjE04.js";import"./trpc-tanstack-CcrFfedX.js";import"./useMutation-DZfcQAwJ.js";const d=F,X=({matches:o})=>[{title:`Reset Password | ${o.find(a=>a.id==="root")?.data?.domainConfig?.name??"Iconited"}`}],_=P(function(){const t=y(),[m]=v(),a=I(["redirectTo"]),[i,c]=N.useState(null),n=m.get("token"),p=B({onSuccess:()=>{R.success("Password reset",{description:"Your password has been reset. Please log in."}),t(a("/login"))},onError:e=>{c(S(e))}}),[l,r]=q({id:"reset-password",constraint:D(d),onValidate({formData:e}){return h(e,{schema:d})},shouldRevalidate:"onBlur",onSubmit(e,{formData:g}){e.preventDefault(),c(null);const x=h(g,{schema:d});x.status==="success"&&n&&p.mutate({newPassword:x.value.password,token:n})}}),u=p.isPending;return n?s.jsx("section",{className:"bg-primary relative min-h-screen overflow-hidden px-4 py-12 md:px-8 md:pt-24",children:s.jsxs("div",{className:"relative z-10 mx-auto flex w-full flex-col gap-8 sm:max-w-90",children:[s.jsx("div",{className:"flex flex-col items-center gap-6 text-center",children:s.jsxs("div",{className:"z-10 flex flex-col gap-2 md:gap-3",children:[s.jsx("h1",{className:"text-display-xs text-primary md:text-display-sm font-semibold",children:"Reset Password"}),s.jsx("p",{className:"text-md text-tertiary self-stretch p-0",children:"Enter your new password below."})]})}),s.jsx(b,{fallback:s.jsx("div",{className:"flex justify-center py-10",children:s.jsx(C,{size:"xl",type:"line-simple"})}),children:()=>s.jsxs("form",{...k(l),className:"z-10 flex flex-col gap-6",children:[s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(f,{isRequired:!0,hideRequiredIndicator:!0,label:"New Password",size:"md",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",...w(r.password,{type:"password"}),autoComplete:"new-password",autoFocus:!0,isInvalid:!!r.password.errors?.length,hint:r.password.errors?.join(", ")}),s.jsx(f,{isRequired:!0,hideRequiredIndicator:!0,label:"Confirm Password",size:"md",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",...w(r.confirmPassword,{type:"password"}),autoComplete:"new-password",isInvalid:!!r.confirmPassword.errors?.length,hint:r.confirmPassword.errors?.join(", ")})]}),l.errors?.length||i?s.jsx("div",{className:"bg-error-secondary rounded-lg px-4 py-3",children:s.jsxs("ul",{className:"flex flex-col gap-1",children:[l.errors?.map(e=>s.jsx("li",{className:"text-error-primary text-sm",children:e},e)),i&&s.jsx("li",{className:"text-error-primary text-sm",children:i})]})}):null,s.jsx(E,{type:"submit",size:"lg",className:"w-full",isLoading:u,isDisabled:u,children:"Reset password"})]})})]})}):(t("/forgot-password"),null)}),ss=j(function(){return s.jsx(z,{})});export{ss as ErrorBoundary,_ as default,X as meta}; 2//# sourceMappingURL=reset-password-B2iEtYFM.js.map
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.