1import{k as Hs,f as qe,r as l,j as e,R as m}from"./vendor-wagmi-CRHMQcRy.js";import{B as Os}from"./BorderedMainContent-B9qGeuWd.js";import{$ as ae,jr as Vs,js as Ys,jt as Qe,cZ as Ks,cY as _s,b7 as Zs,ju as Xs,eu as Je,b5 as qs,b6 as Qs,dI as Js,jv as Gs,ad as Ge,d1 as pe,bi as w,cb as ea,ao as q,H as h,f as D,ce as ta,ap as W,d9 as sa,I as U,d6 as et,bh as X,hC as aa,hD as na,K as ia,hE as ra,hF as la,f6 as tt,cl as oa,bQ as ca,gc as da,bC as ma,bO as xa,jw as ua,it as fa,z as st,aC as je,b3 as L,aE as Q,Z as F,as as E,gB as ha,gi as pa,jx as ja,fB as va,gC as Na,j2 as ve,j3 as at,iH as ba,bS as nt,ie as Ne,bf as Pe,bg as it,r as M,fc as ze,e4 as rt,jy as $e,jz as Ae,jA as Le,jB as Be,jC as G,jD as ee,jE as Re,jF as te,bm as se,jG as lt,ak as H,bz as Ee,dd as ot,jH as ct,dY as be,fp as Ca,d4 as O,d5 as V,J as ne,bJ as ya,al as De,eJ as dt,fN as wa,bj as Ce,bk as $,x as ga,bU as Fe,jI as We,jJ as mt,jK as xt,G as ie,P as ka,ba as ut,ev as Ia,jL as ft,jM as Ma,i5 as Ta,c0 as Ua,B as J,bb as Sa,aZ as Fa,az as Y,au as ht,jN as pt,c3 as Pa,jO as za,M as jt,eo as de,W as $a,X as Aa,jP as La,jQ as Ba,jR as Ra,jS as Ea,jT as ye,jU as Da,b$ as Wa,jV as Ha,dT as _e,fZ as me,jW as xe,jX as ue,a9 as Oa,jY as Va,jZ as Ya,f9 as fe,hJ as he,eb as Ka,j_ as _a,j$ as Za,k0 as Xa,E as vt,fq as qa,dt as He,D as Qa,d as Ja}from"./index-CjDX1y09.js";import{u as Oe}from"./vendor-charts-BcRAxB9K.js";import{u as we,b as ge,B as ke}from"./CastAttachmentsSection-B9VsE4ZG.js";import{U as Ie,a as Ga,L as Ze,M as en,F as Xe,e as Nt}from"./UnfocusedCast-MlYKetbN.js";import{b as Me}from"./useCastBody-B1TJEtfN.js";import{P as Ve}from"./PersonCircleIcon-kjCmkyEK.js";import{u as tn,f as bt,r as Se}from"./useRespondToChannelInvite-DYKXFnur.js";import{u as sn}from"./DepositBonusModal-DUH3J2Hb.js";import{D as an}from"./DollarCircleIcon-DNbQLJ7x.js";import{u as nn}from"./useNavigateToDirectCastsConversation--fX2rKm8.js";import{f as rn}from"./currencyUtils-DsOW9xA0.js";import{u as ln}from"./useOptimisticallyAddNewDirectCastConversationToInbox-Dam0mJZ7.js";import{b as on}from"./DirectCastUtils-Csf6YDsT.js";import{X as re}from"./XpRewardIcon-DTDNLZox.js";import{u as cn}from"./useComposeVerificationUrl-DJJxkJ_n.js";import{u as dn}from"./useStartScheduledAudioRoom-CgGC8W_h.js";import{D as Ct}from"./vendor-viem-ArXx0jqs.js";import{u as mn}from"./useGetXAuthLink-Ddbm-Mam.js";import{u as xn}from"./useSetOnCurrentNavLinkClicked-Bwq5qQ2L.js";import{n as un}from"./keyExtractorUtils-CBXPartG.js";import{P as fn}from"./Page-C2J4bqep.js";import{P as hn}from"./PageHeader-CFhDbjgp.js";import{P as pn}from"./PageTitle-Cat8u_GY.js";import{u as jn}from"./useParams-KuJTUgJA.js";import{P as vn,a as Nn}from"./PillTabs-CC_T0pin.js";import"./vendor-draftjs-CyxKTt2q.js";import"./vendor-privy-DhIdpdpm.js";import"./vendor-solana-CJKAWoEz.js";import"./vendor-emoji-C9KqHmBf.js";import"./ManageChannelUserDropdown-CMH0WxEQ.js";import"./useSendMessageToUser-DYgHwOl-.js";import"./useUserChannelRole-D0qYbPi3.js";import"./SelectOne-Xk6QroaQ.js";import"./index-BA-qcXsU.js";import"./useNavigateToAdminEngagementRingCandidates-BOTIeSBp.js";
1import"./useMarkVisible-5P3bRdZj.js";import"./useDevToolsDomainsOwned-BKtsYRSj.js";import"./SearchForDirectCastTargets-ePQ49shG.js";import"./useRemoveDirectCastConversationFromInbox-m7Ycxkfy.js";import"./casts-DIbT8ZMJ.js";import"./buildStarterPackUsersKey-DAwWEQU2.js";import"./VideoAttachment-BbkmyXvM.js";import"./ImageLightboxModal-DA8GdrFc.js";import"./buildNotificationsInGroupKey-D7IK4vWv.js";import"./ScrollToTop-DxjDDV6u.js";const bn=({fid:t})=>{const{apiClient:s}=ae();return Hs({...Vs,queryKey:Qe({fid:t}),queryFn:Ys({apiClient:s,fid:t})})},Cn=({tab:t,wasPopped:s})=>{const{apiClient:n}=ae(),i=Ks(),a=_s(Je({tab:t}),Xs({apiClient:n,tab:t,setLastCheckedTimestamp:!0,batchMergeIntoGloballyCachedCasts:i}),{initialPageParam:void 0,getNextPageParam:Zs},!s),r=qs(a);return Qs(a,{onEndReached:r})},yn=(t,s)=>Js(Je({tab:t}),s),wn=()=>{const{apiClient:t}=ae(),s=qe();return l.useCallback(async({notificationType:n,feedbackType:i,domain:a})=>{const r=await t.ingestNotificationFeedback({notificationType:n,feedbackType:i,domain:a});return a&&await s.invalidateQueries({queryKey:Gs({domain:a})}),r},[t,s])},gn=()=>{const{apiClient:t}=ae();return l.useCallback(()=>t.setLastCheckedTimestamp(),[t])},kn=()=>{const{apiClient:t}=ae(),s=qe();return l.useCallback(async({fid:n,channel:i})=>{const a=await t.startChannelStreak({channelKey:i.key});return s.setQueryData(Qe({fid:n}),r=>{if(!(typeof r>"u"))return{result:{streak:{channel:i,streakCount:0}}}}),a.data},[t,s])};/** 2 * @license lucide-react v0.487.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const In=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["rect",{x:"15",y:"5",width:"4",height:"12",rx:"1",key:"q8uenq"}],["rect",{x:"7",y:"8",width:"4",height:"9",rx:"1",key:"sr5ea"}]],Mn=Ge("chart-column-big",In);/** 7 * @license lucide-react v0.487.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Tn=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Un=Ge("video",Tn),yt=l.memo(({notificationGroup:t})=>{const s=we({fallback:t.previewItems[0].content.cast}),n=pe(),i=ge(),a=t.isUnread,r=l.useMemo(()=>Me([{cast:s}],{forceThreadPosition:"start_and_end",isHighlighted:a})[0],[s,a]);return i(s)?n?e.jsx(ke,{}):null:e.jsx(Ie,{castWithContext:r})});yt.displayName="CastMentionNotificationGroup";const y=24,le=({notificationGroup:t})=>{const s=l.useMemo(()=>{switch(t.type){case"channel-warning":case"active-badge":case"sync-contacts":case"report-action":case"user-boost":case"channel-role-invite":case"spammy-replies":case"channel-pinned-cast":case"connect-account":case"frame-generic":case"featured-frame":case"recovery-initiated":case"nudge-advanced-protection":case"trending-follow-recommendation":case"warps-redemption-offer":case"new-campaign":case"farcaster-tips-summary":case"tip-received":case"mini-app":case"collectible-cast-creator-bid":case"collectible-cast-bidder-time-left":case"collectible-cast-bidder-outbid":case"collectible-cast-bidder-settled":case"collectible-cast-creator-settled":case"collectible-cast-bidder-cancelled":case"collectible-cast-watch-available":case"trending-token":case"token-alert":case"trader-alert":case"xp-claim-reminder":case"xp-reward-expire-soon":case"xp-reward-expire-imminent":case"were-you-referred":case"referral-reminder":case"referral-launch":case"deposit-bonuses-launch":case"deposit-bonuses-ineligible":case"view-onramp-update":case"new-article":case"swap-failed":case"limit-order-matched":case"usdc-lending":return[];case"wallet-activity":return t.previewItems[0].content.type==="receive"&&t.previewItems[0].content.fromUser?[t.previewItems[0].content.fromUser]:[];default:return t.previewItems.map(({actor:i})=>i)}},[t.previewItems,t.type]),n=l.useMemo(()=>{switch(t.type){case"new-cast":case"new-cast-in-channel":case"dormant-user-new-cast":return Array.from(new Set(t.previewItems.map(({actor:i})=>i.fid))).length;case"channel-warning":return t.totalItemCount;case"active-badge":return t.totalItemCount;default:return t.totalItemCount}},[t.previewItems,t.totalItemCount,t.type]);return{users:s,totalCount:n}},wt=8,B=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),{users:n}=le({notificationGroup:t}),i=ea({fallback:n[0]}),a=l.useMemo(()=>Oe(n,({fid:o})=>o).slice(0,wt),[n]),r=l.useMemo(()=>a.length===1&&typeof i.viewerContext?.following<"u"&&!i.viewerContext?.following,[a.length,i.viewerContext?.following]);return e.jsxs("div",{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"mb-1 flex flex-row",children:a.map((o,c)=>e.jsx(q,{user:o,size:"sm",className:D(c>0&&"ml-1"),withDetailsPopover:!0,hideFollowButton:!0,onClick:()=>{s(h.ClickNotification,{type:t.type,action:"avatar"})}},o.fid))}),r&&e.jsx(ta,{user:i,slim:!0})]})}),gt=l.memo(({users:t,groupType:s})=>{const{trackEvent:n}=w(),i=l.useMemo(()=>Oe(t,({fid:a})=>a).slice(0,wt),[t]);return e.jsx("div",{className:"flex flex-row items-center justify-between",children:e.jsx("div",{className:"mb-1 flex flex-row",children:i.map((a,r)=>
11e.jsx(W,{title:a.displayName,user:a,onClick:()=>{n(h.ClickNotification,{type:s,action:"avatar"})},children:e.jsx(sa,{size:"sm",imgUrl:a.pfp?.url,imgAlt:`${a.displayName} avatar`,className:D(r>0&&"ml-1")})},a.fid))})})});B.displayName="NotificationAvatars";gt.displayName="NotificationAvatarsMinimal";const Sn=()=>{const t=U();return l.useCallback(({groupId:s,title:n,type:i,openInNewTab:a=!1})=>t({to:"notificationGroupUsers",params:{groupId:s,type:i},searchParams:{title:n},options:{openInNewTab:a}}),[t])},x=l.memo(({children:t,notificationGroup:s,onClick:n,title:i,clickable:a=!0,trackingProps:r,trackAsGroup:o})=>{const[c,d]=l.useState(!1),[u,b]=l.useState(!1),{trackEvent:v}=w(),N=Sn(),f=et(),j=l.useCallback(({openInNewTab:C})=>{if(v(o?h.ClickGroupedNotification:h.ClickNotification,{type:s.type,...r}),n){n({openInNewTab:C});return}s.totalItemCount===1&&s.previewItems&&"actor"in s.previewItems[0]&&s.previewItems[0].actor?f({user:s.previewItems[0].actor,openInNewTab:C}):s.id&&N({groupId:s.id,title:i,type:s.type})},[v,s.type,s.totalItemCount,s.previewItems,s.id,n,f,N,i,r,o]),k=l.useCallback(C=>{C.preventDefault(),C.stopPropagation(),a&&j({openInNewTab:C.metaKey||C.ctrlKey})},[a,j]),I=l.useCallback(C=>{C.preventDefault(),C.stopPropagation(),a&&(typeof C.target.href>"u"||j({openInNewTab:C.button===1}))},[a,j]),P=l.useMemo(()=>{if(s.type!=="mini-app")return;const C=s.previewItems?.[0];if(!(!C||C.type!=="mini-app"))return C.content.miniapp},[s]),S=P?.name??"Mini App",A=l.useMemo(()=>{if(s.type!=="frame-generic"&&s.type!=="mini-app")return;const C=new Set,Ue=s.previewItems??[];for(const ce of Ue)ce.type==="frame-generic"&&C.add(ce.content.frame.domain),ce.type==="mini-app"&&C.add(ce.content.miniapp.domain);if(C.size===1)return Array.from(C)[0]},[s]),z=l.useMemo(()=>{const C=s.type==="frame-generic"&&A,Ue=s.type==="mini-app"&&A;return s.type==="dormant-user-new-cast"||s.type==="trending-token"||C||Ue},[s.type,A]),R=wn(),g=m.useMemo(()=>{switch(s.type){case"mini-app":return`Disable ${S} in-app notifications`;case"trending-token":return"Disable trending token notifications";default:return"See less often"}},[s.type,S]),Z=l.useCallback(()=>{v(h.PressSeeLessOften,{notificationType:s.type}),R({notificationType:s.type,feedbackType:"see-fewer",domain:A}),X({message:"You will no longer receive this type of notification",toastId:`see-fewer-${s.id}`,position:"bottom-center"})},[R,s.id,s.type,v,A]);return e.jsxs("div",{className:D("relative flex flex-row items-start border-b px-4 pb-5 pt-4 border-default",a?"cursor-pointer hover:bg-overlay-faint":"",s.isUnread?"bg-[#F5F4FF] dark:bg-[#1F182C]":""),onClick:k,onAuxClick:I,children:[z&&e.jsxs(aa,{modal:!0,open:c,onOpenChange:d,children:[e.jsx(na,{asChild:!0,onClick:C=>{C.stopPropagation()},children:e.jsx("div",{className:"absolute right-4 flex rounded-full p-1 text-muted hover:bg-gray-200",children:e.jsx(ia,{})})}),e.jsx(ra,{children:e.jsxs(la,{className:"outline-hidden z-20 flex w-max cursor-default flex-col rounded-md border p-1 shadow-lg bg-app border-default",side:"bottom",sideOffset:4,align:"end",children:[e.jsx(tt,{name:g,icon:e.jsx(oa,{}),onClick:C=>{C.preventDefault(),C.stopPropagation(),d(!1),Z()}}),e.jsx(Fn,{miniApp:P,miniAppName:S,locallyDisabled:u,onDisabled:()=>b(!0),onClose:()=>d(!1)})]})})]}),t]})}),Fn=({miniApp:t,miniAppName:s,locallyDisabled:n,onDisabled:i,onClose:a})=>{const r=ca("mini-app-push-notifications"),{data:o}=da({domain:t?.domain,enabled:!!t}),c=ma(o??t),d=xa(),u=r&&c?.supportsPushNotifications===!0,b=ua({featureEnabled:r,miniApp:c,locallyDisabled:n}),v=l.useCallback(async()=>{if(c)try{await d({frame:c,enabled:!1}),i(),X({message:`Push notifications disabled for ${s}`,type:"success",position:"bottom-center"})}catch{X({message:"Error disabling push notifications",type:"error",position:"bottom-center"})}},[c,s,i,d]);return u?e.jsx(tt,{name:b?`Disable ${s} push notifications`:`${s} push notifications are off`,icon:e.jsx(fa,{}),disabled:!b,onClick:async N=>{N.preventDefault(),N.stopPropagation(),a(),await v()}}):null},kt=l.memo(({notificationGroup:t,title:s,...n})=>e.jsx(st,{to:"notificationGroupUsers",title:s,params:{type:t.type,groupId:t.id,title:s},searchParams:{},...n}));kt.displayName="LinkToNotificationGroupUsers";const K=l.memo(({notificationGroup:t,...s})=>{const{trackEvent:n}=w(),{users:i,totalCount:a}=le({notificationGroup:t}),[r]=i,o=l.useMemo(()=>{const d=a-1;return d<=0?"":d===1?"1 other":`${d} others`},[a]),c=je(r)==="pro";return e.jsxs("div",{className:"flex flex-1 flex-row items-center gap-1",children:[e.jsx(W,{title:L(r),user:r,className:"relative font-semibold text-default hover:underline",onClick:()=>{n(h.ClickNotification,{type:t.type,action:"actor"})},children:L(r)}),c&&e.jsx(Q,{size:14}),a>1&&e.jsxs(e.Fragment,{children:["and"," ",e.jsx(kt,{notificationGroup:t,title:s.title||o,className:"cursor-pointer font-semibold text-default hover:underline",onClick:()=>{n(h.ClickNotification,{type:t.type,action:"actors"})},children:o})," "]}),"predicate"in s?s.predicate:i.length===1?s.singularPredicate:s.pluralPredicate]})});K.displayName="NotificationGroupUserNames";const T=l.memo(({centerVertically:t,children:s})=>e.jsx("div",{className:D("flex w-[55.5px] shrink-0 flex-row justify-center pr-2",t&&"self-center"),children:s}));T.displayName="NotificationGraphic";const p=l.memo(({children:t,variant:s,channelImageUrl:n})=>{const i=l.useMemo(()=>D(s==="blue"&&"text-informative",s==="brown"&&"text-brown",s==="red"&&"text-danger",s==="green"&&"text-success",s==="purple"&&"text-brand",s==="yellow"&&"text-warning",s==="gray"&&"text-secondary"),[s]);return n?e.jsx(T,{children:e.jsxs("div",{className:"relative h-[38px] w-[44px]",children:[e.jsx("div",{children:e.jsx(F,{src:n,className:"aspect-square rounded-full object-cover",style:{width:28,height:28,minWidth:28,minHeight:28},alt:"Channel image",fallback:E})}),e.jsx("div",{className:D("absolute right-0 top-[12px] flex h-[30px] w-[30px] items-center justify-center rounded-full border border-app",i),children:e.jsx("div",{className:"scale-[0.784]",children:t})})]})}):e.jsx(T,{children:e.jsx("div",{className:D("flex h-8 w-8 items-center justify-end rounded-full",i),children:e.jsx("div",{children:t})})})});p.displayName="NotificationIcon";const _=l.memo(({cast:t})=>{const{displayText:s,hasTranslation:n,isTranslationPending:i,showOriginal:a,sourceLanguageName:r,toggleLabel:o,toggleTranslation:c}=Ga(t);return e.jsxs("div",{className:"flex flex-col gap-2",children:[(n||i)&&e.jsx(Pn,{hasTranslation:n,isTranslationPending:i,showOriginal:a,sourceLanguageName:r,toggleLabel:o,onToggle:c}),e.jsx("div",{className:"line-clamp-2 text-sm text-muted break-gracefully",children:s}),e.jsx(zn,{cast:t})]})}),Pn=l.memo(({hasTranslation:t,isTranslationPending:s,showOriginal:n,sourceLanguageName:i,toggleLabel:a,onToggle:r})=>{const o=c=>{c.preventDefault(),c.stopPropagation(),r()};return s?e.jsxs("div",{className:"flex flex-row items-center gap-1 text-xs text-faint",children:[e.jsx(Ze,{size:12}),e.jsx("span",{children:"translation pending..."})]}):t?e.jsxs("div",{className:"flex flex-row items-center justify-between gap-2 text-xs text-faint",children:[e.jsxs("div",{className:"flex min-w-0 flex-row items-center gap-1",children:[e.jsx(Ze,{size:12,className:"shrink-0"}),e.jsxs("span",{className:"truncate",children:["translated from ",i]})]}),e.jsx("button",{type:"button",className:"relative z-10 shrink-0 font-medium text-link hover:underline","aria-pressed":n,"aria-label":n?"Show translated text":"Show original text",onClick:o,children:a})]}):null}),zn=l.memo(({cast:t})=>{const s=l.useMemo(()=>{const i=t.embeds?.urls??[];for(const a of i){const r=a.openGraph?.url;if(typeof r=="string"&&ha(r))return r}},[t.embeds?.urls]),n=l.useMemo(()=>{const i=t.embeds;if(!i)return[];const a=[];if(i.images.length>0){const r=i.images.map(c=>typeof c.media<"u"?c.media:{version:"2",staticRaster:c.url,height:1e3,width:1e3}),o=pa({medias:r,pixelDensity:3,blockAnimated:!1,useLowQualityImages:!1});for(const c of o)a.push({type:"image",Icon:e.jsx(ja,{size:14,className:"text-muted"}),label:"image",url:c.thumbnail})}if(i.videos&&i.videos.length>0)for(const r of i.videos)a.push({type:"video",Icon:e.jsx(Un,{size:14,className:"text-muted"}),label:"video",url:r.thumbnailUrl});return a},[t.embeds]);return n.length===0&&typeof s>"u"?null:e.jsxs("div",{className:"flex flex-col gap-2",children:[n.length>0&&e.jsx("div",{className:"flex flex-row flex-wrap gap-0.5",children:n.map(({Icon:i,label:a,type:r,url:o},c)=>r==="image"&&typeof o<"u"?e.jsx("div",{children:e.jsx("div",{className:"relative size-32",children:e.jsx(F,{src:o,alt:"notification cast image",width:128,height:128,className:"aspect-square content-center rounded-[12px] border object-cover border-default"})})},`${a}-${c}`):r==="video"?e.jsx("div",{children:e.jsxs("div",{className:"relative size-32",children:[e.jsx(F,{src:o||"",alt:"notification cast video",width:128,height:128,className:"aspect-square content-center rounded-[12px] border object-cover border-default"}),e.jsx("div",{className:"absolute inset-0 flex size-full flex-col items-center justify-center",children:e.jsx("div",{className:"flex size-12 flex-row items-center justify-center rounded-full bg-black/75",children:e.jsx(va,{className:"text-light"})})})]})},`${a}-${c}`):e.jsxs("div",{className:"flex flex-row items-center gap-0.5 rounded-full px-1.5 py-0.5 bg-elevated",children:[i,e.jsx("span",{className:"text-xs font-medium text-muted",children:a})]},`${a}-${c}`))}),typeof s=="string"&&e.jsx(Na,{url:s})]})});_.displayName="NotificationGroupCastText";const It=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=ve(),i=t.previewItems[0].content.cast;return e.jsxs(x,{notificationGroup:t,onClick:()=>{n({castHash:i.hash,authorUsername:i.author.username})},children:[e.jsx(at,{className:"absolute inset-0",cast:i,title:"View cast",stopPropagation:!0,onClick:()=>{s(h.ClickNotification,{type:t.type})}}),e.jsx(p,{variant:"red",children:e.jsx(ba,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsx(K,{notificationGroup:t,predicate:"liked your cast"}),e.jsx(_,{cast:i})]})]})});
11It.displayName="CastReactionNotificationGroup";const Mt=l.memo(({notificationGroup:t})=>{const s=we({fallback:t.previewItems[0].content.cast}),n=pe(),i=ge(),a=t.isUnread,r=l.useMemo(()=>Me([{cast:s}],{forceThreadPosition:"start_and_end",isHighlighted:a})[0],[s,a]);return i(s)?n?e.jsx(ke,{}):null:e.jsx(Ie,{castWithContext:r})});Mt.displayName="CastReplyNotificationGroup";const oe=()=>{const t=U();return l.useCallback(({groupId:s,type:n})=>t({to:"notificationGroupCasts",params:{type:n},searchParams:{groupId:s}}),[t])},Tt=l.memo(({group:t})=>{const s=oe(),n=we({fallback:t.previewItems[0].content.cast}),i=pe(),a=ge(),r=t.isUnread,o=n.channel,c=l.useMemo(()=>Me([{cast:n,pinned:!0}],{forceThreadPosition:"start_and_end",showPinnedAsAnnouncement:!0,isHighlighted:r})[0],[n,r]);return o?t.totalItemCount===1?a(n)?i?e.jsx(ke,{}):null:e.jsx(Ie,{castWithContext:c}):e.jsxs(x,{notificationGroup:t,onClick:()=>{s({groupId:t.id,type:t.type})},children:[e.jsx(p,{variant:"purple",channelImageUrl:o.imageUrl,children:e.jsx(en,{size:24})}),e.jsxs("div",{className:"w-full self-center pt-1",children:[t.totalItemCount," announcements in"," ",e.jsxs("span",{className:"font-semibold",children:["/",o.key]})]}),e.jsx("div",{className:"self-center pt-1",children:e.jsx(nt,{size:24})})]}):null});Tt.displayName="ChannelPinnedCastNotificationGroup";const Ut=l.memo(({group:t})=>{const s=U(),n=l.useMemo(()=>t.previewItems[0].content.channel,[t.previewItems]),i=l.useMemo(()=>t.previewItems[0].content.role,[t.previewItems]),a=l.useMemo(()=>{const r=t.totalItemCount===1?"is":"are",o=t.totalItemCount===1?`a ${i}`:`${i}s`;return`${r} now ${o} of ${n.name}`},[n.name,t.totalItemCount,i]);return e.jsxs(x,{notificationGroup:t,onClick:()=>{s({to:"channelSettingsSection",params:{channelKey:n.key,section:"members"}})},children:[e.jsx(p,{variant:"purple",children:i==="member"?e.jsx(Ve,{size:24}):e.jsx(Ne,{size:24})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsx(K,{notificationGroup:t,predicate:a})]})]})});Ut.displayName="ChannelRoleAcceptNotificationGroup";const Ye=m.memo(({channel:t})=>!t.viewerContext.membersYouKnow||t.viewerContext.membersYouKnow.users.length===0||t.viewerContext.membersYouKnow.totalCount===0?null:e.jsx(St,{membersYouKnow:t.viewerContext.membersYouKnow}));Ye.displayName="ChannelMembersYouKnow";const St=m.memo(({membersYouKnow:t})=>{const s=m.useMemo(()=>t.users.slice(0,3).map((n,i)=>e.jsx("div",{className:D("block","leading-[0]",i>0?"-ml-[3px]":void 0),children:e.jsx(q,{user:n,size:"xs2"})},n.fid)),[t.users]);return e.jsxs("div",{className:"mt-2 flex flex-row items-start",children:[e.jsx("div",{className:"mr-2 flex flex-row",children:s}),e.jsx("div",{className:"text-xs text-faint",children:t.totalCount===1?"1 member you know":`${t.totalCount} members you know`})]})});St.displayName="ChannelMembersYouKnowContent";const $n=()=>{const t=U();return l.useCallback(({groupId:s,openInNewTab:n=!1})=>t({to:"notificationGroupChannelRoleInvites",params:{},searchParams:{groupId:s},options:{openInNewTab:n}}),[t])},Ke=l.memo(({group:t})=>t.previewItems.length===1&&t.totalItemCount===1?e.jsx(Pt,{notif:t.previewItems[0],isUnread:t.isUnread}):e.jsx(Ft,{group:t}));Ke.displayName="ChannelRoleInviteNotificationGroup";Ke.displayName="ChannelRoleInviteNotificationGroup";const Ft=l.memo(({group:t})=>{const s=$n(),n=l.useMemo(()=>t.previewItems,[t.previewItems]),i=l.useMemo(()=>n.length===0?void 0:n[0].content.channel,[n]),a=l.useMemo(()=>{if(n.length===0){const c=t.id.split(":");return c[c.length-1]}else return n[0].content.role},[t.id,n]),r=l.useMemo(()=>t.totalItemCount,[t.totalItemCount]),o=l.useMemo(()=>n.length===2&&r===2?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-bold",children:Se(n[0].content.channel.key)})," and ",e.jsx("span",{className:"font-bold",children:Se(n[1].content.channel.key)})]}):i?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-bold",children:Se(i.key)})," ","and ",r-1," other channels"]}):r>1?e.jsxs(e.Fragment,{children:[r," channels"]}):e.jsxs(e.Fragment,{children:[r," channel"]}),[i,n,r]);return e.jsxs(x,{notificationGroup:t,onClick:({openInNewTab:c})=>{s({groupId:t.id,openInNewTab:c})},children:[e.jsx(p,{variant:"purple",children:a==="member"?e.jsx(Ve,{size:y}):e.jsx(Ne,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsxs("div",{children:["You are invited to become a ",a," of ",o]}),i&&e.jsxs("div",{className:"mt-2 rounded-lg border bg-app-light p-3 border-default dark:bg-app-dark",children:[e.jsxs("div",{className:"flex flex-row items-start gap-2",children:[e.jsx(it,{channelImageUrl:i.fastImageUrl,size:"notification"}),e.jsxs("div",{className:"flex flex-1 flex-col self-center",children:[e.jsxs("span",{className:"font-semibold",children:["/",i.key]}),i.followerCount&&e.jsx("span",{className:"text-xs text-faint",children:bt(i.followerCount)})]}),e.jsxs("div",{className:"flex size-8 items-center justify-center self-start rounded-full text-xs bg-hover",children:["+",r-1]})]}),i.description&&e.jsx("div",{className:"mt-2 text-sm text-muted",children:i.description}),e.jsx(Ye,{channel:i})]})]})]})});Ft.displayName="ChannelRoleInviteNotificationsSummary";const Pt=l.memo(({notif:t,isUnread:s})=>{const n=Pe(),{accept:i,decline:a}=tn(),r=t.content.channel,o=t.content.role;return e.jsxs(x,{notificationGroup:{type:"channel-role-invite",isUnread:s},onClick:({openInNewTab:c})=>
11{n({channelKey:r.key,openInNewTab:c})},children:[e.jsx(p,{variant:"purple",children:o==="member"?e.jsx(Ve,{size:y}):e.jsx(Ne,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:["You are invited to become a ",o,e.jsxs("div",{className:"mt-2 rounded-lg border bg-app-light p-3 border-default dark:bg-app-dark",children:[e.jsxs("div",{className:"flex flex-row items-start gap-2",children:[e.jsx(it,{channelImageUrl:r.fastImageUrl,size:"notification"}),e.jsxs("div",{className:"flex flex-1 flex-col self-center",children:[e.jsxs("span",{className:"font-semibold",children:["/",r.key]}),r.followerCount&&e.jsx("span",{className:"text-xs text-faint",children:bt(r.followerCount)})]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx(M,{variant:"inverted",onClick:async c=>{c.stopPropagation(),await a({channelKey:r.key,role:o,location:"invite notification"}),X({message:`Declined ${o} invitation for ${r.name}`})},children:"Decline"}),e.jsx(M,{variant:"normal",onClick:async c=>{c.stopPropagation(),await i({channelKey:r.key,role:o,location:"invite notification"}),X({message:`You are now a ${o} of ${r.name}`})},children:"Accept"})]})]}),r.description&&e.jsx("div",{className:"mt-2 text-sm text-muted",children:r.description}),e.jsx(Ye,{channel:r})]})]})]})});Pt.displayName="ChannelRoleInviteNotification";const zt=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=t.previewItems[0].content.cast,i=ve(),a=t.previewItems[0].content.cast.channel?.key??"";return e.jsxs(x,{notificationGroup:t,onClick:()=>{i({castHash:n.hash,authorUsername:n.author.username})},children:[e.jsx(p,{variant:"red",children:e.jsx(ze,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsxs("div",{className:"flex flex-row flex-wrap space-x-1",children:[e.jsx("div",{className:"text-default",children:"Your cast does not follow the norms for"}),e.jsx(rt,{title:a,channelKey:a,onClick:()=>{s(h.ClickNotification,{type:t.type,action:"channel"})},children:e.jsxs("span",{className:"font-semibold text-default hover:underline",children:["/",a]})})]}),e.jsx(_,{cast:n})]})]})});zt.displayName="ChannelWarningNotificationGroup";const An=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),$t=({open:t,onOpenChange:s,rewardCents:n,rewardDate:i,txHash:a,txChainId:r})=>{const[o,c]=l.useState(!1),{trackEvent:d}=w();return e.jsxs(e.Fragment,{children:[e.jsxs($e,{open:t,onOpenChange:s,modal:!0,children:[e.jsx(Ae,{asChild:!0,children:"moo"}),e.jsxs(Le,{children:[e.jsx(Be,{className:"fixed inset-0 z-10 bg-overlay"}),e.jsxs(G,{className:"focus:outline-hidden fixed left-1/2 top-1/2 z-20 max-h-[85vh] w-[90vw] max-w-[400px] -translate-x-1/2 -translate-y-1/2 rounded-[6px] py-6 bg-app",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between pl-6 pr-4",children:[e.jsxs(ee,{className:"flex flex-row items-center gap-3",children:[e.jsx("div",{className:"flex size-[32px] items-center justify-center rounded-full bg-[#7C65C133] dark:bg-[#7C65C14D]",children:e.jsx(Re,{size:18,className:"text-action-purple"})}),e.jsx("div",{className:"text-xl font-semibold",children:"Top Creator Reward"})]}),e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex w-max cursor-pointer flex-col items-center justify-center rounded-full p-2 text-faint hover:bg-overlay-faint hover:text-default",children:e.jsx(se,{size:20,className:"text-default"})})})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4 px-6",children:[e.jsxs(lt,{children:["Farcaster sent you ",Math.floor(n/100)," USDC for being a top caster on"," ",An.format(new Date(i)),"."," ",e.jsx(H,{href:Ee({to:"creator-rewards"}),title:"Learn more",children:"Learn more"})]}),e.jsx(H,{href:ct({chainId:r.toString(),hash:a}),onClick:()=>{d(h.ViewCreatorRewardInExplorer,{txHash:a,txChainId:r,rewardDate:i,rewardCents:n})},title:"View transaction",className:"mt-1",children:e.jsxs(M,{className:"outline-hidden flex w-full items-center justify-center !text-base !font-medium",children:["View transaction ",e.jsx(ot,{className:"ml-1"})]})})]})]})]})]}),o&&e.jsx(be,{onClose:()=>{c(!1)},intent:void 0})]})};$t.displayName="CreatorRewardModal";const Ln=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),At=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),[n,i]=l.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{notificationGroup:t,onClick:()=>{s(h.ClickNotification,{type:t.type}),i(!0)},children:[e.jsx(p,{variant:"purple",children:e.jsx(Re,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:["You earned"," ",Math.floor(t.previewItems[0].content.rewardCents/100)," ","USDC!"]}),e.jsxs("div",{className:"text-muted",children:["Farcaster sent you a reward for being a top caster on"," ",Ln.format(new Date(t.previewItems[0].content.rewardDate)),"."]})]})]}),e.jsx($t,{open:n,onOpenChange:a=>i(a),txChainId:t.previewItems[0].content.txChainId,txHash:t.previewItems[0].content.txHash,rewardDate:t.previewItems[0].content.rewardDate,rewardCents:t.previewItems[0].content.rewardCents})]})});At.displayName="CreatorRewardNotificationGroup";const Lt=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=l.useCallback(()=>{s(h.ClickNotification,{type:t.type})},[s,t.type]);return e.jsxs(x,{notificationGroup:t,onClick:n,children:[e.jsx(p,{variant:"red",children:e.jsx(Ca,{size:y,color:"currentColor"})}),e.jsxs("div",{className:"my-1 flex size-full flex-col",children:[e.jsx("div",{className:"font-semibold text-default",children:"Your account isnât eligible for the deposit bonus"}),e.jsx("div",{className:"text-secondary",children:"Please check your email inbox for more details"})]})]})});Lt.displayName="DepositBonusesIneligibleNotificationGroup";const Bt=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),{open:n,Component:i}=sn(),a=l.useCallback(()=>{s(h.ClickNotification,{type:t.type}),n()},[s,t.type,n]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{notificationGroup:t,onClick:a,children:[e.jsx(p,{variant:"purple",children:e.jsx(Mn,{size:y,color:"currentColor"})}),e.jsxs("div",{className:"my-1 flex size-full flex-col",children:[e.jsx("div",{className:"font-semibold text-default",children:"Deposit USDC now, earn up to $500"}),e.jsx("div",{className:"text-subtle",children:"This October, we're matching USDC deposits on Base by up to 10%."})]})]}),i]})});Bt.displayName="DepositBonusesLaunchNotificationGroup";const Rt=l.memo(({group:t})=>
11{const s=O(),i=V()?.navigate,a=ne(),r=t.previewItems[0].content.clickTarget,o=t.previewItems[0].content.title,c=t.previewItems[0].content.body,d=l.useCallback(()=>{r==="https://farcaster.xyz/~/wallet/collectibles"?!s&&i&&i({path:"collectibles"}):r&&a({to:r,openInNewTab:!0})},[r,s,i,a]);return e.jsxs(x,{notificationGroup:t,onClick:d,children:[e.jsx(p,{variant:"purple",children:e.jsx(Q,{size:20})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5 self-center",children:[e.jsx("div",{className:"flex w-full flex-row items-start justify-between",children:e.jsx("div",{className:"shrink font-semibold",children:o})}),e.jsx("div",{className:"text-muted",children:c})]})]})});Rt.displayName="FarcasterProNotificationGroup";const Et=l.memo(({group:t})=>{const s=l.useMemo(()=>t.previewItems[0],[t.previewItems]),n=l.useMemo(()=>t.isUnread,[t.isUnread]);return e.jsx(ya,{children:e.jsx(Bn,{notif:s,isUnread:n})})});Et.displayName="FeaturedFrameNotificationGroup";const Bn=({notif:t,isUnread:s})=>{const{launchMiniApp:n}=De(),i=t.content.frame;return e.jsxs(x,{notificationGroup:{type:"featured-frame",isUnread:s},trackingProps:{domain:i.domain,name:i.name},onClick:()=>{n({context:{type:"launcher"},launchConfig:{type:"standalone",name:i.name,url:i.homeUrl,splashImageUrl:i.splashImageUrl,splashBackgroundColor:i.splashBackgroundColor,author:i.author}})},children:[e.jsx(p,{variant:"blue",children:e.jsx(dt,{size:20,className:"mt-[2px]"})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:"Featured Mini App"}),e.jsx(wa,{frameEmbed:{frameUrl:i.homeUrl,frameEmbed:{version:"next",imageUrl:i.imageUrl||i.splashImageUrl,button:{title:i.buttonTitle||"Launch",action:{type:"launch_frame",name:i.name,url:i.homeUrl,splashImageUrl:i.splashImageUrl,splashBackgroundColor:t.content.frame.splashBackgroundColor}}},author:t.content.frame.author},context:{type:"launcher"}})]})]})};function Dt({size:t=16,color:s="currentColor",filled:n=!1,className:i,flipY:a=!1}){return n?e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:s,className:i,style:a?{transform:"scaleX(-1)"}:void 0,children:[e.jsx("path",{d:"M16 21V19C16 17.9391 15.5786 16.9217 14.8284 16.1716C14.0783 15.4214 13.0609 15 12 15H6C4.93913 15 3.92172 15.4214 3.17157 16.1716C2.42143 16.9217 2 17.9391 2 19V21"}),e.jsx("path",{d:"M16 21V19C16 17.9391 15.5786 16.9217 14.8284 16.1716C14.0783 15.4214 13.0609 15 12 15H6C4.93913 15 3.92172 15.4214 3.17157 16.1716C2.42143 16.9217 2 17.9391 2 19V21",fill:"currentColor"}),e.jsx("path",{d:"M16 21V19C16 17.9391 15.5786 16.9217 14.8284 16.1716C14.0783 15.4214 13.0609 15 12 15H6C4.93913 15 3.92172 15.4214 3.17157 16.1716C2.42143 16.9217 2 17.9391 2 19V21H16Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.jsx("path",{d:"M9 11C11.2091 11 13 9.20914 13 7C13 4.79086 11.2091 3 9 3C6.79086 3 5 4.79086 5 7C5 9.20914 6.79086 11 9 11Z",fill:"currentColor",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.jsx("path",{d:"M19 8V14",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.jsx("path",{d:"M22 11H16",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]}):e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:i,style:a?{transform:"scaleX(-1)"}:void 0,children:[e.jsx("path",{d:"M16 21V19C16 17.9391 15.5786 16.9217 14.8284 16.1716C14.0783 15.4214 13.0609 15 12 15H6C4.93913 15 3.92172 15.4214 3.17157 16.1716C2.42143 16.9217 2 17.9391 2 19V21"}),e.jsx("path",{d:"M9 11C11.2091 11 13 9.20914 13 7C13 4.79086 11.2091 3 9 3C6.79086 3 5 4.79086 5 7C5 9.20914 6.79086 11 9 11Z"}),e.jsx("path",{d:"M19 8V14"}),e.jsx("path",{d:"M22 11H16"})]})}const Wt=l.memo(({notificationGroup:t})=>e.jsxs(x,{notificationGroup:t,children:[e.jsx(p,{variant:"blue",children:e.jsx(Dt,{size:y,filled:!0,flipY:!0,className:"mb-px "})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsx(K,{notificationGroup:t,predicate:"followed you"})]})]}));Wt.displayName="FollowNotificationGroup";const Ht=()=>{const t=U();return l.useCallback(({groupId:s,openInNewTab:n=!1})=>t({to:"notificationGroupMiniApps",params:{},searchParams:{groupId:s},options:{openInNewTab:n}}),[t])},Ot=l.memo(({group:t})=>t.previewItems.length===1?e.jsx(Vt,{notif:t.previewItems[0],isUnread:t.isUnread}):e.jsx(Yt,{group:t}));Ot.displayName="FrameGenericNotificationGroup";const Vt=({notif:t,isUnread:s})=>{const{launchMiniApp:n}=De();return e.jsxs(x,{notificationGroup:{type:"frame-generic",isUnread:s,previewItems:[t]},trackingProps:{domain:t.content.frame.domain,name:t.content.frame.name},onClick:()=>{n({context:{type:"notification",notification:{notificationId:t.content.notificationId,title:t.content.title,body:t.content.body}}
11,launchConfig:{type:"standalone",name:t.content.frame.name,url:t.content.targetUrl,splashImageUrl:t.content.frame.splashImageUrl,splashBackgroundColor:t.content.frame.splashBackgroundColor,author:t.content.frame.author}})},children:[e.jsx(T,{children:e.jsx(Ce,{imageUrl:t.content.frame.iconUrl,size:44})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:t.content.title}),e.jsx("div",{className:"text-faint",children:$(t.timestamp,"floor")})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"grow text-muted",children:t.content.body})})]})]})};Vt.displayName="SingleFrameGenericNotification";const Yt=({group:t})=>{const s=Ht(),n=l.useMemo(()=>t.previewItems[0],[t.previewItems]);return e.jsxs(x,{notificationGroup:t,trackingProps:{domain:n.content.frame.domain,name:n.content.frame.name},trackAsGroup:!0,onClick:({openInNewTab:i})=>{s({groupId:t.id,openInNewTab:i})},children:[e.jsx(T,{centerVertically:!0,children:e.jsx(Ce,{imageUrl:n.content.frame.iconUrl,size:44})}),e.jsxs("div",{className:"w-full self-center pt-1",children:[t.totalItemCount," updates from"," ",e.jsx("span",{className:"font-semibold",children:n.content.frame.name})]}),e.jsx("div",{className:"self-center pt-1",children:e.jsx(nt,{size:24})})]})};Yt.displayName="MultipleFrameGenericNotifications";const Kt=l.memo(({color:t="#7C65C1",size:s=26})=>e.jsx("svg",{width:s,height:s,viewBox:"0 0 26 26",fill:"none",children:e.jsxs("g",{children:[e.jsx("circle",{cx:"13",cy:"13",r:"12.5",fill:"#F0EDFF",stroke:"white"}),e.jsx("path",{d:"M13 6.64062C14.6866 6.64063 16.3045 7.31037 17.4971 8.50293C18.6897 9.69552 19.3594 11.3134 19.3594 13C19.3594 13.128 19.3105 13.2559 19.2129 13.3535L13.3535 19.2129C13.3494 19.217 13.3441 19.2197 13.3398 19.2236C13.329 19.2337 13.3175 19.2428 13.3057 19.252C13.2955 19.2599 13.286 19.2684 13.2754 19.2754C13.2719 19.2777 13.2691 19.281 13.2656 19.2832C13.2525 19.2914 13.2382 19.2968 13.2246 19.3037C13.2199 19.3061 13.2157 19.3093 13.2109 19.3115C13.1378 19.3457 13.0594 19.3613 12.9814 19.3584C12.971 19.358 12.9606 19.3565 12.9502 19.3555C12.9325 19.3537 12.9149 19.3513 12.8975 19.3477C12.8899 19.3461 12.8825 19.3437 12.875 19.3418C12.8581 19.3374 12.8416 19.3323 12.8252 19.3262C12.816 19.3227 12.8069 19.3194 12.7979 19.3154C12.7806 19.3078 12.7635 19.2997 12.7471 19.29C12.743 19.2876 12.7384 19.2857 12.7344 19.2832C12.7316 19.2815 12.7293 19.2791 12.7266 19.2773C12.7218 19.2743 12.7165 19.2718 12.7119 19.2686L12.6865 19.2471C12.6762 19.2387 12.6658 19.2307 12.6562 19.2217L12.6465 19.2129L6.78711 13.3535L6.72266 13.2754C6.68816 13.2231 6.66512 13.1657 6.65234 13.1064C6.65191 13.1044 6.6508 13.1026 6.65039 13.1006L6.64844 13.0811C6.64475 13.0583 6.64215 13.0356 6.6416 13.0127L6.64062 13C6.64065 11.3134 7.31034 9.69552 8.50293 8.50293C9.69552 7.31034 11.3134 6.64065 13 6.64062ZM13 11.7422C12.1055 11.7422 11.4987 12.326 11.4531 12.9277L12.999 17.3467L14.5459 12.9277C14.5003 12.326 13.8945 11.7422 13 11.7422ZM9.04492 11.7422C8.30739 11.7422 7.75807 12.2302 7.6582 12.8105L11.8047 16.957L10.4775 13.165L10.4707 13.1396C10.4653 13.1211 10.4603 13.1024 10.457 13.083L10.4531 13.0664L10.4492 13C10.4492 12.3412 9.85687 11.7422 9.04492 11.7422ZM16.9551 11.7422C16.1384 11.7422 15.5508 12.3403 15.5508 13C15.5508 13.0122 15.5477 13.0242 15.5469 13.0361C15.5459 13.0498 15.5451 13.0634 15.543 13.0771C15.5394 13.1 15.5339 13.1219 15.5273 13.1436C15.5252 13.1505 15.5249 13.1581 15.5225 13.165L14.1943 16.957L18.3408 12.8105C18.24 12.2309 17.6881 11.7422 16.9551 11.7422ZM13 7.64062C11.5786 7.64065 10.215 8.20491 9.20996 9.20996C8.70805 9.71188 8.31551 10.303 8.04883 10.9463C8.3551 10.8155 8.69307 10.7422 9.04492 10.7422C9.81125 10.7422 10.5158 11.0894 10.9619 11.6406C11.4407 11.0831 12.1994 10.7422 13 10.7422C13.7998 10.7422 14.5572 11.083 15.0361 11.6396C15.481 11.0888 16.185 10.7422 16.9551 10.7422C17.3063 10.7422 17.6443 10.8167 17.9512 10.9482C17.6845 10.3043 17.2924 9.71229 16.79 9.20996C15.785 8.20494 14.4214 7.64062 13 7.64062Z",fill:t})]})}));Kt.displayName="AirdropIcon";const Rn=({notificationGroup:t,title:s,description:n,type:i,ctaText:a,ctaTarget:r})=>{const{trackEvent:o}=w();return e.jsxs(x,{notificationGroup:t,clickable:!1,children:[e.jsx(p,{variant:"blue",children:e.jsx(dt,{size:y})}),e.jsxs("div",{className:"flex grow flex-row justify-between self-center",children:[e.jsxs("div",{className:"flex flex-col",children:[s&&e.jsx("div",{className:"mb-1 text-base font-semibold text-default",children:s}),e.jsx("div",{className:"text-default",children:n})]}),a&&r&&e.jsx(H,{href:r,title:a,className:"align-right self-center text-inherit",onClick:()=>{o(h.ClickNotification,{type:i})},children:e.jsx(M,{className:"min-w-[100px]",size:"sm",variant:"muted",children:a})})]})]})},En=({notificationGroup:t,type:s,title:n,description:i,icon:a,primaryCta:r,secondaryCta:o})=>{const{trackEvent:c}=w(),d=l.useMemo(()=>a.bottomRightIcon==="airdrop"?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5",children:e.jsx(Kt,{size:20})}):null,[a]);return e.jsxs(x,{notificationGroup:t,clickable:!1,children:[e.jsx(T,{children:e.jsxs("div",{className:"relative flex h-12 w-12 items-center justify-center rounded-[14px] bg-black",children:[e.jsx(F,{src:a.assetImageUrl,alt:n||"Notification",width:a.width??29,height:a.height??29,fallback:E}),d]})}),e.jsxs("div",{className:"flex grow flex-col",children:[e.jsxs("div",{className:"flex flex-1 flex-col justify-center",children:[n&&e.jsx("div",{className:"mr-1 text-base font-semibold text-default",children:n}),e.jsx("div",{className:n?"mr-1 mt-1 text-default":"mr-1 mt-1 font-medium text-default",children:i})]}),e.jsxs("div",{className:"mt-2 flex w-full flex-row gap-2.5",children:[e.jsx("div",{className:"flex-1",children:e.jsx(H,{href:r.target,title:r.text,className:"text-inherit",onClick:()=>{c(h.ClickNotification,{type:s,cta:"primary"})},children:e.jsx(M,{className:"w-full",size:"sm",variant:"normal",children:r.text})})}),o&&e.jsx("div",{className:"flex-1",children:e.jsx(H,{href:o.target,title:o.text,className:"text-inherit",onClick:()=>{c(h.ClickNotification,{type:s,cta:"secondary"})},children:e.jsx(M,{className:"w-full",size:"sm",variant:"secondary",children:o.text})})})]})]})]})},_t=l.memo(({notificationGroup:t})=>{const s=U(),{navigate:n}=ga(),i=l.useMemo(()=>
11t.previewItems[0],[t.previewItems]),{type:a,title:r,description:o,ctaText:c,ctaTarget:d}=l.useMemo(()=>{const N=i,f=N.content,j=f.webOverride?.cta||f.secondaryCta||f.cta;return{id:N.id,type:N.type,title:f.webOverride?.title||f.title,description:f.webOverride?.description||f.description,ctaText:f.webOverride?.hideCta===!0?void 0:j?.text,ctaTarget:f.webOverride?.hideCta===!0?void 0:j?.target}},[i]);if(i.id==="warpcast-wallet")return e.jsxs(x,{notificationGroup:t,onClick:()=>{s({to:"wallet",params:{}})},children:[e.jsx(p,{variant:"purple",children:e.jsx(Fe,{})}),e.jsx("div",{className:"flex grow flex-row justify-between self-center",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1 text-base font-semibold text-default",children:r}),e.jsx("div",{className:"text-default",children:o})]})})]});if(i.id==="verify-account")return e.jsxs(x,{notificationGroup:t,clickable:!1,children:[e.jsx(p,{variant:"purple",children:e.jsx(Ne,{size:y})}),e.jsx("div",{className:"flex grow flex-row justify-between self-center",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1 text-base font-semibold text-default",children:r}),e.jsx("div",{className:"text-default",children:o})]})})]});if(i.id==="import-x")return e.jsxs(x,{notificationGroup:t,onClick:()=>{s({to:"settingsImport",params:{}})},children:[e.jsx(p,{variant:"gray",children:e.jsx(We,{size:16})}),e.jsx("div",{className:"flex grow flex-row justify-between self-center",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1 text-base font-semibold text-default",children:r}),e.jsx("div",{className:"text-default",children:o})]})})]});if(i.id==="storage-warning-casts"||i.id==="storage-warning-reactions"||i.id==="storage-warning-links")return e.jsxs(x,{notificationGroup:t,onClick:()=>{s({to:"settingsStorage",params:{}})},children:[e.jsx(p,{variant:"blue",children:e.jsx(ze,{size:y})}),e.jsx("div",{className:"flex grow flex-row justify-between self-center",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1 text-base font-semibold text-default",children:r}),e.jsx("div",{className:"text-default",children:o})]})})]});if(i.id==="farcaster-pro-fees-upsell")return e.jsxs(x,{notificationGroup:t,onClick:()=>{n({path:"FarcasterProFullScreenUpsell",params:{}})},children:[e.jsx(p,{variant:"purple",children:e.jsx(Q,{size:24})}),e.jsx("div",{className:"flex grow flex-row justify-between self-center",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"mb-1 text-base font-semibold text-default",children:r}),e.jsx("div",{className:"text-default",children:o})]})})]});const u=t.previewItems[0].content.icon,b=t.previewItems[0].content.cta,v=t.previewItems[0].content.secondaryCta;return u?e.jsx(En,{notificationGroup:t,type:a,title:r,description:o,icon:u,primaryCta:b,secondaryCta:v}):e.jsx(Rn,{notificationGroup:t,title:r,description:o,type:a,ctaText:c,ctaTarget:d})});_t.displayName="GenericNotificationGroup";const Zt=l.memo(({notificationGroup:t})=>{const{description:s}=t.previewItems[0].content.location,n=t.previewItems[0].content.location.description;return e.jsxs(x,{notificationGroup:t,title:n,children:[e.jsx(p,{variant:"brown",children:e.jsx(mt,{size:y,className:"mb-px"})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsx(K,{title:n,notificationGroup:t,singularPredicate:e.jsxs(e.Fragment,{children:["is now in"," ",e.jsx("span",{className:"text-default hover:underline",children:s})]}),pluralPredicate:e.jsxs(e.Fragment,{children:["are now in"," ",e.jsx("span",{className:"text-default hover:underline",children:s})]})})]})]})});Zt.displayName="NearbywNotificationGroup";const Xt=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=oe(),{users:i,totalCount:a}=le({notificationGroup:t}),r=m.useMemo(()=>t.previewItems[0].content.cast,[t.previewItems]),[o]=i,c=m.useMemo(()=>{const u=a-1;return u<=0?"":u===1?"1 other":`${u} others`},[a]),d=je(o)==="pro";return e.jsxs(x,{notificationGroup:t,onClick:()=>{n({groupId:t.id,type:t.type})},children:[e.jsx(p,{variant:"blue",channelImageUrl:r.channel?.imageUrl,children:e.jsx(xt,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsxs("div",{className:"line-clamp-2 flex flex-row items-center gap-1 break-gracefully",children:[e.jsx(W,{title:L(o),user:o,className:"relative font-semibold text-default hover:underline",onClick:()=>{s(h.ClickNotification,{type:t.type,action:"author"})},children:L(o)}),d&&e.jsx(Q,{size:14}),c!==""?`and ${c} `:"","casted in"," ",e.jsx("span",{className:"font-semibold",children:e.jsx(rt,{title:r?.channel?.name??"",channelKe
11y:r?.channel?.key??"",onClick:()=>{s(h.ClickNotification,{type:t.type,action:"channel"})},children:e.jsx("span",{className:"font-semibold text-default hover:underline",children:r?.channel?.name})})})]})]})]})});Xt.displayName="NewCastInChannelNotificationGroup";const qt=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=oe(),{users:i,totalCount:a}=le({notificationGroup:t}),[r]=i,o=m.useMemo(()=>{const d=a-1;return d<=0?"":d===1?"and 1 other":`and ${d} others`},[a]),c=je(r)==="pro";return e.jsxs(x,{notificationGroup:t,onClick:()=>{n({groupId:t.id,type:t.type})},children:[e.jsx(p,{variant:"blue",children:e.jsx(xt,{size:y})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsxs("div",{className:"line-clamp-2 flex flex-row items-center gap-1 break-gracefully",children:["New casts from"," ",e.jsx(W,{title:L(r),user:r,className:"relative font-semibold text-default hover:underline",onClick:()=>{s(h.ClickNotification,{type:t.type,action:"author"})},children:L(r)}),c&&e.jsx(Q,{size:14,className:"ml-[-2px]"}),o]})]})]})});qt.displayName="NewCastNotificationGroup";const Qt=l.memo(({notificationGroup:t})=>{const s=ie(),{trackEvent:n}=w(),i=t.previewItems[0],a=i.actor,r=ne(),o=nn(),c=ln(),d=()=>{const u=on({participantFids:[a.fid,s.fid]});c({currentUser:s,conversationId:u,counterParties:[a]}),o({conversationId:u})};return e.jsxs(x,{notificationGroup:t,children:[e.jsx(p,{variant:"blue",children:e.jsx("div",{className:"pt-[3px]",children:e.jsx(an,{size:y})})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsxs("div",{className:"line-clamp-2 break-gracefully",children:[e.jsx(W,{title:L(a),user:a,className:"relative font-semibold text-default hover:underline",onClick:()=>{n(h.ClickNotification,{type:t.type,action:"author"})},children:a.displayName})," ","sent you"," ",rn(Number(BigInt(i.content.payment.amount)/10n**4n))]}),e.jsxs("div",{className:"mt-2 flex flex-row gap-2",children:[e.jsx(M,{size:"sm",onClick:u=>{u.stopPropagation(),n(h.ClickNotification,{type:t.type,action:"message"}),d()},children:"Message"}),e.jsx(M,{size:"sm",variant:"muted",onClick:u=>{u.stopPropagation(),n(h.ClickNotification,{type:t.type,action:"view transaction"}),r({to:ct({hash:i.content.payment.transactionHash,chainId:"8453"}),openInNewTab:!0})},children:e.jsxs("div",{className:"flex flex-row items-center justify-center",children:["View",e.jsx(ot,{size:12,className:"ml-1"})]})})]})]})]})});Qt.displayName="ReportActionNotificationGroup";const Jt=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=t.previewItems[0].content.recastedCast,i=ve();return e.jsxs(x,{notificationGroup:t,onClick:()=>{const a=t.previewItems[0].content.recastedCast;i({castHash:a.hash,authorUsername:a.author.username})},children:[e.jsx(at,{className:"absolute inset-0",cast:n,title:"View cast",stopPropagation:!0,onClick:()=>{s(h.ClickNotification,{type:t.type})}}),e.jsx(p,{variant:"green",children:e.jsx(ka,{size:y,className:"mb-px"})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsx(K,{notificationGroup:t,predicate:"recasted your cast"}),e.jsx(_,{cast:n})]})]})});Jt.displayName="RecastNotificationGroup";const Gt=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=U(),i=()=>{s(h.ClickNotification,{type:t.type}),n({to:"referrals",options:{openInNewTab:!1},params:{}})};return e.jsxs(x,{notificationGroup:t,onClick:i,children:[e.jsx(p,{variant:"blue",children:e.jsx(Dt,{size:y,filled:!0,flipY:!0,className:"mb-px "})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsx(K,{notificationGroup:t,predicate:"used your referral link."}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"line-clamp-4 grow text-muted",children:"You'll earn 20% of fees every time they trade."})})]})]})});Gt.displayName="ReferralCodeClaimedNotificationGroup";const es=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=U(),i=l.useCallback(()=>{s(h.ClickNotification,{type:t.type}),n({to:"referrals",options:{openInNewTab:!1},params:{}})},[s,n,t.type]);return e.jsxs(x,{notificationGroup:t,onClick:i,children:[e.jsx(p,{variant:"purple",children:e.jsx(re,{size:y,color:"currentColor"})}),e.jsxs("div",{className:"my-1 flex size-full flex-col",children:[e.jsx("div",{className:"font-semibold text-default",children:"Invite friends and earn rewards!"}),e.jsx("div",{className:"text-subtle",children:"Earn 20% of fees when someone trades using your referral code."})]})]})});es.displayName="ReferralLaunchNotificationGroup";const ts=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=U(),i=l.useCallback(()=>{s(h.ClickNotification,{type:t.type}),n({to:"referrals",options:{openInNewTab:!1},params:{}})},[s,n,t.type]);return e.jsxs(x,{notificationGroup:t,onClick:i,children:[e.jsx(p,{variant:"purple",children:e.jsx(re,{size:y,color:"currentColor"})}),e.jsx("div",{className:"my-1 flex size-full flex-row items-center",children:e.jsx("div",{className:"font-semibold text-default",children:"Share your referral code to earn more rewards"})})]})});ts.displayName="ReferralReminderNotificationGroup";const ss=()=>e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 512 512",fill:"
11currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M80 480a16 16 0 01-16-16V68.13a24 24 0 0111.9-20.72C88 40.38 112.38 32 160 32c37.21 0 78.83 14.71 115.55 27.68C305.12 70.13 333.05 80 352 80a183.84 183.84 0 0071-14.5 18 18 0 0125 16.58v219.36a20 20 0 01-12 18.31c-8.71 3.81-40.51 16.25-84 16.25-24.14 0-54.38-7.14-86.39-14.71C229.63 312.79 192.43 304 160 304c-36.87 0-55.74 5.58-64 9.11V464a16 16 0 01-16 16z"})}),as=l.memo(({notificationGroup:t})=>{const s=l.useMemo(()=>t.totalItemCount>1?`We've taken action on ${t.totalItemCount} cast reports.`:`Your report of ${t.previewItems[0].content.reportCastReason} content has been addressed.`,[t.previewItems,t.totalItemCount]);return e.jsxs(x,{notificationGroup:t,clickable:!1,children:[e.jsx(p,{variant:"yellow",children:e.jsx("div",{className:"pt-[3px]",children:e.jsx(ss,{})})}),e.jsxs("div",{children:[e.jsx("div",{className:"w-full min-w-0",children:s}),e.jsx("div",{children:"Thank you for your help."})]})]})});as.displayName="ReportActionNotificationGroup";const ns=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=ie(),i=U(),a=l.useCallback(async()=>{i({to:"profileCastsWithUsername",params:{username:n.username||""}})},[n.username,i]);return e.jsxs(x,{notificationGroup:t,onClick:()=>{a()},children:[e.jsx(p,{variant:"blue",children:e.jsx(mt,{size:y,className:"mb-px"})}),e.jsxs("div",{className:"flex flex-col self-center",children:[e.jsx("span",{className:"mb-1 font-semibold",children:"Find other Farcasters nearby"}),e.jsx("span",{className:"mb-2",children:"By setting your location, you'll get a list of other Farcasters nearby and updates whenever someone you follow comes to your city."}),e.jsx(M,{className:"w-min",variant:"normal",onClick:r=>{r.preventDefault(),r.stopPropagation(),s(h.ClickNotification,{type:t.type}),a()},children:"Set location"})]})]})});ns.displayName="SetLocationNotificationGroup";const is=l.memo(({notificationGroup:t})=>e.jsxs(x,{notificationGroup:t,clickable:!1,children:[e.jsx(p,{variant:"yellow",children:e.jsx("div",{className:"pt-[3px]",children:e.jsx(ss,{})})}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 w-full min-w-0",children:"Warning: your account is at risk of being labelled spammy"}),e.jsx(H,{href:Ee({to:"spammy-replies"}),title:"Learn more",className:"align-right self-center text-inherit",children:e.jsx(M,{className:"min-w-[100px]",size:"sm",variant:"muted",children:"Learn more"})})]})]}));is.displayName="SpammyRepliesNotificationGroup";const rs=({open:t,onOpenChange:s,showCastButton:n=!0})=>{const{userBoost:i}=ut(),{trackEvent:a}=w(),r=Ia(),[o,c]=l.useState(!1);return l.useEffect(()=>{r()},[r]),i===void 0?null:e.jsxs(e.Fragment,{children:[e.jsxs($e,{open:t,onOpenChange:s,modal:!0,children:[e.jsx(Ae,{asChild:!0,children:"moo"}),e.jsxs(Le,{children:[e.jsx(Be,{className:"fixed inset-0 z-10 bg-overlay"}),e.jsxs(G,{className:"focus:outline-hidden fixed left-1/2 top-1/2 z-20 max-h-[85vh] w-[90vw] max-w-[400px] -translate-x-1/2 -translate-y-1/2 rounded-[6px] py-6 bg-app",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between pl-6 pr-4",children:[e.jsxs(ee,{className:"flex flex-row items-center gap-3",children:[e.jsx("div",{className:"flex size-[32px] items-center justify-center rounded-full bg-[#FBF0CD]",children:e.jsx(ft,{size:18,className:"text-action-yellow"})}),e.jsx("div",{className:"text-xl font-semibold",children:"Boost"})]}),e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex w-max cursor-pointer flex-col items-center justify-center rounded-full p-2 text-faint hover:bg-overlay-faint hover:text-default",children:e.jsx(se,{size:20,className:"text-default"})})})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4 px-6",children:[e.jsxs(lt,{children:["Casts will reach more people for the next"," ",Ma(i.endsAt-Date.now()),"."," ",e.jsx(H,{href:Ee({to:"boosts"}),title:"Learn more",children:"Learn more"}),"."]}),n&&e.jsx(M,{title:"Cast now",onClick:()=>{a(h.PressUserBoostCastNow,void 0),c(!0),s(!1)},className:"outline-hidden mt-1 h-12 w-full !text-base",children:"Cast Now"})]})]})]})]}),o&&e.jsx(be,{onClose:()=>{c(!1)},intent:void 0})]})};rs.displayName="UserBoostInfoModal";const ls=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),[n,i]=l.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{notificationGroup:t,onClick:()=>{s(h.ClickNotification,{type:t.type}),i(!0)},children:[e.jsx(p,{variant:"yellow",children:e.jsx(ft,{size:y,className:"mb-px"})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx("div",{className:"font-semibold",children:t.previewItems[0].content.title}),e.jsx("div",{className:"text-muted",children:t.previewItems[0].content.body})]})]}),e.jsx(rs,{open:n,onOpenChange:a=>i(a)})]})});ls.displayName="UserBoostNotificationGroup";const os=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=ne(),i=cn(),a=l.useCallback(async()=>{const r=await i();n({to:r,openInNewTab:!0})},[i,n]);return e.jsxs(x,{notificationGroup:t,onClick:()=>{a()},children:[e.jsx(p,{variant:"blue",children:e.jsx(Ta,{size:y})}),e.jsxs("div",{className:"flex flex-col self-center",children:[e.jsx("span",{className:"mb-1 font-semibold",children:"1 day remaining to re-connect your Ethereum address!"}),e.jsx("span",{className:"mb-2",children:"Please re-connect your Ethereum address to ensure you're eligible for the Active Badge, ENS, DAO notifications and other upcoming onchain features."}),e.jsx(M,{className:"w-min",variant:"normal",onClick:r=>{r.preventDefault(),r.stopPropagation(),s(h.ClickNotification,{type:t.type,action:"connect"}),a()},children:"Connect"})]})]})});os.displayName="VerifyNotificationGroup";const cs=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=U(),i=l.useCallback(()=>{s(h.ClickNotification,{type:t.type}),n({to:"referrals",options:{openInNewTab:!1},params:{}})},[s,n,t.type]);return e.jsxs(x,{notificationGroup:t,onClick:i,children:[e.jsx(p,{variant:"purple",children:e.jsx(re,{size:y,color:"currentColor"})}),e.jsx("div",{className:"my-1 flex size-full flex-row items-center",children:e.jsx("div",{className:"font-semibold text-default",children:"Were you referred to Farcaster?"})})]})});cs.displayName="WereYouReferredNotificationGroup";const ds=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=U(),i=l.useCallback(()=>{s(h.ClickNotification,{type:t.type}),n({to:"referrals",options:{openInNewTab:!1},params:{}})},[s,n,t.type]);return e.jsxs(x,{notificationGroup:t,onClick:i,children:[e.jsx(p,{variant:"purple",children:e.jsx(re,{size:y,color:"currentColor"})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx("div",{className:"my-1 flex size-full flex-row items-center",children:e.jsx("div",{className:"font-semibold text-default",children:"Claim your referral rewards!"})}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"line-clamp-4 grow text-muted",children:"Unclaimed rewards will expire after 7 days"})})]})]})});ds.displayName="XPClaimReminderNotificationGroup";const ms=l.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=U(),i=l.useMemo(()=>t.type==="xp-reward-expire-soon",[t.type]),a=l.useCallback(()=>{s(h.ClickNotification,{type:t.type}),n({to:"referrals",options:{openInNewTab:!1},params:{}})},[s,n,t.type]),r=l.useMemo(()=>i?"Unclaimed rewards expire tomorrow!":"Unclaimed rewards expire in 6 hours!",[i]);return e.jsxs(x,{notificationGroup:t,onClick:a,children:[e.jsx(p,{variant:"purple",children:e.jsx(re,{size:y,color:"currentColor"})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx("div",{className:"my-1 flex size-full flex-row items-center",children:e.jsx("div",{className:"font-semibold text-default",children:r})}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"line-clamp-4 grow text-muted",children:"Tap to claim them to your wallet."})})]})]})});ms.displayName="XPRewardExpireNotificationGroup";const xs=l.memo(({group:t})=>{const s=U(),{join:n}=Ua(),i=dn(),[a,r]=l.useState(!1),o=t.previewItems[0],{actor:c,content:d}=o,u=l.useCallback(async()=>{r(!0);try{const N=await i({roomId:d.roomId});if(!await n(N.room.id,"spaces_list"))return;
11s({to:"spaces",params:{roomId:N.room.id}})}catch(N){X({message:N instanceof Error?N.message:"Failed to start Space",type:"error"})}finally{r(!1)}},[d.roomId,n,s,i]),b="Your Space is scheduled to start",v=a?"Starting your Space...":"Tap to start and join your Space.";return e.jsxs(x,{notificationGroup:t,onClick:u,children:[e.jsx(T,{children:e.jsx(q,{user:c,size:"lg"})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:b}),e.jsx("div",{className:"text-faint",children:$(o.timestamp,"floor")})]}),e.jsx("div",{className:"line-clamp-2 text-muted",children:v})]})})]})});xs.displayName="AudioRoomScheduledStartNotificationGroup";const us=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 98 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.3
1162 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});us.displayName="GitHubTopHatIcon";const fs=m.memo(({notificationGroup:t})=>{const s=we({fallback:t.previewItems[0].content.cast}),n=pe(),i=ge(),a=t.isUnread,r=m.useMemo(()=>Me([{cast:s}],{forceThreadPosition:"start_and_end",isHighlighted:a})[0],[s,a]),o=m.useMemo(()=>typeof s<"u"&&typeof s.embeds<"u"&&typeof s.embeds.casts>"u"&&s.embeds.urls.findIndex(({openGraph:{domain:u}})=>u==="x.com"||u==="twitter.com")!==-1,[s]),c=m.useMemo(()=>typeof s<"u"&&typeof s.embeds<"u"&&typeof s.embeds.casts>"u"&&!o&&s.embeds.urls.findIndex(({openGraph:{domain:u}})=>u==="github.com")!==-1,[s,o]),d=m.useMemo(()=>{if(o)return e.jsx(Xe,{icon:e.jsx(We,{}),children:"Mention"});if(c)return e.jsx(Xe,{icon:e.jsx(us,{}),children:"Mention"})},[c,o]);return i(s)?n?e.jsx(ke,{}):null:e.jsx(Ie,{castWithContext:r,CastTopHatForNotificationsComponent:d})});fs.displayName="CastQuoteNotificationGroup";const Te=()=>e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M1.33545 6.80324C1.33545 6.50309 1.58983 6.25977 1.90363 6.25977H9.93393C10.2477 6.25977 10.5021 6.50309 10.5021 6.80324C10.5021 7.1034 10.2477 7.34672 9.93393 7.34672H1.90363C1.58983 7.34672 1.33545 7.1034 1.33545 6.80324Z",fill:"currentColor"}),e.jsx("path",{d:"M1.33545 14.0542C1.33545 13.7541 1.58983 13.5107 1.90363 13.5107H8.26727C8.58107 13.5107 8.83545 13.7541 8.83545 14.0542C8.83545 14.3544 8.58107 14.5977 8.26727 14.5977H1.90363C1.58983 14.5977 1.33545 14.3544 1.33545 14.0542Z",fill:"currentColor"}),e.jsx("path",{d:"M13.7435 4.8054C13.6825 4.6758 13.5565 4.59375 13.4186 4.59375C13.2807 4.59375 13.1547 4.6758 13.0937 4.8054L11.6161 7.94254L8.31221 8.44561C8.17571 8.46639 8.06232 8.56657 8.0197 8.70402C7.97708 8.84147 8.01262 8.99236 8.11139 9.09324L10.5021 11.5352L9.93775 14.9832C9.91444 15.1257 9.97032 15.2696 10.0819 15.3546C10.1935 15.4395 10.3414 15.4507 10.4635 15.3835L13.4186 13.7555L16.3737 15.3835C16.4958 15.4507 16.6438 15.4395 16.7553 15.3546C16.8669 15.2696 16.9228 15.1257 16.8995 14.9832L16.3351 11.5352L18.7259 9.09324C18.8246 8.99236 18.8602 8.84147 18.8175 8.70402C18.7749 8.56657 18.6615 8.46639 18.525 8.44561L15.2211 7.94254L13.7435 4.8054Z",fill:"currentColor"}),e.jsx("path",{d:"M1.16895 10.4263C1.16895 10.1261 1.42333 9.88281 1.73713 9.88281H6.73713C7.05093 9.88281 7.30531 10.1261 7.30531 10.4263C7.30531 10.7264 7.05093 10.9698 6.73713 10.9698H1.73713C1.42333 10.9698 1.16895 10.7264 1.16895 10.4263Z",fill:"currentColor"})]});Te.displayName="ChannelStreaksIcon";const Dn=m.memo(({onChannelSelect:t})=>{const{data:s,onEndReached:n}=za({forComposer:!1}),i=m.useMemo(()=>s.pages.flatMap(o=>o.result.channels).filter(o=>o.type==="channel")||[],[s]),a=m.useCallback(o=>o.key,[]),r=m.useCallback(({item:o})=>{const c=o.imageUrl||E,d=o.name;return e.jsxs("div",{className:"flex cursor-pointer flex-row items-center space-x-2 px-2 py-3 bg-overlay-faint hover:bg-overlay-light",onClick:()=>{t({channel:o})},children:[e.jsx(F,{src:Y(c,24),className:"aspect-square size-[24px] min-h-[24px] max-w-[24px] flex-1 shrink-0 rounded-full border object-cover border-default",alt:`${d} image`}),e.jsx("span",{className:"line-clamp-1 text-sm text-default",children:o.key}),e.jsxs("span",{className:"flex flex-row items-center space-x-0.5",children:[e.jsx(ht,{className:"text-muted ",size:10}),e.jsx("span",{className:"text-xs text-muted",children:pt({followCount:o.followerCount||0})})]})]})},[t]);return e.jsx(jt,{itemClassName:"border-b border-default last:border-b-0",containerClassName:"border border-default rounded scrollbar-vert flex max-h-[300px] flex-col overflow-y-auto",data:i,renderItem:r,emptyView:e.jsx(e.Fragment,{}),keyExtractor:a,onEndReached:n})}),hs=m.memo(({children:t})=>{const{fid:s}=ie(),{trackEvent:n}=J(),i=Pe(),[a,r]=m.useState(!1),[o,c]=m.useState(!1),[d,u]=m.useState(void 0),[b,v]=m.useState(void 0),[N,f]=m.useState(!1),j=kn(),k=Sa(),I=m.useCallback(()=>{n(h.PressNotInterestedChannelStreakPrompt,void 0),r(!1),f(!0)},[n]),P=m.useCallback(()=>{n(h.PressLetsGoChannelStreaksPrompt,void 0),c(!0)},[n]),S=m.useCallback(async({channel:g})=>
11{n(h.PressSelectChannelChannelStreakPrompt,{channelKey:g.key});const Z={description:g.description||"",followerCount:g.followerCount||0,imageUrl:g.imageUrl||E,key:g.key,name:g.name};j({fid:s,channel:Z}),c(!1),u(Z)},[s,j,n]),A=m.useCallback(()=>{typeof d>"u"||(r(!1),n(h.PressGoToChannelChannelStreakPrompt,{}),i({channelKey:d.key}))},[i,d,n]),z=m.useCallback(()=>{typeof d>"u"||(r(!1),n(h.PressCastNowChannelStreakPrompt,{}),v(d.key))},[d,n]);m.useEffect(()=>{n(h.ShowStartChannelStreaksPrompt,{})},[n]),m.useEffect(()=>{c(!1),u(void 0)},[a]);const R=m.useMemo(()=>o?e.jsxs(G,{className:"focus:outline-hidden fixed left-1/2 top-1/2 z-20 max-h-[85vh] w-[90vw] max-w-[450px] -translate-x-1/2 -translate-y-1/2 rounded-[6px] py-6 bg-app",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between pl-6 pr-4",children:[e.jsx(ee,{className:"text-lg font-semibold text-default",children:"Pick a channel"}),e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex w-max cursor-pointer flex-col items-center justify-center rounded-full p-2 text-faint hover:bg-overlay-faint hover:text-default",children:e.jsx(se,{size:20,className:"text-default"})})})]}),e.jsx("div",{className:"mt-1 px-6 text-default",children:"You can only have 1 streak at a time. You cannot change the channel until the streak ends."}),e.jsx("div",{className:"flex flex-col space-y-2 px-6",children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"flex h-[300px] w-full items-center justify-center",children:e.jsx(Fa,{})}),children:e.jsx(Dn,{onChannelSelect:S})})})]}):typeof d<"u"?e.jsxs(G,{className:"focus:outline-hidden fixed left-1/2 top-1/2 z-20 max-h-[85vh] w-[90vw] max-w-[450px] -translate-x-1/2 -translate-y-1/2 rounded-[6px] py-6 bg-app",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between pl-6 pr-4",children:[e.jsx(ee,{className:"text-lg font-semibold text-default",children:"You're all set!"}),e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex w-max cursor-pointer flex-col items-center justify-center rounded-full p-2 text-faint hover:bg-overlay-faint hover:text-default",children:e.jsx(se,{size:20,className:"text-default"})})})]}),e.jsxs("div",{className:"mt-1 px-6 text-default",children:["Cast in /",d.key," to get started."]}),e.jsxs("div",{className:"relative justify-center",children:[e.jsx(F,{alt:"Channel Straks illustration",src:"/~/images/StreakLightModeSuccess.webp",className:"block dark:hidden"}),e.jsx(F,{alt:"Channel Straks illustration",src:"/~/images/StreakDarkModeSuccess.webp",className:"hidden dark:block"}),e.jsx("div",{className:"absolute top-0 flex size-full items-center justify-center pt-24",children:e.jsxs("div",{className:"flex w-max flex-row items-center space-x-2 self-center rounded border px-2 py-1 bg-app border-default",children:[e.jsx(F,{src:Y(d.imageUrl,24),className:"aspect-square size-[24px] min-h-[24px] max-w-[24px] flex-1 shrink-0 rounded-full border object-cover border-default",alt:`${d.name} image`}),e.jsx("span",{className:"text-sm text-default",children:d.key}),e.jsxs("span",{className:"flex flex-row items-center space-x-0.5 pt-[2px]",children:[e.jsx(ht,{className:"text-muted",size:10}),e.jsx("span",{className:"text-xs text-muted",children:pt({followCount:d.followerCount||0})})]})]})})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-2 grid-rows-1 items-center justify-between gap-4 px-6",children:[e.jsx(M,{title:"Go to channel",className:"outline-hidden flex h-10 !w-full flex-row items-center !justify-center space-x-1 self-center border !bg-transparent !p-0 !text-base !font-normal !text-muted border-default",onClick:A,children:e.jsx("span",{className:"flex flex-row items-center text-center",children:"Go to channel"})}),e.jsx(M,{title:"Cancel",className:"outline-hidden flex h-10 !w-full flex-row items-center !justify-center space-x-1 !text-base !font-normal !bg-action-primary hover:!bg-[#7C65C1F0]",onClick:z,children:e.jsx("span",{className:"flex flex-row items-center text-center text-light",children:"Cast now"})})]})]}):e.jsxs(G,{className:"focus:outline-hidden fixed left-1/2 top-1/2 z-20 max-h-[85vh] w-[90vw] max-w-[450px] -translate-x-1/2 -translate-y-1/2 roun
11ded-[6px] py-6 bg-app",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between pl-6 pr-4",children:[e.jsx(ee,{className:"text-lg font-semibold text-default",children:"Showcase your favorite channel"}),e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex w-max cursor-pointer flex-col items-center justify-center rounded-full p-2 text-faint hover:bg-overlay-faint hover:text-default",children:e.jsx(se,{size:20,className:"text-default"})})})]}),e.jsx(F,{alt:"Channel Straks illustration",src:"/~/images/StreakLightModeStart.webp",className:"block dark:hidden"}),e.jsx(F,{alt:"Channel Straks illustration",src:"/~/images/StreakDarkModeStart.webp",className:"hidden dark:block"}),e.jsxs("div",{className:"flex flex-col space-y-2 px-6",children:[e.jsx("div",{className:"text-base text-default",children:"Here's how it works:"}),e.jsx("div",{className:"text-base text-default",children:"1. Pick a channel for your streak"}),e.jsx("div",{className:"text-base text-default",children:"2. Cast or reply daily to keep your streak alive"}),e.jsx("div",{className:"text-base text-default",children:"3. Miss a day and it resets to 0"})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-2 grid-rows-1 items-center justify-between gap-4 px-6",children:[e.jsx(M,{title:"Not interested",className:"outline-hidden flex h-10 !w-full flex-row items-center !justify-center space-x-1 self-center !bg-transparent !p-0 !text-base !font-normal !text-muted hover:underline",onClick:I,children:e.jsx("span",{className:"flex flex-row items-center text-center",children:"I'm not interested"})}),e.jsx(M,{title:"Cancel",className:"outline-hidden flex h-10 !w-full flex-row items-center !justify-center space-x-1 !text-base !font-normal !bg-action-primary hover:!bg-[#7C65C1F0]",onClick:P,children:e.jsx("span",{className:"flex flex-row items-center text-center text-light",children:"Let's go"})})]})]}),[o,z,S,A,I,P,d]);return e.jsxs(e.Fragment,{children:[e.jsxs($e,{open:a,onOpenChange:r,modal:!0,children:[e.jsx(Ae,{asChild:!0,children:t}),e.jsxs(Le,{children:[e.jsx(Be,{className:"fixed inset-0 z-10 bg-overlay"}),R]})]}),typeof b<"u"&&e.jsx(be,{intent:{channelKey:b},onClose:()=>{v(void 0)}}),N&&e.jsx(Pa,{onCancel:()=>{r(!0),f(!1)},onConfirm:async()=>{k({preferences:{optOutChannelStreaks:!0}}).catch(()=>{}),r(!1),f(!1)},confirmText:"Yes, opt-out",title:"Opt out",destructive:!0,body:e.jsx(e.Fragment,{children:"Opting out will remove the streak indicator from your profile and stop streak notifications."})})]})});hs.displayName="ChannelStreaksModal";const ps=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=J();return e.jsx(hs,{children:e.jsxs(x,{notificationGroup:t,onClick:()=>{s(h.ClickNotification,{type:t.type})},children:[e.jsx(p,{variant:"yellow",children:e.jsx(Te,{})}),e.jsxs("div",{className:"group w-full min-w-0",children:[e.jsx("div",{className:"line-clamp-2 font-semibold break-gracefully",children:"Streak ended"}),e.jsx("div",{className:"mt-1 text-sm text-action-purple group-hover:underline",children:"Start new streak"})]})]})})});ps.displayName="ChannelStreakEndedNotificationGroup";const js=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=J(),n=m.useMemo(()=>t.previewItems[0],[t.previewItems]),i=m.useMemo(()=>typeof n.content.streak.metadata>"u"?"Keep your streak":n.content.streak.streakCount===0?`Keep your streak in /${n.content.streak.channel.key}`:`Keep your streak in /${n.content.streak.channel.key} (${n.content.streak.streakCount} ${n.content.streak.streakCount===1?"day":"days"})`,[n.content.streak.channel.key,n.content.streak.metadata,n.content.streak.streakCount]),a=m.useMemo(()=>{const c=n.content.streak.metadata;if(typeof c>"u"&&n.content.streak.streakCount!==0)return e.jsxs("div",{className:"line-clamp-3 text-sm text-muted break-gracefully",children:["You've casted for ",n.content.streak.streakCount," ",n.content.streak.streakCount===1?"day":"days"," ","in /",n.content.streak.channel.key,"."]});if(typeof c>"u")return;const d=Intl.DateTimeFormat().resolvedOptions().timeZone,u=de(c.expiresAtTimestamp).tz(d).fromNow(!0);return e.jsxs("div",{className:"line-clamp-3 text-sm text-muted break-gracefully",children:["Your streak expires in ",u,"."]})},[n.content.streak.channel.key,n.content.streak.metadata,n.content.streak.streakCount]),[r,o]=m.useState(!1);return e.jsxs(x,{notificationGroup:t,onClick:()=>{s(h.ClickNotification,{type:t.type}),o(!0)},children:[e.jsx(p,{variant:"yellow",children:e.jsx(Te,{})}),e.jsxs("div",{className:"group w-full min-w-0",children:[e.jsx("div",{className:"line-clamp-2 font-semibold break-gracefully",children:i}),a,e.jsx("div",{className:"mt-1 text-sm text-action-purple group-hover:underline",children:"Cast now"})]}),r&&e.jsx(be,{onClose:()=>{o(!1)}
11,intent:{channelKey:n.content.streak.channel.key}})]})});js.displayName="ChannelStreakNotificationGroup";const vs=m.memo(({onCancel:t})=>e.jsx($a,{children:e.jsx(Aa,{onClose:t,children:e.jsx(m.Suspense,{children:e.jsx(Wn,{onCancel:t})})})})),Wn=m.memo(({onCancel:t})=>{const{fid:s}=ie(),{data:n}=bn({fid:s}),i=m.useMemo(()=>typeof n>"u"||typeof n.result.streak>"u"?0:n.result.streak.streakCount,[n]),a=m.useMemo(()=>{if(!(typeof n>"u"||typeof n.result.streak>"u"||typeof n.result.streak.metadata>"u"))return n.result.streak.metadata},[n]),r=m.useMemo(()=>{if(typeof a>"u")return;const v=Intl.DateTimeFormat().resolvedOptions().timeZone;return de(a.latestWindowStartTimestamp).tz(v).format("h:mma z")},[a]),o=m.useMemo(()=>{if(typeof a>"u")return;const v=Intl.DateTimeFormat().resolvedOptions().timeZone;return de(a.expiresAtTimestamp).tz(v).fromNow(!0)},[a]),c=m.useMemo(()=>{if(typeof a>"u")return;const v=Intl.DateTimeFormat().resolvedOptions().timeZone;return de(a.expiresAtTimestamp).tz(v).format("h:mma z")},[a]),d=m.useMemo(()=>typeof a>"u"?!1:a.latestWindowCastCount!==0,[a]),u=Pe(),b=m.useCallback(()=>{t(),typeof n<"u"&&n.result.streak&&u({channelKey:n.result.streak.channel.key})},[n,u,t]);return typeof a>"u"?null:e.jsx("div",{className:"flex size-full flex-col items-center justify-center p-4",children:e.jsxs("div",{className:"flex h-auto w-[500px] flex-col items-start justify-center rounded-lg border p-4 pb-0 bg-app border-default",onClick:v=>{v.stopPropagation()},children:[e.jsx("div",{className:"flex w-full flex-row items-center justify-between pl-6 pr-4",children:e.jsx("div",{className:"text-lg font-semibold text-default",children:"About your streak"})}),e.jsxs("div",{className:"flex w-full flex-col space-y-4 p-6",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-default",children:"Streak length"}),e.jsx("div",{className:"flex flex-row items-center",children:e.jsx("span",{className:"text-default",children:i})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-default",children:"Your streak window"}),e.jsx("div",{className:"flex flex-row items-center",children:e.jsxs("span",{className:"text-default",children:[r," to ",c]})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-default",children:"Current streak window"}),e.jsx("div",{className:"flex flex-col",children:e.jsxs("span",{className:"flex flex-row items-center space-x-2 text-default",children:[e.jsx("span",{children:a.latestWindowCastCount===0?"No casts":a.latestWindowCastCount===1?"1 cast":`${a.latestWindowCastCount} casts`}),d?e.jsx(La,{className:"text-success"}):e.jsx(ze,{className:"text-muted"})]})})]}),d?e.jsx("span",{className:"bg-success/30 flex flex-row items-center justify-center space-x-2 rounded px-2 py-3 text-success",children:e.jsxs("span",{className:"font-semibold",children:["Your next window starts in ",o]})}):e.jsx("span",{className:"flex flex-row items-center justify-center space-x-2 rounded px-2 py-3 text-muted bg-overlay-light",children:e.jsxs("span",{className:"font-semibold",children:["You have ",o," left to cast"]})}),e.jsxs("div",{className:"grid grid-cols-2 grid-rows-1 items-center justify-between gap-4",children:[e.jsx(M,{title:"Close",className:"outline-hidden flex h-10 !w-full flex-row items-center !justify-center space-x-1 self-center border !bg-transparent !p-0 !text-base !font-normal !text-muted border-default",onClick:t,children:e.jsx("span",{className:"flex flex-row items-center text-center",children:"Close"})}),e.jsx(M,{title:"Go to channel",className:"outline-hidden flex h-10 !w-full flex-row items-center !justify-center space-x-1 !text-base !font-normal !bg-action-primary hover:!bg-[#7C65C1F0]",onClick:b,children:e.jsx("span",{className:"flex flex-row items-center text-center text-light",children:"Go to channel"})})]})]})]})})});vs.displayName="UserChannelStreakModal";const Ns=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=J(),[n,i]=m.useState(!1),a=m.useMemo(()=>t.previewItems[0].content.streak,[t.previewItems]),r=m.useMemo(()=>a.streakCount<=1?`Started streak in /${a.channel.key} (1 day)`:`Streak in /${a.channel.key} continued! (${a.streakCount} days)`,[a.channel.key,a.streakCount]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{notificationGroup:t,onClick:()=>{s(h.ClickNotification,{type:t.type}),i(!0)},children:[e.jsx(p,{variant:"yellow",children:e.jsx(Te,{})}),e.jsxs("div",{className:"group w-full min-w-0",children:[e.jsx("div",{className:"line-clamp-2 font-semibold break-gracefully",children:r}),e.jsx("div",{className:"mt-1 text-sm text-action-purple group-hover:underline",children:"View streak details"})]})]}),n&&e.jsx(vs,{onCancel:()=>i(!1)})]})});Ns.displayName="ChannelStreakUpdateNotificationGroup";const Hn=t=>(typeof t=="string"&&(t=BigInt(t)),parseFloat(Ct(t,6))),bs=l.memo(({group:t})=>{const s=U(),{trackEvent:n}=w(),{fid:i}=ie(),a=t.previewItems[0],r=l.useCallback(()=>
11{s({to:"conversationWithUsername",params:{username:a.content.cast.author.username??"",castHashPrefix:a.content.cast.hash.slice(0,10)}})},[a.content.cast.author.username,a.content.cast.hash,s]),o=l.useMemo(()=>{const N=Hn(a.content.topBid.amount);let f=a.content.cast.author.username;switch(f&&(f=f.endsWith("s")?`${f}'`:`${f}'s`),a.content.cast.author.fid===i&&(f="your"),a.type){case"collectible-cast-creator-bid":return`bid $${N} on your cast`;case"collectible-cast-creator-settled":return`collected your cast for $${N}`;case"collectible-cast-bidder-outbid":return`raised the bid to $${N} on ${f} cast`;case"collectible-cast-bidder-settled":return`You collected ${f} cast for $${N}`;case"collectible-cast-bidder-time-left":if("auction"in a.content.collectible&&"topBid"in a.content.collectible.auction){if(a.content.collectible.auction.topBid.bidder.fid===i)return`You are still the top bidder on ${f} cast`;const k=a.content.collectible.auction.end,I=Math.floor((k-a.timestamp)/1e3),P=Math.floor(I/60);return`${f} cast auction ends in ${P} minutes`}return`${f} cast auction ends in a few minutes`;case"collectible-cast-bidder-cancelled":return`${f} deleted their cast. Your bid was refunded.`}},[a.content.cast.author.username,a.content.topBid.amount,a.type,a.content.collectible,a.timestamp,i,a.content.cast.author.fid]),c=l.useMemo(()=>t.previewItems.map(N=>N.content.topBid.bidder),[t.previewItems]),d=a.type!=="collectible-cast-bidder-settled"&&a.type!=="collectible-cast-bidder-time-left"&&a.type!=="collectible-cast-bidder-cancelled",u=c[0],b=c[1],v=l.useMemo(()=>{const N=t.totalItemCount-1;return N===0?" ":N===1?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ml-1",children:" and "}),e.jsxs(W,{title:"1 other",user:b,className:"font-semibold text-default hover:underline",onClick:()=>{b&&n(h.ClickNotification,{type:t.id,action:"actor"})},children:["1 other"," "]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ml-1",children:" and "}),e.jsx("span",{className:"font-semibold",children:`${N} others `})]})},[t.id,t.totalItemCount,b,n]);return e.jsxs(x,{notificationGroup:t,onClick:()=>r(),children:[e.jsx(p,{variant:"green",children:e.jsx(Nt,{size:y,className:"fill-green"})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[d?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx(gt,{users:c,groupType:t.type}),e.jsx("div",{className:"text-faint",children:$(a.timestamp,"floor")})]}),e.jsxs("div",{className:"flex flex-row flex-wrap items-center text-default",children:[e.jsx(W,{title:L({username:u.username,fid:u.fid}),user:u,className:"font-semibold text-default hover:underline",onClick:()=>{n(h.ClickNotification,{type:t.id,action:"actor"})},children:L({username:u.username,fid:u.fid})}),e.jsx("span",{className:"text-default",children:v}),e.jsxs("span",{className:"text-default",children:["Â ",o]})]})]}):e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"font-semibold text-default",children:o}),e.jsx("div",{className:"text-faint",children:$(a.timestamp,"floor")})]}),e.jsx(_,{cast:a.content.cast})]})]})});bs.displayName="CollectibleCastNotificationGroup";const Cs=l.memo(({group:t})=>{const s=U(),{trackEvent:n}=w(),i=t.previewItems[0],a=l.useCallback(()=>{n(h.ClickNotification,{type:t.id,action:"cast"}),s({to:"conversationWithUsername",params:{username:i.content.cast.author.username??"",castHashPrefix:i.content.cast.hash.slice(0,10)}})},[i.content.cast.author.username,i.content.cast.hash,t.id,s,n]);let r=i.content.cast.author.username;r&&(r=r.endsWith("s")?`${r}'`:`${r}'s`);const o=`${r} cast is now available for auction`;return e.jsxs(x,{notificationGroup:t,onClick:()=>a(),children:[e.jsx(p,{variant:"green",children:e.jsx(Nt,{size:y,className:"fill-green"})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"font-semibold text-default",children:o}),e.jsx("div",{className:"text-faint",children:$(i.timestamp,"floor")})]}),e.jsx(_,{cast:i.content.cast})]})]})});Cs.displayName="CollectibleCastWatchAvailableNotificationGroup";const ys=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=J(),n=ne(),i=mn(),a=m.useCallback(async()=>{s(h.SendUserToXToAuth,{via:"notification"});const{result:r}=await i();n({to:r.url,openInNewTab:!0})},[n,i,s]);return e.jsxs(x,{notificationGroup:t,onClick:a,children:[e.jsx(p,{variant:"gray",children:e.jsx(We,{})}),e.jsxs("div",{className:"group w-full min-w-0",children:[e.jsx("div",{className:"line-clamp-2 font-semibold break-gracefully",children:"Connect your X (formerly Twitter) account"}),e.jsx("div",{className:"line-clamp-3 text-sm text-muted break-gracefully",children:"Reach more users by verifying that you own an X account."})]})]})});ys.displayName="ConnectAccountNotificationGroup";const ws=m.memo(({notificationGroup:t})=>{const{trackEvent:s}=w(),n=oe(),{users:i,totalCount:a}=le({notificationGroup:t}),[r]=i,o=m.useMemo(()=>{const c=a-1;return c<=0?" ":c===1?" and 1 other ":` and ${c} others `},[a]);return e.jsxs(x,{notificationGroup:t,onClick:()=>{n({groupId:t.id,type:t.type})},children:[e.jsx(p,{variant:"yellow",children:e.jsx(Ba,{size:"small"})}),e.jsxs("div",{className:"w-full min-w-0",children:[e.jsx(B,{notificationGroup:t}),e.jsxs("div",{className:"line-clamp-2 break-gracefully",children:[e.jsx(W,{title:L(r),user:r,className:"relative font-semibold text-default hover:underline",onClick:()=>{s(h.ClickNotification,{type:t.type,action:"author"})},children:L(r)}),o,"casted for the first time in a while"]})]})]})});ws.displayName="DormantUserNewCastNotificationGroup";const gs=l.memo(({group:t})=>
11{const s=O(),i=V()?.navigate,a=t.previewItems[0],r=a?.content.limitOrderId,o=m.useCallback(()=>{!s&&i&&i({path:"Wallet",params:{initialTab:"orders",limitOrderId:r}})},[s,i,r]);if(!a)return null;const{kind:c,sellToken:d,buyToken:u,sellAmount:b,buyAmount:v,isPartialFill:N}=a.content,f=Ra({kind:c,sellToken:d,buyToken:u}),j=Da({kind:f,sellToken:d,buyToken:u}),{title:k,body:I}=Ea({kind:f,sellToken:d,buyToken:u,sellAmount:b,buyAmount:v,isPartialFill:N});return e.jsxs(x,{notificationGroup:t,onClick:o,children:[e.jsx(T,{children:e.jsxs("div",{className:"relative",children:[j.imageUrl?e.jsx(F,{src:Y(j.imageUrl,48),className:"aspect-cover shrink-0 rounded-full border bg-app border-default",style:{width:48,height:48,minWidth:48,minHeight:48},alt:"Image",fallback:E}):e.jsx("div",{className:"flex items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900",style:{width:48,height:48,minWidth:48,minHeight:48},children:j.symbol&&j.symbol.length>0&&j.symbol.trim()!==""&&j.symbol!=="[invalid]"?e.jsx("span",{className:"text-xl font-semibold text-primary",children:j.symbol[0].toUpperCase()}):e.jsx(ye,{})}),e.jsx(On,{})]})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:k}),e.jsx("div",{className:"text-faint",children:$(a.timestamp,"floor")})]}),e.jsx("div",{className:"text-muted",children:I})]})})]})}),On=()=>e.jsx("div",{className:"absolute -bottom-1 -right-1 flex size-5 items-center justify-center rounded-full border bg-app border-default",children:e.jsx("div",{className:"flex size-4 items-center justify-center rounded-full bg-green-500",children:e.jsx(Wa,{className:"size-3 text-white",strokeWidth:3})})});gs.displayName="LimitOrderMatchedNotificationGroup";const ks=l.memo(({group:t})=>t.previewItems.length===1?e.jsx(Is,{notif:t.previewItems[0],isUnread:t.isUnread}):e.jsx(Ms,{group:t}));ks.displayName="MiniAppNotificationGroup";const Is=({notif:t,isUnread:s})=>{const{launchMiniApp:n}=De();return e.jsxs(x,{notificationGroup:{type:"mini-app",isUnread:s,previewItems:[t]},trackingProps:{domain:t.content.miniapp.domain,name:t.content.miniapp.name},onClick:()=>{n({context:{type:"notification",notification:{notificationId:t.content.notificationId,title:t.content.title,body:t.content.body}},launchConfig:{type:"standalone",name:t.content.miniapp.name,url:t.content.targetUrl,splashImageUrl:t.content.miniapp.splashImageUrl,splashBackgroundColor:t.content.miniapp.splashBackgroundColor,author:t.content.miniapp.author}})},children:[e.jsx(T,{children:e.jsx(Ce,{imageUrl:t.content.miniapp.iconUrl,size:44})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:t.content.title}),e.jsx("div",{className:"text-faint",children:$(t.timestamp,"floor")})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"line-clamp-4 grow text-muted",children:t.content.body})})]})]})};Is.displayName="SingleMiniAppNotification";const Ms=({group:t})=>{const s=Ht(),n=l.useMemo(()=>t.previewItems[0],[t.previewItems]);return e.jsxs(x,{notificationGroup:t,trackingProps:{domain:n.content.miniapp.domain,name:n.content.miniapp.name},trackAsGroup:!0,onClick:({openInNewTab:i})=>{s({groupId:t.id,openInNewTab:i})},children:[e.jsx(T,{centerVertically:!0,children:e.jsx(Ce,{imageUrl:n.content.miniapp.iconUrl,size:44})}),e.jsxs("div",{className:"w-full self-center pt-1",children:[e.jsx("span",{className:"text-base font-semibold text-default",children:n.content.title})," ","and ",t.totalItemCount-1," more from"," ",e.jsx("span",{className:"font-semibold",children:n.content.miniapp.name}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"line-clamp-4 grow text-muted",children:n.content.body})})]})]})};Ms.displayName="MultipleMiniAppNotifications";const Ts=m.memo(({notificationGroup:t})=>{const s=Ha(),n=t.previewItems[0],i=t.previewItems[0].content.article,a=O(),o=V()?.navigate,c=m.useCallback(()=>{s({articlePublicId:i.publicId})},[i.publicId,s]),d=m.useCallback(u=>{u.stopPropagation(),!a&&o&&typeof i.token<"u"&&o({path:"Token",params:{chain:i.token.chain,ca:i.token.c
11a,via:"notification_new_article_inapp"}})},[i.token,a,o]);return e.jsxs(x,{notificationGroup:t,onClick:c,children:[e.jsx(T,{children:e.jsx("div",{className:"relative",children:e.jsx(F,{src:Y(i.token?.imageUrl,48)||E,className:"aspect-cover shrink-0 rounded-full border bg-app border-default",style:{width:48,height:48,minWidth:48,minHeight:48},alt:"Image",fallback:E,onClick:d})})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:i.title}),e.jsx("div",{className:"text-faint",children:$(n.timestamp,"floor")})]}),e.jsx("div",{className:"line-clamp-3 text-muted",children:i.description})]})})]})});Ts.displayName="NewArticleNotificationGroup";const Us=l.memo(({group:t})=>{const s=t.previewItems[0];return e.jsxs(x,{notificationGroup:t,onClick:()=>{},children:[e.jsx(p,{variant:"purple",children:e.jsx(Re,{size:y})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between",children:[e.jsx("div",{className:"shrink",children:s.content.title}),e.jsx("div",{className:"text-faint"})]}),e.jsx("div",{className:"text-muted",children:"Go to your mobile device to claim"})]})]})});Us.displayName="NewCampaignNotificationGroup";const Ss=l.memo(({group:t})=>{const s=O(),i=V()?.navigate,a=t.previewItems[0],{sellToken:r,buyToken:o,sellAmount:c}=a.content,d=m.useCallback(()=>{!s&&i&&i({path:"WalletSwap",params:{platformType:"web",swapIntent:{sell:{chainId:Number(_e(r.chain)),address:r.ca},buy:{chainId:Number(_e(o.chain)),address:o.ca},sellAmount:c}}})},[s,i,r,o,c]),u=me(o.ca)||xe(o.ca),b=ue(o.ca),v=me(r.ca)||xe(r.ca),N=ue(r.ca);let f="buy",j=o;N?(f="buy",j=o):b?(f="sell",j=r):v?(f="buy",j=o):u&&(f="sell",j=r);const k=`${f==="buy"?"Buy":"Sell"} failed`,I=`Tap to retry your ${f==="buy"?"buy":"sell"} of ${j.symbol}`;return e.jsxs(x,{notificationGroup:t,onClick:d,children:[e.jsx(T,{children:e.jsxs("div",{className:"relative",children:[j.imageUrl?e.jsx(F,{src:Y(j.imageUrl,48),className:"aspect-cover shrink-0 rounded-full border bg-app border-default",style:{width:48,height:48,minWidth:48,minHeight:48},alt:"Image",fallback:E}):e.jsx("div",{className:"flex items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900",style:{width:48,height:48,minWidth:48,minHeight:48},children:j.symbol&&j.symbol.length>0&&j.symbol.trim()!==""&&j.symbol!=="[invalid]"?e.jsx("span",{className:"text-xl font-semibold text-primary",children:j.symbol[0].toUpperCase()}):e.jsx(ye,{})}),e.jsx(Vn,{})]})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:k}),e.jsx("div",{className:"text-faint",children:$(a.timestamp,"floor")})]}),e.jsx("div",{className:"text-muted",children:I})]})})]})}),Vn=()=>e.jsx("div",{className:"absolute -bottom-1 -right-1 flex size-5 items-center justify-center rounded-full border bg-app border-default",children:e.jsx("div",{className:"flex size-4 items-center justify-center rounded-full bg-red-500",children:e.jsx(Oa,{className:"size-3 text-white",strokeWidth:3})})});Ss.displayName="SwapFailedNotificationGroup";const Fs=l.memo(({group:t})=>{const s=O(),i=V()?.navigate,a=t.previewItems[0],r=l.useCallback(()=>{!s&&i&&i({path:"Token",params:{chain:a.content.token.chain,ca:a.content.token.ca,via:"notification_token_alert_inapp"}})},[s,i,a]),{upperTargetPriceUsd:o,lowerTargetPriceUsd:c,currentPriceUsd:d,percentChange:u}=a.content.metadata;let b,v;o&&o<=d?(b=o,v="upper"):c&&c>=d&&(b=c,v="lower");const N=m.useMemo(()=>v==="upper"?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 flex size-5 items-center justify-center rounded-md border bg-app border-default",children:e.jsx("div",{className:"flex size-4 items-center justify-center rounded bg-green-600",children:e.jsx(Va,{className:"size-3 text-white",strokeWidth:3})})}):v==="lower"?e.jsx("div",{className:"absolute -bottom-1 -right-1 flex size-5 items-center justify-center rounded-md border bg-app border-default",children:e.jsx("div",{className:"flex size-4 items-center justify-center rounded bg-red-500",children:e.jsx(Ya,{className:"size-3 text-white",strokeWidth:3})})}):null,[v]);let f;
11u&&(f=`${(u*100).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})}% `);let j=a.content.token.ticker;j.length>10&&(j=j.slice(0,10)+"...");let k="",I="";if(a.content.type==="price-target")k=`${j} at ${b?fe(b):""}`,I="Your price target was hit";else if(a.content.type==="price-target-market-cap"){if(!a.content.token.marketCap)return null;k=`${j} at ${he(a.content.token.marketCap)}`,I="Your market cap target was hit"}else{if(!f||!d||!v)return null;if(d<.1){const P=a.content.token.priceUsd?parseFloat(a.content.token.priceUsd):0,S=d/P,z=(a.content.token.marketCap??0)*S;k=`${j} is ${v==="upper"?"up":"down"} ${f}`,I=`Market cap at ${he(z)}`}else k=`${j} is ${v==="upper"?"up":"down"} ${f}`,I=`Price at ${fe(d)}`}return e.jsxs(x,{notificationGroup:t,onClick:r,children:[e.jsx(T,{children:e.jsxs("div",{className:"relative",children:[a.content.token.imageUrl?e.jsx(F,{src:Y(a.content.token.imageUrl,48),className:"aspect-cover shrink-0 rounded-full border bg-app border-default",style:{width:48,height:48,minWidth:48,minHeight:48},alt:"Image",fallback:E}):e.jsx("div",{className:"flex items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900",style:{width:48,height:48,minWidth:48,minHeight:48},children:a.content.token.ticker&&a.content.token.ticker.length>0&&a.content.token.ticker.trim()!==""&&a.content.token.ticker!=="[invalid]"?e.jsx("span",{className:"text-xl font-semibold text-primary",children:a.content.token.ticker[0].toUpperCase()}):e.jsx(ye,{})}),N]})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:k}),e.jsx("div",{className:"text-faint",children:$(a.timestamp,"floor")})]}),e.jsx("div",{className:"text-muted",children:I})]})})]})});Fs.displayName="TokenAlertNotificationGroup";const Ps=l.memo(({group:t})=>{const s=O(),i=V()?.navigate,a=t.previewItems[0],{sentToken:r,sentAmount:o,receivedToken:c,receivedAmount:d}=a.content.metadata,u=me(c.ca)||xe(c.ca),b=me(r.ca)||xe(r.ca),v=ue(c.ca),N=ue(r.ca),f=(r.priceUsd??0)*o,j=(c.priceUsd??0)*d,k=fe(f||j),I=fe(j||f),P=r.marketCap?he(r.marketCap):void 0,S=c.marketCap?he(c.marketCap):void 0,A=a.content.targetUser.username;let z="Bought",R=`${k} ${c.symbol}${S?` at ${S} MC`:""}`,g=c;N&&["token-bought","token-swapped"].includes(a.content.type)?(z="Bought",R=`${k} of ${c.symbol}${S?` at ${S} MC`:""}`,g=c):v&&["token-sold","token-swapped"].includes(a.content.type)?(z="Sold",R=`${I} of ${r.symbol}${P?` at ${P} MC`:""}`,g=r):b&&["token-bought","token-swapped"].includes(a.content.type)?(z="Bought",R=`${k} of ${c.symbol}${S?` at ${S} MC`:""}`,g=c):u&&["token-sold","token-swapped"].includes(a.content.type)&&(z="Sold",R=`${I} of ${r.symbol}${P?` at ${P} MC`:""}`,g=r);const Z=l.useCallback(()=>{!s&&i&&i({path:"Token",params:{chain:g.chain,ca:g.ca,via:"notification_trader_alert_inapp"}})},[s,i,g.ca,g.chain]),C=je(a.content.targetUser)==="pro";return e.jsxs(x,{notificationGroup:t,onClick:Z,children:[e.jsx(T,{children:e.jsxs("div",{className:"relative",children:[e.jsx(q,{size:"md",user:a.content.targetUser,hideFollowButton:!0}),g.imageUrl?e.jsx(F,{src:Y(g.imageUrl,20),className:"aspect-cover absolute -bottom-0.5 -right-0.5 shrink-0 rounded-full border bg-app border-default",style:{width:20,height:20,minWidth:20,minHeight:20},alt:"Image",fallback:E}):e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 flex items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900",style:{width:20,height:20,minWidth:20,minHeight:20},children:g.symbol&&g.symbol.length>0&&g.symbol.trim()!==""&&g.symbol!=="[invalid]"?e.jsx("span",{className:"text-xl font-semibold text-primary",children:g.symbol[0].toUpperCase()}):e.jsx(ye,{})})]})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between gap-x-1",children:[e.jsxs("div",{className:"flex flex-row items-center space-x-0.5",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:A}),C&&e.jsx(Q,{size:18,className:"mb-1"})]}),e.jsx("div",{className:"text-faint",children:$(a.timestamp,"floor")})]}),e.jsx("div",{className:"text-muted",children:`${z} ${R}`})]})})]})});Ps.displayName="TraderAlertNotificationGroup";const zs=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.51023 1.08443C9.49869 0.8546 9.31229 0.66789 9.08882 0.722811C7.53048 1.10579 4.685 3.41723 6.28901 6.62518C6.60459 7.25633 6.54978 7.74188 6.29161 8.00005C5.86521 8.42646 5.0421 8.45616 4.37433 6.79019C4.28702 6.57238 4.04281 6.45082 3.83928 6.56759C2.80781 7.15935 2.16666 8.4746 2.16663 9.83338C2.16655 13.0527 4.91468 15.3334 8.123 15.3334C11.3313 15.3334 13.8333 13.0417 13.8333 9.83338C13.8333 7.87427 12.8558 6.84561 11.8294 5.7654C10.756 4.63578 9.51023 3.448 9.51023 1.08443Z",fill:"currentColor"})});zs.displayName="FlameFillIcon";const $s=m.memo(({notificationGroup:t})=>{const s=ve(),n=oe(),i=m.useMemo(()=>t.previewItems[0],[t.previewItems]),a=m.useMemo(()=>t.totalItemCount!==1,[t.totalItemCount]);return e.jsxs(x,{notificationGroup:t,onClick:()=>{a?n({groupId:t.id,type:t.type}):s({castHash:i.content.cast.hash,authorUsername:i.content.cast.author.username})},children:[e.jsx(p,{variant:"yellow",children:e.jsx(zs,{})}),e.jsxs("div",{className:"group w-full min-w-0",children:[e.jsx("div",{className:"line-clamp-2 font-semibold break-gracefully",children:a?`You have ${t.totalItemCount} casts trending!`:"Your cast is trending!"}),e.jsx(_,{cast:i.content.cast}),a&&e.jsx("div",{className:"mt-1 text-sm text-action-purple group-hover:underline",children:"Show more"})]})]})});$s.displayName="TrendingCastNotificationGroup";const As=l.memo(({group:t})=>{const s=et(),n=t.previewItems[0];return e.jsx(x,{notificationGroup:t,onClick:()=>{s({user:n.content.recommendedUser})},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(T,{children:e.jsx(q,{user:n.content.mutualFollowers[0],hideFollowButton:!0})}),e.jsx("div",{className:"w-full min-w-0 grow",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:`@${n.content.mutualFollowers[0].username} and ${n.content.mutualFollowers.length-1} others`}),e.jsx("div",{className:"text-muted",children:`followed @${n.content.recommendedUser.username} on Farcaster today`})]})})]})})});As.displayName="TrendingFollowRecommendationNotificationGroup";const Ls=l.memo(({group:t})=>
11{const s=O(),i=V()?.navigate,a=t.previewItems[0];let r=a.content.token.ticker;r.length>14&&(r=r.slice(0,14)+"...");const o=`$${r} is trending!`,c=a.content.buyersYouKnow>1?`${a.content.buyersYouKnow} people you know just bought it`:"Someone you know just bought it",d=l.useCallback(()=>{!s&&i&&i({path:"Token",params:{chain:a.content.token.chain,ca:a.content.token.ca,via:"notification_trending_inapp"}})},[s,i,a]);return e.jsxs(x,{notificationGroup:t,onClick:d,children:[e.jsx(T,{children:e.jsx(Ka,{iconUrl:a.content.token.imageUrl,symbol:a.content.token.ticker,diameter:48,imageBordered:!0})}),e.jsx("div",{className:"w-full min-w-0",children:e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsx("div",{className:"text-base font-semibold text-default",children:o}),e.jsx("div",{className:"text-muted",children:c})]})})]})});Ls.displayName="TrendingTokenNotificationGroup";const Bs=l.memo(({group:t})=>{const s=ne(),n=l.useMemo(()=>{for(const r of t.previewItems)if("fromUser"in r.content&&r.content.fromUser)return r.content.fromUser;return null},[t.previewItems]),i=l.useCallback(()=>{const r=_a(t.previewItems[0].content.token.chain);if(!r)return;const o=Za({type:"tx",chainId:r.id.toString(),hash:t.previewItems[0].content.hash});o&&s({to:o,openInNewTab:!0})},[t.previewItems,s]),a=l.useMemo(()=>{const r=t.previewItems[0];switch(r.content.type){case"mint":return e.jsxs("div",{children:[e.jsx("span",{children:"You minted "}),e.jsx("span",{className:"font-semibold",children:r.content.token.name})]});case"receive":{const o=r.content.fromAddress.substring(0,6)+"..."+r.content.fromAddress.substring(r.content.fromAddress.length-4),c=parseFloat(Ct(BigInt(r.content.amount),r.content.token.decimals??18));let d=c.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2});return c<.01?d=c.toFixed(6):c<1?d=c.toFixed(4):c<100&&(d=c.toFixed(2)),e.jsxs("div",{children:[e.jsx("span",{children:n?.username??o}),e.jsx("span",{children:" sent you "}),e.jsx("span",{className:"font-semibold",children:`${d} ${r.content.token.ticker.slice(0,10)}${r.content.token.ticker.length>10?"...":""}`})]})}}},[t.previewItems,n?.username]);return e.jsxs(x,{notificationGroup:t,onClick:i,children:[e.jsx(T,{children:n?.pfp?.url?e.jsxs("div",{className:"relative",children:[e.jsx(q,{user:n,size:"md",isHighlighted:!0,hideFollowButton:!0}),e.jsx("div",{className:"absolute bottom-0 right-[-3px] flex size-[20px] items-center justify-center rounded-full border-2 border-[#F5F4FF] bg-purple-200 dark:border-[#1F182C]",children:e.jsx(Fe,{width:12,height:12})})]}):e.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-faint",children:e.jsx(Fe,{})})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex w-full flex-row items-start justify-between",children:[e.jsx("div",{className:"shrink",children:a}),e.jsx("div",{className:"text-faint",children:$(t.previewItems[0].timestamp,"floor")})]}),e.jsx("div",{className:"text-muted",children:"View funds in your Farcaster wallet"})]})]})});Bs.displayName="WalletActivityNotificationGroup";const Rs=l.memo(({notificationGroup:t})=>{const s=l.useMemo(()=>{switch(t.type){case"cast-mention":return e.jsx(yt,{notificationGroup:t});case"cast-reaction":return e.jsx(It,{notificationGroup:t});case"cast-reply":return e.jsx(Mt,{notificationGroup:t});case"follow":return e.jsx(Wt,{notificationGroup:t});case"nearby":return e.jsx(Zt,{notificationGroup:t});case"recast":return e.jsx(Jt,{notificationGroup:t});case"generic":return e.jsx(_t,{notificationGroup:t});case"audio-room-scheduled-start":return e.jsx(xs,{group:t});case"verify":return e.jsx(os,{notificationGroup:t});case"set-location":return e.jsx(ns,{notificationGroup:t});case"new-cast":return e.jsx(qt,{notificationGroup:t});case"new-cast-in-channel":return e.jsx(Xt,{notificationGroup:t});case"dormant-user-new-cast":return e.jsx(ws,{notificationGroup:t});case"cast-quote":return e.jsx(fs,{notificationGroup:t});case"channel-warning":return e.jsx(zt,{notificationGroup:t});case"trending-cast":return e.jsx($s,{notificationGroup:t});case"channel-streak":return e.jsx(js,{notificationGroup:t});
11case"channel-streak-ended":return e.jsx(ps,{notificationGroup:t});case"channel-streak-update":return e.jsx(Ns,{notificationGroup:t});case"report-action":return e.jsx(as,{notificationGroup:t});case"spammy-replies":return e.jsx(is,{notificationGroup:t});case"payment-received":return e.jsx(Qt,{notificationGroup:t});case"user-boost":return e.jsx(ls,{notificationGroup:t});case"creator-reward":return e.jsx(At,{notificationGroup:t});case"channel-role-invite":return e.jsx(Ke,{group:t});case"channel-role-accept":return e.jsx(Ut,{group:t});case"channel-pinned-cast":return e.jsx(Tt,{group:t});case"connect-account":return e.jsx(ys,{notificationGroup:t});case"frame-generic":return e.jsx(Ot,{group:t});case"mini-app":return e.jsx(ks,{group:t});case"featured-frame":return e.jsx(Et,{group:t});case"nudge-advanced-protection":return null;case"trending-follow-recommendation":return e.jsx(As,{group:t});case"wallet-activity":return e.jsx(Bs,{group:t});case"new-campaign":return e.jsx(Us,{group:t});case"farcaster-pro":return e.jsx(Rt,{group:t});case"collectible-cast-creator-bid":case"collectible-cast-bidder-outbid":case"collectible-cast-bidder-settled":case"collectible-cast-creator-settled":case"collectible-cast-bidder-time-left":case"collectible-cast-bidder-cancelled":return e.jsx(bs,{group:t});case"collectible-cast-watch-available":return e.jsx(Cs,{group:t});case"trending-token":return e.jsx(Ls,{group:t});case"token-alert":return e.jsx(Fs,{group:t});case"trader-alert":return e.jsx(Ps,{group:t});case"referral-code-claimed":return e.jsx(Gt,{notificationGroup:t});case"xp-claim-reminder":return e.jsx(ds,{notificationGroup:t});case"xp-reward-expire-soon":case"xp-reward-expire-imminent":return e.jsx(ms,{notificationGroup:t});case"were-you-referred":return e.jsx(cs,{notificationGroup:t});case"referral-reminder":return e.jsx(ts,{notificationGroup:t});case"referral-launch":return e.jsx(es,{notificationGroup:t});case"deposit-bonuses-launch":return e.jsx(Bt,{notificationGroup:t});case"deposit-bonuses-ineligible":return e.jsx(Lt,{notificationGroup:t});case"new-article":return e.jsx(Ts,{notificationGroup:t});case"swap-failed":return e.jsx(Ss,{group:t});case"limit-order-matched":return e.jsx(gs,{group:t});default:return Xa(`Unrecognized notification group type: ${t.type}`),null}},[t]);return l.useMemo(()=>e.jsx(vt,{notificationType:t.type,children:s}),[s,t.type])});Rs.displayName="NotificationGroup";const Es=({tab:t,isLinkedToUnseen:s})=>{const n=qa(),{data:i,onEndReached:a,isFetchingNextPage:r,refetch:o}=Cn({tab:t,wasPopped:n}),{resetNotificationsCount:c,resetNotificationTabUnseenStatus:d}=He(),u=gn();l.useEffect(()=>{(t==="channels"||t==="apps")&&d(t),s&&u()},[s,d,u,t]);const b=yn(t,o),v=l.useCallback(async()=>{await b(),c(),u()},[b,c,u]);xn(v);const N=l.useMemo(()=>Oe(i?.pages.flatMap(f=>f.result.notifications)||[],f=>f.id),[i]);return e.jsx(jt,{data:N,renderItem:Yn,keyExtractor:un,onEndReached:a,isFetchingNextPage:r,emptyView:e.jsx(Qa,{message:"No notifications yet."})})},Yn=({item:t})=>e.jsx(Rs,{notificationGroup:t});Es.displayName="NotificationsTab";const Ds=l.memo(({params:{tab:t},...s})=>e.jsx(st,{to:"notificationsWithTabs",params:{tab:t},searchParams:{},...s}));Ds.displayName="LinkToNotifications";const Ws=l.memo(({currentTab:t,tabs:s})=>{const{notificationsCount:n,unseenNotificationTabs:i}=He();return e.jsx(vn,{children:s.map((a,r)=>e.jsx(Ds,{title:a.name,params:{tab:r>0?a.id:void 0},children:e.jsx(Nn,{isFocused:t===a.id,notificationDot:a.id===s[0].id&&n>0||i.includes(a.id),children:a.name})},a.id))})});Ws.displayName="NotificationsHeader";const Kn=l.memo(()=>{const{notificationTabs:t}=ut();return t?e.jsx(_n,{tabs:t}):null});Kn.displayName="NotificationsPage";const _n=l.memo(({tabs:t})=>{const s=jn(),{trackEvent:n}=J(),{resetNotificationsCount:i}=He(),a=l.useRef(!1),r=t[0].id,o=l.useMemo(()=>s.tab||r,[r,s.tab]),c=l.useMemo(()=>o===r,[o,r]);return l.useEffect(()=>{n(h.ViewNotifications,{tab:o})},[n,o]),l.useEffect(()=>{a.current||(i(),a.current=!0)},[i,a]),e.jsx(fn,{meta:{title:"Farcaster / Notifications"},children:e.jsxs(Os,{children:[e.jsx(hn,{footer:e.jsx(Ws,{tabs:t,currentTab:o}),children:e.jsx(pn,{children:"Notifications"})}),e.jsx(l.Suspense,{fallback:e.jsx(Ja,{}),children:e.jsx(vt,{on:`notifications-${o}`,children:e.jsx(Es,{tab:o,isLinkedToUnseen:c})})})]})},o)});
11export{Kn as NotificationsPage};
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.