PageSourceSearch

https://pblfg.com/assets/Notifications-CFu61xnU.js

js pblfg.com collected 2026-10-02 01:39:21 UTC 41,099 bytes, 1 lines download raw bytes

1import{r as u,j as t,m as V,k as J,L as K}from"./react-vendor-Q2BSRknM.js";import{q as ee,s as S,Q as Y,dN as z,ad as ue,c as D,dF as me,aA as pe,aB as fe,aC as he,aD as ve,aS as xe,a8 as O,B as ge,b8 as ye,u as be,a as ke,a2 as Ne,a1 as je,a0 as we,a4 as _e,a3 as De}from"./index-BgCZMvjj.js";import{a as Ae,u as Ce,b as $}from"./query-BLOP9k_M.js";import{u as Re}from"./virtual-Bfiv_v4G.js";import{X as H,aN as Se,D as Ee,Z as Ie,Q as Me,F as Te,o as te,b as Qe,Y as Pe,n as $e}from"./lucide-Ckh7y__x.js";import{V as se}from"./VerifiedBadge-CV0rD7Rp.js";import{e as Fe,g as Ue,d as Ve,h as qe,p as Be,i as Le,j as Oe}from"./date-utils-DaNoSKVa.js";import{H as ae}from"./HandOfCardsIcon-CtAWg28s.js";import{u as He}from"./useCardsEnabled-tXq7QIBA.js";import{u as Ke}from"./useCardVault-96-iqhwL.js";import"./capacitor-DSpR9wll.js";import"./ui-radix-DzQ_orwq.js";import"./supabase-DoZmW4Yf.js";import"./cardRarity-Dzs2XQGr.js";const re="alerts_feed_cache_v2",v=["alerts-feed"],Xe=()=>({notifications:[],friendActivities:[],levelUps:[],dailySummaries:[],verifiedEvents:[],pickemOpenEvents:[],predictionHits:[],predictionRecaps:[],cardGifts:[],unreadCount:0}),ie=e=>{const s=(e==null?void 0:e.items)||[],a=[],n=[],h=[],l=[],p=[],f=[],x=[],g=[],N=[];for(const r of s)r.type==="notification"&&r.match?a.push({match:{...r.match,best_of:r.match.best_of||3,status:r.match.status||"completed"},isRead:r.isRead,notificationIds:r.notificationIds||[],sentAt:r.sentAt}):r.type==="friend_activity"?n.push({type:"friend_activity",id:r.id,userId:r.userId,displayName:r.displayName,avatarUrl:r.avatarUrl,activityType:r.activityType,description:r.description,eventName:r.eventName,rank:r.rank,previousRank:r.previousRank,timestamp:r.timestamp,matchId:r.matchId,predictedTeam:r.predictedTeam,voterCount:r.voterCount,matchCount:r.matchCount}):r.type==="level_up"?h.push({id:r.id,level:r.level,title:r.title,totalXP:r.totalXP??r.total_xp??0,isRead:!!r.isRead,timestamp:r.timestamp}):r.type==="daily_xp_summary"?l.push({id:r.id,totalXP:r.totalXP??0,correctPicks:r.correctPicks??0,totalPicks:r.totalPicks??0,accuracyPct:r.accuracyPct??0,hotDay:!!r.hotDay,isRead:!!r.isRead,timestamp:r.timestamp}):r.type==="verified"?p.push({id:r.id,variant:r.variant||"blue",isRead:!!r.isRead,timestamp:r.timestamp}):r.type==="pickem_event_open"?f.push({id:r.id,eventId:r.eventId,eventName:r.eventName,isMlp:!!r.isMlp,submitterCount:Number(r.submitterCount??0),predictionsLockAt:r.predictionsLockAt??null,isRead:!!r.isRead,timestamp:r.timestamp}):r.type==="prediction_hit"||r.type==="prop_bet_hit"?x.push({id:r.id,predictionId:r.predictionId,question:r.question,answer:r.answer,points:Number(r.points??0),creatorName:r.creatorName??null,creatorAvatarUrl:r.creatorAvatarUrl??null,isRead:!!r.isRead,timestamp:r.timestamp}):r.type==="prediction_recap"||r.type==="prop_bet_recap"?g.push({id:r.id,predictionId:r.predictionId,question:r.question,correctAnswer:r.correctAnswer,creatorName:r.creatorName??null,creatorAvatarUrl:r.creatorAvatarUrl??null,creatorPick:r.creatorPick??null,creatorWasCorrect:r.creatorWasCorrect??null,consensusAnswer:r.consensusAnswer??null,consensusPct:Number(r.consensusPct??0),totalPicks:Number(r.totalPicks??0),headline:r.headline,subline:r.subline??null,isRead:!!r.isRead,timestamp:r.timestamp}):r.type==="card_gift"&&N.push({id:r.id,userCardId:r.userCardId,senderId:r.senderId??null,senderName:r.senderName||"A user",senderAvatarUrl:r.senderAvatarUrl??null,playerName:r.playerName||"Card",rarity:r.rarity??null,isRead:!!r.isRead,timestamp:r.timestamp});const _=a.filter(r=>!r.isRead).length+h.filter(r=>!r.isRead).length+l.filter(r=>!r.isRead).length+p.filter(r=>!r.isRead).length+f.filter(r=>!r.isRead).length+x.filter(r=>!r.isRead).length+g.filter(r=>!r.isRead).length+N.filter(r=>!r.isRead).length;return{notifications:a,friendActivities:n,levelUps:h,dailySummaries:l,verifiedEvents:p,pickemOpenEvents:f,predictionHits:x,predictionRecaps:g,cardGifts:N,unreadCount:(e==null?void 0:e.unreadCount)??_,_complete:!0}},ze=e=>{if(!(!e||typeof window>"u"))try{const s=localStorage.getItem(`${re}_${e}`)??localStorage.getItem(`alerts_feed_cache_${e}`);if(!s)return;const a=JSON.parse(s);return{notifications:Array.isArray(a==null?void 0:a.notifications)?a.notifications:[],friendActivities:Array.isArray(a==null?void 0:a.friendActivities)?a.friendActivities:[],levelUps:Array.isArray(a==null?void 0:a.levelUps)?a.levelUps:[],dailySummaries:Array.isArray(a==null?void 0:a.dailySummaries)?a.dailySummaries:[],verifiedEvents:Array.isArray(a==null?void 0:a.verifiedEvents)?a.verifiedEvents:[],pickemOpenEvents:Array.isArray(a==null?void 0:a.pickemOpenEvents)?a.pickemOpenEvents:[],predictionHits:Array.isArray(a==null?void 0:a.predictionHits)?a.predictionHits:[],predictionRecaps:Array.isArray(a==null?void 0:a.predictionRecaps)?a.predictionRecaps:[],cardGifts:Array.isArray(a==null?void 0:a.cardGifts)?a.cardGifts:[],unreadCount:typeof(a==null?void 0:a.unreadCount)=="number"?a.unreadCount:0,_complete:!0}}catch{return}},ne=(e,s)=>{var a;s._complete&&(s.notifications.length===0&&s.friendActivities.length===0&&(((a=s.levelUps)==null?void 0:a.length)??0)===0&&s.unreadCount===0||ue.setItem(`${re}_${e}`,JSON.stringify(s)).catch(n=>z.warn("[useAlertsFeed] Cache write failed:",n)))},oe=async(e=!1)=>{const{data:s,error:a}=await S.functions.invoke("notifications-feed",{headers:{"Content-Type":"application/json"},body:e?{refresh:!0}:void 0});if(a)throw a;return s||{}},Ge=async e=>{try{const s=await oe(!0),a=ie(s);return ne(e,a),a}catch(s){throw s}},We=async(e,s)=>{var n,h,l;const a=performance.now();z.log("[useAlertsFeed] Loading complete chronological feed for user:",e.
1slice(0,8));try{const p=await oe(!1),f=p!=null&&p.fromCache&&(p!=null&&p.stale)?await Ge(e):ie(p);return ne(e,f),(n=s==null?void 0:s.onBackgroundRefresh)==null||n.call(s,f),z.log("[useAlertsFeed] Complete feed loaded",f.notifications.length+f.friendActivities.length+(((h=f.levelUps)==null?void 0:h.length)??0)+(((l=f.dailySummaries)==null?void 0:l.length)??0),"items in",(performance.now()-a).toFixed(0),"ms"),f}catch{return ze(e)??{...Xe(),_complete:!0}}},Ye=()=>{const{userId:e}=ee(),s=Ae(),a=u.useRef(!1),{data:n,isLoading:h,isFetching:l,isError:p,refetch:f}=Ce({queryKey:[...v,e],queryFn:()=>We(e,{onBackgroundRefresh:o=>{s.setQueryData([...v,e],o),s.setQueryData(["unread-alerts-count",e],o.unreadCount)}}),enabled:!!e,staleTime:3e4,gcTime:5*60*1e3,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:3,retryDelay:o=>Math.min(1e3*(o+1),5e3)});u.useEffect(()=>{if(p&&e){const o=setTimeout(()=>{f()},3e3);return()=>clearTimeout(o)}},[p,e,f]);const x=(n==null?void 0:n.notifications)??[],g=(n==null?void 0:n.friendActivities)??[],N=(n==null?void 0:n.levelUps)??[],_=(n==null?void 0:n.dailySummaries)??[],r=(n==null?void 0:n.verifiedEvents)??[],A=(n==null?void 0:n.pickemOpenEvents)??[],j=(n==null?void 0:n.predictionHits)??[],k=(n==null?void 0:n.predictionRecaps)??[],m=(n==null?void 0:n.cardGifts)??[],I=(n==null?void 0:n.unreadCount)??0,q=!!(n!=null&&n._complete),M=$({mutationFn:async o=>{const{error:c}=await S.from("notification_history").update({is_read:!0}).in("id",o);if(c)throw c;return o},onMutate:async o=>{await s.cancelQueries({queryKey:[...v,e]});const c=s.getQueryData([...v,e]),i=s.getQueryData(["unread-alerts-count",e]);if(c){const b={...c,notifications:c.notifications.map(w=>w.notificationIds.some(L=>o.includes(L))&&!w.isRead?{...w,isRead:!0}:w),unreadCount:0};b.unreadCount=b.notifications.filter(w=>!w.isRead).length,s.setQueryData([...v,e],b),s.setQueryData(["unread-alerts-count",e],b.unreadCount)}return{previousData:c,previousBadge:i}},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge)},onSuccess:()=>{s.invalidateQueries({queryKey:["unread-alerts-count",e]})}}),B=$({mutationFn:async()=>{const{error:o}=await S.from("notification_history").update({is_read:!0}).eq("user_id",e).eq("is_read",!1);if(o)throw o;const{error:c}=await S.from("pickem_level_up_events").update({is_read:!0}).eq("user_id",e).eq("is_read",!1);if(c)throw c;const{error:i}=await S.from("pickem_fan_pick_daily_summaries").update({is_read:!0}).eq("user_id",e).eq("is_read",!1);if(i)throw i;await S.from("profiles").update({last_seen_prop_bet_hits_at:new Date().toISOString()}).eq("id",e)},onMutate:async()=>{await s.cancelQueries({queryKey:[...v,e]});const o=s.getQueryData([...v,e]),c=s.getQueryData(["unread-alerts-count",e]);return o&&s.setQueryData([...v,e],{...o,notifications:o.notifications.map(i=>({...i,isRead:!0})),levelUps:(o.levelUps??[]).map(i=>({...i,isRead:!0})),dailySummaries:(o.dailySummaries??[]).map(i=>({...i,isRead:!0})),predictionHits:(o.predictionHits??[]).map(i=>({...i,isRead:!0})),unreadCount:0}),s.setQueryData(["unread-alerts-count",e],0),a.current=!0,{previousData:o,previousBadge:c}},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge)},onSuccess:()=>{s.invalidateQueries({queryKey:["unread-alerts-count",e]})}}),C=$({mutationFn:async o=>{const{error:c}=await S.from("pickem_level_up_events").delete().eq("id",o.id);if(c)throw c;return o},onMutate:async o=>{await s.cancelQueries({queryKey:[...v,e]});const c=s.getQueryData([...v,e]),i=s.getQueryData(["unread-alerts-count",e]);if(c){const b={...c,levelUps:(c.levelUps??[]).filter(w=>w.id!==o.id),unreadCount:o.isRead?c.unreadCount:Math.max(0,c.unreadCount-1)};s.setQueryData([...v,e],b),s.setQueryData(["unread-alerts-count",e],b.unreadCount)}return{previousData:c,previousBadge:i}},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge)},onSuccess:()=>{s.invalidateQueries({queryKey:["unread-alerts-count",e]})}}),T=$({mutationFn:async o=>{const{error:c}=await S.from("pickem_fan_pick_daily_summaries").delete().eq("id",o.id
1);if(c)throw c;return o},onMutate:async o=>{await s.cancelQueries({queryKey:[...v,e]});const c=s.getQueryData([...v,e]),i=s.getQueryData(["unread-alerts-count",e]);if(c){const b={...c,dailySummaries:(c.dailySummaries??[]).filter(w=>w.id!==o.id),unreadCount:o.isRead?c.unreadCount:Math.max(0,c.unreadCount-1)};s.setQueryData([...v,e],b),s.setQueryData(["unread-alerts-count",e],b.unreadCount)}return{previousData:c,previousBadge:i}},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge)},onSuccess:()=>{s.invalidateQueries({queryKey:["unread-alerts-count",e]})}}),E=$({mutationFn:async o=>{const{error:c}=await S.from("notification_history").delete().in("id",o.notificationIds);if(c)throw c;return o},onMutate:async o=>{await s.cancelQueries({queryKey:[...v,e]});const c=s.getQueryData([...v,e]),i=s.getQueryData(["unread-alerts-count",e]);if(c){const b={...c,notifications:c.notifications.filter(w=>w.match.id!==o.match.id),unreadCount:o.isRead?c.unreadCount:Math.max(0,c.unreadCount-1)};s.setQueryData([...v,e],b),s.setQueryData(["unread-alerts-count",e],b.unreadCount)}return{previousData:c,previousBadge:i}},onSuccess:()=>{Y({title:"Alert dismissed"}),s.invalidateQueries({queryKey:["unread-alerts-count",e]})},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge),Y({title:"Failed to dismiss alert",variant:"destructive"})}}),P=$({mutationFn:async o=>{const{error:c}=await S.from("verified_events").update({dismissed:!0,is_read:!0}).eq("id",o.id);if(c)throw c;return o},onMutate:async o=>{await s.cancelQueries({queryKey:[...v,e]});const c=s.getQueryData([...v,e]),i=s.getQueryData(["unread-alerts-count",e]);if(c){const b={...c,verifiedEvents:(c.verifiedEvents??[]).filter(w=>w.id!==o.id),unreadCount:o.isRead?c.unreadCount:Math.max(0,c.unreadCount-1)};s.setQueryData([...v,e],b),s.setQueryData(["unread-alerts-count",e],b.unreadCount)}return{previousData:c,previousBadge:i}},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge)},onSuccess:()=>{s.invalidateQueries({queryKey:["unread-alerts-count",e]})}}),R=$({mutationFn:async o=>{if(!e)throw new Error("Not authenticated");const{error:c}=await S.from("pickem_open_feed_dismissals").upsert({user_id:e,event_id:o.eventId},{onConflict:"user_id,event_id"});if(c)throw c;return o},onMutate:async o=>{await s.cancelQueries({queryKey:[...v,e]});const c=s.getQueryData([...v,e]),i=s.getQueryData(["unread-alerts-count",e]);if(c){const b={...c,pickemOpenEvents:(c.pickemOpenEvents??[]).filter(w=>w.id!==o.id),unreadCount:o.isRead?c.unreadCount:Math.max(0,c.unreadCount-1)};s.setQueryData([...v,e],b),s.setQueryData(["unread-alerts-count",e],b.unreadCount)}return{previousData:c,previousBadge:i}},onError:(o,c,i)=>{i!=null&&i.previousData&&s.setQueryData([...v,e],i.previousData),(i==null?void 0:i.previousBadge)!==void 0&&s.setQueryData(["unread-alerts-count",e],i.previousBadge)},onSuccess:()=>{s.invalidateQueries({queryKey:["unread-alerts-count",e]})}}),Q=u.useCallback(()=>{const o=x.slice(0,2).filter(c=>!c.isRead).flatMap(c=>c.notificationIds);o.length>0&&M.mutate(o)},[x,M]),F=u.useCallback(()=>{if(a.current||I===0)return;a.current=!0;const o=x.filter(c=>!c.isRead).flatMap(c=>c.notificationIds);o.length>0&&M.mutate(o)},[x,I,M]);return u.useEffect(()=>{I>0&&(a.current=!1)},[x.length,I]),{notifications:x,friendActivities:g,levelUps:N,dailySummaries:_,verifiedEvents:r,pickemOpenEvents:A,predictionHits:j,predictionRecaps:k,cardGifts:m,unreadCount:I,isLoading:h&&x.length===0&&g.length===0&&N.length===0&&_.length===0&&r.length===0&&A.length===0&&j.length===0&&k.length===0&&!p,isComplete:q,isRefreshing:l&&!!n,markAsRead:o=>M.mutate(o),markAllAsRead:()=>B.mutate(),dismiss:o=>E.mutate(o),dismissLevelUp:o=>C.mutate(o),dismissDailySummary:o=>T.mutate(o),dismissVerified:o=>P.mutate(o),dismissPickemOpen:o=>R.mutate(o),markInitialAsRead:Q,handleScroll:F,refetch:f,userId:e}},X=80,Ze=.5,Je=({match:e,isRead:s,onDismiss:a,onClick:n,preloadedRatings:h})=>{const[l,p]=u.useState(0),[f,x]=u.useState(!1),[g,N]=u.useState(!0),_=u.useRef(0),r=u.useRef(0),A=u.useRef(null),j=u.useRef(null),k=u.useRef(0),m=u.useRef(0);u.useEffect(()=>()=>{j.current!==null&&(cancelAnimationFrame(j.current),j.current=null)},[]);const I=C=>{_.current=C.touches[0].clientX,r.current=Date.now()},q=C=>{if(f)return;const E=C.touches[0].clientX-_.current,P=E>0?E:0;k.current=P,j.current===null&&(j.current=requestAnimationFrame(()=>{j.current=null;const R=k.current;m.current=R,p(R)}))},M=()=>
1{if(f)return;if(j.current!==null){cancelAnimationFrame(j.current),j.current=null;const Q=k.current;m.current=Q,p(Q)}const T=Date.now()-r.current,E=m.current,P=Math.max(16,T),R=Math.abs(E)/P;E>X||R>Ze&&E>30?B():(k.current=0,m.current=0,p(0))},B=()=>{var T;x(!0);const C=((T=A.current)==null?void 0:T.offsetWidth)||300;k.current=C,m.current=C,p(C),setTimeout(()=>{N(!1),a()},300)};return g?t.jsxs("div",{ref:A,className:"relative overflow-hidden",children:[t.jsx("div",{className:D("absolute inset-0 flex items-center justify-start pl-4 rounded-lg transition-colors",l>X?"bg-destructive/30":"bg-muted/50"),children:t.jsxs("div",{className:D("flex items-center gap-2 text-scalable-sm font-medium transition-all",l>X?"text-destructive":"text-muted-foreground"),children:[t.jsx(H,{className:"w-4 h-4"}),t.jsx("span",{className:"text-xs",children:"Dismiss"})]})}),t.jsx("div",{className:D("relative touch-pan-y",f&&"animate-swipe-out-right"),style:{transform:`translateX(${l}px)`,transition:f?"transform 0.3s ease-out":l===0?"transform 0.2s ease-out":"none"},onTouchStart:I,onTouchMove:q,onTouchEnd:M,children:t.jsx("div",{className:D("relative rounded-lg border border-border/40 bg-card/40 overflow-hidden",!s&&"before:absolute before:left-0 before:top-0 before:bottom-0 before:w-1 before:bg-destructive before:rounded-l-lg before:z-10"),children:t.jsx(me,{match:e,onClick:n,className:D(!s&&"bg-destructive/5 border-destructive/20"),preloadedRatings:h,hideMeta:!0})})})]}):null};function et({activity:e,onTap:s}){const{isVerified:a,getVerifiedBadgeVariant:n}=pe(),h=V();let l="";try{const g=new Date,N=new Date(e.timestamp),_=Fe(g,N),r=Ue(g,N),A=Ve(g,N),j=qe(g,N);_<1?l="now":_<60?l=`${_}m`:r<24?l=`${r}h`:A<7?l=`${A}d`:l=`${j}w`}catch{l=""}const p=e.type==="fan_vote_match",f=e.type==="fan_vote_digest",x=()=>{if(p&&e.matchId){h(`/match/${e.matchId}`);return}f||s==null||s(e.userId)};return f?t.jsxs("button",{className:"flex items-center gap-2.5 w-full text-left rounded-lg px-3 py-1.5 bg-muted/20 hover:bg-muted/40 transition-colors",onClick:x,children:[t.jsx("div",{className:"h-7 w-7 shrink-0 rounded-full bg-primary/10 text-primary flex items-center justify-center",children:t.jsx(Se,{className:"h-3.5 w-3.5"})}),t.jsx("div",{className:"flex-1 min-w-0 leading-tight",children:t.jsxs("div",{children:[t.jsx("span",{className:"text-xs font-medium",children:"Fan Votes"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:e.description})]})}),l&&t.jsx("span",{className:"text-[10px] text-muted-foreground/50 shrink-0",children:l})]}):t.jsxs("button",{className:"flex items-center gap-2.5 w-full text-left rounded-lg px-3 py-1.5 bg-muted/20 hover:bg-muted/40 transition-colors",onClick:x,children:[t.jsxs(fe,{className:"h-7 w-7 shrink-0 self-center",children:[t.jsx(he,{src:e.avatarUrl||void 0}),t.jsx(ve,{className:"text-[9px] bg-primary/10 text-primary font-semibold",children:e.displayName.charAt(0).toUpperCase()})]}),t.jsxs("div",{className:"flex-1 min-w-0 leading-snug",children:[t.jsxs("div",{className:"text-xs",children:[p&&t.jsx(Ee,{className:"inline-block h-3 w-3 mr-1 -mt-0.5 text-primary align-middle"}),t.jsxs("span",{className:"font-medium inline-flex items-center align-middle gap-0.5",children:[t.jsx("span",{children:e.displayName}),a(e.userId)&&t.jsx(se,{className:"shrink-0 -translate-y-[0.5px]",variant:n(e.userId)})]}),t.jsx("span",{className:"text-muted-foreground ml-1.5",children:e.description})]}),e.eventName&&t.jsx("div",{className:"text-[10px] text-muted-foreground/50 mt-px",children:e.eventName})]}),l&&t.jsx("span",{className:"text-[10px] text-muted-foreground/50 shrink-0",children:l})]})}function tt({event:e,onDismiss:s}){return t.jsxs("div",{className:D("relative flex items-center gap-3 rounded-lg border px-3 py-2.5 overflow-hidden","border-[hsl(var(--pickem-accent))]/30",!e.isRead&&"bg-[hsl(var(--pickem-accent))]/8"),style:{background:e.isRead?void 0:"linear-gradient(90deg, hsl(var(--pickem-accent) / 0.10), hsl(var(--pickem-accent) / 0.02))"},children:[t.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--pickem-accent))]/15 text-[hsl(var(--pickem-accent))]",children:t.jsx(Ie,{className:"h-4 w-4 fill-current"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.18em] text-[hsl(var(--pickem-accent))]",children:"Level Up"}),!e.isRead&&t.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-upset-indicator"})]}),t.jsxs("div",{className:"truncate text-sm font-semibold text-foreground",children:["You reached Level ",e.level," — ",e.title]})]}),s&&t.jsx("button",{onClick:s,"aria-label":"Dismiss",className:"text-muted-foreground
1/60 hover:text-foreground transition-colors",style:{WebkitTapHighlightColor:"transparent"},children:t.jsx(H,{className:"h-3.5 w-3.5"})})]})}function st({summary:e,onDismiss:s}){return t.jsxs("div",{className:D("relative flex items-center gap-3 rounded-lg border px-3 py-2.5 overflow-hidden","border-[hsl(var(--pickem-accent))]/30",!e.isRead&&"bg-[hsl(var(--pickem-accent))]/8"),style:{background:e.isRead?void 0:"linear-gradient(90deg, hsl(var(--pickem-accent) / 0.10), hsl(var(--pickem-accent) / 0.02))"},children:[t.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--pickem-accent))]/15 text-[hsl(var(--pickem-accent))]",children:t.jsx(Me,{className:"h-4 w-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.18em] text-[hsl(var(--pickem-accent))]",children:"Daily Fan Picks"}),e.hotDay&&t.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-semibold text-orange-500",children:[t.jsx(Te,{className:"h-3 w-3 fill-current"})," Hot day"]})]}),t.jsxs("div",{className:"text-sm font-semibold text-foreground leading-snug",children:["+",e.totalXP," XP",e.totalFanVotePoints&&e.totalFanVotePoints>0?t.jsxs("span",{className:"text-foreground",children:[" · +",e.totalFanVotePoints," pts"]}):null,t.jsxs("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground whitespace-nowrap",children:["· ",e.correctPicks,"/",e.totalPicks," (",e.accuracyPct,"%)"]})]})]}),(()=>{const a=e.timestamp?Be(e.timestamp):null;return!a||!Le(a)?null:t.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground/70 tabular-nums",children:Oe(a,{addSuffix:!1})})})()]})}function at({event:e}){const s=V(),a=e.variant==="pink"?"330 85% 60%":"var(--primary)";return t.jsxs("button",{type:"button",onClick:()=>s("/account-settings"),className:D("relative w-full text-left overflow-hidden rounded-xl border px-4 py-3.5 transition-transform active:scale-[0.99]","shadow-[0_4px_18px_-6px_hsl(var(--primary)/0.35)]"),style:{borderColor:`hsl(${a} / 0.45)`,background:`linear-gradient(120deg, hsl(${a} / 0.18) 0%, hsl(${a} / 0.06) 55%, hsl(var(--background)) 100%)`},children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-6 -top-6 h-24 w-24 rounded-full blur-2xl",style:{background:`hsl(${a} / 0.35)`}}),t.jsxs("div",{className:"relative flex items-center gap-3.5",children:[t.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-background/80 ring-2",style:{boxShadow:`0 0 0 2px hsl(${a} / 0.35)`},children:t.jsx(se,{size:"md",variant:e.variant,className:"!h-7 !w-7"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.22em]",style:{color:`hsl(${a})`},children:"You're Verified"}),t.jsx("div",{className:"mt-0.5 text-sm font-semibold leading-snug text-foreground",children:"Welcome to the blue check club."})]})]})]})}const rt=e=>{if(!e)return null;const s=new Date(e).getTime()-Date.now();if(!Number.isFinite(s)||s<=0)return null;const a=Math.round(s/(1e3*60*60));return a<1?"Locks soon":a<24?`Locks in ${a}h`:`Locks in ${Math.round(a/24)}d`};function it({event:e,onDismiss:s}){const a=V(),n="var(--primary)",h=rt(e.predictionsLockAt);return t.jsxs("div",{className:D("relative w-full overflow-hidden rounded-xl border transition-transform active:scale-[0.99]","shadow-[0_4px_18px_-6px_hsl(var(--primary)/0.35)]"),style:{borderColor:`hsl(${n} / 0.45)`,background:`linear-gradient(120deg, hsl(${n} / 0.18) 0%, hsl(${n} / 0.06) 55%, hsl(var(--background)) 100%)`},children:[t.jsxs("button",{type:"button",onClick:()=>a("/pickem"),className:"relative flex w-full items-center gap-3.5 px-4 py-3.5 text-left",children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-6 -top-6 h-24 w-24 rounded-full blur-2xl",style:{background:`hsl(${n} / 0.35)`}}),t.jsx("div",{className:"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-background/80 ring-2",style:{boxShadow:`0 0 0 2px hsl(${n} / 0.35)`},children:t.jsx(te,{className:"h-5 w-5",style:{color:`hsl(${n})`}})}),t.jsxs("div",{className:"relative min-w-0 flex-1 pr-6",children:[t.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.22em]",style:{color:`hsl(${n})`},children:"Picks Are Open"}),t.jsxs("div",{className:"mt-0.5 text-sm font-semibold leading-snug text-foreground",children:[t.jsx("span",{className:"truncate",children:e.eventName}),e.isMlp?" — pick your medals":" — make your picks"]}),t.jsxs("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:[e.submitterCount,"+ players in",h?` · ${h}`:""]})]})]}),s&&t.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),s()},"aria-label":"Dismiss",className:"absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground
1/70 hover:bg-background/60 hover:text-foreground",children:t.jsx(H,{className:"h-3.5 w-3.5"})})]})}function nt({event:e}){var l;const s=V(),a="var(--pickem-accent)",n=e.packCount,h=(l=e.eventName)==null?void 0:l.replace(/ Pick '?Em$/i,"").trim();return t.jsx("div",{className:"relative w-full overflow-hidden rounded-xl border transition-transform active:scale-[0.99] shadow-[0_4px_18px_-6px_hsl(var(--pickem-accent)/0.45)]",style:{borderColor:`hsl(${a} / 0.45)`,background:`linear-gradient(120deg, hsl(${a} / 0.2) 0%, hsl(${a} / 0.06) 55%, hsl(var(--background)) 100%)`},children:t.jsxs("button",{type:"button",onClick:()=>s("/pickem?openPack=1"),className:"relative flex w-full items-center gap-3.5 px-4 py-3.5 text-left",children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-6 -top-6 h-24 w-24 rounded-full blur-2xl",style:{background:`hsl(${a} / 0.35)`}}),t.jsxs("div",{className:"relative flex h-11 w-11 shrink-0 items-center justify-center overflow-hidden rounded-full bg-background/80",style:{boxShadow:`0 0 0 2px hsl(${a} / 0.4)`},children:[t.jsx("img",{src:xe,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full scale-[1.5] select-none object-contain opacity-[0.14]"}),t.jsx(ae,{className:"relative h-5 w-5"})]}),t.jsxs("div",{className:"relative min-w-0 flex-1 pr-2",children:[t.jsxs("div",{className:"font-player text-[10px] font-bold uppercase tracking-[0.22em]",style:{color:`hsl(${a})`},children:[n," pack",n===1?"":"s"," ready"]}),t.jsx("div",{className:"mt-0.5 text-sm font-semibold leading-snug text-foreground",children:"Rip your rewards"}),t.jsx("div",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:h?`Earned at ${h} · tap to open`:"Tap to open your pack"})]})]})})}function ot({event:e}){const s=V(),a="var(--pickem-accent)";return t.jsx("div",{className:"relative w-full overflow-hidden rounded-xl border transition-transform active:scale-[0.99]",style:{borderColor:`hsl(${a} / 0.35)`,background:`linear-gradient(120deg, hsl(${a} / 0.14) 0%, hsl(var(--background)) 70%)`},children:t.jsxs("button",{type:"button",onClick:()=>s("/account-settings"),className:"relative flex w-full items-center gap-3.5 px-4 py-3.5 text-left",children:[t.jsx("div",{className:"relative flex h-11 w-11 shrink-0 items-center justify-center overflow-hidden rounded-full bg-background/80",style:{boxShadow:`0 0 0 2px hsl(${a} / 0.35)`},children:e.senderAvatarUrl?t.jsx("img",{src:e.senderAvatarUrl,alt:"","aria-hidden":"true",className:"h-full w-full object-cover"}):t.jsx(ae,{className:"h-5 w-5"})}),t.jsxs("div",{className:"relative min-w-0 flex-1 pr-2",children:[t.jsx("div",{className:"font-player text-[10px] font-bold uppercase tracking-[0.22em]",style:{color:`hsl(${a})`},children:"Card received"}),t.jsxs("div",{className:"mt-0.5 truncate text-sm font-semibold leading-snug text-foreground",children:[e.senderName," sent you a card"]}),t.jsxs("div",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:[e.playerName,e.rarity?` · ${e.rarity}`:""," · tap to view your binder"]})]})]})})}function ct({event:e}){return t.jsxs("div",{className:D("relative flex items-center gap-3 rounded-lg border px-3 py-2.5 overflow-hidden","border-[hsl(var(--pickem-accent))]/30",!e.isRead&&"bg-[hsl(var(--pickem-accent))]/8"),style:{background:e.isRead?void 0:"linear-gradient(90deg, hsl(var(--pickem-accent) / 0.10), hsl(var(--pickem-accent) / 0.02))"},children:[e.creatorAvatarUrl?t.jsx("img",{src:e.creatorAvatarUrl,alt:e.creatorName||"",className:"h-8 w-8 shrink-0 rounded-full object-cover ring-2 ring-[hsl(var(--pickem-accent))]/40",onError:s=>s.currentTarget.style.display="none"}):t.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--pickem-accent))]/15 text-[hsl(var(--pickem-accent))]",children:t.jsx(te,{className:"h-4 w-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.18em] text-[hsl(var(--pickem-accent))]",children:"Prediction Hit"}),!e.isRead&&t.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-upset-indicator"}),e.points>0&&t.jsxs("span",{className:"ml-auto text-xs font-bold text-[hsl(var(--pickem-accent))]",children:["+",e.points.toLocaleStr
1ing()," pts"]})]}),t.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:e.question}),t.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:["Your pick: ",t.jsx("span",{className:"text-foreground",children:e.answer})]})]})]})}function lt({event:e}){const s=e.creatorWasCorrect===!0,a=e.creatorWasCorrect===!1;return t.jsxs("div",{className:D("relative flex items-center gap-3 rounded-lg border px-3 py-2.5 overflow-hidden","border-[hsl(var(--pickem-accent))]/30"),style:{background:"linear-gradient(90deg, hsl(var(--pickem-accent) / 0.10), hsl(var(--pickem-accent) / 0.02))"},children:[e.creatorAvatarUrl?t.jsxs("div",{className:"relative shrink-0",children:[t.jsx("img",{src:e.creatorAvatarUrl,alt:e.creatorName||"",className:"h-9 w-9 rounded-full object-cover ring-2 ring-[hsl(var(--pickem-accent))]/40",onError:n=>n.currentTarget.style.display="none"}),(s||a)&&t.jsx("span",{className:D("absolute -bottom-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded-full ring-2 ring-background",s?"bg-emerald-500 text-white":"bg-rose-500 text-white"),children:s?t.jsx(Qe,{className:"h-2.5 w-2.5"}):t.jsx(H,{className:"h-2.5 w-2.5"})})]}):t.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--pickem-accent))]/15 text-[hsl(var(--pickem-accent))]",children:t.jsx(Pe,{className:"h-4 w-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.18em] text-[hsl(var(--pickem-accent))]",children:"Prediction Recap"}),e.totalPicks>0&&t.jsxs("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground",children:[e.totalPicks.toLocaleString()," picks"]})]}),t.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:e.headline}),e.subline&&t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:e.subline})]})]})}const dt=132;function ut(){var h,l;if(typeof window>"u"||!!((l=(h=window==null?void 0:window.Capacitor)==null?void 0:h.isNativePlatform)!=null&&l.call(h)))return!0;const s="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,a=typeof window.matchMedia=="function"&&(window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches),n=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);return!!(s||a||n)}function G(e){return e.type==="notification"?`n-${e.data.match.id}`:e.type==="friend_activity"?`f-${e.data.id}`:e.type==="level_up"?`l-${e.data.id}`:e.type==="verified"?`v-${e.data.id}`:e.type==="pickem_event_open"?`p-${e.data.id}`:e.type==="prediction_hit"?`pb-${e.data.id}`:e.type==="card_pack"?`cp-${e.data.id}`:e.type==="prediction_recap"?`pbr-${e.data.id}`:`d-${e.data.id}`}function ce({item:e,showMatchResultsHeader:s,onDismiss:a,onClick:n,onLevelUpDismiss:h,onDailySummaryDismiss:l,onVerifiedDismiss:p,onPickemOpenDismiss:f,onFriendActivityTap:x}){return e.type==="friend_activity"?t.jsx(et,{activity:e.data,onTap:x}):e.type==="verified"?t.jsx(at,{event:e.data}):e.type==="pickem_event_open"?t.jsx(it,{event:e.data,onDismiss:f?()=>f(e.data):void 0}):e.type==="card_gift"?t.jsx(ot,{event:e.data}):e.type==="card_pack"?t.jsx(nt,{event:e.data}):e.type==="prediction_hit"?t.jsx(ct,{event:e.data}):e.type==="prediction_recap"?t.jsx(lt,{event:e.data}):e.type==="level_up"?t.jsx(tt,{event:e.data,onDismiss:h?()=>h(e.data):void 0}):e.type==="daily_xp_summary"?t.jsx(st,{summary:e.data,onDismiss:l?()=>l(e.data):void 0}):e.type==="notification"?t.jsxs("div",{children:[s&&t.jsx("div",{className:"px-1 pt-1 pb-1.5 font-player text-xs font-bold uppercase tracking-[0.2em] text-foreground/85",children:"Match Results"}),t.jsx(Je,{match:e.data.match,isRead:e.data.isRead,onDismiss:()=>a(e.data),onClick:()=>n(e.data)})]}):null}function le(e,s){const a=e[s];if(!a||a.type!=="notification")return!1;const n=e[s-1];return!n||n.type!=="notification"}function mt(e){const{feedItems:s,onScrolled:a,containerHeight:n}=e,h=u.useRef(null),l=u.useRef(!1),p=u.useCallback(()=>{!l.current&&a&&(l.current=!0,a())},[a]);u.useEffect(()=>{l.current=!1},[s.length]);const f=typeof n=="number";return t.jsx("div",{ref:h,onScroll:p,className:f?"overflow-y-auto scrollbar-thin":"",style:f?{maxHeight:n}:void 0,children:t.jsx("div",{className:"w-full px-2",children:s.map((x,g)=>t.jsx("div",{className:"py-1",children:t.jsx(ce,{item:x,showMatchResultsHeader:le(s,g),...e})},G(x)))})})}function pt(e){const{feedItems:s,onScrolled:a,containerHeight:n}=e,h=u.useRef(null),l=u.useRef(!1),p=u.useCallback(()=>h.current,[]),f=u.useCallback(k=>{const m=s[k];return(m==null?void 0:m.type)==="friend_activity"?48:(m==null?void 0:m.type)==="level_up"?60:(m==null?void 0:m.type)==="daily_xp_summary"?64:(m==null?void 0:m.type)==="verified"?76:(m==null?void 0:m.type)==="pickem_event_open"?84:(m==null?void 0:m.type)==="prediction_hit"?76:(m==null?void 0:m.type)==="prediction_recap"?84:dt},[s]),x=u.useCallback(k=>{const m=s[k];return m?G(m):k},[s]),g=Re(u.useMemo(()=>({count:s.length,getScrollElement:p,estimateSize:f,getItemKey:x,overscan:3}),[s.length,p,f,x])),N=u.useRef(g);u.useEffect(()=>{N.current=g},[g]);const _=u.useCallback(k=>{k&&N.current.measureElement(k)},[]),r=u.useCallback(()=>{!l.current&&a&&(l.current=!0,a())},[a]);u.useEffect(()=>{l.current=!1},[s.length]);const A=g.getVirtualItems(),j=typeof n=="number";return t.jsx("div",{ref:h,onScroll:r,className:j?"overflow-y-auto scrollbar-thin":"",style:j?{maxHeight:n}:void 0,children:t.jsx("div",{className:"relative w-full",style:{height:`${g.getTotalSize()}px`},children:A.map(k=>{const m=s[k.index];return m?t.jsx("div",{className:"absolute top-0 left-0 w-full px-2",style:{transform:`translateY(${k.start}px)`},children:t.jsx("div",{ref:_,"data-index":k.index,className:"py-1",children:t.jsx(ce,{item:m,showMatchResultsHeader:le(s,k.index),...e})})},G(m)):null})})})}const ft=e=>!(J().pathname==="/notifications")||ut()?t.jsx(mt,{...e}):t.jsx(pt,{...e}),Z=100,ht=({hasFollowedPlayers:e=!0,onFriendActivityTap:s})=>{const{notifications:a,friendActivities:n,levelUps:h,dailySummaries:l,verifiedEvents:p,pickemOpenEvents:f,predictionHits:x,predictionRecaps:g,cardGifts:N,unreadCount:_,isLoading:r,isComplete:A,isRefreshing:j,markAllAsRead:k,dismiss:m,dismissLevelUp:I,dismissDailySummary:q,dismissVerified:M,dism
1issPickemOpen:B,markInitialAsRead:C,handleScroll:T,userId:E}=Ye(),{enabled:P}=He(),{packs:R}=Ke(),Q=u.useMemo(()=>{if(!P||!R||R.length===0)return null;const y=R.reduce((d,U)=>new Date(U.created_at).getTime()>new Date(d.created_at).getTime()?U:d);return{id:`packs-${R.length}-${y.id}`,packCount:R.length,eventName:y.event_name,isRead:!1,timestamp:y.created_at}},[P,R]),[F,o]=u.useState(null),[c,i]=u.useState(Z),b=r||j||!A;u.useEffect(()=>{if(b||a.length===0)return;const y=setTimeout(()=>C(),1500);return()=>clearTimeout(y)},[b,a.length,C]),u.useEffect(()=>{if(b||_===0)return;const y=setTimeout(()=>k(),1200);return()=>clearTimeout(y)},[b,_,k]);const w=y=>{o(y.match)},W=u.useMemo(()=>F?{...F}:null,[F]),L=u.useMemo(()=>{const y=[];for(const d of a){const U=d.sentAt?new Date(d.sentAt).getTime():d.match.updated_at?new Date(d.match.updated_at).getTime():d.match.time?new Date(d.match.time).getTime():Date.now();y.push({type:"notification",data:d,timestamp:U})}for(const d of n)y.push({type:"friend_activity",data:{id:d.id,userId:d.userId,displayName:d.displayName,avatarUrl:d.avatarUrl,type:d.activityType,description:d.description,eventName:d.eventName,rank:d.rank,previousRank:d.previousRank,timestamp:d.timestamp},timestamp:new Date(d.timestamp).getTime()});for(const d of h??[])y.push({type:"level_up",data:d,timestamp:new Date(d.timestamp).getTime()});if(A)for(const d of l??[])y.push({type:"daily_xp_summary",data:d,timestamp:new Date(d.timestamp).getTime()});for(const d of p??[])y.push({type:"verified",data:d,timestamp:new Date(d.timestamp).getTime()});for(const d of f??[])y.push({type:"pickem_event_open",data:d,timestamp:new Date(d.timestamp).getTime()});for(const d of x??[])y.push({type:"prediction_hit",data:d,timestamp:new Date(d.timestamp).getTime()});for(const d of g??[])y.push({type:"prediction_recap",data:d,timestamp:new Date(d.timestamp).getTime()});for(const d of N??[])y.push({type:"card_gift",data:d,timestamp:new Date(d.timestamp).getTime()});return Q&&y.push({type:"card_pack",data:Q,timestamp:new Date(Q.timestamp).getTime()}),y.sort((d,U)=>U.timestamp-d.timestamp),y},[a,n,h,l,p,f,x,g,N,Q,A]);if(!E||!e)return null;const de=!b&&L.length===0;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-full",children:b?t.jsx("div",{className:"w-full px-2 space-y-2","aria-hidden":!0,children:Array.from({length:12}).map((y,d)=>t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border/40 bg-muted/20 px-3 py-2.5",style:{opacity:Math.max(.15,1-d*.07)},children:[t.jsx(O,{className:"h-8 w-8 rounded-full shrink-0"}),t.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[t.jsx(O,{className:"h-2.5 w-20 rounded-sm"}),t.jsx(O,{className:"h-3.5 w-[80%] rounded-sm"})]}),t.jsx(O,{className:"h-2.5 w-8 rounded-sm shrink-0"})]},d))}):de?t.jsxs("div",{className:"flex flex-col items-center justify-center text-center px-6 py-16 gap-3",children:[t.jsx("div",{className:"h-14 w-14 rounded-full bg-muted/50 flex items-center justify-center",children:t.jsx($e,{className:"h-6 w-6 text-muted-foreground"})}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"font-semibold text-base",children:"You're all caught up"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-[260px]",children:"Match alerts, friend activity, and Pick'em updates will show up here."})]})]}):t.jsxs(t.Fragment,{children:[t.jsx(ft,{feedItems:L.slice(0,c),notifications:a,onDismiss:m,onClick:w,onLevelUpDismiss:I,onDailySummaryDismiss:q,onVerifiedDismiss:M,onPickemOpenDismiss:B,onFriendActivityTap:s,onScrolled:T}),L.length>c&&t.jsx("div",{className:"flex justify-center pt-3",children:t.jsx(ge,{variant:"outline",size:"sm",onClick:()=>i(y=>y+Z),children:"View more"})})]})}),t.jsx(ye,{match:W,open:!!F,onOpenChange:y=>!y&&o(null)})]})},St=()=>{const{userId:e}=ee(),s=be(),{isNativeIOS:a}=ke(),{isNativeAndroid:n}=Ne(),h=je(),l=J(),p=V(),f=we(),x=u.useRef(null);u.useEffect(()=>{l.hash==="#pickem"&&p("/account-settings#pickem",{replace:!0})},[l.hash,p]);const g=()=>{f()};return t.jsxs("div",{className:D("min-h-screen pb-safe pl-safe pr-safe overflow-x-hidden",a&&"pt-safe"),style:{background:"var(--gradient-header)"},children:[s&&a&&t.jsx("div",{className:"fixed top-0 left-0 right-0 z-[997] pointer-events-none",style:{height:"env(safe-area-inset-top)",background:"var(--gradient-header)"}}),s&&t.jsx("div",{className:"fixed left-0 right-0 z-[25] pointer-events-none",style:{to
1p:a?"env(safe-area-inset-top)":n?"24px":"0",height:h?"64px":"0px",background:"var(--gradient-header)",transition:"height 150ms ease-out"}}),!s&&t.jsx(_e,{onRefresh:()=>{},lastRefreshTime:null,onAuthClick:()=>g()}),s&&t.jsx("div",{ref:x,children:t.jsx(De,{onAuthClick:()=>g()})}),t.jsxs("main",{className:D(s?D("pb-20",n&&"pb-[calc(4.5rem+1rem)]"):"container mx-auto px-4 pt-20 pb-8"),children:[s&&a&&t.jsx("div",{className:"h-16"}),s&&!a&&!n&&t.jsx("div",{className:"h-16"}),s&&n&&t.jsx("div",{className:"h-[88px]"}),t.jsx("div",{className:D("animate-in fade-in-50 duration-300 space-y-4",s?"px-4":"",s&&a?"-mt-12":""),children:t.jsx(ht,{hasFollowedPlayers:!0,onFriendActivityTap:N=>{p(`/u/${N}`)}})}),!e&&t.jsx("footer",{className:"text-center pt-3 pb-1",children:t.jsxs("p",{className:"text-[9px] text-muted-foreground/60",children:[t.jsx(K,{to:"/support",className:"hover:text-muted-foreground underline-offset-2 hover:underline",children:"Contact Us"})," · ",t.jsx(K,{to:"/privacy-policy",className:"hover:text-muted-foreground underline-offset-2 hover:underline",children:"Privacy Policy"})," · ",t.jsx(K,{to:"/terms-of-service",className:"hover:text-muted-foreground underline-offset-2 hover:underline",children:"Terms of Use"})]})})]})]})};export{St 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.