mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-04 10:40:09 +01:00
2 lines
114 KiB
JavaScript
2 lines
114 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[60],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(4050),a=n(6137),s=n(4399),o=n(3657),i=n(6202),c=n(8835),l=n(706),d=n(7799);const u={large:160,medium:128,small:104},m=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:h})=>{var f;const v=(0,r.sO)(null),[p,g]=(0,l.Z)(),Z=`sticker${e.id}`,E=(0,o.Op)(v,n),P=null===(f=e.thumbnail)||void 0===f?void 0:f.dataUri,y=(0,i.Z)(`${Z}?size=m`,!E&&!h,a.IU.BlobUrl,m),{transitionClassNames:C}=(0,c.Z)(y,"slow"),b=(0,i.Z)(Z,!E,a.IU.Lottie,m),w=Boolean(b),[N,k]=(0,r.eJ)(String(Math.random())),I=(0,r.I4)((()=>{k(String(Math.random()))}),[]),T=u[t],S=`width: ${T}px; height: ${T}px;`;return r.ZP.createElement("div",{ref:v,className:"AnimatedEmoji media-inner",style:S,onClick:I},!p&&P&&r.ZP.createElement("img",{src:P,className:e.id===s.wB?"like-sticker-thumb":void 0,alt:""}),!p&&y&&r.ZP.createElement("img",{src:y,className:C,alt:""}),w&&r.ZP.createElement(d.Z,{key:Z,id:Z,animationData:b,size:T,quality:1,play:E&&N,noLoop:!0,onLoad:g}))}},7799:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(9118),s=n(6752),o=n(8674),i=n(5332);let c,l;async function d(){return c||(c=n.e(941).then(n.bind(n,7941)),l=(await c).default),c}setTimeout(d,5e3);const u=(0,r.X$)((({className:e,id:t,animationData:n,play:c,playSegment:u,speed:m,noLoop:h,size:f,quality:v,isLowPriority:p,onLoad:g})=>{const[Z,E]=(0,r.eJ)(),P=(0,r.sO)(null),y=(0,r.sO)(!1),C=(0,r.sO)(!1),b=(0,r.sO)();b.current=c;const w=(0,r.sO)();w.current=u,(0,r.d4)((()=>{if(Z||!n)return;const e=()=>{if(!P.current)return;const e=new l(t,P.current,n,{noLoop:h,size:f,quality:v,isLowPriority:p},g);m&&e.setSpeed(m),E(e)};l?e():d().then((()=>{(0,a.T2)((()=>{P.current&&e()}))}))}),[Z,n,t,p,h,g,v,f,m]),(0,r.d4)((()=>()=>{Z&&Z.destroy()}),[Z]);const N=(0,r.I4)(((e=!1)=>{Z&&(b.current||w.current)&&(w.current?Z.playSegment(w.current):e?Z.goToAndPlay(0):Z.play())}),[Z]),k=(0,r.I4)((()=>{Z&&Z.pause()}),[Z]),I=(0,r.I4)((()=>{C.current=!0,Z&&(y.current||(y.current=Z.isPlaying()),k())}),[Z,k]),T=(0,r.I4)((()=>{y.current&&N(),y.current=!1,C.current=!1}),[N]),S=(0,r.I4)((()=>{(0,a.T2)(T)}),[T]);(0,r.d4)((()=>{Z&&(c||u?C.current?y.current=!0:N(h):C.current?y.current=!1:k())}),[Z,c,u,h,N,k]),(0,o.ZP)(I,T),(0,i.Z)(I,S);const M=(0,s.Z)("AnimatedSticker",e),x=f?`width: ${f}px; height: ${f}px;`:void 0;return r.ZP.createElement("div",{ref:P,className:M,style:x})}))},4752:(e,t,n)=>{n.d(t,{Z:()=>T});var r=n(4050),a=n(6137),s=n(1713),o=n(7361),i=n(790),c=n(2858),l=n(6752),d=n(2340),u=n(5376),m=n(2761),h=n(1212),f=n(2019),v=n(3186),p=n(2619),g=n(9107),Z=n(1174),E=n(6202),P=n(396),y=n(663),C=n(231),b=n(9196),w=n(8033);const N=o.wB?20:25,k=o.wB?50:75;function I(e,t,n){return r.ZP.createElement("div",{className:"seekline no-selection",ref:n},r.ZP.createElement("span",{className:"seekline-buffered-progress"},r.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),r.ZP.createElement("span",{className:"seekline-play-progress"},r.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),r.ZP.createElement("span",{className:"seekline-thumb"},r.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const T=(0,r.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:T,origin:S,date:M,lastSyncTime:x,className:L,isSelectable:A,isSelected:$,onPlay:O,onReadMedia:F,onCancelUpload:U,onDateClick:D})=>{const{content:{audio:R,voice:B,video:V},isMediaUnread:X}=t,K=Boolean(B||V),q=(0,r.sO)(!1),z=(0,r.sO)(!1),j=(0,r.sO)(null),H=(0,g.Z)(),{isRtl:Y}=H,[J,W]=(0,r.eJ)(!1),_=x,G=(0,c.Ti)(t,"pictogram"),Q=(0,E.Z)(G,!1,a.IU.BlobUrl),{mediaData:ee,downloadProgress:te}=(0,m.Z)((0,c.Ti)(t,"inline"),!_,(0,c.kG)(t,"inline")),ne=(0,r.I4)((()=>{W(!0),O(t.id,t.chatId)}),[t,O]),re=(0,r.I4)((()=>{W(!1)}),[]),{isBuffered:ae,bufferedProgress:se,bufferingHandlers:oe,checkBuffering:ie}=(0,f.Z)(),{isPlaying:ce,playProgress:le,playPause:de,play:ue,pause:me,setCurrentTime:he,duration:fe}=(0,v.Z)((0,P.An)(t),(0,c.XV)(t),K?"voice":"audio",S,ee,oe,void 0,ie,J,ne,re,(0,c.CI)(t)),ve=ce||le>0&&le<1;(0,r.d4)((()=>{W(ce)}),[ce]);const{isDownloadStarted:pe,downloadProgress:ge,handleDownloadClick:Ze}=(0,p.Z)((0,c.Ti)(t,"download"),(0,c.I3)(t)),Ee=J&&!ae,{isUploading:Pe,isTransferring:ye,transferProgress:Ce}=(0,c.Sc)(t,pe?ge:T||te,Ee||pe),{shouldRender:be,transitionClassNames:we}=(0,h.Z)(ye),Ne=be&&(Ee||Pe),ke=(0,r.I4)((()=>{Pe?null==U||U():(ce||O(t.id,t.chatId),W(!J),de())}),[ce,Pe,t.id,t.chatId,U,O,de,J]);(0,r.d4)((()=>{ce&&F&&X&&F()}),[ce,X,F]);const Ie=(0,r.I4)((e=>{if(q.current&&j.current){const{width:t,left:n}=j.current.getBoundingClientRect(),r=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),he(Math.max(Math.min(fe*((r-n)/t),fe-.1),.001))}}),[fe,he]),Te=(0,r.I4)((e=>{e instanceof MouseEvent&&2===e.button||(q.current=!0,z.current=ce,me(),Ie(e))}),[Ie,me,ce]),Se=(0,r.I4)((()=>{q.current=!1,z.current&&ue()}),[ue]),Me=(0,r.I4)((()=>{D(t.id,t.chatId)}),[D,t.id,t.chatId]);function xe(){if(K)return n||"Voice";const{title:e,fileName:t}=R;return e||t}(0,r.d4)((()=>{if(j.current&&ve)return(0,Z.s)(j.current,{onCapture:Te,onRelease:Se,onClick:Se,onDrag:Ie})}),[ve,Te,Ie,Se]);const Le=(0,c.B4)(t),Ae=(0,r.Ye)((()=>B&&function(e,t=0,n=!1,a,s){const{waveform:o,duration:i}=e;if(!o)return;const c="dark"===a?"#494A78":"#ADD3F7",l="dark"===a?"#B7ABED":"#AEDFA4",d="dark"===a?"#8774E1":"#3390EC",u="dark"===a?"#FFFFFF":"#4FAE4E",m=Math.min(i/10,1),h=Math.round(N+(k-N)*m),f=function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const r=Array(n),a=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=a[t]+(a[t+1]<<8);r[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),o=Math.floor(5*(n-1)%8),i=a[s]+(a[s+1]<<8);return r[n-1]=i>>o&31,r}(new Uint8Array(o)),{data:v,peak:p}=function(e,t){let n=0;const r=new Array(t),a=e.length/t,s=e[0],o=e[e.length-1];for(let d=0;d<t;d++){var i,c,l;const t=Math.floor(d*a),u=((null!==(i=e[t-1])&&void 0!==i?i:s)+(null!==(c=e[t])&&void 0!==c?c:s)+(null!==(l=e[t+1])&&void 0!==l?l:o))/3;r[d]=u,n<u&&(n=u)}return{data:r,peak:n}}(f,h),{src:g,width:Z,height:E}=function(e,t,{peak:n,fillStyle:r,progressFillStyle:a}){const s=4*e.length,o=document.createElement("canvas");o.width=2*s,o.height=46,o.style.width=`${s}px`,o.style.height="23px";const i=o.getContext("2d");return i.scale(2,2),e.forEach(((s,o)=>{i.globalAlpha=o/e.length>=t?.5:1,i.fillStyle=t>o/e.length?a:r;const c=Math.max(2,s/Math.max(1,n)*23);!function(e,t,n,r,a,s){2<2*s&&(s=1),a<2*s&&(s=a/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-a,s),e.arcTo(t+2,n-a,t,n-a,s),e.arcTo(t,n-a,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(i,4*o,23,0,c,1),i.fill()})),{src:o.toDataURL(),width:s,height:23}}(v,t,{peak:p,fillStyle:n?l:c,progressFillStyle:n?u:d});return r.ZP.createElement("img",{src:g,alt:"",width:Z,height:E,className:"waveform",draggable:!1,ref:s})}(B,X&&!Le?1:le,Le,e,j)),[B,X,Le,le,e]),$e=(0,l.Z)("Audio",L,Le&&S===s.Cr.Inline&&"own",(S===s.Cr.Search||S===s.Cr.SharedMedia)&&"bigger",$&&"audio-is-selected"),Oe=["toggle-play"];Ne?Oe.push("loading"):ce?Oe.push("pause"):ce||Oe.push("play");const Fe=(0,l.Z)("content",ve&&"with-seekline");function Ue(){return r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("div",{className:Fe},r.ZP.createElement("div",{className:"content-row"},r.ZP.createElement("p",{className:"title",dir:"auto",title:xe()},(0,d.Z)(xe())),r.ZP.createElement("div",{className:"message-date"},M&&r.ZP.createElement(w.Z,{className:"date",onClick:Me},(0,i.VX)(H,1e3*M)))),ve&&r.ZP.createElement("div",{className:"meta search-result",dir:Y?"rtl":void 0},r.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},le<1&&`${(0,i.k9)(fe*le,fe)}`),I(le,se,j)),!ve&&function(){if(K)return r.ZP.createElement("div",{className:"meta",dir:Y?"rtl":void 0},(0,i.k9)((B||V).duration));const{performer:e}=R;return r.ZP.createElement("div",{className:"meta",dir:Y?"rtl":void 0},(0,i.k9)(fe),r.ZP.createElement("span",{className:"bullet"},"•"),e&&r.ZP.createElement("span",{className:"performer",title:e},(0,d.Z)(e)),e&&n&&r.ZP.createElement("span",{className:"bullet"},"•"),n&&r.ZP.createElement("span",{title:n},(0,d.Z)(n)))}()))}return r.ZP.createElement("div",{className:$e,dir:H.isRtl?"rtl":void 0},A&&r.ZP.createElement("div",{className:"message-select-control"},$&&r.ZP.createElement("i",{className:"icon-select"})),r.ZP.createElement(C.Z,{round:!0,ripple:!o.wB,size:"smaller",color:Q?"translucent-white":"primary",className:Oe.join(" "),ariaLabel:ce?"Pause audio":"Play audio",onClick:ke,isRtl:H.isRtl,backgroundImage:Q},r.ZP.createElement("i",{className:"icon-play"}),r.ZP.createElement("i",{className:"icon-pause"})),be&&r.ZP.createElement("div",{className:(0,l.Z)("media-loading",we,Ne&&"interactive")},r.ZP.createElement(b.Z,{progress:Ce,transparent:!0,size:"m",onClick:Ne?ke:void 0,noCross:!Ne})),R&&!Pe&&r.ZP.createElement(C.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:pe?"Cancel download":"Download",onClick:Ze},r.ZP.createElement("i",{className:pe?"icon-close":"icon-arrow-down"})),S===s.Cr.Search&&Ue(),S!==s.Cr.Search&&R&&function(e,t,n,a,s,o,c,l,m,h,f){const{title:v,performer:p,fileName:g}=t,Z=a||s>0&&s<1,{isRtl:E}=y.i0;return r.ZP.createElement("div",{className:"content"},r.ZP.createElement("p",{className:"title",dir:"auto",title:v},(0,d.Z)(v||g)),Z&&r.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},r.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,i.k9)(n*s,n)),I(s,o,c)),!Z&&l&&r.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},h?`${(0,u.yW)(t.size*h)} / `:void 0,(0,u.yW)(t.size)),!Z&&!l&&r.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},r.ZP.createElement("span",{className:"duration",dir:"auto"},(0,i.k9)(n)),r.ZP.createElement("span",{className:"bullet"},"•"),r.ZP.createElement("span",{className:"performer",dir:"auto",title:p},(0,d.Z)(p||"Unknown")),m&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("span",{className:"bullet"},"•"),r.ZP.createElement(w.Z,{className:"date",onClick:f},(0,i.ZK)(e,1e3*m,!0)))))}(H,R,fe,ce,le,se,j,pe||Pe,M,Ce,D?Me:void 0),S===s.Cr.SharedMedia&&(B||V)&&Ue(),S===s.Cr.Inline&&B&&function(e,t,n,a){return r.ZP.createElement("div",{className:"content"},t,r.ZP.createElement("p",{className:(0,l.Z)("voice-duration",a&&"unread"),dir:"auto"},0===n?(0,i.k9)(e.duration):(0,i.k9)(e.duration*n)))}(B,Ae,le,X))}))},172:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(6137),s=n(3716),o=n(2858),i=n(2155),c=n(6752),l=n(2340),d=n(6202),u=n(8835),m=n(9107);const h=(0,r.X$)((({className:e,size:t="large",chat:n,user:h,text:f,withOnlineStatus:v,isSavedMessages:p,lastSyncTime:g,onClick:Z})=>{const E=h&&(0,o.NB)(h),P=h&&(0,o.pK)(h.id);let y;p||E||(h?y=(0,o.RT)(h):n&&(y=(0,o.RT)(n)));const C=(0,d.Z)(y,!1,a.IU.DataUri,g),{shouldRenderFullMedia:b,transitionClassNames:w}=(0,u.Z)(C,"slow"),N=(0,m.Z)();let k="";if(p)k=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(E)k=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(P)k=r.ZP.createElement("i",{className:"icon-reply-filled"});else if(b)k=r.ZP.createElement("img",{src:C,className:`${w} avatar-media`,alt:"",decoding:"async"});else if(h){const e=(0,o.Js)(h);k=e?(0,i.Xv)(e,2):void 0}else if(n){const e=(0,o.U)(N,n);k=e&&(0,i.Xv)(e,(0,o.YA)(n.id)?2:1)}else f&&(k=(0,i.Xv)(f,2));const I=!p&&h&&(0,o.kM)(h),T=(0,c.Z)(`Avatar size-${t}`,e,`color-bg-${(0,o.Rs)(h||n)}`,p&&"saved-messages",E&&"deleted-account",P&&"replies-bot-account",v&&I&&"online",Z&&"interactive",!p&&!b&&"no-photo"),S=(0,r.I4)((e=>{Z&&Z(e,p||b)}),[Z,p,b]),M=(h||n)&&(h||n).id;return r.ZP.createElement("div",{className:T,onClick:S,"data-test-sender-id":s.Cg?M:void 0},"string"==typeof k?(0,l.Z)(k,["jumbo"===t?"hq_emoji":"emoji"]):k)}))},180:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(782),l=n(4319),d=n(6272),u=n(9107),m=n(1876),h=n(3321);const f=(0,r.X$)((0,a.c$)(((e,{chatOrUserId:t})=>{const{lastSyncTime:n,countryList:{phoneCodes:r}}=e,a=t?(0,s.Z1)(e,t):void 0,i=(0,o.YA)(t)?(0,s.dy)(e,t):void 0,c=a&&(0,o.i4)(a,(0,s.dZ)(e),(0,s.NJ)(e));return{lastSyncTime:n,phoneCodeList:r,chat:a,user:i,canInviteUsers:a&&!i&&(!(0,o.eA)(a)&&!(0,o.Mg)(a,"inviteUsers")||(0,o.VE)(a,"inviteUsers")),isMuted:c}}),((e,t)=>(0,c.ei)(t,["loadFullUser","updateChatMutedState","showNotification"])))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:a,canInviteUsers:s,isMuted:c,phoneCodeList:f,loadFullUser:v,showNotification:p,updateChatMutedState:g})=>{const{id:Z,fullInfo:E,username:P,phoneNumber:y,isSelf:C}=t||{},{id:b}=n||{},w=(0,u.Z)();(0,r.d4)((()=>{e&&Z&&v({userId:Z})}),[v,Z,e]);const N=(0,r.I4)((()=>{g({chatId:b,isMuted:!c})}),[b,c,g]);if(!n||n.isRestricted||C&&!a)return;function k(e,t){(0,l.TE)(e),p({message:`${t} was copied`})}const I=y&&(0,d.WZ)(f,y),T=(0,o.hu)(n),S=(null==E?void 0:E.bio)||(0,o.GM)(n);return r.ZP.createElement("div",{className:"ChatExtra"},I&&!!I.length&&r.ZP.createElement(m.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(I,w("Phone"))},r.ZP.createElement("span",{className:"title",dir:"auto"},I),r.ZP.createElement("span",{className:"subtitle"},w("Phone"))),P&&r.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(`@${P}`,w("Username"))},r.ZP.createElement("span",{className:"title",dir:"auto"},(0,i.Z)(P)),r.ZP.createElement("span",{className:"subtitle"},w("Username"))),S&&!!S.length&&r.ZP.createElement(m.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},r.ZP.createElement("span",{className:"title",dir:"auto"},(0,i.Z)(S,["br","links","emoji"])),r.ZP.createElement("span",{className:"subtitle"},w(Z?"UserBio":"Info"))),(s||!P)&&T&&r.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(T,w("SetUrlPlaceholder"))},r.ZP.createElement("div",{className:"title"},T),r.ZP.createElement("span",{className:"subtitle"},w("SetUrlPlaceholder"))),!a&&r.ZP.createElement(m.Z,{icon:"unmute",ripple:!0,onClick:N},r.ZP.createElement("span",null,w("Notifications")),r.ZP.createElement(h.Z,{id:"group-notifications",label:Z?"Toggle User Notifications":"Toggle Chat Notifications",checked:!c,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(782),c=n(9107),l=n(2340),d=n(172),u=n(3103),m=n(231);const h=(0,r.X$)((0,a.c$)(((e,{chat:t})=>{const n=(0,o.YA)(t.id),r=(0,s.FM)(e,t.id),a=n&&(0,s.dy)(e,(0,o.zX)(t)),i=a&&(0,o.cS)(a)&&!t.isSupport,c=n&&!r&&!i,l=n?(0,o.Vl)((0,s.dy)(e,(0,o.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:r,isBot:i,isChannel:(0,o.eA)(t),isBasicGroup:(0,o.G9)(t),isSuperGroup:(0,o.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:l}}),((e,t)=>(0,i.ei)(t,["leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact"])))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:a,isChatWithSelf:s,isBot:i,isBasicGroup:h,isSuperGroup:f,currentUserId:v,canDeleteForAll:p,contactName:g,onClose:Z,onCloseAnimationEnd:E,leaveChannel:P,deleteHistory:y,deleteChannel:C,deleteChatUser:b,blockContact:w})=>{const N=(0,c.Z)(),k=(0,o.U)(N,t),I=(0,r.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),Z()}),[y,t.id,Z]),T=(0,r.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),w({contactId:t.id,accessHash:t.accessHash}),Z()}),[y,t.id,t.accessHash,w,Z]),S=(0,r.I4)((()=>{a?y({chatId:t.id,shouldDeleteForAll:!1}):h?(b({chatId:t.id,userId:v}),y({chatId:t.id,shouldDeleteForAll:!1})):!n&&!f||t.isCreator?(n||f)&&t.isCreator&&C({chatId:t.id}):P({chatId:t.id}),Z()}),[a,h,n,f,v,t.isCreator,t.id,Z,y,b,P,C]);return r.ZP.createElement(u.Z,{isOpen:e,className:"DeleteChatModal",header:r.ZP.createElement("div",{className:"modal-header",dir:N.isRtl?"rtl":void 0},r.ZP.createElement(d.Z,{size:"tiny",chat:t,isSavedMessages:s}),r.ZP.createElement("h3",{className:"modal-title"},N(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":h||f?"Group.LeaveGroup":"DeleteChatUser"))),onClose:Z,onCloseAnimationEnd:E},n&&t.isCreator?r.ZP.createElement("p",null,(0,l.Z)(N("ChatList.DeleteAndLeaveGroupConfirmation",k),["simple_markdown"])):n&&!t.isCreator||h||f?r.ZP.createElement("p",null,(0,l.Z)(N("ChannelLeaveAlertWithName",k),["simple_markdown"])):r.ZP.createElement("p",null,(0,l.Z)(N("ChatList.DeleteChatConfirmation",g),["simple_markdown"])),i&&r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},N("DeleteAndStop")),p&&r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},g?(0,l.Z)(N("ChatList.DeleteForEveryone",g)):N("DeleteForAll")),r.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},N(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":h||f?"Group.LeaveGroup":p?"ChatList.DeleteForCurrentUser":"Delete")),r.ZP.createElement(m.Z,{className:"confirm-dialog-button",isText:!0,onClick:Z},N("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5376),s=n(2858),o=n(3657),i=n(2761),c=n(6202),l=n(6562),d=n(7002);const u=(0,r.X$)((({message:e,observeIntersection:t,smaller:n,uploadProgress:u,withDate:m,datetime:h,className:f,sender:v,isSelected:p,isSelectable:g,onCancelUpload:Z,onMediaClick:E,onDateClick:P})=>{const y=(0,r.sO)(null),C=e.content.document,b=(0,a.K2)(C)||"",{fileName:w,size:N,timestamp:k}=C,I=E&&Boolean(C.mediaType),T=(0,o.Op)(y,t),[S,M]=(0,r.eJ)(!1),{mediaData:x,downloadProgress:L}=(0,i.Z)((0,s.Ti)(e,"download"),!S,void 0,void 0,void 0,!0),{isUploading:A,isTransferring:$,transferProgress:O}=(0,s.Sc)(e,u||L,S),F=(0,a.v6)(C),U=F?(0,s.DH)(e):void 0,D=F?C.previewBlobUrl:void 0,R=(0,c.Z)((0,s.Ti)(e,"pictogram"),!T),B=(0,r.I4)((()=>{I?E():A?Z&&Z():M((e=>!e))}),[I,A,Z,E]),V=(0,r.I4)((()=>{P(e.id,e.chatId)}),[P,e.id,e.chatId]);return(0,r.d4)((()=>{S&&x&&((0,l.Z)(x,w),M(!1))}),[w,x,S]),r.ZP.createElement(d.Z,{ref:y,name:w,extension:b,size:N,timestamp:m?h||k:void 0,thumbnailDataUri:U,previewData:D||R,smaller:n,isTransferring:$,isUploading:A,transferProgress:O,className:f,sender:v,isSelectable:g,isSelected:p,actionIcon:I?(0,s.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:B,onDateClick:P?V:void 0})}))},7002:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(1212),s=n(8835),o=n(6752),i=n(790),c=n(5376),l=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const f=(0,r.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:w,transferProgress:N,actionIcon:k,onClick:I,onDateClick:T})=>{const S=(0,u.Z)();let M=(0,r.sO)(null);e&&(M=e);const{shouldRender:x,transitionClassNames:L}=(0,a.Z)(y,void 0,!0),A=(0,c.Oh)(f),$=(0,c.yW)(n),{shouldRenderThumb:O,shouldRenderFullMedia:F,transitionClassNames:U}=(0,s.Z)(Z,"slow"),{width:D,height:R}=(0,l.lE)(P),B=(0,o.Z)("File",E,P&&"smaller",I&&!C&&"interactive",w&&"file-is-selected");return r.ZP.createElement("div",{ref:M,className:B,dir:S.isRtl?"rtl":void 0},b&&r.ZP.createElement("div",{className:"message-select-control"},w&&r.ZP.createElement("i",{className:"icon-select"})),r.ZP.createElement("div",{className:"file-icon-container",onClick:C?void 0:I},g||Z?r.ZP.createElement("div",{className:"file-preview media-inner"},O&&r.ZP.createElement("img",{src:g,width:D,height:R,className:"thumbnail",alt:""}),F&&r.ZP.createElement("img",{src:Z,className:`full-media ${U}`,width:D,height:R,alt:""})):r.ZP.createElement("div",{className:`file-icon ${A}`},f.length<=4&&r.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),x&&r.ZP.createElement("div",{className:(0,o.Z)("file-progress",A,L)},r.ZP.createElement(m.Z,{progress:N,size:P?"s":"m",onClick:C?I:void 0})),I&&r.ZP.createElement("i",{className:(0,o.Z)("action-icon",k||"icon-download",x&&"hidden")})),r.ZP.createElement("div",{className:"file-info"},r.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(t)),r.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},r.ZP.createElement("span",null,y&&N?`${Math.round(100*N)}%`:$),p&&r.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(p)),!p&&v&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("span",{className:"bullet"}),r.ZP.createElement(h.Z,{onClick:T},(0,i.ZK)(S,1e3*v,!0))))),p&&v&&r.ZP.createElement(h.Z,{onClick:T},(0,i.VX)(S,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(1713),o=n(2858),i=n(8085),c=n(2340),l=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);const f=(0,r.X$)((0,a.c$)(((e,{chatId:t})=>{const{lastSyncTime:n}=e,r=(0,i.Z1)(e,t);return{lastSyncTime:n,chat:r,onlineCount:r?(0,i.YK)(e,r):void 0,areMessagesLoaded:Boolean((0,i.Zw)(e,t))}}),((e,t)=>(0,l.ei)(t,["loadFullChat","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:a,withFullInfo:i,withUpdatingStatus:l,withChatType:f,noRtl:v,chat:p,onlineCount:g,areMessagesLoaded:Z,lastSyncTime:E,loadFullChat:P,openMediaViewer:y})=>{const C=p&&(0,o.ZV)(p),{id:b,isMin:w,isRestricted:N}=p||{};(0,r.d4)((()=>{b&&!w&&i&&E&&P({chatId:b})}),[b,w,E,i,P,C]);const k=(0,r.I4)(((e,n)=>{p&&n&&(e.stopPropagation(),y({avatarOwnerId:p.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[p,t,y]),I=(0,d.Z)();if(p)return r.ZP.createElement("div",{className:"ChatInfo",dir:!v&&I.isRtl?"rtl":void 0},r.ZP.createElement(u.Z,{key:p.id,size:t,chat:p,onClick:n?k:void 0}),r.ZP.createElement("div",{className:"info"},r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},(0,c.Z)((0,o.U)(I,p))),p.isVerified&&r.ZP.createElement(m.Z,null)),function(){if(l&&!Z&&!N)return r.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating"));if(!p)return;if(e)return r.ZP.createElement(h.Z,{typingStatus:e});if(f)return r.ZP.createElement("div",{className:"status",dir:"auto"},I((0,o.l6)(p)));const t=a?p.username:void 0,n=function(e,t){const n=e((0,o.l6)(t)),{membersCount:r}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":r?e("Channel"===n?"Subscribers":"Members",r,"i"):n}(I,p),s=g?`, ${I("OnlineCount",g,"i")}`:void 0;return r.ZP.createElement("div",{className:"status"},t&&r.ZP.createElement("span",{className:"handle"},t),r.ZP.createElement("span",{className:"group-status"},n),s&&r.ZP.createElement("span",{className:"online-status"},s))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(790),s=n(9107),o=n(8018);const i=(0,r.X$)((({message:e,outgoingStatus:t})=>{const n=(0,s.Z)();return r.ZP.createElement("div",{className:"LastMessageMeta"},t&&r.ZP.createElement(o.Z,{status:t}),r.ZP.createElement("span",{className:"time"},(0,a.VX)(n,1e3*e.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(790),s=n(2858),o=n(6202),i=n(8835);const c=(0,r.X$)((({message:e,idPrefix:t="shared-media",onClick:n})=>{const c=(0,r.I4)((()=>{n(e.id,e.chatId)}),[e.id,e.chatId,n]),l=(0,s.DH)(e),d=(0,o.Z)((0,s.Ti)(e,"pictogram")),{shouldRenderThumb:u,shouldRenderFullMedia:m,transitionClassNames:h}=(0,i.Z)(d,"slow"),f=(0,s.b7)(e);return r.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?c:void 0},u&&r.ZP.createElement("img",{src:l,alt:""}),m&&r.ZP.createElement("img",{src:d,className:`${h} full-media`,alt:""}),f&&r.ZP.createElement("span",{className:"video-duration"},f.isGif?"GIF":(0,a.k9)(f.duration)))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>o});var r,a=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"}(r||(r={}));const o=(0,a.X$)((({status:e})=>a.ZP.createElement("div",{className:"MessageOutgoingStatus"},a.ZP.createElement(s.Z,{name:"reveal",activeKey:r[e]},(()=>a.ZP.createElement("i",{className:`icon-message-${e}`}))))))},7262:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(6752),s=n(1212),o=n(2340),i=n(9107);const c=(0,r.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,i.Z)(),{transitionClassNames:c}=(0,s.Z)(!0);return r.ZP.createElement("div",{className:(0,a.Z)("NothingFound",c,t&&"with-description")},e,t&&r.ZP.createElement("p",{className:"description"},(0,o.Z)(n(t),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(2858),s=n(1273),o=n(4605),i=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,r.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,r.sO)(null),w=t.length>10;(0,r.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{b.current.focus()}))}),500)}),[]);const N=(0,r.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,r.I4)((e=>{const{value:t}=e.currentTarget;y(t)}),[y]),[I,T]=(0,m.Z)(C,e,Boolean(n)),S=(0,h.Z)();return r.ZP.createElement("div",{className:"Picker"},r.ZP.createElement("div",{className:"picker-header custom-scroll",dir:S.isRtl?"rtl":void 0},t.map(((e,n)=>r.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:w&&n<t.length-5,canClose:!0,onClick:N,clickArg:e}))),r.ZP.createElement(i.Z,{id:g,ref:b,value:n,onChange:k,placeholder:v||S("SelectChat")})),null!=I&&I.length?r.ZP.createElement(s.Z,{className:"picker-list custom-scroll",items:I,onLoadMore:T,noScrollRestore:E},I.map((e=>r.ZP.createElement(c.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>N(e),ripple:!0},r.ZP.createElement(o.Z,{label:"",checked:t.includes(e)}),(0,a.YA)(e)?r.ZP.createElement(l.Z,{userId:e}):r.ZP.createElement(d.Z,{chatId:e}))))):Z||!I||I.length?r.ZP.createElement(f.Z,null):r.ZP.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(6752),l=n(9107),d=n(172);const u=(0,r.X$)((0,a.c$)(((e,{chatOrUserId:t})=>t?{chat:t?(0,s.Z1)(e,t):void 0,user:(0,o.YA)(t)?(0,s.dy)(e,t):void 0}:{}))((({icon:e,title:t,isMinimized:n,canClose:a,onClick:s,clickArg:u,chat:m,user:h,className:f})=>{const v=(0,l.Z)();let p,g;if(e&&t)p=r.ZP.createElement("div",{className:"item-icon"},r.ZP.createElement("i",{className:`icon-${e}`})),g=t;else if(m||h){p=r.ZP.createElement(d.Z,{chat:m,user:h,size:"small",isSavedMessages:null==h?void 0:h.isSelf});const e=!m||h&&!h.isSelf?(0,o.Vl)(h):(0,o.U)(v,m,h);g=e?(0,i.Z)(e):void 0}const Z=(0,c.Z)("PickerSelectedItem",f,n&&"minimized",a&&"closeable");return r.ZP.createElement("div",{className:Z,onClick:()=>s(u),title:n?g:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&r.ZP.createElement("div",{className:"item-name",dir:"auto"},g),a&&r.ZP.createElement("div",{className:"item-remove"},r.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(5116),s=n(1713),o=n(8085),i=n(2858),c=n(2340),l=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);const f=(0,r.X$)((0,a.c$)(((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:r,serverTimeOffset:a}=e,s=(0,o.dy)(e,t);return{lastSyncTime:r,user:s,isSavedMessages:!n&&s&&s.isSelf,areMessagesLoaded:Boolean((0,o.Zw)(e,t)),serverTimeOffset:a}}),((e,t)=>(0,l.ei)(t,["loadFullUser","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:a,withUsername:o,withFullInfo:l,withUpdatingStatus:f,noStatusOrTyping:v,noRtl:p,user:g,isSavedMessages:Z,areMessagesLoaded:E,lastSyncTime:P,loadFullUser:y,openMediaViewer:C,serverTimeOffset:b})=>{const{id:w}=g||{},N=(0,i.Js)(g);(0,r.d4)((()=>{l&&P&&w&&y({userId:w})}),[w,y,P,l]);const k=(0,r.I4)(((e,n)=>{g&&n&&(e.stopPropagation(),C({avatarOwnerId:g.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[g,t,C]),I=(0,d.Z)();if(g)return r.ZP.createElement("div",{className:"ChatInfo",dir:!p&&I.isRtl?"rtl":void 0},r.ZP.createElement(u.Z,{key:g.id,size:t,user:g,isSavedMessages:Z,onClick:a?k:void 0}),r.ZP.createElement("div",{className:"info"},Z?r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",null,I("SavedMessages"))):r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},N&&(0,c.Z)(N)),(null==g?void 0:g.isVerified)&&r.ZP.createElement(m.Z,null)),(n||!Z&&!v)&&(n?r.ZP.createElement("span",{className:"status",dir:"auto"},n):f&&!E?r.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating")):g?e?r.ZP.createElement(h.Z,{typingStatus:e}):r.ZP.createElement("div",{className:"status "+((0,i.kM)(g)?"online":"")},o&&g.username&&r.ZP.createElement("span",{className:"handle"},g.username),r.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,i.Tq)(I,g,b))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>w});var r=n(4050),a=n(5116),s=n(1713),o=n(7361),i=n(8085),c=n(2858),l=n(2340),d=n(782),u=n(1174),m=n(6752),h=n(6137),f=n(647),v=n(9107),p=n(9411),g=n(2155),Z=n(6202),E=n(2937),P=n(7204),y=n(9204);const C=(0,r.X$)((({chat:e,user:t,photo:n,isFirstPhoto:a,isSavedMessages:s,lastSyncTime:o,onClick:i})=>{const d=(0,v.Z)(),u=t&&(0,c.NB)(t),f=e&&(0,c.pK)(e.id);function p(r="big",a){if(n&&!a)return`photo${n.id}?size=c`;let o;return s||u||f||(t?o=(0,c.RT)(t,r):e&&(o=(0,c.RT)(e,r))),o}const C=p(),b=(0,Z.Z)(C,!1,null!=C&&C.startsWith("avatar")?h.IU.DataUri:h.IU.BlobUrl,o),w=(0,Z.Z)(!b&&a?p("normal",!0):void 0,!1,h.IU.DataUri,o),N=(0,E.Z)(!b&&n&&n.thumbnail&&n.thumbnail.dataUri),k=b||w||N,I=(0,P.Z)(k);let T="";if(s)T=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(u)T=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(f)T=r.ZP.createElement("i",{className:"icon-reply-filled"});else if(k)T=r.ZP.createElement("img",{src:k,className:"avatar-media",alt:"",decoding:"async"});else if(!k&&t){const e=(0,c.Js)(t);T=e?(0,g.Xv)(e,2):void 0}else if(!k&&e){const t=(0,c.U)(d,e);T=t&&(0,g.Xv)(t,(0,c.YA)(e.id)?2:1)}else T=r.ZP.createElement("div",{className:"spinner-wrapper"},r.ZP.createElement(y.Z,{color:"white"}));const S=(0,m.Z)("ProfilePhoto",`color-bg-${(0,c.Rs)(t||e)}`,s&&"saved-messages",u&&"deleted-account",f&&"replies-bot-account",!s&&!k&&"no-photo");return r.ZP.createElement("div",{className:S,onClick:k?i:void 0},I&&k&&I!==k&&r.ZP.createElement("img",{src:I,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof T?(0,l.Z)(T,["hq_emoji"]):T)}));var b=n(2255);const w=(0,r.X$)((0,a.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:r,serverTimeOffset:a}=e,s=(0,i.dy)(e,t),o=(0,i.Z1)(e,t),c=!n&&s&&s.isSelf,{animationLevel:l}=e.settings.byKey;return{connectionState:r,user:s,chat:o,isSavedMessages:c,animationLevel:l,serverTimeOffset:a}}),((e,t)=>(0,d.ei)(t,["loadFullUser","openMediaViewer"])))((({forceShowSelf:e,user:t,chat:n,isSavedMessages:a,connectionState:i,animationLevel:d,loadFullUser:g,openMediaViewer:Z,serverTimeOffset:E})=>{var P;const{id:y}=t||{},{id:w}=n||{},N=t?(0,c.Js)(t):n?n.title:"",k=(null==t?void 0:t.photos)||(null==n?void 0:n.photos)||[],I=d>=1?"slide":"none",[T,S]=(0,r.eJ)(0),M=a||k.length<=1||0===T,x=a||k.length<=1||T===k.length-1;(0,r.d4)((()=>{T>k.length&&S(Math.max(0,k.length-1))}),[T,k.length]);const L=(0,v.Z)();(0,r.d4)((()=>{"connectionStateReady"===i&&y&&!e&&g({userId:y})}),[y,g,i,e]),function(e,t,n){(0,r.d4)((()=>{t.slice(n,n+4).forEach((e=>{f.UV(`photo${e.id}?size=c`)||f.he(`photo${e.id}?size=c`,h.IU.BlobUrl)}))}),[n,t])}(0,k,T);const A=(0,r.I4)((()=>{Z({avatarOwnerId:y||w,profilePhotoIndex:T,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[Z,y,w,T,e]),$=(0,r.I4)((()=>{M||S(T-1)}),[T,M]),O=(0,r.I4)((()=>{x||S(T+1)}),[T,x]);if((0,r.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,u.s)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:o.$b?(e,t)=>t===u.e.Right?($(),!0):t===u.e.Left&&(O(),!0):void 0})}),[O,$]),!t&&!n)return;function F(){const e=!a&&k&&k.length>0?k[T]:void 0;return r.ZP.createElement(C,{key:T,user:t,chat:n,photo:e,isSavedMessages:a,isFirstPhoto:M,onClick:A})}const U=null===(P=t||n)||void 0===P?void 0:P.isVerified;return r.ZP.createElement("div",{className:(0,m.Z)("ProfileInfo",e&&"self"),dir:L.isRtl?"rtl":void 0},r.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(a||!k||k.length<=1))return r.ZP.createElement("div",{className:"photo-dashes"},k.map(((e,t)=>r.ZP.createElement("span",{className:"photo-dash "+(t===T?"current":"")}))))}(),r.ZP.createElement(b.Z,{activeKey:T,name:I,className:"profile-slide-container"},F),!M&&r.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":L("AccDescrPrevious"),onClick:$}),!x&&r.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":L("Next"),onClick:O})),r.ZP.createElement("div",{className:"info",dir:L.isRtl?"rtl":"auto"},a?r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},L("SavedMessages"))):r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",{dir:"auto"},N&&(0,l.Z)(N)),U&&r.ZP.createElement(p.Z,null)),!a&&(t?r.ZP.createElement("div",{className:"status "+((0,c.kM)(t)?"online":"")},r.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,c.Tq)(L,t,E))):r.ZP.createElement("span",{className:"status",dir:"auto"},(0,c.eA)(n)?L("Subscribers",null!==(D=n.membersCount)&&void 0!==D?D:0,"i"):L("Members",null!==(R=n.membersCount)&&void 0!==R?R:0,"i")))));var D,R})))},3547:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(6137),s=n(3657),o=n(6202),i=n(8835),c=n(706),l=n(6752),d=n(386),u=n(7799),m=n(231);const h=(0,r.X$)((({sticker:e,size:t,observeIntersection:n,noAnimate:h,title:f,className:v,onClick:p,clickArg:g,onUnfaveClick:Z})=>{const E=(0,r.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,w=(0,o.Z)(`${P}?size=m`,!C,a.IU.BlobUrl),N=C&&!h,k=(0,o.Z)(e.isAnimated&&P,!N,a.IU.Lottie),[I,T,S]=(0,c.Z)(Boolean(k)),M=I&&N,{shouldRenderThumb:x,shouldRenderFullMedia:L,transitionClassNames:A}=(0,i.Z)(w||M,"slow");(0,r.d4)((()=>{N||S()}),[S,N]);const $=(0,l.Z)("StickerButton",p&&"interactive",e.isAnimated&&"animated",y,v),O=x&&b?`background-image: url('${b}');`:"";return r.ZP.createElement("div",{ref:E,className:$,title:f||(null==e?void 0:e.emoji),style:O,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(g)}},L&&!M&&r.ZP.createElement("img",{src:w,className:A}),N&&k&&r.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),Z&&r.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),Z(e)}},r.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9203),s=n(8778);const o=(0,r.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(a.gl.Extra,"StickerSetModal",!t);return n?r.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(5116),s=n(8085),o=n(2858),i=n(2340),c=n(9107);const l=(0,r.X$)((0,a.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dy)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),a=t&&!t.isSelf&&(0,o.Vl)(t);return r.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},a&&r.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,i.Z)(a)),n(e.action).replace("{user}","").trim(),r.ZP.createElement("span",{className:"ellipsis"}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=()=>r.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(2858),s=n(6752),o=n(8035),i=n(2340),c=n(790),l=n(9107),d=n(3709),u=n(8033),m=n(88);const h=(0,r.X$)((({message:e,senderTitle:t,onMessageClick:n})=>{const h=(0,l.Z)();let f=(0,a.s1)(e);if(!f){const t=(0,a.T7)(e);if(t){const{url:n,domain:r}=t,s=(0,a.MK)(h,e);f={siteName:r.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,description:s!==n?s:void 0}}}const v=(0,r.I4)((()=>{n(e.id,e.chatId)}),[n,e.id,e.chatId]);if(!f)return;const{siteName:p,url:g,displayUrl:Z,title:E,description:P,photo:y,video:C}=f,b=!t&&(0,o.Z)(P,170),w=(0,s.Z)("WebLink scroll-item",!y&&!C&&"without-media");return r.ZP.createElement("div",{className:w,"data-initial":(p||Z)[0],dir:h.isRtl?"rtl":void 0},y&&r.ZP.createElement(d.Z,{message:e}),r.ZP.createElement("div",{className:"content"},r.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-title",onClick:v},(0,i.Z)(E||p||Z)),b&&r.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-description",onClick:v},(0,i.Z)(b)),r.ZP.createElement(m.Z,{url:g,className:"site-name",text:"",isRtl:h.isRtl},g.replace("mailto:","")||Z),t&&r.ZP.createElement("div",{className:"sender-name"},(0,i.Z)(t))),t&&r.ZP.createElement("div",{className:"message-date"},r.ZP.createElement(u.Z,{className:"date",onClick:v,isRtl:h.isRtl},(0,c.VX)(h,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>i,Gw:()=>c,vw:()=>l,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>Z,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>w,jg:()=>N});var r=n(3716),a=n(7361),s=n(3858),o=n(2858);const i="(max-height: 640px)",c=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=200,d={width:640,height:640},u="1258816259753933",m={width:100,height:100};let h,f,v;function p(e,t,n,r){const o=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!a.wB)return n;const{width:r}=s.Z.get();return h||(h=Math.min(30,r/c-4.5)),f||(f=Math.min(29,r/c-7)),v||(v=Math.min(29,r/c-4.5)),e?h:t?v:f}(e,r)-o)*c}function g({width:e,height:t,fromOwnMessage:n,isForwarded:r,isWebPagePhoto:a,isGif:s,noAvatars:o}){const i=t/e;return N(p(n,r,a,o),function(e,t){return e&&t&&t>=.75&&t<=1.25?20*c:27*c}(s,i),e,t)}function Z(e,t){const n=window.matchMedia(i),{width:r,height:a}=s.Z.get();let o=t&&n.matches?10:8.25;return e&&(o=n.matches?10:15),{width:r,height:a-o*c}}function E(e,t,n,r,a){const{width:s,height:i}=(0,o.HV)(e)||m;return g({width:s,height:i,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:r,noAvatars:a})}function P(e,t,n,r){const{width:a,height:s}=(0,o.jC)(e)||m;return g({width:a,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:r})}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,o=c*(a.wB?r.w7:r.K7),i=s?o*s:o;return s&&i>o?{width:Math.round(o/s),height:o}:{width:o,height:i}}function w({width:e,height:t},n,r=!1){const{width:a,height:s}=Z(n,r);return N(a,s,e,t)}function N(e,t,n,r){const a=r/n,s=Math.min(n,e);return Math.round(s*a)>t?{width:Math.round(t/a),height:t}:{width:s,height:Math.round(s*a)}}},935:(e,t,n)=>{n.d(t,{X:()=>d,H:()=>h});var r=n(4050),a=n(5116),s=n(6137),o=n(2858),i=n(2340),c=n(7373),l=n(88);function d(e,t,n){const r=e.content.text;if(!r||!r.text){const t=(0,o.UD)(e);return t?[t]:void 0}const{text:a,entities:s}=r;return h(a,s,t,n)}function u(e,t,n,r){const{offset:a,length:s}=e,o=new Set([t]);if(r.has(t))return;const i=[];return n.filter(((e,n)=>n>t&&e.offset>=a&&e.offset<a+s)).map((e=>u(e,n.indexOf(e),n,r))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||o.has(e)||(t=!0),o.add(e)})),t&&i.push(e)})),{entity:e,organizedIndexes:o,nestedEntities:i}}function m(e){const t=new Set,n=[];return e.forEach(((r,a)=>{if(t.has(a))return;const s=u(r,a,e,t);s&&(s.organizedIndexes.forEach((e=>{t.add(e)})),n.push(s))})),n}function h(e,t,n,a,o){if(!t||!t.length)return f(e,n,a,o);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:w}=P;let N=e.substring(t,C);const k=N.length;N&&(u&&N.length>0&&"\n"===N[0]&&(N=N.substr(1),u=!1),N&&E.push(...f(N,n,a,o)));const I=t+k,T=I+b;let S=e.substring(C,C+b);const M=[];if(u&&S.length>0&&"\n"===S[0]&&(S=S.substr(1),u=!1),w===s.Vv.Pre&&(u=!0),y.length){let e=I;y.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:a}=Z(e,T,t,n===y.length-1);M.push(...r),e=a}))}const x=o?function(e,t,n){const r="string"==typeof t&&t,a=n.length?n.join(""):(0,i.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!r)return a;switch(e.type){case s.Vv.Bold:return`<b>${a}</b>`;case s.Vv.Italic:return`<i>${a}</i>`;case s.Vv.Underline:return`<u>${a}</u>`;case s.Vv.Code:return`<code class="text-entity-code">${a}</code>`;case s.Vv.Pre:return`\`\`\`<br/>${a}<br/>\`\`\``;case s.Vv.Strike:return`<del>${a}</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 >${a}</a>`;case s.Vv.Url:case s.Vv.TextUrl:return`<a\n class="text-entity-link"\n href=${v(r,e)}\n data-entity-type="${e.type}"\n dir="auto"\n >${a}</a>`;default:return a}}(P,S,M):function(e,t,n){const a="string"==typeof t&&t,o=n.length?n:t;if(!a)return f(o);switch(e.type){case s.Vv.Bold:return r.ZP.createElement("strong",null,f(o));case s.Vv.Blockquote:return r.ZP.createElement("blockquote",null,f(o));case s.Vv.BotCommand:return r.ZP.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Hashtag:case s.Vv.Cashtag:return r.ZP.createElement("a",{onClick:g,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Code:return r.ZP.createElement("code",{className:"text-entity-code"},f(o));case s.Vv.Email:return r.ZP.createElement("a",{href:`mailto:${a}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Italic:return r.ZP.createElement("em",null,f(o));case s.Vv.MentionName:return r.ZP.createElement(c.Z,{userId:e.userId},f(o));case s.Vv.Mention:return r.ZP.createElement(c.Z,{username:a},f(o));case s.Vv.Phone:return r.ZP.createElement("a",{href:`tel:${a}`,className:"text-entity-link",dir:"auto"},f(o));case s.Vv.Pre:return r.ZP.createElement("pre",{className:"text-entity-pre"},f(o));case s.Vv.Strike:return r.ZP.createElement("del",null,f(o));case s.Vv.TextUrl:case s.Vv.Url:return r.ZP.createElement(l.Z,{url:v(a,e),text:a},f(o));case s.Vv.Underline:return r.ZP.createElement("ins",null,f(o));default:return f(o)}}(P,S,M);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,a,o))}return{renderResult:E,entityEndIndex:T}}let E=0;return h.forEach(((t,n)=>{const{renderResult:r,entityEndIndex:a}=Z(E,e.length,t,n===h.length-1);d.push(...r),E=a})),d}function f(e,t,n,r){if(Array.isArray(e)){const a=[];return e.forEach((e=>{a.push(...f(e,t,n,r))})),a}if(r)return(0,i.Z)(e,["escape_html","emoji_html","br_html"]);const a=n?"hq_emoji":"emoji";return t?(0,i.Z)(e,[a,"br","highlight"],{highlight:t}):(0,i.Z)(e,[a,"br"])}function v(e,t){const{type:n,url:r}=t;return n===s.Vv.TextUrl&&r?r:e}function p(e){(0,a.uC)().sendBotCommand({command:e.currentTarget.innerText})}function g(e){(0,a.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,a.uC)().searchTextMessagesLocal()}},9359:(e,t,n)=>{n.d(t,{Z:()=>B});var r=n(4050),a=n(5116),s=n(3716),o=n(7361),i=n(7204),c=n(782),l=n(2858),d=n(8085),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(2864),Z=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),w=n(6202),N=n(172),k=n(9411),I=n(8729),T=n(6844),S=n(329),M=n(1876),x=n(2155),L=n(126);const A=(0,r.X$)((({chat:e,isPinned:t,isMuted:n})=>{const a=Boolean(e.unreadCount||e.hasUnreadMark||t),s=(0,P.Z)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function o(){return e.unreadCount?e.unreadMentionsCount?r.ZP.createElement("div",{className:"Badge-wrapper"},r.ZP.createElement("div",{className:"Badge mention"},r.ZP.createElement("i",{className:"icon-mention"})),r.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount))):r.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount)):e.hasUnreadMark?r.ZP.createElement("div",{className:s}):t?r.ZP.createElement("div",{className:s},r.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0}return r.ZP.createElement(L.Z,{isCustom:!0,className:"Badge-transition",isOpen:a},o)})),$=(0,r.X$)((0,a.c$)(((e,{chatId:t})=>{const n=(0,d.Z1)(e,t);if(!n||!n.lastMessage)return{};const{senderId:r,replyToMessageId:a,isOutgoing:s}=n.lastMessage,o=r?(0,d.dy)(e,r):void 0,i=(0,l.N5)(n.lastMessage),c=i&&a?(0,d.hj)(e,n.id,a):void 0,{targetUserIds:u,targetChatId:m}=i||{},h=(0,l.zX)(n),{byId:f}=e.users,{chatId:v,threadId:g,type:Z}=(0,d.Bt)(e)||{},E=t===v&&g===p._f;return{chat:n,isMuted:(0,l.i4)(n,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:o,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:c,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===Z,lastSyncTime:e.lastSyncTime,...s&&{lastMessageOutgoingStatus:(0,d.dT)(e,n.lastMessage)},...h&&{privateChatUser:(0,d.dy)(e,h)},...u&&{usersById:f}}}),((e,t)=>(0,c.ei)(t,["openChat","focusLastMessage"])))((({style:e,chatId:t,folderId:n,orderDiff:a,animationType:i,isPinned:c,chat:d,isMuted:u,privateChatUser:h,actionTargetUserIds:f,usersById:p,lastMessageSender:x,lastMessageOutgoingStatus:L,actionTargetMessage:$,actionTargetChatId:O,draft:F,animationLevel:U,isSelected:D,canScrollDown:R,lastSyncTime:B,openChat:V,focusLastMessage:X})=>{const K=(0,r.sO)(null),[q,z,j]=(0,b.Z)(),[H,Y,J]=(0,b.Z)(),{lastMessage:W,typingStatus:_}=d||{},G=W&&(0,l.Lo)(W);(0,y.Z)(t,G?W.replyToMessageId:void 0,$);const Q=W&&!(0,l.bf)(W)?(0,l.DH)(W):void 0,ee=(0,w.Z)(W?(0,l.Ti)(W,"micro"):void 0),te=Boolean(W&&(0,l.Y5)(W)),ne=(0,r.Ye)((()=>f?f.map((e=>null==p?void 0:p[e])).filter(Boolean):void 0),[f,p]);(0,r.bt)((()=>{const e=K.current;if(0!==U&&e){if(i===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(i!==m.Move)return;e.style.transform=`translate3d(0, ${100*-a}%, 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)}}),[U,a,i]);const re=(0,r.I4)((()=>{V({id:t,shouldReplaceHistory:!0}),D&&R&&X()}),[D,R,V,t,X]),ae=(0,C.Z)({chat:d,privateChatUser:h,handleDelete:function(){Y(),z()},folderId:n,isPinned:c,isMuted:u}),se=(0,v.Z)();if(!d)return;const oe=(0,P.Z)("Chat chat-item-clickable",(0,l.YA)(t)?"private":"group",D&&"selected");return r.ZP.createElement(M.Z,{ref:K,className:oe,style:e,ripple:!o.wB,contextActions:ae,onClick:re},r.ZP.createElement("div",{className:"status"},r.ZP.createElement(N.Z,{chat:d,user:h,withOnlineStatus:!0,isSavedMessages:null==h?void 0:h.isSelf,lastSyncTime:B})),r.ZP.createElement("div",{className:"info"},r.ZP.createElement("div",{className:"title"},r.ZP.createElement("h3",null,(0,Z.Z)((0,l.U)(se,d,h))),d.isVerified&&r.ZP.createElement(k.Z,null),u&&r.ZP.createElement("i",{className:"icon-muted-chat"}),d.lastMessage&&r.ZP.createElement(T.Z,{message:d.lastMessage,outgoingStatus:L})),r.ZP.createElement("div",{className:"subtitle"},function(){if(_&&W&&_.timestamp>1e3*W.date)return r.ZP.createElement(I.Z,{typingStatus:_});if(null!=F&&F.text.length)return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},r.ZP.createElement("span",{className:"draft"},se("Draft")),(0,Z.Z)(F.text));if(!W)return;if(G){const e=d&&((0,l.eA)(d)||W.senderId===W.chatId)?d:x;return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},(0,Z.Z)((0,g.D)(se,W,e,ne,$,O,{asPlain:!0})))}const e=(0,l.zF)(se,t,x);return r.ZP.createElement("p",{className:"last-message",dir:se.isRtl?"auto":"ltr"},e&&r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("span",{className:"sender-name"},(0,Z.Z)(e)),r.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,a){return n?r.ZP.createElement("span",{className:"media-preview"},r.ZP.createElement("img",{src:n,alt:"",className:a?"round":void 0}),(0,l.b7)(t)&&r.ZP.createElement("i",{className:"icon-play"}),(0,Z.Z)((0,l.MK)(e,t,!0))):(0,Z.Z)((0,l.MK)(e,t))}(se,W,ee||Q,te))}(),r.ZP.createElement(A,{chat:d,isPinned:c,isMuted:u}))),H&&r.ZP.createElement(S.Z,{isOpen:q,onClose:j,onCloseAnimationEnd:J,chat:d}))})));var O=n(1713),F=n(231),U=n(7854);const D=(0,r.X$)((0,a.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:a})=>{const s=(0,v.Z)(),i=(0,r.I4)((()=>{n({type:"editFolder",payload:e}),a(O.MT.FoldersEditFolderFromChatList)}),[e,n,a]);return r.ZP.createElement("div",{className:"EmptyFolder"},r.ZP.createElement("div",{className:"sticker"},t&&r.ZP.createElement(U.Z,{sticker:t})),r.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),r.ZP.createElement("p",{className:"description",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&a&&r.ZP.createElement(F.Z,{ripple:!o.wB,fluid:!0,pill:!0,onClick:i,size:"smaller",isRtl:s.isRtl},r.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))})));var R;!function(e){e.all="active",e.archived="archived"}(R||(R={}));const B=(0,r.X$)((0,a.c$)(((e,{folderType:t,folderId:n})=>{const{chats:{listIds:r,byId:a,orderedPinnedIds:s},users:{byId:o},lastSyncTime:i}=e,c="folder"!==t?R[t]:void 0,l=n?(0,d.Mw)(e,n):void 0;return{chatsById:a,usersById:o,lastSyncTime:i,notifySettings:(0,d.dZ)(e),notifyExceptions:(0,d.NJ)(e),...c?{listIds:r[c],orderedPinnedIds:s[c]}:{chatFolder:l}}}),((e,t)=>(0,c.ei)(t,["loadMoreChats","preloadTopChatMessages","preloadArchivedChats","openChat","openNextChat"])))((({folderType:e,folderId:t,isActive:n,chatFolder:a,chatsById:d,usersById:v,listIds:p,orderedPinnedIds:g,lastSyncTime:Z,foldersDispatch:E,notifySettings:P,notifyExceptions:y,onScreenSelect:C,loadMoreChats:b,preloadTopChatMessages:w,preloadArchivedChats:N,openChat:k,openNextChat:I})=>{const[T,S]=(0,r.Ye)((()=>"folder"===e&&a?(0,l.P4)(d,v,a,P,y):[p,g]),[e,a,d,v,P,y,p,g]),[M,x]=(0,r.Ye)((()=>{if(!T||"folder"===e&&!a)return[];const t=(0,l.O)(d,T,S,e),n=[...t.pinnedChats,...t.otherChats],r=n.map((({id:e})=>e));return[n.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),r]}),[T,S,e,a,d]),L=(0,i.Z)(M),A=(0,r.Ye)((()=>M&&L?(0,c.Q8)(M,((e,t)=>e-(void 0!==L[t]?L[t]:1/0))):{}),[M,L]),O=(0,r.I4)((()=>{b({listType:"archived"===e?"archived":"active"})}),[b,e]),[F,U]=(0,u.Z)(Z?O:void 0,x,void 0,s.t_,"all"===e&&!s.NM),R=F&&(0,l.O)(d,F,S,e);(0,r.d4)((()=>{Z&&"all"===e&&(w(),N())}),[Z,e,w,N]);const B=function(e){const t=(0,r.I4)((t=>e[t]<0),[e]),n=(0,r.I4)((t=>e[t]>0),[e]),a=Object.keys(e).map(Number),s=a.filter(t).length,o=a.filter(n).length;return(0,r.I4)((r=>{const a=e[r];return 0===a?m.None:a===1/0||a===-1/0||t(r)&&s<=o||n(r)&&o<s?m.Opacity:m.Move}),[n,t,o,s,e])}(A);return(0,r.d4)((()=>{const e=e=>{if(n&&x){if(o.fl&&(o.jm&&e.metaKey||!o.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>x.length-1)return;k({id:x[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),I({targetIndexDelta:t,orderedIds:x})}}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}})),r.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:F,onLoadMore:U,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=F&&F.length&&R?function(){const e=x.indexOf(F[0]),n=e+R.pinnedChats.length;return r.ZP.createElement("div",{className:"scroll-container",style:o.wZ?`height: ${x.length*s.rS}px`:void 0,teactFastList:!0},R.pinnedChats.map((({id:n},a)=>r.ZP.createElement($,{key:n,teactOrderKey:a,chatId:n,isPinned:!0,folderId:t,animationType:B(n),orderDiff:A[n],style:`top: ${(e+a)*s.rS}px;`}))),R.otherChats.map(((e,a)=>r.ZP.createElement($,{key:e.id,teactOrderKey:(0,l.OE)(e),chatId:e.id,folderId:t,animationType:B(e.id),orderDiff:A[e.id],style:`top: ${(n+a)*s.rS}px;`}))))}():F&&!F.length?r.ZP.createElement(D,{folderId:t,folderType:e,foldersDispatch:E,onScreenSelect:C}):r.ZP.createElement(f.Z,{key:"loading"}))})))},91:(e,t,n)=>{n.d(t,{F:()=>a});var r=n(2858);function a(e,t,n,a){const{senderId:s}=t;if(!s)return;const o=(0,r.YA)(s)?a[s]:n[s];let i=(0,r.OU)(e,o);const c=n[t.chatId];return c&&((0,r.YA)(s)&&o.isSelf?i=`${e("FromYou")} → ${(0,r.U)(e,c)}`:(0,r.Bf)(c)&&(i+=` → ${(0,r.U)(e,c)}`)),i}},2420:(e,t,n)=>{n.d(t,{t:()=>d,Z:()=>u});var r=n(4050),a=n(1212),s=n(6752),o=n(3989),i=n(7204),c=n(706);const l=(0,r.X$)((({isQuick:e,onFileSelect:t})=>{const[n,a,o]=(0,c.Z)(),i=(0,s.Z)("DropTarget",n&&"hovered");return r.ZP.createElement("div",{className:i,onDrop:t,onDragEnter:()=>{a()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),o()}},r.ZP.createElement("div",{className:"target-content"},r.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),r.ZP.createElement("div",{className:"title"},"Drop files here to send them"),r.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));const u=(0,r.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:c})=>{const d=(0,r.sO)(null),u=(0,i.Z)(t),{shouldRender:m,transitionClassNames:h}=(0,a.Z)(e);(0,r.d4)((()=>e?(0,o.Z)(n):void 0),[e,n]);const f=(0,r.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),c(Array.from(t.files),!1))}),[c,n]),v=(0,r.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),c(Array.from(t.files),!0))}),[c,n]),p=(0,r.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:r}=e;t.matches(".DropTarget, .DropArea")&&!r&&(d.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!m)return;const g=(0,s.Z)("DropArea",h);return r.ZP.createElement("div",{className:g,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},r.ZP.createElement(l,{onFileSelect:f}),(t||u)&&r.ZP.createElement(l,{onFileSelect:v,isQuick:!0}))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9203),s=n(8778);const o=(0,r.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(a.gl.Extra,"EmojiTooltip",!t);return n?r.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(4050),a=n(5116),s=n(3716),o=n(8085),i=n(9118),c=n(5723),l=n(6752),d=n(782),u=n(7361),m=n(517),h=n(2645),f=n(706),v=n(4784),p=n(6391),g=n(9107),Z=n(2340),E=n(3283);const P=u.wB?256:416,y=(0,r.X$)((0,a.c$)((e=>{const{chatId:t,threadId:n}=(0,o.Bt)(e)||{},{messageSendKeyCombo:r}=e.settings.byKey;return{currentChatId:t,messageSendKeyCombo:r,replyingToId:t&&n?(0,o.Yy)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}),((e,t)=>(0,d.ei)(t,["editLastMessage","replyToNextMessage"])))((({id:e,isAttachmentModalInput:t,editableInputId:n,html:a,placeholder:o,forcedPlaceholder:d,shouldSetFocus:y,shouldSuppressFocus:C,shouldSuppressTextFormatter:b,onUpdate:w,onSuppressedFocus:N,onSend:k,currentChatId:I,replyingToId:T,noTabCapture:S,messageSendKeyCombo:M,editLastMessage:x,replyToNextMessage:L})=>{const A=(0,r.sO)(null),$=(0,r.sO)(null),O=(0,g.Z)(),F=(0,r.sO)(!1),[U,D,R]=(0,f.Z)(),[B,V]=(0,r.eJ)(),[X,K]=(0,r.eJ)();(0,r.d4)((()=>{t&&Y(!1)}),[t]),(0,h.Z)((([e])=>{a!==A.current.innerHTML&&(A.current.innerHTML=a),a!==$.current.innerHTML&&($.current.innerHTML=a),void 0!==e&&e!==a&&Y(!a.length)}),[a]);const q=(0,r.I4)((()=>{A.current.closest(".from, .to")?setTimeout(q,350):(0,c.Z)(A.current)}),[]),z=(0,r.I4)((()=>{R(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[R]);function j(){if(u.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||F.current)return R(),!1;const t=e.getRangeAt(0),r=t.toString().trim();return!(b||!(0,p.R)(t,n||s.R2)||!r||(0,v.Z)(r)||!t.START_TO_END)||(R(),!1)}function H(){if(!j())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=A.current.getBoundingClientRect();let r=t.left+t.width/2-n.left;r<90?r=90:r>n.width-90&&(r=n.width-90),V({x:r,y:t.top-n.top}),K(e),D()}function Y(e=!1){const t=A.current,n=$.current,r=Number(t.style.height.replace("px","")),a=Math.min(n.scrollHeight,P);if(a===r)return;const s=Math.round(50*Math.log(Math.abs(a-r))),o=()=>{t.style.height=`${a}px`,t.style.transitionDuration=`${s}ms`,t.classList.toggle("overflown",n.scrollHeight>P)};e?requestAnimationFrame(o):o()}(0,r.d4)((()=>{u.$b||y&&q()}),[I,q,T,y]),(0,r.d4)((()=>{if(S)return;const e=(0,i.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(q))}),2e3,!0,!1);return(0,m.Z)({onTab:e})}),[q,S]),(0,r.d4)((()=>{const e=A.current;function t(){e.blur()}return C&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[C]);const J=(0,l.Z)("form-control custom-scroll",a.length>0&&"touched",C&&"focus-disabled");return r.ZP.createElement("div",{id:e,onClick:C?N:void 0,dir:O.isRtl?"rtl":void 0},r.ZP.createElement("div",{ref:A,id:n||s.R2,className:J,contentEditable:!0,dir:"auto",onClick:q,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(w("<br>"===t?"":t),!(u.$b||n&&n.length)){const e=window.getSelection();e&&(A.current.blur(),e.removeAllRanges(),(0,c.Z)(A.current,!0))}},onKeyDown:function(e){if(e.metaKey&&!a.length){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void L({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||a.length||e.metaKey||e.altKey?e.target.addEventListener("keyup",(function t(){H(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),x()):u.cj||u.wZ||!("enter"===M&&!e.shiftKey||"ctrl-enter"===M&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),R(),k())},onMouseDown:function(e){2===e.button?!0!==F.current&&(F.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{F.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{F.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){H(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:u.wZ?function(e){j()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:u.wZ?H:void 0}),r.ZP.createElement("div",{ref:$,className:(0,l.Z)(J,"clone"),dir:"auto"}),!d&&r.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},o),r.ZP.createElement(E.Z,{isOpen:U,anchorPosition:B,selectedRange:X,onClose:z}),d&&r.ZP.createElement("span",{className:"forced-placeholder"},(0,Z.Z)(d)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(3716),s=n(6752),o=n(3989),i=n(1212),c=n(8758),l=n(706),d=n(9107),u=n(231);const m={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},h=document.createElement("div"),f=(0,r.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,onClose:f})=>{const v=(0,r.sO)(null),p=(0,r.sO)(null),{shouldRender:g,transitionClassNames:Z}=(0,i.Z)(e),[E,P,y]=(0,l.Z)(),[C,b]=(0,r.eJ)(""),[w,N]=(0,r.eJ)(!1),[k,I]=(0,r.eJ)(),[T,S]=(0,r.eJ)({});(0,r.d4)((()=>e?(0,o.Z)(f):void 0),[e,f]),(0,c.Z)(e,v,f),(0,r.d4)((()=>{E?p.current.focus():(b(""),N(!1))}),[E]),(0,r.d4)((()=>{g||(y(),S({}),I(void 0))}),[y,g]),(0,r.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:r}=n.commonAncestorContainer;for(;r&&r.id!==a.R2;){const e=m[r.tagName];e&&(t[e]=!0),r=r.parentElement}S(t)}),[e,n,P]);const M=(0,r.I4)((()=>{if(n)return h.innerText=n.toString(),h.innerHTML}),[n]),x=(0,r.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function L(){const e=p.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:r}=e;if(n<=t)return void I(void 0);let a="";r<n-t&&(a="mask-right"),r>0&&(a+=" mask-left"),I(a)}function A(e){if(T[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(T).some((t=>t!==e&&!!T[t])))return"disabled"}else if(T.monospace||T.strikethrough)return"disabled"}const $=(0,r.I4)((()=>{S((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})))}),[]),O=(0,r.I4)((()=>{document.execCommand("italic"),S((e=>({...e,italic:!e.italic})))}),[]),F=(0,r.I4)((()=>{document.execCommand("underline"),S((e=>({...e,underline:!e.underline})))}),[]),U=(0,r.I4)((()=>{if(T.strikethrough){const e=x();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void S((e=>({...e,strikethrough:!1})))}const e=M();document.execCommand("insertHTML",!1,`<del>${e}</del>`),f()}),[x,M,f,n,T.strikethrough]),D=(0,r.I4)((()=>{if(T.monospace){const e=x();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void S((e=>({...e,monospace:!1})))}const e=M();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),f()}),[x,M,f,n,T.monospace]);function R(){const e=encodeURI(C.includes("://")?C:`http://${C}`);if(w){const t=x();if(!t||"A"!==t.tagName)return;return t.href=e,void f()}const t=M();!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>`),f()}const B=(0,r.I4)((e=>{const t={KeyK:P,KeyB:$,KeyU:F,KeyI:O,KeyM:D,KeyS:U}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[$,O,F,D,U,P]);(0,r.d4)((()=>(e&&document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B))),[e,B]);const V=(0,d.Z)();if(!g)return;const X=(0,s.Z)("TextFormatter",Z,E&&"link-control-shown"),K=(0,s.Z)("TextFormatter-link-url-confirm",!!C.length&&"shown"),q=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return r.ZP.createElement("div",{ref:v,className:X,style:q,onKeyDown:function(e){"Enter"===e.key&&E&&(R(),e.preventDefault())}},r.ZP.createElement("div",{className:"TextFormatter-buttons"},r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Bold text",className:A("bold"),onClick:$},r.ZP.createElement("i",{className:"icon-bold"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Italic text",className:A("italic"),onClick:O},r.ZP.createElement("i",{className:"icon-italic"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Underlined text",className:A("underline"),onClick:F},r.ZP.createElement("i",{className:"icon-underlined"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:A("strikethrough"),onClick:U},r.ZP.createElement("i",{className:"icon-strikethrough"})),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:"Monospace text",className:A("monospace"),onClick:D},r.ZP.createElement("i",{className:"icon-monospace"})),r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("TextFormat.AddLinkTitle"),onClick:P},r.ZP.createElement("i",{className:"icon-link"}))),r.ZP.createElement("div",{className:"TextFormatter-link-control"},r.ZP.createElement("div",{className:"TextFormatter-buttons"},r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("Cancel"),onClick:y},r.ZP.createElement("i",{className:"icon-arrow-left"})),r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",k)},r.ZP.createElement("input",{ref:p,className:"TextFormatter-link-url-input",type:"text",value:C,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){b(e.target.value),L()},onScroll:L})),r.ZP.createElement("div",{className:K},r.ZP.createElement("div",{className:"TextFormatter-divider"}),r.ZP.createElement(u.Z,{color:"translucent",ariaLabel:V("Save"),className:"color-primary",onClick:R},r.ZP.createElement("i",{className:"icon-check"}))))))}))},6980:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(6137),a=n(7361);const s={B:r.Vv.Bold,STRONG:r.Vv.Bold,I:r.Vv.Italic,EM:r.Vv.Italic,U:r.Vv.Underline,S:r.Vv.Strike,STRIKE:r.Vv.Strike,DEL:r.Vv.Strike,CODE:r.Vv.Code,PRE:r.Vv.Pre,BLOCKQUOTE:r.Vv.Blockquote};function o(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return a.op||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/<\/?span([^>]*)?>/g,""),t=t.replace(/ /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(/[*]{2}([^*\n]+)[*]{2}/g,"<b>$1</b>"),t=t.replace(/[_]{2}([^*\n]+)[_]{2}/g,"<i>$1</i>"),t=t.replace(/[~]{2}([^~\n]+)[~]{2}/g,"<s>$1</s>"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let o=0,i=0;const c=[];function l(e){const{index:t,entity:a}=function(e,t,n){const a=function(e){if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===r.Vv.MentionName?r.Vv.MentionName:t.dataset.entityType===r.Vv.Url?r.Vv.Url:t.href.startsWith("mailto:")?r.Vv.Email:t.href.startsWith("tel:")?r.Vv.Phone:t.href!==t.textContent?r.Vv.TextUrl:r.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const o=t.indexOf(e.textContent,n),i=o>=0?o:n,c=t.substring(0,i).length,{length:l}=t.substring(i,i+e.textContent.length);let d,u;return a===r.Vv.TextUrl&&(d=e.href),a===r.Vv.MentionName&&(u=Number(e.dataset.userId)),{index:i,entity:{type:a,offset:c,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,o);a?(o=t,c.push(a)):e.textContent&&(o+=e.textContent.length),e.hasChildNodes()&&i<=3&&(i+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach((e=>{i=1,l(e)})),{text:n,entities:c.length?c:void 0}}},2400:(e,t,n)=>{n.d(t,{_:()=>i});const r=/(<br>|<br\s?\/>)/g,a=/( |\u00A0)/g,s=/(<div>|<\/div>)/gi,o=/\n$/i;function i(e){return e.replace(a," ").replace(r,"\n").replace(s,"").replace(o,"")}},6391:(e,t,n)=>{function r(e,t){const{commonAncestorContainer:n}=e;let r=n,a=1;for(;r&&r.id!==t&&a<5;)r=r.parentElement,a++;return Boolean(r&&r.id===t)}n.d(t,{R:()=>r})},8353:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(3716),s=n(735),o=n(2400),i=n(4284),c=n(5723),l=n(782),d=n(706);let u,m,h,f;try{f=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){f=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function v(e,t,v,p=a.R2,g,Z,E,P=!1){const[y,C,b]=(0,d.Z)(),[w,N]=(0,r.eJ)(),[k,I]=(0,r.eJ)(),[T,S]=(0,r.eJ)({}),[M,x]=(0,r.eJ)(),[L,A]=(0,r.eJ)({}),[$,O]=(0,r.eJ)(!1),[F,U]=(0,r.eJ)(s.D),D=(0,r.Ye)((()=>w&&v.length?Object.values((0,l.q0)(w,v)):[]),[w,v]);(0,r.d4)((()=>{if(P)return;const e=()=>{N(h.emojis)};h?e():async function(){return u||(u=n.e(501).then(n.t.bind(n,7501,19)),m=(await u).default,h=(0,i.NM)(m)),u}().then(e)}),[P]),(0,r.d4)((()=>{if(!w||P)return;const e=Object.values(w),t=(0,l.ee)(e,"native"),n=Z?(0,l.Q8)(Z,(e=>Object.values((0,l.q0)(t,e)))):{},r=E?(0,l.Q8)(E,(e=>Object.values((0,l.q0)(t,e)))):{};S({...n,...r}),I([...Object.keys(n),...Object.keys(r)]);const a=e.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});A(a),x(Object.keys(a))}),[P,Z,w,E]),(0,r.d4)((()=>{if(!(e&&t&&w&&k&&k.length))return void b();const n=t.includes(":")&&function(e){const t=(0,o._)(e).match(f);return t?t[0].trim():void 0}(t);if(!n)return U(s.D),void b();const r=n.length>2&&n.endsWith(":"),a=n.substr(1,r?n.length-2:void 0);let i=[];if(O(r),a){if(a.length>=2){const e=k.filter((e=>e.startsWith(a))).sort();i=i.concat((0,l.xH)(Object.values((0,l.q0)(T,e))));const t=M.filter((e=>e.startsWith(a)));i=i.concat((0,l.xH)(Object.values((0,l.q0)(L,t)))),i=(0,l.Tw)(i)}}else i=D;i.length?(r||C(),U(i.slice(0,36))):b()}),[w,T,k,L,M,t,e,C,D,b,O]);const R=(0,r.I4)(((e,n)=>{const r=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==r){g(`${t.substr(0,r)}${e}`);const n=document.getElementById(p);requestAnimationFrame((()=>{(0,c.Z)(n,!0)}))}b()}),[t,p,g,b]);return(0,r.d4)((()=>{y&&$&&F.length&&R(F[0].native,!0)}),[F,R,y,$]),{isEmojiTooltipOpen:y,closeEmojiTooltip:b,filteredEmojis:F,insertEmoji:R}}},2365:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(4050),a=n(6137),s=n(3716),o=n(2858),i=n(5765);function c(e,t){const n=t.username.toLowerCase(),r=(0,o.Js)(t),a=r&&r.toLowerCase(),s=e.toLowerCase();return n.startsWith(s)||a&&(0,i.Z)(a,s)}var l=n(2400),d=n(5723),u=n(706),m=n(782);const h=(0,n(9118).P2)((e=>e()),500,!0);let f;try{f=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){f=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function v(e,t,n,i=s.R2,v,p,g,Z){const[E,P,y]=(0,u.Z)(),[C,b]=(0,r.eJ)(),w=(0,r.Ye)((()=>(p||[]).map((e=>null==Z?void 0:Z[e])).filter(Boolean)),[p,Z]),N=(0,r.I4)(((e,t)=>{(v||p)&&Z?h((()=>{const n=(t?w:[]).filter((t=>!e||c(e,t))),r=(v||[]).map((({userId:e})=>Z[e])).filter((t=>!(!t||t.id===g)&&(!e||c(e,t))));b((0,m.Tw)(n.concat(r)))})):b(void 0)}),[g,v,p,w,Z]);(0,r.d4)((()=>{if(!e||!t.length)return void y();const n=t.includes("@")&&function(e){const t=(0,l._)(e).match(f);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";N(e,function(e){return e.startsWith("@")}(t))}else y()}),[e,t,N,P,y]),(0,r.d4)((()=>{null!=C&&C.length?P():y()}),[P,y,C]);const k=(0,r.I4)(((e,r=!1)=>{if(!e.username&&!(0,o.Vl)(e))return;const s=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${a.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,o.Vl)(e)}</a>`,c=t.lastIndexOf("@");if(-1!==c){n(`${t.substr(0,c)}${s} `);const e=document.getElementById(i);requestAnimationFrame((()=>{(0,d.Z)(e,r)}))}y()}),[t,i,n,y]);return{isMentionTooltipOpen:E,closeMentionTooltip:y,insertMention:k,mentionFilteredUsers:C}}},7891:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(9290),s=n(5326);function o(e,t){const n=void 0===t,o=(0,r.sO)(n),i=(0,r.sO)(),c=(0,s.Z)();return(0,a.Z)((()=>{n||(o.current=!1,i.current&&(clearTimeout(i.current),i.current=void 0))}),e),(0,r.d4)((()=>{if(n||o.current)return;const e=()=>{o.current=!0,c()};t>0?i.current=window.setTimeout(e,t):e()}),e),o.current}},7551:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(9107),s=n(3103),o=n(231);const i=(0,r.X$)((({isOpen:e,onClose:t,onCloseAnimationEnd:n,title:i,header:c,text:l,textParts:d,confirmLabel:u="Confirm",confirmHandler:m,confirmIsDestructive:h,isButtonsInOneRow:f})=>{const v=(0,a.Z)();return r.ZP.createElement(s.Z,{className:"confirm",title:i,header:c,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:m},l&&l.split("\\n").map((e=>r.ZP.createElement("p",null,e))),d,r.ZP.createElement("div",{className:f?"dialog-buttons mt-2":""},r.ZP.createElement(o.Z,{className:"confirm-dialog-button",isText:!0,onClick:m,color:h?"danger":"primary"},u),r.ZP.createElement(o.Z,{className:"confirm-dialog-button",isText:!0,onClick:t},v("Cancel"))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(6752),s=n(231);const o=({isShown:e,className:t,color:n="primary",ariaLabel:o,disabled:i,onClick:c,children:l})=>{const d=(0,a.Z)("FloatingActionButton",e&&"revealed",t);return r.ZP.createElement(s.Z,{className:d,color:n,round:!0,disabled:i,onClick:e&&!i?c:void 0,ariaLabel:o,tabIndex:-1},l)}},1273:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(1713),a=n(4050),s=n(9118),o=n(7675);const i=({ref:e,className:t,onLoadMore:n,onScroll:i,onKeyDown:c,items:l,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:h=!1,noScrollRestoreOnTop:f=!1,noFastList:v,cacheBuster:p,children:g})=>{let Z=(0,a.sO)(null);e&&(Z=e);const E=(0,a.sO)({}),[P,y]=(0,a.Ye)((()=>n?[(0,s.Ds)(((e=!1)=>{n({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,s.Ds)((()=>{n({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[n,l]);(0,a.d4)((()=>{if(!P)return;if(u>0&&(!l||l.length<u))return void P(!0);const{scrollHeight:e,clientHeight:t}=Z.current;t&&e<=t&&P()}),[l,P,u]),(0,a.bt)((()=>{const e=Z.current,t=E.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:r}=e;n=r+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}h||f&&0===e.scrollTop||((0,o.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[l,d,h,f,p]);const C=(0,a.I4)((e=>{if(y&&P){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=E.current,r=E.current.listItemElements;if(e)return void(E.current.isScrollTopJustUpdated=!1);const a=r.length,s=Z.current,{scrollTop:i,scrollHeight:c,offsetHeight:l}=s,d=i<=(a?r[0].offsetTop:0)+m,u=(a?r[a-1].offsetTop+r[a-1].offsetHeight:c)-(i+l)<=m;let h=!1;if(d){const e=r[0];if(e){const r=e.getBoundingClientRect().top,a=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&a>n&&(E.current.currentAnchor=e,E.current.currentAnchorTop=r,h=!0,(0,o.Z)(s),y())}}if(u){const e=r[a-1];if(e){const r=e.getBoundingClientRect().top,a=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&a<n&&(E.current.currentAnchor=e,E.current.currentAnchorTop=r,h=!0,(0,o.Z)(s),P())}}if(!h)if(null!=t&&t.offsetParent)E.current.currentAnchorTop=t.getBoundingClientRect().top;else{const e=r[0];e&&(E.current.currentAnchor=e,E.current.currentAnchorTop=e.getBoundingClientRect().top)}}i&&i(e)}),[P,y,i,m]);return a.ZP.createElement("div",{ref:Z,className:t,onScroll:C,teactFastList:!v,onKeyDown:c},g)}},1876:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),a=n(7361),s=n(9118),o=n(6752),i=n(7240),c=n(3394),l=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964);const f=e=>{const{ref:t,buttonRef:n,icon:f,className:v,style:p,children:g,disabled:Z,ripple:E,narrow:P,inactive:y,focus:C,destructive:b,multiline:w,isStatic:N,contextActions:k,onMouseDown:I,onClick:T}=e;let S=(0,r.sO)(null);t&&(S=t);const[M,x,L]=(0,l.Z)(),{isContextMenuOpen:A,contextMenuPosition:$,handleBeforeContextMenu:O,handleContextMenu:F,handleContextMenuClose:U,handleContextMenuHide:D}=(0,i.Z)(S,!k),R=(0,r.I4)((()=>S.current),[]),B=(0,r.I4)((()=>S.current.closest(".custom-scroll")),[]),V=(0,r.I4)((()=>S.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:X,positionY:K,style:q}=(0,c.Z)($,R,B,V),z=(0,r.I4)((e=>{!Z&&T&&(T(e),a.$b&&!E&&(x(),(0,s.T2)(L)))}),[Z,x,T,E,L]),j=(0,r.I4)((e=>{y||a.$b||(!k||2!==e.button&&T||O(e),0===e.button&&(T?z(e):F(e)))}),[y,k,T,O,F,z]),H=(0,d.Z)(),Y=(0,o.Z)("ListItem",v,!N&&"no-selection",E&&"has-ripple",P&&"narrow",Z&&"disabled",y&&"inactive",$&&"has-menu-open",C&&"focus",b&&"destructive",w&&"multiline",N&&"is-static");return r.ZP.createElement("div",{ref:S,className:Y,dir:H.isRtl?"rtl":void 0,style:p,onMouseDown:I},r.ZP.createElement("div",{className:(0,o.Z)("ListItem-button",M&&"active"),role:"button",ref:n,tabIndex:0,onClick:!y&&a.$b?z:void 0,onMouseDown:j,onContextMenu:!y&&k?F:void 0},f&&r.ZP.createElement("i",{className:`icon-${f}`}),w&&r.ZP.createElement("div",{className:"multiline-item"},g),!w&&g,!Z&&!y&&E&&r.ZP.createElement(u.Z,null)),k&&void 0!==$&&r.ZP.createElement(m.Z,{isOpen:A,positionX:X,positionY:K,style:q,className:"ListItem-context-menu",autoClose:!0,onClose:U,onCloseAnimationEnd:D},k.map((e=>r.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},3103:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(4050),a=n(517),s=n(6752),o=n(8674),i=n(1212),c=n(274),l=n(9107),d=n(6590),u=n(231),m=n(2898);const h=({title:e,className:t,isOpen:n,header:h,hasCloseButton:f,noBackdrop:v,children:p,onClose:g,onCloseAnimationEnd:Z,onEnter:E,shouldSkipHistoryAnimations:P})=>{const{shouldRender:y,transitionClassNames:C}=(0,i.Z)(n,Z,P,void 0,P),b=(0,r.sO)(null);(0,r.d4)((()=>n?(0,a.Z)({onEsc:g,onEnter:E}):void 0),[n,g,E]),(0,r.d4)((()=>n&&b.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const r=n.findIndex((e=>e.isSameNode(document.activeElement)));let a=0;r>=0&&(a=t.shiftKey?r>0?r-1:n.length-1:r<n.length-1?r+1:0),n[a].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}(b.current):void 0),[n]);const{forceClose:w}=(0,d.ZP)(n,g);(0,r.d4)((()=>()=>{n&&w()}),[]),(0,c.Z)((([e])=>(document.body.classList.toggle("has-open-dialog",n),(n||!n&&void 0!==e)&&(0,o.YW)(200),()=>{document.body.classList.remove("has-open-dialog")})),[n]);const N=(0,l.Z)();if(!y)return;const k=(0,s.Z)("Modal",t,C,v&&"transparent-backdrop");return r.ZP.createElement(m.Z,null,r.ZP.createElement("div",{ref:b,className:k,tabIndex:-1,role:"dialog"},r.ZP.createElement("div",{className:"modal-container"},r.ZP.createElement("div",{className:"modal-backdrop",onClick:g}),r.ZP.createElement("div",{className:"modal-dialog"},h||(e?r.ZP.createElement("div",{className:"modal-header"},f&&r.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:N("Close"),onClick:g},r.ZP.createElement("i",{className:"icon-close"})),r.ZP.createElement("div",{className:"modal-title"},e)):void 0),r.ZP.createElement("div",{className:"modal-content custom-scroll"},p)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(3716),s=n(1212),o=n(6752),i=n(3989),c=n(2898);const l=({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=(0,r.eJ)(!0),m=(0,r.sO)(null),{transitionClassNames:h}=(0,s.Z)(d),f=(0,r.I4)((()=>{u(!1),setTimeout(l,150+a.fK)}),[l]);(0,r.d4)((()=>d?(0,i.Z)(f):void 0),[d,f]),(0,r.d4)((()=>(m.current=window.setTimeout(f,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)})),[t,f]);const v=(0,r.I4)((()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[]),p=(0,r.I4)((()=>{m.current=window.setTimeout(f,t)}),[t,f]);return r.ZP.createElement(c.Z,{className:"Notification-container",containerId:n},r.ZP.createElement("div",{className:(0,o.Z)("Notification",h),onClick:f,onMouseEnter:v,onMouseLeave:p},r.ZP.createElement("div",{className:"content"},e)))}},2898:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(2916);const s=({containerId:e,className:t,children:n})=>{const s=(0,r.sO)();return s.current||(s.current=document.createElement("div")),(0,r.bt)((()=>{const n=document.querySelector(e||"#portals");if(!n)return;const r=s.current;return t&&r.classList.add(t),n.appendChild(r),()=>{a.Z.render(void 0,r),n.removeChild(r)}}),[t,e]),a.Z.render(n,s.current)}},9196:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(6752);const s={s:22,m:25,l:28,xl:20},o=(0,r.X$)((({progress:e=0,size:t="l",square:n,transparent:o,noCross:i,onClick:c})=>{const l=s[t],d=l-4,u=l-1,m=2*d*Math.PI,h=(0,r.sO)(null);(0,r.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,a.Z)(`ProgressSpinner size-${t}`,o&&"transparent",n&&"square",i&&"no-cross");return r.ZP.createElement("div",{ref:h,className:f,onClick:c})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(6752),s=n(9107),o=n(9204);const i=(0,r.X$)((({id:e,label:t,subLabel:n,value:i,name:c,checked:l,disabled:d,hidden:u,isLoading:m,onChange:h})=>{const f=(0,s.Z)(),v=(0,a.Z)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return r.ZP.createElement("label",{className:v,dir:f.isRtl?"rtl":void 0},r.ZP.createElement("input",{type:"radio",name:c,value:i,id:e,checked:l,onChange:h,disabled:d||u}),r.ZP.createElement("div",{className:"Radio-main"},r.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},t),n&&r.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},n)),m&&r.ZP.createElement(o.Z,null))})),c=(0,r.X$)((({id:e,name:t,options:n,selected:a,disabled:s,loadingOption:o,onChange:c})=>{const l=(0,r.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return r.ZP.createElement("div",{id:e,className:"radio-group"},n.map((e=>r.ZP.createElement(i,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===a,hidden:e.hidden,disabled:s,isLoading:o?o===e.value:void 0,onChange:l}))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(6752),s=n(706),o=n(9107),i=n(4288),c=n(231);const l=(0,r.X$)((({ref:e,children:t,parentContainerClassName:n,value:l,inputId:d,className:u,focused:m,isLoading:h,placeholder:f,disabled:v,autoComplete:p,canClose:g,onChange:Z,onReset:E,onFocus:P,onBlur:y})=>{let C=(0,r.sO)(null);e&&(C=e);const[b,w,N]=(0,s.Z)(m);(0,r.d4)((()=>{C.current&&(m?C.current.focus():C.current.blur())}),[m,f]);const k=(0,o.Z)(),I=(0,r.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}}),[n]);return r.ZP.createElement("div",{className:(0,a.Z)("SearchInput",u,b&&"has-focus"),dir:k.isRtl?"rtl":void 0},t,r.ZP.createElement("input",{ref:C,id:d,type:"text",dir:"auto",placeholder:f||k("Search"),className:"form-control",value:l,disabled:v,autoComplete:p,onChange:function(e){const{currentTarget:t}=e;Z(t.value)},onFocus:function(){w(),P&&P()},onBlur:function(){N(),y&&y()},onKeyDown:I}),r.ZP.createElement("i",{className:"icon-search"}),h&&r.ZP.createElement(i.Z,null),!h&&(l||g)&&E&&r.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:E},r.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(1212),s=n(7204),o=n(6752);const i=({isOpen:e,isCustom:t,id:n,className:i,onClick:c,children:l})=>{const{shouldRender:d,transitionClassNames:u}=(0,a.Z)(e,void 0,void 0,!t&&void 0),m=(0,s.Z)(e),h=(0,s.Z)(l),f=(0,r.sO)();return m&&!e&&(f.current=h),d&&r.ZP.createElement("div",{id:n,className:(0,o.Z)(i,u),onClick:c},e?l():f.current())}},3321:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(6752);const s=(0,r.X$)((({id:e,name:t,value:n,label:s,checked:o=!1,disabled:i,inactive:c,noAnimation:l,onChange:d,onCheck:u})=>{const m=(0,r.I4)((e=>{d&&d(e),u&&u(e.currentTarget.checked)}),[d,u]),h=(0,a.Z)("Switcher",i&&"disabled",c&&"inactive",l&&"no-animation");return r.ZP.createElement("label",{className:h,title:s},r.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:o,disabled:i,onChange:m}),r.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(1367),s=n(7204),o=n(8781),i=n(9107),c=n(6752),l=n(2340);const d=(0,r.X$)((({className:e,title:t,active:n,badgeCount:a,isBadgeActive:s,previousActiveTab:o,onClick:i,clickArg:d})=>{const u=(0,r.sO)(null);return(0,r.bt)((()=>{if(!n||void 0===o)return;const e=u.current,t=e.querySelector("i"),r=e.parentElement.children[o];if(!r)return;const a=r.querySelector("i");a.classList.remove("animate"),t.classList.remove("animate");const s=a.parentElement.offsetLeft-t.parentElement.offsetLeft,i=a.clientWidth/t.clientWidth;t.style.transform=`translate3d(${s}px, 0, 0) scale3d(${i}, 1, 1)`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.classList.add("animate"),t.style.transform="none"}))}))}))}),[n,o]),r.ZP.createElement("button",{type:"button",className:(0,c.Z)("Tab",e,n&&"active"),onClick:()=>i(d),ref:u},r.ZP.createElement("span",null,(0,l.Z)(t),!!a&&r.ZP.createElement("span",{className:(0,c.Z)("badge",s&&"active")},a),r.ZP.createElement("i",null)))})),u=(0,r.X$)((({tabs:e,activeTab:t,big:n,onSwitchTab:c})=>{const l=(0,r.sO)(null),u=(0,s.Z)(t);(0,o.Z)(l.current),(0,r.d4)((()=>{const e=l.current;if(e.scrollWidth<=e.offsetWidth)return;const t=e.querySelector(".Tab.active");if(t){const n=t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2;if(Math.abs(n-e.scrollLeft)<16)return;(0,a.Z)(e,n)}}),[t]);const m=(0,i.Z)();return r.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:m.isRtl?"rtl":void 0},e.map(((e,n)=>r.ZP.createElement(d,{key:e.title,title:m(e.title),active:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:c,clickArg:n}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),a=n(5116),s=n(5326),o=n(7204),i=n(6752),c=n(8674),l=n(1279);const d=Symbol("CLEANED_UP"),u=({ref:e,activeKey:t,name:n,direction:u="auto",renderCount:m,shouldRestoreHeight:h,shouldCleanup:f,cleanupExceptionKey:v,id:p,className:g,onStart:Z,onStop:E,children:P})=>{const{animationLevel:y}=(0,a.Rd)().settings.byKey,C=(0,r.sO)();let b=(0,r.sO)(null);e&&(b=e);const w=(0,r.sO)({}),N=(0,o.Z)(t),k=(0,s.Z)(),I=void 0!==N&&t!==N;!m&&I&&(w.current={[N]:w.current[N]}),w.current[t]=P,(0,r.bt)((()=>{function e(){!f||void 0!==v&&v===N||(w.current={[N]:d},k())}const r=b.current,a=r.children;if(1===a.length&&!I)return void a[0].classList.add("active");const s=Array.from(r.childNodes);if(!I||!s.length)return;const o=-1===u||"auto"===u&&N>t||"inverse"===u&&N<t;r.classList.remove("animating"),r.classList.toggle("backwards",o);const i=Object.keys(w.current).map(Number),p=m?N:i.indexOf(N),g=m?t:i.indexOf(t);if("none"===n||0===y)return s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===g))})),void e();let P;s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("active"),e.classList.toggle("from",t===p),e.classList.toggle("through",t>p&&t<g||t<p&&t>g),e.classList.toggle("to",t===g))})),y>0&&(P=(0,c.YW)()),requestAnimationFrame((()=>{var a;function i(){requestAnimationFrame((()=>{if(t===C.current){if(r.classList.remove("animating","backwards"),s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===g))})),h){const e=r.querySelector(".active");e&&(e.style.height="auto",r.style.height=`${e.clientHeight}px`)}P&&P(),e(),E&&E()}}))}r.classList.add("animating"),Z&&Z();const c="mv-slide"===n?null===(a=s[g])||void 0===a?void 0:a.firstChild:"reveal"===n&&o?s[p]:s[g];C.current=t,y>0&&c?(0,l.f)(c,i):i()}))}),[t,N,I,u,n,Z,E,m,h,f,v,y,k]),(0,r.bt)((()=>{if(h){const e=b.current,t=e.querySelector(".active")||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[h,P]);const T=w.current,S=Object.keys(m?new Array(m).fill(void 0):T).map(Number).map((e=>{const n=T[e];return"function"==typeof n?r.ZP.createElement("div",{key:e},n(e===t,e===N,t)):void 0})),M=(0,i.Z)("Transition",g,n);return r.ZP.createElement("div",{ref:b,id:p,className:M},S)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>o,vb:()=>l,ZP:()=>h});var r=n(1090),a=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"}],o=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],i=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let r=[],s=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,a.ei)(e.folder,i);r=t||[],s=Object.keys(o).filter((e=>Boolean(o[e])))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,a.ei)(e.folder,c);r=t||[],s=Object.keys(o).filter((e=>Boolean(o[e])))}return{selectedChatIds:r,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,a.ei)(e.folder,i)};case"editExcludeFilters":return{...e,excludeFilters:(0,a.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,a.CE)(e.folder,i),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,a.CE)(e.folder,c),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...r}=t.payload;return{mode:"edit",folderId:e,folder:r,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,r.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(4050),a=n(5116),s=n(396),o=n(274),i=n(5266),c=n(9290),l=n(4532);const d=(e,t,n,d,u,m,h,f,v=!1,p,g,Z=!1,E=!1)=>{const P=(0,r.sO)(null),[y,C]=(0,r.eJ)(!1);let b=y;const[w,N]=(0,r.eJ)(0),k=(0,r.I4)((()=>{C(!1),g&&g()}),[g]);(0,c.Z)((()=>{P.current=(0,s.z2)(e,n,d,((e,n)=>{var r;switch(e){case"onPlay":C(!0),(0,l.N)(h,function(e){let t={};if(e&&e.current){const{play:n,pause:r,setCurrentTime:s,proxy:o,requestNextTrack:i,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(o.src)},pause:()=>{r()},stop:()=>{r(),s(0),(0,a.uC)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(o.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(o.currentTime+t,o.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},d()||(t.nexttrack=()=>{i()}),l()||(t.previoustrack=()=>{c()})}return t}(P)),(0,l.pC)("playing");break;case"onPause":C(!1),(0,l.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=P.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;E||N(e.currentTime/n),(0,l.NS)({duration:e.duration,playbackRate:e.playbackRate,position:e.currentTime});break}case"onEnded":(0,l.pC)("paused")}null==m||null===(r=m[e])||void 0===r||r.call(m,n)}),p,k);const{proxy:r}=P.current;y||r.paused||(C(!0),b=!0),f&&f(r)}),[e]),(0,r.d4)((()=>{y&&h&&(0,l.Ym)(h)}),[h,y]);const{play:I,pause:T,setCurrentTime:S,proxy:M,destroy:x,setVolume:L,setCurrentOrigin:A,stop:$}=P.current,O=M.duration&&Number.isFinite(M.duration)?M.duration:t;(0,r.d4)((()=>{!O||(0,i.z)(M)||E||N(M.currentTime/O)}),[O,w,M,E]),(0,r.d4)((()=>()=>{x(Z)}),[x,Z]),(0,o.Z)((([e,t])=>{e===v&&u===t||M.src&&M.paused||v&&u&&!y&&I(u)}),[v,u,y,I,M.src,M.paused]);const F=(0,r.I4)((()=>{u&&(A(d),I(u))}),[u,d,I,A]),U=(0,r.I4)((()=>{y?T():F()}),[T,F,y]),D=(0,r.I4)((e=>{S(e),O&&N(M.currentTime/O)}),[O,M,S]);return{isPlaying:b,playProgress:w,playPause:U,pause:T,play:F,stop:$,setCurrentTime:D,setVolume:L,audioProxy:M,duration:O}}},5332:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);function a(e,t){(0,r.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},2937:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(6264),s=n(9290),o=n(1394),i=n(5326);const c=new Map;function l(e){const t=(0,r.sO)();let n=!1;(0,s.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const r=new Image;if(r.src=e,!r.width)return;const s=(0,o.ao)(r);(0,a.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,r.sO)(e?c.get(e):void 0),l=(0,r.sO)(),d=(0,i.Z)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),(0,r.d4)((()=>{if(!e||s.current||t)return;const r=new Image;r.onload=()=>{const t=(0,o.ao)(r);(0,a.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((()=>{r.src=e}),n):r.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:()=>o});var r=n(4050),a=n(9118),s=n(5266);const o=(e=!1)=>{const[t,n]=(0,r.eJ)(!e),[o,i]=(0,r.eJ)(0),c=(0,r.Ye)((()=>(0,a.Ds)(n,200,!1,!0)),[]),l=(0,r.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&i(t.buffered.end(0)/t.duration),c(t.readyState>=3||t.currentTime>0))}),[c]);return{isBuffered:t,bufferedProgress:o,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:()=>i});var r=n(4050),a=n(6264),s=n(5326),o=n(7361);function i(e,t=!1,n){const i=(0,r.sO)(null),c=(0,s.Z)();return(0,r.d4)((()=>{const r=i.current;if(!e||!r||t)return;const s=new Image,c=()=>{r.width=s.width,r.height=s.height;const e=r.getContext("2d",{alpha:!1});o.vX&&(e.filter="blur(2px)"),e.drawImage(s,-4,-4,r.width+8,r.height+8),o.vX||(0,a.Z)(e,0,0,r.width,r.height,2,2)};s.onload=()=>{n?requestAnimationFrame(c):c()},s.src=e}),[i,e,c,t,n]),i}},1470:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(5116),s=n(2858),o=n(9107);const i=({chat:e,privateChatUser:t,handleDelete:n,folderId:i,isPinned:c,isMuted:l},d=!1)=>{const u=(0,o.Z)();return(0,r.Ye)((()=>{if(!e)return;const{toggleChatPinned:r,updateChatMutedState:o,toggleChatArchived:m,toggleChatUnread:h}=(0,a.uC)(),f=c?{title:u("UnpinFromTop"),icon:"unpin",handler:()=>r({id:e.id,folderId:i})}:{title:u("PinToTop"),icon:"pin",handler:()=>r({id:e.id,folderId:i})};if(d)return[f];const v=e.unreadCount||e.hasUnreadMark?{title:u("MarkAsRead"),icon:"readchats",handler:()=>h({id:e.id})}:{title:u("MarkAsUnread"),icon:"unread",handler:()=>h({id:e.id})},p=l?{title:u("ChatList.Unmute"),icon:"unmute",handler:()=>o({chatId:e.id,isMuted:!1})}:{title:u("ChatList.Mute"),icon:"mute",handler:()=>o({chatId:e.id,isMuted:!0})},g=(0,s.pE)(e)?{title:u("Unarchive"),icon:"unarchive",handler:()=>m({id:e.id})}:{title:u("Archive"),icon:"archive",handler:()=>m({id:e.id})},Z={title:(0,s.YA)(e.id)?u("Delete"):u((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n};return[v,f,...null!=t&&t.isSelf?[]:[p,g],Z]}),[e,c,u,d,l,n,null==t?void 0:t.isSelf,i])}},7240:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(7361);const s=(e,t,n,s)=>{const[o,i]=(0,r.eJ)(!1),[c,l]=(0,r.eJ)(void 0),d=(0,r.I4)((e=>{t||2!==e.button||document.body.classList.add("no-selection")}),[t]),u=(0,r.I4)((e=>{document.body.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(i(!0),l({x:e.clientX,y:e.clientY})))}),[t,n,c]),m=(0,r.I4)((()=>{i(!1)}),[]),h=(0,r.I4)((()=>{l(void 0),document.body.classList.remove("no-selection")}),[]);return(0,r.d4)((()=>{if(t||!a.$b||s)return;const r=e.current;if(!r)return;let o;const d=()=>{o&&(clearTimeout(o),o=void 0)},u=e=>{t||a.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(d(),o=window.setTimeout((()=>(e=>{d();const{clientX:t,clientY:a,target:s}=e.touches[0];c||n&&s.matches("a[href]")||(r.addEventListener("touchend",(function e(t){r.removeEventListener("touchend",e,!0),t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation()}),!0),document.body.classList.add("no-selection"),i(!0),l({x:t,y:a}))})(e)),200))};return r.addEventListener("touchstart",u,{passive:!0}),r.addEventListener("touchcancel",d,!0),r.addEventListener("touchend",d,!0),r.addEventListener("touchmove",d,{passive:!0}),()=>{d(),r.removeEventListener("touchstart",u),r.removeEventListener("touchcancel",d,!0),r.removeEventListener("touchend",d,!0),r.removeEventListener("touchmove",d)}}),[c,t,s,e,n]),{isContextMenuOpen:o,contextMenuPosition:c,handleBeforeContextMenu:d,handleContextMenu:u,handleContextMenuClose:m,handleContextMenuHide:h}}},3394:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=(e,t,n,a,s=0,o=0)=>{const[i,c]=(0,r.eJ)("right"),[l,d]=(0,r.eJ)("bottom"),[u,m]=(0,r.eJ)(!1),[h,f]=(0,r.eJ)(""),[v,p]=(0,r.eJ)("");return(0,r.d4)((()=>{const r=t();if(!e||!r)return;let{x:i,y:l}=e;const u={width:0,left:0,height:0,top:0},h=a(),v=n(),g=r.getBoundingClientRect(),Z=h?{width:h.offsetWidth,height:h.offsetHeight}:u,E=v?v.getBoundingClientRect():u;let P;i+Z.width+s<E.width+E.left?(i+=3,P="left"):i-Z.width>0?(P="right",i-=3):(P="left",i=16),c(P),l+Z.height<E.height+E.top?d("top"):(d("bottom"),l-Z.height<E.top+o&&(l=E.top+E.height));const y="left"===P?Math.min(i-g.left,E.width-Z.width-16):Math.max(i-g.left,Z.width+16),C=Math.min(E.height-g.top+g.height-12,l-g.top),b=E.height-12;m(b<Z.height),p(`max-height: ${b}px;`),f(`left: ${y}px; top: ${C}px`)}),[e,s,o,a,n,t]),{positionX:i,positionY:l,style:h,menuStyle:v,withScroll:u}}},8360:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7204);function a(e,t=!1,n=!1){const a=(0,r.Z)(e,t);return n||null!=e?e:a}},5790:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(5116),s=n(9118);const o=(e,t,n,o)=>{const{loadMessage:i}=(0,a.uC)(),c=(0,r.Ye)((()=>{const n=(0,s.P2)(i,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:o})}}),[i,e,t,o]);(0,r.d4)((()=>{t&&!n&&c()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);const a=(e,t)=>{(0,r.d4)((()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},7407:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),a=n(1713),s=n(782),o=n(5326),i=n(7204);const c=(e,t,n=!1,c=30,d=!1)=>{const u=(0,r.sO)(),m=(0,r.sO)((()=>{if(!t||u.current)return;const{newViewportIds:e}=l(t,t[0],a.Uq.Forwards,c);return e})()),h=(0,o.Z)(),f=(0,i.Z)(t),v=(0,i.Z)(n);if(t&&!n&&(t!==f||n!==v)){const{offsetId:e=t[0],direction:n=a.Uq.Forwards}=u.current||{},{newViewportIds:r}=l(t,e,n,c);m.current&&(0,s.et)(m.current,r)||(m.current=r)}(0,r.d4)((()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}}),[t,n,e,d]);const p=(0,r.I4)((({direction:n,noScroll:r})=>{const o=m.current,i=o?n===a.Uq.Backwards?o[o.length-1]:o[0]:void 0;if(!t)return void(e&&e({offsetId:i}));r||(u.current={...u.current,direction:n,offsetId:i});const{newViewportIds:d,areSomeLocal:f,areAllLocal:v}=l(t,i,n,c);!f||o&&(0,s.et)(o,d)||(m.current=d,h()),!v&&e&&e({offsetId:i})}),[t,c,e,h]);return n?[t]:[m.current,p]};function l(e,t=0,n,r){const{length:s}=e,o=e.indexOf(t),i=n===a.Uq.Forwards?o:o+1||s,c=Math.max(0,i-r),l=i+r-1,d=e.slice(Math.max(0,c),l+1);let u,m;switch(n){case a.Uq.Forwards:u=i>0,m=c>=0;break;case a.Uq.Backwards:u=i<s,m=l<=s-1}return{newViewportIds:d,areSomeLocal:u,areAllLocal:m}}},3657:(e,t,n)=>{n.d(t,{S1:()=>o,_N:()=>i,Op:()=>c});var r=n(4050),a=n(9118),s=n(8674);function o({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:o,margin:i,threshold:c,isDisabled:l,isAutoUnfreezeDisabled:d=!1},u){const m=(0,r.sO)(),h=(0,r.sO)(),f=(0,r.sO)(0),v=(0,r.sO)(),p=(0,r.sO)();h.current=u;const g=(0,r.I4)((()=>{f.current&&(f.current--,!f.current&&p.current&&(p.current(),p.current=void 0))}),[]),Z=(0,r.I4)((()=>{f.current++,d||(v.current&&(clearTimeout(v.current),v.current=void 0),v.current=window.setTimeout((()=>{v.current=void 0,f.current&&(f.current=1,g())}),2e3))}),[d,g]);return(0,s.ZP)(Z,g),(0,r.d4)((()=>{if(!l)return()=>{m.current&&(m.current.observer.disconnect(),m.current.callbacks.clear(),m.current=void 0)}}),[l]),{observe:(0,r.I4)(((r,s)=>{m.current||function(){const r=new Map,s=new Map,l=()=>{const e=Array.from(s.values());e.forEach((t=>{const n=r.get(t.target);n&&n(t,e)})),h.current&&h.current(e),s.clear()},d=t?a.P2:n?a.Ds:void 0,u=d?d(l,t||n,!o):l,v=new IntersectionObserver((e=>{e.forEach((e=>{s.set(e.target,e)})),f.current?p.current=()=>{u()}:u()}),{root:e.current,rootMargin:i?`${i}px`:void 0,threshold:c});m.current={observer:v,callbacks:r}}();const l=m.current;return l.observer.observe(r),s&&l.callbacks.set(r,s),()=>{s&&l.callbacks.delete(r),l.observer.unobserve(r)}}),[l]),freeze:Z,unfreeze:g}}function i(e,t,n){(0,r.d4)((()=>t?t(e.current,n):void 0),[])}function c(e,t,n){const[a,s]=(0,r.eJ)(!t);return i(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),a}},2645:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(7204);const s=(e,t,n)=>{const s=(0,a.Z)(t);return(0,r.bt)((()=>e(s||[])),t,n)}},6202:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(6137),s=n(647),o=n(5326);const i=(e,t=!1,n=a.IU.BlobUrl,i,c)=>{const l=e?s.UV(e):void 0,d=(0,o.Z)();return(0,r.d4)((()=>{if(!t&&e&&!l){const t=Date.now();s.he(e,n).then((()=>{const e=Date.now()-t;!c||e>=c?d():setTimeout(d,c-e)}))}}),[t,e,l,n,i,d,c]),l}},2619:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(2761),s=n(6562);function o(e,t){const[n,o]=(0,r.eJ)(!1),{mediaData:i,downloadProgress:c}=(0,a.Z)(e,!n);(0,r.d4)((()=>{n&&i&&((0,s.Z)(i,t),o(!1))}),[t,i,n]),(0,r.d4)((()=>{o(!1)}),[e]);const l=(0,r.I4)((e=>{e.stopPropagation(),o((e=>!e))}),[]);return{isDownloadStarted:n,downloadProgress:c,handleDownloadClick:l}}},2761:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),a=n(7361),s=n(6137),o=n(9118),i=n(647),c=n(5326);const l=(e,t=!1,n=s.IU.BlobUrl,l,d,u=!1)=>{const m=e?i.UV(e):void 0,h=n===s.IU.Stream||a.I_&&n===s.IU.Progressive,f=(0,c.Z)(),[v,p]=(0,r.eJ)(m&&!h?1:0),g=(0,r.sO)(),Z=(0,r.Ye)((()=>(0,o.P2)((e=>{(!d||Date.now()-g.current>d)&&p(e)}),500,!0)),[d]);return(0,r.d4)((()=>{!t&&e&&(m?h&&setTimeout((()=>{p(.75)}),1500):(p(0),g.current&&i.cC(Z),g.current=Date.now(),i.he(e,n,u,Z).then((()=>{const e=Date.now()-g.current;g.current=void 0,!d||e>=d?f():setTimeout(f,d-e)}))))}),[t,e,m,n,l,f,h,d,Z,u]),(0,r.d4)((()=>{t&&g.current&&(i.cC(Z),p(0))}),[Z,t]),{mediaData:m,downloadProgress:v}}},6503:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(7361);let s;function o(e,t,n=250,o=!1){const i=(0,r.sO)(!0);return(0,r.d4)((()=>{e&&(i.current=!0)}),[e]),(0,r.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||a.$b||o||(s=window.setTimeout((()=>{i.current||t()}),2*n))}),[o,e,n,t]),[(0,r.I4)((()=>{i.current=!0}),[]),(0,r.I4)((()=>{i.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{i.current||t()}),n)}),[n,t])]}},2678:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(4050),a=n(7204),s=n(5326),o=n(9290);function i(e,t){const n=(0,a.Z)(e,!0),i=(0,r.sO)(),c=(0,s.Z)(),l=null!=e,d=null!=n;return l&&i.current&&(clearTimeout(i.current),i.current=void 0),(0,o.Z)((()=>{t&&!l&&d&&!i.current&&(i.current=window.setTimeout((()=>{i.current=void 0,c()}),t))}),[e]),i.current&&t&&!l?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050);function a(e,t){const n=(0,r.sO)(e),[a,s]=(0,r.eJ)(t);return[a,(0,r.I4)((e=>{s((t=>n.current(t,e)))}),[])]}},8835:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050),a=n(1212);const s={fast:200,slow:350},o=(e,t="fast",n=!1)=>{const o=Boolean(e),i=!(0,r.sO)(o).current&&!n,[c,l]=(0,r.eJ)(!o),{shouldRender:d,transitionClassNames:u}=(0,a.Z)(o,void 0,!i,t);return(0,r.d4)((()=>{d&&(i?setTimeout((()=>{l(!1)}),s[t]):l(!1))}),[i,d,t]),{shouldRenderThumb:c,shouldRenderFullMedia:d,transitionClassNames:u}}},6898:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(4050),a=n(9118);function s(e,t){(0,r.d4)((()=>{const t=e.current;return()=>{t&&(0,a.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>s});const r=[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],a=[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,o,i,c){if(Number.isNaN(i)||i<1)return;i|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const l=e.getImageData(t,n,s,o),d=l.data;let u,m,h,f,v,p,g,Z,E,P,y,C,b=s-1,w=o-1,N=i+1,k=[],I=[],T=[],S=r[i],M=a[i],x=[],L=[];for(;c-- >0;){for(C=y=0,v=0;v<o;v++){for(u=d[C]*N,m=d[C+1]*N,h=d[C+2]*N,p=1;p<=i;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+N)<b?g:b)<<2,L[f]=(g=f-i)>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]*N,m=I[P]*N,h=T[P]*N,p=1;p<=i;p++)P+=p>w?0:s,u+=k[P],m+=I[P],h+=T[P];for(y=f<<2,v=0;v<o;v++)d[y]=u*S>>>M,d[y+1]=m*S>>>M,d[y+2]=h*S>>>M,0==f&&(x[v]=((g=v+N)<w?g:w)*s,L[v]=(g=v-i)>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:()=>v,z2:()=>p,An:()=>E});var r=n(5116),a=n(1713),s=n(7361),o=n(4753),i=n(5266),c=n(2858),l=n(9118);const d=new Map;let u,m=[],h=[];function f(e,t){const n=u&&d.get(u);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const a=d.get(e),s=g(a);if(!s)return;const i=Z(s,e,a.origin,t);if(!i)return;if(!d.has(i))return void(0,r.uC)().openAudioPlayer((0,c.Ak)(P(i).messageKey));const l=d.get(i);n&&(l.origin=n.origin),l.onForcePlay&&l.onForcePlay(),u=i,l.audio.src&&(0,o.Z)(l.audio)}function v(){const e=u&&d.get(u);e&&e.audio.pause()}function p(e,t,n,r,a,c){if(!d.has(e)){const r=function(e,t,n,r,a){const s=new Audio;function o(t){return n=>{d.has(e)&&((0,i.z)(s)||d.get(e).handlers.forEach((e=>{e(t,n)})))}}return s.addEventListener("timeupdate",o("onTimeUpdate")),s.addEventListener("play",o("onPlay")),s.addEventListener("pause",o("onPause")),s.addEventListener("loadstart",o("onLoadStart")),s.addEventListener("loadeddata",o("onLoadedData")),s.addEventListener("playing",o("onPlaying")),s.addEventListener("ended",(()=>{d.has(e)&&((0,i.z)(s)||f(e))})),{audio:s,type:t,proxy:new Proxy(s,{get:(e,t)=>e[t]}),origin:n,handlers:[],onForcePlay:r,onTrackChange:a}}(e,t,n,a,c);d.set(e,r),function(e,t){"audio"!==e.type||h.includes(t)||(h.push(t),h.sort(y)),"voice"!==e.type||m.includes(t)||(m.push(t),m.sort(y))}(r,e)}const{audio:v,proxy:p,handlers:E}=d.get(e);return E.push(r),{play(t){if(!v.paused)return;const n=u&&d.get(u);n&&u!==e&&(n.audio.pause(),n.audio.currentTime=0,(0,i.z)(n.audio)&&(n.audio.dataset.preventPlayAfterPatch="true"),n.onTrackChange&&n.onTrackChange()),u=e,v.src||(v.src=t,v.preload="auto",t.includes("/progressive/")&&s.s$&&(delete v.dataset.preventPlayAfterPatch,(0,i.B)(v))),(0,o.Z)(v)},setCurrentOrigin(t){d.get(e).origin=t},pause(){u===e&&v.pause()},stop(){if(u===e){const e=v.src;v.pause(),(0,l.T2)((()=>{v.src="",v.src=e}))}},setCurrentTime(t){u===e&&(v.fastSeek?v.fastSeek(t):v.currentTime=t)},setVolume(t){u===e&&(v.volume=t)},proxy:p,requestNextTrack(){f(e)},isLast(){const t=g(d.get(e));return!t||!Z(t,e,d.get(e).origin)},isFirst(){const t=g(d.get(e));return!t||!Z(t,e,d.get(e).origin,!0)},requestPreviousTrack(){f(e,!0)},destroy(t=!1){const n=d.get(e);n&&(n.handlers=n.handlers.filter((e=>e!==r)),n.handlers.length||(n.audio.pause(),d.delete(e),t&&function(e,t){"audio"===e.type&&(h=h.filter((e=>e!==t))),"voice"===e.type&&(m=m.filter((e=>e!==t)))}(n,e),e===u&&(u=void 0)))}}}function g(e){return"audio"===e.type?h:"voice"===e.type?m:void 0}function Z(e,t,n,r){if(n===a.Cr.Search){const n=e.indexOf(t);if(n<0)return;return e[n+(r?-1:1)]}const{chatId:s}=(0,c.Ak)(P(t).messageKey),o=e.filter((e=>e.startsWith(`msg${s}`))),i=o.indexOf(t);if(i<0)return;let l=n===a.Cr.Inline?-1:1;return r&&(l*=-1),o[i+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:r}=P(e),{date:a,messageKey:s}=P(t),o=a-n;return 0===o?s.localeCompare(r):o}},1174:(e,t,n)=>{n.d(t,{e:()=>a,s:()=>s});var r=n(7361);let a;function s(e,t){let n,s,o=!1,i=!1;function c(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",d),document.addEventListener("mouseup",l);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",d,{passive:!0}),t.addEventListener("touchend",l),t.addEventListener("touchcancel",l),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function l(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",l),document.removeEventListener("mousemove",d),n.target.removeEventListener("touchcancel",l),n.target.removeEventListener("touchend",l),n.target.removeEventListener("touchmove",d),n=void 0,r.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),o?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),o=!1,i=!1,s=void 0}function d(e){if(n){"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));const c=e.pageX-n.pageX,l=e.pageY-n.pageY;(Math.abs(c)>=15||Math.abs(l)>=15)&&(o=!0);let d=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:c,dragOffsetY:l}),d=!0),t.onSwipe&&!i&&(i=function(e,n,o){if(r.cj){const t=e.touches[0].pageX;if(t<=20||t>=window.innerWidth-20)return!1}const i=Math.abs(n),c=Math.abs(o);if(n&&o&&Math.max(i,c)/Math.min(i,c)<2)return!1;let l;if(i>=50?l="x":c>=50&&(l="y"),!l)return!1;if(s){if(s!==l)return!1}else s=l;return function(e,t,n,r,s){return"x"===t?s(e,n<0?a.Left:a.Right):"y"===t&&s(e,r<0?a.Up:a.Down)}(e,l,n,o,t.onSwipe)}(e,c,l),d=i),r.cj&&d&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",c),e.addEventListener("touchstart",c,{passive:!0}),()=>{e.removeEventListener("mousedown",c),e.removeEventListener("touchstart",c)}}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(a||(a={}))},4319:(e,t,n)=>{n.d(t,{yl:()=>a,TE:()=>o,VP:()=>i});var r=n(3716);const a=navigator.clipboard&&window.ClipboardItem,s=document.createElement("textarea");s.setAttribute("readonly",""),s.tabIndex=-1,s.className="visually-hidden";const o=e=>{s.value=e,document.body.appendChild(s);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);s.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(s)},i=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),r=new Image;r.onload=e=>{if(n&&e.currentTarget){const r=e.currentTarget;t.width=r.width,t.height=r.height,n.drawImage(r,0,0,r.width,r.height),t.toBlob(c,"image/png",1)}},r.src=e};async function c(e){if(e&&a)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){r.eM&&console.error(e)}}},1279:(e,t,n)=>{function r(e,t,n){s("transitionend",e,t,n)}function a(e,t,n){s("animationend",e,t,n)}function s(e,t,n,r){let a=!1;t.addEventListener(e,(function s(o){a||o.target!==o.currentTarget||r&&(o instanceof TransitionEvent&&o.propertyName===r||o instanceof AnimationEvent&&o.animationName===r)||(a=!0,t.removeEventListener(e,s),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>r,f:()=>a})},3570:(e,t,n)=>{function r(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>r})},6562:(e,t,n)=>{function r(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click()}n.d(t,{Z:()=>r})},539:(e,t,n)=>{n.d(t,{Z:()=>l,N:()=>d});var r=n(5116),a=n(1713),s=n(3716),o=n(8674),i=n(9933);let c=!1;function l(e,t,n,o=0,i=s.V$,c,l,d){const m=function(e,t,n=s.V$,r){const{offsetTop:o}=t,{scrollTop:i}=e;if(void 0===r){const t=o-e.scrollTop;if(t<-n)return i+(t+n);if(t>n)return i+(t-n)}else{if(r===a.fo.Up)return o+n;if(r===a.fo.Down)return Math.max(0,o-n)}return i}(e,t,i,c);c!==a.fo.Static?((0,r.Rd)().settings.byKey.animationLevel===s.oB&&(l=0),u(e,t,m,n,o,l,d)):u(e,t,m,n,o,0)}function d(){return c}function u(e,t,n,r,a=0,l,d){const{offsetTop:u,offsetHeight:f}=t,{scrollTop:v,offsetHeight:p,scrollHeight:g}=e,Z=d&&e.dataset.normalHeight?Number(e.dataset.normalHeight):p;let E;switch(v!==n&&(e.scrollTop=n),r){case"start":E=u-a-n;break;case"end":E=u+f+a-(n+Z);break;case"nearest":case"center":case"centerOrTop":E=f<Z?u+f/2-(n+Z/2):u-a-n}if(E<0){const e=-n;E=Math.max(E,e)}else if(E>0){const e=g-(n+Z);E=Math.min(E,e)}if(0===E)return;const P=n+E;if(0===l)return void(e.scrollTop=P);c=!0;const y=Math.abs(E),C=y<s.xn?h:m,b=l||s.bK+y/s.V$*(s.ck-s.bK),w=Date.now(),N=(0,o.YW)();(0,i.c)((()=>{const t=Math.min((Date.now()-w)/b,1),n=E*(1-C(t));return e.scrollTop=Math.round(P-n),c=t<1,c||N(),c}))}function m(e){return 1-(1-e)**5}function h(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(5116),a=n(3716),s=n(7361),o=n(9933);function i(e,t,n=300){(0,r.Rd)().settings.byKey.animationLevel===a.oB&&(n=0),s.cj?function(e,t,n){const{scrollLeft:r,offsetWidth:a,scrollWidth:s}=e;let i=t-r;if(i<0){const e=-r;i=Math.max(i,e)}else if(i>0){const e=s-(r+a);i=Math.min(i,e)}if(0===i)return;const c=r+i;if(0===n)return void(e.scrollLeft=c);const l=Date.now();(0,o.j)((()=>{const t=Math.min((Date.now()-l)/n,1),r=i*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(c-r),t<1}))}(e,t,n):e.scrollTo({left:t,...n&&{behavior:"smooth"}})}},5723:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7361);function a(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),a=document.createRange(),s=e.lastChild||e;r.$b||s&&s.nodeValue?(a.selectNodeContents(s),a.collapse(!1),n.removeAllRanges(),n.addRange(a)):e.focus()}},4532:(e,t,n)=>{n.d(t,{N:()=>a,Ym:()=>s,Ay:()=>i,pC:()=>c,NS:()=>l,Of:()=>d});const r={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 a(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&o(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=void 0!==e?e:null)}function o(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...r,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function i(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,o(r),e.playbackState&&(e.playbackState="none"),e.setPositionState&&e.setPositionState(void 0))}function c(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||!e.position||!e.duration)return;const{mediaSession:t}=window.navigator;t&&t.setPositionState&&t.setPositionState(e)}function d({title:e,artist:t,album:n,artwork:r}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:r})}},5266:(e,t,n)=>{function r(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 a(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>r,z:()=>a})},7675:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(7361);const a=(e,t)=>{r.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),r.cj&&(e.style.overflow="")}},4753:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(3716);const a=e=>{e.play().catch((e=>{r.eM&&console.warn(e)}))}}}]);
|
||
//# sourceMappingURL=60.6c59c81ddbafee713af5.js.map
|