PageSourceSearch

https://www.my2cents.io/_next/static/chunks/pages/profile/settings-ad99b630116f959dbd6f.js

js my2cents.io collected 2026-10-07 18:32:49 UTC 16,465 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8353],{20401:function(e,t,r){"use strict";var n=r(35774),a=r(55141),s=r(97646),l=r(32589),o=r(45241),i=r(4477),u=r(41664),c=r(11163),d=r(67294),f=r(93942),p=r(85893);t.Z=function(){var e=(0,f.v9)(o.Z).currentUser,t=(0,d.useContext)(a.N).theme,r=(0,d.useState)(0),h=r[0],x=r[1],m=(0,c.useRouter)();(0,d.useEffect)((function(){var e;x((e=i.mh,Math.floor(Math.random()*e.length)))}),[m.asPath]);var b=[{title:"Profile",Icon:n.NZ,href:"/profile"},{title:"Activity",Icon:n.cS,href:"/profile/activity"},{title:"Wallet",Icon:n.w5,href:"/profile/wallet"},{title:"Favorite",Icon:n.rF,href:"/profile/favorite-users"},{title:"Troll List",Icon:n.cu,href:"/profile/troll-users"},{title:"Settings",Icon:n.Zr,href:"/profile/settings"},{title:"Stats",Icon:n.jk,href:"/stats"}],w=[{title:"Profile",Icon:n.NZ,href:"/profile"},{title:"Wallet",Icon:n.w5,href:"/profile/wallet"},{title:"Settings",Icon:n.Zr,href:"/profile/settings"}],v="super-admin"===(null===e||void 0===e?void 0:e.role)?w:b;return(0,p.jsxs)("ul",{className:"flex flex-col gap-4",children:[(0,p.jsx)("div",{style:{backgroundImage:"url(".concat("dark"===t?s.Z.src:l.Z.src,")")},className:"h-56 rounded-[18px] w-full flex items-center justify-center dark:bg-color-blue-900",children:(0,p.jsx)("p",{className:"font-normal text-base sm:text-xl text-white text-center w-[95%] sm:w-2/3 m-auto",children:i.mh[h]})}),(0,p.jsx)("ul",{className:"flex justify-center ".concat("super-admin"===(null===e||void 0===e?void 0:e.role)?"sm:justify-start":"sm:justify-between"," flex-wrap gap-5 mb-6 mt-4"),children:v.map((function(e,r){var n=e.title,a=e.Icon,s=e.href;return(0,p.jsx)("li",{className:"flex flex-col items-center",children:(0,p.jsx)(u.default,{href:s,children:(0,p.jsxs)("a",{className:"flex flex-col items-center",children:[(0,p.jsx)("div",{className:"flex items-center justify-center w-16 h-16 cursor-pointer rounded-[18px] ".concat(m.pathname===s?"bg-color-blue dark:bg-color-blue-900":"bg-color-line dark:bg-white dark:bg-opacity-10"),children:(0,p.jsx)(a,{stroke:m.pathname===s?"#FFFFFF":"dark"===t?"white":"#004de5"})}),(0,p.jsx)("span",{className:"dark:text-color-dark-60",children:n})]})})},r)}))})]})}},37629:function(e,t,r){"use strict";r.r(t);var n=r(30266),a=r(809),s=r.n(a),l=r(4477),o=r(15503),i=r(41054),u=r(11163),c=r(67294),d=r(19501),f=r(52585),p=r(67587),h=r(45241),x=r(93942),m=r(85893);t.default=function(){var e=(0,u.useRouter)(),t=(0,x.v9)(h.Z),r=(t.isWithAds,t.currentUser,d.Ry({newEmail:d.Z_(),newPassword:d.Z_().min(8,"The password is too short. It must comprise at least 8 characters."),currentPassword:d.Z_().when("newPassword",{is:function(e){return e&&e.length>7},then:d.Z_().required("The current password is required to set a new password.").min(8,"The password is too short. It must comprise at least 8 characters."),otherwise:d.Z_()}),email:d.Z_().when("newEmail",{is:function(e){return e},then:d.Z_(),otherwise:d.Z_()})})),a=(0,c.useState)({}),b=a[0],w=a[1],v=(0,c.useState)(!1),g=v[0],k=v[1];(0,c.useEffect)((function(){function e(){return(e=(0,n.Z)(s().mark((function e(t){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,p.Ho)(t);case 3:r=e.sent,w(r),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),(0,l.h4)("error",e.t0.message);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}var t=localStorage.getItem("auth_user");t&&function(t){e.apply(this,arguments)}(JSON.parse(t).uid)}),[]);var y=b.email,P=function(){var e=(0,n.Z)(s().mark((function e(t){var r,n,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=t.newEmail||""!=t.newPassword){e.next=2;break}return e.abrupt("return");case 2:if(k(!0),r=o.Z.auth().currentUser,e.prev=4,!t.newEmail||""!=t.newPassword){e.next=14;break}return e.next=8,r.updateEmail(t.newEmail);case 8:return e.next=10,(0,p.oQ)(r.uid,{email:t.newEmail});case 10:(0,l.h4)("success","Your email has been updated."),k(!1),e.next=35;break;case 14:if(!t.newPassword||""!=t.newEmail){e.next=24;break}return n=o.Z.auth.EmailAuthProvider.credential(r.email,t.currentPassword),e.next=18,r.reauthenticateWithCredential(n);case 18:return e.next=20,r.updatePassword(t.newPassword);case 20:(0,l.h4)("success","Your password has been updated."),k(!1),e.next=35;break;case 24:return a=o.Z.auth.EmailAuthProvider.credential(r.email,t.currentPassword),e.next=27,r.updateEmail(t.newEmail);case 27:return e.next=29,r.updatePassword(t.newPassword);case 29:return e.next=31,(0,p.oQ)(r.uid,{email:t.newEmail});case 31:return e.next=33,r.reauthenticateWithCredential(a);case 33:(0,l.h4)("success","Your email & password have been updated."),k(!1);case 35:e.next=41;break;case 37:e.prev=37,e.t0=e.catch(4),(0,l.h4)("error",e.t0.message),k(!1);case 41:case"end":return e.stop()}}),e,null,[[4,37]])})));return function(t){return e.apply(this,arguments)}}(),T=function(){e.push("/profile")};return(0,m.jsx)("div",{className:"w-full h-full",children:(0,m.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,m.jsx)(i.J9,{enableReinitialize:!0,initialValues:{email:y,newEmail:"",currentPassword:"",newPassword:""},validationSchema:r,onSubmit:function(){var e=(0,n.Z)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:function(){return(0,m.jsxs)(i.l0,{className:"w-full",children:[(0,m.jsx)(f.kR,{control:"InputWithLink",type:"password",label:"Current Password",name:"currentPassword"}),(0,m.jsx)(f.kR,{control:"input",type:"password",label:"New Password",name:"newPassword"}),(0,m.jsxs)("div",{className:"flex items-center gap-4 mt-6",children:[(0,m.jsx)("button",{className:"max-w-[fit-content] dark:disabled:bg-color-dark-200 text-white bg-color-blue dark:bg-color-blue-900 py-2 px-4 flex-grow rounded-[24px] font-medium text-[18px]",type:"submit",disabled:g,children:"Save Changes"}),(0,m.jsx)("button",{onClick:T,className:"max-w-[fit-content] text-color-blue bg-color-line dark:bg-color-dark-100 dark:text-white py-2 px-4 flex-grow rounded-[24px] font-medium text-[18px]",children:"Discard"})]})]})}})})})}},49851:function(e,t,r){"use strict";r.r(t);var n=r(30266),a=r(809),s=r.n(a),l=r(52585),o=r(20401),i=r(67587),u=r(45241),c=r(62145),d=r(87570),f=r(4477),p=r(45703),h=r(17969),x=r(15503),m=r(41054),b=r(67294),w=r(93942),v=r(37629),g=r(85893);function k(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}t.default=function(){var e=(0,b.useState)(!1),t=e[0],r=e[1],a=(0,w.v9)(u.Z),y=(a.isWithAds,a.currentUser),P=[{key:"Sure",value:"Sure"},{key:"Nope",value:"Nope"}],T=function(){var e=(0,n.Z)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r(!0),n=x.Z.auth().currentUser,e.prev=2,e.next=5,(0,i.oQ)(n.uid,{storeOnChain:t.storeOnChain});case 5:d.Z.dispatch((0,c.rr)(t.storeOnChain)),(0,f.h4)("success","Profile updated."),r(!1),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(2),(0,f.h4)("error",e.t0.message),r(!1);case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),j=(0,p.d)(),N=j.width,E=j.height;return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(l.Zn,{title:"Profile",hasRightSidebar:!(N<=1024&&E<=768),children:(0,g.jsxs)("div",{className:"w-full h-full px-4 sm:px-0",children:[(0,g.jsx)(o.Z,{}),(0,g.jsx)("div",{className:"w-full py-6",children:(0,g.jsxs)(h.O.Group,{defaultIndex:0,children:[(0,g.jsxs)(h.O.List,{className:"flex border-b border-color-line dark:border-white dark:border-opacity-10",children:[(0,g.jsx)(h.O,{className:function(e){return k("w-1/3 sm:w-1/4 py-6 text-sm sm:text-md leading-5 font-medium  rounded-lg rounded-t-2xl rounded-b-none","ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60 focus:outline-none",e.selected?"bg-color-blue dark:bg-color-blue-900 text-white":"text-color-blue dark:text-color-dark-60 dark:hover:bg-color-blue-900 hover:bg-color-line dark:hover:text-white hover:text-color-blue-900")},children:"Account"}),(0,g.jsx)(h.O,{className:function(e){return k("w-1/3 sm:w-1/4 py-6 text-sm sm:text-md leading-5 font-medium  rounded-lg rounded-t-2xl rounded-b-none","ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60 focus:outline-none",e.selected?"bg-color-blue dark:bg-color-blue-900 text-white":"text-color-blue dark:text-color-dark-60 dark:hover:bg-color-blue-900 hover:bg-color-line dark:hover:text-white hover:text-color-blue-900")},children:"Onchain"})]}),(0,g.jsxs)(h.O.Panels,{className:"mt-2",children:[(0,g.jsx)(h.O.Panel,{className:k("bg-white dark:bg-transparent roun
1ded-xl px-0 sm:px-3 py-3 focus:outline-none","focus:outline-none"),children:(0,g.jsx)(v.default,{})}),(0,g.jsxs)(h.O.Panel,{className:k("bg-white dark:bg-transparent rounded-xl p-3 focus:outline-none","focus:outline-none"),children:[(0,g.jsx)("p",{className:"text-base text text-color-mid-blue dark:text-white my-4",children:"Choose whether your data should be stored onchain."}),(0,g.jsx)(m.J9,{enableReinitialize:!0,initialValues:{storeOnChain:(null===y||void 0===y?void 0:y.storeOnChain)||"Sure"},onSubmit:function(){var e=(0,n.Z)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:T(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:function(){return(0,g.jsxs)(m.l0,{className:"w-full",children:[(0,g.jsx)(l.kR,{control:"select",label:"Always stored onchain?",name:"storeOnChain",option:P}),(0,g.jsx)("div",{className:"flex items-center gap-4 mt-6",children:(0,g.jsx)("button",{className:"max-w-[fit-content] text-white dark:disabled:bg-color-dark-200 bg-color-blue dark:bg-color-blue-900 py-2 px-4 flex-grow rounded-[24px] font-medium text-[18px]",type:"submit",disabled:t,children:"Save Changes"})})]})}})]})]})]})})]})})})}},12100:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/settings",function(){return r(49851)}])},17969:function(e,t,r){"use strict";r.d(t,{O:function(){return Z}});var n=r(67294),a=r(12351),s=r(19946),l=r(32984),o=r(61363),i=r(84575),u=r(16723),c=r(23784),d=r(14157),f=r(3855),p=r(46045);function h({onFocus:e}){let[t,r]=(0,n.useState)(!0);return t?n.createElement(p._,{as:"button",type:"button",features:p.A.Focusable,onFocus:t=>{t.preventDefault();let n,a=50;n=requestAnimationFrame((function t(){if(!(a--<=0))return e()?(r(!1),void cancelAnimationFrame(n)):void(n=requestAnimationFrame(t));n&&cancelAnimationFrame(n)}))}}):null}var x,m=r(73781),b=((x=b||{})[x.SetSelectedIndex=0]="SetSelectedIndex",x[x.RegisterTab=1]="RegisterTab",x[x.UnregisterTab=2]="UnregisterTab",x[x.RegisterPanel=3]="RegisterPanel",x[x.UnregisterPanel=4]="UnregisterPanel",x[x.ForceRerender=5]="ForceRerender",x);let w={0(e,t){let r=e.tabs.filter((e=>{var t;return!(null!=(t=e.current)&&t.hasAttribute("disabled"))}));if(t.index<0)return{...e,selectedIndex:e.tabs.indexOf(r[0])};if(t.index>e.tabs.length)return{...e,selectedIndex:e.tabs.indexOf(r[r.length-1])};let n=e.tabs.slice(0,t.index),a=[...e.tabs.slice(t.index),...n].find((e=>r.includes(e)));return a?{...e,selectedIndex:e.tabs.indexOf(a)}:e},1:(e,t)=>e.tabs.includes(t.tab)?e:{...e,tabs:(0,i.z2)([...e.tabs,t.tab],(e=>e.current))},2:(e,t)=>({...e,tabs:(0,i.z2)(e.tabs.filter((e=>e!==t.tab)),(e=>e.current))}),3:(e,t)=>
1e.panels.includes(t.panel)?e:{...e,panels:[...e.panels,t.panel]},4:(e,t)=>({...e,panels:e.panels.filter((e=>e!==t.panel))}),5:e=>({...e})},v=(0,n.createContext)(null);function g(e){let t=(0,n.useContext)(v);if(null===t){let t=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,g),t}return t}v.displayName="TabsSSRContext";let k=(0,n.createContext)(null);function y(e){let t=(0,n.useContext)(k);if(null===t){let t=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,y),t}return t}k.displayName="TabsDataContext";let P=(0,n.createContext)(null);function T(e){let t=(0,n.useContext)(P);if(null===t){let t=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,T),t}return t}function j(e,t){return(0,l.E)(t.type,w,e,t)}P.displayName="TabsActionsContext";let N=n.Fragment,E=(0,a.yV)((function(e,t){let{defaultIndex:r=0,vertical:s=!1,manual:l=!1,onChange:o,selectedIndex:i=null,...d}=e;const p=s?"vertical":"horizontal",x=l?"manual":"auto";let m=(0,c.T)(t),[b,w]=(0,n.useReducer)(j,{selectedIndex:null!=i?i:r,tabs:[],panels:[]}),g=(0,n.useMemo)((()=>({selectedIndex:b.selectedIndex})),[b.selectedIndex]),y=(0,f.E)(o||(()=>{})),T=(0,f.E)(b.tabs),E=(0,n.useMemo)((()=>({orientation:p,activation:x,...b})),[p,x,b]),I=(0,f.E)(b.selectedIndex),O=(0,n.useMemo)((()=>({registerTab:e=>(w({type:1,tab:e}),()=>w({type:2,tab:e})),registerPanel:e=>(w({type:3,panel:e}),()=>w({type:4,panel:e})),forceRerender(){w({type:5})},change(e){I.current!==e&&y.current(e),I.current=e,w({type:0,index:e})}})),[w]);(0,u.e)((()=>{w({type:0,index:null!=i?i:r})}),[i]);let R=(0,n.useRef)({tabs:[],panels:[]}),S={ref:m};return n.createElement(v.Provider,{value:R},n.createElement(P.Provider,{value:O},n.createElement(k.Provider,{value:E},E.tabs.length<=0&&n.createElement(h,{onFocus:()=>{var e,t;for(let r of T.current)if(0===(null==(e=r.current)?void 0:e.tabIndex))return null==(t=r.current)||t.focus(),!0;return!1}}),(0,a.sY)({ourProps:S,theirProps:d,slot:g,defaultTag:N,name:"Tabs"}))))})),I=(0,a.yV)((function(e,t){let{orientation:r,selectedIndex:n}=y("Tab.List"),s=(0,c.T)(t);return(0,a.sY)({ourProps:{ref:s,role:"tablist","aria-orientation":r},theirProps:e,slot:{selectedIndex:n},defaultTag:"div",name:"Tabs.List"})})),O=(0,a.yV)((function(e,t){var r,f;let p=`headlessui-tabs-tab-${(0,s.M)()}`,{orientation:h,activation:x,selectedIndex:b,tabs:w,panels:v}=y("Tab"),k=T("Tab"),P=g("Tab"),j=(0,n.useRef)(null),N=(0,c.T)(j,t,(e=>{!e||k.forceRerender()}));(0,u.e)((()=>k.registerTab(j)),[k,j]);let E=P.current.tabs.indexOf(p);-1===E&&(E=P.current.tabs.push(p)-1);let I=w.indexOf(j);-1===I&&(I=E);let O=I===b,R=(0,m.z)((e=>{let t=w.map((e=>e.current)).filter(Boolean);if(e.key===o.R.Space||e.key===o.R.Enter)return e.preventDefault(),e.stopPropagation(),void k.change(I);switch(e.key){case o.R.Home:case o.R.PageUp:return e.preventDefault(),e.stopPropagation(),(0,i.jA)(t,i.TO.First);case o.R.End:case o.R.PageDown:return e.preventDefault(),e.stopPropagation(),(0,i.jA)(t,i.TO.Last)}return(0,l.E)(h,{vertical:()=>e.key===o.R.ArrowUp?(0,i.jA)(t,i.TO.Previous|i.TO.WrapAround):e.key===o.R.ArrowDown?(0,i.jA)(t,i.TO.Next|i.TO.WrapAround):void 0,horizontal:()=>e.key===o.R.ArrowLeft?(0,i.jA)(t,i.TO.Previous|i.TO.WrapAround):e.key===o.R.ArrowRight?(0,i.jA)(t,i.TO.Next|i.TO.WrapAround):void 0})})),S=(0,m.z)((()=>{var e;null==(e=j.current)||e.focus()})),A=(0,m.z)((()=>{var e;null==(e=j.current)||e.focus(),k.change(I)})),Z=(0,m.z)((e=>{e.preventDefault()})),C=(0,n.useMemo)((()=>({selected:O})),[O]),F=e,_={ref:N,onKeyDown:R,onFocus:"manual"===x?S:A,onMouseDown:Z,onClick:A,id:p,role:"tab",type:(0,d.f)(e,j),"aria-controls":null==(f=null==(r=v[I])?void 0:r.current)?void 0:f.id,"aria-selected":O,tabIndex:O?0:-1};return(0,a.sY)({ourProps:_,theirProps:F,slot:C,defaultTag:"button",name:"Tabs.Tab"})})),R=(0,a.yV)((function(e,t){let{selectedIndex:r}=y("Tab.Panels"),s=(0,c.T)(t),l=(0,n.useMemo)((()=>({selectedIndex:r})),[r]);return(0,a.sY)({ourProps:{ref:s},theirProps:e,slot:l,defaultTag:"div",name:"Tabs.Panels"})})),S=a.AN.RenderStrategy|a.AN.Static,A=(0,a.yV)((function(e,t){var r,l;let{selectedIndex:o,tabs:i,panels:d}=y("Tab.Panel"),f=T("Tab.Panel"),p=g("Tab.Panel"),h=`headlessui-tabs-panel-${(0,s.M)()}`,x=(0,n.useRef)(null),m=(0,c.T)(x,t,(e=>{!e||f.forceRerender()}));(0,u.e)((()=>f.registerPanel(x)),[f,x]);let b=p.current.panels.indexOf(h);-1===b&&(b=p.current.panels.push(h)-1);let w=d.indexOf(x);-1===w&&(w=b);let v=w===o,k=(0,n.useMemo)((()=>({selected:v})),[v]),P=e,j={ref:m,id:h,role:"tabpanel","aria-labelledby":null==(l=null==(r=i[w])?void 0:r.current)?void 0:l.id,tabIndex:v?0:-1};return(0,a.sY)({ourProps:j,theirProps:P,slot:k,defaultTag:"div",features:S,visible:v,name:"Tabs.Panel"})})),Z=Object.assign(O,{Group:E,List:I,Panels:R,Panel:A})}},function(e){e.O(0,[9774,2888,179],(function(){return t=12100,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.