mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-10 14:58:32 +01:00
2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1989],{70172:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(14050),o=n(33555),c=n(6137),s=n(83716),l=n(83158),i=n(2155),a=n(46752),d=n(32340),u=n(6202),v=n(31212),m=n(59107),f=n(3657),p=n(21747);const h=(0,a.y)("Avatar");h.media=h("media"),h.icon=h("icon");const g=(0,r.X$)((e=>{var t,n,g;let{className:Z,size:b="large",chat:I,user:w,photo:E,userStatus:y,text:P,isSavedMessages:A,noVideo:k,noLoop:C,lastSyncTime:T,observeIntersection:N,onClick:B}=e;const{loadFullUser:S}=(0,o.Sv)(),O=(0,r.sO)(null),U=(0,r.sO)(null),L=(0,f.Op)(O,N),R=w&&(0,l.NB)(w),M=w&&(0,l.pK)(w.id);let q,x;const F=null===(t=w||I)||void 0===t?void 0:t.hasVideoAvatar,D=(null==w||null===(n=w.fullInfo)||void 0===n?void 0:n.profilePhoto)||(null==I||null===(g=I.fullInfo)||void 0===g?void 0:g.profilePhoto),V=!k&&Boolean((null==w?void 0:w.isPremium)&&(null==D?void 0:D.isVideo)),z=L&&V,H="jumbo"===b;A||R||(V&&(x=(0,l.RT)(w,void 0,"video")),w?q=(0,l.RT)(w,H?"big":void 0):I?q=(0,l.RT)(I,H?"big":void 0):E&&(q=`photo${E.id}?size=m`)),(0,p.Z)(U,z),(0,r.d4)((()=>{const e=U.current;if(!e||!C)return;const t=()=>{e.currentTime=0};return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)}),[C]),(0,r.d4)((()=>{L&&!k&&w&&F&&!D&&S({userId:w.id})}),[F,D,S,w,k,L]);const j=(0,u.Z)(q,!1,c.IU.BlobUrl,T),J=(0,u.Z)(x,!1,c.IU.BlobUrl,T),$=Boolean(j||J),{transitionClassNames:K}=(0,v.Z)($,void 0,$,"slow"),X=(0,m.Z)();let _;const Y=w?(0,l.Js)(w):I?(0,l.U)(X,I):P;if(A)_=r.ZP.createElement("i",{className:(0,a.Z)(h.icon,"icon-avatar-saved-messages"),"aria-label":Y});else if(R)_=r.ZP.createElement("i",{className:(0,a.Z)(h.icon,"icon-avatar-deleted-account"),"aria-label":Y});else if(M)_=r.ZP.createElement("i",{className:(0,a.Z)(h.icon,"icon-reply-filled"),"aria-label":Y});else if($)_=r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("img",{src:j,className:(0,a.Z)(h.media,"avatar-media",K,J&&"poster"),alt:Y,decoding:"async"}),J&&r.ZP.createElement("video",{ref:U,src:J,className:(0,a.Z)(h.media,"avatar-media",K),muted:!0,autoPlay:!0,loop:!C,playsInline:!0}));else if(w){const e=(0,l.Js)(w);_=e?(0,i.Xv)(e,2):void 0}else if(I){const e=(0,l.U)(X,I);_=e&&(0,i.Xv)(e,(0,l.YC)(I.id)?2:1)}else P&&(_=(0,i.Xv)(P,2));const W=!A&&w&&y&&(0,l.kM)(w,y),G=(0,a.Z)(`Avatar size-${b}`,Z,`color-bg-${(0,l.Rs)(w||I)}`,A&&"saved-messages",R&&"deleted-account",M&&"replies-bot-account",W&&"online",B&&"interactive",!A&&!j&&"no-photo"),Q=Boolean(A||j),ee=(0,r.I4)((e=>{B&&B(e,Q)}),[B,Q]),te=(w||I)&&(w||I).id;return r.ZP.createElement("div",{ref:O,className:G,onClick:ee,"data-test-sender-id":s.Cg?te:void 0,"aria-label":"string"==typeof _?Y:void 0},"string"==typeof _?(0,d.Z)(_,["jumbo"===b?"hq_emoji":"emoji"]):_)}))},21747:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(14050),o=n(69118),c=n(74753),s=n(45332),l=n(18674);function i(e,t){var n;const i=(0,r.sO)(null===(n=e.current)||void 0===n?void 0:n.paused),a=(0,r.sO)();a.current=t;const d=(0,r.I4)((()=>{e.current&&(i.current=!e.current.paused,i.current&&e.current.pause())}),[e]),u=(0,r.I4)((()=>{e.current&&i.current&&a.current&&document.body.contains(e.current)&&(0,c.Z)(e.current)}),[e]),v=(0,r.I4)((()=>{(0,o.T2)(u)}),[u]);(0,s.Z)(d,v),(0,l.ZP)(d,u)}},21273:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(91713),o=n(14050),c=n(69118),s=n(87675),l=n(77361),i=n(80036);const a=".ListItem",d=20,u=800,v=e=>{let{ref:t,className:n,onLoadMore:v,onScroll:m,onKeyDown:f,items:p,itemSelector:h=a,preloadBackwards:g=d,sensitiveArea:Z=u,withAbsolutePositioning:b,maxHeight:I,noScrollRestore:w=!1,noScrollRestoreOnTop:E=!1,noFastList:y,cacheBuster:P,children:A}=e,k=(0,o.sO)(null);t&&(k=t);const C=(0,o.sO)({}),[T,N]=(0,o.Ye)((()=>v?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];v({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{v({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[v,p]);(0,o.d4)((()=>{if(!T)return;if(g>0&&(!p||p.length<g))return void T(!0);const{scrollHeight:e,clientHeight:t}=k.current;t&&e<=t&&T()}),[p,T,g]),(0,o.bt)((()=>{const e=k.current,t=C.current;let n;if(t
|
||
|
//# sourceMappingURL=1989.770621cd3dc5c36bdc6e.js.map
|