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