mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-11 16:49:44 +01:00
2 lines
98 KiB
JavaScript
2 lines
98 KiB
JavaScript
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(105).concat([function(e,t,n){"use strict";var a=n(0),r=n(7),c=n(8),s=n(144),i=n(173),o=n(26),l=n(42),d=n(53),u=n(41);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:S,handleBeforeContextMenu:L,handleContextMenu:I,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)(S,x,D,R),U=Object(a.m)(e=>{!p&&N&&N(e)},[p,N]),B=Object(a.m)(e=>{v||r.l||(!T||2!==e.button&&N||L(e),0===e.button&&(N?U(e):I(e)))},[v,T,N,L,I,U]),H=Object(o.a)(),q=Object(c.a)("ListItem",b,!C&&"no-selection",O&&"has-ripple",g&&"narrow",p&&"disabled",v&&"inactive",S&&"has-menu-open",j&&"focus",E&&"destructive",y&&"multiline",C&&"is-static");return a.a.createElement("div",{ref:w,className:q,dir:H.isRtl?"rtl":void 0,style:h},a.a.createElement("div",{className:"ListItem-button",role:"button",ref:n,tabIndex:0,onClick:!v&&r.l?U:void 0,onMouseDown:B,onContextMenu:!v&&T?I: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!==S&&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(48);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.g: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(54),s=n(27);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(5),i=n(4),o=n(24),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.Hb)(e,t);return{lastSyncTime:a,user:c,isSavedMessages:!n&&c&&c.isSelf,areMessagesLoaded:Boolean(Object(s.m)(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.99440f9419554c31523e.js.map
|