telegram-tt/dist/0.70d39e3b6708f3605239.js

2 lines
99 KiB
JavaScript
Raw Normal View History

2021-07-15 20:58:27 +02:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(105).concat([function(e,t,n){"use strict";var a=n(0),r=n(5),c=n(8),s=n(144),i=n(173),o=n(26),l=n(43),d=n(54),u=n(42);n(207);t.a=e=>{const{ref:t,buttonRef:n,icon:m,className:b,style:h,children:f,disabled:p,ripple:O,narrow:g,inactive:v,focus:j,destructive:E,multiline:y,isStatic:C,contextActions:T,onClick:N}=e;let w=Object(a.q)(null);t&&(w=t);const{isContextMenuOpen:M,contextMenuPosition:I,handleBeforeContextMenu:S,handleContextMenu:L,handleContextMenuClose:k,handleContextMenuHide:A}=Object(s.a)(w,!T),x=Object(a.m)(()=>w.current,[]),D=Object(a.m)(()=>w.current.closest(".custom-scroll"),[]),R=Object(a.m)(()=>w.current.querySelector(".ListItem-context-menu .bubble"),[]),{positionX:_,positionY:P,style:F}=Object(i.a)(I,x,D,R),U=Object(a.m)(e=>{!p&&N&&N(e)},[p,N]),B=Object(a.m)(e=>{v||r.m||(!T||2!==e.button&&N||S(e),0===e.button&&(N?U(e):L(e)))},[v,T,N,S,L,U]),q=Object(o.a)(),H=Object(c.a)("ListItem",b,!C&&"no-selection",O&&"has-ripple",g&&"narrow",p&&"disabled",v&&"inactive",I&&"has-menu-open",j&&"focus",E&&"destructive",y&&"multiline",C&&"is-static");return a.a.createElement("div",{ref:w,className:H,dir:q.isRtl?"rtl":void 0,style:h},a.a.createElement("div",{className:"ListItem-button",role:"button",ref:n,tabIndex:0,onClick:!v&&r.m?U:void 0,onMouseDown:B,onContextMenu:!v&&T?L:void 0},m&&a.a.createElement("i",{className:"icon-"+m}),y&&a.a.createElement("div",{className:"multiline-item"},f),!y&&f,!p&&!v&&O&&a.a.createElement(l.a,null)),T&&void 0!==I&&a.a.createElement(d.a,{isOpen:M,positionX:_,positionY:P,style:F,className:"ListItem-context-menu",autoClose:!0,onClose:k,onCloseAnimationEnd:A},T.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(50);function s({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:s,margin:i,threshold:o,isDisabled:l},d){const u=Object(a.q)(),m=Object(a.q)(),b=Object(a.q)(0),h=Object(a.q)();m.current=d;const f=Object(a.m)(()=>{b.current++},[]),p=Object(a.m)(()=>{b.current&&(b.current--,!b.current&&h.current&&(h.current(),h.current=void 0))},[]);Object(c.a)(f,p),Object(a.n)(()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}},[l]);return{observe:Object(a.m)((a,c)=>{u.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()},d=t?r.h:n?r.a:void 0,f=d?d(l,t||n,!s):l,p=new IntersectionObserver(e=>{e.forEach(e=>{c.set(e.target,e)}),b.current?h.current=()=>{f()}:f()},{root:e.current,rootMargin:i?i+"px":void 0,threshold:o});u.current={observer:p,callbacks:a}}();const l=u.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(6),c=n(55),s=n(28);t.a=(e,t=!1,n=r.ApiMediaFormat.BlobUrl,i,o)=>{const l=e?c.c(e):void 0,d=Object(s.a)();return Object(a.n)(()=>{if(!t&&e&&!l){const t=Date.now();c.b(e,n).then(()=>{const e=Date.now()-t;!o||e>=o?d():setTimeout(d,o-e)})}},[t,e,l,n,i,d,o]),l}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(19),s=n(7),i=n(4),o=n(25),l=n(3),d=n(26),u=n(111),m=n(132),b=n(155);t.a=Object(a.h)(Object(r.h)((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,c=Object(s.Ib)(e,t);return{lastSyncTime:a,user:c,isSavedMessages:!n&&c&&c.isSelf,areMessagesLoaded:Boolean(Object(s.n)(e,t)),serverTimeOffset:r}},(e,t)=>Object(l.l)(t,["loadFullUser","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:r,withUsername:s,withFullInfo:l,withUpdatingStatus:h,noStatusOrTyping:f,noRtl:p,user:O,isSavedMessages:g,a
//# sourceMappingURL=0.70d39e3b6708f3605239.js.map