mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 18:57:12 +01:00
2 lines
109 KiB
JavaScript
2 lines
109 KiB
JavaScript
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[519],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(4399),i=n(3657),o=n(6202),l=n(692),c=n(706),d=n(7799);const u={large:160,medium:128,small:104},m=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:h})=>{var f;const v=(0,a.sO)(null),[p,g]=(0,c.Z)(),Z=`sticker${e.id}`,E=(0,i.Op)(v,n),P=null===(f=e.thumbnail)||void 0===f?void 0:f.dataUri,y=(0,o.Z)(`${Z}?size=m`,!E&&!h,r.IU.BlobUrl,m),C=(0,l.Z)(y),b=(0,o.Z)(Z,!E,r.IU.Lottie,m),N=Boolean(b),[w,k]=(0,a.eJ)(String(Math.random())),I=(0,a.I4)((()=>{k(String(Math.random()))}),[]),T=u[t],M=`width: ${T}px; height: ${T}px;`;return a.ZP.createElement("div",{ref:v,className:"AnimatedEmoji media-inner",style:M,onClick:I},!p&&P&&a.ZP.createElement("img",{src:P,className:e.id===s.wB?"like-sticker-thumb":void 0,alt:""}),!p&&y&&a.ZP.createElement("img",{src:y,className:C,alt:""}),N&&a.ZP.createElement(d.Z,{key:Z,id:Z,animationData:b,size:T,quality:1,play:E&&w,noLoop:!0,onLoad:g}))}},4752:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(4050),r=n(5116),s=n(6137),i=n(1713),o=n(7361),l=n(790),c=n(2858),d=n(6752),u=n(2340),m=n(5376),h=n(2566),f=n(1212),v=n(2019),p=n(3186),g=n(9107),Z=n(1174),E=n(6202),P=n(396),y=n(663),C=n(231),b=n(9196),N=n(8033);const w=o.wB?20:25,k=o.wB?50:75;function I(e,t,n){return a.ZP.createElement("div",{className:"seekline no-selection",ref:n},a.ZP.createElement("span",{className:"seekline-buffered-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const T=(0,a.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:T,origin:M,date:S,lastSyncTime:x,className:L,isSelectable:$,isSelected:F,isDownloading:A,onPlay:O,onReadMedia:R,onCancelUpload:D,onDateClick:U})=>{const{content:{audio:B,voice:V,video:X},isMediaUnread:K}=t,z=Boolean(V||X),Y=(0,a.sO)(!1),j=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,g.Z)(),{isRtl:W}=q,J=(0,r.uC)(),[_,G]=(0,a.eJ)(!1),Q=x,ee=(0,c.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,c.Ti)(t,"inline"),!Q,(0,c.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,c.Ti)(t,"download"),!A),re=(0,a.I4)((()=>{G(!0),O(t.id,t.chatId)}),[t,O]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:le,checkBuffering:ce}=(0,v.Z)(),{isPlaying:de,playProgress:ue,playPause:me,play:he,pause:fe,setCurrentTime:ve,duration:pe}=(0,p.Z)((0,P.An)(t),(0,c.XV)(t),z?"voice":"audio",ne,le,void 0,ce,_,re,se,(0,c.CI)(t)),ge=(0,c.B4)(t),Ze=function(e,t,n=0,r=!1){const s=(0,a.sO)(null),{data:i,peak:o}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const a=Math.min(n/10,1),r=Math.round(w+(k-w)*a);return function(e,t){let n=0;const a=new Array(t),r=e.length/t,s=e[0],i=e[e.length-1];for(let d=0;d<t;d++){var o,l,c;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(l=e[t])&&void 0!==l?l:s)+(null!==(c=e[t+1])&&void 0!==c?c:i))/3;a[d]=u,n<u&&(n=u)}return{data:a,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=r[t]+(r[t+1]<<8);a[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),o=r[s]+(r[s+1]<<8);return a[n-1]=o>>i&31,a}(new Uint8Array(e)),r)}),[t])||{};return(0,a.bt)((()=>{const t=s.current;t&&i&&void 0!==o&&function(e,t,n,{peak:a,fillStyle:r,progressFillStyle:s}){const i=4*t.length;e.width=2*i,e.height=46,e.style.width=`${i}px`,e.style.height="23px";const o=e.getContext("2d");o.scale(2,2),t.forEach(((e,i)=>{o.globalAlpha=i/t.length>=n?.5:1,o.fillStyle=n>i/t.length?s:r;const l=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,a,r,s){2<2*s&&(s=1),r<2*s&&(s=r/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-r,s),e.arcTo(t+2,n-r,t,n-r,s),e.arcTo
|
||
|
//# sourceMappingURL=519.1679cb6fb0287d9b7d78.js.map
|