telegram-tt/dist/37.9e975e031ef296075093.js
Alexander Zinchuk b8909192b3 [Build]
2022-01-24 04:57:29 +01:00

2 lines
113 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[37],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(6752),i=n(3657),o=n(6202),c=n(692),l=n(5296),d=n(4399),u=n(7799);const m=(0,a.X$)((({sticker:e,effect:t,isOwn:n,soundId:m,size:h="medium",observeIntersection:f,lastSyncTime:v,forceLoadPreview:p,messageId:g,chatId:Z,activeEmojiInteraction:E})=>{var P;const{markAnimationLoaded:y,isAnimationLoaded:C,ref:b,width:N,style:w,handleClick:k,playKey:I}=(0,l.Z)(h,Z,g,m,E,n,void 0,null==t?void 0:t.emoji),T=`sticker${e.id}`,M=(0,i.Op)(b,f),S=null===(P=e.thumbnail)||void 0===P?void 0:P.dataUri,x=(0,o.Z)(`${T}?size=m`,!M&&!p,r.IU.BlobUrl,v),L=(0,c.Z)(x),$=(0,o.Z)(T,!M,r.IU.Lottie,v),A=Boolean($);return a.ZP.createElement("div",{ref:b,className:(0,s.Z)("AnimatedEmoji media-inner",e.id===d.wB&&"like-sticker-thumb"),style:w,onClick:k},!C&&S&&a.ZP.createElement("img",{src:S,alt:""}),!C&&x&&a.ZP.createElement("img",{src:x,className:L,alt:""}),A&&T&&a.ZP.createElement(u.Z,{key:T,id:T,animationData:$,size:N,quality:1,play:M&&I,forceOnHeavyAnimation:!0,noLoop:!0,onLoad:y}))}))},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),c=n(790),l=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(711),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:A,isDownloading:O,onPlay:F,onReadMedia:R,onCancelUpload:D,onDateClick:U})=>{const{content:{audio:B,voice:X,video:V},isMediaUnread:j}=t,z=Boolean(X||V),K=(0,a.sO)(!1),Y=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,g.Z)(),{isRtl:W}=q,_=(0,r.uC)(),[J,G]=(0,a.eJ)(!1),Q=x,ee=(0,l.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,l.Ti)(t,"inline"),!Q,(0,l.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,l.Ti)(t,"download"),!O),re=(0,a.I4)((()=>{G(!0),F(t.id,t.chatId)}),[t,F]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:ce,checkBuffering:le}=(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,l.XV)(t),z?"voice":"audio",ne,ce,void 0,le,J,re,se,(0,l.CI)(t)),ge=(0,l.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,c,l;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(c=e[t])&&void 0!==c?c:s)+(null!==(l=e[t+1])&&void 0!==l?l: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 c=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(t,n-r,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(o,4*i,23,0,c,1),o.fill()}))}(t,i,n,{peak:o,fillStyle:r?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:r?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[r,o,n,i,e]),s}(e,X,j&&!ge?1:ue,ge),Ee=de||ue>0&&ue<1;(0,a.d4)((()=>{G(de)}),[de]);const Pe=J&&!ie,{isUploading:ye,isTransferring:Ce,transferProgress:be}=(0,l.Sc)(t,T||ae,Pe||O),{shouldRender:Ne,transitionClassNames:we}=(0,f.Z)(Ce),ke=Ne&&(Pe||ye),Ie=(0,a.I4)((()=>{ye?null==D||D():(de||F(t.id,t.chatId),(0,r.uC)().setAudioPlayerOrigin({origin:M}),G(!J),me())}),[ye,de,J,me,D,F,t.id,t.chatId,M]);(0,a.d4)((()=>{R&&j&&(de||O)&&R()}),[de,j,R,O]);const Te=(0,a.I4)((()=>{O?_.cancelMessageMediaDownload({message:t}):_.downloadMessageMedia({message:t})}),[_,O,t]),Me=(0,a.I4)((e=>{if(K.current&&H.current){const{width:t,left:n}=H.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),ve(Math.max(Math.min(pe*((a-n)/t),pe-.1),.001))}}),[pe,ve]),Se=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(K.current=!0,Y.current=de,fe(),Me(e))}),[Me,fe,de]),xe=(0,a.I4)((()=>{K.current=!1,Y.current&&he()}),[he]),Le=(0,a.I4)((()=>{U(t.id,t.chatId)}),[U,t.id,t.chatId]);function $e(){if(z)return n||"Voice";const{title:e,fileName:t}=B;return e||t}(0,a.d4)((()=>{if(H.current&&Ee)return(0,Z.s)(H.current,{onCapture:Se,onRelease:xe,onClick:xe,onDrag:Me})}),[Ee,Se,Me,xe]);const Ae=(0,d.Z)("Audio",L,ge&&M===i.Cr.Inline&&"own",(M===i.Cr.Search||M===i.Cr.SharedMedia)&&"bigger",A&&"audio-is-selected"),Oe=["toggle-play"];ke?Oe.push("loading"):de?Oe.push("pause"):de||Oe.push("play");const Fe=(0,d.Z)("content",Ee&&"with-seekline");function Re(){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:Fe},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:$e()},(0,u.Z)($e())),a.ZP.createElement("div",{className:"message-date"},S&&a.ZP.createElement(N.Z,{className:"date",onClick:Le},(0,c.VX)(q,1e3*S)))),Ee&&a.ZP.createElement("div",{className:"meta search-result",dir:W?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},ue<1&&`${(0,c.k9)(pe*ue,pe)}`),I(ue,oe,H)),!Ee&&function(){if(z)return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,c.k9)((X||V).duration));const{performer:e}=B;return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,c.k9)(pe),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,u.Z)(e)),e&&n&&a.ZP.createElement("span",{className:"bullet"},"•"),n&&a.ZP.createElement("span",{title:n},(0,u.Z)(n)))}()))}return a.ZP.createElement("div",{className:Ae,dir:q.isRtl?"rtl":"ltr"},$&&a.ZP.createElement("div",{className:"message-select-control"},A&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement(C.Z,{round:!0,ripple:!o.wB,size:"smaller",color:te?"translucent-white":"primary",className:Oe.join(" "),ariaLabel:de?"Pause audio":"Play audio",onClick:Ie,isRtl:q.isRtl,backgroundImage:te},a.ZP.createElement("i",{className:"icon-play"}),a.ZP.createElement("i",{className:"icon-pause"})),Ne&&a.ZP.createElement("div",{className:(0,d.Z)("media-loading",we,ke&&"interactive")},a.ZP.createElement(b.Z,{progress:be,transparent:!0,size:"m",onClick:ke?Ie:void 0,noCross:!ke})),B&&!ye&&a.ZP.createElement(C.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:O?"Cancel download":"Download",onClick:Te},a.ZP.createElement("i",{className:O?"icon-close":"icon-arrow-down"})),M===i.Cr.Search&&Re(),M!==i.Cr.Search&&B&&function(e,t,n,r,s,i,o,l,d,h,f){const{title:v,performer:p,fileName:g}=t,Z=r||s>0&&s<1,{isRtl:E}=y.i0;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:v},(0,u.Z)(v||g)),Z&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,c.k9)(n*s,n)),I(s,i,o)),!Z&&l&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},h?`${(0,m.yW)(t.size*h)} / `:void 0,(0,m.yW)(t.size)),!Z&&!l&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,c.k9)(n)),a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:p},(0,u.Z)(p||"Unknown")),d&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(N.Z,{className:"date",onClick:f},(0,c.ZK)(e,1e3*d,!0)))))}(q,B,pe,de,ue,oe,H,O||ye,S,be,U?Le:void 0),M===i.Cr.SharedMedia&&(X||V)&&Re(),M===i.Cr.Inline&&X&&function(e,t,n,r,s){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),a.ZP.createElement("p",{className:(0,d.Z)("voice-duration",s&&"unread"),dir:"auto"},0===r?(0,c.k9)(e.duration):(0,c.k9)(e.duration*r)))}(X,H,Ze,ue,j))}))},2531:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"CalendarModal",!t);return n?a.ZP.createElement(n,e):void 0}))},180:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),c=n(4319),l=n(6272),d=n(9107),u=n(1876),m=n(3321);const h=(0,a.X$)((0,r.c$)(((e,{chatOrUserId:t})=>{const{lastSyncTime:n,countryList:{phoneCodes:a}}=e,r=t?(0,s.Z1)(e,t):void 0,o=(0,i.YC)(t)?(0,s.dy)(e,t):void 0,c=r&&(0,i.i4)(r,(0,s.dZ)(e),(0,s.NJ)(e));return{lastSyncTime:n,phoneCodeList:a,chat:r,user:o,canInviteUsers:r&&!o&&(!(0,i.eA)(r)&&!(0,i.Mg)(r,"inviteUsers")||(0,i.VE)(r,"inviteUsers")),isMuted:c}}))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:s,canInviteUsers:h,isMuted:f,phoneCodeList:v})=>{const{loadFullUser:p,showNotification:g,updateChatMutedState:Z}=(0,r.uC)(),{id:E,fullInfo:P,username:y,phoneNumber:C,isSelf:b}=t||{},{id:N}=n||{},w=(0,d.Z)();(0,a.d4)((()=>{e&&E&&p({userId:E})}),[p,E,e]);const k=(0,a.I4)((()=>{Z({chatId:N,isMuted:!f})}),[N,f,Z]);if(!n||n.isRestricted||b&&!s)return;function I(e,t){(0,c.TE)(e),g({message:`${t} was copied`})}const T=C&&(0,l.WZ)(v,C),M=(0,i.hu)(n),S=(null==P?void 0:P.bio)||(0,i.GM)(n);return a.ZP.createElement("div",{className:"ChatExtra"},T&&!!T.length&&a.ZP.createElement(u.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(T,w("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},T),a.ZP.createElement("span",{className:"subtitle"},w("Phone"))),y&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(`@${y}`,w("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(y)),a.ZP.createElement("span",{className:"subtitle"},w("Username"))),S&&!!S.length&&a.ZP.createElement(u.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(S,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},w(E?"UserBio":"Info"))),(h||!y)&&M&&a.ZP.createElement(u.Z,{icon:n.username?"mention":"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(M,w("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},M),a.ZP.createElement("span",{className:"subtitle"},w("SetUrlPlaceholder"))),!s&&a.ZP.createElement(u.Z,{icon:"unmute",ripple:!0,onClick:k},a.ZP.createElement("span",null,w("Notifications")),a.ZP.createElement(m.Z,{id:"group-notifications",label:E?"Toggle User Notifications":"Toggle Chat Notifications",checked:!f,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(9107),c=n(2340),l=n(172),d=n(3103),u=n(231);const m=(0,a.X$)((0,r.c$)(((e,{chat:t})=>{const n=(0,i.YC)(t.id),a=(0,s.FM)(e,t.id),r=n&&(0,s.dy)(e,(0,i.zX)(t)),o=r&&(0,i.cS)(r)&&!t.isSupport,c=n&&!a&&!o,l=n?(0,i.Vl)((0,s.dy)(e,(0,i.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isBot:o,isChannel:(0,i.eA)(t),isBasicGroup:(0,i.G9)(t),isSuperGroup:(0,i.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:l}}))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:s,isChatWithSelf:m,isBot:h,isBasicGroup:f,isSuperGroup:v,currentUserId:p,canDeleteForAll:g,contactName:Z,onClose:E,onCloseAnimationEnd:P})=>{const{leaveChannel:y,deleteHistory:C,deleteChannel:b,deleteChatUser:N,blockContact:w}=(0,r.uC)(),k=(0,o.Z)(),I=(0,i.U)(k,t),T=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),E()}),[C,t.id,E]),M=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),w({contactId:t.id,accessHash:t.accessHash}),E()}),[C,t.id,t.accessHash,w,E]),S=(0,a.I4)((()=>{s?C({chatId:t.id,shouldDeleteForAll:!1}):f?(N({chatId:t.id,userId:p}),C({chatId:t.id,shouldDeleteForAll:!1})):!n&&!v||t.isCreator?(n||v)&&t.isCreator&&b({chatId:t.id}):y({chatId:t.id}),E()}),[s,f,n,v,p,t.isCreator,t.id,E,C,N,y,b]);return a.ZP.createElement(d.Z,{isOpen:e,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:k.isRtl?"rtl":void 0},a.ZP.createElement(l.Z,{size:"tiny",chat:t,isSavedMessages:m}),a.ZP.createElement("h3",{className:"modal-title"},k(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":f||v?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:P},n&&t.isCreator?a.ZP.createElement("p",null,(0,c.Z)(k("ChatList.DeleteAndLeaveGroupConfirmation",I),["simple_markdown"])):n&&!t.isCreator||f||v?a.ZP.createElement("p",null,(0,c.Z)(k("ChannelLeaveAlertWithName",I),["simple_markdown"])):a.ZP.createElement("p",null,(0,c.Z)(k("ChatList.DeleteChatConfirmation",Z),["simple_markdown"])),h&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},k("DeleteAndStop")),g&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},Z?(0,c.Z)(k("ChatList.DeleteForEveryone",Z)):k("DeleteForAll")),a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},k(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":f||v?"Group.LeaveGroup":g?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},k("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(5376),i=n(2858),o=n(3657),c=n(2566),l=n(6202),d=n(706),u=n(7002);const m=(0,a.X$)((({message:e,observeIntersection:t,smaller:n,canAutoLoad:m,autoLoadFileMaxSizeMb:h,uploadProgress:f,withDate:v,datetime:p,className:g,sender:Z,isSelected:E,isSelectable:P,onCancelUpload:y,onMediaClick:C,onDateClick:b,isDownloading:N})=>{const w=(0,r.uC)(),k=(0,a.sO)(null),I=e.content.document,{fileName:T,size:M,timestamp:S}=I,x=(0,s.K2)(I)||"",L=(0,o.Op)(k,t),[$,A]=(0,d.Z)();(0,a.d4)((()=>{L&&A()}),[L,A]);const[O,F]=(0,a.eJ)(m&&(!h||M<=1048576*h)),R=Boolean(N||O&&$),D=(0,i.Ti)(e,"download"),{loadProgress:U,mediaData:B}=(0,c.Z)(D,!R,void 0,void 0,void 0,!0),X=Boolean(B),{isUploading:V,isTransferring:j,transferProgress:z}=(0,i.Sc)(e,f||U,R&&!X),K=(0,s.v6)(I),Y=K?(0,i.DH)(e):void 0,H=K?I.previewBlobUrl:void 0,q=(0,l.Z)((0,i.Ti)(e,"pictogram"),!L),W=C&&Boolean(I.mediaType),_=(0,a.I4)((()=>{V?y&&y():N?w.cancelMessageMediaDownload({message:e}):j?F(!1):W?C():w.downloadMessageMedia({message:e})}),[V,N,j,W,y,w,e,C]),J=(0,a.I4)((()=>{b(e.id,e.chatId)}),[b,e.id,e.chatId]);return a.ZP.createElement(u.Z,{ref:k,name:T,extension:x,size:M,timestamp:v?p||S:void 0,thumbnailDataUri:Y,previewData:H||q,smaller:n,isTransferring:j,isUploading:V,transferProgress:z,className:g,sender:Z,isSelectable:P,isSelected:E,actionIcon:W?(0,i.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:_,onDateClick:b?J:void 0})}))},7002:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(1212),s=n(692),i=n(6752),o=n(790),c=n(5376),l=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const f=(0,a.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:p,thumbnailDataUri:g,previewData:Z,className:E,smaller:P,isTransferring:y,isUploading:C,isSelectable:b,isSelected:N,transferProgress:w,actionIcon:k,onClick:I,onDateClick:T})=>{const M=(0,u.Z)();let S=(0,a.sO)(null);e&&(S=e);const x=(0,s.Z)(Z),{shouldRender:L,transitionClassNames:$}=(0,r.Z)(y,void 0,!0),A=(0,c.Oh)(f),O=(0,c.yW)(n),{width:F,height:R}=(0,l.lE)(P),D=(0,i.Z)("File",E,P&&"smaller",I&&!C&&"interactive",N&&"file-is-selected");return a.ZP.createElement("div",{ref:S,className:D,dir:M.isRtl?"rtl":void 0},b&&a.ZP.createElement("div",{className:"message-select-control"},N&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:C?void 0:I},g||Z?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:g,width:F,height:R,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:Z,className:(0,i.Z)("full-media",x),width:F,height:R,alt:""})):a.ZP.createElement("div",{className:`file-icon ${A}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),L&&a.ZP.createElement("div",{className:(0,i.Z)("file-progress",A,$)},a.ZP.createElement(m.Z,{progress:w,size:P?"s":"m",onClick:C?I:void 0})),I&&a.ZP.createElement("i",{className:(0,i.Z)("action-icon",k||"icon-download",L&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(t)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,y&&w?`${Math.round(100*w)}%`:O),p&&a.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(p)),!p&&v&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(h.Z,{onClick:T},(0,o.ZK)(M,1e3*v,!0))))),p&&v&&a.ZP.createElement(h.Z,{onClick:T},(0,o.VX)(M,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1713),i=n(2858),o=n(1638),c=n(2340),l=n(9107),d=n(172),u=n(9411),m=n(8729);const h=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{const{lastSyncTime:n}=e,a=(0,o.Z1)(e,t);return{lastSyncTime:n,chat:a,onlineCount:a?(0,o.YK)(e,a):void 0,areMessagesLoaded:Boolean((0,o.Zw)(e,t))}}))((({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:o,withFullInfo:h,withUpdatingStatus:f,withChatType:v,noRtl:p,chat:g,onlineCount:Z,areMessagesLoaded:E,lastSyncTime:P})=>{const{loadFullChat:y,openMediaViewer:C}=(0,r.uC)(),b=g&&(0,i.ZV)(g),{id:N,isMin:w,isRestricted:k}=g||{};(0,a.d4)((()=>{N&&!w&&h&&P&&y({chatId:N})}),[N,w,P,h,y,b]);const I=(0,a.I4)(((e,n)=>{g&&n&&(e.stopPropagation(),C({avatarOwnerId:g.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[g,t,C]),T=(0,l.Z)();if(g)return a.ZP.createElement("div",{className:"ChatInfo",dir:!p&&T.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:g.id,size:t,chat:g,onClick:n?I:void 0}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,c.Z)((0,i.U)(T,g))),g.isVerified&&a.ZP.createElement(u.Z,null)),function(){if(f&&!E&&!k)return a.ZP.createElement("span",{className:"status",dir:"auto"},T("Updating"));if(!g)return;if(e)return a.ZP.createElement(m.Z,{typingStatus:e});if(v)return a.ZP.createElement("div",{className:"status",dir:"auto"},T((0,i.l6)(g)));const t=o?g.username:void 0,n=function(e,t){const n=e((0,i.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(T,g),r=Z?`, ${T("OnlineCount",Z,"i")}`:void 0;return a.ZP.createElement("div",{className:"status"},t&&a.ZP.createElement("span",{className:"handle"},t),a.ZP.createElement("span",{className:"group-status"},n),r&&a.ZP.createElement("span",{className:"online-status"},r))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(790),s=n(9107),i=n(8018);const o=(0,a.X$)((({message:e,outgoingStatus:t})=>{const n=(0,s.Z)();return a.ZP.createElement("div",{className:"LastMessageMeta"},t&&a.ZP.createElement(i.Z,{status:t}),a.ZP.createElement("span",{className:"time"},(0,r.VX)(n,1e3*e.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(790),s=n(3227),i=n(2858),o=n(6752),c=n(6202),l=n(692);const d=(0,a.X$)((({message:e,idPrefix:t="shared-media",isProtected:n,onClick:d})=>{const u=(0,a.I4)((()=>{d(e.id,e.chatId)}),[e.id,e.chatId,d]),m=(0,i.DH)(e),h=(0,c.Z)((0,i.Ti)(e,"pictogram")),f=(0,l.Z)(h),v=(0,i.b7)(e);return a.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:d?u:void 0},a.ZP.createElement("img",{src:m,alt:"",draggable:!n,onContextMenu:n?s.Z:void 0}),a.ZP.createElement("img",{src:h,className:(0,o.Z)("full-media",f),alt:"",draggable:!n,onContextMenu:n?s.Z:void 0}),v&&a.ZP.createElement("span",{className:"video-duration"},v.isGif?"GIF":(0,r.k9)(v.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>i});var a,r=n(4050),s=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));const i=(0,r.X$)((({status:e})=>r.ZP.createElement("div",{className:"MessageOutgoingStatus"},r.ZP.createElement(s.Z,{name:"reveal",activeKey:a[e]},(()=>r.ZP.createElement("i",{className:`icon-message-${e}`}))))))},7262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6752),s=n(1212),i=n(2340),o=n(9107);const c=(0,a.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,o.Z)(),{transitionClassNames:c}=(0,s.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",c,t&&"with-description")},e,t&&a.ZP.createElement("p",{className:"description"},(0,i.Z)(n(t),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(2858),s=n(1273),i=n(4605),o=n(7687),c=n(1876),l=n(6058),d=n(8799),u=n(9187),m=n(7407),h=n(9107),f=n(4288);const v=(0,a.X$)((({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:v,notFoundText:p,searchInputId:g,isLoading:Z,noScrollRestore:E,onSelectedIdsChange:P,onFilterChange:y,onLoadMore:C})=>{const b=(0,a.sO)(null),N=t.length>10;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{b.current.focus()}))}),500)}),[]);const w=(0,a.I4)((e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),P(n),y("")}),[t,P,y]),k=(0,a.I4)((e=>{const{value:t}=e.currentTarget;y(t)}),[y]),[I,T]=(0,m.Z)(C,e,Boolean(n)),M=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:M.isRtl?"rtl":void 0},t.map(((e,n)=>a.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:N&&n<t.length-5,canClose:!0,onClick:w,clickArg:e}))),a.ZP.createElement(o.Z,{id:g,ref:b,value:n,onChange:k,placeholder:v||M("SelectChat")})),null!=I&&I.length?a.ZP.createElement(s.Z,{className:"picker-list custom-scroll",items:I,onLoadMore:T,noScrollRestore:E},I.map((e=>a.ZP.createElement(c.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>w(e),ripple:!0},a.ZP.createElement(i.Z,{label:"",checked:t.includes(e)}),(0,r.YC)(e)?a.ZP.createElement(l.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):Z||!I||I.length?a.ZP.createElement(f.Z,null):a.ZP.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),c=n(6752),l=n(9107),d=n(172);const u=(0,a.X$)((0,r.c$)(((e,{chatOrUserId:t})=>t?{chat:t?(0,s.Z1)(e,t):void 0,user:(0,i.YC)(t)?(0,s.dy)(e,t):void 0}:{}))((({icon:e,title:t,isMinimized:n,canClose:r,onClick:s,clickArg:u,chat:m,user:h,className:f})=>{const v=(0,l.Z)();let p,g;if(e&&t)p=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${e}`})),g=t;else if(m||h){p=a.ZP.createElement(d.Z,{chat:m,user:h,size:"small",isSavedMessages:null==h?void 0:h.isSelf});const e=!m||h&&!h.isSelf?(0,i.Vl)(h):(0,i.U)(v,m,h);g=e?(0,o.Z)(e):void 0}const Z=(0,c.Z)("PickerSelectedItem",f,n&&"minimized",r&&"closeable");return a.ZP.createElement("div",{className:Z,onClick:()=>s(u),title:n?g:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},g),r&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1713),i=n(1638),o=n(2858),c=n(2340),l=n(9107),d=n(172),u=n(9411),m=n(8729);const h=(0,a.X$)((0,r.c$)(((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,s=(0,i.dy)(e,t);return{lastSyncTime:a,user:s,userStatus:(0,i.ss)(e,t),isSavedMessages:!n&&s&&s.isSelf,areMessagesLoaded:Boolean((0,i.Zw)(e,t)),serverTimeOffset:r}}))((({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:i,withUsername:h,withFullInfo:f,withUpdatingStatus:v,noStatusOrTyping:p,noRtl:g,user:Z,userStatus:E,isSavedMessages:P,areMessagesLoaded:y,lastSyncTime:C,serverTimeOffset:b})=>{const{loadFullUser:N,openMediaViewer:w}=(0,r.uC)(),{id:k}=Z||{},I=(0,o.Js)(Z);(0,a.d4)((()=>{f&&C&&k&&N({userId:k})}),[k,N,C,f]);const T=(0,a.I4)(((e,n)=>{Z&&n&&(e.stopPropagation(),w({avatarOwnerId:Z.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[Z,t,w]),M=(0,l.Z)();if(Z)return a.ZP.createElement("div",{className:"ChatInfo",dir:!g&&M.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:Z.id,size:t,user:Z,isSavedMessages:P,onClick:i?T:void 0}),a.ZP.createElement("div",{className:"info"},P?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,M("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},I&&(0,c.Z)(I)),(null==Z?void 0:Z.isVerified)&&a.ZP.createElement(u.Z,null)),(n||!P&&!p)&&(n?a.ZP.createElement("span",{className:"status",dir:"auto"},n):v&&!y?a.ZP.createElement("span",{className:"status",dir:"auto"},M("Updating")):Z?e?a.ZP.createElement(m.Z,{typingStatus:e}):a.ZP.createElement("div",{className:"status "+((0,o.kM)(Z,E)?"online":"")},h&&Z.username&&a.ZP.createElement("span",{className:"handle"},Z.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,o.Tq)(M,Z,E,b))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>b});var a=n(4050),r=n(5116),s=n(1713),i=n(7361),o=n(1638),c=n(2858),l=n(2340),d=n(1174),u=n(6752),m=n(6137),h=n(647),f=n(9107),v=n(9411),p=n(2155),g=n(6202),Z=n(2937),E=n(7204),P=n(9204);const y=(0,a.X$)((({chat:e,user:t,photo:n,isFirstPhoto:r,isSavedMessages:s,lastSyncTime:i,onClick:o})=>{const d=(0,f.Z)(),h=t&&(0,c.NB)(t),v=e&&(0,c.pK)(e.id);function y(a,r){if(n&&!r)return`photo${n.id}?size=c`;let i;return s||h||v||(t?i=(0,c.RT)(t,a):e&&(i=(0,c.RT)(e,a))),i}const C=(0,g.Z)(y("big"),!1,m.IU.BlobUrl,i),b=r&&!C?y("normal",!0):void 0,N=(0,g.Z)(b,!1,m.IU.BlobUrl,i),w=(0,Z.Z)(!C&&n&&n.thumbnail&&n.thumbnail.dataUri),k=C||N||w,I=(0,E.Z)(k);let T="";if(s)T=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(h)T=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(v)T=a.ZP.createElement("i",{className:"icon-reply-filled"});else if(k)T=a.ZP.createElement("img",{src:k,className:"avatar-media",alt:"",decoding:"async"});else if(!k&&t){const e=(0,c.Js)(t);T=e?(0,p.Xv)(e,2):void 0}else if(!k&&e){const t=(0,c.U)(d,e);T=t&&(0,p.Xv)(t,(0,c.YC)(e.id)?2:1)}else T=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(P.Z,{color:"white"}));const M=(0,u.Z)("ProfilePhoto",`color-bg-${(0,c.Rs)(t||e)}`,s&&"saved-messages",h&&"deleted-account",v&&"replies-bot-account",!s&&!k&&"no-photo");return a.ZP.createElement("div",{className:M,onClick:k?o:void 0},I&&k&&I!==k&&a.ZP.createElement("img",{src:I,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof T?(0,l.Z)(T,["hq_emoji"]):T)}));var C=n(2255);const b=(0,a.X$)((0,r.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:a,serverTimeOffset:r}=e,s=(0,o.dy)(e,t),i=(0,o.ss)(e,t),c=(0,o.Z1)(e,t),l=!n&&s&&s.isSelf,{animationLevel:d}=e.settings.byKey;return{connectionState:a,user:s,userStatus:i,chat:c,isSavedMessages:l,animationLevel:d,serverTimeOffset:r}}))((({forceShowSelf:e,user:t,userStatus:n,chat:o,isSavedMessages:p,connectionState:g,animationLevel:Z,serverTimeOffset:E})=>{var P;const{loadFullUser:b,openMediaViewer:N}=(0,r.uC)(),w=(0,f.Z)(),{id:k}=t||{},{id:I}=o||{},T=t?(0,c.Js)(t):o?o.title:"",M=(null==t?void 0:t.photos)||(null==o?void 0:o.photos)||[],S=Z>=1?w.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[x,L]=(0,a.eJ)(0),$=p||M.length<=1||0===x,A=p||M.length<=1||x===M.length-1;(0,a.d4)((()=>{x>M.length&&L(Math.max(0,M.length-1))}),[x,M.length]),(0,a.d4)((()=>{"connectionStateReady"===g&&k&&!e&&b({userId:k})}),[k,b,g,e]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{h.UV(`photo${e.id}?size=c`)||h.he(`photo${e.id}?size=c`,m.IU.BlobUrl)}))}),[n,t])}(0,M,x);const O=(0,a.I4)((()=>{N({avatarOwnerId:k||I,profilePhotoIndex:x,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[N,k,I,x,e]),F=(0,a.I4)((()=>{$||L(x-1)}),[x,$]),R=(0,a.I4)((()=>{A||L(x+1)}),[x,A]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,d.s)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:i.$b?(e,t)=>t===d.e.Right?(F(),!0):t===d.e.Left&&(R(),!0):void 0})}),[R,F]),!t&&!o)return;function D(){const e=!p&&M&&M.length>0?M[x]:void 0;return a.ZP.createElement(y,{key:x,user:t,chat:o,photo:e,isSavedMessages:p,isFirstPhoto:$,onClick:O})}const U=null===(P=t||o)||void 0===P?void 0:P.isVerified;return a.ZP.createElement("div",{className:(0,u.Z)("ProfileInfo",e&&"self"),dir:w.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(p||!M||M.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},M.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===x?"current":"")}))))}(),a.ZP.createElement(C.Z,{activeKey:x,name:S,className:"profile-slide-container"},D),!$&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":w("AccDescrPrevious"),onClick:F}),!A&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":w("Next"),onClick:R})),a.ZP.createElement("div",{className:"info",dir:w.isRtl?"rtl":"auto"},p?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},w("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},T&&(0,l.Z)(T)),U&&a.ZP.createElement(v.Z,null)),!p&&(t?a.ZP.createElement("div",{className:"status "+((0,c.kM)(t,n)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,c.Tq)(w,t,n,E))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,c.eA)(o)?w("Subscribers",null!==(B=o.membersCount)&&void 0!==B?B:0,"i"):w("Members",null!==(X=o.membersCount)&&void 0!==X?X:0,"i")))));var B,X})))},8198:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(5116),s=n(6137),i=n(6202),o=n(6752);const c=(0,a.X$)((({reaction:e,ref:t,className:n})=>{var c,l,d;const u=null===(c=(0,r.Rd)().availableReactions)||void 0===c||null===(l=c.find((t=>t.reaction===e)))||void 0===l||null===(d=l.staticIcon)||void 0===d?void 0:d.id,m=(0,i.Z)(`document${u}`,!u,s.IU.BlobUrl);return a.ZP.createElement("img",{className:(0,o.Z)("ReactionStaticEmoji",n),ref:t,src:m,alt:""})}))},3547:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(6137),s=n(3657),i=n(6202),o=n(1212),c=n(706),l=n(6752),d=n(386),u=n(7799),m=n(231);const h=(0,a.X$)((({sticker:e,size:t,observeIntersection:n,noAnimate:h,title:f,className:v,onClick:p,clickArg:g,onUnfaveClick:Z})=>{const E=(0,a.sO)(null),P=`sticker${e.id}`,y=`sticker-button-${e.id}`,C=(0,s.Op)(E,n),b=e.thumbnail?e.thumbnail.dataUri:void 0,N=(0,i.Z)(`${P}?size=m`,!C,r.IU.BlobUrl),w=C&&!h,k=(0,i.Z)(e.isAnimated&&P,!w,r.IU.Lottie),[I,T,M]=(0,c.Z)(Boolean(k)),S=I&&w,{transitionClassNames:x}=(0,o.Z)(Boolean(N||S),void 0,void 0,"slow");(0,a.d4)((()=>{w||M()}),[M,w]);const L=(0,l.Z)("StickerButton",p&&"interactive",e.isAnimated&&"animated",y,v),$=b&&!S?`background-image: url('${b}');`:"";return a.ZP.createElement("div",{ref:E,className:L,title:f||(null==e?void 0:e.emoji),style:$,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(g)}},!S&&a.ZP.createElement("img",{src:N,className:x}),w&&k&&a.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),Z&&a.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),Z(e)}},a.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"StickerSetModal",!t);return n?a.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),c=n(9107);const l=(0,a.X$)((0,r.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dy)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),r=t&&!t.isSelf&&(0,i.Vl)(t);return a.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},r&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,o.Z)(r)),n(e.action).replace("{user}","").replace("{emoji}",e.emoji).trim(),a.ZP.createElement("span",{className:"ellipsis"}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=()=>a.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(2858),s=n(6752),i=n(8035),o=n(2340),c=n(790),l=n(9107),d=n(3709),u=n(8033),m=n(88);const h=(0,a.X$)((({message:e,senderTitle:t,isProtected:n,onMessageClick:h})=>{const f=(0,l.Z)();let v=(0,r.s1)(e);if(!v){const t=(0,r.T7)(e);if(t){const{url:n,domain:a}=t,s=(0,r.MK)(f,e);v={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,description:s!==n?s:void 0}}}const p=(0,a.I4)((()=>{h(e.id,e.chatId)}),[h,e.id,e.chatId]);if(!v)return;const{siteName:g,url:Z,displayUrl:E,title:P,description:y,photo:C,video:b}=v,N=!t&&(0,i.Z)(y,170),w=(0,s.Z)("WebLink scroll-item",!C&&!b&&"without-media");return a.ZP.createElement("div",{className:w,"data-initial":(g||E)[0],dir:f.isRtl?"rtl":void 0},C&&a.ZP.createElement(d.Z,{message:e,isProtected:n}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(u.Z,{isRtl:f.isRtl,className:"site-title",onClick:p},(0,o.Z)(P||g||E)),N&&a.ZP.createElement(u.Z,{isRtl:f.isRtl,className:"site-description",onClick:p},(0,o.Z)(N)),a.ZP.createElement(m.Z,{url:Z,className:"site-name",text:"",isRtl:f.isRtl},Z.replace("mailto:","")||E),t&&a.ZP.createElement("div",{className:"sender-name"},(0,o.Z)(t))),t&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(u.Z,{className:"date",onClick:p,isRtl:f.isRtl},(0,c.VX)(f,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>o,Gw:()=>c,Rj:()=>l,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>Z,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>N,jg:()=>w});var a=n(3716),r=n(7361),s=n(3858),i=n(2858);const o="(max-height: 640px)",c=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=240,d={width:640,height:640},u="4986041492570112461",m={width:100,height:100};let h,f,v;function p(e,t,n,a){const i=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!r.wB)return n;const{width:a}=s.Z.get();return h||(h=Math.min(30,a/c-4.5)),f||(f=Math.min(29,a/c-7)),v||(v=Math.min(29,a/c-4.5)),e?h:t?v:f}(e,a)-i)*c}function g({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:s,noAvatars:i}){const o=t/e,l=p(n,a,r,i),d=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*c:27*c}(s,o),u=s?Math.max(300,e):e;return w(l,d,u,s?t*(u/e):t)}function Z(e,t){const n=window.matchMedia(o),{width:a,height:r}=s.Z.get();let i=t&&n.matches?10:8.25;return e&&(i=n.matches?10:15),{width:a,height:r-i*c}}function E(e,t,n,a,r){const{width:s,height:o}=(0,i.HV)(e)||m;return g({width:s,height:o,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function P(e,t,n,a){const{width:r,height:s}=(0,i.jC)(e)||m;return g({width:r,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function y(){return{width:2*c,height:2*c}}function C(e){return e?{width:3*c,height:3*c}:{width:3.375*c,height:3.375*c}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const s=n&&t&&n/t,i=c*(r.wB?a.w7:a.K7),o=s?i*s:i;return s&&o>i?{width:Math.round(i/s),height:i}:{width:i,height:o}}function N({width:e,height:t},n,a=!1){const{width:r,height:s}=Z(n,a);return w(r,s,e,t)}function w(e,t,n,a){const r=a/n,s=Math.min(n,e);return Math.round(s*r)>t?{width:Math.round(t/r),height:t}:{width:s,height:Math.round(s*r)}}},935:(e,t,n)=>{n.d(t,{X:()=>d,H:()=>h});var a=n(4050),r=n(5116),s=n(6137),i=n(2858),o=n(2340),c=n(7373),l=n(88);function d(e,t,n){const a=e.content.text;if(!a||!a.text){const t=(0,i.UD)(e);return t?[t]:void 0}const{text:r,entities:s}=a;return h(r,s,t,n)}function u(e,t,n,a){const{offset:r,length:s}=e,i=new Set([t]);if(a.has(t))return;const o=[];return n.filter(((e,n)=>n>t&&e.offset>=r&&e.offset<r+s)).map((e=>u(e,n.indexOf(e),n,a))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||i.has(e)||(t=!0),i.add(e)})),t&&o.push(e)})),{entity:e,organizedIndexes:i,nestedEntities:o}}function m(e){const t=new Set,n=[];return e.forEach(((a,r)=>{if(t.has(r))return;const s=u(a,r,e,t);s&&(s.organizedIndexes.forEach((e=>{t.add(e)})),n.push(s))})),n}function h(e,t,n,r,i){if(!t||!t.length)return f(e,n,r,i);const d=[];let u=!1;const h=m(t);function Z(t,d,m,h){const E=[],{entity:P,nestedEntities:y}=m,{offset:C,length:b,type:N}=P;let w=e.substring(t,C);const k=w.length;w&&(u&&w.length>0&&"\n"===w[0]&&(w=w.substr(1),u=!1),w&&E.push(...f(w,n,r,i)));const I=t+k,T=I+b;let M=e.substring(C,C+b);const S=[];if(u&&M.length>0&&"\n"===M[0]&&(M=M.substr(1),u=!1),N===s.Vv.Pre&&(u=!0),y.length){let e=I;y.forEach(((t,n)=>{const{renderResult:a,entityEndIndex:r}=Z(e,T,t,n===y.length-1);S.push(...a),e=r}))}const x=i?function(e,t,n){const a="string"==typeof t&&t,r=n.length?n.join(""):(0,o.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!a)return r;switch(e.type){case s.Vv.Bold:return`<b>${r}</b>`;case s.Vv.Italic:return`<i>${r}</i>`;case s.Vv.Underline:return`<u>${r}</u>`;case s.Vv.Code:return`<code class="text-entity-code">${r}</code>`;case s.Vv.Pre:return`\`\`\`<br/>${r}<br/>\`\`\``;case s.Vv.Strike:return`<del>${r}</del>`;case s.Vv.MentionName:return`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.userId}"\n contenteditable="false"\n dir="auto"\n >${r}</a>`;case s.Vv.Url:case s.Vv.TextUrl:return`<a\n class="text-entity-link"\n href=${v(a,e)}\n data-entity-type="${e.type}"\n dir="auto"\n >${r}</a>`;default:return r}}(P,M,S):function(e,t,n){const r="string"==typeof t&&t,i=n.length?n:t;if(!r)return f(i);switch(e.type){case s.Vv.Bold:return a.ZP.createElement("strong",null,f(i));case s.Vv.Blockquote:return a.ZP.createElement("blockquote",null,f(i));case s.Vv.BotCommand:return a.ZP.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Hashtag:case s.Vv.Cashtag:return a.ZP.createElement("a",{onClick:g,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Code:return a.ZP.createElement("code",{className:"text-entity-code"},f(i));case s.Vv.Email:return a.ZP.createElement("a",{href:`mailto:${r}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Italic:return a.ZP.createElement("em",null,f(i));case s.Vv.MentionName:return a.ZP.createElement(c.Z,{userId:e.userId},f(i));case s.Vv.Mention:return a.ZP.createElement(c.Z,{username:r},f(i));case s.Vv.Phone:return a.ZP.createElement("a",{href:`tel:${r}`,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Pre:return a.ZP.createElement("pre",{className:"text-entity-pre"},f(i));case s.Vv.Strike:return a.ZP.createElement("del",null,f(i));case s.Vv.TextUrl:case s.Vv.Url:return a.ZP.createElement(l.Z,{url:v(r,e),text:r},f(i));case s.Vv.Underline:return a.ZP.createElement("ins",null,f(i));default:return f(i)}}(P,M,S);if(Array.isArray(x)?E.push(...x):E.push(x),h&&T<d){let t=e.substring(T,d);u&&t.length>0&&"\n"===t[0]&&(t=t.substring(1)),t&&E.push(...f(t,n,r,i))}return{renderResult:E,entityEndIndex:T}}let E=0;return h.forEach(((t,n)=>{const{renderResult:a,entityEndIndex:r}=Z(E,e.length,t,n===h.length-1);d.push(...a),E=r})),d}function f(e,t,n,a){if(Array.isArray(e)){const r=[];return e.forEach((e=>{r.push(...f(e,t,n,a))})),r}if(a)return(0,o.Z)(e,["escape_html","emoji_html","br_html"]);const r=n?"hq_emoji":"emoji";return t?(0,o.Z)(e,[r,"br","highlight"],{highlight:t}):(0,o.Z)(e,[r,"br"])}function v(e,t){const{type:n,url:a}=t;return n===s.Vv.TextUrl&&a?a:e}function p(e){(0,r.uC)().sendBotCommand({command:e.currentTarget.innerText})}function g(e){(0,r.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,r.uC)().searchTextMessagesLocal()}},5296:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(4753),s=n(5116),i=n(6202),o=n(706),c=n(1638);const l={large:160,medium:128,small:104};function d(e,t,n,d,u,m,h,f){const{interactWithAnimatedEmoji:v,sendEmojiInteraction:p,sendWatchingEmojiInteraction:g}=(0,s.uC)(),Z=h||f,[E,P]=(0,o.Z)(),y=(0,a.sO)(null),C=(0,a.sO)(null),b=(0,i.Z)(d?`document${d}`:void 0,!d),N=l[e],w=`width: ${N}px; height: ${N}px;`,[k,I]=(0,a.eJ)(String(Math.random())),T=(0,a.sO)(void 0),M=(0,a.sO)(void 0),S=(0,a.I4)((()=>{y.current&&(p({chatId:t,messageId:n,localEffect:h,emoji:f,interactions:T.current}),M.current=void 0,T.current=void 0)}),[p,t,n,h,f]),x=(0,a.I4)((()=>{I(String(Math.random()));const e=C.current;b&&(e&&(e.pause(),e.remove()),C.current=new Audio,C.current.src=b,(0,r.Z)(C.current),C.current.addEventListener("ended",(()=>{C.current=void 0}),{once:!0}))}),[b]),L=(0,a.I4)((()=>{x();const e=y.current;if(!(Z&&e&&n&&t))return;const{x:a,y:r}=e.getBoundingClientRect();v({localEffect:h,emoji:f,x:a,y:r,startSize:N,isReversed:!m}),T.current||(T.current=[],M.current=performance.now(),setTimeout(S,1e3)),T.current.push(M.current?(performance.now()-M.current)/1e3:0)}),[t,f,Z,v,m,h,n,x,S,N]);return(0,a.d4)((()=>{const e=y.current;if(!e||!u)return;const{messageId:a,endX:r,endY:s}=u;if(!r&&!s&&a===n){const{x:n,y:a}=e.getBoundingClientRect();g({chatId:t,emoticon:h?(0,c.ji)(h):f,startSize:N,x:n,y:a,isReversed:!m}),x()}}),[u,t,f,m,h,n,x,g,N]),{playKey:k,ref:y,style:w,width:N,handleClick:L,markAnimationLoaded:P,isAnimationLoaded:E}}},742:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}))},1080:(e,t,n)=>{n.d(t,{Z:()=>V});var a=n(4050),r=n(5116),s=n(3716),i=n(7361),o=n(7204),c=n(782),l=n(2858),d=n(1638),u=n(7407);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(1273),f=n(4288),v=n(9107),p=n(6137),g=n(8005),Z=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),N=n(6202),w=n(172),k=n(9411),I=n(8729),T=n(6844),M=n(329),S=n(1876),x=n(2155),L=n(126);const $=(0,a.X$)((({chat:e,isPinned:t,isMuted:n})=>{const r=Boolean(e.unreadCount||e.hasUnreadMark||t),s=(0,P.Z)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function i(){return e.unreadCount?e.unreadMentionsCount?a.ZP.createElement("div",{className:"Badge-wrapper"},a.ZP.createElement("div",{className:"Badge mention"},a.ZP.createElement("i",{className:"icon-mention"})),a.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount))):a.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount)):e.hasUnreadMark?a.ZP.createElement("div",{className:s}):t?a.ZP.createElement("div",{className:s},a.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0}return a.ZP.createElement(L.Z,{isCustom:!0,className:"Badge-transition",isOpen:r},i)}));var A=n(742);const O=(0,a.X$)((({isSelected:e,isActive:t})=>a.ZP.createElement("div",{className:(0,P.Z)("ChatCallStatus",t&&"active",e&&!i.wB&&"selected")},a.ZP.createElement("div",{className:"indicator"},a.ZP.createElement("div",null),a.ZP.createElement("div",null),a.ZP.createElement("div",null))))),F=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{var n;const a=(0,d.Z1)(e,t);if(!a||!a.lastMessage)return{};const{senderId:r,replyToMessageId:s,isOutgoing:i}=a.lastMessage,o=r?(0,d.dy)(e,r):void 0,c=(0,l.N5)(a.lastMessage),u=c&&s?(0,d.hj)(e,a.id,s):void 0,{targetUserIds:m,targetChatId:h}=c||{},f=(0,l.zX)(a),{chatId:v,threadId:g,type:Z}=(0,d.Bt)(e)||{},E=t===v&&g===p._f;return{chat:a,isMuted:(0,l.i4)(a,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:o,actionTargetUserIds:m,actionTargetChatId:h,actionTargetMessage:u,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===Z,canChangeFolder:Boolean(null===(n=e.chatFolders.orderedIds)||void 0===n?void 0:n.length),lastSyncTime:e.lastSyncTime,...i&&{lastMessageOutgoingStatus:(0,d.dT)(e,a.lastMessage)},...f&&{user:(0,d.dy)(e,f),userStatus:(0,d.ss)(e,f)}}}))((({style:e,chatId:t,folderId:n,orderDiff:o,animationType:c,isPinned:d,chat:u,isMuted:h,user:f,userStatus:p,actionTargetUserIds:x,lastMessageSender:L,lastMessageOutgoingStatus:F,actionTargetMessage:R,actionTargetChatId:D,draft:U,animationLevel:B,isSelected:X,canScrollDown:V,canChangeFolder:j,lastSyncTime:z})=>{const{openChat:K,focusLastMessage:Y}=(0,r.uC)(),H=(0,a.sO)(null),[q,W,_]=(0,b.Z)(),[J,G,Q]=(0,b.Z)(),[ee,te,ne]=(0,b.Z)(),[ae,re,se]=(0,b.Z)(),{lastMessage:ie,typingStatus:oe}=u||{},ce=ie&&(0,l.Lo)(ie);(0,y.Z)(t,ce?ie.replyToMessageId:void 0,R);const le=ie&&!(0,l.bf)(ie)?(0,l.DH)(ie):void 0,de=(0,N.Z)(ie?(0,l.Ti)(ie,"micro"):void 0),ue=Boolean(ie&&(0,l.Y5)(ie)),me=(0,a.Ye)((()=>{if(!x)return;const e=(0,r.Rd)().users.byId;return x.map((t=>e[t])).filter(Boolean)}),[x]);(0,a.bt)((()=>{const e=H.current;if(0!==B&&e){if(c===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(c!==m.Move)return;e.style.transform=`translate3d(0, ${100*-o}%, 0)`,(0,E.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,E.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+s.fK)}}),[B,o,c]);const he=(0,a.I4)((()=>{K({id:t,shouldReplaceHistory:!0}),X&&V&&Y()}),[X,V,K,t,Y]),fe=(0,C.Z)({chat:u,user:f,handleDelete:function(){te(),W()},handleChatFolderChange:function(){re(),G()},folderId:n,isPinned:d,isMuted:h,canChangeFolder:j}),ve=(0,v.Z)();if(!u)return;const pe=(0,P.Z)("Chat chat-item-clickable",(0,l.YC)(t)?"private":"group",X&&"selected");return a.ZP.createElement(S.Z,{ref:H,className:pe,style:e,ripple:!i.wB,contextActions:fe,onClick:he},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(w.Z,{chat:u,user:f,userStatus:p,isSavedMessages:null==f?void 0:f.isSelf,lastSyncTime:z}),u.isCallActive&&u.isCallNotEmpty&&a.ZP.createElement(O,{isSelected:X,isActive:0!==B})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,Z.Z)((0,l.U)(ve,u,f))),u.isVerified&&a.ZP.createElement(k.Z,null),h&&a.ZP.createElement("i",{className:"icon-muted"}),u.lastMessage&&a.ZP.createElement(T.Z,{message:u.lastMessage,outgoingStatus:F})),a.ZP.createElement("div",{className:"subtitle"},function(){if(oe&&ie&&oe.timestamp>1e3*ie.date)return a.ZP.createElement(I.Z,{typingStatus:oe});if(null!=U&&U.text.length)return a.ZP.createElement("p",{className:"last-message",dir:ve.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},ve("Draft")),(0,Z.Z)(U.text));if(!ie)return;if(ce){const e=u&&((0,l.eA)(u)||ie.senderId===ie.chatId)?u:L;return a.ZP.createElement("p",{className:"last-message",dir:ve.isRtl?"auto":"ltr"},(0,Z.Z)((0,g.D)(ve,ie,e,me,R,D,{asPlain:!0})))}const e=(0,l.zF)(ve,t,L);return a.ZP.createElement("p",{className:"last-message",dir:ve.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,Z.Z)(e)),a.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:r?"round":void 0}),(0,l.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,Z.Z)((0,l.MK)(e,t,!0))):(0,Z.Z)((0,l.MK)(e,t))}(ve,ie,de||le,ue))}(),a.ZP.createElement($,{chat:u,isPinned:d,isMuted:h}))),ee&&a.ZP.createElement(M.Z,{isOpen:q,onClose:_,onCloseAnimationEnd:ne,chat:u}),ae&&a.ZP.createElement(A.Z,{isOpen:J,onClose:Q,onCloseAnimationEnd:se,chatId:t}))})));var R=n(1713),D=n(231),U=n(7854);const B=(0,a.X$)((0,r.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,d.Mw)(e,t):void 0,animatedEmoji:(0,d.zB)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:r})=>{const s=(0,v.Z)(),o=(0,a.I4)((()=>{n({type:"editFolder",payload:e}),r(R.MT.FoldersEditFolderFromChatList)}),[e,n,r]);return a.ZP.createElement("div",{className:"EmptyFolder"},a.ZP.createElement("div",{className:"sticker"},t&&a.ZP.createElement(U.Z,{sticker:t})),a.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"description",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&r&&a.ZP.createElement(D.Z,{ripple:!i.wB,fluid:!0,pill:!0,onClick:o,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))})));var X;!function(e){e.all="active",e.archived="archived"}(X||(X={}));const V=(0,a.X$)((0,r.c$)(((e,{folderType:t,folderId:n})=>{const{chats:{listIds:a,byId:r,orderedPinnedIds:s},users:{byId:i},lastSyncTime:o}=e,c="folder"!==t?X[t]:void 0,l=n?(0,d.Mw)(e,n):void 0;return{allListIds:a,chatsById:r,usersById:i,lastSyncTime:o,notifySettings:(0,d.dZ)(e),notifyExceptions:(0,d.NJ)(e),...c?{listIds:a[c],orderedPinnedIds:s[c]}:{chatFolder:l}}}))((({folderType:e,folderId:t,isActive:n,allListIds:d,chatsById:v,usersById:p,listIds:g,orderedPinnedIds:Z,chatFolder:E,lastSyncTime:P,notifySettings:y,notifyExceptions:C,foldersDispatch:b,onScreenSelect:N})=>{const{loadMoreChats:w,preloadTopChatMessages:k,preloadArchivedChats:I,openChat:T,openNextChat:M}=(0,r.uC)(),[S,x]=(0,a.Ye)((()=>"folder"===e&&E?(0,l.P4)(d,v,p,E,y,C):[g,Z]),[e,E,d,v,p,y,C,g,Z]),[L,$,A]=(0,a.Ye)((()=>{if(!S||"folder"===e&&!E)return[];const t=(0,l.O)(v,S,x,e),n=[].concat(t.pinnedChats,t.otherChats),a=n.map((({id:e})=>e));return[n.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),a,t]}),[S,x,e,E,v]),O=(0,o.Z)(L),R=(0,a.Ye)((()=>L&&O?(0,c.Q8)(L,((e,t)=>void 0!==O[t]?e-O[t]:-1/0)):{}),[L,O]),D=(0,a.I4)((()=>{w({listType:"archived"===e?"archived":"active"})}),[w,e]),[U,X]=(0,u.Z)(P?D:void 0,$,void 0,s.t_,"all"===e&&!s.NM),V=(0,a.Ye)((()=>{if(U&&A)return(0,l.wG)(A,U)}),[A,U]);(0,a.d4)((()=>{P&&"all"===e&&(k(),I())}),[P,e,k,I]),(0,a.d4)((()=>{if(n&&$)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if(i.fl&&(i.jm&&e.metaKey||!i.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>$.length-1)return;T({id:$[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),M({targetIndexDelta:t,orderedIds:$})}}}),[n,T,M,$]);const j=function(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const r=e[t];return 0===r?m.None:r===1/0||r===-1/0||n<=a&&r<0||a<n&&r>0?m.Opacity:m.Move}}),[e])}(R);return a.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:U,onLoadMore:X,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=U&&U.length&&V?function(){const e=$.indexOf(U[0]),n=e+V.pinnedChats.length;return a.ZP.createElement("div",{className:"scroll-container",style:i.wZ?`height: ${$.length*s.rS}px`:void 0,teactFastList:!0},V.pinnedChats.map((({id:n},r)=>a.ZP.createElement(F,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,animationType:j(n),orderDiff:R[n],style:`top: ${(e+r)*s.rS}px;`}))),V.otherChats.map(((e,r)=>a.ZP.createElement(F,{key:e.id,teactOrderKey:(0,l.OE)(e),chatId:e.id,folderId:t,animationType:j(e.id),orderDiff:R[e.id],style:`top: ${(n+r)*s.rS}px;`}))))}():U&&!U.length?a.ZP.createElement(B,{folderId:t,folderType:e,foldersDispatch:b,onScreenSelect:N}):a.ZP.createElement(f.Z,{key:"loading"}))})))},91:(e,t,n)=>{n.d(t,{F:()=>r});var a=n(2858);function r(e,t,n,r){const{senderId:s}=t;if(!s)return;const i=(0,a.YC)(s)?r[s]:n[s];let o=(0,a.OU)(e,i);const c=n[t.chatId];return c&&((0,a.YC)(s)&&i.isSelf?o=`${e("FromYou")}${(0,a.U)(e,c)}`:(0,a.Bf)(c)&&(o+=`${(0,a.U)(e,c)}`)),o}},2420:(e,t,n)=>{n.d(t,{t:()=>u,Z:()=>m});var a=n(4050),r=n(1212),s=n(6752),i=n(3989),o=n(7204),c=n(2898),l=n(706);const d=(0,a.X$)((({isQuick:e,onFileSelect:t})=>{const[n,r,i]=(0,l.Z)(),o=(0,s.Z)("DropTarget",n&&"hovered");return a.ZP.createElement("div",{className:o,onDrop:t,onDragEnter:()=>{r()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),i()}},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),a.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let u;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(u||(u={}));const m=(0,a.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:l})=>{const u=(0,a.sO)(null),m=(0,o.Z)(t),{shouldRender:h,transitionClassNames:f}=(0,r.Z)(e);(0,a.d4)((()=>e?(0,i.Z)(n):void 0),[e,n]);const v=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!1))}),[l,n]),p=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!0))}),[l,n]),g=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(u.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!h)return;const Z=(0,s.Z)("DropArea",f);return a.ZP.createElement(c.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:Z,onDragLeave:g,onDragOver:()=>{u.current&&window.clearTimeout(u.current)},onDrop:n},a.ZP.createElement(d,{onFileSelect:v}),(t||m)&&a.ZP.createElement(d,{onFileSelect:p,isQuick:!0})))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(4050),r=n(5116),s=n(3716),i=n(1638),o=n(9118),c=n(5723),l=n(6752),d=n(7361),u=n(517),m=n(2645),h=n(706),f=n(8674),v=n(6389),p=n(9107),g=n(4784),Z=n(6391),E=n(2340),P=n(3283);const y=d.wB?256:416,C=(0,a.X$)((0,r.c$)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyingToId:t&&n?(0,i.Yy)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}))((({id:e,chatId:t,threadId:n,isAttachmentModalInput:i,editableInputId:C,html:b,placeholder:N,forcedPlaceholder:w,canAutoFocus:k,shouldSuppressFocus:I,shouldSuppressTextFormatter:T,replyingToId:M,noTabCapture:S,messageSendKeyCombo:x,onUpdate:L,onSuppressedFocus:$,onSend:A})=>{const{editLastMessage:O,replyToNextMessage:F}=(0,r.uC)(),R=(0,a.sO)(null),D=(0,a.sO)(null),U=(0,p.Z)(),B=(0,a.sO)(!1),[X,V,j]=(0,h.Z)(),[z,K]=(0,a.eJ)(),[Y,H]=(0,a.eJ)(),q=(0,v.Z)(t,n);(0,a.d4)((()=>{i&&Q(!1)}),[i]),(0,m.Z)((([e])=>{b!==R.current.innerHTML&&(R.current.innerHTML=b),b!==D.current.innerHTML&&(D.current.innerHTML=b),void 0!==e&&e!==b&&Q(!b.length)}),[b]),(0,a.sO)(t).current=t;const W=(0,a.I4)((()=>{(0,f.zG)()?setTimeout(W,350):(0,c.Z)(R.current)}),[]),_=(0,a.I4)((()=>{j(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[j]);function J(){if(d.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||B.current)return j(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(T||!(0,Z.R)(t,C||s.R2)||!n||(0,g.Z)(n)||!t.START_TO_END)||(j(),!1)}function G(){if(!J())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=R.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),K({x:a,y:t.top-n.top}),H(e),V()}function Q(e=!1){const t=R.current,n=D.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,y);if(r===a)return;const s=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=`${r}px`,t.style.transitionDuration=`${s}ms`,t.classList.toggle("overflown",n.scrollHeight>y)};e?requestAnimationFrame(i):i()}(0,a.d4)((()=>{d.$b||k&&W()}),[t,W,M,k]),(0,a.d4)((()=>{if(S)return;const e=(0,o.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(W))}),2e3,!0,!1);return(0,u.Z)({onTab:e})}),[W,S]),(0,a.d4)((()=>{const e=R.current;function t(){e.blur()}return I&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[I]);const ee=(0,l.Z)("form-control custom-scroll",b.length>0&&"touched",I&&"focus-disabled");return a.ZP.createElement("div",{id:e,onClick:I?$:void 0,dir:U.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:R,id:C||s.R2,className:ee,contentEditable:!0,dir:"auto",onClick:W,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(L("<br>"===t?"":t),q({type:"typing"}),!d.$b&&(!n||!n.length)&&(d.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(R.current.blur(),e.removeAllRanges(),(0,c.Z)(R.current,!0))}},onKeyDown:function(e){if(!b.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void F({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||b.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",(function t(){G(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),O()):d.cj||d.wZ||!("enter"===x&&!e.shiftKey||"ctrl-enter"===x&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),j(),A())},onMouseDown:function(e){2===e.button?!0!==B.current&&(B.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{B.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{B.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){G(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:d.wZ?function(e){J()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:d.wZ?G:void 0}),a.ZP.createElement("div",{ref:D,className:(0,l.Z)(ee,"clone"),dir:"auto"}),!w&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},N),a.ZP.createElement(P.Z,{isOpen:X,anchorPosition:z,selectedRange:Y,setSelectedRange:H,onClose:_}),w&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,E.Z)(w)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(4050),r=n(3716),s=n(6752),i=n(1396),o=n(3989),c=n(7529),l=n(1212),d=n(8758),u=n(706),m=n(9107),h=n(231);const f={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},v=document.createElement("div"),p=(0,a.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,setSelectedRange:p,onClose:g})=>{const Z=(0,a.sO)(null),E=(0,a.sO)(null),{shouldRender:P,transitionClassNames:y}=(0,l.Z)(e),[C,b,N]=(0,u.Z)(),[w,k]=(0,a.eJ)(""),[I,T]=(0,a.eJ)(!1),[M,S]=(0,a.eJ)(),[x,L]=(0,a.eJ)({});(0,a.d4)((()=>e?(0,o.Z)(g):void 0),[e,g]),(0,d.Z)(e,Z,g),(0,a.d4)((()=>{C?E.current.focus():(k(""),T(!1))}),[C]),(0,a.d4)((()=>{P||(N(),L({}),S(void 0))}),[N,P]),(0,a.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==r.R2;){const e=f[a.tagName];e&&(t[e]=!0),a=a.parentElement}L(t)}),[e,n,b]);const $=(0,a.I4)((()=>{const e=window.getSelection();e&&p(e.getRangeAt(0))}),[p]),A=(0,a.I4)((()=>{if(n)return v.innerText=n.toString(),v.innerHTML}),[n]),O=(0,a.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function F(){const e=E.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void S(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),S(r)}function R(e){if(x[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(x).some((t=>t!==e&&!!x[t])))return"disabled"}else if(x.monospace||x.strikethrough)return"disabled"}const D=(0,a.I4)((()=>{L((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)})),$(),{...e,bold:!e.bold})))}),[$]),U=(0,a.I4)((()=>{document.execCommand("italic"),$(),L((e=>({...e,italic:!e.italic})))}),[$]),B=(0,a.I4)((()=>{document.execCommand("underline"),$(),L((e=>({...e,underline:!e.underline})))}),[$]),X=(0,a.I4)((()=>{if(x.strikethrough){const e=O();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,strikethrough:!1})))}const e=A();document.execCommand("insertHTML",!1,`<del>${e}</del>`),g()}),[O,A,g,n,x.strikethrough]),V=(0,a.I4)((()=>{if(x.monospace){const e=O();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,monospace:!1})))}const e=A();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),g()}),[O,A,g,n,x.monospace]);function j(){const e=encodeURI((0,i.X)(w)||"");if(I){const t=O();if(!t||"A"!==t.tagName)return;return t.href=e,void g()}const t=A();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),g()}const z=(0,a.I4)((e=>{const t={k:b,b:D,u:B,i:U,m:V,s:X}[(0,c.Z)(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[D,U,B,V,X,b]);(0,a.d4)((()=>(e&&document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z))),[e,z]);const K=(0,m.Z)();if(!P)return;const Y=(0,s.Z)("TextFormatter",y,C&&"link-control-shown"),H=(0,s.Z)("TextFormatter-link-url-confirm",!!w.length&&"shown"),q=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.ZP.createElement("div",{ref:Z,className:Y,style:q,onKeyDown:function(e){"Enter"===e.key&&C&&(j(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Bold text",className:R("bold"),onClick:D},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Italic text",className:R("italic"),onClick:U},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Underlined text",className:R("underline"),onClick:B},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:R("strikethrough"),onClick:X},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Monospace text",className:R("monospace"),onClick:V},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:K("TextFormat.AddLinkTitle"),onClick:b},a.ZP.createElement("i",{className:"icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:K("Cancel"),onClick:N},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",M)},a.ZP.createElement("input",{ref:E,className:"TextFormatter-link-url-input",type:"text",value:w,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){k(e.target.value),F()},onScroll:F})),a.ZP.createElement("div",{className:H},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:K("Save"),className:"color-primary",onClick:j},a.ZP.createElement("i",{className:"icon-check"}))))))}))},2400:(e,t,n)=>{n.d(t,{_:()=>o});const a=/(<br>|<br\s?\/>)/g,r=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,i=/\n$/i;function o(e){return e.replace(r," ").replace(a,"\n").replace(s,"").replace(i,"")}},6391:(e,t,n)=>{function a(e,t){const{commonAncestorContainer:n}=e;let a=n,r=1;for(;a&&a.id!==t&&r<5;)a=a.parentElement,r++;return Boolean(a&&a.id===t)}n.d(t,{R:()=>a})},3575:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(4050),r=n(3716),s=n(735),i=n(2400),o=n(4284),c=n(5723),l=n(782);const d=new WeakMap;function u(e){return(...t)=>{const n=d.get(e);if(n&&(0,l.et)(n.lastArgs,t))return n.lastResult;const a=e(...t);return d.set(e,{lastArgs:t,lastResult:a}),a}}var m=n(706);let h,f,v,p;const g=u((function(e,t,n){return e&&t.length?Object.values((0,l.q0)(e,t)).slice(0,n):s.D})),Z=u((function(e,t,n){const a=Object.values(e),r=(0,l.ee)(a,"native"),s=t?(0,l.Q8)(t,(e=>Object.values((0,l.q0)(r,e)))):{},i=n?(0,l.Q8)(n,(e=>Object.values((0,l.q0)(r,e)))):{},o={...s,...i},c=[].concat(Object.keys(s),Object.keys(i)),d=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});return{byKeyword:o,keywords:c,byName:d,names:Object.keys(d)}})),E=u((function(e,t,n){const{byKeyword:a,keywords:r,byName:i,names:o}=e;let c=s.D;const d=r.filter((e=>e.startsWith(t))).sort();c=c.concat((0,l.xH)(Object.values((0,l.q0)(a,d))));const u=o.filter((e=>e.startsWith(t)));return c=c.concat((0,l.xH)(Object.values((0,l.q0)(i,u)))),c=(0,l.Tw)(c),c.slice(0,n)}));try{p=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){p=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function P(e,t,l,d=r.R2,u,P,y,C=!1){const[b,N,w]=(0,m.Z)(),[k,I]=(0,a.eJ)(),[T,M]=(0,a.eJ)(!1),[S,x]=(0,a.eJ)(s.D);(0,a.d4)((()=>{if(C)return;const e=()=>{I(v.emojis)};v?e():async function(){return h||(h=n.e(501).then(n.t.bind(n,7501,19)),f=(await h).default,v=(0,o.NM)(f)),h}().then(e)}),[C]);const L=t.current;(0,a.d4)((()=>{if(!e||!L||!k||C)return void w();const t=L.includes(":")&&function(e){const t=(0,i._)(e).match(p);return t?t[0].trim():void 0}(L);if(!t)return x(s.D),void w();const n=t.length>2&&t.endsWith(":"),a=t.substr(1,n?t.length-2:void 0);let r=s.D;if(M(n),a){if(a.length>=2){const e=Z(k,P,y);r=E(e,a,36)}}else r=g(k,l,36);r.length?(n||N(),x(r)):w()}),[k,L,e,N,l,w,M,C,P,y]);const $=(0,a.I4)(((e,n)=>{const a=t.current,r=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==r){u(`${a.substr(0,r)}${e}`);const t=document.getElementById(d);requestAnimationFrame((()=>{(0,c.Z)(t,!0)}))}w()}),[t,d,u,w]);return(0,a.d4)((()=>{b&&T&&S.length&&$(S[0].native,!0)}),[S,$,b,T]),{isEmojiTooltipOpen:b,closeEmojiTooltip:w,filteredEmojis:S,insertEmoji:$}}},9295:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(6137),i=n(3716),o=n(2858),c=n(2400),l=n(5723),d=n(706),u=n(782);const m=(0,n(9118).P2)((e=>e()),500,!0);let h;try{h=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){h=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function f(e,t,n,f=i.R2,v,p,g){const[Z,E,P]=(0,d.Z)(),[y,C]=(0,a.eJ)(),b=(0,a.I4)(((e,t)=>{const n=(0,r.Rd)().users.byId;(v||p)&&n?m((()=>{const a=null==v?void 0:v.reduce(((e,t)=>(t.userId!==g&&e.push(t.userId),e)),[]),r=(0,o.kK)((0,u.Tw)([...t&&p||[],...a||[]]),n,e);C(Object.values((0,u.q0)(n,r)))})):C(void 0)}),[g,v,p]),N=t.current;(0,a.d4)((()=>{if(!e||!N.length)return void P();const t=N.includes("@")&&function(e){const t=(0,c._)(e).match(h);return t?t[0].trim():void 0}(N);if(t){const e=t?t.substr(1):"";b(e,function(e){return e.startsWith("@")}(N))}else P()}),[e,b,E,P,N]),(0,a.d4)((()=>{null!=y&&y.length?E():P()}),[E,P,y]);const w=(0,a.I4)(((e,a=!1)=>{if(!e.username&&!(0,o.Vl)(e))return;const r=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,o.Vl)(e)}</a>`,i=t.current,c=i.lastIndexOf("@");if(-1!==c){n(`${i.substr(0,c)}${r}&nbsp;`);const e=document.getElementById(f);requestAnimationFrame((()=>{(0,l.Z)(e,a)}))}P()}),[t,f,n,P]);return{isMentionTooltipOpen:Z,closeMentionTooltip:P,insertMention:w,mentionFilteredUsers:y}}},7891:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9290),s=n(5326);function i(e,t){const n=void 0===t,i=(0,a.sO)(n),o=(0,a.sO)(),c=(0,s.Z)();return(0,r.Z)((()=>{n||(i.current=!1,o.current&&(clearTimeout(o.current),o.current=void 0))}),e),(0,a.d4)((()=>{if(n||i.current)return;const e=()=>{i.current=!0,c()};t>0?o.current=window.setTimeout(e,t):e()}),e),i.current}},1218:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(4605);const s=(0,a.X$)((({id:e,options:t,selected:n=[],disabled:s,round:i,loadingOptions:o,onChange:c})=>{const[l,d]=(0,a.eJ)(n||[]),u=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...l,t]:l.filter((e=>e!==t)),d(a),c(a)}),[c,l]);return a.ZP.createElement("div",{id:e,className:"radio-group"},t.map((e=>a.ZP.createElement(r.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==n.indexOf(e.value),disabled:s,round:i,isLoading:o?-1!==o.indexOf(e.value):void 0,onChange:u}))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752),s=n(231);const i=({isShown:e,className:t,color:n="primary",ariaLabel:i,disabled:o,onClick:c,children:l})=>{const d=(0,r.Z)("FloatingActionButton",e&&"revealed",t);return a.ZP.createElement(s.Z,{className:d,color:n,round:!0,disabled:o,onClick:e&&!o?c:void 0,ariaLabel:i,tabIndex:-1},l)}},1876:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(7361),s=n(9118),i=n(6752),o=n(7240),c=n(3394),l=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964),f=n(231);const v=({ref:e,buttonRef:t,icon:n,secondaryIcon:v,className:p,style:g,children:Z,disabled:E,ripple:P,narrow:y,inactive:C,focus:b,destructive:N,multiline:w,isStatic:k,contextActions:I,onMouseDown:T,onClick:M,onSecondaryIconClick:S})=>{let x=(0,a.sO)(null);e&&(x=e);const[L,$,A]=(0,l.Z)(),{isContextMenuOpen:O,contextMenuPosition:F,handleBeforeContextMenu:R,handleContextMenu:D,handleContextMenuClose:U,handleContextMenuHide:B}=(0,o.Z)(x,!I),X=(0,a.I4)((()=>x.current),[]),V=(0,a.I4)((()=>x.current.closest(".custom-scroll")),[]),j=(0,a.I4)((()=>x.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:z,positionY:K,style:Y}=(0,c.Z)(F,X,V,j),H=(0,a.I4)((e=>{!E&&M&&(M(e),r.$b&&!P&&($(),(0,s.T2)(A)))}),[E,$,M,P,A]),q=(0,a.I4)((e=>{C||r.$b||(!I||2!==e.button&&M||R(e),0===e.button&&(M?H(e):D(e)))}),[C,I,M,R,D,H]),W=(0,d.Z)(),_=(0,i.Z)("ListItem",p,!k&&"no-selection",P&&"has-ripple",y&&"narrow",E&&"disabled",C&&"inactive",F&&"has-menu-open",b&&"focus",N&&"destructive",w&&"multiline",k&&"is-static");return a.ZP.createElement("div",{ref:x,className:_,dir:W.isRtl?"rtl":void 0,style:g,onMouseDown:T},a.ZP.createElement("div",{className:(0,i.Z)("ListItem-button",L&&"active"),role:"button",ref:t,tabIndex:0,onClick:!C&&r.$b?H:void 0,onMouseDown:q,onContextMenu:!C&&I?D:void 0},n&&a.ZP.createElement("i",{className:`icon-${n}`}),w&&a.ZP.createElement("div",{className:"multiline-item"},Z),!w&&Z,!E&&!C&&P&&a.ZP.createElement(u.Z,null),v&&a.ZP.createElement(f.Z,{className:"secondary-icon",round:!0,color:"translucent",size:"smaller",onMouseDown:e=>{E||0!==e.button||!S&&!I||(e.stopPropagation(),S?S(e):D(e))}},a.ZP.createElement("i",{className:`icon-${v}`}))),I&&void 0!==F&&a.ZP.createElement(m.Z,{isOpen:O,positionX:z,positionY:K,style:Y,className:"ListItem-context-menu",autoClose:!0,onClose:U,onCloseAnimationEnd:B},I.map((e=>a.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(3716),s=n(1212),i=n(6752),o=n(3989),c=n(2898);const l=({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=(0,a.eJ)(!0),m=(0,a.sO)(null),{transitionClassNames:h}=(0,s.Z)(d),f=(0,a.I4)((()=>{u(!1),setTimeout(l,150+r.fK)}),[l]);(0,a.d4)((()=>d?(0,o.Z)(f):void 0),[d,f]),(0,a.d4)((()=>(m.current=window.setTimeout(f,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)})),[t,f]);const v=(0,a.I4)((()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[]),p=(0,a.I4)((()=>{m.current=window.setTimeout(f,t)}),[t,f]);return a.ZP.createElement(c.Z,{className:"Notification-container",containerId:n},a.ZP.createElement("div",{className:(0,i.Z)("Notification",h),onClick:f,onMouseEnter:v,onMouseLeave:p},a.ZP.createElement("div",{className:"content"},e)))}},9196:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752);const s={s:22,m:25,l:28,xl:20},i=(0,a.X$)((({progress:e=0,size:t="l",square:n,transparent:i,noCross:o,onClick:c})=>{const l=s[t],d=l-4,u=l-1,m=2*d*Math.PI,h=(0,a.sO)(null);(0,a.d4)((()=>{if(!h.current)return;const t=h.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):h.current.innerHTML=`<svg\n viewBox="0 0 ${2*u} ${2*u}"\n height="${2*u}"\n width="${2*u}"\n >\n <circle\n stroke="white"\n fill="transparent"\n stroke-width=2\n stroke-dasharray="${m} ${m}"}\n stroke-dashoffset="${n}"\n stroke-linecap="round"\n r=${d}\n cx=${u}\n cy=${u}\n />\n </svg>`}),[h,m,u,d,e]);const f=(0,r.Z)(`ProgressSpinner size-${t}`,i&&"transparent",n&&"square",o&&"no-cross");return a.ZP.createElement("div",{ref:h,className:f,onClick:c})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6752),s=n(9107),i=n(9204);const o=(0,a.X$)((({id:e,label:t,subLabel:n,value:o,name:c,checked:l,disabled:d,hidden:u,isLoading:m,onChange:h})=>{const f=(0,s.Z)(),v=(0,r.Z)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return a.ZP.createElement("label",{className:v,dir:f.isRtl?"rtl":void 0},a.ZP.createElement("input",{type:"radio",name:c,value:o,id:e,checked:l,onChange:h,disabled:d||u}),a.ZP.createElement("div",{className:"Radio-main"},a.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},t),n&&a.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},n)),m&&a.ZP.createElement(i.Z,null))})),c=(0,a.X$)((({id:e,name:t,options:n,selected:r,disabled:s,loadingOption:i,onChange:c})=>{const l=(0,a.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return a.ZP.createElement("div",{id:e,className:"radio-group"},n.map((e=>a.ZP.createElement(o,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===r,hidden:e.hidden,disabled:s,isLoading:i?i===e.value:void 0,onChange:l}))))}))},8051:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752),s=n(9107);const i=(0,a.X$)((({options:e,min:t=0,max:n=(e?e.length-1:100),step:i=1,label:o,value:c,renderValue:l,disabled:d,onChange:u})=>{const m=(0,s.Z)(),h=(0,a.I4)((e=>{u(Number(e.currentTarget.value))}),[u]),f=(0,r.Z)("RangeSlider",d&&"disabled"),v=(0,a.Ye)((()=>e?c/(e.length-1)*100:(c-t)/((n-t)/i)*100),[e,c,n,t,i]);return a.ZP.createElement("div",{className:f},o&&a.ZP.createElement("div",{className:"slider-top-row",dir:m.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},o),!e&&a.ZP.createElement("span",{className:"value",dir:"auto"},l?l(c):c)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${v}%`}),a.ZP.createElement("input",{min:t,max:n,value:c,step:i,type:"range",onChange:h}),e&&a.ZP.createElement("div",{className:"slider-options"},e.map(((e,t)=>a.ZP.createElement("div",{className:(0,r.Z)("slider-option no-selection",t===c&&"active"),onClick:()=>u(t)},e))))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(6752),s=n(706),i=n(9107),o=n(2515),c=n(4288),l=n(231);const d=(0,a.X$)((({ref:e,children:t,parentContainerClassName:n,value:d,inputId:u,className:m,focused:h,isLoading:f,placeholder:v,disabled:p,autoComplete:g,canClose:Z,autoFocusSearch:E,onChange:P,onReset:y,onFocus:C,onBlur:b})=>{let N=(0,a.sO)(null);e&&(N=e);const[w,k,I]=(0,s.Z)(h);(0,o.Z)(N,E,I),(0,a.d4)((()=>{N.current&&(h?N.current.focus():N.current.blur())}),[h,v]);const T=(0,i.Z)(),M=(0,a.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}}),[n]);return a.ZP.createElement("div",{className:(0,r.Z)("SearchInput",m,w&&"has-focus"),dir:T.isRtl?"rtl":void 0},t,a.ZP.createElement("input",{ref:N,id:u,type:"text",dir:"auto",placeholder:v||T("Search"),className:"form-control",value:d,disabled:p,autoComplete:g,onChange:function(e){const{currentTarget:t}=e;P(t.value)},onFocus:function(){k(),C&&C()},onBlur:function(){I(),b&&b()},onKeyDown:M}),a.ZP.createElement("i",{className:"icon-search"}),f&&a.ZP.createElement(c.Z,null),!f&&(d||Z)&&y&&a.ZP.createElement(l.Z,{round:!0,size:"tiny",color:"translucent",onClick:y},a.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(1212),s=n(7204),i=n(6752);const o=({isOpen:e,isCustom:t,id:n,className:o,onClick:c,children:l})=>{const{shouldRender:d,transitionClassNames:u}=(0,r.Z)(e,void 0,void 0,!t&&void 0),m=(0,s.Z)(e),h=(0,s.Z)(l),f=(0,a.sO)();return m&&!e&&(f.current=h),d&&a.ZP.createElement("div",{id:n,className:(0,i.Z)(o,u),onClick:c},e?l():f.current())}},3321:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(6752);const s=(0,a.X$)((({id:e,name:t,value:n,label:s,checked:i=!1,disabled:o,inactive:c,noAnimation:l,onChange:d,onCheck:u})=>{const m=(0,a.I4)((e=>{d&&d(e),u&&u(e.currentTarget.checked)}),[d,u]),h=(0,r.Z)("Switcher",o&&"disabled",c&&"inactive",l&&"no-animation");return a.ZP.createElement("label",{className:h,title:s},a.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:o,onChange:m}),a.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(7361),s=n(1367),i=n(7204),o=n(8781),c=n(9107),l=n(6752),d=n(2972),u=n(2340);const m="Tab--active",h=(0,a.X$)((({className:e,title:t,isActive:n,badgeCount:r,isBadgeActive:s,previousActiveTab:i,onClick:o,clickArg:c})=>{const h=(0,a.sO)(null);return(0,a.d4)((()=>{if(n&&void 0===i&&h.current&&h.current.classList.add(m),!n||void 0===i)return;const e=h.current,t=e.parentElement.children[i];if(!t)return;const a=e.querySelector("i"),r=t.querySelector("i"),s=r.parentElement.offsetLeft-a.parentElement.offsetLeft,o=r.clientWidth/a.clientWidth;r.classList.remove("animate"),a.classList.remove("animate"),a.style.transform=`translate3d(${s}px, 0, 0) scale3d(${o}, 1, 1)`,(0,d.Z)(a),a.classList.add("animate"),a.style.transform="none",t.classList.remove(m),e.classList.add(m)}),[n,i]),a.ZP.createElement("div",{className:(0,l.Z)("Tab",e),onClick:()=>o(c),ref:h},a.ZP.createElement("span",null,(0,u.Z)(t),!!r&&a.ZP.createElement("span",{className:(0,l.Z)("badge",s&&"Tab__badge--active")},r),a.ZP.createElement("i",null)))})),f=r.cj?450:r.wZ?400:300,v=(0,a.X$)((({tabs:e,activeTab:t,big:n,onSwitchTab:r})=>{const l=(0,a.sO)(null),d=(0,i.Z)(t);(0,o.Z)(l.current),(0,a.d4)((()=>{const e=l.current,{scrollWidth:n,offsetWidth:a,scrollLeft:r}=e;if(n<=a)return;const i=e.childNodes[t];if(!i)return;const{offsetLeft:o,offsetWidth:c}=i,d=o-a/2+c/2;Math.abs(d-r)<16||(0,s.Z)(e,d,f)}),[t]);const u=(0,c.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:u.isRtl?"rtl":void 0},e.map(((e,n)=>a.ZP.createElement(h,{key:e.title,title:u(e.title),isActive:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:d,onClick:r,clickArg:n}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(3716),i=n(6752),o=n(2972),c=n(1279),l=n(5326),d=n(7204),u=n(8674);const m=Symbol("CLEANED_UP"),h="Transition__slide--active",f=({ref:e,activeKey:t,name:n,direction:f="auto",renderCount:v,shouldRestoreHeight:p,shouldCleanup:g,cleanupExceptionKey:Z,id:E,className:P,onStart:y,onStop:C,children:b})=>{const{animationLevel:N}=(0,r.Rd)().settings.byKey,w=(0,a.sO)();let k=(0,a.sO)(null);e&&(k=e);const I=(0,a.sO)({}),T=(0,d.Z)(t),M=(0,l.Z)(),S=void 0!==T&&t!==T;!v&&S&&(I.current={[T]:I.current[T]}),I.current[t]=b,(0,a.bt)((()=>{function e(){!g||void 0!==Z&&Z===T||(I.current={[T]:m},M())}const a=k.current,r=a.children;if(1===r.length&&!S)return n.startsWith("slide-optimized")&&(r[0].style.transition="none",r[0].style.transform="translate3d(0, 0, 0)"),void r[0].classList.add(h);const i=Array.from(a.childNodes);if(!S||!i.length)return;w.current=t;const l=-1===f||"auto"===f&&T>t||"inverse"===f&&T<t,d=Object.keys(I.current).map(Number),E=v?T:d.indexOf(T),P=v?t:d.indexOf(t);if("slide-optimized"===n||"slide-optimized-rtl"===n)return void function(e,t,n,a,r,i,l,d,m,f,v,p){if(!p||!v)return;if(e===s.oB)return p.style.transition="none",p.style.transform="",p.classList.remove(h),v.style.transition="none",v.style.transform="translate3d(0, 0, 0)",v.classList.add(h),void a();"slide-optimized-rtl"===t&&(n=!n);const g=(0,u.YW)();requestAnimationFrame((()=>{null==m||m(),p.style.transition="none",p.style.transform="translate3d(0, 0, 0)",v.style.transition="none",v.style.transform=`translate3d(${n?"-":""}100%, 0, 0)`,(0,o.Z)(v),p.style.transition="",p.style.transform=`translate3d(${n?"":"-"}100%, 0, 0)`,v.style.transition="",v.style.transform="translate3d(0, 0, 0)",p.classList.remove(h),v.classList.add(h),(0,c.L)(p,(()=>{r===i.current&&(p.style.transition="none",p.style.transform="",d&&(v.style.height="auto",l.style.height=`${v.clientHeight}px`),null==f||f(),g(),a())}))}))}(N,n,l,e,t,w,a,p,y,C,i[P],i[E]);if(a.classList.remove("animating"),a.classList.toggle("backwards",l),"none"===n||N===s.oB)return i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(h,t===P))})),void e();i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove(h),e.classList.toggle("from",t===E),e.classList.toggle("through",t>E&&t<P||t<E&&t>P),e.classList.toggle("to",t===P))}));const b=(0,u.YW)();requestAnimationFrame((()=>{var r;function s(){requestAnimationFrame((()=>{if(t===w.current){if(a.classList.remove("animating","backwards"),i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(h,t===P))})),p){const e=a.querySelector(`.${h}`);e&&(e.style.height="auto",a.style.height=`${e.clientHeight}px`)}null==C||C(),b(),e()}}))}a.classList.add("animating"),null==y||y();const o="mv-slide"===n?null===(r=i[P])||void 0===r?void 0:r.firstChild:"reveal"===n&&l?i[E]:i[P];o?(0,c.f)(o,s):s()}))}),[t,T,S,f,n,y,C,v,p,g,Z,N,M]),(0,a.bt)((()=>{if(p){const e=k.current,t=e.querySelector(`.${h}`)||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[p,b]);const x=I.current,L=Object.keys(v?new Array(v).fill(void 0):x).map(Number).map((e=>{const n=x[e];return"function"==typeof n?a.ZP.createElement("div",{key:e,teactOrderKey:e},n(e===t,e===T,t)):void 0}));return a.ZP.createElement("div",{ref:k,id:E,className:(0,i.Z)("Transition",P,n),teactFastList:!v&&!g},L)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>i,vb:()=>l,ZP:()=>h});var a=n(1090),r=n(782);const s=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],o=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],s=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,r.ei)(e.folder,o);a=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,r.ei)(e.folder,c);a=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}return{selectedChatIds:a,selectedChatTypes:s}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,r.ei)(e.folder,o)};case"editExcludeFilters":return{...e,excludeFilters:(0,r.ei)(e.folder,c)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,r.CE)(e.folder,o),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,r.CE)(e.folder,c),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(5116),s=n(396),i=n(274),o=n(5266),c=n(9290),l=n(4532);const d=(e,t,n,d,u,m,h,f=!1,v,p,g=!1,Z=!1)=>{const E=(0,a.sO)(null),[P,y]=(0,a.eJ)(!1);let C=P;const[b,N]=(0,a.eJ)(0),w=(0,a.I4)((()=>{y(!1),p&&p()}),[p]);(0,c.Z)((()=>{E.current=(0,s.z2)(e,n,((e,a)=>{var s;switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:t,toggleMuted:a,proxy:s}=E.current;y(!0),(0,l.N)(m,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:s,proxy:i,requestNextTrack:o,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(i.src)},pause:()=>{a()},stop:()=>{a(),s(0),(0,r.uC)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(i.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(i.currentTime+t,i.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},d()||(t.nexttrack=()=>{o()}),l()||(t.previoustrack=()=>{c()})}return t}(E)),(0,l.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),a(!!(0,r.Rd)().audioPlayer.isMuted),"voice"===n&&t((0,r.Rd)().audioPlayer.playbackRate),(0,l.NS)({duration:s.duration||0,playbackRate:s.playbackRate,position:s.currentTime});break}case"onRateChange":{const{proxy:e}=E.current;(0,l.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":y(!1),(0,l.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=E.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;Z||N(e.currentTime/n);break}case"onEnded":(0,l.pC)("paused")}null==u||null===(s=u[e])||void 0===s||s.call(u,a)}),v,w);const{proxy:a}=E.current;P||a.paused||(y(!0),C=!0),h&&h(a)}),[e]),(0,a.d4)((()=>{P&&m&&(0,l.Ym)(m)}),[m,P]);const{play:k,pause:I,setCurrentTime:T,proxy:M,destroy:S,setVolume:x,stop:L,isFirst:$,isLast:A,requestNextTrack:O,requestPreviousTrack:F,setPlaybackRate:R,toggleMuted:D}=E.current,U=M.duration&&Number.isFinite(M.duration)?M.duration:t;(0,a.d4)((()=>{!U||(0,o.z)(M)||Z||N(M.currentTime/U)}),[U,b,M,Z]),(0,a.d4)((()=>()=>{S(g)}),[S,g]),(0,i.Z)((([e,t])=>{e===f&&d===t||M.src&&M.paused||f&&d&&!P&&k(d)}),[f,d,P,k,M.src,M.paused]);const B=(0,a.I4)((()=>{d&&k(d)}),[d,k]),X=(0,a.I4)((()=>{P?I():B()}),[I,B,P]),V=(0,a.I4)((e=>{T(e),U&&N(M.currentTime/U)}),[U,M,T]);return{isPlaying:C,playProgress:b,playPause:X,pause:I,play:B,stop:L,setCurrentTime:V,setVolume:x,audioProxy:M,duration:U,requestNextTrack:O,requestPreviousTrack:F,isFirst:$,isLast:A,setPlaybackRate:R,toggleMuted:D}}},2937:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(6264),s=n(9290),i=n(1394),o=n(5326);const c=new Map;function l(e){const t=(0,a.sO)();let n=!1;(0,s.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const a=new Image;if(a.src=e,!a.width)return;const s=(0,i.ao)(a);(0,r.Z)(s.getContext("2d"),0,0,s.width,s.height,2,2),t.current=s.toDataURL()}),[e]);const l=function(e,t=!1,n){const s=(0,a.sO)(e?c.get(e):void 0),l=(0,a.sO)(),d=(0,o.Z)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),(0,a.d4)((()=>{if(!e||s.current||t)return;const a=new Image;a.onload=()=>{const t=(0,i.ao)(a);(0,r.Z)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();s.current=n,d(),c.size>=1e3&&c.clear(),c.set(e,n)},n?l.current=window.setTimeout((()=>{a.src=e}),n):a.src=e}),[e,n,d,t]),s.current}(e||void 0,Boolean(t.current));return t.current||!n&&l||e||void 0}},2019:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9118),s=n(5266);const i=(e=!1)=>{const[t,n]=(0,a.eJ)(!e),[i,o]=(0,a.eJ)(0),c=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),l=(0,a.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&o(t.buffered.end(0)/t.duration),c(t.readyState>=3||t.currentTime>0))}),[c]);return{isBuffered:t,bufferedProgress:i,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){c(e.readyState>=3)}}}},5866:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(6264),s=n(5326),i=n(7361);function o(e,t=!1,n){const o=(0,a.sO)(null),c=(0,s.Z)();return(0,a.d4)((()=>{const a=o.current;if(!e||!a||t)return;const s=new Image,c=()=>{a.width=s.width,a.height=s.height;const e=a.getContext("2d",{alpha:!1});i.vX&&(e.filter="blur(2px)"),e.drawImage(s,-4,-4,a.width+8,a.height+8),i.vX||(0,r.Z)(e,0,0,a.width,a.height,2,2)};s.onload=()=>{n?requestAnimationFrame(c):c()},s.src=e}),[o,e,c,t,n]),o}},1470:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(5116),s=n(2858),i=n(782),o=n(9107);const c=({chat:e,user:t,handleDelete:n,handleChatFolderChange:c,folderId:l,isPinned:d,isMuted:u,canChangeFolder:m},h=!1)=>{const f=(0,o.Z)(),{isSelf:v}=t||{};return(0,a.Ye)((()=>{if(!e)return;const{toggleChatPinned:t,updateChatMutedState:a,toggleChatArchived:o,toggleChatUnread:p}=(0,r.uC)(),g=m?{title:f("ChatList.Filter.AddToFolder"),icon:"folder",handler:c}:void 0,Z=d?{title:f("UnpinFromTop"),icon:"unpin",handler:()=>t({id:e.id,folderId:l})}:{title:f("PinToTop"),icon:"pin",handler:()=>t({id:e.id,folderId:l})};if(h)return(0,i.oA)([Z,g]);const E=e.unreadCount||e.hasUnreadMark?{title:f("MarkAsRead"),icon:"readchats",handler:()=>p({id:e.id})}:{title:f("MarkAsUnread"),icon:"unread",handler:()=>p({id:e.id})},P=u?{title:f("ChatList.Unmute"),icon:"unmute",handler:()=>a({chatId:e.id,isMuted:!1})}:{title:f("ChatList.Mute"),icon:"mute",handler:()=>a({chatId:e.id,isMuted:!0})},y=(0,s.pE)(e)?{title:f("Unarchive"),icon:"unarchive",handler:()=>o({id:e.id})}:{title:f("Archive"),icon:"archive",handler:()=>o({id:e.id})},C={title:(0,s.YC)(e.id)?f("Delete"):f((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n},b=void 0!==l;return(0,i.oA)([g,E,Z,!v&&P,!v&&!b&&y,C])}),[e,m,f,c,d,h,u,n,l,v])}},7240:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);function s(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const i=(e,t,n,i)=>{const[o,c]=(0,a.eJ)(!1),[l,d]=(0,a.eJ)(void 0),u=(0,a.I4)((e=>{t||2!==e.button||e.target.classList.add("no-selection")}),[t]),m=(0,a.I4)((e=>{e.target.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),l||(c(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,l]),h=(0,a.I4)((()=>{c(!1)}),[]),f=(0,a.I4)((()=>{d(void 0),document.body.classList.remove("no-selection")}),[]);return(0,a.d4)((()=>{if(t||!r.$b||i)return;const a=e.current;if(!a)return;let o;const u=()=>{o&&(clearTimeout(o),o=void 0)},m=e=>{t||r.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(u(),o=window.setTimeout((()=>(e=>{u();const{clientX:t,clientY:i,target:o}=e.touches[0];l||n&&o.matches("a[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),s(t)}),!0),r.fl&&r.cj&&a.addEventListener("mousedown",(function e(t){a.removeEventListener("mousedown",e,!0),s(t)}),!0),document.body.classList.add("no-selection"),c(!0),d({x:t,y:i}))})(e)),200))};return a.addEventListener("touchstart",m,{passive:!0}),a.addEventListener("touchcancel",u,!0),a.addEventListener("touchend",u,!0),a.addEventListener("touchmove",u,{passive:!0}),()=>{u(),a.removeEventListener("touchstart",m),a.removeEventListener("touchcancel",u,!0),a.removeEventListener("touchend",u,!0),a.removeEventListener("touchmove",u)}}),[l,t,i,e,n]),{isContextMenuOpen:o,contextMenuPosition:l,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:f}}},3394:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050);const r={width:0,left:0,height:0,top:0};function s(e,t,n,s,i){const[o,c]=(0,a.eJ)("right"),[l,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(!1),[h,f]=(0,a.eJ)(""),[v,p]=(0,a.eJ)("opacity: 0;");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:o,y:l}=e;const u=s(),h=n(),{extraPaddingX:v=0,extraTopPadding:g=0,marginSides:Z=0,extraMarginTop:E=0}=(null==i?void 0:i())||{},P=u?parseInt(getComputedStyle(u).marginTop,10)+E:void 0,y=u?{width:u.offsetWidth,height:u.offsetHeight+P}:r,C=h?h.getBoundingClientRect():r;let b;o+y.width+v<C.width+C.left?(o+=3,b="left"):o-y.width>0?(b="right",o-=3):(b="left",o=16),c(b),Z&&"right"===b&&o+v+Z>=C.width+C.left&&(o-=Z),Z&&"left"===b&&(o+v+Z+y.width>=C.width+C.left?o-=Z:o-Z<=0&&(o+=Z)),l+y.height<C.height+C.top?d("top"):(d("bottom"),l-y.height<C.top+g&&(l=C.top+C.height));const N=a.getBoundingClientRect(),w="left"===b?Math.min(o-N.left,C.width-y.width-16):Math.max(o-N.left,y.width+16),k=Math.min(C.height-N.top+N.height-12+(P||0),l-N.top),I=C.height-12-(P||0);m(I<y.height),p(`max-height: ${I}px;`),f(`left: ${w}px; top: ${k}px`)}),[e,s,n,t,i]),{positionX:o,positionY:l,style:h,menuStyle:v,withScroll:u}}},2202:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118);function s(e,t,n){return(0,a.Ye)((()=>(0,r.Ds)((e=>e()),e,!t,!n)),[e,t,n])}},5790:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(5116),s=n(9118);const i=(e,t,n,i)=>{const{loadMessage:o}=(0,r.uC)(),c=(0,a.Ye)((()=>{const n=(0,s.P2)(o,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}}),[o,e,t,i]);(0,a.d4)((()=>{t&&!n&&c()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t)=>{(0,a.d4)((()=>{if(e&&!t)return e.addEventListener("wheel",n,{passive:!0}),()=>{e.removeEventListener("wheel",n)};function n(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},2515:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7361);function s(e,t,n){(0,a.d4)((()=>{t?r.wB||setTimeout((()=>{requestAnimationFrame((()=>{e.current&&e.current.focus()}))}),500):(e.current&&e.current.blur(),n&&setTimeout(n,300))}),[e,t,n])}},3657:(e,t,n)=>{n.d(t,{S1:()=>i,_N:()=>o,Op:()=>c});var a=n(4050),r=n(9118),s=n(8674);function i({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:i,margin:o,threshold:c,isDisabled:l},d){const u=(0,a.sO)(),m=(0,a.sO)(),h=(0,a.sO)(0),f=(0,a.sO)();m.current=d;const v=(0,a.I4)((()=>{h.current++}),[]),p=(0,a.I4)((()=>{h.current&&(h.current--,!h.current&&f.current&&(f.current(),f.current=void 0))}),[]);return(0,s.ZP)(v,p),(0,a.d4)((()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}}),[l]),{observe:(0,a.I4)(((a,s)=>{u.current||function(){const a=new Map,s=new Map,l=()=>{const e=Array.from(s.values());e.forEach((t=>{const n=a.get(t.target);n&&n(t,e)})),m.current&&m.current(e),s.clear()},d=t?r.P2:n?r.Ds:void 0,v=d?d(l,t||n,!i):l,p=new IntersectionObserver((e=>{e.forEach((e=>{s.set(e.target,e)})),h.current?f.current=()=>{v()}:v()}),{root:e.current,rootMargin:o?`${o}px`:void 0,threshold:c});u.current={observer:p,callbacks:a}}();const l=u.current;return l.observer.observe(a),s&&l.callbacks.set(a,s),()=>{s&&l.callbacks.delete(a),l.observer.unobserve(a)}}),[l]),freeze:v,unfreeze:p}}function o(e,t,n){(0,a.d4)((()=>t?t(e.current,n):void 0),[])}function c(e,t,n){const[r,s]=(0,a.eJ)(!t);return o(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),r}},2357:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=function(e,t,n=!1){const r=(0,a.sO)(e);(0,a.bt)((()=>{r.current=e}),[e]),(0,a.d4)((()=>{if(void 0===t)return;const e=setInterval((()=>r.current()),t);return n||r.current(),()=>clearInterval(e)}),[t,n])}},2645:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7204);const s=(e,t,n)=>{const s=(0,r.Z)(t);return(0,a.bt)((()=>e(s||[])),t,n)}},692:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(1212);function r(e){const t=Boolean(e),{transitionClassNames:n}=(0,a.Z)(t,void 0,t,"slow");return n}},2566:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(7361),s=n(6137),i=n(9118),o=n(647),c=n(5326),l=n(6926);const d={};function u(e,t=!1,n=s.IU.BlobUrl,u,m,h=!1){const f=e?o.UV(e):void 0,v=n===s.IU.Stream||r.I_&&n===s.IU.Progressive,p=(0,c.Z)(),g=(()=>{const e=(0,a.sO)();return e.current||(e.current=(0,l.Z)(d),d[e.current]=!0),e.current})(),[Z,E]=(0,a.eJ)(f&&!v?1:0),P=(0,a.sO)(),y=(0,a.Ye)((()=>(0,i.P2)((e=>{P.current&&(!m||Date.now()-P.current>m)&&E(e)}),500,!0)),[m]);return(0,a.d4)((()=>{!t&&e&&(f?v&&setTimeout((()=>{E(.75)}),1500):(E(0),P.current&&o.cC(y),P.current=Date.now(),o.he(e,n,h,y,g).then((()=>{const e=Date.now()-P.current;P.current=void 0,!m||e>=m?p():setTimeout(p,m-e)}))))}),[t,e,f,n,u,p,v,m,y,h,g]),(0,a.d4)((()=>{t&&P.current&&(o.cC(y),E(0),P.current=void 0)}),[y,t]),(0,a.d4)((()=>()=>{e&&o.Iq(e,g)}),[g,e]),{mediaData:f,loadProgress:Z}}},6503:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);let s;function i(e,t,n=250,i=!1){const o=(0,a.sO)(!1),c=(0,a.I4)((()=>{o.current=!0}),[]);return(0,a.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||r.$b||i||(s=window.setTimeout((()=>{o.current||t()}),2*n))}),[i,e,n,t]),[(0,a.I4)((()=>{o.current=!0}),[]),(0,a.I4)((()=>{o.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{o.current||t()}),n)}),[n,t]),c]}},2678:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(7204),s=n(5326),i=n(9290);function o(e,t){const n=(0,r.Z)(e,!0),o=(0,a.sO)(),c=(0,s.Z)(),l=null!=e,d=null!=n;return l&&o.current&&(clearTimeout(o.current),o.current=void 0),(0,i.Z)((()=>{t&&!l&&d&&!o.current&&(o.current=window.setTimeout((()=>{o.current=void 0,c()}),t))}),[e]),o.current&&t&&!l?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);function r(e,t){const n=(0,a.sO)(e),[r,s]=(0,a.eJ)(t);return[r,(0,a.I4)((e=>{s((t=>n.current(t,e)))}),[])]}},6389:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(5116),s=n(3716),i=n(9118);const o=(e,t)=>(0,a.Ye)((()=>(0,i.P2)((n=>{(0,r.uC)().sendMessageAction({chatId:e,threadId:t,action:n})}),s.o_)),[e,t])},971:(e,t,n)=>{n.d(t,{Y:()=>r});var a=n(4050);function r(e){const t=(0,a.sO)(e);return(0,a.d4)((()=>{t.current=e}),[e]),t}},6898:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118);function s(e,t){(0,a.d4)((()=>{const t=e.current;return()=>{t&&(0,r.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>s});const a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],r=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function s(e,t,n,s,i,o,c){if(Number.isNaN(o)||o<1)return;o|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const l=e.getImageData(t,n,s,i),d=l.data;let u,m,h,f,v,p,g,Z,E,P,y,C,b=s-1,N=i-1,w=o+1,k=[],I=[],T=[],M=a[o],S=r[o],x=[],L=[];for(;c-- >0;){for(C=y=0,v=0;v<i;v++){for(u=d[C]*w,m=d[C+1]*w,h=d[C+2]*w,p=1;p<=o;p++)g=C+((p>b?b:p)<<2),u+=d[g++],m+=d[g++],h+=d[g++];for(f=0;f<s;f++)k[y]=u,I[y]=m,T[y]=h,0==v&&(x[f]=((g=f+w)<b?g:b)<<2,L[f]=(g=f-o)>0?g<<2:0),Z=C+x[f],E=C+L[f],u+=d[Z++]-d[E++],m+=d[Z++]-d[E++],h+=d[Z++]-d[E++],y++;C+=s<<2}for(f=0;f<s;f++){for(P=f,u=k[P]*w,m=I[P]*w,h=T[P]*w,p=1;p<=o;p++)P+=p>N?0:s,u+=k[P],m+=I[P],h+=T[P];for(y=f<<2,v=0;v<i;v++)d[y]=u*M>>>S,d[y+1]=m*M>>>S,d[y+2]=h*M>>>S,0==f&&(x[v]=((g=v+w)<N?g:N)*s,L[v]=(g=v-o)>0?g*s:0),Z=f+x[v],E=f+L[v],u+=k[Z]-k[E],m+=I[Z]-I[E],h+=T[Z]-T[E],y+=s<<2}}e.putImageData(l,t,n)}},396:(e,t,n)=>{n.d(t,{Es:()=>p,z2:()=>g,An:()=>E});var a=n(5116),r=n(1713),s=n(7361),i=n(4753),o=n(5266),c=n(2858),l=n(9118),d=n(1638);const u=new Map;let m,h=[],f=[];function v(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const s=Z(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!s)return;if(!u.has(s))return void(0,a.uC)().openAudioPlayer((0,c.Ak)(P(s).messageKey));const o=u.get(s);o.onForcePlay&&o.onForcePlay(),m=s,o.audio.src&&(0,i.Z)(o.audio)}function p(){const e=m&&u.get(m);e&&e.audio.pause()}function g(e,t,n,p,g){if(!u.has(e)){const n=function(e,t,n,a){const r=new Audio;function s(t){return n=>{u.has(e)&&((0,o.z)(r)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return r.addEventListener("timeupdate",s("onTimeUpdate")),r.addEventListener("play",s("onPlay")),r.addEventListener("pause",s("onPause")),r.addEventListener("loadstart",s("onLoadStart")),r.addEventListener("loadeddata",s("onLoadedData")),r.addEventListener("playing",s("onPlaying")),r.addEventListener("ended",(()=>{u.has(e)&&((0,o.z)(r)||v(e))})),{audio:r,type:t,proxy:new Proxy(r,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,p,g);u.set(e,n),function(e,t){"audio"!==e.type||f.includes(t)||(f.push(t),f.sort(y)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(y))}(n,e)}const{audio:E,proxy:C,handlers:b}=u.get(e);return b.push(n),{play(n){if(!E.paused)return;const l=m&&u.get(m);l&&m!==e&&(l.audio.pause(),l.audio.currentTime=0,(0,o.z)(l.audio)&&(l.audio.dataset.preventPlayAfterPatch="true"),l.onTrackChange&&l.onTrackChange()),m=e,E.src||(E.src=n,E.preload="auto",n.includes("/progressive/")&&s.s$&&(delete E.dataset.preventPlayAfterPatch,(0,o.B)(E))),(0,i.Z)(E),function(e,t){var n;if((0,a.Rd)().globalSearch.currentContent===r.nJ.Music)return;const{chatId:s}=(0,c.Ak)(P(t).messageKey),i=null===(n=(0,d.Bt)((0,a.Rd)()))||void 0===n?void 0:n.chatId,o=e=>e.startsWith(`msg${s}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(f=f.filter(o)),"voice"===e&&(h=h.filter(o))}(t,e)},pause(){m===e&&E.pause()},stop(){if(m===e){const e=E.src;E.pause(),(0,l.T2)((()=>{E.src="",E.src=e}))}},setCurrentTime(t){m===e&&(E.fastSeek?E.fastSeek(t):E.currentTime=t)},setVolume(t){m===e&&(E.volume=t,E.muted=!1)},setPlaybackRate(t){m===e&&(E.playbackRate=t)},toggleMuted(e){E.muted=void 0===e?!E.muted:e},proxy:C,requestNextTrack(){v(e)},isLast:()=>!Z(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!Z(e,(0,a.Rd)().audioPlayer.origin,!0),requestPreviousTrack(){v(e,!0)},destroy(t=!1){const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(f=f.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function Z(e,t=r.Cr.Inline,n){const a=function(e){switch(e.type){case"audio":return f;case"voice":return h;default:return}}(u.get(e));if(!a)return;if(t===r.Cr.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:s}=(0,c.Ak)(P(e).messageKey),i=a.filter((e=>e.startsWith(`msg${s}`))),o=i.indexOf(e);if(o<0)return;let l=t===r.Cr.Inline?-1:1;return n&&(l*=-1),i[o+l]}function E(e){return`${(0,c.Tp)(e)}-${e.date}`}function P(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function y(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=P(e),{date:r,messageKey:s}=P(t),i=r-n;return 0===i?s.localeCompare(a):i}},1174:(e,t,n)=>{n.d(t,{e:()=>r,s:()=>c});var a=n(7361);let r;function s(e,t){return t?Math.sqrt((t.pageX-e.pageX)**2+(t.pageY-e.pageY)**2):0}function i(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(r||(r={}));let o=0;function c(e,t){let n,c,l=!1,d=!1,u=0,m={x:window.innerWidth/2,y:window.innerHeight/2};function h(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",v),document.addEventListener("mouseup",f),t.onDoubleClick&&Date.now()-o<300&&t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),o=Date.now();else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",v,{passive:!0}),t.addEventListener("touchend",f),t.addEventListener("touchcancel",f),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(u=s(e.touches[0],e.touches[1]),m=i(e.touches[0],e.touches[1])))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function f(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",f),document.removeEventListener("mousemove",v),n.target.removeEventListener("touchcancel",f),n.target.removeEventListener("touchend",f),n.target.removeEventListener("touchmove",v),n=void 0,a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),l?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),l=!1,d=!1,u=0,c=void 0,m={x:window.innerWidth/2,y:window.innerHeight/2}}function v(e){if(n){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&u>0&&2===e.touches.length)){const n=s(e.touches[0],e.touches[1]),a=i(e.touches[0],e.touches[1]),r=a.x-m.x,o=a.y-m.y,c=n/u;t.onZoom(e,{zoomFactor:c,initialCenterX:m.x,initialCenterY:m.y,dragOffsetX:r,dragOffsetY:o,currentCenterX:a.x,currentCenterY:a.y}),1!==c&&(l=!0)}const o=e.pageX-n.pageX,h=e.pageY-n.pageY;(Math.abs(o)>=15||Math.abs(h)>=15)&&(l=!0);let f=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:o,dragOffsetY:h}),f=!0),t.onSwipe&&!d&&(d=function(e,n,s){if(a.cj){const t=e.touches[0].pageX;if(t<=20||t>=window.innerWidth-20)return!1}const i=Math.abs(n),o=Math.abs(s);if(n&&s&&Math.max(i,o)/Math.min(i,o)<2)return!1;let l;if(i>=50?l="x":o>=50&&(l="y"),!l)return!1;if(c){if(c!==l)return!1}else c=l;return function(e,t,n,a,s){return"x"===t?s(e,n<0?r.Left:r.Right):"y"===t&&s(e,a<0?r.Up:r.Down)}(e,l,n,s,t.onSwipe)}(e,o,h),f=d),a.cj&&f&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",h),e.addEventListener("touchstart",h,{passive:!t.isNotPassive}),()=>{e.removeEventListener("mousedown",h),e.removeEventListener("touchstart",h)}}},1279:(e,t,n)=>{function a(e,t,n){s("transitionend",e,t,n)}function r(e,t,n){s("animationend",e,t,n)}function s(e,t,n,a){let r=!1;t.addEventListener(e,(function s(i){r||i.target!==i.currentTarget||a&&(i instanceof TransitionEvent&&i.propertyName===a||i instanceof AnimationEvent&&i.animationName===a)||(r=!0,t.removeEventListener(e,s),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>a,f:()=>r})},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},539:(e,t,n)=>{n.d(t,{Z:()=>u,N:()=>m});var a=n(5116),r=n(1713),s=n(3716),i=n(7361),o=n(8674),c=n(9933),l=n(9118);let d=!1;function u(e,t,n,i=0,o=s.V$,c,l,d){const u=function(e,t,n=s.V$,a){const{offsetTop:i}=t,{scrollTop:o}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return o+(t+n);if(t>n)return o+(t-n)}else{if(a===r.fo.Up)return i+n;if(a===r.fo.Down)return Math.max(0,i-n)}return o}(e,t,o,c);c!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===s.oB&&(l=0),h(e,t,u,n,i,l,d)):h(e,t,u,n,i,0)}function m(){return d}function h(e,t,n,a,r=0,u,m){const{offsetTop:h,offsetHeight:p}=t,{scrollTop:g,offsetHeight:Z,scrollHeight:E}=e,P=m&&e.dataset.normalHeight?Number(e.dataset.normalHeight):Z;let y;switch(g!==n&&(e.scrollTop=n),a){case"start":y=h-r-n+(i.wZ?1:0);break;case"end":y=h+p+r-(n+P);break;case"nearest":case"center":case"centerOrTop":y=p<P?h+p/2-(n+P/2):h-r-n}if(y<0){const e=-n;y=Math.max(y,e)}else if(y>0){const e=E-(n+P);y=Math.min(y,e)}if(0===y)return;const C=n+y;if(0===u)return void(e.scrollTop=C);d=!0;const b=Math.abs(y),N=b<s.xn?v:f,w=u||s.bK+b/s.V$*(s.ck-s.bK),k=Date.now(),I=(0,o.YW)();(0,l.T2)((()=>{(0,c.cK)((()=>{const t=Math.min((Date.now()-k)/w,1),n=y*(1-N(t));return e.scrollTop=Math.round(C-n),d=t<1,d||I(),d}))}))}function f(e){return 1-(1-e)**5}function v(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(5116),r=n(3716),s=n(9933),i=n(9118);function o(e,t,n=300){(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),function(e,t,n){const a="rtl"===e.getAttribute("dir"),{scrollLeft:r,offsetWidth:o,scrollWidth:c}=e;let l=t-r;if(l<0){const e=-r*(a?-1:1);l=Math.max(l,e)}else if(l>0){const e=c-(r+o);l=Math.min(l,e)}if(0===l)return;const d=r+l;if(0===n)return void(e.scrollLeft=d);const u=Date.now();(0,i.T2)((()=>{(0,s.jt)((()=>{const t=Math.min((Date.now()-u)/n,1),a=l*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(d-a),t<1}))}))}(e,t,n)}},5723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(7361);function r(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),r=document.createRange(),s=e.lastChild||e;a.$b||s&&s.nodeValue?(r.selectNodeContents(s),r.collapse(!1),n.removeAllRanges(),n.addRange(r)):e.focus()}},7529:(e,t,n)=>{function a(e){const t="key"in e?e.key:e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}n.d(t,{Z:()=>a})},4532:(e,t,n)=>{n.d(t,{N:()=>r,Ym:()=>s,Ay:()=>o,pC:()=>c,NS:()=>l,Of:()=>d});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function r(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&i(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function i(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function o(){const{mediaSession:e}=window.navigator;var t;e&&(e.metadata=null,i(a),e.playbackState&&(e.playbackState="none"),null===(t=e.setPositionState)||void 0===t||t.call(e))}function c(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){var t;if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:n}=window.navigator;null==n||null===(t=n.setPositionState)||void 0===t||t.call(n,e)}function d({title:e,artist:t,album:n,artwork:a}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:a})}},3099:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(6137),r=n(7361);const s={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote};function i(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return r.op||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/<\/?span([^>]*)?>/g,""),t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"<code>$1</code>"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<b>$2</b>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<i>$2</i>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<s>$2</s>$3"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let i=0,o=0;const c=[];function l(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),o=i>=0?i:n,c=t.substring(0,o).length,{length:l}=t.substring(o,o+e.textContent.length);let d,u;return r===a.Vv.TextUrl&&(d=e.href),r===a.Vv.MentionName&&(u=e.dataset.userId),{index:o,entity:{type:r,offset:c,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,i);r?(i=t,c.push(r)):e.textContent&&(i+=e.textContent.length),e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach((e=>{o=1,l(e)})),{text:n,entities:c.length?c:void 0}}},5266:(e,t,n)=>{function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.dataset.patchForSafariInProgress="true",e.addEventListener("progress",(function n(){e.buffered.length&&(e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&!e.dataset.preventPlayAfterPatch&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>a,z:()=>r})},3227:(e,t,n)=>{n.d(t,{Z:()=>a});const a=e=>{e.stopPropagation(),e.preventDefault()}}}]);
//# sourceMappingURL=37.9e975e031ef296075093.js.map