import{d as e}from"./objectSpread2-DtFdQpqy.js";import{a as t,n}from"./preload-helper-EQ20WQt-.js";import{l as r,o as i,w as a}from"./prop-types-DdDwMzX7.js";import{B as o,K as s,U as c,V as l,c as u,z as d}from"./poll-BqfIhRzt.js";import{t as f}from"./short_number-CCNBtmoH.js";import{t as p}from"./classnames-CFUb2mE1.js";import{l as m,u as h}from"./status_quoted-BBEee1ee.js";import{h as g,o as _,u as v}from"./account-wZ_-xOTl.js";import{t as y}from"./formatted_date-B609P2Oc.js";import{n as b,r as x,t as S}from"./number_fields-0_zdDBoP.js";var C=e(t()),w=e(p()),T={wrapper:`_comp_account_list_item__wrapper`,main:`_comp_account_list_item__main`,displayName:`_comp_account_list_item__displayName`,badge:`_comp_account_list_item__badge`,handle:`_comp_account_list_item__handle`,button:`_comp_account_list_item__button`,verifiedBadge:`_comp_account_list_item__verifiedBadge`,bio:`_comp_account_list_item__bio`},E=n(),D=[`followers`,`posts`,`last-active`],O=({accountId:e,stats:t=D,withBio:n=!0,withBorder:p=!0,badge:g,renderButton:O=k})=>{let A=r(),j=c(e),M=o(j,a),N=x(e),P=(0,C.useMemo)(()=>j==null?void 0:j.created_at.includes(new Date().getFullYear().toString()),[j==null?void 0:j.created_at]);if(!e||!j)return null;let F=g==null?N!=null&&N.followed_by?(0,E.jsx)(_,{}):null:g,I=j.fields.find(e=>!!e.verified_at);return(0,E.jsxs)(`div`,{className:T.wrapper,"data-with-border":p,children:[(0,E.jsx)(h,{className:T.main,icon:(0,E.jsx)(l,{account:j,size:40}),sideContent:(0,E.jsx)(`span`,{className:T.button,children:O({accountId:e,relationship:N})}),children:(0,E.jsxs)(m,{to:`/@${j.acct}`,"data-hover-card-account":e,subtitle:(0,E.jsx)(`span`,{className:T.handle,children:M}),children:[(0,E.jsx)(d,{account:j,className:T.displayName}),F&&(0,E.jsx)(`span`,{className:T.badge,children:F})]})}),(0,E.jsxs)(S,{children:[t.includes(`followers`)&&(0,E.jsx)(b,{label:(0,E.jsx)(i,{id:`account.followers`,defaultMessage:`Followers`}),hint:A.formatNumber(j.followers_count),children:(0,E.jsx)(f,{value:j.followers_count})}),t.includes(`following`)&&(0,E.jsx)(b,{label:(0,E.jsx)(i,{id:`account.following`,defaultMessage:`Following`}),hint:A.formatNumber(j.following_count),link:`/@${j.acct}/following`,children:(0,E.jsx)(f,{value:j.following_count})}),t.includes(`posts`)&&(0,E.jsx)(b,{label:(0,E.jsx)(i,{id:`account.posts`,defaultMessage:`Posts`}),hint:A.formatNumber(j.statuses_count),children:(0,E.jsx)(f,{value:j.statuses_count})}),t.includes(`joined`)&&(0,E.jsx)(b,{label:(0,E.jsx)(i,{id:`account.joined_short`,defaultMessage:`Joined`}),hint:A.formatDate(j.created_at),children:P?(0,E.jsx)(y,{value:j.created_at,month:`short`,day:`2-digit`}):(0,E.jsx)(y,{value:j.created_at,year:`numeric`})}),t.includes(`last-active`)&&(0,E.jsx)(b,{label:(0,E.jsx)(i,{id:`account.last_active`,defaultMessage:`Last active`}),children:j.last_status_at?(0,E.jsx)(u,{long:!0,timestamp:j.last_status_at}):`-`}),I&&(0,E.jsx)(v,{link:I.value,className:T.verifiedBadge})]}),n&&j.note.length>0&&(0,E.jsx)(s,{className:(0,w.default)(T.bio,`translate`),htmlString:j.note_emojified,extraEmojis:j.emojis})]})},k=({accountId:e})=>(0,E.jsx)(A,{accountId:e}),A=({accountId:e})=>(0,E.jsx)(g,{compact:!0,labelLength:`short`,accountId:e});export{A as n,O as t};
//# sourceMappingURL=account_list_item-YPkuEEKD.js.map