telegram-tt/dist/0.5e785b5aad34456c99fe.js

1 line
92 KiB
JavaScript
Raw Normal View History

2021-04-12 16:56:48 +02:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(93).concat([function(e,t,n){"use strict";var a=n(0),r=n(10),c=n(29);t.a=()=>{const e=Object(c.a)();return Object(a.n)(()=>r.a(e),[e]),r.b}},function(e,t,n){"use strict";var a=n(0),r=n(7),c=n(8),s=n(131),i=n(162),o=n(33),l=n(47),u=n(32);n(194);t.a=e=>{const{ref:t,icon:n,className:d,style:m,children:h,disabled:b,ripple:f,narrow:p,inactive:g,contextActions:O,focus:v,destructive:j,onClick:E}=e;let y=Object(a.q)(null);t&&(y=t);const{isContextMenuOpen:N,contextMenuPosition:C,handleBeforeContextMenu:T,handleContextMenu:M,handleContextMenuClose:w,handleContextMenuHide:L}=Object(s.a)(y,!O),S=Object(a.m)(()=>y.current,[]),I=Object(a.m)(()=>y.current.closest(".custom-scroll"),[]),k=Object(a.m)(()=>y.current.querySelector(".ListItem-context-menu .bubble"),[]),{positionX:A,positionY:x,style:D}=Object(i.a)(C,S,I,k),_=Object(a.m)(e=>{!b&&E&&E(e)},[b,E]),R=Object(a.m)(e=>{g||r.k||(!O||2!==e.button&&E||T(e),0===e.button&&(E?_(e):M(e)))},[g,O,E,T,M,_]),P=Object(c.a)("ListItem no-selection",d,f&&"has-ripple",p&&"narrow",b&&"disabled",g&&"inactive",C&&"has-menu-open",v&&"focus",j&&"destructive");return a.a.createElement("div",{ref:y,className:P,style:m},a.a.createElement("div",{className:"ListItem-button",role:"button",tabIndex:0,onClick:!g&&r.k?_:void 0,onMouseDown:R,onContextMenu:!g&&O?M:void 0},n&&a.a.createElement("i",{className:"icon-"+n}),h,!b&&!g&&f&&a.a.createElement(o.a,null)),O&&void 0!==C&&a.a.createElement(l.a,{isOpen:N,positionX:A,positionY:x,style:D,className:"ListItem-context-menu",autoClose:!0,onClose:w,onCloseAnimationEnd:L},O.map(e=>a.a.createElement(u.a,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title))))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}));var a=n(0),r=n(9),c=n(43);function s({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:s,margin:i,threshold:o,isDisabled:l},u){const d=Object(a.q)(),m=Object(a.q)(),h=Object(a.q)(),b=Object(a.q)();m.current=u;const f=Object(a.m)(()=>{h.current=!0},[]),p=Object(a.m)(()=>{h.current=!1,b.current&&(b.current(),b.current=void 0)},[]);Object(c.a)(f,p),Object(a.n)(()=>{if(!l)return()=>{d.current&&(d.current.observer.disconnect(),d.current.callbacks.clear(),d.current=void 0)}},[l]);return{observe:Object(a.m)((a,c)=>{d.current||function(){const a=new Map,c=new Map,l=()=>{const e=Array.from(c.values());e.forEach(t=>{const n=a.get(t.target);n&&n(t,e)}),m.current&&m.current(e),c.clear()},u=t?r.g:n?r.a:void 0,f=u?u(l,t||n,!s):l,p=new IntersectionObserver(e=>{e.forEach(e=>{c.set(e.target,e)}),h.current?b.current=()=>{f()}:f()},{root:e.current,rootMargin:i?i+"px":void 0,threshold:o});d.current={observer:p,callbacks:a}}();const l=d.current;return l.observer.observe(a),c&&l.callbacks.set(a,c),()=>{c&&l.callbacks.delete(a),l.observer.unobserve(a)}},[l]),freeze:f,unfreeze:p}}function i(e,t,n){Object(a.n)(()=>t?t(e.current,n):void 0,[])}function o(e,t,n){const[r,c]=Object(a.r)(!t);return i(e,t,e=>{c(e.isIntersecting),n&&n(e)}),r}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(18),s=n(6),i=n(4),o=n(35),l=n(3),u=n(93),d=n(99),m=n(130),h=n(146);t.a=Object(a.h)(Object(r.h)((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a}=e,r=Object(s.Bb)(e,t);return{lastSyncTime:a,user:r,isSavedMessages:!n&&r&&r.isSelf,areMessagesLoaded:Boolean(Object(s.m)(e,t))}},(e,t)=>Object(l.l)(t,["loadFullUser","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:r,withHandle:s,withFullInfo:l,withUpdatingStatus:b,noStatusOrTyping:f,user:p,isSavedMessages:g,areMessagesLoaded:O,lastSyncTime:v,loadFullUser:j,openMediaViewer:E})=>{const{id:y}=p||{},N=Object(i.Z)(p);Object(a.n)(()=>{l&&v&&y&&j({userId:y})},[y,j,v,l]);const C=Object(a.m)((e,n)=>{p&&n&&(e.stopPropagation(),E({avatarOwnerId:p.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[p,t,E]),T=Object(u.a)();if(p)return a.a.createElement("div",{className:"ChatInfo"},a.a.createElement(d.a,{key:p.id,size:t,user:p,isSavedM