1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1831],{12620:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/password-reset/[token]",function(){return t(13817)}])},13817:(e,s,t)=>{"use strict";t.r(s),t.d(s,{__N_SSP:()=>l,default:()=>r});var a=t(67544),l=!0;let r=a.default},43848:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});var a=t(55024),l=t(13005);class r extends l.Ay{static async fetchOrganizationInfo(e){let s=a.J.BASE_URL()+"/api/organizations/"+e+"/info";return await this.fetchApi(l.U0.get,s)}}},67544:(e,s,t)=>{"use strict";t.r(s),t.d(s,{__N_SSP:()=>S,default:()=>P,getCustomerPasswordResetTokenProps:()=>C});var a=t(50979),l=t(84614),r=t(25963),o=t(8119),n=t(5208),d=t(89723),i=t(10400),c=t(8320),u=t(85739),h=t(8563),w=t(46033),p=t(58547),m=t(53113),g=t(33792),f=t(92458),x=t(55024),v=t(91993),j=t(5054),N=t(27984),_=t(58411),y=t(90682),R=t(81438);let A=e=>{var s,t,A,k;let{t:b}=(0,l.Bd)("auth"),S=(0,f.br)(),{seller:C}=(0,g.hn)(),P=(0,n.C)(),[E,I]=(0,r.useState)(!1),U=(0,r.useRef)({sellerId:(null==C?void 0:C._id)||"",password:"",passwordRepeat:""}).current,z=p.Q.setNewPassword.append({passwordRepeat:m.s.password.required().valid(d.A.ref("password")).messages({"any.only":b("auth:passwordReset.passwordsDoNotMatch")})}),L=(0,w.e)(U,new u.A({},z));if((0,r.useEffect)(()=>{_.v.applyCheckoutStyling({theme:"white",accentColor:(null==C?void 0:C.accentColor)||"#000000",sellerInfo:C})},[]),!C)return(0,a.jsx)(R.M,{code:404,message:b("seller:sellerCouldNotBeFound")});let B=async()=>{if(L.check(),L.hasErrors())return P();o.Ay.start();try{let{passwordRepeat:s,...t}=U;await v.A.setPassword(e.token,t),I(!0)}catch(e){j.X.info({title:b("common:errors.failed"),message:b("auth:passwordReset.couldNotSetPassword")})}finally{o.Ay.stop()}},F=(0,f.oU)({_id:C._id},S);return(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"account-grid",children:[(0,a.jsx)("div",{className:"account-left",children:(0,a.jsx)("div",{className:"account-left",children:(null==(s=C.brandingSettings)?void 0:s.customLogo)?(0,a.jsx)("a",{href:x.J.getValidUrl(C.brandingSettings.shopLogoUrl||F),children:(0,a.jsx)("img",{src:x.J.CDN_URL()+"/image?width=120&url="+C.brandingSettings.customLogo,alt:C.name})}):(0,a.jsx)(N.A,{className:"vi-w-36"})})}),(0,a.jsxs)("div",{className:"account-right",children:[(0,a.jsx)("div",{className:"mini-container",children:E?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"h2",children:b("auth:passwordReset.passwordResetted")}),(0,a.jsx)("div",{className:"text-muted mb-24",children:b("auth:passwordReset.passwordSuccessfullyResetted")}),(null==(k=null==(A=C.shopSettings)||null==(t=A.accountPages)?void 0:t.personalInformation.visible)||k)&&(0,a.jsx)("a",{className:"btn default",href:(0,f.oU)(C,S)+"/account/edit",children:b("common:myAccount")}),(0,a.jsx)("a",{className:"btn ml-12 bordered",href:(0,f.oU)(C,S),children:b("auth:passwordReset.sellerPage")})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"h2",children:b("auth:passwordReset.title")}),(0,a.jsx)("div",{className:"text-muted mb-24",children:b("auth:passwordReset.choosePasswordForAccount")}),(0,a.jsxs)(i.Ay,{validator:L,children:[(0,a.jsx)(c.A,{link:new h.a(U,"password"),title:b("common:password"),type:"password"}),(0,a.jsx)(c.A,{link:new h.a(U,"passwordRepeat"),title:b("common:passwordRepeat"),type:"password"})]}),(0,a.jsx)("button",{type:"button",className:"btn default block",onClick:e=>B(),disabled:o.Ay.loading,children:b("auth:passwordReset.definePassword")})]})}),(0,a.jsx)("div",{className:"footer-container",children:(0,a.jsx)(y.S,{hideCookieSettings:!0,sellerId:C._id})})]})]})})};var k=t(43848),b=t(92200),S=!0;let C=async(e,s,t)=>{var a,l;let r=null==(l=e.query)||null==(a=l.token)?void 0:a.toString();try{if(!(r&&t?await v.A.getPasswordReset(r,t):void 0))return{seller:null,organization:null};let a=t?await b.A.fetchSellerInfo(t,e.detectedLocale):void 0,l=(0,f.Wq)(s.domainCtx,null==a?void 0:a._id,null==a?void 0:a.orgId),o=null;return(null==a?void 0:a.orgId)&&(o=await k.A.fetchOrganizationInfo(a.orgId)),s.domainCtx=await l,{seller:null!=a?a:null,organization:o,token:r}}catch(e){}return{seller:null,organization:null}},P=e=>{let{seller:s,organization:t,token:r}=e,{t:o}=(0,l.Bd)(["auth","seller"]);return r?s?(0,a.jsx)(g.O3,{seller:s,organization:null!=t?t:void 0,children:(0,a.jsx)(A,{token:r})}):(0,a.jsx)(R.M,{code:404,message:o("seller:sellerCouldNotBeFound")}):(0,a.jsx)(R.M,{code:400,message:o("auth:passwordReset.tokenExpiredError")})}}},e=>{e.O(0,[7310,95,6878,8367,7681,6707,6099,575,636,6593,8792],()=>e(e.s=12620)),_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.