import{a as e,d as t,i as n}from"./objectSpread2-DtFdQpqy.js";import{a as r,n as i}from"./preload-helper-EQ20WQt-.js";import{o as a}from"./prop-types-DdDwMzX7.js";import{ft as o,i as s,lt as c}from"./poll-D7UTo6nN.js";import{Bt as l,Ht as u,Li as d,Qi as f,Ut as p,fn as m,ko as h}from"./time-BE5vfriQ.js";import{d as g}from"./react-router-OpaHPRhD.js";import{t as _}from"./helmet-xJbX5x_5.js";import{n as v}from"./short_number-CCNBtmoH.js";import{i as y}from"./streaming-4dcMOrhn.js";import{t as b}from"./column-CvSGioVA.js";import{t as x}from"./bundle_column_error-EbL41WId.js";import{n as S}from"./lists-Aoj54pku.js";import{a as C}from"./columns_area-DMVhiuQq.js";import{a as w}from"./compose_form_container-CpVH13U8.js";import{t as T}from"./delete-DNXWKXG-.js";import{t as E}from"./status_list_container-4f3gb5WG.js";var D=t(r());s();var O=i();e();var k=(e,t)=>({list:e.getIn([`lists`,t.params.id]),hasUnread:e.getIn([`timelines`,`list:${t.params.id}`,`unread`])>0}),A=class extends D.PureComponent{constructor(...e){super(...e),n(this,`handlePin`,()=>{let{columnId:e,dispatch:t}=this.props;e?t(p(e)):(t(l(`LIST`,{id:this.props.params.id})),this.props.history.push(`/`))}),n(this,`handleMove`,e=>{let{columnId:t,dispatch:n}=this.props;n(u(t,e))}),n(this,`handleHeaderClick`,()=>{this.column.scrollTop()}),n(this,`setRef`,e=>{this.column=e}),n(this,`handleLoadMore`,e=>{let{id:t}=this.props.params;this.props.dispatch(d(t,{maxId:e}))}),n(this,`handleDeleteClick`,()=>{let{dispatch:e,columnId:t}=this.props,{id:n}=this.props.params;e(f({modalType:`CONFIRM_DELETE_LIST`,modalProps:{listId:n,columnId:t}}))})}componentDidMount(){let{dispatch:e}=this.props,{id:t}=this.props.params;e(m(t)),e(d(t)),this.disconnect=e(y(t))}componentDidUpdate(e){let{dispatch:t,params:{id:n}}=this.props;n!==e.params.id&&(this.disconnect&&(this.disconnect(),this.disconnect=null),t(m(n)),t(d(n)),this.disconnect=t(y(n)))}componentWillUnmount(){this.disconnect&&(this.disconnect(),this.disconnect=null)}render(){let{hasUnread:e,columnId:t,multiColumn:n,list:r}=this.props,{id:i}=this.props.params,s=!!t,l=r?r.get(`title`):i;return r===void 0?(0,O.jsx)(b,{children:(0,O.jsx)(`div`,{className:`scrollable`,children:(0,O.jsx)(o,{})})}):r===!1?(0,O.jsx)(x,{multiColumn:n,errorType:`routing`}):(0,O.jsxs)(b,{bindToDocument:!n,ref:this.setRef,label:l,children:[(0,O.jsx)(C,{icon:`list-ul`,iconComponent:S,active:e,title:l,onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:s,multiColumn:n,children:(0,O.jsx)(`div`,{className:`column-settings`,children:(0,O.jsxs)(`section`,{className:`column-header__links`,children:[(0,O.jsxs)(v,{to:`/lists/${i}/edit`,className:`text-btn column-header__setting-btn`,children:[(0,O.jsx)(c,{id:`pencil`,icon:w}),` `,(0,O.jsx)(a,{id:`lists.edit`,defaultMessage:`Edit list`})]}),(0,O.jsxs)(`button`,{type:`button`,className:`text-btn column-header__setting-btn`,tabIndex:0,onClick:this.handleDeleteClick,children:[(0,O.jsx)(c,{id:`trash`,icon:T}),` `,(0,O.jsx)(a,{id:`lists.delete`,defaultMessage:`Delete list`})]})]})})}),(0,O.jsx)(E,{trackScroll:!s,scrollKey:`list_timeline-${t}`,timelineId:`list:${i}`,onLoadMore:this.handleLoadMore,emptyMessage:(0,O.jsx)(a,{id:`empty_column.list`,defaultMessage:`There is nothing in this list yet. When members of this list post new statuses, they will appear here.`}),bindToDocument:!n}),(0,O.jsxs)(_,{children:[(0,O.jsx)(`title`,{children:l}),(0,O.jsx)(`meta`,{name:`robots`,content:`noindex`})]})]})}},j=g(h(k)(A));export{j as default};
//# sourceMappingURL=list_timeline-DawDpggz.js.map