mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 10:47:04 +01:00
2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[739],{7799:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(9118),c=n(6752),s=n(8674),a=n(5332);let l,i;async function d(){return l||(l=n.e(941).then(n.bind(n,7941)),i=(await l).default),l}setTimeout(d,5e3);const u=(0,r.X$)((({className:e,id:t,animationData:n,play:l,playSegment:u,speed:m,noLoop:f,size:p,quality:h,isLowPriority:v,onLoad:g,color:Z})=>{const[w,y]=(0,r.eJ)(),E=(0,r.sO)(null),C=(0,r.sO)(!1),b=(0,r.sO)(!1),I=(0,r.sO)(!0),P=(0,r.sO)();P.current=l;const A=(0,r.sO)();A.current=u,(0,r.d4)((()=>{if(w||!n)return;const e=()=>{if(!E.current)return;const e=new i(t,E.current,n,{noLoop:f,size:p,quality:h,isLowPriority:v},g,Z);m&&e.setSpeed(m),y(e)};i?e():d().then((()=>{(0,o.T2)((()=>{E.current&&e()}))}))}),[Z,w,n,t,v,f,g,h,p,m]),(0,r.d4)((()=>{w&&w.setColor(Z)}),[Z,w]),(0,r.d4)((()=>()=>{w&&w.destroy()}),[w]);const T=(0,r.I4)(((e=!1)=>{w&&(P.current||A.current)&&(A.current?w.playSegment(A.current):e?w.goToAndPlay(0):w.play())}),[w]),N=(0,r.I4)((()=>{w&&w.pause()}),[w]),S=(0,r.I4)((()=>{b.current=!0,w&&(C.current||(C.current=w.isPlaying()),N())}),[w,N]),k=(0,r.I4)((()=>{C.current&&T(),C.current=!1,b.current=!1}),[T]),L=(0,r.I4)((()=>{(0,o.T2)(k)}),[k]);(0,r.d4)((()=>{w&&(l||u?b.current?C.current=!0:T(f):b.current?C.current=!1:N())}),[w,l,u,f,T,N]),(0,r.d4)((()=>{w&&(I.current?I.current=!1:(w.changeData(n),T()))}),[T,w,n]),(0,s.ZP)(S,k),(0,a.Z)(S,L);const B=(0,c.Z)("AnimatedSticker",e),x=p?`width: ${p}px; height: ${p}px;`:void 0;return r.ZP.createElement("div",{ref:E,className:B,style:x})}))},172:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),o=n(6137),c=n(3716),s=n(2858),a=n(2155),l=n(6752),i=n(2340),d=n(6202),u=n(1212),m=n(9107);const f=(0,r.X$)((({className:e,size:t="large",chat:n,user:f,photo:p,userStatus:h,text:v,isSavedMessages:g,lastSyncTime:Z,onClick:w})=>{const y=f&&(0,s.NB)(f),E=f&&(0,s.pK)(f.id);let C;g||y||(f?C=(0,s.RT)(f):n?C=(0,s.RT)(n):p&&(C=`photo${p.id}?size=m`));const b=(0,d.Z)(C,!1,o.IU.BlobUrl,Z),I=Boolean(b),{transitionClassNames:P}=(0,u.Z)(I,void 0,I,"slow"),A=(0,m.Z)();let T="";if(g)T=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(y)T=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(E)T=r.ZP.createElement("i",{className:"icon-reply-filled"});else if(b)T=r.ZP.createElement("img",{src:b,className:(0,l.Z)("avatar-media",P),alt:"",decoding:"async"});else if(f){const e=(0,s.Js)(f);T=e?(0,a.Xv)(e,2):void 0}else if(n){const e=(0,s.U)(A,n);T=e&&(0,a.Xv)(e,(0,s.YC)(n.id)?2:1)}else v&&(T=(0,a.Xv)(v,2));const N=!g&&f&&h&&(0,s.kM)(f,h),S=(0,l.Z)(`Avatar size-${t}`,e,`color-bg-${(0,s.Rs)(f||n)}`,g&&"saved-messages",y&&"deleted-account",E&&"replies-bot-account",N&&"online",w&&"interactive",!g&&!b&&"no-photo"),k=Boolean(g||b),L=(0,r.I4)((e=>{w&&w(e,k)}),[w,k]),B=(f||n)&&(f||n).id;return r.ZP.createElement("div",{className:S,onClick:L,"data-test-sender-id":c.Cg?B:void 0},"string"==typeof T?(0,i.Z)(T,["jumbo"===t?"hq_emoji":"emoji"]):T)}))},7551:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(9107),c=n(3103),s=n(231);const a=(0,r.X$)((({isOpen:e,onClose:t,onCloseAnimationEnd:n,title:a,header:l,text:i,textParts:d,confirmLabel:u="Confirm",confirmHandler:m,confirmIsDestructive:f,isButtonsInOneRow:p,children:h})=>{const v=(0,o.Z)();return r.ZP.createElement(c.Z,{className:"confirm",title:a,header:l,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:m},i&&i.split("\\n").map((e=>r.ZP.createElement("p",null,e))),d||h,r.ZP.createElement("div",{className:p?"dialog-buttons mt-2":""},r.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:m,color:f?"danger":"primary"},u),r.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:t},v("Cancel"))))}))},1273:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(1713),o=n(4050),c=n(9118),s=n(7675);const a=({ref:e,className:t,onLoadMore:n,onScroll:a,onKeyDown:l,items:i,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:f=!1,noScrollRestoreOnTop:p=!1,noFastList:h,cacheBuster:v,children:g})=>{let Z=(0,o.sO)(null);e&&(Z=e);const w=(0,o.sO)({}),[y,E]=(0,o.Ye)((()=>n?[(0,c.Ds)(((e=!1)=>{n({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{n({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[n,i]);(0,o.d4)((()=>{if(!y)return;if(u>0&&(!i||i.length<u))return void y(!0);const{scrollHeight:e,clientHeight:t}=Z.current;t&&e<=t&&y()}),[i,y,u]),(0,o.bt)((()=>{const e=Z.current,t=w.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:r}=e;n=r+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}f||p&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[i,d,f,p,v]);const C=(0,o.I4)((e=>{if(E&&y){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=w.current,r=w.current.listItemElements;if(e)return void(w.current.isScrollTopJustUpdated=!1);const o=r.length,c=Z.current,{scrollTop:s,scrollHeight:a,offsetHeight:l}=c,i=s<=(o?r[0].offsetTop:0)+m,d=(o?r[o-1].offsetTop+r[o-1].offsetHeight:a)-(s+l)<=m;let u=!1;if(i){const e=r[0];if(e){const r=e.getBoundingClientRect().top,o=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&o>n&&(w.current.currentAnchor=e,w.current.currentAnchorTop=r,u=!0,E())}}if(d){const e=r[o-1];if(e){const r=e.getBoundingClientRect().top,o=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&o<n&&(w.current.currentAnchor=e,w.current.currentAnchorTop=r,u=!0,y())}}if(!u)if(null!=t&&t.offsetParent)w.current.currentAnchorTop=t.getBoundingClientRect().top;else{const e=r[0];e&&(w.current.currentAnchor=e,w.current.currentAnchorTop=e.getBoundingClientRect().top)}}a&&a(e)}),[y,E,a,m]);return o.ZP.createElement("div",{ref:Z,className:t,onScroll:C,teactFastList:!h,onKeyDown:l},g)}},3103:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),o=n(517),c=n(6752),s=n(8674),a=n(1212),l=n(274),i=n(9107),d=n(6590),u=n(231),m=n(2898);const f=({dialogRef:e,title:t,className:n,isOpen:f,header:p,hasCloseButton:h,noBackdrop:v,children:g,onClose:Z,onCloseAnimationEnd:w,onEnter:y,shouldSkipHistoryAnimations:E})=>{const{shouldRender:C,transitionClassNames:b}=(0,a.Z)(f,w,E,void 0,E),I=(0,r.sO)(null);(0,r.d4)((()=>f?(0,o.Z)({onEsc:Z,onEnter:y}):void 0),[f,Z,y]),(0,r.d4)((()=>f&&I.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const r=n.findIndex((e=>e.isSameNode(document.activeElement)));let o=0;r>=0&&(o=t.shiftKey?r>0?r-1:n.length-1:r<n.length-1?r+1:0),n[o].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}(I.current):void 0),[f]);const{forceClose:P}=(0,d.ZP)(f,Z);(0,r.d4)((()=>()=>{f&&P()}),[]),(0,l.Z)((([e])=>(document.body.classList.toggle("has-open-dialog",f),(f||!f&&void 0!==e)&&(0,s.YW)(200),()=>{document.body.classList.remove("has-open-dialog")})),[f]);const A=(0,i.Z)();if(!C)return;const T=(0,c.Z)("Modal",n,b,v&&"transparent-backdrop");return r.ZP.createElement(m.Z,null,r.ZP.createElement("div",{ref:I,className:T,tabIndex:-1,role:"dialog"},r.ZP.createElement("div",{className:"modal-container"},r.ZP.createElement("div",{className:"modal-backdrop",onClick:Z}),r.ZP.createElement("div",{className:"modal-dialog",ref:e},p||(t?r.ZP.createElement("div",{className:"modal-header"},h&&r.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:A("Close"),onClick:Z},r.ZP.createElement("i",{className:"icon-close"})),r.ZP.createElement("div",{className:"modal-title"},t)):void 0),r.ZP.createElement("div",{className:"modal-content custom-scroll"},g)))))}},2898:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),o=n(2916);const c=({containerId:e,className:t,children:n})=>{const c=(0,r.sO)();return c.current||(c.current=document.createElement("div")),(0,r.bt)((()=>{const n=document.querySelector(e||"#portals");if(!n)return;const r=c.current;return t&&r.classList.add(t),n.appendChild(r),()=>{o.Z.render(void 0,r),n.removeChild(r)}}),[t,e]),o.Z.render(n,c.current)}},5332:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);function o(e,t){(0,r.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},8360:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7204);function o(e,t=!1,n=!1){const o=(0,r.Z)(e,t);return n||null!=e?e:o}},7407:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),o=n(1713),c=n(782),s=n(5326),a=n(7204);const l=(e,t,n=!1,l=30,d=!1)=>{const u=(0,r.sO)(),m=(0,r.sO)((()=>{if(!t||u.current)return;const{newViewportIds:e}=i(t,o.Uq.Forwards,l,t[0]);return e})()),f=(0,s.Z)(),p=(0,a.Z)(t),h=(0,a.Z)(n);if(t&&!n&&(t!==p||n!==h)){const{offsetId:e=t[0],direction:n=o.Uq.Forwards}=u.current||{},{newViewportIds:r}=i(t,n,l,e);m.current&&(0,c.et)(m.current,r)||(m.current=r)}(0,r.d4)((()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}}),[t,n,e,d]);const v=(0,r.I4)((({direction:n,noScroll:r})=>{const s=m.current,a=s?n===o.Uq.Backwards?s[s.length-1]:s[0]:void 0;if(!t)return void(e&&e({offsetId:a}));r||(u.current={...u.current,direction:n,offsetId:a});const{newViewportIds:d,areSomeLocal:p,areAllLocal:h}=i(t,n,l,a);!p||s&&(0,c.et)(s,d)||(m.current=d,f()),!h&&e&&e({offsetId:a})}),[t,l,e,f]);return n?[t]:[m.current,v]};function i(e,t,n,r){const{length:c}=e,s=r?e.indexOf(r):0,a=t===o.Uq.Forwards?s:s+1||c,l=Math.max(0,a-n),i=a+n-1,d=e.slice(Math.max(0,l),i+1);let u,m;switch(t){case o.Uq.Forwards:u=a>0,m=l>=0;break;case o.Uq.Backwards:u=a<c,m=i<=c-1}return{newViewportIds:d,areSomeLocal:u,areAllLocal:m}}},6202:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6137),c=n(647),s=n(5326);const a=(e,t=!1,n=o.IU.BlobUrl,a,l)=>{const i=e?c.UV(e):void 0,d=(0,s.Z)();return(0,r.d4)((()=>{if(!t&&e&&!i){const t=Date.now();c.he(e,n).then((()=>{const e=Date.now()-t;!l||e>=l?d():setTimeout(d,l-e)}))}}),[t,e,i,n,a,d,l]),i}},4319:(e,t,n)=>{n.d(t,{yl:()=>o,TE:()=>s,VP:()=>a});var r=n(3716);const o=navigator.clipboard&&window.ClipboardItem,c=document.createElement("textarea");c.setAttribute("readonly",""),c.tabIndex=-1,c.className="visually-hidden";const s=e=>{c.value=e,document.body.appendChild(c);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);c.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(c)},a=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),r=new Image;r.onload=e=>{if(n&&e.currentTarget){const r=e.currentTarget;t.width=r.width,t.height=r.height,n.drawImage(r,0,0,r.width,r.height),t.toBlob(l,"image/png",1)}},r.src=e};async function l(e){if(e&&o)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){r.eM&&console.error(e)}}},2972:(e,t,n)=>{function r(e){e.offsetWidth}n.d(t,{Z:()=>r})},7675:(e,t,n)=>{n.d(t,{Z:()=>c,z:()=>s});var r=n(7361),o=n(2972);const c=(e,t)=>{r.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),r.cj&&(e.style.overflow="")};function s(e){e.style.display="none",(0,o.Z)(e),e.style.display=""}},4753:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(3716);const o=e=>{e.play().catch((t=>{r.eM&&console.warn(t,e)}))}}}]);
|
|
//# sourceMappingURL=739.6fe3d94f039ecb571067.js.map
|