import{d as e}from"./objectSpread2-DtFdQpqy.js";import{a as t,n}from"./preload-helper-EQ20WQt-.js";import{o as r}from"./prop-types-DdDwMzX7.js";import{J as i,L as a,V as o,lt as s}from"./poll-BqfIhRzt.js";import{Do as c,Eo as l,nr as u}from"./time-BE5vfriQ.js";import{s as d}from"./react-router-OpaHPRhD.js";import{R as f}from"./status_quoted-BBEee1ee.js";import{b as p,x as m,y as h}from"./compose_form_container-1C-FOHvv.js";var g=e(t()),_=n(),v=({statusId:e})=>{let t=d(),n=(0,g.useRef)(),v=l(),y=c(t=>t.statuses.get(e)),b=c(e=>e.accounts.get(y==null?void 0:y.get(`account`))),x=(0,g.useCallback)(({clientX:e,clientY:t})=>{n.current=[e,t]},[n]),S=(0,g.useCallback)(({clientX:r,clientY:i,target:a,button:o,ctrlKey:s,metaKey:c})=>{var l;let[u,d]=(l=n.current)==null?[0,0]:l,[f,p]=[Math.abs(r-u),Math.abs(i-d)],m=a;for(;m;){if(m.localName===`button`||m.localName===`a`||m.localName===`label`)return;m=m.parentNode}if(f+p<5&&b){let n=`/@${b.acct}/${e}`;o===0&&!(s||c)?t.push(n):(o===1||o===0&&(s||c))&&window.open(n,`_blank`,`noopener`)}n.current=null},[n,e,b,t]),C=(0,g.useCallback)(()=>{v(u(e))},[v,e]);if(!y)return null;let w=!!y.get(`spoiler_text`),T=y.get(`poll`),E=!y.get(`hidden`)||!w,D=y.get(`media_attachments`).size;return(0,_.jsxs)(i,{className:`notification-group__embedded-status`,role:`button`,tabIndex:-1,onMouseDown:x,onMouseUp:S,children:[(0,_.jsxs)(`div`,{className:`notification-group__embedded-status__account`,children:[(0,_.jsx)(o,{account:b,size:16}),(0,_.jsx)(a,{account:b})]}),(0,_.jsx)(f,{status:y,onClick:C,expanded:E}),(!w||E)&&(0,_.jsx)(h,{className:`notification-group__embedded-status__content reply-indicator__content translate`,status:y}),E&&(T||D>0)&&(0,_.jsxs)(`div`,{className:`notification-group__embedded-status__attachments reply-indicator__attachments`,children:[!!T&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{icon:m,id:`bar-chart-4-bars`}),(0,_.jsx)(r,{id:`reply_indicator.poll`,defaultMessage:`Poll`})]}),D>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{icon:p,id:`photo-library`}),(0,_.jsx)(r,{id:`reply_indicator.attachments`,defaultMessage:`{count,plural,one{# attachment} other{# attachments}}`,values:{count:D}})]})]})]})};export{v as t};
//# sourceMappingURL=embedded_status-rVkj7rk3.js.map