2 lines
241 KiB
JavaScript
2 lines
241 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[4269],{4794:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(33555),i=n(42431),r=n(46752),s=n(7054),c=n(59107),l=n(31212),d=n(18360),u=n(231),m=n(70172);const h=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,s.Z1J)(e,n),a=(0,i.Bj)(e,n);return{groupCall:a,isActive:((0,s.jUK)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==a?.id&&Boolean(a?a.participantsCount>0&&a.isLoaded:o&&o.isCallNotEmpty&&o.isCallActive)}}))((e=>{let{chatId:t,isActive:n,className:i,groupCall:s,hasPinnedOffset:h}=e;const{requestMasterAndJoinGroupCall:p,subscribeToGroupCallUpdates:g}=(0,a.Sv)(),Z=(0,c.Z)(),v=(0,o.I4)((()=>{p({chatId:t})}),[p,t]),f=s?.participants,P=(0,o.Ye)((()=>{if(!f)return[];const e=(0,a.Rd)().users.byId,t=(0,a.Rd)().chats.byId;return Object.values(f).slice(0,3).map((n=>{let{id:o}=n;return e[o]||t[o]})).filter(Boolean)}),[f]);(0,o.d4)((()=>{if(s?.id&&(n||!s.isLoaded))return g({id:s.id,subscribed:!0}),()=>{g({id:s.id,subscribed:!1})}}),[s?.id,s?.isLoaded,n,g]);const{shouldRender:E,transitionClassNames:y}=(0,l.Z)(Boolean(s&&n)),b=(0,d.Z)(s?.participantsCount,!0),C=(0,d.Z)(P,!0);if(E)return o.ZP.createElement("div",{className:(0,r.Z)("GroupCallTopPane",h&&"has-pinned-offset",i,y),onClick:v},o.ZP.createElement("div",{className:"info"},o.ZP.createElement("span",{className:"title"},Z("VoipGroupVoiceChat")),o.ZP.createElement("span",{className:"participants"},Z("Participants",null!=b?b:0,"i"))),o.ZP.createElement("div",{className:"avatars"},C?.map((e=>o.ZP.createElement(m.Z,{key:e.id,peer:e})))),o.ZP.createElement(u.Z,{round:!0,className:"join"},Z("VoipChatJoin")))})))},34076:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(33555),i=n(46752),r=n(7054),s=n(59107),c=n(60706);const l=e=>{let{text:t,className:n}=e;const l=(0,s.Z)(),d=(0,o.sO)(),[u,m,h]=(0,c.Z)(!1),p=(0,r.FOo)((0,a.Rd)()),g=(0,o.Ye)((()=>{if(!p)return t;if(!u)return d.current||t;const e=d.current,n=[];for(let a=0;a<t.length;a++)e&&t[a]!==e[a]?n.push(o.ZP.createElement("div",{className:"LTqDt1MFKRDBjNZxKii4"},o.ZP.createElement("div",{className:"o1u1ctUWtWa2FWlC_BuT"},t[a]),o.ZP.createElement("div",{className:"tzggk5evL9EPqVAtvWEu",onAnimationEnd:h},e[a]),o.ZP.createElement("div",{className:"q6poDASGW35qQiXsD99c",onAnimationEnd:h},t[a]))):n.push(o.ZP.createElement("span",null,t[a]));return d.current=t,n}),[p,u,t]);return(0,o.d4)((()=>{m()}),[t]),o.ZP.createElement("span",{className:(0,i.Z)("Tx2CpCmpZZrHnCMUksg2",n),dir:l.isRtl?"rtl":void 0},g)}},45601:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(6137),i=n(48670),r=n(6202),s=n(21179);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c.apply(this,arguments)}const l=(0,o.X$)((function(e){const{sticker:t,noLoad:n,forcePreview:l,...d}=e,u=t?.thumbnail?.dataUri,m=t&&`sticker${t.id}`,h=(0,r.Z)(t?(0,i.RK)(t.id):void 0,n&&!l,a.IU.BlobUrl),p=(0,r.Z)(m,n);return o.ZP.createElement(s.Z,c({tgsUrl:p,previewUrl:h,thumbDataUri:u},d))}))},21179:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(58912),i=n(46752),r=n(80036),s=n(25190),c=n(70692),l=n(60706);const d="gp5OwinzPeHwkesmaEIR";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u.apply(this,arguments)}const m=new Set,h=(0,o.X$)((function(e){const{previewUrl:t,thumbDataUri:n,className:h,...p}=e,[g,,Z]=(0,l.Z)(Boolean(n)),v=(0,c.Z)(g),[f,P,E]=(0,l.Z)(m.has(t)),y=(0,c.Z)(f),[b,C]=(0,l.Z)(!1),w=(0,s.Z)((()=>{P(),m.add(t)})),S=(0,s.Z)((()=>{Z(),E(),setTimeout(C,300)})),{size:N}=e;return o.ZP.createElement("div",{className:(0,i.Z)(h,"oGmd77AsTbJeJk8CV6gl"),style:(0,r.Z)(void 0!==N&&`width: ${N}px; height: ${N}px;`)},n&&!b&&o.ZP.createElement("img",{src:n,className:(0,i.Z)(d,v)}),t&&!b&&o.ZP.createElement("img",{src:t,className:(0,i.Z)(d,y),onLoad:w}),o.ZP.createElement(a.Z,u({},p,{onLoad:S})))}))},54752:(e,t,n)=>{n.d(t,{ZP:()=>A});var o=n(60748),a=n(33555),i=n(6137),r=n(91713);function s(e,t,n,o){let{peak:a,fillStyle:i,progressFillStyle:r}=o;const s=4*t.length;e.width=2*s,e.height=46,e.style.width=`${s}px`,e.style.height="23px";const c=e.getContext("2d");c.scale(2,2),t.forEach(((e,o)=>{c.globalAlpha=o/t.length>=n?.5:1,c.fillStyle=n>o/t.length?r:i;const s=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,o,a,i){2<2*i&&(i=1),a<2*i&&(i=a/2),e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+2,n,t+2,n-a,i),e.arcTo(t+2,n-a,t,n-a,i),e.arcTo(t,n-a,t,n,i),e.arcTo(t,n,t+2,n,i),e.closePath()}(c,4*o,(23+s)/2,0,s,1),c.fill()}))}var c=n(32340),l=n(15376),d=n(48670),u=n(46752),m=n(790);function h(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const o=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),i=a[t]+(a[t+1]<<8);o[e]=i>>n&31}const i=Math.floor(5*(n-1)/8),r=Math.floor(5*(n-1)%8),s=a[i]+(a[i+1]<<8);return o[n-1]=s>>r&31,o}function p(e,t){let n=0;const o=new Array(t),a=e.length/t,i=e[0],r=e[e.length-1];for(let d=0;d<t;d++){var s,c,l;const t=Math.floor(d*a),u=((null!==(s=e[t-1])&&void 0!==s?s:i)+(null!==(c=e[t])&&void 0!==c?c:i)+(null!==(l=e[t+1])&&void 0!==l?l:r))/3;o[d]=u,n<u&&(n=u)}return{data:o,peak:n}}var g=n(10396),Z=n(25190),v=n(6701),f=n(31212),P=n(12019),E=n(23186),y=n(59107),b=n(64963),C=n(6202),w=n(42797),S=n(231),N=n(39196),I=n(8337);const M=window.matchMedia("(max-width: 375px)"),k=window.matchMedia("(max-width: 410px)");function x(e,t){return{MIN_SPIKES:e?M.matches?16:20:25,MAX_SPIKES:e?M.matches?35:t&&k.matches?40:45:75}}function T(e,t,n){return o.ZP.createElement("div",{className:"seekline",ref:n},t.map((e=>{let{start:t,end:n}=e;return o.ZP.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*t}%; right: ${100-100*n}%`})})),o.ZP.createElement("span",{className:"seekline-play-progress"},o.ZP.createElement("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})),o.ZP.createElement("span",{className:"seekline-thumb"},o.ZP.createElement("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})))}const A=(0,o.X$)((e=>{let{theme:t,message:n,senderTitle:M,uploadProgress:k,origin:A,date:O,noAvatars:R,className:D,isSelectable:L,isSelected:F,isDownloading:B,isTranscribing:U,isTranscriptionHidden:$,isTranscribed:j,isTranscriptionError:H,canDownload:_,canTranscribe:Y,onHideTranscription:z,onPlay:V,onReadMedia:X,onCancelUpload:q,onDateClick:W}=e;const{cancelMessageMediaDownload:G,downloadMessageMedia:K,transcribeAudio:J}=(0,a.Sv)(),{content:{audio:Q,voice:ee,video:te},isMediaUnread:ne}=n,oe=Boolean(ee||te),ae=(0,o.sO)(!1),ie=(0,o.sO)(null),re=(0,y.Z)(),{isRtl:se}=re,{isMobile:ce}=(0,w.ZP)(),[le,de]=(0,o.eJ)(!1),ue=le||!0,me=(0,d.Ti)(n,"pictogram"),he=(0,C.Z)(me,!1,i.IU.BlobUrl),pe=(0,C.Z)((0,d.Ti)(n,"inline"),!ue,(0,d.kG)(n,"inline")),{loadProgress:ge}=(0,v.Z)((0,d.Ti)(n,"download"),!B,(0,d.kG)(n,"download")),Ze=(0,Z.Z)((()=>{de(!0),V(n.id,n.chatId)})),ve=(0,Z.Z)((()=>{de(!1)})),{isBuffered:fe,bufferedRanges:Pe,bufferingHandlers:Ee,checkBuffering:ye}=(0,P.Z)(),{isPlaying:be,playProgress:Ce,playPause:we,setCurrentTime:Se,duration:Ne}=(0,E.Z)((0,g.An)(n),(0,d.XV)(n),oe?"voice":"audio",pe,Ee,void 0,ye,le,Ze,ve,(0,d.CI)(n)),Ie=(0,d.B4)(n),Me=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const c=(0,o.sO)(null),{data:l,peak:d}=(0,o.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:o,MAX_SPIKES:a}=x(r,i),s=Math.min(n/10,1),c=Math.round(o+(a-o)*s);return p(h(new Uint8Array(e)),c)}),[r,t,i])||{};return(0,o.bt)((()=>{const t=c.current;t&&l&&void 0!==d&&s(t,l,n,{peak:d,fillStyle:a?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:a?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[a,d,n,l,e]),c}(t,ee,ne&&!Ie?1:Ce,Ie,!R,ce),ke=be||Ce>0&&Ce<1;(0,o.d4)((()=>{de(be)}),[be]);const xe=le&&!fe,{isUploading:Te,isTransferring:Ae,transferProgress:Oe}=(0,d.Sc)(n,k||ge,xe||B),{shouldRender:Re,transitionClassNames:De}=(0,f.Z)(Ae),Le=Re&&(xe||Te),Fe=(0,Z.Z)((()=>{Te?q?.():(be||V(n.id,n.chatId),(0,a.Sv)().setAudioPlayerOrigin({origin:A}),de(!le),we())}));(0,o.d4)((()=>{X&&ne&&(be||B)&&X()}),[be,ne,X,B]);const Be=(0,Z.Z)((()=>{B?G({message:n}):K({message:n})})),Ue=(0,Z.Z)((e=>{if(ae.current&&ie.current){const{width:t,left:n}=ie.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Se(Math.max(Math.min(Ne*((o-n)/t),Ne-.1),.001))}})),$e=(0,Z.Z)((e=>{e instanceof MouseEvent&&2===e.button||(ae.current=!0,Ue(e))})),je=(0,Z.Z)((()=>{ae.current=!1})),He=(0,Z.Z)((()=>{W(n.id,n.chatId)})),_e=(0,Z.Z)((()=>{J({chatId:n.chatId,messageId:n.id})}));function Ye(){if(oe)return M||"Voice";const{title:e,fileName:t}=Q;return e||t}(0,o.d4)((()=>{if(ie.current&&ke)return(0,b.sf)(ie.current,{onCapture:$e,onRelease:je,onClick:je,onDrag:Ue})}),[ke,$e,Ue,je]);const ze=(0,u.Z)("Audio",D,A===r.Cr.Inline&&"inline",Ie&&A===r.Cr.Inline&&"own",(A===r.Cr.Search||A===r.Cr.SharedMedia)&&"bigger",F&&"audio-is-selected"),Ve=["toggle-play"];Le?Ve.push("loading"):Ve.push(be?"pause":"play");const Xe=(0,u.Z)("content",ke&&"with-seekline");function qe(){return o.ZP.createElement("div",{className:Xe},o.ZP.createElement("div",{className:"content-row"},o.ZP.createElement("p",{className:"title",dir:"auto",title:Ye()},(0,c.Z)(Ye())),o.ZP.createElement("div",{className:"message-date"},Boolean(O)&&o.ZP.createElement(I.Z,{className:"date",onClick:He},(0,m.VX)(re,1e3*O)))),ke&&o.ZP.createElement("div",{className:"meta search-result",dir:se?"rtl":void 0},o.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},Ce<1&&`${(0,m.k9)(Ne*Ce,Ne)}`),T(Ce,Pe,ie)),!ke&&function(){if(oe)return o.ZP.createElement("div",{className:"meta",dir:se?"rtl":void 0},(0,m.k9)((ee||te).duration));const{performer:e}=Q;return o.ZP.createElement("div",{className:"meta",dir:se?"rtl":void 0},(0,m.k9)(Ne),o.ZP.createElement("span",{className:"bullet"},"•"),e&&o.ZP.createElement("span",{className:"performer",title:e},(0,c.Z)(e)),e&&M&&o.ZP.createElement("span",{className:"bullet"},"•"),M&&o.ZP.createElement("span",{title:M},(0,c.Z)(M)))}())}return o.ZP.createElement("div",{className:ze,dir:re.isRtl?"rtl":"ltr"},L&&o.ZP.createElement("div",{className:"message-select-control"},F&&o.ZP.createElement("i",{className:"icon icon-select"})),o.ZP.createElement(S.Z,{round:!0,ripple:!ce,size:"smaller",color:he?"translucent-white":"primary",className:Ve.join(" "),ariaLabel:be?"Pause audio":"Play audio",onClick:Fe,isRtl:re.isRtl,backgroundImage:he},o.ZP.createElement("i",{className:"icon icon-play"}),o.ZP.createElement("i",{className:"icon icon-pause"})),Re&&o.ZP.createElement("div",{className:(0,u.Z)("media-loading",De,Le&&"interactive")},o.ZP.createElement(N.Z,{progress:Oe,transparent:!0,size:"m",onClick:Le?Fe:void 0,noCross:!Le})),Q&&_&&!Te&&o.ZP.createElement(S.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:B?"Cancel download":"Download",onClick:Be},o.ZP.createElement("i",{className:(0,u.Z)("icon",B?"icon-close":"icon-arrow-down")})),A===r.Cr.Search&&qe(),A!==r.Cr.Search&&Q&&function(e,t,n,a,i,r,s,d,u,h,p){const{title:g,performer:Z,fileName:v}=t,f=a||i>0&&i<1,{isRtl:P}=e;return o.ZP.createElement("div",{className:"content"},o.ZP.createElement("p",{className:"title",dir:"auto",title:g},(0,c.Z)(g||v)),f&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},o.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,m.k9)(n*i,n)),T(i,r,s)),!f&&d&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},h?`${(0,l.yW)(t.size*h)} / `:void 0,(0,l.yW)(t.size)),!f&&!d&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},o.ZP.createElement("span",{className:"duration",dir:"auto"},(0,m.k9)(n)),Z&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"},"•"),o.ZP.createElement("span",{className:"performer",dir:"auto",title:Z},(0,c.Z)(Z))),Boolean(u)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"},"•"),o.ZP.createElement(I.Z,{className:"date",onClick:p},(0,m.ZK)(e,1e3*u,!0)))))}(re,Q,Ne,be,Ce,Pe,ie,B||Te,O,Oe,W?He:void 0),A===r.Cr.SharedMedia&&(ee||te)&&qe(),A===r.Cr.Inline&&ee&&function(e,t,n,a,i,r,s,c,l,d,h){return o.ZP.createElement("div",{className:"content"},o.ZP.createElement("div",{className:"waveform-wrapper"},o.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},o.ZP.createElement("canvas",{ref:n})),d&&o.ZP.createElement(S.Z,{onClick:()=>{(c||l)&&h?h(!s):r||d()}},o.ZP.createElement("i",{className:(0,u.Z)("transcribe-icon","icon",c||l?"icon-down":"icon-transcribe",(c||l)&&!s&&"transcribe-shown")}),r&&o.ZP.createElement("svg",{viewBox:"0 0 32 24",className:"loading-svg"},o.ZP.createElement("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"var(--accent-color)","stroke-dashoffset":"1","stroke-dasharray":"32,68"})))),o.ZP.createElement("p",{className:(0,u.Z)("voice-duration",i&&"unread"),dir:"auto"},0===a?(0,m.k9)(e.duration):(0,m.k9)(e.duration*a)))}(ee,ie,Me,Ce,ne,U,$,j,H,Y?_e:void 0,z))}))},65351:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(46752),i=n(59107),r=n(70172);const s={root:"ahi3up0oMwlFJTE6hkxG","size-micro":"DOhAE8mniLY2g2i7rkfz",sizeMicro:"DOhAE8mniLY2g2i7rkfz","size-mini":"gF82cRdQRxqmTN8fLb9i",sizeMini:"gF82cRdQRxqmTN8fLb9i","size-tiny":"ecJbjvbrCkoUdtVrdBYi",sizeTiny:"ecJbjvbrCkoUdtVrdBYi","size-small":"iaKZOfQnH3hROD8QK_fq",sizeSmall:"iaKZOfQnH3hROD8QK_fq","size-small-mobile":"YP90v9JGup97HOcD2duf",sizeSmallMobile:"YP90v9JGup97HOcD2duf","size-medium":"TmYXjEqVbt0gwaoWlRHv",sizeMedium:"TmYXjEqVbt0gwaoWlRHv","size-large":"YIuShtdEPpbCXrGgmeFv",sizeLarge:"YIuShtdEPpbCXrGgmeFv","size-jumbo":"D9X7fMnC8YtoUm_wjoSA",sizeJumbo:"D9X7fMnC8YtoUm_wjoSA",avatar:"PTpUqAuoZL9Uou6MqJXX"},c=(0,o.X$)((e=>{let{peers:t,size:n,className:c}=e;const l=(0,i.Z)();return o.ZP.createElement("div",{className:(0,a.Z)(c,s.root,s[`size-${n}`]),dir:l.isRtl?"rtl":"ltr"},t?.map((e=>o.ZP.createElement(r.Z,{size:n,peer:e,className:s.avatar}))))}))},70180:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(6137),r=n(83716),s=n(7054),c=n(48670),l=n(32340),d=n(64319),u=n(6272),m=n(69118),h=n(3858),p=n(25190),g=n(59107),Z=n(31876),v=n(83321);const f=(0,m.Ds)((e=>e()),500,!1),P=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatOrUserId:n}=t;const{countryList:{phoneCodes:o}}=e,a=n?(0,s.Z1J)(e,n):void 0,i=(0,c.YC)(n)?(0,s.dyD)(e,n):void 0,r=a?.isForum,l=a&&(0,c.i4)(a,(0,s.dZI)(e),(0,s.NJL)(e)),{threadId:d}=(0,s.Btg)(e)||{},u=r?d:void 0,m=a?(0,s.x67)(e,a.id)?.inviteLink:void 0;let h=i?(0,s.ccz)(e,i.id)?.bio:void 0;return!h&&a&&(h=(0,s.x67)(e,a.id)?.about),{phoneCodeList:o,chat:a,user:i,canInviteUsers:a&&!i&&(!(0,c.eA)(a)&&!(0,c.Mg)(a,"inviteUsers")||(0,c.VE)(a,"inviteUsers")),isMuted:l,topicId:u,chatInviteLink:m,description:h}}))((e=>{let{user:t,chat:n,forceShowSelf:s,canInviteUsers:m,isMuted:P,phoneCodeList:E,topicId:y,description:b,chatInviteLink:C}=e;const{loadFullUser:w,showNotification:S,updateChatMutedState:N,updateTopicMutedState:I,loadUserStories:M}=(0,a.Sv)(),{id:k,usernames:x,phoneNumber:T,isSelf:A}=t||{},{id:O,usernames:R}=n||{},D=(0,g.Z)(),[L,F]=(0,o.eJ)(!P);(0,o.d4)((()=>{F(!P)}),[P]),(0,o.d4)((()=>{k&&(w({userId:k}),M({userId:k}))}),[k]);const B=Boolean(y&&y!==i._f),U=(0,o.Ye)((()=>{const e=x?.filter((e=>e.isActive));return e?.length?e:void 0}),[x]),$=(0,o.Ye)((()=>{const e=t?void 0:R?.filter((e=>e.isActive));return e?.length?e:void 0}),[R,t]),j=(0,o.Ye)((()=>{if(n)return B?(0,c.pA)(n.id,$?.[0].username,y):(0,c.hu)(n)||C}),[n,B,$,y,C]),H=(0,p.Z)((()=>{F((e=>{const t=!e;return f((()=>{B?I({chatId:O,topicId:y,isMuted:!t}):N({chatId:O,isMuted:!t})})),t}))}));if(!n||n.isRestricted||A&&!s)return;function _(e,t){(0,d.TE)(e),S({message:`${t} was copied`})}const Y=T&&(0,u.WZ)(E,T);function z(e,t){const[n,...a]=e,i=a.length?D("UsernameAlso","%USERNAMES%").split("%").map((e=>"USERNAMES"===e?o.ZP.createElement(o.ZP.Fragment,null,a.map(((e,n)=>{let{username:a}=e;const i=t?`${r.zHP}${a}`:`@${a}`;return o.ZP.createElement(o.ZP.Fragment,null,n>0?", ":"",o.ZP.createElement("a",{key:a,href:`${r.zHP}${a}`,onClick:e=>{(0,h.Z)(e),_(i,D(t?"Link":"Username"))},className:"text-entity-link username-link"},`@${a}`))}))):e)):void 0,s=t?`t.me/${n.username}`:n.username,c=t?`${r.zHP}${n.username}`:`@${n.username}`;return o.ZP.createElement(Z.Z,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>_(c,D(t?"Link":"Username"))},o.ZP.createElement("span",{className:"title",dir:"auto"},s),o.ZP.createElement("span",{className:"subtitle"},i&&o.ZP.createElement("span",{className:"other-usernames"},i),D(t?"Link":"Username")))}return o.ZP.createElement("div",{className:"ChatExtra"},Y&&Boolean(Y.length)&&o.ZP.createElement(Z.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>_(Y,D("Phone"))},o.ZP.createElement("span",{className:"title",dir:"auto"},Y),o.ZP.createElement("span",{className:"subtitle"},D("Phone"))),U&&z(U),b&&Boolean(b.length)&&o.ZP.createElement(Z.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},o.ZP.createElement("span",{className:"title word-break allow-selection",dir:"auto"},(0,l.Z)(b,["br","links","emoji"])),o.ZP.createElement("span",{className:"subtitle"},D(k?"UserBio":"Info"))),$&&!B&&z($,!0),(!$&&m||B)&&j&&o.ZP.createElement(Z.Z,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>_(j,D("SetUrlPlaceholder"))},o.ZP.createElement("div",{className:"title"},j),o.ZP.createElement("span",{className:"subtitle"},D("SetUrlPlaceholder"))),!s&&o.ZP.createElement(Z.Z,{icon:"unmute",ripple:!0,onClick:H},o.ZP.createElement("span",null,D("Notifications")),o.ZP.createElement(v.Z,{id:"group-notifications",label:k?"Toggle User Notifications":"Toggle Chat Notifications",checked:L,inactive:!0})))})))},4949:(e,t,n)=>{n.d(t,{Z:()=>Lt});var o=n(60748),a=n(57710),i=n(33555),r=n(83716),s=n(601),c=n(70735),l=n(7054),d=n(48670),u=n(790),m=n(65723),h=n(83099),p=n(41098);function g(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const o=n.textContent.length,a=document.createRange(),i=window.getSelection();a.setStart(n,o),a.setEnd(n,o),i.removeAllRanges(),i.addRange(a),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}var Z=n(46752),v=n(43858),f=n(82267),P=n(9211),E=n(74288),y=n(96391),b=n(20230),C=n(44139),w=n(71394),S=n(93447);const N=/\.[^/.]+$/;async function I(e,t,o){const a=URL.createObjectURL(t),{type:i,size:s}=t;let c,l,d,u;if(r.oGt.has(i)){const n=await(0,w.pt)(a),{width:s,height:l}=n;u=!k(s,l);const m=Math.max(s,l)>1280,h=i===r.s11;if(!u){if(!o?.compressedBlobUrl&&!h&&(m||"image/jpeg"!==i)){const n=await(0,S.j)(a,m?1280/Math.max(s,l):1,"image/jpeg");return URL.revokeObjectURL(a),I(e,t,{compressedBlobUrl:n})}"image/jpeg"===i&&(e=e.replace(N,".jpg")),c={width:s,height:l}}d=Math.max(s,l)>40?await(0,S.j)(a,40/Math.max(s,l),"image/jpeg"):a}else if(r.wGh.has(i)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,w.jj)(a);u=!k(e,t),u||(c={width:e,height:t,duration:n})}catch(e){u=!0}d=await(0,w.ud)(a)}else if(r.e74.has(i)){const{duration:e,title:t,performer:o,coverUrl:i}=await async function(e){const{fetchFromUrl:t,selectCover:o}=await n.e(8505).then(n.t.bind(n,38505,23)),a=await t(e),{common:{title:i,artist:r,picture:s},format:{duration:c}}=a,l=o(s);return{title:i,performer:r,duration:c,coverUrl:l?`data:${l.format};base64,${l.data.toString("base64")}`:void 0}}(a);l={duration:e||0,title:t,performer:o},d=i}return{blobUrl:a,filename:e,mimeType:i,size:s,quick:c,audio:l,previewBlobUrl:d,shouldSendAsFile:u||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...o}}function M(e,t){return e.map((e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!e.voice||void 0,shouldSendAsSpoiler:void 0}))}function k(e,t){return Math.max(e,t)/Math.min(e,t)<=20}let x;function T(e){x.focus(),e.focus()}s.cj&&(x=document.createElement("input"),x.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(x));var A=n(32340),O=n(25190),R=n(33799),D=n(60706),L=n(87204),F=n(17240),B=n(59107),U=n(56389),$=n(62357),j=n(34446),H=n(69156),_=n(86203),Y=n(70971),z=n(274),V=n(28183),X=n(33057);function q(e){return e.shouldSendAsFile?"file":r.oGt.has(e.mimeType)?"image":r.wGh.has(e.mimeType)?"video":r.e74.has(e.mimeType)?"audio":"file"}const W={encoderPath:new URL(n(68973),n.b).href,reuseWorker:!0},G={type:"audio/ogg"};let K,J,Q;async function ee(){return K||(K=n.e(1161).then(n.t.bind(n,1161,23)),J=(await K).default,Q=new J(W)),K}async function te(e){await async function(){await ee(),await Q.start()}();const t=Date.now();let n;const o=[],i=[];Q.ondataavailable=e=>{o.push(e)};const r=function(t,n){const o=t.sourceNode,r=o.context.createAnalyser();r.fftSize=64,o.connect(r);const s=r.frequencyBinCount,c=new Uint8Array(s);let l=!1;return function t(){if(l)return;r.getByteFrequencyData(c);const n=c.reduce(((e,t)=>e+t),0)/s/255;(t=>{i.push(255*t),e(t)})(n<.1?0:n),(0,a.i$)(t)}(),()=>{l=!0}}(Q);return{stop:()=>new Promise(((e,a)=>{Q.onstop=()=>{e({blob:new Blob(o,G),duration:Math.round(((n||Date.now())-t)/1e3),waveform:i})},Q.onerror=a;const s=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Q.stop(),r()}),s)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Q.pause(),n=Date.now(),r()}),e)}}}var ne=n(23989);var oe=n(28353),ae=n(60130),ie=n(94462),re=n(33681),se=n(52400),ce=n(71790);const le=new RegExp(`^${r.t8f.source}$`,"g");var de=n(29295),ue=n(16580),me=n(11309);const he=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,pe=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,ge={username:"",query:"",canShowHelp:!1,usernameLowered:""},Ze=document.createElement("div");const ve=(0,ue.Z)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()}))),fe=/^\/([\w@]{1,32})?$/i;var Pe=n(6137),Ee=n(45332),ye=n(58637),be=n(88957);let Ce=!1;const we=new Set([Pe.Vv.TextUrl,Pe.Vv.Url]);var Se=n(21262);const Ne=/id="docs-internal-guid/i,Ie=["H1","H2","H3","H4","H5","H6"];function Me(e){return(new DOMParser).parseFromString(e,"text/html").body}function ke(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function xe(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function Te(e,t){let n=t.cloneNode(!0);return e?(e.style&&"700"===e.style.fontWeight&&(n=xe(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=xe(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=xe(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=xe(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=xe(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=xe(n,"sub")),n):n}function Ae(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=ke(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=Te(o,n),n}function Oe(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const o=[];for(let t=0;t<e.childNodes.length;t++)o.push(...Oe(e.childNodes[t]));o.map((e=>n.appendChild(e)))}else-1!==Ie.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=Ae(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=ke(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=Te(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=Ae(e));return t?(t.appendChild(n),[t]):[e.cloneNode(!0)]}if(e.childNodes){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(...Oe(e.childNodes[n]));return t}return[e]}function Re(e){return 8!==e.nodeType}var De=n(56266);const Le=/<style>(.*?)<\/style>/gs,Fe=(e,t,n,a,i,s,c)=>{(0,o.d4)((()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=document.activeElement;if(o&&![r.R2F,r.nYf,r.Cic].includes(o.id))return;const l=e.clipboardData.getData("text").substring(0,4096),d=e.clipboardData.getData("text/html");let u=d?(0,h.ZP)(function(e){let t=document.createElement("div");try{e=(n=e).match(Ne)?function(e){const t=document.createElement("body"),n=e.childNodes,o=Array.from(n).filter(Re),a=[];for(const e of o)a.push(...Oe(e));for(let e=0;e<a.length;e++)t.appendChild(a[e].cloneNode(!0));return t}(Me(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:Me(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){r.eMD&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(Le,"");const o=t.querySelectorAll(".text-content");return o.length&&(t=o[o.length-1]),Array.from(t.getElementsByTagName("*")).forEach((e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),h.xe[e.tagName]&&e.setAttribute("data-entity-type",h.xe[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case Pe.Vv.MentionName:e.replaceWith(e.textContent||"");break;case Pe.Vv.CustomEmoji:e.textContent=e.dataset.alt||""}})),t.innerHTML.trimEnd()}(d),void 0,!0):void 0;u&&(0,De.Lo)(u)&&s&&(u=(0,De.If)(u),c?.());const{items:m}=e.clipboardData;let p=[];if(e.preventDefault(),m.length>0&&(p=await(0,Se.Z)(m)),!p?.length&&!l)return;const g=u?.entities?.length?u:{text:l};let Z=!1;try{Z="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(d,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const v=g&&g.text,f=p?.length&&!i&&!Z;if(f){const e=await Promise.all(p.map((e=>I(e.name,e))));n((t=>t.concat(e)))}v&&(f?a(g):t(g,o?.id))}}),[t,i,n,e,s,c,a])};var Be=n(31212),Ue=n(99203),$e=n(48778),je=n(12420);const He=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"DropArea",!t);return n?o.ZP.createElement(n,e):void 0},_e=e=>{const{attachments:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"AttachmentModal",!t.length);return n?o.ZP.createElement(n,e):void 0},Ye=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"PollModal",!t);return n?o.ZP.createElement(n,e):void 0},ze=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"DeleteMessageModal",!t);return n?o.ZP.createElement(n,e):void 0},Ve=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"SendAsMenu",!t);return n?o.ZP.createElement(n,e):void 0},Xe=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"MentionTooltip",!t);return n?o.ZP.createElement(n,e):void 0},qe=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"BotCommandTooltip",!t);return n?o.ZP.createElement(n,e):void 0},We=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"InlineBotTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var Ge=n(17891),Ke=n(12644),Je=n(231),Qe=n(84441),et=n(58964),tt=n(52328),nt=n(66902);const ot=(0,o.X$)((0,i.c$)(((e,t)=>{let{shouldForceShowEditing:n}=t;const{chatId:o,threadId:a,type:i}=(0,l.Btg)(e)||{};if(!o||!a||!i)return{};const{forwardMessages:{fromChatId:r,toChatId:s,messageIds:c,noAuthors:u,noCaptions:m}}=(0,l.jUK)(e),h=(0,l.Yyv)(e,o,a),p="scheduled"===i?(0,l.nBP)(e,o):(0,l._$9)(e,o,a),g=(0,l.FOo)(e),Z=s===o,v=c?.map((t=>(0,l.hjO)(e,r,t)));let f,P;if(h&&!n?f=(0,l.hjO)(e,o,h):p?f=(0,l.kKD)(e,o,a,i):Z&&1===c.length&&(f=v?.[0]),h&&f&&!n){const{forwardInfo:t}=f,n=(0,l.FM1)(e,o);t&&(t.isChannelPost||n)&&(P=(0,l.cve)(e,f)),P||t?.hiddenUserName||(P=(0,l.Urc)(e,f))}else Z&&(f&&(P=(0,l.cve)(e,f),P||(P=(0,l.Urc)(e,f))),P||(P=(0,d.YC)(r)?(0,l.dyD)(e,r):(0,l.Z1J)(e,r)));const E=v?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),y=Z&&1===c.length&&Boolean(f?.content.storyData);return{replyingToId:h,editingId:p,message:f,sender:P,shouldAnimate:g,forwardedMessagesCount:Z?c.length:void 0,noAuthors:u,noCaptions:m,forwardsHaveCaptions:E,isCurrentUserPremium:(0,l.wVz)(e),isContextMenuDisabled:y}}))((e=>{let{replyingToId:t,editingId:n,message:a,sender:r,shouldAnimate:s,forwardedMessagesCount:c,noAuthors:l,noCaptions:u,forwardsHaveCaptions:m,shouldForceShowEditing:h,isCurrentUserPremium:p,isContextMenuDisabled:g,onClear:v}=e;const{setReplyingToId:f,setEditingId:P,focusMessage:E,changeForwardRecipient:y,setForwardNoAuthors:b,setForwardNoCaptions:C,exitForwardMode:w}=(0,i.Sv)(),S=(0,o.sO)(null),N=(0,B.Z)(),I=Boolean(c),M=Boolean((t||n)&&a||r&&c),k=(0,Ge.Z)([c],c?300:void 0),{shouldRender:x,transitionClassNames:T}=(0,Be.Z)(k&&M,void 0,!s,void 0,!s),A=(0,O.Z)((()=>{t&&!h?f({messageId:void 0}):n?P({messageId:void 0}):c&&w(),v?.()}));(0,o.d4)((()=>M?(0,ne.Z)(A):void 0),[M,A]);const R=(0,O.Z)((()=>{I||E({chatId:a.chatId,messageId:a.id,noForumTopicPanel:!0})})),D=(0,O.Z)((e=>{e.stopPropagation(),A()})),L=(0,O.Z)((()=>{y()})),{isContextMenuOpen:U,contextMenuPosition:$,handleContextMenu:j,handleContextMenuClose:H,handleContextMenuHide:_}=(0,F.Z)(S),Y=(0,O.Z)((()=>S.current)),z=(0,O.Z)((()=>S.current)),V=(0,O.Z)((()=>S.current.querySelector(".forward-context-menu .bubble"))),{positionX:X,positionY:q,transformOriginX:W,transformOriginY:G,style:K}=(0,Ke.Z)($,Y,z,V);(0,o.d4)((()=>{x||H()}),[H,x]);const J=(0,Z.Z)("ComposerEmbeddedMessage",T),Q=(0,o.Ye)((()=>t&&!h?"icon-reply":n?"icon-edit":I?"icon-forward":void 0),[n,I,t,h]),ee=c&&c>1?N("ForwardedMessageCount",c):void 0,te=(0,o.Ye)((()=>{if(!a||!I||!a.content.text||!l||p)return a;const e=(0,d.If)(a.content.text);return{...a,content:{...a.content,text:e}}}),[p,I,a,l]);if(x)return o.ZP.createElement("div",{className:J,ref:S,onContextMenu:j,onClick:j},o.ZP.createElement("div",{className:"ComposerEmbeddedMessage_inner"},o.ZP.createElement("div",{className:"embedded-left-icon"},o.ZP.createElement("i",{className:(0,Z.Z)("icon",Q)})),o.ZP.createElement(Qe.Z,{className:"inside-input",message:te,sender:l?void 0:r,customText:ee,title:n?N("EditMessage"):l?N("HiddenSendersNameDescription"):void 0,onClick:R,hasContextMenu:I&&!g}),o.ZP.createElement(Je.Z,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:N("Cancel"),onClick:D},o.ZP.createElement("i",{className:"icon icon-close"})),I&&!g&&o.ZP.createElement(tt.Z,{isOpen:U,transformOriginX:W,transformOriginY:G,positionX:X,positionY:q,style:K,className:"forward-context-menu",onClose:H,onCloseAnimationEnd:_},o.ZP.createElement(et.Z,{icon:l?void 0:"message-succeeded",customIcon:l?o.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>b({noAuthors:!1})},N(c>1?"ShowSenderNames":"ShowSendersName")),o.ZP.createElement(et.Z,{icon:l?"message-succeeded":void 0,customIcon:l?void 0:o.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>b({noAuthors:!0})},N(c>1?"HideSenderNames":"HideSendersName")),m&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(nt.Z,null),o.ZP.createElement(et.Z,{icon:u?void 0:"message-succeeded",customIcon:u?o.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>C({noCaptions:!1})},N(c>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")),o.ZP.createElement(et.Z,{icon:u?"message-succeeded":void 0,customIcon:u?void 0:o.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>C({noCaptions:!0})},N(c>1?"Conversation.ForwardOptions.HideCaption":"HideCaption"))),o.ZP.createElement(nt.Z,null),o.ZP.createElement(et.Z,{icon:"replace",onClick:L},N("ChangeRecipient")))))})));var at=n(18360),it=n(54659);const rt=new RegExp(r.FM6,"i"),st=(0,o.X$)((0,i.c$)(((e,t)=>{let{chatId:n,threadId:o}=t;const a=(0,l.tVX)(e,n,o);return{theme:(0,l.Puy)(e),webPagePreview:(0,l.jUK)(e).webPagePreview,noWebPage:a}}))((e=>{let{chatId:t,threadId:n,getHtml:a,isDisabled:r,webPagePreview:s,noWebPage:c,theme:l}=e;const{loadWebPagePreview:d,clearWebPagePreview:u,toggleMessageWebPage:m}=(0,i.Sv)(),p=(0,o.sO)(),g=(0,me.iD)((()=>{const e=(0,h.ZP)(a()),t=e.entities?.find((e=>e.type===Pe.Vv.TextUrl));return p.current=e,t?.url||e.text.match(rt)?.[0]}),[a],300,!0),v=(0,ce.Z)(g,[g,a],!0);(0,o.d4)((()=>{const e=v(),o=p.current;e?d({text:o}):(u(),m({chatId:t,threadId:n}))}),[v,t,n]),(0,j.Z)((()=>{u(),m({chatId:t,threadId:n})}),[t,u,n,m]);const f=(0,_.Z)((()=>Boolean(s&&a()&&!c&&!r)),[r,a,c,s]),{shouldRender:P,transitionClassNames:E}=(0,Be.Z)(f),y=(0,at.Z)(s,!0),b=(0,O.Z)((()=>{m({chatId:t,threadId:n,noWebPage:!0})}));if(!P||!y)return;const{photo:C,...w}=y,S={content:{webPage:w}};return o.ZP.createElement("div",{className:(0,Z.Z)("WebPagePreview",E)},o.ZP.createElement("div",{className:"WebPagePreview_inner"},o.ZP.createElement("div",{className:"WebPagePreview-left-icon"},o.ZP.createElement("i",{className:"icon icon-link"})),o.ZP.createElement(it.Z,{message:S,inPreview:!0,theme:l}),o.ZP.createElement(Je.Z,{className:"WebPagePreview-clear",round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:b},o.ZP.createElement("i",{className:"icon icon-close"}))))}))),ct=(0,o.X$)((e=>{let{isOpen:t,onClick:n,text:a,isDisabled:i}=e;const r=(0,o.sO)(null);return(0,o.d4)((()=>{const e=r.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)}),[t,a]),(0,o.d4)((()=>{const e=r.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),o.ZP.createElement(Je.Z,{className:(0,Z.Z)("bot-menu",t&&"open"),round:!0,color:"translucent",disabled:i,onClick:n,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:(0,Z.Z)("bot-menu-icon","icon","icon-webapp",t&&"open")}),o.ZP.createElement("span",{ref:r,className:"bot-menu-text"},a))}));var lt=n(43521),dt=n(70172),ut=n(23522),mt=n(49841),ht=n(49204),pt=n(85655),gt=n(30879),Zt=n(56503),vt=n(62898),ft=n(42797),Pt=n(6202);const Et="N3E1geoPu1vesCKf545F",yt=/#fff/gi,bt=(0,o.X$)((e=>{let{icon:t,theme:n}=e;const{isTouchScreen:a}=(0,ft.ZP)(),i=(0,Pt.Z)((0,d.ym)(t),!1,Pe.IU.Text),r=(0,o.Ye)((()=>{if(!i)return"";const e="dark"===n?"rgb(170, 170, 170)":"rgb(112, 117, 121)",t=i.replace(yt,e),o=(new DOMParser).parseFromString(t,"image/svg+xml");return o.querySelectorAll("path").forEach((t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"})),`data:image/svg+xml;utf8,${o.documentElement.outerHTML}`}),[i,n]);return o.ZP.createElement("i",{className:(0,Z.Z)("vL8HfVVnjTeFmp1ECFj8","icon",!a&&Et)},o.ZP.createElement("img",{src:r,alt:"",className:(0,Z.Z)("Fb4aIyDYEwOlaqY8oZkV",!a&&Et)}))})),Ct=(0,o.X$)((e=>{let{bot:t,theme:n,chatId:a,threadId:r,onMenuOpened:s,onMenuClosed:c}=e;const{callAttachBot:l,toggleAttachBot:d}=(0,i.Sv)(),u=(0,B.Z)(),m=(0,o.Ye)((()=>t.icons.find((e=>{let{name:t}=e;return"default_static"===t}))?.document),[t.icons]),[h,p,g]=(0,D.Z)(),[Z,v]=(0,o.eJ)(void 0),f=(0,O.Z)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();v({x:t.right,y:t.bottom}),s(),p()})),P=(0,O.Z)((()=>{g(),c()})),E=(0,O.Z)((()=>{v(void 0)})),y=(0,O.Z)((()=>{d({botId:t.id,isEnabled:!1})}));return o.ZP.createElement(et.Z,{key:t.id,customIcon:m&&o.ZP.createElement(bt,{icon:m,theme:n}),icon:m?void 0:"bots",onClick:()=>l({bot:t,chatId:a,threadId:r}),onContextMenu:f},t.shortName,Z&&o.ZP.createElement(vt.Z,null,o.ZP.createElement(tt.Z,{isOpen:h,positionX:"right",style:`left: ${Z.x}px;top: ${Z.y}px;`,className:"bot-attach-context-menu",autoClose:!0,onClose:P,onCloseAnimationEnd:E},o.ZP.createElement(et.Z,{icon:"stop",destructive:!0,onClick:y},u("WebApp.RemoveBot")))))})),wt=(0,o.X$)((e=>{let{chatId:t,threadId:n,isButtonVisible:a,canAttachMedia:i,canAttachPolls:c,canSendPhotos:l,canSendVideos:d,canSendDocuments:u,canSendAudios:m,attachBots:h,peerType:p,isScheduled:g,onFileSelect:Z,onMenuOpen:v,onMenuClose:f,onPollCreate:P,theme:E,shouldCollectDebugLogs:y}=e;const[b,C,S]=(0,D.Z)(),[N,I,M]=(0,Zt.Z)(b,S),k=l&&d,x=l||d,[T,A,R]=(0,D.Z)(),L=b||T;(0,o.d4)((()=>{b&&M()}),[b,M]),(0,o.d4)((()=>{L?v():f()}),[L,f,v]);const F=(0,O.Z)((()=>{b?S():C()})),U=(0,O.Z)(((e,t)=>{const{files:n}=e.target,o=(0,w.ox)(n);o?.length&&Z(o,t)})),$=(0,O.Z)((()=>{(0,pt.g)(Array.from(k?r.dII:l?r.oGt:r.wGh).join(","),(e=>U(e,!0)))})),j=(0,O.Z)((()=>{(0,pt.g)(!u&&m?Array.from(r.e74).join(","):"*",(e=>U(e,!1)))})),H=(0,O.Z)((()=>{const e=new File([(0,gt.aZ)()],r.Wpe,{type:"text/plain"});Z([e])})),_=(0,o.Ye)((()=>h?Object.values(h).filter((e=>!!p&&(!("bots"!==p||e.id!==t||!e.peerTypes.includes("self"))||e.peerTypes.includes(p)))):void 0),[h,t,p]),Y=(0,B.Z)();if(a)return o.ZP.createElement("div",{className:"AttachMenu"},o.ZP.createElement(lt.Z,{id:"attach-menu-button",className:b?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:F,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0},o.ZP.createElement("i",{className:"icon icon-attach"})),o.ZP.createElement(tt.Z,{id:"attach-menu-controls",isOpen:L,autoClose:!0,positionX:"right",positionY:"bottom",onClose:S,className:"AttachMenu--menu fluid",onCloseAnimationEnd:S,onMouseEnter:s.$b?void 0:N,onMouseLeave:s.$b?void 0:I,noCloseOnBackdrop:!s.$b,ariaLabelledBy:"attach-menu-button"},!i&&o.ZP.createElement(et.Z,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),i&&o.ZP.createElement(o.ZP.Fragment,null,x&&o.ZP.createElement(et.Z,{icon:"photo",onClick:$},Y(k?"AttachmentMenu.PhotoOrVideo":l?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")),(u||m)&&o.ZP.createElement(et.Z,{icon:"document",onClick:j},Y(!u&&m?"InputAttach.Popover.Music":"AttachDocument")),u&&y&&o.ZP.createElement(et.Z,{icon:"bug",onClick:H},Y("DebugSendLogs"))),c&&o.ZP.createElement(et.Z,{icon:"poll",onClick:P},Y("Poll")),i&&!g&&_?.map((e=>o.ZP.createElement(Ct,{bot:e,chatId:t,threadId:n,theme:E,onMenuOpened:A,onMenuClosed:R})))))})),St=(0,o.X$)((0,i.c$)(((e,t)=>{let{messageId:n}=t;const{chatId:o}=(0,l.Btg)(e)||{};return o?{message:(0,l.hjO)(e,o,n)}:{}}))((e=>{let{isOpen:t,message:n,onClose:a}=e;const{clickBotInlineButton:r}=(0,i.Sv)(),[c,l]=(0,Zt.Z)(t,a),{isKeyboardSingleUse:d}=n||{};if(n&&n.keyboardButtons)return o.ZP.createElement(tt.Z,{isOpen:t,autoClose:d,positionX:"right",positionY:"bottom",onClose:a,className:"BotKeyboardMenu",onCloseAnimationEnd:a,onMouseEnter:s.$b?void 0:c,onMouseLeave:s.$b?void 0:l,noCompact:!0},o.ZP.createElement("div",{className:"content"},n.keyboardButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(Je.Z,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>r({messageId:n.id,button:e})},e.text))))))))}))),Nt=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"BotCommandMenu",!t);return n?o.ZP.createElement(n,e):void 0};var It=n(93219);const Mt=e=>{const{isOpen:t}=e,n=(0,$e.Z)(Ue.gl.Extra,"StickerTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var kt=n(19830),xt=n(67146),Tt=n(472),At=n(48198),Ot=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e}(Ot||{});const Rt="wonderful-voice-message.ogg",Dt={emoticon:"❤"},Lt=(0,o.X$)((0,i.c$)(((e,t)=>{var n;let{chatId:o,threadId:a,storyId:i,messageListType:s,isMobile:c,type:u}=t;const m=(0,l.Z1J)(e,o),h=o!==r.FVh?(0,l.kBx)(e,o):void 0,p=Boolean(h),g=(0,l.FM1)(e,o),Z=(0,d.YC)(o),v=p?(0,l.ccz)(e,h.id):void 0,f=Z?void 0:(0,l.x67)(e,o),E=(p||!Z)&&(0,l.FTG)(e,o,a),y=(0,l.qyA)(e,o,a),{language:b,shouldSuggestStickers:C,shouldSuggestCustomEmoji:w,shouldUpdateStickerSetOrder:S}=e.settings.byKey,N=e.emojiKeywords[r.pRL],I=b!==r.pRL?e.emojiKeywords[b]:void 0,M=E?E.id:void 0,k=M?(0,l.hjO)(e,o,M):void 0,{currentUserId:x}=e,T=f?f?.sendAsId||x:void 0,A=m?.sendAsPeerIds&&T&&(m.sendAsPeerIds.some((e=>e.id===T))?T:m?.adminRights?.anonymous?m?.id:void 0),O=A?(0,l.dyD)(e,A):void 0,R=!O&&A?(0,l.Z1J)(e,A):void 0,D=(0,l.uHr)(e,o),L=(0,l.nAc)(e,o),F=(0,l.jUK)(e),B=Boolean(F.storyViewer.storyId),U=(0,l.Btg)(e),$=o===U?.chatId&&a===U?.threadId&&s===U?.type&&!B,j=(0,l.dyD)(e,o),H=null===(n=j&&!(0,l.ccz)(e,j.id)?.noVoiceMessages)||void 0===n||n,_=f?.slowMode,Y=(0,l.wVz)(e),z="scheduled"===s?(0,l.hI0)(e,o):(0,l.saH)(e,o,a),V=(0,l.Yyv)(e,o,a),X=i&&(0,l.o9F)(e,o,i),q=X&&"sentReaction"in X?X.sentReaction:void 0;return{availableReactions:"story"===u?e.availableReactions:void 0,topReactions:"story"===u?e.topReactions:void 0,isOnActiveTab:!F.isBlurred,editingMessage:(0,l.kKD)(e,o,a,s),replyingToId:V,draft:(0,l.Mst)(e,o,a),chat:m,isChatWithBot:p,isChatWithSelf:g,isForCurrentMessageList:$,canScheduleUntilOnline:(0,l.Eh5)(e,o),isChannel:m?(0,d.eA)(m):void 0,isRightColumnShown:(0,l.Jf5)(e,c),isSelectModeActive:(0,l.CAb)(e),withScheduledButton:"thread"===s&&Boolean(y?.length),shouldSchedule:"scheduled"===s,botKeyboardMessageId:M,botKeyboardPlaceholder:k?.keyboardPlaceholder,isForwarding:o===F.forwardMessages.toChatId,pollModal:F.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,groupChatMembers:f?.members,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:x,contentToBeScheduled:F.contentToBeScheduled,shouldSuggestStickers:C,shouldSuggestCustomEmoji:w,shouldUpdateStickerSetOrder:S,recentEmojis:e.recentEmojis,baseEmojiKeywords:N?.keywords,emojiKeywords:I?.keywords,inlineBots:F.inlineBots.byUsername,isInlineBotLoading:F.inlineBots.isLoading,chatBotCommands:f?.botCommands,botCommands:v?v.botInfo?.commands||!1:void 0,botMenuButton:v?.botInfo?.menuButton,sendAsUser:O,sendAsChat:R,sendAsId:A,editingDraft:z,requestedDraftText:D,requestedDraftFiles:L,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,l.taM)(e,o),theme:(0,l.Puy)(e),fileSizeLimit:(0,P.M)(e,"uploadMaxFileparts")*r.pJM,captionLimit:(0,P.M)(e,"captionLength"),isCurrentUserPremium:Y,canSendVoiceByPrivacy:H,attachmentSettings:e.attachmentSettings,slowMode:_,currentMessageList:U,isReactionPickerOpen:(0,l.Io8)(e),canBuyPremium:!Y&&!(0,l.oe5)(e),canPlayAnimatedEmojis:(0,l.W9H)(e),shouldCollectDebugLogs:e.settings.byKey.shouldCollectDebugLogs,sentStoryReaction:q,stealthMode:e.stories.stealthMode}}))((e=>{let{type:t,isOnActiveTab:n,dropAreaState:l,shouldSchedule:P,canScheduleUntilOnline:w,isReady:S,isMobile:N,onDropHide:k,onFocus:x,onBlur:W,editingMessage:G,chatId:K,threadId:J,storyId:Q,currentMessageList:ue,messageListType:Se,draft:Ne,chat:Ie,isForCurrentMessageList:Me,isCurrentUserPremium:ke,canSendVoiceByPrivacy:xe,isChatWithBot:Te,isChatWithSelf:Ae,isChannel:Oe,fileSizeLimit:Re,isRightColumnShown:De,isSelectModeActive:Le,isReactionPickerOpen:Ue,isForwarding:$e,pollModal:Ge,botKeyboardMessageId:Ke,botKeyboardPlaceholder:Qe,inputPlaceholder:et,withScheduledButton:tt,stickersForEmoji:nt,customEmojiForEmoji:at,groupChatMembers:it,topInlineBotIds:rt,currentUserId:pt,captionLimit:gt,contentToBeScheduled:Zt,shouldSuggestStickers:vt,shouldSuggestCustomEmoji:ft,baseEmojiKeywords:Pt,emojiKeywords:Et,recentEmojis:yt,inlineBots:bt,isInlineBotLoading:Ct,botCommands:Lt,chatBotCommands:Ft,sendAsUser:Bt,sendAsChat:Ut,sendAsId:$t,editingDraft:jt,replyingToId:Ht,requestedDraftText:_t,requestedDraftFiles:Yt,botMenuButton:zt,attachBots:Vt,attachMenuPeerType:Xt,attachmentSettings:qt,theme:Wt,slowMode:Gt,shouldUpdateStickerSetOrder:Kt,editableInputCssSelector:Jt,editableInputId:Qt,inputId:en,className:tn,availableReactions:nn,topReactions:on,canBuyPremium:an,canPlayAnimatedEmojis:rn,shouldCollectDebugLogs:sn,sentStoryReaction:cn,stealthMode:ln,onForward:dn}=e;const{sendMessage:un,clearDraft:mn,showDialog:hn,forwardMessages:pn,openPollModal:gn,closePollModal:Zn,loadScheduledHistory:vn,openChat:fn,addRecentEmoji:Pn,sendInlineBotResult:En,loadSendAs:yn,resetOpenChatWithDraft:bn,callAttachBot:Cn,addRecentCustomEmoji:wn,showNotification:Sn,showAllowedMessageTypesNotification:Nn,openStoryReactionPicker:In,closeReactionPicker:Mn,sendStoryReaction:kn}=(0,i.Sv)(),xn=(0,B.Z)(),Tn=(0,o.sO)(null),An=(0,o.sO)(null),[On,Rn]=(0,R.Z)(""),[Dn,Ln]=(0,o.eJ)(!1),Fn=(0,H.Z)(Jt),Bn=(0,o.sO)(),Un=(0,L.Z)(l),{width:$n}=v.Z.get(),jn="messageList"===t,Hn="story"===t,_n=jn?Ie?.sendAsPeerIds:void 0,Yn=_n&&(_n.length>1||!_n.some((e=>e.id===pt))),[zn,Vn,Xn]=(0,D.Z)(),qn=(0,U.Z)(K,J),[Wn,Gn,Kn]=(0,D.Z)(),[Jn,Qn,eo]=(0,D.Z)(),to=!(!cn||!("emoticon"in cn))&&cn.emoticon===Dt.emoticon;(0,o.d4)(E.AU,[On]);const no=(0,o.sO)(0),[oo,ao]=(0,X.Z)(jn&&w,Xn);(0,V.Z)((()=>{Ln(!0)}),430),(0,o.d4)((()=>{jn||Mn()}),[jn,Q]),(0,o.d4)((()=>{Bn.current=void 0}),[K]),(0,o.d4)((()=>{K&&S&&!Hn&&vn({chatId:K})}),[S,K,J,Hn]),(0,o.d4)((()=>{K&&Ie&&!_n&&S&&(0,d.ZV)(Ie)&&yn({chatId:K})}),[Ie,K,S,yn,_n]);const io=(0,o.sO)(!1);(0,j.Z)((e=>{let[t,n]=e;io.current=Boolean(K===t&&_n&&!n)}),[K,_n]);const[ro,so]=(0,o.eJ)([]),co=Boolean(ro.length),[lo,uo]=(0,o.eJ)(void 0),{canSendStickers:mo,canSendGifs:ho,canAttachMedia:po,canAttachPolls:go,canAttachEmbedLinks:Zo,canSendVoices:vo,canSendPlainText:fo,canSendAudios:Po,canSendVideos:Eo,canSendPhotos:yo,canSendDocuments:bo}=(0,o.Ye)((()=>(0,d.H5)(Ie,Te,Hn)),[Ie,Te,Hn]),Co=!fo&&!G,wo=(0,O.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qt;if(t===Qt&&Co)return;const n=window.getSelection();let o;if(o=t===Qt?document.querySelector(Jt):document.getElementById(t),n.rangeCount){const a=n.getRangeAt(0);if((0,y.R)(a,t))return(0,p.tx)(e),void o.dispatchEvent(new Event("input",{bubbles:!0}))}Rn(`${On()}${e}`),(0,a.Yq)((()=>{(0,m.Z)(o)}))})),So=(0,O.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qt;const n=(0,A.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");wo(n,t)})),No=(0,O.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qt;const n=(0,b.z)(e);wo(n,t)})),Io=(0,O.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qt;wo((0,C.yR)(e),t)})),Mo=(0,O.Z)((()=>{lo&&(No(lo,Qt),uo(void 0))})),{shouldSuggestCompression:ko,shouldForceCompression:xo,shouldForceAsFile:To,handleAppendFiles:Ao,handleFileSelect:Oo,onCaptionUpdate:Ro,handleClearAttachments:Do,handleSetAttachments:Lo}=function(e){let{attachments:t,fileSizeLimit:n,setHtml:a,setAttachments:r,chatId:s,canSendAudios:l,canSendVideos:d,canSendPhotos:u,canSendDocuments:m,insertNextText:h}=e;const{openLimitReachedModal:p,showAllowedMessageTypesNotification:g}=(0,i.Sv)(),[Z,v]=(0,o.eJ)(!1),[f,P]=(0,o.eJ)(!1),[E,y]=(0,o.eJ)(void 0),b=(0,O.Z)((()=>{r(c.D),h()})),C=(0,O.Z)((e=>{const o="function"==typeof e?e(t):e;if(o.length)if(o.some((e=>{const t=q(e);return"audio"===t&&!l&&!m||"video"===t&&!d&&!m||"image"===t&&!u&&!m||"file"===t&&!m})))g({chatId:s});else if(o.some((e=>{let{size:t}=e;return t>n})))p({limit:"uploadMaxFileparts"});else{r(o);const e=o.some((e=>{const t=q(e);return"audio"===t&&!l||"video"===t&&!d||"image"===t&&!u}));v(Boolean(e&&m)),P(!m),y(void 0)}else b()}));return{shouldSuggestCompression:E,handleAppendFiles:(0,O.Z)((async(e,n)=>{C([...t,...await Promise.all(e.map((e=>I(e.name,e,{shouldSendAsSpoiler:n||void 0}))))])})),handleFileSelect:(0,O.Z)((async(e,t)=>{C(await Promise.all(e.map((e=>I(e.name,e))))),y(t)})),onCaptionUpdate:a,handleClearAttachments:b,handleSetAttachments:C,shouldForceCompression:f,shouldForceAsFile:Z}}({attachments:ro,setHtml:Rn,setAttachments:so,fileSizeLimit:Re,chatId:K,canSendAudios:Po,canSendVideos:Eo,canSendPhotos:yo,canSendDocuments:bo,insertNextText:Mo}),[Fo,Bo,Uo]=(0,D.Z)(),[$o,jo,Ho]=(0,D.Z)(),[_o,Yo,zo]=(0,D.Z)(),[Vo,Xo,qo]=(0,D.Z)(),[Wo,Go,Ko]=(0,D.Z)(),[Jo,Qo,ea]=(0,D.Z)(),{startRecordingVoice:ta,stopRecordingVoice:na,pauseRecordingVoice:oa,activeVoiceRecording:aa,currentRecordTime:ia,recordButtonRef:ra,startRecordTimeRef:sa}=(()=>{const e=(0,o.sO)(null),[t,n]=(0,o.eJ)(),i=(0,o.sO)(),[r,c]=(0,o.eJ)();(0,o.d4)((()=>{s.s$&&s.mh&&ee()}),[]);const l=(0,O.Z)((async()=>{try{const{stop:t,pause:o}=await te((t=>{e.current&&(i.current&&Date.now()%4==0&&(0,a.WM)((()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)})),c(Date.now()))}));i.current=Date.now(),c(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}})),d=(0,O.Z)((()=>{if(t){(0,a.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.pause()}catch(e){return void console.error(e)}}})),u=(0,O.Z)((()=>{if(t){n(void 0),i.current=void 0,c(void 0),(0,a.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.stop()}catch(e){return void console.error(e)}}}));return(0,o.d4)((()=>t?(0,ne.Z)(u):void 0),[t,u]),{startRecordingVoice:l,pauseRecordingVoice:d,stopRecordingVoice:u,activeVoiceRecording:t,currentRecordTime:r,recordButtonRef:e,startRecordTimeRef:i}})(),ca=Me&&!Hn;(0,$.Z)((()=>{qn({type:"recordAudio"})}),ca?aa&&r.o_S:void 0),(0,o.d4)((()=>{Me&&!Hn&&(aa||qn({type:"cancel"}))}),[aa,Me,Hn,qn]);const la=(0,Y.Y)(Boolean(G));(0,o.d4)((()=>{Me&&!Hn&&On()&&!la.current&&qn({type:"typing"})}),[On,la,Me,Hn,qn]);const da=Ie&&(0,d.Nl)(Ie),{isEmojiTooltipOpen:ua,closeEmojiTooltip:ma,filteredEmojis:ha,filteredCustomEmojis:pa,insertEmoji:ga}=(0,oe.Z)(Boolean(S&&n&&(Hn||Me)&&vt&&!co),On,Rn,void 0,yt,Pt,Et),{isCustomEmojiTooltipOpen:Za,closeCustomEmojiTooltip:va,insertCustomEmoji:fa}=(0,ae.Z)(Boolean(S&&n&&(Hn||Me)&&ft&&!co),On,Rn,Fn,Tn,at),{isStickerTooltipOpen:Pa,closeStickerTooltip:Ea}=function(e,t,n){const{loadStickersForEmoji:a,clearStickersForEmoji:c}=(0,i.Sv)(),[l,d,u]=(0,D.Z)(!1),m=(0,ce.Z)((()=>{const n=t();if(!e||!n||s.op&&n.length>8)return;if(!n.match(s.op?re.Z:r.t8f))return;const o=(0,se._)(n);return o&&(s.op&&1===(0,ie.Z)(o)||!s.op&&Boolean(n.match(le)))?s.op?o:o.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),h=(0,_.Z)((()=>Boolean(m())),[m]),p=Boolean(n?.length);return(0,o.d4)((()=>{if(!e||!h)return;const t=m();t?p||a({emoji:t}):c()}),[e,h,m,p,a,c]),(0,o.d4)(u,[u,t]),{isStickerTooltipOpen:Boolean(h&&p&&!l),closeStickerTooltip:d}}(Boolean(S&&n&&(Hn||Me)&&vt&&mo&&!co),On,nt),{isMentionTooltipOpen:ya,closeMentionTooltip:ba,insertMention:Ca,mentionFilteredUsers:wa}=(0,de.Z)(Boolean(jn&&S&&Me&&!co),On,Rn,Fn,Tn,it,rt,pt),{isOpen:Sa,botId:Na,isGallery:Ia,switchPm:Ma,switchWebview:ka,results:xa,closeTooltip:Ta,help:Aa,loadMore:Oa}=function(e,t,n,a){const{queryInlineBot:r,resetInlineBot:s,resetAllInlineBots:c}=(0,i.Sv)(),[l,d,u]=(0,D.Z)(!1),m=(0,me.CH)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return ge;const t=function(e){return Ze.innerHTML=e.replace(/<br>/g,"\n"),Ze.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),Ze.innerText}(e),n=t.match(he);return n?ve(n[1],n[2],""===n[2]&&!t.match(pe)):ge}(t):ge}),[n,e],300),{username:h,query:p,canShowHelp:g,usernameLowered:Z}=(0,_.Z)(m,[m,n],!0);(0,j.Z)((e=>{let[t]=e;t&&s({username:t})}),[h,s]),(0,o.d4)((()=>{Z&&r({chatId:t,username:Z,query:p})}),[t,p,r,Z]),(0,o.d4)(u,[u,n]);const{id:v,switchPm:f,switchWebview:P,offset:E,results:y,isGallery:b,help:C}=Z&&a?.[Z]||{},w=Boolean((y?.length||f)&&!l);(0,o.d4)((()=>{w||h||c()}),[w,c,h]);const S=(0,O.Z)((()=>{Z&&r({chatId:t,username:Z,query:p,offset:E})}));return{isOpen:w,botId:v,isGallery:b,switchPm:f,switchWebview:P,results:y,closeTooltip:d,help:g&&C?`@${h} ${C}`:void 0,loadMore:S}}(Boolean(jn&&S&&Me&&!co),K,On,bt),{isOpen:Ra,close:Da,filteredBotCommands:La}=function(e,t,n,a){const[i,r]=(0,o.eJ)(),[s,c,l]=(0,D.Z)(!1),d=(0,me.CH)((()=>{const n=t();return e&&n.startsWith("/")?(0,se._)(n).match(fe)?.[0].trim():void 0}),[t,e],300),u=(0,ce.Z)(d,[d,t],!0);return(0,o.d4)((()=>{const e=u(),t=n||a;if(!e||!t)return void r(void 0);const o=e.substring(1),i=t.filter((e=>!o||e.command.startsWith(o)));r(i?.length?i:void 0)}),[u,n,a]),(0,o.d4)(l,[l,t]),{isOpen:Boolean(i?.length&&!s),close:c,filteredBotCommands:i}}(Boolean(jn&&S&&Me&&(Lt&&Lt?.length||Ft?.length)),On,Lt,Ft);((e,t,n,c,l,d,u)=>{const{saveDraft:p,clearDraft:g,loadCustomEmojis:Z}=(0,i.Sv)(),v=Boolean(d),f=(0,O.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u||v)return;const a=c();var i,r,s,l;a?p({chatId:null!==(i=e.chatId)&&void 0!==i?i:t,threadId:null!==(r=e.threadId)&&void 0!==r?r:n,draft:(0,h.ZP)(a),shouldForce:o}):g({chatId:null!==(s=e.chatId)&&void 0!==s?s:t,threadId:null!==(l=e.threadId)&&void 0!==l?l:n,shouldForce:o})})),P=(0,Y.Y)(f),E=(0,be.Z)(r.r_R,!0,void 0,[t,n]);(0,z.Z)((o=>{let[i,c,h]=o;if(u)return;if(t===i&&n===c&&(!e&&h&&l(""),!e?.shouldForce))return;if(d||!e)return;l((0,b.z)(e));const p=e.entities?.map((e=>e.type===Pe.Vv.CustomEmoji&&e.documentId)).filter(Boolean)||[];p.length&&Z({ids:p}),s.$b||(0,a.Yq)((()=>{const e=document.querySelector(r.Edp);e&&(0,m.Z)(e,!0)}))}),[t,n,e,l,d,Z,u]),(0,o.d4)((()=>{if(!u)return()=>{v||P.current({chatId:t,threadId:n}),Ce=!0,(0,a.i$)((()=>{Ce=!1}))}}),[t,n,v,P,u]);const y=(0,Y.Y)(t),C=(0,Y.Y)(n);function w(){f(void 0,!0)}(0,o.d4)((()=>{if(u||Ce)return;if(!c())return void P.current();const e=y.current,t=C.current;E((()=>{y.current===e&&C.current===t&&P.current()}))}),[y,c,u,E,C,P]),(0,Ee.Z)(w),(0,ye.Z)(w)})(Ne,K,J,On,Rn,G,Hn);const Fa=(0,O.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||Rn(""),so(c.D),uo(void 0),ma(),va(),Ea(),ba(),N?setTimeout((()=>zo()),350):zo()})),[Ba,Ua,$a]=((e,t,n,s,c,l,u,p,g,Z,v)=>{const{editMessage:f,setEditingDraft:P,toggleMessageWebPage:E}=(0,i.Sv)(),[y,C]=(0,o.eJ)(!1);(0,z.Z)((e=>{let[o,i]=e;if(!n)return;if(v&&i!==v)return t(""),void C(!1);if(o?.id===n.id&&v===i)return;const s=!o&&Z?.text.length?Z:n.content.text,c=(0,b.z)(s);t(c),C(!0),(0,a.Yq)((()=>{const e=document.querySelector(r.Edp);e&&(0,m.Z)(e,!0)}))}),[n,v,Z,t]),(0,o.d4)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>we.has(e.type)));E({chatId:l,threadId:u,noWebPage:e})}),[l,u,n]),(0,o.d4)((()=>{if(n)return()=>{const t=(0,h.ZP)(e()),n=t.text.length?t:void 0;P({chatId:l,threadId:u,type:p,text:n})}}),[l,n,e,P,u,p]);const w=(0,me.iD)((()=>{if(!n)return!1;const t=(0,h.ZP)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>we.has(e.type)))&&!t.entities?.some((e=>we.has(e.type)))}),[n,e],300,!0),S=(0,ce.Z)(w,[w,e],!0);(0,z.Z)((e=>{let[t]=e;n&&t?.id===n.id&&S()&&E({chatId:l,threadId:u,noWebPage:!1})}),[n,l,e,u,S]);const N=(0,O.Z)((()=>{g&&(0,a.i$)((()=>{t((0,b.z)(g)),(0,a.Yq)((()=>{const e=document.querySelector(r.Edp);e&&(0,m.Z)(e,!0)}))}))})),I=(0,O.Z)((()=>{s(),N()})),M=(0,O.Z)((()=>{const{text:t,entities:o}=(0,h.ZP)(e());n&&(t||(0,d.u8)(n)?(f({messageList:{chatId:l,threadId:u,type:p},text:t,entities:o}),s(),N()):c())})),k=(0,O.Z)((()=>{if(!n)return;const t=(0,h.ZP)(e()),o=t.text.length?t:void 0;P({chatId:l,threadId:u,type:p,text:o})}));return(0,Ee.Z)(k),(0,ye.Z)(k),[M,I,y]})(On,Rn,G,Fa,Go,K,J,Se,Ne,jt,Ht),ja=(0,Y.Y)(Fa),Ha=(0,Y.Y)(na);(0,o.d4)((()=>()=>{Ha.current(),ja.current()}),[K,J,ja,Ha]);const _a=(0,O.Z)((()=>{const e=no.current;Sn(e?{message:xn("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:pt,shouldReplaceHistory:!0}},actionText:xn("Open")}:{message:xn("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:xn("PremiumMore")}),no.current=Number(!e)})),Ya=(0,_.Z)((()=>Wn||!dn||On()&&!co?G&&$a?Ot.Edit:!s.mh||aa||$e||On()&&!co?P?Ot.Schedule:Ot.Send:Ot.Record:Ot.Forward),[aa,G,On,co,$e,Wn,dn,$a,P]),za=!P,{isContextMenuOpen:Va,handleContextMenu:Xa,handleContextMenuClose:qa,handleContextMenuHide:Wa}=(0,F.Z)(ra,!(Ya===Ot.Send&&za)),{contextMenuPosition:Ga,handleContextMenu:Ka,handleBeforeContextMenu:Ja,handleContextMenuHide:Qa}=(0,F.Z)(An,!Hn);(0,o.d4)((()=>{Ue||Ga&&(In({storyUserId:K,storyId:Q,position:Ga}),Qa())}),[K,Qa,Ue,Q,Ga]),Fe(Me||Hn,No,Lo,uo,G,!ke&&!Ae,_a);const ei=(0,O.Z)((()=>{G&&Ua()})),ti=(0,O.Z)(((e,t)=>{const n=t?gt:4096;if(e?.length>n){const t=e.length-n;return hn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),ni=(0,O.Z)((()=>{if(Gt&&!da){const e=document.querySelector(Jt),t=(0,f.bp)(),n=Bn.current&&Math.floor(t-Bn.current),o=Gt.nextSendDate&&Gt.nextSendDate>t;if(n&&n<Gt.seconds||o){const a=o?Gt.nextSendDate-t:Gt.seconds-n;return hn({data:{message:xn("SlowModeHint",(0,u.k9)(a)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),oi=(0,O.Z)((e=>{let{attachments:t,sendCompressed:n=qt.shouldCompress,sendGrouped:o=qt.shouldSendGrouped,isSilent:i,scheduledAt:r}=e;if(!ue&&!Q)return;const{text:s,entities:c}=(0,h.ZP)(On());(s||t.length)&&ti(s,!0)&&ni()&&(un({messageList:ue,text:s,entities:c,scheduledAt:r,isSilent:i,shouldUpdateStickerSetOrder:Kt,attachments:M(t,n),shouldGroupMessages:o}),Bn.current=(0,f.bp)(),mn({chatId:K,localOnly:!0}),(0,a.i$)((()=>{Fa()})))})),ai=(0,O.Z)(((e,t,n,o)=>{oi({attachments:ro,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o})})),ii=(0,O.Z)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if(!ue&&!Q)return;let n=ro;if(aa){const e=await na();if(e){const{blob:t,duration:o,waveform:a}=e;n=[await I(Rt,t,{voice:{duration:o,waveform:a}})]}}const{text:o,entities:i}=(0,h.ZP)(On());if(n.length)return void oi({attachments:n});if(!o&&!$e)return;if(!ti(o))return;const r=document.querySelector(Jt);if(o){if(!ni())return;un({messageList:ue,text:o,entities:i,scheduledAt:t,isSilent:e,shouldUpdateStickerSetOrder:Kt})}$e&&pn({scheduledAt:t,isSilent:e}),Bn.current=(0,f.bp)(),mn({chatId:K,localOnly:!0}),s.cj&&r&&r===document.activeElement&&T(r),(0,a.i$)((()=>{Fa()}))})),ri=(0,O.Z)((()=>{"webApp"===zt?.type&&Cn({chatId:K,url:zt.url,threadId:J})})),si=(0,O.Z)((()=>{zo(),jo()})),ci=(0,O.Z)(((e,t,n)=>{if(e&&"queryId"in e){const{id:o,queryId:a,isSilent:i}=e;return void En({id:o,queryId:a,scheduledAt:t,isSilent:i,messageList:n})}const{isSilent:o,...a}=e||{};if(e&&0!==Object.keys(a).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:a=!1}=e;ai(n,a,o,t)}else un({...e,messageList:n,scheduledAt:t});else ii(Boolean(o),t)}));(0,z.Z)((e=>{let[t]=e;ue&&Zt&&Zt!==t&&oo((e=>{ci(Zt,e,ue)}))}),[Zt,ue,ci,oo]),(0,o.d4)((()=>{_t&&(Rn(_t),bn(),(0,a.Yq)((()=>{const e=document.getElementById(Qt);(0,m.Z)(e,!0)})))}),[Qt,_t,bn,Rn]),(0,o.d4)((()=>{Yt?.length&&(Oo(Yt),bn())}),[Oo,Yt,bn]);const li=(0,O.Z)(((e,t)=>{e.isFree||ke||Ae?Io(e,t):_a()})),di=(0,O.Z)((e=>{li(e,r.nYf)})),ui=(0,O.Z)(((e,t,n)=>{(ue||Q)&&(P||n?(Vn(),oo((n=>{Xn(),ci({gif:e,isSilent:t},n,ue),(0,a.i$)((()=>{Fa(!0)}))}))):(un({messageList:ue,gif:e,isSilent:t}),(0,a.i$)((()=>{Fa(!0)}))))})),mi=(0,O.Z)((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;(ue||Q)&&(e={...e,isPreloadedGlobally:!0},P||n?(Vn(),oo((n=>{Xn(),ci({sticker:e,isSilent:t},n,ue),(0,a.i$)((()=>{Fa(o)}))}))):(un({messageList:ue,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:Kt&&i}),(0,a.i$)((()=>{Fa(o)}))))})),hi=(0,O.Z)(((e,t,n)=>{if(!ue&&!Q)return;P||n?oo((n=>{ci({id:e.id,queryId:e.queryId,isSilent:t},n,ue)})):En({id:e.id,queryId:e.queryId,isSilent:t,messageList:ue});const o=document.querySelector(Jt);s.cj&&o&&o===document.activeElement&&T(o),mn({chatId:K,localOnly:!0}),(0,a.i$)((()=>{Fa()}))})),pi=(0,O.Z)((()=>{mn({chatId:K,localOnly:!0}),(0,a.i$)((()=>{Fa()}))})),gi=(0,O.Z)((e=>{ue&&(P?(oo((t=>{ci({poll:e},t,ue)})),Zn()):(un({messageList:ue,poll:e}),Zn()))})),Zi=(0,O.Z)((e=>{if(P)oo((t=>{ci({...e,isSilent:!0},t,ue)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1}=e;ai(t,n,!0)}else ii(!0)})),vi=(0,O.Z)((()=>{const e=document.querySelector(Jt);if(!N||e!==document.activeElement)return Ho(),zo(),void Xo();e?.blur(),setTimeout((()=>{Ho(),zo(),Xo()}),100)}));(0,o.d4)((()=>{Co&&Rn("")}),[Co,Rn,ro]);const fi=(0,O.Z)((e=>{So(e,r.nYf)})),Pi=(0,O.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qt;const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,y.R)(n,e))return void document.execCommand("delete",!1)}Rn(g(On()))})),Ei=(0,O.Z)((()=>{Pi(r.nYf)})),yi=(0,O.Z)((()=>{fn({id:K,threadId:J,type:"scheduled",noForumTopicPanel:!0})}));(0,o.d4)((()=>{De&&N&&zo()}),[De,zo,N]),(0,o.d4)((()=>{S&&(Le?Qo():setTimeout((()=>{ea()}),200))}),[Le,ea,Qo,S]);const bi=Te&&"webApp"===zt?.type&&!G,Ci=(0,_.Z)((()=>bi&&!On()&&!aa),[bi,On,aa]),[wi,Si]=(0,o.Ye)((()=>Gt?.nextSendDate?["SlowModeWait",Gt.nextSendDate]:ln?.activeUntil&&Hn?["StealthModeActiveHint",ln.activeUntil]:[]),[Hn,Gt?.nextSendDate,ln?.activeUntil]),Ni=Fo||_o||ua||Vo||ya||Sa||Wo||$o||Jn||Pa||Ra||Za||Ci||Va||Boolean(aa)||ro.length>0||Wn,Ii=(Ni||Ue)&&Hn&&!Jn&&!_o;(0,o.d4)((()=>{Ni?x?.():W?.()}),[Ni,W,x]);const{shouldRender:Mi,transitionClassNames:ki}=(0,Be.Z)(Ii),xi=!(Ya!==Ot.Record||po&&xe&&vo),Ti=(0,O.Z)((()=>{switch(Ya){case Ot.Forward:dn?.();break;case Ot.Send:ii();break;case Ot.Record:xi?xe?vo||Nn({chatId:K}):Sn({message:xn("VoiceMessagesRestrictedByPrivacy",Ie?.title)}):ta();break;case Ot.Edit:Ba();break;case Ot.Schedule:if(aa&&oa(),!ue)return;oo((e=>{ci({},e,ue)}))}})),Ai=(0,L.Z)(G,!0),Oi=G||Ai,Ri=new Date;Ri.setSeconds(0),Ri.setMilliseconds(0);const Di=new Date;Di.setFullYear(Di.getFullYear()+1);let Li="SendMessage";switch(Ya){case Ot.Forward:Li="Forward";break;case Ot.Edit:Li="Save edited message";break;case Ot.Record:Li=po?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Fi=(0,Z.Z)("Composer",!Le&&"shown",Jo&&"hover-disabled",Dn&&"mounted",tn),Bi=(0,O.Z)((e=>{let t,n;if("emoticon"in e)t=e.emoticon;else{const o=(0,i.Rd)().customEmojis.byId[e.documentId];if(!o)return;if(!o.isFree&&!ke&&!Ae)return void _a();const a=(0,h.ZP)((0,C.yR)(o));t=a.text,n=a.entities}un({text:t,entities:n,isReaction:!0}),Mn()})),Ui=(0,O.Z)((e=>{In({storyUserId:K,storyId:Q,position:e,sendAsMessage:!0})})),$i=(0,O.Z)((()=>{kn({userId:K,storyId:Q,reaction:cn?void 0:Dt})})),ji=(0,O.Z)((()=>{oo((e=>{ci({},e,ue)}))})),Hi=(0,O.Z)((()=>{Zi()})),_i=(0,O.Z)((()=>{ci({},r.t4X,ue)})),Yi=(0,O.Z)(((e,t)=>{oo((n=>{ci({sendCompressed:e,sendGrouped:t},n,ue)}))})),zi=(0,O.Z)(((e,t)=>{Zi({sendCompressed:e,sendGrouped:t})})),Vi=Ya===Ot.Edit?Ba:Ya===Ot.Schedule?ji:ii,Xi=Te&&"commands"===zt?.type&&!G&&!1!==Lt&&!aa;return o.ZP.createElement("div",{className:Fi},jn&&po&&S&&o.ZP.createElement(He,{isOpen:l!==je.t.None,withQuick:l===je.t.QuickFile||Un===je.t.QuickFile,onHide:k,onFileSelect:Oo}),Mi&&o.ZP.createElement(Tt.Z,{topReactions:on,allAvailableReactions:nn,onToggleReaction:Bi,isPrivate:!0,isReady:S,canBuyPremium:an,isCurrentUserPremium:ke,canPlayAnimatedEmojis:rn,onShowMore:Ui,className:ki}),o.ZP.createElement(_e,{chatId:K,threadId:J,canShowCustomSendMenu:za,attachments:ro,getHtml:On,isReady:S,shouldSuggestCompression:ko,shouldForceCompression:xo,shouldForceAsFile:To,isForCurrentMessageList:Me,isForMessage:jn,shouldSchedule:P,forceDarkTheme:Hn,onCaptionUpdate:Ro,onSendSilent:zi,onSend:ai,onSendScheduled:Yi,onFileAppend:Ao,onClear:Do,onAttachmentsUpdate:Lo,onCustomEmojiSelect:di,onRemoveSymbol:Ei,onEmojiSelect:fi}),o.ZP.createElement(Ye,{isOpen:Ge.isOpen,isQuiz:Ge.isQuiz,shouldBeAnonymous:Oe,onClear:Zn,onSend:gi}),Oi&&o.ZP.createElement(ze,{isOpen:Wo,isSchedule:"scheduled"===Se,onClose:Ko,message:Oi}),o.ZP.createElement(Ve,{isOpen:Vo,onClose:qo,chatId:K,selectedSendAsId:$t,sendAsPeerIds:_n,isCurrentUserPremium:ke}),o.ZP.createElement(Xe,{isOpen:ya,filteredUsers:wa,onInsertUserName:Ca,onClose:ba}),o.ZP.createElement(qe,{isOpen:Ra,withUsername:Boolean(Ft),botCommands:La,getHtml:On,onClick:pi,onClose:Da}),o.ZP.createElement("div",{className:(0,Z.Z)("composer-wrapper",jn&&"full-featured")},jn&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("svg",{className:"svg-appendix",width:"9",height:"20"},o.ZP.createElement("defs",null,o.ZP.createElement("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix"},o.ZP.createElement("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),o.ZP.createElement("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),o.ZP.createElement("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"}))),o.ZP.createElement("g",{fill:"none","fill-rule":"evenodd"},o.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#000",filter:"url(#composerAppendix)"}),o.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"}))),o.ZP.createElement(We,{isOpen:Sa,botId:Na,isGallery:Ia,inlineBotResults:xa,switchPm:Ma,switchWebview:ka,loadMore:Oa,isSavedMessages:Ae,canSendGifs:ho,isCurrentUserPremium:ke,onSelectResult:hi,onClose:Ta}),o.ZP.createElement(ot,{onClear:ei,shouldForceShowEditing:Boolean($a&&G)}),o.ZP.createElement(st,{chatId:K,threadId:J,getHtml:On,isDisabled:!Zo||co})),o.ZP.createElement("div",{className:"message-input-wrapper"},jn&&o.ZP.createElement(o.ZP.Fragment,null,bi&&o.ZP.createElement(ct,{isOpen:Ci,text:zt.text,isDisabled:Boolean(aa),onClick:ri}),Xi&&o.ZP.createElement(lt.Z,{className:(0,Z.Z)("bot-commands",$o&&"activated"),round:!0,disabled:void 0===Lt,color:"translucent",onActivate:si,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon icon-bot-commands-filled"})),Yn&&(Bt||Ut)&&o.ZP.createElement(Je.Z,{round:!0,color:"translucent",onClick:Vo?qo:vi,ariaLabel:xn("SendMessageAsTitle"),className:(0,Z.Z)("send-as-button",io.current&&"appear-animation")},o.ZP.createElement(dt.Z,{peer:Bt||Ut,size:"tiny"}))),(!Co||ho||mo)&&o.ZP.createElement(ut.Z,{chatId:K,threadId:J,isMobile:N,isReady:S,isSymbolMenuOpen:_o,openSymbolMenu:Yo,closeSymbolMenu:zo,canSendStickers:mo,canSendGifs:ho,isMessageComposer:jn,onGifSelect:ui,onStickerSelect:mi,onCustomEmojiSelect:li,onRemoveSymbol:Pi,onEmojiSelect:So,closeBotCommandMenu:Ho,closeSendAsMenu:qo,isSymbolMenuForced:zn,canSendPlainText:!Co,inputCssSelector:Jt,idPrefix:t,forceDarkTheme:Hn}),o.ZP.createElement(mt.Z,{ref:Tn,id:en,editableInputId:Qt,customEmojiPrefix:t,isStoryInput:Hn,chatId:K,canSendPlainText:!Co,threadId:J,isReady:S,isActive:!co,getHtml:On,placeholder:aa&&$n<=600?"":Co?xn("Chat.PlaceholderTextNotAllowed"):Qe||et||xn("Message"),timedPlaceholderDate:Si,timedPlaceholderLangKey:wi,forcedPlaceholder:Aa,canAutoFocus:S&&Me&&!co&&jn,noFocusInterception:co,shouldSuppressFocus:N&&_o,shouldSuppressTextFormatter:ua||ya||Sa,onUpdate:Rn,onSend:Vi,onSuppressedFocus:zo,onFocus:Gn,onBlur:Kn}),Hn&&!aa&&o.ZP.createElement(Je.Z,{round:!0,className:"story-reaction-button",color:"translucent",onClick:$i,onContextMenu:Ka,onMouseDown:Ja,ariaLabel:xn("AccDescrLike"),ref:An},cn&&!to&&o.ZP.createElement(At.Z,{reaction:cn,availableReactions:nn}),o.ZP.createElement("i",{className:(0,Z.Z)("icon",!cn&&"icon-heart-outline",to&&"icon-heart story-reaction-heart"),"aria-hidden":!0})),jn&&o.ZP.createElement(o.ZP.Fragment,null,Ct&&Boolean(Na)&&o.ZP.createElement(ht.Z,{color:"gray"}),tt&&o.ZP.createElement(Je.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:yi,ariaLabel:"Open scheduled messages"},o.ZP.createElement("i",{className:"icon icon-schedule"})),Boolean(Ke)&&!aa&&!G&&o.ZP.createElement(lt.Z,{className:Fo?"activated":"",round:!0,color:"translucent",onActivate:Bo,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon icon-bot-command"}))),aa&&Boolean(ia)&&o.ZP.createElement("span",{className:"recording-state"},(0,u.rM)(ia-sa.current)),o.ZP.createElement(wt,{chatId:K,threadId:J,isButtonVisible:!aa&&!G,canAttachMedia:po,canAttachPolls:go,canSendPhotos:yo,canSendVideos:Eo,canSendDocuments:bo,canSendAudios:Po,onFileSelect:Oo,onPollCreate:gn,isScheduled:P,attachBots:jn?Vt:void 0,peerType:Xt,shouldCollectDebugLogs:sn,theme:Wt,onMenuOpen:Qn,onMenuClose:eo}),jn&&Boolean(Ke)&&o.ZP.createElement(St,{messageId:Ke,isOpen:Fo,onClose:Uo}),jn&&Lt&&o.ZP.createElement(Nt,{isOpen:$o,botCommands:Lt,onClose:Ho}),o.ZP.createElement(It.Z,{key:`custom-emoji-tooltip-${Qt}`,chatId:K,isOpen:Za,onCustomEmojiSelect:fa,addRecentCustomEmoji:wn,onClose:va}),o.ZP.createElement(Mt,{key:`sticker-tooltip-${Qt}`,chatId:K,threadId:J,isOpen:Pa,onStickerSelect:mi,onClose:Ea}),o.ZP.createElement(kt.Z,{key:`emoji-tooltip-${Qt}`,isOpen:ua,emojis:ha,customEmojis:pa,addRecentEmoji:Pn,addRecentCustomEmoji:wn,onEmojiSelect:ga,onCustomEmojiSelect:ga,onClose:ma}))),aa&&o.ZP.createElement(Je.Z,{round:!0,color:"danger",className:"cancel",onClick:na,ariaLabel:"Cancel voice recording"},o.ZP.createElement("i",{className:"icon icon-delete"})),o.ZP.createElement(Je.Z,{ref:ra,round:!0,color:"secondary",className:(0,Z.Z)(Ya,"main-button",!S&&"not-ready",aa&&"recording"),disabled:xi,allowDisabledClick:!0,noFastClick:!0,ariaLabel:xn(Li),onClick:Ti,onContextMenu:Ya===Ot.Send&&za?Xa:void 0},o.ZP.createElement("i",{className:"icon icon-send"}),o.ZP.createElement("i",{className:"icon icon-microphone-alt"}),dn&&o.ZP.createElement("i",{className:"icon icon-forward"}),jn&&o.ZP.createElement("i",{className:"icon icon-schedule"}),jn&&o.ZP.createElement("i",{className:"icon icon-check"})),za&&o.ZP.createElement(xt.Z,{isOpen:Va,canSchedule:jn,canScheduleUntilOnline:w,onSendSilent:Ae?void 0:Hi,onSendSchedule:P?void 0:ji,onSendWhenOnline:_i,onClose:qa,onCloseAnimationEnd:Wa,isSavedMessages:Ae}),ao)})))},40329:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(7054),r=n(48670),s=n(59107),c=n(32340),l=n(70172),d=n(34563),u=n(231);const m=(0,o.X$)((0,a.c$)(((e,t)=>{let{chat:n}=t;const o=(0,r.YC)(n.id),a=(0,i.FM1)(e,n.id),s=o&&(0,i.dyD)(e,(0,r.zX)(n)),c=s&&(0,r.cS)(s)&&!n.isSupport,l=o&&!a&&!c,d=o?(0,r.Vl)((0,i.dyD)(e,(0,r.zX)(n))):void 0;return{isPrivateChat:o,isChatWithSelf:a,isBot:c,isChannel:(0,r.eA)(n),isBasicGroup:(0,r.G9)(n),isSuperGroup:(0,r.ZV)(n),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:d}}))((e=>{let{isOpen:t,chat:n,isChannel:i,isPrivateChat:m,isChatWithSelf:h,isBot:p,isBasicGroup:g,isSuperGroup:Z,currentUserId:v,canDeleteForAll:f,contactName:P,onClose:E,onCloseAnimationEnd:y}=e;const{leaveChannel:b,deleteHistory:C,deleteChannel:w,deleteChatUser:S,blockUser:N}=(0,a.Sv)(),I=(0,s.Z)(),M=(0,r.U)(I,n),k=(0,o.I4)((()=>{C({chatId:n.id,shouldDeleteForAll:!0}),E()}),[C,n.id,E]),x=(0,o.I4)((()=>{C({chatId:n.id,shouldDeleteForAll:!0}),N({userId:n.id}),E()}),[n.id,E]),T=(0,o.I4)((()=>{m?C({chatId:n.id,shouldDeleteForAll:!1}):g?(S({chatId:n.id,userId:v}),C({chatId:n.id,shouldDeleteForAll:!1})):!i&&!Z||n.isCreator?(i||Z)&&n.isCreator&&w({chatId:n.id}):b({chatId:n.id}),E()}),[m,g,i,Z,v,n.isCreator,n.id,E,C,S,b,w]),A=(0,o.I4)((()=>{i||Z?(b({chatId:n.id}),E()):T()}),[n.id,T,i,Z,b,E]);return o.ZP.createElement(d.Z,{isOpen:t,className:"DeleteChatModal",header:o.ZP.createElement("div",{className:"modal-header",dir:I.isRtl?"rtl":void 0},o.ZP.createElement(l.Z,{size:"tiny",peer:n,isSavedMessages:h}),o.ZP.createElement("h3",{className:"modal-title"},I(i&&!n.isCreator?"LeaveChannel":i&&n.isCreator?"ChannelDelete":g||Z?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:y},i&&n.isCreator?o.ZP.createElement("p",null,(0,c.Z)(I("ChatList.DeleteAndLeaveGroupConfirmation",M),["simple_markdown","emoji"])):i&&!n.isCreator||g||Z?o.ZP.createElement("p",null,(0,c.Z)(I("ChannelLeaveAlertWithName",M),["simple_markdown","emoji"])):o.ZP.createElement("p",null,(0,c.Z)(I("ChatList.DeleteChatConfirmation",P),["simple_markdown","emoji"])),o.ZP.createElement("div",{className:"dialog-buttons-column"},p&&o.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x},I("DeleteAndStop")),f&&o.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:k},P?(0,c.Z)(I("ChatList.DeleteForEveryone",P)):I("DeleteForAll")),!m&&n.isCreator&&o.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},I("DeleteForAll")),o.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:m?T:A},I(i&&!n.isCreator?"LeaveChannel":i&&n.isCreator?"Chat.Input.Delete":g||Z?"Group.LeaveGroup":f?"ChatList.DeleteForCurrentUser":"Delete")),o.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},I("Cancel"))))})))},82535:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(60748),a=n(33555),i=n(83716),r=n(15376),s=n(48670),c=n(25190),l=n(3657),d=n(6701),u=n(6202),m=n(60706),h=n(47002);const p=(0,o.X$)((e=>{let{message:t,observeIntersection:n,smaller:p,canAutoLoad:g,autoLoadFileMaxSizeMb:Z,uploadProgress:v,withDate:f,datetime:P,className:E,sender:y,isSelected:b,isSelectable:C,onCancelUpload:w,onMediaClick:S,onDateClick:N,isDownloading:I}=e;const M=(0,a.Sv)(),k=(0,o.sO)(null),x=t.content.document,{fileName:T,size:A,timestamp:O}=x,R=(0,r.K2)(x)||"",D=(0,l.Op)(k,n),[L,F]=(0,m.Z)();(0,o.d4)((()=>{D&&F()}),[D,F]);const[B,U]=(0,o.eJ)(g&&(!Z||A<=1048576*Z)),$=Boolean(I||B&&L),j=(0,s.Ti)(t,"download"),{loadProgress:H,mediaData:_}=(0,d.Z)(j,!$,(0,s.kG)(t,"download"),void 0,!0),Y=Boolean(_),{isUploading:z,isTransferring:V,transferProgress:X}=(0,s.Sc)(t,v||H,$&&!Y),q=(0,r.v6)(x),W=q?(0,s.DH)(t):void 0,G=q?x.previewBlobUrl:void 0,K=(0,u.Z)((0,s.Ti)(t,"pictogram"),!D),J=S&&Boolean(x.mediaType)&&(i.wGh.has(x.mimeType)||i.oGt.has(x.mimeType)),Q=(0,c.Z)((()=>{z?w&&w():I?M.cancelMessageMediaDownload({message:t}):V?U(!1):J?S():M.downloadMessageMedia({message:t})})),ee=(0,c.Z)((()=>{N(t.id,t.chatId)}));return o.ZP.createElement(h.Z,{ref:k,name:T,extension:R,size:A,timestamp:f?P||O:void 0,thumbnailDataUri:W,previewData:G||K,smaller:p,isTransferring:V,isUploading:z,transferProgress:X,className:E,sender:y,isSelectable:C,isSelected:b,actionIcon:J?(0,s.hC)(t)?"icon-play":"icon-eye":"icon-download",onClick:Q,onDateClick:N?ee:void 0})}))},78780:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(46752),i=n(32340),r=n(59107);const s=e=>{let{content:t,className:n}=e;const s=(0,r.Z)();return o.ZP.createElement("span",{className:(0,a.Z)("DotAnimation",n),dir:s.isRtl?"rtl":"auto"},(0,i.Z)(t),o.ZP.createElement("span",{className:"ellipsis"}))}},84441:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(48670),i=n(32340),r=n(74399),s=n(46752),c=n(3657),l=n(6202),d=n(2903),u=n(59107),m=n(39415),h=n(75368),p=n(78323),g=n(45370),Z=n(62230);const v=e=>{let{className:t,message:n,sender:v,title:f,customText:P,isProtected:E,noUserColors:y,hasContextMenu:b,chatTranslations:C,requestedChatTranslationLanguage:w,observeIntersectionForLoading:S,observeIntersectionForPlaying:N,onClick:I}=e;const M=(0,o.sO)(null),k=(0,c.Op)(M,S),x=(0,l.Z)(n&&(0,a.Ti)(n,"pictogram"),!k),T=(0,d.Z)(n),A=Boolean(n&&(0,a.Y5)(n)),O=Boolean(n&&(0,a.NE)(n)),R=n&&(0,a.cT)(n),{translatedText:D}=(0,h.Z)(C,n?.chatId,R?n?.id:void 0,w),L=(0,u.Z)(),F=v?(0,a.OU)(L,v):n?.forwardInfo?.hiddenUserName,{handleClick:B,handleMouseDown:U}=(0,m.m)(I);return o.ZP.createElement("div",{ref:M,className:(0,s.Z)("EmbeddedMessage",t,v&&!y&&`color-${(0,a.Rs)(v)}`),onClick:n&&B,onMouseDown:n&&U},T&&function(e,t,n,a,i){const{width:c,height:l}=(0,r.W7)(),d=t||e;return o.ZP.createElement("div",{className:(0,s.Z)("embedded-thumb",n&&"round")},!i&&o.ZP.createElement("img",{src:d,width:c,height:l,alt:"",className:"pictogram",draggable:!1}),o.ZP.createElement(Z.Z,{thumbDataUri:d,isVisible:Boolean(i),width:c,height:l}),a&&o.ZP.createElement("span",{className:"protector"}))}(T,x,A,E,O),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("p",{dir:"auto"},n?(0,a.FT)(n)?o.ZP.createElement(p.Z,{message:n,isEmbedded:!0,observeIntersectionForLoading:S,observeIntersectionForPlaying:N}):o.ZP.createElement(g.Z,{lang:L,message:n,noEmoji:Boolean(T),translatedText:D,observeIntersectionForLoading:S,observeIntersectionForPlaying:N}):P||" "),o.ZP.createElement("div",{className:"message-title",dir:"auto"},(0,i.Z)(F||f||" "))),b&&o.ZP.createElement("i",{className:"embedded-more icon icon-more"}))}},47002:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(601),i=n(46752),r=n(790),s=n(15376),c=n(74399),l=n(32340),d=n(31212),u=n(70692),m=n(59107),h=n(15866),p=n(42797),g=n(39196),Z=n(8337);const v=(0,o.X$)((e=>{let{ref:t,name:n,size:v,extension:f="",timestamp:P,sender:E,thumbnailDataUri:y,previewData:b,className:C,smaller:w,isTransferring:S,isUploading:N,isSelectable:I,isSelected:M,transferProgress:k,actionIcon:x,onClick:T,onDateClick:A}=e;const O=(0,m.Z)();let R=(0,o.sO)(null);t&&(R=t);const{isMobile:D}=(0,p.ZP)(),[L]=(0,o.eJ)(!b),F=Boolean(b),B=(0,h.Z)(y,F,D&&!a.vX),U=(0,u.Z)(!F),{shouldRender:$,transitionClassNames:j}=(0,d.Z)(S,void 0,!0),H=(0,s.Oh)(f),_=(0,s.yW)(v),Y=(0,o.Ye)((()=>S&&k?`${(0,s.yW)(v*k)} / ${_}`:_),[S,v,_,k]),{width:z,height:V}=(0,c.lE)(w),X=(0,i.Z)("File",C,w&&"smaller",T&&!N&&"interactive",M&&"file-is-selected");return o.ZP.createElement("div",{ref:R,className:X,dir:O.isRtl?"rtl":void 0},I&&o.ZP.createElement("div",{className:"message-select-control"},M&&o.ZP.createElement("i",{className:"icon icon-select"})),o.ZP.createElement("div",{className:"file-icon-container",onClick:N?void 0:T},y||b?o.ZP.createElement("div",{className:"file-preview media-inner"},o.ZP.createElement("img",{src:b,className:"full-media",width:z,height:V,alt:""}),L&&o.ZP.createElement("canvas",{ref:B,className:(0,i.Z)("thumbnail",U)})):o.ZP.createElement("div",{className:`file-icon ${H}`},f.length<=4&&o.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),$&&o.ZP.createElement("div",{className:(0,i.Z)("file-progress",H,j)},o.ZP.createElement(g.Z,{progress:k,size:w?"s":"m",onClick:N?T:void 0})),T&&o.ZP.createElement("i",{className:(0,i.Z)("action-icon","icon",x||"icon-download",$&&"hidden")})),o.ZP.createElement("div",{className:"file-info"},o.ZP.createElement("div",{className:"file-title",dir:"auto",title:n},(0,l.Z)(n)),o.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},o.ZP.createElement("span",null,Y),E&&o.ZP.createElement("span",{className:"file-sender"},(0,l.Z)(E)),!E&&Boolean(P)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"}),o.ZP.createElement(Z.Z,{onClick:A},(0,r.ZK)(O,1e3*P,!0))))),E&&Boolean(P)&&o.ZP.createElement(Z.Z,{onClick:A},(0,r.VX)(O,1e3*P)))}))},98799:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(91713),r=n(74399),s=n(48670),c=n(7054),l=n(46752),d=n(32340),u=n(59107),m=n(70172),h=n(68729),p=n(78780),g=n(2153),Z=n(2995),v=n(25190);const f=2.5*r.Gw,P=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:o}=t;const a=(0,c.Z1J)(e,n),i=o?(0,c.tZg)(e,n,o):void 0,r=a?(0,c.YK0)(e,a):void 0,s=Boolean((0,c.Zwk)(e,n)),l=o?a?.topics?.[o]:void 0;return{chat:a,threadInfo:i,onlineCount:r,topic:l,areMessagesLoaded:s,messagesCount:l&&(0,c.xxG)(e,n,o)}}))((e=>{let{typingStatus:t,className:n,avatarSize:r="medium",noAvatar:c,status:P,withDots:E,withMediaViewer:y,withUsername:b,withFullInfo:C,withUpdatingStatus:w,withChatType:S,threadInfo:N,noRtl:I,chat:M,onlineCount:k,areMessagesLoaded:x,topic:T,messagesCount:A,noStatusOrTyping:O,onClick:R}=e;const{loadFullChat:D,openMediaViewer:L,loadProfilePhotos:F}=(0,a.Sv)(),B=(0,u.Z)(),U=M&&(0,s.ZV)(M),$=Boolean(M?.isForum&&N&&T),{id:j,isMin:H,isRestricted:_}=M||{};(0,o.d4)((()=>{j&&!H&&(C&&D({chatId:j}),y&&F({profileId:j}))}),[j,H,C,D,F,U,y]);const Y=(0,v.Z)(((e,t)=>{M&&t&&(e.stopPropagation(),L({avatarOwnerId:M.id,mediaId:0,origin:"jumbo"===r?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),z=(0,o.Ye)((()=>M&&b&&(0,s.WS)(M)),[M,b]);if(M)return o.ZP.createElement("div",{className:(0,l.Z)("ChatInfo",n),dir:!I&&B.isRtl?"rtl":void 0,onClick:R},!c&&!$&&o.ZP.createElement(m.Z,{key:M.id,size:r,peer:M,onClick:y?Y:void 0}),$&&o.ZP.createElement(Z.Z,{topic:T,className:"topic-header-icon",size:f}),o.ZP.createElement("div",{className:"info"},T?o.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,d.Z)(T.title)):o.ZP.createElement(g.Z,{peer:M}),!O&&function(){if(P)return E?o.ZP.createElement(p.Z,{className:"status",content:P}):o.ZP.createElement("span",{className:"status",dir:"auto"},P);if(w&&!x&&!_)return o.ZP.createElement(p.Z,{className:"status",content:B("Updating")});if(!M)return;if(t)return o.ZP.createElement(h.Z,{typingStatus:t});if($)return o.ZP.createElement("span",{className:"status",dir:"auto"},A?B("messages",A,"i"):(0,d.Z)(M.title));if(S)return o.ZP.createElement("span",{className:"status",dir:"auto"},B((0,s.l6)(M)));const e=function(e,t){const n=e((0,s.l6)(t)),{membersCount:o}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":o?e("Channel"===n?"Subscribers":"Members",o,"i"):n}(B,M),n=k?`, ${B("OnlineCount",k,"i")}`:void 0;return o.ZP.createElement("span",{className:"status"},z&&o.ZP.createElement("span",{className:"handle"},z),o.ZP.createElement("span",{className:"group-status"},e),n&&o.ZP.createElement("span",{className:"online-status"},n))}()))})))},76844:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(790),i=n(59107),r=n(8018);const s=(0,o.X$)((e=>{let{message:t,outgoingStatus:n}=e;const s=(0,i.Z)();return o.ZP.createElement("div",{className:"LastMessageMeta"},n&&o.ZP.createElement(r.Z,{status:n}),o.ZP.createElement("span",{className:"time"},(0,a.VX)(s,1e3*t.date)))}))},13709:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(60748),a=n(790),i=n(3858),r=n(48670),s=n(46752),c=n(25190),l=n(6202),d=n(70692),u=n(60706),m=n(3657),h=n(62230);const p=(0,o.X$)((e=>{let{message:t,idPrefix:n="shared-media",isProtected:p,observeIntersection:g,onClick:Z}=e;const v=(0,o.sO)(null),f=(0,m.Op)(v,g),P=(0,r.DH)(t),E=(0,l.Z)((0,r.Ti)(t,"pictogram"),!f),y=(0,d.Z)(E),b=(0,r.b7)(t),C=(0,r.NE)(t),[w,,S]=(0,u.Z)(C),N=(0,c.Z)((()=>{S(),Z(t.id,t.chatId)}));return o.ZP.createElement("div",{ref:v,id:`${n}${(0,r.d0)(t.id)}`,className:"Media scroll-item",onClick:Z?N:void 0},o.ZP.createElement("img",{src:P,className:"media-miniature",alt:"",draggable:!p,decoding:"async",onContextMenu:p?i.Z:void 0}),o.ZP.createElement("img",{src:E,className:(0,s.Z)("full-media","media-miniature",y),alt:"",draggable:!p,decoding:"async",onContextMenu:p?i.Z:void 0}),C&&o.ZP.createElement(h.Z,{thumbDataUri:E||P,isVisible:w,className:"media-spoiler"}),b&&o.ZP.createElement("span",{className:"video-duration"},b.isGif?"GIF":(0,a.k9)(b.duration)),p&&o.ZP.createElement("span",{className:"protector"}))}))},62230:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(46752),i=n(25190),r=n(15866),s=n(31212);const c=(0,o.X$)((e=>{let{isVisible:t,withAnimation:n,thumbDataUri:c,className:l,width:d,height:u}=e;const m=(0,o.sO)(null),{shouldRender:h,transitionClassNames:p}=(0,s.Z)(t,void 0,!0,!n&&void 0,void 0,500),g=(0,r.Z)(c,!h,void 0,25,d,u),Z=(0,i.Z)((e=>{if(!m.current)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,a=n-t.width/2,i=o-t.height/2;m.current.setAttribute("style",`--click-shift-x: ${a}px; --click-shift-y: ${i}px`)}));if(h)return o.ZP.createElement("div",{className:(0,a.Z)("MbgQHglBDZLEAHDebnxc",p,l,n&&"zFmCa6knHOC8UhmcYHq8"),ref:m,onClick:n?Z:void 0},o.ZP.createElement("canvas",{ref:g,className:"oQmroREXWSylQXgjAdIB",width:d,height:u}),o.ZP.createElement("div",{className:"leAfUrALDfdpl4i8VEmv"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(2255),i=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(i||{});const r=(0,o.X$)((e=>{let{status:t}=e;return o.ZP.createElement("div",{className:"MessageOutgoingStatus"},o.ZP.createElement(a.Z,{name:"reveal",activeKey:i[t]},"failed"===t?o.ZP.createElement("div",{className:"MessageOutgoingStatus--failed"},o.ZP.createElement("i",{className:"icon icon-message-failed"})):o.ZP.createElement("i",{className:`icon icon-message-${t}`})))}))},47262:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(46752),i=n(31212),r=n(32340),s=n(59107);const c="Nothing found.",l=(0,o.X$)((e=>{let{text:t=c,description:n}=e;const l=(0,s.Z)(),{transitionClassNames:d}=(0,i.Z)(!0);return o.ZP.createElement("div",{className:(0,a.Z)("NothingFound",d,n&&"with-description")},t,n&&o.ZP.createElement("p",{className:"description"},(0,r.Z)(l(n),["br"])))}))},99364:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(57710),i=n(83716),r=n(601),s=n(46752),c=n(3858),l=n(59107),d=n(28183),u=n(42797),m=n(231);const h=(0,o.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:h,hint:p,placeholder:g="Password",submitLabel:Z="Next",description:v,shouldShowSubmit:f,shouldResetValue:P,shouldDisablePasswordManager:E=!1,noRipple:y=!1,clearError:b,onChangePasswordVisibility:C,onInputChange:w,onSubmit:S}=e;const N=(0,o.sO)(null),I=(0,l.Z)(),{isMobile:M}=(0,u.ZP)(),[k,x]=(0,o.eJ)(""),[T,A]=(0,o.eJ)(!1),O=M?550:400;return(0,o.d4)((()=>{P&&x("")}),[P]),(0,d.Z)((()=>{r.$b||N.current.focus()}),O),(0,o.d4)((()=>{h&&(0,a.WM)((()=>{N.current.focus(),N.current.select()}))}),[h]),o.ZP.createElement("form",{action:"",onSubmit:S?function(e){e.preventDefault(),t||T&&S(k)}:c.Z,autoComplete:"off"},o.ZP.createElement("div",{className:(0,s.Z)("input-group password-input",k&&"touched",h&&"error"),dir:I.isRtl?"rtl":void 0},E&&o.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),o.ZP.createElement("input",{ref:N,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:k||"",autoComplete:E?"one-time-code":"current-password",onChange:function(e){h&&b();const{target:t}=e;x(t.value),A(t.value.length>=i.loe),w&&w(t.value)},maxLength:256,dir:"auto"}),o.ZP.createElement("label",null,h||p||g),o.ZP.createElement("div",{className:"div-button toggle-password",onClick:function(){C(!n)},role:"button",tabIndex:0,title:"Toggle password visibility"},o.ZP.createElement("i",{className:(0,s.Z)("icon",n?"icon-eye":"icon-eye-closed")}))),v&&o.ZP.createElement("p",{className:"description"},v),S&&(T||f)&&o.ZP.createElement(m.Z,{type:"submit",ripple:!y,isLoading:t,disabled:!T},Z))}))},11820:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(57710),i=n(48670),r=n(46752),s=n(70735),c=n(25190),l=n(27407),d=n(59107),u=n(21273),m=n(14605),h=n(97687),p=n(31876),g=n(6058),Z=n(98799),v=n(49187),f=n(34288);const P=(0,o.X$)((e=>{let{itemIds:t,selectedIds:n,filterValue:P,filterPlaceholder:E,notFoundText:y,searchInputId:b,isLoading:C,noScrollRestore:w,isSearchable:S,isRoundCheckbox:N,lockedIds:I,forceShowSelf:M,onSelectedIdsChange:k,onFilterChange:x,onDisabledClick:T,onLoadMore:A}=e;const O=(0,o.sO)(null),R=n.length>10;(0,o.d4)((()=>{S&&setTimeout((()=>{(0,a.WM)((()=>{O.current.focus()}))}),500)}),[S]);const[D,L]=(0,o.Ye)((()=>{if(!I?.length)return[s.D,n];const e=n.filter((e=>!I.includes(e)));return[I,e]}),[n,I]),F=(0,o.Ye)((()=>new Set(I)),[I]),B=(0,o.Ye)((()=>t.sort(((e,t)=>{const n=F.has(e),o=F.has(t);return n&&!o?-1:!n&&o?1:0}))),[t,F]),U=(0,c.Z)((e=>{if(F.has(e))return void T?.(e);const t=n.slice();t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),k?.(t),x?.("")})),$=(0,c.Z)((e=>{const{value:t}=e.currentTarget;x?.(t)})),[j,H]=(0,l.Z)(A,B,Boolean(P)),_=(0,d.Z)();return o.ZP.createElement("div",{className:"Picker"},S&&o.ZP.createElement("div",{className:"picker-header custom-scroll",dir:_.isRtl?"rtl":void 0},D.map(((e,t)=>o.ZP.createElement(v.Z,{chatOrUserId:e,isMinimized:R&&t<n.length-5,forceShowSelf:M,onClick:U,clickArg:e}))),L.map(((e,t)=>o.ZP.createElement(v.Z,{chatOrUserId:e,isMinimized:R&&t+D.length<n.length-5,canClose:!0,onClick:U,clickArg:e}))),o.ZP.createElement(h.Z,{id:b,ref:O,value:P,onChange:$,placeholder:E||_("SelectChat")})),j?.length?o.ZP.createElement(u.Z,{className:"picker-list custom-scroll",items:j,onLoadMore:H,noScrollRestore:w},j.map((e=>{const t=()=>o.ZP.createElement(m.Z,{label:"",disabled:F.has(e),checked:n.includes(e),round:N});return o.ZP.createElement(p.Z,{key:e,className:(0,r.Z)("chat-item-clickable picker-list-item",N&&"chat-item"),disabled:F.has(e),allowDisabledClick:Boolean(T),onClick:()=>U(e),ripple:!0},N?void 0:t(),(0,i.YC)(e)?o.ZP.createElement(g.Z,{forceShowSelf:M,userId:e}):o.ZP.createElement(Z.Z,{chatId:e}),N?t():void 0)}))):C||!j||j.length?o.ZP.createElement(f.Z,null):o.ZP.createElement("p",{className:"no-results"},y||"Sorry, nothing found."))}))},49187:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(60748),a=n(33555),i=n(7054),r=n(48670),s=n(32340),c=n(46752),l=n(59107),d=n(70172);const u=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatOrUserId:n,forceShowSelf:o}=t;if(!n)return{};const a=n?(0,i.Z1J)(e,n):void 0,s=(0,r.YC)(n)?(0,i.dyD)(e,n):void 0;return{chat:a,user:s,isSavedMessages:!o&&s&&s.isSelf}}))((e=>{let{icon:t,title:n,isMinimized:a,canClose:i,clickArg:u,chat:m,user:h,className:p,isSavedMessages:g,onClick:Z}=e;const v=(0,l.Z)();let f,P;if(t&&n)f=o.ZP.createElement("div",{className:"item-icon"},o.ZP.createElement("i",{className:(0,c.Z)("icon",`icon-${t}`)})),P=n;else if(h||m){f=o.ZP.createElement(d.Z,{peer:h||m,size:"small",isSavedMessages:g});const e=!m||h&&!g?(0,r.Vl)(h):(0,r.U)(v,m,g);P=e?(0,s.Z)(e):void 0}const E=(0,c.Z)("PickerSelectedItem",p,m?.isForum&&"forum-avatar",a&&"minimized",i&&"closeable");return o.ZP.createElement("div",{className:E,onClick:()=>Z(u),title:a?P:void 0,dir:v.isRtl?"rtl":void 0},f,!a&&o.ZP.createElement("div",{className:"item-name",dir:"auto"},P),i&&o.ZP.createElement("div",{className:"item-remove"},o.ZP.createElement("i",{className:"icon icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(33555),i=n(91713),r=n(7054),s=n(48670),c=n(46752),l=n(32340),d=n(25190),u=n(59107),m=n(70172),h=n(68729),p=n(78780),g=n(2153),Z=n(68512);const v=(0,o.X$)((0,a.c$)(((e,t)=>{let{userId:n,forceShowSelf:o}=t;const a=(0,r.dyD)(e,n);return{user:a,userStatus:(0,r.ssc)(e,n),isSavedMessages:!o&&a&&a.isSelf,areMessagesLoaded:Boolean((0,r.Zwk)(e,n))}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:r,statusIcon:v,withDots:f,withMediaViewer:P,withUsername:E,withStory:y,withFullInfo:b,withUpdatingStatus:C,emojiStatusSize:w,noStatusOrTyping:S,noEmojiStatus:N,noRtl:I,user:M,userStatus:k,isSavedMessages:x,areMessagesLoaded:T,adminMember:A,ripple:O,onEmojiStatusClick:R,storyViewerOrigin:D}=e;const{loadFullUser:L,openMediaViewer:F,loadProfilePhotos:B}=(0,a.Sv)(),U=(0,u.Z)(),{id:$}=M||{};(0,o.d4)((()=>{$&&(b&&L({userId:$}),P&&B({profileId:$}))}),[$,b,P]);const j=(0,d.Z)(((e,t)=>{M&&t&&(e.stopPropagation(),F({avatarOwnerId:M.id,mediaId:0,origin:"jumbo"===n?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),H=(0,o.Ye)((()=>M&&E&&(0,s.WS)(M)),[M,E]);if(!M)return;const _=A?A.customTitle||U(A.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return o.ZP.createElement("div",{className:"ChatInfo",dir:!I&&U.isRtl?"rtl":void 0},o.ZP.createElement(m.Z,{key:M.id,size:n,peer:M,isSavedMessages:x,withStory:y,storyViewerOrigin:D,storyViewerMode:"single-user",onClick:P?j:void 0}),o.ZP.createElement("div",{className:"info"},_?o.ZP.createElement("div",{className:"info-name-title"},o.ZP.createElement(g.Z,{peer:M,withEmojiStatus:!N,emojiStatusSize:w,isSavedMessages:x,onEmojiStatusClick:R}),_&&o.ZP.createElement("span",{className:"custom-title"},_)):o.ZP.createElement(g.Z,{peer:M,withEmojiStatus:!N,emojiStatusSize:w,isSavedMessages:x,onEmojiStatusClick:R}),(r||!x&&!S)&&(r?f?o.ZP.createElement(p.Z,{className:"status",content:r}):o.ZP.createElement("span",{className:"status",dir:"auto"},v&&o.ZP.createElement("i",{className:`icon ${v} status-icon`}),(0,l.Z)(r)):C&&!T?o.ZP.createElement(p.Z,{className:"status",content:U("Updating")}):M?t?o.ZP.createElement(h.Z,{typingStatus:t}):o.ZP.createElement("span",{className:(0,c.Z)("status",(0,s.kM)(M,k)&&"online")},H&&o.ZP.createElement("span",{className:"handle"},H),o.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,s.Tq)(U,M,k))):void 0)),O&&o.ZP.createElement(Z.Z,null))})))},16568:(e,t,n)=>{n.d(t,{Z:()=>B});var o=n(60748),a=n(33555),i=n(91713),r=n(601),s=n(70735),c=n(7054),l=n(48670),d=n(64963),u=n(46752),m=n(32340),h=n(25190),p=n(6137),g=n(40647),Z=n(59107),v=n(87204),f=n(2153),P=n(2155),E=n(6202),y=n(60706),b=n(70692),C=n(15866),w=n(42797),S=n(49204),N=n(57080);const I=(0,o.X$)((e=>{let{chat:t,user:n,photo:a,isSavedMessages:i,canPlayVideo:s,onClick:c}=e;const d=(0,o.sO)(null),h=(0,Z.Z)(),{isMobile:p}=(0,w.ZP)(),g=n&&(0,l.NB)(n),v=t&&(0,l.pK)(t.id),f=n||t,I=f&&!i&&!g&&!v,{isVideo:M}=a||{},k=I&&(0,l.RT)(f,"normal"),x=(0,E.Z)(k),T=I&&a&&!M&&`photo${a.id}?size=c`,A=(0,E.Z)(T),O=I&&a&&M&&(0,l.Dk)(a),R=(0,E.Z)(O)||A,[D,L]=(0,y.Z)(),F=Boolean(R&&(!M||D)),B=(0,b.Z)(F),U=I&&!F&&!x&&a?.thumbnail?.dataUri,$=(0,C.Z)(a?.thumbnail?.dataUri,!U,p&&!r.vX),j=a||x||U;let H;if((0,o.d4)((()=>{d.current&&!s&&(d.current.currentTime=0)}),[s]),i)H=o.ZP.createElement("i",{className:"icon icon-avatar-saved-messages"});else if(g)H=o.ZP.createElement("i",{className:"icon icon-avatar-deleted-account"});else if(v)H=o.ZP.createElement("i",{className:"icon icon-reply-filled"});else if(j)H=o.ZP.createElement(o.ZP.Fragment,null,U?o.ZP.createElement("canvas",{ref:$,className:"thumb"}):o.ZP.createElement("img",{src:x,className:"thumb",alt:""}),a&&(M?o.ZP.createElement(N.Z,{canPlay:s,ref:d,src:R,className:(0,u.Z)("avatar-media",B),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:L}):o.ZP.createElement("img",{src:R,className:(0,u.Z)("avatar-media",B),alt:""})));else if(n){const e=(0,l.Js)(n);H=e?(0,P.Xv)(e,2):void 0}else if(t){const e=(0,l.U)(h,t);H=e&&(0,P.Xv)(e,(0,l.YC)(t.id)?2:1)}else H=o.ZP.createElement("div",{className:"spinner-wrapper"},o.ZP.createElement(S.Z,{color:"white"}));const _=(0,u.Z)("ProfilePhoto",`color-bg-${(0,l.Rs)(n||t)}`,i&&"saved-messages",g&&"deleted-account",v&&"replies-bot-account",!i&&!j&&"no-photo");return o.ZP.createElement("div",{className:_,onClick:j?c:void 0},"string"==typeof H?(0,m.Z)(H,["hq_emoji"]):H)}));var M=n(2255),k=n(2995),x=n(70172);const T="DwTvYuXwYiyH8P8HGyEw",A="a_azkhZzdtjRO5pWnNno",O="NVXGZpj7iFHkn7HaGsey",R="zPvRR0bFn0HFuXDjj1wU",D="YvztuUsksHhhNiXGWWbN",L="rcKy8wQruH_z84yRjAry";var F=n(70971);const B=(0,o.X$)((0,a.c$)(((e,t)=>{let{userId:n,forceShowSelf:o}=t;const{connectionState:a}=e,i=(0,c.dyD)(e,n),r=(0,l.YC)(n),s=(0,c.ssc)(e,n),d=(0,c.Z1J)(e,n),u=!o&&i&&i.isSelf,{mediaId:m,avatarOwnerId:h}=(0,c.jUK)(e).mediaViewer,p=d?.isForum,{threadId:g}=(0,c.Btg)(e)||{},Z=p&&g?d?.topics?.[g]:void 0,v=r?(0,c.ccz)(e,n):void 0,f=r?void 0:(0,c.x67)(e,n);return{connectionState:a,user:i,userStatus:s,chat:d,userPersonalPhoto:v?.personalPhoto,userProfilePhoto:v?.profilePhoto,userFallbackPhoto:v?.fallbackPhoto,chatProfilePhoto:f?.profilePhoto,isSavedMessages:u,mediaId:m,avatarOwnerId:h,...Z&&{topic:Z,messagesCount:(0,c.xxG)(e,n,g)}}}))((e=>{let{forceShowSelf:t,canPlayVideo:n,user:c,userStatus:P,chat:E,isSavedMessages:y,connectionState:b,mediaId:C,avatarOwnerId:w,topic:S,messagesCount:N,userPersonalPhoto:B,userProfilePhoto:U,userFallbackPhoto:$,chatProfilePhoto:j}=e;const{loadFullUser:H,openMediaViewer:_,openPremiumModal:Y}=(0,a.Sv)(),z=(0,Z.Z)(),{id:V}=c||{},{id:X}=E||{},q=c?.photos||E?.photos||s.D,W=(0,v.Z)(C),G=(0,v.Z)(w),K=(0,F.Y)(C),[J,Q]=(0,o.eJ)(!0),ee=J?z.isRtl?"slideRtl":"slide":"none",[te,ne]=(0,o.eJ)(0),oe=y||q.length<=1||0===te,ae=y||q.length<=1||te===q.length-1;(0,o.d4)((()=>{G&&void 0!==W&&void 0===C&&(Q(!1),ne(W))}),[C,W,G]),(0,o.d4)((()=>{Q(!1),ne(K.current||0)}),[K,q]),(0,o.d4)((()=>{te>q.length&&(Q(!1),ne(Math.max(0,q.length-1)))}),[te,q.length]),(0,o.d4)((()=>{"connectionStateReady"===b&&V&&!t&&H({userId:V})}),[V,H,b,t]),function(e,t){(0,o.d4)((()=>{e.slice(t,t+4).forEach((e=>{g.UV(`photo${e.id}?size=c`)||g.he(`photo${e.id}?size=c`,p.IU.BlobUrl)}))}),[t,e])}(q,te);const ie=(0,h.Z)((()=>{_({avatarOwnerId:V||X,mediaId:te,origin:t?i.bZ.SettingsAvatar:i.bZ.ProfileAvatar})})),re=(0,h.Z)((()=>{V&&Y({fromUserId:V})})),se=(0,h.Z)((()=>{oe||(Q(!0),ne(te-1))})),ce=(0,h.Z)((()=>{ae||(Q(!0),ne(te+1))}));var le,de;if((0,o.d4)((()=>{const e=document.querySelector(".YvztuUsksHhhNiXGWWbN");if(e)return(0,d.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:r.$b?(e,t)=>t===d.eM.Right?(se(),!0):t===d.eM.Left&&(ce(),!0):void 0})}),[ce,se]),c||E)return S?o.ZP.createElement("div",{className:"Dlmqly7y8H7bCtaGNFIO"},o.ZP.createElement(k.Z,{topic:S,size:120,className:"Bv321I_wzF0fdNw63dxB",letterClassName:"MwfYq2acbtWIp8pGf9kI",noLoopLimit:!0}),o.ZP.createElement("h3",{className:"eMDgnAzVXSNlBUAgdBPK",dir:z.isRtl?"rtl":void 0},(0,m.Z)(S.title)),o.ZP.createElement("p",{className:"YrvPEuAvDVR3BLU68aIN"},N?z("Chat.Title.Topic",N,"i"):z("lng_forum_no_messages"))):o.ZP.createElement("div",{className:(0,u.Z)("ProfileInfo",t&&"M4GWpBd7i7ViA2xNTvH4"),dir:z.isRtl?"rtl":void 0},o.ZP.createElement("div",{className:D},function(){if(!(y||!q||q.length<=1))return o.ZP.createElement("div",{className:"UXIlP1uQpXVG_DNB26iC"},q.map(((e,t)=>o.ZP.createElement("span",{className:(0,u.Z)("Ay_dhoiSuGWjH2hVOy7i",t===te&&"xWzV6TAYO756R70Pzfmb")}))))}(),!t&&B&&o.ZP.createElement("div",{className:(0,u.Z)(A,oe&&R)},o.ZP.createElement("div",{className:O},z(B.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto"))),t&&$&&o.ZP.createElement("div",{className:(0,u.Z)(A,(oe||ae)&&R)},o.ZP.createElement("div",{className:O,onClick:function(){oe&&(Q(!0),ne(q.length-1))}},!ae&&o.ZP.createElement(x.Z,{photo:$,className:"IG9hcS9__jiZjU59BA1U",size:"mini"}),z($.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto"))),o.ZP.createElement(M.Z,{activeKey:te,name:ee},ue),!oe&&o.ZP.createElement("button",{type:"button",dir:z.isRtl?"rtl":void 0,className:(0,u.Z)(L,"IrGNErqISNgGY687XP5I"),"aria-label":z("AccDescrPrevious"),onClick:se}),!ae&&o.ZP.createElement("button",{type:"button",dir:z.isRtl?"rtl":void 0,className:(0,u.Z)(L,"mERrfFjC7wKBhpVCjGgg"),"aria-label":z("Next"),onClick:ce})),o.ZP.createElement("div",{className:"uHKuP7J67YWxko9FiDo9",dir:z.isRtl?"rtl":"auto"},(c||E)&&o.ZP.createElement(f.Z,{peer:c||E,withEmojiStatus:!0,emojiStatusSize:24,isSavedMessages:y,onEmojiStatusClick:re,noLoopLimit:!0,canCopyTitle:!0}),!y&&(c?o.ZP.createElement("div",{className:(0,u.Z)(T,"status",(0,l.kM)(c,P)&&"online")},o.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,l.Tq)(z,c,P))):o.ZP.createElement("span",{className:(0,u.Z)(T,"status"),dir:"auto"},(0,l.eA)(E)?z("Subscribers",null!==(le=E.membersCount)&&void 0!==le?le:0,"i"):z("Members",null!==(de=E.membersCount)&&void 0!==de?de:0,"i")))));function ue(e){const t=(!y&&q.length>0?q[te]:void 0)||B||U||j||$;return o.ZP.createElement(I,{key:te,user:c,chat:E,photo:t,isSavedMessages:y,canPlayVideo:Boolean(e&&n),onClick:ie})}})))},48198:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(60748),a=n(6137),i=n(46752),r=n(48670),s=n(70692),c=n(6202),l=n(96459),d=n(69123);const u=(0,o.X$)((e=>{let{reaction:t,availableReactions:n,className:u,size:m,withIconHeart:h,observeIntersection:p}=e;const g="documentId"in t,Z=(0,o.Ye)((()=>n?.find((e=>(0,r.Hl)(e.reaction,t)))),[n,t]),v=Z?.staticIcon?.id,f=(0,c.Z)(`document${v}`,!v,a.IU.BlobUrl),P=(0,s.Z)(f),E="emoticon"in t&&"🦄"===t.emoticon,y=h&&"emoticon"in t&&"❤"===t.emoticon;return g?o.ZP.createElement(l.Z,{documentId:t.documentId,className:(0,i.Z)("ReactionStaticEmoji",u),size:m,observeIntersectionForPlaying:p}):y?o.ZP.createElement("i",{className:"ReactionStaticEmoji icon icon-heart",style:`font-size: ${m}px; width: ${m}px`}):o.ZP.createElement("img",{className:(0,i.Z)("ReactionStaticEmoji",E&&"with-unicorn-fix",P,u),style:m?`width: ${m}px; height: ${m}px`:void 0,src:f||d,alt:Z?.title})}))},66534:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(46752),r=n(25190),s=n(59107),c=n(34563),l=n(231),d=n(14434),u=n(97687);const m=(0,o.X$)((e=>{let{isOpen:t,subject:n="messages",chatId:m,userId:h,photo:p,messageIds:g,storyId:Z,onClose:v,onCloseAnimationEnd:f}=e;const{reportMessages:P,reportPeer:E,reportProfilePhoto:y,reportStory:b,exitMessageSelectMode:C}=(0,a.Sv)(),[w,S]=(0,o.eJ)("spam"),[N,I]=(0,o.eJ)(""),M=(0,r.Z)((()=>{switch(n){case"messages":P({messageIds:g,reason:w,description:N}),C();break;case"peer":E({chatId:m,reason:w,description:N});break;case"media":y({chatId:m,photo:p,reason:w,description:N});break;case"story":b({userId:h,storyId:Z,reason:w,description:N})}v()})),k=(0,r.Z)((e=>{S(e)})),x=(0,r.Z)((e=>{I(e.target.value)})),T=(0,s.Z)(),A=(0,o.Ye)((()=>[{value:"spam",label:T("lng_report_reason_spam")},{value:"violence",label:T("lng_report_reason_violence")},{value:"pornography",label:T("lng_report_reason_pornography")},{value:"childAbuse",label:T("lng_report_reason_child_abuse")},{value:"copyright",label:T("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:T("lng_report_reason_other")}]),[T]);if("messages"===n&&!g||"peer"===n&&!m||"media"===n&&(!m||!p)||"story"===n&&(!Z||!h))return;const O=T("messages"===n?"lng_report_message_title":"ReportPeer.Report");return o.ZP.createElement(c.Z,{isOpen:t,onClose:v,onEnter:t?M:void 0,onCloseAnimationEnd:f,className:(0,i.Z)("narrow","story"===n&&"component-theme-dark"),title:O},o.ZP.createElement(d.Z,{name:"report-message",options:A,onChange:k,selected:w}),o.ZP.createElement(u.Z,{label:T("lng_report_reason_description"),value:N,onChange:x}),o.ZP.createElement("div",{className:"dialog-buttons"},o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},T("lng_report_button")),o.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:v},T("Cancel"))))}))},2995:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(96459),i=n(58987);const r=(0,o.X$)((e=>{let{topic:t,className:n,letterClassName:r,size:s,noLoopLimit:c,observeIntersection:l,onClick:d}=e;return t.iconEmojiId&&"0"!==t.iconEmojiId?o.ZP.createElement(a.Z,{documentId:t.iconEmojiId,className:n,size:s,observeIntersectionForPlaying:l,loopLimit:c?void 0:2,onClick:d}):o.ZP.createElement(i.Z,{iconColor:t.iconColor,title:t.title,topicId:t.id,className:n,letterClassName:r,onClick:d})}))},68729:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(33555),i=n(7054),r=n(48670),s=n(32340),c=n(59107),l=n(78780);const d=(0,o.X$)((0,a.c$)(((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,i.dyD)(e,n.userId)}:{}}))((e=>{let{typingStatus:t,typingUser:n}=e;const a=(0,c.Z)(),i=n&&!n.isSelf&&(0,r.Vl)(n),d=a(t.action).replace("{user}","").replace("{emoji}",t.emoji||"").trim();return o.ZP.createElement("p",{className:"typing-status",dir:a.isRtl?"rtl":"auto"},i&&o.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,s.Z)(i)),o.ZP.createElement(l.Z,{content:d}))})))},45418:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(60748),a=n(48670),i=n(46752),r=n(48035),s=n(32340),c=n(790),l=n(996),d=n(25190),u=n(59107),m=n(13709),h=n(8337),p=n(10088);const g=(0,o.X$)((e=>{let{message:t,senderTitle:n,isProtected:g,observeIntersection:Z,onMessageClick:v}=e;const f=(0,u.Z)();let P=(0,a.s1)(t);if(!P){const e=(0,a.T7)(t);if(e){const{url:n,domain:o}=e;P={siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,a.UD)(t)!==n?(0,l.e)(f,t,void 0,void 0,170):void 0}}}const E=(0,d.Z)((()=>{v(t.id,t.chatId)}));if(!P)return;const{siteName:y,url:b,displayUrl:C,title:w,description:S,formattedDescription:N,photo:I,video:M}=P,k=!n&&S&&(0,r.Z)(S,170),x=(0,i.Z)("WebLink scroll-item",!I&&!M&&"without-media"),T=b.replace("mailto:","")||C;return o.ZP.createElement("div",{className:x,"data-initial":(y||C)[0],dir:f.isRtl?"rtl":void 0},I&&o.ZP.createElement(m.Z,{message:t,isProtected:g,observeIntersection:Z}),o.ZP.createElement("div",{className:"content"},o.ZP.createElement(h.Z,{isRtl:f.isRtl,className:"site-title",onClick:E},(0,s.Z)(w||y||C)),(k||N)&&o.ZP.createElement(h.Z,{isRtl:f.isRtl,className:"site-description",onClick:E},N||k&&(0,s.Z)(k)),o.ZP.createElement(p.Z,{url:b,className:"site-name",text:T,isRtl:f.isRtl}),n&&o.ZP.createElement("div",{className:"sender-name"},(0,s.Z)(n))),n&&o.ZP.createElement("div",{className:"message-date"},o.ZP.createElement(h.Z,{className:"date",onClick:E,isRtl:f.isRtl},(0,c.VX)(f,1e3*t.date))))}))},996:(e,t,n)=>{n.d(t,{X:()=>c,e:()=>l});var o=n(6137),a=n(48670),i=n(32340),r=n(20230),s=n(48035);function c(e){let{message:t,highlight:n,emojiSize:o,isSimple:i,truncateLength:c,isProtected:l,forcePlayback:d,shouldRenderAsHtml:u}=e;const{text:m,entities:h}=t.content.text||{};if(!m){const e=(0,a.UD)(t);return e?[(0,s.Z)(e,c)]:void 0}return(0,r.H)({text:(0,s.Z)(m,c),entities:h,highlight:n,emojiSize:o,shouldRenderAsHtml:u,messageId:t.id,isSimple:i,isProtected:l,forcePlayback:d})}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.lN;const{entities:d}=t.content.text||{},u=d?.some((e=>e.type===o.Vv.Spoiler)),m=d?.some((e=>e.type===o.Vv.CustomEmoji));if(!u&&!m){const o=(0,s.Z)((0,a.MK)(e,t,n),l);return r?(0,i.Z)(o,["emoji","highlight"],{highlight:r}):(0,i.Z)(o)}const h=!n&&(0,a.Eb)(t),p=h?`${h} `:"",g=c({message:t,highlight:r,isSimple:!0,truncateLength:l}),Z=(0,a.Kk)(e,t,g);return[...(0,i.Z)(p),...Array.isArray(Z)?Z:[Z]].filter(Boolean)}},50742:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"ChatFolderModal",!t);return n?o.ZP.createElement(n,e):void 0}},79347:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"MuteChatModal",!t);return n?o.ZP.createElement(n,e):void 0}},77699:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(19369),i=n(2155),r=n(46752),s=n(86203),c=n(40126),l=n(34076);const d=(0,o.X$)((e=>{let{topic:t,chat:n,isPinned:d,isMuted:u,shouldShowOnlyMostImportant:m,wasTopicOpened:h,forceHidden:p}=e;const{unreadMentionsCount:g=0,unreadReactionsCount:Z=0}=n.isForum?{}:n,v=!d&&t&&!h,f=n.isForum&&!t,P=(0,o.Ye)((()=>f&&n?.topics?Object.values(n.topics).filter((e=>{let{unreadCount:t}=e;return t})):void 0),[n,f]),E=(0,o.Ye)((()=>f?u&&P?.filter((e=>!1===e.isMuted)).length||P?.length:(t||n).unreadCount),[n,t,P,f,u]),y=(0,o.Ye)((()=>{const e=n.topics&&Object.values(n.topics).some((e=>e.isMuted&&e.unreadCount));return u||n.topics&&!e}),[n,u]),b=!t&&n.hasUnreadMark,C=!(0,s.Z)((()=>(0,a.$Z)(p)?p():p),[p])&&Boolean(E||g||b||d||Z||v),w=Boolean(E||b),S=(0,r.Z)("ChatBadge",y&&"muted",!w&&d&&"pinned",w&&"unread");return o.ZP.createElement(c.Z,{isCustom:!0,className:"ChatBadge-transition",isOpen:C},function(){const e=Z&&o.ZP.createElement("div",{className:(0,r.Z)("ChatBadge reaction",y&&"muted")},o.ZP.createElement("i",{className:"icon icon-heart"})),t=g&&o.ZP.createElement("div",{className:"ChatBadge mention"},o.ZP.createElement("i",{className:"icon icon-mention"})),n=v&&o.ZP.createElement("div",{className:(0,r.Z)("ChatBadge unopened",y&&"muted")}),a=b||E?o.ZP.createElement("div",{className:S},!b&&o.ZP.createElement(l.Z,{text:(0,i.bi)(E)})):void 0,s=d&&!a&&!t&&!e&&o.ZP.createElement("div",{className:S},o.ZP.createElement("i",{className:"icon icon-pinned-chat"})),c=[n,e,t,a,s].filter(Boolean);if(0!==c.length)return 1===c.length?c[0]:m?[t,a,e,s].filter(Boolean)[0]:o.ZP.createElement("div",{className:"ChatBadge-wrapper"},c)}())}))},59148:(e,t,n)=>{n.d(t,{Z:()=>ae});var o=n(60748),a=n(33555),i=n(91713),r=n(83716),s=n(601),c=n(16974),l=n(46752),d=n(25190),u=n(27407),m=n(95616),h=n(3657),p=n(73541),g=n(67360),Z=n(61204),v=n(47783),f=n(21273),P=n(34288),E=n(6137),y=n(48670),b=n(7054),C=n(15780),w=n(19369),S=n(7792),N=n(65116);const I=new Map;(0,N.ll)((e=>{for(const[t,{setter:n}]of I)n(t(e))}));var M=n(41470),k=n(60706),x=n(44499),T=n(42797),A=n(31212),O=n(31876),R=n(70172),D=n(76844),L=n(40329),F=n(66534),B=n(2153),U=n(50742),$=n(79347);const j="mem3FdA38CqQltSSxUwi",H=(0,o.X$)((e=>{let{isSelected:t,isActive:n,isMobile:a}=e;return o.ZP.createElement("div",{className:(0,l.Z)("wYxzEPxIxq51N_1Jvb22",n&&"AtRfJ5hbKIb7giL05RZz",t&&!a&&"J83lhIRMV9uenQVCQJpB")},o.ZP.createElement("div",{className:"GjqQzJt4PhbEBMchbPMg"},o.ZP.createElement("div",{className:j}),o.ZP.createElement("div",{className:j}),o.ZP.createElement("div",{className:j})))}));var _=n(77699);const Y=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,b.Z1J)(e,n);if(!o)return{};const{senderId:a,replyToMessageId:i,isOutgoing:r}=o.lastMessage||{},s=a?(0,b.dyD)(e,a)||(0,b.Z1J)(e,a):void 0,c=o.lastMessage?(0,y.N5)(o.lastMessage):void 0,l=c&&i?(0,b.hjO)(e,o.id,i):void 0,{targetUserIds:d,targetChatId:u}=c||{},m=(0,y.zX)(o),{chatId:h,threadId:p,type:g}=(0,b.Btg)(e)||{},Z=n===h&&p===E._f,v=o.isForum&&n===h||n===(0,b.jUK)(e).forumPanelChatId,f=m?(0,b.dyD)(e,m):void 0,P=m?(0,b.ssc)(e,m):void 0,C=o.lastMessage&&(0,b.p$s)(e,o.lastMessage),w=(0,b.WPz)(e,n,E._f,"typingStatus");return{chat:o,isMuted:(0,y.i4)(o,(0,b.dZI)(e),(0,b.NJL)(e)),lastMessageSender:s,actionTargetUserIds:d,actionTargetChatId:u,actionTargetMessage:l,draft:(0,b.Mst)(e,n,E._f),isSelected:Z,isSelectedForum:v,isForumPanelOpen:(0,b.nd)(e),canScrollDown:Z&&"thread"===g,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...r&&o.lastMessage&&{lastMessageOutgoingStatus:(0,b.dTW)(e,o.lastMessage)},user:f,userStatus:P,lastMessageTopic:C,typingStatus:w,withInterfaceAnimations:(0,b.FOo)(e)}}))((e=>{let{chatId:t,folderId:n,orderDiff:r,animationType:c,isPinned:u,observeIntersection:m,chat:p,isMuted:g,user:Z,userStatus:v,actionTargetUserIds:f,lastMessageSender:P,lastMessageOutgoingStatus:N,actionTargetMessage:j,actionTargetChatId:Y,offsetTop:z,draft:V,withInterfaceAnimations:X,isSelected:q,isSelectedForum:W,isForumPanelOpen:G,canScrollDown:K,canChangeFolder:J,lastMessageTopic:Q,typingStatus:ee,onDragEnter:te}=e;const{openChat:ne,focusLastMessage:oe,loadTopics:ae,openForumPanel:ie,closeForumPanel:re}=(0,a.Sv)(),{isMobile:se}=(0,T.ZP)(),[ce,le,de]=(0,k.Z)(),[ue,me,he]=(0,k.Z)(),[pe,ge,Ze]=(0,k.Z)(),[ve,fe,Pe]=(0,k.Z)(),[Ee,ye,be]=(0,k.Z)(),[Ce,we,Se]=(0,k.Z)(),[Ne,Ie,Me]=(0,k.Z)(),[ke,xe,Te]=(0,k.Z)(),{lastMessage:Ae,isForum:Oe}=p||{},{renderSubtitle:Re,ref:De}=(0,x.Z)({chat:p,chatId:t,lastMessage:Ae,typingStatus:ee,draft:V,actionTargetMessage:j,actionTargetUserIds:f,actionTargetChatId:Y,lastMessageTopic:Q,lastMessageSender:P,observeIntersection:m,animationType:c,withInterfaceAnimations:X,orderDiff:r}),Le=function(e){let t=I.get(e);if(!t){const[n,o]=(0,w.gQ)(e((0,a.Rd)()));t={clientsCount:0,getter:n,setter:o},I.set(e,t)}return(0,S.Z)((()=>(t.clientsCount++,()=>{t.clientsCount--,t.clientsCount||I.delete(e)}))),t.getter}(b.hqL),Fe=(0,d.Z)((()=>{Oe?G?re(void 0,{forceOnHeavyAnimation:!0}):ie({chatId:t},{forceOnHeavyAnimation:!0}):(ne({id:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),q&&K&&oe())})),Be=(0,d.Z)((e=>{e.preventDefault(),te?.(t)})),Ue=(0,d.Z)((()=>{ye(),le()})),$e=(0,d.Z)((()=>{we(),me()})),je=(0,d.Z)((()=>{Ie(),ge()})),He=(0,d.Z)((()=>{xe(),fe()})),_e=(0,M.Z)({chat:p,user:Z,handleDelete:Ue,handleMute:$e,handleChatFolderChange:je,handleReport:He,folderId:n,isPinned:u,isMuted:g,canChangeFolder:J}),Ye=(0,h.Op)(De,p?m:void 0);(0,o.d4)((()=>{Ye&&Oe&&p&&void 0===p.listedTopicIds&&ae({chatId:t})}),[p,t,Oe,Ye]);const ze=Z&&v&&(0,y.kM)(Z,v),{hasShownClass:Ve}=(0,A.Z)(ze);if(!p)return;const Xe=Z||p,qe=(0,l.Z)("Chat chat-item-clickable",(0,y.YC)(t)?"private":"group",Oe&&"forum",q&&"selected",W&&"selected-forum");return o.ZP.createElement(O.Z,{ref:De,className:qe,href:s.IT?`#${(0,C.tB)(t,"thread",E._f)}`:void 0,style:`top: ${z}px`,ripple:!Oe&&!se,contextActions:_e,onClick:Fe,onDragEnter:Be,withPortalForMenu:!0},o.ZP.createElement("div",{className:(0,l.Z)("status","status-clickable")},o.ZP.createElement(R.Z,{peer:Xe,isSavedMessages:Z?.isSelf,withStory:Z&&!Z?.isSelf,withStoryGap:Ve,storyViewerOrigin:i.ze.ChatList,storyViewerMode:"single-user"}),o.ZP.createElement("div",{className:"avatar-badge-wrapper"},o.ZP.createElement("div",{className:(0,l.Z)("avatar-online",Ve&&"avatar-online-shown")}),o.ZP.createElement(_.Z,{chat:p,isMuted:g,shouldShowOnlyMostImportant:!0,forceHidden:Le})),p.isCallActive&&p.isCallNotEmpty&&o.ZP.createElement(H,{isMobile:se,isSelected:q,isActive:X})),o.ZP.createElement("div",{className:"info"},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement(B.Z,{peer:Xe,withEmojiStatus:!0,isSavedMessages:t===Z?.id&&Z?.isSelf,observeIntersection:m}),g&&o.ZP.createElement("i",{className:"icon icon-muted"}),o.ZP.createElement("div",{className:"separator"}),p.lastMessage&&o.ZP.createElement(D.Z,{message:p.lastMessage,outgoingStatus:N})),o.ZP.createElement("div",{className:"subtitle"},Re(),o.ZP.createElement(_.Z,{chat:p,isPinned:u,isMuted:g}))),Ee&&o.ZP.createElement(L.Z,{isOpen:ce,onClose:de,onCloseAnimationEnd:be,chat:p}),Ce&&o.ZP.createElement($.Z,{isOpen:ue,onClose:he,onCloseAnimationEnd:Se,chatId:t}),Ne&&o.ZP.createElement(U.Z,{isOpen:pe,onClose:Ze,onCloseAnimationEnd:Me,chatId:t}),ke&&o.ZP.createElement(F.Z,{isOpen:ve,onClose:Pe,onCloseAnimationEnd:Te,chatId:t,subject:"peer"}))})));var z=n(59107),V=n(231),X=n(45601);const q=(0,o.X$)((0,a.c$)(((e,t)=>{let{folderId:n,folderType:o}=t;return{chatFolder:n&&"folder"===o?(0,b.MwT)(e,n):void 0,animatedEmoji:(0,b.zB_)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:a,onSettingsScreenSelect:r}=e;const s=(0,z.Z)(),{isMobile:c}=(0,T.ZP)(),l=(0,o.I4)((()=>{a({type:"editFolder",payload:t}),r(i.MT.FoldersEditFolderFromChatList)}),[t,a,r]);return o.ZP.createElement("div",{className:"SQg81XcAI_8yUrDTZsuO"},o.ZP.createElement("div",{className:"wJbYOMkKbFvBF3ETHcTe"},n&&o.ZP.createElement(X.Z,{sticker:n,size:96})),o.ZP.createElement("h3",{className:"aAjnCIjqnZ5azP_wg1ax",dir:"auto"},s("FilterNoChatsToDisplay")),o.ZP.createElement("p",{className:"xkUox6hbodMU0tsgwbai",dir:"auto"},s(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),t&&o.ZP.createElement(V.Z,{ripple:!c,fluid:!0,pill:!0,onClick:l,size:"smaller",isRtl:s.isRtl},o.ZP.createElement("i",{className:"icon icon-settings"}),o.ZP.createElement("div",{className:"avAW55GP937eCr8UmpfS"},s("ChatList.EmptyChatListEditFilter"))))})));var W=n(60782),G=n(2155),K=n(32340),J=n(95481);const Q={root:"QNEU55wdWY0UBHKcohz_",minimized:"HJvl22k3BH70ntnjhIP0",button:"RF4n_8QOkb5FMXcpbmBW",title:"XFFMu4VlEHKxRihwcGTm","unread-count":"jYYtPy1W31sqUc_gw9RW",unreadCount:"jYYtPy1W31sqUc_gw9RW",info:"fvlwjR3heR1XQKFT_jiv",name:"Njj0lF4z1QQ96mlTyHt_",icon:"EKj05B3RNFnEMtMNttAq",avatarWrapper:"qx5qdiOt16oub2O9sYeg",avatar:"n8grGxKGGUr4oa8NVGFW",chatsPreview:"m7P0WNHzg_kxle3rxniA",unread:"mee_ERQMDxZsfb47JEBb"},ee=(0,o.X$)((e=>{let{archiveSettings:t,onDragEnter:n,onClick:i}=e;const{updateArchiveSettings:s}=(0,a.Sv)(),c=(0,z.Z)(),d=(0,m.d7)(r.WSp),u=(0,m.yi)()[r.WSp]?.chatsCount,h=(0,o.Ye)((()=>{if(!d?.length)return c("Loading");const e=(0,a.Rd)().chats.byId;return d.slice(0,5).map(((t,n,a)=>{const i=n===a.length-1,r=e[t];if(!r)return;const s=(0,y.U)(c,r);return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:(0,l.Z)(Q.chat,u&&r.unreadCount&&Q.unread)},(0,K.Z)(s)),i?"":", ")}))}),[d,c,u]),p=(0,o.Ye)((()=>{const e=!t.isMinimized&&{title:c("lng_context_archive_collapse"),icon:"collapse",handler:()=>{s({isMinimized:!0})}},n=t.isMinimized&&{title:c("lng_context_archive_expand"),icon:"expand",handler:()=>{s({isMinimized:!1})}},o={title:c("lng_context_archive_to_menu"),icon:"archive-to-main",handler:()=>{s({isHidden:!0})}};return(0,W.oA)([e,n,o])}),[t.isMinimized,c,s]),g=(0,o.I4)((e=>{e.preventDefault(),n?.()}),[n]);return o.ZP.createElement(O.Z,{onClick:i,onDragEnter:g,className:(0,l.Z)(Q.root,t.isMinimized&&Q.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:Q.button,contextActions:p,withPortalForMenu:!0},t.isMinimized?o.ZP.createElement("div",{className:(0,l.Z)(Q.info,"info")},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,l.Z)("title",Q.title)},o.ZP.createElement("h3",{dir:"auto",className:(0,l.Z)(Q.name,"fullName")},o.ZP.createElement("i",{className:(0,l.Z)(Q.icon,"icon","icon-archive-filled")}),c("ArchivedChats"))),o.ZP.createElement(J.Z,{className:Q.unreadCount,text:u?(0,G.bi)(u):void 0}))):o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:(0,l.Z)("status",Q.avatarWrapper)},o.ZP.createElement("div",{className:(0,l.Z)("Avatar",Q.avatar)},o.ZP.createElement("i",{className:"icon icon-archive-filled"}))),o.ZP.createElement("div",{className:(0,l.Z)(Q.info,"info")},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,l.Z)("title",Q.title)},o.ZP.createElement("h3",{dir:"auto",className:(0,l.Z)(Q.name,"fullName")},c("ArchivedChats")))),o.ZP.createElement("div",{className:"subtitle"},o.ZP.createElement("div",{className:(0,l.Z)("status",Q.chatsPreview)},h),o.ZP.createElement(J.Z,{className:Q.unreadCount,text:u?(0,G.bi)(u):void 0})))))}));var te=n(57710),ne=n(87675);const oe=new Set(["9","0"]),ae=(0,o.X$)((e=>{let{folderType:t,folderId:n,isActive:E,isForumPanelOpen:y,canDisplayArchive:b,archiveSettings:C,foldersDispatch:w,onSettingsScreenSelect:S,onLeftColumnContentChange:N}=e;const{openChat:I,openNextChat:M,closeForumPanel:k,toggleStoryRibbon:x}=(0,a.Sv)(),T=(0,o.sO)(null),A=(0,o.sO)(!1),O="archived"===t,R="all"===t?r.NfV:O?r.WSp:n,D="all"===t&&b,L=(0,m.d7)(R);(0,v.Z)(L);const F=(L?.length||0)*r.rSj,B=D?C.isMinimized?r.RBO:r.rSj:0,{orderDiffById:U,getAnimationType:$}=(0,Z.Z)(L),[j,H]=(0,u.Z)(void 0,L,void 0,r.t_F);(0,p.y)(E&&L?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),M({targetIndexDelta:-1,orderedIds:L})},"Alt+ArrowDown":e=>{e.preventDefault(),M({targetIndexDelta:1,orderedIds:L})}}:void 0),(0,o.d4)((()=>{if(E&&L&&s.RM)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((s.jm&&e.metaKey||!s.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||oe.has(t))return;const n=D&&!C.isMinimized,o=n?-1:0,a=Number(t)+o-1;if(n&&-1===a)return void N(i.du.Archived);if(a>L.length-1)return;I({id:L[a],shouldReplaceHistory:!0})}}}),[C,E,N,I,M,L,D]);const{observe:_}=(0,h.S1)({rootRef:T,throttleMs:200}),z=(0,d.Z)((()=>{N(i.du.Archived),k()})),V=(0,d.Z)((()=>{A.current?A.current=!1:z()})),X=(0,g.Z)((e=>{A.current?A.current=!1:I({id:e,shouldReplaceHistory:!0})}),[I],500,!0),W=(0,d.Z)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top;n<t.width||o<t.y||(A.current=!0)})),G=function(e,t,n){const a=(0,o.sO)(null),i=(0,o.sO)(!1),r=(0,o.sO)(0),c=(0,o.sO)(!1),l=(0,o.sO)(!0),u=(0,o.sO)(0),m=(0,o.sO)(!1),h=(0,d.Z)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];c.current||a.current&&e.current&&(a.current.style.display="block",e.current.scrollTop=1,s.s$||t||(0,ne.n)(e.current),i.current=!0,r.current=1,c.current=!0,l.current=!0)})),p=(0,d.Z)((()=>{c.current&&a.current&&(a.current.style.display="none",c.current=!1)})),Z=(0,d.Z)((()=>{if(!e.current)return;if(i.current)return void(i.current=!1);const o=e.current.scrollTop,s=o>r.current,d=o<r.current,g=0===o,Z=Date.now()-u.current;if(a.current){if(g&&!c.current)return void(0,te.x4)(h,[e.current,a.current]);(0,te.x4)(p,a.current)}d&&(l.current&&Z>100||o<0&&m.current)?t?.():s&&o>0&&n?.(),r.current=o,l.current=g,u.current=Date.now(),m.current=s&&o<0})),v=(0,g.Z)((o=>{if(!e.current)return;const a=e.current;a.scrollHeight>a.offsetHeight||0===o.deltaY||(o.deltaY<0?t?.():n?.())}),[e,t,n],250);return(0,o.d4)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,te.WM)((()=>{h(!0)})),t.addEventListener("scroll",Z,{passive:!0}),t.addEventListener("wheel",v,{passive:!0}),()=>{t.removeEventListener("scroll",Z),t.removeEventListener("wheel",v)}}),[e,v]),s.cj?void 0:o.ZP.createElement("div",{ref:a,className:"overscroll-trigger",key:"overscroll-trigger"})}(T,(0,d.Z)((()=>{x({isShown:!0,isArchived:O})})),(0,d.Z)((()=>{x({isShown:!1,isArchived:O})})));return o.ZP.createElement(f.Z,{className:(0,l.Z)("chat-list custom-scroll",y&&"forum-panel-open"),ref:T,items:j,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:r.t_F,withAbsolutePositioning:!0,beforeChildren:G,maxHeight:F+B,onLoadMore:H,onDragLeave:W},D&&o.ZP.createElement(ee,{key:"archive",archiveSettings:C,onClick:z,onDragEnter:V}),j?.length?function(){const e=L.indexOf(j[0]),t=(0,c.aE)(R)||0;return j.map(((a,i)=>{const s=e+i<t,l=B+(e+i)*r.rSj;return o.ZP.createElement(Y,{key:a,teactOrderKey:s?i:(0,c.jK)(a),chatId:a,isPinned:s,folderId:n,animationType:$(a),orderDiff:U[a],offsetTop:l,observeIntersection:_,onDragEnter:X})}))}():j&&!j.length?o.ZP.createElement(q,{folderId:n,folderType:t,foldersDispatch:w,onSettingsScreenSelect:S}):o.ZP.createElement(P.Z,{key:"loading"}))}))},59690:(e,t,n)=>{n.d(t,{Z:()=>X});var o=n(60748),a=n(33555),i=n(57710),r=n(6137),s=n(83716),c=n(601),l=n(7054),d=n(46752),u=n(48670),m=n(23989),h=n(1279),p=n(64963),g=n(15780),Z=n(25190),v=n(27407),f=n(3657),P=n(61204),E=n(59107),y=n(87204),b=n(46590),C=n(18674),w=n(42797),S=n(98799),N=n(231),I=n(32340),M=n(44499),k=n(60782),x=n(60706),T=n(31876),A=n(76844),O=n(77699),R=n(79347),D=n(17551),L=n(2995);const F=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,topic:o,isSelected:a}=t;const i=(0,l.Z1J)(e,n),r=(0,l.hjO)(e,n,o.lastMessageId),{senderId:s,replyToMessageId:c,isOutgoing:d}=r||{},m=s?(0,l.dyD)(e,s)||(0,l.Z1J)(e,s):void 0,h=r?(0,u.N5)(r):void 0,p=h&&c?(0,l.hjO)(e,n,c):void 0,{targetUserIds:g,targetChatId:Z}=h||{},v=(0,l.WPz)(e,n,o.id,"typingStatus"),f=(0,l.Mst)(e,n,o.id),P=(0,l.tZg)(e,n,o.id),E=Boolean(P?.lastReadInboxMessageId),{chatId:y,threadId:b}=(0,l.Btg)(e)||{};return{chat:i,lastMessage:r,actionTargetUserIds:g,actionTargetChatId:Z,actionTargetMessage:p,lastMessageSender:m,typingStatus:v,canDelete:(0,l.nt7)(e,n,o.id),withInterfaceAnimations:(0,l.FOo)(e),draft:f,...d&&r&&{lastMessageOutgoingStatus:(0,l.dTW)(e,r)},canScrollDown:a&&i?.id===y&&b===o.id,wasTopicOpened:E}}))((e=>{let{topic:t,isSelected:n,chatId:i,chat:r,style:s,lastMessage:l,canScrollDown:m,lastMessageOutgoingStatus:h,observeIntersection:p,canDelete:v,actionTargetMessage:f,actionTargetUserIds:P,actionTargetChatId:y,lastMessageSender:b,animationType:C,withInterfaceAnimations:w,orderDiff:S,typingStatus:N,draft:F,wasTopicOpened:B}=e;const{openChat:U,deleteTopic:$,focusLastMessage:j}=(0,a.Sv)(),H=(0,E.Z)(),[_,Y,z]=(0,x.Z)(),[V,X,q]=(0,x.Z)(),[W,G,K]=(0,x.Z)(),[J,Q,ee]=(0,x.Z)(),{isPinned:te,isClosed:ne}=t,oe=t.isMuted||void 0===t.isMuted&&r.isMuted,ae=(0,Z.Z)((()=>{G(),Y()})),ie=(0,Z.Z)((()=>{$({chatId:r.id,topicId:t.id})})),re=(0,Z.Z)((()=>{Q(),X()})),{renderSubtitle:se,ref:ce}=(0,M.Z)({chat:r,chatId:i,lastMessage:l,draft:F,actionTargetMessage:f,actionTargetUserIds:P,actionTargetChatId:y,lastMessageSender:b,lastMessageTopic:t,observeIntersection:p,isTopic:!0,typingStatus:N,animationType:C,withInterfaceAnimations:w,orderDiff:S}),le=(0,Z.Z)((()=>{U({id:i,threadId:t.id,shouldReplaceHistory:!0}),m&&j()})),de=function(e){let{topic:t,chat:n,wasOpened:i,canDelete:r,handleDelete:s,handleMute:l}=e;const d=(0,E.Z)();return(0,o.Ye)((()=>{const{isPinned:e,isMuted:o,isClosed:m,id:h}=t,p=n.id,{editTopic:g,toggleTopicPinned:Z,markTopicRead:v,updateTopicMutedState:f,openChatInNewTab:P}=(0,a.Sv)(),E=(0,u.GU)(n,t),y=n.isCreator||(0,u.VE)(n,"manageTopics"),b=c.IT&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{P({chatId:n.id,threadId:h})}},C=t.unreadCount||!i?{title:d("MarkAsRead"),icon:"readchats",handler:()=>{v({chatId:p,topicId:h})}}:void 0,w=y?e?{title:d("UnpinFromTop"),icon:"unpin",handler:()=>Z({chatId:p,topicId:h,isPinned:!1})}:{title:d("PinToTop"),icon:"pin",handler:()=>Z({chatId:p,topicId:h,isPinned:!0})}:void 0,S=n.isMuted&&!1!==o||!0===o?{title:d("ChatList.Unmute"),icon:"unmute",handler:()=>f({chatId:p,topicId:h,isMuted:!1})}:{title:`${d("ChatList.Mute")}...`,icon:"mute",handler:l},N=E?m?{title:d("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>g({chatId:p,topicId:h,isClosed:!1})}:{title:d("lng_forum_topic_close"),icon:"close-topic",handler:()=>g({chatId:p,topicId:h,isClosed:!0})}:void 0,I=r?{title:d("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:s}:void 0;return(0,k.oA)([b,w,C,S,N,I])}),[t,n,i,d,r,s,l])}({topic:t,chat:r,wasOpened:B,canDelete:v,handleDelete:ae,handleMute:re});return o.ZP.createElement(T.Z,{className:(0,d.Z)("YmRS2ZiwKMtqCF87Nsw8","Chat",n&&"selected","chat-item-clickable"),onClick:le,style:s,href:c.IT?`#${(0,g.tB)(i,"thread",t.id)}`:void 0,contextActions:de,withPortalForMenu:!0,ref:ce},o.ZP.createElement("div",{className:"info"},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,d.Z)("title")},o.ZP.createElement(L.Z,{topic:t,className:"TB99wQ9nHBumZ6E9ByUz",observeIntersection:p}),o.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,I.Z)(t.title))),t.isMuted&&o.ZP.createElement("i",{className:"icon icon-muted"}),o.ZP.createElement("div",{className:"separator"}),ne&&o.ZP.createElement("i",{className:(0,d.Z)("icon","icon-lock-badge","K6QDMKEV2GXbuOQWOS73")}),l&&o.ZP.createElement(A.Z,{message:l,outgoingStatus:h})),o.ZP.createElement("div",{className:"subtitle"},se(),o.ZP.createElement(O.Z,{chat:r,isPinned:te,isMuted:oe,topic:t,wasTopicOpened:B}))),W&&o.ZP.createElement(D.Z,{isOpen:_,onClose:z,onCloseAnimationEnd:K,confirmIsDestructive:!0,confirmHandler:ie,text:H("lng_forum_topic_delete_sure"),confirmLabel:H("Delete")}),J&&o.ZP.createElement(R.Z,{isOpen:V,onClose:q,onCloseAnimationEnd:ee,chatId:i,topicId:t.id}))})));var B=n(21273),U=n(34288),$=n(59188),j=n(4794),H=n(74399),_=n(45601);const Y={root:"ZyX_vkPmR8lkPavXpJ8t","button-text":"eyTT7Nz45S4tsccfs60O",buttonText:"eyTT7Nz45S4tsccfs60O",sticker:"qtGErqZ1CIiAYG3E4UcJ",title:"xpDHtODGvlK2Esrg3kFa",description:"xqeZm45hTFw3abdn8dYe","is-ios":"G5wtv6cwHgiIpRWtvIvu",isIos:"G5wtv6cwHgiIpRWtvIvu","is-macos":"H92rL6BfAuzokrWOXdQr",isMacos:"H92rL6BfAuzokrWOXdQr"},z=7*H.Gw,V=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,l.Z1J)(e,n),a=o&&(o.isCreator||(0,u.VE)(o,"manageTopics"));return{animatedEmoji:(0,l.zB_)(e,"🐣"),canManageTopics:a}}))((e=>{let{chatId:t,animatedEmoji:n,canManageTopics:i}=e;const{openCreateTopicPanel:r}=(0,a.Sv)(),s=(0,E.Z)(),{isMobile:c}=(0,w.ZP)(),l=(0,o.I4)((()=>{r({chatId:t})}),[t,r]);return o.ZP.createElement("div",{className:Y.root},o.ZP.createElement("div",{className:Y.sticker},n&&o.ZP.createElement(_.Z,{sticker:n,size:z})),o.ZP.createElement("h3",{className:Y.title,dir:"auto"},s("ChatList.EmptyTopicsTitle")),o.ZP.createElement("p",{className:(0,d.Z)(Y.description,Y.centered),dir:"auto"},s("ChatList.EmptyTopicsDescription")),i&&o.ZP.createElement(N.Z,{ripple:!c,fluid:!0,onClick:l,size:"smaller",isRtl:s.isRtl},o.ZP.createElement("div",{className:Y.buttonText},s("ChatList.EmptyTopicsCreate"))))}))),X=(0,o.X$)((0,a.c$)((e=>{const t=(0,l.jUK)(e).forumPanelChatId,n=t?(0,l.Z1J)(e,t):void 0,{chatId:o,threadId:a}=(0,l.Btg)(e)||{};return{chat:n,currentTopicId:t===o?a:void 0,withInterfaceAnimations:(0,l.FOo)(e)}}),(e=>(0,l.nd)(e)))((e=>{let{chat:t,currentTopicId:n,isOpen:l,isHidden:I,onTopicSearch:M,onCloseAnimationEnd:k,onOpenAnimationStart:x,withInterfaceAnimations:T}=e;const{closeForumPanel:A,openChatWithInfo:O,loadTopics:R}=(0,a.Sv)(),D=(0,o.sO)(null),L=(0,o.sO)(null),H=(0,o.sO)(null),{isMobile:_}=(0,w.ZP)();(0,o.d4)((()=>{t&&!t.topics&&R({chatId:t.id})}),[t,R]);const[Y,z]=(0,o.eJ)(!1),X=(0,E.Z)(),q=(0,Z.Z)((()=>{A()}));(0,o.d4)((()=>{T||l||k?.()}),[T,l,k]);const W=(0,Z.Z)((()=>{t&&O({id:t.id,shouldReplaceHistory:!0})})),{observe:G}=(0,f.S1)({rootRef:L,throttleMs:200});(0,f._N)(H,G,(e=>{let{isIntersecting:t}=e;z(!t)}));const K=(0,o.Ye)((()=>t?.topics?(0,u.AY)(Object.values(t.topics),t.orderedPinnedTopicIds).map((e=>{let{id:t}=e;return t})):[]),[t]),{orderDiffById:J,getAnimationType:Q}=(0,P.Z)(K,t?.id),[ee,te]=(0,v.Z)((()=>{t&&R({chatId:t.id})}),K,!t?.topicsCount||K.length>=t.topicsCount,s.C1M),ne=(0,o.sO)(!1),oe=l&&!I,ae=(0,y.Z)(oe);ae!==oe&&(ne.current=!1),(0,b.Z)({isActive:oe,onBack:q,hash:t?(0,g.tB)(t.id,"thread",r._f):void 0}),(0,o.d4)((()=>oe?(0,m.Z)(q):void 0),[q,oe]),(0,o.d4)((()=>{ae!==oe&&(0,i.Yq)((()=>{if(!D.current)return;const e=(0,C.YW)();(0,h.L)(D.current,e),x?.(),oe?(ne.current=!0,D.current.style.transform="none"):(ne.current=!1,D.current.style.transform="")}))}),[oe,x,ae]),(0,o.d4)((()=>{if(c.$b)return(0,p.sf)(D.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(X.isRtl?p.eM.Left:p.eM.Right)&&(A(),!0)})}),[A,X.isRtl]);const ie=void 0===t?.topics;return o.ZP.createElement("div",{ref:D,className:(0,d.Z)("GUOX6Q0XzHRhNZvBwjQ9",Y&&"h_YBka1L8eRICjrO5dF5",X.isRtl&&"_1XehUpS3aX91hWXDmcu",!T&&"mPOFnJvncopcVbbyZrzs"),onTransitionEnd:l?void 0:k},o.ZP.createElement("div",{id:"TopicListHeader",className:"left-header"},o.ZP.createElement(N.Z,{round:!0,size:"smaller",color:"translucent",onClick:q,ariaLabel:X("Close")},o.ZP.createElement("i",{className:"icon icon-close"})),t&&o.ZP.createElement(S.Z,{noAvatar:!0,className:"mzucaTAH77gNB1V006lS",chatId:t.id,onClick:W}),t&&o.ZP.createElement($.Z,{chatId:t.id,threadId:r._f,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:_,onTopicSearch:M})),t&&o.ZP.createElement(j.Z,{chatId:t.id,hasPinnedOffset:!1,className:"OH0LaRqoNDIvvHsCtEte"}),o.ZP.createElement("div",{className:"UhjDQykjZBYhiVclJl16"}),o.ZP.createElement(B.Z,{className:"chat-list custom-scroll",ref:L,items:ee,preloadBackwards:s.C1M,withAbsolutePositioning:!0,maxHeight:(K?.length||0)*s.oDu,onLoadMore:te,sensitiveArea:s.BtI,beforeChildren:o.ZP.createElement("div",{ref:H,className:"cO3iiLSh70tyWuNCUFtX"})},Boolean(ee?.length)&&function(){const e=K.indexOf(ee[0]);return ee?.map(((a,i)=>o.ZP.createElement(F,{key:a,chatId:t.id,topic:t.topics[a],style:`top: ${(e+i)*s.oDu}px;`,isSelected:n===a,observeIntersection:G,animationType:Q(a),orderDiff:J[a]})))}(),ie&&!ee?.length&&o.ZP.createElement(U.Z,{key:"loading"})),!ie&&1===ee?.length&&ee[0]===s.OxA&&o.ZP.createElement(V,{chatId:t.id}))})))},9950:(e,t,n)=>{n.d(t,{b:()=>a,w:()=>i});var o=n(60748);let a=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function i(e){return(0,o.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,o=t.filter((e=>e>0)).length;return t=>{const i=e[t];return 0===i?a.None:i===1/0||i===-1/0||n<=o&&i<0||o<n&&i>0?a.Opacity:a.Move}}),[e])}},44499:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(60748),a=n(57710),i=n(33555),r=n(59107),s=n(83716),c=n(20230),l=n(48670),d=n(18005),u=n(32340),m=n(46752),h=n(75790),p=n(6202),g=n(9950),Z=n(45370),v=n(42797),f=n(39415),P=n(74399),E=n(2995);const y="GrFgsvT5YSYldl56Hnzu",b="yHnVWii5hDMte2XGiGio",C="H4WbKWl7lQI8hw8ryOgF",w="DGAWy9KRwAZqof7Bt1nx",S=Number(P.Gw),N=(0,o.X$)((e=>{let{chat:t,renderLastMessage:n,observeIntersection:a}=e;const{openChat:s}=(0,i.Sv)(),c=(0,o.sO)(null),d=(0,o.sO)(null),h=(0,r.Z)(),[p,...g]=(0,o.Ye)((()=>t.topics?(0,l.AY)(Object.values(t.topics),void 0,!0).slice(0,3):[]),[t.topics]),[Z,P]=(0,o.eJ)(!1),[N,I]=(0,o.eJ)(void 0),{handleClick:M,handleMouseDown:k}=(0,f.m)((e=>{0!==p.unreadCount&&(e.stopPropagation(),e.preventDefault(),s({id:t.id,threadId:p.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,v.W7)()}))}));return(0,o.d4)((()=>{const e=c.current,t=d.current;if(!e||!t)return;const n=e.offsetWidth,o=t.offsetWidth;Math.abs(n-o)<S?I(Math.max(n,o)):I(void 0),P(n>o)}),[p,n]),o.ZP.createElement("div",{className:(0,m.Z)("gljGvMdlFlsKhrMPQ_xa",Z&&"RJ0NXk_lx9qewdoGgJsT",N&&"e4cE7B51DN3MrEY9WuKx"),dir:h.isRtl?"rtl":void 0,style:N?`--overwritten-width: ${N}px`:void 0},p&&o.ZP.createElement("div",{className:y},o.ZP.createElement("div",{className:(0,m.Z)("VUe4FFBCwClvaU9aiXG1",p.unreadCount&&b),ref:d,onClick:M,onMouseDown:k},o.ZP.createElement(E.Z,{topic:p,observeIntersection:a}),o.ZP.createElement("div",{className:"WeBppBs2KkOXzHRzQ2_W"},(0,u.Z)(p.title)),!N&&Z&&o.ZP.createElement("div",{className:C},o.ZP.createElement("div",{className:w}))),o.ZP.createElement("div",{className:"FJt1oTIn6WgfvH9iKMg3"},g.map((e=>o.ZP.createElement("div",{className:(0,m.Z)("RhuR5wto63HGEeY1NdXg",e.unreadCount&&b),key:e.id},o.ZP.createElement(E.Z,{topic:e,className:"mrAD_CKmksSYVhfxgz_w",observeIntersection:a}),o.ZP.createElement("span",{className:"Ub9bpPYaMAw0qMouq5_O"},(0,u.Z)(e.title)))))),o.ZP.createElement("div",{className:"RL7lx7aP0Fg2LakRlxHp"})),!p&&o.ZP.createElement("div",{className:(0,m.Z)(y,"bYI9fzK27IbEWGTzvRGf")},h("Loading")),o.ZP.createElement("div",{className:(0,m.Z)("OyHxp9apV7oixvvxGFDx",p?.unreadCount&&b),ref:c,onClick:M,onMouseDown:k},n(),!N&&!Z&&o.ZP.createElement("div",{className:C},o.ZP.createElement("div",{className:w}))))}));var I=n(68729);function M(e){let{chat:t,lastMessage:n,chatId:v,typingStatus:f,draft:P,actionTargetMessage:E,actionTargetUserIds:y,lastMessageTopic:b,lastMessageSender:C,actionTargetChatId:w,observeIntersection:S,animationType:M,orderDiff:k,withInterfaceAnimations:x,isTopic:T}=e;const A=(0,r.Z)(),O=(0,o.sO)(null),R=n&&(0,l.FT)(n);(0,h.Z)(v,R?n.replyToMessageId:void 0,E);const D=n&&!(0,l.bf)(n)?(0,l.DH)(n):void 0,L=(0,p.Z)(n?(0,l.Ti)(n,"micro"):void 0),F=Boolean(n&&(0,l.Y5)(n)),B=(0,o.Ye)((()=>{if(!y)return;const e=(0,i.Rd)().users.byId;return y.map((t=>e[t])).filter(Boolean)}),[y]),U=(0,o.I4)((()=>{if(f&&n&&f.timestamp>1e3*n.date)return o.ZP.createElement(I.Z,{typingStatus:f});if(P?.text.length&&(!t?.isForum||T))return o.ZP.createElement("p",{className:"last-message",dir:A.isRtl?"auto":"ltr"},o.ZP.createElement("span",{className:"draft"},A("Draft")),(0,c.H)({text:P.text,entities:P.entities,isSimple:!0,withTranslucentThumbs:!0}));if(!n)return;if(R){const e=t&&((0,l.eA)(t)||n.senderId===n.chatId);return o.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:A.isRtl?"auto":"ltr"},(0,d.D)(A,n,e?void 0:C,e?t:void 0,B,E,w,b,{isEmbedded:!0},void 0,void 0))}const e=(0,l.zF)(A,v,C);return o.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:A.isRtl?"auto":"ltr"},e&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"sender-name"},(0,u.Z)(e)),o.ZP.createElement("span",{className:"colon"},":")),n.forwardInfo&&o.ZP.createElement("i",{className:"icon icon-share-filled chat-prefix-icon"}),Boolean(n.replyToStoryId)&&o.ZP.createElement("i",{className:"icon icon-story-reply chat-prefix-icon"}),function(e,t,n,a,i){const r=o.ZP.createElement(Z.Z,{lang:e,message:t,noEmoji:Boolean(a),observeIntersectionForLoading:n,inChatList:!0});if(!a)return r;const s=(0,l.NE)(t);return o.ZP.createElement("span",{className:"media-preview"},o.ZP.createElement("img",{src:a,alt:"",className:(0,m.Z)("media-preview--image",i&&"round",s&&"media-preview-spoiler")}),(0,l.b7)(t)&&o.ZP.createElement("i",{className:"icon icon-play"}),r)}(A,n,S,L||D,F))}),[w,E,B,t,v,P,R,F,T,A,n,C,b,L,D,S,f]);return(0,o.bt)((()=>{const e=O.current;if(x&&e){if(M===g.b.Opacity)e.style.opacity="0",(0,a.WM)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(M!==g.b.Move)return;e.style.transform=`translate3d(0, ${-k*s.rSj}px, 0)`,(0,a.WM)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,a.WM)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+s.fK3)}}),[x,k,M]),{renderSubtitle:function(){return t?.isForum&&!T?o.ZP.createElement(N,{chat:t,renderLastMessage:U,observeIntersection:S}):U()},ref:O}}},73217:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(87204),i=n(65326);function r(e){const t=(0,i.Z)(),n=(0,o.sO)(e),r=(0,a.Z)(e);return!1===e&&r!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},61204:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(87204),i=n(60782),r=n(9950);function s(e,t){const n=(0,o.Ye)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),s=(0,a.Z)(n),c=(0,a.Z)(t),l=(0,o.Ye)((()=>n&&s&&t===c?(0,i.Q8)(n,((e,t)=>void 0!==s[t]?e-s[t]:-1/0)):{}),[t,n,c,s]);return{orderDiffById:l,getAnimationType:(0,r.w)(l)}}},91:(e,t,n)=>{n.d(t,{F:()=>a});var o=n(48670);function a(e,t,n,a){const{senderId:i}=t;if(!i)return;const r=(0,o.YC)(i)?a[i]:n[i];let s=(0,o.OU)(e,r);const c=n[t.chatId];return c&&((0,o.YC)(i)&&r.isSelf?s=`${e("FromYou")} → ${(0,o.U)(e,c)}`:(0,o.Bf)(c)&&(s+=` → ${(0,o.U)(e,c)}`)),s}},78323:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(60748),a=n(33555),i=n(7054),r=n(48670),s=n(46752),c=n(18005),l=n(30386),d=n(75790),u=n(17240),m=n(3657),h=n(45277),p=n(59107),g=n(60706),Z=n(31212),v=n(97182),f=n(45601),P=n(91713),E=n(6137),y=n(40647),b=n(25190),C=n(6202),w=n(70172),S=n(66735),N=n(17551);const I=(0,o.X$)((e=>{let{message:t,renderContent:n}=e;const{openMediaViewer:i,uploadProfilePhoto:s,showNotification:c}=(0,a.Sv)(),{isOutgoing:l}=t,d=(0,p.Z)(),[u,m]=(0,o.eJ)(),[h,Z,v]=(0,g.Z)(!1),f=(0,C.Z)((0,r.Ti)(t,"full")),I=t.content.action.photo?.isVideo,M=(0,b.Z)((()=>{c({title:d("ApplyAvatarHintTitle"),message:d("ApplyAvatarHint"),action:{action:"requestNextSettingsScreen",payload:{screen:P.MT.Main}},actionText:d("Open")})})),k=(0,b.Z)((e=>{m(void 0),s({file:e}),M()})),x=(0,b.Z)((()=>{m(void 0)})),T=(0,b.Z)((async()=>{v(),M();const e=t.content.action.photo,n=await y.he(`videoAvatar${e.id}?size=u`,E.IU.BlobUrl),o=await fetch(n).then((e=>e.blob()));s({file:new File([o],"avatar.mp4"),isVideo:!0,videoTs:e.videoSizes?.find((e=>void 0!==e.videoStartTs))?.videoStartTs})}));return o.ZP.createElement("span",{className:"action-message-suggested-avatar",tabIndex:0,role:"button",onClick:async()=>{!l&&f?I?Z():m(await fetch(f).then((e=>e.blob()))):i({chatId:t.chatId,mediaId:t.id,threadId:E._f,origin:P.bZ.SuggestedAvatar})}},o.ZP.createElement(w.Z,{photo:t.content.action.photo,loopIndefinitely:!0,withVideo:I,size:"jumbo"}),o.ZP.createElement("span",null,n()),o.ZP.createElement("span",{className:"action-message-button"},d(I?"ViewVideoAction":"ViewPhotoAction")),o.ZP.createElement(S.Z,{file:u,onClose:x,onChange:k}),o.ZP.createElement(N.Z,{isOpen:h,title:d("SuggestedVideo"),confirmHandler:T,onClose:v,textParts:n()}))})),M=(0,o.X$)((0,a.c$)(((e,t)=>{let{message:n,threadId:o}=t;const{chatId:a,senderId:s,replyToMessageId:c,content:l}=n,d=s,{targetUserIds:u,targetChatId:m}=l.action||{},h=c,p=h?(0,i.hjO)(e,a,h):void 0,g=!!o&&(0,i._XY)(e,n,o),{direction:Z,noHighlight:v}=g&&(0,i.jUK)(e).focusedMessage||{},f=(0,i.Z1J)(e,a),P=f&&((0,r.eA)(f)||d===a),E=!P&&d?(0,i.dyD)(e,d):void 0,y=P?f:void 0,b=e.premiumGifts?.stickers?.[0];return{senderUser:E,senderChat:y,targetChatId:m,targetUserIds:u,targetMessage:p,isFocused:g,premiumGiftSticker:b,topic:(0,i.p$s)(e,n),canPlayAnimatedEmojis:(0,i.W9H)(e),...g&&{focusDirection:Z,noFocusHighlight:v}}}))((e=>{let{message:t,isEmbedded:n,appearanceOrder:i=0,isJustAdded:P,isLastInList:E,senderUser:y,senderChat:b,targetUserIds:C,targetMessage:w,targetChatId:S,isFocused:N,focusDirection:M,noFocusHighlight:k,premiumGiftSticker:x,isInsideTopic:T,topic:A,memoFirstUnreadIdRef:O,canPlayAnimatedEmojis:R,observeIntersectionForReading:D,observeIntersectionForLoading:L,observeIntersectionForPlaying:F,onPinnedIntersectionChange:B}=e;const{openPremiumModal:U,requestConfetti:$}=(0,a.Sv)(),j=(0,p.Z)(),H=(0,o.sO)(null);(0,m._N)(H,D),(0,d.Z)(t.chatId,t.replyToMessageId,w),(0,h.Z)(H,t.chatId,N,M,k,P),(0,o.d4)((()=>{if(t.isPinned)return()=>{B?.({viewportPinnedIdsToRemove:[t.id],isUnmount:!0})}}),[B,t.isPinned,t.id]);const _=i<=0,[Y,z]=(0,g.Z)(_),V=Boolean(t.content.action?.text.startsWith("ActionGift")),X="suggestProfilePhoto"===t.content.action?.type&&t.content.action.photo;(0,o.d4)((()=>{_||setTimeout(z,10*i)}),[i,z,_]);const q=(0,m.Op)(H,F),W=(0,o.sO)((()=>{const e=O?.current&&t.id>=O.current;return V&&!t.isOutgoing&&e})());(0,o.d4)((()=>{q&&W.current&&(W.current=!1,$())}),[q,$]);const{transitionClassNames:G}=(0,Z.Z)(Y,void 0,_,!1),K=(0,a.Rd)().users.byId,J=(0,o.Ye)((()=>C?C.map((e=>K?.[e])).filter(Boolean):void 0),[C,K]),Q=(0,o.I4)((()=>(0,c.D)(j,t,y,b,J,w,S,A,{isEmbedded:n},L,F)),[n,j,t,L,F,b,y,S,w,J,A]),{isContextMenuOpen:ee,contextMenuPosition:te,handleBeforeContextMenu:ne,handleContextMenu:oe,handleContextMenuClose:ae,handleContextMenuHide:ie}=(0,u.Z)(H),re=void 0!==te;if(T&&"TopicWasCreatedAction"===t.content.action?.text)return o.ZP.createElement("span",{ref:H});if(n)return o.ZP.createElement("span",{ref:H,className:"embedded-action-message"},Q());const se=(0,s.Z)("ActionMessage message-list-item",N&&!k&&"focused",(V||X)&&"centered-action",re&&"has-menu-open",E&&"last-in-list",!V&&!X&&"in-one-row",G);return o.ZP.createElement("div",{ref:H,id:(0,r.d0)(t.id),className:se,"data-message-id":t.id,"data-is-pinned":t.isPinned||void 0,onMouseDown:e=>{(0,l.q)(e),ne(e)},onContextMenu:oe},!X&&o.ZP.createElement("span",{className:"action-message-content"},Q()),V&&o.ZP.createElement("span",{className:"action-message-gift",tabIndex:0,role:"button",onClick:()=>{U({isGift:!0,fromUserId:y?.id,toUserId:C?.[0],monthsAmount:t.content.action?.months||0})}},o.ZP.createElement(f.Z,{key:t.id,sticker:x,play:R,noLoop:!0,nonInteractive:!0}),o.ZP.createElement("strong",null,j("ActionGiftPremiumTitle")),o.ZP.createElement("span",null,j("ActionGiftPremiumSubtitle",j("Months",t.content.action?.months,"i"))),o.ZP.createElement("span",{className:"action-message-button"},j("ActionGiftPremiumView"))),X&&o.ZP.createElement(I,{message:t,renderContent:Q}),te&&o.ZP.createElement(v.Z,{isOpen:ee,anchor:te,message:t,messageListType:"thread",onClose:ae,onCloseAnimationEnd:ie}))})))},59188:(e,t,n)=>{n.d(t,{Z:()=>y});var o=n(60748),a=n(57710),i=n(33555),r=n(6137),s=n(91713),c=n(601),l=n(48670),d=n(7054),u=n(25190),m=n(59107),h=n(73541),p=n(231),g=n(99203),Z=n(48778);const v=e=>{const{isOpen:t}=e,n=(0,Z.Z)(g.gl.Extra,"HeaderMenuContainer",!t);return n?o.ZP.createElement(n,e):void 0};var f=n(53106),P=n(58964),E=n(66902);const y=(0,o.X$)((0,i.c$)(((e,t)=>{let{chatId:n,threadId:o,messageListType:a,isMobile:i}=t;const s=(0,d.Z1J)(e,n),u=Boolean(s&&(0,l.eA)(s)),m=(0,d.rB0)(e),h=(0,d.Mc4)(e),{doNotTranslate:p}=e.settings.byKey;if(!s||s.isRestricted||(0,d.CAb)(e))return{noMenu:!0,language:m,translationLanguage:h,doNotTranslate:p};const g=(0,d.kBx)(e,n),Z=(0,l.YC)(n)?void 0:(0,d.x67)(e,n),v=(0,l.YC)(n)?(0,d.ccz)(e,n):void 0,f=Z||v,P=(0,d.FM1)(e,n),E="thread"===a&&o===r._f,y="thread"===a&&o!==r._f,b=(0,d.Jf5)(e,i),C=Boolean(g&&(0,d.s4q)(e,g.id)),w=!C&&Boolean((0,d.pkN)(e,n)),S=Boolean((E||s.isForum)&&(u||(0,l.ZV)(s))&&s.isNotJoined),N=E||y,I=c.Bi&&(0,l.YC)(s.id)&&!P&&!g,M=E&&!P&&!S,k=E&&!S,x=c.Bi&&E&&s.isCallActive,T=c.Bi&&E&&!s.isCallActive&&(s.adminRights?.manageCall||s.isCreator&&(0,l.G9)(s)),A=E&&Z?.canViewStatistics,O=E?Z?.requestsPending:void 0,R=Boolean(s?.isNotJoined&&s.isJoinToSend),D=Boolean(s?.isNotJoined&&s.isJoinRequest),L=!(0,d.FOo)(e),F=Boolean((0,d.lpX)(e,n));return{noMenu:!1,isChannel:u,isRightColumnShown:b,canStartBot:w,canRestartBot:C,canSubscribe:S,canSearch:N,canCall:I,canMute:M,canViewStatistics:A,canLeave:k,canEnterVoiceChat:x,canCreateVoiceChat:T,pendingJoinRequests:O,shouldJoinToSend:R,shouldSendJoinRequest:D,noAnimation:L,canTranslate:(0,d.GDM)(e,n)&&!f?.isTranslationDisabled,isTranslating:F,translationLanguage:h,language:m,doNotTranslate:p,detectedChatLanguage:s.detectedLanguage}}))((e=>{let{chatId:t,threadId:n,noMenu:l,isMobile:d,isChannel:g,canStartBot:Z,canRestartBot:y,canSubscribe:C,canSearch:w,canCall:S,canMute:N,canViewStatistics:I,canLeave:M,canEnterVoiceChat:k,canCreateVoiceChat:x,pendingJoinRequests:T,isRightColumnShown:A,isForForum:O,canExpandActions:R,shouldJoinToSend:D,shouldSendJoinRequest:L,noAnimation:F,canTranslate:B,isTranslating:U,translationLanguage:$,language:j,detectedChatLanguage:H,doNotTranslate:_,onTopicSearch:Y}=e;const{joinChannel:z,sendBotCommand:V,openLocalTextSearch:X,restartBot:q,requestMasterAndRequestCall:W,requestNextManagementScreen:G,showNotification:K,openChat:J,requestChatTranslation:Q,togglePeerTranslations:ee,openChatLanguageModal:te,setSettingOption:ne}=(0,i.Sv)(),oe=(0,o.sO)(null),ae=(0,m.Z)(),[ie,re]=(0,o.eJ)(!1),[se,ce]=(0,o.eJ)(void 0),le=(0,u.Z)((()=>{re(!0);const e=oe.current.getBoundingClientRect();ce({x:e.right,y:e.bottom})})),de=(0,u.Z)((()=>{re(!1)})),ue=(0,u.Z)((()=>{ce(void 0)})),me=(0,u.Z)((()=>{z({chatId:t}),L&&K({message:ae(g?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),he=(0,u.Z)((()=>{V({command:"/start"})})),pe=(0,u.Z)((()=>{q({chatId:t})})),ge=(0,u.Z)((()=>{Q(U?{chatId:t,toLanguageCode:void 0}:{chatId:t,toLanguageCode:$})})),Ze=(0,u.Z)((()=>{G({screen:s.u1.JoinRequests})})),ve=(0,u.Z)((()=>{O?Y?.():(X(),d?document.querySelector("#MobileSearch input").focus():F?(0,a.i$)((()=>{(0,a.Yq)(b)})):setTimeout(b,320))})),fe=(0,u.Z)((()=>{J({id:t,threadId:r._f})})),Pe=(0,u.Z)((e=>{w&&c.RM&&!e.shiftKey&&(e.preventDefault(),ve())})),Ee=(0,u.Z)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=ae(n);if(o!==n)return ae(e,o);const a=new Intl.DisplayNames([j],{type:"language"}).of(t);return ae(`${e}Other`,a)})),ye=(0,o.Ye)((()=>U?ae("ShowOriginalButton"):Ee("TranslateToButton",$)),[$,Ee,U,ae]),be=(0,o.Ye)((()=>{if(H)return Ee("DoNotTranslateLanguage",H)}),[Ee,H]),Ce=(0,u.Z)((()=>{ee({chatId:t,isEnabled:!1}),Q({chatId:t,toLanguageCode:void 0})})),we=(0,u.Z)((()=>{te({chatId:t})})),Se=(0,u.Z)((()=>{H&&(ne({doNotTranslate:[..._,H]}),Q({chatId:t,toLanguageCode:void 0}),K({message:Ee("AddedToDoNotTranslate",H)}))}));(0,h.y)({"Mod+F":Pe});const Ne=(0,o.Ye)((()=>e=>{let{onTrigger:t,isOpen:n}=e;return o.ZP.createElement(p.Z,{round:!0,ripple:A,color:"translucent",size:"smaller",className:n?"active":"",onClick:t,ariaLabel:ae("TranslateMessage")},o.ZP.createElement("i",{className:"icon icon-language","aria-hidden":!0}))}),[A,ae]);return o.ZP.createElement("div",{className:"HeaderActions"},!O&&B&&o.ZP.createElement(f.Z,{className:"stickers-more-menu with-menu-transitions",trigger:Ne,positionX:"right"},o.ZP.createElement(P.Z,{icon:"language",onClick:ge},ye),o.ZP.createElement(P.Z,{icon:"replace",onClick:we},ae("Chat.Translate.Menu.To")),o.ZP.createElement(E.Z,null),H&&o.ZP.createElement(P.Z,{icon:"hand-stop",onClick:Se},be),o.ZP.createElement(P.Z,{icon:"close-circle",onClick:Ce},ae("Hide"))),!d&&o.ZP.createElement(o.ZP.Fragment,null,R&&!L&&(C||D)&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:me},ae(g?"ProfileJoinChannel":"ProfileJoinGroup")),R&&L&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:me},ae("ChannelJoinRequest")),R&&Z&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:he},ae("BotStart")),R&&y&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:pe},ae("BotRestart")),w&&o.ZP.createElement(p.Z,{round:!0,ripple:A,color:"translucent",size:"smaller",onClick:ve,ariaLabel:ae("Conversation.SearchPlaceholder")},o.ZP.createElement("i",{className:"icon icon-search","aria-hidden":!0})),S&&o.ZP.createElement(p.Z,{round:!0,color:"translucent",size:"smaller",onClick:function(){W({userId:t})},ariaLabel:"Call"},o.ZP.createElement("i",{className:"icon icon-phone","aria-hidden":!0}))),!O&&Boolean(T)&&o.ZP.createElement(p.Z,{round:!0,className:"badge-button",ripple:A,color:"translucent",size:"smaller",onClick:Ze,ariaLabel:ae(g?"SubscribeRequests":"MemberRequests")},o.ZP.createElement("i",{className:"icon icon-user","aria-hidden":!0}),o.ZP.createElement("div",{className:"badge"},T)),o.ZP.createElement(p.Z,{ref:oe,className:ie?"active":"",round:!0,ripple:!d,size:"smaller",color:"translucent",disabled:l,ariaLabel:"More actions",onClick:le},o.ZP.createElement("i",{className:"icon icon-more","aria-hidden":!0})),se&&o.ZP.createElement(v,{chatId:t,threadId:n,isOpen:ie,anchor:se,withExtraActions:d||!R,isChannel:g,canStartBot:Z,canRestartBot:y,canSubscribe:C,canSearch:w,canCall:S,canMute:N,canViewStatistics:I,canLeave:M,canEnterVoiceChat:k,canCreateVoiceChat:x,pendingJoinRequests:T,onJoinRequestsClick:Ze,withForumActions:O,onSubscribeChannel:me,onSearchClick:ve,onAsMessagesClick:fe,onClose:de,onCloseAnimationEnd:ue}))})));function b(){document.querySelector(".RightHeader .SearchInput input")?.focus()}},93219:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"CustomEmojiTooltip",!t);return n?o.ZP.createElement(n,e):void 0}},67146:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"CustomSendMenu",!t);return n?o.ZP.createElement(n,e):void 0}},12420:(e,t,n)=>{n.d(t,{t:()=>h,Z:()=>p});var o=n(60748),a=n(31212),i=n(46752),r=n(21262),s=n(23989),c=n(25190),l=n(87204),d=n(62898),u=n(60706);const m=(0,o.X$)((e=>{let{isQuick:t,isGeneric:n,onFileSelect:a}=e;const[r,s,c]=(0,u.Z)(),l=(0,i.Z)("DropTarget",r&&"hovered");return o.ZP.createElement("div",{className:l,onDrop:a,onDragEnter:s,onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),c()},"data-dropzone":!0},o.ZP.createElement("div",{className:"target-content"},o.ZP.createElement("div",{className:"icon icon-"+(t?"photo":"document")}),o.ZP.createElement("div",{className:"title"},"Drop files here to send them"),!n&&o.ZP.createElement("div",{className:"description"},t?"in a quick way":"without compression")))}));let h=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const p=(0,o.X$)((e=>{let{isOpen:t,withQuick:n,onHide:u,onFileSelect:h}=e;const p=(0,o.sO)(null),g=(0,l.Z)(n),{shouldRender:Z,transitionClassNames:v}=(0,a.Z)(t);(0,o.d4)((()=>t?(0,s.Z)(u):void 0),[t,u]);const f=(0,c.Z)((async e=>{const{dataTransfer:t}=e;let o=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,r.Z)(t.items);e?.length&&(o=o.concat(e))}}else o=o.concat(Array.from(t.files));u(),h(o,!n&&void 0)})),P=(0,c.Z)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(u(),h(Array.from(t.files),!0))})),E=(0,c.Z)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;t.matches(".DropTarget, .DropArea")&&!n&&(p.current=window.setTimeout((()=>{u()}),150))}));if(!Z)return;const y=n||g,b=(0,i.Z)("DropArea",v);return o.ZP.createElement(d.Z,{containerId:"#middle-column-portals"},o.ZP.createElement("div",{className:b,onDragLeave:E,onDragOver:()=>{p.current&&window.clearTimeout(p.current)},onDrop:u,onClick:u},o.ZP.createElement(m,{onFileSelect:f,isGeneric:!y}),y&&o.ZP.createElement(m,{onFileSelect:P,isQuick:!0})))}))},19830:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"EmojiTooltip",!t);return n?o.ZP.createElement(n,e):void 0}},49841:(e,t,n)=>{n.d(t,{Z:()=>_});var o=n(60748),a=n(57710),i=n(33555),r=n(83716),s=n(601),c=n(7054),l=n(69118),d=n(65723),u=n(46752),m=n(517),h=n(98069),p=n(94462),g=n(96391),Z=n(32340),v=n(25190),f=n(60706),P=n(18674),E=n(59107),y=n(84089),b=n(74288),C=n(28712),w=n(74753);function S(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class N{constructor(e,t,n){this.container=t,this.options=n,S(this,"video",void 0),S(this,"isPlaying",!1),this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,a.WM)((()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()}))}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,w.Z)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,a.i$)((()=>{if(!this.video)return;const o=this.video,{width:i,height:r}=this.container.getBoundingClientRect();(0,a.WM)((()=>{o.style.left=`${Math.round(t*i)}px`,o.style.top=`${Math.round(n*r)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`}))}))}}var I=n(74399),M=n(27370),k=n(22268),x=n(78722),T=n(45332),A=n(3927),O=n(92085),R=n(274);const D=1.25*I.Gw;var L=n(42797),F=n(86203),B=n(72087),U=n(4292);const $="input-scroller",j=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],_=(0,o.X$)((0,i.c$)(((e,t)=>{let{chatId:n,threadId:o}=t;const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyingToId:n&&o?(0,c.Yyv)(e,n,o):void 0,isSelectModeActive:(0,c.CAb)(e),canPlayAnimatedEmojis:(0,c.W9H)(e)}}))((e=>{let{ref:t,id:n,chatId:w,captionLimit:S,isAttachmentModalInput:I,isStoryInput:_,customEmojiPrefix:Y,editableInputId:z,isReady:V,isActive:X,getHtml:q,placeholder:W,timedPlaceholderLangKey:G,timedPlaceholderDate:K,forcedPlaceholder:J,canSendPlainText:Q,canAutoFocus:ee,noFocusInterception:te,shouldSuppressFocus:ne,shouldSuppressTextFormatter:oe,replyingToId:ae,isSelectModeActive:ie,canPlayAnimatedEmojis:re,messageSendKeyCombo:se,onUpdate:ce,onSuppressedFocus:le,onSend:de,onScroll:ue,onFocus:me,onBlur:he}=e;const{editLastMessage:pe,replyToNextMessage:ge,showAllowedMessageTypesNotification:Ze}=(0,i.Sv)();let ve=(0,o.sO)(null);t&&(ve=t);const fe=(0,o.sO)(null),Pe=(0,o.sO)(null),Ee=(0,o.sO)(null),ye=(0,o.sO)(null),be=(0,o.sO)(null),Ce=(0,o.sO)(null),we=(0,E.Z)(),Se=(0,o.sO)(!1),[Ne,Ie,Me]=(0,f.Z)(),[ke,xe]=(0,o.eJ)(),[Te,Ae]=(0,o.eJ)(),[Oe,Re]=(0,o.eJ)(!1),{isMobile:De}=(0,L.ZP)(),Le=De&&(s.cj||s.wZ),[Fe,Be]=(0,o.eJ)(!1);(0,o.d4)((()=>{Be(Boolean(G&&K))}),[K,G]);const Ue=(0,v.Z)((()=>{Be(!1)}));!function(e,t,n,r,s,l,d,u,m){const h=(0,O.Z)(t,!u),p=(0,k.Z)(h,!0),g=(0,o.sO)(new Map),Z=(0,v.Z)((e=>{e.forEach((e=>{const t=g.current.get(e);t&&(t.destroy(),g.current.delete(e))}))})),f=(0,v.Z)((()=>{if(!(u&&t.current&&n.current&&r.current))return;const e=(0,i.Rd)(),o=new Set(g.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const a=`${l}${t.dataset.uniqueId}${h||""}`,i=t.dataset.documentId;o.delete(a);const u=(0,b.XH)(i);if(!u)return;const m=n.current.getBoundingClientRect(),Z=t.getBoundingClientRect(),v=(0,C.NM)((Z.left-m.left)/m.width,4),f=(0,C.NM)((Z.top-m.top)/m.height,4);if(g.current.has(a))return void g.current.get(a).updatePosition(v,f);const P=e.customEmojis.byId[i];if(!P)return;const E=P?.stickerSetInfo&&(0,c.Si0)(e,P.stickerSetInfo),w=[l,i,h].filter(Boolean).join("_");(async function(e){let{customEmoji:t,sharedCanvasRef:n,sharedCanvasHqRef:o,absoluteContainerRef:a,renderId:i,viewId:r,mediaUrl:s,position:c,isHq:l,textColor:d,colorFilter:u}=e;if(t.isLottie){const e=t.shouldUseTextColor&&d?(0,M.oo)(d):void 0,a=(await(0,y.t)()).init(s,l?o.current:n.current,i,{size:D,coords:c,isLowPriority:!l},r,e?[e.r,e.g,e.b]:void 0);return{play:()=>a.play(),pause:()=>a.pause(),destroy:()=>a.removeView(r),updatePosition:(e,t)=>a.setSharedCanvasCoords(r,{x:e,y:t})}}if(t.isVideo){const e=t.shouldUseTextColor&&u?`filter: ${u};`:void 0,n=new N(s,a.current,{size:D,position:c,style:e});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:P,sharedCanvasRef:n,sharedCanvasHqRef:r,absoluteContainerRef:s,renderId:w,viewId:a,mediaUrl:u,isHq:E,position:{x:v,y:f},textColor:h,colorFilter:p}).then((e=>{d&&e.play(),g.current.set(a,e)}))})),Z(Array.from(o))}));(0,o.d4)((()=>(0,b.bn)(f)),[f]),(0,o.d4)((()=>{e()&&t.current&&n.current&&m&&u?(0,a.i$)((()=>{f()})):Z(Array.from(g.current.keys()))}),[e,f,t,Z,n,m,u]),(0,o.bt)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")}),[p]),(0,R.Z)((e=>{let[t]=e;void 0!==t&&h!==t&&f()}),[h,f]);const P=(0,A.Z)(f,[f],300,!1);(0,x.Z)(n,P);const E=(0,v.Z)((()=>{g.current.forEach((e=>{e.pause()}))})),w=(0,v.Z)((()=>{d&&g.current?.forEach((e=>{e.play()}))})),S=(0,v.Z)((()=>{(0,a.i$)(w)}));(0,T.Z)(E,S)}(q,ve,ye,be,Ce,Y,re,V,X);const $e=I?160:_?128:De?256:416,je=(0,v.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,a.lT)((()=>{const t=ve.current.closest(".input-scroller"),n=Number(t.style.height.replace("px","")),o=Ee.current,{scrollHeight:i}=o,r=Math.min(i,$e);if(r===n)return;const s=i>$e;function c(){const e=Math.round(50*Math.log(Math.abs(r-n)));t.style.height=`${r}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",s)}return e?void(0,a.WM)(c):c}))}));(0,o.bt)((()=>{I&&je(!1)}),[I,je]);const He=(0,o.sO)(q());(0,o.bt)((()=>{const e=X?q():"";e!==ve.current.innerHTML&&(ve.current.innerHTML=e),e!==Pe.current.innerHTML&&(Pe.current.innerHTML=e),e!==He.current&&(He.current=e,je(!e))}),[q,X,je]),(0,o.sO)(w).current=w;const _e=(0,v.Z)((()=>{ve.current&&((0,P.zG)()?setTimeout(_e,350):(0,d.Z)(ve.current))})),Ye=(0,v.Z)((()=>{Me(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function ze(){if(s.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Se.current)return Me(),s.wZ&&Re(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(oe||!(0,g.R)(t,z||r.R2F)||!n||(0,p.Z)(n)||!t.START_TO_END)||(Me(),!1)}function Ve(){if(!ze())return;if(Oe)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=ve.current.closest(".input-scroller").getBoundingClientRect();let o=t.left+t.width/2-n.left;o<j?o=j:o>n.width-j&&(o=n.width-j),xe({x:o,y:t.top-n.top}),Ae(e),Ie()}function Xe(){fe.current&&window.clearTimeout(fe.current),fe.current=window.setTimeout(Ve,260)}(0,o.d4)((()=>{s.$b||ee&&_e()}),[w,_e,ae,ee]),(0,o.d4)((()=>{if(!w||z!==r.R2F||te||Le||ie)return;const e=e=>{if((0,h.wT)())return;const{key:t}=e,n=e.target;if(!n||H.includes(t))return;const o=ve.current,a=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!a||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&o&&n!==o&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,d.Z)(o,!0,!0);const t=new KeyboardEvent(e.type,e);o.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[w,z,Le,ie,te]),(0,o.d4)((()=>{const e=(0,l.Ds)((e=>{"Tab"!==e.key||(0,h.wT)()||(e.preventDefault(),(0,a.WM)(_e))}),2e3,!0,!1);return(0,m.Z)({onTab:e})}),[_e]),(0,o.d4)((()=>{const e=ve.current;function t(){e.blur()}return ne&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[ne]);const qe=(0,F.Z)((()=>Boolean(X&&q())),[X,q]),We=(0,u.Z)("form-control allow-selection",qe&&"touched",ne&&"focus-disabled");return o.ZP.createElement("div",{id:n,onClick:ne?le:void 0,dir:we.isRtl?"rtl":void 0},o.ZP.createElement("div",{className:(0,u.Z)("custom-scroll",$),onScroll:ue,onClick:I||Q?void 0:function(){I||Q||Ze({chatId:w})}},o.ZP.createElement("div",{className:"input-scroller-content"},o.ZP.createElement("div",{ref:ve,id:z||r.R2F,className:We,contentEditable:I||Q,role:"textbox",dir:"auto",tabIndex:0,onClick:_e,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ce("<br>"===t?"":t),!s.$b&&(!n||!n.length)&&(s.op||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(ve.current.blur(),e.removeAllRanges(),(0,d.Z)(ve.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=q();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void ge({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Xe,{once:!0}):(e.preventDefault(),pe()):!Le&&("enter"===se&&!e.shiftKey||"ctrl-enter"===se&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),Me(),de())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{Se.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Se.current||(Se.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",Xe,{once:!0})},onContextMenu:s.wZ?function(e){ze()&&(Re(!Oe),Oe?Me():(e.preventDefault(),e.stopPropagation(),Ve()))}:void 0,onTouchCancel:s.wZ?Xe:void 0,"aria-label":W,onFocus:me,onBlur:he}),!J&&o.ZP.createElement("span",{className:(0,u.Z)("placeholder-text",!I&&!Q&&"with-icon"),dir:"auto"},!I&&!Q&&o.ZP.createElement("i",{className:"icon icon-lock-badge placeholder-icon"}),Fe?o.ZP.createElement(U.Z,{langKey:G,endsAt:K,onEnd:Ue}):W),o.ZP.createElement("canvas",{ref:ye,className:"shared-canvas"}),o.ZP.createElement("canvas",{ref:be,className:"shared-canvas"}),o.ZP.createElement("div",{ref:Ce,className:"absolute-video-container"}))),o.ZP.createElement("div",{ref:Ee,className:(0,u.Z)("custom-scroll",$,"clone")},o.ZP.createElement("div",{className:"input-scroller-content"},o.ZP.createElement("div",{ref:Pe,className:(0,u.Z)(We,"clone"),dir:"auto"}))),void 0!==S&&o.ZP.createElement("div",{className:"max-length-indicator",dir:"auto"},S),o.ZP.createElement(B.Z,{isOpen:Ne,anchorPosition:ke,selectedRange:Te,setSelectedRange:Ae,onClose:Ye}),J&&o.ZP.createElement("span",{className:"forced-placeholder"},(0,Z.Z)(J)))})))},23522:(e,t,n)=>{n.d(t,{Z:()=>Z});var o=n(60748),a=n(33555),i=n(83716),r=n(46752),s=n(25190),c=n(60706),l=n(12644),d=n(231),u=n(49204),m=n(43521),h=n(99203),p=n(48778);const g=e=>{const{isOpen:t}=e,n=(0,p.Z)(h.gl.Extra,"SymbolMenu",!t);return n?o.ZP.createElement(n,e):void 0},Z=(0,o.X$)((e=>{let{chatId:t,threadId:n,isMobile:h,canSendGifs:p,canSendStickers:Z,isMessageComposer:v,isReady:f,isSymbolMenuOpen:P,idPrefix:E,isAttachmentModal:y,canSendPlainText:b,isSymbolMenuForced:C,className:w,forceDarkTheme:S,inputCssSelector:N=i.Edp,openSymbolMenu:I,closeSymbolMenu:M,onCustomEmojiSelect:k,onStickerSelect:x,onGifSelect:T,onRemoveSymbol:A,onEmojiSelect:O,closeBotCommandMenu:R,closeSendAsMenu:D}=e;const{setStickerSearchQuery:L,setGifSearchQuery:F,addRecentEmoji:B,addRecentCustomEmoji:U}=(0,a.Sv)(),$=(0,o.sO)(null),[j,H]=(0,c.Z)(),[_,Y]=(0,o.eJ)(void 0),z=(0,r.Z)("mobile-symbol-menu-button",!f&&"not-ready",j?P&&"menu-opened":P&&"is-loading"),V=(0,s.Z)((()=>{R?.(),D?.(),I();const e=$.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();Y({x:t,y:n})})),X=(0,s.Z)((e=>{"stickers"===e?(L({query:""}),F({query:void 0})):(F({query:""}),L({query:void 0}))})),q=(0,s.Z)((()=>{const e=document.querySelector(y?i.VEm:N);h&&e===document.activeElement?(e?.blur(),setTimeout((()=>{R?.(),I()}),100)):I()})),W=(0,s.Z)((()=>$.current)),G=(0,s.Z)((()=>$.current?.closest(".custom-scroll, .no-scrollbar"))),K=(0,s.Z)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),J=(0,s.Z)((()=>({withPortal:!0}))),{positionX:Q,positionY:ee,transformOriginX:te,transformOriginY:ne,style:oe}=(0,l.Z)(_,W,G,K,J);return o.ZP.createElement(o.ZP.Fragment,null,h?o.ZP.createElement(d.Z,{className:z,round:!0,color:"translucent",onClick:P?M:q,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon icon-smile"}),o.ZP.createElement("i",{className:"icon icon-keyboard"}),P&&!j&&o.ZP.createElement(u.Z,{color:"gray"})):o.ZP.createElement(m.Z,{className:(0,r.Z)("symbol-menu-button",P&&"activated"),round:!0,color:"translucent",onActivate:V,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("div",{ref:$,className:"symbol-menu-trigger"}),o.ZP.createElement("i",{className:"icon icon-smile"})),o.ZP.createElement(g,{chatId:t,threadId:n,isOpen:P||Boolean(C),canSendGifs:p,canSendStickers:Z,isMessageComposer:v,idPrefix:E,onLoad:H,onClose:M,onEmojiSelect:O,onStickerSelect:x,onCustomEmojiSelect:k,onGifSelect:T,onRemoveSymbol:A,onSearchOpen:X,addRecentEmoji:B,addRecentCustomEmoji:U,isAttachmentModal:y,canSendPlainText:b,className:(0,r.Z)(w,S&&"component-theme-dark"),positionX:y?Q:void 0,positionY:y?ee:void 0,transformOriginX:y?te:void 0,transformOriginY:y?ne:void 0,style:y?oe:void 0}))}))},72087:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(6137),i=n(83716),r=n(46752),s=n(81396),c=n(23989),l=n(44139),d=n(3858),u=n(25190),m=n(31212),h=n(58758),p=n(60706),g=n(59107),Z=n(231);const v={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},f=document.createElement("div"),P=(0,o.X$)((e=>{let{isOpen:t,anchorPosition:n,selectedRange:P,setSelectedRange:E,onClose:y}=e;const b=(0,o.sO)(null),C=(0,o.sO)(null),{shouldRender:w,transitionClassNames:S}=(0,m.Z)(t),[N,I,M]=(0,p.Z)(),[k,x]=(0,o.eJ)(""),[T,A]=(0,o.eJ)(!1),[O,R]=(0,o.eJ)(),[D,L]=(0,o.eJ)({});(0,o.d4)((()=>t?(0,c.Z)(y):void 0),[t,y]),(0,h.Z)(t,b,y,!0),(0,o.d4)((()=>{N?C.current.focus():(x(""),A(!1))}),[N]),(0,o.d4)((()=>{w||(M(),L({}),R(void 0))}),[M,w]),(0,o.d4)((()=>{if(!t||!P)return;const e={};let{parentElement:n}=P.commonAncestorContainer;for(;n&&n.id!==i.R2F;){const t=v[n.tagName];t&&(e[t]=!0),n=n.parentElement}L(e)}),[t,P,I]);const F=(0,u.Z)((()=>{if(!P)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(P))})),B=(0,u.Z)((()=>{const e=window.getSelection();e&&E(e.getRangeAt(0))})),U=(0,u.Z)((e=>{if(P)return f.replaceChildren(P.cloneContents()),e&&f.querySelectorAll(l.fJ).forEach((e=>{e.replaceWith(e.getAttribute("alt"))})),f.innerHTML})),$=(0,u.Z)((()=>{if(P)return P.commonAncestorContainer.parentElement}));function j(){const e=C.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:o}=e;if(n<=t)return void R(void 0);let a="";o<n-t&&(a="mask-right"),o>0&&(a+=" mask-left"),R(a)}function H(e){if(D[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(D).some((t=>t!==e&&Boolean(D[t]))))return"disabled"}else if(D.monospace||D.strikethrough)return"disabled"}const _=(0,u.Z)((()=>{if(D.spoiler){const e=$();if(!P||!e||e.dataset.entityType!==a.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,spoiler:!1})))}const e=U();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${a.Vv.Spoiler}">${e}</span>`),y()})),Y=(0,u.Z)((()=>{L((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!Boolean(e[t])||document.execCommand(t)})),B(),{...e,bold:!e.bold})))})),z=(0,u.Z)((()=>{document.execCommand("italic"),B(),L((e=>({...e,italic:!e.italic})))})),V=(0,u.Z)((()=>{document.execCommand("underline"),B(),L((e=>({...e,underline:!e.underline})))})),X=(0,u.Z)((()=>{if(D.strikethrough){const e=$();if(!P||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,strikethrough:!1})))}const e=U();document.execCommand("insertHTML",!1,`<del>${e}</del>`),y()})),q=(0,u.Z)((()=>{if(D.monospace){const e=$();if(!P||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,monospace:!1})))}const e=U(!0);document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),y()})),W=(0,u.Z)((()=>{const e=((0,s.X)(k)||"").split("%").map(encodeURI).join("%");if(T){const t=$();if(!t||"A"!==t.tagName)return;return t.href=e,void y()}const t=U(!0);F(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),y()})),G=(0,u.Z)((e=>{const t={k:I,b:Y,u:V,i:z,m:q,s:X,p:_}[function(e){const t=e.key||e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}));(0,o.d4)((()=>(t&&document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G))),[t,G]);const K=(0,g.Z)();if(!w)return;const J=(0,r.Z)("TextFormatter",S,N&&"link-control-shown"),Q=(0,r.Z)("TextFormatter-link-url-confirm",Boolean(k.length)&&"shown"),ee=n?`left: ${n.x}px; top: ${n.y}px;--text-formatter-left: ${n.x}px;`:"";return o.ZP.createElement("div",{ref:b,className:J,style:ee,onKeyDown:function(e){"Enter"===e.key&&N&&(W(),e.preventDefault())},onMouseDown:d.Z},o.ZP.createElement("div",{className:"TextFormatter-buttons"},o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Spoiler text",className:H("spoiler"),onClick:_},o.ZP.createElement("i",{className:"icon icon-eye-closed"})),o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Bold text",className:H("bold"),onClick:Y},o.ZP.createElement("i",{className:"icon icon-bold"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Italic text",className:H("italic"),onClick:z},o.ZP.createElement("i",{className:"icon icon-italic"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Underlined text",className:H("underline"),onClick:V},o.ZP.createElement("i",{className:"icon icon-underlined"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:H("strikethrough"),onClick:X},o.ZP.createElement("i",{className:"icon icon-strikethrough"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Monospace text",className:H("monospace"),onClick:q},o.ZP.createElement("i",{className:"icon icon-monospace"})),o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:K("TextFormat.AddLinkTitle"),onClick:I},o.ZP.createElement("i",{className:"icon icon-link"}))),o.ZP.createElement("div",{className:"TextFormatter-link-control"},o.ZP.createElement("div",{className:"TextFormatter-buttons"},o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:K("Cancel"),onClick:M},o.ZP.createElement("i",{className:"icon icon-arrow-left"})),o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement("div",{className:(0,r.Z)("TextFormatter-link-url-input-wrapper",O)},o.ZP.createElement("input",{ref:C,className:"TextFormatter-link-url-input",type:"text",value:k,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){x(e.target.value),j()},onScroll:j})),o.ZP.createElement("div",{className:Q},o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:K("Save"),className:"color-primary",onClick:W},o.ZP.createElement("i",{className:"icon icon-check"}))))))}))},21262:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(71394);async function a(e){const t=[];function n(e,o){return new Promise((a=>{if(e instanceof File)t.push(e),a(e);else if(e.isFile){const n=o.getAsFile();e.file((e=>{t.push(e),a(e)}),(()=>{n&&t.push(n),a(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let a=0;a<e.length;a++)t.push(n(e[a],o));a(Promise.all(t))}))}))}const a=[];for(let t=0;t<e.length;t++){const o=e[t];if("file"===o.kind){const e=o.webkitGetAsEntry()||o.getAsFile();e&&a.push(n(e,o))}}return await Promise.all(a),(0,o.ox)(t)}},52400:(e,t,n)=>{n.d(t,{_:()=>s});const o=/(<br>|<br\s?\/>)/g,a=/( |\u00A0)/g,i=/(<div>|<\/div>)/gi,r=/\n$/i;function s(e){return e.replace(a," ").replace(o,"\n").replace(i,"").replace(r,"")}},96391:(e,t,n)=>{function o(e,t){const{commonAncestorContainer:n}=e;let o=n,a=1;for(;o&&o.id!==t&&a<5;)o=o.parentElement,a++;return Boolean(o&&o.id===t)}n.d(t,{R:()=>o})},60130:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33681),i=n(57710),r=n(33555),s=n(83716),c=n(601),l=n(41098),d=n(65723),u=n(44139),m=n(25190),h=n(86203),p=n(60706),g=n(71790),Z=n(11309);const v=new RegExp(`(${a.Z.source})$`,"g"),f=new RegExp(`${s.t8f.source}$`,"g");function P(e,t,n,P,E,y){const{loadCustomEmojiForEmoji:b,clearCustomEmojiForEmoji:C}=(0,r.Sv)(),[w,S,N]=(0,p.Z)(!1),I=(0,Z.CH)((()=>{const n=t();if(e&&n&&P()?.collapsed&&n.match(c.op?a.Z:s.t8f))return(0,l.gJ)(E.current).match(c.op?v:f)?.[0]}),[t,P,E,e],300),M=(0,g.Z)(I,[I,t,P],!0),k=(0,h.Z)((()=>Boolean(M())),[M]),x=Boolean(y?.length);(0,o.d4)((()=>{if(!e||!k)return;const t=M();t?x||b({emoji:c.op?t:t.match(/.+alt="(.+)"/)?.[1]}):C()}),[e,k,M,x,C,b]);const T=(0,m.Z)((t=>{const o=M();if(!e||!o)return;const a=E.current,r=(0,l.gJ)(a),s=c.op?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),m=new RegExp(`(${s})\\1*$`,""),h=r.match(m)[0].length/o.length,p=r.replace(m,(0,u.yR)(t).repeat(h)),g=a.innerHTML.substring(r.length);n(`${p}${g}`),(0,i.Yq)((()=>{(0,d.Z)(a,!0,!0)}))}));return(0,o.d4)(N,[N,t]),{isCustomEmojiTooltipOpen:Boolean(k&&x&&!w),closeCustomEmojiTooltip:S,insertCustomEmoji:T}}},28353:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(60748),a=n(57710),i=n(33555),r=n(34284),s=n(83716),c=n(60782),l=n(70735),d=n(52400),u=n(65723),m=n(16580),h=n(32340),p=n(7054),g=n(44139),Z=n(25190),v=n(60706),f=n(71790),P=n(11309);let E,y,b,C,w;const S=(0,m.Z)((function(e,t,n){return e&&t.length?Object.values((0,c.q0)(e,t)).slice(0,n):l.D})),N=(0,m.Z)((function(e,t,n){const o=Object.values(e),a=(0,c.ee)(o,"native"),i=t?(0,c.Q8)(t,(e=>Object.values((0,c.q0)(a,e)))):{},r=n?(0,c.Q8)(n,(e=>Object.values((0,c.q0)(a,e)))):{},s={...i,...r},l=[].concat(Object.keys(i),Object.keys(r)),d=o.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),u=Object.keys(d),m=l.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:s,keywords:l,byName:d,names:u,maxKeyLength:m}})),I=(0,m.Z)((function(e,t,n){const{byKeyword:o,keywords:a,byName:i,names:r,maxKeyLength:s}=e;let d=[];if(t.length>s)return l.D;const u=a.filter((e=>e.startsWith(t))).sort();d=d.concat(Object.values((0,c.q0)(o,u)).flat());const m=r.filter((e=>e.startsWith(t)));return d=d.concat(Object.values((0,c.q0)(i,m)).flat()),d=(0,c.Tw)(d),d.length?d.slice(0,n):l.D}));try{C=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,w=/\p{Ll}/u}catch(e){C=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,w=/[a-zяёґєії]/}function M(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.R2F,m=arguments.length>4?arguments[4]:void 0,E=arguments.length>5?arguments[5]:void 0,y=arguments.length>6?arguments[6]:void 0;const[M,x,T]=(0,v.Z)(!1),[A,O]=(0,o.eJ)(),[R,D]=(0,o.eJ)(l.D),[L,F]=(0,o.eJ)(l.D);(0,o.d4)((()=>{function t(){O(b.emojis)}e&&(b?t():k().then(t))}),[e]);const B=(0,P.CH)((()=>{const n=t();return e&&n.includes(":")?(0,d._)(n).match(C)?.[0].trim():void 0}),[t,e],300),U=(0,f.Z)(B,[B,t],!0),$=(0,Z.Z)((e=>{if(D(e),e===l.D)return void F(l.D);const t=e.map((e=>e.native)),n=(0,c.od)((0,p.iXW)((0,i.Rd)(),t),"id");F(n)})),j=(0,Z.Z)((function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=t();if(!i)return;const c=i.lastIndexOf(":",o?i.lastIndexOf(":")-1:void 0);if(-1!==c){const t="string"==typeof e?(0,h.Z)(e,["emoji_html"]):(0,g.yR)(e);n(`${i.substring(0,c)}${t}`);const o=r===s.R2F?document.querySelector(s.Edp):document.getElementById(r);(0,a.Yq)((()=>{(0,u.Z)(o,!0,!0)}))}$(l.D)}));return(0,o.d4)((()=>{const e=U();if(!e||!A)return void $(l.D);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let o=l.D;if(n){if(1===n.length&&w.test(n)||n.length>=2){const e=N(A,E,y);o=I(e,n.toLowerCase(),36)}}else o=S(A,m,36);o.length?t?j(o[0].native,!0):$(o):$(l.D)}),[E,A,U,y,j,m,$]),(0,o.d4)(T,[T,t]),{isEmojiTooltipOpen:Boolean(R.length||L.length)&&!M,closeEmojiTooltip:x,filteredEmojis:R,filteredCustomEmojis:L,insertEmoji:j}}async function k(){return E||(E=n.e(7501).then(n.t.bind(n,47501,19)),y=(await E).default,b=(0,r.NM)(y)),E}},29295:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(33555),i=n(57710),r=n(6137),s=n(48670),c=n(52400),l=n(65723),d=n(60782),u=n(41098),m=n(25190),h=n(60706),p=n(71790),g=n(11309);let Z;try{Z=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){Z=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function v(e,t,n,v,P,E,y,b){const[C,w]=(0,o.eJ)(),[S,N,I]=(0,h.Z)(!1),M=(0,g.CH)((()=>{const n=t();if(!e||!v()?.collapsed||!n.includes("@"))return;const o=(0,u.gJ)(P.current);return(0,c._)(o).match(Z)?.[0].trim()}),[e,t,v,P],300),k=(0,p.Z)(M,[M,t,v],!0),x=(0,p.Z)((()=>e&&t().startsWith("@")),[t,e]);(0,o.d4)((()=>{const e=k();if(!e||!E&&!y)return void w(void 0);const t=(0,a.Rd)().users.byId;if(!t)return void w(void 0);const n=E?.reduce(((e,t)=>(t.userId!==b&&e.push(t.userId),e)),[]),o=e.substring(1),i=(0,s.kK)((0,d.Tw)([...x()&&y||[],...n||[]]),t,o);w(Object.values((0,d.q0)(t,i)))}),[b,E,y,k,x]);const T=(0,m.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.usernames&&!(0,s.Vl)(e))return;const o=(0,s.WS)(e),a=(0,s.Vl)(e)||"",c=o?`@${o}`:`<a\n class="text-entity-link"\n data-entity-type="${r.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${a}</a>`,d=P.current,m=(0,u.gJ)(d),h=f(m),p=h.lastIndexOf("@"),g=(o?o.length+1:a.length)-(h.length-p);if(-1!==p){const e=`${h.substr(0,p)}${c} `,o=f(d.innerHTML).substring(h.length),a=(0,u.qK)(d);n(`${e}${o}`),(0,i.Yq)((()=>{const e=a+g+1;(0,l.Z)(d,t),e>=0&&(0,u.Mq)(d,e)}))}w(void 0)}));return(0,o.d4)(I,[I,t]),{isMentionTooltipOpen:Boolean(C?.length&&!S),closeMentionTooltip:N,insertMention:T,mentionFilteredUsers:C}}function f(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},93609:(e,t,n)=>{n.d(t,{Z:()=>Z});var o=n(60748),a=n(33555),i=n(601),r=n(48670),s=n(46752),c=n(790),l=n(6202),d=n(25190),u=n(59107),m=n(15866),h=n(42797),p=n(18360),g=n(31212);const Z=(0,o.X$)((function(e){let{story:t,isPreview:n,isProtected:Z,isConnected:v}=e;const{openStoryViewer:f,loadUserStoriesByIds:P,showNotification:E}=(0,a.Sv)(),y=(0,u.Z)(),{isMobile:b}=(0,h.ZP)(),C=t&&"isDeleted"in t,w=t&&"content"in t,S=w?t.content.video:void 0,N=w?(0,r.Cc)(t):void 0,I=(0,l.Z)(N),M=w?S?S.thumbnail?.dataUri:t.content.photo?.thumbnail?.dataUri:void 0,k=(0,p.Z)(I,!0),{shouldRender:x,transitionClassNames:T}=(0,g.Z)(Boolean(k)),A=(0,m.Z)(M,C&&!n,b&&!i.vX),O=(0,s.Z)("u1iXUR7f9a1fJ3oKj6UR","media-inner",(!v||C)&&"sM8Yb5GJn63Lqe7WGyxs",C&&"GU6ftk8mOSKG68G3clJz",n&&"PdT0BgaOGO3KQ6uAMywg");(0,o.d4)((()=>{!t||w||C||P({userId:t.userId,storyIds:[t.id]})}),[t,C,w]);const R=(0,d.Z)((()=>{C?E({message:y("StoryNotFound")}):f({userId:t.userId,storyId:t.id,isSingleUser:!0,isSingleStory:!0})}));return o.ZP.createElement("div",{className:O,onClick:v?R:void 0},!C&&n&&o.ZP.createElement("canvas",{ref:A,className:"thumbnail blurred-bg"}),x&&o.ZP.createElement("img",{src:k,alt:"",className:(0,s.Z)("bCVEWkiPlJ2vOFKdsOZn",n&&"VjvrVyctay2XnrWkF6Pm",T)}),C&&o.ZP.createElement("span",null,o.ZP.createElement("i",{className:(0,s.Z)("C6JcJFH05QLPlgncYbFX","icon icon-story-expired"),"aria-hidden":!0}),y("StoryExpiredSubtitle")),Boolean(S?.duration)&&o.ZP.createElement("div",{className:"message-media-duration"},(0,c.k9)(S.duration)),Z&&o.ZP.createElement("span",{className:"protector"}))}))},97182:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"ContextMenuContainer",!t);return n?o.ZP.createElement(n,e):void 0}},95822:(e,t,n)=>{n.d(t,{Z:()=>b});var o=n(60748),a=n(57710),i=n(83716),r=n(48670),s=n(46752),c=n(26593),l=n(83967),d=n(25190),u=n(3657),m=n(6701),h=n(31212),p=n(41280),g=n(87204),Z=n(70692),v=n(72645),f=n(60706),P=n(42797),E=n(39196),y=n(62230);const b=e=>{let{id:t,message:n,observeIntersection:b,noAvatars:C,canAutoLoad:w,isInSelectMode:S,isSelected:N,uploadProgress:I,forcedWidth:M,size:k="inline",dimensions:x,asForwarded:T,nonInteractive:A,shouldAffectAppendix:O,isDownloading:R,isProtected:D,theme:L,onClick:F,onCancelUpload:B}=e;const U=(0,o.sO)(null),$=(0,r.O$)(n)||(0,r.F$)(n),j=$.blobUrl,H=(0,u.Op)(U,b),{isMobile:_}=(0,P.ZP)(),[Y,z]=(0,o.eJ)(w),V=Y&&H,{mediaData:X,loadProgress:q}=(0,m.Z)((0,r.Ti)(n,k),!V),W=j||X,G=Boolean(M),[K]=(0,o.eJ)(!W),J=Boolean(W),Q=(0,p.Z)(n,J),ee=(0,p.Z)(n,!G),te=(0,Z.Z)(!J),ne=(0,r.DH)(n),[oe,,ae]=(0,f.Z)($.isSpoiler),{loadProgress:ie}=(0,m.Z)((0,r.Ti)(n,"download"),!R,(0,r.kG)(n,"download")),{isUploading:re,isTransferring:se,transferProgress:ce}=(0,r.Sc)(n,I||(R?ie:q),V&&!W),le=!1===(0,g.Z)(Y),{shouldRender:de,transitionClassNames:ue}=(0,h.Z)(se,void 0,le,"slow"),{shouldRender:me,transitionClassNames:he}=(0,h.Z)(!W&&!Y),pe=(0,d.Z)((()=>{re?B?.(n):W?oe?ae():F?.(n.id):z((e=>!e))})),ge=(0,r.B4)(n);(0,v.Z)((e=>{let[t]=e;if(!O)return void(t&&U.current.closest(i.be_).removeAttribute(i.s22));const n=U.current.closest(i.be_);W?(0,c.Z)(W,ge,N,L).then((e=>{(0,a.WM)((()=>{n.style.setProperty("--appendix-bg",e),n.setAttribute(i.s22,"")}))})):n.classList.add("has-appendix-thumb")}),[O,W,ge,S,N,L]);const{width:Ze,height:ve,isSmall:fe}=x||(0,l.GH)(n,T,C,_),Pe=(0,s.Z)("media-inner",!re&&!A&&"interactive",fe&&"small-image",Ze===ve&&"square-image",ve<l.Xo&&"fix-min-height"),Ee=x?` width: ${Ze}px; left: ${x.x}px; top: ${x.y}px;`:"",ye="inline"===k?`height: ${ve}px;${Ee}`:void 0;return o.ZP.createElement("div",{id:t,ref:U,className:Pe,style:ye,onClick:re?void 0:pe},G&&o.ZP.createElement("canvas",{ref:ee,className:"thumbnail blurred-bg"}),o.ZP.createElement("img",{src:W,className:(0,s.Z)("full-media",G&&"with-blurred-bg"),alt:"",style:M?`width: ${M}px`:void 0,draggable:!D}),K&&o.ZP.createElement("canvas",{ref:Q,className:(0,s.Z)("thumbnail",te)}),D&&o.ZP.createElement("span",{className:"protector"}),de&&!me&&o.ZP.createElement("div",{className:`media-loading ${ue}`},o.ZP.createElement(E.Z,{progress:ce,onClick:re?pe:void 0})),me&&o.ZP.createElement("i",{className:(0,s.Z)("icon","icon-download",he)}),o.ZP.createElement(y.Z,{isVisible:oe,withAnimation:!0,thumbDataUri:ne,width:Ze,height:ve,className:"media-spoiler"}),se&&o.ZP.createElement("span",{className:"message-transfer-progress"},Math.round(100*ce),"%"))}},472:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(46752),i=n(48670),r=n(25190),s=n(59107),c=n(74399),l=n(6202),d=n(60706),u=n(97799);const m=2*c.Gw,h=(0,a.y)("ReactionSelectorReaction"),p=(0,o.X$)((e=>{let{reaction:t,isReady:n,noAppearAnimation:a,chosen:i,onToggleReaction:r}=e;const s=(0,l.Z)(`sticker${t.appearAnimation?.id}`,!n||a),c=(0,l.Z)(`document${t.selectAnimation?.id}`,!n||a),p=(0,l.Z)(`document${t.staticIcon?.id}`,!a),[g,Z]=(0,d.Z)(),[v,,f]=(0,d.Z)(!0),[P,E,y]=(0,d.Z)();return o.ZP.createElement("div",{className:h("&",i&&"chosen"),onClick:function(){r(t.reaction)},onMouseEnter:n&&!v?E:void 0},a&&o.ZP.createElement("img",{className:h("static-icon"),src:p,alt:""}),!g&&!a&&o.ZP.createElement(u.Z,{key:t.appearAnimation?.id,tgsUrl:s,play:v,noLoop:!0,size:m,onEnded:f,forceAlways:!0}),!v&&!a&&o.ZP.createElement(u.Z,{key:t.selectAnimation?.id,tgsUrl:c,play:P,noLoop:!0,size:m,onLoad:Z,onEnded:y,forceAlways:!0}))}));var g=n(231);const Z=(0,a.y)("ReactionSelector"),v=(0,o.X$)((e=>{let{allAvailableReactions:t,topReactions:n,enabledReactions:c,currentReactions:l,maxUniqueReactions:d,isPrivate:u,isReady:m,canPlayAnimatedEmojis:h,onToggleReaction:v,onShowMore:f,className:P}=e;const E=(0,o.sO)(null),y=(0,s.Z)(),b=(0,o.Ye)((()=>{const e=t?.map((e=>{if(!e.isInactive&&(u||c&&(0,i.XU)(e.reaction,c))&&(!(d&&l&&l.length>=d)||l.some((t=>{let{reaction:n}=t;return(0,i.Hl)(n,e.reaction)}))))return e})).filter(Boolean)||[];return(0,i.PO)(e,n)}),[t,l,c,u,d,n]),C=(0,o.Ye)((()=>7===b.length?b:b.slice(0,6)),[b]),w=C.length<b.length,S=(0,o.Ye)((()=>{const e=l?.filter((e=>{let{chosenOrder:t}=e;return void 0!==t}))||[];return new Set(e.map((e=>{let{reaction:t}=e;return C.findIndex((e=>e&&(0,i.Hl)(e.reaction,t)))})))}),[l,C]),N=(0,r.Z)((()=>{const e=E.current?.getBoundingClientRect()||{x:0,y:0};f({x:e.x,y:e.y})}));if(C.length)return o.ZP.createElement("div",{className:(0,a.Z)(Z("&",y.isRtl&&"isRtl"),P),ref:E},o.ZP.createElement("div",{className:Z("bubble-small",y.isRtl&&"isRtl")}),o.ZP.createElement("div",{className:Z("items-wrapper")},o.ZP.createElement("div",{className:Z("bubble-big",y.isRtl&&"isRtl")}),o.ZP.createElement("div",{className:Z("items"),dir:y.isRtl?"rtl":void 0},C.map(((e,t)=>o.ZP.createElement(p,{key:(0,i.$d)(e.reaction),isReady:m,onToggleReaction:v,reaction:e,noAppearAnimation:!h,chosen:S.has(t)}))),w&&o.ZP.createElement(g.Z,{color:"translucent",className:Z("show-more"),onClick:N},o.ZP.createElement("i",{className:"icon icon-down"})))))}))},35269:(e,t,n)=>{n.d(t,{Z:()=>S});var o=n(60748),a=n(33555),i=n(83967),r=n(790),s=n(46752),c=n(74399),l=n(48670),d=n(40647),u=n(25190),m=n(3657),h=n(6701),p=n(6202),g=n(31212),Z=n(87204),v=n(70692),f=n(41280),P=n(60706),E=n(42797),y=n(13617),b=n(39196),C=n(57080),w=n(62230);const S=e=>{let{id:t,message:n,observeIntersectionForLoading:S,observeIntersectionForPlaying:N,noAvatars:I,canAutoLoad:M,canAutoPlay:k,uploadProgress:x,forcedWidth:T,dimensions:A,asForwarded:O,isDownloading:R,isProtected:D,onClick:L,onCancelUpload:F}=e;const B=(0,o.sO)(null),U=(0,o.sO)(null),$=(0,l.b7)(n)||(0,l.Cg)(n),j=$.blobUrl,[H,,_]=(0,P.Z)($.isSpoiler),Y=(0,m.Op)(B,S),z=(0,m.Op)(B,N)&&Y,V=(0,o.sO)(Y);z&&!V.current&&(V.current=!0);const{isMobile:X}=(0,E.ZP)(),[q,W]=(0,o.eJ)(M),G=Boolean(q&&Y),[K,J]=(0,o.eJ)(Boolean(k&&!H)),Q=(0,l.Ti)(n,"inline"),[ee]=(0,o.eJ)(Boolean(Q&&d.UV(Q))),{mediaData:te,loadProgress:ne}=(0,h.Z)(Q,!G,(0,l.kG)(n,"inline")),oe=j||te,[ae,ie]=(0,P.Z)(),re=(0,l.DH)(n),se=Boolean(re),ce=Boolean(T),le=(0,l.Ti)(n,"preview"),[de]=(0,o.eJ)(Boolean(le&&d.UV(le))),ue=Y,me=(0,p.Z)(le,!ue),he=(0,v.Z)((se||me)&&!ae),pe=!se||me||ae,ge=(0,f.Z)(n,pe),Ze=(0,f.Z)(n,!ce),ve=(0,v.Z)(!pe),fe=oe&&V.current,Pe=(0,y.Z)(U,!0,!fe),{loadProgress:Ee}=(0,h.Z)((0,l.Ti)(n,"download"),!R,(0,l.kG)(n,"download")),{isUploading:ye,isTransferring:be,transferProgress:Ce}=(0,l.Sc)(n,x||(R?Ee:ne),G&&!ae&&!ee||R),we=!1===(0,Z.Z)(q),{shouldRender:Se,transitionClassNames:Ne}=(0,g.Z)(be&&!Pe,void 0,we),{transitionClassNames:Ie}=(0,g.Z)(Boolean((q||oe)&&!K&&!Se)),[Me,ke]=(0,o.eJ)(0),xe=(0,u.Z)((e=>{ke(Math.max(0,e.currentTarget.currentTime-1))})),Te=(Number.isFinite(U.current?.duration)?U.current?.duration:$.duration)||0,Ae=(0,l.B4)(n),Oe=Boolean((0,l.Cg)(n)),{width:Re,height:De}=A||(0,c.GC)($,Ae,O,Oe,I,X),Le=(0,u.Z)((()=>{ye?F?.(n):R?(0,a.Sv)().cancelMessageMediaDownload({message:n}):oe?(oe&&!K&&J(!0),H?_():L?.(n.id)):W((e=>!e))})),Fe=(0,s.Z)("media-inner dark",!ye&&"interactive",De<i.Xo&&"fix-min-height"),Be=`height: ${De}px;${A?` width: ${Re}px; left: ${A.x}px; top: ${A.y}px;`:""}`;return o.ZP.createElement("div",{ref:B,id:t,className:Fe,style:Be,onClick:ye?void 0:Le},ce&&o.ZP.createElement("canvas",{ref:Ze,className:"thumbnail blurred-bg"}),fe&&o.ZP.createElement(C.Z,{ref:U,src:oe,className:(0,s.Z)("full-media",ce&&"with-blurred-bg"),canPlay:K&&z&&!Pe,muted:!0,loop:!0,playsInline:!0,draggable:!D,onTimeUpdate:xe,onReady:ie,style:T?`width: ${T}px`:void 0}),o.ZP.createElement("img",{src:me,className:(0,s.Z)("thumbnail",he,ce&&"with-blurred-bg"),alt:"",style:T?`width: ${T}px;`:void 0,draggable:!D}),se&&!de&&o.ZP.createElement("canvas",{ref:ge,className:(0,s.Z)("thumbnail",ve)}),D&&o.ZP.createElement("span",{className:"protector"}),o.ZP.createElement("i",{className:(0,s.Z)("icon","icon-large-play",Ie)}),o.ZP.createElement(w.Z,{isVisible:H,withAnimation:!0,thumbDataUri:re,width:Re,height:De,className:"media-spoiler"}),Se&&o.ZP.createElement("div",{className:(0,s.Z)("media-loading",Ne)},o.ZP.createElement(b.Z,{progress:Ce,onClick:Le})),!q&&!oe&&o.ZP.createElement("i",{className:"icon icon-download"}),!be||Pe&&!R?o.ZP.createElement("div",{className:"message-media-duration"},$.isGif?"GIF":(0,r.k9)(Math.max(Te-Me,0)),Pe&&o.ZP.createElement("i",{className:"icon icon-message-failed playback-failed"})):o.ZP.createElement("span",{className:"message-transfer-progress"},ye||R?`${Math.round(100*Ce)}%`:"..."))}},54659:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(48670),r=n(83967),s=n(32340),c=n(48035),l=n(46752),d=n(25190),u=n(42797),m=n(59107),h=n(31526),p=n(10088),g=n(95822),Z=n(35269),v=n(231),f=n(93609);const P=(0,o.X$)((e=>{let{message:t,observeIntersection:n,noAvatars:P,canAutoLoad:E,canAutoPlay:y,inPreview:b,asForwarded:C,isDownloading:w=!1,isProtected:S,isConnected:N,story:I,theme:M,onMediaClick:k,onCancelMediaTransfer:x}=e;const{openTelegramLink:T}=(0,a.Sv)(),A=(0,i.s1)(t),{isMobile:O}=(0,u.ZP)(),R=(0,m.Z)(),D=(0,d.Z)((()=>{k()})),L=(0,d.Z)((()=>{A&&T({url:A.url})})),{story:F}=A||{};if((0,h.Z)(F?.userId,F?.id,I),!A)return;const{siteName:B,url:U,displayUrl:$,title:j,description:H,photo:_,video:Y,type:z}=A,V="telegram_story"===z,X=b||I&&"isDeleted"in I?void 0:function(e){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"lng_view_button_request_join";case"telegram_message":return"lng_view_button_message";case"telegram_bot":return"lng_view_button_bot";case"telegram_voicechat":return"lng_view_button_voice_chat";case"telegram_livestream":return"lng_view_button_voice_chat_channel";case"telegram_megagroup":case"telegram_chat":return"lng_view_button_group";case"telegram_channel":return"lng_view_button_channel";case"telegram_user":return"lng_view_button_user";case"telegram_botapp":return"lng_view_button_bot_app";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"ViewStory";default:return}}(z),q=(0,c.Z)(H,170),W=Boolean(q||j||B);let G=!1;if(W&&A?.photo&&!A.video){const{width:e,height:n}=(0,r.GH)(t,void 0,void 0,O);G=e===n}const K=(_||Y)&&k&&!G,J=(0,l.Z)("WebPage",b&&"in-preview",G&&"with-square-photo",!_&&!Y&&!b&&"without-media",Y&&"with-video",!W&&"no-article",X&&"with-quick-button");return o.ZP.createElement("div",{className:J,"data-initial":(B||$)[0],dir:"auto"},o.ZP.createElement("div",{className:(0,l.Z)("WebPage--content",V&&"is-story")},V&&o.ZP.createElement(f.Z,{story:I,isProtected:S,isConnected:N,isPreview:!0}),_&&!Y&&o.ZP.createElement(g.Z,{message:t,observeIntersection:n,noAvatars:P,canAutoLoad:E,size:G?"pictogram":"inline",asForwarded:C,nonInteractive:!K,isDownloading:w,isProtected:S,theme:M,onClick:K?D:void 0,onCancelUpload:x}),W&&o.ZP.createElement("div",{className:"WebPage-text"},o.ZP.createElement(p.Z,{className:"site-name",url:U,text:B||$}),!b&&j&&o.ZP.createElement("p",{className:"site-title"},(0,s.Z)(j)),q&&o.ZP.createElement("p",{className:"site-description"},(0,s.Z)(q,["emoji","br"]))),!b&&Y&&o.ZP.createElement(Z.Z,{message:t,observeIntersectionForLoading:n,noAvatars:P,canAutoLoad:E,canAutoPlay:y,asForwarded:C,isDownloading:w,isProtected:S,onClick:K?D:void 0,onCancelUpload:x})),X&&(Q=X,o.ZP.createElement(v.Z,{className:"WebPage--quick-button",size:"tiny",color:"translucent-bordered",onClick:L},R(Q))));var Q}))},26593:(e,t,n)=>{n.d(t,{Z:()=>a});const o={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function a(e,t,n,a){return n?Promise.resolve(o[a||"light"][t?"outgoing":"incoming"]):async function(e,t){const n=new Image;n.src=e,n.crossOrigin="anonymous",n.width||await new Promise((e=>{n.onload=e}));const o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.width,o.height=n.height,a.drawImage(n,0,0,n.width,n.height);const i=t?n.width-1:0,r=n.height-1;return`rgba(${Array.from(a.getImageData(i,r,1,1).data).join(",")})`}(e,t)}},83967:(e,t,n)=>{n.d(t,{GH:()=>l,Pw:()=>c,Vx:()=>i,Xo:()=>s});var o=n(74399),a=n(48670);const i=20*o.Gw,r=12*o.Gw,s=5*o.Gw;function c(e,t){var n;return(null!==(n=e?.length)&&void 0!==n?n:0)>40||t?i:r}function l(e,t,n,i){const r=(0,a.B4)(e),l=(0,a.O$)(e)||(0,a.F$)(e),d=(0,a.b7)(e),u=Boolean((0,a.F$)(e)),m=Boolean((0,a.Cg)(e)),{width:h,height:p}=l?(0,o.Eh)(l,r,t,u,n,i):(0,o.GC)(d,r,t,m,n,i),g=c((0,a.UD)(e));let Z=1;h<g&&g-h<12&&(Z=g/h),p*Z<s&&s-p*Z<12&&(Z=s/p);const v=Math.round(h*Z),f=Math.round(p*Z);return{width:v,height:f,isSmall:v<g||f<s}}},41280:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(601),a=n(48670),i=n(15866),r=n(42797);function s(e,t,n){const{isMobile:s}=(0,r.ZP)(),c=n||(0,a.DH)(e);return(0,i.Z)(c,Boolean(t),s&&!o.vX)}},45277:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(57710),i=n(81740);function r(e,t,n,r,s,c,l){const d=(0,o.sO)(!l);(0,o.bt)((()=>{const t=d.current;if(d.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),o=s,l=()=>(0,i.ZP)(n,e.current,o?"end":"centerOrTop",20,void 0!==r?o?500:750:void 0,r,void 0,c,!0);t?(0,a.lT)(l):(0,a.i$)((()=>{(0,a.WM)(l())}))}}),[e,t,n,r,s,c])}},75368:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(33555),i=n(69118);const r=new Map;function s(e,t,n,i){const s=i&&n?e?.byLangCode[i]?.[n]:void 0,{isPending:l,text:d}=s||{};return(0,o.d4)((()=>{t&&n&&!d&&void 0===l&&i&&function(e,t,n){const o=r.get(n)||new Map,i=o.get(e)||[];i.includes(t)||(i.push(t),o.set(e,i),r.set(n,o),(0,a.Sv)().markMessagesTranslationPending({chatId:e,messageIds:i,toLanguageCode:n})),c()}(t,n,i)}),[t,d,l,n,i]),t&&n?{isPending:l,translatedText:d}:{isPending:!1,translatedText:void 0}}const c=(0,i.P2)((function(){const{translateMessages:e}=(0,a.Sv)();let t=!1;r.forEach(((n,o)=>{n.forEach(((n,a)=>{const i=n.slice(0,20);i.length<n.length&&(t=!0),e({chatId:a,messageIds:i,toLanguageCode:o}),function(e,t,n){const o=r.get(n);if(!o?.size)return void r.delete(n);const a=o.get(e);if(!a?.length)return void o.delete(e);const i=a.filter((e=>!t.includes(e)));if(!i?.length)return o.delete(e),void(o.size||r.delete(n));o.set(e,i)}(a,i,o)}))})),t&&c()}),500)},17891:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(34446),i=n(65326);function r(e,t){const n=void 0===t,r=(0,o.sO)(n),s=(0,o.sO)(),c=(0,i.Z)();return(0,a.Z)((()=>{n||(r.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))}),e),(0,o.d4)((()=>{if(n||r.current)return;const e=()=>{r.current=!0,c()};t>0?s.current=window.setTimeout(e,t):e()}),e),r.current}},47505:(e,t,n)=>{n.d(t,{Z:()=>y});var o=n(60748),a=n(33555),i=n(42797),r=n(46752),s=n(59107),c=n(78781),l=n(91713),d=n(48670),u=n(30386),m=n(17240),h=n(25190),p=n(12644),g=n(19156),Z=n(70172),v=n(52328),f=n(58964),P=n(41372);const E=(0,o.X$)((function(e){let{user:t,isArchived:n}=e;const{openChat:i,openChatWithInfo:c,openStoryViewer:E,toggleStoriesHidden:y}=(0,a.Sv)(),b=(0,s.Z)(),C=(0,o.sO)(null);(0,g.Z)(t.id);const{isContextMenuOpen:w,contextMenuPosition:S,handleBeforeContextMenu:N,handleContextMenu:I,handleContextMenuClose:M,handleContextMenuHide:k}=(0,m.Z)(C),x=(0,h.Z)((()=>C.current)),T=(0,h.Z)((()=>document.body)),A=(0,h.Z)((()=>C.current.querySelector(".story-user-context-menu .bubble"))),O=(0,h.Z)((()=>({withPortal:!0,isDense:!0}))),{positionX:R,positionY:D,transformOriginX:L,transformOriginY:F,style:B}=(0,p.Z)(S,x,T,A,O),U=(0,h.Z)((()=>{w||E({userId:t.id,origin:l.ze.StoryRibbon})})),$=(0,h.Z)((e=>{(0,u.b)(e),N(e)})),j=(0,h.Z)((()=>{c({id:t.id,shouldReplaceHistory:!0,profileTab:"stories"})})),H=(0,h.Z)((()=>{c({id:t.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),_=(0,h.Z)((()=>{i({id:t.id,shouldReplaceHistory:!0})})),Y=(0,h.Z)((()=>{c({id:t.id,shouldReplaceHistory:!0})})),z=(0,h.Z)((()=>{y({userId:t.id,isHidden:!n})}));return o.ZP.createElement("div",{ref:C,role:"button",tabIndex:0,className:P.Z.user,onMouseDown:$,onClick:U,onContextMenu:I},o.ZP.createElement(Z.Z,{peer:t,withStory:!0,storyViewerOrigin:l.ze.StoryRibbon,storyViewerMode:"full"}),o.ZP.createElement("div",{className:(0,r.Z)(P.Z.name,t.hasUnreadStories&&P.Z.name_hasUnreadStory)},t.isSelf?b("MyStory"):(0,d.Vl)(t)),void 0!==S&&o.ZP.createElement(v.Z,{isOpen:w,transformOriginX:L,transformOriginY:F,positionX:R,positionY:D,style:B,className:(0,r.Z)("story-user-context-menu",P.Z.contextMenu),autoClose:!0,withPortal:!0,onClose:M,onCloseAnimationEnd:k},t.isSelf?o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(f.Z,{onClick:j,icon:"play-story"},b("StoryList.Context.SavedStories")),o.ZP.createElement(f.Z,{onClick:H,icon:"archive"},b("StoryList.Context.ArchivedStories"))):o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(f.Z,{onClick:_,icon:"message"},b("SendMessageTitle")),o.ZP.createElement(f.Z,{onClick:Y,icon:"user"},b("StoryList.Context.ViewProfile")),o.ZP.createElement(f.Z,{onClick:z,icon:n?"unarchive":"archive"},b(n?"StoryList.Context.Unarchive":"StoryList.Context.Archive")))))})),y=(0,o.X$)((0,a.c$)(((e,t)=>{let{isArchived:n}=t;const{orderedUserIds:{active:o,archived:a}}=e.stories;return{orderedUserIds:n?a:o,usersById:e.users.byId}}))((function(e){let{isArchived:t,className:n,orderedUserIds:a,usersById:l,isClosing:d}=e;const u=(0,s.Z)(),m=(0,r.Z)(P.Z.root,!a.length&&P.Z.hidden,d&&P.Z.closing,n,"no-scrollbar"),h=(0,o.sO)(null);return(0,c.Z)(h,(0,i.W7)()),o.ZP.createElement("div",{ref:h,className:m,dir:u.isRtl?"rtl":void 0},a.map((e=>{const n=l[e];if(n)return o.ZP.createElement(E,{key:e,user:n,isArchived:t})})))})))},66372:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(83716),r=n(46752),s=n(7054),c=n(59107),l=n(31212),d=n(19156),u=n(70172);const m=(0,o.X$)((0,a.c$)(((e,t)=>{let{isArchived:n}=t;const{orderedUserIds:{archived:o,active:a}}=e.stories,{storyViewer:{isRibbonShown:i,isArchivedRibbonShown:r}}=(0,s.jUK)(e);return{currentUserId:e.currentUserId,orderedUserIds:n?o:a,isShown:n?!r:!i,usersById:e.users.byId}}))((function(e){let{currentUserId:t,orderedUserIds:n,usersById:s,canShow:m,isShown:h,isArchived:p}=e;const{toggleStoryRibbon:g}=(0,a.Sv)(),Z=(0,c.Z)(),v=(0,o.Ye)((()=>1===n.length?[s[n[0]]]:n.map((e=>s[e])).filter((e=>e&&e.id!==t)).slice(0,i.Ob7).reverse()),[t,n,s]),f=(0,o.Ye)((()=>n.slice(0,5)),[n]);(0,d.Z)(f);const{shouldRender:P,transitionClassNames:E}=(0,l.Z)(m&&h,void 0,void 0,"slow");if(P)return o.ZP.createElement("button",{type:"button",className:(0,r.Z)("laLpjZnhOwW8cdBN3mEv",E),"aria-label":Z("Chat.Context.Peer.OpenStory"),onClick:()=>g({isShown:!0,isArchived:p}),dir:Z.isRtl?"rtl":void 0},v.map((e=>o.ZP.createElement(u.Z,{key:e.id,peer:e,size:"tiny",className:"ewhbkm9F8nGqLpj_toQg",withStorySolid:!0}))))})))},19156:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(6137),r=n(7054),s=n(48670),c=n(40647),l=n(69118);const d={},u=(0,l.wO)(1e3),m=function(e,t){(0,o.d4)((()=>{(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,a.Rd)().stories.byUserId[e]?.orderedIds?.[0];n&&(async e=>{await u,e.forEach((e=>{let{hash:t,format:n}=e;c.he(t,n).then((e=>{n===i.IU.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.style.display="none",t.appendChild(n),setTimeout((()=>{t.removeChild(n)}),1e3)}(e)}))}))})(function(e,t){const n=(0,r.GZu)((0,a.Rd)(),e);if(!n||!n.orderedIds?.length)return[];const o=function(e,t,n){const o=e.indexOf(t);return e.slice(o-5,o+5)}(n.orderedIds,t),c=[];return o.forEach((t=>{if(d[e]?.has(t))return;const o=n.byId[t];o&&"content"in o&&(c.push({hash:(0,s.Cc)(o,"full"),format:o.content.video?i.IU.Progressive:i.IU.BlobUrl}),c.push({hash:(0,s.Cc)(o),format:i.IU.BlobUrl}),o.content.altVideo&&c.push({hash:(0,s.Cc)(o,"full",!0),format:i.IU.Progressive}),d[e]=(d[e]||new Set).add(t))})),c}(e,n))}))}),[t,e])}},13617:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(33555),i=n(25190),r=n(59107),s=n(601);function c(e,t,n){const{showNotification:c}=(0,a.Sv)(),l=(0,r.Z)(),[d,u]=(0,o.eJ)(!1),m=(0,i.Z)((()=>{u(!0),t||c({message:s.q$?l("Video.Unsupported.Mobile"):l("Video.Unsupported.Desktop"),duration:8e3})})),h=(0,i.Z)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||m())})),p=(0,i.Z)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||m()}));return(0,o.d4)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",h),t.addEventListener("canplay",p),()=>{t.removeEventListener("error",h),t.removeEventListener("canplay",p)}):void 0}),[n,e]),d}},47783:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(60748),a=n(33555),i=n(48670),r=n(7054),s=n(69118);const c=new Map;let l=new Set;const d=(0,s.P2)((()=>{const e=Array.from(l),t=e.slice(0,100),n=e.slice(101);(0,a.Sv)().loadStoriesMaxIds({userIds:t}),t.forEach((e=>c.set(e,Date.now()))),l=new Set(n),l.size&&d()}),500);function u(e){const t=(0,o.Ye)((()=>e?.map((e=>(0,a.Rd)().users.byId[e])).filter(Boolean)),[e]),n=(0,o.Ye)((()=>{const e=(0,a.Rd)();return t?.filter((t=>{const n=c.get(t.id)||0;if(Date.now()-n<36e5)return!1;const o=(0,r.ssc)(e,t.id),a=o&&"userStatusEmpty"!==o.type;return!t.isContact&&!t.isSelf&&!(0,i.cS)(t)&&!t.isSupport&&a})).map((e=>e.id))}),[t]);(0,o.d4)((()=>{n?.length&&(n.forEach((e=>l.add(e))),d())}),[n])}},53455:(e,t,n)=>{n.d(t,{Yy:()=>r,ZP:()=>h,fi:()=>i,vb:()=>l});var o=n(60782),a=n(91090);const i=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],r=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],i=[];if("included"===t){const{includedChatIds:t,...r}=n?e.includeFilters||{}:(0,o.ei)(e.folder,s);a=t||[],i=Object.keys(r).filter((e=>Boolean(r[e])))}else{const{excludedChatIds:t,...r}=n?e.excludeFilters||{}:(0,o.ei)(e.folder,c);a=t||[],i=Object.keys(r).filter((e=>Boolean(r[e])))}return{selectedChatIds:a,selectedChatTypes:i}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||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"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,o.ei)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:(0,o.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,o.CE)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,o.CE)(e.folder,c),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...o}=t.payload;return{mode:"edit",folderId:e,folder:o,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},11309:(e,t,n)=>{n.d(t,{CH:()=>r,Vr:()=>l,WR:()=>s,iD:()=>c});var o=n(3927),a=n(67360),i=n(71790);function r(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,o.Z)((t=>{t(e())}),t,n,a)}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=r((()=>e()),[e],t,n);return(0,i.Z)(o,[o,e],!0)}function c(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,a.Z)((t=>{t(e())}),t,n,o,i)}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=c((()=>e()),[e],t,n,o);return(0,i.Z)(a,[a,e],!0)}},23186:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(60748),a=n(33555),i=n(83716),r=n(10396),s=n(85266),c=n(64532),l=n(7054),d=n(274),u=n(34446),m=n(25190);function h(e){let t={};if(e&&e.current){const{play:n,pause:o,setCurrentTime:i,proxy:r,requestNextTrack:s,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(r.src)},pause:()=>{o()},stop:()=>{o(),i(0),(0,a.Sv)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;i(Math.max(r.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;i(Math.min(r.currentTime+t,r.duration))},seekTo:e=>{e.seekTime&&i(e.seekTime)}},d()||(t.nexttrack=()=>{s()}),l()||(t.previoustrack=()=>{c()})}return t}const p=function(e,t,n,p,g,Z,v){let f=arguments.length>7&&void 0!==arguments[7]&&arguments[7],P=arguments.length>8?arguments[8]:void 0,E=arguments.length>9?arguments[9]:void 0,y=arguments.length>10&&void 0!==arguments[10]&&arguments[10],b=arguments.length>11&&void 0!==arguments[11]&&arguments[11];const C=(0,o.sO)(null),[w,S]=(0,o.eJ)(!1);let N=w;const[I,M]=(0,o.eJ)(0),k=(0,m.Z)((()=>{S(!1),E&&E()}));(0,u.Z)((()=>{C.current=(0,r.z2)(e,n,((e,o)=>{switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:r,proxy:s}=C.current;S(!0),(0,c.N)(Z,h(C)),(0,c.pC)("playing");const{audioPlayer:d}=(0,l.jUK)((0,a.Rd)());e(d.volume),r(Boolean(d.isMuted));const u=s.duration&&Number.isFinite(s.duration)?s.duration:t;("voice"===n||u>i.J0S)&&o(d.playbackRate),(0,c.NS)({duration:s.duration||0,playbackRate:s.playbackRate,position:s.currentTime});break}case"onRateChange":{const{proxy:e}=C.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":S(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=C.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;b||M(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}g?.[e]?.(o)}),P,k);const{proxy:o}=C.current;w||o.paused||(S(!0),N=!0),v&&v(o)}),[e]),(0,o.d4)((()=>{w&&Z&&(0,c.Ym)(Z)}),[Z,w]);const{play:x,pause:T,setCurrentTime:A,proxy:O,destroy:R,setVolume:D,stop:L,isFirst:F,isLast:B,requestNextTrack:U,requestPreviousTrack:$,setPlaybackRate:j,toggleMuted:H}=C.current,_=O.duration&&Number.isFinite(O.duration)?O.duration:t;(0,o.d4)((()=>{!_||(0,s.z)(O)||b||M(O.currentTime/_)}),[_,I,O,b]),(0,o.d4)((()=>()=>{R(y)}),[R,y]),(0,d.Z)((e=>{let[t,n]=e;t===f&&p===n||O.src&&O.paused||f&&p&&!w&&x(p)}),[f,p,w,x,O.src,O.paused]);const Y=(0,m.Z)((()=>{p&&x(p)})),z=(0,m.Z)((()=>{w?T():Y()})),V=(0,m.Z)((e=>{A(e),_&&M(O.currentTime/_)}));return{isPlaying:N,playProgress:I,playPause:z,pause:T,play:Y,stop:L,setCurrentTime:V,setVolume:D,audioProxy:O,duration:_,requestNextTrack:U,requestPreviousTrack:$,isFirst:F,isLast:B,setPlaybackRate:j,toggleMuted:H}}},58637:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(69118),i=n(25190);function r(e){const t=(0,i.Z)(e);(0,o.d4)((()=>(0,a.Gq)(t)),[t])}},15866:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(57710),i=n(601),r=n(96264),s=n(34446);function c(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,l=arguments.length>4?arguments[4]:void 0,d=arguments.length>5?arguments[5]:void 0;const u=(0,o.sO)(null),m=(0,o.sO)();return(0,s.Z)((()=>{t||(m.current=!1)}),[e,t]),(0,o.d4)((()=>{const o=u.current;if(!e||!o||t||m.current)return;m.current=!0;const s=new Image,h=()=>{const e=l||s.width,t=d||s.height,n=o.getContext("2d",{alpha:!1});(0,a.WM)((()=>{o.width=e,o.height=t,i.vX&&(n.filter=`blur(${c}px)`),n.drawImage(s,2*-c,2*-c,e+4*c,t+4*c),i.vX||(0,r.Z)(n,0,0,e,t,c,2)}))};s.onload=()=>{n?(0,a.i$)(h):h()},s.src=e}),[e,t,d,l,c,n]),u}},41470:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(33555),i=n(601),r=n(83716),s=n(48670),c=n(60782),l=n(59107);const d=function(e){let{chat:t,user:n,folderId:d,isPinned:u,isMuted:m,canChangeFolder:h,handleDelete:p,handleMute:g,handleChatFolderChange:Z,handleReport:v}=e,f=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const P=(0,l.Z)(),{isSelf:E}=n||{},y=n?.id===r.awM;return(0,o.Ye)((()=>{if(!t)return;const{toggleChatPinned:e,updateChatMutedState:o,toggleChatArchived:l,toggleChatUnread:b,openChatInNewTab:C}=(0,a.Sv)(),w=i.IT&&{title:r.D$V?"Open in new window":"Open in new tab",icon:"open-in-new-tab",handler:()=>{C({chatId:t.id})}},S=h?{title:P("ChatList.Filter.AddToFolder"),icon:"folder",handler:Z}:void 0,N=u?{title:P("UnpinFromTop"),icon:"unpin",handler:()=>e({id:t.id,folderId:d})}:{title:P("PinToTop"),icon:"pin",handler:()=>e({id:t.id,folderId:d})},I=m?{title:P("ChatList.Unmute"),icon:"unmute",handler:()=>o({chatId:t.id,isMuted:!1})}:{title:`${P("ChatList.Mute")}...`,icon:"mute",handler:g};if(f)return(0,c.oA)([w,N,S,I]);const M=t.unreadCount||t.hasUnreadMark?{title:P("MarkAsRead"),icon:"readchats",handler:()=>b({id:t.id})}:void 0,k=t.unreadCount||t.hasUnreadMark||t.isForum?void 0:{title:P("MarkAsUnread"),icon:"unread",handler:()=>b({id:t.id})},x=(0,s.pE)(t)?{title:P("Unarchive"),icon:"unarchive",handler:()=>l({id:t.id})}:{title:P("Archive"),icon:"archive",handler:()=>l({id:t.id})},T=v&&((0,s.eA)(t)||(0,s.Bf)(t)||n&&!n.isSelf)?{title:P("ReportPeer.Report"),icon:"flag",handler:v}:void 0,A={title:(0,s.YC)(t.id)?P("Delete"):P((0,s.cc)(t)?"DeleteChat":(0,s.eA)(t)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:p},O=void 0!==d;return(0,c.oA)([w,S,M,k,N,!E&&I,!E&&!y&&!O&&x,T,A])}),[t,n,h,P,Z,u,f,m,p,g,v,d,E,y])}},71790:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(34446),a=n(33799),i=n(70971),r=n(93862);const s=function(e,t){var n;let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const c=t?e:()=>e;null!==(n=t)&&void 0!==n||(t=[e]);const[l,d]=(0,a.Z)(),u=(0,i.Y)(c);function m(){const e=u.current;s?e(d):d(e())}return(0,o.Z)(m,t),(0,r.b)(m,t),l}},86203:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(65326),i=n(34446),r=n(70971),s=n(93862);const c=function(e,t){var n;let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=t?e:()=>e();null!==(n=t)&&void 0!==n||(t=[e]);const d=(0,o.sO)(),u=(0,a.Z)(),m=(0,r.Y)(l);function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=m.current;if(c)t((e=>{d.current!==e&&(d.current=e,u())}));else{const n=t();d.current!==n&&(d.current=n,e||u())}}return(0,i.Z)((()=>{h(!0)}),t),(0,s.b)(h,t),d.current}},75790:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(33555);function i(e,t,n,i){const{loadMessage:r}=(0,a.Sv)();(0,o.d4)((()=>{t&&!n&&r({chatId:e,messageId:t,replyOriginForId:i})}),[e,n,t,i])}},31526:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(33555),i=n(69118);const r=function(e,t,n){const{loadUserStoriesByIds:r}=(0,a.Sv)(),s=(0,o.Ye)((()=>{const n=(0,i.P2)(r,200,!0);return()=>{n({userId:e,storyIds:[t]})}}),[t,e]);(0,o.d4)((()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&s()}),[s,n,t,e])}},95616:(e,t,n)=>{n.d(t,{d7:()=>r,mE:()=>c,yi:()=>s});var o=n(60748),a=n(16974),i=n(65326);function r(e){const t=(0,i.Z)();return(0,o.d4)((()=>(0,a.M2)(e,t)),[e,t]),(0,a.gO)(e)}function s(){const e=(0,i.Z)();return(0,o.d4)((()=>(0,a.O6)(e)),[e]),(0,a.wC)()}function c(){const e=(0,i.Z)();return(0,o.d4)((()=>(0,a.r_)(e)),[e]),(0,a.Yz)()}},54416:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(25190),i=n(65326),r=n(34446);function s(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,o.sO)(e),n=(0,o.sO)(!1),s=(0,i.Z)();(0,r.Z)((()=>{e&&(t.current=!0)}),[e]);const c=(0,a.Z)((()=>{t.current=!1,n.current=!1,s()})),l=(0,a.Z)((()=>{n.current=!0,s()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:c,handleForumPanelAnimationStart:l}}},69156:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(33799);function i(e){const[t,n]=(0,a.Z)();return(0,o.d4)((()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const o=t.getRangeAt(0);if(!o)return;if(!document.querySelector(e))return;const{commonAncestorContainer:a}=o;(a instanceof Element?a:a.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)}),[e,n]),t}},78781:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(60748);const a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,o.d4)((()=>{if(t)return;const o=e.current;function a(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",a,{passive:!n}),()=>{o.removeEventListener("wheel",a)}}),[e,t,n])}},73541:(e,t,n)=>{n.d(t,{y:()=>s});var o=n(60748);var a=n(16063);const i=new Set(["INPUT","TEXTAREA","SELECT"]),r=(0,a._)();function s(e){(0,o.d4)((()=>{if(!e)return;const t=Object.entries(e);return r.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!i.has(e.target.tagName)})(e)&&t.forEach((t=>{let[n,o]=t;(function(e){return t=>function(e,t){const{alt:n,ctrl:o,meta:a,mod:i,shift:r,key:s}=e,{altKey:c,ctrlKey:l,metaKey:d,shiftKey:u,key:m}=t;if(n!==c)return!1;if(i){if(!l&&!d)return!1}else{if(o!==l)return!1;if(a!==d)return!1}return r===u&&Boolean(s&&(m.toLowerCase()===s.toLowerCase()||t.code.replace("Key","").toLowerCase()===s.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},o=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!o.includes(e)))}}(e),t)})(n)(e)&&o(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",r.runCallbacks)},12515:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(57710),i=n(42797);function r(e,t,n){const{isMobile:r}=(0,i.ZP)();(0,o.d4)((()=>{t?r||setTimeout((()=>{(0,a.WM)((()=>{e.current?.isConnected&&e.current.focus()}))}),500):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,300))}),[e,r,t,n])}},6701:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(601),i=n(6137),r=n(69118),s=n(40647),c=n(65326),l=n(27704);function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.IU.BlobUrl,d=arguments.length>3?arguments[3]:void 0,u=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const m=e?s.UV(e):void 0,h=n===i.IU.Stream||a.I_&&n===i.IU.Progressive,p=(0,c.Z)(),g=(0,l.Z)(),[Z,v]=(0,o.eJ)(m&&!h?1:0),f=(0,o.sO)(),P=(0,o.Ye)((()=>(0,r.P2)((e=>{f.current&&(!d||Date.now()-f.current>d)&&v(e)}),500,!0)),[d]);return(0,o.d4)((()=>{!t&&e&&(m?h&&setTimeout((()=>{v(.75)}),1500):(v(0),f.current&&s.cC(P),f.current=Date.now(),s.he(e,n,u,P,g).then((()=>{const e=Date.now()-f.current;f.current=void 0,!d||e>=d?p():setTimeout(p,d-e)}))))}),[t,e,m,n,p,h,d,P,u,g]),(0,o.d4)((()=>{t&&f.current&&(s.cC(P),v(0),f.current=void 0)}),[P,t]),(0,o.d4)((()=>()=>{e&&s.Iq(e,g)}),[g,e]),{mediaData:m,loadProgress:Z}}},56503:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(601),i=n(25190);let r;function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const c=(0,o.sO)(!1),l=(0,i.Z)((()=>{c.current=!0}));(0,o.d4)((()=>{r&&(clearTimeout(r),r=void 0),!e||a.$b||s||(r=window.setTimeout((()=>{c.current||t()}),2*n))}),[s,e,n,t]);const d=(0,i.Z)((()=>{c.current=!0})),u=(0,i.Z)((()=>{c.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout((()=>{c.current||t()}),n)}));return[d,u,l]}},52678:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(87204),i=n(65326),r=n(34446);function s(e,t){const n=(0,a.Z)(e,!0),s=(0,o.sO)(),c=(0,i.Z)(),l=null!=e,d=null!=n;return l&&s.current&&(clearTimeout(s.current),s.current=void 0),(0,r.Z)((()=>{t&&!l&&d&&!s.current&&(s.current=window.setTimeout((()=>{s.current=void 0,c()}),t))}),[t,c,l,d]),s.current&&t&&!l?n:e}},91090:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(65326);function i(e,t){const n=(0,a.Z)(),i=(0,o.sO)(e),r=(0,o.sO)(t),s=(0,o.I4)((e=>(r.current=i.current(r.current,e),n(),r.current)),[]);return[r.current,s]}},88957:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(67360);function a(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,o.Z)((e=>{e()}),a,e,t,n)}},33057:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(83716),i=n(790),r=n(82267),s=n(25190),c=n(59107),l=n(99203),d=n(48778);const u=e=>{const{isOpen:t}=e,n=(0,d.Z)(l.gl.Extra,"CalendarModal",!t);return n?o.ZP.createElement(n,e):void 0},m=(e,t,n)=>{const l=(0,c.Z)(),[d,m]=(0,o.eJ)(),h=(0,s.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,r.Qj)());d?.(n),m(void 0)})),p=(0,s.Z)((()=>{h(new Date(1e3*a.t4X),!0)})),g=(0,s.Z)((()=>{m(void 0),t?.()})),Z=(0,s.Z)((e=>{m((()=>e))})),v=n?new Date(1e3*n):new Date;v.setSeconds(0),v.setMilliseconds(0);const f=new Date;return f.setFullYear(f.getFullYear()+1),[Z,o.ZP.createElement(u,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:v.getTime(),maxAt:(0,i._F)(f),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:g,onSubmit:h,onSecondButtonClick:e?p:void 0})]}},56389:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(33555),i=n(83716),r=n(69118);const s=(e,t)=>(0,o.Ye)((()=>(0,r.P2)((n=>{e&&t&&(0,a.Sv)().sendMessageAction({chatId:e,threadId:t,action:n})}),i.o_S)),[e,t])},33799:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(19369);function i(e){var t;const n=(0,o.sO)();return null!==(t=n.current)&&void 0!==t||(n.current=(0,a.gQ)(e)),n.current}},93862:(e,t,n)=>{n.d(t,{b:()=>r});var o=n(60748),a=n(19369),i=n(7792);function r(e,t){const n=(0,o.sO)(!0);n.current&&(n.current=!1,t?.forEach((t=>{(0,a.$Z)(t)&&t.subscribe(e)}))),(0,i.Z)((()=>()=>{(0,a.Dc)(e)}))}},28183:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(60748);const a=function(e,t){const n=(0,o.sO)(e);(0,o.bt)((()=>{n.current=e}),[e]),(0,o.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n.current()),t);return()=>clearTimeout(e)}),[t])}},74095:(e,t,n)=>{n.d(t,{K:()=>r});var o=n(69995);function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class i{constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n,a(this,"requestStates",new Map),a(this,"requestStatesByCallback",new Map)}destroy(){}init(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.postMessage({type:"init",args:t})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,a=(0,o.Z)(),i={type:"callMethod",messageId:a,...e},r={messageId:a},s=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("function"==typeof i.args[i.args.length-1]){i.withCallback=!0;const e=i.args.pop();r.callback=e,n.set(e,r)}return t.set(a,r),s.catch((()=>{})).finally((()=>{t.delete(a),r.callback&&n.delete(r.callback)})),this.postMessage(i),s}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessage({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;if(e.channel===n)if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type)t.get(e.messageId)?.callback?.(...e.callbackArgs);else if("unhandledError"===e.type)throw new Error(e.error?.message)}postMessage(e){e.channel=this.channel,this.target.postMessage(e)}}function r(e,t,n){const o=new i(e,t,n);function a(e){let{data:t}=e;o.onMessage(t)}return e.addEventListener("message",a),o.destroy=()=>{e.removeEventListener("message",a)},o}},8582:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(33555),a=n(9933),i=n(57710),r=n(7054);const s=new Map;function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300;(0,r.FOo)((0,o.Rd)())||(n=0);const c="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:m,dataset:{scrollId:h}}=e;let p=t-d;if(p<0){const e=-d*(c?-1:1);p=Math.max(p,e)}else if(p>0){const e=m-(d+u);p=Math.min(p,e)}if(0===p)return Promise.resolve();h&&s.has(h)&&s.get(h)();const g=d+p;return new Promise((t=>{(0,i.WM)((()=>{if(0===n)return e.scrollLeft=g,void t();let o=!1;const r=Math.random().toString();e.dataset.scrollId=r,s.set(r,(()=>{o=!0})),e.style.scrollSnapType="none";const c=Date.now();(0,a.jt)((()=>{if(o)return!1;const a=Math.min((Date.now()-c)/n,1),i=p*(1-l(a));return e.scrollLeft=Math.round(g-i),a>=1&&(e.style.scrollSnapType="",delete e.dataset.scrollId,s.delete(r),t()),a<1}),i.WM)}))}))}function l(e){return 1-(1-e)**3.5}},81740:(e,t,n)=>{n.d(t,{Ni:()=>Z,ZP:()=>h,wA:()=>p});var o=n(57710),a=n(33555),i=n(91713),r=n(83716),s=n(601),c=n(18674),l=n(9933),d=n(7054);let u,m=!1;function h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u=t.slice(0,8);const a=g(...u),i=t[8];if(i)return a;(0,o.WM)(a)}function p(){m&&((0,l.vR)(),(0,o.i$)((()=>{(0,o.WM)(g(...u))})))}function g(e,t,n){let h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:r.V$q,g=arguments.length>5?arguments[5]:void 0,Z=arguments.length>6?arguments[6]:void 0,E=arguments.length>7?arguments[7]:void 0;g!==i.fo.Static&&(0,d.FOo)((0,a.Rd)())||(Z=0);const{offsetTop:y,offsetHeight:b}=t,{scrollTop:C,offsetHeight:w,scrollHeight:S}=e,N=E&&e.dataset.normalHeight?Number(e.dataset.normalHeight):w;let I;switch(n){case"start":I=y-h+(s.wZ?1:0);break;case"end":I=y+b+h-N;break;case"nearest":case"center":case"centerOrTop":I=b<N?y+b/2-N/2:y-h}const M=v(e,I,p,g);let k=I-M;if(k<0){const e=-M;k=Math.max(k,e)}else if(k>0){const e=S-(M+N);k=Math.min(k,e)}const x=Math.abs(k);return()=>{if(x<1)return void(C!==M&&(e.scrollTop=M));const t=M+k;if(0===Z)return void(e.scrollTop=t);m=!0;const n=x<=r.xnK?f:P,a=Z||r.bKs+x/r.V$q*(r.ckE-r.bKs),i=Date.now(),s=(0,c.YW)();(0,l.cK)((()=>{const o=Math.min((Date.now()-i)/a,1),r=k*(1-n(o)),c=Math.round(t-r);return e.scrollTop=c,m=o<1&&c!==t,m||(u=void 0,s()),m}),o.WM)}}function Z(){return m}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.V$q,o=arguments.length>3?arguments[3]:void 0;const{scrollTop:a}=e;if(void 0===o){const e=t-a;if(e<-n)return a+(e+n);if(e>n)return a+(e-n)}else{if(o===i.fo.Up)return t+n;if(o===i.fo.Down)return Math.max(0,t-n)}return a}function f(e){return 1-(1-e)**3.5}function P(e){return 1-(1-e)**6.5}},10396:(e,t,n)=>{n.d(t,{An:()=>E,Es:()=>Z,z2:()=>v});var o=n(33555),a=n(57710),i=n(91713),r=n(601),s=n(74753),c=n(85266),l=n(48670),d=n(7054);const u=new Map;let m,h=[],p=[];function g(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const a=P(e,(0,d.jUK)((0,o.Rd)()).audioPlayer.origin||i.Cr.Inline,t);if(!a)return;if(!u.has(a))return void(0,o.Sv)().openAudioPlayer((0,l.Ak)(y(a).messageKey));const r=u.get(a);r.onForcePlay&&r.onForcePlay(),m=a,r.audio.src&&(0,s.Z)(r.audio)}function Z(){const e=m&&u.get(m);e&&e.audio.pause()}function v(e,t,n,Z,v){if(!u.has(e)){const n=function(e,t,n,o){const a=new Audio;function i(t){return n=>{u.has(e)&&((0,c.z)(a)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return a.addEventListener("timeupdate",i("onTimeUpdate")),a.addEventListener("play",i("onPlay")),a.addEventListener("pause",i("onPause")),a.addEventListener("loadstart",i("onLoadStart")),a.addEventListener("loadeddata",i("onLoadedData")),a.addEventListener("playing",i("onPlaying")),a.addEventListener("ended",(()=>{u.has(e)&&((0,c.z)(a)||g(e))})),{audio:a,type:t,proxy:new Proxy(a,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(e,t,Z,v);u.set(e,n),function(e,t){"audio"!==e.type||p.includes(t)||(p.push(t),p.sort(b)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(b))}(n,e)}const{audio:f,proxy:E,handlers:C}=u.get(e);return C.push(n),{play(n){if(!f.paused)return;const a=m&&u.get(m);a&&m!==e&&(a.audio.pause(),a.audio.currentTime=0,(0,c.z)(a.audio)&&(a.audio.dataset.preventPlayAfterPatch="true"),a.onTrackChange&&a.onTrackChange()),m=e,f.src||(f.src=n,f.preload="auto",n.includes("/progressive/")&&r.s$&&(delete f.dataset.preventPlayAfterPatch,(0,c.B)(f))),(0,s.Z)(f),function(e,t){if((0,d.jUK)((0,o.Rd)()).globalSearch.currentContent===i.nJ.Music)return;const{chatId:n}=(0,l.Ak)(y(t).messageKey),a=(0,d.Btg)((0,o.Rd)())?.chatId,r=e=>e.startsWith(`msg${n}`)||a&&e.startsWith(`msg${a}`);"audio"===e&&(p=p.filter(r)),"voice"===e&&(h=h.filter(r))}(t,e)},pause(){m===e&&f.pause()},stop(){if(m===e){const e=f.src;f.pause(),(0,a.Yq)((()=>{f.src="",f.src=e}))}},setCurrentTime(t){m===e&&(f.fastSeek?f.fastSeek(t):f.currentTime=t)},setVolume(t){m===e&&(f.volume=t,f.muted=!1)},setPlaybackRate(t){m===e&&(f.playbackRate=t)},toggleMuted(e){f.muted=void 0===e?!f.muted:e},proxy:E,requestNextTrack(){g(e)},isLast:()=>!P(e,(0,d.jUK)((0,o.Rd)()).audioPlayer.origin),isFirst:()=>!P(e,(0,d.jUK)((0,o.Rd)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const o=u.get(e);o&&(o.handlers=o.handlers.filter((e=>e!==n)),o.handlers.length||(o.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(h=h.filter(n))}(o,e),e===m&&(m=void 0)))}}}function f(e){switch(e.type){case"audio":return p;case"voice":return h;default:return}}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Cr.Inline,n=arguments.length>2?arguments[2]:void 0;const o=u.get(e),a=f(o);if(!a)return;if(t===i.Cr.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:r}=(0,l.Ak)(y(e).messageKey),s=a.filter((e=>e.startsWith(`msg${r}`))),c=s.indexOf(e);if(c<0)return;let d=t===i.Cr.Inline?-1:1;return n&&(d*=-1),s[c+d]}function E(e){return`${(0,l.Tp)(e)}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function b(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=y(e),{date:a,messageKey:i}=y(t),r=a-n;return 0===r?i.localeCompare(o):r}},64963:(e,t,n)=>{n.d(t,{vJ:()=>l,eM:()=>c,sf:()=>p});var o=n(601);function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(28712),r=n(69118),s=n(43858);let c=function(e){return e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right",e}({});const l=20;function d(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function u(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let m=0;const h=new class{constructor(){let{stability:e=8,sensitivity:t=100,tolerance:n=1.1,delay:o=150}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,"stability",void 0),a(this,"sensitivity",void 0),a(this,"tolerance",void 0),a(this,"delay",void 0),a(this,"lastUpDeltas",void 0),a(this,"lastDownDeltas",void 0),a(this,"deltasTimestamp",void 0),this.stability=e,this.sensitivity=t,this.tolerance=n,this.delay=o,this.lastUpDeltas=new Array(2*this.stability).fill(0),this.lastDownDeltas=new Array(2*this.stability).fill(0),this.deltasTimestamp=new Array(2*this.stability).fill(0)}check(e){let t;return void 0!==(e=e.originalEvent||e).wheelDelta?t=e.wheelDelta:void 0!==e.deltaY?t=-40*e.deltaY:void 0===e.detail&&0!==e.detail||(t=-40*e.detail),this.deltasTimestamp.push(Date.now()),this.deltasTimestamp.shift(),t>0?(this.lastUpDeltas.push(t),this.lastUpDeltas.shift(),this.isInertia(1)):(this.lastDownDeltas.push(t),this.lastDownDeltas.shift(),this.isInertia(-1))}isInertia(e){const t=-1===e?this.lastDownDeltas:this.lastUpDeltas;if(void 0===t[0])return e;if(this.deltasTimestamp[2*this.stability-2]+this.delay>Date.now()&&t[0]===t[2*this.stability-1])return!1;const n=t.slice(0,this.stability),o=t.slice(this.stability,2*this.stability),a=n.reduce(((e,t)=>e+t)),i=o.reduce(((e,t)=>e+t)),r=a/n.length,s=i/o.length;return Math.abs(r)<Math.abs(s*this.tolerance)&&this.sensitivity<Math.abs(s)}}({stability:5,sensitivity:25,tolerance:.6,delay:150});function p(e,t){var n,a,p;let g,Z=!1,v=!1,f=!1,P=0,E=null!==(n=t.initialZoom)&&void 0!==n?n:1,y={x:0,y:0},b={x:!1,y:!1};const C=s.Z.get();let w,S={x:C.width/2,y:C.height/2};const N=null!==(a=t.minZoom)&&void 0!==a?a:1,I=null!==(p=t.maxZoom)&&void 0!==p?p:4;function M(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(g=e,"mousedown"===e.type)!t.withNativeDrag&&t.onDrag&&e.preventDefault(),document.addEventListener("mousemove",x),document.addEventListener("mouseup",k);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",x,{passive:!0}),t.addEventListener("touchend",k),t.addEventListener("touchcancel",k),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(P=d(e.touches[0],e.touches[1]),S=u(e.touches[0],e.touches[1])))}t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function k(e){g&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.removeEventListener("mouseup",k),document.removeEventListener("mousemove",x),g.target.removeEventListener("touchcancel",k),g.target.removeEventListener("touchend",k),g.target.removeEventListener("touchmove",x),o.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),e&&(Z?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-m<300?t.onDoubleClick(e,{centerX:g.pageX,centerY:g.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),m=Date.now()))),Z=!1,v=!1,f=!1,P=0,E=(0,i.uZ)(E,N,I),w=void 0,y={x:0,y:0},b={x:!1,y:!1};const n=s.Z.get();S={x:n.width/2,y:n.height/2},g=void 0}function x(e){if(g){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&P>0&&2===e.touches.length)){const n=d(e.touches[0],e.touches[1]),o=u(e.touches[0],e.touches[1]),a=o.x-S.x,i=o.y-S.y,r=n/P;t.onZoom(e,{zoomFactor:r,initialCenterX:S.x,initialCenterY:S.y,dragOffsetX:a,dragOffsetY:i,currentCenterX:o.x,currentCenterY:o.y}),1!==r&&(Z=!0)}const n=e.pageX-g.pageX,a=e.pageY-g.pageY;(Math.abs(n)>=15||Math.abs(a)>=15)&&(Z=!0);let i=!1;t.onDrag&&(t.onDrag(e,g,{dragOffsetX:n,dragOffsetY:a}),i=!0),t.onSwipe&&!v&&(v=function(e,n,a){if(o.cj){const t=e.touches[0].pageX;if(t<=l||t>=s.Z.get().width-l)return!1}const i=Math.abs(n),r=Math.abs(a);if(n&&a&&Math.max(i,r)/Math.min(i,r)<2)return!1;let d;if(i>=50?d="x":r>=50&&(d="y"),!d)return!1;if(w){if(w!==d)return!1}else w=d;return function(e,t,n,o,a){return"x"===t?a(e,n<0?c.Left:c.Right):"y"===t&&a(e,o<0?c.Up:c.Down)}(e,d,n,a,t.onSwipe)}(e,n,a),i=v),o.cj&&i&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}const T=(0,r.Ds)(k,150,!1),A=(0,r.Ds)(k,150,!1);function O(e){Z||(M(e),Z=!0,S={x:e.x,y:e.y})}function R(e){if(!t.onZoom&&!t.onDrag)return;if(t.excludedClosestSelector&&(e.target.matches(t.excludedClosestSelector)||e.target.closest(t.excludedClosestSelector)))return;e.preventDefault(),e.stopPropagation();const{doubleTapZoom:n=3}=t;if(t.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return O(e),E=E>1?1:n,t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),void(Z=!1);const o=e.metaKey||e.ctrlKey||e.shiftKey;if(o&&function(e){if(!t.onZoom)return;O(e);const n=e.x-S.x,o=e.y-S.y,a=(0,i.uZ)(e.deltaY,-25,25);E-=.01*a,E=(0,i.uZ)(E,.5*N,3*I),f=!0,t.onZoom(e,{zoom:(0,i.NM)(E,2),initialCenterX:S.x,initialCenterY:S.y,dragOffsetX:n,dragOffsetY:o,currentCenterX:e.x,currentCenterY:e.y}),A(e)}(e),!o&&!f){const n=h.check(e);(1!==E||n)&&function(e){if(!t.onDrag)return;O(e),b.x&&Math.sign(y.x)!==Math.sign(e.deltaX)||(y.x-=e.deltaX),b.y&&Math.sign(y.y)!==Math.sign(e.deltaY)||(y.y-=e.deltaY);const{x:n,y:o}=y;t.onDrag(e,g,{dragOffsetX:n,dragOffsetY:o},((e,t)=>{b={x:e,y:t}})),T(e)}(e)}}return e.addEventListener("wheel",R),e.addEventListener("mousedown",M),e.addEventListener("touchstart",M,{passive:!t.isNotPassive}),()=>{k(),e.removeEventListener("wheel",R),e.removeEventListener("touchstart",M),e.removeEventListener("mousedown",M)}}},75851:(e,t,n)=>{n.d(t,{CO:()=>i,eb:()=>s,ix:()=>c,rZ:()=>l,uR:()=>d,wK:()=>a,xP:()=>r});var o=n(71394);function a(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function i(e){const t=e[0].toString(16),n=e[1].toString(16),o=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==n.length?"0"+n:n)+(1==o.length?"0"+o:o)}function r(e){let[t,n,o]=e;t/=255,n/=255,o/=255;let a,i,r=Math.max(t,n,o),s=Math.min(t,n,o),c=r,l=r-s;if(i=0==r?0:l/r,r==s)a=0;else{switch(r){case t:a=(n-o)/l+(n<o?6:0);break;case n:a=(o-t)/l+2;break;case o:a=(t-n)/l+4}a/=6}return[a,i,c]}function s(e){let t,n,o,[a,i,r]=e,s=Math.floor(6*a),c=6*a-s,l=r*(1-i),d=r*(1-c*i),u=r*(1-(1-c)*i);switch(s%6){case 0:t=r,n=u,o=l;break;case 1:t=d,n=r,o=l;break;case 2:t=l,n=r,o=u;break;case 3:t=l,n=d,o=r;break;case 4:t=u,n=l,o=r;break;case 5:t=r,n=l,o=d}return[Math.round(255*t),Math.round(255*n),Math.round(255*o)]}async function c(e){const t=[0,0,0];let n,a,i,r,s=-4,c=[0,0,0],l=0;const d=document.createElement("canvas"),u=d.getContext&&d.getContext("2d");if(!u)return t;const m=await(0,o.pt)(e);i=m.naturalHeight||m.offsetHeight||m.height,a=m.naturalWidth||m.offsetWidth||m.width,d.height=i,d.width=a,u.drawImage(m,0,0);try{n=u.getImageData(0,0,a,i)}catch(e){return t}for(r=n.data.length;(s+=20)<r;)0!==n.data[s+3]&&(++l,c[0]+=n.data[s],c[1]+=n.data[s+1],c[2]+=n.data[s+2]);return c[0]=Math.floor(c[0]/l),c[1]=Math.floor(c[1]/l),c[2]=Math.floor(c[2]/l),c}function l(e){const[t,n,o]=e;return.2126*t+.7152*n+.0722*o}function d(e){let[t,n,o]=r(e);return n=Math.min(1,n+.05+.1*(1-n)),o=o>.5?Math.max(0,.65*o):Math.max(0,Math.min(1,1-.65*o)),`hsla(${360*t}, ${100*n}%, ${100*o}%, .4)`}},3570:(e,t,n)=>{function o(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>o})},6562:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(69118);let a=[],i=!1;function r(e,t){a.push({url:e,filename:t}),i||(i=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of a)s(t),e++,10===e&&(await(0,o.wO)(1e3),e=0);a=[]}(),i=!1}),1e3))}function s(e){let{url:t,filename:n}=e;const o=document.createElement("a");o.href=t,o.download=n;try{o.click()}catch(e){console.error(e)}}},65723:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(601),a=n(57710);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),r=document.createRange(),s=e.lastChild||e;o.$b||n||s&&s.nodeValue?(r.selectNodeContents(n?e:s),r.collapse(!1),i.removeAllRanges(),i.addRange(r)):(0,a.i$)((()=>e.focus()))}},60998:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(83716);function a(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&i(e.focusNode,o.gnl);if(!t||0===t.childElementCount)return;const a=Array.from(t.children).reduce(((e,t)=>1===t.nodeType&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):1===t.nodeType&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||a.pop(),a}function i(e,t){return!(1!==e.nodeType||!e.classList.contains(t))||!!e.parentNode&&i(e.parentNode,t)}},93447:(e,t,n)=>{n.d(t,{j:()=>i,t:()=>r});var o=n(75851);const a=240;function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png";const o=e instanceof Blob?URL.createObjectURL(e):e,a=new Image;return new Promise((i=>{a.onload=()=>{s(a,a.width*t,a.height*t,n).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(i).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(o)}))},a.src=o}))}function r(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";const a=e instanceof Blob?URL.createObjectURL(e):e,i=new Image;return new Promise((r=>{i.onload=()=>{s(i,t,n,o).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(r).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(a)}))},i.src=a}))}async function s(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(!("createImageBitmap"in window))return c(e,t,n,void 0,i);try{const r=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(r.height!==n||r.width!==t)throw new Error("Image bitmap resize not supported!");const s=await(0,o.ix)(e.src),c=(0,o.rZ)(s)<a?"#fff":"#000";return await new Promise((e=>{const t=document.createElement("canvas");t.width=r.width,t.height=r.height;const n=t.getContext("2d");n.fillStyle=c,n.fillRect(0,0,t.width,t.height);const o=t.getContext("bitmaprenderer");o?o.transferFromImageBitmap(r):n.drawImage(r,0,0),t.toBlob(e,i)}))}catch(o){return c(e,t,n,void 0,i)}}async function c(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"image/png";const s=document.createElement("canvas"),c=s.getContext("2d"),l=document.createElement("canvas"),d=l.getContext("2d");if(s.width=t,s.height=n,e.width*i>t){const n=1/i;let o={width:Math.floor(e.width*i),height:Math.floor(e.height*i)};for(l.width=o.width,l.height=o.height,d.drawImage(e,0,0,o.width,o.height);o.width*i>t;)o={width:Math.floor(o.width*i),height:Math.floor(o.height*i)},d.drawImage(l,0,0,o.width*n,o.height*n,0,0,o.width,o.height);c.drawImage(l,0,0,o.width,o.height,0,0,s.width,s.height)}else c.drawImage(e,0,0,s.width,s.height);const u=await(0,o.ix)(e.src),m=(0,o.rZ)(u)<a?"#fff":"#000";return c.fillStyle=m,c.globalCompositeOperation="destination-over",c.fillRect(0,0,s.width,s.height),new Promise((e=>{s.toBlob(e,r)}))}},55254:(e,t,n)=>{n.d(t,{P:()=>a});var o=n(43858);function a(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=o.Z.get();return t.top<=n&&t.top+t.height>=0}},91489:(e,t,n)=>{n.d(t,{Qw:()=>s,k4:()=>l,lZ:()=>c,zY:()=>r});const o={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},a=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),i=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15;const{lat:a,long:i}=t,r=o[e];switch(e){case"google":return`${r}/place/${a}+${i}/@${a},${i},${n}z`;case"bing":return`${r}?cp=${a}~${i}&lvl=${n}&sp=point.${a}_${i}`;case"apple":return`${r}?q=${a},${i}`;default:return`${r}/?mlat=${a}&mlon=${i}&zoom=${n}`}}function s(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function c(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function l(e){return e?a.get(e)||a.get(e.split("/")[0])||i[(t=e,t.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0)%i.length)]:"#008df2";var t}},64532:(e,t,n)=>{n.d(t,{Ay:()=>s,N:()=>a,NS:()=>l,Of:()=>d,Ym:()=>i,pC:()=>c});const o={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function a(e,t){const{mediaSession:n}=window.navigator;n?(e&&i(e),t&&r(t)):console.warn("MediaSession API not supported in this browser")}function i(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function r(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach((e=>{let[n,o]=e;try{t.setActionHandler(n,o)}catch(e){}}))}function s(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,r(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function d(e){let{title:t,artist:n,album:o,artwork:a}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:o,artwork:a})}},16580:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60782);const a=new WeakMap;function i(e){return function(){const t=a.get(e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(t&&(0,o.et)(t.lastArgs,i))return t.lastResult;const s=e(...i);return a.set(e,{lastArgs:i,lastResult:s}),s}}},94462:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(33681);const a=new RegExp(`^(?:${o.Z.source})+$`,""),i=e=>{const t=e.split("\n"),n=t.join("");if(n.length>800)return!1;if(!Boolean(n.match(a)))return!1;const i=t.map((e=>{let t=0;for(;o.Z.exec(e);)if(t++,t>100)return o.Z.lastIndex=0,-1;return t}));let r=t.length;for(let e=0;e<i.length;e++){if(-1===i[e])return!1;i[e]>r&&(r=i[e])}return r}},83099:(e,t,n)=>{n.d(t,{ZP:()=>s,fu:()=>c,xe:()=>r});var o=n(6137),a=n(83716),i=n(601);const r={B:o.Vv.Bold,STRONG:o.Vv.Bold,I:o.Vv.Italic,EM:o.Vv.Italic,INS:o.Vv.Underline,U:o.Vv.Underline,S:o.Vv.Strike,STRIKE:o.Vv.Strike,DEL:o.Vv.Strike,CODE:o.Vv.Code,PRE:o.Vv.Pre,BLOCKQUOTE:o.Vv.Blockquote};function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=document.createElement("div");o.innerHTML=n?e:l(t?d(e):e),c(o);const a=o.innerText.trim().replace(/\u200b+/g,""),i=o.innerText.indexOf(a[0]);let r=-i,s=0;const m=[];function h(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=u(e,a,r);if(n)r=t,m.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;r+=e.textContent.length}e.hasChildNodes()&&s<=3&&(s+=1,Array.from(e.childNodes).forEach(h))}return Array.from(o.childNodes).forEach((e=>{s=1,h(e)})),{text:a,entities:m.length?m:void 0}}function c(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}function l(e){let t=e.slice(0);return 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](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),i.op||(t=t.replace(/\[<img[^>]+alt="([^"]+)"[^>]*>]/gm,"[$1]")),t=t.replace(/(?!<(?:code|pre)[^<]*|<\/)\[([^\]\n]+)\]\(customEmoji:(\d+)\)(?![^<]*<\/(?:code|pre)>)/g,'<img alt="$1" data-document-id="$2">'),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)/g,"<b>$2</b>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)/g,"<i>$2</i>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)/g,"<s>$2</s>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)/g,`<span data-entity-type="${o.Vv.Spoiler}">$2</span>`),t}function d(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${a.FM6}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`))}function u(e,t,n){const a=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(r[e.nodeName])return r[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===o.Vv.MentionName?o.Vv.MentionName:t.dataset.entityType===o.Vv.Url?o.Vv.Url:t.href.startsWith("mailto:")?o.Vv.Email:t.href.startsWith("tel:")?o.Vv.Phone:t.href!==t.textContent?o.Vv.TextUrl:o.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?o.Vv.CustomEmoji:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),s=i>=0?i:n,c=t.substring(0,s).length,{length:l}=t.substring(s,s+e.textContent.length);return a===o.Vv.TextUrl?{index:s,entity:{type:a,offset:c,length:l,url:e.href}}:a===o.Vv.MentionName?{index:s,entity:{type:a,offset:c,length:l,userId:e.dataset.userId}}:a===o.Vv.Pre?{index:s,entity:{type:a,offset:c,length:l,language:e.dataset.language}}:a===o.Vv.CustomEmoji?{index:s,entity:{type:a,offset:c,length:l,documentId:e.dataset.documentId}}:{index:s,entity:{type:a,offset:c,length:l}}}},41098:(e,t,n)=>{n.d(t,{Mq:()=>s,dG:()=>c,gJ:()=>i,qK:()=>r,tx:()=>a});const o=document.createElement("div");function a(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),a=o.lastChild;n.insertNode(o),a?(n.setStartAfter(a),n.setEndAfter(a)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function i(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const a=n.getRangeAt(0).cloneRange();return a.intersectsNode(e)?t||e.contains(a.commonAncestorContainer)?(a.collapse(!0),a.setStart(e,0),o.innerHTML="",o.appendChild(a.cloneContents()),o.innerHTML):"":e.innerHTML}function r(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),a=o.cloneRange();return a.selectNodeContents(e),a.setEnd(o.endContainer,o.endOffset),t=a.toString().length,t}function s(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),o=window.getSelection();return e.setStart(n,t),e.collapse(!0),o.removeAllRanges(),o.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=s(n,t)))return-1;return t}function c(){window.getSelection()?.removeAllRanges()}},85655:(e,t,n)=>{let o;function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o||(o=document.createElement("input"),o.setAttribute("type","file")),o.setAttribute("accept",e),n?o.removeAttribute("multiple"):o.setAttribute("multiple","multiple"),o.onchange=null,o.value="",o.onchange=t,o.click()}n.d(t,{g:()=>a})},41372:(e,t,n)=>{n.d(t,{Z:()=>o});const o={root:"J2OUAM1NNJzVPwPvfhkE",fadeIn:"M0CnDOPqsqgp07DpRE7u",closing:"U1ngPxxXOIuHX2rXUTdq",user:"vEyOaK0611BDq1vciUK5",name:"M4TMTYSSXa3H49Go9t9g",name_hasUnreadStory:"kUi0jmHQpokhzBJI5FJA",nameHasUnreadStory:"kUi0jmHQpokhzBJI5FJA",hidden:"c5X6suR_qxO1W64dH2j3",contextMenu:"nAc8FkZyj9PHGgGm0BO7"}},68973:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.8ea62f6317fbac7d4558.js"}}]);
|
||
//# sourceMappingURL=4269.28fc5604715befe86c2b.js.map
|