PageSourceSearch

https://ripplemind.com/_next/static/chunks/pages/customers/change-password-6483549284bf90dd.js

js ripplemind.com collected 2026-10-06 13:15:36 UTC 7,931 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[151],{19081:function(e,s,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/customers/change-password",function(){return r(51206)}])},51206:function(e,s,r){"use strict";r.r(s),r.d(s,{default:function(){return p}});var n=r(85893),t=r(99603),a=r(88446),o=r(67294),l=r(86501),c=r(59417),i=r(11163),d=r(9008),u=r.n(d),x=()=>{let e=(0,o.useRef)(null),s=(0,o.useRef)(null),r=(0,o.useRef)(null),[d,x]=(0,o.useState)({current:"",new:"",confirm:""}),[m,h]=(0,o.useState)({current:!1,new:!1,confirm:!1}),[f,p]=(0,o.useState)({loading:!1,success:"",error:""}),[w,v]=(0,o.useState)({loading:!1,success:"",error:""}),[g,j]=(0,o.useState)({current:"",new:"",confirm:""}),N=(0,i.useRouter)(),[y,b]=(0,o.useState)(-1),[C,P]=(0,o.useState)("");(0,o.useEffect)(()=>{P(window.location.href)},[N]);let _=async()=>{try{v({loading:!0,success:"",error:""});let s=await a.Z.get("/user/viewuser");if(200===s.status){var e;b(null==s?void 0:null===(e=s.data)||void 0===e?void 0:e.id)}v({loading:!1,success:"success",error:""})}catch(e){console.error(e),v({loading:!1,success:"",error:"something went wrong"})}},E=async()=>{try{let e=!1,s={current:"",new:"",confirm:""};s.current="";let r=d.current.toUpperCase(),n="1,2,3,4,5,6,7,8,9,0";if("string"!=typeof d.current?(s.current="Not a valid password",e=!0):d.current.length<8?(s.current="Need atleast 8 character",e=!0):[...d.current].some(e=>r.includes(e))?[...d.current].some(e=>n.includes(e))||(s.current="Need at least one number",e=!0):(s.current="Need at least one Upper Case character",e=!0),s.new="","string"!=typeof d.new?(s.new="Not a valid password",e=!0):d.new.length<8?(s.new="Need atleast 8 character",e=!0):[...d.new].some(e=>r.includes(e))?[...d.new].some(e=>n.includes(e))||(s.new="Need at least one number",e=!0):(s.new="Need at least one Upper Case character",e=!0),s.confirm="",d.confirm!==d.new&&(s.confirm="Password mismatch",e=!0),j({...g,...s}),e)return!0;return!1}catch(e){console.error(e)}},G=async()=>{try{let e=await E();if(e){p({loading:!1,success:"",error:"something went wrong"});return}p({loading:!0,success:"",error:""});let s={userId:y,current_password:d.current,new_password:d.new,confirm_password:d.confirm};await a.Z.post("/user/changePassword",{...s},{headers:{frontendurl:C||""}}).then(e=>{var s,r;(null==e?void 0:e.status)===404?l.ZP.error(null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.message):(null==e?void 0:e.status)===200?(l.ZP.success(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message,{duration:3e3,icon:(0,n.jsx)(t.G,{icon:c.GTN})}),N.push("/customers")):l.ZP.error("Internal Server Error")}).catch(e=>{var s,r,n,t;400===e.response.status?l.ZP.error(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message):500===e.response.status?l.ZP.error(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message):l.ZP.error("Internal Server Error")}),p({loading:!1,success:"success",error:""})}catch(e){console.error(e),p({loading:!1,success:"error",error:""})}};return(0,o.useEffect)(()=>{_()},[]),(0,n.jsxs)("div",{className:"md:mx-28 ",children:[(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(u(),{children:(0,n.jsx)("title",{children:"Change Password"})})}),(0,n.jsx)("div",{className:"container mx-auto flex justify-center items-center",children:(0,n.jsxs)("div",{className:"border lg:w-1/3 my-5",children:[(0,n.jsx)("div",{className:"border-b bg-gray-100 rounded-md p-3",children:(0,n.jsx)("h1",{children:"Change Password"})}),(0,n.jsxs)("div",{className:"border ",children:[(0,n.jsxs)("div",{className:"p-3 space-y-2",children:[(0,n.jsxs)("div",{className:" flex justify-between p-2",children:[(0,n.jsx)("label",{htmlFor:"",children:"Current Password"}),(null==g?void 0:g.current.length)!==0&&(0,n.jsxs)("div",{className:"text-red-500 text-end",children:[(0,n.jsx)(t.G,{icon:c.RLE}),(0,n.jsx)("span",{className:"px-1",children:null==g?void 0:g.current})]})]}),(0,n.jsxs)("div",{className:"border p-3 flex w-full",children:[(0,n.jsx)("input",{ref:e,onChange:e=>{let s=e.target.value;x({...d,current:s})},className:" w-full outline-none",type:m.current?"text":"password",placeholder:"Enter your current password",id:"",value:d.current})," ",(0,n.jsx)("div",{className:"  flex items-center px-3",children:(0,n.jsx)("button",{className:"",onClick:()=>h({...m,current:!m.current}),children:!1===m.current?(0,n.jsx)(t.G,{icon:c.Mdf,className:" rounded px-4 text-sm text-gray-400 font-mono curs
1or-pointer"}):(0,n.jsx)(t.G,{icon:c.Aq,className:" rounded px-4 text-sm text-gray-400 font-mono cursor-pointer"})})})]})]}),(0,n.jsxs)("div",{className:"p-3 space-y-2",children:[(0,n.jsxs)("div",{className:" flex justify-between p-2",children:[(0,n.jsxs)("label",{htmlFor:"",children:["Password ",(0,n.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==g?void 0:g.new.length)!==0&&(0,n.jsxs)("div",{className:"text-red-500 text-end",children:[(0,n.jsx)(t.G,{icon:c.RLE}),(0,n.jsx)("span",{className:"px-1",children:null==g?void 0:g.new})]})]}),(0,n.jsxs)("div",{className:"border p-3   flex  w-full",children:[(0,n.jsx)("input",{ref:s,onChange:e=>{let s=e.target.value,r="";for(let e=0;e<s.length;e++){let n=s[e].charCodeAt(0);32===n||(r+=s[e])}x({...d,new:r})},className:" w-full outline-none ",type:m.new?"text":"password",name:"newPassword",placeholder:"Enter new password",id:"",value:d.new}),(0,n.jsx)("div",{className:"  flex items-center px-3",children:(0,n.jsx)("button",{className:"",onClick:()=>h({...m,new:!m.new}),children:!1===m.new?(0,n.jsx)(t.G,{icon:c.Mdf,className:" rounded px-4 text-sm text-gray-400 font-mono cursor-pointer"}):(0,n.jsx)(t.G,{icon:c.Aq,className:" rounded px-4 text-sm text-gray-400 font-mono cursor-pointer"})})})]})]}),(0,n.jsxs)("div",{className:"p-3 space-y-2",children:[(0,n.jsxs)("div",{className:" flex justify-between p-2",children:[(0,n.jsxs)("label",{htmlFor:"",children:["Confirm Password ",(0,n.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==g?void 0:g.confirm.length)!==0&&(0,n.jsxs)("div",{className:"text-red-500 text-end",children:[(0,n.jsx)(t.G,{icon:c.RLE}),(0,n.jsx)("span",{className:"px-1",children:null==g?void 0:g.confirm})]})]}),(0,n.jsxs)("div",{className:"border p-3   flex  w-full",children:[(0,n.jsx)("input",{ref:r,onChange:e=>{let s=e.target.value,r="";for(let e=0;e<s.length;e++){let n=s[e].charCodeAt(0);32===n||(r+=s[e])}x({...d,confirm:r})},className:" w-full outline-none ",type:m.confirm?"text":"password",name:"confirmPassword",placeholder:"Confirm new Password",id:"",value:d.confirm}),(0,n.jsx)("div",{className:"  flex items-center px-3",children:(0,n.jsx)("button",{className:"",onClick:()=>h({...m,confirm:!m.confirm}),children:!1===m.confirm?(0,n.jsx)(t.G,{icon:c.Mdf,className:" rounded px-4 text-sm text-gray-400 font-mono cursor-pointer"}):(0,n.jsx)(t.G,{icon:c.Aq,className:" rounded px-4 text-sm text-gray-400 font-mono cursor-pointer"})})})]})]}),(0,n.jsx)("div",{className:"p-2 flex justify-center",children:(0,n.jsx)("button",{onClick:()=>G(),className:"border rounded-md bg-green-500 text-white p-2",children:"Change password"})})]})]})})]})},m=r(94543),h=r(48583),f=r(28646),p=()=>{let e=(0,h.Dv)(m.ZP);return e.loading?(0,n.jsx)("p",{className:"md:mx-28 text-center p-5",children:"Loading..."}):e.isLoggedIn?(0,n.jsx)(x,{}):(0,n.jsx)(f.Z,{})}},28646:function(e,s,r){"use strict";var n=r(85893),t=r(41664),a=r.n(t),o=r(11163);r(67294),s.Z=()=>{let e=(0,o.useRouter)(),s=e.asPath;return(0,n.jsxs)("div",{className:"md:mx-28 text-center text-red-500 p-10 bg-gray-100 text-xl",children:["Your are not Logged in to use this functionality .......! ",(0,n.jsx)("br",{}),(0,n.jsx)(a(),{className:"text-blue-500",href:"/login?re_url=".concat(s),children:"Click here to Login"})]})}},9008:function(e,s,r){e.exports=r(42636)}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=19081)}),_N_E=e.O()}]);

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.