(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[159],{91243:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/password-reset/[id]",function(){return n(27183)}])},2391:function(e,s,n){"use strict";n.d(s,{E:function(){return r}});var r={maxWidth:"400px",margin:"auto",border:"1px solid lightgrey",borderRadius:"5px",padding:"10px 20px 20px 20px",backgroundColor:"#fafafa",fontSize:"12pt",color:"#606060"}},73306:function(e,s,n){"use strict";n.d(s,{Z:function(){return u}});var r=n(85893),t=n(9008),i=n.n(t),o=n(54),a=n(48397),c=n(1864);function u(e){var s=e.title,n=(0,o.i)().siteName;return(0,r.jsxs)(i(),{children:[(0,r.jsxs)("title",{children:[n," ",n?"\u2013":""," ",s]}),(0,r.jsx)("meta",{name:"description",content:"CoCalc landing pages and documentation"}),(0,r.jsx)("link",{rel:"icon",href:(0,c.join)(null!==a.Z&&void 0!==a.Z?a.Z:"","/webapp/favicon-32x32.png")})]})}},27183:function(e,s,n){"use strict";n.r(s),n.d(s,{__N_SSP:function(){return E},default:function(){return P}});var r=n(85893),t=n(97183),i=n(47568),o=n(26042),a=n(69396),c=n(70655),u=n(14670),d=n(79531),l=n(71577),p=n(67294),h=n(61429),x=n(17682),g=n(40981),f=n(2391),j=n(9125),w=n(7772),m=n(92771),y=n(11163);function v(e){var s=e.passwordResetId,n=(0,x.Z)(),t=n.account,v=n.siteName,b=(0,p.useState)(""),_=b[0],S=b[1],C=(0,p.useState)(!1),E=C[0],P=C[1],k=(0,p.useState)(""),I=k[0],N=k[1],R=(0,p.useState)(""),T=R[0],z=R[1],F=(0,y.useRouter)();function Y(){return B.apply(this,arguments)}function B(){return(B=(0,i.Z)((function(){var e,n;return(0,c.__generator)(this,(function(r){switch(r.label){case 0:if(E)return[2];r.label=1;case 1:return r.trys.push([1,3,4,5]),N(""),z(""),P(!0),e={},[4,(0,j.Z)("/auth/redeem-password-reset",(e.password=_,e.passwordResetId=s,e))];case 2:return r.sent(),F.reload(),[3,5];case 3:return n=r.sent(),N("".concat(n)),[3,5];case 4:return P(!1),[7];case 5:return[2]}}))}))).apply(this,arguments)}return(0,r.jsxs)("div",{style:{padding:"15px"},children:[(0,r.jsxs)("div",{style:{textAlign:"center",marginBottom:"15px"},children:[(0,r.jsx)(h.Z,{style:{width:"100px",height:"100px"}}),(0,r.jsxs)("h1",{children:[t?"Successfully ":"","Reset Your ",v," Password"]})]}),t&&(0,r.jsx)("div",{style:f.E,children:(0,r.jsx)(u.Z,{style:{marginTop:"20px"},message:(0,r.jsx)("b",{children:"Success"}),description:(0,r.jsx)("div",{style:{fontSize:"12pt"},children:"Password successfully set. You are now signed in using your new password."}),type:"success",showIcon:!0})}),!t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:f.E,children:[(0,r.jsxs)("div",{style:{margin:"10px 0"},children:["Choose a new ",v," password:"]}),(0,r.jsxs)("form",{children:[(0,r.jsx)(d.Z.Password,{style:{fontSize:"13pt"},autoFocus:!0,placeholder:"New Password",autoComplete:"username",value:_,onChange:function(e){S(e.target.value),N(""),z("")},onPressEnter:function(e){e.preventDefault(),!E&&Z(_)&&Y()}}),_&&(0,r.jsx)(l.Z,{disabled:E||!Z(_),shape:"round",size:"large",type:"primary",style:{width:"100%",marginTop:"20px"},onClick:Y,children:E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Icon,{name:"spinner",spin:!0})," Changing password..."]}):Z(_)?"Change Password":"Enter password (at least 6 characters)."})]}),I&&(0,r.jsx)(u.Z,{style:{marginTop:"20px"},message:"Error",description:(0,r.jsxs)("div",{style:{fontSize:"12pt"},children:[(0,r.jsx)("b",{children:I}),(0,r.jsx)("br",{})," If you are stuck ",(0,r.jsx)(m.Z,{lower:!0}),"."]}),type:"error",showIcon:!0}),T&&(0,r.jsx)(u.Z,{style:{marginTop:"20px"},message:(0,r.jsx)("b",{children:"Success"}),description:(0,r.jsx)("div",{style:{fontSize:"12pt"},children:T}),type:"success",showIcon:!0})]}),(0,r.jsxs)("div",{style:(0,a.Z)((0,o.Z)({},f.E),{backgroundColor:"white",marginTop:"30px",marginBottom:"30px",paddingTop:"15px"}),children:[(0,r.jsxs)("p",{children:["Remember your password? ",(0,r.jsx)(g.Z,{href:"/auth/sign-in",children:"Sign In"})]}),"You can also"," ",(0,r.jsxs)(g.Z,{href:"/auth/try",children:["use ",v," without creating an account"]})]})]})]})}function Z(e){return e.length>=6}var b=n(31910),_=n(73306),S=n(31498),C=n(54),E=!0;function P(e){var s=e.passwordResetId,n=e.customize;return(0,r.jsxs)(C.l,{value:n,children:[(0,r.jsx)(_.Z,{title:"Password Reset"}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(S.Z,{page:"sign-in",subPage:"password-reset"}),(0,r.jsxs)(t.Z.Content,{style:{backgroundColor:"white"},children:[(0,r.jsx)(v,{passwordResetId:s}),(0,r.jsx)(b.Z,{})]})]})]})}}},function(e){e.O(0,[5386,7324,4089,7731,6747,6994,4953,9066,6735,9774,2888,179],(function(){return s=91243,e(e.s=s);var s}));var s=e.O();_N_E=s}]);