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