mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 21:31:22 +01:00
2 lines
8.8 KiB
JavaScript
2 lines
8.8 KiB
JavaScript
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[453],{172:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(4050),r=n(6137),c=n(3716),s=n(5806),l=n(2155),i=n(6752),a=n(2340),d=n(6202),u=n(1212),m=n(9107);const f=(0,i.y)("Avatar");f.img=f("img"),f.icon=f("icon");const v=(0,o.X$)((e=>{let{className:t,size:n="large",chat:v,user:h,photo:g,userStatus:p,text:Z,isSavedMessages:w,lastSyncTime:E,onClick:y}=e;const A=h&&(0,s.NB)(h),b=h&&(0,s.pK)(h.id);let C;const I="jumbo"===n;w||A||(h?C=(0,s.RT)(h,I?"big":void 0):v?C=(0,s.RT)(v,I?"big":void 0):g&&(C=`photo${g.id}?size=m`));const P=(0,d.Z)(C,!1,r.IU.BlobUrl,E),N=Boolean(P),{transitionClassNames:T}=(0,u.Z)(N,void 0,N,"slow"),k=(0,m.Z)();let B="";if(w)B=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-avatar-saved-messages")});else if(A)B=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-avatar-deleted-account")});else if(b)B=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-reply-filled")});else if(P)B=o.ZP.createElement("img",{src:P,className:(0,i.Z)(f.img,"avatar-media",T),alt:"",decoding:"async"});else if(h){const e=(0,s.Js)(h);B=e?(0,l.Xv)(e,2):void 0}else if(v){const e=(0,s.U)(k,v);B=e&&(0,l.Xv)(e,(0,s.YC)(v.id)?2:1)}else Z&&(B=(0,l.Xv)(Z,2));const S=!w&&h&&p&&(0,s.kM)(h,p),U=(0,i.Z)(`Avatar size-${n}`,t,`color-bg-${(0,s.Rs)(h||v)}`,w&&"saved-messages",A&&"deleted-account",b&&"replies-bot-account",S&&"online",y&&"interactive",!w&&!P&&"no-photo"),L=Boolean(w||P),R=(0,o.I4)((e=>{y&&y(e,L)}),[y,L]),q=(h||v)&&(h||v).id;return o.ZP.createElement("div",{className:U,onClick:R,"data-test-sender-id":c.Cg?q:void 0},"string"==typeof B?(0,a.Z)(B,["jumbo"===n?"hq_emoji":"emoji"]):B)}))},1273:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(1713),r=n(4050),c=n(9118),s=n(7675),l=n(7361);const i=".ListItem",a=20,d=800,u=e=>{let{ref:t,className:n,onLoadMore:u,onScroll:m,onKeyDown:f,items:v,itemSelector:h=i,preloadBackwards:g=a,sensitiveArea:p=d,withAbsolutePositioning:Z,maxHeight:w,noScrollRestore:E=!1,noScrollRestoreOnTop:y=!1,noFastList:A,cacheBuster:b,children:C}=e,I=(0,r.sO)(null);t&&(I=t);const P=(0,r.sO)({}),[N,T]=(0,r.Ye)((()=>u?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u({direction:o.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{u({direction:o.Uq.Forwards})}),1e3,!0,!1)]:[]),[u,v]);(0,r.d4)((()=>{if(!N)return;if(g>0&&(!v||v.length<g))return void N(!0);const{scrollHeight:e,clientHeight:t}=I.current;t&&e<=t&&N()}),[v,N,g]),(0,r.bt)((()=>{const e=I.current,t=P.current;let n;if(t.listItemElements=e.querySelectorAll(h),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:o}=e;n=o+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}Z||E||y&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[v,h,E,y,b,Z]);const k=(0,r.I4)((e=>{if(T&&N){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=P.current,o=P.current.listItemElements;if(e)return void(P.current.isScrollTopJustUpdated=!1);const r=o.length,c=I.current,{scrollTop:s,scrollHeight:l,offsetHeight:i}=c,a=s<=(r?o[0].offsetTop:0)+p,d=(r?o[r-1].offsetTop+o[r-1].offsetHeight:l)-(s+i)<=p;let u=!1;if(a){const e=o[0];if(e){const o=e.getBoundingClientRect().top,r=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:o;t&&void 0!==n&&r>n&&(P.current.currentAnchor=e,P.current.currentAnchorTop=o,u=!0,T())}}if(d){const e=o[r-1];if(e){const o=e.getBoundingClientRect().top,r=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:o;t&&void 0!==n&&r<n&&(P.current.currentAnchor=e,P.current.currentAnchorTop=o,u=!0,N())}}if(!u)if(null!=t&&t.offsetParent)P.current.currentAnchorTop=t.getBoundingClientRect().top;else{const e=o[0];e&&(P.current.currentAnchor=e,P.current.currentAnchorTop=e.getBoundingClientRect().top)}}m&&m(e)}),[N,T,m,p]);return r.ZP.createElement("div",{ref:I,className:n,onScroll:k,teactFastList:!A&&!Z,onKeyDown:f},Z&&null!=v&&v.length?r.ZP.createElement("div",{teactFastList:!A,style
|
||
|
//# sourceMappingURL=453.f00f7a152cec60ddb828.js.map
|