PageSourceSearch

https://gayhearts.app/static/js/9541.8f88f33e.chunk.js

js gayhearts.app collected 2026-09-24 13:43:32 UTC 16,432 bytes, 3 lines download raw bytes

1/*! For license information please see 9541.8f88f33e.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9541],{9541(e,t,s){s.r(t),s.d(t,{default:()=>D});var i=s(5043),a=s(6792),l=s(9570),r=s(4368),n=s(6328),o=s(4918),c=s(3944),d=s(2574),m=s(8646),h=s(6099),x=s(9233),u=s(5469);const p=(0,s(7784).A)("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var f=s(9855),b=s(614),g=s(653),y=s(6879),w=s(579);const k={match:{icon:o.A,color:"#E91E63",bg:"bg-primary/15",label_de:"Match",label_en:"Match"},super_like:{icon:c.A,color:"#F59E0B",bg:"bg-yellow-400/15",label_de:"Super-Like",label_en:"Super Like"},like:{icon:o.A,color:"#EF4444",bg:"bg-red-400/15",label_de:"Like",label_en:"Like"},like_teaser:{icon:o.A,color:"#EF4444",bg:"bg-red-400/15",label_de:"Like",label_en:"Like"},message:{icon:d.A,color:"#9C27B0",bg:"bg-secondary/15",label_de:"Nachricht",label_en:"Message"},event:{icon:m.A,color:"#A855F7",bg:"bg-purple-400/15",label_de:"Event",label_en:"Event"},welcome:{icon:h.A,color:"#E91E63",bg:"bg-primary/15",label_de:"Willkommen",label_en:"Welcome"},announcement:{icon:x.A,color:"#A855F7",bg:"bg-purple-400/15",label_de:"Ank\xfcndigung",label_en:"Announcement"},default:{icon:x.A,color:"#94A3B8",bg:"bg-white/10",label_de:"System",label_en:"System"}},j=(e,t)=>{if(!e)return"";try{const s=new Date(e),i=Math.floor((Date.now()-s.getTime())/6e4);if(i<1)return"de"===t?"gerade eben":"just now";if(i<60)return"de"===t?`vor ${i} Min`:`${i}m ago`;const a=Math.floor(i/60);return a<24?"de"===t?`vor ${a} Std`:`${a}h ago`:s.toLocaleTimeString("de"===t?"de-DE":"en-US",{hour:"2-digit",minute:"2-digit"})}catch{return""}},N=[{k:"all",icon:x.A,label_de:"Alle",label_en:"All"},{k:"match",icon:o.A,label_de:"Matches",label_en:"Matches"},{k:"message",icon:d.A,label_de:"Nachrichten",label_en:"Messages"},{k:"system",icon:h.A,label_de:"System",label_en:"System"}],v=({notification:e,onClose:t,onDismiss:s,onOpenLink:i,de:a})=>{const l=k[e.type]||k.default,n=l.icon,o=(e.body||"").split(/\n{1,}/).filter(Boolean);return(0,w.jsx)(r.P.div,{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center",initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},onClick:t,style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)"},"data-testid":"notification-detail-modal",children:(0,w.jsxs)(r.P.div,{onClick:e=>e.stopPropagation(),className:"w-full sm:max-w-lg sm:m-4 sm:rounded-3xl rounded-t-3xl bg-paper border border-white/10 shadow-2xl max-h-[88vh] flex flex-col",initial:{y:80,opacity:0},animate:{y:0,opacity:1},exit:{y:80,opacity:0},transition:{type:"spring",stiffness:400,damping:35},children:[(0,w.jsxs)("div",{className:"flex items-start gap-3 p-5 border-b border-white/[0.06]",children:[(0,w.jsx)("div",{className:`w-12 h-12 rounded-full flex items-center justify-center flex-shrink-0 ${l.bg}`,children:(0,w.jsx)(n,{className:"w-5 h-5",style:{color:l.color},strokeWidth:1.8})}),(0,w.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,w.jsx)("span",{className:"inline-block text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full mb-1",style:{background:`${l.color}20`,color:l.color},children:a?l.label_de:l.label_en}),(0,w.jsx)("h3",{className:"text-base font-bold text-foreground leading-tight pr-6",children:e.title})]}),(0,w.jsx)("button",{onClick:t,className:"absolute top-3 right-3 sm:top-4 sm:right-4 w-9 h-9 rounded-full flex items-center justify-center bg-white/5 hover:bg-white/10 text-muted-foreground hover:text-foreground transition-colors","aria-label":a?"Schlie\xdfen":"Close","data-testid":"notification-detail-close",children:(0,w.jsx)(b.A,{className:"w-4 h-4"})})]}),(0,w.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[o.length>0?o.map((e,t)=>(0,w.jsx)("p",{className:"text-sm text-foreground/90 leading-relaxed mb-3 whitespace-pre-wrap break-words",children:e},t)):(0,w.jsx)("p",{className:"text-sm text-muted-foreground italic",children:a?"(keine weiteren Details)":"(no further details)"}),e.timestamp&&(0,w.jsx)("p",{className:"text-[11px] text-muted-foreground/60 mt-2",children:new Date(e.timestamp).toLocaleString(a?"de-DE":"en-US")})]}),(0,w.jsxs)("div",{className:"flex gap-2 p-4 border-t border-white/[0.06]",children:[(0,w.jsxs)("button",{onClick:s,className:"flex-1 px-4 py-2.5 rounded-xl bg-rose-500/10 hover:bg-rose-500/20 border border-rose-500/30 text-rose-300 text-sm font-medium transition-colors flex items-center justify-center gap-2","data-testid":"notification-detail-dismiss",children:[(0,w.jsx)(f.A,{className:"w-4 h-4"}),a?"L\xf6schen":"Dismiss"]}),e.link&&(0,w.jsx)("button",{onClick:i,className:"flex-1 px-4 py-2.5 rounded-xl bg-gradient-to-r from-primary to-secondary hover:opacity-90 text-white text-sm font-semibold transition-opacity","data-testid":"notification-detail-open",children:a?"\xd6ffnen":"Open"}),(0,w.jsx)("button",{onClick:t,className:"px-4 py-2.5 rounded-xl bg-white/5 hover:bg-white/10 border border-white/10 text-foreground text-sm font-medium transition-colors","data-testid":"notification-detail-close-btn",children:a?"Schlie\xdfen":"Close"})]})]})})},A=({notification:e,onClick:t,onDismiss:s,dismissing:i,lang:a})=>{const l=k[e.type]||k.default,n=l.icon,o="de"===a;return(0,w.jsxs)(r.P.li,{layout:!0,initial:{opacity:0,y:10},animate:{opacity:i?0:1,y:0,x:i?300:0},exit:{opacity:0,x:300},transition:{duration:.22},drag:"x",dragConstraints:{left:0,right:0},dragElastic:.4,onDragEnd:(e,t)=>{(t.offset.x>120||t.velocity.x>400)&&s()},className:"relative rounded-2xl border overflow-hidden "+(e.read?"bg-white/[0.025] border-white/[0.05]":"bg-gradient-to-br from-primary/[0.08] to-transparent border-primary/20"),"data-testid":`notification-card-${e.id}`,children:[(0,w.jsxs)("button",{onClick:t,className:"w-full text-left p-4 pr-12 flex items-start gap-3 hover:bg-white/[0.02] transition-colors",children:[e.profilePicture?(0,w.jsx)("img",{src:e.profilePicture,alt:"",className:"w-12 h-12 rounded-full object-cover flex-shrink-0 ring-2 ring-white/5"}):(0,w.jsx)("div",{className:`w-12 h-12 rounded-full flex items-center justify-center flex-shrink-0 ${l.bg}`,children:(0,w.jsx)(n,{className:"w-5 h-5",style:{color:l.color},strokeWidth:1.8})}),(0,w.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,w.jsxs)("div",{className:"flex items-center gap-2 mb-0.5 flex-wrap",children:[(0,w.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full",style:{background:`${l.color}20`,color:l.color},children:o?l.label_de:l.label_en}),!e.read&&(0,w.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-primary","aria-label":"unread"}),(0,w.jsx)("span",{className:"text-[11px] text-muted-foreground
2/70 ml-auto",children:j(e.timestamp,a)})]}),(0,w.jsx)("p",{className:"text-sm font-medium text-foreground leading-tight mb-0.5",children:e.title}),e.body&&(0,w.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed",children:e.body})]})]}),(0,w.jsx)("button",{onClick:e=>{e.stopPropagation(),s()},className:"absolute top-2 right-2 w-8 h-8 rounded-full flex items-center justify-center bg-white/[0.04] hover:bg-rose-500/20 text-muted-foreground hover:text-rose-400 transition-colors","aria-label":"Dismiss","data-testid":`notification-dismiss-${e.id}`,children:(0,w.jsx)(b.A,{className:"w-3.5 h-3.5",strokeWidth:2.2})})]})},_=({filter:e,de:t,onDiscover:s})=>{const i={all:{title:t?"Noch alles ruhig hier":"All quiet for now",sub:t?"Swipe durch Profile, um Matches zu finden":"Swipe through profiles to find matches"},match:{title:t?"Noch keine Matches":"No matches yet",sub:t?"Starte mit dem ersten Like!":"Start with your first like!"},message:{title:t?"Keine Nachrichten":"No messages",sub:t?"Schreib Deinen Matches den ersten Gru\xdf":"Say hi to your matches"},system:{title:t?"Keine System-Infos":"No system updates",sub:t?"Du bist auf dem neuesten Stand":"You're all caught up"}},a=i[e]||i.all;return(0,w.jsxs)("div",{className:"py-20 flex flex-col items-center text-center","data-testid":"notifications-empty",children:[(0,w.jsx)("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mb-5 bg-gradient-to-br from-primary/10 to-secondary/10 border border-white/[0.06]",children:(0,w.jsx)(x.A,{className:"w-8 h-8 text-primary/70",strokeWidth:1.5})}),(0,w.jsx)("h3",{className:"text-lg font-heading font-semibold text-foreground mb-1",style:{fontFamily:"Outfit, sans-serif"},children:a.title}),(0,w.jsx)("p",{className:"text-sm text-muted-foreground mb-6 max-w-xs",children:a.sub}),(0,w.jsx)("button",{onClick:s,className:"px-5 py-2.5 rounded-full bg-gradient-to-r from-primary to-secondary text-white font-medium text-sm shadow-[0_10px_30px_-10px_rgba(233,30,99,0.5)] hover:shadow-[0_12px_36px_-8px_rgba(233,30,99,0.6)] transition-shadow","data-testid":"notifications-go-discover",children:t?"Zum Discover-Feed":"Open Discover"})]})},D=()=>{const{api:e}=(0,g.As)(),{language:t}=(0,y.ok)(),s=(0,a.Zp)(),r="de"===t,[o,c]=(0,i.useState)([]),[d,m]=(0,i.useState)(!0),[h,x]=(0,i.useState)("all"),[b,k]=(0,i.useState)(0),[j,D]=(0,i.useState)(null),[S,C]=(0,i.useState)(null),M=(0,i.useCallback)(async()=>{try{const t=await e.get("/notifications"),s=(t.data.notifications||[]).slice().sort((e,t)=>{const s=e.timestamp?new Date(e.timestamp).getTime():0;return(t.timestamp?new Date(t.timestamp).getTime():0)-s});c(s),k(t.data.unreadCount||0)}catch{n.oR.error(r?"Fehler beim Laden":"Failed to load")}finally{m(!1)}},[e,r]);(0,i.useEffect)(()=>{M()},[M]),(0,i.useEffect)(()=>{if(0===b)return;const t=setTimeout(async()=>{try{await e.post("/notifications/mark-read"),c(e=>e.map(e=>({...e,read:!0}))),k(0)}catch{}},800);return()=>clearTimeout(t)},[b,e]);const L=async t=>{D(t),c(e=>e.filter(e=>e.id!==t)),setTimeout(()=>D(null),200);try{await e.delete(`/notifications/${encodeURIComponent(t)}`)}catch(s){console.warn("[Notifications] dismiss failed",s)}},E=o.filter(e=>((e,t)=>
2"all"===t||("system"===t?["welcome","event"].includes(e.type):"match"===t?["match","super_like","like","like_teaser"].includes(e.type):e.type===t))(e,h)),F=((e,t)=>{const s=new Date,i=new Date(s.getFullYear(),s.getMonth(),s.getDate()),a=new Date(i);a.setDate(i.getDate()-1);const l=new Date(i);l.setDate(i.getDate()-7);const r={today:{title:"de"===t?"Heute":"Today",items:[]},yesterday:{title:"de"===t?"Gestern":"Yesterday",items:[]},thisWeek:{title:"de"===t?"Letzte Woche":"Last week",items:[]},earlier:{title:"de"===t?"\xc4lter":"Earlier",items:[]}};return e.forEach(e=>{const t=e.timestamp?new Date(e.timestamp):null;t&&!isNaN(t.getTime())?t>=i?r.today.items.push(e):t>=a?r.yesterday.items.push(e):t>=l?r.thisWeek.items.push(e):r.earlier.items.push(e):r.earlier.items.push(e)}),Object.values(r).filter(e=>e.items.length>0)})(E,t);return(0,w.jsxs)("div",{className:"min-h-screen",style:{background:"radial-gradient(ellipse at top, rgba(233,30,99,0.04) 0%, #0A080F 40%, #05040A 100%)"},"data-testid":"notifications-page",children:[(0,w.jsxs)("header",{className:"sticky top-0 z-30 border-b border-white/[0.06]",style:{background:"rgba(10,8,16,0.88)",backdropFilter:"blur(18px)",WebkitBackdropFilter:"blur(18px)"},children:[(0,w.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-3 flex items-center gap-2",children:[(0,w.jsx)("button",{onClick:()=>s(-1),className:"w-10 h-10 rounded-full flex items-center justify-center hover:bg-white/5 transition-colors","data-testid":"notifications-back","aria-label":r?"Zur\xfcck":"Back",children:(0,w.jsx)(u.A,{className:"w-5 h-5 text-foreground"})}),(0,w.jsxs)("div",{className:"flex-1",children:[(0,w.jsx)("h1",{className:"text-lg font-heading font-semibold text-foreground",style:{fontFamily:"Outfit, sans-serif"},children:r?"Benachrichtigungen":"Notifications"}),b>0&&(0,w.jsxs)("p",{className:"text-xs text-muted-foreground",children:[b," ",r?"ungelesen":"unread"]})]}),o.length>0&&b>0&&(0,w.jsxs)("button",{onClick:async()=>{try{await e.post("/notifications/mark-read"),c(e=>e.map(e=>({...e,read:!0}))),k(0),n.oR.success(r?"Alle gelesen":"All marked read")}catch{n.oR.error(r?"Fehler":"Error")}},className:"px-3 py-1.5 rounded-full bg-primary/15 hover:bg-primary/25 text-primary text-xs font-medium transition-colors flex items-center gap-1.5","data-testid":"notifications-mark-all-read",children:[(0,w.jsx)(p,{className:"w-3.5 h-3.5"}),r?"Alle gelesen":"All read"]}),o.length>0&&(0,w.jsx)("button",{onClick:async()=>{if(!o.length)return;if(!window.confirm(r?"Alle Benachrichtigungen l\xf6schen?":"Dismiss all notifications?"))return;const t=o;c([]),k(0);try{await e.delete("/notifications"),n.oR.success(r?"Alle gel\xf6scht":"All dismissed")}catch{c(t),n.oR.error(r?"Fehler beim L\xf6schen":"Failed to dismiss")}},className:"w-9 h-9 rounded-full flex items-center justify-center bg-white/[0.04] hover:bg-rose-500/20 text-muted-foreground hover:text-rose-400 transition-colors","data-testid":"notifications-dismiss-all",title:r?"Alle l\xf6schen":"Dismiss all","aria-label":r?"Alle l\xf6schen":"Dismiss all",children:(0,w.jsx)(f.A,{className:"w-4 h-4"})})]}),(0,w.jsx)("div",{className:"max-w-3xl mx-auto px-4 pb-3 flex gap-2 overflow-x-auto scrollbar-hide",children:N.map(({k:e,icon:t,label_de:s,label_en:i})=>{const a=h===e,l=r?s:i;return(0,w.jsxs)("button",{onClick:()=>x(e),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium whitespace-nowrap transition-all "+(a?"bg-gradient-to-r from-primary/25 to-secondary/25 text-primary border border-primary/40":"bg-white/[0.04] text-muted-foreground border border-white/[0.06] hover:text-foreground"),"data-testid":`notifications-filter-${e}`,children:[(0,w.jsx)(t,{className:"w-3.5 h-3.5"}),l]},e)})})]}),(0,w.jsx)("main",{className:"max-w-3xl mx-auto px-4 py-5 pb-24",children:d?(0,w.jsx)("div",{className:"space-y-3",children:[1,2,3,4].map(e=>(0,w.jsxs)("div",{className:"flex gap-3 p-4 rounded-2xl bg-white/[0.03] border border-white/[0.04] animate-pulse",children:[(0,w.jsx)("div",{className:"w-12 h-12 rounded-full bg-white/5 flex-shrink-0"}),(0,w.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,w.jsx)("div",{className:"h-3 bg-white/5 rounded w-1/3"}),(0,w.jsx)("div",{className:"h-4 bg-white/5 rounded w-3/4"}),(0,w.jsx)("div",{className:"h-2.5 bg-white/5 rounded w-1/5"})]})]},e))}):0===F.length?(0,w.jsx)(_,{filter:h,de:r,onDiscover:()=>s("/discover")}):(0,w.jsx)("div",{className:"space-y-6",children:F.map(e=>(0,w.jsxs)("section",{"data-testid":`notifications-group-${e.title}`,children:[(0,w.jsx)("h2",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-muted-foreground
2/70 mb-2 px-1",children:e.title}),(0,w.jsx)(l.N,{initial:!1,children:(0,w.jsx)("ul",{className:"space-y-2",children:e.items.map(e=>(0,w.jsx)(A,{notification:e,onClick:()=>(e=>{const t="announcement"===e.type||"welcome"===e.type,i=(e.body||"").length>60;t||i?C(e):e.link?s(e.link):"match"!==e.type&&"message"!==e.type||s("/chat")})(e),onDismiss:()=>L(e.id),dismissing:j===e.id,lang:t},e.id))})})]},e.title))})}),(0,w.jsx)(l.N,{children:S&&(0,w.jsx)(v,{notification:S,onClose:()=>C(null),onDismiss:async()=>{const e=S.id;C(null),await L(e)},onOpenLink:()=>{const e=S.link;C(null),e&&s(e)},de:r})})]})}},5469(e,t,s){s.d(t,{A:()=>i});const i=(0,s(7784).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},8646(e,t,s){s.d(t,{A:()=>i});const i=(0,s(7784).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},3944(e,t,s){s.d(t,{A:()=>i});const i=(0,s(7784).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},9855(e,t,s){s.d(t,{A:()=>i});const i=(0,s(7784).A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}}]);
3//# sourceMappingURL=9541.8f88f33e.chunk.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.