var w=Object.defineProperty;var T=(e,n,s)=>n in e?w(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s;var m=(e,n,s)=>T(e,typeof n!="symbol"?n+"":n,s);import{j as t}from"./client-By3tlFYA.js";import{P as i}from"./short_number-C9zm8Jg6.js";import"./index-TEHZzOO_.js";import{j as C,dR as k,g as B,p as P,q as S,f as E,d$ as F,dT as I,z as H,e0 as R,L as v,a as U}from"./useSelectableClick-D9BFU7v4.js";import{A as q}from"./index-k42DYsn6.js";import{C as z,A as D,L as K,T as $}from"./limited_account_hint-12iJWv1k.js";import{B as G}from"./bundle_column_error-Bgy8dpSN.js";import{S as J}from"./scrollable_list-b0C3wAAH.js";import{C as b}from"./column-BaxhIcvj.js";import{M as l}from"./message-CVkQtbZv.js";import"./numbers-BLyy7tyF.js";import"./index-DkCxcZFY.js";import"./relative_timestamp-BOUL06oe.js";import"./ready-DpOgoWSg.js";import"./index-DUY7J2K7.js";import"./skeleton-CwYXpOUk.js";import"./api-C8Dh2R2O.js";import"./index-DiPYjm3h.js";import"./load_locale-Dm9dKbU7.js";import"./status_quoted-CMTQM4tf.js";import"./counters-O2iLRFgv.js";import"./follow_button-BBWD2ebm.js";import"./verified_badge-CnDAo1Ce.js";import"./column_header-B74GfnnV.js";import"./add-CxOAEcXl.js";import"./chevron_left-tY77j9LU.js";import"./unfold_more-Dg1Ay52N.js";import"./Helmet-BG0DmkIY.js";import"./familiar_followers-CUvxMfXu.js";import"./notifications-CQHZPMn8.js";import"./notifications_active-fill-MijdFE1U.js";import"./group-DAy9I84u.js";import"./person-C13r8tNn.js";import"./content_copy-DVR8BuWm.js";import"./formatted_date-CyjChcMh.js";import"./react-textarea-autosize.browser.esm-CJKL8aJv.js";import"./use-isomorphic-layout-effect.browser.esm-Du49dnA5.js";import"./avatar_group-DgqlUJ8x.js";import"./column-KuFpKGtG.js";import"./scroll-BygYx8ga.js";import"./gif-BgNkw5yr.js";import"./index-CdcXssN4.js";import"./scroll_context-mV8SlNiP.js";import"./schedule_idle_task-CDh0madc.js";import"./load_more-CRfza3T3.js";const N=(e,{params:{acct:n,id:s}})=>{const o=s||e.accounts_map[k(n)];return o?{accountId:o,remote:e.getIn(["accounts",o,"acct"])!==e.getIn(["accounts",o,"username"]),remoteUrl:e.getIn(["accounts",o,"url"]),isAccount:!!e.getIn(["accounts",o]),accountIds:e.getIn(["user_lists","following",o,"items"]),hasMore:!!e.getIn(["user_lists","following",o,"next"]),isLoading:e.getIn(["user_lists","following",o,"isLoading"],!0),suspended:e.getIn(["accounts",o,"suspended"],!1),hideCollections:e.getIn(["accounts",o,"hide_collections"],!1),hidden:B(e,o),blockedBy:e.getIn(["relationships",o,"blocked_by"],!1)}:{isLoading:!0}},j=({accountId:e,url:n})=>{const s=U(r=>{var a;return(a=r.accounts.get(e))==null?void 0:a.acct}),o=s?s.split("@")[1]:void 0;return t.jsx($,{url:n,message:t.jsx(l,{id:"hints.profiles.follows_may_be_missing",defaultMessage:"Follows for this profile may be missing."}),label:t.jsx(l,{id:"hints.profiles.see_more_follows",defaultMessage:"See more follows on {domain}",values:{domain:t.jsx("strong",{children:o})}})})};class y extends P{constructor(){super(...arguments);m(this,"handleLoadMore",H(()=>{this.props.dispatch(R(this.props.accountId))},300,{leading:!0}))}_load(){const{accountId:s,isAccount:o,dispatch:r}=this.props;o||r(E(s)),r(F(s))}componentDidMount(){const{params:{acct:s},accountId:o,dispatch:r}=this.props;o?this._load():r(I(s))}componentDidUpdate(s){const{params:{acct:o},accountId:r,dispatch:a}=this.props;s.accountId!==r&&r?this._load():s.params.acct!==o&&a(I(o))}render(){const{accountId:s,accountIds:o,hasMore:r,blockedBy:a,isAccount:_,multiColumn:p,isLoading:M,suspended:d,hidden:u,remote:f,remoteUrl:h,hideCollections:A}=this.props;if(!_)return t.jsx(G,{multiColumn:p,errorType:"routing"});if(!o)return t.jsx(b,{children:t.jsx(v,{})});let c;const g=a||d||u;d?c=t.jsx(l,{id:"empty_column.account_suspended",defaultMessage:"Account suspended"}):u?c=t.jsx(K,{accountId:s}):a?c=t.jsx(l,{id:"empty_column.account_unavailable",defaultMessage:"Profile unavailable"}):A&&o.isEmpty()?c=t.jsx(l,{id:"empty_column.account_hides_collections",defaultMessage:"This user has chosen to not make this information available"}):f&&o.isEmpty()?c=t.jsx(j,{accountId:s,url:h}):c=t.jsx(l,{id:"account.follows.empty",defaultMessage:"This user doesn't follow anyone yet."});const L=f?t.jsx(j,{accountId:s,url:h}):null;return t.jsxs(b,{children:[t.jsx(z,{}),t.jsx(J,{scrollKey:"following",hasMore:!g&&r,isLoading:M,onLoadMore:this.handleLoadMore,prepend:t.jsx(D,{accountId:this.props.accountId,hideTabs:!0}),alwaysPrepend:!0,append:L,emptyMessage:c,bindToDocument:!p,children:g?[]:o.map(x=>t.jsx(q,{id:x},x))})]})}}m(y,"propTypes",{params:i.shape({acct:i.string,id:i.string}).isRequired,accountId:i.string,dispatch:i.func.isRequired,accountIds:S.list,hasMore:i.bool,isLoading:i.bool,blockedBy:i.bool,isAccount:i.bool,suspended:i.bool,hidden:i.bool,remote:i.bool,remoteUrl:i.string,multiColumn:i.bool});const zo=C(N)(y);export{zo as default};
//# sourceMappingURL=following-index-DCVPJMlL.js.map
