PageSourceSearch

https://www.adultforce.com/assets/index-BeDXou7J-131925.js

js adultforce.com collected 2026-10-08 10:11:25 UTC 6,379 bytes, 1 lines download raw bytes

1import{m as s,r as e,j as r,R as o}from"./index-DLnlVNDg-131925.js";import{Navigate as t}from"./index-BBKd_28P-131925.js";import{p as a,by as i,C as n,D as m,T as d,bx as l,bq as p}from"./index-Dphu-qOt-131925.js";import{u}from"./use-router-params-_ticf5mX-131925.js";import{A as c,F as x}from"./form-card-container-AQhR5y-V-131925.js";import{C as j}from"./create-password-card-DQaf7Iyi-131925.js";import{B as w}from"./index-DC61SDCQ-131925.js";import{T as g}from"./index-C87iuh3q-131925.js";import{F as f}from"./form-provider-DWvc67EL-131925.js";import"./index-V4Du0HJ0-131925.js";import{u as h,t as b}from"./zod-DQ53zw6b-131925.js";import{u as P}from"./useMutation-BQ92-s9p-131925.js";import{u as y}from"./use-logout-M9co9Xf5-131925.js";import{t as F}from"./tour.mutationkeys-D0LHImad-131925.js";import"./cookies-fns-lEw0PJte-131925.js";import"./regular-y6UEXsrN-131925.js";import"./navigate-to-CrAY8bty-131925.js";import"./simple-health-check-store-Doea7J72-131925.js";import"./use-full-pathname-C539e2NN-131925.js";import"./index-Cf-B8iFn-131925.js";import"./index.es-xJxMdNjC-131925.js";import"./utils-DDYFzoWe-131925.js";import"./TransitionGroupContext-CMCob8J3-131925.js";import"./index-DbTeTm7z-131925.js";import"./Menu-XfhkgwEB-131925.js";import"./useSlot-vy7oc7-l-131925.js";import"./createSimplePaletteValueFilter-DHR8FfCQ-131925.js";import"./useForkRef-C-l_k7VT-131925.js";import"./useSlotProps-BWiorq2P-131925.js";import"./ownerDocument-CJ3p5_B2-131925.js";import"./Modal-C7-xNka9-131925.js";import"./useEventCallback-Czuum7uV-131925.js";import"./Portal-Ddck73hv-131925.js";import"./getReactElementRef-BPfZ9vnx-131925.js";import"./Grow-COMo13HL-131925.js";import"./listClasses-CsIoINxD-131925.js";import"./ListItem-DFY-dE3O-131925.js";import"./TextField-DokD3QJ4-131925.js";import"./Select-BXYCifwX-131925.js";import"./useControlled-Doet4Q-G-131925.js";import"./useFormControl-DJ77Q5c5-131925.js";import"./createSvgIcon-Bfj-zq6W-131925.js";import"./index-DYtaa5Lv-131925.js";import"./ListItemText-CEdsopjY-131925.js";import"./MenuItem-C53sjrJ8-131925.js";import"./menuItemClasses-C4_8HHHt-131925.js";import"./ButtonBase-BfiH1b7_-131925.js";import"./Typography-DBhpvH3Q-131925.js";import"./index-BQreqPbs-131925.js";import"./light-BWSUVi2E-131925.js";import"./InputAdornment-JzKJvsAZ-131925.js";import"./debounce-UDipISnY-131925.js";import"./Switch-CXex8SXN-131925.js";import"./SwitchBase-CQmc8jD7-131925.js";const T=async s=>(await a.post(i.changePassword.post,s)).data;const C=n({username:m().min(1,{message:"Username is required!"}),password:m().min(5,{message:"Password must be 5-20 characters"}).max(20,{message:"Password must be 5-20 characters"}).regex(/^(?!.*\s).+$/,{message:"Password must not contain spaces"}).regex(/(?=.*[a-z])/,{message:"Password must contain at least one lowercase letter"}).regex(/(?=.*[A-Z])/,{message:"Password must contain at least one uppercase letter"}).regex(/(?=.*[0-9\W_])/,{message:"Password must contain at least one number or symbol"}),confirmPassword:m().min(1,{message:"Confirm password is required!"})}).refine(s=>s.password===s.confirmPassword,{path:["confirmPassword"],message:"Passwords do not match!"});function k(e){const r=function(){const{logout:e}=y();return P({mutationKey:F.changePassword,mutationFn:T,onSuccess:()=>{s.success("Your password was reset successfully."),e()},onError:e=>{var r,o,t;403===(null==(r=null==e?void 0:e.response)?void 0:r.status)?s.error('Your token for resetting the password has expired. Please use the "forgot password" functionality again on the login page.'):"Token Not Found"===(null==(o=null==e?void 0:e.response)?void 0:o.data.errorMessage)?s.error('The reset token on the URL is invalid. Try using the "forgot password" functionality again.'):"Token has expired"===(null==(t=null==e?void 0:e.response)?void 0:t.data.errorMessage)?s.error('The reset token on the URL has expired. Try using the "forgot password" functionality again.'):s.error("Something went wrong during the reset of your password.")}})}(),o={username:e.username,password:"",confirmPassword:""},t=h({mode:"onChange",resolver:b(C),defaultValues:o}),{reset:a,handleSubmit:i,formState:{isValid:n}}=t,m=i(async s=>{const o={username:e.username,token:e.token,password:s.password};r.mutate(o,{onSettled:()=>{a()}})});return{formMethods:t,isLoading:r.isPending,isValid:n,onFormSubmit:m}}const S=s=>{const{formMethods:t,isLoading:a,isValid:i,onFormSubmit:n}=k(s),m=e.useMemo(()=>[{name:"username",labelTranslationKey:"setNewPassword.username",required:!0,disabled:!0,passwordField:!1},{name:"password",labelTranslationKey:"setNewPassword.password",required:!0,passwordField:!0},{name:"confirmPassword",labelTranslationKey:"setNewPassword.confirmPassword",required:!0,passwordField:!0}],[]);return r.jsxs(o.Fragment,{children:[r.jsx(d,{translationKey:"setNewPassword.heading",children:r.jsx(d.Basic,{variants:{md:"h5",xs:"h
17"}})}),r.jsxs(f,{methods:t,onSubmit:n,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"32px",width:"100%",maxWidth:"320px",gridArea:"form"},children:[m.map((s,e)=>s.passwordField?r.jsx(g.Password,{name:s.name,labelTranslationKey:s.labelTranslationKey,defaultColorTextField:"#fff",labelTextColor:"#C2D8FF",size:"small",sx:{width:"100%"},required:s.required,disabled:s.disabled},e):r.jsx(g.Default,{name:s.name,labelTranslationKey:s.labelTranslationKey,defaultColorTextField:"#fff",labelTextColor:"#C2D8FF",size:"small",sx:{width:"100%"},required:s.required,disabled:s.disabled},e)),r.jsx(w,{translationKey:"setNewPassword.button",type:"submit",disabled:a||!i,isLoading:a,sxProps:{width:"100%",maxWidth:"320px"},children:r.jsx(w.Form,{})})]})]})},v=()=>{const s=u();return s.username&&s.token?r.jsx(c,{children:r.jsxs(c.Container,{children:[r.jsx(c.BackButton,{}),r.jsxs(c.FormContainer,{children:[r.jsx(x,{image:{src:"/assets/icons/adult-force/password-lock.svg",alt:"password-lock",variant:"ABSOLUTE",sx:{left:{xs:"50%",lg:0},top:{lg:"-20px",xs:24},transform:{lg:"translateX(-55%)",xs:"translate(-50%, -65%)"},width:{lg:220,xs:142}}},sx:{width:"100%",maxWidth:{xs:"100%",md:500,lg:500},padding:{lg:"44px 64px 64px 64px",md:8,xs:"64px 20px 40px 20px"}},children:r.jsx(S,{token:s.token,username:s.username})}),r.jsx(j,{nameSpace:{path:p.tour.changePassword},sx:{maxWidth:{xs:"100%",md:500,lg:300}}})]})]})}):r.jsx(t,{to:l[404]})};export{v 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.