1(self.webpackChunkhydra=self.webpackChunkhydra||[]).push([[9564],{43411:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>k});var a=t(92137),n=t(28481),i=t(96156),s=t(87757),o=t.n(s),l=t(67294),c=t(94184),d=t.n(c),u=t(77678),p=t(82095),f=t(66283),v=t(17812),m=t(64436),g=t(43832),E=t(22318),y=t(282),h=t(41120),w=t(51463),b=t(43993),_=t(65549),O=t(90292),S=t(62767);function T(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function L(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?T(Object(t),!0).forEach((function(r){(0,i.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var x=(0,h.Z)((function(e){return{title:{marginBottom:e.spacing(4),width:"100%"},root:(0,i.Z)({display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(5,4),width:"600px",background:e.palette.background.paper,boxShadow:"0px 2px 4px ".concat(e.palette.grey[200]),margin:"".concat(e.spacing(6),"px auto")},e.breakpoints.down("xs"),{width:"100%",padding:e.spacing(2.5,2)}),button:{marginBottom:e.spacing(1.5),marginTop:e.spacing(1.5)},buttonText:{position:"relative"},loader:{position:"absolute",left:e.spacing(-3),top:e.spacing(.75)},alert:{width:"100%",marginBottom:e.spacing(2)}}}));function R(e){var r=e.handleClick;return l.createElement(f.Z,{position:"end"},l.createElement(v.Z,{size:"small",onClick:r,tabIndex:"-1"},l.createElement(w.JO,{type:"cross",size:"sm",color:"secondary"})))}function k(e){var r,t=e.match.params.regenerationKey,s=(0,b.QT)(),c=s.locale,f=s.translate,v=x(),h=(0,l.useRef)(),T=S.Z.get("recaptchaSiteKey"),k=(0,l.useCallback)((function(e){var r=Object.getOwnPropertyNames(e.fields).every((function(r){return e.fields[r].valid})),t=e.fields.password,a=e.fields.passwordConfirmation,n=!!a.value&&a.value===t.value;n!==a.valid&&P("passwordConfirmation",n,f("validator_password_verification")),n||(r=!1),e.valid!==r&&j({type:"SET_FORM_VALIDITY",valid:r})}),[f]),D=(0,l.useReducer)((function(e,r){switch(r.type){case"RESET_FORM":var t=L(L({},e),{},{valid:!1});return Object.keys(t.fields).forEach((function(e){var r=t.fields[e];r.touched=!1,r.valid=!1,r.errorMessage=void 0,r.value=""})),t;case"SET_ALERT":return L(L({},e),{},{alert:r.severity&&r.message?{severity:r.severity,message:r.message}:void 0});case"SET_FIELD_VALIDITY":var a=e.fields[r.field];return L(L({},e),{},{fields:L(L({},e.fields),{},(0,i.Z)({},r.field,L(L({},a),{},{valid:r.valid,errorMessage:r.errorMessage})))});case"SET_FIELD_VALUE":var n=e.fields[r.field],s=function(e,r,t){var a=e.fields[r];return a.required&&!t?{valid:!1,errorMessage:f("validator_required",{with:{field:a.label}})}:a.minLength&&t&&t.length<a.minLength?{valid:!1,errorMessage:f("validator_min_length",{with:{field:a.label,minLength:a.minLength}})}:{valid:!0}}(e,r.field,r.value);return L(L({},e),{},{fields:L(L({},e.fields),{},(0,i.Z)({},r.field,L(L({},n),{},{touched:!0,valid:s.valid,errorMessage:s.errorMessage,value:r.value})))});case"SET_FORM_ERRORS":var o=L(L({},e),{},{valid:!1}),l=r.fieldErrors;return l&&Object.keys(l).forEach((function(e){var r=o.fields[e],t=l[e];r&&t&&(r.valid=!1,r.errorMessage=f(t.message,{with:L({field:e},t)}))})),o;case"SET_FORM_VALIDITY":return L(L({},e),{},{valid:r.valid});case"SET_LOADING":return L(L({},e),{},{loading:r.loading});default:throw new Error("Unsupported action type: ".concat(r.type))}}),{fields:{password:{id:"password",label:f("Password"),required:!0,minLength:6,touched:!1,valid:!1,value:""},passwordConfirmation:{id:"password-confirmation",label:f("authentication_confirm_new_password"),required:!0,touched:!1,valid:!1,value:""}},valid:!1,loading:!1}),I=(0,n.Z)(D,2),M=I[0],j=I[1];(0,l.useEffect)((function(){k(M)}),[k,M]);var A=function(e){j({type:"SET_FIELD_VALUE",field:e,value:""})},N=function(e,r){j({type:"SET_FIELD_VALUE",field:r,value:e.target.value})},Z=function(){var e=(0,a.Z)(o().mark((function e(r){var a,n,i,s,l,d,u,v,m,g;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.preventDefault(),M.valid){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,C(),e.next=7,h.current.executeAsync();case 7:return a=e.sent,F(!0),n={password:M.fields.password.value,passwordConfirmation:M.fields.passwordConfirmation.value,timestamp:Date.now()},e.next=12,_.v_("/api/user/reset-password",{json:{regenerationKey:t,RESET_CREDENTIALS:(0,O.lM)(JSON.stringify(n))}}).json();case 12:return i=e.sent,s=i.USER_CREDENTIALS,l=JSON.parse((0,O.Q0)(s)),d={email:l.email,password:M.fields.password.value,timestamp:Date.now()},e.next=18,_.v_("/api/user/login",{json:{LOGIN_CREDENTIALS:(0,O.lM)(JSON.stringify(d)),"g-recaptcha-response":a}});case 18:q(),F(!1),window.location.href="/".concat(c,"/overview"),e.next=30;break;case 23:if(e.prev=23,e.t0=e.catch(3),!(e.t0 instanceof _.Bb)){e.next=29;break}return e.next=28,e.t0.response.json();case 28:g=e.sent;case 29:null!==(u=g)&&void 0!==u&&u.fields&&Object.keys(g.fields).length?V(g.fields):null!==(v=g)&&void 0!==v&&v.error&&"string"==typeof(null===(m=g)||void 0===m?void 0:m.error)?C("error",f(g.error)):(p.Tb(e.t0),C("error",f("generic_error")));case 30:return e.prev=30,F(!1),e.finish(30);case 33:case"end":return e.stop()}}),e,null,[[3,23,30,33]])}
1)));return function(r){return e.apply(this,arguments)}}(),C=function(e,r){j({type:"SET_ALERT",severity:e,message:r})},F=function(e){j({type:"SET_LOADING",loading:e})},P=function(e,r,t){j({type:"SET_FIELD_VALIDITY",field:e,valid:r,errorMessage:t})},V=function(e){j({type:"SET_FORM_ERRORS",fieldErrors:e})},q=function(){j({type:"RESET_FORM"})},U=function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",a=M.fields[e];return a?l.createElement(m.Z,null,l.createElement(w.nv,{label:a.label,id:"change-password-".concat(a.id),type:t,value:a.value,required:null!==(r=a.required)&&void 0!==r&&r,error:a.touched&&!a.valid,helperText:a.touched&&!a.valid&&a.errorMessage?a.errorMessage:null,onChange:function(r){return N(r,e)},InputProps:{endAdornment:a.value&&l.createElement(R,{handleClick:function(){return A(e)}})}})):null};return l.createElement(g.Z,null,l.createElement("div",{className:v.root},l.createElement(E.Z,{variant:"h3",color:"textSecondary",className:v.title},l.createElement(w.vN,{content:"change_password"})),(null===(r=M.alert)||void 0===r?void 0:r.message)&&l.createElement("div",{className:v.alert},l.createElement(w.Zl,{severity:M.alert.severity,title:M.alert.message,dismissable:!0})),l.createElement(m.Z,{component:"form",onSubmit:Z,fullWidth:!0},l.createElement(u.Z,{ref:h,size:"invisible",sitekey:T}),U("password","password"),U("passwordConfirmation","password"),l.createElement(y.Z,{disabled:!M.valid&&M.loading,variant:"contained",color:"primary",size:"large",type:"submit",className:d()(v.button)},l.createElement("div",{className:v.buttonText},M.loading&&l.createElement(w.JO,{type:"loader",size:"sm",color:"white",className:v.loader}),l.createElement(w.vN,{content:"send_password_button"}))))))}},90292:(e,r,t)=>{"use strict";t.d(r,{lM:()=>i,Q0:()=>s});var a=t(81354),n=t.n(a);function i(e){return n().AES.encrypt(e,"key").toString()}function s(e){return n().AES.decrypt(e,"key").toString(n().enc.Utf8)}},42480:()=>{}}]); 2//# sourceMappingURL=reset-password.25dba3e1263cd72fc656.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.