mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-02 17:48:34 +01:00
2 lines
102 KiB
JavaScript
2 lines
102 KiB
JavaScript
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(108).concat([function(e,t,n){"use strict";var a=n(0),r=n(6),c=n(10),s=n(9),i=n(148),o=n(178),l=n(25),d=n(16),u=n(43),m=n(55),b=n(42);n(212);t.a=e=>{const{ref:t,buttonRef:n,icon:h,className:f,style:p,children:O,disabled:g,ripple:v,narrow:j,inactive:E,focus:y,destructive:C,multiline:N,isStatic:T,contextActions:w,onClick:M}=e;let I=Object(a.q)(null);t&&(I=t);const[S,L,k]=Object(l.a)(),{isContextMenuOpen:A,contextMenuPosition:x,handleBeforeContextMenu:D,handleContextMenu:R,handleContextMenuClose:_,handleContextMenuHide:F}=Object(i.a)(I,!w),P=Object(a.m)(()=>I.current,[]),U=Object(a.m)(()=>I.current.closest(".custom-scroll"),[]),B=Object(a.m)(()=>I.current.querySelector(".ListItem-context-menu .bubble"),[]),{positionX:q,positionY:H,style:$}=Object(o.a)(x,P,U,B),K=Object(a.m)(e=>{!g&&M&&(M(e),r.n&&!v&&(L(),Object(c.b)(k)))},[g,L,M,v,k]),V=Object(a.m)(e=>{E||r.n||(!w||2!==e.button&&M||D(e),0===e.button&&(M?K(e):R(e)))},[E,w,M,D,R,K]),z=Object(d.a)(),W=Object(s.a)("ListItem",f,!T&&"no-selection",v&&"has-ripple",j&&"narrow",g&&"disabled",E&&"inactive",x&&"has-menu-open",y&&"focus",C&&"destructive",N&&"multiline",T&&"is-static");return a.a.createElement("div",{ref:I,className:W,dir:z.isRtl?"rtl":void 0,style:p},a.a.createElement("div",{className:Object(s.a)("ListItem-button",S&&"active"),role:"button",ref:n,tabIndex:0,onClick:!E&&r.n?K:void 0,onMouseDown:V,onContextMenu:!E&&w?R:void 0},h&&a.a.createElement("i",{className:"icon-"+h}),N&&a.a.createElement("div",{className:"multiline-item"},O),!N&&O,!g&&!E&&v&&a.a.createElement(u.a,null)),w&&void 0!==x&&a.a.createElement(m.a,{isOpen:A,positionX:q,positionY:H,style:$,className:"ListItem-context-menu",autoClose:!0,onClose:_,onCloseAnimationEnd:F},w.map(e=>a.a.createElement(b.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(10),c=n(51);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(8),c=n(57),s=n(31);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(1),c=n(13),s=n(7),i=n(4),o=n(22),l=n(3),d=n(16),u=n(114),m=n(137),b=n(159);t.a=Object(a.h)(Object(r.h)((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,c=Object(s.Jb)(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,wi
|
||
|
//# sourceMappingURL=0.f2808a011513b284cd67.js.map
|