(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),a=n(54),o=n(48397),c=n(1864);function u(e){var s=e.title,n=(0,a.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!==o.Z&&void 0!==o.Z?o.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),a=n(26042),o=n(69396),c=n(34051),u=n.n(c),d=n(14670),l=n(79531),p=n(71577),x=n(67294),h=n(61429),f=n(17682),g=n(40981),w=n(2391),j=n(9125),m=n(7772),y=n(92771),v=n(11163);function Z(e){var s=e.passwordResetId,n=(0,f.Z)(),t=n.account,c=n.siteName,Z=(0,x.useState)(""),S=Z[0],_=Z[1],C=(0,x.useState)(!1),k=C[0],E=C[1],P=(0,x.useState)(""),I=P[0],N=P[1],R=(0,x.useState)(""),T=R[0],z=R[1],F=(0,v.useRouter)();function Y(){return B.apply(this,arguments)}function B(){return(B=(0,i.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,N(""),z(""),E(!0),e.next=8,(0,j.Z)("/auth/redeem-password-reset",{password:S,passwordResetId:s});case 8:F.reload(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),N("".concat(e.t0));case 14:return e.prev=14,E(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})))).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 ",c," Password"]})]}),t&&(0,r.jsx)("div",{style:w.E,children:(0,r.jsx)(d.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:w.E,children:[(0,r.jsxs)("div",{style:{margin:"10px 0"},children:["Choose a new ",c," password:"]}),(0,r.jsxs)("form",{children:[(0,r.jsx)(l.Z.Password,{style:{fontSize:"13pt"},autoFocus:!0,placeholder:"New Password",autoComplete:"username",value:S,onChange:function(e){_(e.target.value),N(""),z("")},onPressEnter:function(e){e.preventDefault(),!k&&b(S)&&Y()}}),S&&(0,r.jsx)(p.Z,{disabled:k||!b(S),shape:"round",size:"large",type:"primary",style:{width:"100%",marginTop:"20px"},onClick:Y,children:k?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Icon,{name:"spinner",spin:!0})," Changing password..."]}):b(S)?"Change Password":"Enter password (at least 6 characters)."})]}),I&&(0,r.jsx)(d.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)(y.Z,{lower:!0}),"."]}),type:"error",showIcon:!0}),T&&(0,r.jsx)(d.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,o.Z)((0,a.Z)({},w.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 ",c," without creating an account"]})]})]})]})}function b(e){return e.length>=6}var S=n(31910),_=n(73306),C=n(31498),k=n(54),E=!0;function P(e){var s=e.passwordResetId,n=e.customize;return(0,r.jsxs)(k.l,{value:n,children:[(0,r.jsx)(_.Z,{title:"Password Reset"}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(C.Z,{page:"sign-in",subPage:"password-reset"}),(0,r.jsxs)(t.Z.Content,{style:{backgroundColor:"white"},children:[(0,r.jsx)(Z,{passwordResetId:s}),(0,r.jsx)(S.Z,{})]})]})]})}}},function(e){e.O(0,[5386,1271,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}]);