1"use strict";(self.webpackChunkthnk_client=self.webpackChunkthnk_client||[]).push([[4117],{4117(e,s,a){a.r(s),a.d(s,{default:()=>g});var n=a(7565),l=a(4111),t=a(5544),o=a(1030),r=a(477),i=a(6515),c=a(5823),d=a(9615),u=a(2917),p=a(7849),m=a(866),h=a(4912),w=a(7929);const v=function(){const e=(0,o.Zp)(),s=(0,u.M)().setAlert,a=(0,r.ok)(),l=(0,t.A)(a,2),v=l[0],f=(l[1],(0,n.useMemo)(()=>v.get("h")||"",[v])),g=(0,h.M)("",e=>(0,p.sl)(e)),x=(0,h.M)("",e=>!(0,p.Im)(e)&&e===g.value),y=(0,m.A)("".concat("https://www.thnk.org/api","/user/reset-password/").concat(f)),j=y.result,b=y.doFetch,_=y.loading,N=y.error,C=(0,n.useCallback)(()=>{b({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:g.value})})},[b,g.value]);return(0,n.useEffect)(()=>{j&&"success"===j.status&&(s({message:j.message}),e("/login"))},[e,j,s]),(0,n.useEffect)(()=>{N&&s({message:N.message,status:"error"})},[N,s]),f?(0,w.jsxs)(c.A,{className:"flex gap-sm",inputs:[g,x],onSubmit:C,children:[(0,w.jsx)(d.A,{id:"password",type:"password",name:"password",placeholder:"Enter your new password",label:"New Password",input:g,emptyMessage:"Please fill in your new password",invalidMessage:"Please fill in a valid password, minimum eight characters, one uppercase letter, one lowercase letter, one digit and one special character."}),(0,w.jsx)(d.A,{id:"repeat-new-password",type:"password",name:"repeat-new-password",placeholder:"Repeat your new password",label:"Repeat your new password",input:x,emptyMessage:"Please repeat your new password",invalidMessage:"Your passwords don't match",autoComplete:"off"}),(0,w.jsx)(i.A,{className:"resert-password__btn btn btn--dark",type:"submit",loading:_,children:"Save"})]}):null};var f=a(5776);const g=function(){var e,s,a,t;const o=(0,f.f)(),r=o.data.generalData,i=o.setPage;return(0,n.useEffect)(()=>{i("reset-password")},[i]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(l.mg,{children:[null!==r&&void 0!==r&&null!==(e=r.seo)&&void 0!==e&&e.title?(0,w.jsx)("title",{children:null===r||void 0===r||null===(s=r.seo)||void 0===s?void 0:s.title}):null,null!==r&&void 0!==r&&null!==(a=r.seo)&&void 0!==a&&a.description?(0,w.jsx)("meta",{name:"description",content:null===r||void 0===r||null===(t=r.seo)||void 0===t?void 0:t.description}):null]}),(0,w.jsx)("section",{className:"section",children:(0,w.jsxs)("div",{className:"wrap wrap--xs",children:[(0,w.jsx)("h1",{className:"h2",style:{marginBottom:"24px"},children:"Create new password"}),(0,w.jsx)(v,{})]})})]})}},5823(e,s,a){var n=a(7565),l=a(7929);const t=function(e){let s=e.children,a=e.className,t=e.onSubmit,o=e.inputs;const r=(0,n.useCallback)(e=>{e.preventDefault();const s=[];o.forEach(e=>{var a;e.isValid||(e.setShowError(!0),s.length||null===(a=e.ref.current)||void 0===a||a.focus(),s.push(1))}),s.length>0||t&&t()},[o,t]);return(0,l.jsx)("form",{className:a,onSubmit:r,children:s})};a.d(s,["A",0,t])},9615(e,s,a){var n=a(5544),l=a(7565),t=a(477),o=a(2865),r=a(7929);function i(e){let s=e.id,a=e.link,i=e.type,c=e.name,d=e.info,u=e.label,p=e.icon,m=e.placeholder,h=e.emptyMessage,w=e.invalidMessage,v=e.className,f=e.disabled,g=e.input,x=e.autoComplete,y=void 0===x?"on":x,j=e.onFocus,b=e.onBlur,_=e.readOnly;const N=(0,l.useState)(i),C=(0,n.A)(N,2),k=C[0],E=C[1],A=(0,l.useMemo)(()=>g.showError?g.isEmpty?"empty":g.isValid?"":"invalid":"",[g.showError,g.isEmpty,g.isValid]),M=(0,l.useCallback)(()=>{j&&j()},[j]),S=(0,l.useCallback)(()=>{b&&b()},[b]);return(0,r.jsxs)("div",{className:"input".concat(A?" error":"").concat(p?" with-icon":"").concat(v?" ".concat(v):""),children:[u||a?(0,r.jsxs)("div",{className:"input__header",children:[u?(0,r.jsx)("label",{className:"input__label body-label",htmlFor:s,children:u}):null,a?(0,r.jsx)(t.N_,{className:"input__link",to:a.href,children:a.text}):null]}):null,(0,r.jsxs)("div",{className:"input__wrapper",children:[(0,r.jsx)("input",{id:s,autoComplete:y,type:k||"text",name:c,value:g.value,onChange:g.onChange,placeholder:m,disabled:f,readOnly:_,onFocus:M,onBlur:S,ref:g.ref,className:"input__field".concat("password"===i?" input__field--password":"")}),"password"!==i?null:(0,r.jsxs)("button",{className:"input__btn",type:"button",onClick:()=>E("password"===k?"text":"password"),children:[(0,r.jsx)("span",{className:"sr-only",children:"Change input type"}),"password"===k?(0,r.jsx)(o.I.Eye,{className:"icon-large"}):(0,r.jsx)(o.I.EyeClosed,{className:"icon-large"})]}),p?(0,r.jsx)("span",{className:"input__icon",children:p}):null,d?(0,r.jsx)("div",{className:"input__info caption",children:d}):null]}),A?(0,r.jsx)("div",{className:"input__error",children:(0,r.jsx)("span",{children:"empty"===A?h:"invalid"===A?w:""})}):null]})}const c=(0,l.memo)(i);a.d(s,["A",0,c])},4912(e,s,a){var n=a(5544),l=a(7565),t=a(7849);a.d(s,["M",0,function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;const a=(0,l.useState)(e),o=(0,n.A)(a,2),r=o[0],i=o[1],c=(0,l.useState)(s(r)),d=(0,n.A)(c,2),u=d[0],p=d[1],m=(0,l.useState)(!0),h=(0,n.A)(m,2),w=h[0],v=h[1],f=(0,l.useState)(!1),g=(0,n.A)(f,2),x=g[0],y=g[1],j=(0,l.useRef)(null);(0,l.useEffect)(()=>{i(e)},[e]),(0,l.useEffect)(()=>{y(!1),v((0,t.Im)(r)),p(s(r))},[r]);const b=(0,l.useCallback)(e=>{y(!1);const a=e.currentTarget.value;i(a),v((0,t.Im)(a)),p(s(a))},[s]);return(0,l.useMemo)(()=>({value:r,onChange:b,isValid:u,isEmpty:w,showError:x,setShowError:y,setValue:i,ref:j}),[w,u,b,x,r])}])}}]); 2//# sourceMappingURL=4117.4f135fbf.chunk.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.