1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[906],{5881:function(e,t,r){"use strict";var n=r(2122),a=r(2949),s=r(7294),i=(r(5122),r(6010)),o=r(4670),c=s.forwardRef((function(e,t){var r=e.children,o=e.classes,c=e.className,l=e.component,u=void 0===l?"div":l,d=e.onChange,p=e.showLabels,m=void 0!==p&&p,f=e.value,h=(0,a.Z)(e,["children","classes","className","component","onChange","showLabels","value"]);return s.createElement(u,(0,n.Z)({className:(0,i.Z)(o.root,c),ref:t},h),s.Children.map(r,(function(e,t){if(!s.isValidElement(e))return null;var r=void 0===e.props.value?t:e.props.value;return s.cloneElement(e,{selected:r===f,showLabel:void 0!==e.props.showLabel?e.props.showLabel:m,value:r,onChange:d})})))}));t.Z=(0,o.Z)((function(e){return{root:{display:"flex",justifyContent:"center",height:56,backgroundColor:e.palette.background.paper}}}),{name:"MuiBottomNavigation"})(c)},8665:function(e,t,r){"use strict";var n=r(2122),a=r(2949),s=r(7294),i=r(6010),o=r(4670),c=r(2467),l=s.forwardRef((function(e,t){var r=e.classes,o=e.className,l=e.icon,u=e.label,d=e.onChange,p=e.onClick,m=e.selected,f=e.showLabel,h=e.value,x=(0,a.Z)(e,["classes","className","icon","label","onChange","onClick","selected","showLabel","value"]);return s.createElement(c.Z,(0,n.Z)({ref:t,className:(0,i.Z)(r.root,o,m?r.selected:!f&&r.iconOnly),focusRipple:!0,onClick:function(e){d&&d(e,h),p&&p(e)}},x),s.createElement("span",{className:r.wrapper},l,s.createElement("span",{className:(0,i.Z)(r.label,m?r.selected:!f&&r.iconOnly)},u)))}));t.Z=(0,o.Z)((function(e){return{root:{transition:e.transitions.create(["color","padding-top"],{duration:e.transitions.duration.short}),padding:"6px 12px 8px",minWidth:80,maxWidth:168,color:e.palette.text.secondary,flex:"1","&$iconOnly":{paddingTop:16},"&$selected":{paddingTop:6,color:e.palette.primary.main}},selected:{},iconOnly:{},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"},label:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(12),opacity:1,transition:"font-size 0.2s, opacity 0.2s",transitionDelay:"0.1s","&$iconOnly":{opacity:0,transitionDelay:"0s"},"&$selected":{fontSize:e.typography.pxToRem(14)}}}}),{name:"MuiBottomNavigationAction"})(l)},5477:function(e,t,r){"use strict";var n=r(2122),a=r(2949),s=r(7294),i=r(6010),o=r(4670),c=r(3871),l=44,u=s.forwardRef((function(e,t){var r=e.classes,o=e.className,u=e.color,d=void 0===u?"primary":u,p=e.disableShrink,m=void 0!==p&&p,f=e.size,h=void 0===f?40:f,x=e.style,v=e.thickness,Z=void 0===v?3.6:v,y=e.value,j=void 0===y?0:y,b=e.variant,w=void 0===b?"indeterminate":b,g=(0,a.Z)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),k={},P={},N={};if("determinate"===w||"static"===w){var C=2*Math.PI*((l-Z)/2);k.strokeDasharray=C.toFixed(3),N["aria-valuenow"]=Math.round(j),k.strokeDashoffset="".concat(((100-j)/100*C).toFixed(3),"px"),P.transform="rotate(-90deg)"}return s.createElement("div",(0,n.Z)({className:(0,i.Z)(r.root,o,"inherit"!==d&&r["color".concat((0,c.Z)(d))],{determinate:r.determinate,indeterminate:r.indeterminate,static:r.static}[w]),style:(0,n.Z)({width:h,height:h},P,x),ref:t,role:"progressbar"},N,g),s.createElement("svg",{className:r.svg,viewBox:"".concat(22," ").concat(22," ").concat(l," ").concat(l)},s.createElement("circle",{className:(0,i.Z)(r.circle,m&&r.circleDisableShrink,{determinate:r.circleDeterminate,indeterminate:r.circleIndeterminate,static:r.circleStatic}[w]),style:k,cx:l,cy:l,r:(l-Z)/2,fill:"none",strokeWidth:Z})))}));t.Z=(0,o.Z)((function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:e.transitions.create("transform")},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:e.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(u)},3279:function(e,t,r){"use strict";var n=r(5318),a=r(862);t.Z=void 0;
1var s=a(r(7294)),i=(0,n(r(2108)).default)(s.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"}),"Message");t.Z=i},8551:function(e,t,r){"use strict";var n=r(5318),a=r(862);t.Z=void 0;var s=a(r(7294)),i=(0,n(r(2108)).default)(s.createElement(s.Fragment,null,s.createElement("circle",{cx:"12",cy:"12",r:"3.2"}),s.createElement("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})),"PhotoCamera");t.Z=i},9969:function(e,t,r){"use strict";var n=r(5318),a=r(862);t.Z=void 0;var s=a(r(7294)),i=(0,n(r(2108)).default)(s.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");t.Z=i},1039:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var n=r(5893),a=r(9659),s=r(7294),i=r(5881),o=r(8665),c=r(9895),l=r(442),u=r(3279),d=r(9969);function p(e){var t=(0,s.useState)(e.selected),r=t[0],p=t[1];return(0,n.jsx)(c.Z,{elevation:1,children:(0,n.jsxs)(i.Z,{value:r,onChange:function(e,t){p(t)},showLabels:!0,children:[(0,n.jsx)(o.Z,{component:a.Z,href:"/user",label:"Dashboard",icon:(0,n.jsx)(l.Z,{})}),(0,n.jsx)(o.Z,{component:a.Z,href:"/user/blogs",label:"Your Stories",icon:(0,n.jsx)(u.Z,{})}),(0,n.jsx)(o.Z,{component:a.Z,href:"/user/account",label:"Account",icon:(0,n.jsx)(d.Z,{})})]})})}},1042:function(e,t,r){"use strict";r.r(t);var n=r(5893),a=r(6265),s=r(809),i=r.n(s),o=r(2447),c=r(4121),l=r(7294),u=r(9008),d=r(5567),p=r(1039),m=r(2157),f=r(282),h=r(1964),x=r(8551),v=r(1120),Z=r(1749),y=r(3832),j=r(4562),b=r(9956),w=r(2318),g=r(6912),k=r(5517),P=r(5477);function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=(0,v.Z)((function(e){return{input:{display:"none"},paper:{marginTop:e.spacing(3),display:"flex",flexDirection:"column",alignItems:"center"},form:{width:"100%",marginTop:e.spacing(3)},submit:{margin:e.spacing(3,0,2)}}})),O=function(){var e,t=D(),r=(0,d.x)(),s=(0,c.Z)(r,2),v=s[0],N=s[1].mutate;if(!v)return(0,n.jsxs)(Z.Z,{align:"center",children:[(0,n.jsx)(b.Z,{my:7,children:(0,n.jsx)(P.Z,{})})," "]});var O=v||{},S=O._id,E=O.name,T=(0,l.useState)(!1),R=T[0],z=T[1],L=(0,l.useRef)(),W=(0,l.useRef)(),_=(0,l.useRef)(),F=(0,l.useState)([]),M=F[0],H=F[1],I=(0,l.useState)(!1),V=I[0],q=I[1];(0,l.useEffect)((function(){L.current.value=v.name,W.current.value=v.bio}),[v]);var A=function(){var e=(0,o.Z)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_.current.files[0]?document.querySelector("#button-file-upload").textContent=_.current.files[0].name:document.querySelector("#button-file-upload").textContent="Upload";case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$=function(e,t){"clickaway"!==t&&q(!1)},Y=function(){var e=(0,o.Z)(i().mark((function e(t){var r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!R){e.next=3;break}return e.abrupt("return");case 3:return z(!0),r=new FormData,_.current.files[0]&&r.append("profilePic",_.current.files[0]),r.append("name",L.current.value),r.append("bio",W.current.value),e.next=10,fetch("/api/user",{method:"PATCH",body:r});case 10:if(200!==(n=e.sent).status){e.next=19;break}return e.next=14,n.json();case 14:a=e.sent,N({user:C(C({},v),a.user)}),H(["success","Profile updated"]),e.next=25;break;case 19:return e.t0=H,e.next=22,n.text();case 22:e.t1=e.sent,e.t2=["error",e.t1],(0,e.t0)(e.t2);case 25:q(!0);case 26:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),B=function(){var e=(0,o.Z)(i().mark((function e(t){var r,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),t.currentTarget.newPassword.value==t.currentTarget.newPasswordRepeat.value){e.next=5;break}return H(["warning","New passwords do not match"]),q(!0),e.abrupt("return");
1case 5:return r={oldPassword:t.currentTarget.oldPassword.value,newPassword:t.currentTarget.newPassword.value},t.currentTarget.oldPassword.value="",t.currentTarget.newPassword.value="",e.next=10,fetch("/api/user/password",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});case 10:if(200!==(n=e.sent).status){e.next=15;break}H(["success","Password updated"]),e.next=21;break;case 15:return e.t0=H,e.next=18,n.text();case 18:e.t1=e.sent,e.t2=["error",e.t1],(0,e.t0)(e.t2);case 21:q(!0);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function U(){return(U=(0,o.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/user/email/verify",{method:"POST"});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.default,{children:(0,n.jsxs)("title",{children:[E," - Account | Settings"]})}),(0,n.jsx)(k.Z,{}),(0,n.jsx)(p.Z,{selected:2,userId:S}),(0,n.jsx)(y.Z,{maxWidth:"lg",children:(0,n.jsxs)(b.Z,{my:3,children:[(0,n.jsx)(Z.Z,{container:!0,justify:"center",children:(0,n.jsxs)(w.Z,{variant:"h4",className:"mb-3",children:["Your Account",(0,n.jsx)(k.Z,{})]})}),(0,n.jsxs)(Z.Z,{container:!0,direction:"row",justify:"center",alignItems:"flex-start",children:[(0,n.jsx)(Z.Z,{item:!0,xs:12,md:6,children:(0,n.jsx)(b.Z,{mb:3,children:(0,n.jsx)(y.Z,{component:"main",maxWidth:"xs",children:(0,n.jsxs)("section",{children:[(0,n.jsx)(w.Z,{variant:"h5",className:"mb-1",children:"Edit Profile"}),(0,n.jsxs)("form",{onSubmit:Y,children:[v.emailVerified?(0,n.jsx)(b.Z,{my:3,children:(0,n.jsxs)(j.Z,{severity:"success",children:["Your email has been verified."," "]})}):(0,n.jsx)(b.Z,{my:3,children:(0,n.jsxs)(j.Z,{severity:"error",children:["Your email has not been verified."," ",(0,n.jsx)(f.Z,{role:"button",onClick:function(){return U.apply(this,arguments)},children:"ReSend verification email"})]})}),(0,n.jsxs)(Z.Z,{container:!0,spacing:2,children:[(0,n.jsx)(Z.Z,{item:!0,xs:12,children:(0,n.jsx)(m.Z,{autoComplete:"name",name:"name",variant:"outlined",required:!0,fullWidth:!0,id:"name",label:"Name or Nickname",defaultValue:v.name,inputRef:L,autoFocus:!0})}),(0,n.jsx)(Z.Z,{item:!0,xs:12,children:(0,n.jsx)(m.Z,{autoComplete:"bio",name:"bio",variant:"outlined",fullWidth:!0,id:"bio",label:"About you",defaultValue:v.bio,inputRef:W,inputProps:{maxLength:100},multiline:!0})}),(0,n.jsx)(b.Z,{my:4,children:(0,n.jsxs)(Z.Z,{container:!0,xs:12,children:[(0,n.jsx)(h.Z,{userName:v.name,userPic:v.profilePic}),(0,n.jsx)("input",(e={accept:"image/png, image/jpeg",className:t.input,onChange:A,id:"avatar",name:"avatar"},(0,a.Z)(e,"id","icon-button-file"),(0,a.Z)(e,"type","file"),(0,a.Z)(e,"ref",_),e)),(0,n.jsx)("label",{htmlFor:"icon-button-file",children:(0,n.jsxs)(f.Z,{color:"primary","aria-label":"upload picture",component:"span",children:[(0,n.jsx)(x.Z,{}),(0,n.jsx)(w.Z,{className:"ml-2",variant:"body2",children:(0,n.jsxs)("span",{id:"button-file-upload",children:[v.profilePic?"Replace":"Upload"," Image"]})})]})})]})})]}),(0,n.jsx)(f.Z,{fullWidth:!0,color:"primary",className:"mt-2",variant:"outlined",disabled:R,type:"submit",children:"Save"})]})]})})})}),(0,n.jsx)(Z.Z,{item:!0,xs:12,md:6,children:(0,n.jsx)(y.Z,{component:"main",maxWidth:"xs",children:(0,n.jsxs)(b.Z,{mb:1,children:[(0,n.jsx)(w.Z,{variant:"h5",className:"mb-1",children:"Change Password"}),(0,n.jsx)(b.Z,{my:3,children:(0,n.jsxs)("form",{onSubmit:B,children:[(0,n.jsxs)(Z.Z,{container:!0,spacing:2,children:[(0,n.jsx)(Z.Z,{item:!0,xs:12,children:(0,n.jsx)(m.Z,{variant:"outlined",required:!0,fullWidth:!0,name:"oldPassword",label:"Current Password",type:"password",id:"oldpassword"})}),(0,n.jsx)(Z.Z,{item:!0,xs:12,children:(0,n.jsx)(m.Z,{variant:"outlined",required:!0,fullWidth:!0,name:"newPassword",label:"New Password",type:"password",id:"newpassword"})}),(0,n.jsx)(Z.Z,{item:!0,xs:12,children:(0,n.jsx)(m.Z,{variant:"outlined",required:!0,fullWidth:!0,name:"newPasswordRepeat",label:"Repeat New Password",type:"password",id:"newpasswordRepeat"})})]}),(0,n.jsx)(f.Z,{fullWidth:!0,color:"primary",variant:"outlined",className:"mt-2",type:"submit",children:"Change Password"})]})})]})})})]}),(0,n.jsx)(g.Z,{open:V,autoHideDuration:6e3,onClose:$,children:(0,n.jsx)(j.Z,{onClose:$,severity:M[0],children:M[1]})})]})})]})};t.default=function(){var e=(0,d.x)();return(0,c.Z)(e,1)[0]?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(O,{})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Z.Z,{container:!0,justify:"center",children:(0,n.jsx)(b.Z,{my:12,children:(0,n.jsx)(P.Z,{})})})})}},6522:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/account",function(){return r(1042)}])}},function(e){e.O(0,[918,170,774,888,179],(function(){return t=6522,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.