"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["7833"],{49597:function(e,t,i){(0,i(6400).createContext)(null)},31541:function(e,t,i){i.d(t,{Eb:()=>c,in:()=>_,r8:()=>d});var n=i(16584),o=i(30396),r=i(94184),l=i.n(r),a=i(11163),s=i(83234);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,n.tZ)(m,{}),[i,r]=(0,o.eJ)(e);return[i&&t,()=>{r(!1)}]}function m(){return(0,n.tZ)(c,{})}function c(e){let{className:t}=e;return(0,n.tZ)(_,{className:l()(t,"reader2-unread-dot")})}let _=(0,a.L)(s.Z.unreadDot)},74949:function(e,t,i){i.d(t,{IC:()=>eA,P_:()=>ew,Xn:()=>eZ,gG:()=>eP});var n=i(7409),o=i(99282),r=i(16584),l=i(6400),a=i(98661),s=i(30396),d=i(94184),m=i.n(d),c=i(18446),_=i.n(c),u=i(99869),p=i(48493),v=i(68494),h=i(85200),y=i(88510),g=i(2156),f=i(50049),b=i(85557),k=i(36569),Z=i(67416),w=i(71960),S=i(6967),B=i(98508),x=i(10247),I=i(84924);i(32351);var H=i(85685),C=i(58474),Y=i(19548),X=i(64719),M=i(35543),q=i(95441);i(36518);var N=i(60807),z=i(92291),P=i(5952);i(42375);var T=i(13748),E=i(93963);i(85527);var A=i(53678),R=i(16451),L=i(68833),V=i(48980),O=i(59897);i(7882);var U=i(98750),D=i(98914),W=i(60590),F=i(94874),j=i(24547),K=i(15771),G=i(80026);i(86075);var J=i(19081),$=i(36500),Q=i(84747);i(98248);var ee=i(38841);i(15186);var et=i(58175),ei=i(70379),en=i(87989),eo=i(76817);i(35449);var er=i(83010),el=i(46585),ea=i(15503);i(27744);var es=i(2009),ed=i(79567);i(81043);var em=i(65575);i(49597);var ec=i(31541);i(70293),i(91400);var e_=i(98012),eu=i(48884),ep=i(31377),ev=i(22838),eh=i(60308),ey=i(62515),eg=i(63651),ef=i(84864),eb=i(47929),ek=i(43883);function eZ(e){var t,i;let{activityResult:r,activityResultMaps:l,feedState:a,item:s,idx:d}=e,{publications:m,posts:c,users:_,comments:u,mentions:p,communityComments:v,communityPosts:h,liveStreams:y,liveStreamInvites:g,drafts:f,viralGifts:b,feedItemComments:k,mediaClips:Z}=l,w=a.comments.size?a.comments:u,S=s.comment_id||s.target_comment_id;return(0,o._)((0,n._)({},s),{idx:d,pub:s.publication_id&&m.get(s.publication_id),post:s.target_post_id&&null!==(i=null!==(t=c.get(s.target_post_id))&&void 0!==t?t:f.get(s.target_post_id))&&void 0!==i?i:null,media_clip:s.target_media_clip_id?Z.get(s.target_media_clip_id):null,recent_senders:s.recent_sender_ids&&(0,O.Z)(s.recent_sender_ids,e=>_.get(e)),comment:s.comment_id&&w.get(s.comment_id)||null,target_comment:s.target_comment_id&&w.get(s.target_comment_id)||null,target_user:s.target_user_id&&_.get(s.target_user_id)||null,mention:s.mention_id&&p.get(s.mention_id)||null,community_post:s.community_post_id&&h.get(s.community_post_id)||null,community_comment:s.community_comment_id&&v.get(s.community_comment_id)||null,target_community_post:s.target_community_post_id&&h.get(s.target_community_post_id)||null,target_community_comment:s.target_community_comment_id&&v.get(s.target_community_comment_id)||null,subscription_context:r.itemIdToSubscriptionContext[s.id],target_subscription_note:r.subscriptionNotes.find(e=>{let{publication_id:t,user_id:i}=e;return t===s.publication_id&&i===s.target_user_id}),target_pledge_note:r.pledgeNotes.find(e=>{let{publication_id:t,user_id:i}=e;return t===s.publication_id&&i===s.target_user_id}),feed_item_comment:S&&k.get(S)||null,target_live_stream:("live_stream"===s.type||"live_stream_invite"===s.type||"live_stream_scheduled"===s.type||"live_stream_scheduled_invite"===s.type)&&s.target_live_stream_id&&y.get(s.target_live_stream_id)?y.get(s.target_live_stream_id):null,target_live_stream_invite:("live_stream"===s.type||"live_stream_invite"===s.type||"live_stream_scheduled_invite"===s.type)&&s.target_live_stream_invite_id&&g.get(s.target_live_stream_invite_id)?g.get(s.target_live_stream_invite_id):null,target_live_stream_published_media_upload:function(e){var t;let{item:i,liveStreamPublishedMediaUploads:n,users:o,liveStreamInvites:r}=e;return"live_stream"===i.type&&i.target_live_stream_id?null!==(t=n.find(e=>{if(e.live_stream_id!==i.target_live_stream_id)return!1;if(i.target_live_stream_invite_id){var t,n,l;let a=o.get(null!==(l=null===(t=r.get(i.target_live_stream_invite_id))||void 0===t?void 0:t.invited_user_id)&&void 0!==l?l:0);return(null==a?void 0:null===(n=a.primary_publication)||void 0===n?void 0:n.id)===e.publication_id}return!0}))&&void 0!==t?t:n.find(e=>e.live_stream_id===i.target_live_stream_id):void 0}({item:s,liveStreamPublishedMediaUploads:r.liveStreamPublishedMediaUploads,users:_,liveStreamInvites:g}),viral_gifts:"viral_gift_granted"===s.type&&s.publication_id&&b.get(s.publication_id)?b.get(s.publication_id):null})}let ew=(0,a.memo)(e=>{let{item:t,isUnread:i,readOnly:n}=e,o=eL((0,N.aF)(),t)?eS:eB;return(0,r.tZ)(eI,{item:t,isUnread:i,readOnly:n,children:(0,r.BX)(J.tu,{gap:4,flex:"grow",minWidth:0,children:[(0,r.tZ)(eY,{namedSenders:t.recent_senders.slice(0,2),item:t}),(0,r.tZ)(o,{item:t})]})})},_()),eS=e=>{let{item:t}=e,i=t.comment||t.target_comment,n=t.feed_item_comment;if(!i||!n)return null;let o=!!t.post&&"everyone"!==t.post.write_comment_permissions,l="restack"===t.type||"restack_quote"===t.type||"note_like"===t.type;return(0,r.BX)(J.tu,{gap:12,flex:"grow",minWidth:0,children:[(0,r.tZ)(P.bN,{comment:i,item:n,paddingRight:16*!!l}),i.attachments&&i.attachments.length>0&&(0,r.tZ)("div",{className:ek.Z.attachmentContainer,children:(0,r.tZ)(z.yd,{attachments:i.attachments,onAttachmentClick:function(){let{commentId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,ea.rw)(n,"activity-page","attachment",{tabId:ev.QP.Activity,extraEventProps:{commentId:e}})},utm_content:n.entity_key})}),(0,r.BX)(J.gq,{justifyContent:l?"end":"start",style:{marginTop:l?"-24px":"0"},children:[!l&&(0,r.tZ)(E.$w,{item:n,comment:i,disableRestack:o}),(0,r.tZ)(T.U,{publication:t.pub,post:t.post,comment:i,item:n,parentItem:t})]})]})},eB=e=>{let{item:t}=e,i=function(e){var t,i,n,o,r,l,a,s,d,m,c,_,u,p,v,h,y,g,f,b,k,Z,w,S,B,x,I,H,C,Y,X,M,q;let N="",z=null===(i=e.target_comment)||void 0===i?void 0:null===(t=i.attachments)||void 0===t?void 0:t.find(e=>"post"===e.type),P=null===(o=e.target_comment)||void 0===o?void 0:null===(n=o.attachments)||void 0===n?void 0:n.find(e=>"comment"===e.type);switch(e.type){case"post_reply":case"note_reply":case"comment_reply":case"comment_mention":case"user_first_note":case"new_note":N=(null===(l=e.comment)||void 0===l?void 0:l.body)||"";break;case"comment_arr":N="".concat(e.comment_new_paid_subs_count&&e.comment_new_paid_subs_count>1?"This note generated ".concat(e.comment_new_paid_subs_count," paid subscribers"):"This note generated 1 paid subscriber").concat((null===(a=e.comment)||void 0===a?void 0:a.body)?": “".concat(e.comment.body,"”"):"");break;case"post_like":N=(null===(s=e.post)||void 0===s?void 0:s.title)||(null===(d=e.post)||void 0===d?void 0:d.description)||"";break;case"media_clip_like":N=(null===(m=e.media_clip)||void 0===m?void 0:m.title)||"";break;case"note_like":case"comment_like":case"mentioning_comment_like":case"mentioning_comment_reply":case"mentioning_comment_restack":N=(null===(c=e.target_comment)||void 0===c?void 0:c.body)||"";break;case"naked_restack_reaction":N=(null===(_=e.post)||void 0===_?void 0:_.title)||(null===(u=e.feed_item_comment)||void 0===u?void 0:u.comment.body)||"";break;case"post_mention":N=(null===(p=e.mention)||void 0===p?void 0:p.context)||(null===(v=e.post)||void 0===v?void 0:v.description)||"";break;case"restack":case"restack_quote":N="restack_quote"===e.type&&(null==z?void 0:null===(h=z.postSelection)||void 0===h?void 0:h.text)?null==z?void 0:null===(y=z.postSelection)||void 0===y?void 0:y.text:(null===(g=e.target_comment)||void 0===g?void 0:g.body)||(null==z?void 0:null===(f=z.postSelection)||void 0===f?void 0:f.text)||(null==z?void 0:null===(b=z.post)||void 0===b?void 0:b.title)||(null==P?void 0:null===(k=P.comment)||void 0===k?void 0:k.body)||(null===(Z=e.post)||void 0===Z?void 0:Z.title)||(null===(w=e.post)||void 0===w?void 0:w.description)||"";break;case"follow":{let{recent_senders:t}=e;if(t[0]){let{primary_publication:e,handle:i,bio:n}=t[0];N=e?"Writes ".concat(e.name):n||(i?"@".concat(i):"")}else N="";break}case"free_subscription":case"referred_free_subscription":case"new_profile":N=(null===(S=e.recent_senders[0])||void 0===S?void 0:S.bio)||"";break;case"community_comment_like":case"community_comment_mention":case"community_comment_quote_reply":case"community_comment_reply":case"community_post_reply":N=(null===(B=e.community_comment)||void 0===B?void 0:B.body)||"";break;case"community_post_like":N=(null===(x=e.target_community_post)||void 0===x?void 0:x.body)||"";break;case"arr_10k_milestone":case"arr_1k_milestone":case"list_100_milestone":case"list_1k_milestone":N="Congrats! To celebrate this milestone, we’ve created some custom images for you to share on other social networks. ";break;case"viral_post":N="Your post has received a lot of traffic over the last 24 hours";break;case"share_handle":N="Sharing your handle on Twitter will let your friends find you on Substack";break;case"paid_subscription":N=(null===(I=e.target_subscription_note)||void 0===I?void 0:I.note)||"";break;case"pledged_subscription":N=(null===(H=e.target_pledge_note)||void 0===H?void 0:H.note)||"";break;case"live_stream":N=(null===(C=e.target_live_stream)||void 0===C?void 0:C.title)||"";break;case"live_stream_scheduled":N=(null===(Y=e.target_live_stream)||void 0===Y?void 0:Y.title)?"".concat(null===(X=e.target_live_stream)||void 0===X?void 0:X.title," is happening ").concat((0,e_.Z)(e.target_live_stream.scheduled_at).format("MMM D [at] hh:mm a")):"";break;case"live_stream_scheduled_invite":N=e.target_live_stream?(0,e_.Z)(e.target_live_stream.scheduled_at).isSame((0,e_.Z)(),"day")?"Happening at ".concat((0,e_.Z)(e.target_live_stream.scheduled_at).format("hh:mm a")):(0,e_.Z)(e.target_live_stream.scheduled_at).isSame((0,e_.Z)().add(1,"day"),"day")?"Happening tomorrow at ".concat((0,e_.Z)(e.target_live_stream.scheduled_at).format("hh:mm a")):"Happening ".concat((0,e_.Z)(e.target_live_stream.scheduled_at).format("MMM D [at] hh:mm a")):"";break;case"post_shareable_assets_ready":N="We've generated several clips for your latest video";break;case"viral_gift_granted":N=(null===(q=e.viral_gifts)||void 0===q?void 0:null===(M=q.unsent)||void 0===M?void 0:M.length)?"You have new paid subscriptions to send friends":"You have sent all your paid subscriptions to friends"}return(0,ef.truncateWords)(N,300,{quotationMarks:"restack_quote"===e.type&&!!(null==z?void 0:null===(r=z.postSelection)||void 0===r?void 0:r.text)})}(t);if(!i)return null;let n=t.target_post_id&&t.post&&t.pub&&["post_like","media_clip_like","restack","restack_quote"].includes(t.type);return(0,r.BX)(r.HY,{children:[(0,r.tZ)(et.xv.B3,{as:"p",className:ek.Z.contentPreview,color:"secondary",style:{paddingRight:20*!!n},children:i}),n&&(0,r.tZ)(J.gq,{justifyContent:"end",style:{marginTop:"-24px"},children:(0,r.tZ)(ex,{item:t})})]})};function ex(e){let{item:t}=e,i=(0,ei.pm)(),l=(0,N.aF)(),{iString:s}=(0,q.M1)(),{pub:d,post:m}=t,[c,_]=(0,a.useState)(!1),[y,g]=(0,a.useState)(!1),f=m?(0,ep.getPostAuthor)(d,m):null,b=m&&l&&l.id===(null==f?void 0:f.id),k="/api/v1/notification_settings/post/".concat(null==m?void 0:m.id,"/mute");(0,a.useEffect)(()=>{let e=async()=>{g(!!await (0,V.rd)(k,{method:"GET"}))};b&&c&&e()},[b,c,k]);let Z=async e=>{let t;switch(e){case"1hour":t=1;break;case"8hours":t=8;break;case"24hours":t=24}let l=t?{expires_at:(0,e_.Z)().add(t,"hour").toISOString()}:{};await (0,V.rd)(k,{method:"POST",json:l}),g(!0),i.popToast(e=>(0,r.tZ)(ei.FN,(0,o._)((0,n._)({},e),{text:s("Paused notifications"),Icon:p.Z})))},w=async()=>{await (0,V.rd)(k,{method:"DELETE"}),g(!1),i.popToast(e=>(0,r.tZ)(ei.FN,(0,o._)((0,n._)({},e),{text:s("Unpaused notifications"),Icon:v.Z})))},S=[(0,r.tZ)(Q.u,{leading:(0,r.tZ)(u.Z,{}),onClick:()=>{if(!m)return;let e=(0,eg.mx9)(d,m);(0,D.vQ)(e),i.popToast(e=>(0,r.tZ)(ei.FN,(0,o._)((0,n._)({},e),{text:s("Copied link to clipboard"),Icon:u.Z})))},children:s("Copy link")})].filter(Boolean),B=[b&&(y?(0,r.tZ)(el.WS,{onClick:w,customLabel:s("Unpause notifications")}):(0,r.tZ)(el.KV,{onMute:Z,customLabel:s("Pause notifications")}))].filter(Boolean),x=[0!==S.length&&S,0!==B.length&&(0,r.tZ)($.xw,{children:B})];return 0===x.length?null:(0,r.tZ)("div",{style:{position:"relative"},children:(0,r.tZ)(Q.M,{onOpen:()=>{_(!0)},trigger:(0,r.tZ)(J.hs,{className:ek.Z.moreButtonContainer,maxHeight:360,children:(0,r.tZ)(K.hU,{priority:"quaternary",size:"sm",className:ek.Z.moreButton,"aria-label":s("More options"),children:(0,r.tZ)(h.Z,{size:16})})}),children:x})})}function eI(e){var t;let{item:i,isUnread:l,children:a,readOnly:d}=e,c=(0,er.n)(),[,_]=(0,ec.r8)(!!l,(0,r.tZ)(ec.Eb,{className:ek.Z.unreadBadge})),u=null!==(t=i.target_comment)&&void 0!==t?t:i.comment,p=(0,s.sO)(null);return(0,U.UM)(p,()=>{var e,t,o;return c(L.FP.ACTIVITY_ITEM_VIEWED,(0,n._)({type:i.type,publication_id:i.publication_id,activity_item_id:i.id,position:i.idx,comment_type:null==u?void 0:u.post_id?"post":"note",is_unread:l,comment_id:(null===(e=i.target_comment)||void 0===e?void 0:e.id)||(null===(t=i.comment)||void 0===t?void 0:t.id),community_comment_id:i.community_comment_id,community_post_id:i.community_post_id,post_id:null===(o=i.post)||void 0===o?void 0:o.id,user_id:i.target_user_id},i.trackingParams))},{threshold:.2}),(0,r.tZ)(eH,{item:i,children:(0,r.tZ)(em.Uj,{ref:p,linkClassName:m()(ek.Z.notificationLink,l&&ek.Z.unread),isPadded:!1,onClick:e=>{c(L.FP.ACTIVITY_ITEM_TAPPED,(0,n._)({type:i.type,position:i.idx,publication_id:i.publication_id,activity_item_id:i.id,comment_type:null==u?void 0:u.post_id?"post":"note",is_unread:l},i.trackingParams));let t=e.composedPath().some(e=>e instanceof HTMLAnchorElement);if(!e.defaultPrevented&&!t){d||_();let t=(0,eg.n1t)(function(e){var t,i,r,l,a,s,d,m,c,_,u,p,v,h,y,g;switch(e.type){case"post_reply":return(0,eg.uRy)(e.pub,e.post,{commentId:e.comment_id});case"post_like":case"post_mention":return(0,eg.uRy)(e.pub,e.post);case"media_clip_like":if(e.media_clip&&(null===(i=e.post)||void 0===i?void 0:null===(t=i.publishedBylines)||void 0===t?void 0:t.find(t=>t.id===e.user_id)))return(0,eg.k0y)(e.media_clip,null===(r=e.post)||void 0===r?void 0:r.publishedBylines.find(t=>t.id===e.user_id),{noBase:es.L});break;case"note_reply":case"comment_reply":if((null!==(l=e.sender_count)&&void 0!==l?l:0)>1&&e.target_comment_id&&e.target_comment&&null==e.target_comment.post_id){return g=e.target_comment_id,"/activity/replies/".concat(g)}if(e.comment&&null==e.comment.post_id)return(0,eg.Sgq)(e.comment);return(0,eh.Wnz)(e.pub,e.post,e.comment,{});case"note_like":case"comment_like":if(e.target_comment&&!e.target_comment.post_id)return(0,eg.Sgq)(e.target_comment);return(0,eg.uRy)(e.pub,e.post,{commentId:e.target_comment_id});case"naked_restack_reaction":if(e.feed_item_comment)return(0,eg.Sgq)(e.feed_item_comment.comment);if(e.target_comment)return(0,eg.Sgq)(e.target_comment);return(0,eg.uRy)(void 0,e.post);case"restack":if(e.target_comment&&!e.target_comment.post_id)return(0,eg.Sgq)(e.target_comment);return(0,eg.uRy)(e.pub,e.post,{commentId:e.target_comment_id,comments:!!e.target_comment_id});case"mentioning_comment_like":case"mentioning_comment_reply":case"mentioning_comment_restack":if(e.target_comment)return(0,eg.Sgq)(e.target_comment);break;case"restack_quote":if(e.target_comment)return(0,eg.Sgq)((0,o._)((0,n._)({},e.target_comment),{name:null===(a=e.target_user)||void 0===a?void 0:a.name}));break;case"free_subscription":case"follow":case"new_profile":return(0,eg.NNq)((null===(s=e.target_user)||void 0===s?void 0:s.name)&&e.target_user||ez(e)||e.pub);case"referred_free_subscription":{let t=ez(e);return(null==t?void 0:t.name)?(0,eg.NNq)(t):(0,eg.SVA)(e.pub)}case"comment_mention":case"user_first_note":case"new_note":case"comment_arr":if(e.comment)return(0,eg.Sgq)(e.comment);break;case"community_comment_quote_reply":case"community_comment_reply":case"community_comment_mention":case"community_comment_like":case"community_post_reply":return(0,eg.xC8)({pubId:e.publication_id,postId:e.target_community_post_id,commentId:e.target_community_comment_id,params:{targetReplyId:e.community_comment_id,showTarget:!0}});case"community_post_like":return(0,eg.xC8)({pubId:e.publication_id,postId:e.target_community_post_id});case"viral_post":if(e.post)return(0,eg.cwg)(e.pub,e.post.id,{addBase:!0});break;case"share_handle":{if(!e.target_user)return"";let t=(0,eg.NNq)(e.target_user,{utm_source:"share_handle"}),i=Math.ceil(6*Math.random()),n="".concat("Substack".slice(0,i),"*").concat("Substack".slice(i+1)),o=null===(d=e.target_user)||void 0===d?void 0:d.handle;return(0,eh.LaP)({text:"You can find me on ".concat(n).concat(o?" at @".concat(o):""),url:t})}case"live_stream":if(e.target_live_stream_published_media_upload)return(0,eh.K8_)(e.target_live_stream_published_media_upload.publication_subdomain,e.target_live_stream_published_media_upload.post_slug,{params:{utm_source:eb.b3.activityItem}});if(!(null===(m=e.target_live_stream)||void 0===m?void 0:m.id))break;return(0,D.K1)()?(0,eg.bHR)({liveStreamId:null===(c=e.target_live_stream)||void 0===c?void 0:c.id,utm_source:eb.b3.activityItem,params:{source:"notification"}}):(0,eg.UDR)({liveStreamId:null===(_=e.target_live_stream)||void 0===_?void 0:_.id,utm_source:eb.b3.activityItem,noBase:!0});case"live_stream_scheduled":case"live_stream_scheduled_invite":if(!(null===(u=e.target_live_stream)||void 0===u?void 0:u.id))break;return(0,eg.bHR)({liveStreamId:null===(p=e.target_live_stream)||void 0===p?void 0:p.id,utm_source:eb.b3.activityItem});case"post_shareable_assets_ready":return(0,eg.FKc)({post_id:e.target_post_id,publication_subdomain:null===(v=e.pub)||void 0===v?void 0:v.subdomain});case"viral_gift_granted":if(null===(y=e.viral_gifts)||void 0===y?void 0:null===(h=y.unsent)||void 0===h?void 0:h.length)return(0,eg.b1P)({pub:e.pub,params:{utm_source:eb.b3.activityItem}})}return""}(i),{utm_source:eb.b3.activityItem});(0,D.uX)(t,{event:e,local_navigation:window.location.hostname===eg.pvz.hostname||t.startsWith("/live-stream"),state:{showBack:!0}})}},children:(0,r.BX)(J.hs,{gap:8,className:ek.Z.container,flex:"grow",minWidth:0,children:[(0,r.tZ)(eT,{item:i}),a]})})})}function eH(e){let{item:t,children:i}=e,n=1===t.recent_senders.length?t.recent_senders[0]:null,o=(0,Y.gc)(null==n?void 0:n.id),[l,s]=(0,a.useState)(!1);return!l&&o?(0,r.tZ)(J.tu,{paddingY:16,children:(0,r.BX)(G.M5,{radius:"md",border:"detail",padding:20,color:"secondary",cursor:"pointer",onClick:()=>s(!0),children:[(0,r.BX)(et.xv.B4,{minWidth:0,flex:"grow",children:["This activity item concerns someone"," ","muting"===o?"you’ve muted":"blocking"===o?"you’ve blocked":"who has blocked you","."]}),(0,r.tZ)(et.xv.B4,{weight:"semibold",decoration:"hover-underline",children:"Show activity"})]})}):(0,r.tZ)(r.HY,{children:i})}function eC(e){var t,i,n,o;let{item:l}=e,{iString:a}=(0,q.M1)();if(["arr_10k_milestone","arr_1k_milestone","list_100_milestone","list_1k_milestone","viral_gift_granted"].includes(l.type))return(0,r.tZ)(r.HY,{children:(0,r.tZ)(A.hh,{href:(0,eg.SVA)(l.pub),weight:"medium",ellipsis:!1,children:l.pub.name})});if("viral_post"===l.type&&l.post)return(0,r.tZ)(r.HY,{children:(0,r.tZ)(A.hh,{href:(0,eg.cwg)(l.pub,l.post.id,{addBase:!0}),weight:"medium",ellipsis:!1,children:l.post.title})});if(["share_handle"].includes(l.type)||"naked_restack_reaction"===l.type&&!l.sender_count)return null;if("post_shareable_assets_ready"===l.type){let e=(null===(t=l.post)||void 0===t?void 0:t.draft_title)||(null===(i=l.post)||void 0===i?void 0:i.title)||"Untitled";return(0,r.tZ)("span",{style:{fontWeight:"bold"},children:e})}if("post_mention"===l.type&&l.pub&&0===l.recent_senders.length)return(0,r.tZ)("span",{style:{fontWeight:"bold"},children:l.pub.name});let s=l.recent_senders,d=(0,eo.Q)(s,l);if("comment_arr"===l.type){let e=d.filter(e=>(0,eo.T)(e))[0];if(l.user_id===e.id)return(0,r.tZ)(r.HY,{children:"Your"})}let m=(e,t)=>"comment_arr"===t.type?"".concat(e.name,"'s"):e.name;return"live_stream_scheduled"===l.type&&l.target_user_id===l.user_id?(0,r.tZ)(r.HY,{children:(0,r.tZ)(A.hh,{href:(null===(n=l.target_live_stream)||void 0===n?void 0:n.id)?(0,eg.bHR)({liveStreamId:null===(o=l.target_live_stream)||void 0===o?void 0:o.id,utm_source:eb.b3.activityItem}):"",weight:"medium",ellipsis:!1,children:a("Your live video is scheduled")})}):(0,r.tZ)(r.HY,{children:d.length>0?d.map(e=>(0,eo.T)(e)?(0,r.BX)(r.HY,{children:[(0,r.tZ)(H.ProfileHoverCard,{subject:e,utmSource:"notification",children:(0,r.tZ)(A.hh,{weight:"medium",href:(0,eg.NNq)(e),showBack:!0,children:m(e,l)})}),!!e.bestseller_tier&&(0,r.BX)(r.HY,{children:[" ",(0,r.tZ)(en.UserBadge,{className:ek.Z.userBadge,inline:!0,size:"sm",tier:e.bestseller_tier,userId:e.id})]})]}):e.bold?(0,r.tZ)(et.xv.B3,{weight:"medium",as:"span",children:e.value}):e.value):"Someone "})}function eY(e){var t,i,l,a,s,d,m,c,_;let{namedSenders:u,item:p}=e;return(0,r.BX)(J.tu,{className:ek.Z.notificationBody,alignItems:"start",gap:8,flex:"grow",children:[(0,r.BX)(J.hs,{alignItems:"center",justifyContent:"space-between",flex:"grow",alignSelf:"stretch",gap:8,children:["viral_gift_granted"!==p.type&&(null===(t=p.recent_senders.filter(e=>null==e?void 0:e.name))||void 0===t?void 0:t.length)?(0,r.tZ)(j.H,{users:p.recent_senders,max:6,total:null!==(_=p.sender_count)&&void 0!==_?_:void 0,size:32,renderAvatar:e=>(0,r.tZ)(F.xV,(0,o._)((0,n._)({},e),{noBase:es.L,utmSource:"notification"}))}):(null===(i=p.pub)||void 0===i?void 0:i.logo_url)?(0,r.tZ)(ee.wk,{pub:p.pub,size:32}):(null===(l=p.feed_item_comment)||void 0===l?void 0:l.comment)?(0,r.tZ)(j.H,{users:[{id:null===(a=p.feed_item_comment)||void 0===a?void 0:a.comment.id,name:(null===(s=p.feed_item_comment)||void 0===s?void 0:s.comment.name)||"",photo_url:null===(d=p.feed_item_comment)||void 0===d?void 0:d.comment.photo_url}],max:6,size:32,renderAvatar:e=>(0,r.tZ)(F.xV,(0,o._)((0,n._)({},e),{noBase:es.L,utmSource:"notification"}))}):p.target_comment?(0,r.tZ)(j.H,{users:[{id:p.target_comment.id,name:p.target_comment.name||"",photo_url:p.target_comment.photo_url}],max:6,size:32,renderAvatar:e=>(0,r.tZ)(F.xV,(0,o._)((0,n._)({},e),{noBase:es.L,utmSource:"notification"}))}):(null===(m=p.post)||void 0===m?void 0:m.publishedBylines)?(0,r.tZ)(j.H,{users:null===(c=p.post)||void 0===c?void 0:c.publishedBylines,max:6,size:32,renderAvatar:e=>(0,r.tZ)(F.xV,(0,o._)((0,n._)({},e),{noBase:es.L,utmSource:"notification"}))}):null,(0,r.tZ)(eX,{item:p,namedSenders:u})]}),(0,r.tZ)(J.tu,{flex:"grow",children:(0,r.BX)(et.xv.B3,{as:"span",color:"primary",children:[(0,r.tZ)(eC,{item:p})," ",(0,r.tZ)(et.xv,{as:"span",paddingRight:8,children:function(e,t){var i,n,o,l,a,s,d,m,c,_,u,p,v,h,y,g,f,b,k,Z,w,S,B,x,I,H;let C=(null===(i=e.post)||void 0===i?void 0:i.title)?(0,r.BX)(r.HY,{children:[" ",(0,r.tZ)(A.hh,{href:(0,eg.uRy)(e.pub,e.post),weight:"medium",ellipsis:!1,children:e.post.title})]}):null,Y=null===(o=e.post)||void 0===o?void 0:null===(n=o.publishedBylines)||void 0===n?void 0:n.find(t=>t.id===e.user_id),X=(null===(l=e.media_clip)||void 0===l?void 0:l.title)&&Y&&e.media_clip?(0,r.BX)(r.HY,{children:[" ",(0,r.tZ)(A.hh,{href:(0,eg.k0y)(e.media_clip,Y,{noBase:es.L}),weight:"medium",ellipsis:!1,children:e.media_clip.title})]}):null,M=C?"comment":(null===(a=e.comment)||void 0===a?void 0:a.ancestor_path)?"reply":"note";if("comment_reply"===e.type)switch(e.comment_audience){case"post_author":case"publication_author":return(0,r.BX)(r.HY,{children:["replied to a comment",C&&[" on ",C]]});case"comment_sibling":return(0,r.BX)(r.HY,{children:["also commented",C&&[" on ",C]]});default:return(0,r.BX)(r.HY,{children:["replied to your ",(null===(s=e.comment)||void 0===s?void 0:s.post_id)?"comment":"note",C&&[" on ",C]]})}else if("post_reply"===e.type)return(0,r.BX)(r.HY,{children:["commented on your ",C?["post ",C]:"note"]});else if("post_like"===e.type)return(0,r.BX)(r.HY,{children:["liked your ",C?["post ",C]:"note"]});else if("media_clip_like"===e.type)return(0,r.BX)(r.HY,{children:["liked your ",X?["clip ",X]:"note"]});else if("comment_like"===e.type)return(0,r.BX)(r.HY,{children:["liked your ",C?["comment on ",C]:M]});else if("comment_mention"===e.type)return(0,r.BX)(r.HY,{children:["mentioned you in a"," ",C?["comment on ",C]:M]});else if("post_mention"===e.type){if((t||e.pub)&&(null===(d=e.mention)||void 0===d?void 0:d.mentioned_type)==="user")return(0,r.BX)(r.HY,{children:["mentioned you",C&&[" in ",C]]});if((t||e.pub)&&(null===(m=e.mention)||void 0===m?void 0:m.mentioned_type)==="pub")return(0,r.BX)(r.HY,{children:["mentioned your publication",C&&[" in ",C]]});if(!t&&(null===(c=e.mention)||void 0===c?void 0:c.mentioned_type)==="user")return(0,r.BX)(r.HY,{children:["You were mentioned",C&&[" in ",C]]});else if(!t&&(null===(_=e.mention)||void 0===_?void 0:_.mentioned_type)==="pub")return(0,r.BX)(r.HY,{children:["Your publication was mentioned",C&&[" in ",C]]})}else if("restack"===e.type||"restack_quote"===e.type){let t="restack_quote"===e.type&&(null===(p=e.target_comment)||void 0===p?void 0:null===(u=p.attachments)||void 0===u?void 0:u.find(e=>"post"===e.type));return t&&(null==t?void 0:null===(v=t.postSelection)||void 0===v?void 0:v.text)?(0,r.BX)(r.HY,{children:["quoted your post ",C]}):"restack"===e.type&&e.target_comment?(0,r.BX)(r.HY,{children:["restacked your"," ",e.target_comment.post_id?"comment":e.target_comment.ancestor_path?"reply":"note",C&&[" on ",C]]}):(0,r.BX)(r.HY,{children:["restacked your ",C?["post ",C]:"note"]})}else if("free_subscription"===e.type)return(0,r.BX)(r.HY,{children:["subscribed to"," ",(0,r.tZ)(A.hh,{href:(0,eg.SVA)(e.pub),weight:"medium",ellipsis:!1,children:e.pub.name})]});else if("follow"===e.type)return(0,r.BX)(r.HY,{children:["followed you",e.pub?(0,r.tZ)(r.HY,{children:(0,r.tZ)(A.hh,{href:(null===(h=e.pub.author)||void 0===h?void 0:h.name)||e.pub.author_name?(0,eg.GR3)((null===(y=e.pub.author)||void 0===y?void 0:y.id)||e.pub.author_id,(null===(g=e.pub.author)||void 0===g?void 0:g.name)||e.pub.author_name):(0,eg.SVA)(e.pub),weight:"medium",ellipsis:!1,children:(null===(f=e.pub.author)||void 0===f?void 0:f.name)||e.pub.author_name||e.pub.name})}):""]});else if("user_first_note"===e.type)return"posted their first note";else if("new_note"===e.type)return"posted a note";else if("new_profile"===e.type)return"is on Substack";else if("community_comment_like"===e.type)return"reacted to your reply";else if("community_post_like"===e.type)return"reacted to your thread";else if("community_comment_quote_reply"===e.type||"community_comment_reply"===e.type)return"replied to your message";else if("community_post_reply"===e.type)return"replied to your thread";else if("community_comment_mention"===e.type)return"mentioned you in a reply";else if("note_like"===e.type)return"liked your note";else if("note_reply"===e.type)return"replied to your note";else if("referred_free_subscription"===e.type)return(0,r.BX)(r.HY,{children:["subscribed to"," ",(0,r.tZ)(A.hh,{href:(0,eg.SVA)(e.pub),weight:"medium",ellipsis:!1,children:e.pub.name})," ","because of your share"]});else if("list_100_milestone"===e.type)return"has reached 100 subscribers";else if("list_1k_milestone"===e.type)return"has reached 1,000 subscribers";else if("arr_1k_milestone"===e.type)return"has reached $1,000 in annual revenue";else if("arr_10k_milestone"===e.type)return"has reached $10,000 in annual revenue";else if("mentioning_comment_like"===e.type)return"liked a note you were mentioned in";else if("mentioning_comment_reply"===e.type)return"replied to a note you were mentioned in";else if("mentioning_comment_restack"===e.type)return"restacked a note you were mentioned in";else if("viral_post"===e.type)return"is getting a lot of traffic";else if("share_handle"===e.type)return"Share your handle on Twitter";else if("naked_restack_reaction"===e.type)return e.sender_count?"liked your ".concat(e.feed_item_comment||e.target_comment?"note":"post"," restack"):"".concat(e.feed_item_comment?e.feed_item_comment.comment.reaction_count:e.target_comment?e.target_comment.reaction_count:null===(b=e.post)||void 0===b?void 0:b.reaction_count," people liked the ").concat(e.feed_item_comment||e.target_comment?"note":"post"," that you restacked");else if("paid_subscription"===e.type)return(0,r.BX)(r.HY,{children:["became a paying subscriber to"," ",(0,r.tZ)(A.hh,{href:(0,eg.SVA)(e.pub),weight:"medium",ellipsis:!1,children:e.pub.name})]});else if("pledged_subscription"===e.type)return(0,r.BX)(r.HY,{children:["pledged a subscription to"," ",(0,r.tZ)(A.hh,{href:(0,eg.SVA)(e.pub),weight:"medium",ellipsis:!1,children:e.pub.name})]});else if("publication_recommendation"===e.type)return(0,r.BX)(r.HY,{children:["recommended"," ",(0,r.tZ)(A.hh,{href:(0,eg.SVA)(e.pub),weight:"medium",ellipsis:!1,children:e.pub.name})]});else if("live_stream"===e.type){let t=(null===(k=e.target_live_stream)||void 0===k?void 0:k.status)==="active";return(null===(Z=e.target_live_stream)||void 0===Z?void 0:Z.user_is_paywalled)?(null!==(w=e.sender_count)&&void 0!==w?w:0)>1?t?"are live on Substack with paid subscribers":"were live on Substack with paid subscribers":t?"is live on Substack with paid subscribers":"was live on Substack with paid subscribers":(null!==(S=e.sender_count)&&void 0!==S?S:0)>1?t?"are live on Substack":"were live on Substack":t?"is live on Substack":"was live on Substack"}else if("live_stream_scheduled"===e.type){let t=(null===(B=e.target_live_stream)||void 0===B?void 0:B.status)==="active",i=(null===(x=e.target_live_stream)||void 0===x?void 0:x.status)==="scheduled";return e.target_user_id===e.user_id?null:(null!==(I=e.sender_count)&&void 0!==I?I:0)>1?i?"scheduled a live video":t?"are live on Substack":"were live on Substack":i?"scheduled a live video":t?"is live on Substack":"was live on Substack"}else if("live_stream_scheduled_invite"===e.type)return"invited you to go live";else if("live_stream_invite"===e.type){let t=(null===(H=e.target_live_stream)||void 0===H?void 0:H.status)==="active";return"".concat(t?"is inviting":"invited"," you to a live video on Substack")}else if("comment_arr"===e.type)return"note made you $".concat(e.comment_arr_usd||100);return""}(p,!!u[0])}),(0,r.tZ)(eM,{item:p})]})})]})}function eX(e){var t,i,n,o,l,a,s,d,m,c;let{item:_,namedSenders:u}=e,{iString:p}=(0,q.M1)(),v=(0,ed.k)(_.target_live_stream),h=(0,M.Xe)(),y=u[0],g=(0,D.K1)(),f=null!==(l=_.cta)&&void 0!==l?l:null,b=null!==(a=null==f?void 0:f.priority)&&void 0!==a?a:"secondary";return(null==f?void 0:f.type)==="message"&&(null==y?void 0:y.name)?(0,r.tZ)(K.zx,{priority:b,size:"sm",href:(0,ey.gp)({urlParams:{user:(0,eg.JlE)({userId:y.id,userName:y.name})}}),children:p("Message")}):(null==f?void 0:f.type)==="follow"?h.data?(0,r.tZ)(eq,{user:y,text:p("follow"===_.type?"Follow back":"Follow")}):null:(null==f?void 0:f.type)==="share"?(0,r.tZ)(eN,{item:_,pub:_.pub,priority:b}):(null==f?void 0:f.type)==="subscribe"?(0,r.tZ)(K.zx,{priority:"secondary-outline",size:"sm",onClick:()=>{(0,D.uX)((0,eg.W1P)(_.pub,{addBase:!0,params:{utm_source:"recommendation_notification"}}))},children:p("Subscribe")}):(null==f?void 0:f.type)==="live-stream"&&_.target_live_stream?(0,r.tZ)(K.zx,{priority:b,size:"sm",href:_.target_live_stream_published_media_upload?(0,eh.K8_)(_.target_live_stream_published_media_upload.publication_subdomain,_.target_live_stream_published_media_upload.post_slug,{params:{utm_source:eb.b3.activityItem}}):g?(0,eg.bHR)({liveStreamId:null===(s=_.target_live_stream)||void 0===s?void 0:s.id,utm_source:eb.b3.activityItem,params:{source:"notification"}}):(0,eg.UDR)({liveStreamId:null===(d=_.target_live_stream)||void 0===d?void 0:d.id,utm_source:eb.b3.activityItem,noBase:!0}),localNavigation:!_.target_live_stream_published_media_upload,children:p("Watch now")}):(null==f?void 0:f.type)==="start-livestream-test-run"&&(null===(t=_.target_live_stream)||void 0===t?void 0:t.id)?(0,r.tZ)(K.zx,{priority:b,size:"sm",href:(0,eg.bHR)({liveStreamId:null===(m=_.target_live_stream)||void 0===m?void 0:m.id,utm_source:eb.b3.activityItem,params:{show_test_run:"true"}}),onClick:()=>{var e;(0,L.j)(L.FP.LIVE_STREAM_TEST_RUN_CLICKED,{liveStreamId:null===(e=_.target_live_stream)||void 0===e?void 0:e.id,liveStreamInviteId:_.target_live_stream_invite_id,surface:"live-stream-activity-item"})},children:p("Start test run")}):(null==f?void 0:f.type)==="add-livestream-to-calendar"?(0,r.tZ)(W.m,{priority:b,size:"sm",handleClick:e=>{var t;(0,L.j)(L.FP.ADD_TO_CALENDAR_CLICKED,{liveStreamId:null===(t=_.target_live_stream)||void 0===t?void 0:t.id,surface:"live-stream-activity-item",type:e})},event:v,menuProps:{onOpen:()=>{(0,V.rd)("/api/v1/live_stream/".concat(_.target_live_stream_id,"/rsvp"),{method:"PUT"})}}}):(null==f?void 0:f.type)==="live-stream-invite"?(0,r.tZ)(K.zx,{priority:b,size:"sm",onClick:()=>{(0,V.rd)("/api/v1/live_stream/".concat(_.target_live_stream_id,"/invite/").concat(_.target_live_stream_invite_id,"/accept"),{method:"PUT",json:{sendEmails:!0}}).then(e=>{alert(JSON.stringify(e))}).catch(e=>{alert(JSON.stringify(e))})},children:p("Accept invite")}):(null==f?void 0:f.type)==="post-shareable-assets"?(0,r.tZ)(K.zx,{priority:b,size:"sm",href:(0,eg.FKc)({post_id:_.target_post_id,publication_subdomain:null===(c=_.pub)||void 0===c?void 0:c.subdomain}),children:p("Open Draft")}):(null==f?void 0:f.type)==="viral-gift-granted"?(0,r.tZ)(K.zx,{priority:b,size:"sm",href:(0,eg.b1P)({pub:_.pub,params:{utm_source:eb.b3.activityItem}}),children:p("Send gifts")}):(null==f?void 0:f.type)==="download-clip"&&(null==f?void 0:f.deepLink)&&_.pub&&(null===(o=_.media_clip)||void 0===o?void 0:null===(n=o.assets)||void 0===n?void 0:null===(i=n[0])||void 0===i?void 0:i.media_upload_id)?(0,r.tZ)(K.zx,{priority:b,size:"sm",onClick:()=>{var e,t,i;let n=null===(i=_.media_clip)||void 0===i?void 0:null===(t=i.assets)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.media_upload_id;if(!n)return;let o=(0,eh.Cf3)(_.pub,n),r=document.createElement("a");r.href=o,r.download="",document.body.appendChild(r),r.click(),document.body.removeChild(r)},children:p("Download")}):null}function eM(e){let{item:t}=e;return(0,r.tZ)(R.Ku,{timestamp:t.updated_at})}function eq(e){let{user:t,text:i}=e,{iString:n}=(0,q.M1)(),{isFollowing:o,toggle:l}=(0,M.Sv)(t,"notifications");return(0,a.useMemo)(()=>o,[])?null:(0,r.tZ)(K.zx,{priority:o?"secondary-outline":"primary",size:"sm",onClick:e=>{e.preventDefault(),l()},children:o?n("Following"):i})}function eN(e){let{item:t,pub:i,priority:n}=e,{iString:o}=(0,q.M1)(),[s,d]=(0,a.useState)(!1),m=(0,X.Cq)();return(0,a.useEffect)(()=>{if(s){let e=document.createElement("div");(0,l.render)((0,r.tZ)(()=>{let[n,o]=(0,a.useState)(s);return(0,r.tZ)(q._7,{language:(0,eu.G3)({pub:i}),children:(0,r.tZ)(X.UN,{value:m,children:(0,r.tZ)(C.iL,{isOpen:n,setOpen:t=>{t||e.remove(),o(t),d(t)},pub:i,item:t})})})},{}),e)}},[s]),(0,r.tZ)(K.zx,{priority:n,size:"sm",onClick:e=>{e.preventDefault(),d(!0)},children:o("Share")})}function ez(e){var t;return null!==(t=e.recent_senders.find(e=>e.name))&&void 0!==t?t:null}let eP=new Set(["comment_like","comment_mention","comment_reply","community_comment_like","community_comment_mention","community_comment_quote_reply","community_comment_reply","community_post_like","community_post_reply","free_subscription","new_note","new_profile","note_like","note_reply","comment_arr","post_like","post_mention","post_reply","naked_restack_reaction","restack_quote","restack","user_first_note","referred_free_subscription","follow","arr_10k_milestone","arr_1k_milestone","list_100_milestone","list_1k_milestone","viral_post","paid_subscription","pledged_subscription","share_handle","publication_recommendation","live_stream","live_stream_scheduled","live_stream_scheduled_invite","mentioning_comment_like","mentioning_comment_reply","mentioning_comment_restack","post_shareable_assets_ready","viral_gift_granted","media_clip_like"]);function eT(e){let{item:t}=e;return(0,r.tZ)(eE,{type:function(e){let t;if(["post_like","comment_like","community_post_like","community_comment_like","note_like","naked_restack_reaction","mentioning_comment_like"].includes(e.type))t="like";else if(["restack","restack_quote","mentioning_comment_restack"].includes(e.type)){var i,n,o;let r="restack_quote"===e.type&&(null===(n=e.target_comment)||void 0===n?void 0:null===(i=n.attachments)||void 0===i?void 0:i.find(e=>"post"===e.type));t=r&&(null==r?void 0:null===(o=r.postSelection)||void 0===o?void 0:o.text)?"quote":"restack"}else t=["comment_reply","community_post_reply","community_comment_quote_reply","community_comment_reply","note_reply","mentioning_comment_reply"].includes(e.type)?"comment_sibling"===e.comment_audience?"comment":"reply":["free_subscription","referred_free_subscription"].includes(e.type)?"subscription":["paid_subscription","pledged_subscription"].includes(e.type)?"paid_subscription":["comment_mention","post_mention","community_comment_mention"].includes(e.type)?"mention":["new_note","new_profile","user_first_note","live_stream","comment_arr","post_shareable_assets_ready","viral_gift_granted"].includes(e.type)?"promotion":["arr_10k_milestone","arr_1k_milestone","list_100_milestone","list_1k_milestone"].includes(e.type)?"milestone":"follow"===e.type?"follow":["live_stream","live_stream_scheduled","live_stream_invite","live_stream_scheduled_invite","live_stream_host_reminder"].includes(e.type)?"live_stream":"comment";return t}(t)})}function eE(e){let{type:t}=e;return(0,r.tZ)(J.hs,{alignItems:"center",justifyContent:"center",className:m()(ek.Z.reactionBadge,ek.Z.unelevated,ek.Z["notification-".concat(t)]),children:"like"===t?(0,r.tZ)(f.Z,{color:"var(--color-accent-fg-red)"}):"comment"===t?(0,r.tZ)(y.Z,{color:"var(--color-accent-fg-cyan)"}):"restack"===t?(0,r.tZ)(x.Z,{color:"var(--color-accent-fg-green)"}):"subscription"===t?(0,r.tZ)(w.Z,{color:"var(--color-accent-fg-orange)"}):"paid_subscription"===t?(0,r.tZ)(Z.Z,{color:"var(--color-accent-fg-orange)"}):"follow"===t?(0,r.tZ)(w.Z,{color:"var(--color-accent-fg-orange)"}):"mention"===t?(0,r.tZ)(k.Z,{color:"var(--color-accent-fg-purple)"}):"quote"===t?(0,r.tZ)(S.Z,{color:"var(--color-accent-fg-yellow)"}):"promotion"===t?(0,r.tZ)(I.Z,{color:"var(--color-accent-fg-purple)"}):"milestone"===t?(0,r.tZ)(g.Z,{color:"var(--color-accent-fg-yellow)"}):"live_stream"===t?(0,r.tZ)(b.Z,{color:"var(--color-accent-fg-red)"}):(0,r.tZ)(B.Z,{color:"var(--color-accent-fg-cyan)"})})}function eA(e){let t=new Map(e.pubs.map(e=>[e.id,e])),i=new Map(e.posts.map(e=>[e.id,e])),n=new Map(e.drafts.map(e=>[e.id,e])),o=new Map(e.users.map(e=>[e.id,e])),r=new Map(e.comments.map(e=>[e.id,e])),l=new Map(e.mentions.map(e=>[e.id,e])),a=new Map(e.communityPosts.map(e=>[e.id,e])),s=new Map(e.communityComments.map(e=>[e.id,e])),d=new Map(e.feedItemComments.map(e=>[e.comment.id,e])),m=new Map((e.liveStreams||[]).map(e=>[e.id,e])),c=new Map((e.liveStreamInvites||[]).map(e=>[e.id,e]));return{publications:t,posts:i,users:o,comments:r,mentions:l,communityPosts:a,communityComments:s,feedItemComments:d,liveStreams:m,liveStreamInvites:c,drafts:n,viralGifts:new Map((e.viralGifts||[]).map(e=>{var t;return[null===(t=e.unsent[0])||void 0===t?void 0:t.publication_id,e]}).filter(e=>!!e[0])),mediaClips:new Map((e.mediaClips||[]).map(e=>[e.id,e]))}}let eR=new Set([ev.Os.comment_reply,ev.Os.comment_mention,ev.Os.note_reply,ev.Os.note_like,ev.Os.post_reply,ev.Os.restack_quote,ev.Os.restack,ev.Os.user_first_note]),eL=(e,t)=>{var i,n;return eR.has(t.type)&&null!==t.feed_item_comment&&((null===(n=t.feed_item_comment)||void 0===n?void 0:null===(i=n.comment)||void 0===i?void 0:i.user_id)!==(null==e?void 0:e.id)||!t.target_post_id&&("restack"===t.type||"restack_quote"===t.type||"note_like"===t.type))}},35449:function(e,t,i){i.d(t,{f:()=>a});var n=i(16584),o=i(80026),r=i(65575),l=i(43883);function a(e){let{count:t=8}=e;return(0,n.tZ)(r.mE,{children:Array(t).fill(0).map(()=>(0,n.tZ)(s,{}))})}function s(e){let{elevated:t=!1}=e;return(0,n.tZ)(r.Uj,{linkClassName:l.Z.notificationLink,isPadded:!1,children:(0,n.BX)(o.hs,{gap:12,className:l.Z.container,flex:"grow",children:[(0,n.tZ)(r.Vm,{width:32,height:32,type:"circle",elevated:t}),(0,n.BX)(o.tu,{gap:12,flex:"grow",children:[(0,n.tZ)(r.Vm,{width:32,height:32,type:"circle",elevated:t}),(0,n.BX)(o.tu,{flex:"grow",gap:8,children:[(0,n.tZ)(r.Vm,{type:"bar",width:"50%",elevated:t}),(0,n.tZ)(r.Vm,{type:"bar",width:"60%",elevated:t}),(0,n.tZ)(r.Vm,{type:"bar",width:"35%",elevated:t})]})]})]})})}},70293:function(e,t,i){i.d(t,{M:()=>o});var n=i(30396);function o(e,t,i){let{shouldCheck:o,threshold:r=200,bodyRef:l}=i,a=(0,n.sO)(),s=null!=l?l:a,d=()=>{let t=s.current;if(t){let{bottom:i}=t.getBoundingClientRect();i{if(o)return window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",d,{capture:!0})}},t),{bodyRef:s,check:d}}}}]);