PageSourceSearch

https://stickerradar.com/assets/profile-DPzBW3Y1.js

js stickerradar.com collected 2026-10-06 07:22:51 UTC 13,017 bytes, 1 lines download raw bytes

1import{c as _,b as O,ae as W,u as z,af as H,l as Y,k as J,r,j as e,g as T,h as X,i as l,C as j,ag as U,M as Z,B as g,ah as ee,ai as q,P as se,v as te,aj as ae,ak as B}from"./index-C6Per_8z.js";import{I as d}from"./input-BjI3DTVp.js";import{L as c}from"./label-Dl47zl_N.js";import{S as re,a as ne,b as ie,c as le,d as v}from"./select-DEc3yrXl.js";import{S as N}from"./skeleton-Bwv58L-l.js";import{C as de}from"./calendar-IEoS38v_.js";import{f as ce}from"./format-BBErTw00.js";import"./index-D88v7ThS.js";import"./chevron-up-BKLXtn5P.js";const oe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],me=_("message-square",oe);const xe=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],ue=_("phone",xe),he=[{count:1,name:"Connector",emoji:"🔗"},{count:3,name:"Scout",emoji:"🎯"},{count:10,name:"Ambassador",emoji:"🏆"}],pe={local:"Local meetup only",postal:"Postal mail only",both:"Both local & postal"};function Ce(){const{data:t,isLoading:G}=O(),{data:a}=W(),{user:R}=z(),n=H(),b=Y(),{toast:i}=J(),[$,y]=r.useState(!1),[w,S]=r.useState(""),[o,C]=r.useState(""),[m,k]=r.useState(""),[h,M]=r.useState("both"),[P,p]=r.useState(!1),[x,I]=r.useState(!0),[A,E]=r.useState(""),[D,f]=r.useState(!1);r.useEffect(()=>{t&&(S(t.displayName??""),C(t.city??""),k(t.country??""),M(t.swapMethod??"both"),I(t.notifyEmail??!0),E(t.notifyPhone??""),p(!1),f(!1))},[t]);const u=()=>p(!0),L=()=>f(!0),F=()=>{n.mutate({data:{notifyEmail:x,notifyPhone:A||null}},{onSuccess:()=>{i({title:"Notification preferences saved"}),b.invalidateQueries({queryKey:B()}),f(!1)},onError:()=>i({title:"Failed to save",variant:"destructive"})})},Q=()=>{n.mutate({data:{displayName:w,city:o,country:m,swapMethod:h}},{onSuccess:()=>{i({title:"Profile saved",description:"Your profile has been updated."}),b.invalidateQueries({queryKey:B()}),p(!1)},onError:()=>{i({title:"Failed to save",variant:"destructive"})}})};if(G)return e.jsxs("div",{className:"max-w-2xl mx-auto space-y-4",children:[e.jsx(N,{className:"h-10 w-48"}),e.jsx(N,{className:"h-64 w-full rounded-xl"}),e.jsx(N,{className:"h-48 w-full rounded-xl"})]});const V=o&&o!=="Unknown"&&m&&m!=="Unknown";return e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-secondary mb-1",children:"My Profile"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account details and swap preferences."})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[e.jsxs("div",{className:"bg-card border rounded-xl p-4 text-center shadow-sm",children:[e.jsx(T,{className:"w-5 h-5 text-destructive mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-destructive",children:t?.missingCount??0}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Missing"})]}),e.jsxs("div",{className:"bg-card border rounded-xl p-4 text-center shadow-sm",children:[e.jsx(T,{className:"w-5 h-5 text-primary mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-primary",children:t?.duplicateCount??0}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Duplicates"})]}),e.jsxs("div",{className:"bg-card border rounded-xl p-4 text-center shadow-sm",children:[e.jsx(X,{className:"w-5 h-5 text-emerald-600 mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-emerald-600",children:t?.completedSwaps??0}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Swaps Done"})]})]}),e.jsxs("div",{className:"bg-card border rounded-xl p-6 shadow-sm space-y-5 mb-5",children:[e.jsxs("div",{className:"flex items-center justify-between border-b pb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Profile Details"}),V?e.jsxs(l,{className:"bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-50 flex items-center gap-1",children:[e.jsx(j,{className:"w-3.5 h-3.5"})," Complete"]}):e.jsx(l,{variant:"outline",className:"text-amber-600 border-amber-300",children:"Incomplete"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(c,{className:"flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3.5 h-3.5"})," Email"]}),e.jsx(d,{value:R?.primaryEmailAddress?.emailAddress??t?.email??"",disabled:!0,className:"bg-muted/50 text-muted-foreground"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Managed by your account — cannot be changed here."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{children:"Display Name"}),e.jsx(d,{value:w,onChange:s=>{S(s.target.value),u()},placeholder:"Your name visible to other collectors"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(c,{className:"flex items-center gap-1.5",children:[e.jsx(Z,{className:"w-3.5 h-3.5"})," City"]}),e.jsx(d,{value:o,onChange:s=>{C(s.target.value),u()},placeholder:"e.g. Stockholm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{children:"Country"}),e.jsx(d,{value:m,onChange:s=>{k(s.target.value),u()},placeholder:"e.g. Sweden"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"Same city = +15 pts · Same country = +8 pts in swap score calculations."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(c,{children:"Preferred Swap Method"}),e.jsxs(re,{value:h,onValueChange:s=>{M(s),u()},children:[e.jsx(ne,{children:e.jsx(ie,{})}),e.jsxs(le,{children:[e.jsx(v,{value:"local",children:"Local meetup only"}),e.jsx(v,{value:"postal",children:"Postal mail only"}),e.jsx(v,{value:"both",children:"Both local & postal"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Postal-only partners receive a −5 pts penalty in scoring."})]}),e.jsxs("div",{className:"pt-2 border-t flex items-center gap-3",children:[e.jsx(g,{onClick:Q,disabled:n.isPending||!P,children:n.isPending?"Saving...":"Save Changes"}),!P&&!n.isPending&&e.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(j,{className:"w-3.5 h-3.5 text-emerald-500"})," Up to date"]})]})]}),e.jsxs("div",{className:"bg-card border rounded-xl p-6 shadow-sm space-y-5 mb-5",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b pb-4",children:[e.jsx(ee,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Notification Preferences"})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(U,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:"Email notifications"}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:"Receive emails when someone sends you a swap request, accepts, rejects or completes a swap."})]})]}),e.jsx("button",{onClick:()=>{I(s=>!s),L()},className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus:outline-none ${x?"bg-primary":"bg-muted-foreground
1/30"}`,role:"switch","aria-checked":x,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${x?"translate-x-6":"translate-x-1"}`})})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:e.jsx(ue,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-muted-foreground",children:"Phone number"}),e.jsx(l,{variant:"outline",className:"text-[10px] py-0 h-4 border-amber-300 text-amber-600",children:"Coming soon"})]}),e.jsx(d,{value:A,onChange:s=>{E(s.target.value),L()},placeholder:"+46 70 123 45 67",className:"mt-1.5 text-sm",disabled:!0})]})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4 opacity-50 pointer-events-none select-none",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:e.jsx(me,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-muted-foreground",children:"SMS / WhatsApp"}),e.jsx(l,{variant:"outline",className:"text-[10px] py-0 h-4 border-amber-300 text-amber-600",children:"Coming soon"})]}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:"Get notified via SMS or WhatsApp. Requires phone number above."})]})]}),e.jsx("div",{className:"relative inline-flex h-6 w-11 shrink-0 items-center rounded-full bg-muted-foreground/30",children:e.jsx("span",{className:"inline-block h-4 w-4 rounded-full bg-white shadow translate-x-1"})})]}),e.jsxs("div",{className:"pt-2 border-t flex items-center gap-3",children:[e.jsx(g,{onClick:F,disabled:n.isPending||!D,children:n.isPending?"Saving…":"Save Preferences"}),!D&&!n.isPending&&e.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(j,{className:"w-3.5 h-3.5 text-emerald-500"})," Up to date"]})]})]}),e.jsxs("div",{className:"bg-card border rounded-xl p-6 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Invite Friends"})]}),e.jsxs(g,{size:"sm",onClick:()=>y(!0),className:"gap-1.5",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Get invite link"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xl font-bold text-primary",children:a?.inviteCount??0})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:"Friends invited"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a?.tier?`Current badge: ${a.tier}`:"Invite 1 friend to earn your first badge"})]})]}),a?.nextTier&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between text-xs mb-1.5",children:[e.jsxs("span",{className:"text-muted-foreground",children:["Progress to ",a.nextTier]}),e.jsxs("span",{className:"font-medium",children:[a.inviteCount,"/",a.nextTierCount]})]}),e.jsx(se,{value:Math.min(100,Math.round((a.inviteCount??0)/(a.nextTierCount??1)*100)),className:"h-2"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:he.map(s=>{const K=(a?.inviteCount??0)>=s.count;return e.jsxs("div",{className:`flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium border transition-all ${K?"bg-primary/10 text-primary border-primary/30":"bg-muted/50 text-muted-foreground border-transparent"}`,children:[e.jsx("span",{children:s.emoji}),e.jsx("span",{children:s.name}),e.jsxs("span",{className:"opacity-60",children:["· ",s.count,"+"]})]},s.name)})}),a?.inviteUrl&&e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(a.inviteUrl),i({title:"Invite link copied!"})},className:"w-full flex items-center gap-2 bg-muted/40 hover:bg-muted/60 border rounded-lg px-3 py-2 text-xs text-muted-foreground transition-colors text-left",children:[e.jsx(te,{className:"w-3.5 h-3.5 shrink-0"}),e.jsx("span",{className:"flex-1 truncate font-mono",children:a.inviteUrl}),e.jsx("span",{className:"shrink-0 text-primary font-medium",children:"Copy"})]})]}),e.jsxs("div",{className:"bg-card border rounded-xl p-6 shadow-sm",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Account Info"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"flex justify-between items-center py-2 border-b",children:[e.jsxs("span",{className:"text-muted-foreground flex items-center gap-1.5",children:[e.jsx(de,{className:"w-3.5 h-3.5"})," Member since"]}),e.jsx("span",{className:"font-medium",children:t?.createdAt?ce(new Date(t.createdAt),"d MMMM yyyy"):"—"})]}),e.jsxs("div",{className:"flex justify-between items-center py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:"Swap method"}),e.jsx(l,{variant:"outline",children:pe[h]})]}),e.jsxs("div",{className:"flex justify-between items-center py-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Account ID"}),e.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["#",t?.id]})]})]})]}),e.jsx(ae,{open:$,onClose:()=>y(!1)})]})}export{Ce as default};

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.