1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4618],{12871:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/reset-password",function(){return a(30437)}])},86380:function(e,t,a){"use strict";a.d(t,{d:function(){return s}});let s=e=>{let t=e.split(".");if(3!==t.length)throw Error("Invalid JWT token");try{return JSON.parse(atob(t[1]))}catch(e){throw Error("Error parsing payload")}}},5417:function(e,t,a){"use strict";a.d(t,{z:function(){return r}});var s=a(86380);let r=e=>{try{let t=(0,s.d)(e);if(!t||!(null==t?void 0:t.exp))return!1;let a=new Date(1e3*t.exp);return new Date<a}catch(e){return!1}}},30437:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return O},default:function(){return N}});var s=a(85893),r=a(67294),n=a(5152),i=a.n(n),l=a(60814),o=a(52509),_=a(6304),c=a(20243),u=a(5417),d=a(86380),E=a(87027),T=a(68977),S=a(84660),R=a.n(S),m=a(63013),w=a(12420);let p=e=>/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[-_.@!#$%^&*+=])[A-Za-z\d\-_.@!#$%^&*+=]{8,}$/.test(e),A=e=>({event:"login_failed",...e});var f=a(48246);let g=i()(()=>a.e(1324).then(a.bind(a,91324)),{loadableGenerated:{webpack:()=>[91324]},ssr:!1}),h="reset-password-error";var x=e=>{let{testMode:t}=e,{translate:a,TRANSLATION_KEYS:n}=(0,c.T)(),i=n.ACCOUNT,{login:S,resetPassword:x,resetExpiredPassword:O}=(0,E.x7)(),[N,v]=(0,r.useState)(""),[U,y]=(0,r.useState)(""),[P,b]=(0,r.useState)(""),[D,H]=(0,r.useState)(!1),[C,I]=(0,r.useState)(!1),[L,k]=(0,r.useState)(""),[j,W]=(0,r.useState)(!1),M=!p(L)&&j,z=N?h:void 0;(0,r.useEffect)(()=>{let{search:e}=window.location,s=new URLSearchParams(e),r=(null==s?void 0:s.get("resetToken"))||"";if(!t&&(!r||!(0,u.z)(r))){alert(a(i.AUTH_RESET_ALERT_INVALID_TOKEN)),H(!0),window.location.href="/account/login";return}let n=(0,d.d)(r);y(n.email),I(n.isUserMigration),b(r)},[]);let B=()=>{window.localStorage.setItem("topBarMessage",JSON.stringify({message:a(i.AUTH_RESET_TOAST_ACCOUNT_UPDATED),backgroundColor:"#004d03",textColor:"white"}))},Q=async e=>{let{customer:t,errors:a}=await S(e);t&&((0,m.lQ)((0,w.CX)(e)),B(),window.location.href="/account/home"),a&&((0,m.lQ)(A(e)),window.location.assign("/account/login")),H(!1)},F=async e=>{let{errors:t}=await O({password:e,resetToken:P});if(t)return t.message.includes("expired")?v(a(i.AUTH_RESET_ERROR_TOKEN_EXPIRED)):t.message.includes("cannot create user")?v(a(i.AUTH_RESET_ERROR_PASSWORD_UPDATED)):v(a(i.AUTH_RESET_ERROR_GENERIC));Q({email:U,password:e})},X=async e=>{let t={email:U,password:e},{errors:s}=await x({credentials:t,resetToken:P});if(s){(null==s?void 0:s.message.includes("expired"))?v(a(i.AUTH_RESET_ERROR_TOKEN_EXPIRED)):v(a(i.AUTH_RESET_ERROR_GENERIC));return}(0,m.lQ)(f.cp.resetPasswordSuccess({email:U})),Q(t)},Z=async e=>{if(e.cancelable&&e.preventDefault(),e.target instanceof HTMLFormElement){let{elements:t}=e.target,s=t.namedItem("password"),r=t.namedItem("confirmPassword"),n=s.value.trim();if(n!==r.value.trim()){v(a(i.AUTH_RESET_ERROR_PASSWORDS_NO_MATCH));return}if(!p(n)){v(a(i.AUTH_RESET_ERROR_PASSWORD_RULES));return}v(""),H(!0),C?await F(n):await X(n),H(!1)}};return(0,s.jsxs)("div",{className:R().container,children:[(0,s.jsx)("div",{className:R().sectionTitle,children:(0,s.jsx)(l.x,{variant:"heading4",weight:"regular",className:R().titleText,children:a(i.AUTH_RESET_PAGE_TITLE)})}),(0,s.jsx)(l.x,{variant:"body",weight:"regular",className:R().emailText,children:a(i.AUTH_RESET_NEW_PASSWORD_FOR_EMAIL,{email:U})}),(0,s.jsxs)("form",{className:R().inputsContainer,onSubmit:Z,children:[(0,s.jsx)("div",{className:R().inputSimple,children:(0,s.jsx)(o.I.Simple,{id:"reset-password",label:a(i.AUTH_RESET_LABEL_PASSWORD),name:"password",size:"small",required:a(i.AUTH_RESET_REQUIRED_PASSWORD),inputType:"password",autoFocus:!0,onChange:e=>k(e),onFocus:()=>W(!0),maxLength:256,"aria-invalid":!!N,"aria-describedby":z})}),M&&(0,s.jsx)(g,{currentPassword:L}),(0,s.jsx)("div",{className:R().inputSimple,children:(0,s.jsx)(o.I.Simple,{id:"reset-confirm-password",label:a(i.AUTH_RESET_LABEL_CONFIRM_PASSWORD),name:"confirmPassword",size:"small",required:a(i.AUTH_RESET_REQUIRED_PASSWORDS_MATCH),inputType:"password",maxLength:256,"aria-invalid":!!N,"aria-describedby":z})}),(0,s.jsx)(_.Z,{className:R().saveBtn,text:a(i.AUTH_RESET_SAVE),onClick:T.Z,wide:!0,type:"submit",testId:"button-re-register-save",disabled:D}),N&&(0,s.jsx)(l.x,{id:h,role:"alert",variant:"heading6",weight:"regular",className:R().errorMessage,children:N})]})]})},O=!0,N=()=>(0,s.jsx)(x,{})},84660:function(e){e.exports={container:"styles_container__1LZQk",sectionTitle:"styles_sectionTitle__9E5H7",titleText:"styles_titleText__PkSE4",inputsContainer:"styles_inputsContainer__yB9zv",emailText:"styles_emailText__qbOeO",inputSimple:"styles_inputSimple__Al2fQ",saveBtn:"styles_saveBtn__FihzJ",errorMessage:"styles_errorMessage__LW8Vk"}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=12871)}),_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.