1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1216],{21216:(e,s,r)=>{r.r(s),r.d(s,{default:()=>i});var a=r(75038),t=r(76430),n=r(34530),d=r(19977),o=r(1433),l=r(2272);function i(){let{c_Session:e,c_SetModals:s}=(0,t.useContext)(l.A),[r,i]=(0,t.useState)({new:null,confirm:null}),p=(0,t.useRef)();(0,t.useEffect)(()=>{setTimeout(()=>{p?.current?.focus()},50)},[]);let c=async e=>{if(e.preventDefault(),r?.new!==r?.confirm)return void o.Ay.error("New password and new password confirmation should match");let a=(0,d.U)(),{data:t,error:n}=await a.auth.updateUser({password:r.new});if(t?.user){o.Ay.success("Your password has been updated"),s(e=>e?.filter(e=>"resetPasswordModal"!==e.id));return}n&&o.Ay.error(n?.message??"Something went wrong, please try again")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"border-b-2 py-2 md:py-4 flex items-center justify-center text-base md:text-xl border-gray-300 dark:border-gray-700 dark:text-white font-semibold",children:"Update your password"}),(0,a.jsx)("div",{className:"flex items-center justify-center flex-col",children:e?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("form",{onSubmit:c,className:"space-y-6 px-4 py-8 max-w-[500px] w-full",children:[(0,a.jsx)(n.pd,{passref:p,id:"newPassword",label:"Enter new password",onChange:e=>i(s=>({...s,new:e.target.value})),type:"password",placeholder:"Enter new password"}),(0,a.jsx)(n.pd,{id:"confirmNewPassword",label:"Repeat new password",onChange:e=>i(s=>({...s,confirm:e.target.value})),type:"password",placeholder:"Confirm new password"}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"rounded-xl",onClick:c,children:"Update Password"})]})}):"You need to be logged in to change the password"})]})}}}]);
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.