PageSourceSearch

https://catalyzernd.com/assets/SettingsPage-BQNRBAjF.js

js catalyzernd.com collected 2026-10-10 02:22:14 UTC 9,355 bytes, 2 lines download raw bytes

1import{j as e}from"./lexical-C8X_J-2S.js";import{u as N,M as A,B as C,ax as R,aF as E,i as w,aU as F,aV as _,aW as B,r as y,aX as M,aY as W,aZ as Y,a_ as $,K as L,w as z,x as H,y as G,p as K,Q as I,W as Q,a2 as V,a$ as X}from"./index-yvrWtOpg.js";import{P as Z}from"./page-meta-7RzMGKYP.js";import{P as q}from"./container-wJftftFB.js";import{a as m}from"./sentry-CY4vWSGw.js";import{C as f,a as j,b as p,c as b,d as g,e as T}from"./card-DOk1YAaq.js";import{A as P,a as v,b as S}from"./alert-Q62eJ29s.js";import{P as J}from"./PasswordFields-BjVfGivk.js";import{C as O}from"./circle-check-bZQydtRJ.js";import{C as ee}from"./checkbox-BOfcPmJs.js";import{S as k}from"./switch-CQJ1SgV_.js";import{i as se}from"./messaging-format-DnJWaq_0.js";import{B as te}from"./ban-EIkHNbnj.js";import{u as ae}from"./use-scroll-to-hash-N7ygFkwl.js";import"./supabase-BDlgASMm.js";import"./password-rules-CvqpA_oC.js";import"./editor-config-CDCRO3yE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:'"d865f3bb8e9caca8b5bcbdf7657c11d55b8d85ec"'};var s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="5856e4a5-5602-42fa-b1be-c06762f81534",t._sentryDebugIdIdentifier="sentry-dbid-5856e4a5-5602-42fa-b1be-c06762f81534")}catch{}})();const re=({className:t})=>{const[s,c]=m.useState(""),[n,a]=m.useState(""),[d,r]=m.useState(null),[x,l]=m.useState(!1),{updatePassword:i,isLoading:h}=N(),o=async u=>{if(u.preventDefault(),r(null),l(!1),!s||!n){r("Please fill in both password fields.");return}if(s!==n){r("Passwords do not match.");return}try{await i(s),l(!0),c(""),a("")}catch(U){r(R(U))}};return e.jsxs(f,{className:t,children:[e.jsxs(j,{children:[e.jsx(p,{children:"Change Password"}),e.jsx(b,{children:"Enter a new password for your account."})]}),e.jsxs("form",{onSubmit:o,children:[e.jsx(g,{className:"space-y-4",children:e.jsx(J,{password:s,repeatPassword:n,onPasswordChange:c,onRepeatPasswordChange:a,passwordLabel:"New Password",repeatLabel:"Confirm New Password"})}),e.jsxs(T,{className:"flex flex-col gap-4 justify-start items-start pt-0 sm:pt-0",children:[d&&e.jsxs(P,{variant:"destructive",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx(v,{children:"Error"}),e.jsx(S,{children:d})]}),x&&e.jsxs(P,{variant:"success",children:[e.jsx(O,{className:"h-4 w-4"}),e.jsx(v,{children:"Password updated"}),e.jsx(S,{children:"Your password has been successfully updated."})]}),e.jsx(C,{type:"submit",disabled:h,children:h?"Updating...":"Update Password"})]})]})]})},ne=({className:t})=>{const s=E(),[c,n]=m.useState(null),[a,d]=m.useState(!1),{user:r,isLoading:x}=N(),[l,i]=m.useState(r?.interests??[]),h=async o=>{if(o.preventDefault(),n(null),d(!1),!r?.id){n("User not found.");return}if(l.length===0){n("Please select at least one interest.");return}try{await s.mutateAsync({userId:r?.id,data:{interests:l}}),d(!0)}catch(u){n(u instanceof Error?u.message:"Something went wrong")}};return e.jsxs(f,{className:t,children:[e.jsxs(j,{children:[e.jsx(p,{children:"Change Interests"}),e.jsx(b,{children:"Update your interests."})]}),e.jsxs("form",{onSubmit:h,children:[e.jsxs(g,{className:"space-y-4",children:[e.jsx(w,{children:"I'm interested in"}),F.map(({value:o,label:u})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ee,{id:`interest-${o}`,checked:l.includes(o),disabled:s.isPending,onCheckedChange:U=>i(U===!0?[...l,o]:l.filter(D=>D!==o))}),e.jsx(w,{htmlFor:`interest-${o}`,className:"text-sm font-normal cursor-pointer",children:u})]},o))]}),e.jsxs(T,{className:"flex flex-col gap-4 justify-start items-start pt-0 sm:pt-0",children:[c&&e.jsxs(P,{variant:"destructive",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx(v,{children:"Error"}),e.jsx(S,{children:c})]}),a&&e.jsxs(P,{variant:"success",children:[e.jsx(O,{className:"h-4 w-4"}),e.jsx(v,{children:"Interests updated"}),e.jsx(S,{children:"Your interests have been successfully updated."})]}),e.jsx(C,{type:"submit",disabled:x,children:x?"Updating...":"Update Interests"})]})]})]})},ie=["COMMENTS","POSTS","CONTRIBUTIONS","ACCESS","COLLABORATORS","FOLLOWS","UPDATES"];function ce({className:t}){const{data:s,isLoading:c}=_(),n=B();return e.jsxs(f,{className:t,id:"notification-preferences",children:[e.jsxs(j,{children:[e.jsx(p,{children:"Notification Preferences"}),e.jsx(b,{children:"Choose how you want to be notified about activity."})]}),e.jsx(g,{children:c?e.jsx("div",{className:"space-y-4",children:Array.from({length:5}).map((a,d)=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(y,{className:"h-4 w-32"}),e.jsx(y,{className:"h-3 w-56"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(y,{className:"h-6 w-11 rounded-full"}),e.jsx(y,{className:"h-6 w-11 rounded-full"})]})]},d))}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-end gap-4 pb-2 pr-0.5",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground w-11 text-center",children:"In-app"}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground w-11 text-center",children:"Email"})]}),ie.map(a=>{const d=s?.find(r=>r.category===a);return e.jsxs("div",{className:"flex items-center justify-between py-3 border-t",children:[e.jsxs("div",{className:"flex-1 min-w-0 pr-4",children:[e.jsx(w,{className:"text-sm font-medium",children:M(a)}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:W(a)})]}),e.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[e.jsx(k,{checked:d?.inApp??!0,onCheckedChange:r=>n.mutate({category:a,inApp:r})}),e.jsx(k,{checked:d?.email??!0,onCheckedChange:r=>n.mutate({category:a,email:r})})]})]},a)})]})})]})}function de({className:t}){const{data:s,isLoading:c,hasNextPage:n,isFetchingNextPage:a,fetchNextPage:d}
1=Y(),r=$(),x=s?.pages.flatMap(i=>i.results)??[];function l(i,h){r.mutate(i,{onSuccess:()=>I.success(`Unblocked ${h}`),onError:()=>I.error("Could not unblock user.")})}return e.jsxs(f,{className:K(t),children:[e.jsx(j,{children:e.jsxs(p,{className:"flex items-center gap-2 text-base",children:[e.jsx(te,{className:"h-4 w-4"})," Blocked users"]})}),e.jsxs(g,{className:"flex flex-col gap-2",children:[c&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(L,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!c&&x.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"You haven't blocked anyone."}),x.map(i=>e.jsxs("div",{className:"flex items-center gap-3 py-2 border-b last:border-b-0",children:[e.jsxs(z,{className:"h-8 w-8",children:[i.avatar&&e.jsx(H,{src:i.avatar,alt:""}),e.jsx(G,{children:se(i.name)})]}),e.jsx("span",{className:"flex-1 text-sm truncate",children:i.name}),e.jsx(C,{variant:"outline",size:"sm",disabled:r.isPending&&r.variables===i.id,onClick:()=>l(i.id,i.name),children:"Unblock"})]},i.id)),n&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>d(),disabled:a,children:a?"Loading…":"Load more"})]})]})}function le({className:t}){const{user:s}=N(),c=E(),n=s?.settings?.followingListPublic??!0;return e.jsxs(f,{className:t,id:"privacy",children:[e.jsxs(j,{children:[e.jsx(p,{children:"Privacy"}),e.jsx(b,{children:"Control who can see your activity."})]}),e.jsx(g,{children:e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0 pr-4",children:[e.jsx(w,{className:"text-sm font-medium",children:"Make my following list public"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"When off, only you can see who and what you follow."})]}),e.jsx(k,{checked:n,onCheckedChange:a=>{s?.id&&c.mutate({userId:s.id,data:{followingListPublic:a}})}})]})})]})}function oe({className:t}){const{user:s}=N(),c=E(),n=s?.settings?.donationsEnabled??!0;return e.jsxs(f,{className:t,id:"donations",children:[e.jsxs(j,{children:[e.jsx(p,{children:"Donations"}),e.jsx(b,{children:"Control whether others can donate to you."})]}),e.jsx(g,{children:e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0 pr-4",children:[e.jsx(w,{className:"text-sm font-medium",children:"Allow donations to my profile"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"When off, the donate button is hidden and new donations are blocked."})]}),e.jsx(k,{checked:n,onCheckedChange:a=>{s?.id&&c.mutate({userId:s.id,data:{donationsEnabled:a}})}})]})})]})}const Ue=()=>{const{user:t,isLoading:s}=N();return ae(!!t),!t&&s?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx(L,{className:"h-8 w-8 animate-spin text-primary"})}):t?e.jsxs(q,{className:"space-y-6",children:[e.jsx(Z,{title:"Settings",url:X()}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-4xl font-bold mb-2",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account settings"})]}),e.jsx(ne,{className:"max-w-2xl"}),e.jsx(ce,{className:"max-w-2xl"}),e.jsx(le,{className:"max-w-2xl"}),e.jsx(oe,{className:"max-w-2xl"}),e.jsx(de,{className:"max-w-2xl"}),e.jsx(re,{className:"max-w-2xl"})]}):e.jsx(Q,{to:V()})};export{Ue as SettingsPage,Ue as default};
2//# sourceMappingURL=SettingsPage-BQNRBAjF.js.map

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.