"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["8118"],{47002:function(t,e,n){n.r(e),n.d(e,{PublicationFeedPage:()=>k});var i=n(7409),l=n(99282),o=n(16584),s=n(30396),a=n(47976),r=n(347),u=n(14952),c=n(42375),d=n(81914),m=n(883),p=n(2891),h=n(68833),v=n(7882),b=n(86075),_=n(19081),f=n(27744),g=n(75419),Z=n(70293),C=n(64172);function k(){return(0,o.tZ)(r.h,{children:(0,o.tZ)(p.T,{children:(0,o.tZ)(_.hs,{justifyContent:"center",className:"container-_2ob3_",children:(0,o.tZ)(_.tu,{minWidth:0,style:{flex:"1 1 1px",maxWidth:600},className:"column-EQAs5c",children:(0,o.tZ)(y,{})})})})})}function y(){var t,e;let n=(0,u.Ij)(),r=(0,C._V)(null!==(e=null==n?void 0:n.id)&&void 0!==e?e:0),[p,k]=(0,f.d6)();(0,s.d4)(()=>{(0,h.j)(h.FP.FEED_PUBLICATION_SCREEN_VIEWED,{visited_publication_id:null==n?void 0:n.id})},[]);let{canFetchMore:y,lastPage:x,fetchMore:E,hasLoadedOnce:I}=(0,v.NL)({pathname:"/api/v1/notes",getPageInit:t=>{var e;let{lastPage:n,init:o}=t,s=null==n?void 0:null===(e=n.result)||void 0===e?void 0:e.nextCursor;return s&&(o.query=(0,l._)((0,i._)({},o.query),{cursor:s})),o},auto:!0,deps:[],pages:p.pages,dispatch:k}),N=y&&!!(null==x?void 0:null===(t=x.result)||void 0===t?void 0:t.nextCursor),{bodyRef:P}=(0,Z.M)(E,[x],{shouldCheck:N,threshold:640}),B=p.pages.map(t=>{var e;return(null===(e=t.result)||void 0===e?void 0:e.items)||[]}).flat().filter(t=>"comment"===t.type);return(0,o.tZ)(c.$U,{surface:"publication",dispatch:k,state:p,children:(0,o.BX)(_.tu,{ref:P,paddingBottom:20,children:[(null==r?void 0:r.public)&&(null==r?void 0:r.is_in_notes_feed)&&(0,o.tZ)(_.tu,{borderBottom:"detail",children:(0,o.tZ)(g.pe,{})}),B.map(t=>{var e,n,s;return(0,o.tZ)(d.Bm,{className:"feedItem-mD9tP5",item:(0,l._)((0,i._)({},t),{publication:t.publication?null!==(e=p.publications.get(t.publication.id))&&void 0!==e?e:null:t.publication,post:t.post?null!==(n=p.posts.get(t.post.id))&&void 0!==n?n:null:t.post,comment:t.comment&&null!==(s=p.comments.get(t.comment.id))&&void 0!==s?s:t.comment,parentComments:t.parentComments?t.parentComments.map(t=>{if(!t)return null;let e=p.comments.get(t.id);return e?(0,l._)((0,i._)({},e),{tracking_parameters:t.tracking_parameters}):null}):[]})})}),(null==x?void 0:x.isLoading)||!I?(0,o.tZ)(m.n,{}):0===B.length?(0,o.tZ)(_.hs,{justifyContent:"center",alignItems:"center",flex:"grow",style:{minHeight:"calc(100dvh - 300px)"},children:(0,o.tZ)(b.u,{icon:(0,o.tZ)(a.Z,{}),title:"".concat((null==n?void 0:n.name)||"This publication"," hasn't published any notes yet."),description:"Check back later to see their latest notes."})}):null]})})}},2891:function(t,e,n){n.d(e,{T:()=>o});var i=n(16584),l=n(5749);function o(t){let{children:e}=t;return(0,i.tZ)("div",{className:l.Z.variables,children:e})}}}]);