1"use strict";(self.webpackChunk_vndr_ship_client=self.webpackChunk_vndr_ship_client||[]).push([[9340],{29340(e,t,s){s.r(t),s.d(t,{default:()=>f});var a=s(98477),n=s(39698),o=s(67252),r=s(71288),i=s(57863),l=s(84489),d=s(14618),u=s(16536),c=s(79121),v=s(53292),h=s(58072),m=s(75252),p=s(63096),x=s(76276),A=s(28872);const g="invalid",w="valid",y="checking",f=()=>{const e=(0,o.useState)(y),t=(0,n.A)(e,2),s=t[0],f=t[1],j=(0,i.useParams)().token,C=(0,r.useDispatch)(),S=(0,x.A)(),k=S.toastError,b=S.toastInfo,P=S.toastSuccess,_=(0,i.useHistory)(),E=(0,r.useSelector)(e=>{var t,s,a;return{isAuthenticated:!(null===e||void 0===e||null===(t=e.auth)||void 0===t||null===(s=t.user)||void 0===s||!s._id),user:null===e||void 0===e||null===(a=e.auth)||void 0===a?void 0:a.user}}),F=E.isAuthenticated,I=E.user,O=(0,o.useState)(""),N=(0,n.A)(O,2),H=N[0],W=N[1];(0,o.useEffect)(()=>{document.title="Reset Password - ShipFare"},[]);const D={NEED_EMAIL_VERIFICATION:(0,A.jsxs)(A.Fragment,{children:["Please verify your account by signing in through the link sent to your email address. Click"," ",(0,A.jsx)("a",{href:"#",onClick:()=>{(async()=>{try{var e;const t=await d.FH.post("/auth/v1/resend-verification-link",{email:H});C((0,h.Gg)((0,a.A)({notice:null===t||void 0===t||null===(e=t.data)||void 0===e?void 0:e.message,autoHideDuration:3e4,closeOnClickAway:!1},p.Ay.INFO)))}catch(s){var t;console.log(s);const e=(null===s||void 0===s||null===(t=s.response)||void 0===t?void 0:t.data)||"Error sending the verification link, please contact support";k(e)}})()},className:"tw-text-red-500",children:"here"})," ","to resend the link"]})};return(0,o.useEffect)(()=>{"byPass"!==j?(async()=>{try{const e=(await d.FH.get("/auth/v1/reset-password/".concat(j))).data;f(w),W(null===e||void 0===e?void 0:e.email)}catch(t){var e;f(g),k((null===t||void 0===t||null===(e=t.response)||void 0===e?void 0:e.data)||(null===t||void 0===t?void 0:t.message)||"Something Went Wrong")}})():f(w)},[j,C,k]),s===y?(0,A.jsx)(c.A,{}):s===g?F?(0,A.jsx)(i.Redirect,{to:"/auth/reset-password/byPass"}):(0,A.jsx)(i.Redirect,{to:"/login"}):(0,A.jsx)(v.A,{children:(0,A.jsx)(l.l1,{initialValues:{password:"",confirmPassword:"",userId:null===I||void 0===I?void 0:I._id},validationSchema:u.Oh,onSubmit:async(e,t)=>{let s=t.setSubmitting,n=t.setStatus,o=t.resetForm;n(),s(!0);try{const t=await d.FH.post("/auth/v1/reset-password/".concat(j),(0,a.A)((0,a.A)({},e),{},{userAgent:window.navigator.userAgent}));if(s(!1),P(t.data.message),!t.headers["x-authorization"])return s(!1),o(),b(t.data);C((0,h.iD)({response:t})),_.replace("/")}catch(i){var r;console.log("response",i),s(!1),n({error:(null===i||void 0===i||null===(r=i.response)||void 0===r?void 0:r.data)||(null===i||void 0===i?void 0:i.message)||"Something Went Wrong"})}},children:e=>{let t=e.isSubmitting,s=e.status;return(0,A.jsx)(l.lV,{children:(0,A.jsxs)(l.Zp,{title:"Update Password",className:"tw-mt-16",children:[(0,A.jsx)(m.A,{name:"password",label:"Password",autoCapitalize:"off"}),(0,A.jsx)(m.A,{name:"confirmPassword",label:"Confirm Password",autoCapitalize:"off"}),(0,A.jsx)("div",{children:(0,A.jsx)(l.$n,{loading:t,disabled:t,variant:"outlined",type:"submit",children:"Update Password"})}),s&&s.error?(0,A.jsx)(l.o5,{className:"tw-text-red-600",children:D[s.error]||s.error}):null]})})}})})}},53292(e,t,s){s.d(t,{A:()=>i});var a=s(98477),n=s(37643),o=(s(67252),s(28872));const r=["center","style"],i=e=>{e.center;const t=e.style,s=void 0===t?{}:t,i=(0,n.A)(e,r),l=(0,a.A)({width:"400px",maxWidth:"90vw",margin:"20px auto"},s);return(0,o.jsx)("div",(0,a.A)({style:l},i))}},75252(e,t,s){s.d(t,{A:()=>h});var a=s(98477),n=s(37643),o=s(39698),r=s(67252),i=s(67973),l=s(84489),d=s(45851),u=s(36128),c=s(28872);const v=["variant","readOnly","autoComplete","maxLength","rootClass","outlineClass","underlineClass","transform","iconStyles"],h=e=>{const t=(0,r.useState)(!1),s=(0,o.A)(t,2),h=s[0],m=s[1],p=(0,i.Mt)(e),x=(0,o.A)(p,3),A=x[0],g=x[1],w=x[2],y=e.variant,f=void 0===y?"outlined":y,j=e.readOnly,C=e.autoComplete,S=e.maxLength,k=(e.rootClass,e.outlineClass,e.underlineClass,e.transform),b=void 0===k?e=>e:k,P=e.iconStyles,_=void 0===P?{}:P,E=(0,n.A)(e,v),F=A.name,I=g.touched,O=g.error;return(0,c.jsxs)("div",{children:[(0,c.jsx)(l.A_,(0,a.A)((0,a.A)((0,a.A)({},A),E),{},{error:!(!I||!O),id:F,sx:{width:"100%"},variant:f,autoComplete:C||F,readOnly:j,endAdornment:(0,c.jsx)(l.K0,{style:_,onClick:()=>m(!h),children:h?(0,c.jsx)(d.bvC,{}):(0,c.jsx)(d.QM4,{})}),maxLength:S,type:h?"text":"password",onChange:e=>{w.setValue(b(e.target.value))}})),(0,c.jsx)(u.A,{name:F})]})}}}]);
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.