"use strict";(self.webpackChunkmontana_messenger=self.webpackChunkmontana_messenger||[]).push([[3952],{63744(e,t,n){n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(11597),a=n(71331),r=n(87357),d=n(14),c=n(59030),l=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,s.hds)(e,t),o=(0,a.mD)(e,t);return{groupCall:o,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}})(({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,i.ko)(),g=(0,c.A)(),f=(0,o.hb)(()=>{p({chatId:e})},[p,e]),v=s?.participants,A=(0,o.Kr)(()=>{if(!v)return[];const e=(0,i.mS)().users.byId,t=(0,i.mS)().chats.byId;return Object.values(v).slice(0,3).map(({id:n})=>e[n]||t[n]).filter(Boolean)},[v]),y=(0,d.A)(s?.participantsCount,!0),C=(0,d.A)(A,!0),w=Boolean(s&&t),{ref:I,shouldRender:b}=(0,l.A)({isOpen:w,onStateChange:a});if(b)return(0,m.FD)("div",{ref:I,className:(0,r.A)("GroupCallTopPane",n),onClick:f,children:[(0,m.FD)("div",{className:"info",children:[(0,m.Y)("span",{className:"title",children:g("VoipGroupVoiceChat")}),(0,m.Y)("span",{className:"participants",children:g("Participants",y??0,"i")})]}),Boolean(C?.length)&&(0,m.Y)(u.A,{size:"small",peers:C,className:"avatars"}),(0,m.Y)(h.A,{round:!0,className:"join",children:g("VoipChatJoin")})]})}))},70832(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(14242),s=n(39351),a=n(17712),r=n(20021);const d=(0,o.ph)(({className:e,size:t,progress:n})=>{const d=(0,s.A)(),[c,l]=(0,o.J0)(0),u=(0,o.li)(),h=(0,a.A)(()=>{clearTimeout(u.current),u.current=void 0}),m=(0,a.A)(()=>{if(void 0===n)return;const e=t*n,o=e-c;if(0!==o){const t=Math.max(262144,o/10),n=Math.min(e,c+t);l(n)}u.current=window.setTimeout(()=>{m()},100)});(0,o.vJ)(()=>{if(void 0===n)return h(),void l(0);const e=t*n;if(e>1073741824||1===n)return h(),void l(e);u.current||m()},[n,t]),(0,o._W)(h);const p=(0,i.v7)(d,c,2),g=(0,i.v7)(d,t);return void 0===n||1===n?g:(0,r.Y)("span",{className:e,dir:d.isRtl?"rtl":void 0,children:d("FileTransferProgress",{currentSize:p,totalSize:g},{withNodes:!0})})})},65240(e,t,n){n.d(t,{Ay:()=>E});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(11597),c=n(56494),l=n(53827),u=n(87357),h=n(50442),m=n(58744),p=n(44029),g=n(4961),f=n(43874),v=n(88792),A=n(71533),y=n(39351),C=n(17712),w=n(62587),I=n(69419),b=n(59030),S=n(50680),M=n(64493),N=n(96530),k=n(35913),Y=n(70832),F=n(4438),P=n(18276),T=n(20021);const D=window.matchMedia("(max-width: 375px)"),x=window.matchMedia("(max-width: 410px)");function L(e,t,n,o,i,s,a,r,d,c,l,u){const{title:h,performer:p,fileName:f}=n,v=i||s>0&&s<1,{isRtl:A}=e;return(0,T.FD)("div",{className:"content",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:h,children:(0,g.A)(h||f)}),v&&(0,T.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:(0,m.QO)(o*s,o)}),R(s,a,r)]}),!v&&d&&(0,T.Y)(Y.A,{className:"meta",size:n.size,progress:l}),!v&&!d&&(0,T.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration",dir:"auto",children:(0,m.QO)(o)}),p&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:"•"}),(0,T.Y)("span",{className:"performer",dir:"auto",title:p,children:(0,g.A)(p)})]}),Boolean(c)&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:"•"}),(0,T.Y)(N.A,{className:"date",onClick:u,children:(0,m.fS)(t,1e3*c,!0)})]})]})]})}function B(e,t,n,o,i,s,r,d,c,l,h,p){return(0,T.FD)("div",{className:"content",children:[(0,T.FD)("div",{className:"waveform-wrapper",children:[(0,T.Y)("div",{className:"waveform",draggable:!1,ref:t,children:(0,T.Y)("canvas",{ref:n})}),l&&(0,T.FD)(M.A,{onClick:()=>{(d||c)&&h?h(!r):s||l()},children:[(0,T.Y)(P.A,{name:d||c?"down":"transcribe",className:(0,u.A)("transcribe-icon",(d||c)&&!r&&"transcribe-shown")}),s&&(0,T.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,T.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]}),(0,T.Y)("p",{className:(0,u.A)("voice-duration",p!==a.d9.OneTimeModal&&i&&"unread"),dir:"auto",children:0===o||1===o?(0,m.QO)(e.duration):(0,m.QO)(e.duration*o)})]})}function R(e,t,n){return(0,T.FD)("div",{className:"seekline",ref:n,children:[t.map(({start:e,end:t})=>(0,T.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`})),(0,T.Y)("span",{className:"seekline-play-progress",children:(0,T.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,T.Y)("span",{className:"seekline-thumb",children:(0,T.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const E=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,d.Pn$)(e,t),mediaDuration:(0,c.Y9)(e,t)}))(({theme:e,message:t,senderTitle:n,uploadProgress:d,origin:c,date:Y,noAvatars:E,className:O,isSelectable:U,isSelected:K,isDownloading:z,isTranscribing:V,isTranscriptionHidden:j,isTranscribed:G,isTranscriptionError:J,canDownload:q,canTranscribe:$,autoPlay:H,webPage:W,mediaDuration:_,onHideTranscription:Q,onPlay:Z,onPause:X,onReadMedia:ee,onCancelUpload:te,onDateClick:ne})=>{const{cancelMediaDownload:oe,downloadMedia:ie,transcribeAudio:se,openOneTimeMediaModal:ae}=(0,i.ko)(),{content:{audio:re,voice:de,video:ce},isMediaUnread:le}=t,ue=re||(0,r.y3)(W),he=de||ce||ue,me=de||ce,pe=Boolean(de||ce),ge=(0,o.li)(!1),fe=(0,o.li)(),ve=(0,b.A)(),Ae=(0,y.A)(),{isMobile:ye}=(0,f.Ay)(),[Ce,we]=(0,o.J0)(!1),Ie=Ce||!0,be=(0,r.VO)(he,"pictogram"),Se=(0,w.A)(be,!1,s.qZ.BlobUrl),Me=(0,r.G5)(t),Ne=c===a.d9.OneTimeModal,ke=pe?Me?"oneTimeVoice":"voice":"audio",Ye=(0,w.A)((0,r.VO)(he,"inline"),!Ie,(0,r.Cz)(he,"inline")),{loadProgress:Fe}=(0,I.A)((0,r.VO)(he,"download"),!z,(0,r.Cz)(he,"download")),Pe=(0,C.A)(()=>{we(!0),Z?.(t.id,t.chatId)}),Te=(0,C.A)(()=>{we(!1)}),{isBuffered:De,bufferedRanges:xe,bufferingHandlers:Le,checkBuffering:Be}=(0,A.A)(),Re=Ne,{isPlaying:Ee,playProgress:Oe,playPause:Ue,setCurrentTime:Ke,duration:ze}=(0,v.A)((0,l.dj)(t),_,ke,Ye,Le,void 0,Be,Boolean(Ce||H),Pe,Te,(0,r.Nb)(t)||Me,void 0,X,Re,Me&&!Ne),Ve=1-Oe,je=(0,r.Ie)(t),Ge=Me&&Ne,Je=function(e,t,n=0,i=!1,s=!1,a=!1,r=!1){const d=(0,o.li)(),{data:c,peak:l}=(0,o.Kr)(()=>{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:i}=function(e,t){return{MIN_SPIKES:e?D.matches?16:20:25,MAX_SPIKES:e?D.matches?35:t&&x.matches?40:45:75}}(a,s),r=Math.min(n/10,1),d=Math.round(o+(i-o)*r);return function(e,t){let n=0;const o=new Array(t),i=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=i[s]+(i[s+1]<<8);return o[n-1]=r>>a&31,o}(new Uint8Array(e)),d)},[a,t,s])||{};return(0,o.Nf)(()=>{const t=d.current;t&&c&&void 0!==l&&function(e,t,n,{peak:o,fillStyle:i,progressFillStyle:s}){const a=4*t.length;e.width=2*a,e.height=46,e.style.width=`${a}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach((e,a)=>{r.globalAlpha=a/t.length>=n?.5:1,r.fillStyle=n>a/t.length?s:i;const d=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,o,i,s){2<2*s&&(s=1),i<2*s&&(s=i/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-i,s),e.arcTo(t+2,n-i,t,n-i,s),e.arcTo(t,n-i,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+d)/2,0,d,1),r.fill()})}(t,c,r?1-n:n,{peak:l,fillStyle:i?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:i?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})},[i,l,n,c,e,r]),d}(e,me,!le||je||Ge?Oe:1,je,!E,ye,Ge),qe=Ee||Oe>0&&Oe<1;(0,o.vJ)(()=>{we(Ee)},[Ee]);const $e=Ce&&!De,{isUploading:He,isTransferring:We,transferProgress:_e}=(0,r.LK)(d||Fe,$e||z,void 0!==d),{shouldRender:Qe,transitionClassNames:Ze}=(0,S.A)(We),Xe=Qe&&($e||He),et=(0,C.A)(()=>{if(He)te?.();else{if(Me)return ae({message:t}),void ee?.();Ee||Z?.(t.id,t.chatId),(0,i.ko)().setAudioPlayerOrigin({origin:c}),we(!Ce),Ue()}});(0,o.vJ)(()=>{ee&&le&&Ee&&ee()},[Ee,le,ee]);const tt=(0,C.A)(()=>{z?oe({media:he}):ie({media:he,originMessage:t})}),nt=(0,C.A)(e=>{if(ge.current&&fe.current){const{width:t,left:n}=fe.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ke(Math.max(Math.min(ze*((o-n)/t),ze-.1),.001))}}),ot=(0,C.A)(e=>{e instanceof MouseEvent&&2===e.button||(ge.current=!0,nt(e))}),it=(0,C.A)(()=>{ge.current=!1}),st=(0,C.A)(()=>{ne(t)}),at=(0,C.A)(()=>{se({chatId:t.chatId,messageId:t.id})});function rt(){if(pe)return n||"Voice";const{title:e,fileName:t}=ue;return e||t}function dt(){if(pe)return(0,T.Y)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:(0,m.QO)((de||ce).duration)});const{performer:e}=ue;return(0,T.FD)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:[(0,m.QO)(ze),(0,T.Y)("span",{className:"bullet",children:"•"}),e&&(0,T.Y)("span",{className:"performer",title:e,children:(0,g.A)(e)}),e&&n&&(0,T.Y)("span",{className:"bullet",children:"•"}),n&&(0,T.Y)("span",{title:n,children:(0,g.A)(n)})]})}(0,o.vJ)(()=>{if(fe.current&&qe&&!Ne)return(0,h.wJ)(fe.current,{onCapture:ot,onRelease:it,onClick:it,onDrag:nt})},[qe,ot,nt,it,Ne]);const ct=(0,u.A)("Audio",O,Ne&&"non-interactive",c===a.d9.Inline&&"inline",je&&c===a.d9.Inline&&"own",(c===a.d9.Search||c===a.d9.SharedMedia)&&"bigger",K&&"audio-is-selected"),lt=["toogle-play-wrapper"];Xe?lt.push("loading"):lt.push(Ee?"pause":"play");const ut=(0,u.A)("content",qe&&"with-seekline");function ht(){return(0,T.FD)("div",{className:ut,children:[(0,T.FD)("div",{className:"content-row",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:rt(),children:(0,g.A)(rt())}),(0,T.Y)("div",{className:"message-date",children:Boolean(Y)&&(0,T.Y)(N.A,{className:"date",onClick:st,children:(0,m.be)(ve,1e3*Y)})})]}),qe&&(0,T.FD)("div",{className:"meta search-result",dir:Ae.isRtl?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:Oe<1&&(0,m.QO)(ze*Oe,ze)}),R(Oe,xe,fe)]}),!qe&&dt()]})}return(0,T.FD)("div",{className:ct,dir:Ae.isRtl?"rtl":"ltr",children:[U&&(0,T.Y)("div",{className:"message-select-control no-selection",children:K&&(0,T.Y)(P.A,{name:"check",className:"message-select-control-icon"})}),(0,T.FD)("div",{className:(0,u.A)(...lt),children:[(0,T.FD)(M.A,{round:!0,ripple:!ye,size:"smaller",className:"toggle-play",color:Se?"translucent-white":"primary",ariaLabel:Ee?"Pause audio":"Play audio",onClick:et,isRtl:Ae.isRtl,backgroundImage:Se,nonInteractive:Ne,children:[!Ne&&(0,T.Y)(P.A,{name:"play"}),!Ne&&(0,T.Y)(P.A,{name:"pause"}),Ne&&(0,T.Y)(F.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Me&&!Ne&&(0,T.Y)(P.A,{name:"view-once"})]}),Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading",Ze,Xe&&"interactive"),children:(0,T.Y)(k.A,{progress:_e,transparent:!0,withColor:!0,size:"m",onClick:Xe?et:void 0,noCross:!Xe})}),Ne&&!Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading"),children:(0,T.Y)(k.A,{progress:Oe,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ue&&q&&!He&&(0,T.Y)(M.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:z?"Cancel download":"Download",onClick:tt,iconName:z?"close":"arrow-down"}),c===a.d9.Search&&ht(),c!==a.d9.Search&&ue&&L(Ae,ve,ue,ze,Ee,Oe,xe,fe,z||He,Y,_e,ne?st:void 0),c===a.d9.SharedMedia&&me&&ht(),(c===a.d9.Inline||Ne||G)&&me&&B(me,fe,Je,Me?Ve:Oe,le,V,j,G,J,$?at:void 0,Q,c)]})}))},85637(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(90709),s=n(87357),a=n(62587),r=n(38691),d=n(55158);var c=n(56534),l=n(20021);const u=(0,o.ph)(({className:e,geo:t,width:n,height:o,zoom:u=15,shouldShowPin:h=!0,onClick:m})=>{const p=(0,r.A)(),g=(0,i.rt)(t,n,o,u,p),f=(0,a.A)(g);return(0,l.FD)("div",{className:(0,s.A)("XBUElgxr",m&&"J6r8_vbD",e),style:`width: ${n}px; height: ${o}px;`,onClick:m,children:[f?(0,l.Y)("img",{src:f,alt:"",className:"WcMeaxCq",draggable:!1}):(0,l.Y)(d.A,{className:"jkrmQLBw",width:n,height:o,animation:"wave"}),h&&(0,l.Y)("img",{src:c,alt:"",className:"N9mH6bow",draggable:!1})]})})},5505(e,t,n){n.d(t,{c:()=>y,A:()=>S});var o=n(84051),i=n(90709),s=n(96454),a=n(87357),r=n(76023),d=n(43874),c=n(45470),l=n(5912),u=n(62587),h=n(37960),m=n(65843),p=n(18276),g=n(27860);const f="NsY9vwcV";var v=n(20021);const A=2*r.$;function y(e,t){const n=e?.photo,o=e?.document,i=w(n,o,e?.video,t),s=e?.video||t?.gif,a=I(s,i),r=a?e?.video?.blobUrl||t?.blobUrl:void 0,d=b(n,o,s,a);return Boolean(i||r||d||C(n,o,e?.video,t))}function C(e,t,n,o){return e&&(0,i.VD)(e)||t&&(0,i.VD)(t)||n&&(0,i.VD)(n)||o?.previewBlobUrl||(o?.mimeType.startsWith("image/")?o.blobUrl:void 0)}function w(e,t,n,o){return e?.blobUrl||t?.previewBlobUrl||n?.previewBlobUrl||o?.previewBlobUrl||(o?.mimeType.startsWith("image/")?o.blobUrl:void 0)}function I(e,t){return Boolean(e?.isGif&&!e.previewPhotoSizes?.length&&!t)}function b(e,t,n,o){return e?(0,i.rI)(e,"pictogram"):t?(0,i.mr)(t,"pictogram"):n?(0,i.sC)(n,o?"full":"pictogram"):void 0}const S=(0,o.ph)(({id:e,className:t,media:n,attachment:i,size:r,isPictogram:y,isRound:S,isProtected:M,isSpoiler:N,actionIcon:k,observeIntersectionForLoading:Y,observeIntersectionForPlaying:F,onClick:P})=>{const T=(0,o.li)(),{isMobile:D}=(0,d.Ay)(),x=r||(y?A:void 0),L=n?.photo,B=n?.document,R=n?.video||i?.gif,E=w(L,B,n?.video,i),O=I(R,E),U=(0,l.Vz)(T,Y),K=(0,l.Vz)(T,F)&&U,z=b(L,B,R,O),V=O?n?.video?.blobUrl||i?.blobUrl:void 0,j=C(L,B,n?.video,i),G=(0,u.A)(z,Boolean(!z||E||V||!U)),J=E||(O?void 0:G),q=V||(O?G:void 0),$=N??L?.isSpoiler??n?.video?.isSpoiler??i?.shouldSendAsSpoiler,H=Boolean(J||q),W=Boolean(j&&($||!H)),_=(0,c.A)(j,!j||!W,D&&!s.QH,void 0,x,x);(0,h.A)({ref:_,hasMediaData:W});const{ref:Q}=(0,h.A)({hasMediaData:Boolean(J&&!$)}),{ref:Z}=(0,h.A)({hasMediaData:Boolean(q&&!$)}),X=j||J,ee=x?`width: ${x}px; height: ${x}px`:void 0;return(0,v.FD)("div",{ref:T,id:e,className:(0,a.A)("owIDN_V5",t,y&&"m7kss9na",S&&"fJ_oGwtQ",k&&"_vdnpJ_s",P&&"VsrDmC01"),style:ee,onClick:P,children:[j&&(0,v.Y)("canvas",{ref:_,className:(0,a.A)("thumbnail","OwdvzYe0")}),!$&&J&&(0,v.Y)("img",{ref:Q,src:J,alt:"",className:(0,a.A)("full-media",f),draggable:!1}),!$&&q&&(0,v.Y)(m.A,{ref:Z,className:(0,a.A)("full-media",f),src:q,canPlay:K,poster:j,loop:!0,playsInline:!0,muted:!0,disablePictureInPicture:!0}),(0,v.Y)(g.A,{thumbDataUri:X,isVisible:Boolean($),width:x,height:x}),M&&(0,v.Y)("span",{className:(0,a.A)("protector","Sc_QpUHj")}),k&&(0,v.Y)(p.A,{name:k,className:"ChEzNmCw"})]})})},17676(e,t,n){n.d(t,{A:()=>rn});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),c=n(27109),l=n(70636),u=n(11597),h=n(64520),m=n(30708),p=n(96115),g=n(96454),f=n(87357),v=n(58744),A=n(55148),y=n(46275),C=n(91800),w=n(60261),I=n(48899),b=n(87679),S=n(36353),M=n(48775),N=n(58554),k=n(79824),Y=n(80539),F=n(39074),P=n(80140),T=n(43503),D=n(13235);let x;function L(e){x.focus(),e.focus()}g.pz&&(x=document.createElement("input"),x.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(x));var B=n(55153),R=n(58734),E=n(11359),O=n(4961),U=n(69282),K=n(32625),z=n(14737),V=n(10722),j=n(19129),G=n(82117),J=n(37661),q=n(30857),$=n(41316),H=n(39351),W=n(17712),_=n(59030),Q=n(39996),Z=n(29886),X=n(73767),ee=n(11186),te=n(73172),ne=n(50680),oe=n(41257),ie=n(35297),se=n(17778),ae=n(63988),re=n(83414);const de=/^\/([\w@]{1,32})?$/i;var ce=n(78396),le=n(11951),ue=n(45761);const he=new Set([a.CfG,a.e0F,a.YVZ]);var me=n(3225),pe=n(37859),ge=n(56133),fe=n(61157),ve=n(60138);let Ae=!1;const ye=new Set([s.C7.TextUrl,s.C7.Url]);var Ce=n(25498),we=n(37830);const Ie=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,be=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Se={username:"",query:"",canShowHelp:!1,usernameLowered:""},Me=document.createElement("div");const Ne=(0,we.A)((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})),ke=new RegExp(a.kNZ,"i");var Ye=n(9442),Fe=n(20247),Pe=n(16120),Te=n(17237);const De=new RegExp(`^${a.bpX.source}$`,"g");var xe=n(11778);const Le={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Be={type:"audio/ogg"};let Re,Ee,Oe;async function Ue(){return Re||(Re=n.e(4550).then(n.t.bind(n,14550,23)),Ee=(await Re).default,Oe=new Ee(Le)),Re}async function Ke(e){await async function(){await Ue(),await Oe.start()}();const t=Date.now();let n;const o=[],i=[];Oe.ondataavailable=e=>{o.push(e)};const s=function(t){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const s=o.frequencyBinCount,a=new Uint8Array(s);let d=!1;return function t(){if(d)return;o.getByteFrequencyData(a);const n=a.reduce((e,t)=>e+t,0)/s/255;(t=>{i.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{d=!0}}(Oe);return{stop:()=>new Promise((e,a)=>{Oe.onstop=()=>{e({blob:new Blob(o,Be),duration:Math.round(((n||Date.now())-t)/1e3),waveform:i})},Oe.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Oe.stop(),s()},r)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{Oe.pause(),n=Date.now(),s()},e)}}}var ze=n(80089),Ve=n(80464),je=n(20021);const Ge=e=>{const{attachments:t}=e,n=(0,Ve.A)(ze.ar.Extra,"AttachmentModal",!t.length);return n?(0,je.Y)(n,{...e}):void 0};var Je=n(61182),qe=n(52844),$e=n(36680),He=n(18276),We=n(71429),_e=n(24433),Qe=n(66469),Ze=n(54639),Xe=n(22110),et=n(57003),tt=n(64493),nt=n(19806),ot=n(40664),it=n(22337),st=n(17486);const at="lhbRRfJq",rt="HWyhnXC0",dt="NQnrpinS",ct="CNbapDG1",lt=(0,o.ph)(({isOpen:e,onClose:t,onSubmit:n})=>{const[i,s,a]=(0,J.A)(),[r,d]=(0,o.J0)(()=>pt(new Date).getTime()),[c,l]=(0,o.J0)(ut),u=(0,H.A)();(0,o.vJ)(()=>{e?(d(pt(new Date).getTime()),l(ut)):a()},[a,e]);const h=(0,o.Kr)(()=>Math.round(r/1e3),[r]),m=(0,o.Kr)(()=>[{title:u("FormattedDateRelative")},{title:u("FormattedDateAbsolute")}],[u]),p=(0,o.Kr)(()=>[{title:u("FormattedDateNone")},{title:u("FormattedDateShort")},{title:u("FormattedDateLong")}],[u]),g=(F=c).relative?{relative:!0}:{dayOfWeek:F.dayOfWeek||void 0,shortDate:"short"===F.dateStyle||void 0,longDate:"long"===F.dateStyle||void 0,shortTime:"short"===F.timeStyle||void 0,longTime:"long"===F.timeStyle||void 0},v=(0,o.Kr)(()=>(0,Xe.xs)(u,h,g),[g,u,h]),A=(0,o.Kr)(()=>(0,Xe.Nk)(u,h),[u,h]),y=c.relative,C=c.relative?0:1,w=ht.indexOf(c.dateStyle),I=mt.indexOf(c.timeStyle),b=(0,W.A)(e=>{l(t=>({...t,relative:0===e}))}),S=(0,W.A)(e=>{l(t=>({...t,dayOfWeek:e}))}),M=(0,W.A)(e=>{y||l(t=>({...t,dateStyle:ht[e]}))}),N=(0,W.A)(e=>{y||l(t=>({...t,timeStyle:mt[e]}))}),k=(0,W.A)(()=>{n((0,Xe.kq)((0,Xe.FD)(u,h),h,g)),t()}),Y=(0,W.A)(e=>{d(e.getTime()),a()});var F;return(0,je.FD)(je.FK,{children:[(0,je.FD)(it.A,{isOpen:e,onClose:t,onEnter:k,title:u("FormattedDateModalTitle"),dialogClassName:"ucSyPzYs",isSlim:!0,hasCloseButton:!0,children:[(0,je.Y)("div",{className:"QXsemKIL",children:(0,je.Y)(ot.A,{className:"H70XoTed",label:u("FormattedDatePreview"),value:v||(0,Xe.FD)(u,h),readOnly:!0,title:A,onClick:s})}),(0,je.FD)("div",{className:"JT43WbEI",children:[(0,je.Y)(st.A,{className:(0,f.A)(dt,"O6DMdivw"),tabs:m,activeTab:C,onSwitchTab:b}),(0,je.FD)("div",{className:at,children:[(0,je.Y)("div",{className:rt,children:u("FormattedDateDate")}),(0,je.Y)(st.A,{className:(0,f.A)(dt,y&&ct),tabs:p,activeTab:w,onSwitchTab:M})]}),(0,je.FD)("div",{className:at,children:[(0,je.Y)("div",{className:rt,children:u("FormattedDateTime")}),(0,je.Y)(st.A,{className:(0,f.A)(dt,y&&ct),tabs:p,activeTab:I,onSwitchTab:N})]}),(0,je.Y)("div",{className:"oXhiXOl1",children:(0,je.Y)(nt.A,{label:u("FormattedDateDayOfWeek"),checked:c.dayOfWeek,disabled:y,onCheck:S})})]}),(0,je.FD)("div",{className:"dialog-buttons mt-2",children:[(0,je.Y)(tt.A,{className:"confirm-dialog-button",onClick:k,children:u("Save")}),(0,je.Y)(tt.A,{className:"confirm-dialog-button",isText:!0,onClick:t,children:u("Cancel")})]})]}),(0,je.Y)(et.A,{isOpen:e&&i,selectedAt:r,withTimePicker:!0,submitButtonLabel:u("Save"),onClose:a,onSubmit:Y})]})}),ut={relative:!1,dayOfWeek:!1,dateStyle:"long",timeStyle:"short"},ht=["none","short","long"],mt=["none","short","long"];function pt(e){const t=new Date(e.getTime());return t.setSeconds(0),t.setMilliseconds(0),t}const gt=(0,o.ph)(({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:s,canAttachPolls:r,canAttachToDoLists:c,canSendPhotos:l,canSendVideos:u,canSendDocuments:h,canSendAudios:m,attachBots:p,peerType:v,isScheduled:A,theme:y,shouldCollectDebugLogs:C,canEditMedia:w,editingMessage:I,messageListType:S,paidMessagesStars:M,canInsertDate:N,onFileSelect:k,onDateInsert:Y,onMenuOpen:F,onMenuClose:P,onTodoListCreate:T})=>{const{openPollModal:D,updateAttachmentSettings:x}=(0,i.ko)(),[L,B,R]=(0,J.A)(),[E,O,U]=(0,$e.A)(L,R),[K,z,V]=(0,J.A)(),j=l&&u,G=l||u,[q,$,Q]=(0,J.A)(),Z=L||q,X=I&&I?.groupedId&&Boolean((0,d.yl)(I)||Boolean((0,d.zX)(I))),ee=I&&I?.groupedId&&Boolean((0,d.wp)(I)||(0,d.gB)(I)||(0,d.zC)(I));(0,o.vJ)(()=>{L&&U()},[L,U]),(0,o.vJ)(()=>{Z?F():P()},[Z,P,F]);const te=(0,W.A)(()=>{L?R():B()}),ne=(0,W.A)(e=>{const{files:t}=e.target,n=(0,b.kc)(t);n?.length&&k(n)}),oe=(0,W.A)(()=>{x({shouldCompress:!0}),(0,qe.p)(Array.from(j?a.mxD:l?a.gex:a.fNs).join(","),e=>ne(e))}),ie=(0,W.A)(()=>{x({shouldCompress:!1}),(0,qe.p)(!h&&m?Array.from(a.IH3).join(","):"*",e=>ne(e))}),se=(0,W.A)(()=>{const e=new File([(0,Je.F8)()],a.lFE,{type:"text/plain"});k([e])}),ae=(0,o.Kr)(()=>p?Object.values(p).filter(t=>!(!v||!t.isForAttachMenu)&&(!("bots"!==v||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(v))):void 0,[p,e,v]),re=(0,_.A)(),de=(0,H.A)(),ce=(0,W.A)(()=>{R(),z()}),le=(0,W.A)(()=>{R(),D({chatId:e,threadId:t,messageListType:S})});if(n||K)return(0,je.FD)("div",{className:"AttachMenu",children:[n&&(0,je.FD)(je.FK,{children:[I&&w?(0,je.Y)(Qe.A,{id:"replace-menu-button",className:(0,f.A)("AttachMenu--button composer-action-button",L&&"activated"),round:!0,color:"translucent",onActivate:te,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,je.Y)(He.A,{name:"replace"})}):(0,je.Y)(Qe.A,{id:"attach-menu-button",disabled:Boolean(I),className:(0,f.A)("AttachMenu--button composer-action-button",L&&"activated"),round:!0,color:"translucent",onActivate:te,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,je.Y)(He.A,{name:"attach"})}),(0,je.FD)(We.A,{id:"attach-menu-controls",isOpen:Z,autoClose:!0,positionX:"right",positionY:"bottom",onClose:R,className:"AttachMenu--menu fluid",onCloseAnimationEnd:R,onMouseEnter:g.TF?void 0:E,onMouseLeave:g.TF?void 0:O,noCloseOnBackdrop:!g.TF,ariaLabelledBy:"attach-menu-button",children:[!s&&(0,je.Y)(_e.A,{className:"media-disabled",disabled:!0,children:de("scheduled"===S&&M?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),s&&(0,je.FD)(je.FK,{children:[G&&!ee&&(0,je.Y)(_e.A,{icon:"photo",onClick:oe,children:re(j?"AttachmentMenu.PhotoOrVideo":l?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(h||m)&&!X&&(0,je.Y)(_e.A,{icon:"document",onClick:ie,children:re(!h&&m?"InputAttach.Popover.Music":"AttachDocument")}),h&&C&&(0,je.Y)(_e.A,{icon:"bug",onClick:se,children:re("DebugSendLogs")})]}),r&&!I&&(0,je.Y)(_e.A,{icon:"poll",onClick:le,children:de("Poll")}),c&&!I&&(0,je.Y)(_e.A,{icon:"select",onClick:T,children:de("TitleToDoList")}),N&&!I&&(0,je.Y)(_e.A,{icon:"calendar",onClick:ce,children:de("GiftInfoDate")}),!I&&!w&&!A&&ae?.map(n=>(0,je.Y)(Ze.A,{bot:n,chatId:e,threadId:t,theme:y,onMenuOpened:$,onMenuClosed:Q}))]})]}),(0,je.Y)(lt,{isOpen:K,onClose:V,onSubmit:Y})]})}),ft=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"BotCommandMenu",!t);return n?(0,je.Y)(n,{...e}):void 0};var vt=n(85449),At=n(87412);const yt={root:"QStkncE6",content:"wBwPdyzh",row:"DTjMAvA7",button:"w7g6mTl8",inlineButtonText:"TrvGJ8OO",customEmojiIcon:"X5A2gwL_",primaryTint:"atzyyrya",successTint:"tvyk0Qd_",destructiveTint:"VTGJKGRJ"},Ct=(0,o.ph)((0,i.EK)((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return{message:n?(0,u.O5q)(e,n,t):void 0}})(({isOpen:e,threadId:t,message:n,onClose:s})=>{const{clickBotInlineButton:a}=(0,i.ko)(),r=(0,H.A)(),[d,c,l]=(0,$e.A)(e,s),{isKeyboardSingleUse:u}=n||{};(0,o.vJ)(()=>{e&&l()},[e,l]);const h=(0,o.Kr)(()=>{const e=[];return n?.keyboardButtons.forEach(t=>{e.push(t.map(e=>(0,vt.A)(r,e)))}),e},[r,n?.keyboardButtons]);if(n&&n.keyboardButtons)return(0,je.Y)(We.A,{isOpen:e,autoClose:u,positionX:"right",positionY:"bottom",onClose:s,className:yt.root,onCloseAnimationEnd:s,onMouseEnter:g.TF?void 0:d,onMouseLeave:g.TF?void 0:c,noCloseOnBackdrop:!g.TF,noCompact:!0,children:(0,je.Y)("div",{className:(0,f.A)(yt.content,"custom-scroll"),children:n.keyboardButtons.map((e,o)=>(0,je.Y)("div",{className:yt.row,children:e.map((e,i)=>(0,je.Y)(tt.A,{className:(0,f.A)(yt.button,e.style?.type&&yt[`${e.style.type}Tint`]),ripple:!0,noForcedUpperCase:!0,disabled:"unsupported"===e.type,onClick:()=>a({chatId:n.chatId,messageId:n.id,threadId:t,button:e}),children:(0,je.FD)("span",{className:yt.inlineButtonText,children:[e.style?.iconId&&(0,je.Y)(At.A,{className:yt.customEmojiIcon,documentId:e.style.iconId,size:16}),h?.[o][i]]})}))}))})})})),wt=(0,o.ph)(({isOpen:e,onClick:t,text:n,isDisabled:i})=>{const s=(0,o.li)();return(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)},[e,n]),(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}},[]),(0,je.FD)(tt.A,{className:(0,f.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:i,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,je.Y)(He.A,{name:"webapp",className:(0,f.A)("bot-menu-icon",e&&"open")}),(0,je.Y)("span",{ref:s,className:"bot-menu-text",children:(0,O.A)(n)})]})}),It=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"ChatCommandTooltip",!t);return n?(0,je.Y)(n,{...e}):void 0};var bt=n(56494),St=n(87894),Mt=n(43874),Nt=n(14),kt=n(1455),Yt=n(91930),Ft=n(60859);const Pt=(0,o.ph)((0,i.EK)((e,{shouldForceShowEditing:t,chatId:n,threadId:o,messageListType:i})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:c,noCaptions:l},isShareMessageModalShown:h,shouldPreventComposerAnimation:m}=(0,u.nTw)(e),g="scheduled"===i?(0,p.Vl)(e,n):(0,p.Ys)(e,n,o),f=(0,u.PKK)(e)&&!m,v=a===n,A=r?.map(t=>(0,u.O5q)(e,s,t)),y=(0,p.GA)(e,n,o),C=y?.replyInfo,w=y?.suggestedPostInfo,I=C?.replyToPeerId,b=I?(0,u.hds)(e,I):void 0;let S,M;if(g?S=(0,u.KLw)(e,n,o,i):v&&1===r.length?S=A?.[0]:C&&!t&&(S=(0,u.O5q)(e,C.replyToPeerId||n,C.replyToMsgId)),g&&S)M=(0,u.Y7C)(e,S);else if(v){let t=A?.map(t=>{return n=t,M=(0,u.Szq)(e,n),M||(M=(0,u.Y7C)(e,n)),M;var n}).filter(Boolean);t=t?(0,St.Am)(t):void 0,M=1===t?.length?t?.[0]:void 0}else if(C&&S&&!t){const{forwardInfo:t}=S,o=(0,u.nZ4)(e,n);t&&(t.isChannelPost||o)&&(M=(0,u.Szq)(e,S)),M||t?.hiddenUserName&&!Boolean(C.quoteText)||(M=(0,u.Y7C)(e,S))}const N=M&&(0,u.hds)(e,M.id),k=N&&(0,d.WX)(N),Y=A?.some(e=>e?.content.text&&Object.keys(e.content).length>1),F=v&&1===r.length&&Boolean(S?.content.storyData),P=C?.replyToMsgId===o&&!C.replyToPeerId,T=S&&(0,bt.B9)(e,S);return{replyInfo:C,suggestedPostInfo:w,editingId:g,message:S,sender:M,shouldAnimate:f,forwardedMessagesCount:v?r.length:void 0,noAuthors:c,noCaptions:l,forwardsHaveCaptions:Y,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:F,isReplyToDiscussion:P,isInChangingRecipientMode:h,shouldPreventComposerAnimation:m,senderChat:b,currentUserId:e.currentUserId,isSenderChannel:k,forwardMessageIds:r,fromChatId:s,isMediaNsfw:T,theme:(0,u.SJA)(e)}})(e=>{const{shouldAnimate:t,isReplyToDiscussion:n,isInChangingRecipientMode:s,forwardMessageIds:a,fromChatId:r,replyInfo:c,editingId:l,suggestedPostInfo:h,shouldForceShowEditing:m,message:p,forwardedMessagesCount:g}=e,{resetDraftReplyInfo:v,resetDraftSuggestedPostInfo:A,updateDraftReplyInfo:y,setEditingId:C,focusMessage:w,changeRecipient:I,openChatOrTopicWithReplyInDraft:b,setForwardNoAuthors:S,setForwardNoCaptions:M,exitForwardMode:N,setShouldPreventComposerAnimation:k,openSuggestMessageModal:Y,requestMessageMediaEditor:F}=(0,i.ko)(),P=(0,o.li)(),T=(0,_.A)(),D=(0,H.A)(),{isMobile:x}=(0,Mt.Ay)(),L="topicCreate"===p?.content.action?.type,B=Boolean(h)&&!m,R=Boolean(g),E=(0,W.A)(e=>{const t=(0,i.mS)();let n=(0,u.Szq)(t,e);return n||(n=(0,u.Y7C)(t,e)),n}),O=(0,o.Kr)(()=>{if(!R)return;const e=a?.map(e=>(0,u.O5q)((0,i.mS)(),r,e)).filter(Boolean),t=e?.map(e=>E(e)).filter(Boolean);return t?(0,St.Am)(t):void 0},[R,a,r]),U=!(s||(!p||!c&&!l)&&(!O||!R)&&!B),{shouldRender:K,transitionClassNames:z,isClosing:j}=(0,ne.A)(U&&!L&&!n,void 0,!t,void 0,!t,350,!t),{chatId:G,currentUserId:J,theme:q,onClear:$,isCurrentUserPremium:Z,isContextMenuDisabled:X,shouldPreventComposerAnimation:ee,sender:te,senderChat:oe,isMediaNsfw:ie,noAuthors:se,noCaptions:ae,forwardsHaveCaptions:re,forwardedMessagesCount:de,message:ce,shouldForceShowEditing:le,suggestedPostInfo:ue,replyInfo:he,editingId:me,isSenderChannel:pe}=(0,kt.A)(e,j),ge=Boolean(de),fe=Boolean(he)&&!le,ve=Boolean(he?.quoteText),Ae=Boolean(ue)&&!le,ye=ce&&(0,d.tM)(ce)&&!x;(0,o.vJ)(()=>{ee&&k({shouldPreventComposerAnimation:!1})});const Ce=(0,W.A)(()=>{me?C({messageId:void 0}):de?N():Ae?(A(),v()):he&&!le&&v(),$?.()});(0,o.vJ)(()=>U?(0,xe.A)(Ce):void 0,[U,Ce]);const{isContextMenuOpen:we,contextMenuAnchor:Ie,handleContextMenu:be,handleContextMenuClose:Se,handleContextMenuHide:Me}=(0,V.A)(P),Ne=(0,W.A)(e=>{ue?Y({chatId:G}):be(e)}),ke=(0,W.A)(e=>{e.stopPropagation(),!me&&"message"!==he?.type||!ye||F()}),Ye=(0,W.A)(e=>{e.stopPropagation(),Ce(),Me()}),Fe=e=>()=>{Se(),e()},Pe=(0,W.A)(Fe(I)),Te=(0,W.A)(Fe(()=>{w({chatId:ce.chatId,messageId:ce.id,noForumTopicPanel:!0})})),De=(0,W.A)(Fe(()=>y({quoteText:void 0}))),Le=(0,W.A)(Fe(I)),Be=(0,W.A)(()=>{Se(),te&&b({chatId:te.id})}),Re=(0,W.A)(Fe(Ce)),Ee=(0,W.A)(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),be(e))}),Oe=(0,W.A)(()=>P.current),Ue=(0,W.A)(()=>P.current),Ke=(0,W.A)(()=>P.current.querySelector(".forward-context-menu .bubble"));(0,o.vJ)(()=>{K||(Se(),Me())},[Se,Me,K]);const ze=(0,f.A)("ComposerEmbeddedMessage",z),{className:Ve,style:Ge}=(0,Q.Ay)({peer:te,theme:q}),Je=(0,f.A)("ComposerEmbeddedMessage_inner",Ve),qe=(0,o.Kr)(()=>me?"edit":Ae?"cash-circle":ge?"forward":fe?"reply":void 0,[me,ge,fe,Ae]),$e=de&&de>1?T("ForwardedMessageCount",de):void 0,Qe=(0,o.Kr)(()=>{if(!ce||!ge||!ce.content.text||!se||Z)return ce;const e=(0,d.m4)(ce.content.text);return{...ce,content:{...ce.content,text:e}}},[Z,ge,ce,se]),Ze=(0,Nt.A)(qe,!0);if(!K)return;const Xe=te&&!pe&&G!==te.id&&te.id!==J;return(0,je.Y)("div",{className:ze,ref:P,onContextMenu:be,children:(0,je.FD)("div",{className:Je,style:Ge,children:[(0,je.FD)("div",{className:"embedded-left-icon",role:"button",tabIndex:0,onClick:be,onKeyDown:Ee,children:[Ze&&(0,je.Y)(He.A,{name:Ze}),Boolean(he?.quoteText)&&(0,je.Y)(He.A,{name:"quote",className:"quote-reply"})]}),(0,je.Y)(Yt.A,{isOpen:U,className:"inside-input",replyInfo:he,suggestedPostInfo:ue,isMediaNsfw:ie,isInComposer:!0,message:Qe,sender:se?void 0:te,composerForwardSenders:O,customText:$e,noCaptions:ae,title:me&&!fe?T("EditMessage"):se?T("HiddenSendersNameDescription"):void 0,onClick:Ne,onPictogramClick:ye?ke:void 0,pictogramActionIcon:ye?"edit":void 0,senderChat:oe}),(0,je.Y)(tt.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:T("Cancel"),onClick:Ye,iconName:"close"}),(fe||ge)&&!X&&(0,je.FD)(We.A,{isOpen:we,anchor:Ie,getTriggerElement:Oe,getRootElement:Ue,getMenuElement:Ke,className:"forward-context-menu",onClose:Se,onCloseAnimationEnd:Me,children:[ge&&(0,je.FD)(je.FK,{children:[(0,je.Y)(_e.A,{icon:se?void 0:"message-succeeded",customIcon:se?(0,je.Y)(He.A,{name:"placeholder"}):void 0,onClick:()=>S({noAuthors:!1}),children:T(de>1?"ShowSenderNames":"ShowSendersName")}),(0,je.Y)(_e.A,{icon:se?"message-succeeded":void 0,customIcon:se?void 0:(0,je.Y)(He.A,{name:"placeholder"}),onClick:()=>S({noAuthors:!0}),children:T(de>1?"HideSenderNames":"HideSendersName")}),re&&(0,je.FD)(je.FK,{children:[(0,je.Y)(Ft.A,{}),(0,je.Y)(_e.A,{icon:ae?void 0:"message-succeeded",customIcon:ae?(0,je.Y)(He.A,{name:"placeholder"}):void 0,onClick:()=>M({noCaptions:!1}),children:T(de>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,je.Y)(_e.A,{icon:ae?"message-succeeded":void 0,customIcon:ae?void 0:(0,je.Y)(He.A,{name:"placeholder"}),onClick:()=>M({noCaptions:!0}),children:T(de>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,je.Y)(Ft.A,{}),(0,je.Y)(_e.A,{icon:"replace",onClick:Pe,children:T("ForwardAnotherChat")})]}),fe&&(0,je.FD)(je.FK,{children:[(0,je.Y)(_e.A,{icon:"show-message",onClick:Te,children:T("Message.Context.Goto")}),ve&&(0,je.Y)(_e.A,{icon:"remove-quote",onClick:De,children:T("RemoveQuote")}),Xe&&(0,je.Y)(_e.A,{icon:"user",onClick:Be,children:D("ReplyInPrivateMessage")}),(0,je.Y)(_e.A,{icon:"replace",onClick:Le,children:T("ReplyToAnotherChat")}),(0,je.Y)(_e.A,{icon:"delete",onClick:Re,children:T("DoNotReply")})]})]})]})})}));var Tt=n(25897),Dt=n(6070),xt=n(41510);const Lt=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"DropArea",!t);return n?(0,je.Y)(n,{...e}):void 0};var Bt=n(49068);const Rt=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"InlineBotTooltip",!t);return n?(0,je.Y)(n,{...e}):void 0},Et=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"MentionTooltip",!t);return n?(0,je.Y)(n,{...e}):void 0};var Ot=n(78407);const Ut=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"SendAsMenu",!t);return n?(0,je.Y)(n,{...e}):void 0},Kt=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"StickerTooltip",!t);return n?(0,je.Y)(n,{...e}):void 0};var zt=n(26440);const Vt=e=>{const{modal:t}=e,n=(0,Ve.A)(ze.ar.Extra,"ToDoListModal",!t);return n?(0,je.Y)(n,{...e}):void 0};var jt=n(2338),Gt=n(62587),Jt=n(34201),qt=n(86070);const $t="zqTOc7LU",Ht="b0A9Zfoa";const Wt=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,u.nTw)(e),i=(0,p.rQ)(e,t,n),{attachmentSettings:s}=e,a=o.webPagePreviewId?(0,u.kgA)(e,o.webPagePreviewId):void 0;return{webPagePreview:"empty"===a?.webpageType?void 0:a,noWebPage:i,attachmentSettings:s}})(({chatId:e,threadId:t,isDisabled:n,webPagePreview:s,noWebPage:a,attachmentSettings:r,isEditing:c})=>{const{toggleMessageWebPage:l,updateAttachmentSettings:u}=(0,i.ko)(),h=(0,H.A)(),m=(0,o.li)(),p=r.isInvertedMedia,g="small"===r.webPageMediaSize,v=(0,j.A)(()=>Boolean(s&&!a&&!n),[n,a,s]),{shouldRender:A}=(0,Jt.A)({isOpen:v,ref:m,withShouldRender:!0}),y="full"===s?.webpageType&&s.hasLargeMedia,C=(0,o.li)(s);s&&s!==C.current&&(C.current=s);const w=s||C.current,I="full"===w?.webpageType,b=(0,jt.A)(I?{content:w}:void 0),S=(0,d.eY)(w)||(0,d.rU)(w)||(0,d.y3)(w)||(0,d.rj)(w),M=S&&(0,d.VO)(S,"pictogram"),N=(0,Gt.A)(M),{shouldRender:k,ref:Y}=(0,Jt.A)({isOpen:Boolean(N),withShouldRender:!0,noCloseTransition:!0}),F=Boolean(N||k),P=(0,W.A)(()=>{l({chatId:e,threadId:t,noWebPage:!0})}),{isContextMenuOpen:T,contextMenuAnchor:D,handleContextMenu:x,handleContextMenuClose:L,handleContextMenuHide:B,handleBeforeContextMenu:R}=(0,V.A)(m,c,!0),E=(0,W.A)(()=>m.current),O=(0,W.A)(()=>m.current),U=(0,W.A)(()=>m.current.querySelector(`.${$t} .bubble`)),K=(0,W.A)(e=>{x(e)});function z(e){u({isInvertedMedia:e})}function G(e){u({webPageMediaSize:e})}if((0,o.vJ)(()=>{A&&w||(L(),B())},[L,B,A,w]),A&&w)return(0,je.Y)("div",{className:(0,f.A)("O3di3ULC",!c&&"G5_7x_Hn"),ref:m,children:(0,je.FD)("div",{className:"m3DBx9f5",children:[(0,je.Y)("div",{className:"vFWsMwfP",onClick:K,children:(0,je.Y)(He.A,{name:"link"})}),w&&"empty"!==w.webpageType&&(0,je.FD)(qt.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:x,onMouseDown:R,onClick:K,children:[F&&(0,je.FD)("div",{className:"VvwZOug9",children:[b&&(0,je.Y)("img",{src:b,alt:"",className:Ht}),k&&(0,je.Y)("img",{ref:Y,src:N,alt:"",className:Ht})]}),(0,je.FD)("div",{className:"itmZe2qi",children:[(0,je.Y)("span",{className:"ER149gdz",children:I?w.siteName||w.url:h("Loading")}),(0,je.Y)("span",{className:"FSYSqC60",children:I?w.description||h((J=w,J.photo?"AttachPhoto":J.video?"AttachVideo":J.audio?"AttachMusic":J.document?"AttachDocument":J.story?"AttachStory":"LinkPreview")):w.url})]})]}),(0,je.Y)(tt.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:h("AccLinkRemovePreview"),onClick:P,iconName:"close"}),!c&&(0,je.Y)(We.A,{isOpen:T,anchor:D,getTriggerElement:E,getRootElement:O,getMenuElement:U,className:$t,onClose:L,onCloseAnimationEnd:B,autoClose:!0,children:(0,je.FD)(je.FK,{children:[p?(0,je.Y)(_e.A,{icon:"move-caption-up",onClick:()=>z(void 0),children:h("ContextMoveTextUp")}):(0,je.Y)(_e.A,{icon:"move-caption-down",onClick:()=>z(!0),children:h("ContextMoveTextDown")}),y&&(g?(0,je.Y)(_e.A,{icon:"expand",onClick:()=>G("large"),children:h("ContextLinkLargerMedia")}):(0,je.Y)(_e.A,{icon:"collapse",onClick:()=>G("small"),children:h("ContextLinkSmallerMedia")})),(0,je.Y)(_e.A,{icon:"delete",onClick:P,children:h("ContextLinkRemovePreview")})]})})]})});var J}));var _t=n(97676),Qt=n(76283),Zt=n(97422),Xt=n(61361),en=n(41036),tn=n(68292),nn=n(21849),on=n(48227),sn=n(11241),an=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}(an||{});const rn=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,storyId:o,messageListType:i,isMobile:r,type:l})=>{const g=(0,u.hds)(e,t),f=(0,d.DX)(t)?void 0:(0,u.yps)(e,t),v=Boolean(f),A=(0,u.nZ4)(e,t),y=(0,I.L8)(t),C=y?(0,u.vGo)(e,t):void 0,w=(0,u.WA9)(e,t),b=y?void 0:(0,u.AWZ)(e,t),S=(v||!y)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:k,shouldPaidMessageAutoApprove:Y}=e.settings.byKey,{language:F,shouldCollectDebugLogs:P}=(0,m.lS)(e),{forwardMessages:{messageIds:T},shouldOpenMessageMediaEditor:x}=(0,u.nTw)(e),L=e.emojiKeywords[a.cUY],B=F!==a.cUY?e.emojiKeywords[F]:void 0,R=S?S.id:void 0,E=R?(0,u.O5q)(e,t,R):void 0,{currentUserId:O}=e,U=(0,u.mBe)(e,O),K=b?b?.sendAsId||O:void 0,z=K?(0,u.PVB)(e,K):void 0,V=(0,u.sam)(e,t),j=(0,u.p6T)(e,t),G=(0,u.nTw)(e),J=Boolean(G.storyViewer.storyId),q=(0,u.Xf0)(e),$=t===q?.chatId&&n===q?.threadId&&i===q?.type&&!J,H=(0,u.mBe)(e,t),W=(H&&!C?.noVoiceMessages)??!0,_=b?.slowMode,Q=(0,u.g29)(e),Z="scheduled"===i?(0,p.dk)(e,t):(0,p.U0)(e,t,n),X=o&&(0,u.Msb)(e,t,o),ee=X&&"sentReaction"in X?X.sentReaction:void 0,te=(0,p.GA)(e,t,n),ne=te?.replyInfo?(0,u.O5q)(e,t,te.replyInfo.replyToMsgId):void 0,oe=g?.isForum&&g.isForumAsMessages&&n===s.l3&&ne?(0,u.nkm)(e,ne):void 0,ie="scheduled"===i,se=y&&!v&&!ie&&!A,ae=(0,p.rQ)(e,t,n),re=g&&(0,c.RY)(g,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,de=y&&!v&&!ie&&!A&&"story"!==l&&t!==a.zv8,ce=(0,u.xYJ)(e,"stickerEffects"),le=G.shouldPlayEffectInComposer,ue=de&&te?.effectId,he=ue?e.availableEffectById[ue]:void 0,me=e.reactions.effectReactions,pe=e.config?.maxMessageLength||D.Yf,ge=t===G.forwardMessages.toChatId,fe=Boolean(te?.replyInfo),ve=Boolean(te?.suggestedPostInfo),Ae=e.stars?.balance.amount||0,ye=Boolean(G.starsBalanceModal),Ce=(0,u.trm)(e),we=e.isAppConfigLoaded,Ie=G.insertingPeerIdMention,be=G.webPagePreviewId?(0,u.kgA)(e,G.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===l?e.reactions.topReactions:void 0,isOnActiveTab:!G.isBlurred,editingMessage:(0,u.KLw)(e,t,n,i),draft:te,chat:g,user:H,isChatWithBot:v,isChatWithSelf:A,isForCurrentMessageList:$,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:g?(0,d.WX)(g):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===i&&(C||b)?.hasScheduledMessages,isInScheduledList:ie,botKeyboardMessageId:R,botKeyboardPlaceholder:E?.keyboardPlaceholder,isForwarding:ge,isReplying:fe,hasSuggestedPost:ve,forwardedMessagesCount:ge?T.length:void 0,todoListModal:G.todoListModal,aiMessageEditorPendingResult:G.aiMessageEditorPendingResult,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:b,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:O,currentUser:U,contentToBeScheduled:G.contentToBeScheduled,shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:k,recentEmojis:e.recentEmojis,baseEmojiKeywords:L?.keywords,emojiKeywords:B?.keywords,inlineBots:G.inlineBots.byUsername,isInlineBotLoading:G.inlineBots.isLoading,botCommands:C?C.botInfo?.commands||!1:void 0,botMenuButton:C?.botInfo?.menuButton,sendAsPeer:z,sendAsId:K,editingDraft:Z,requestedDraft:V,requestedDraftFiles:j,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,u.dfQ)(e,t),theme:(0,u.SJA)(e),fileSizeLimit:(0,h.d)(e,"uploadMaxFileparts")*a.dK5,captionLimit:(0,h.d)(e,"captionLength"),isCurrentUserPremium:Q,canSendVoiceByPrivacy:W,attachmentSettings:e.attachmentSettings,slowMode:_,currentMessageList:q,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!Q&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!A&&y&&!v&&!ie,shouldCollectDebugLogs:P,sentStoryReaction:ee,stealthMode:e.stories.stealthMode,replyToTopic:oe,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:se,noWebPage:ae,webPagePreview:be,isContactRequirePremium:C?.isContactRequirePremium,effect:he,effectReactions:me,areEffectsSupported:de,canPlayEffect:ce,shouldPlayEffect:le,maxMessageLength:pe,paidMessagesStars:w,shouldPaidMessageAutoApprove:Y,isSilentPosting:re,isPaymentMessageConfirmDialogOpen:G.isPaymentMessageConfirmDialogOpen&&!G.aiMessageEditorModal&&!G.pollModal&&!G.sharePreparedMessageModal,starsBalance:Ae,isStarsBalanceModalOpen:ye,shouldDisplayGiftsButton:C?.shouldDisplayGiftsButton,disallowedGifts:C?.disallowedGifts,isAccountFrozen:Ce,isAppConfigLoaded:we,insertingPeerIdMention:Ie,shouldOpenMessageMediaEditor:x,replyToMessage:ne}})(({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:c,canScheduleUntilOnline:h,isReady:m,isMobile:p,editingMessage:I,chatId:D,threadId:x,storyId:we,currentMessageList:Le,messageListType:Be,draft:Re,chat:Ee,chatFullInfo:Oe,user:ze,replyToTopic:Ve,isForCurrentMessageList:Je,isCurrentUserPremium:qe,canSendVoiceByPrivacy:$e,isChatWithBot:We,isChatWithSelf:_e,isChannel:Ze,fileSizeLimit:Xe,isRightColumnShown:et,isSelectModeActive:nt,isReactionPickerOpen:ot,shouldDisplayGiftsButton:it,isForwarding:st,isReplying:at,hasSuggestedPost:rt,forwardedMessagesCount:dt,todoListModal:ct,aiMessageEditorPendingResult:lt,botKeyboardMessageId:ut,botKeyboardPlaceholder:ht,inputPlaceholder:mt,withScheduledButton:pt,stickersForEmoji:vt,customEmojiForEmoji:At,topInlineBotIds:yt,currentUserId:bt,currentUser:St,captionLimit:Mt,contentToBeScheduled:Nt,shouldSuggestStickers:kt,shouldSuggestCustomEmoji:Yt,baseEmojiKeywords:Ft,emojiKeywords:jt,recentEmojis:Gt,inlineBots:Jt,isInlineBotLoading:qt,botCommands:$t,sendAsPeer:Ht,sendAsId:rn,editingDraft:dn,requestedDraft:cn,requestedDraftFiles:ln,botMenuButton:un,attachBots:hn,attachMenuPeerType:mn,attachmentSettings:pn,theme:gn,slowMode:fn,shouldUpdateStickerSetOrder:vn,editableInputCssSelector:An,editableInputId:yn,inputId:Cn,className:wn,availableReactions:In,topReactions:bn,canBuyPremium:Sn,canPlayAnimatedEmojis:Mn,shouldCollectDebugLogs:Nn,sentStoryReaction:kn,stealthMode:Yn,canSendOneTimeMedia:Fn,quickReplyMessages:Pn,quickReplies:Tn,canSendQuickReplies:Dn,webPagePreview:xn,noWebPage:Ln,isContactRequirePremium:Bn,paidMessagesStars:Rn,effect:En,effectReactions:On,areEffectsSupported:Un,canPlayEffect:Kn,shouldPlayEffect:zn,maxMessageLength:Vn,isSilentPosting:jn,isPaymentMessageConfirmDialogOpen:Gn,starsBalance:Jn,isStarsBalanceModalOpen:qn,disallowedGifts:$n,isAccountFrozen:Hn,isAppConfigLoaded:Wn,insertingPeerIdMention:_n,replyToMessage:Qn,shouldOpenMessageMediaEditor:Zn,onDropHide:Xn,onFocus:eo,onBlur:to,onForward:no})=>{const{sendMessage:oo,clearDraft:io,saveDraft:so,showDialog:ao,openTodoListModal:ro,closeTodoListModal:co,openAiMessageEditorModal:lo,clearAiMessageEditorPendingResult:uo,loadScheduledHistory:ho,openThread:mo,addRecentEmoji:po,sendInlineBotResult:go,loadSendAs:fo,resetOpenChatWithDraft:vo,callAttachBot:Ao,addRecentCustomEmoji:yo,showNotification:Co,showAllowedMessageTypesNotification:wo,openStoryReactionPicker:Io,openGiftModal:bo,closeReactionPicker:So,sendStoryReaction:Mo,editMessage:No,updateAttachmentSettings:ko,saveEffectInDraft:Yo,setReactionEffect:Fo,hideEffectInComposer:Po,updateChatSilentPosting:To,updateInsertingPeerIdMention:Do,updateDraftSuggestedPostInfo:xo,updateShouldSaveAttachmentsCompression:Lo,applyDefaultAttachmentsCompression:Bo}=(0,i.ko)(),Ro=(0,_.A)(),Eo=(0,H.A)(),Oo=(0,o.li)(),Uo=(0,o.li)(),Ko=(0,o.li)(),[zo,Vo]=(0,o.Ul)(""),[jo,Go]=(0,o.J0)(!1),Jo=(0,$.A)(An),qo=(0,o.li)(),$o=(0,X.A)(n),{width:Ho}=T.A.get(),Wo=(0,q.A)(),_o="messageList"===e,Qo="story"===e,Zo=_o?Ee?.sendAsPeerIds:void 0,Xo=Boolean(Zo?.length),[ei,ti,ni]=(0,J.A)(),oi=(0,te.A)(D,x),[ii,si,ai]=(0,J.A)(),[ri,di,ci]=(0,J.A)(),li=I&&(0,d.ZV)(I),ui=Ee?.isMonoforum,{emojiSet:hi,members:mi,botCommands:pi}=Oe||{},gi=hi?.id,fi=!Rn&&!ui,vi=kn&&(0,d.a0)(kn,a.tNZ);(0,o.vJ)(w.VU,[zo]);const Ai=(0,o.li)(0),[yi,Ci]=(0,ee.A)(_o&&h,ni);(0,z.A)(()=>{Go(!0)},430),(0,o.vJ)(()=>{_o||So()},[_o,we]),(0,o.vJ)(()=>{qo.current=void 0},[D]),(0,o.vJ)(()=>{Wn&&D&&m&&!Qo&&!ui&&ho({chatId:D})},[m,D,x,Qo,Wn,ui]),(0,o.vJ)(()=>{const e=Ze&&Ee?.areProfilesShown,t=Ee&&(0,d.Vs)(Ee)&&Boolean((0,d.gA)(Ee)||Ee.isLinkedInDiscussion||Ee.hasGeo);!Zo&&m&&(t||e)&&fo({chatId:D})},[Ee,D,Ze,m,fo,Zo]);const wi=(0,o.li)(!1);(0,ie.A)(([e,t])=>{wi.current=Boolean(D===e&&Zo&&!t)},[D,Zo]);const[Ii,bi]=(0,o.J0)([]),Si=Boolean(Ii.length),[Mi,Ni]=(0,o.J0)(void 0);(0,o.vJ)(()=>{Ii.length&&Ii||Lo({shouldSave:!1})},[Ii]);const{canSendStickers:ki,canSendGifs:Yi,canAttachMedia:Fi,canAttachPolls:Pi,canAttachEmbedLinks:Ti,canAttachToDoLists:Di,canSendVoices:xi,canSendPlainText:Li,canSendAudios:Bi,canSendVideos:Ri,canSendPhotos:Ei,canSendDocuments:Oi}=(0,o.Kr)(()=>(0,d.Q_)(Ee,Oe,We,_e,Qo,Rn,c),[Ee,Oe,We,_e,Qo,Rn,c]),Ui=Bn&&Qo,Ki=Ui||!Li,zi=(0,j.A)(()=>{if(Si)return Ii.length;const e=zo()||Si?1:0;return st&&dt?dt+e:e||1},[zo,Si,Ii,st,dt]),Vi=Rn?zi*Rn:0,{closeConfirmDialog:ji,dialogHandler:Gi,shouldAutoApprove:Ji,setAutoApprove:qi,handleWithConfirmation:$i}=(0,Fe.A)(Vi,qn,Jn),Hi=!Si&&Ti&&!Ln&&"full"===xn?.webpageType,Wi=Ki&&!I;(0,o.vJ)(()=>{Hi||ko({isInvertedMedia:void 0})},[Hi]);const _i=(0,W.A)((e,t=yn,n=!1)=>{if(t===yn&&Wi)return;const o=window.getSelection(),i=Jo();let s;if(s=t===yn?document.querySelector(An):document.getElementById(t),!n){let n;if(o.rangeCount){const e=o.getRangeAt(0);(0,E.L)(e,t)&&(n=e)}if(!n&&i&&(0,E.L)(i,t)&&(n=i.cloneRange()),n)try{return o.rangeCount&&o.getRangeAt(0)===n||(o.removeAllRanges(),o.addRange(n)),(0,F.oR)(e),void s.dispatchEvent(new Event("input",{bubbles:!0}))}catch{}}if(n){const t=e.split(" ")[0],n=zo().startsWith(t);Vo(n?e:`${e}${zo()}`)}else Vo(`${zo()}${e}`);(0,r.Uz)(()=>{(0,S.A)(s)})}),Qi=(0,W.A)((e,t=yn)=>{const n=(0,O.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"​");_i(n,t)}),Zi=(0,W.A)((e,t=yn,n=!1)=>{const o=(0,U.QY)(e);_i(o,t,n)}),Xi=(0,W.A)((e,t=yn)=>{_i((0,R.hB)(e),t)}),es=(0,W.A)(()=>{Mi&&(Zi(Mi,yn),Ni(void 0))}),{shouldForceCompression:ts,shouldForceAsFile:ns,handleAppendFiles:os,handleFileSelect:is,onCaptionUpdate:ss,handleClearAttachments:as,handleSetAttachments:rs}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:r,canSendAudios:c,canSendVideos:l,canSendPhotos:u,canSendDocuments:h,insertNextText:m,editedMessage:p,shouldSendInHighQuality:g}){const f=(0,H.A)(),{openLimitReachedModal:v,showAllowedMessageTypesNotification:A,showNotification:y}=(0,i.ko)(),[C,w]=(0,o.J0)(!1),[I,b]=(0,o.J0)(!1),S=(0,W.A)(()=>{s(k.p),m()}),M=(0,W.A)(n=>{const o="function"==typeof n?n(e):n;if(o.length)if(o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!c&&!h||"video"===t&&!l&&!h||"photo"===t&&!u&&!h||"file"===t&&!h}))A({chatId:r});else if(o.some(({size:e})=>e>t))v({limit:"uploadMaxFileparts"});else{s(o);const e=o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!c||"video"===t&&!l||"photo"===t&&!u});w(Boolean(e&&h)),b(!h)}else S()}),N=(0,W.A)(async(t,n)=>{if(p){if(p.groupedId&&t[0].type===a.Vz3)return void y({message:f("MediaReplaceInvalidError",void 0,{pluralValue:1})});const e=await(0,B.Ay)(t[0].name,t[0]),n=p&&(0,d.eh)(p,e);p?.groupedId?n?M([e]):y({message:f("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):M([e])}else{const o=await Promise.all(t.map(e=>(0,B.Ay)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:g})));M([...e,...o])}}),Y=(0,W.A)(async e=>{if(p){if(p.groupedId&&e[0].type===a.Vz3)return void y({message:f("MediaReplaceInvalidError",void 0,{pluralValue:1})});const t=await(0,B.Ay)(e[0].name,e[0]),n=p&&(0,d.eh)(p,t);p?.groupedId?n?M([t]):y({message:f("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):M([t])}else{const t=await Promise.all(e.map(e=>(0,B.Ay)(e.name,e,{shouldSendInHighQuality:g})));M(t)}}),F=(0,W.A)(async()=>{const t=await Promise.all(e.map(async e=>e.blob?(0,B.Ay)(e.filename,e.blob,{shouldSendInHighQuality:g}):e));M(t)});return(0,o.vJ)(()=>{F()},[g]),{handleAppendFiles:N,handleFileSelect:Y,onCaptionUpdate:n,handleClearAttachments:S,handleSetAttachments:M,shouldForceCompression:I,shouldForceAsFile:C}}({attachments:Ii,setHtml:Vo,setAttachments:bi,fileSizeLimit:Xe,chatId:D,canSendAudios:Bi,canSendVideos:Ri,canSendPhotos:Ei,canSendDocuments:Oi,insertNextText:es,editedMessage:I,shouldSendInHighQuality:pn.shouldSendInHighQuality}),ds=(0,o.li)();(0,o.vJ)(()=>{if(!Zn)return;const e=I||Qn,t=e&&((0,d.yl)(e)||(0,d.nd)(e));if(!t)return;const n=(0,d.VO)(t,"full");if(!n)return;const o=Date.now();ds.current=o,(0,N.hd)(n,s.qZ.BlobUrl).then(async e=>{if(ds.current!==o)return;const n=await(0,b.sZ)(e),i=await(0,B.Ay)((0,d.sd)(t),n);rs([i])})},[I,Qn,Zn,rs]);const[cs,ls,us]=(0,J.A)(),[hs,ms,ps]=(0,J.A)(),[gs,fs,vs]=(0,J.A)(),[As,ys,Cs]=(0,J.A)(),[ws,Is,bs]=(0,J.A)(),{startRecordingVoice:Ss,stopRecordingVoice:Ms,pauseRecordingVoice:Ns,activeVoiceRecording:ks,currentRecordTime:Ys,recordButtonRef:Fs,startRecordTimeRef:Ps,isViewOnceEnabled:Ts,setIsViewOnceEnabled:Ds,toogleViewOnceEnabled:xs}=(()=>{const e=(0,o.li)(),[t,n]=(0,o.J0)(),i=(0,o.li)(),[s,a]=(0,o.J0)(),[d,c]=(0,o.J0)(!1);(0,o.vJ)(()=>{g.Yw&&g.pW&&Ue()},[]);const l=(0,W.A)(async()=>{try{const{stop:t,pause:o}=await Ke(t=>{e.current&&(i.current&&Date.now()%4==0&&(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)}),a(Date.now()))});i.current=Date.now(),a(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}}),u=(0,W.A)(()=>{if(t){(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.pause()}catch(e){return void console.error(e)}}}),h=(0,W.A)(()=>{if(t){n(void 0),i.current=void 0,a(void 0),(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.stop()}catch(e){return void console.error(e)}}});(0,o.vJ)(()=>t?(0,xe.A)(h):void 0,[t,h]);const m=(0,W.A)(()=>{c(!d)});return{startRecordingVoice:l,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:i,isViewOnceEnabled:d,setIsViewOnceEnabled:c,toogleViewOnceEnabled:m}})(),Ls=Je&&!Qo;(0,K.A)(()=>{oi({type:"recordAudio"})},Ls?ks&&a.cqp:void 0),(0,o.vJ)(()=>{Je&&!Qo&&(ks||oi({type:"cancel"}))},[ks,Je,Qo,oi]);const Bs=(0,oe.i)(Boolean(I));(0,o.vJ)(()=>{Je&&!Qo&&zo()&&!Bs.current&&oi({type:"typing"})},[zo,Bs,Je,Qo,oi]);const Rs=Ee&&(0,d.SJ)(Ee),{isEmojiTooltipOpen:Es,closeEmojiTooltip:Os,filteredEmojis:Us,filteredCustomEmojis:Ks,insertEmoji:zs}=(0,Ce.A)(Boolean(m&&t&&(Qo||Je)&&kt&&!Si),zo,Vo,void 0,Gt,Ft,jt),{isCustomEmojiTooltipOpen:Vs,closeCustomEmojiTooltip:js,insertCustomEmoji:Gs}=(0,me.A)(Boolean(m&&t&&(Qo||Je)&&Yt&&!Si),zo,Vo,Jo,Oo,At),{isStickerTooltipOpen:Js,closeStickerTooltip:qs}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,i.ko)(),[d,c,l]=(0,J.A)(!1),u=(0,re.A)(()=>{const n=t();if(!e||!n||g.TL&&n.length>8)return;if(!n.match(g.TL?Pe.A:a.bpX))return;const o=(0,se.S)(n);return o&&(g.TL&&1===(0,Te.A)(o)||!g.TL&&Boolean(n.match(De)))?g.TL?o:o.match(/alt="(.+)"/)?.[1]:void 0},[t,e]),h=(0,j.A)(()=>Boolean(u()),[u]),m=Boolean(n?.length);return(0,o.vJ)(()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()},[e,h,u,m,s,r]),(0,o.vJ)(l,[l,t]),{isStickerTooltipOpen:Boolean(h&&m&&!d),closeStickerTooltip:c}}(Boolean(m&&t&&(Qo||Je)&&kt&&ki&&!Si),zo,vt),{isMentionTooltipOpen:$s,closeMentionTooltip:Hs,insertMention:Ws,mentionFilteredUsers:_s}=(0,Ye.A)(Boolean(_o&&m&&Je&&!Si),zo,Vo,Jo,Oo,mi,yt,bt);(0,o.vJ)(()=>{if(!_n)return;const e=(0,u.PVB)((0,i.mS)(),_n);e&&Ws(e,!0,!0),Do({peerId:void 0})},[_n,Ws]),(0,o.vJ)(()=>{if(!lt)return;const{text:e,shouldClear:t,shouldSendWithAttachments:n}=lt;n||(t?(Vo(""),io({chatId:D,threadId:x,isLocalOnly:!0})):e&&(Vo((0,U.QY)(e)),so({chatId:D,threadId:x,text:e})),uo())},[lt,D,io,uo,so,Vo,x]);const{isOpen:Qs,botId:Zs,isGallery:Xs,switchPm:ea,switchWebview:ta,results:na,closeTooltip:oa,help:ia,loadMore:sa}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:d}=(0,i.ko)(),[c,l,u]=(0,J.A)(!1),h=(0,ae.gs)(()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Se;const t=function(e){return Me.innerHTML=e.replace(/
/g,"\n"),Me.querySelectorAll("[alt]").forEach(e=>{e.innerText||(e.innerText=e.getAttribute("alt"))}),Me.innerText}(e),n=t.match(Ie);return n?Ne(n[1],n[2],""===n[2]&&!t.match(be)):Se}(t):Se},[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,j.A)(h,[h,n],!0);(0,ie.A)(([e])=>{e&&r({username:e})},[m,r]),(0,o.vJ)(()=>{f&&a({chatId:t,username:f,query:p})},[t,p,a,f]),(0,o.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:I,help:b}=f&&s?.[f]||{},S=Boolean((w?.length||A||y)&&!c);(0,o.vJ)(()=>{S||m||d()},[S,d,m]);const M=(0,W.A)(()=>{f&&a({chatId:t,username:f,query:p,offset:C})});return{isOpen:S,botId:v,isGallery:I,switchPm:A,switchWebview:y,results:w,closeTooltip:l,help:g&&b?`@${m} ${b}`:void 0,loadMore:M}}(Boolean(_o&&m&&Je&&!Si),D,zo,Jt),aa=Boolean(Tn&&Object.keys(Tn).length),{isOpen:ra,close:da,filteredBotCommands:ca,filteredQuickReplies:la}=function(e,t,n,i,s){const[a,r]=(0,o.J0)(),[d,c]=(0,o.J0)(),[l,u,h]=(0,J.A)(!1),m=(0,ae.gs)(()=>{const n=t();return e&&n.startsWith("/")?(0,se.S)(n).match(de)?.[0].trim():void 0},[t,e],300),p=(0,re.A)(m,[m,t],!0);return(0,o.vJ)(()=>{const e=p(),t=n||i;if(!e||!t&&!s)return r(void 0),void c(void 0);const o=e.substring(1),a=t?.filter(e=>!o||e.command.startsWith(o));r(a?.length?a:void 0);const d=Object.values(s||{}).filter(e=>!o||e.shortcut.startsWith(o));c(d?.length?d:void 0)},[p,n,i,s]),(0,o.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||d?.length)&&!l),close:u,filteredBotCommands:a,filteredQuickReplies:d}}(Boolean(_o&&m&&Je&&($t&&$t?.length||pi?.length||aa&&Dn)),zo,$t,pi,Dn?Tn:void 0);(({draft:e,chatId:t,threadId:n,getHtml:d,setHtml:c,editedMessage:l,isDisabled:u})=>{const{saveDraft:h,clearDraft:m,loadCustomEmojis:p}=(0,i.ko)(),g=(0,o.li)(!1);(0,o.vJ)(()=>{const t=d(),n=void 0!==e?.isLocal;(0,U.QY)(e?.text)!==t||n?g.current=!0:g.current=!1},[e,d]),(0,o.vJ)(()=>{g.current=!1},[t,n]);const f=Boolean(l),v=(0,W.A)((e={})=>{if(u||f||!g.current)return;const o=d();o?(0,r.YS)(()=>{h({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,Y.A)(o)})}):m({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})}),A=(0,ge.A)(a.mPG,!0,void 0,[t,n]);(0,pe.A)(([o,i,d])=>{if(u)return;const h=g.current,m=e?.suggestedPostInfo&&!d?.suggestedPostInfo;if(t===o&&n===i){if(h&&!e)return;if(!e&&d&&c(""),h&&!m)return}if(l||!e)return;c((0,U.QY)(e.text)),m&&(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,S.A)(e,!0)});const f=e.text?.entities?.map(e=>e.type===s.C7.CustomEmoji&&e.documentId).filter(Boolean)||[];f.length&&p({ids:f})},[t,n,e,d,c,l,u]),(0,o.Nf)(()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),Ae=!0,(0,r.YS)(()=>{Ae=!1})}},[t,n,f,v,u]);const y=(0,oe.i)(t),C=(0,oe.i)(n);(0,o.vJ)(()=>{if(u||Ae)return;if(!d())return void v();const e=y.current,t=C.current;A(()=>{y.current===e&&C.current===t&&v()})},[y,d,u,A,C,v]),(0,fe.Ay)(v),(0,ve.A)(v)})({draft:Re,chatId:D,threadId:x,getHtml:zo,setHtml:Vo,editedMessage:I,isDisabled:Qo||Boolean(cn)||!rt&&ui}),function({getHtml:e,chatId:t,threadId:n}){const{loadWebPagePreview:a,clearWebPagePreview:r,toggleMessageWebPage:d}=(0,i.ko)(),c=(0,o.li)(),l=(0,ae.tF)(()=>{const t=(0,Y.A)(e()),n=t.entities?.find(e=>e.type===s.C7.TextUrl);return c.current=t,n?.url||t.text.match(ke)?.[0]},[e],300,!0),u=(0,re.A)(l,[l,e],!0);(0,o.vJ)(()=>{const e=u(),o=c.current;e?a({text:o}):(r(),d({chatId:t,threadId:n}))},[u,t,n]),(0,ie.A)(()=>{r(),d({chatId:t,threadId:n})},[t,r,n,d])}({chatId:D,threadId:x,getHtml:zo});const ua=(0,W.A)((e=!1)=>{e||Vo(""),bi(k.p),Ni(void 0),Os(),js(),qs(),Hs(),p?setTimeout(()=>vs(),350):vs()}),ha=(0,W.A)((e,t)=>{const n=t?Mt:Vn;if(e?.length>n){const t=e.length-n;return ao({data:{type:"localized",text:{key:"ErrorMessageTooLong",variables:{count:t},options:{pluralValue:t}}}}),!1}return!0}),[ma,pa,ga]=((e,t,n,s,c,l,u,h,m,p)=>{const{editMessage:g,setEditingDraft:f,toggleMessageWebPage:v,openDeleteMessageModal:A}=(0,i.ko)(),[y,C]=(0,o.J0)(!1),w=m?.replyInfo?.replyToMsgId;(0,G.A)(([e,o])=>{if(!n)return;if(w&&o!==w)return t(""),void C(!1);if(e?.id===n.id&&w===o)return;const i=!e&&p?.text.length?p:n.content.text,s=(0,U.QY)(i);t(s),C(!0),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,S.A)(e,!0)})},[n,w,p,t]),(0,o.vJ)(()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some(e=>ye.has(e.type));v({chatId:l,threadId:u,noWebPage:e})},[l,u,n]),(0,o.vJ)(()=>{if(n)return()=>{const t=(0,Y.A)(e()),n=t.text.length?t:void 0;f({chatId:l,threadId:u,type:h,text:n})}},[l,n,e,f,u,h]);const I=(0,ae.tF)(()=>{if(!n)return!1;const t=(0,Y.A)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some(e=>ye.has(e.type))&&!t.entities?.some(e=>ye.has(e.type))},[n,e],300,!0),b=(0,re.A)(I,[I,e],!0);(0,G.A)(([e])=>{n&&e?.id===n.id&&b()&&v({chatId:l,threadId:u,noWebPage:!1})},[n,l,e,u,b]);const M=(0,W.A)(()=>{m&&(0,r.YS)(()=>{t((0,U.QY)(m.text)),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,S.A)(e,!0)})})}),N=(0,W.A)(()=>{s(),M()}),k=(0,W.A)(()=>{const{text:t,entities:o}=(0,Y.A)(e());n&&(t||(0,d.mR)(n)?t&&!c(t)||(g({messageList:{chatId:l,threadId:u,type:h},text:t,entities:o}),s(),M()):A({chatId:l,messageIds:[n.id],isSchedule:"scheduled"===h}))}),F=(0,W.A)(()=>{if(!n)return;const t=(0,Y.A)(e()),o=t.text.length?t:void 0;f({chatId:l,threadId:u,type:h,text:o})});return(0,fe.Ay)(F),(0,ve.A)(F),[k,N,y]})(zo,Vo,I,ua,ha,D,x,Be,Re,dn),fa=(0,oe.i)(ua),va=(0,oe.i)(Ms);(0,o.vJ)(()=>()=>{va.current(),fa.current()},[D,x,fa,va]);const Aa=(0,o.Kr)(()=>{if($n)return Object.values($n).every(Boolean)},[$n]),ya=Boolean(!_e&&it&&!Aa),Ca=ui&&!I&&!st&&!at&&!Re?.suggestedPostInfo,wa=(0,W.A)(()=>{const e=Ai.current;Co(e?{message:Ro("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:bt,shouldReplaceHistory:!0}},actionText:Ro("Open")}:{message:Ro("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:Ro("PremiumMore")}),Ai.current=Number(!e)}),Ia=(0,j.A)(()=>ii||!no||zo()&&!Si?I&&ga?an.Edit:!g.pW||ks||st||zo()&&!Si?c?an.Schedule:an.Send:an.Record:an.Forward,[ks,I,zo,Si,st,ii,no,ga,c]),ba=!c,{isContextMenuOpen:Sa,handleContextMenu:Ma,handleContextMenuClose:Na,handleContextMenuHide:ka}=(0,V.A)(Fs,!(Ia===an.Send&&ba)),{contextMenuAnchor:Ya,handleContextMenu:Fa,handleBeforeContextMenu:Pa,handleContextMenuHide:Ta}=(0,V.A)(Ko,!Qo);(0,o.vJ)(()=>{ot||Ya&&(Io({peerId:D,storyId:we,position:Ya}),Ta())},[D,Ta,ot,we,Ya]);const{className:Da,style:xa}=(0,Q.Ay)({peer:Ht||St,theme:gn}),La=Ii.some(e=>e.gif);((e,t,n,s,a,r,c,l,u)=>{const{showNotification:h,updateShouldSaveAttachmentsCompression:m,applyDefaultAttachmentsCompression:p}=(0,i.ko)(),g=(0,H.A)();(0,o.vJ)(()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=e.target?.closest("div[contenteditable]");if(!o||!he.has(o.id))return;if(e.preventDefault(),document.activeElement!==o)return;const i=e.clipboardData.getData("text"),f=e.clipboardData.getData("text/html");let v=f?(0,Y.A)((0,le._0)(f),void 0,!0):void 0;v&&(0,ce.T8)(v)&&r&&(v=(0,ce.m4)(v),c?.());const{items:A}=e.clipboardData;let y=[];if(A.length>0&&(y=await(0,ue.A)(A),a&&(y=y?.slice(0,1))),!y?.length&&!i)return;const C=v?.entities?.length?v:{text:i};let w=!1;try{w="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(f,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const I=C&&C.text;let b=y?.length&&!w&&!u;const S=y?await Promise.all(y.map(e=>(0,B.Ay)(e.name,e))):[],M=a&&S?.length&&(0,d.eh)(a,S[0])||Boolean(I),N=(0,d.NK)(S[0]),k=a&&a?.groupedId;a&&S?.length>1?h({message:g("MediaReplaceInvalidError",void 0,{pluralValue:S.length})}):a&&N?h({message:g("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!k||(b=M,b)?(b&&(l&&(m({shouldSave:!0}),p()),n(a?S:e=>e.concat(S))),I&&(b?s(C):t(C,o?.id))):h({message:g("MediaReplaceInvalidError",void 0,{pluralValue:S.length})})}},[t,a,n,e,r,c,s,g,l,u])})(Je||Qo,Zi,rs,Ni,I,!qe&&!_e,wa,!Ii.length,La);const Ba=(0,W.A)(()=>{I&&pa()}),Ra=(0,W.A)(()=>{if(fn&&!Rs){const e=document.querySelector(An),t=(0,P.Fm)(),n=qo.current&&Math.floor(t-qo.current),o=fn.nextSendDate&&fn.nextSendDate>t;if(void 0!==n&&n{if(!Le&&!we)return!1;const{text:t}=(0,Y.A)(zo());return!(!t&&!e.length||!ha(t,!0)||!Ra())},Oa=(0,W.A)(({attachments:e,sendCompressed:t=pn.shouldCompress,sendGrouped:n=pn.shouldSendGrouped,isSilent:o,scheduledAt:i,scheduleRepeatPeriod:s,isInvertedMedia:a})=>{if(!Le&&!we)return;o=o||jn;const{text:d,entities:c}=(0,Y.A)(zo());a=d&&t&&n?a:void 0,I?No({messageList:Le,text:d,entities:c,attachments:(0,B.Lx)(e,t)}):oo({messageList:Le,text:d,entities:c,scheduledAt:i,scheduleRepeatPeriod:s,isSilent:o,shouldUpdateStickerSetOrder:vn,attachments:(0,B.Lx)(e,t),shouldGroupMessages:n,isInvertedMedia:a}),qo.current=(0,P.Fm)(),io({chatId:D,threadId:x,isLocalOnly:!0}),(0,r.YS)(()=>{ua()})}),Ua=(0,W.A)((e,t,n)=>{if(Ea(Ii)){if(I)return void Oa({attachments:Ii,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});$i(Oa,{attachments:Ii,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}}),Ka=(0,W.A)((e,t,n,o,i,s)=>{Ea(Ii)&&Oa({attachments:Ii,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o,scheduleRepeatPeriod:s,isInvertedMedia:i})}),za=(0,W.A)((e,t=!1,n,o)=>{const{text:i,entities:s}=(0,Y.A)(zo());if(e.length)return void(Ea(e)&&Oa({attachments:e,scheduledAt:n,scheduleRepeatPeriod:o,isSilent:t}));if(!i&&!st)return;if(!ha(i))return;const a=document.querySelector(An),d=En?.id;if(i||st){if(!Ra())return;const e=Hi?pn.isInvertedMedia:void 0;Un&&Yo({chatId:D,threadId:x,effectId:void 0}),oo({messageList:Le,text:i,entities:s,scheduledAt:n,scheduleRepeatPeriod:o,isSilent:t,shouldUpdateStickerSetOrder:vn,isInvertedMedia:e,effectId:d,webPageMediaSize:pn.webPageMediaSize,webPageUrl:Hi?xn.url:void 0})}qo.current=(0,P.Fm)(),io({chatId:D,threadId:x,isLocalOnly:!0,shouldKeepReply:st}),g.pz&&a&&a===document.activeElement&&L(a),(0,r.YS)(()=>{ua()})}),Va=(0,W.A)(async(e=!1,t,n)=>{if(!Le&&!we)return;e=e||jn;let o=Ii;if(ks){const e=await Ms(),t=Ts?a.dxe:void 0;if(e){const{blob:n,duration:i,waveform:s}=e;o=[await(0,B.Ay)("wonderful-voice-message.ogg",n,{voice:{duration:i,waveform:s},ttlSeconds:t})]}}za(o,e,t,n)}),ja=(0,W.A)((e=!1,t,n)=>{$i(Va,e,t,n)}),Ga=(0,W.A)(()=>{qe?ro({chatId:D}):Co({message:Eo("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Eo("PremiumMore")})}),Ja=(0,W.A)(()=>{const{text:e,entities:t}=(0,Y.A)(zo());lo({chatId:D,text:{text:e,entities:t}})}),qa=(0,W.A)(()=>{if("webApp"!==un?.type)return;const e=(0,y.vG)(un.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,A._)(un.url):Ao({chatId:D,url:un.url,threadId:x})}),$a=(0,W.A)(()=>{vs(),ms()}),Ha=(0,W.A)((e,t,n,o,i)=>{if(e&&"queryId"in e){const{id:n,queryId:o,isSilent:i}=e;return void go({id:n,chatId:D,threadId:x,queryId:o,scheduledAt:t,isSilent:i||jn})}const{isSilent:s,...a}=e||{};if(e&&0!==Object.keys(a).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:o=!1,sendGrouped:i=!1,isInvertedMedia:a}=e;Ka(o,i,s,t,a,n)}else oo({...e,messageList:o,scheduledAt:t,scheduleRepeatPeriod:n,effectId:i});else Va(Boolean(s),t,n)});(0,G.A)(([e])=>{Le&&Nt&&Nt!==e&&yi((e,t)=>{Ha(Nt,e,t,Le,void 0)})},[Nt,Le,Ha,yi]),(0,o.vJ)(()=>{cn&&(Zi(cn,void 0,!0),vo(),(0,r.Uz)(()=>{const e=document.getElementById(yn);(0,S.A)(e,!0)}))},[yn,cn,vo,Vo]),(0,o.vJ)(()=>{ln?.length&&(is(ln),vo())},[is,ln,vo]),(0,o.vJ)(()=>{ln?.length?(Lo({shouldSave:!0}),Bo()):Lo({shouldSave:!1})},[ln,Lo,Bo]);const Wa=(0,W.A)((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||qe||_e||n===gi?Xi(e,t):wa()}),_a=(0,W.A)(e=>{Wa(e,a.e0F)}),Qa=(0,W.A)((e,t,n)=>{(Le||we)&&(t=t||jn,c||n?(ti(),yi((n,o)=>{ni(),$i(Ha,{gif:e,isSilent:t},n,o,Le),(0,r.YS)(()=>{ua(!0)})})):($i(oo,{messageList:Le,gif:e,isSilent:t}),(0,r.YS)(()=>{ua(!0)})),io({chatId:D,threadId:x,isLocalOnly:!0}))}),Za=(0,W.A)(e=>{rs([(0,B.gI)(e)]),vs()}),Xa=(0,W.A)((e,t,n,o=!1,i)=>{(Le||we)&&(t=t||jn,e={...e,isPreloadedGlobally:!0},c||n?(ti(),yi((n,i)=>{ni(),$i(Ha,{sticker:e,isSilent:t},n,i,Le),(0,r.YS)(()=>{ua(o)})})):($i(oo,{messageList:Le,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:vn&&i}),io({chatId:D,threadId:x,isLocalOnly:!0}),(0,r.YS)(()=>{ua(o)})))}),er=(0,W.A)((e,t,n)=>{if(!Le&&!we)return;t=t||jn,c||n?yi((n,o)=>{$i(Ha,{id:e.id,queryId:e.queryId,isSilent:t},n,o,Le)}):$i(go,{id:e.id,queryId:e.queryId,threadId:x,chatId:D,isSilent:t});const o=document.querySelector(An);g.pz&&o&&o===document.activeElement&&L(o),io({chatId:D,threadId:x,isLocalOnly:!0}),(0,r.YS)(()=>{ua()})}),tr=(0,W.A)(()=>{io({chatId:D,threadId:x,isLocalOnly:!0}),(0,r.YS)(()=>{ua()})}),nr=(0,W.A)(e=>{Le&&(c?yi((t,n)=>{$i(Ha,{todo:e},t,n,Le)}):$i(oo,{messageList:Le,todo:e,isSilent:jn}))}),or=(0,W.A)(e=>{if(c)yi((t,n)=>{Ha({...e,isSilent:!0},t,n,Le)});else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:o}=e;Ka(t,n,!0,void 0,o)}else Va(!0)}),ir=(0,W.A)(()=>{const e=document.querySelector(An);if(!p||e!==document.activeElement)return ps(),vs(),void ys();e?.blur(),setTimeout(()=>{ps(),vs(),ys()},100)});(0,o.vJ)(()=>{Wi&&Vo("")},[Wi,Vo,Ii]);const sr=(0,W.A)(e=>{Qi(e,a.e0F)}),ar=(0,W.A)(e=>{const t=Ii.length?a.e0F:yn;Zi(e,t)}),rr=(0,W.A)((e=yn)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,E.L)(n,e))return void document.execCommand("delete",!1)}Vo(function(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,i=document.createRange(),s=window.getSelection();i.setStart(n,o),i.setEnd(n,o),s.removeAllRanges(),s.addRange(i),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(zo()))}),dr=(0,W.A)(()=>{rr(a.e0F)}),cr=(0,W.A)(()=>{mo({chatId:D,threadId:x,type:"scheduled",noForumTopicPanel:!0})}),lr=(0,W.A)(()=>{bo({forUserId:D})}),ur=(0,W.A)(()=>{xo({price:{currency:a.OUy,amount:0,nanos:0}})}),hr=(0,W.A)(()=>{const e=!jn;To({chatId:D,isEnabled:e}),Co({localId:"silentPosting",icon:e?"mute":"unmute",message:Eo(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})});(0,o.vJ)(()=>{et&&p&&vs()},[et,vs,p]),(0,o.vJ)(()=>{if(!m)return;let e;return nt?Is():e=window.setTimeout(()=>{bs()},200),()=>{e&&clearTimeout(e)}},[nt,bs,Is,m]);const mr=(0,j.A)(()=>zo(),[zo]),pr=Boolean(mr),[gr,fr]=(0,o.J0)(!1);(0,o.vJ)(()=>{Si||(0,r.YS)(()=>{const e=Oo.current;if(!mr||!e)return void fr(!1);const{totalLines:t}=(0,C.A)(e,!0);fr(t>=3)})},[mr,Si]);const vr=We&&"webApp"===un?.type&&!I&&"thread"===Be,Ar=vr&&!pr&&!ks,yr=cs||gs||Es||As||$s||Qs||hs||ri||Js||ra||Vs||Ar||Sa||Boolean(ks)||Ii.length>0||ii,Cr=yr&&!ot&&Qo&&!ri&&!gs,wr=(()=>{if(fn?.nextSendDate&&!(fn.nextSendDate<(0,P.Fm)()))return Eo("SlowModePlaceholder",{timer:(0,je.Y)(Xt.A,{endsAt:fn.nextSendDate,onEnd:Wo})},{withNodes:!0})})(),Ir=(0,o.Kr)(()=>ks&&Ho<=600?"":Wi?Eo(Qo?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):wr||ht||mt||(Rn?Eo("ComposerPlaceholderPaidMessage",{amount:(0,M.U2)(Eo,Rn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):at&&rt?Eo("ComposerPlaceholderCaption"):Yn?.activeUntil&&Qo&&Yn.activeUntil>(0,P.Fm)()?Eo("StealthModeComposerPlaceholder",{timer:(0,je.Y)(Xt.A,{endsAt:Yn.activeUntil,onEnd:Wo})},{withNodes:!0}):Ee?.adminRights?.anonymous?Eo("ComposerPlaceholderAnonymous"):Ee?.isBotForum&&!ze?.canManageBotForumTopics&&x===s.l3?Eo("ComposerPlaceholderBotTopicGeneral"):Ee?.isForum&&!Ee.isBotForum&&Ee.isForumAsMessages&&x===s.l3?Ve?Eo("ComposerPlaceholderTopic",{topic:Ve.title}):Eo("ComposerPlaceholderTopicGeneral"):Eo(Ze?jn?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder")),[ks,ht,Ee,mt,Ze,Wi,Qo,jn,Eo,Ve,at,x,Ho,Rn,rt,wr,Yn?.activeUntil,ze?.canManageBotForumTopics]);(0,o.vJ)(()=>{yr?eo?.():to?.()},[yr,to,eo]);const{shouldRender:br,transitionClassNames:Sr}=(0,ne.A)(Cr),Mr=!(Ia!==an.Record||Fi&&$e&&xi),Nr=(0,W.A)(()=>{switch(Ia){case an.Forward:no?.();break;case an.Send:ja();break;case an.Record:Mr?$e?xi||wo({chatId:D,messageListType:Be}):Co({message:Ro("VoiceMessagesRestrictedByPrivacy",Ee?.title)}):(Ds(!1),Ss());break;case an.Edit:ma();break;case an.Schedule:if(ks&&Ns(),!Le)return;yi((e,t)=>{Ha({},e,t,Le,En?.id)})}});let kr="SendMessage";switch(Ia){case an.Forward:kr="Forward";break;case an.Edit:kr="Save edited message";break;case an.Record:kr=Fi?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Yr=(0,f.A)("Composer",!nt&&"shown",ws&&"hover-disabled",jo&&"mounted",wn),Fr=(0,W.A)(e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const o=(0,u.O8F)((0,i.mS)(),e.documentId);if(!o)return;if(!o.isFree&&!qe&&!_e)return void wa();const s=(0,Y.A)((0,R.hB)(o));t=s.text,n=s.entities}$i(oo,{text:t,entities:n,isReaction:!0}),So()}),Pr=(0,W.A)(e=>{Fo({chatId:D,threadId:x,reaction:e}),So()}),Tr=(0,W.A)(e=>{Io({peerId:D,storyId:we,position:e,sendAsMessage:!0})}),Dr=(0,W.A)(()=>{const e=kn?void 0:a.tNZ;Mo({peerId:D,storyId:we,containerId:(0,d.$_)(D,we),reaction:e})}),xr=(0,W.A)(()=>{yi((e,t)=>{Ha({},e,t,Le,void 0)})}),Lr=(0,W.A)(()=>{$i(or)}),Br=(0,W.A)(()=>{$i(Ha,{},a.NkL,void 0,Le,En?.id)}),Rr=(0,W.A)((e,t,n,o,i)=>{o?$i(Ha,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},o,i,Le,void 0):yi((o,i)=>{$i(Ha,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},o,i,Le,void 0)})}),Er=(0,W.A)((e,t,n)=>{$i(or,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}),Or=(0,W.A)(()=>{Yo({chatId:D,threadId:x,effectId:void 0})}),Ur=(0,W.A)(()=>{Po({})}),Kr=(0,o.Kr)(()=>{switch(Ia){case an.Edit:return ma;case an.Schedule:return xr;default:return ja}},[Ia,ma,ja]),zr=We&&"commands"===un?.type&&!I&&!1!==$t&&!ks,Vr=Un&&En?.emoticon,jr=Boolean(Rn&&Ia===an.Send),Gr=(0,Z.A)(jr);return(0,je.FD)("div",{className:Yr,children:[_o&&Fi&&m&&(0,je.Y)(Lt,{isOpen:n!==xt.I.None,withQuick:n===xt.I.QuickFile||$o===xt.I.QuickFile,onHide:Xn,onFileSelect:is,editingMessage:I}),br&&!Ui&&(0,je.Y)(Qt.A,{topReactions:bn,allAvailableReactions:In,onToggleReaction:Fr,isPrivate:!0,isReady:m,canBuyPremium:Sn,isCurrentUserPremium:qe,isInSavedMessages:_e,isInStoryViewer:Qo,canPlayAnimatedEmojis:Mn,onShowMore:Tr,className:Sr}),(0,je.Y)(Ge,{chatId:D,threadId:x,canShowCustomSendMenu:ba,attachments:Ii,getHtml:zo,isReady:m,shouldForceCompression:ts,shouldForceAsFile:ns,isForCurrentMessageList:Je,isForMessage:_o,shouldSchedule:fi&&c,canSchedule:fi,forceDarkTheme:Qo,onCaptionUpdate:ss,onSendSilent:Er,onSend:Ua,onSendScheduled:Rr,onFileAppend:os,onClear:as,onAttachmentsUpdate:rs,onCustomEmojiSelect:_a,onRemoveSymbol:dr,onEmojiSelect:sr,editingMessage:I,onSendWhenOnline:Br,canScheduleUntilOnline:h&&!Ts,paidMessagesStars:Rn}),(0,je.Y)(Vt,{modal:ct,onClear:co,onSend:nr}),(0,je.Y)(Ut,{isOpen:As,onClose:Cs,chatId:D,selectedSendAsId:rn,sendAsPeerIds:Zo,isCurrentUserPremium:qe}),(0,je.Y)(Et,{isOpen:$s,filteredUsers:_s,onInsertUserName:Ws,onClose:Hs}),(0,je.Y)(It,{isOpen:ra,chatId:D,withUsername:Boolean(pi),botCommands:ca,quickReplies:la,getHtml:zo,self:St,quickReplyMessages:Pn,onClick:tr,onClose:da}),(0,je.FD)("div",{className:(0,f.A)("composer-wrapper",Qo&&"with-story-tweaks",Ui&&"is-need-premium"),children:[!Ui&&(0,je.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,je.Y)("defs",{children:(0,je.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,je.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,je.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,je.Y)("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"})]})}),(0,je.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,je.Y)("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)"}),(0,je.Y)("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&&(0,je.FD)(je.FK,{children:[(0,je.Y)(Rt,{isOpen:Qs,botId:Zs,isGallery:Xs,inlineBotResults:na,switchPm:ea,switchWebview:ta,loadMore:sa,isSavedMessages:_e,canSendGifs:Yi,isCurrentUserPremium:qe,onSelectResult:er,onClose:oa}),(0,je.Y)(Pt,{onClear:Ba,shouldForceShowEditing:Boolean(ga&&I),chatId:D,threadId:x,messageListType:Be}),(0,je.Y)(Wt,{chatId:D,threadId:x,isDisabled:!Ti||Si||!pr,isEditing:Boolean(I)})]}),(0,je.FD)("div",{className:(0,f.A)("message-input-wrapper",Da),style:xa,children:[_o&&(0,je.FD)(je.FK,{children:[vr&&(0,je.Y)(wt,{isOpen:Ar,text:un.text,isDisabled:Boolean(ks),onClick:qa}),zr&&(0,je.Y)(Qe.A,{className:(0,f.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===$t,color:"translucent",onActivate:$a,ariaLabel:"Open bot command keyboard",children:(0,je.Y)(He.A,{name:"bot-commands-filled"})}),Xo&&Ht&&(0,je.Y)(tt.A,{round:!0,color:"translucent",onClick:As?Cs:ir,ariaLabel:Ro("SendMessageAsTitle"),className:(0,f.A)("send-as-button","composer-action-button",wi.current&&"appear-animation"),children:(0,je.Y)(nn.A,{peer:Ht,size:"tiny"})})]}),(!Wi||Yi||ki)&&!Ui&&!Hn&&(0,je.Y)(zt.A,{chatId:D,threadId:x,isMobile:p,isReady:m,isSymbolMenuOpen:gs,openSymbolMenu:fs,closeSymbolMenu:vs,canSendStickers:ki,canSendGifs:Yi,isMessageComposer:_o,onGifSelect:Qa,onGifAddCaption:Za,onStickerSelect:Xa,onCustomEmojiSelect:Wa,onRemoveSymbol:rr,onEmojiSelect:Qi,closeBotCommandMenu:ps,closeSendAsMenu:Cs,isSymbolMenuForced:ei,canSendPlainText:!Wi,inputCssSelector:An,idPrefix:e,forceDarkTheme:Qo}),(0,je.Y)(tt.A,{round:!0,faded:!0,className:(0,f.A)("ai-composer-button",(!gr||Si)&&"ai-composer-button-hidden"),color:"translucent",ariaLabel:Eo("AiMessageEditor"),iconName:"ai",tabIndex:gr&&!Si?0:-1,onClick:Ja}),(0,je.Y)(Ot.A,{ref:Oo,id:Cn,editableInputId:yn,customEmojiPrefix:e,isStoryInput:Qo,chatId:D,canSendPlainText:!Wi,threadId:x,isReady:m,isActive:!Si,getHtml:zo,placeholder:Ir,forcedPlaceholder:ia,canAutoFocus:m&&Je&&!Si&&_o,noFocusInterception:Si,shouldSuppressFocus:p&&gs,shouldSuppressTextFormatter:Es||$s||Qs,onUpdate:Vo,onSend:Kr,onSuppressedFocus:vs,onFocus:si,onBlur:ai,isNeedPremium:Ui,messageListType:Be}),_o&&(0,je.FD)(je.FK,{children:[qt&&Boolean(Zs)&&(0,je.Y)(Zt.A,{color:"gray"}),(0,je.Y)(en.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(pr),direction:"inverse",name:"slideFadeAndroid",children:!pr&&(0,je.FD)(je.FK,{children:[Ze&&(0,je.Y)(en.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(jn),children:(0,je.Y)(tt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:hr,ariaLabel:Eo(jn?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),iconName:jn?"mute":"unmute"})}),pt&&(0,je.Y)(tt.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:cr,ariaLabel:Eo("AriaComposerOpenScheduled"),iconName:"scheduled"}),ya&&(0,je.Y)(tt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:lr,iconName:"gift"}),Ca&&(0,je.Y)(tt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:ur,iconName:"cash-circle"}),Boolean(ut)&&!ks&&!I&&(0,je.FD)(je.FK,{children:[(0,je.Y)(Qe.A,{className:(0,f.A)("composer-action-button",cs&&"activated"),round:!0,color:"translucent",noClickActivation:!0,onActivate:ls,ariaLabel:Eo("AriaComposerBotKeyboard"),children:(0,je.Y)(He.A,{name:"bot-command"})}),!p&&(0,je.Y)(Ct,{messageId:ut,threadId:x,isOpen:cs,onClose:us})]})]})})]}),ks&&Boolean(Ys)&&(0,je.Y)("span",{className:"recording-state",children:(0,v.JW)(Ys-Ps.current)}),!Ui&&(0,je.Y)(gt,{chatId:D,threadId:x,editingMessage:I,canEditMedia:li,isButtonVisible:!ks,canAttachMedia:Fi,canAttachPolls:Pi,canAttachToDoLists:Di,canSendPhotos:Ei,canSendVideos:Ri,canSendDocuments:Oi,canSendAudios:Bi,canInsertDate:!Wi,onFileSelect:is,onDateInsert:ar,onTodoListCreate:Ga,isScheduled:c,attachBots:_o?hn:void 0,peerType:mn,shouldCollectDebugLogs:Nn,theme:gn,onMenuOpen:di,onMenuClose:ci,messageListType:Be,paidMessagesStars:Rn}),p&&_o&&Boolean(ut)&&(0,je.Y)(Ct,{messageId:ut,threadId:x,isOpen:cs,onClose:us}),_o&&$t&&(0,je.Y)(ft,{isOpen:hs,botCommands:$t,onClose:ps})]}),(0,je.Y)(Tt.A,{chatId:D,isOpen:Vs,onCustomEmojiSelect:Gs,addRecentCustomEmoji:yo,onClose:js},`custom-emoji-tooltip-${yn}`),(0,je.Y)(Kt,{chatId:D,threadId:x,isOpen:Js,onStickerSelect:Xa,onClose:qs},`sticker-tooltip-${yn}`),(0,je.Y)(Bt.A,{isOpen:Es,emojis:Us,customEmojis:Ks,addRecentEmoji:po,addRecentCustomEmoji:yo,onEmojiSelect:zs,onCustomEmojiSelect:zs,onClose:Os},`emoji-tooltip-${yn}`)]}),Fn&&ks&&(0,je.FD)(tt.A,{className:(0,f.A)("view-once",Ts&&"active"),round:!0,color:"secondary",ariaLabel:Ro("Chat.PlayOnceVoiceMessageTooltip"),onClick:xs,children:[(0,je.Y)(He.A,{name:"view-once"}),(0,je.Y)(He.A,{name:"one-filled"})]}),ks&&(0,je.Y)(tt.A,{round:!0,color:"danger",className:"cancel",onClick:Ms,ariaLabel:"Cancel voice recording",iconName:"delete"}),Qo&&!ks&&(0,je.FD)(tt.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:Dr,onContextMenu:Fa,onMouseDown:Pa,ariaLabel:Ro("AccDescrLike"),ref:Ko,children:[kn&&(0,je.Y)(sn.A,{containerId:(0,d.$_)(D,we),reaction:kn,withEffectOnly:vi},(0,d.Jj)(kn)),(!kn||vi)&&(0,je.Y)(He.A,{name:"heart",className:(0,f.A)(vi&&"story-reaction-heart")})]}),(0,je.FD)(tt.A,{ref:Fs,round:!0,color:"secondary",className:(0,f.A)(Ia,"main-button",!m&&"not-ready",ks&&"recording"),disabled:Mr,allowDisabledClick:!0,noFastClick:!0,ariaLabel:Ro(kr),onClick:Nr,onContextMenu:Ia===an.Send&&ba?Ma:void 0,children:[(0,je.Y)(He.A,{name:"send"}),(0,je.Y)(He.A,{name:"microphone-alt"}),no&&(0,je.Y)(He.A,{name:"forward"}),_o&&(0,je.Y)(He.A,{name:"schedule"}),_o&&(0,je.Y)(He.A,{name:"check"}),(0,je.Y)(tt.A,{className:(0,f.A)("paidStarsBadge",jr&&"visible",Gr&&!jr&&"hiding",!Gr&&!jr&&"hidden"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,je.FD)("div",{className:"paidStarsBadgeText",children:[(0,je.Y)(He.A,{name:"star"}),(0,je.Y)(tn.A,{ref:Uo,text:Eo.number(Vi)})]})})]}),Vr&&(0,je.Y)("span",{className:"effect-icon",onClick:Or,children:(0,O.A)(Vr)}),En&&Kn&&(0,je.Y)(_t.A,{shouldPlay:zn,effect:En,onStop:Ur}),ba&&(0,je.Y)(Dt.A,{isOpen:Sa,canSchedule:fi&&_o&&!Ts,canScheduleUntilOnline:h&&!Ts,onSendSilent:_e?void 0:Lr,onSendSchedule:c?void 0:xr,onSendWhenOnline:Br,onRemoveEffect:Or,onClose:Na,onCloseAnimationEnd:ka,isSavedMessages:_e,chatId:D,withEffects:Un,hasCurrentEffect:Boolean(En),effectReactions:On,allAvailableReactions:In,onToggleReaction:Pr,isCurrentUserPremium:qe,isInSavedMessages:_e,isInStoryViewer:Qo,canPlayAnimatedEmojis:Mn}),Ci,(0,je.Y)(on.A,{isOpen:Gn,onClose:ji,userName:Ee?(0,l.F9)(Eo,Ee):void 0,messagePriceInStars:Rn||0,messagesCount:zi,shouldAutoApprove:Ji,setAutoApprove:qi,confirmHandler:Gi})]})}))},54314(e,t,n){n.d(t,{A:()=>f});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(48899),d=n(4961),c=n(39351),l=n(17712),u=n(59030),h=n(64493),m=n(22337),p=n(21849),g=n(20021);const f=(0,o.ph)((0,i.EK)((e,{chat:t,isSavedDialog:n})=>{const o=(0,r.L8)(t.id),i=(0,a.nZ4)(e,t.id),d=(0,a.mBe)(e,t.id),c=d&&(0,s.tv)(d)&&!t.isSupport,l=o&&!i&&!c&&!n,u=o?(0,s.u0)(d):void 0;return{isPrivateChat:o,isChatWithSelf:i,isBot:c,isChannel:(0,s.WX)(t),isBasicGroup:(0,s.yn)(t),isSuperGroup:(0,s.Vs)(t),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:u}})(({isOpen:e,chat:t,isSavedDialog:n,isChannel:o,isPrivateChat:a,isChatWithSelf:r,isBot:f,isBasicGroup:v,isSuperGroup:A,currentUserId:y,canDeleteForAll:C,contactName:w,onClose:I,onCloseAnimationEnd:b})=>{const{leaveChannel:S,leaveBasicGroup:M,deleteHistory:N,deleteSavedHistory:k,deleteChannel:Y,deleteChatUser:F,blockUser:P,deleteChat:T}=(0,i.ko)(),D=(0,u.A)(),x=(0,c.A)(),L=(0,s.Js)(x,t),B=(0,l.A)(()=>{N({chatId:t.id,shouldDeleteForAll:!0}),I()}),R=(0,l.A)(()=>{N({chatId:t.id,shouldDeleteForAll:!0}),P({userId:t.id}),I()}),E=(0,l.A)(()=>{n?k({chatId:t.id}):a?N({chatId:t.id,shouldDeleteForAll:!1}):v?t.isCreator?(N({chatId:t.id,shouldDeleteForAll:!0}),T({chatId:t.id})):(N({chatId:t.id,shouldDeleteForAll:!1}),F({chatId:t.id,userId:y})):!o&&!A||t.isCreator?(o||A)&&t.isCreator&&Y({chatId:t.id}):S({chatId:t.id}),I()}),O=(0,l.A)(()=>{o||A?(S({chatId:t.id}),I()):v&&t.isCreator?(M({chatId:t.id}),I()):E()});return(0,g.FD)(m.A,{isOpen:e,className:"DeleteChatModal",header:(0,g.FD)("div",{className:"modal-header",dir:x.isRtl?"rtl":void 0,children:[(0,g.Y)(p.A,{size:"tiny",peer:t,isSavedMessages:r}),(0,g.Y)("h3",{className:"modal-title",children:D(n?r?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"ChannelDelete":v||A?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:I,onCloseAnimationEnd:b,children:[n?(0,g.Y)("p",{children:(0,d.A)(r?D("ClearHistoryMyNotesMessage"):D("ClearHistoryMessageSingle",L),["simple_markdown","emoji"])}):o&&t.isCreator?(0,g.Y)("p",{children:(0,d.A)(D("ChatList.DeleteAndLeaveGroupConfirmation",L),["simple_markdown","emoji"])}):o&&!t.isCreator||v||A?(0,g.Y)("p",{children:(0,d.A)(D("ChannelLeaveAlertWithName",L),["simple_markdown","emoji"])}):(0,g.Y)("p",{children:(0,d.A)(D("ChatList.DeleteChatConfirmation",w),["simple_markdown","emoji"])}),(0,g.FD)("div",{className:"dialog-buttons-column",children:[f&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:R,children:D("DeleteAndStop")}),C&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:B,children:w?(0,d.A)(D("ChatList.DeleteForEveryone",w)):D("DeleteForAll")}),!a&&t.isCreator&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:D("DeleteForAll")}),(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:a||n?E:O,children:D(n?"Delete":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"Chat.Input.Delete":v||A?"Group.LeaveGroup":C?"ChatList.DeleteForCurrentUser":"Delete")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:I,children:D("Cancel")})]})]})}))},55723(e,t,n){n.d(t,{A:()=>b});var o=n(84051),i=n(13439),s=n(90709),a=n(10315),r=n(91525),d=n(15186),c=n(11597),l=n(96454),u=n(87679),h=n(58554);const m=new(n(84947).A)(100);var p=n(37661),g=n(5912),f=n(17712),v=n(69419),A=n(59030),y=n(19806),C=n(94189),w=n(52988),I=n(20021);const b=(0,o.ph)(({document:e,observeIntersection:t,fileSize:n,canAutoLoad:b,autoLoadFileMaxSizeMb:S,uploadProgress:M,datetime:N,className:k,sender:Y,isSelected:F,isSelectable:P,shouldWarnAboutFiles:T,isDownloading:D,message:x,id:L,onCancelUpload:B,onMediaClick:R,onDateClick:E})=>{const{cancelMediaDownload:O,downloadMedia:U,setSharedSettingOption:K}=(0,i.ko)(),z=(0,o.li)(),V=(0,A.A)(),[j,G,J]=(0,p.A)(),[q,$]=(0,o.J0)(!1),{fileName:H,size:W,mimeType:_}=e,Q=(0,r.rK)(e)||"",Z=(0,g.Vz)(z,t),[X,ee]=(0,p.A)();(0,o.vJ)(()=>{Z&&ee()},[Z,ee]);const[te,ne]=(0,o.J0)(b&&(!S||W<=1048576*S)),oe=Boolean(D||te&&X),ie=(0,s.mr)(e,"download"),{loadProgress:se,mediaData:ae}=(0,v.A)(ie,!oe,(0,s.Cz)(e,"download"),void 0,!0),re=Boolean(ae),{isUploading:de,isTransferring:ce,transferProgress:le}=(0,s.LK)(M||se,oe&&!re,void 0!==M),ue=(0,r.ON)(e),he=(0,o.Kr)(()=>ue?{document:e}:void 0,[e,ue]),me="photo"===e.innerMediaType&&e.mediaSize&&!e.mediaSize.fromDocumentAttribute&&!e.mediaSize.fromPreload,pe=R&&e.innerMediaType&&!me;(0,o.vJ)(()=>{const e=z.current;if(!pe||!e||!x)return;const t=()=>{!async function(e){const t=(0,s.Op)(e),n=(0,s.nd)(e),o=t||n,a=n&&n.mediaSize&&!n.mediaSize.fromDocumentAttribute;if(!o||o.previewBlobUrl||a)return;const r=(0,s.mr)(o,"full");if(!r||m.has(r))return;m.set(r,void 0);const p=await(0,h.hd)(r,(0,s.Cz)(o,"full"));if(!p)return;let g;if(t&&l.Uz){const e=await(0,u.FW)(p);g={width:e.videoWidth,height:e.videoHeight,fromPreload:!0}}if(n){const e=await(0,u.NN)(p);g={width:e.naturalWidth,height:e.naturalHeight,fromPreload:!0}}if(!g||g.width<=0||g.height<=0)return;let f=(0,i.mS)();const v=(0,c.O5q)(f,e.chatId,e.id);v&&v.content.document&&(f=(0,d.r3y)(f,e.chatId,e.id,{content:{...v.content,document:{...v.content.document,mediaSize:g}}}),(0,i.UF)(f))}(x)};return e.addEventListener("mouseenter",t),()=>{e.removeEventListener("mouseenter",t)}},[pe,x]);const ge=(0,f.A)(()=>{U({media:e,originMessage:x})}),fe=(0,f.A)(()=>{de?B&&B():D?O({media:e}):ce?ne(!1):pe?x?R?.(x.id):R&&R():(0,a.N)({mimeType:_,extension:Q})&&T?G():ge()}),ve=(0,f.A)(()=>{K({shouldWarnAboutFiles:!q}),J(),ge()}),Ae=(0,f.A)(()=>{E?.(x)});return(0,I.FD)(I.FK,{children:[(0,I.Y)(w.A,{ref:z,id:L,name:H,extension:Q,size:W,timestamp:N,previewMedia:he,observeIntersection:t,previewSize:n,isTransferring:ce,isUploading:de,transferProgress:le,className:k,sender:Y,isSelectable:P,isSelected:F,actionIcon:pe?(0,s.hr)(e)?"play":"eye":"download",onClick:fe,onDateClick:E?Ae:void 0}),(0,I.FD)(C.A,{isOpen:j,onClose:J,confirmHandler:ve,children:[V("lng_launch_svg_warning"),(0,I.Y)(y.A,{className:"dialog-checkbox",checked:q,label:V("lng_launch_exe_dont_ask"),onCheck:$})]})]})})},80999(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(87357),s=n(4961),a=n(39351),r=n(20021);const d=(0,o.ph)(({content:e,className:t})=>{const n=(0,a.A)();return(0,r.FD)("span",{className:(0,i.A)("DotAnimation",t),dir:n.isRtl?"rtl":"auto",children:[(0,s.A)(e),(0,r.Y)("span",{className:"ellipsis"})]})})},52988(e,t,n){n.d(t,{A:()=>A});var o=n(84051),i=n(87357),s=n(58744),a=n(91525),r=n(76023),d=n(4961),c=n(39351),l=n(59030),u=n(50680),h=n(96530),m=n(35913),p=n(70832),g=n(5505),f=n(18276),v=n(20021);const A=(0,o.ph)(({ref:e,id:t,name:n,size:A,extension:y="",timestamp:C,sender:w,previewMedia:I,previewAttachment:b,className:S,previewSize:M="medium",isTransferring:N,isUploading:k,isSelectable:Y,isSelected:F,transferProgress:P,actionIcon:T,observeIntersection:D,onClick:x,onDateClick:L})=>{const B=(0,l.A)(),R=(0,c.A)();let E=(0,o.li)();e&&(E=e);const{shouldRender:O,transitionClassNames:U}=(0,u.A)(N,void 0,!0),K=(0,a.fE)(y),{width:z}=(0,r.tP)(M),V=(0,g.c)(I,b),j=(0,i.A)("File",S,"medium"!==M&&`size-${M}`,x&&!k&&"interactive",F&&"file-is-selected");return(0,v.FD)("div",{id:t,ref:E,className:j,dir:R.isRtl?"rtl":void 0,children:[Y&&(0,v.Y)("div",{className:"message-select-control no-selection",children:F&&(0,v.Y)(f.A,{name:"check",className:"message-select-control-icon"})}),(0,v.FD)("div",{className:"file-icon-container",onClick:k?void 0:x,children:[V?(0,v.Y)(g.A,{className:"file-preview media-inner",media:I,attachment:b,size:z,observeIntersectionForLoading:D}):(0,v.Y)("div",{className:`file-icon ${K}`,children:y.length<=4&&(0,v.Y)("span",{className:"file-ext",dir:"auto",children:y})}),O&&(0,v.Y)("div",{className:(0,i.A)("file-progress",K,U),children:(0,v.Y)(m.A,{progress:P,size:"small"===M?"s":"m",onClick:k?x:void 0})}),x&&(0,v.Y)(f.A,{name:T||"download",className:(0,i.A)("action-icon",O&&"hidden")})]}),(0,v.FD)("div",{className:"file-info",children:[(0,v.Y)("div",{className:"file-title",dir:"auto",title:n,children:(0,d.A)(n)}),(0,v.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,v.Y)(p.A,{size:A,progress:N?P:void 0}),w&&(0,v.FD)(v.FK,{children:[(0,v.Y)("span",{className:"bullet",children:"•"}),(0,v.Y)("span",{className:"file-sender",children:(0,d.A)(w)})]}),!w&&Boolean(C)&&(0,v.FD)(v.FK,{children:[(0,v.Y)("span",{className:"bullet",children:"•"}),(0,v.Y)(h.A,{onClick:L,children:(0,s.fS)(B,1e3*C,!0)})]})]})]}),w&&Boolean(C)&&(0,v.Y)(h.A,{onClick:L,children:(0,s.be)(B,1e3*C)})]})})},72167(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(98021),s=n(76023),a=n(4961),r=n(87412),d=n(18276);var c=n(20021);const l=2.25*s.$,u=(0,o.ph)(({emoji:e,customEmojiId:t,shouldAnimate:n})=>{if(t)return(0,c.Y)(r.A,{documentId:t,size:l,shouldNotLoop:!n});if(!e)return(0,c.Y)(d.A,{name:"folder-tabs-folder"});const o=(0,i.FQ)(e);return o?(0,c.Y)(d.A,{name:o}):(0,c.Y)("div",{className:"pAEvaw7s",children:(0,a.A)(e)})})},51083(e,t,n){n.d(t,{A:()=>b});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(11597),d=n(96115),c=n(87357),l=n(76023),u=n(4961),h=n(39351),m=n(17712),p=n(41036),g=n(21849),f=n(80999),v=n(34431),A=n(18276),y=n(38102),C=n(10398),w=n(20021);const I=2.5*l.$,b=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,isSavedDialog:o})=>{const i=(0,r.hds)(e,t),s=i?(0,r.ToO)(e,i):void 0,a=Boolean(o?(0,r.zeq)(e,e.currentUserId):(0,r.zeq)(e,t)),c=n?(0,r.S0q)(e,t,n):void 0;return{chat:i,onlineCount:s,topic:c,areMessagesLoaded:a,messagesCount:c&&(0,d.Qb)(e,t,n),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,t)}})(({typingStatusByPeerId:e,className:t,statusIcon:n,avatarSize:d="medium",noAvatar:l,status:b,withDots:S,withMediaViewer:M,withUsername:N,withFullInfo:k,withUpdatingStatus:Y,withChatType:F,noRtl:P,chat:T,onlineCount:D,areMessagesLoaded:x,topic:L,messagesCount:B,noStatusOrTyping:R,withStory:E,storyViewerOrigin:O,noEmojiStatus:U,emojiStatusSize:K,isSavedDialog:z,self:V,withMonoforumStatus:j,monoforumChannel:G,onClick:J,onEmojiStatusClick:q})=>{const{loadFullChat:$,openMediaViewer:H,loadMoreProfilePhotos:W}=(0,i.ko)(),_=!j&&G?G:T,Q=(0,h.A)(),Z=_&&(0,a.Vs)(_),X=Boolean(_?.isForum&&L),{id:ee,isMin:te}=_||{},ne=(0,r._ls)((0,i.mS)(),ee);(0,o.vJ)(()=>{ee&&!te&&(k&&$({chatId:ee}),M&&W({peerId:ee,isPreload:!0}))},[ee,te,k,Z,M]);const oe=(0,m.A)((e,t)=>{_&&t&&(e.stopPropagation(),H({isAvatarView:!0,chatId:_.id,mediaIndex:0,origin:"jumbo"===d?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ie=(0,o.Kr)(()=>_&&N&&(0,a.Kl)(_),[_,N]);if(_)return(0,w.FD)("div",{className:(0,c.A)("ChatInfo",t),dir:!P&&Q.isRtl?"rtl":void 0,onClick:J,children:[!l&&!X&&(0,w.FD)(w.FK,{children:[z&&V&&(0,w.Y)(g.A,{size:d,peer:V,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,c.A)(z&&"overlay-avatar"),size:d,peer:_,withStory:E,asMessageBubble:Boolean(G),storyViewerOrigin:O,storyViewerMode:"single-peer",isSavedDialog:z,onClick:M?oe:void 0},_.id)]}),X&&(0,w.Y)(y.A,{topic:L,className:"topic-header-icon",size:I}),(0,w.FD)("div",{className:"info",children:[L?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,u.A)(L.title)}):(0,w.Y)(v.A,{peer:_,isMonoforum:!j&&Boolean(G),emojiStatusSize:K,withEmojiStatus:!U,isSavedDialog:z,onEmojiStatusClick:q}),!R&&function(){if(Y&&!x&&!ne)return(0,w.Y)(f.A,{className:"status",content:Q("Updating")});if(j)return(0,w.Y)("span",{className:"status",dir:"auto",children:Q("MonoforumStatus")});if(T?.isMonoforum)return;if(b)return S?(0,w.Y)(f.A,{className:"status",content:b}):(0,w.FD)("span",{className:"status",dir:"auto",children:[n&&(0,w.Y)(A.A,{className:"status-icon",name:n}),(0,u.A)(b)]});if(!_)return;if(e)return(0,w.Y)(C.A,{typingStatusByPeerId:e});if(X)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==B?1:2,className:"message-count-transition",children:void 0!==B?Q("Messages",{count:B},{pluralValue:B}):Q("ChatInfoNoMessages")})});if(F)return(0,w.Y)("span",{className:"status",dir:"auto",children:Q((0,a.yS)(_))});const t=(0,w.Y)("span",{className:"group-status",children:(0,a.sT)(Q,_)}),o=D?Q("OnlineCount",{count:D},{pluralValue:D}):void 0,i=o?(0,w.Y)("span",{className:"online-status",children:o}):void 0;return(0,w.FD)("span",{className:"status",children:[ie&&(0,w.Y)("span",{className:"handle withStatus",children:ie}),i?Q("GroupStatusWithOnline",{status:t,onlineCount:i},{withNodes:!0}):t]})}()]})]})}))},59324(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(97422),s=n(41036),a=n(18276);var r=n(20021);const d=(0,o.ph)(({iconName:e,isLoading:t})=>(0,r.Y)(s.Ay,{className:"LLqNvbR9",activeKey:t?0:1,name:"fade",children:t?(0,r.Y)(i.A,{className:"PbV71feg",color:"white"}):(0,r.Y)(a.A,{className:"sohV68PB",name:e})}))},81642(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(87357),s=n(58744),a=n(59030),r=n(45),d=n(20021);const c=(0,o.ph)(({className:e,message:t,outgoingStatus:n,draftDate:o})=>{const c=(0,a.A)(),l=o&&o>t.date;return(0,d.FD)("div",{className:(0,i.A)("LastMessageMeta",e),children:[n&&!l&&(0,d.Y)(r.A,{status:n}),(0,d.Y)("span",{className:"time",children:(0,s.be)(c,1e3*(l?o:t.date))})]})})},47058(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(87357),a=n(85982),r=n(43874),d=n(39351),c=n(17712),l=n(59030),u=n(64493),h=n(22699),m=n(24433);var p=n(20021);const g=(0,o.ph)(({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,d.A)(),y=(0,l.A)(),{showNotification:C,openChatWithDraft:w}=(0,i.ko)(),{isMobile:I}=(0,r.Ay)(),b=!v,S=(0,c.A)(()=>{(0,a.eM)(t),C({message:{key:"LinkCopied"}})}),M=(0,c.A)(()=>{n||S()}),N=(0,c.A)(()=>{w({text:{text:t}})}),k=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(u.A,{round:!0,ripple:!I,size:"smaller",color:"translucent",className:t?"active":"",iconName:"more",onClick:e,ariaLabel:A("AriaLabelOpenMenu")}),[I,A]);return(0,p.FD)("div",{className:g,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:y(e||"InviteLink.InviteLink")}),(0,p.FD)("div",{className:"xNjJHI7j",children:[(0,p.Y)("input",{className:(0,s.A)("form-control","Ag6k_p7b"),value:t,readOnly:!0,onClick:M}),b?(0,p.Y)(u.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,iconName:"copy",disabled:n,onClick:M}):(0,p.FD)(h.A,{className:"p7t3macG",trigger:k,positionX:"right",children:[(0,p.Y)(m.A,{icon:"copy",onClick:M,disabled:n,children:y("Copy")}),v&&(0,p.Y)(m.A,{icon:"delete",onClick:v,destructive:!0,children:y("RevokeButton")})]})]}),f&&(0,p.Y)(u.A,{disabled:n,onClick:N,className:"Sbagy_Tm",children:y("FolderLinkScreen.LinkActionShare")})]})})},81524(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(90709),s=n(96454),a=n(87357),r=n(58744),d=n(83868),c=n(35749),l=n(2338),u=n(37661),h=n(5912),m=n(17712),p=n(62587),g=n(83057),f=n(65843),v=n(27860),A=n(20021);const y=(0,o.ph)(({message:e,idPrefix:t="shared-media",isProtected:n,canAutoPlay:y,observeIntersection:C,onClick:w})=>{const I=(0,o.li)(),b=(0,h.Vz)(I,C),[S,M,N]=(0,u.A)(),k=(0,l.A)(e),Y=(0,c.A)(e,"pictogram"),F=(0,p.A)(Y,!b),P=(0,g.A)(F),T=(0,i.zX)(e),D=T?.isGif?(0,i.sC)(T,"full"):void 0,x=(0,p.A)(D,!b),L=(0,i.y2)(e),[B,,R]=(0,u.A)(L),E=(0,m.A)(()=>{R(),w(e.id,e.chatId)});return(0,A.FD)("div",{ref:I,id:`${t}${(0,i.GZ)(e.id)}`,className:"Media scroll-item",onClick:w?E:void 0,onMouseOver:s.TF?void 0:M,onMouseOut:s.TF?void 0:N,children:[(0,A.Y)("img",{src:k,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?d.A:void 0}),x?(0,A.Y)(f.A,{canPlay:b&&!L&&S&&Boolean(y),src:x,className:(0,a.A)("full-media","media-miniature",P),muted:!0,loop:!0,playsInline:!0,draggable:!1,disablePictureInPicture:!0,onContextMenu:n?d.A:void 0}):(0,A.Y)("img",{src:F,className:(0,a.A)("full-media","media-miniature",P),alt:"",draggable:!1,decoding:"async",onContextMenu:n?d.A:void 0}),L&&(0,A.Y)(v.A,{thumbDataUri:F||k,isVisible:B,className:"media-spoiler"}),T&&(0,A.Y)("span",{className:"video-duration",children:T.isGif?"GIF":(0,r.QO)(T.duration)}),n&&(0,A.Y)("span",{className:"protector"})]})})},45(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(41036),s=n(18276),a=n(20021),r=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(r||{});const d=(0,o.ph)(({status:e})=>(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(i.Ay,{name:"reveal",activeKey:r[e],children:"failed"===e?(0,a.Y)("div",{className:"MessageOutgoingStatus--failed",children:(0,a.Y)(s.A,{name:"message-failed"})}):(0,a.Y)(s.A,{name:`message-${e}`})})}))},42827(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(87357),s=n(44029),a=n(4961),r=n(59030),d=n(50680),c=n(64489),l=n(20021);const u=(0,o.ph)(({text:e="Nothing found.",description:t,withSticker:n})=>{const o=(0,r.A)(),{transitionClassNames:u}=(0,d.A)(!0);return(0,l.FD)("div",{className:(0,i.A)("NothingFound",u,t&&"with-description",n&&"with-sticker"),children:[n&&(0,l.Y)(c.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),e,t&&(0,l.Y)("p",{className:"description",children:(0,a.A)(o(t),["br"])})]})})},48227(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(48775),s=n(39351),a=n(19806),r=n(94189);var d=n(20021);const c=(0,o.ph)(({isOpen:e,onClose:t,userName:n,messagePriceInStars:o,messagesCount:c,shouldAutoApprove:l,setAutoApprove:u,confirmHandler:h})=>{const m=(0,s.A)(),p=m("ConfirmationModalPaymentForMessage",{user:n,amount:(0,i.Kk)(m,o),totalAmount:(0,i.Kk)(m,o*c),count:c},{withMarkdown:!0,withNodes:!0,pluralValue:c}),g=m("PayForMessage",{count:c},{withNodes:!0,pluralValue:c});return(0,d.FD)(r.A,{title:m("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:h,children:[p,(0,d.Y)(a.A,{className:"eScpikxM",label:m("DoNotAskAgain"),checked:l,onCheck:u})]})})},58920(e,t,n){n.d(t,{A:()=>k});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(11597),d=n(96115),c=n(87357),l=n(76023),u=n(4961),h=n(54699),m=n(39351),p=n(17712),g=n(59030),f=n(42452),v=n(41036),A=n(21849),y=n(80999),C=n(34431),w=n(18276),I=n(85223),b=n(38102),S=n(10398),M=n(20021);const N=2.5*l.$,k=(0,o.ph)((0,i.EK)((e,{userId:t,threadId:n,forceShowSelf:o,isSavedDialog:i})=>{const{isSynced:s}=e,a=t?(0,r.mBe)(e,t):void 0,c=t?(0,r.K0y)(e,t):void 0,l=!o&&a&&a.isSelf,u=l?a:(0,r.mBe)(e,e.currentUserId),h=Boolean(i?(0,r.zeq)(e,e.currentUserId):(0,r.zeq)(e,t)),m=n?(0,r.S0q)(e,t,n):void 0;return{user:a,userStatus:c,isSavedMessages:l,areMessagesLoaded:h,self:u,isSynced:s,topic:m,messagesCount:m&&t?(0,d.Qb)(e,t,n):void 0}})(({userId:e,customPeer:t,typingStatusByPeerId:n,avatarSize:r="medium",status:d,statusIcon:l,withDots:k,withMediaViewer:Y,withUsername:F,withStory:P,withFullInfo:T,withUpdatingStatus:D,emojiStatusSize:x,noStatusOrTyping:L,noEmojiStatus:B,noFake:R,noVerified:E,noRtl:O,user:U,userStatus:K,self:z,topic:V,messagesCount:j,isSavedMessages:G,isSavedDialog:J,areMessagesLoaded:q,chatMember:$,chatMemberOriginId:H,ripple:W,className:_,storyViewerOrigin:Q,noAvatar:Z,isSynced:X,iconElement:ee,rightElement:te,onClick:ne,onEmojiStatusClick:oe})=>{const{loadFullUser:ie,openMediaViewer:se,loadMoreProfilePhotos:ae}=(0,i.ko)(),re=(0,g.A)(),de=(0,m.A)(),ce=Boolean(U?.isBotForum&&V),le=Y&&!G;(0,o.vJ)(()=>{e&&(T&&X&&ie({userId:e}),Y&&ae({peerId:e,isPreload:!0}))},[e,T,Y,X]),(0,h.A)(6e4);const ue=(0,p.A)((t,n)=>{n&&(t.stopPropagation(),se({isAvatarView:!0,chatId:e,mediaIndex:0,origin:"jumbo"===r?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),he=(0,o.Kr)(()=>U&&F&&(0,a.Kl)(U),[U,F]);var me;if(U||t)return(0,M.FD)("div",{className:(0,c.A)("ChatInfo",_),dir:!O&&de.isRtl?"rtl":void 0,onClick:ne,children:[J&&z&&(0,M.Y)(A.A,{size:r,peer:z,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),!Z&&!ce&&(0,M.Y)(A.A,{size:r,peer:t||U,className:(0,c.A)(J&&"overlay-avatar"),isSavedMessages:G,isSavedDialog:J,withStory:P,storyViewerOrigin:Q,storyViewerMode:"single-peer",onClick:le?ue:void 0},U?.id),ce&&(0,M.Y)(b.A,{topic:V,className:"topic-header-icon",size:N}),(0,M.FD)("div",{className:"info",children:[ce?(0,M.Y)("h3",{dir:"auto",className:"fullName",children:(0,u.A)(V.title)}):$&&(me=$,Boolean(me&&(me.rank||me.isOwner||me.isAdmin)))?(0,M.FD)("div",{className:"info-name-title",children:[(0,M.Y)(C.A,{peer:t||U,noFake:R,noVerified:E,withEmojiStatus:!B,emojiStatusSize:x,isSavedMessages:G,isSavedDialog:J,iconElement:ee,onEmojiStatusClick:oe}),(0,M.Y)(I.A,{chatId:H,userId:$.userId,isAdmin:$.isAdmin,isOwner:$.isOwner,rank:$.rank})]}):(0,M.Y)(C.A,{peer:t||U,noFake:R,noVerified:E,withEmojiStatus:!B,emojiStatusSize:x,isSavedMessages:G,isSavedDialog:J,onEmojiStatusClick:oe,iconElement:ee}),(d||!G&&!L)&&function(){if(d)return k?(0,M.Y)(y.A,{className:"status",content:d}):(0,M.FD)("span",{className:"status",dir:"auto",children:[l&&(0,M.Y)(w.A,{className:"status-icon",name:l}),(0,u.A)(d)]});if(D&&!q)return(0,M.Y)(y.A,{className:"status",content:de("Updating")});if(t?.subtitleKey)return(0,M.Y)("span",{className:"status",dir:"auto",children:(0,M.Y)("span",{className:"user-status",dir:"auto",children:re(t.subtitleKey)})});if(!U)return;if(n)return(0,M.Y)(S.A,{typingStatusByPeerId:n,isPrivate:!0});if(ce)return(0,M.Y)("span",{className:"status",dir:"auto",children:(0,M.Y)(v.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==j?1:2,className:"message-count-transition",children:void 0!==j?j>0?de("Messages",{count:j},{pluralValue:j}):de("ChatInfoNoMessages"):de("ChatInfoForumTopic")})});if((0,a.DX)(U.id))return;const e=(0,a.CD)(re,U,K),o=(0,c.A)("handle",e&&"withStatus");return(0,M.FD)("span",{className:(0,c.A)("status",(0,a.PF)(U,K,!0)&&"online"),children:[he&&(0,M.Y)("span",{className:o,children:he}),e&&(0,M.Y)("span",{className:"user-status",dir:"auto",children:e})]})}()]}),W&&(0,M.Y)(f.A,{}),te]})}))},85223(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(87357),a=n(39351),r=n(17712),d=n(39996),c=n(81949),l=n(20021);const u=(0,o.ph)(({chatId:e,className:t,userId:n,isAdmin:o,isOwner:u,rank:h,isClickable:m})=>{const{openRankModal:p}=(0,i.ko)(),g=(0,a.A)(),f=u||o,v=!f,A=h||u&&g("ChannelCreator")||o&&g("ChannelAdmin"),y=(0,r.A)(()=>{e&&p({chatId:e,userId:n,isAdmin:o,isOwner:u,rank:h})});if(A)return(0,l.Y)(c.A,{className:(0,s.A)(f&&(0,d.yp)(u?2:3),v&&"admin-title-plain",t),isPlain:v,inline:!0,onClick:m?y:void 0,children:A})})},14413(e,t,n){n.d(t,{A:()=>l});var o=n(84051),i=n(13439),s=n(31481),a=n(39351),r=n(19806),d=n(94189);var c=n(20021);const l=(0,o.ph)((0,i.EK)(e=>({verifyAgeMin:e.appConfig.verifyAgeMin||s.lYi}))(({isOpen:e,onClose:t,shouldAlwaysShow:n,onAlwaysShowChanged:o,confirmHandler:i,verifyAgeMin:s})=>{const l=(0,a.A)();return(0,c.FD)(d.A,{title:l("TitleSensitiveModal",{years:s}),confirmLabel:l("ButtonSensitiveView"),isOpen:e,onClose:t,confirmHandler:i,children:[l("TextSensitiveModal"),(0,c.Y)(r.A,{className:"mYXi2mIC",label:l("ButtonSensitiveAlways",{years:s}),checked:n,onCheck:o})]})}))},38102(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(87412),s=n(76471),a=n(20021);const r=(0,o.ph)(({topic:e,className:t,letterClassName:n,size:o,noLoopLimit:r,observeIntersection:d,onClick:c})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(i.A,{documentId:e.iconEmojiId,className:t,size:o,observeIntersectionForPlaying:d,loopLimit:r?void 0:2,onClick:c}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:c}))},10398(e,t,n){n.d(t,{A:()=>A});var o=n(84051),i=n(70636),s=n(11597),a=n(87357),r=n(44029),d=n(76023),c=n(63527),l=n(39351),u=n(64489);var h=n(20021);const m=1.125*d.$,p=1.25*d.$;function g(){return(0,h.Y)(u.A,{className:"PgPXTILu",tgsUrl:r.w.Eyes,size:p,play:!0,noLoop:!1,shouldUseTextColor:!0})}function f(e,t,n){return(t?(0,i.F9)(e,t):void 0)||n}function v(e,t){return e.name.localeCompare(t.name)||e.peerId.localeCompare(t.peerId)}const A=(0,o.ph)(({typingStatusByPeerId:e,isPrivate:t})=>{const n=(0,l.A)(),i=n("ActionFallbackUser"),d=(0,o.Kr)(()=>Object.keys(e),[e]),p=(0,o.Kr)(()=>Object.entries(e).sort(([,e],[,t])=>t.timestamp-e.timestamp),[e]),A=p[0],y=A?.[0],C=A?.[1],w=d.length>=2,I=(0,o.hb)(e=>d.map(t=>(0,s.PVB)(e,t)),[d]),b=(0,c.LV)(I),S=y?d.indexOf(y):-1,M=S>=0?b[S]:void 0,N=f(n,M,i),k=(0,o.Kr)(()=>d.map((e,t)=>({peerId:e,name:f(n,b[t],i)})).sort(v).map(({name:e})=>e),[i,b,d,n]);if(!C)return;const Y=N;let F;F=w?2===p.length?n("UserTypingSeveral",{users:n.conjunction([k[0]||i,k[1]||i])},{withNodes:!0}):n("UserTypingMany",{user:k[0]||i,count:n.number(p.length-1)},{withNodes:!0,pluralValue:p.length-1}):t?function(e,t){switch(t.type){case"recordVideo":return e("SendActionRecordVideo");case"uploadVideo":return e("SendActionUploadVideo");case"recordAudio":return e("SendActionRecordAudio");case"uploadAudio":return e("SendActionUploadAudio");case"uploadPhoto":return e("SendActionUploadPhoto");case"uploadFile":return e("SendActionUploadFile");case"playingGame":return e("PlayingGame");case"recordRound":return e("SendActionRecordRound");case"uploadRound":return e("SendActionUploadRound");case"chooseSticker":return e("SendActionChooseSticker",{eyes:g()},{withNodes:!0});case"watchingAnimations":return e("ActionWatchingAnimations",{emoji:t.emoji});default:return e("Typing")}}(n,C):function(e,t,n){switch(t.type){case"recordVideo":return e("UserActionRecordVideo",{user:n},{withNodes:!0});case"uploadVideo":return e("UserActionUploadVideo",{user:n},{withNodes:!0});case"recordAudio":return e("UserActionRecordAudio",{user:n},{withNodes:!0});case"uploadAudio":return e("UserActionUploadAudio",{user:n},{withNodes:!0});case"uploadPhoto":return e("UserActionUploadPhoto",{user:n},{withNodes:!0});case"uploadFile":return e("UserActionUploadFile",{user:n},{withNodes:!0});case"playingGame":return e("UserPlayingGame",{user:n},{withNodes:!0});case"recordRound":return e("UserActionRecordRound",{user:n},{withNodes:!0});case"uploadRound":return e("UserActionUploadRound",{user:n},{withNodes:!0});case"chooseSticker":return e("UserActionChooseSticker",{user:n,eyes:g()},{withNodes:!0});default:return e("UserTyping",{user:n},{withNodes:!0})}}(n,C,Y);const P=w||"typing"===(T=C).type||"chooseLocation"===T.type||"chooseContact"===T.type;var T;return(0,h.FD)("span",{className:(0,a.A)("c5gR1CMp","typing-status"),dir:n.isRtl?"rtl":"auto",children:[P&&(0,h.Y)(u.A,{className:"ZpTqvFi7",tgsUrl:r.w.Typing,size:m,play:!0,noLoop:!1,shouldUseTextColor:!0}),(0,h.Y)("span",{className:"UG2b8Y_c",dir:"auto",children:F})]})})},37378(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(87357),d=n(58744),c=n(58849),l=n(49086),u=n(4961),h=n(39351),m=n(17712),p=n(59030),g=n(96530),f=n(81524),v=n(84685),A=n(20021);const y=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,a.Pn$)(e,t)}))(({message:e,webPage:t,senderTitle:n,isProtected:i,observeIntersection:a,onMessageClick:y})=>{const C=(0,h.A)(),w=(0,p.A)(),I=(0,m.A)(()=>{y(e)});let b=t;if(!b){const t=(0,s.ZD)(e);if(t){const{url:n,domain:o}=t;b={mediaType:"webpage",webpageType:"full",id:"",displayUrl:n,siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.BN)(C,e)?.text!==n?(0,l.C)(C,e,void 0,void 0,170):void 0}}}const S="full"===b?.webpageType?b:void 0,{url:M}=b||{},N=(0,o.Kr)(()=>(0,s.BN)(C,e)?.text!==M?(0,l.C)(C,e,void 0,void 0,170):void 0,[C,e,M]),{siteName:k,displayUrl:Y,title:F,description:P,formattedDescription:T=N,photo:D,video:x}=S||{},L=(0,o.Kr)(()=>{const e=F||k||Y;if(e)return e;if(!M)return"";try{return new URL(M).hostname}catch(e){return""}},[F,k,Y,M]);if(!M)return;const B=!n&&P&&(0,c.A)(P,170),R=(0,r.A)("WebLink scroll-item",!D&&!x&&"without-media"),E=Y||M.replace("mailto:","");return(0,A.FD)("div",{className:R,"data-initial":L[0],dir:C.isRtl?"rtl":void 0,children:[D&&(0,A.Y)(f.A,{message:e,isProtected:i,observeIntersection:a}),(0,A.FD)("div",{className:"content",children:[(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-title",onClick:I,children:(0,u.A)(L)}),(B||T)&&(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-description",onClick:I,children:T||B&&(0,u.A)(B)}),(0,A.Y)(v.A,{url:M,className:"site-name",text:E,isRtl:C.isRtl}),n&&(0,A.Y)("div",{className:"sender-name",children:(0,u.A)(n)})]}),n&&(0,A.Y)("div",{className:"message-date",children:(0,A.Y)(g.A,{className:"date",onClick:I,isRtl:C.isRtl,children:(0,d.be)(w,1e3*e.date)})})]})}))},91930(e,t,n){n.d(t,{A:()=>S});var o=n(84051),i=n(31481),s=n(90709),a=n(3544),r=n(70636),d=n(87357),c=n(58744),l=n(48899),u=n(48775),h=n(4961),m=n(69282),p=n(39351),g=n(59030),f=n(64154),v=n(42452),A=n(5505),y=n(18276),C=n(18653),w=n(86070),I=n(20021);const b=" ",S=({className:e,message:t,replyInfo:n,suggestedPostInfo:S,sender:M,senderChat:N,forwardSender:k,composerForwardSenders:Y,title:F,customText:P,isProtected:T,isInComposer:D,noUserColors:x,chatTranslations:L,requestedChatTranslationLanguage:B,requestedChatTranslationTone:R,isMediaNsfw:E,noCaptions:O,pictogramActionIcon:U,observeIntersectionForLoading:K,observeIntersectionForPlaying:z,onClick:V,onPictogramClick:j})=>{const G=(0,o.Kr)(()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}},[t,n]),J=(0,A.c)(G?.content),q=Boolean(G&&(0,s.lk)(G)),$=Boolean(G&&(0,s.y2)(G))||E,H=Boolean("message"===n?.type&&n.isQuote),W="message"===n?.type?n.replyFrom:void 0,_=t&&(0,s.ZR)(t),{translatedText:Q}=(0,f.A)(L,t?.chatId,_?t?.id:void 0,B,R),Z=(0,g.A)(),X=(0,p.A)(),ee=M?(0,r.F9)(Z,M):W?.hiddenUserName||t?.forwardInfo?.hiddenUserName,te=(0,o.Kr)(()=>{if(!Y)return;const e=Y.map(e=>(0,r.F9)(X,e)).filter(Boolean);return X.conjunction(e)},[Y,X]),ne=N?(0,r.F9)(Z,N):void 0,oe=k?(0,r.F9)(Z,k):t?.forwardInfo?.hiddenUserName,ie=M&&M.id===k?.id;return(0,I.FD)(w.A,{peer:M,emojiIconClassName:"EmbeddedMessage--background-icons",shouldReset:!0,isReply:Boolean(n),noUserColors:x,className:(0,d.A)("EmbeddedMessage",e,H&&"is-quote",J&&"with-thumb","no-selection",Y&&"is-input-forward",S&&"is-suggested-post"),dir:X.isRtl?"rtl":void 0,onClick:V,children:[(0,I.Y)("div",{className:"hover-effect"}),(0,I.Y)(v.A,{}),J&&(0,I.Y)(A.A,{media:G?.content,className:"embedded-thumb",isPictogram:!0,isRound:q,isProtected:T,isSpoiler:$,actionIcon:U,observeIntersectionForLoading:K,observeIntersectionForPlaying:z,onClick:j}),(0,I.FD)("div",{className:"message-text",children:[(0,I.Y)("p",{className:(0,d.A)("embedded-text-wrapper",H&&"multiline"),children:function(){if(S){if(!S?.price?.amount&&!S.scheduleDate)return X("ComposerEmbeddedMessageSuggestedPostDescription");const e=S.price?S.price.currency===i.ykW?(0,u.Ms)(X,S.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,u.U2)(X,S.price.amount,{className:"suggested-price-star-icon"}):"",t=S.scheduleDate?(0,c.e0)(S.scheduleDate,X,Z):"";return e&&!t?(0,I.Y)("span",{className:"suggested-post-price-wrapper",children:X("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,I.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` • ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,m.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?O?X("EmbeddedMessageNoCaption"):(0,I.Y)(C.A,{message:t,noEmoji:J,forcedText:Q,observeIntersectionForLoading:K,observeIntersectionForPlaying:z,emojiSize:17}):P||function(e){if(!e||e.content.text)return b;const t=(0,a.GG)(X,e.content,{});return t?(0,I.Y)("span",{children:(0,h.A)(t)}):b}(G)||b}()}),(0,I.FD)("div",{className:"message-title",children:[function(){if(F)return(0,h.A)(F);if(S&&n)return X("TitleSuggestedChanges");if(S)return X("ComposerEmbeddedMessageSuggestedPostTitle");if(!ee&&!te)return b;let e;N&&((0,s.WX)(N)&&(e="channel-filled"),(0,s.YE)(N)&&(e="group-filled"));const t=D&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,I.FD)("span",{className:"embedded-sender-wrapper",children:[(!N||!!(0,l.L8)(N?.id)||N.id!==M?.id)&&(0,I.FD)("span",{className:"embedded-sender",children:[!Y&&ee&&(0,h.A)(t?Z("ReplyToQuote",ee):ee),te&&(0,h.A)(X("ComposerTitleForwardFrom",{users:te},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,I.Y)(y.A,{name:e,className:"embedded-chat-icon"}),e&&ne&&(0,I.Y)("span",{className:"embedded-sender-chat",children:(0,h.A)(ne)})]})}(),oe&&!ie&&(0,I.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,I.Y)(y.A,{name:k?"share-filled":"forward",className:"embedded-origin-icon"}),(0,I.Y)("span",{className:"forward-sender-title",children:(0,h.A)(oe)})]})]})]})]})}},55317(e,t,n){function o(e,t){const{level:n,boosts:o,currentLevelBoosts:i,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,d=t&&o===i&&a;return{currentLevel:d?n-1:n,hasNextLevel:Boolean(s),boosts:o,levelProgress:!s||d?1:(o-i)/(s-i),remainingBoosts:s?s-o:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>o})},24899(e,t,n){n.d(t,{A:()=>i});var o=n(31481);function i(e,t){return t?`${o.jsp}${e}`:`@${e}`}},25301(e,t,n){n.d(t,{A:()=>de});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(27109),l=n(70636),u=n(11597),h=n(93005),m=n(87357),p=n(85982),g=n(64713),f=n(83868),v=n(59852),A=n(37959),y=n(24899),C=n(4961),w=n(69282),I=n(68323),b=n(41385),S=n(57675),M=n(82117),N=n(39351),k=n(17712),Y=n(59030),F=n(79462),P=n(55810),T=n(19210),D=n(64493),x=n(22720),L=n(85637),B=n(87412),R=n(18276),E=n(84685),O=n(96454),U=n(58744);const K=1440,z=10080;function V(){const e=new Date;e.setHours(0,0,0,0);const t=e.getDay(),n=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(n)).getTime()}function j(e,t){if(0===t)return e;const n=[];for(const o of e){let e=(o.startMinute+t)%z,i=(o.endMinute+t)%z;e<0&&(e+=z),i<=0&&(i+=z),e>i?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:i})):n.push({startMinute:e,endMinute:i})}return n.sort((e,t)=>e.startMinute-t.startMinute),n.reduce((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e},[])}var G=n(63527),J=n(32625),q=n(19129),$=n(37661),H=n(30857);var W=n(20021);const _=Array.from({length:7},(e,t)=>t),Q=(0,o.ph)(({businessHours:e,className:t})=>{const[n,i,s]=(0,$.A)(!1),[a,r,d]=(0,$.A)(!1),c=(0,Y.A)(),l=(0,H.A)(),{startViewTransition:p}=(0,I.Y)(),{createVtnStyle:g}=(0,b.k)();(0,J.A)(l,6e4);const f=(0,G.BI)(u.z8w),v=(0,q.A)(f,[f]),A=(0,o.Kr)(()=>{if(!v)return 0;const t=v[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60},[e.timezoneId,v]),y=(0,o.Kr)(()=>{const t=V(),n=function(e){const t={};for(const n of e){const e=n.startMinute,o=n.endMinute,i=Math.floor(e/K),s=Math.floor((o-1)/K);for(let n=i;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*K),endMinute:Math.min(K,o-n*K)})}return t}(j(e.workHours,a?A:0)),o={};return _.forEach(e=>{const i=n[e];o[e]=i?i.map(({startMinute:e,endMinute:n})=>n-e===1440?c("BusinessHoursDayFullOpened"):`${(0,U.fU)(c,t+60*e*1e3)} – ${(0,U.fU)(c,t+60*n*1e3)}`):[c("BusinessHoursDayClosed")]}),o},[e.workHours,a,c,A]),C=(0,o.Kr)(()=>{const t=j(e.workHours,A),n=V(),o=((new Date).getTime()-n)/1e3/60;return t.some(({startMinute:e,endMinute:t})=>e<=o&&o<=t)},[e.workHours,A]),w=(0,o.Kr)(()=>(new Date(Date.now()-(a?0:60*A*1e3)).getDay()+6)%7,[a,A]),S=(0,k.A)(()=>{n?p(h.w7,()=>{s()}):p(h.rG,()=>{i()})}),M=(0,k.A)(e=>{e.stopPropagation(),p(h.QG,()=>{a?d():r()})});return(0,W.FD)(x.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:(0,m.A)("Ef_0p5Qm",t),style:g("businessHours",!0),isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:S,children:[(0,W.FD)("div",{className:"nHSmCUNs",children:[(0,W.FD)("div",{className:"JTZ8UnnP",children:[(0,W.Y)("div",{children:c("BusinessHoursProfile")}),(0,W.Y)("div",{className:(0,m.A)("JVL7ZnnJ",C&&"segAfYXs"),children:c(C?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,W.Y)(R.A,{className:"dYxw2cFn",style:g("expandArrow",!0),name:n?"up":"down"})]}),n&&(0,W.FD)("div",{className:"lp9VIV1o",children:[Boolean(A)&&(0,W.Y)("div",{className:"gVwflFhz",style:g("offsetTrigger"),role:"button",tabIndex:0,onMouseDown:O.TF?void 0:M,onClick:O.TF?M:void 0,children:c(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,W.Y)("dl",{className:"MPBKHdZL",children:_.map(e=>(0,W.FD)(W.FK,{children:[(0,W.Y)("dt",{className:(0,m.A)("cmxPqAof",e===w&&"YZVvP_56"),children:(0,U.wv)(c,6===e?0:e+1)}),(0,W.Y)("dd",{className:"Rs0VPgpq",children:y[e].map(e=>(0,W.Y)("div",{children:e}))})]}))})]})]})});var Z=n(66644),X=n(87894),ee=n(58554),te=n(14737),ne=n(82855);const oe=["🎉","🎆","🎈"],ie=(0,o.ph)((0,i.EK)(e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,u.n_C)(e)}})(({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:r,isInSettings:c})=>{const{openGiftModal:l,requestConfetti:u}=(0,i.ko)(),h=(0,o.li)(),p=(0,o.li)(!1),[g,f,v]=(0,$.A)(),A=(0,N.A)(),{formattedDate:y,isToday:w,age:I}=(0,o.Kr)(()=>{const e=new Date,n=new Date(t.year||2024,t.month-1,t.day);return{formattedDate:(0,U.A)(n,A.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&se(n)}},[t,A]),b=(0,o.Kr)(()=>{if(!I||!w)return;const e=a?.stickers?.filter(({emoji:e})=>e?.endsWith("️⃣"));if(!e)return;const t=(0,X.dU)(e,"emoji");return I.toString().split("").map(e=>t[e+"️⃣"])},[I,a?.stickers,w]),S=(0,o.Kr)(()=>{if(!w)return;const e=oe[Math.floor(Math.random()*oe.length)];return r?.stickers?.find(({emoji:t})=>t===e)},[r?.stickers,w]);(0,o.vJ)(()=>{if(w&&b&&(b.forEach(e=>{const t=(0,d.Mw)(e,"preview");ee.hd(t,s.qZ.BlobUrl)}),S)){const e=(0,d.Mw)(S,"preview");ee.hd(e,s.qZ.BlobUrl)}},[S,w,b]),(0,te.A)(v,g?3e3:void 0),(0,o.vJ)(()=>{if(g){p.current=!0;const e=document.getElementById(c?"LeftColumn":"RightColumn");if(!e)return;(0,Z.YS)(()=>{const{top:t,left:n,width:o,height:i}=e.getBoundingClientRect();u({top:t,left:n,width:o,height:i,style:"top-down"})})}},[c,g]);const M=(0,o.Kr)(()=>I?A(`ProfileBirthday${w?"Today":""}ValueAge`,{date:y,age:I},{pluralValue:I}):A(`ProfileBirthday${w?"Today":""}Value`,{date:y}),[I,y,w,A]),Y=w&&!e.isPremium&&!e.isSelf&&!n,F=(0,k.A)(()=>{l({forUserId:e.id})}),P=(0,k.A)(()=>{w&&(Y&&p.current?F():f())}),T=!w&&!Y;return(0,W.FD)("div",{className:"wCp6TBYF",children:[(0,W.FD)(x.A,{icon:"calendar",secondaryIcon:Y?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:h,ripple:!T,onClick:P,isStatic:T,onSecondaryIconClick:F,children:[(0,W.Y)("div",{className:"title",dir:A.isRtl?"rtl":void 0,children:(0,C.A)(M)}),(0,W.Y)("span",{className:"subtitle",children:A(w?"ProfileBirthdayToday":"ProfileBirthday")})]}),g&&O.ol&&b?.map((e,t)=>(0,W.Y)("div",{className:(0,m.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,W.Y)(ne.A,{containerRef:h,sticker:e,size:128,forceAlways:!0})})),g&&S&&(0,W.Y)("div",{className:"cFEXGUih",children:(0,W.Y)(ne.A,{containerRef:h,sticker:S,size:288,shouldLoop:!0,forceAlways:!0})})]})}));function se(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const o=t.getMonth()-e.getMonth();return(o<0||0===o&&t.getDate(){const{countryList:{phoneCodes:o}}=e,i=t?(0,u.hds)(e,t):void 0,s=t?(0,u.mBe)(e,t):void 0,a=t?(0,u.XOs)(e,t):void 0,r=i?.isForum,l=i&&(0,c.If)(i,(0,u.K52)(e),(0,u.P5N)(e,i.id)),{threadId:h}=(0,u.Xf0)(e)||{},m=r&&h?Number(h):void 0,p=i&&(0,u.AWZ)(e,i.id),g=s&&(0,u.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=i&&(0,d.WX)(i)&&(0,d.SJ)(i),C=i&&!s&&(!(0,d.WX)(i)&&!(0,d.Sq)(i,"inviteUsers")||(0,d.ub)(i,"inviteUsers")),w=m?(0,u.sZk)(e,t,m):void 0,I=!n&&e.chats.listIds.saved?.includes(t),b=g?.personalChannelId?(0,u.hds)(e,g.personalChannelId):void 0,S=s?.hasMainMiniApp;return{phoneCodeList:o,chat:i,user:s,userFullInfo:g,canInviteUsers:C,botAppPermissions:a,isMuted:l,topicId:m,chatInviteLink:v,description:A,topicLink:w,hasSavedMessages:I,personalChannel:b,hasMainMiniApp:S,isBotCanManageEmojiStatus:g?.isBotCanManageEmojiStatus,botVerification:f,canViewSubscribers:y}})(({chatOrUserId:e,user:t,chat:n,userFullInfo:c,isOwnProfile:O,canInviteUsers:U,isMuted:K,phoneCodeList:z,topicId:V,description:j,chatInviteLink:G,topicLink:J,hasSavedMessages:q,personalChannel:$,hasMainMiniApp:H,isBotCanManageEmojiStatus:_,botAppPermissions:Z,botVerification:X,className:ee,style:te,isInSettings:ne,withIslands:oe,canViewSubscribers:se})=>{const{showNotification:de,updateChatMutedState:ce,updateTopicMutedState:le,loadPeerStories:ue,openSavedDialog:he,openMapModal:me,requestCollectibleInfo:pe,requestMainWebView:ge,toggleUserEmojiStatusPermission:fe,toggleUserLocationPermission:ve,requestNextManagementScreen:Ae}=(0,i.ko)(),{id:ye,usernames:Ce,phoneNumber:we,isSelf:Ie}=t||{},{id:be,usernames:Se}=n||{},Me=ye||be,{businessLocation:Ne,businessWorkHours:ke,personalChannelMessageId:Ye,birthday:Fe,note:Pe}=c||{},Te=(0,Y.A)(),De=(0,N.A)(),{startViewTransition:xe}=(0,I.Y)(),{createVtnStyle:Le}=(0,b.k)(),Be=(0,o.li)(),Re=Boolean(Pe),{isCollapsed:Ee,isCollapsible:Oe,setIsCollapsed:Ue}=(0,S.A)(Be,3,void 0,!Re);(0,M.A)(([e])=>{Me&&e!==Me&&(t||n&&(0,d.WX)(n))&&ue({peerId:Me})},[Me,n,t]);const{width:Ke,height:ze,zoom:Ve}=re,je=(0,o.Kr)(()=>{if(Ne?.geo)return(0,W.Y)(L.A,{className:"UZbkeFDB",geo:Ne.geo,width:Ke,height:ze,zoom:Ve})},[Ne,Ke,ze,Ve]),Ge=Boolean(V&&V!==s.l3),Je=n&&(0,d.WX)(n)||t?.isPremium,qe=(0,o.Kr)(()=>{const e=Ce?.filter(e=>e.isActive);return e?.length?e:void 0},[Ce]),$e=(0,o.Kr)(()=>{const e=t?void 0:Se?.filter(e=>e.isActive);return e?.length?e:void 0},[Se,t]),He=(0,o.Kr)(()=>{if(n)return Ge?J:(0,d.L7)(n)||G},[n,Ge,J,G]),We=(0,k.A)(()=>{const{address:e,geo:t}=Ne;if(!t)return(0,p.eM)(e),void de({message:Te("BusinessLocationCopied")});me({geoPoint:t,zoom:Ve})}),_e=(0,k.A)(()=>{const e=K?r.Os5:r.xEh;Ge?le({chatId:be,topicId:V,mutedUntil:e}):ce({chatId:be,mutedUntil:e})}),Qe=(0,k.A)(()=>{t&&fe({botId:t.id,isEnabled:!_})}),Ze=(0,k.A)(()=>{t&&ve({botId:t.id,isAccessGranted:!Z?.geolocation})}),Xe=(0,k.A)(()=>{he({chatId:e})}),et=Oe&&Ee,tt=(0,k.A)(()=>{xe(h.Xz,()=>{Ue(!1)})}),nt=(0,k.A)(()=>{const e=Ee;xe(e?h.Xz:h.S$,()=>{Ue(()=>!e)})});function ot(e,t){(0,p.eM)(e),de({message:`${t} was copied`})}const it=we&&(0,g.Ox)(z,we),st=(0,k.A)(()=>{we?.length===r.PGI&&we.startsWith(r._Bb)?pe({collectible:we,peerId:Me,type:"phone"}):ot(it,Te("Phone"))}),at=(0,k.A)((e,t)=>{e.isEditable?ot((0,y.A)(e.username,t),Te(t?"Link":"Username")):pe({collectible:e.username,peerId:Me,type:"username"})}),rt=(0,k.A)(()=>{Ae({screen:a.je.ChannelSubscribers})}),dt=(0,k.A)(()=>{const e=t?.id;if(!e)return;const n=(0,v.A)();ge({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})}),ct=De("ProfileOpenAppAbout",{terms:(0,W.Y)(E.A,{text:De("ProfileOpenAppTerms"),url:De("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if(be&&(0,u._ls)((0,i.mS)(),be)||Ie&&!O&&!ne)return;function lt(e,t){const[n,...o]=e,i=o.length?Te("UsernameAlso","%USERNAMES%").split("%").map(e=>"USERNAMES"===e?(0,W.Y)(W.FK,{children:o.map((e,n)=>(0,W.FD)(W.FK,{children:[n>0?", ":"",(0,W.Y)("a",{href:(0,y.A)(e.username,!0),onMouseDown:f.A,onClick:n=>{(0,f.A)(n),at(e,t)},className:"text-entity-link username-link",children:(0,y.A)(e.username)},e.username)]}))}):e):void 0;return(0,W.FD)(x.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{at(n,t)},children:[(0,W.Y)("span",{className:"title",dir:De.isRtl?"rtl":void 0,children:(0,y.A)(n.username,t)}),(0,W.FD)("span",{className:"subtitle",children:[i&&(0,W.Y)("span",{className:"other-usernames",children:i}),Te(t?"Link":"Username")]})]})}const ut=oe?F.Ay:"div";return(0,W.FD)("div",{className:(0,m.A)("ChatExtra",ee),style:te||Le("chatExtra"),children:[t&&c?.isUnofficialSecurityRisk&&(0,W.Y)(ut,{className:oe?"Y3L5CYCA":void 0,children:(0,W.FD)("div",{className:"_7GIPeo8",children:[(0,W.Y)(R.A,{className:(0,m.A)("ygqV9SKu","in-text-icon"),name:"info-filled"}),De("UnofficialSecurityRisk",{peer:(0,l.F9)(De,t)})]})}),$&&(0,W.FD)("div",{className:"HP5EJx7s",style:Le("personalChannel"),children:[(0,W.Y)("h3",{className:"cHyTGri2",children:Te("ProfileChannel")}),(0,W.Y)("span",{className:"kYd2GrmU",children:Te("Subscribers",$.membersCount,"i")}),(0,W.Y)(ut,{className:"qOJwhXMC",children:(0,W.Y)(T.A,{chatId:$.id,orderDiff:0,shiftDiff:0,animationType:A.IP.None,isPreview:!0,previewMessageId:Ye})})]}),(0,W.FD)(ut,{children:[Boolean(it?.length)&&(0,W.FD)(x.A,{icon:"phone",className:"Kz3Kt7V9",multiline:!0,narrow:!0,ripple:!0,onClick:st,style:Le("phone"),children:[(0,W.Y)("span",{className:"title",dir:De.isRtl?"rtl":void 0,children:it}),(0,W.Y)("span",{className:"subtitle",children:Te("Phone")})]}),qe&<(qe),j&&Boolean(j.length)&&(0,W.FD)(x.A,{icon:"info",className:"sfYp5akl",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,style:Le("description"),children:[(0,W.Y)("span",{className:"title word-break allow-selection",dir:De.isRtl?"rtl":void 0,children:(0,C.A)(j,["br",Je?"links":"tg_links","emoji"])}),(0,W.Y)("span",{className:"subtitle",children:Te(ye?"UserBio":"Info")})]}),$e&&!Ge&<($e,!0),(!$e&&U||Ge)&&He&&(0,W.FD)(x.A,{icon:"link",multiline:!0,className:"I6wEM4Gg",narrow:!0,ripple:!0,onClick:()=>ot(He,Te("SetUrlPlaceholder")),style:Le("link"),children:[(0,W.Y)("div",{className:"title",children:He}),(0,W.Y)("span",{className:"subtitle",children:Te("SetUrlPlaceholder")})]}),Fe&&(0,W.Y)(ie,{birthday:Fe,user:t,isInSettings:ne},Me),H&&(0,W.FD)(x.A,{multiline:!0,className:"GQTzMGTi",isStatic:!0,narrow:!0,style:Le("miniapp"),children:[(0,W.Y)(D.A,{className:"x925YeS3",onClick:dt,children:Te("ProfileBotOpenApp")}),(0,W.Y)("div",{className:"IrqRJFxm",children:ct})]}),!O&&!ne&&(0,W.FD)(x.A,{icon:K?"mute":"unmute",className:"RBvIJLG2",narrow:!0,ripple:!0,onClick:_e,style:Le("notifications"),children:[(0,W.Y)("span",{children:De("Notifications")}),(0,W.Y)(P.A,{id:"group-notifications",checked:!K,className:ae})]}),ke&&(0,W.Y)(Q,{businessHours:ke}),Ne&&(0,W.FD)(x.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,className:"_xXKFqUd",style:Le("location"),rightElement:je,onClick:We,children:[(0,W.Y)("div",{className:"title",children:Ne.address}),(0,W.Y)("span",{className:"subtitle",children:Te("BusinessProfileLocation")})]}),Re&&(0,W.FD)(x.A,{icon:"note",iconClassName:"tzdaXm4b",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,className:"NTIM9Ilb",style:Le("note"),children:[(0,W.Y)("div",{ref:Be,className:(0,m.A)("title","word-break","allow-selection","wfFIBsS9",Ee&&"XDGCHF3C"),style:Le("noteText",!0),dir:De.isRtl?"rtl":void 0,onClick:et?tt:void 0,children:(0,w.fd)({text:Pe.text,entities:Pe.entities})}),(0,W.FD)("div",{className:(0,m.A)("subtitle","PZmqBGnF"),style:Le("noteSubtitle"),children:[(0,W.Y)("span",{children:De("UserNoteTitle")}),(0,W.Y)("span",{className:"ULBE6izv",children:De("UserNoteHint")}),Oe&&(0,W.Y)(R.A,{className:(0,m.A)("sUNntQ81","emWTh6l1"),style:Le("noteExpandIcon",!0),onClick:nt,name:Ee?"down":"up"})]})]}),q&&!O&&!ne&&(0,W.Y)(x.A,{icon:"saved-messages",className:"zOAUgAZz",narrow:!0,ripple:!0,onClick:Xe,style:Le("savedMessages"),children:(0,W.Y)("span",{children:Te("SavedMessagesTab")})}),c&&"isBotAccessEmojiGranted"in c&&(0,W.FD)(x.A,{icon:"user",className:"wlATcqd6",narrow:!0,ripple:!0,onClick:Qe,style:Le("botEmojiStatus"),children:[(0,W.Y)("span",{children:Te("BotProfilePermissionEmojiStatus")}),(0,W.Y)(P.A,{checked:Boolean(_),className:ae})]}),void 0!==Z?.geolocation&&(0,W.FD)(x.A,{icon:"location",className:"AM09D0iF",narrow:!0,ripple:!0,onClick:Ze,style:Le("botLocation"),children:[(0,W.Y)("span",{children:Te("BotProfilePermissionLocation")}),(0,W.Y)(P.A,{checked:Boolean(Z?.geolocation),className:ae})]}),se&&(0,W.FD)(x.A,{icon:"group",narrow:!0,multiline:!0,ripple:!0,className:"nKT9b7NU",onClick:rt,style:Le("subscribers"),children:[(0,W.Y)("div",{className:"title",children:De("ProfileItemSubscribers")}),(0,W.Y)("span",{className:"subtitle",children:De.number(n?.membersCount||0)})]}),X&&(0,W.FD)("div",{className:"RWFu5ENh",style:Le("botVerification"),children:[(0,W.Y)(B.A,{className:"b32hsSPS",documentId:X.iconId,size:16}),X.description]})]})]})}))},87970(e,t,n){n.d(t,{A:()=>ce});var o=n(84051),i=n(89925),s=n(31481),a=n(90709),r=n(13439),d=n(11597),c=n(30708),l=n(96115),u=n(96454),h=n(87357),m=n(95807),p=n(50442),g=n(79824),f=n(31460),v=n(76023),A=n(4961),y=n(41385),C=n(54699),w=n(39351),I=n(17712),b=n(59030),S=n(73767),M=n(45294),N=n(23174),k=n(58554),Y=n(41036),F=n(21849),P=n(34431),T=n(18276),D=n(38102),x=n(48899),L=n(14242),B=n(43874),R=n(45470),E=n(37661),O=n(62587),U=n(83057),K=n(39996),z=n(65843),V=n(97422),j=n(20021);const G=(0,o.ph)(({chat:e,user:t,photo:n,isSavedMessages:i,isSavedDialog:s,canPlayVideo:r,className:d,style:c,theme:l,onClick:p})=>{const g=(0,o.li)(),f=(0,w.A)(),{isMobile:v}=(0,B.Ay)(),y=t&&(0,a.PL)(t),C=e&&(0,a.kE)(e.id),I=e&&(0,a.Qe)(e.id),b=t||e,S=b&&!i&&!y&&!C&&!I,{isVideo:M}=n||{},N=(!n||n.id===b.avatarPhotoId)&&(0,a.cP)(b,"normal"),k=S&&n&&!N&&(0,a.rI)(n,"pictogram"),Y=(0,O.A)(k||N),F=S&&n&&!M&&(0,a.mU)(n),P=(0,O.A)(F),D=S&&n&&M&&(0,a.Pg)(n),G=(0,O.A)(D)||P,[J,q]=(0,E.A)(),$=Boolean(G&&(!M||J)),H=(0,U.A)($),W=S&&!$&&!Y&&n?.thumbnail?.dataUri,_=(0,R.A)(n?.thumbnail?.dataUri,!W,v&&!u.QH),Q=n||Y||W,{className:Z,style:X}=(0,K.Ay)({peer:b,theme:l});(0,o.vJ)(()=>{g.current&&!r&&(g.current.currentTime=0)},[r]);const ee=(0,o.Kr)(()=>i?s?"my-notes":"avatar-saved-messages":y?"avatar-deleted-account":C?"reply-filled":I?"author-hidden":void 0,[I,y,s,C,i]);let te;if(ee)te=(0,j.Y)(T.A,{name:ee,role:"img"});else if(Q)te=(0,j.FD)(j.FK,{children:[W?(0,j.Y)("canvas",{ref:_,className:"thumb"}):(0,j.Y)("img",{src:Y,draggable:!1,className:"thumb",alt:""}),n&&(M?(0,j.Y)(z.A,{canPlay:r,ref:g,src:G,className:(0,h.A)("avatar-media",H),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:q}):(0,j.Y)("img",{src:G,draggable:!1,className:(0,h.A)("avatar-media",H),alt:""}))]});else if(t){const e=(0,a.Yg)(t);te=e?(0,L.Qh)(e,2):void 0}else if(e){const t=(0,a.Js)(f,e);te=t&&(0,L.Qh)(t,(0,x.L8)(e.id)?2:1)}else te=(0,j.Y)("div",{className:"spinner-wrapper",children:(0,j.Y)(V.A,{color:"white"})});const ne=(0,h.A)("ProfilePhoto",Z,i&&"saved-messages",I&&"anonymous-forwards",y&&"deleted-account",C&&"replies-bot-account",!i&&!Q&&"no-photo",d);return(0,j.Y)("div",{className:ne,style:(0,m.A)(c,X),onClick:Q?p:void 0,children:"string"==typeof te?(0,A.A)(te,["hq_emoji"]):te})});var J=n(43336),q=n(66833),$=n(95773),H=n(82855);const W=2*v.$,_=[{x:-.2,y:-.3},{x:.3,y:.1},{x:-.4,y:-.1},{x:.4,y:-.1},{x:-.25,y:.1},{x:.25,y:-.25}],Q=({gift:e,style:t,className:n,withGlow:i,peerId:s})=>{const{openGiftInfoModal:a}=(0,r.ko)(),d=(0,o.li)(),c=(0,o.Kr)(()=>(0,q.uc)(e.gift),[e]),l=(0,I.A)(()=>{a({peerId:s,gift:e})});if(c?.model&&c.backdrop)return(0,j.Y)($.A,{withSparkles:!0,sparklesColor:c.backdrop.textColor,glowColor:i?c.backdrop.edgeColor:void 0,ref:d,className:n,style:t,onClick:l,children:(0,j.Y)(H.A,{containerRef:d,sticker:c.model.sticker,size:W,withTranslucentThumb:!0,noPlay:!0})})},Z=(0,o.ph)(({peerId:e,gifts:t,isExpanded:n,className:o,withGlow:i})=>{const{createVtnStyle:s}=(0,y.k)();if(t)return(0,j.Y)("div",{className:(0,h.A)("dspICZx5",o),children:t.slice(0,_.length).map((t,o)=>{const a=n?function(e){return{x:(0,J.qE)(1.5*e.x,-.45,.45),y:(0,J.qE)(1.5*e.y,-.45,.45)}}(_[o]):_[o],r=(0,m.A)(`top: ${100*(.5+a.y)}%`,`left: ${100*(.5+a.x)}%`);return(0,j.Y)(Q,{peerId:e,className:"GtRefNqT",gift:t,style:(0,m.A)(r,s(`profilePinnedGift${o}`,"profilePinnedGift")),withGlow:i},t.gift.id)})})});var X=n(40558);const ee="XxRtPe_4",te="eZ2DGNou",ne="ldzIKEUp",oe="uNvH08Qp",ie="UZ7NDj8N",se="Yr9FHqbF",ae="eFsZljMG",re=8*v.$,de=5.25*v.$,ce=(0,o.ph)((0,r.EK)((e,{peerId:t})=>{const n=(0,d.PVB)(e,t),o=(0,d.mBe)(e,t),i=o?(0,d.vGo)(e,t):void 0,r=(0,d.K0y)(e,t),u=(0,d.hds)(e,t),h=(0,d.IVq)(e,t),{mediaIndex:m,chatId:p}=(0,d.nTw)(e).mediaViewer,g=u?.isForum,{threadId:f}=(0,d.Xf0)(e)||{},v=g&&f?(0,d.S0q)(e,t,f):void 0,{animationLevel:A}=(0,c.lS)(e),y=n?.emojiStatus,C=y?(0,d.O8F)(e,y.documentId):void 0,w="collectible"===y?.type?y.slug:void 0,I=n&&(0,d.Vi6)(e,n),b=(0,d.SJA)(e),S=(0,d.c7s)(e,t),M=(0,d.FDg)(e,t),N=Boolean(n?.avatarPhotoId),k=(0,a.Qe)(t),Y=(0,a.DX)(t)||k||n?.id===s.zv8;return{user:o,userFullInfo:i,userStatus:r,chat:u,mediaIndex:m,avatarOwnerId:p,animationLevel:A,emojiStatusSticker:C,emojiStatusSlug:w,emojiStatus:y,profilePhotos:h,topic:v,messagesCount:v?(0,l.Qb)(e,t,v.id):void 0,profileColorOption:I,theme:b,isPlain:!S,savedGifts:M,hasAvatar:N,isSystemAccount:Y}})(({isExpanded:e,isForSettings:t,canPlayVideo:n,user:s,userFullInfo:d,userStatus:c,chat:l,mediaIndex:v,avatarOwnerId:x,topic:L,messagesCount:B,animationLevel:R,emojiStatus:E,emojiStatusSticker:O,emojiStatusSlug:U,profilePhotos:K,peerId:z,isForMonoforum:V,profileColorOption:J,theme:q,isPlain:$,savedGifts:H,hasAvatar:W,isSystemAccount:_,onExpand:Q})=>{const{openMediaViewer:ce,openPremiumModal:le,openStickerSet:ue,openPrivacySettingsNoticeModal:he,loadMoreProfilePhotos:me,openUniqueGiftBySlug:pe,openProfileRatingModal:ge,loadPeerSavedGifts:fe}=(0,r.ko)(),ve=(0,b.A)(),Ae=(0,w.A)();(0,C.A)(s?6e4:void 0);const{createVtnStyle:ye}=(0,y.k)(),Ce=K?.photos||g.p,we=(0,S.A)(v),Ie=(0,S.A)(x),[be,Se]=(0,o.J0)(!0),[Me,Ne]=(0,o.J0)(0),ke=Ce.length<=1||0===Me,Ye=Ce.length<=1||Me===Ce.length-1,Fe="collectible"===E?.type?E:void 0,Pe=s||l,{customEmoji:Te}=(0,M.A)(Fe?.patternDocumentId||Pe?.profileColor?.backgroundEmojiId),De=(0,o.Kr)(()=>{if(Fe)return{bgColors:[Fe.centerColor,Fe.edgeColor],storyColors:[Fe.textColor,Fe.textColor]};const e=J&&("dark"===q?J.darkColors:J.colors);return e?{bgColors:[...e.bgColors].reverse(),storyColors:[...e.storyColors].reverse()}:void 0},[J,q,Fe]),xe=De?.bgColors||Te,Le=(0,o.Kr)(()=>H?.gifts.filter(e=>"starGiftUnique"===e.gift.type?e.isPinned&&e.gift.slug!==Fe?.slug:e.isPinned),[H,Fe?.slug]);(0,o.vJ)(()=>{Ce.length-Me<=3&&me({peerId:z})},[Me,z,Ce.length]),(0,o.vJ)(()=>{fe({peerId:z})},[z]),(0,o.vJ)(()=>{Ie&&void 0!==we&&void 0===v&&(Se(!1),Ne(we))},[v,we,Ie]),(0,o.vJ)(()=>{Me>Ce.length&&(Se(!1),Ne(Math.max(0,Ce.length-1)))},[Me,Ce.length]),(0,o.vJ)(()=>{e||Ne(0)},[e]),function(e,t){(0,o.vJ)(()=>{e.slice(t,t+4).forEach(e=>{const t=(0,a.mU)(e);k.Ih(t)||k.hd(t,N.qZ.BlobUrl)})},[t,e])}(Ce,Me);const Be=(0,I.A)(()=>{ce({isAvatarView:!0,chatId:z,mediaIndex:Me,origin:t?i.TQ.SettingsAvatar:i.TQ.ProfileAvatar})}),Re=(0,I.A)(()=>{U?pe({slug:U}):z?le({fromUserId:z}):ue({stickerSetInfo:O.stickerSetInfo})}),Ee=(0,I.A)(()=>{ke||(Se(!0),Ne(Me-1))}),Oe=(0,I.A)(()=>{Ye||(Se(!0),Ne(Me+1))}),Ue=(0,I.A)(()=>{he({chatId:l.id,isReadDate:!1})}),Ke=(0,I.A)(e=>{s&&ge({userId:s.id,level:e})}),ze=(0,I.A)(()=>{t?Be():W&&Q?.()});if((0,o.vJ)(()=>{const e=document.querySelector(`.${ie}`);if(e)return(0,p.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:u.TF?(e,t)=>t===p.ez.Right?(Ee(),!0):t===p.ez.Left&&(Oe(),!0):void 0})},[Oe,Ee]),s||l)return L?(0,j.FD)("div",{className:"dNcezQH8",children:[(0,j.Y)(D.A,{topic:L,size:120,className:"YwVcTLvK",letterClassName:"_sQEevF7",noLoopLimit:!0}),(0,j.Y)("h3",{className:"hjk4U031",dir:Ae.isRtl?"rtl":void 0,children:(0,A.A)(L.title)}),(0,j.Y)("p",{className:"GXxwbzqF",children:B?ve("Chat.Title.Topic",B,"i"):ve("lng_forum_no_messages")})]}):(0,j.FD)("div",{className:(0,h.A)("ProfileInfo","Z_HM0Jqg",!e&&"blI_IH7j",$&&"YIhgPXW6"),style:(0,m.A)(De&&`--rating-outline-color: ${e?"transparent":De?.bgColors[0]}`,De&&!e&&`--rating-text-color: ${De?.bgColors[0]}`,ye("profileInfo",!0)),dir:Ae.isRtl?"rtl":void 0,children:[xe&&(0,j.Y)(X.A,{backgroundColors:De?.bgColors,patternIcon:Te,patternSize:16,withLinearGradient:!Fe,className:"BvunKb6r",yPosition:$?de:re}),Boolean(Le?.length)&&(0,j.Y)(Z,{peerId:z,gifts:Le,isExpanded:e,className:"JX3wjADD",withGlow:!$}),e&&(0,j.FD)("div",{className:ie,style:ye("photoWrapper",!0),children:[function(){const e=Math.max(Ce.length,K?.count||0);if(!Ce||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=Me>=30?29:Me;return(0,j.Y)("div",{className:"e7iOf_3T",style:ye("photoDashes",!0),children:t.map((e,t)=>(0,j.Y)("span",{className:(0,h.A)("eD0Is6TL",t===n&&"MSdiAM06")}))})}(),!t&&K?.personalPhoto&&(0,j.Y)("div",{className:(0,h.A)(te,ke&&oe),children:(0,j.Y)("div",{className:ne,children:ve(K.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),t&&K?.fallbackPhoto&&(0,j.Y)("div",{className:(0,h.A)(te,(ke||Ye)&&oe),children:(0,j.FD)("div",{className:ne,onClick:function(){ke&&(Se(!0),Ne(Ce.length-1))},children:[!Ye&&(0,j.Y)(F.A,{photo:K.fallbackPhoto,className:"a9OwsvOP",size:"mini"}),ve(K.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,j.Y)(Y.Ay,{activeKey:Me,name:(0,f.P)("slide",R,!be,Ae.isRtl),children:function(e){const t=Ce.length>0?Ce[Me]:void 0;return(0,j.Y)(G,{user:s,chat:l,photo:t,theme:q,canPlayVideo:Boolean(e&&n),className:(0,h.A)(e&&"yltXKQri"),style:e?ye("avatar",!0):void 0,onClick:Be},Me)}}),!ke&&(0,j.Y)("button",{type:"button",dir:Ae.isRtl?"rtl":void 0,className:(0,h.A)(se,"Z1ZX2xot"),"aria-label":ve("AccDescrPrevious"),onClick:Ee}),!Ye&&(0,j.Y)("button",{type:"button",dir:Ae.isRtl?"rtl":void 0,className:(0,h.A)(se,"X0stLWTl"),"aria-label":ve("Next"),onClick:Oe})]}),!e&&(0,j.Y)(F.A,{withStory:!0,storyColors:De?.storyColors,className:"rLHO_VQT",size:"jumbo",peer:Pe,style:ye("avatar",!0),storyCircleStyle:ye("avatarStoryCircle",!0),onClick:W?ze:void 0},Pe?.id),(0,j.FD)("div",{className:"ZFBuRDGK",dir:Ae.isRtl?"rtl":"auto",style:ye("info",!0),children:[(s||l)&&(0,j.Y)(P.A,{className:"atYgxkWV",style:ye("title",!0),peer:s||l,withEmojiStatus:!0,withStatusTextColor:!0,emojiStatusSize:24,onEmojiStatusClick:Re,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,a.Qe)(z),t=(0,a.DX)(z);if(!e&&!t)return V?(0,j.Y)("span",{className:(0,h.A)(ee,"status"),dir:"auto",style:ye("status",!0),children:Ae("MonoforumStatus")}):s?(0,j.FD)("div",{className:(0,h.A)(ee,"status",(0,a.PF)(s,c)&&"online"),style:ye("status",!0),children:[Ve(),(0,j.Y)("span",{className:"F4JyLH2c",dir:"auto",children:(0,a.CD)(ve,s,c)}),c?.isReadDateRestrictedByMe&&!_&&(0,j.Y)("span",{className:"wCXGPPTY",onClick:Ue,children:(0,j.Y)("span",{children:ve("StatusHiddenShow")})})]}):(0,j.Y)("span",{className:(0,h.A)(ee,"status"),dir:"auto",style:ye("status",!0),children:(0,a.WX)(l)?ve("Subscribers",l.membersCount??0,"i"):ve("Members",l.membersCount??0,"i")})}()]})]});function Ve(){if(!d?.starsRating)return;const e=d.starsRating.level,t=()=>Ke(e);if(e<0)return(0,j.FD)("span",{role:"button",tabIndex:0,className:"vuUzgWI1",onClick:t,children:[(0,j.Y)(T.A,{name:"rating-icons-negative",className:"JZBCjHv0"}),(0,j.Y)("span",{className:ae,children:"!"})]});const n=Math.max(e,1),o=Math.min(n,90),i=o<10?`rating-icons-level${o}`:"rating-icons-level"+10*Math.floor(o/10);return(0,j.FD)("span",{role:"button",tabIndex:0,className:"P6tsZMON",onClick:t,children:[(0,j.Y)(T.A,{name:i,className:"Yvu9iM5n"}),(0,j.Y)("span",{className:ae,children:e})]})}}))},67778(e,t,n){n.d(t,{Al:()=>A,eI:()=>f,xh:()=>y,mq:()=>g,Ay:()=>C,ym:()=>m});var o=n(84051),i=n(87357),s=n(54839),a=n(39351),r=n(14745),d=n(18276),c=n(97422),l=n(41494);var u=n(20021);const h=(0,o.q6)(void 0);function m(){return(0,s.A)(h)}function p({htmlFor:e,className:t,baseClassName:n,children:o}){const s=m(),a=(0,l.Ft)(),r=e??s?.id;return!a?.isLabel&&r?(0,u.Y)("label",{htmlFor:r,className:(0,i.A)(n,t),dir:"auto",children:o}):(0,u.Y)("span",{className:(0,i.A)(n,t),dir:"auto",children:o})}const g=e=>(0,u.Y)(p,{...e,baseClassName:"e3KhS7xm"}),f=e=>(0,u.Y)(p,{...e,baseClassName:"IlAOwgt6"}),v=({className:e,children:t})=>(0,u.Y)("div",{className:(0,i.A)("t5YTBCxC",e),children:t}),A=({className:e,children:t})=>(0,u.Y)("div",{className:(0,i.A)("KYxTS_Ah",e),children:t}),y=({iconName:e,className:t,backgroundColor:n})=>(0,u.Y)(v,{className:t,children:(0,u.Y)("div",{className:(0,i.A)("nIswe_tx",n&&"FdOKwwkT"),style:n?`--control-icon-background-color: ${n};`:void 0,children:e&&(0,u.Y)(d.A,{name:e,className:"qPnSUAL5"})})}),C=(0,o.ph)(({inputEnd:e,className:t,children:n})=>{const s=(0,r.A)(),d=(0,a.A)(),m=(0,l.Ft)(),p=`control-${s}`,g=(0,o.Kr)(()=>({id:p,inputClassName:"OVIWnWDn"}),[p]);return(0,u.Y)(h.Provider,{value:g,children:(0,u.FD)("div",{className:(0,i.A)("Wty_RKaA",e&&"wQ53Rv7_",t),dir:d.isRtl?"rtl":void 0,children:[m?.isLoading&&(0,u.Y)(c.A,{className:"uJ9CYh3V"}),n]})})})},41494(e,t,n){n.d(t,{Ay:()=>m,Ft:()=>h});var o=n(84051),i=n(87357),s=n(54839),a=n(17712);const r=new Set(["button","link","menuitem","switch","tab","treeitem"]),d=new Set(["button","switch","checkbox","radio","option","tab","treeitem"]);var c=n(42452);var l=n(20021);const u=(0,o.q6)(void 0);function h(){return(0,s.A)(u)}const m=(0,o.ph)(({asLabel:e,clickable:t,ripple:n,disabled:s,loading:h,className:m,children:p,onClick:g})=>{const f=(0,o.Kr)(()=>({isDisabled:Boolean(s),isLoading:Boolean(h),isLabel:Boolean(e)}),[e,s,h]),v=s||h,A=function(e,{disabled:t,role:n="button",withA11y:i=!0,tabIndex:s=0}={}){const c=(0,o.li)(!1),l=Boolean(e)&&!t,u=(0,a.A)(t=>{const n=t.nativeEvent;(0===t.detail||-1===n?.pointerId)&&!c.current||(c.current=!1,e?.(t))}),h=(0,a.A)(e=>{if("Enter"===e.key&&r.has(n))return e.preventDefault(),c.current=!0,void e.currentTarget.click();" "===e.key&&d.has(n)&&e.preventDefault()}),m=(0,a.A)(e=>{" "===e.key&&d.has(n)&&(e.preventDefault(),c.current=!0,e.currentTarget.click())});return{onClick:l?u:void 0,onKeyDown:l?h:void 0,onKeyUp:l?m:void 0,role:e&&i?n:void 0,tabIndex:e&&i?t?-1:s:void 0,"aria-disabled":!!(e&&i&&t)||void 0}}(g,{disabled:v,withA11y:!e}),y=(0,i.A)("eX4uiNIB",t&&!v&&"h8jsmIPu",v&&"iIxB9lL8",s&&"ncZyDI4f",m),C=(0,l.FD)(l.FK,{children:[p,n&&!v&&(0,l.Y)(c.A,{})]});return e?(0,l.Y)(u.Provider,{value:f,children:(0,l.Y)("label",{className:y,...A,children:C})}):(0,l.Y)(u.Provider,{value:f,children:(0,l.Y)("div",{className:y,...A,children:C})})})},79462(e,t,n){n.d(t,{IW:()=>s,Qg:()=>a,Ay:()=>r});var o=n(87357);var i=n(20021);const s=({className:e,children:t,...n})=>(0,i.Y)("div",{className:(0,o.A)("j6O7w_HR",e),...n,children:t}),a=({className:e,children:t,...n})=>(0,i.Y)("div",{className:(0,o.A)("vcGtwOtR",e),...n,children:t}),r=({ref:e,className:t,children:n,...s})=>(0,i.Y)("div",{ref:e,className:(0,o.A)("RE8jeQLf",t),...s,children:n})},37903(e,t,n){n.d(t,{A:()=>s});var o=n(87357);var i=n(20021);const s=({ref:e,scrollable:t,noPadding:n,className:s,children:a,...r})=>{const d=Boolean(t);return(0,i.Y)("div",{ref:e,className:(0,o.A)("CSCjJZ7G",d&&"custom-scroll",d&&"VzUroCLS",n&&"bbnI9Aoa",s),...r,children:a})}},69287(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(87357),s=n(17712),a=n(67778),r=n(41494);var d=n(20021);const c=(0,o.ph)(({checked:e,disabled:t,isRound:n,indeterminate:c,isInvalid:l,className:u,onChange:h,id:m,...p})=>{const g=(0,a.ym)(),f=(0,r.Ft)(),v=(0,o.li)(),A=m??g?.id,y=t||f?.isDisabled||f?.isLoading;(0,o.Nf)(()=>{v.current&&(v.current.indeterminate=Boolean(c))},[c]);const C=(0,s.A)(e=>{h?.(e.currentTarget.checked)});if(!f?.isLoading)return(0,d.Y)("input",{...p,ref:v,type:"checkbox",id:A,checked:e,disabled:y,className:(0,i.A)("t5vsqnKM",g?.inputClassName,l&&"HTFBqLcA",n&&"ulcKZn5W",u),onChange:C})})},65036(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(87357),s=n(17712),a=n(67778),r=n(41494);var d=n(20021);const c=(0,o.ph)(({value:e,checked:t,disabled:n,className:o,onChange:c,id:l,...u})=>{const h=(0,a.ym)(),m=(0,r.Ft)(),p=l??h?.id,g=n||m?.isDisabled||m?.isLoading,f=(0,s.A)(()=>{c?.(e)});if(!m?.isLoading)return(0,d.Y)("input",{type:"radio",...u,id:p,value:e,checked:t,disabled:g,className:(0,i.A)("HAwjpZIq",h?.inputClassName,o),onChange:f})})},55810(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(87357),s=n(17712),a=n(18276),r=n(26607),d=n(67778),c=n(41494);var l=n(20021);const u=(0,o.ph)(({checked:e,disabled:t,locked:n,withPermissionColors:o,className:u,onChange:h,id:m,...p})=>{const g=(0,d.ym)(),f=(0,c.Ft)(),v=m??g?.id,A=t||f?.isDisabled||f?.isLoading,y=(0,s.A)(e=>{n||h?.(e.currentTarget.checked)});if(!f?.isLoading)return(0,l.FD)("span",{className:(0,i.A)("VK9Npdde",A&&"syqXqv44",n&&"VYZlc7QP",o&&"YVnBQ1jB",g?.inputClassName,u),children:[(0,l.Y)("input",{...p,type:"checkbox",role:"switch",id:v,checked:e,disabled:A||n,className:"e2V38dWV",onChange:y}),(0,l.Y)("span",{className:"XLATOQUP","aria-hidden":!0,children:(0,l.Y)("span",{className:"HsE7br1z",children:(0,l.Y)(r.A,{isOpen:Boolean(n),className:"eQTr9arp",children:(0,l.Y)(a.A,{name:"lock-badge",className:"D7bB2tRu"})})})})]})})},97967(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97046(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},19210(e,t,n){n.d(t,{A:()=>J});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(27109),l=n(11597),u=n(96115),h=n(96454),m=n(87357),p=n(48899),g=n(49763),f=n(66414),v=n(63527),A=n(43874),y=n(47067),C=n(49746),w=n(37661),I=n(5912),b=n(17712),S=n(50680),M=n(73176),N=n(21849),k=n(54314),Y=n(34431),F=n(18276),P=n(9267),T=n(81642),D=n(22720),x=n(97967),L=n(97046),B=n(46566);const R="AA5s1Pu4";var E=n(20021);const O=(0,o.ph)(({isSelected:e,isActive:t,isMobile:n})=>(0,E.Y)("div",{className:(0,m.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,E.FD)("div",{className:"nl36F75B",children:[(0,E.Y)("div",{className:R}),(0,E.Y)("div",{className:R}),(0,E.Y)("div",{className:R})]})}));var U=n(76023),K=n(69282),z=n(39996);const V="oIgI9O0L",j=.875*U.$,G=(0,o.ph)(({orderedFolderIds:e,chatFoldersById:t,isFoldersSidebarShown:n,itemClassName:o})=>{if(!e)return;const i=e.slice(0,3),a=e.length-i.length;function r(e){let t=e.title.text,o=e.title.entities;if(n){const n=e.title.entities?.find(e=>e.type===s.C7.CustomEmoji&&0===e.offset);if(n){const{offset:i,length:s}=n;t=e.title.text.replace(e.title.text.substring(i,i+s),""),o=e.title.entities?.filter(e=>e.offset!==i).map(e=>({...e,offset:e.offset-s}))}}return(0,K.fd)({text:t,entities:o,noCustomEmojiPlayback:e.noTitleAnimations,emojiSize:j})}return(0,E.FD)("div",{className:"cgAMX02q",children:[i.map(e=>{const n=t?.[e];return n&&(0,E.Y)("div",{className:(0,m.A)(V,void 0!==n.color&&-1!==n.color&&(0,z.yp)(n.color),o),children:r(n)},n.id)}),a>0&&(0,E.FD)("div",{className:(0,m.A)(V,"hZDqIz3W",o),children:["+",a]})]})}),J=(0,o.ph)((0,i.EK)((e,{chatId:t,isSavedDialog:n,isPreview:o,previewMessageId:i})=>{const a=(0,l.hds)(e,t),r=(0,l.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const d=(0,g.N)(t),{areTagsEnabled:h}=e.chatFolders,m=(0,l.g29)(e),p=i||(0,l.ZZX)(e,t,n?"saved":"all"),f=i?(0,l.O5q)(e,t,i):(0,l.yHC)(e,t,n?"saved":"all"),{isOutgoing:v,forwardInfo:A}=f||{},y=n&&A?.fromId?(0,l.PVB)(e,A.fromId):void 0,C=f?(0,l.Y7C)(e,f):void 0,w=y||C,{chatId:I,threadId:b,type:S}=(0,l.Xf0)(e)||{},M=!o&&t===I&&(n?t===b:b===s.l3),N=a.isForum&&t===I||t===(0,l.nTw)(e).forumPanelChatId,k=(0,l.K0y)(e,t),Y=f&&(0,l.nkm)(e,f),F=(0,u._X)(e,t,s.l3,"typingStatusByPeerId"),P=(0,l.xyP)(e,t),T=f?.content.storyData,D=T&&(0,l.Msb)(e,T.peerId,T.id),x=(0,l.trm)(e),L=(0,l.k2W)(e,t);return{chat:a,isMuted:(0,c.If)(a,(0,l.K52)(e),(0,l.P5N)(e,a.id)),lastMessageSender:w,draft:(0,u.GA)(e,t,s.l3),isSelected:M,isSelectedForum:N,isForumPanelOpen:(0,l.clw)(e),canScrollDown:M&&"thread"===S,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,lastMessageOutgoingStatus:v&&f&&!n?(0,l.Tl2)(e,t,s.l3,f.id,"thread"):void 0,user:r,userStatus:k,lastMessageTopic:Y,typingStatusByPeerId:F,withInterfaceAnimations:(0,l.PKK)(e),lastMessage:f,lastMessageId:p,currentUserId:e.currentUserId,listedTopicIds:P?.listedTopicIds,isSynced:e.isSynced,lastMessageStory:D,isAccountFrozen:x,monoforumChannel:L,chatFolderIds:d,orderedFolderIds:e.chatFolders.orderedIds,chatFoldersById:e.chatFolders.byId,areTagsEnabled:h&&m}})(({chatId:e,folderId:t,orderDiff:n,shiftDiff:c,animationType:u,isPinned:g,listedTopicIds:R,observeIntersection:U,chat:K,monoforumChannel:z,lastMessageStory:V,isMuted:j,user:J,userStatus:q,lastMessageSender:$,lastMessageOutgoingStatus:H,offsetTop:W,draft:_,withInterfaceAnimations:Q,isSelected:Z,isSelectedForum:X,isForumPanelOpen:ee,canScrollDown:te,canChangeFolder:ne,lastMessageTopic:oe,typingStatusByPeerId:ie,lastMessageId:se,lastMessage:ae,isSavedDialog:re,currentUserId:de,isPreview:ce,previewMessageId:le,className:ue,isSynced:he,isAccountFrozen:me,chatFolderIds:pe,orderedFolderIds:ge,chatFoldersById:fe,areTagsEnabled:ve,withTags:Ae,isFoldersSidebarShown:ye,onDragEnter:Ce,onDragLeave:we,onReorderAnimationEnd:Ie})=>{const{openChat:be,openSavedDialog:Se,toggleChatInfo:Me,focusMessage:Ne,loadTopics:ke,openForumPanel:Ye,closeForumPanel:Fe,setShouldCloseRightColumn:Pe,reportMessages:Te,openFrozenAccountModal:De,updateChatMutedState:xe,openQuickPreview:Le,scrollMessageListToBottom:Be}=(0,i.ko)(),{isMobile:Re}=(0,A.Ay)(),[Ee,Oe,Ue]=(0,w.A)(),[Ke,ze,Ve]=(0,w.A)(),[je,Ge,Je]=(0,w.A)(),[qe,$e,He]=(0,w.A)(),[We,_e,Qe]=(0,w.A)(),[Ze,Xe,et]=(0,w.A)(),{isForum:tt,isForumAsMessages:nt,isMonoforum:ot}=K||{},it=K?.isBotForum&&R&&!R.length;(0,C.A)(re?de:e,se,ae);const st=(0,o.Kr)(()=>{const e=new Set(pe);return ge?.filter(n=>{if(!e.has(n))return;const o=n===t,i=n===r.DSF,s=fe?.[n],a=void 0!==s?.color&&-1!==s.color;return!o&&!i&&a})},[ge,t,fe,pe]),at=ve&&Ae,rt=at&&Boolean(st?.length),{renderSubtitle:dt,ref:ct}=(0,M.A)({chat:K,chatId:e,lastMessage:ae,typingStatusByPeerId:ie,draft:_,statefulMediaContent:(0,d.FE)({story:V}),lastMessageTopic:oe,lastMessageSender:$,observeIntersection:U,animationType:u,withInterfaceAnimations:Q,orderDiff:n,shiftDiff:c,isSavedDialog:re,isPreview:ce,onReorderAnimationEnd:Ie,topicIds:R,hasTags:rt,shouldForceNonForumView:it}),lt=(0,v.BI)(l.sRo),ut=(0,b.A)(t=>{if(t.altKey&&!re&&!tt&&!ce)return t.preventDefault(),void Le({id:e});const n=Re&&nt||it;if(Re&&Pe({value:!0}),ce)Ne({chatId:e,messageId:le});else{if(re)return Se({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Re&&Me({force:!1}));if(tt){if(ee)return void Fe(void 0,{forceOnHeavyAnimation:!0});if(n||Ye({chatId:e},{forceOnHeavyAnimation:!0}),!nt&&!it)return}be({id:e,noForumTopicPanel:n,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),Z&&te&&Be()}}),ht=(0,b.A)(t=>{t.preventDefault(),Ce?.(e)}),mt=(0,b.A)(()=>{me?De():($e(),Oe())}),pt=(0,b.A)(()=>{me?De():(_e(),ze())}),gt=(0,b.A)(()=>{me?De():xe({chatId:e,mutedUntil:r.Os5})}),ft=(0,b.A)(()=>{Xe(),Ge()}),vt=(0,b.A)(()=>{me?De():K&&Te({chatId:K.id,messageIds:[]})}),At=(0,y.A)({chat:K,user:J,handleDelete:mt,handleMute:pt,handleUnmute:gt,handleChatFolderChange:ft,handleReport:vt,folderId:t,isPinned:g,isMuted:j,canChangeFolder:ne,isSavedDialog:re,currentUserId:de,isPreview:ce,topicIds:R}),yt=(0,I.Vz)(ct,K?U:void 0);(0,o.vJ)(()=>{yt&&tt&&he&&void 0===R&&ke({chatId:e})},[e,R,he,tt,yt]);const Ct=J&&q&&(0,d.PF)(J,q),{hasShownClass:wt}=(0,S.A)(Ct),It=(0,o.Kr)(()=>{if(h.OS)return re?`#${(0,f.az)(de,"thread",e)}`:`#${(0,f.az)(e,"thread",s.l3)}`},[e,de,re]);if(!K)return;const bt=J||K,St=(0,m.A)("Chat chat-item-clickable",(0,p.L8)(e)?"private":"group",tt&&!it&&"forum",Z&&"selected",X&&"selected-forum",ce&&"standalone",ve&&Ae&&"chat-item-with-tags",ue);return(0,E.FD)(D.A,{ref:ct,className:St,href:It,style:void 0!==W?`top: ${W}px`:void 0,ripple:!tt&&!Re,contextActions:At,withPortalForMenu:!0,onClick:ut,onDragEnter:ht,onDragLeave:we,children:[(0,E.FD)("div",{className:(0,m.A)("status","status-clickable"),children:[(0,E.FD)("div",{className:"avatar-wrapper",children:[(0,E.Y)(N.A,{peer:ot?z:bt,isSavedMessages:J?.isSelf,isSavedDialog:re,size:ce?"medium":"large",asMessageBubble:ot,withStory:!J?.isSelf&&!ot,withStoryGap:wt||Boolean(K.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,E.FD)("div",{className:"avatar-badge-wrapper",children:[(0,E.Y)("div",{className:(0,m.A)("avatar-online","avatar-badge",wt&&"avatar-online-shown")}),!wt&&Boolean(K.subscriptionUntil)&&(0,E.Y)(P.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"})]}),(0,E.Y)(B.A,{chat:K,isMuted:j,shouldShowOnlyMostImportant:!0,forceHidden:lt,isSelected:Z,isOnAvatar:!0})]}),K.isCallActive&&K.isCallNotEmpty&&(0,E.Y)(O,{isMobile:Re,isSelected:Z,isActive:Q})]}),(0,E.FD)("div",{className:(0,m.A)("info",at&&"has-tags"),children:[(0,E.FD)("div",{className:"info-row",children:[(0,E.Y)(Y.A,{peer:ot?z:bt,isMonoforum:ot,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:e===J?.id&&J?.isSelf,isSavedDialog:re,observeIntersection:U,withStatusTextColor:Z}),j&&!re&&(0,E.Y)(F.A,{name:"muted"}),(0,E.Y)("div",{className:"separator"}),ae&&(0,E.Y)(T.A,{message:ae,outgoingStatus:re?void 0:H,draftDate:_?.date})]}),(0,E.FD)("div",{className:"subtitle",children:[dt(),!ce&&(0,E.Y)(B.A,{chat:K,isPinned:g,isMuted:j,isSavedDialog:re,hasMiniApp:J?.hasMainMiniApp,isSelected:Z,transitionClassName:"chat-badge-transition"})]}),rt&&(0,E.Y)(G,{itemClassName:"chat-tag",orderedFolderIds:st,chatFoldersById:fe,isFoldersSidebarShown:ye})]}),qe&&(0,E.Y)(k.A,{isOpen:Ee,onClose:Ue,onCloseAnimationEnd:He,chat:K,isSavedDialog:re}),We&&(0,E.Y)(L.A,{isOpen:Ke,onClose:Ve,onCloseAnimationEnd:Qe,chatId:e}),Ze&&(0,E.Y)(x.A,{isOpen:je,onClose:Je,onCloseAnimationEnd:et,chatId:e})]})}))},46566(e,t,n){n.d(t,{A:()=>k});var o=n(84051),i=n(13439),s=n(23174),a=n(11597),r=n(96115),d=n(87357),c=n(87894),l=n(80140),u=n(22237),h=n(14242),m=n(59852),p=n(63527),g=n(19129),f=n(39351),v=n(17712),A=n(30857),y=n(73767),C=n(35297),w=n(68292),I=n(18276),b=n(64493),S=n(26607);const M="PNHSXmwb";var N=n(20021);const k=(0,o.ph)(({topic:e,chat:t,isPinned:n,isMuted:k,shouldShowOnlyMostImportant:Y,wasTopicOpened:F,forceHidden:P,isSavedDialog:T,hasMiniApp:D,isSelected:x,isOnAvatar:L,transitionClassName:B,badgeClassName:R})=>{const{requestMainWebView:E}=(0,i.ko)(),O=(0,f.A)(),U=(0,o.hb)(n=>(0,r.a1)(n,t.id,e?.id||s.l3),[t.id,e?.id]),K=(0,p.Ay)(U),{unreadMentionsCount:z=0,unreadPollVotesCount:V=0,unreadReactionsCount:j=0,unreadCount:G=0,hasUnreadMark:J}=K||{},q=(0,o.hb)(e=>(0,a.xyP)(e,t.id),[t.id]),$=(0,p.LV)(q),{listedTopicIds:H,topicsById:W}=$||{},_=(0,o.hb)(e=>(0,c.pA)(H||[],n=>[n,(0,r.a1)(e,t.id,n)]),[t.id,H]),Q=(0,p.LV)(_),Z=!n&&e&&!F,X=t.isForum&&!e,ee=(0,o.Kr)(()=>X&&H?H.filter(e=>Q[e]?.unreadCount):void 0,[H,X,Q]),te=(0,o.Kr)(()=>X&&H?H.filter(e=>Q[e]?.unreadMentionsCount):void 0,[H,X,Q]),ne=(0,o.Kr)(()=>X&&H?H.filter(e=>Q[e]?.unreadPollVotesCount):void 0,[H,X,Q]),oe=(0,o.Kr)(()=>X&&H?H.filter(e=>Q[e]?.unreadReactionsCount):void 0,[H,X,Q]),ie=(0,o.Kr)(()=>{if(!X)return;const e=[...ee||[],...ne||[],...oe||[]];return e.length?[...new Set(e)]:[]},[X,ee,ne,oe]),se=X?ee?.length:G,ae=X?te?.length:z,re=X?ne?.length:V,de=X?oe?.length:j,ce=(0,o.Kr)(()=>X?ie?.length?k?ie.some(e=>0===W?.[e]?.notifySettings.mutedUntil):!ie.every(e=>{const t=W?.[e]?.notifySettings.mutedUntil;return t&&t>(0,l.Fm)()}):!k:!k||0===e?.notifySettings.mutedUntil,[X,k,W,e?.notifySettings.mutedUntil,ie]),le=Boolean((se||J)&&!T),ue=function(e,t){const n=(0,y.A)(e),i=(0,y.A)(t),s=(0,o.li)(!1),a=(0,A.A)();return e&&n&&void 0!==t&&void 0!==i&&i!==t&&!s.current&&(s.current=!0),(0,C.A)(()=>{if(!s.current)return;const e=window.setTimeout(()=>{s.current=!1,a()},150);return()=>clearTimeout(e)},[t]),e&&!s.current}(!(0,g.A)(()=>(0,u.Hp)(P)?P():P,[P])&&Boolean(se||ae||re||J||n||de||Z||D),le||ae||de||re||Z?"active":D?"miniapp":n?"pinned":"none"),he=(0,v.A)(e=>{e.stopPropagation();const n=(0,m.A)();E({botId:t.id,peerId:t.id,theme:n})});return(0,N.Y)(S.A,{isCustom:!0,className:(0,d.A)("zGiYriqE",x&&"x5LnLky3",L&&"ZJcE67F7",B),isOpen:ue,children:function(){const e=(0,d.A)("vbb34kEa",R),t=(0,d.A)(e,!ce&&"H0NRx4u_"),o=de&&(0,N.Y)("div",{className:(0,d.A)(t,"R31SqbQj",M),children:(0,N.Y)(I.A,{name:"heart"})}),i=re&&(0,N.Y)("div",{className:(0,d.A)(t,"Ra_i2eep",M),children:(0,N.Y)(I.A,{name:"poll-badge"})}),s=ae&&(0,N.Y)("div",{className:(0,d.A)(e,"IOO6C469",M),children:(0,N.Y)(I.A,{name:"mention"})}),a=Z&&(0,N.Y)("div",{className:(0,d.A)(t,"qbAbFaK3")}),r=le?(0,N.Y)("div",{className:(0,d.A)(t,"RqISI7Dg"),children:!J&&(0,N.Y)(w.A,{text:(0,h.Vw)(O,se)})}):void 0,c=n&&(0,N.Y)("div",{className:(0,d.A)(e,"lVbUgp6W"),children:(0,N.Y)(I.A,{name:"pinned-chat"})}),l=D&&(0,N.Y)(b.A,{color:x?"secondary":"primary",className:(0,d.A)(e,"x2AM544v"),pill:!0,size:"tiny",onClick:he,children:O("BotChatMiniAppOpen")}),u=!r&&!s&&!o&&!i&&c,m=[a,i,o,s,r,u].filter(Boolean);return T?c:D&&(0===m.length||u)?l:0!==m.length?1===m.length?m[0]:Y?[i,o,s,r,c].filter(Boolean)[0]:(0,N.Y)("div",{className:"R5lXhuMd",children:m}):void 0}()})})},70463(e,t,n){n.d(t,{A:()=>Me});var o=n(84051),i=n(13439),s=n(89925),a=n(31481),r=n(96454),d=n(87357),c=n(75956),l=n(49763),u=n(37959),h=n(23459),m=n(7985),p=n(74984),g=n(2178),f=n(96374),v=n(5912),A=n(17712),y=n(9717),C=n(46222),w=n(52745),I=n(23174),b=n(90709),S=n(11597),M=n(30708),N=n(96115),k=n(95807),Y=n(25903),F=n(87894),P=n(14242),T=n(4961),D=n(63527),x=n(39351),L=n(35297),B=n(21849),R=n(18276),E=n(24713),O=n(22720);const U={root:"sG8AAzvK",noAnimation:"z7YCLnQC",minimized:"lTOui0dp",noMarginTop:"CODezO4o",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"};var K=n(20021);const z={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},V=(0,o.ph)(({archiveSettings:e,isFoldersSidebarShown:t,offsetTop:n,animationType:s,onDragEnter:r,onClick:c})=>{const{updateArchiveSettings:l}=(0,i.ko)(),h=(0,o.li)(),m=(0,D.Ay)(M.Vu),g=(0,o.li)(m!==a.dnp),f=(0,x.A)();(0,L.A)(()=>{if(m===a.dnp)return void(g.current=!1);if(s!==u.IP.None)return void(g.current=!0);const e=setTimeout(()=>{g.current=!1},200),t=h.current;return t&&(0,Y.j)(t,()=>{g.current=!1},"transform"),()=>clearTimeout(e)},[s,m]);const v=(0,p.Rh)(a._E9),A=(0,p.ic)(),y=A[a._E9]?.chatsCount,C=(0,o.Kr)(()=>{if(!v?.length)return f("Loading");const e=(0,i.mS)();return v.slice(0,5).map((t,n,o)=>{const i=n===o.length-1,s=(0,S.hds)(e,t),a=(0,N.a1)(e,t,I.l3);if(!s)return;const r=(0,b.Js)(f,s);return(0,K.FD)(K.FK,{children:[(0,K.Y)("span",{className:(0,d.A)(U.chat,y&&a?.unreadCount&&U.unread),children:(0,T.A)(r)}),i?"":", "]})})},[v,f,y]),w=(0,o.Kr)(()=>{const t=!e.isMinimized&&{title:f("ContextArchiveCollapse"),icon:"collapse",handler:()=>{l({isMinimized:!0})}},n=e.isMinimized&&{title:f("ContextArchiveExpand"),icon:"expand",handler:()=>{l({isMinimized:!1})}},o={title:f("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{l({isHidden:!0})}};return(0,F.oE)([t,n,o])},[e.isMinimized,f,l]),V=(0,o.hb)(e=>{e.preventDefault(),r?.()},[r]);return(0,K.Y)(O.A,{ref:h,onClick:c,onDragEnter:V,className:(0,d.A)(U.root,e.isMinimized&&U.minimized,t&&e.isMinimized&&U.noMarginTop,!g.current&&U.noAnimation,n&&U.noMarginTop,"chat-item-clickable","chat-item-archive"),style:(0,k.A)(Boolean(n)&&`transform: translateY(${n}px)`),buttonClassName:U.button,contextActions:w,withPortalForMenu:!0,children:e.isMinimized?(0,K.Y)("div",{className:(0,d.A)(U.info,"info"),children:(0,K.FD)("div",{className:"info-row",children:[(0,K.Y)("div",{className:(0,d.A)("title",U.title),children:(0,K.FD)("h3",{dir:"auto",className:(0,d.A)(U.name,"fullName"),children:[(0,K.Y)(R.A,{name:"archive-filled",className:U.icon}),f("ArchivedChats")]})}),(0,K.Y)(E.A,{className:U.unreadCount,text:y?(0,P.Vw)(f,y):void 0})]})}):(0,K.FD)(K.FK,{children:[(0,K.Y)("div",{className:(0,d.A)("status",U.avatarWrapper),children:(0,K.Y)(B.A,{peer:z})}),(0,K.FD)("div",{className:(0,d.A)(U.info,"info"),children:[(0,K.Y)("div",{className:"info-row",children:(0,K.Y)("div",{className:(0,d.A)("title",U.title),children:(0,K.Y)("h3",{dir:"auto",className:(0,d.A)(U.name,"fullName"),children:f("ArchivedChats")})})}),(0,K.FD)("div",{className:"subtitle",children:[(0,K.Y)("div",{className:(0,d.A)("status",U.chatsPreview),children:C}),(0,K.Y)(E.A,{className:U.unreadCount,text:y?(0,P.Vw)(f,y):void 0})]})]})]})})});var j=n(19210),G=n(43874),J=n(59030),q=n(79577),$=n(64493);const H=(0,o.ph)((0,i.EK)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,S.$aQ)(e,t):void 0,animatedEmoji:(0,S.oei)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,i.ko)(),r=(0,J.A)(),{isMobile:d}=(0,G.Ay)(),c=(0,o.hb)(()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})},[e,n]);return(0,K.FD)("div",{className:"yftKUVDQ",children:[(0,K.Y)("div",{className:"UCBfMOiz",children:t&&(0,K.Y)(q.A,{sticker:t,size:96})}),(0,K.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,K.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,K.Y)($.A,{ripple:!d,fluid:!0,pill:!0,iconName:"settings",onClick:c,isRtl:r.isRtl,children:(0,K.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})})]})}));var W=n(61433),_=n(66644),Q=n(80140),Z=n(76023),X=n(15283),ee=n(34201),te=n(5718),ne=n(48885);const oe=(0,o.ph)(({isAccountFrozen:e,onPaneStateChange:t})=>{const{openFrozenAccountModal:n}=(0,i.ko)(),o=(0,x.A)(),{ref:s,shouldRender:a}=(0,ne.A)({isOpen:e,onStateChange:t,withResizeObserver:!0}),r=(0,A.A)(()=>{n()});if(a)return(0,K.FD)("div",{ref:s,className:"lx6b4nbs",role:"button",tabIndex:0,onClick:r,children:[(0,K.Y)("div",{className:"JjWxp6pv",children:o("TitleFrozenAccount")}),(0,K.Y)("div",{className:"sGa3VcFf",children:o("SubtitleFrozenAccount")})]})});var ie=n(66833),se=n(87412),ae=n(61361);const re="shhqZMEh",de="KFchKnrq",ce="t5Jgtdxv",le=(0,o.ph)((0,i.EK)(e=>({activeGiftAuctionIds:e.activeGiftAuctionIds,giftAuctionByGiftId:e.giftAuctionByGiftId}))(({canShow:e,activeGiftAuctionIds:t,giftAuctionByGiftId:n,onPaneStateChange:s})=>{const{openGiftAuctionBidModal:a,openActiveGiftAuctionsModal:r}=(0,i.ko)(),c=e&&Boolean(t?.length),l=(0,x.A)(),{ref:u,shouldRender:h}=(0,ne.A)({isOpen:c,onStateChange:s,withResizeObserver:!0}),[m,p,g]=(0,o.Kr)(()=>{const e=t?.map(e=>n?.[e]).filter(e=>"active"===e?.state.type&&Boolean(e.userState.bidAmount));if(!e)return[void 0,0,0];const[o,i]=(0,F.jB)(e,e=>{const t=e.state;return(0,ie.e0)(e.userState.bidAmount,e.userState.bidDate,t.bidLevels)<=e.gift.giftsPerRound});return[e,o.length,i.length]},[t,n]),f=m?.length||0,v=1===m?.length?m[0]:void 0,y=(0,A.A)(()=>{m?.length&&(v?a({auctionGiftId:v.gift.id}):r())});if(h)return(0,K.FD)("div",{ref:u,className:(0,d.A)(re,"VaA_6uap"),role:"button",tabIndex:0,onClick:y,children:[(0,K.FD)("div",{className:(0,d.A)(de,"matSj1dD"),children:[(0,K.Y)("span",{className:"VHzRR9AT",children:m?.map(e=>(0,K.Y)(se.A,{sticker:e.gift.sticker,loopLimit:1},e.gift.id))}),l("ChatListAuctionTitle",{count:f},{pluralValue:f})]}),(0,K.Y)("div",{className:(0,d.A)(ce,"is8ed6Lp",!p&&g&&"Mevh41Gd"),children:function(){if(p||g)return p&&!g?l("ChatListAuctionWinning"):!p&&g?l("ChatListAuctionOutbid"):l("ChatListAuctionMixed",{winCount:p,outbidCount:g})}()}),(0,K.Y)($.A,{className:"o5FU73x3",iconName:v?"auction-filled":void 0,iconClassName:"DyW9v3dj",size:"tiny",pill:!0,onClick:y,children:v?(0,K.Y)(ae.A,{endsAt:v.state.nextRoundAt,shouldShowZeroOnEnd:!0}):l("ChatListAuctionView")})]})}));var ue=n(69282),he=n(14);const me="BIRTHDAY_SETUP",pe=new Set([me]),ge=new Set([me]),fe={BIRTHDAY_SETUP:["SuggestionBirthdaySetupTitle","SuggestionBirthdaySetupMessage"]},ve=(0,o.ph)(({promoData:e,onPaneStateChange:t})=>{const{openBirthdaySetupModal:n,dismissSuggestion:s,openUrl:a}=(0,i.ko)(),r=(0,x.A)(),c=(0,o.Kr)(()=>e?.customPendingSuggestion?e.customPendingSuggestion:e?.pendingSuggestions.find(e=>pe.has(e)),[e]),l=(0,he.A)(c),u="object"==typeof l,{ref:h,shouldRender:m}=(0,ne.A)({isOpen:Boolean(c),onStateChange:t,withResizeObserver:!0}),p=(0,A.A)(()=>{if(!l)return;const e=u?l.suggestion:l;ge.has(e)&&s({suggestion:e}),u?a({url:l.url}):l===me&&n({})}),g=(0,A.A)(e=>{if(e.stopPropagation(),!l)return;const t=u?l.suggestion:l;s({suggestion:t})});if(!m||!l)return;const f=u?(0,ue.fd)(l.title):r(fe[l][0],void 0,{withNodes:!0}),v=u?(0,ue.fd)(l.description):r(fe[l][1],void 0,{withNodes:!0});return(0,K.FD)("div",{ref:h,className:(0,d.A)(re,"SDkananZ"),role:"button",tabIndex:0,onClick:p,children:[(0,K.Y)("div",{className:(0,d.A)(de,"A0XudHG_"),children:f}),(0,K.Y)("div",{className:(0,d.A)(ce,"jjwC84Vs"),children:v}),(0,K.Y)(R.A,{name:"close",className:"iY6Fyv9_",onClick:g})]})}),Ae="EPR4baV0",ye=(0,o.ph)(({unconfirmedSession:e,onPaneStateChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,i.ko)(),r=(0,x.A)(),d=Boolean(e),c=(0,he.A)(e),{ref:l,shouldRender:u}=(0,ne.A)({isOpen:d,withResizeObserver:!0,onStateChange:t}),h=(0,o.Kr)(()=>c?c.region?r("UnconfirmedAuthLocationRegion",{deviceModel:c.deviceModel,region:c.region,country:c.country}):r("UnconfirmedAuthLocationCountry",{deviceModel:c.deviceModel,country:c.country}):"",[c,r]),m=(0,A.A)(()=>{c&&n({hash:c.hash,isConfirmed:!0})}),p=(0,A.A)(()=>{c&&(s({hash:c.hash}),a({title:r("UnconfirmedAuthDeniedTitle"),message:r("UnconfirmedAuthDeniedMessage",{location:h})}))});if(u&&c)return(0,K.FD)("div",{className:"sjWwxV5d",ref:l,children:[(0,K.Y)("h2",{className:"XXUAbrjx",children:r("UnconfirmedAuthTitle")}),(0,K.Y)("p",{className:"XQfnrzqW",children:r("UnconfirmedAuthSingle",{location:h})}),(0,K.FD)("div",{className:"ASbVib3E",children:[(0,K.Y)($.A,{fluid:!0,isText:!0,className:Ae,onClick:m,children:r("UnconfirmedAuthConfirm")}),(0,K.Y)($.A,{fluid:!0,isText:!0,color:"danger",onClick:p,className:Ae,children:r("UnconfirmedAuthDeny")})]})]})}),Ce=.25*Z.$,we=.5*Z.$,Ie={height:0},be=(0,o.ph)((0,i.EK)(e=>({isForumPanelOpen:(0,S.clw)(e),sessions:e.activeSessions.byHash,promoData:e.promoData,isAccountFrozen:(0,S.trm)(e)}))(({className:e,sessions:t,promoData:n,isAccountFrozen:i,isForumPanelOpen:s,onHeightChange:r})=>{const[c,l]=(0,o.Ul)(Ie),[u,h]=(0,o.Ul)(Ie),[m,p]=(0,o.Ul)(Ie),[g,f]=(0,o.Ul)(Ie),v=(0,o.li)(!0),{shouldRender:A,ref:y}=(0,ee.A)({isOpen:!0,withShouldRender:!0,noMountTransition:!0});(0,X.A)(()=>{v.current=!1});const C=(0,o.Kr)(()=>{const e=Object.values(t||{}),n=e.find(e=>e.isCurrent);if(n&&!((0,Q.Fm)()-n.dateCreatede.isUnconfirmed)},[t]),w=!i&&!s&&C,I=!i&&!s&&!C&&n,b=!i&&!s;if((0,te.R)(()=>{const e=c(),t=u(),n=m(),o=g(),i=[e,t,n,{height:n.height?Ce:0,isSpacer:!0},o,{height:we,isSpacer:!0}],s=v.current,a=i.reduce((e,t)=>e+t.height,0);r(0!==a-we?a:0);const d=document.getElementById("LeftColumn");d&&((0,ne.S)({list:i,noTransition:s,zIndexIncrease:!0}),(0,_.RK)(()=>{(0,W.Tv)(d,{"--chat-list-panes-height":`${a}px`})}))},[c,u,g,m]),A)return(0,K.FD)("div",{ref:y,className:(0,d.A)("l4B81S5u",e),children:[(0,K.Y)(oe,{isAccountFrozen:i,onPaneStateChange:h}),(0,K.Y)(ye,{unconfirmedSession:w?C:void 0,onPaneStateChange:l}),(0,K.Y)(le,{canShow:b,onPaneStateChange:p}),(0,K.Y)(ve,{promoData:I?n:void 0,onPaneStateChange:f})]})})),Se=new Set(["9","0"]),Me=(0,o.ph)(({className:e,folderType:t,folderId:n,isActive:I,isForumPanelOpen:b,canDisplayArchive:S,archiveSettings:M,isMainList:N,withTags:k,isFoldersSidebarShown:Y,isStoryRibbonShown:F,foldersDispatch:P,noAbsolutePositioning:T,noVirtualization:D,noScrollRestore:x,noFastList:L,scrollContainerClosest:B,onScroll:R})=>{const{openChat:E,openNextChat:O,closeForumPanel:U,toggleStoryRibbon:z,openLeftColumnContent:G}=(0,i.ko)(),J=(0,o.li)(),[q,$]=(0,o.J0)(0),W="archived"===t,_="all"===t,Q="saved"===t,Z=_?a.DSF:W?a._E9:Q?a.pX9:n,X=_&&S&&M,ee=(0,p.Rh)(Z);(0,h.A)(ee);const te=(ee?.length||0)*a.yq1,ne=X?M?.isMinimized?a.eqO:a.yq1:0,{orderDiffById:oe,shiftDiff:ie,getAnimationType:se,onReorderAnimationEnd:ae}=(0,y.A)(ee,q),re=D?Math.max(a.T7t,ee?.length||0):a.T7t,[de,ce]=(0,f.A)(void 0,ee,void 0,re);(0,g.v)((0,o.Kr)(()=>I&&ee?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),O({targetIndexDelta:-1,orderedIds:ee})},"Alt+ArrowDown":e=>{e.preventDefault(),O({targetIndexDelta:1,orderedIds:ee})}}:void 0,[I,ee])),(0,o.vJ)(()=>{if(I&&!Q&&ee&&r.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((r.MP&&e.metaKey||!r.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||Se.has(t))return;const n=X&&M&&!M.isMinimized,o=n?-1:0,i=Number(t)+o-1;if(n&&-1===i)return void(N&&G({contentKey:s.Bn.Archived}));if(i>ee.length-1)return;E({id:ee[i],shouldReplaceHistory:!0})}}},[M,Q,I,E,O,ee,X,N]);const{observe:le}=(0,v.BL)({rootRef:J,throttleMs:200}),ue=(0,A.A)(()=>{G({contentKey:s.Bn.Archived}),U()}),he=(0,A.A)(()=>{z({isShown:!0,isArchived:W})}),me=(0,A.A)(()=>{z({isShown:!1,isArchived:W})}),pe=(0,A.A)(()=>{(0,c.W)(()=>{ue()})}),ge=(0,A.A)(e=>{(0,c.W)(()=>{E({id:e,shouldReplaceHistory:!0})})});(0,m.A)({containerRef:J,onOverscroll:he,onReset:me,isDisabled:Q,isOverscrolled:F});const fe=te+ne+q;return(0,K.FD)(C.A,{className:(0,d.A)("chat-list custom-scroll",b&&"forum-panel-open",e),ref:J,items:de,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!T,maxHeight:T?void 0:fe,scrollContainerClosest:B,noScrollRestore:x,noFastList:L,onLoadMore:ce,onScroll:R,children:[_&&(0,K.Y)(be,{onHeightChange:$},"panes"),X&&(0,K.Y)(V,{archiveSettings:M,onClick:ue,onDragEnter:pe,animationType:se(u.E5),offsetTop:q,isFoldersSidebarShown:Y},"archive"),de?.length?function(){const e=ee.indexOf(de[0]),t=(0,l.zm)(Z)||0;return de.map((o,i)=>{const s=e+ise});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),c=n(11597),l=n(96115),u=n(96454),h=n(87357),m=n(11778),p=n(50442),g=n(25903),f=n(48899),v=n(87894),A=n(63527),y=n(43874),C=n(82117),w=n(26072),I=n(96374),b=n(5912),S=n(39351),M=n(17712),N=n(73767),k=n(9717),Y=n(63744),F=n(51083),P=n(58920),T=n(48553),D=n(64493),x=n(46222),L=n(52745),B=n(66414),R=n(81642),E=n(22720);const O="lqZyVmVG";var U=n(20021);const K=(0,o.ph)((0,i.EK)((e,{chatId:t})=>({lastMessage:(0,c.yHC)(e,t,"all")}))(({chatId:e,isSelected:t,style:n,lastMessage:o})=>{const{openThread:a,openQuickPreview:r}=(0,i.ko)(),d=(0,S.A)(),c=(0,M.A)(t=>{if(t.altKey)return t.preventDefault(),void r({id:e});a({chatId:e,threadId:s.l3,shouldReplaceHistory:!0})});return(0,U.Y)(E.A,{className:(0,h.A)(O,"Chat",t&&"selected","chat-item-clickable"),onClick:c,style:n,href:u.OS?`#${(0,B.az)(e,"thread",s.l3)}`:void 0,children:(0,U.FD)("div",{className:"info",children:[(0,U.FD)("div",{className:"info-row",children:[(0,U.Y)("div",{className:(0,h.A)("title"),children:(0,U.Y)("h3",{dir:"auto",className:"fullName",children:d("BotForumAllTopicTitle")})}),(0,U.Y)("div",{className:"separator"}),o&&(0,U.Y)(R.A,{message:o})]}),(0,U.Y)("div",{className:"subtitle",children:(0,U.Y)("span",{className:"last-message",children:d("BotForumAllTopicDescription")})})]})})}));var z=n(76023),V=n(59030),j=n(79577);const G={root:"WPgq_7q8","button-text":"X68lc0hu",buttonText:"X68lc0hu",sticker:"jyXw4GPj",title:"_bhNYUNF",description:"zlgqVt7f","is-ios":"iUlEHnLc",isIos:"iUlEHnLc","is-macos":"mOsbMLNN",isMacos:"mOsbMLNN"},J=7*z.$,q=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,c.hds)(e,t),o=n&&(n.isCreator||(0,d.ub)(n,"manageTopics"));return{animatedEmoji:(0,c.oei)(e,"🐣"),canManageTopics:o}})(({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:o}=(0,i.ko)(),s=(0,S.A)(),a=(0,V.A)(),{isMobile:r}=(0,y.Ay)(),d=(0,M.A)(()=>{o({chatId:e})});return(0,U.FD)("div",{className:G.root,children:[(0,U.Y)("div",{className:G.sticker,children:t&&(0,U.Y)(j.A,{sticker:t,size:J})}),(0,U.Y)("h3",{className:G.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,U.Y)("p",{className:(0,h.A)(G.description,G.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,U.Y)(D.A,{ripple:!r,fluid:!0,onClick:d,isRtl:s.isRtl,children:(0,U.Y)("div",{className:G.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})}));var $=n(27109),H=n(4961),W=n(37661),_=n(73176),Q=n(63495),Z=n(18276),X=n(38102),ee=n(94189),te=n(97046),ne=n(46566);const oe=(0,o.ph)((0,i.EK)((e,{chatId:t,topic:n,isSelected:o})=>{const i=(0,c.hds)(e,t),s=(0,l.Vw)(e,t,n.id),a=s?.lastMessageId?(0,c.O5q)(e,t,s.lastMessageId):void 0,{isOutgoing:r}=a||{},d=a&&(0,c.Y7C)(e,a),u=(0,l._X)(e,t,n.id,"typingStatusByPeerId"),h=(0,l.GA)(e,t,n.id),m=(0,l.a1)(e,t,n.id),p=i?.isBotForum||Boolean(m?.lastReadInboxMessageId),g=(0,c.xyP)(e,t)?.listedTopicIds,{chatId:f,threadId:v}=(0,c.Xf0)(e)||{},A=a?.content.storyData,y=A&&(0,c.Msb)(e,A.peerId,A.id);return{chat:i,lastMessage:a,lastMessageSender:d,typingStatusByPeerId:u,isChatMuted:i&&(0,$.If)(i,(0,c.K52)(e),(0,c.P5N)(e,i.id)),canDelete:(0,c.DBV)(e,t,n.id),withInterfaceAnimations:(0,c.PKK)(e),draft:h,...r&&a&&{lastMessageOutgoingStatus:(0,c.Tl2)(e,t,n.id,a.id,"thread")},canScrollDown:o&&i?.id===f&&v===n.id,wasTopicOpened:p,topicIds:g,lastMessageStory:y,unreadCount:m?.unreadCount}})(({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:r,style:c,lastMessage:l,lastMessageStory:m,canScrollDown:p,lastMessageOutgoingStatus:g,observeIntersection:f,canDelete:A,lastMessageSender:y,animationType:C,withInterfaceAnimations:w,orderDiff:I,shiftDiff:b,typingStatusByPeerId:N,draft:k,wasTopicOpened:Y,topicIds:F,unreadCount:P,onReorderAnimationEnd:T})=>{const{openThread:D,deleteTopic:x,scrollMessageListToBottom:L,setViewForumAsMessages:K,updateTopicMutedState:z,openQuickPreview:j}=(0,i.ko)(),G=(0,V.A)(),[J,q,$]=(0,W.A)(),[oe,ie,se]=(0,W.A)(),[ae,re,de]=(0,W.A)(),[ce,le,ue]=(0,W.A)(),{isPinned:he,isClosed:me,notifySettings:pe}=e,ge=Boolean(pe.mutedUntil||void 0===pe.mutedUntil&&r),fe=(0,M.A)(()=>{re(),q()}),ve=(0,M.A)(()=>{x({chatId:s.id,topicId:e.id})}),Ae=(0,M.A)(()=>{le(),ie()}),ye=(0,M.A)(()=>{z({chatId:n,topicId:e.id,mutedUntil:a.Os5})}),{renderSubtitle:Ce,ref:we}=(0,_.A)({chat:s,chatId:n,lastMessage:l,draft:k,lastMessageSender:y,lastMessageTopic:e,observeIntersection:f,isTopic:!0,typingStatusByPeerId:N,topicIds:F,statefulMediaContent:(0,d.FE)({story:m}),animationType:C,withInterfaceAnimations:w,orderDiff:I,shiftDiff:b,onReorderAnimationEnd:T}),Ie=(0,M.A)(t=>{if(t.altKey)return t.preventDefault(),void j({id:n,threadId:e.id});D({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),s.isBotForum||s.isMonoforum||K({chatId:n,isEnabled:!1}),p&&L()}),be=function({topic:e,unreadCount:t,chat:n,isChatMuted:s,wasOpened:a,canDelete:r,handleDelete:c,handleMute:l,handleUnmute:h}){const m=(0,S.A)(),p=(0,V.A)();return(0,o.Kr)(()=>{const{isPinned:o,notifySettings:g,isClosed:f,id:A}=e,y=n.id,{editTopic:C,toggleTopicPinned:w,markTopicRead:I,openChatInNewTab:b,openQuickPreview:S}=(0,i.ko)(),M=(0,d.l1)(n,e)&&!n.isBotForum,N=n.isCreator||(0,d.ub)(n,"manageTopics"),k=u.OS&&{title:Q.Vq?m("ChatListOpenInNewWindow"):m("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{b({chatId:n.id,threadId:A})}},Y={title:m("QuickPreview"),icon:"eye-outline",handler:()=>{S({id:y,threadId:A})}},F=t||!a?{title:p("MarkAsRead"),icon:"readchats",handler:()=>{I({chatId:y,topicId:A})}}:void 0,P=N?o?{title:p("UnpinFromTop"),icon:"unpin",handler:()=>w({chatId:y,topicId:A,isPinned:!1})}:{title:p("PinToTop"),icon:"pin",handler:()=>w({chatId:y,topicId:A,isPinned:!0})}:void 0,T=s&&void 0===g.mutedUntil||g.mutedUntil?{title:p("ChatList.Unmute"),icon:"unmute",handler:h}:{title:`${p("ChatList.Mute")}...`,icon:"mute",handler:l},D=M?f?{title:p("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>C({chatId:y,topicId:A,isClosed:!1})}:{title:p("lng_forum_topic_close"),icon:"close-topic",handler:()=>C({chatId:y,topicId:A,isClosed:!0})}:void 0,x=r?{title:p("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:c}:void 0;return(0,v.oE)([k,Y,P,F,T,D,x])},[n,e,t,a,s,r,c,l,h,m,p])}({topic:e,chat:s,isChatMuted:r,wasOpened:Y,canDelete:A,unreadCount:P,handleDelete:fe,handleMute:Ae,handleUnmute:ye});return(0,U.FD)(E.A,{className:(0,h.A)(O,"Chat",t&&"selected","chat-item-clickable"),onClick:Ie,style:c,href:u.OS?`#${(0,B.az)(n,"thread",e.id)}`:void 0,contextActions:be,withPortalForMenu:!0,ref:we,children:[(0,U.FD)("div",{className:"info",children:[(0,U.FD)("div",{className:"info-row",children:[(0,U.FD)("div",{className:(0,h.A)("title"),children:[(0,U.Y)(X.A,{topic:e,className:"tEQjGvh6",observeIntersection:f}),(0,U.Y)("h3",{dir:"auto",className:"fullName",children:(0,H.A)(e.title)})]}),Boolean(pe.mutedUntil)&&(0,U.Y)(Z.A,{name:"muted"}),(0,U.Y)("div",{className:"separator"}),me&&(0,U.Y)(Z.A,{name:"lock-badge",className:"kIae39BG"}),l&&(0,U.Y)(R.A,{message:l,outgoingStatus:g})]}),(0,U.FD)("div",{className:"subtitle",children:[Ce(),(0,U.Y)(ne.A,{chat:s,isPinned:he,isMuted:ge,topic:e,wasTopicOpened:Y,isSelected:t})]})]}),ae&&(0,U.Y)(ee.A,{isOpen:J,onClose:$,onCloseAnimationEnd:de,confirmIsDestructive:!0,confirmHandler:ve,text:G("lng_forum_topic_delete_sure"),confirmLabel:G("Delete")}),ce&&(0,U.Y)(te.A,{isOpen:oe,onClose:se,onCloseAnimationEnd:ue,chatId:n,topicId:e.id})]})})),ie="XjZQCsMW",se=(0,o.ph)((0,i.EK)(e=>{const t=(0,c.nTw)(e).forumPanelChatId,n=t?(0,c.hds)(e,t):void 0,{chatId:o,threadId:i}=(0,c.Xf0)(e)||{},s=t?(0,c.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===o?Number(i):void 0,isSynced:(0,c.nIz)(e),withInterfaceAnimations:(0,c.PKK)(e),topicsInfo:s}},e=>(0,c.clw)(e))(({chat:e,currentTopicId:t,isOpen:n,isHidden:c,isSynced:B,topicsInfo:R,withInterfaceAnimations:E,onTopicSearch:O,onCloseAnimationEnd:z,onOpenAnimationStart:V})=>{const{closeForumPanel:j,openChatWithInfo:G,loadTopics:J}=(0,i.ko)(),$=(0,o.li)(),H=(0,o.li)(),W=(0,o.li)(),{isMobile:_}=(0,y.Ay)(),Q=e?.id;(0,C.A)(([e])=>{if(!B)return;const t=!1===e;!Q||!t&&R||J({chatId:Q,force:t})},[B,Q,R]);const[Z,X]=(0,o.J0)(!1),ee=(0,S.A)(),te=(0,M.A)(()=>{j()});(0,o.vJ)(()=>{E||n||z?.()},[E,n,z]);const ne=(0,M.A)(()=>{e&&G({id:e.id,shouldReplaceHistory:!0})}),{observe:se}=(0,b.BL)({rootRef:H,throttleMs:200});(0,b.mv)(W,se,({isIntersecting:e})=>{X(!e)});const ae=(0,o.hb)(t=>{if(e?.id)return(0,v.Tq)(R?.topicsById||{},n=>(0,l.$j)(t,e.id,n.id))},[e?.id,R?.topicsById]),re=(0,A.Ay)(ae),de=(0,o.Kr)(()=>{const t=re&&(0,v.LG)(re,e=>e.threadInfo),n=R&&re?(0,d.CO)(Object.values(R.topicsById),t,R.orderedPinnedTopicIds).map(({id:e})=>e):[];return e?.isBotForum?[s.l3,...n]:n},[e?.isBotForum,R,re]),{orderDiffById:ce,shiftDiff:le,getAnimationType:ue,onReorderAnimationEnd:he}=(0,k.A)(de,0,e?.id),[me,pe]=(0,I.A)(()=>{e&&B&&J({chatId:e.id})},de,!R?.totalCount||de.length>=R.totalCount,a.iIc),ge=(0,o.li)(!1),fe=n&&!c,ve=(0,N.A)(fe);ve!==fe&&(ge.current=!1),(0,w.A)({isActive:fe,onBack:te}),(0,o.vJ)(()=>fe?(0,m.A)(te):void 0,[te,fe]),(0,o.vJ)(()=>{ve!==fe&&(0,r.Uz)(()=>{if(!$.current)return;const e=(0,o.VK)();(0,g.j)($.current,e),V?.(),fe?(ge.current=!0,$.current.style.transform="none"):(ge.current=!1,$.current.style.transform="")})},[fe,V,ve]),(0,o.vJ)(()=>{if(u.TF)return(0,p.wJ)($.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(ee.isRtl?p.ez.Left:p.ez.Right)&&(j(),!0)})},[j,ee.isRtl]);const Ae=void 0===R;if(e)return(0,U.FD)("div",{ref:$,className:(0,h.A)("lrlHKC_D",Z&&"H5tiS5xY",ee.isRtl&&"Lt4eKHrj",!E&&"c1q2bVwa"),onTransitionEnd:n?void 0:z,children:[(0,U.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,U.Y)(D.A,{round:!0,size:"smaller",color:"translucent",onClick:te,ariaLabel:ee("Close"),iconName:"close"}),(0,f.L8)(e.id)?(0,U.Y)(P.A,{noAvatar:!0,className:ie,userId:e.id,onClick:ne}):(0,U.Y)(F.A,{noAvatar:!0,className:ie,chatId:e.id,onClick:ne}),(0,U.Y)(T.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:_,onTopicSearch:O})]}),!(0,f.L8)(e.id)&&(0,U.Y)(Y.A,{chatId:e.id}),(0,U.Y)("div",{className:"JTeUtfo5"}),(0,U.FD)(x.A,{className:"chat-list custom-scroll",ref:H,items:me,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(de?.length||0)*a.HGU,onLoadMore:pe,sensitiveArea:a.C$_,beforeChildren:(0,U.Y)("div",{ref:W,className:"RtZDYhKR"}),children:[Boolean(me?.length)&&function(){const n=de.indexOf(me[0]);return me?.map((o,i)=>o===s.l3?(0,U.Y)(K,{chatId:e.id,isSelected:t===o},o):(0,U.Y)(oe,{chatId:e.id,topic:R.topicsById[o],style:`top: ${(n+i)*a.HGU}px;`,isSelected:t===o,observeIntersection:se,animationType:ue(o),orderDiff:ce[o],shiftDiff:le,onReorderAnimationEnd:he},o))}(),Ae&&!me?.length&&(0,U.Y)(L.A,{},"loading")]}),!Ae&&1===me?.length&&me[0]===a.HxB&&(0,U.Y)(q,{chatId:Q})]})}))},37959(e,t,n){n.d(t,{E5:()=>o.E5,IP:()=>o.IP});var o=n(79882)},79882(e,t,n){n.d(t,{E5:()=>s,IP:()=>i,We:()=>a});var o=n(84051);let i=function(e){return e[e.Shift=0]="Shift",e[e.Move=1]="Move",e[e.Opacity=2]="Opacity",e[e.None=3]="None",e}({});const s="archive";function a(e,t,n){return(0,o.Kr)(()=>{if(t)return()=>i.None;const o=Object.values(e),s=o.filter(e=>e<0).length,a=o.filter(e=>e>0).length;return t=>{const o=e[t];return o?o===1/0||o===-1/0||s<=a&&o<0||a0?i.Opacity:i.Move:n?i.Shift:i.None}},[e,n,t])}},73176(e,t,n){n.d(t,{A:()=>U});var o=n(84051),i=n(31481),s=n(66644),a=n(90709),r=n(70636),d=n(37836);function c(e,t=d.IJ){return new Promise(n=>{t(()=>{(function(e){return Promise.allSettled(e.getAnimations({subtree:!0}).filter(e=>e instanceof CSSTransition).map(e=>e.finished))})(e).then(()=>n())})})}var l=n(87357),u=n(48899),h=n(4961),m=n(69282),p=n(79882),g=n(35749),f=n(2338),v=n(21488),A=n(39351),y=n(62587),C=n(13439),w=n(11597),I=n(96115),b=n(87894),S=n(76023),M=n(63527),N=n(43874),k=n(11217),Y=n(38102);const F="CBda1UmC",P="BhS75ocD",T="uWo2dhui",D="g3XnC73g";var x=n(20021);const L=Number(S.$),B=(0,o.ph)(({chat:e,topicIds:t,hasTags:n,renderLastMessage:i,observeIntersection:s})=>{const{openThread:r}=(0,C.ko)(),d=(0,o.li)(),c=(0,o.li)(),u=(0,A.A)(),m=(0,o.hb)(n=>(0,b.pA)(t||[],t=>[t,(0,I.$j)(n,e.id,t)]),[e.id,t]),p=(0,M.LV)(m),g=(0,o.hb)(n=>t?.map(t=>(0,w.S0q)(n,e.id,t)).filter(Boolean),[e.id,t]),f=(0,M.LV)(g),[v,...y]=(0,o.Kr)(()=>{if(!f)return[];const e=(0,b.Tq)(p,e=>e?.threadInfo);return(0,a.CO)(f,e,void 0,!0).slice(0,3)},[f,p]),S=v?p[v.id]?.readState:void 0,[B,R]=(0,o.J0)(!1),[E,O]=(0,o.J0)(void 0),{handleClick:U,handleMouseDown:K}=(0,k.Q)(t=>{v&&(0===S?.unreadCount||e.isForumAsMessages&&!e.isBotForum||(t.stopPropagation(),t.preventDefault(),r({chatId:e.id,threadId:v.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,N.Ny)()})))});return(0,o.vJ)(()=>{const e=d.current,t=c.current;if(!e||!t||n)return;const o=e.offsetWidth,i=t.offsetWidth;Math.abs(o-i)i)},[v,i,n]),(0,x.FD)("div",{className:(0,l.A)("Ow6Ij9O5",B&&"U_yhhC0w",E&&"HV0wCR4O"),dir:u.isRtl?"rtl":void 0,style:E?`--overwritten-width: ${E}px`:void 0,children:[!n&&(0,x.FD)(x.FK,{children:[v&&(0,x.FD)("div",{className:F,children:[(0,x.FD)("div",{className:(0,l.A)("lEbV6HrI",S?.unreadCount&&P),ref:c,onClick:U,onMouseDown:K,children:[(0,x.Y)(Y.A,{topic:v,observeIntersection:s}),(0,x.Y)("div",{className:"k3Ch25ZQ",children:(0,h.A)(v.title)}),!E&&B&&(0,x.Y)("div",{className:T,children:(0,x.Y)("div",{className:D})})]}),(0,x.Y)("div",{className:"IkuCBmvA",children:y.map(e=>(0,x.FD)("div",{className:(0,l.A)("d0hTIVJn",p[e.id]?.readState?.unreadCount&&P),children:[(0,x.Y)(Y.A,{topic:e,className:"oknhG11L",observeIntersection:s}),(0,x.Y)("span",{className:"ZUj3xAjs",children:(0,h.A)(e.title)})]},e.id))}),(0,x.Y)("div",{className:"_m_2xcPW"})]}),!v&&(0,x.Y)("div",{className:(0,l.A)(F,"L4Zk0yMN"),children:u("Loading")})]}),(0,x.FD)("div",{className:(0,l.A)("KJ16dBus",S?.unreadCount&&!n&&P),ref:d,onClick:U,onMouseDown:K,children:[i(),!E&&!B&&(0,x.Y)("div",{className:T,children:(0,x.Y)("div",{className:D})})]})]})});var R=n(18276),E=n(18653),O=n(10398);function U({chat:e,topicIds:t,lastMessage:n,statefulMediaContent:d,chatId:l,typingStatusByPeerId:C,draft:w,lastMessageTopic:I,lastMessageSender:b,observeIntersection:S,animationType:M,orderDiff:N,shiftDiff:k,withInterfaceAnimations:Y,isTopic:F,isSavedDialog:P,isPreview:T,hasTags:D,shouldForceNonForumView:L,onReorderAnimationEnd:E}){const U=(0,A.A)(),z=(0,o.li)(),V=n?.content.storyData,j=d&&!d.story;(0,v.A)(j?V?.peerId:void 0,V?.id,d?.story);const G=d?.story||n,J=G&&!(0,a.fP)(G),q=(0,f.A)(G),$=J?q:void 0,H=(0,g.A)(G,"micro"),W=(0,y.A)(J?H:void 0),_=Boolean(n&&(0,a.lk)(n)),Q=(0,o.hb)(()=>{const t=function(e){if(!e)return;const t=Object.values(e).map(({timestamp:e})=>e);return t.length?Math.max(...t):void 0}(C);if(!P&&!T&&C&&n&&t&&t>n.date)return(0,x.Y)(O.A,{typingStatusByPeerId:C,isPrivate:(0,u.L8)(l)});const o=w&&w.replyInfo?.replyToMsgId===I?.id,i=w?.replyInfo&&!w.text&&w.isLocal;if(!e?.isForum&&!P&&!T&&w&&!i&&(!F||!o))return(0,x.FD)("p",{className:"last-message",dir:U.isRtl?"auto":"ltr",children:[(0,x.Y)("span",{className:"draft",children:U("ChatDraftPrefix")}),(0,x.Y)("span",{className:"last-message-summary",dir:"auto",children:(0,m.fd)({text:w.text?.text||"",entities:w.text?.entities,asPreview:!0,withTranslucentThumbs:!0})})]});if(!n)return;const s=b?(0,r.Q5)(U,l,b):void 0;return(0,x.FD)("p",{className:"last-message shared-canvas-container",dir:U.isRtl?"auto":"ltr",children:[s&&(0,x.FD)(x.FK,{children:[(0,x.Y)("span",{className:"sender-name",children:(0,h.A)(s)}),(0,x.Y)("span",{className:"colon",children:":"})]}),!P&&n.forwardInfo&&(0,x.Y)(R.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,x.Y)(R.A,{name:"story-reply",className:"chat-prefix-icon"}),(0,x.Y)("span",{className:"last-message-summary",dir:"auto",children:K(n,S,W||$,_)})]})},[e,l,w,_,F,U,n,b,I,W,$,S,C,P,T]);return(0,o.Nf)(()=>{const e=z.current;if(!Y||!e)return;let t=!1;const n=()=>{t||((0,s.RK)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}),E?.())};return M===p.IP.Opacity&&(e.style.opacity="0",(0,s.RK)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1",c(e).then(n)})),M===p.IP.Move&&(e.style.transform=`translate3d(0, ${-N*i.yq1-k}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",c(e).then(n)})),M===p.IP.Shift&&(e.style.transform=`translate3d(0, ${-k}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",c(e).then(n)})),M!==p.IP.None?()=>{t=!0}:void 0},[Y,N,k,M,E]),{renderSubtitle:function(){return!e?.isForum||F||L?Q():(0,x.Y)(B,{chat:e,renderLastMessage:Q,observeIntersection:S,topicIds:t,hasTags:D})},ref:z}}function K(e,t,n,o){const i=(0,x.Y)(E.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return i;const s=(0,a.y2)(e);return(0,x.FD)("span",{className:"media-preview",children:[(0,x.Y)("img",{src:n,alt:"",className:(0,l.A)("media-preview--image",o&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,x.Y)(R.A,{name:"play"}),i]})}},24920(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(73767);function a(e){const t=(0,i.A)(),n=(0,o.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},9717(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(66644),s=n(87894),a=n(79882),r=n(30857),d=n(17712),c=n(73767),l=n(35297);const u={};function h(e,t,n){const h=(0,o.Kr)(()=>{if(e)return e.reduce((e,t,n)=>(e[t]=n,e),{})},[e]),m=(0,c.A)(h),p=(0,c.A)(n),g=(0,c.A)(t),f=(0,o.li)(!0);(0,o.vJ)(()=>{(0,i.Uz)(()=>{f.current=!1})},[]);const v=(0,o.li)(u),A=(0,r.A)(),y=(0,d.A)(()=>{v.current!==u&&(v.current=u,A())}),C=void 0!==g?t-g:0;(0,l.A)(()=>{if(!h||!m||n!==p||m===h)return void(v.current=u);const e=(0,s.LG)(h,(e,t)=>void 0!==m[t]?e-m[t]:-1/0),t=Object.values(e).some(e=>0!==e);v.current=t?e:u},[n,h,p,m,t]);const w=(0,a.We)(v.current,f.current,Boolean(C));return{orderDiffById:v.current,shiftDiff:C,getAnimationType:w,onReorderAnimationEnd:y}}},55429(e,t,n){n.d(t,{N:()=>a});var o=n(90709),i=n(70636),s=n(48899);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const d=(0,s.L8)(r)?a[r]:n[r];let c=(0,i.F9)(e,d);const l=n[t.chatId];return l&&("isSelf"in d&&d.isSelf?c=`${e("FromYou")} → ${(0,o.Js)(e,l)}`:(0,o.YE)(l)&&(c+=` → ${(0,o.Js)(e,l)}`)),c}},26087(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(11597),a=n(99375),r=n(69282),d=n(37661),c=n(39351),l=n(64493),u=n(22337),h=n(20021);const m=(0,o.ph)((0,i.EK)(e=>({dialogs:(0,s.nTw)(e).dialogs,currentMessageList:(0,s.Xf0)(e)}))(({dialogs:e,currentMessageList:t})=>{const{dismissDialog:n,sendMessage:s}=(0,i.ko)(),[m,p,g]=(0,d.A)(),f=(0,c.A)();if((0,o.vJ)(()=>{e.length>0&&p()},[e,p]),!e.length)return;const v=(e,t="Telegram")=>(0,h.FD)(u.A,{isOpen:m,onClose:g,onCloseAnimationEnd:n,className:"error",title:t,children:[e,(0,h.Y)("div",{className:"dialog-buttons mt-2",children:(0,h.Y)(l.A,{isText:!0,onClick:g,children:f("OK")})})]});return Boolean(e.length)&&("contact"===(A=e[e.length-1]).type?(y=A.contact,(0,h.FD)(u.A,{isOpen:m,onClose:g,className:"confirm",title:f("ShareYouPhoneNumberTitle"),onCloseAnimationEnd:n,children:[f("AreYouSureShareMyContactInfoBot",void 0,{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}),(0,h.FD)("div",{className:"dialog-buttons mt-2",children:[(0,h.Y)(l.A,{className:"confirm-dialog-button",isText:!0,onClick:()=>{t&&(s({contact:y,messageList:t}),g())},children:f("OK")}),(0,h.Y)(l.A,{className:"confirm-dialog-button",isText:!0,onClick:g,children:f("Cancel")})]})]})):"message"===A.type?(e=>{const t=(0,r.fd)(e.text);return v(t,void 0)})(A):"localized"===A.type?(e=>v(f.with(e.text),void 0))(A):(e=>{const t=e.hasErrorKey?(0,a.Ay)(e):e.entities?.length?(0,r.fd)({text:e.message,entities:e.entities}):e.message;return v(t,function(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}(e))})(A));var A,y}))},15006(e,t,n){n.d(t,{U:()=>u,A:()=>l});var o=n(84051),i=n(13439),s=n(31481),a=n(11597),r=n(6842),d=n(14235);var c=n(20021);const l=(0,o.ph)(()=>(0,c.Y)("div",{className:"AN8wkEiR",id:s.Lj4}));function u(e){const t=(0,i.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),o=n.left+window.scrollX,l=n.top+window.scrollY,u=n.width,m=n.height;if(o+u+50<0||o-50>window.innerWidth||l+m+50<0||l-50>window.innerHeight)return!1;const p=Math.floor(Date.now()/1e3),g=`${s.xcU}-${(0,d.A)()}`,f=(0,c.FD)("svg",{className:"ANWk2pWP",width:u,height:m,style:`left: ${o}px; top: ${l}px;`,viewBox:`0 0 ${u} ${m}`,children:[(0,c.Y)("defs",{children:h(g,Math.min(u,m),p)}),(0,c.Y)("g",{filter:`url(#${g})`,children:(0,c.Y)("foreignObject",{className:"UDCMfXxs",width:u,height:m})})]}),v=(0,r.A)(f)[0],A=v.querySelector("foreignObject"),y=window.getComputedStyle(e),C=e.cloneNode(!0);Array.from(y).forEach(e=>C.style.setProperty(e,y.getPropertyValue(e),"important")),A.appendChild(C);const w=document.getElementById(s.Lj4);return w.appendChild(v),v.addEventListener("animationend",()=>{w.removeChild(v)},{once:!0}),!0}function h(e,t,n=42){return(0,c.FD)("filter",{xmlns:s.jNX,id:e,x:"-150%",y:"-150%",width:"400%",height:"400%","color-interpolation-filters":"sRGB",children:[(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"1",result:"dustNoise",seed:n}),(0,c.Y)("feComponentTransfer",{in:"dustNoise",result:"dustNoiseMask",children:(0,c.Y)("feFuncA",{type:"linear",slope:"5",intercept:"0",children:(0,c.Y)("animate",{attributeName:"slope",values:"5; 2; 1; 0",dur:"1000ms",fill:"freeze"})})}),(0,c.Y)("feComposite",{in:"SourceGraphic",in2:"dustNoiseMask",operator:"in",result:"dustySource"}),(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.015",numOctaves:"1",result:"displacementNoise1",seed:n+1}),(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"1",numOctaves:"2",result:"displacementNoise2",seed:n+2}),(0,c.FD)("feMerge",{result:"combinedNoise",children:[(0,c.Y)("feMergeNode",{in:"displacementNoise1"}),(0,c.Y)("feMergeNode",{in:"displacementNoise2"})]}),(0,c.Y)("feDisplacementMap",{in:"dustySource",in2:"combinedNoise",scale:"0",xChannelSelector:"R",yChannelSelector:"G",children:(0,c.Y)("animate",{attributeName:"scale",values:"0; "+3*t,dur:"1000ms",fill:"freeze"})})]})}},48553(e,t,n){n.d(t,{A:()=>P});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(66644),c=n(90709),l=n(11597),u=n(96454),h=n(48899),m=n(97822),p=n(2178),g=n(39351),f=n(17712),v=n(59030),A=n(87412),y=n(18276),C=n(64493),w=n(22699),I=n(96530),b=n(24433),S=n(60859),M=n(34396),N=n(80089),k=n(80464),Y=n(20021);const F=e=>{const{isOpen:t}=e,n=(0,k.A)(N.ar.Extra,"HeaderMenuContainer",!t);return n?(0,Y.Y)(n,{...e}):void 0},P=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,messageListType:o,isMobile:i})=>{const a=(0,l.hds)(e,t),r=Boolean(a&&(0,c.WX)(a)),d=Boolean(a&&(0,c.Vs)(a)),m=(0,l.wmb)(e),p=(0,l.Qq_)(e),g=(0,h.L8)(t),{doNotTranslate:f,translationTone:v}=e.settings.byKey,A=(0,l._ls)(e,t);if(!a||A||(0,l.rTV)(e))return{noMenu:!0,language:m,translationLanguage:p,doNotTranslate:f,currentTone:v};const y=(0,l.yps)(e,t),C=g?void 0:(0,l.AWZ)(e,t),w=g?(0,l.vGo)(e,t):void 0,I=C||w,b=(0,l.nZ4)(e,t),S="thread"===o&&n===s.l3,M="thread"===o&&n!==s.l3,N=(0,l.gjV)(e,i),k=(0,c.cG)(t,n,e.currentUserId),Y=!!g&&(0,l.apd)(e,t),F=Boolean(y&&Y),P=!F&&Boolean((0,l.I_m)(e,t)),T=Y&&!y,D=Boolean((S||a.isForum)&&(r||d)&&a.isNotJoined&&!a.isMonoforum),x=S||M,L=u.OL&&(0,h.L8)(a.id)&&!b&&!y&&!a.isSupport&&!(0,c.Qe)(a.id),B=S&&!b&&!D,R=k||S&&!D,E=u.OL&&S&&a.isCallActive,O=u.OL&&S&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,c.yn)(a))&&!a.isMonoforum,U=S&&C?.canViewStatistics,K=S&&C?.canViewMonetization,z=S&&!a.isMonoforum&&(d||r)&&(U||(0,c.ub)(a,"postStories")),V=!z&&(d||r)&&!a.isMonoforum,j=S?C?.requestsPending:void 0,G=Boolean(a?.isNotJoined&&a.isJoinToSend),J=Boolean(a?.isNotJoined&&a.isJoinRequest),q=!(0,l.PKK)(e),$=Boolean((0,l.qZq)(e,t)),H=(0,l.jGY)(e,t)&&!I?.isTranslationDisabled,W=(0,l.trm)(e),_=(0,l.g9e)(e,t),Q=(0,c.WX)(a)?a.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:r,isRightColumnShown:N,canStartBot:P,canRestartBot:F,canSubscribe:D,canSearch:x,canCall:L,canMute:B,canViewStatistics:U,canViewMonetization:K,canViewBoosts:z,canShowBoostModal:V,canLeave:R,canEnterVoiceChat:E,canCreateVoiceChat:O,pendingJoinRequests:j,shouldJoinToSend:G,shouldSendJoinRequest:J,noAnimation:q,canTranslate:H,isTranslating:$,translationLanguage:p,language:m,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:T,isAccountFrozen:W,channelMonoforumId:Q,currentTone:_}})(({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:c,canStartBot:l,canRestartBot:h,canUnblock:m,canSubscribe:N,canSearch:k,canCall:P,canMute:D,canViewStatistics:x,canViewMonetization:L,canViewBoosts:B,canShowBoostModal:R,canLeave:E,canEnterVoiceChat:O,canCreateVoiceChat:U,channelMonoforumId:K,pendingJoinRequests:z,isRightColumnShown:V,isForForum:j,canExpandActions:G,shouldJoinToSend:J,shouldSendJoinRequest:q,noAnimation:$,canTranslate:H,isTranslating:W,translationLanguage:_,language:Q,detectedChatLanguage:Z,doNotTranslate:X,isAccountFrozen:ee,currentTone:te,onTopicSearch:ne})=>{const{joinChannel:oe,sendBotCommand:ie,openMiddleSearch:se,restartBot:ae,requestMasterAndRequestCall:re,requestNextManagementScreen:de,showNotification:ce,openChat:le,requestChatTranslation:ue,setChatTranslationTone:he,togglePeerTranslations:me,openChatLanguageModal:pe,setSettingOption:ge,unblockUser:fe,setViewForumAsMessages:ve,openFrozenAccountModal:Ae,openCocoonModal:ye}=(0,i.ko)(),Ce=(0,o.li)(),we=(0,v.A)(),Ie=(0,g.A)(),[be,Se]=(0,o.J0)(!1),[Me,Ne]=(0,o.J0)(void 0),ke=(0,f.A)(()=>{Se(!0);const e=Ce.current.getBoundingClientRect();Ne({x:e.right,y:e.bottom})}),Ye=(0,f.A)(()=>{Se(!1)}),Fe=(0,f.A)(()=>{Ne(void 0)}),Pe=(0,f.A)(()=>{oe({chatId:e}),q&&ce({message:we(c?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})}),Te=(0,f.A)(()=>{ie({command:"/start"})}),De=(0,f.A)(()=>{ae({chatId:e})}),xe=(0,f.A)(()=>{fe({userId:e})}),Le=(0,f.A)(()=>{ue(W?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:_})}),Be=(0,f.A)(()=>{de({screen:a.je.JoinRequests})}),Re=(0,f.A)(()=>{j?ne?.():(se(),$?(0,d.YS)(()=>{(0,d.Uz)(T)}):T())}),Ee=(0,f.A)(()=>{le({id:e}),ve({chatId:e,isEnabled:!0})}),Oe=(0,f.A)(()=>{ee?Ae():re({userId:e})}),Ue=(0,f.A)(e=>{k&&u.lE&&!e.shiftKey&&(e.preventDefault(),Re())}),Ke=(0,o.hb)((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=we(n);if(o!==n)return we(e,o);const i=new Intl.DisplayNames([Q],{type:"language"}).of(t);return we(`${e}Other`,i)},[Q,we]),ze=(0,o.Kr)(()=>W?we("ShowOriginalButton"):Ke("TranslateToButton",_),[_,Ke,W,we]),Ve=(0,o.Kr)(()=>{if(Z)return Ke("DoNotTranslateLanguage",Z)},[Ke,Z]),je=(0,f.A)(()=>{me({chatId:e,isEnabled:!1}),ue({chatId:e,toLanguageCode:void 0})}),Ge=(0,f.A)(()=>{pe({chatId:e})}),Je=(0,f.A)(()=>{ye()}),qe=(0,f.A)(()=>{Z&&(ge({doNotTranslate:[...X,Z]}),ue({chatId:e,toLanguageCode:void 0}),ce({message:Ke("AddedToDoNotTranslate",Z)}))}),$e=(0,f.A)(t=>{he({chatId:e,tone:t}),ge({translationTone:t})});(0,p.v)((0,o.Kr)(()=>({"Mod+F":Ue}),[]));const He=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,Y.Y)(C.A,{round:!0,ripple:V,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:we("TranslateMessage"),iconName:"language"}),[V,we]);return(0,Y.FD)("div",{className:"HeaderActions",children:[!j&&H&&(0,Y.FD)(w.A,{className:"stickers-more-menu with-menu-transitions",trigger:He,positionX:"right",children:[(0,Y.Y)(b.A,{icon:"language",onClick:Le,children:ze}),(0,Y.Y)(b.A,{icon:"replace",onClick:Ge,children:we("Chat.Translate.Menu.To")}),(0,Y.Y)(M.A,{icon:"tone",submenuClassName:"translation-tone-menu",submenu:(0,Y.FD)(Y.FK,{children:[(0,Y.Y)(b.A,{icon:"neutral"===te?"message-succeeded":void 0,customIcon:"neutral"!==te?(0,Y.Y)(y.A,{name:"placeholder"}):void 0,onClick:()=>$e("neutral"),children:Ie("TranslationToneNeutral")}),(0,Y.Y)(b.A,{icon:"formal"===te?"message-succeeded":void 0,customIcon:"formal"!==te?(0,Y.Y)(y.A,{name:"placeholder"}):void 0,onClick:()=>$e("formal"),children:Ie("TranslationToneFormal")}),(0,Y.Y)(b.A,{icon:"casual"===te?"message-succeeded":void 0,customIcon:"casual"!==te?(0,Y.Y)(y.A,{name:"placeholder"}):void 0,onClick:()=>$e("casual"),children:Ie("TranslationToneCasual")})]}),children:Ie("TranslationTone")}),(0,Y.Y)(S.A,{}),Z&&(0,Y.Y)(b.A,{icon:"hand-stop",onClick:qe,children:Ve}),(0,Y.Y)(b.A,{icon:"close-circle",onClick:je,children:we("Hide")}),(0,Y.Y)(S.A,{}),(0,Y.Y)(b.A,{withWrap:!0,onClick:Je,children:Ie("TranslateMenuCocoon",{link:(0,Y.Y)(I.A,{isPrimary:!0,onClick:e=>e.preventDefault(),children:Ie("TranslateMenuCocoonLinkText")})},{withNodes:!0,withMarkdown:!0,specialReplacement:{"🥚":(0,Y.Y)(A.A,{documentId:r.f8_})}})})]}),!s&&(0,Y.FD)(Y.FK,{children:[G&&!q&&(N||J)&&(0,Y.Y)(C.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Pe,children:we(c?"ProfileJoinChannel":"ProfileJoinGroup")}),G&&q&&(0,Y.Y)(C.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Pe,children:we("ChannelJoinRequest")}),G&&l&&(0,Y.Y)(C.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Te,children:we("BotStart")}),G&&h&&(0,Y.Y)(C.A,{size:"tiny",ripple:!0,fluid:!0,onClick:De,children:we("BotRestart")}),G&&m&&(0,Y.Y)(C.A,{size:"smaller",ripple:!0,fluid:!0,onClick:xe,children:we("Unblock")}),k&&(0,Y.Y)(C.A,{round:!0,ripple:V,color:"translucent",size:"smaller",onClick:Re,ariaLabel:we("Conversation.SearchPlaceholder"),iconName:"search"}),P&&(0,Y.Y)(C.A,{round:!0,color:"translucent",size:"smaller",onClick:Oe,ariaLabel:"Call",iconName:"phone"})]}),!j&&Boolean(z)&&(0,Y.Y)(C.A,{round:!0,className:"badge-button",ripple:V,color:"translucent",size:"smaller",iconName:"user",onClick:Be,ariaLabel:we(c?"SubscribeRequests":"MemberRequests"),children:(0,Y.Y)("div",{className:"badge",children:z})}),(0,Y.Y)(C.A,{ref:Ce,className:be?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:ke,iconName:"more"}),Me&&(0,Y.Y)(F,{chatId:e,threadId:t,isOpen:be,anchor:Me,withExtraActions:s||!G,isChannel:c,canStartBot:l,canSubscribe:N,canSearch:k,canCall:P,canMute:D,canViewStatistics:x,canViewBoosts:B,canViewMonetization:L,canShowBoostModal:R,canLeave:E,canEnterVoiceChat:O,canCreateVoiceChat:U,pendingJoinRequests:z,onJoinRequestsClick:Be,withForumActions:j,channelMonoforumId:K,onSubscribeChannel:Pe,onSearchClick:Re,onAsMessagesClick:Ee,onClose:Ye,onCloseAnimationEnd:Fe})]})}));function T(){const e=document.querySelector("#MiddleSearch input");e&&(0,m.A)(e)}},46442(e,t,n){n.d(t,{A:()=>lt});var o=n(84051),i=n(61433),s=n(13439),a=n(23174),r=n(89925),d=n(31481),c=n(66644),l=n(90709),u=n(11597),h=n(21133),m=n(19408),p=n(96115),g=n(81954),f=n(96454),v=n(87357),A=n(48899),y=n(87894),C=n(60343),w=n(9718),I=n(37836),b=n(16460),S=n(76023),M=n(58744);function N(e){return"albumId"in e}function k(e){return"documentGroupId"in e}function Y(e,t,n,o,i){let s,a;const r=[{originalDate:e[0].date,datetime:(0,M.CS)(1e3*e[0].date),senderGroups:[[]]}];return e.forEach((d,c)=>{const u=r[r.length-1],h=u.senderGroups[u.senderGroups.length-1];d.isInAlbum?s?(s.messages.push(d),d.hasComments&&(s.commentsMessage=d),d.content.text&&!s.hasMultipleCaptions&&(s.captionMessage?(s.hasMultipleCaptions=!0,s.captionMessage=void 0):s.captionMessage=d)):s={albumId:d.groupedId,messages:[d],mainMessage:d,hasMultipleCaptions:!1,commentsMessage:d.hasComments?d:void 0,captionMessage:d.content.text?d:void 0}:(d.content.paidMedia?.extendedMedia.length||0)>1?h.push({albumId:`paid-${d.id}`,messages:[d],mainMessage:d,hasMultipleCaptions:!1,isPaidMedia:!0}):d.groupedId?a?(a.messages.push(d),d.hasComments&&(a.commentsMessage=d)):a={documentGroupId:d.groupedId,messages:[d],firstMessageId:d.id,commentsMessage:d.hasComments?d:void 0}:h.push(d);const m=e[c+1];!s||m&&m.groupedId&&m.groupedId===s.albumId||(h.push(s),s=void 0),!a||m&&m.groupedId&&m.groupedId===a.documentGroupId||(h.push(a),a=void 0);const p=h[h.length-1];if(m&&!s&&!a){const e=(0,M.CS)(1e3*m.date);if(u.datetime!==e){const t={originalDate:m.date,datetime:e,senderGroups:[[]]};r.push(t)}else(m.id===t||d.senderId!==m.senderId||!i&&d.paidMessageStars||m.suggestedPostInfo||d.isOutgoing!==m.isOutgoing||d.postAuthorTitle!==m.postAuthorTitle||(0,l._P)(d)&&"phoneCall"!==d.content.action?.type||(0,l._P)(m)&&"phoneCall"!==m.content.action?.type||d.inlineButtons||m.inlineButtons||m.date-d.date>600||n&&(d.id===n||p&&(N(p)&&p.mainMessage.id===n||k(p)&&p.firstMessageId===n))&&m.id!==n&&(!d.groupedId||d.groupedId!==m.groupedId)||o&&d.forwardInfo?.fromId!==m.forwardInfo?.fromId)&&u.senderGroups.push([])}}),r}var F=n(32332),P=n(54464),T=n(32625),D=n(82117),x=n(17712),L=n(37859),B=n(81686),R=n(2178);var E=n(41257),O=n(35297),U=n(61157),K=n(93545),z=n(37661),V=n(56133);var j=n(52745),G=n(41036),J=n(59030),q=n(82855);var $=n(20021);const H=(0,o.ph)((0,s.EK)((e,{userId:t})=>{const{stickers:n}=e.stickers.greeting,o=(0,u.hds)(e,t);if(!o)return{};const i=(0,u.mBe)(e,t),s=(0,u.vGo)(e,t),{unreadCount:r}=(0,p.a1)(e,o.id,a.l3)||{},d=(0,u.ZZX)(e,o.id);return{defaultStickers:n,lastMessageId:r?d:void 0,connectionState:e.connectionState,currentMessageList:(0,u.Xf0)(e),businessIntro:s?.businessIntro,user:i}})(({defaultStickers:e,connectionState:t,lastMessageId:n,currentMessageList:i,businessIntro:a,user:r})=>{const{loadGreetingStickers:d,sendMessage:c,markMessageListRead:u}=(0,s.ko)(),h=(0,J.A)(),m=(0,o.li)(),p=(0,o.Kr)(()=>{if(a?.sticker)return a.sticker;if(!e?.length)return;const t=Math.floor(Math.random()*e.length);return e[t]},[a?.sticker,e]);(0,o.vJ)(()=>{e?.length||"connectionStateReady"!==t||d()},[t,d,e]),(0,o.vJ)(()=>{"connectionStateReady"===t&&n&&u({maxId:n})},[t,n]);const g=(0,x.A)(()=>{i&&c({sticker:{...p,isPreloadedGlobally:!0},messageList:i})}),f=a?.title||h("Conversation.EmptyPlaceholder"),v=a?.description||h("Conversation.GreetingText");return(0,$.FD)("div",{className:"osdROIcA",children:[(0,$.FD)("div",{className:"c3NtU3JZ",children:[(0,$.Y)("p",{className:"n2KO1cAv",dir:"auto",children:f}),(0,$.Y)("p",{className:"MVSedxKc",dir:"auto",children:v}),(0,$.Y)("div",{ref:m,className:"qsfxNv7L",onClick:g,children:p&&(0,$.Y)(q.A,{containerRef:m,sticker:p,size:160,shouldLoop:!0})})]}),a&&(0,$.Y)("div",{className:"WIbO6rja",children:h("Chat.EmptyStateIntroFooter",(0,l.Yg)(r))})]})}));var W=n(95807),_=n(52491),Q=n(64713),Z=n(83868),X=n(4961),ee=n(39351),te=n(62587),ne=n(26875),oe=n(18276),ie=n(92108),se=n(96530),ae=n(65843),re=n(55158);const de="ubFGDy3d",ce="kpMdEhns",le="mtKNWJmZ",ue="BH_g_jqY",he=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const{countryList:{phoneCodes:n}}=e,o=(0,u.hds)(e,t),i=(0,u.vGo)(e,t),s=(0,u.Ua4)(e,t);let a,r=!1;return(0,u.yps)(e,t)&&(i?a=i.botInfo:r=!0),{chat:o,userFullInfo:i,botInfo:a,isLoadingFullUser:r,phoneCodeList:n,commonChats:s}})(({chat:e,chatId:t,botInfo:n,isLoadingFullUser:i,phoneCodeList:a,commonChats:r,userFullInfo:d,hasMessages:c})=>{const{loadCommonChats:h,openChatWithInfo:m}=(0,s.ko)(),p=(0,J.A)(),g=(0,ee.A)(),{phoneCountry:f,registrationMonth:A,nameChangeDate:y,photoChangeDate:C}=d?.settings||{};(0,o.vJ)(()=>{h({userId:t})},[t]);const w=(0,o.Kr)(()=>{if(a&&f)return(0,Q.gH)(a,f)},[a,f]),I=(0,te.A)(n?.photo?(0,l.Fi)(n.photo):void 0),b=(0,te.A)(n?.gif?(0,l.sC)(n.gif,"full"):void 0),S=n?.photo?(0,l.Xn)(n.photo):n?.gif?(0,l.NZ)(n.gif):void 0,N=n&&!n.description&&!n.gif&&!n.photo,k=!w||!A,Y=(0,l.Rl)(t),{width:F,height:P}=S||{},T=(0,x.A)(e=>{(0,Z.A)(e),m({id:t,shouldReplaceHistory:!0,profileTab:"commonChats",forceScrollProfileTab:!0})}),D=y&&e?(0,$.Y)("div",{className:"local-action-message",children:(0,$.Y)("span",{children:g("UserUpdatedName",{user:e.title,time:(0,M.vm)(g,y)},{withNodes:!0,withMarkdown:!0})})},"security-name-message"):void 0,L=C&&e?(0,$.Y)("div",{className:"local-action-message",children:(0,$.Y)("span",{children:g("UserUpdatedPhoto",{user:e.title,time:(0,M.vm)(g,C)},{withNodes:!0,withMarkdown:!0})})},"security-photo-message"):void 0,B=(0,o.Kr)(()=>{const e=[];if(w&&e.push([p("PrivacyPhone"),(0,$.FD)("span",{className:"TYJGFKqJ",children:[(0,$.Y)("span",{className:"WuX68A65",children:(0,X.A)((0,_.D0)(w?.iso2))}),w?.defaultName]})]),A&&e.push([g("ContactInfoRegistration"),(0,M.BR)(g.code,A)]),d?.commonChatsCount){const t=(0,s.mS)(),n=r?.ids.slice(0,3).map(e=>(0,u.PVB)(t,e)).filter(Boolean);e.push([g("ChatNonContactUserGroups"),(0,$.FD)(se.A,{className:"yIJ4jRxH",onClick:T,children:[(0,$.Y)("span",{className:"_MPDNfhr",children:g("ChatGroups",{count:d.commonChatsCount},{pluralValue:d.commonChatsCount})}),Boolean(n?.length)&&(0,$.Y)(ne.A,{size:"micro",peers:n}),(0,$.Y)(oe.A,{name:"next",className:"KYcoeDmo"})]})])}return e},[g,p,w,A,r,d]);return(0,$.FD)("div",{className:(0,v.A)("tFPZHCMt","empty"),children:[i&&k&&(0,$.Y)("span",{children:p("Loading")}),N&&k&&!i&&!c&&(0,$.Y)("span",{children:p("NoMessages")}),n&&(0,$.FD)("div",{className:(0,v.A)(de,"kXKBpNnb"),style:(0,W.A)(F?`width: ${F}px`:void 0),children:[I&&(0,$.Y)("img",{className:le,src:I,width:F,height:P,alt:"Bot info"}),b&&(0,$.Y)(ae.A,{canPlay:!0,className:le,src:b,loop:!0,disablePictureInPicture:!0,muted:!0,playsInline:!0,style:(0,W.A)(Boolean(F)&&`width: ${F}px`,Boolean(P)&&`height: ${P}px`)}),S&&!I&&!b&&(0,$.Y)(re.A,{className:le,width:F,height:P,forceAspectRatio:!0,animation:"pulse"}),Y&&(0,$.Y)("div",{className:ce,children:p("VerifyChatInfo")}),!Y&&n.description&&(0,$.FD)("div",{className:ce,children:[(0,$.Y)("p",{className:"H__cBlx8",children:p("BotInfoTitle")}),(0,X.A)(n.description,["br","emoji","links"])]})]}),!k&&e&&(0,$.FD)("div",{className:(0,v.A)(de,"niS9Gfcl"),children:[(0,$.Y)("h3",{className:"RyB2zw9K",children:(0,X.A)((0,l.Js)(g,e))}),(0,$.Y)("p",{className:(0,v.A)("n9OcHdnh",ue),children:g("ChatNonContactUserSubtitle")}),(0,$.Y)(ie.A,{keyClassName:ue,data:B}),!e?.isVerified&&(0,$.FD)("div",{className:(0,v.A)("sCB3zhO3",ue),children:[(0,$.Y)(oe.A,{name:"info-filled"}),(0,$.Y)("p",{className:"dlaTjW_s",children:g("ContactInfoNotVerified")})]})]}),D,L]})}));var me=n(70636),pe=n(17142),ge=n(19801),fe=n(48775),ve=n(4262),Ae=n(83414),ye=n(73767),Ce=n(43874),we=n(5912);const Ie=f.Ni?1e3:350;var be=n(63988),Se=n(16581),Me=n(5718),Ne=n(47594),ke=n(18444),Ye=n(10722),Fe=n(34201),Pe=n(21849),Te=n(71429),De=n(24433);const xe="FHxnbOg6",Le=(0,o.ph)((0,s.EK)((e,t)=>{const{message:n,withAvatar:o}=t,{chatId:i}=n,s=(0,u.hds)(e,i),a=(0,u.nZ4)(e,i),r=(0,l.DX)(i),d=(0,l.Qe)(i),c=!a&&(0,l.zP)(n),h=o||c;return{sender:(0,u.Y7C)(e,n),canShowSender:h,originSender:(0,u.Szq)(e,n),isChatWithSelf:a,isRepliesChat:r,isAnonymousForwards:d,isChannel:s&&(0,l.WX)(s)}})(({message:e,withAvatar:t,children:n,id:i,appearanceOrder:a,sender:r,canShowSender:c,originSender:u,isChatWithSelf:h,isRepliesChat:m,isAnonymousForwards:p,isChannel:g,canPost:f})=>{const{openChat:A,updateInsertingPeerIdMention:y,openMiddleSearch:C}=(0,s.ko)(),{forwardInfo:w}=e,I=c?r:void 0,b=(0,ee.A)(),S=a<=0,[M,N]=(0,z.A)(S);(0,o.vJ)(()=>{S||setTimeout(N,a*d.zq7)},[a,S]);const k=w&&(h||m||p||!I)?u:I,Y=k&&(0,me.mO)(k),F=(0,x.A)(()=>{k&&A({id:k.id})}),P=(0,x.A)(()=>{k&&document.querySelector(d.m$5)&&y({peerId:k.id})}),T=(0,x.A)(()=>{k&&C({fromPeerId:k.id})}),D=(0,x.A)(()=>{F()}),{ref:L,shouldRender:B}=(0,Fe.A)({isOpen:t&&M,noMountTransition:M,withShouldRender:!0}),{isContextMenuOpen:R,contextMenuAnchor:E,handleContextMenu:O,handleContextMenuClose:U,handleContextMenuHide:K}=(0,Ye.A)(L),V=(0,x.A)(()=>L.current),j=(0,x.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),G=(0,x.A)(()=>L?.current?.querySelector(`.${xe} .bubble`)),J=(0,x.A)(()=>({withPortal:!0})),q=f&&k&&(Y||Boolean((0,l.Kl)(k))),H=!g,W=Boolean(E)&&(Y||q||H),_=(0,v.A)("sender-group-container","Tk8btfOT");return(0,$.FD)("div",{id:i,className:_,children:[B&&(0,$.FD)("div",{ref:L,className:"UPrRM3Ks",children:[function(){const e=!k&&w?w.hiddenUserName:void 0;return(0,$.Y)(Pe.A,{size:"small",className:"jdvqXfYh",peer:k,text:e,onClick:k?D:void 0,onContextMenu:O})}(),W&&(0,$.Y)(Te.A,{isOpen:R,anchor:E,getTriggerElement:V,getRootElement:j,getLayout:J,getMenuElement:G,className:xe,onClose:U,onCloseAnimationEnd:K,withPortal:!0,autoClose:!0,children:(0,$.FD)($.FK,{children:[Y&&(0,$.Y)(De.A,{icon:"comments",onClick:F,children:b("SendMessage")}),q&&(0,$.Y)(De.A,{icon:"mention",onClick:P,children:b("ContextMenuItemMention")}),H&&(0,$.Y)(De.A,{icon:"search",onClick:T,children:b("Search")})]})})]}),n]})}));var Be=n(56494),Re=n(69282),Ee=n(35127),Oe=n(81949),Ue=n(86070),Ke=n(64493),ze=n(48906),Ve=n(51644),je=n(80089),Ge=n(80464);const Je=e=>{const{isOpen:t}=e,n=(0,Ge.A)(je.ar.Extra,"SponsoredContextMenuContainer",!t);return n?(0,$.Y)(n,{...e}):void 0};var qe=n(25477);const $e=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const n=(0,u.v8U)(e,t),o=(0,u.yuw)(e),i=n?(0,Be.iS)(e,n):void 0,s=i&&(0,l.$r)(o,i);return{message:n,theme:(0,u.SJA)(e),isDownloading:s,canAutoLoadMedia:n?(0,u.wwb)(e,n):void 0,canAutoPlayMedia:n?(0,u.OEt)(e,n):void 0}})(({chatId:e,message:t,containerRef:n,theme:i,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,isDownloading:c,canAutoLoadMedia:u,canAutoPlayMedia:h})=>{const{viewSponsored:m,openUrl:p,hideSponsored:g,clickSponsored:A,openMediaViewer:y,openAboutAdsModal:C}=(0,s.ko)(),w=(0,J.A)(),I=(0,o.li)(),b=(0,o.li)(),S=Boolean(t),{isMobile:M}=(0,Ce.Ay)(),{observe:N}=(0,we.BL)({rootRef:n,debounceMs:200,threshold:1}),{isContextMenuOpen:k,contextMenuAnchor:Y,handleBeforeContextMenu:F,handleContextMenu:T,handleContextMenuClose:D,handleContextMenuHide:L}=(0,Ye.A)(b,void 0,!0,f.Ni);(0,o.vJ)(()=>S?N(I.current,e=>{e.isIntersecting&&t?.randomId&&m({randomId:t.randomId})}):void 0,[t?.randomId,S,N,m]);const B=(0,x.A)(()=>{g()}),R=t&&(0,l.r_)(t),{photo:E,video:O,text:U}=R||{},K=O?.isGif,z=Boolean(E||O),V=(0,x.A)(()=>{t&&(A({randomId:t.randomId,isMedia:!(!E&&!K)||void 0}),p({url:t.url,shouldSkipModal:!0}))}),j=(0,x.A)(()=>{t&&(A({randomId:t.randomId,isMedia:!0}),y({origin:r.TQ.SponsoredMessage,chatId:e,isSponsoredMessage:!0}))}),G=(0,x.A)(()=>{t&&C({randomId:t.randomId,canReport:t.canReport,additionalInfo:t.additionalInfo,sponsorInfo:t.sponsorInfo})}),q=(0,o.Kr)(()=>{let e,t,n="";if(E||O){let n;E?n=(0,Ee.yA)({media:E,isMobile:M}).width:O&&(n=(0,Ee.yA)({media:O,isMobile:M}).width),n&&(n<(0,Ee.Ay)(M)&&(t=n),e=Math.max((0,Ee.nP)(U?.text,M),n))}return e&&(n=`width: ${e+0}px`),{contentWidth:t,noMediaCorners:!1,style:n}},[E,O,M,U?.text]),{contentWidth:H,style:W}=q;if(t&&t.content)return(0,$.FD)("div",{ref:b,className:"SponsoredMessage Message open sponsored-media-preview",children:[(0,$.FD)("div",{className:"message-content media has-shadow has-solid-background has-appendix",dir:"auto",style:W,onMouseDown:e=>{(0,P.l)(e),F(e)},onContextMenu:T,children:[(0,$.FD)(Ue.A,{peerColor:t.peerColor,className:"content-inner",dir:"auto",children:[function(){if(t)return E?(0,$.Y)(Ve.A,{photo:E,theme:i,canAutoLoad:u,isDownloading:c,observeIntersection:a,noAvatars:!0,onClick:V,forcedWidth:H}):O?(0,$.Y)(qe.A,{video:O,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,noAvatars:!0,canAutoLoad:u,canAutoPlay:h,isDownloading:c,onClick:K?V:j,forcedWidth:H}):void 0}(),t.photo&&(0,$.Y)(Pe.A,{size:"large",photo:t.photo,className:(0,v.A)("channel-avatar",w.isRtl&&"is-rtl")}),(0,$.FD)("span",{className:(0,v.A)("message-title message-type",z&&"has-media"),children:[t.isRecommended?w("Message.RecommendedLabel"):w("SponsoredMessage"),(0,$.Y)(Oe.A,{onClick:G,className:"ad-about",children:w("SponsoredMessageAdWhatIsThis")})]}),function(){if(t)return(0,$.FD)($.FK,{children:[(0,$.Y)("div",{className:"message-title message-peer",dir:"auto",children:t.title}),Boolean(t.content?.text)&&(0,$.Y)("div",{className:"text-content with-meta",dir:"auto",ref:I,children:(0,$.Y)("span",{className:"text-content-inner",dir:"auto",children:(0,Re.fd)({text:t.content.text.text,entities:t.content.text.entities})})}),(0,$.Y)(Ke.A,{className:"SponsoredMessage__button",size:"tiny",color:"translucent",isRectangular:!0,onClick:V,children:t.buttonText})]})}()]}),(0,$.Y)(ze.A,{}),(0,$.Y)("div",{className:"message-action-buttons-container",children:(0,$.Y)("div",{className:"message-action-buttons-sticky-zone",children:(0,$.FD)("div",{className:"message-action-buttons message-action-button-sticky",children:[(0,$.Y)(Ke.A,{className:"message-action-button",color:"translucent-white",round:!0,iconName:"close",iconClassName:"sponsored-action-icon",ariaLabel:w("Close"),onClick:B}),t.canReport&&(0,$.Y)(Ke.A,{className:"message-action-button",color:"translucent-white",round:!0,iconName:"more",iconClassName:"sponsored-action-icon",ariaLabel:w("More"),onClick:T,onContextMenu:T})]})})})]}),Y&&(0,$.Y)(Je,{isOpen:k,anchor:Y,triggerRef:b,randomId:t.randomId,canReport:t.canReport,sponsorInfo:t.sponsorInfo,additionalInfo:t.additionalInfo,onClose:D,onCloseAnimationEnd:L})]},"sponsored-message")}));var He=n(42211);const We=(0,o.ph)(({isFocused:e,className:t})=>{const n=(0,o.li)();return(0,He.A)({elementRef:n,isJustAdded:!0,isFocused:e,noFocusHighlight:!0}),(0,$.Y)("div",{ref:n,className:(0,v.A)("list-bottom-marker",t)})});var _e=n(50805);const Qe=(0,o.ph)(({canShowAds:e,chatId:t,threadId:n,messageIds:i,messageGroups:h,getContainerHeight:m,isViewportNewest:p,isUnread:g,isComments:A,isEmptyThread:C,withUsers:w,isChannelChat:b,isChatMonoforum:S,canManageBotForumTopics:Y,noAvatars:F,containerRef:T,anchorIdRef:D,memoUnreadDividerBeforeIdRef:L,memoFirstUnreadIdRef:B,type:R,isReady:E,hasLinkedChat:K,isSchedule:z,shouldRenderAccountInfo:V,nameChangeDate:j,photoChangeDate:G,noAppearanceAnimation:q,isSavedDialog:H,isQuickPreview:W,shouldScrollToBottom:_,canPost:Q,onScrollDownToggle:Z,onNotchToggle:X,onIntersectPinnedMessage:te,onTallTypingDraft:ne})=>{const{openHistoryCalendar:se}=(0,s.ko)(),ae=o.OV,re=(0,Ae.A)(()=>E&&!ae(),[E,ae]),de=!H&&!z,ce=e&&p,le=!1===K||!b||Boolean(S),{observeIntersectionForReading:ue,observeIntersectionForLoading:Ye,observeIntersectionForPlaying:Fe,onMessageUnmount:Pe}=function({type:e,containerRef:t,memoFirstUnreadIdRef:n,chatId:i,threadId:a,isQuickPreview:r,onIntersectPinnedMessage:d}){const{markMessageListRead:c,markMentionsRead:l,markPollVotesRead:u,animateUnreadReaction:h,scheduleForViewsIncrement:m}=(0,s.ko)(),{isMobile:p}=(0,Ce.Ay)(),g=p?300:500,f=(0,o.li)([]);(0,o.vJ)(()=>{f.current=[]},[a,i,e]);const{observe:v,freeze:A,unfreeze:C}=(0,we.BL)({rootRef:t,throttleMs:150,threshold:0,shouldSkipFirst:!0},t=>{if("thread"!==e||(0,U.g1)())return;let o=0;const s=[],a=[],p=[],g=[],v=f.current,A=new Set,C=[];t.forEach(e=>{const{isIntersecting:t,target:n}=e,{dataset:i}=n,r=Number(i.lastMessageId||i.messageId),d="true"===i.shouldUpdateViews,c=i.albumMainId?Number(i.albumMainId):void 0;t?(C.push(r),r>o&&(o=r),i.hasUnreadMention&&s.push(r),i.hasUnreadPollVote&&a.push(r),i.hasUnreadReaction&&p.push(r),d&&g.push(c||r)):A.add(r)}),f.current=(0,y.Am)(v.concat(C)).filter(e=>!A.has(e)).sort((e,t)=>e-t),r||(n.current&&o&&o>=n.current&&c({maxId:o}),s.length&&l({chatId:i,messageIds:s}),a.length&&u({chatId:i,messageIds:a}),g.length&&m({chatId:i,ids:g})),p.length&&h({chatId:i,messageIds:p}),f.current.length&&d?.({firstViewportId:f.current[0]})});(0,U.Ay)(A,C);const{observe:w}=(0,we.BL)({rootRef:t,throttleMs:Ie,margin:g}),{observe:I}=(0,we.BL)({rootRef:t,throttleMs:Ie});return{observeIntersectionForReading:v,observeIntersectionForLoading:w,observeIntersectionForPlaying:I,onMessageUnmount:(0,x.A)(e=>{f.current=f.current.filter(t=>t!==e)})}}({type:R,containerRef:T,memoFirstUnreadIdRef:B,chatId:t,threadId:n,isQuickPreview:W,onIntersectPinnedMessage:te}),{withHistoryTriggers:Te,backwardsTriggerRef:De,forwardsTriggerRef:xe,fabTriggerRef:Be,observeIntersectionForTopExit:Re}=function({type:e,containerRef:t,messageIds:n,getContainerHeight:i,isViewportNewest:a,isUnread:d,isReady:l,onScrollDownToggle:u,onNotchToggle:h}){const{loadViewportMessages:m}=(0,s.ko)(),[p,g]=(0,o.Kr)(()=>"thread"===e?[(0,I.sg)(()=>m({direction:r.TN.Backwards}),1e3,!0,!1),(0,I.sg)(()=>m({direction:r.TN.Forwards}),1e3,!0,!1)]:[],[m,n]),v=(0,o.li)(),A=(0,o.li)(),y=(0,o.li)(),C=(0,x.A)((e,t)=>{u?.(e),h?.(t)}),w=(0,Se.A)(C,[C],100,!0,!1),b=(0,x.A)(()=>{if(!l)return;if(!n?.length)return void C(!1,!1);if(!a)return void w(!0,!0);const e=t.current,o=y.current;if(!e||!o)return;const{offsetHeight:i,scrollHeight:s,scrollTop:r}=e,c=o.offsetTop,u=Math.round(c-r-i),h=u<=1;0!==s&&w(d?!h:!(u<=50),!h)}),{observe:S}=(0,we.BL)({rootRef:t,margin:f.et},e=>{g&&p&&e.forEach(({isIntersecting:e,target:t})=>{e&&("backwards-trigger"===t.className&&p(),"forwards-trigger"===t.className&&g())})}),M=n&&n.length>1;(0,we.mv)(v,M?S:void 0),(0,we.mv)(A,M?S:void 0);const{observe:N,freeze:k,unfreeze:Y}=(0,we.BL)({rootRef:t,margin:100,throttleScheduler:c.YS},b);(0,we.mv)(y,N);const{observe:F,freeze:P,unfreeze:T}=(0,we.BL)({rootRef:t,margin:1,throttleScheduler:c.YS},b);(0,we.mv)(y,F);const{observe:D}=(0,we.BL)({rootRef:t,margin:"-50px 0px 0px 0px",throttleScheduler:c.YS});(0,o.vJ)(()=>{l&&b()},[l]),(0,o.vJ)(()=>{const e=t.current;if(e)return e.addEventListener("scrollend",b),()=>{e.removeEventListener("scrollend",b)}},[t]);const L=(0,x.A)(()=>{k(),P(),setTimeout(()=>{T(),Y()},350)});(0,O.A)(L,[L,n]);const B=(0,be.D7)(i,200);return(0,Me.R)(L,[L,B]),{withHistoryTriggers:M,backwardsTriggerRef:v,forwardsTriggerRef:A,fabTriggerRef:y,observeIntersectionForTopExit:D}}({type:R,containerRef:T,messageIds:i,getContainerHeight:m,isViewportNewest:p,isUnread:g,isReady:E,onScrollDownToggle:Z,onNotchToggle:X}),Ee=(0,J.A)(),Oe=(0,ee.A)(),Ue=(0,$.Y)("div",{className:(0,v.A)("unread-divider","local-action-message"),children:(0,$.Y)("span",{children:Ee("UnreadMessages")})},"unread-messages"),Ke=(e,t)=>{if(e.paidMessageStars){const n=t?.messages?.length||1,o=e.paidMessageStars*n;return(0,$.Y)("div",{className:(0,v.A)("local-action-message"),children:(0,$.Y)("span",{children:e.isOutgoing?Oe("ActionPaidOneMessageOutgoing",{amount:(0,fe.Kk)(Oe,o)}):(()=>{const t=(0,u.Y7C)((0,s.mS)(),e),n=t?(0,me.F9)(Oe,t):"";return Oe("ActionPaidOneMessageIncoming",{user:n,amount:(0,fe.Kk)(Oe,o)})})()})},`paid-messages-action-${e.id}`)}},ze=e=>{if(e.suggestedPostInfo){const{price:t,scheduleDate:n}=e.suggestedPostInfo,o=(0,u.Y7C)((0,s.mS)(),e),i=o?(0,me.F9)(Oe,o):"",a=(0,ve.Nm)(o?.id,i||Oe("ActionFallbackUser")),r="message"===e.replyInfo?.type&&e.replyInfo.replyToMsgId?(0,u.O5q)((0,s.mS)(),e.chatId,e.replyInfo.replyToMsgId):void 0,d=(0,l.Do)(e,r)?(0,l.EQ)(Oe,e,r,e.isOutgoing,a):e.isOutgoing?Oe("ActionSuggestedPostOutgoing",void 0,{withNodes:!0,withMarkdown:!0}):Oe("ActionSuggestedPostIncoming",{user:a},{withNodes:!0,withMarkdown:!0}),c=(0,y.oE)([[Oe("TitlePrice"),t?"TON"===t.currency?(0,fe.QH)(Oe,(0,pe.wD)(t.amount)):(0,fe.Kk)(Oe,t.amount):Oe("SuggestMessageNoPrice")],[Oe("TitleTime"),n?(0,M.e0)(n,Oe,Ee):Oe("SuggestMessageAnytime")]]);return(0,$.Y)("div",{className:(0,v.A)("local-action-message"),children:(0,$.FD)("span",{className:_e.A.suggestedPostContainer,children:[(0,$.Y)("div",{className:_e.A.suggestedPostTitle,children:d}),Boolean(c.length)&&(0,$.Y)(ie.A,{className:_e.A.suggestedPostInfo,data:c})]})},`suggested-post-action-${e.id}`)}},Ve=q?0:h.reduce((e,t)=>e+t.senderGroups.flat().reduce((e,t)=>e+(k(t)?t.messages.length:1),0),0);let je=0;const Ge=(0,ye.A)(i),Je=Boolean(i&&Ge&&i[i.length-2]===Ge[Ge.length-1]),qe=h.map((e,t,o)=>{const i=function(e,t,o){return e.senderGroups.map((e,i,s)=>{if(1===e.length&&!N(e[0])&&!k(e[0])&&(0,l._P)(e[0])&&"phoneCall"!==e[0].content.action?.type){const a=e[0],r=i===s.length-1&&t===o.length-1;return(0,y.oE)([a.id===L.current&&Ue,(0,$.Y)(Ne.A,{message:a,threadId:n,observeIntersectionForBottom:ue,observeIntersectionForLoading:Ye,observeIntersectionForPlaying:Fe,memoFirstUnreadIdRef:B,appearanceOrder:Ve-++je,isJustAdded:r&&Je,isLastInList:r,getIsMessageListReady:re,onMessageUnmount:Pe},a.id)])}let r=!1;const d=e.map((d,c)=>{function u(e,t,o,i,s){const r=(0,l.Ie)(e),d=(0,l.sj)(e),c=(0,l.u7)(e)?`${e.date}_${d}`:d;return(0,y.oE)([e.id===L.current&&Ue,e.paidMessageStars&&!w&&Ke(e,i),e.suggestedPostInfo&&ze(e),(0,$.Y)(ke.A,{message:e,observeIntersectionForBottom:ue,observeIntersectionForLoading:Ye,observeIntersectionForPlaying:Fe,album:i,documentGroup:s,noAvatars:F,withAvatar:t.isLastInGroup&&w&&!r&&(!o||!A),withSenderName:t.isFirstInGroup&&w&&!r,threadId:n,messageListType:R,noComments:le,noReplies:!le||n!==a.l3||"scheduled"===R,appearanceOrder:Ve-++je,isJustAdded:t.isLastInList&&Je,isThreadTop:o,isFirstInGroup:t.isFirstInGroup,isLastInGroup:t.isLastInGroup,isFirstInDocumentGroup:t.isFirstInDocumentGroup,isLastInDocumentGroup:t.isLastInDocumentGroup,isLastInList:t.isLastInList,memoFirstUnreadIdRef:B,getIsMessageListReady:re,observeIntersectionForTopExit:Re,onMessageUnmount:Pe,onTallTypingDraft:ne},c)])}if(k(d)){const a=d;return a.messages.map((d,h)=>{const m=0===h,p=h===a.messages.length-1;d.previousLocalId&&D.current===(0,l.GZ)(d.previousLocalId)&&(D.current=(0,l.GZ)(d.id)),m&&d.id===n&&(r=!0);const g=d.id===n||r;return p&&(r=!1),u(d,{isFirstInGroup:0===c&&m,isLastInGroup:c===e.length-1&&p,isFirstInDocumentGroup:m,isLastInDocumentGroup:p,isLastInList:c===e.length-1&&p&&i===s.length-1&&t===o.length-1},g,void 0,a)}).flat()}const h=N(d)?d.mainMessage:d,m=N(d)?d:void 0;h.previousLocalId&&D.current===(0,l.GZ)(h.previousLocalId)&&(D.current=(0,l.GZ)(h.id));const p=h.id===n;return u(h,{isFirstInGroup:0===c,isLastInGroup:c===e.length-1,isFirstInDocumentGroup:!1,isLastInDocumentGroup:!1,isLastInList:c===e.length-1&&i===s.length-1&&t===o.length-1},p,m)}).flat();if(!w)return d;const c=e[e.length-1],u=N(c)?c.mainMessage:k(c)?c.messages[c.messages.length-1]:c,h=(0,l.sj)(u),m=Ve-je,p=(0,l.Ie)(u),g=e[0],f=N(g)?g.mainMessage:k(g)?g.messages[0]:g,v=(0,l.sj)(f),I=u.id===n||f.id===n&&Boolean(f.groupedId),b=`${v}-${h}`,S=v===h?`message-group-${v}`:`message-group-${v}-${h}`,M=w&&!p&&(!I||!A);return(0,y.oE)([(0,$.Y)(Le,{id:S,message:u,withAvatar:M,appearanceOrder:m,canPost:Q,children:d},b),I&&(0,$.Y)("div",{className:"local-action-message",children:(0,$.Y)("span",{children:Ee(C?A?"NoComments":"NoReplies":"DiscussionStarted")})},`discussion-started-${h}`)])}).flat()}(e,t,o);return(0,$.FD)("div",{className:(0,v.A)("message-date-group",!(j||G)&&0===t&&"first-message-date-group"),onMouseDown:P.l,teactFastList:!0,children:[(0,$.Y)("div",{className:(0,v.A)("sticky-date",de&&"interactive"),onMouseDown:P.l,onClick:de?()=>se({selectedAt:e.datetime}):void 0,children:(0,$.FD)("span",{dir:"auto",children:[z&&e.originalDate===d.NkL&&Ee("MessageScheduledUntilOnline"),z&&e.originalDate!==d.NkL&&Ee("MessageScheduledOn",(0,M.F5)(Ee,e.datetime,void 0,!0)),!z&&(0,ge.$r)(Oe,new Date(e.datetime))]})},"date-header"),i.flat()]},e.datetime)});return(0,$.FD)("div",{className:"messages-container",teactFastList:!0,children:[Te&&(0,$.Y)("div",{ref:De,className:"backwards-trigger"},"backwards-trigger"),V&&(0,$.Y)(he,{chatId:t,hasMessages:!0},`account_info_${t}`),qe.flat(),p&&(()=>{if(Y&&n===a.l3)return(0,$.Y)("div",{className:(0,v.A)("local-action-message",_e.A.root),children:(0,$.FD)("div",{className:_e.A.contentBox,children:[(0,$.Y)(oe.A,{className:_e.A.botForumTopicIcon,name:"topic-new"}),(0,$.Y)("h3",{className:_e.A.botForumTopicTitle,children:Oe("BotForumActionNew")}),(0,$.Y)("span",{className:_e.A.botForumTopicDescription,children:Oe("BotForumActionNewDescription")}),(0,$.Y)(oe.A,{className:_e.A.botForumTopicArrow,name:"down"})]})},"botforum-new-topic")})(),Te&&(0,$.Y)("div",{ref:xe,className:"forwards-trigger"},"forwards-trigger"),(0,$.Y)("div",{ref:Be,className:"fab-trigger"},"fab-trigger"),p&&(0,$.Y)(We,{isFocused:_,className:ce?"with-sponsored":void 0},"bottom-marker"),ce&&(0,$.Y)($e,{chatId:t,containerRef:T,observeIntersectionForLoading:Ye,observeIntersectionForPlaying:Fe},t)]})});var Ze=n(38102);const Xe=3*S.$,et=(0,o.ph)(({isChatWithSelf:e,type:t,isGroupChatJustCreated:n,topic:o})=>{const i=(0,J.A)();return"scheduled"===t?function(e){return(0,$.Y)("div",{className:"empty",children:(0,$.Y)("span",{children:e("ScheduledMessages.EmptyPlaceholder")})})}(i):e?function(e){return(0,$.Y)("div",{className:"NoMessages",children:(0,$.FD)("div",{className:"wrapper",children:[(0,$.Y)(oe.A,{name:"cloud-download",className:"no-messages-icon"}),(0,$.Y)("h3",{className:"title",children:e("Conversation.CloudStorageInfo.Title")}),(0,$.FD)("ul",{className:"description",children:[(0,$.Y)("li",{children:e("Conversation.ClousStorageInfo.Description1")}),(0,$.Y)("li",{children:e("Conversation.ClousStorageInfo.Description2")}),(0,$.Y)("li",{children:e("Conversation.ClousStorageInfo.Description3")}),(0,$.Y)("li",{children:e("Conversation.ClousStorageInfo.Description4")})]})]})})}(i):n?function(e){return(0,$.Y)("div",{className:"NoMessages",children:(0,$.FD)("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0,children:[(0,$.Y)("h3",{className:"title",children:e("EmptyGroupInfo.Title")}),(0,$.Y)("p",{className:"description",children:e("EmptyGroupInfo.Subtitle")}),(0,$.FD)("ul",{className:"list-checkmarks",children:[(0,$.Y)("li",{children:e("EmptyGroupInfo.Line1")}),(0,$.Y)("li",{children:e("EmptyGroupInfo.Line2")}),(0,$.Y)("li",{children:e("EmptyGroupInfo.Line3")}),(0,$.Y)("li",{children:e("EmptyGroupInfo.Line4")})]})]})})}(i):o?function(e,t){return(0,$.Y)("div",{className:"NoMessages",children:(0,$.FD)("div",{className:"wrapper",children:[(0,$.Y)(Ze.A,{topic:t,size:Xe,className:"no-messages-icon topic-icon"}),(0,$.Y)("h3",{className:"title",children:e("Chat.EmptyTopicPlaceholder.Title")}),(0,$.Y)("p",{className:"description topic-description",children:(0,X.A)(e("Chat.EmptyTopicPlaceholder.Text"),["br"])})]})})}(i,o):(0,$.Y)("div",{className:"empty",children:(0,$.Y)("span",{children:i("NoMessages")})})});var tt=n(44029),nt=n(64489),ot=n(85118);const it=(0,o.ph)((0,s.EK)((e,{peerId:t})=>{const n=(0,u.SJA)(e),{patternColor:o}=(0,u.Gyz)(e,n)||{};return{patternColor:o,peer:(0,u.PVB)(e,t)}})(function({patternColor:e,peer:t,paidMessagesStars:n}){const o=(0,J.A)(),i=(0,ee.A)(),{openPremiumModal:a,openStarsBalanceModal:r}=(0,s.ko)(),d=(0,x.A)(()=>a()),c=(0,x.A)(()=>{r({})});if(t)return(0,$.Y)("div",{className:"J2RfusJI",children:(0,$.FD)("div",{className:"C90W_KKX",children:[(0,$.FD)("div",{className:"Qi7tZATP",children:[(0,$.Y)(nt.A,{tgsUrl:tt.w.Unlock,size:54,color:e,className:"lfcZJyxp"}),(0,$.Y)(oe.A,{name:"comments-sticker",className:"zd5EAc5e"})]}),(0,$.Y)("span",{className:"E_YZ3IQs",children:n?i((0,me.mO)(t)?"MessagesPlaceholderPaidUser":"MessagesPlaceholderPaidChannel",{peer:(0,me.F9)(i,t),amount:(0,fe.U2)(i,n,{asFont:!0,containerClassName:"IL_EHscS"})},{withNodes:!0,withMarkdown:!0}):(0,X.A)(o("MessageLockedPremium",(0,me.F9)(i,t)),["simple_markdown"])}),(0,$.Y)(Ke.A,{color:"translucent-black",size:"default",pill:!0,onClick:n?c:d,className:"Nz8BOo0i",children:n?(0,$.FD)($.FK,{children:[i("ButtonBuyStars"),(0,$.Y)(ot.A,{preset:"button"})]}):o("MessagePremiumUnlock")})]})})}));var st=function(e){return e[e.Loading=0]="Loading",e[e.Restricted=1]="Restricted",e[e.StarsRequired=2]="StarsRequired",e[e.PremiumRequired=3]="PremiumRequired",e[e.AccountInfo=4]="AccountInfo",e[e.ContactGreeting=5]="ContactGreeting",e[e.NoMessages=6]="NoMessages",e[e.MessageList=7]="MessageList",e}(st||{});const at=.5*S.$,rt="force-messages-scroll",dt="with-bottom-snap",ct=(0,I.sg)(e=>e(),200,!1),lt=(0,o.ph)((0,s.EK)((e,{chatId:t,threadId:n,type:o})=>{const i=(0,u.nTw)(e),s=e.currentUserId,r=(0,u.hds)(e,t),c=(0,u.mBe)(e,t),g=(0,u.vGo)(e,t),f=(0,p.a1)(e,t,n);if(!r)return{currentUserId:s};const v=(0,u.vRX)(e,t,n,o),y=(0,u.zeq)(e,t),C="scheduled"===o?(0,u.yFI)(e,t):y,w=(0,l.cG)(t,n,s);if(!(n===a.l3||w||r?.isForum||y&&n&&y[Number(n)]))return{currentUserId:s};const I=(0,h._l)(e,t),b=(0,m.G6)(e,r?.restrictionReasons),S="thread"===o?(0,u.yHC)(e,t,w?"saved":"all"):void 0,M=(0,u.kdX)(e,t),N=n===a.l3&&!v&&f&&!f.unreadCount&&!M&&S&&!S.groupedId,k=(0,u.yps)(e,t),Y=Boolean(g?.settings?.canAddContact),F=g?.settings?.nameChangeDate,P=g?.settings?.photoChangeDate,T=(0,u.S0q)(e,t,n),D=(0,A.L8)(t)?void 0:(0,u.AWZ)(e,t),x=0===(0,p.Vw)(e,t,n)?.messagesCount,L=!(0,u.g29)(e)||(0,u.vGo)(e,s)?.areAdsEnabled,B=(0,u.trm)(e),R=Boolean(g?.businessIntro),E=e.isAppConfigLoaded,O=(0,u.k2W)(e,t)?.id,U=(0,u.jGY)(e,t)&&!D?.isTranslationDisabled,K=r?.hasAutoTranslation,z=(0,u.Qq_)(e),V=(0,m.Xf)(e),j=V&&V.chatId===t&&V.threadId===n&&V.type===o,{chatId:G,threadId:J,messageId:q}=i.focusedMessage||{},$=G===t&&J===n&&!q;return{isActive:j,areAdsEnabled:L,isChatLoaded:!0,isRestricted:I,restrictionReasons:b,isChannelChat:(0,l.WX)(r),isChatMonoforum:(0,l.Ve)(r),isGroupChat:(0,l.YE)(r),isChannelWithAvatars:r.areProfilesShown,isCreator:r.isCreator,isChatWithSelf:(0,u.nZ4)(e,t),isSystemBotChat:(0,l.DX)(t),isAnonymousForwards:(0,l.Qe)(t),isBot:Boolean(k),isNonContact:Y,nameChangeDate:F,photoChangeDate:P,isSynced:e.isSynced,messageIds:v,messagesById:C,firstUnreadId:(0,u.RjD)(e,t,n),isViewportNewest:"thread"!==o||(0,u.haw)(e,t,n),focusingId:M,isSelectModeActive:(0,u.rTV)(e),hasLinkedChat:D?Boolean(D.linkedChatId):void 0,channelJoinInfo:D?.joinInfo,topic:T,noMessageSendingAnimation:!(0,u.xYJ)(e,"messageSendingAnimations"),isServiceNotificationsChat:t===d.zv8,isForum:r.isForum,isEmptyThread:x,currentUserId:s,isChatProtected:(0,u.ryq)(e,t),lastMessage:N?S:void 0,isAccountFrozen:B,hasCustomGreeting:R,isAppConfigLoaded:E,monoforumChannelId:O,canTranslate:U,translationLanguage:z,shouldAutoTranslate:K,canManageBotForumTopics:r.isBotForum&&c?.canManageBotForumTopics,shouldScrollToBottom:$}})(({chatId:e,threadId:t,type:n,isChatLoaded:h,isForum:m,isChannelChat:S,isGroupChat:M,isChannelWithAvatars:N,canPost:k,isSynced:J,isActive:q,canManageBotForumTopics:W,shouldScrollToBottom:_,isChatMonoforum:Q,isReady:Z,isChatWithSelf:X,isSystemBotChat:ee,isAnonymousForwards:te,isCreator:ne,isBot:oe,isNonContact:ie,nameChangeDate:se,photoChangeDate:ae,messageIds:re,messagesById:de,firstUnreadId:ce,isComments:le,isViewportNewest:ue,isRestricted:me,restrictionReasons:pe,isEmptyThread:ge,focusingId:fe,isSelectModeActive:ve,lastMessage:Ae,hasLinkedChat:ye,withBottomShift:Ce,withDefaultBg:we,topic:Ie,noMessageSendingAnimation:be,isServiceNotificationsChat:Se,currentUserId:Me,isContactRequirePremium:Ne,paidMessagesStars:ke,areAdsEnabled:Ye,channelJoinInfo:Fe,isChatProtected:Pe,isAccountFrozen:Te,hasCustomGreeting:De,monoforumChannelId:xe,isAppConfigLoaded:Le,canTranslate:Be,translationLanguage:Re,shouldAutoTranslate:Ee,isQuickPreview:Oe,onIntersectPinnedMessage:Ue,onScrollDownToggle:Ke,onNotchToggle:ze})=>{const{loadViewportMessages:Ve,setScrollOffset:je,loadSponsoredMessages:Ge,loadMessageReactions:Je,copyMessagesByIds:qe,loadMessageViews:$e,loadPeerStoriesByIds:He,loadFactChecks:We,requestChatTranslation:_e}=(0,s.ko)(),Ze=(0,o.li)(),Xe=(0,o.li)("thread"===n&&(0,p.j_)((0,s.mS)(),e,t)||(0,p.rK)((0,s.mS)(),e,t)||0),tt=(0,o.li)(),nt=(0,o.li)(),ot=(0,o.li)(),lt=(0,o.li)(),ht=(0,o.li)(),mt=(0,o.li)(),pt=(0,o.li)(!1),gt=(0,o.li)(Boolean(Ae)),ft=(0,o.li)(),vt=(0,o.li)(),At=(0,l.cG)(e,t,Me),yt=At&&t!==d.Ckz&&t!==Me,Ct=Boolean(re),wt=(0,A.L8)(e),It=Boolean(!wt&&!S||X||ee||te||N);(0,O.A)(()=>{Ct&&(0,I.aj)(()=>{gt.current=!1})},[Ct]),(0,O.A)(()=>{lt.current=ce},[ce]),(0,o.vJ)(()=>{Ye&&(S||oe)&&J&&Z&&Le&&Ge({peerId:e})},[e,J,Z,S,oe,Ye,Le]),(0,O.A)(()=>{Ct&&(ht.current=lt.current)},[Ct]),(0,O.A)(()=>{mt.current=fe},[fe]),(0,o.vJ)(()=>{Ee&&Be&&_e({chatId:e,toLanguageCode:Re})},[Ee,Be,Re,e]),(e=>{const t=(0,x.A)(t=>{const n=(0,B.A)();n&&n.length>1&&(t.preventDefault(),e({messageIds:n}))});(0,R.v)((0,o.Kr)(()=>({"Mod+C":t}),[]))})(qe);const bt=(0,o.Kr)(()=>{if(!re?.length||!de)return;const e=[];re.forEach((t,o,i)=>{const s=e[e.length-1],a=de[t];if(!a)return;const{shouldAppendJoinMessage:r,shouldAppendJoinMessageAfterCurrent:d}=(()=>{if(Fe&&"thread"===n)return s&&s.date{const e=re?.[re.length-1],t=void 0!==e?de?.[e]:void 0;return t?(0,l.sj)(t):e},[re,de]);(0,T.A)(()=>{if(!re||!de||"scheduled"===n||Te||!q)return;if(!S&&!M)return;const t=re.filter(e=>{const t=de[e];return t&&t.reactions&&!t.content.action});t.length&&Je({chatId:e,ids:t})},2e4),(0,T.A)(()=>{if(!re||!de||"scheduled"===n||!q)return;const e=re.map(e=>de[e]?.content.storyData).filter(Boolean);if(!e.length)return;const t=e.reduce((e,t)=>{const{peerId:n,id:o}=t;return e[n]||(e[n]=[]),e[n].push(o),e},{});Object.entries(t).forEach(([e,t])=>{He({peerId:e,storyIds:t})})},3e5),(0,T.A)(()=>{if(!re||!de||t!==a.l3||"scheduled"===n||!q)return;const o=(0,s.mS)(),i=re.filter(t=>(0,p.Vw)(o,e,t)?.isCommentsInfo||void 0!==de[t]?.viewsCount);i.length&&$e({chatId:e,ids:i})},2e4,!0),(0,T.A)(()=>{if(!re||!de||t!==a.l3||"scheduled"===n||!q)return;const o=re.filter(e=>de[e]?.factCheck?.shouldFetch);o.length&&We({chatId:e,ids:o})},5e3);const Mt=(0,o.Kr)(()=>{if("thread"===n)return(0,I.sg)(()=>Ve({direction:r.TN.Around,chatId:e,threadId:t}),1e3,!0,!1)},[Ve,re]),{isScrolled:Nt,updateStickyDates:kt}=function(){const[e,t]=(0,z.A)(!1),n=(0,V.A)(1e3,!0);return{isScrolled:e,updateStickyDates:(0,x.A)(e=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,c.RK)(()=>{document.body.classList.add("is-scrolling-messages")}),n(()=>{const t=function(e){const t=e.querySelectorAll(".sticky-date"),n=e.scrollTop,o=getComputedStyle(e),i=parseInt(o.getPropertyValue("--middle-header-panes-height"),10);return Array.from(t).find(e=>{const{offsetTop:t,offsetHeight:o}=e,s=t-n;return-o<=s&&s<=i+10})}(e);(0,c.RK)(()=>{const e=document.querySelector(".stuck");e&&e.classList.remove("stuck"),t&&t.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})})}}(),Yt=(0,x.A)(()=>{const e=Ze.current,t=e?.querySelector(".fab-trigger");if(!e||!t)return;const n=e.scrollTop+e.offsetHeight,o=t.offsetTop,s=o-7<=n&&n<=o+14;e.classList.contains(dt)!==s&&(s?(0,c.RK)(()=>{(0,i.YM)(e,dt)}):(clearTimeout(ft.current),ft.current=void 0,(0,c.RK)(()=>{(0,i.HW)(e,dt)})))}),Ft=(0,x.A)((e,t)=>{if(!t)return void(vt.current===e&&(vt.current=void 0));if(vt.current===e)return;const n=Ze.current;n&&n.classList.contains(dt)&&(vt.current=e,clearTimeout(ft.current),ft.current=void 0,(0,c.RK)(()=>{(0,i.HW)(n,dt)}))}),Pt=(0,x.A)(()=>{if(pt.current)return void(pt.current=!1);const o=Ze.current;o&&(mt.current||kt(o),void 0===ft.current&&Yt(),ct(()=>{const i=(0,s.mS)();Boolean((0,u.nTw)(i).focusedMessage?.chatId)||Ue?.({shouldCancelWaiting:!0}),o.parentElement&&(Xe.current=o.scrollHeight-o.scrollTop,"thread"!==n||Oe||je({chatId:e,threadId:t,scrollOffset:Xe.current}))}))}),[Tt,Dt]=function(e,t){const[n,i]=(0,o.Ul)(),s=(0,x.A)(e=>{i(e.contentRect.height)});(0,K.A)(e,s),(0,o.vJ)(()=>{const o=Number(e.current.dataset.normalHeight)||0,i=n();i&&i>o&&t&&(e.current.dataset.normalHeight=String(i))},[t,e,n]);const a=(0,o.li)();return[n,a]}(Ze,k&&!ve),xt=(0,x.A)(e=>{if(f.$M&&e.deltaY<0){const e=Ze.current;if(!e)return;(0,c.RK)(()=>{(0,i.HW)(e,dt)})}});(0,o.vJ)(()=>{if(!Mt||!h||me||fe)return;if(re&&(0,C.iL)(re[re.length-1]))return;const e=Ze.current;(!re||1===re.length||re.length{if(!re||!ot.current)return;const e=ot.current.filter(e=>re.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(tt.current=t.id,nt.current=t.getBoundingClientRect().top)});(0,O.A)(()=>(0,c.Uj)(()=>Lt.current()),[re,ue,Lt]),(0,o.vJ)(()=>Lt.current(),[Tt,Lt]),(0,L.A)(([e,t,n])=>{const o=Tt(),s=Dt.current;if(Dt.current=o,re===e&&ue===t&&o!==s&&void 0===s)return;const a=Ze.current;ot.current=Array.from(a.querySelectorAll(".message-list-item"));const r=ot.current[ot.current.length-1],u=lt.current?a.querySelector(`#${(0,l.GZ)(lt.current)}`):void 0,h=St!==n,m=re?.[0]!==e?.[0]&&re?.length===d.yo2/2+1,p=h&&!m;ue&&p&&re&&re.lengtha.firstElementChild.clientHeight<=2*a.offsetHeight)&&((0,i.YM)(a.parentElement,rt),setTimeout(()=>{a.parentElement&&(0,i.HW)(a.parentElement,rt)},500)),p&&(clearTimeout(ft.current),ft.current=void 0,(0,i.HW)(a,dt),ft.current=window.setTimeout(()=>{ft.current=void 0,Yt()},500)),(0,F.U)(()=>{const{scrollTop:e,scrollHeight:n,offsetHeight:i}=a,d=Xe.current;let l=d-(s||i);p&&(l-=r?r.offsetHeight:0);const h=ue&&t&&l<=50,m=re&&mt.current===re[re.length-1];p&&h&&!m&&(0,c.YS)(()=>{const e=!(0,U.g1)()||!u;(0,g.Ay)({container:a,element:e?r:u,position:e?"end":"start",margin:at,forceDuration:be?0:void 0})});const f=void 0!==s&&s!==o;if(f&&(0,g.o8)())return;const v=tt.current&&a.querySelector(`#${tt.current}`),A=!v&&ht.current&&a.querySelector(".unread-divider");let y;if(h&&f)y=n-i;else if(v){const t=v.getBoundingClientRect().top;y=e+(t-(nt.current||0))}else y=A?Math.min((0,b.A)(A,a).top-10,n-d):n-d;return()=>{(0,w.A)(a,Math.ceil(y)),(0,g._v)(),Xe.current=Math.max(Math.ceil(n-y),i),mt.current||(pt.current=!0,(0,c.YS)(()=>{pt.current=!1,Yt()}))}})},[re,ue,St,Tt,Dt,be]),(0,D.A)(([e])=>{void 0!==e&&(0,o.VK)(200+d.xB5)},[ve]);const Bt=Boolean(!It||S&&!N),Rt=(0,A.L8)(e)&&!X&&!oe&&!te&&"thread"===n&&(!bt&&!Ae&&re&&(!ot.current||0===ot.current.length)||1===re?.length&&"contactSignUp"===de?.[re[0]]?.content.action?.type||"contactSignUp"===Ae?.content?.action?.type),Et=M&&ne&&1===re?.length&&"chatCreate"===de?.[re[0]]?.content.action?.type,Ot=1===re?.length&&"topicCreate"===de?.[re[0]]?.content.action?.type,Ut=(0,v.A)("MessageList custom-scroll",Bt&&"no-avatars",!k&&"no-composer","pinned"===n&&"type-pinned",Ce&&"with-bottom-shift",we&&"with-default-bg",ve&&"select-mode-active",Nt&&"scrolled",!Z&&"is-animating",yt&&"saved-dialog",Pe&&"hide-on-print"),Kt=Boolean(re&&bt||Ae);(0,o.vJ)(()=>{Kt||Ke?.(!1)},[Kt,Ke]);const zt=me?st.Restricted:!ke||Kt||De?Ne&&!Kt?st.PremiumRequired:!oe&&!ie||Kt||t!==a.l3?Rt?st.ContactGreeting:re&&(!bt||Et||Ot)?st.NoMessages:Kt?st.MessageList:st.Loading:st.AccountInfo:st.StarsRequired;return(0,$.Y)(G.Ay,{ref:Ze,className:Ut,name:"fade",activeKey:zt,shouldCleanup:!0,onScroll:Pt,onWheel:xt,onMouseDown:P.l,children:zt===st.Restricted?(0,$.Y)("div",{className:"empty",children:(0,$.Y)("span",{children:pe?.[0]?.text||"This is a private "+(S?"channel":"chat")})}):zt===st.StarsRequired?(0,$.Y)(it,{paidMessagesStars:ke,peerId:xe||e}):zt===st.PremiumRequired?(0,$.Y)(it,{peerId:e}):zt===st.AccountInfo?(0,$.Y)(he,{chatId:e,hasMessages:Kt}):zt===st.ContactGreeting?(0,$.Y)(H,{userId:e},e):zt===st.NoMessages?(0,$.Y)(et,{chatId:e,topic:Ie,type:n,isChatWithSelf:X,isGroupChatJustCreated:Et}):zt===st.MessageList?(0,$.Y)(Qe,{canShowAds:Ye&&S,chatId:e,isComments:le,isChannelChat:S,isChatMonoforum:Q,isSavedDialog:At,messageIds:re||[Ae.id],messageGroups:bt||Y([Ae]),getContainerHeight:Tt,isViewportNewest:Boolean(ue),isUnread:Boolean(ce),isEmptyThread:ge,withUsers:It,noAvatars:Bt,containerRef:Ze,anchorIdRef:tt,memoUnreadDividerBeforeIdRef:ht,memoFirstUnreadIdRef:lt,threadId:t,type:n,isReady:Z,hasLinkedChat:ye,isSchedule:!!bt&&"scheduled"===n,shouldRenderAccountInfo:oe||ie,nameChangeDate:se,photoChangeDate:ae,noAppearanceAnimation:!bt||!gt.current,isQuickPreview:Oe,canPost:k,canManageBotForumTopics:W,shouldScrollToBottom:_,onScrollDownToggle:Ke,onNotchToggle:ze,onIntersectPinnedMessage:Ue,onTallTypingDraft:Ft}):(0,$.Y)(j.A,{color:"white",backgroundColor:"dark"})})}));function ut(e){return e+1e-6}},54639(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(37661),a=n(17712),r=n(59030),d=n(71429),c=n(24433),l=n(23174),u=n(90709),h=n(87357),m=n(43874),p=n(62587);const g="VGmPJoga";var f=n(20021);const v=/#fff/gi,A=(0,o.ph)(({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,m.Ay)(),i=(0,p.A)((0,u.mr)(e,"full"),!1,l.qZ.Text),s=(0,o.Kr)(()=>{if(!i)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=i.replace(v,e),o=(new DOMParser).parseFromString(n,"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,t]);return(0,f.Y)("i",{className:(0,h.A)("mklnEg0s","icon",!n&&g),children:(0,f.Y)("img",{src:s,alt:"",className:(0,h.A)("tT8KQwg0",!n&&g),draggable:!1})})}),y=(0,o.ph)(({bot:e,theme:t,chatId:n,threadId:l,isInSideMenu:u,canShowNew:h,onMenuOpened:m,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,i.ko)(),y=(0,r.A)(),C=(0,o.Kr)(()=>e.icons.find(({name:e})=>"default_static"===e)?.document,[e.icons]),[w,I,b]=(0,s.A)(),[S,M]=(0,o.J0)(void 0),N=(0,a.A)(e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),m(),I()}),k=(0,a.A)(()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:l})}),Y=(0,a.A)(()=>{b(),p()}),F=(0,a.A)(()=>{M(void 0)}),P=(0,a.A)(()=>{v({botId:e.id,isEnabled:!1})});return(0,f.FD)(c.A,{customIcon:C&&(0,f.Y)(A,{icon:C,theme:t}),icon:C?void 0:"bots",onClick:k,onContextMenu:N,children:[e.shortName,h&&e.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:y("New")}),S&&(0,f.Y)(d.A,{isOpen:w,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:Y,onCloseAnimationEnd:F,children:(0,f.Y)(c.A,{icon:"stop",destructive:!0,onClick:P,children:y("WebApp.RemoveBot")})})]},e.id)})},25897(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},6070(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomSendMenu",!t);return n?(0,s.Y)(n,{...e}):void 0}},41510(e,t,n){n.d(t,{I:()=>y,A:()=>C});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(11778),d=n(55153),c=n(45761),l=n(39351),u=n(17712),h=n(73767),m=n(50680),p=n(3325),g=n(37661),f=n(18276),v=n(20021);const A=(0,o.ph)(({isQuick:e,isGeneric:t,onFileSelect:n})=>{const i=(0,o.li)(),s=(0,l.A)(),[r,d,c]=(0,g.A)(),h=(0,u.A)(e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),c()}),m=(0,a.A)("DropTarget",r&&"hovered");return(0,v.FD)("div",{className:m,ref:i,onDrop:n,onDragEnter:d,onDragLeave:h,"data-dropzone":!0,children:[(0,v.Y)("svg",{className:"target-outline-container",children:(0,v.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,v.FD)("div",{className:"target-content",children:[(0,v.Y)(f.A,{name:e?"photo":"document"}),(0,v.Y)("div",{className:"title",children:s("FileDropZoneTitle")}),!t&&(0,v.Y)("div",{className:"description",children:s(e?"FileDropZoneQuick":"FileDropZoneNoCompression")})]})]})});let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const C=(0,o.ph)(({isOpen:e,withQuick:t,editingMessage:n,onHide:g,onFileSelect:f})=>{const y=(0,l.A)(),{showNotification:C,updateAttachmentSettings:w}=(0,i.ko)(),I=(0,o.li)(),b=(0,h.A)(t),{shouldRender:S,transitionClassNames:M}=(0,m.A)(e);(0,o.vJ)(()=>e?(0,r.A)(g):void 0,[e,g]);const N=(0,u.A)(async e=>{const{dataTransfer:o}=e;let i=[];if(!(o.files&&o.files.length>0)||o.items&&o.items.length){if(o.items&&o.items.length>0){const e=await(0,c.A)(o.items);e?.length&&(i=i.concat(e))}}else i=i.concat(Array.from(o.files));if(n){if(i.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})});if(1===i.length){const e=await(0,d.Ay)(i[0].name,i[0]);if(!(n&&e&&(0,s.eh)(n,e)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})})}}g(),w({shouldCompress:!t&&void 0}),f(i)}),k=(0,u.A)(async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(n){if(e.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,d.Ay)(e[0].name,e[0]);if(!(n&&t&&(0,s.eh)(n,t)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}g(),w({shouldCompress:!0}),f(e)}}),Y=(0,u.A)(e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(I.current=window.setTimeout(()=>{g()},150))});if(!S)return;const F=t||b,P=(0,a.A)("DropArea",M);return(0,v.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,v.FD)("div",{className:P,onDragLeave:Y,onDragOver:()=>{I.current&&window.clearTimeout(I.current)},onDrop:g,onClick:g,children:[(0,v.Y)(A,{onFileSelect:N,isGeneric:!F}),F&&(0,v.Y)(A,{onFileSelect:k,isQuick:!0})]})})})},49068(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},78407(e,t,n){n.d(t,{A:()=>_});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(11597),d=n(30708),c=n(96115),l=n(63495),u=n(96454),h=n(87357),m=n(52674),p=n(14680),g=n(17237),f=n(36353),v=n(37836),A=n(4961),y=n(11359),C=n(43874),w=n(19129),I=n(37661),b=n(39351),S=n(17712),M=n(59030),N=n(88458),k=n(41733);class Y{isPlaying=!1;constructor(e,t,n){this.container=t,this.options=n,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.RK)(()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()})}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,k.A)(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.YS)(()=>{if(!this.video)return;const o=this.video,{width:i,height:s}=this.container.getBoundingClientRect();(0,a.RK)(()=>{o.style.left=`${Math.round(t*i)}px`,o.style.top=`${Math.round(n*s)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`})})}}var F=n(48894),P=n(60261),T=n(43336),D=n(76023),x=n(37479),L=n(87094),B=n(82117),R=n(93545),E=n(672),O=n(61157),U=n(38691);const K=1.25*D.$;var z=n(18276),V=n(64493),j=n(80089),G=n(80464),J=n(20021);const q=e=>{const{isOpen:t}=e,n=(0,G.A)(j.ar.Extra,"TextFormatter",!t);return n?(0,J.Y)(n,{...e}):void 0},$="input-scroller",H=140,W=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],_=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:o}=(0,d.lS)(e);return{messageSendKeyCombo:o,replyInfo:t&&n?(0,c.GA)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}})(({ref:e,id:t,chatId:n,captionLimit:d,isAttachmentModalInput:c,isStoryInput:k,customEmojiPrefix:D,editableInputId:j,isReady:G,isActive:_,getHtml:Q,placeholder:Z,forcedPlaceholder:X,canSendPlainText:ee,canAutoFocus:te,noFocusInterception:ne,shouldSuppressFocus:oe,shouldSuppressTextFormatter:ie,replyInfo:se,isSelectModeActive:ae,canPlayAnimatedEmojis:re,messageSendKeyCombo:de,isNeedPremium:ce,messageListType:le,onUpdate:ue,onSuppressedFocus:he,onSend:me,onScroll:pe,onFocus:ge,onBlur:fe})=>{const{editLastMessage:ve,replyToNextMessage:Ae,showAllowedMessageTypesNotification:ye,openPremiumModal:Ce}=(0,i.ko)();let we=(0,o.li)();e&&(we=e);const Ie=(0,o.li)(),be=(0,o.li)(),Se=(0,o.li)(),Me=(0,o.li)(),Ne=(0,o.li)(),ke=(0,o.li)(),Ye=(0,M.A)(),Fe=(0,b.A)(),Pe=(0,o.li)(!1),[Te,De,xe]=(0,I.A)(),[Le,Be]=(0,o.J0)(),[Re,Ee]=(0,o.J0)(),[Oe,Ue]=(0,o.J0)(!1),{isMobile:Ke}=(0,C.Ay)(),ze=Ke&&(u.pz||u.Ni);!function(e,t,n,s,d,c,l,u,h){const m=(0,L.A)(t,void 0,!u),p=(0,x.A)(m,!0),g=(0,U.A)(),f=(0,o.li)(new Map),v=(0,S.A)(e=>{e.forEach(e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))})}),A=(0,S.A)(()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,i.mS)(),o=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach(t=>{if(!t.dataset.uniqueId)return;const i=`${c}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;o.delete(i);const u=(0,P.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,T.LI)((v.left-h.left)/h.width,4),y=(0,T.LI)((v.top-h.top)/h.height,4);if(f.current.has(i))return void f.current.get(i).updatePosition(A,y);const C=(0,r.O8F)(e,a);if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),I=[c,a,m,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:o,renderId:i,viewId:s,mediaUrl:a,position:r,isHq:d,textColor:c,colorFilter:l}){if(e.isLottie){const o=e.shouldUseTextColor&&c?(0,F.hF)(c):void 0,l=(await(0,N.Y)()).init(a,d?n.current:t.current,i,{size:K,coords:r,isLowPriority:!d},s,o?[o.r,o.g,o.b]:void 0);return{play:()=>l.play(),pause:()=>l.pause(),destroy:()=>l.removeView(s),updatePosition:(e,t)=>l.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&l?`filter: ${l};`:void 0,n=new Y(a,o.current,{size:K,position:r,style:t});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:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:d,renderId:I,viewId:i,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then(e=>{l&&e.play(),f.current.set(i,e)})}),v(Array.from(o))});(0,o.vJ)(()=>(0,P.K3)(A),[A]),(0,o.vJ)(()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}},[]),(0,o.vJ)(()=>{e()&&t.current&&n.current&&h&&u?(0,a.YS)(()=>{A()}):v(Array.from(f.current.keys()))},[e,A,t,v,n,h,u]),(0,o.Nf)(()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")},[p]),(0,B.A)(([e])=>{void 0!==e&&m!==e&&A()},[m,A]);const y=(0,E.A)(A,[A],300,!1);(0,R.A)(n,y),(0,B.A)(([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())},[g,A]);const C=(0,S.A)(()=>{f.current.forEach(e=>{e.pause()})}),w=(0,S.A)(()=>{l&&f.current.forEach(e=>{e.play()})}),I=(0,S.A)(()=>{(0,a.YS)(w)});(0,O.Ay)(C,I)}(Q,we,Me,Ne,ke,D,re,G,_);const Ve=c?160:k?128:Ke?256:416,je=(0,S.A)((e=!1)=>{(0,v.IJ)(()=>{(0,a.gm)(()=>{const t=we.current.closest(`.${$}`),n=Number(t.style.height.replace("px","")),o=Se.current,{scrollHeight:i}=o,s=Math.min(i,Ve);if(s===n)return;const r=i>Ve;function d(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,a.RK)(d):d})})});(0,o.Nf)(()=>{c&&je(!1)},[c,je]);const Ge=(0,o.li)(Q());(0,o.Nf)(()=>{const e=_?Q():"";!_&&we.current&&we.current.blur(),e!==we.current.innerHTML&&(we.current.innerHTML=e),e!==be.current.innerHTML&&(be.current.innerHTML=e),e!==Ge.current&&(Ge.current=e,je(!e))},[Q,_,je]),(0,o.li)(n).current=n;const Je=(0,S.A)(()=>{we.current&&!ce&&(0,f.A)(we.current)}),qe=(0,S.A)(()=>{xe(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()});function $e(){if(u.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Pe.current)return xe(),u.Ni&&Ue(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(ie||!(0,y.L)(t,j||s.CfG)||!n||(0,g.A)(n)||!t.START_TO_END)||(xe(),!1)}function He(){if(!$e())return;if(Oe)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=we.current.closest(`.${$}`).getBoundingClientRect();let o=t.left+t.width/2-n.left;on.width-H&&(o=n.width-H),Be({x:o,y:t.top-n.top}),Ee(e),De()}function We(){Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(He,260)}const _e=(0,S.A)(e=>"Enter"===e.key&&!e.shiftKey&&!ze&&("enter"===de&&!e.shiftKey||"ctrl-enter"===de&&(e.ctrlKey||e.metaKey))),Qe=(0,S.A)(e=>{e.preventDefault(),xe(),me()}),Ze=(0,S.A)(()=>Ce());(0,o.vJ)(()=>{u.TF||te&&Je()},[n,Je,se,te]),(0,o.vJ)(()=>{if(!n||j!==s.CfG&&j!==s.e0F||ze||ae)return;const e=e=>{const t=e.target,n=we.current;if(!(_&&n&&t&&t!==n&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName)||t.isContentEditable||(0,m.N)("Enter"))return;if(_e(e))return void Qe(e);const{key:o}=e;if(ne||(0,p.ZJ)()||W.includes(o))return;const i=document.getSelection()?.isCollapsed;if((o.startsWith("Arrow")||e.shiftKey&&"Shift"===o)&&!i||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==t.tagName)return;(0,f.A)(n,!0,!0);const s=new KeyboardEvent(e.type,e);n.dispatchEvent(s)};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[n,j,ze,_,ae,ne]),(0,o.vJ)(()=>{const e=(0,v.sg)(e=>{"Tab"!==e.key||(0,p.ZJ)()||(e.preventDefault(),(0,a.RK)(Je))},2e3,!0,!1);return(0,m.A)({onTab:e})},[Je]),(0,o.vJ)(()=>{const e=we.current;function t(){e.blur()}return oe&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[oe]);const Xe=(0,w.A)(()=>Boolean(_&&Q()),[_,Q]),et=(0,h.A)("form-control allow-selection",Xe&&"touched",oe&&"focus-disabled"),tt=(0,h.A)("input-scroller-content",ce&&"is-need-premium"),nt="string"==typeof Z?Z:void 0;return(0,J.FD)("div",{id:t,onClick:oe?he:void 0,dir:Fe.isRtl?"rtl":void 0,children:[(0,J.Y)("div",{className:(0,h.A)("custom-scroll",$,ce&&"is-need-premium"),onScroll:pe,onClick:c||ee?void 0:function(){c||ee||k&&ce||ye({chatId:n,messageListType:le})},children:(0,J.FD)("div",{className:tt,children:[(0,J.Y)("div",{ref:we,id:j||s.CfG,className:et,contentEditable:c||ee,role:"textbox",dir:"auto",spellCheck:!l.Vq&&void 0,tabIndex:0,onClick:Je,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ue("
"===t?"":t),!u.TF&&(!n||!n.length)&&(u.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(we.current.blur(),e.removeAllRanges(),(0,f.A)(we.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 Ae({targetIndexDelta:t})}!t&&_e(e)?Qe(e):t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",We,{once:!0}):(e.preventDefault(),ve())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout(()=>{Pe.current=!1},100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Pe.current||(Pe.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",We,{once:!0})},onContextMenu:u.Ni?function(e){$e()&&(Ue(!Oe),Oe?xe():(e.preventDefault(),e.stopPropagation(),He()))}:void 0,onTouchCancel:u.Ni?We:void 0,"aria-label":nt,onFocus:ce?void 0:ge,onBlur:ce?void 0:fe}),!X&&(0,J.FD)("span",{className:(0,h.A)("placeholder-text",!c&&!ee&&"with-icon",ce&&"is-need-premium"),dir:"auto",children:[!c&&!ee&&(0,J.Y)(z.A,{name:"lock-badge",className:"placeholder-icon"}),Z,k&&ce&&(0,J.Y)(V.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:Ze,children:Ye("StoryRepliesLockedButton")})]}),(0,J.Y)("canvas",{ref:Me,className:"shared-canvas"}),(0,J.Y)("canvas",{ref:Ne,className:"shared-canvas"}),(0,J.Y)("div",{ref:ke,className:"absolute-video-container"})]})}),(0,J.Y)("div",{ref:Se,className:(0,h.A)("custom-scroll",$,"clone",ce&&"is-need-premium"),children:(0,J.Y)("div",{className:tt,children:(0,J.Y)("div",{ref:be,className:(0,h.A)(et,"clone"),dir:"auto"})})}),void 0!==d&&(0,J.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,J.Y)(q,{isOpen:Te,anchorPosition:Le,selectedRange:Re,setSelectedRange:Ee,onClose:qe}),X&&(0,J.Y)("span",{className:"forced-placeholder",children:(0,A.A)(X)})]})}))},26440(e,t,n){n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(31481),a=n(87357),r=n(37661),d=n(17712),c=n(18276),l=n(64493),u=n(66469),h=n(97422),m=n(80089),p=n(80464),g=n(20021);const f=e=>{const{isOpen:t}=e,n=(0,p.A)(m.ar.Extra,"SymbolMenu",!t);return n?(0,g.Y)(n,{...e}):void 0},v=(0,o.ph)(({chatId:e,threadId:t,isMobile:n,canSendGifs:m,canSendStickers:p,isMessageComposer:v,isReady:A,isSymbolMenuOpen:y,idPrefix:C,isAttachmentModal:w,canSendPlainText:I,isSymbolMenuForced:b,className:S,forceDarkTheme:M,inputCssSelector:N=s.m$5,openSymbolMenu:k,closeSymbolMenu:Y,onCustomEmojiSelect:F,onStickerSelect:P,onGifSelect:T,onGifAddCaption:D,onRemoveSymbol:x,onEmojiSelect:L,closeBotCommandMenu:B,closeSendAsMenu:R})=>{const{setStickerSearchQuery:E,setGifSearchQuery:O,addRecentEmoji:U,addRecentCustomEmoji:K}=(0,i.ko)(),z=(0,o.li)(),[V,j]=(0,r.A)(),[G,J]=(0,o.J0)(void 0),q=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",V?y&&"menu-opened":y&&"is-loading"),$=(0,d.A)(()=>{B?.(),R?.(),k();const e=z.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})}),H=(0,d.A)(e=>{"stickers"===e?(E({query:""}),O({query:void 0})):(O({query:""}),E({query:void 0}))}),W=(0,d.A)(()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout(()=>{B?.(),k()},100)):k()}),_=(0,d.A)(()=>z.current),Q=(0,d.A)(()=>z.current?.closest(".custom-scroll, .no-scrollbar")),Z=(0,d.A)(()=>document.querySelector("#portals .SymbolMenu .bubble")),X=(0,d.A)(()=>({withPortal:!0}));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(l.A,{className:q,round:!0,color:"translucent",onClick:y?Y:W,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(c.A,{name:"smile"}),(0,g.Y)(c.A,{name:"keyboard"}),y&&!V&&(0,g.Y)(h.A,{color:"gray"})]}):(0,g.FD)(u.A,{className:(0,a.A)("composer-action-button symbol-menu-button",y&&"activated"),round:!0,color:"translucent",onActivate:$,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:z,className:"symbol-menu-trigger"}),(0,g.Y)(c.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(b),canSendGifs:m,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:j,onClose:Y,onEmojiSelect:L,onStickerSelect:P,onCustomEmojiSelect:F,onGifSelect:T,onGifAddCaption:D,onRemoveSymbol:x,onSearchOpen:H,addRecentEmoji:U,addRecentCustomEmoji:K,isAttachmentModal:w,canSendPlainText:I,className:(0,a.A)(S,M&&"component-theme-dark"),anchor:w?G:void 0,getTriggerElement:w?_:void 0,getRootElement:w?Q:void 0,getMenuElement:w?Z:void 0,getLayout:w?X:void 0})]})})},55153(e,t,n){n.d(t,{gI:()=>l,Ay:()=>r,Lx:()=>d});var o=n(31481),i=n(87679),s=n(24909);const a=/\.[^/.]+$/;async function r(e,t,d){const l=URL.createObjectURL(t),{type:u,size:h}=t;let m,p,g,f;const v=d?.shouldSendInHighQuality;if(o.gex.has(u)){const n=await(0,i.NN)(l),{width:h,height:p}=n;f=!c(h,p);const A=v?2560:1280,y=Math.max(h,p)>A,C=u===o.Vz3;if(!f){if(!d?.compressedBlobUrl&&!C&&(y||"image/jpeg"!==u)){const n=await(0,s.s)(l,y?A/Math.max(h,p):1,"image/jpeg");return URL.revokeObjectURL(l),r(e,t,{...d,compressedBlobUrl:n})}"image/jpeg"===u&&(e=e.replace(a,".jpg")),m={width:h,height:p}}g=Math.max(h,p)>40?await(0,s.s)(l,40/Math.max(h,p),"image/jpeg"):l}else if(o.fNs.has(u)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,i.FW)(l);f=!c(e,t),f||(m={width:e,height:t,duration:n})}catch(e){f=!0}g=await(0,i.eT)(l)}else if(o.IH3.has(u)){const{duration:e,title:t,performer:o,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:o}=await n.e(3186).then(n.bind(n,53186)),s=await(0,i.sZ)(e),a=await t(s),{common:{title:r,artist:d,picture:c},format:{duration:l}}=a,u=o(c),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:d,duration:l,coverUrl:h?URL.createObjectURL(h):void 0}}(l);p={duration:e||0,title:t,performer:o},g=s}return{blob:t,blobUrl:l,filename:e,mimeType:u,size:h,quick:m,audio:p,previewBlobUrl:g,shouldSendAsFile:f||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...d}}function d(e,t){return e.map(e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!(e.voice||e.audio)||void 0,shouldSendAsSpoiler:void 0})}function c(e,t){return Math.max(e,t)/Math.min(e,t)<=20}function l(e){const{blobUrl:t,thumbnail:n,fileName:o,mimeType:i,size:s,width:a,height:r,duration:d}=e;return{gif:e,blobUrl:t||"",previewBlobUrl:n?.dataUri,filename:o,mimeType:i,size:s,quick:a&&r?{width:a,height:r,duration:d}:void 0}}},45761(e,t,n){n.d(t,{A:()=>i});var o=n(87679);async function i(e){const t=[];function n(e,o){return new Promise(i=>{if(e instanceof File)t.push(e),i(e);else if(e.isFile){const n=o.getAsFile();e.file(e=>{t.push(e),i(e)},()=>{n&&t.push(n),i(n)})}else e.isDirectory&&e.createReader().readEntries(e=>{const t=[];for(let i=0;ir});const o=/(
|)/g,i=/( |\u00A0)/g,s=/(
|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(i," ").replace(o,"\n").replace(s,"").replace(a,"")}},11359(e,t,n){n.d(t,{J:()=>s,L:()=>i});var o=n(31481);function i(e,t){const{commonAncestorContainer:n}=e;let o=n,i=1;for(;o&&o.id!==t&&i<5;)o=o.parentElement,i++;return Boolean(o&&o.id===t)}function s(){const e=document.activeElement;if(e?.id!==o.CfG&&e?.id!==o.e0F)return!1;const t=window.getSelection();return Boolean(t&&!t.isCollapsed)}},3225(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(16120),d=n(96454),c=n(36353),l=n(39074),u=n(58734),h=n(63988),m=n(83414),p=n(19129),g=n(37661),f=n(17712);const v=new RegExp(`(${r.A.source})$`,"g"),A=new RegExp(`${s.bpX.source}$`,"g");function y(e,t,n,y,C,w){const{loadCustomEmojiForEmoji:I,clearCustomEmojiForEmoji:b}=(0,i.ko)(),[S,M,N]=(0,g.A)(!1),k=(0,h.gs)(()=>{const n=t();if(!e||!n||!y()?.collapsed)return;if(!n.match(d.TL?r.A:s.bpX))return;const o=(0,l.LV)(C.current);return o.match(d.TL?v:A)?.[0]},[t,y,C,e],300),Y=(0,m.A)(k,[k,t,y],!0),F=(0,p.A)(()=>Boolean(Y()),[Y]),P=Boolean(w?.length);(0,o.vJ)(()=>{if(!e||!F)return;const t=Y();if(t){if(!P){const e=d.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&I({emoji:e})}}else b()},[e,F,Y,P,b,I]);const T=(0,f.A)(t=>{const o=Y();if(!e||!o)return;const i=C.current,s=(0,l.LV)(i),r=d.TL?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/o.length,p=Array.from({length:m},()=>(0,u.hB)(t)),g=s.replace(h,p.join("")),f=i.innerHTML.substring(s.length);n(`${g}${f}`),(0,a.Uz)(()=>{(0,c.A)(i,!0,!0)})});return(0,o.vJ)(N,[N,t]),{isCustomEmojiTooltipOpen:Boolean(F&&P&&!S),closeCustomEmojiTooltip:M,insertCustomEmoji:T}}},25498(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(11597),d=n(52491),c=n(36353),l=n(87894),u=n(79824),h=n(37830),m=n(4961),p=n(58734),g=n(17778),f=n(63988),v=n(83414),A=n(37661),y=n(17712);let C,w,I,b,S;const M=(0,h.A)(function(e,t,n){return e&&t.length?Object.values((0,l._E)(e,t)).slice(0,n):u.p}),N=(0,h.A)(function(e,t,n){const o=Object.values(e),i=(0,l.dU)(o,"native"),s=t?(0,l.LG)(t,e=>Object.values((0,l._E)(i,e))):{},a=n?(0,l.LG)(n,e=>Object.values((0,l._E)(i,e))):{},r={...s,...a},d=[].concat(Object.keys(s),Object.keys(a)),c=o.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{}),u=Object.keys(c),h=d.reduce((e,t)=>Math.max(e,t.length),0);return{byKeyword:r,keywords:d,byName:c,names:u,maxKeyLength:h}}),k=(0,h.A)(function(e,t,n){const{byKeyword:o,keywords:i,byName:s,names:a,maxKeyLength:r}=e;let d=[];if(t.length>r)return u.p;const c=i.filter(e=>e.startsWith(t)).sort();d=d.concat(Object.values((0,l._E)(o,c)).flat());const h=a.filter(e=>e.startsWith(t));return d=d.concat(Object.values((0,l._E)(s,h)).flat()),d=(0,l.Am)(d),d.length?d.slice(0,n):u.p});try{b=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){b=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function Y(e,t,h,Y=s.CfG,F,P,T){const[D,x,L]=(0,A.A)(!1),[B,R]=(0,o.J0)(),[E,O]=(0,o.J0)(u.p),[U,K]=(0,o.J0)(u.p);(0,o.vJ)(()=>{function t(){R(I.emojis)}e&&(I?t():async function(){return C||(C=n.e(996).then(n.t.bind(n,20996,19)),w=(await C).default,I=(0,d.cp)(w)),C}().then(t))},[e]);const z=(0,f.gs)(()=>{const n=t();return e&&n.includes(":")?(0,g.S)(n).match(b)?.[0].trim():void 0},[t,e],300),V=(0,v.A)(z,[z,t],!0),j=(0,y.A)(e=>{if(O(e),e===u.p)return void K(u.p);const t=e.map(e=>e.native),n=(0,l.Xd)((0,r.oZ0)((0,i.mS)(),t),"id");K(n)}),G=(0,y.A)((e,n=!1)=>{const o=t();if(!o)return;const i=o.lastIndexOf(":",n?o.lastIndexOf(":")-1:void 0);if(-1!==i){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${o.substring(0,i)}${t}`);const n=Y===s.CfG?document.querySelector(s.m$5):document.getElementById(Y);(0,a.Uz)(()=>{(0,c.A)(n,!0,!0)})}j(u.p)});return(0,o.vJ)(()=>{const e=V();if(!e||!B)return void j(u.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let o=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=2){const e=N(B,P,T);o=k(e,n.toLowerCase(),36)}}else o=M(B,F,36);o.length?t?G(o[0].native,!0):j(o):j(u.p)},[P,B,V,T,G,F,j]),(0,o.vJ)(L,[L,t]),{isEmojiTooltipOpen:Boolean(E.length||U.length)&&!D,closeEmojiTooltip:x,filteredEmojis:E,filteredCustomEmojis:U,insertEmoji:G}}},9442(e,t,n){n.d(t,{A:()=>C});var o=n(84051),i=n(13439),s=n(23174),a=n(66644),r=n(90709),d=n(70636),c=n(36353),l=n(87894),u=n(39074),h=n(11951),m=n(17778),p=n(63988),g=n(83414),f=n(37661),v=n(39351),A=n(17712);let y;try{y=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){y=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function C(e,t,n,C,I,b,S,M){const N=(0,v.A)(),[k,Y]=(0,o.J0)(),[F,P,T]=(0,f.A)(!1),D=(0,p.gs)(()=>{const n=t();if(!e||!C()?.collapsed||!n.includes("@"))return;const o=(0,u.LV)(I.current);return(0,m.S)(o).match(y)?.[0].trim()},[e,t,C,I],300),x=(0,g.A)(D,[D,t,C],!0),L=(0,g.A)(()=>e&&t().startsWith("@"),[t,e]);(0,o.vJ)(()=>{const e=x();if(!e||!b&&!S)return void Y(void 0);const t=(0,i.mS)().users.byId;if(!t)return void Y(void 0);const n=b?.reduce((e,t)=>(t.userId!==M&&e.push(t.userId),e),[]),o=e.substring(1),s=(0,d.PU)({ids:(0,l.Am)([...L()&&S||[],...n||[]]),query:o,type:"user"});Y(Object.values((0,l._E)(t,s)))},[M,b,S,x,L]);const B=(0,A.A)((e,t=!1,o=!1)=>{if(!e.hasUsername&&!(0,d.F9)(N,e))return;const i=(0,r.Kl)(e),l=(0,d.F9)(N,e)||"",m=i?`@${(0,h.ZD)(i)}`:`${(0,h.ZD)(l)}`,p=I.current,g=w((0,u.LV)(p)),f=o?g.length:g.lastIndexOf("@"),v=(i?i.length+1:l.length)-(g.length-f);if(-1!==f){const e=`${g.substr(0,f)}${m} `,o=w(p.innerHTML).substring(g.length),i=(0,u.JC)(p);n(`${e}${o}`),(0,a.Uz)(()=>{const e=i+v+1;(0,c.A)(p,t),e>=0&&(0,u.vZ)(p,e)})}Y(void 0)});return(0,o.vJ)(T,[T,t]),{isMentionTooltipOpen:Boolean(k?.length&&!F),closeMentionTooltip:P,insertMention:B,mentionFilteredUsers:k}}function w(e){return e.replace(/
(
|)?<\/div>/gi,"
")}},20247(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(17712);function r(e,t,n,r){const{shouldPaidMessageAutoApprove:d}=(0,i.mS)().settings.byKey,[c,l]=(0,o.J0)(Boolean(d)),[u,h]=(0,o.J0)(!1),m=(0,o.li)(void 0),p=(0,a.A)(()=>{(0,i.ko)().closePaymentMessageConfirmDialogOpen()});(0,o.vJ)(()=>{u&&!t&&(h(!1),n>e&&m?.current?.())},[u,t,n,e]);const g=(0,a.A)(()=>{(0,i.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),h(!0)}),f=(0,a.A)(()=>{e>n?g():r?setTimeout(()=>{m?.current?.()},250):m?.current?.(),(0,i.ko)().closePaymentMessageConfirmDialogOpen(),c&&(0,i.ko)().setPaidMessageAutoApprove()});return{closeConfirmDialog:p,handleWithConfirmation:(0,a.A)((t,...o)=>{if(e){if(m.current=()=>t(...o),!d)return void(0,i.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void g()}t(...o)}),dialogHandler:f,shouldAutoApprove:c,setAutoApprove:l}}},48885(e,t,n){n.d(t,{A:()=>l,S:()=>u});var o=n(84051),i=n(61433),s=n(66644),a=n(14737),r=n(17712),d=n(93545),c=n(672);function l({ref:e,isOpen:t,isDisabled:n,withResizeObserver:i,onStateChange:l}){const[u,h]=(0,o.J0)(t),m=(0,o.li)(),p=e||m,g=(0,o.li)(0),f=(0,r.A)(()=>{h(!0),l?.({element:void 0,height:0,isOpen:!1})});(0,o.vJ)(()=>{n&&f()},[n]),(0,o.vJ)(()=>{t&&h(!0)},[t]),(0,o._W)(f),(0,a.A)(()=>{h(!1),l?.({height:0,isOpen:!1})},t?void 0:450);const v=(0,o.hb)(()=>{const e=p.current;!n&&e&&u&&(t?(0,s.gm)(()=>{const n=e.offsetHeight;return g.current=n,()=>{l?.({element:e,height:n,isOpen:t})}}):l?.({element:e,height:0,isOpen:!1}))},[t,u,n,p,l]),A=(0,c.A)(()=>{const e=p.current;e&&e.offsetHeight!==g.current&&v()},[v,p],100,!0);return(0,o.Nf)(v,[v]),(0,d.A)(p,A,!i||!u),{shouldRender:u,ref:p}}function u({list:e,noTransition:t=!1,zIndexIncrease:n}){let o=0;for(let a=0;a{(0,i.Tv)(d,{transform:`translateY(${r.isOpen?c:`calc(${c} - 100% - 0.5rem)`})`,zIndex:String(-a),transition:t?"none":""})};d.dataset.isPanelOpen||!r.isOpen||t?l():((0,i.Tv)(d,{transform:`translateY(calc(${c} - 100%))`,zIndex:String(n?a:-a),transition:"none"}),d.dataset.isPanelOpen="true",(0,s.Uz)(l)),o+=r.height}}},18444(e,t,n){n.d(t,{A:()=>mo});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(70636),l=n(26129),u=n(11597),h=n(56494),m=n(30708),p=n(96115),g=n(63495),f=n(96454),v=n(87357),A=n(95807),y=n(48899),C=n(60343),w=n(6211),I=n(80140),b=n(83868),S=n(41512),M=n(76023),N=n(4961),k=n(58734);function Y(e){if(!e||1!==e.extendedMedia.length)return{photo:void 0,video:void 0};const t=e.extendedMedia[0],n="mediaType"in t;return{photo:n?t.duration?void 0:t:t.photo,video:n?t.duration?t:void 0:t.video}}var F=n(43336),P=n(35127);function T(e,t){return e.reduce((e,t)=>e+t,t)}function D(e){const t={width:0,height:0};return e.forEach(({dimensions:e,sides:n})=>{2&n&&(t.width=e.width+e.x),4&n&&(t.height=e.height+e.y)}),t}function x(e,t,n,o){const i=function(e,t,n){const o=e[0].isOutgoing,i=(t?e[0].content.paidMedia.extendedMedia.map(e=>"mediaType"in e?e:e.photo||e.video):e.map(e=>(0,d.r_)(e).photo||(0,d.r_)(e).video)).filter(Boolean);return i.map(e=>{const t=(0,P.yA)({media:e,isOwn:o,isMobile:n});return t.width/t.height})}(n.messages,Boolean(n.isPaidMedia),o),s=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(i),a=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(i),r=i.length,c=i.some(e=>e>2),l=(0,M.w4)(e,!1,t,o);let u;const h={ratios:i,proportions:s,averageRatio:a,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return u=r>=5||c?function({ratios:e,averageRatio:t,maxWidth:n,minWidth:o,spacing:i,maxHeight:s=4*n/3}){const a=function(e,t){return e.map(e=>t>1.1?(0,F.qE)(e,1,2.75):(0,F.qE)(e,.6667,1))}(e,t),r=e.length,d=new Array(r),c=[],l=e=>{const t=[];let o=0;e.forEach(e=>{t.push(((e,t)=>{const o=T(a.slice(e,e+t),0);return(n-(t-1)*i)/o})(o,e)),o+=e}),c.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&l([e,t])}for(let e=1;e!==r-1;++e)for(let n=1;n!==r-e;++n){const o=r-e-n;e<=3&&n<=(t<.85?4:3)&&o<=3&&l([e,n,o])}for(let e=1;e!==r-1;++e)for(let t=1;t!==r-e;++t)for(let n=1;n!==r-e-t;++n){const o=r-e-t-n;e<=3&&t<=3&&n<=3&&o<=4&&l([e,t,n,o])}let u,h=0;for(let e=0;e{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),m=Math.abs(r-s)*d*l;(!u||m1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(i-o)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+o,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=(n-o)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],i)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+o,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:o,spacing:i,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(o-i),(o-i)/t[0]/(1/t[0]+1/t[1]))),o-i-a),d=o-r-i,c=Math.min(s,Math.round(Math.min(d/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:d,height:c},sides:13},{dimensions:{x:d+i,y:0,width:r,height:c},sides:7}]}(e)}(h):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:o,maxWidth:i,minWidth:s}=e,a=t,r=Math.round(Math.min((t-n)/2,o[1]*(i-n)/(o[2]+o[1]))),d=a-r-n,c=Math.max(s,Math.round(Math.min((i-n)/2,Math.min(r*o[2],d*o[1])))),l=Math.min(Math.round(a*o[0]),i-n-c);return[{dimensions:{x:0,y:0,width:l,height:a},sides:13},{dimensions:{x:l+n,y:0,width:c,height:d},sides:3},{dimensions:{x:l+n,y:d+n,width:c,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:o,spacing:i}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(o-i))),r=(t-i)/2,d=Math.min(o-a-i,Math.round(Math.min(r/n[1],r/n[2])));return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+i,width:r,height:d},sides:12},{dimensions:{x:r+i,y:a+i,width:s-r-i,height:d},sides:6}]}(e)}(h):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:n,maxHeight:o,minWidth:i}){const s=e,a=Math.round(Math.min(s/t[0],.66*(o-n))),r=Math.round((e-2*n)/(t[1]+t[2]+t[3])),d=Math.max(i,Math.round(Math.min(.4*(e-2*n),r*t[1]))),c=Math.round(Math.max(Math.max(i,.33*(e-2*n)),r*t[3])),l=s-d-c-2*n,u=Math.min(o-a-n,r);return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+n,width:d,height:u},sides:12},{dimensions:{x:d+n,y:a+n,width:l,height:u},sides:4},{dimensions:{x:d+n+l+n,y:a+n,width:c,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:n,spacing:o,minWidth:i}){const s=e,a=Math.round(Math.min(s*t[0],.6*(n-o))),r=Math.round((e-2*o)/(1/t[1]+1/t[2]+1/t[3])),d=Math.round(r/t[1]),c=Math.round(r/t[2]),l=s-d-c-2*o,u=Math.max(i,Math.min(n-a-o,r));return[{dimensions:{x:0,y:0,width:a,height:s},sides:13},{dimensions:{x:a+o,y:0,width:u,height:d},sides:3},{dimensions:{x:a+o,y:d+o,width:u,height:c},sides:2},{dimensions:{x:a+o,y:d+c+2*o,width:u,height:l},sides:6}]}(e)}(h),{layout:u,containerStyle:D(u)}}var L=n(43874),B=n(10722),R=n(82117),E=n(49746),O=n(21488),U=n(37661),K=n(5912),z=n(39351),V=n(17712),j=n(59030),G=n(39996),J=n(73767),q=n(34201),$=n(52603),H=n(84947),W=n(37836);const _=new Map;const Q=(0,W.nF)(function(e){const{updateChatDetectedLanguage:t}=(0,i.ko)(),n=_.get(e);if(!n)return;const o=n.size;if(o<8)return;let s=0,a=0;const r=new Map;for(const e of n.values()){e.isTranslatable&&s++,e.detectedLanguage&&a++;const t=e.detectedLanguage;if(t){const e=r.get(t)||0;r.set(t,e+1)}}if(s/o<.3||a/s<.6)return;t({chatId:e,detectedLanguage:Array.from(r.entries()).sort(([,e],[,t])=>t-e)[0][0]})},1e3);var Z=n(42211),X=n(46275),ee=n(64154),te=n(66644),ne=n(50442),oe=n(43503),ie=n(54464),se=n(672);const ae=3*M.$,re=Number(M.$),de="data-is-document-group-hover";function ce(e,t,n,s,a,r,d,c,l,u,h,m,p){const{updateDraftReplyInfo:g,sendDefaultReaction:v}=(0,i.ko)(),[A,y,C]=(0,U.A)(),[w,I,S]=(0,U.A)(),M=(0,o.li)(),N=(0,se.A)(e=>{const t=h.current;if(!t)return;const{clientX:n,clientY:o}=e,{x:i,width:s,y:a,height:r}=t.getBoundingClientRect(),d=i+s/2,c=a+r/2,l=Math.abs(d-n){if(!f.TF||s||!a||u||!p?.())return;let e;return(0,ne.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===ne.ez.Left&&(e||(e=Date.now()),I(),!0),onRelease:()=>{e&&a&&(g({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})},[t,s,n,I,S,a,u,p]),{handleMouseDown:s?void 0:function(e){(0,ie.l)(e),c(e)},handleClick:function(t){if(s)e(t);else if(f.TF)return M.current?(clearInterval(M.current),M.current=void 0,void v({chatId:l,messageId:n})):void(M.current=setTimeout(()=>{M.current=void 0,function(e){if(f.Ni){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;oe.A.getIsKeyboardVisible()?setTimeout(()=>{d(e)},350):d(e)}}(t)},200))},handleContextMenu:s?r?b.A:void 0:function(t){if(f.Ni){if(t.target.matches("a[href]")||u)return;t.preventDefault(),e()}else d(t)},handleDoubleClick:s?void 0:function(){!f.TF&&a&&g({replyToMsgId:n,replyToPeerId:void 0,quoteText:void 0,quoteOffset:void 0})},handleContentDoubleClick:f.TF?void 0:function(e){e.stopPropagation()},handleMouseMove:N,handleSendQuickReaction:function(e){e.stopPropagation(),v({chatId:l,messageId:n})},handleMouseLeave:function(e){(0,te.YS)(C),m&&function(e){const t=ue(e.currentTarget);t&&t.removeAttribute(de)}(e)},isSwiped:w,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:le}}function le(e){const t=ue(e.currentTarget);t&&t.setAttribute(de,"")}function ue(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var he=n(65240),me=n(21849),pe=n(87412),ge=n(55723),fe=n(80999),ve=n(91930),Ae=n(11217),ye=n(5505),Ce=n(18276),we=n(86070),Ie=n(20021);const be=({story:e,sender:t,noUserColors:n,isProtected:o,observeIntersectionForLoading:s,observeIntersectionForPlaying:a,onClick:r})=>{const{showNotification:d}=(0,i.ko)(),l=(0,j.A)(),u=e&&"content"in e,h=e&&"isDeleted"in e,m=u?"Story":h?"ExpiredStory":"Loading",p=u&&(0,ye.c)(e.content),g=t?(0,c.F9)(l,t):void 0,f=(0,V.A)(()=>{e&&!h?r():d({message:l("StoryNotFound")})}),{handleClick:A,handleMouseDown:y}=(0,Ae.Q)(f);return(0,Ie.FD)(we.A,{peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,v.A)("EmbeddedMessage",p&&"with-thumb"),onClick:A,onMouseDown:y,children:[u&&p&&(0,Ie.Y)(ye.A,{media:e.content,className:"embedded-thumb",isPictogram:!0,isProtected:o,observeIntersectionForLoading:s,observeIntersectionForPlaying:a}),(0,Ie.FD)("div",{className:"message-text with-message-color",children:[(0,Ie.FD)("p",{className:"embedded-text-wrapper",children:[h&&(0,Ie.Y)(Ce.A,{name:"story-expired",className:"embedded-origin-icon"}),u&&(0,Ie.Y)(Ce.A,{name:"story-reply",className:"embedded-origin-icon"}),l(m)]}),(0,Ie.Y)("div",{className:"message-title",children:(0,N.A)(g||" ")})]})]})};var Se=n(2578),Me=n(9267),Ne=n(45215),ke=n(85223),Ye=n(17794),Fe=n(85118),Pe=n(90603),Te=n(38102);var De=n(61911);const xe=1.125*M.$,Le=(0,o.ph)(({topic:e,className:t,onClick:n})=>{const o=(0,j.A)();return(0,Ie.FD)("div",{className:(0,v.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Pe.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,Ie.Y)(Te.A,{topic:e,size:xe}):(0,Ie.Y)("img",{src:De,alt:"",draggable:!1}),e?.title?(0,N.A)(e.title):o("Loading"),e?.isClosed&&(0,Ie.Y)(Ce.A,{name:"lock"}),(0,Ie.Y)(Ce.A,{name:"next"})]})});var Be=n(15006),Re=n(64493),Ee=n(94189),Oe=n(40664);function Ue(e){return(0,o.ph)((0,i.EK)((e,t)=>{const{clickArg:n,noSelectControls:o}=t;return{isInSelectMode:!o&&(0,u.rTV)(e),isSelected:!o&&(0,u.H1_)(e,n)}})(t=>{const{isInSelectMode:n,isSelected:s,dimensions:a,clickArg:r}=t,{toggleMessageSelection:d}=(0,i.ko)(),c=(0,V.A)(e=>{e.stopPropagation(),d({messageId:r,withShift:e?.shiftKey})}),l=(0,o.Kr)(()=>{const{dimensions:e,onClick:o}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:o}},[t,n,s]);return(0,Ie.FD)("div",{className:(0,v.A)("album-item-select-wrapper",s&&"is-selected"),style:a?`left: ${a.x}px; top: ${a.y}px;`:"",onClick:n?c:void 0,children:[n&&(0,Ie.Y)("div",{className:"message-select-control",children:s&&(0,Ie.Y)(Ce.A,{name:"check",className:"message-select-control-icon"})}),(0,Ie.Y)(e,{...l})]})}))}var Ke=n(51644),ze=n(25477);const Ve=Ue(Ke.A),je=Ue(ze.A),Ge=(0,i.EK)(e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}})(({album:e,observeIntersection:t,hasCustomAppendix:n,isOwn:s,isProtected:a,albumLayout:r,onMediaClick:c,uploadsByKey:l,activeDownloads:h,theme:m})=>{const{cancelUploadMedia:p}=(0,i.ko)(),{content:{paidMedia:g}}=e.mainMessage,f=e.isPaidMedia?g.extendedMedia.length:e.messages.length,v=(0,V.A)(t=>{c(e.mainMessage.id,t)}),A=(0,V.A)(e=>{c(e)}),y=(0,V.A)(t=>{p({chatId:e.mainMessage.chatId,messageId:t})}),w=(0,o.Kr)(()=>e.isPaidMedia?e.mainMessage.content.paidMedia.extendedMedia.map(()=>e.mainMessage):e.messages,[e]),{width:I,height:b}=r.containerStyle;return(0,Ie.Y)("div",{className:"Album",style:`width: ${I}px; height: ${b}px;`,children:w.map(function(o,c){const p=e.isPaidMedia?o.content.paidMedia?.extendedMedia[c]:void 0,g=p&&"mediaType"in p?p:p?.photo,w=p&&"mediaType"in p?p:p?.video,I=g||(0,d.yl)(o),b=w||(0,d.r_)(o).video,S=l[(0,C.bj)(o)],M=S?.progress,{dimensions:N,sides:k}=r.layout[c],Y=(0,u.wwb)((0,i.mS)(),o),F=(0,u.OEt)((0,i.mS)(),o);if(I){const i=n&&(s?c===f-1:Boolean(8&k&&4&k));return(0,Ie.Y)(Ve,{id:`album-media-${(0,d.GZ)(o.id,e.isPaidMedia?c:void 0)}`,photo:I,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:Y,shouldAffectAppendix:i,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?c:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:y,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,d.$r)(h,I),theme:m,noSelectControls:e.isPaidMedia})}if(b)return(0,Ie.Y)(je,{id:`album-media-${(0,d.GZ)(o.id)}`,video:b,observeIntersectionForLoading:t,canAutoLoad:Y,canAutoPlay:F,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?c:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:y,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,d.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})})})});var Je=n(41733),qe=n(62587);const $e=7*M.$;function He(e,t,n,s,a,r,d){const{interactWithAnimatedEmoji:c,sendEmojiInteraction:l,sendWatchingEmojiInteraction:u}=(0,i.ko)(),h=(0,o.li)(),m=(0,o.li)(),p=(0,qe.A)(n?`document${n}`:void 0,!n),f=d||$e,v=(0,A.A)(`width: ${f}px`,`height: ${f}px`,r&&!g.Vq&&"cursor: pointer"),y=(0,o.li)(void 0),C=(0,o.li)(void 0),w=(0,V.A)(()=>{h.current&&(l({chatId:e,messageId:t,emoji:r,interactions:y.current}),C.current=void 0,y.current=void 0)}),I=(0,V.A)(()=>{const e=m.current;p&&(e&&(e.pause(),e.remove()),m.current=new Audio,m.current.src=p,(0,Je.A)(m.current),m.current.addEventListener("ended",()=>{m.current=void 0},{once:!0}))}),b=(0,V.A)(()=>{I();const n=h.current;if(!(r&&n&&t&&e))return;const{x:o,y:i}=n.getBoundingClientRect();c({emoji:r,x:o,y:i,startSize:f,isReversed:!a}),y.current||(y.current=[],C.current=performance.now(),setTimeout(w,1e3)),y.current.push(C.current?(performance.now()-C.current)/1e3:0)});return(0,o.vJ)(()=>{const n=h.current;n&&s&&s.forEach(({id:o,startSize:i,messageId:s})=>{if(i||t!==s)return;const{x:d,y:c}=n.getBoundingClientRect();u({id:o,chatId:e,emoticon:r,startSize:f,x:d,y:c,isReversed:!a}),I()})},[s,e,r,a,t,I,u,f]),{ref:h,size:f,style:v,handleClick:b}}const We=(0,o.ph)((0,i.EK)((e,{customEmojiId:t,withEffects:n})=>{const o=(0,u.O8F)(e,t);return{sticker:o,effect:o?.emoji&&n?(0,u.Nr8)(e,o.emoji):void 0,soundId:o?.emoji&&(0,u.tKM)(e,o.emoji),noPlay:!(0,u.BWX)(e)}})(({isOwn:e,customEmojiId:t,messageId:n,chatId:o,activeEmojiInteractions:i,sticker:s,effect:a,soundId:r,noPlay:d,observeIntersection:c})=>{const{ref:l,size:u,style:h,handleClick:m}=He(o,n,r,i,e,a?.emoji,(0,k.Rr)(1));return(0,Ie.Y)(pe.A,{ref:l,documentId:t,className:(0,v.A)("AnimatedEmoji media-inner",s?.id===M.AC&&"like-sticker-thumb"),style:h,size:u,isBig:!0,noPlay:d,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(a&&i?.length),observeIntersectionForLoading:c,onClick:m})}));var _e=n(79577);const Qe=(0,o.ph)((0,i.EK)((e,{emoji:t,withEffects:n})=>({sticker:(0,u.oei)(e,t),effect:n?(0,u.Nr8)(e,t):void 0,soundId:(0,u.tKM)(e,t)}))(({isOwn:e,observeIntersection:t,forceLoadPreview:n,messageId:o,chatId:i,activeEmojiInteractions:s,sticker:a,effect:r,soundId:d})=>{const{ref:c,size:l,style:u,handleClick:h}=He(i,o,d,s,e,r?.emoji),m=(0,K.Vz)(c,t);return(0,Ie.Y)(_e.A,{sticker:a,size:l,quality:1,noLoad:!m,forcePreview:n,play:m,forceAlways:!0,ref:c,className:(0,v.A)("AnimatedEmoji media-inner",a?.id===M.AC&&"like-sticker-thumb"),style:u,onClick:h})}));var Ze=n(14242),Xe=n(93809),et=n(68292),tt=n(97422);const nt=(0,o.ph)(({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s})=>{const{openThread:a,openFrozenAccountModal:r}=(0,i.ko)(),d=(0,Xe.A)([s],450),c=(0,j.A)(),l=(0,z.A)(),{originMessageId:h,chatId:m,messagesCount:p,recentReplierIds:g,originChannelId:f,hasUnread:A}=t||{},y=(0,V.A)(()=>{const e=(0,i.mS)();h&&f&&((0,u.trm)(e)?r():a({isComments:!0,chatId:m,originMessageId:h,originChannelId:f}))}),C=(0,o.Kr)(()=>{if(!g?.length)return;const e=(0,i.mS)();return g.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[g]),w=p?c("CommentsCount","%COMMENTS_COUNT%",void 0,p).split("%").map(e=>"COMMENTS_COUNT"===e?(0,Ie.Y)(et.A,{text:(0,Ze.Vw)(l,p)}):e):void 0;return(0,Ie.FD)("div",{"data-cnt":(0,Ze.Vw)(l,p||0),className:(0,v.A)("CommentButton",A&&"has-unread",n&&"disabled",e&&"CommentButton-custom-shape",s&&"loading"),dir:l.isRtl?"rtl":"ltr",onClick:y,role:"button",tabIndex:0,children:[(0,Ie.Y)(Ce.A,{name:"comments-sticker",className:(0,v.A)("CommentButton_icon-comments",s&&d&&"CommentButton_hidden")}),!C?.length&&(0,Ie.Y)(Ce.A,{name:"comments"}),Boolean(C?.length)&&(0,Ie.Y)("div",{className:"recent-repliers",dir:l.isRtl?"rtl":"ltr",children:C.map(e=>(0,Ie.Y)(me.A,{size:"small",peer:e},e.id))}),(0,Ie.Y)("div",{className:"label",dir:"auto",children:p?w:c("LeaveAComment")}),(0,Ie.FD)("div",{className:"CommentButton_right",children:[s&&(0,Ie.Y)(tt.A,{className:(0,v.A)("CommentButton_loading",!d&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,Ie.Y)(Ce.A,{name:"next",className:(0,v.A)("CommentButton_icon-open",s&&d&&"CommentButton_hidden")})]})]})});var ot=n(85982),it=n(64713);const st="ReDHhQHm";function at(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const rt=(0,i.EK)((e,{contact:t})=>{const{countryList:{phoneCodes:n}}=e;return{user:(0,u.mBe)(e,t.userId),phoneCodeList:n}})(({contact:e,user:t,phoneCodeList:n,noUserColors:o})=>{const s=(0,j.A)(),{openChat:a,openAddContactDialog:r,showNotification:c,openChatWithInfo:l}=(0,i.ko)(),{phoneNumber:u,userId:h}=e,m="0"!==h,p=m&&t&&(0,d.Gh)(t),g=(0,V.A)(()=>{a({id:h})}),f=(0,V.A)(()=>{r({userId:t?.id})}),v=(0,V.A)(()=>{t?l({id:h}):((0,ot.eM)(u),c({message:s("PhoneCopied")}))});return(0,Ie.FD)(we.A,{noUserColors:o,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,Ie.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,Ie.Y)(me.A,{size:"medium",peer:t,text:at(e)}),(0,Ie.FD)("div",{className:"fpYynE5s",children:[(0,Ie.Y)("div",{className:"_PNTJc_V",children:t?(0,d.Yg)(t):at(e)}),(0,Ie.Y)("div",{className:"JP_3wes8",children:(0,it.Ox)(n,u)})]})]}),m&&(0,Ie.FD)(Ie.FK,{children:[(0,Ie.Y)("div",{className:"_OSJcuqH"}),(0,Ie.FD)("div",{className:"Blui4M4G",children:[(0,Ie.Y)(Re.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:st,children:s("SharedContactMessage")}),p&&(0,Ie.Y)(Re.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:st,children:s("SharedContactAdd")})]})]})]})});var dt=n(80089),ct=n(80464);const lt=e=>{const{isOpen:t}=e,n=(0,ct.A)(dt.ar.Extra,"ContextMenuContainer",!t);return n?(0,Ie.Y)(n,{...e}):void 0};var ut=n(30163),ht=n(82855);const mt="CjuMj2Ml",pt="o_0F4yn3",gt="D0ZI66VZ",ft="a7edyhq7",vt=13*M.$,At=(0,o.ph)((0,i.EK)((e,{dice:t})=>({idleSticker:(0,ut.zE)(e,t.emoticon),valueSticker:(0,ut.NQ)(e,t.emoticon,t.value),winEffect:e.appConfig.diceEmojiesSuccess[t.emoticon]}))(({dice:e,canSendDice:t,idleSticker:n,valueSticker:s,winEffect:a,canPlayWinEffect:r,isLocal:d,isOutgoing:c,onEffectPlayed:l,observeIntersectionForLoading:u,observeIntersectionForPlaying:h})=>{const{requestConfetti:m,showNotification:p}=(0,i.ko)(),{isMobile:g}=(0,L.Ay)(),{width:f}=n?(0,M.bu)(n,g):{width:vt},A=!r&&!d,[y,C]=(0,o.J0)(A),[w,I]=(0,U.A)(),b=(0,o.li)(),S=(0,o.li)(),N=(0,V.A)(()=>{C(w)}),k=(0,V.A)(t=>{r&&c&&e.value===a?.value&&t===a?.frameStart&&(m({}),l?.())}),Y=(0,V.A)(()=>{t&&p({message:{key:"DiceToast",variables:{emoji:e.emoticon},options:{withNodes:!0}},action:{action:"sendDiceInCurrentChat",payload:{emoji:e.emoticon}},actionText:{key:"DiceToastSend"}})});return(0,Ie.FD)("div",{className:(0,v.A)(mt,t&&pt),style:`--_size: ${f}px`,onClick:Y,children:[n&&(0,Ie.Y)("div",{ref:b,className:(0,v.A)(gt,y&&ft),children:(0,Ie.Y)(ht.A,{containerRef:b,sticker:n,size:f,noPlay:y,shouldLoop:!0,forceAlways:!0,skipPreview:y,onAnimatedStickerLoop:N,observeIntersectionForLoading:u,observeIntersectionForPlaying:h})}),s&&(0,Ie.Y)("div",{ref:S,className:(0,v.A)(gt,!y&&ft),children:(0,Ie.Y)(ht.A,{containerRef:S,sticker:s,size:f,noPlay:!y,skipPreview:!0,forceAlways:!0,forceAnimatedStickerOnEnd:A,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,onAnimatedStickerLoad:I,onAnimatedStickerFrame:k})})]})})),yt=[1,2,3,0];var Ct=n(37960),wt=n(18104);const It=13*M.$,bt=(0,o.ph)((0,i.EK)(e=>{const t=e.stickers.diceSetIdByEmoji?.[r.IgS];return{slotsStickerSet:t?(0,u.ycM)(e,t):void 0,winEffect:e.appConfig.diceEmojiesSuccess[r.IgS]}})(({dice:e,canSendDice:t,canPlayWinEffect:n,isLocal:s,isOutgoing:a,slotsStickerSet:r,winEffect:c,onEffectPlayed:l,observeIntersectionForLoading:u})=>{const{requestConfetti:h,showNotification:m}=(0,i.ko)(),{isMobile:p}=(0,L.Ay)(),g=e.value===c?.value,f=!n&&!s,A=(0,o.li)(0),[y,C]=(0,U.A)(!f),[w,I]=(0,o.J0)(f&&g?"win":"base"),[b,S]=(0,o.J0)(f?"result":"base"),{ref:N}=(0,Ct.A)({hasMediaData:y}),k=(0,K.Vz)(N,u),Y=r?.stickers&&function(e,t){const n=-1===t,o=t-1&3,i=t-1>>2&3,s=t-1>>4&3;return{background:e[0],frameWin:e[1],frameStart:e[2],leftWin:e[3],leftResult:n?void 0:e[4+yt[o]],leftSpin:e[8],middleWin:e[9],middleResult:n?void 0:e[10+yt[i]],middleSpin:e[14],rightWin:e[15],rightResult:n?void 0:e[16+yt[s]],rightSpin:e[20]}}(r?.stickers,e.value),F=Y?.background?(0,d.Mw)(Y.background,"full"):void 0,P=(0,qe.A)(F,!k),T=Y?.frameWin&&g?(0,d.Mw)(Y.frameWin,"full"):void 0,D=(0,qe.A)(T,!k),x=Y?.frameStart?(0,d.Mw)(Y.frameStart,"full"):void 0,B=(0,qe.A)(x,!k),R=Y?.leftSpin?(0,d.Mw)(Y.leftSpin,"full"):void 0,E=(0,qe.A)(R,!k),O=Y?.middleSpin?(0,d.Mw)(Y.middleSpin,"full"):void 0,z=(0,qe.A)(O,!k),j=Y?.rightSpin?(0,d.Mw)(Y.rightSpin,"full"):void 0,G=(0,qe.A)(j,!k),J=Y?.leftResult?(0,d.Mw)(Y.leftResult,"full"):void 0,q=(0,qe.A)(J,!k),$=Y?.middleResult?(0,d.Mw)(Y.middleResult,"full"):void 0,H=(0,qe.A)($,!k),W=Y?.rightResult?(0,d.Mw)(Y.rightResult,"full"):void 0,_=(0,qe.A)(W,!k),{width:Q}=Y?(0,M.bu)(Y.background,p):{width:It},Z=!q||!H||!_,X=(0,V.A)(()=>{A.current+=1,A.current>=3&&setTimeout(()=>{C()},100)}),ee=(0,V.A)(()=>{Z||(S("result"),g&&setTimeout(()=>I("win"),700))}),te=(0,V.A)(e=>{n&&a&&g&&e===c?.frameStart&&(h({}),l?.())}),ne=(0,V.A)(()=>{t&&m({message:{key:"DiceToast",variables:{emoji:e.emoticon},options:{withNodes:!0}},action:{action:"sendDiceInCurrentChat",payload:{emoji:e.emoticon}},actionText:{key:"DiceToastSend"}})});function oe(e,t,n,o,i,s){if(!o||!t)return(0,Ie.Y)("div",{className:(0,v.A)(gt,t&&ft),children:(0,Ie.Y)(wt.A,{tgsUrl:e,size:Q,play:!t,noLoop:!n,forceAlways:!0,onEnded:i,onFrame:s,onLoad:t?void 0:X,seekToEnd:f})})}return(0,Ie.FD)("div",{ref:N,className:(0,v.A)(mt,t&&pt),style:`--_size: ${Q}px`,onClick:ne,children:[oe(P,"base"!==w,!1,!0),oe(D,"win"!==w,!1,!1,void 0,te),oe(E,"base"!==b,Z,!0),oe(z,"base"!==b,Z,!0),oe(G,"base"!==b,Z,!0,ee),oe(q,"result"!==b),oe(H,"result"!==b),oe(_,"result"!==b),oe(B,!1)]})})),St=(0,o.ph)(e=>e.dice.emoticon===r.IgS?(0,Ie.Y)(bt,{...e}):(0,Ie.Y)(At,{...e}));var Mt=n(69282),Nt=n(57675),kt=n(32581);const Yt={type:"regular",color:0},Ft=(0,o.ph)(({factCheck:e,isToggleDisabled:t})=>{const n=(0,j.A)(),i=(0,o.li)(),s=(0,o.li)(),{isCollapsed:a,isCollapsible:r,setIsCollapsed:d}=(0,Nt.A)(i,4,s),c=(0,o.Kr)(()=>{if(e.countryCode&&n.code)return new Intl.DisplayNames([n.code],{type:"region"}).of(e.countryCode)},[e.countryCode,n.code]),l=!t&&a,u=(0,V.A)(()=>{d(!1)}),h=(0,V.A)(()=>{d(e=>!e)});if(e.text)return(0,Ie.FD)(we.A,{peerColor:Yt,className:"HMB5LgeX",onClick:l?u:void 0,children:[(0,Ie.FD)("div",{ref:s,className:(0,v.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,Ie.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,Ie.Y)("div",{ref:i,className:"k_dGolcu",children:(0,Mt.fd)({text:e.text.text,entities:e.text.entities})}),(0,Ie.Y)(kt.A,{className:"qRaSs5iA"}),(0,Ie.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",c)})]}),r&&(0,Ie.Y)("div",{className:(0,v.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:h,"aria-hidden":!0,children:(0,Ie.Y)(Ce.A,{name:a?"down":"up"})})]})});var Pt=n(55158);const Tt=(0,o.ph)(({message:e,threadId:t,canAutoLoadMedia:n})=>{const{clickBotInlineButton:o}=(0,i.ko)(),s=e.content.game,{title:a,description:r}=s,c=(0,d.zb)(s),l=(0,d.ih)(s),u=(0,qe.A)(c,!n),h=(0,qe.A)(l,!n);return(0,Ie.FD)("div",{className:"Game",children:[(0,Ie.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{o({chatId:e.chatId,messageId:e.id,threadId:t,button:e.inlineButtons[0][0]})},children:[!u&&!h&&(0,Ie.Y)(Pt.A,{className:"skeleton preview-content",animation:"pulse"}),u&&(0,Ie.Y)("img",{className:"preview-content",src:u,alt:a,draggable:!1}),h&&(0,Ie.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:h})]}),(0,Ie.Y)("div",{className:"title",children:a}),!(0,d.P5)(e)&&(0,Ie.Y)("div",{className:"description",children:r})]})});var Dt=n(58744),xt=n(52491),Lt=n(4875),Bt=n(44029),Rt=n(64489),Et=n(10187);const Ot="ogvcv3mr",Ut="MSFa9BPf",Kt="HfZ6SuLI",zt="rPyyNYxK",Vt="FV70u896",jt=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{giveaway:n}=t.content,o=(0,u.hds)(e,t.chatId);return{chat:o,sender:(n?.channelIds[0]?(0,u.hds)(e,n.channelIds[0]):void 0)||(0,u.Szq)(e,t)||o,giftSticker:n&&(0,u.t0O)(e,n.months),canPlayAnimatedEmojis:(0,u.BWX)(e)}})(({chat:e,sender:t,message:n,canPlayAnimatedEmojis:s,giftSticker:a})=>{const{openChat:r}=(0,i.ko)(),l=(0,o.li)(!1),[u,h]=(0,o.J0)(),m=(0,j.A)(),{giveaway:p,giveawayResults:g}=n.content,f=Boolean(g),{months:A,untilDate:y,prizeDescription:C,stars:w}=p||g,b=(0,d.Ie)(n),S=f?g.winnersCount:p.quantity,M=(0,I.Fm)()>y,k=(0,o.Kr)(()=>{if(f)return;const e=new Intl.DisplayNames([m.code,"en"].filter(Boolean),{type:"region"});return p?.countries?.map(t=>`${(0,xt.D0)(t)} ${e.of(t)}`).join(", ")},[p,f,m.code]),Y=(0,V.A)(e=>{r({id:e})}),F=(0,V.A)(async()=>{if(l.current)return;l.current=!0;const t=await(0,Lt.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});h(t),l.current=!1}),P=(0,V.A)(()=>{h(void 0)}),T=(0,o.Kr)(()=>{if(u)return m("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")},[u,m]);return(0,Ie.FD)("div",{className:"CbpKtOey",children:[(0,Ie.FD)("div",{className:(0,v.A)("hjjKhvVv",f&&"JEiR48jJ"),children:[f?(0,Ie.Y)(Rt.A,{size:150,tgsUrl:Bt.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,Ie.Y)(_e.A,{sticker:a,play:s&&M,noLoop:!0,nonInteractive:!0,size:175}),(0,Ie.Y)("span",{className:"n_QCMv_A",children:`x${S}`})]}),f?function(e){const t=e.winnerIds;return(0,Ie.FD)(Ie.FK,{children:[(0,Ie.FD)("div",{className:Ut,children:[(0,Ie.Y)("strong",{className:Ot,children:(0,N.A)(m("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,Ie.Y)("p",{className:Kt,children:(0,N.A)(m("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,Ie.Y)("strong",{className:Ot,children:m("lng_prizes_results_winners")}),(0,Ie.Y)("div",{className:zt,children:t.map(e=>(0,Ie.Y)(Et.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:Vt,clickArg:e,onClick:Y}))})]}),(0,Ie.Y)("div",{className:Ut,children:(0,Ie.Y)("p",{className:Kt,children:m("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(g):function(e){const t=e.channelIds;return(0,Ie.FD)(Ie.FK,{children:[(0,Ie.FD)("div",{className:Ut,children:[(0,Ie.Y)("strong",{className:Ot,children:(0,N.A)(m("BoostingGiveawayPrizes"),["simple_markdown"])}),C&&(0,Ie.FD)(Ie.FK,{children:[(0,Ie.Y)("p",{className:Kt,children:(0,N.A)(m("BoostingGiveawayMsgPrizes",[S,C],void 0,S),["simple_markdown"])}),(0,Ie.Y)(kt.A,{children:m("BoostingGiveawayMsgWithDivider")})]}),(0,Ie.Y)("p",{className:Kt,children:n?.content?.giveaway?.stars?(0,Ie.FD)(Ie.FK,{children:[(0,N.A)(m("Chat.Giveaway.Message.Stars.PrizeText",m("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,Ie.Y)("br",{}),(0,N.A)(m("AmongWinners",S),["simple_markdown"])]}):(0,Ie.FD)(Ie.FK,{children:[(0,N.A)(m("Chat.Giveaway.Info.Subscriptions",S),["simple_markdown"]),(0,Ie.Y)("br",{}),(0,N.A)(m("ActionGiftPremiumSubtitle",m("Chat.Giveaway.Info.Months",A)),["simple_markdown"])]})})]}),(0,Ie.FD)("div",{className:Ut,children:[(0,Ie.Y)("strong",{className:Ot,children:(0,N.A)(m("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,Ie.Y)("p",{className:Kt,children:(0,N.A)(m("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,Ie.Y)("div",{className:zt,children:t.map(e=>(0,Ie.Y)(Et.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:Vt,clickArg:e,onClick:Y}))}),k&&(0,Ie.Y)("span",{children:(0,N.A)(m("Chat.Giveaway.Message.CountriesFrom",k))})]}),(0,Ie.FD)("div",{className:Ut,children:[(0,Ie.Y)("strong",{className:Ot,children:(0,N.A)(m("BoostingWinnersDate"),["simple_markdown"])}),(0,Ie.Y)("p",{className:Kt,children:(0,Dt.L2)(1e3*y,m.code,!0)})]})]})}(p),(0,Ie.Y)(Re.A,{className:"jMBw7STU",color:"adaptive",onClick:F,children:m("BoostingHowItWork")}),(0,Ie.Y)(Ee.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:T,confirmHandler:P,onClose:P,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,c.vj)(t)?(0,d.Js)(m,t):(0,d.Yg)(t),o=(0,Dt.U)(m,1e3*y),s=p?.channelIds?p.channelIds.length-1:0,a=m("Chat.Giveaway.Info.OtherChannels",s),r=s>0,l=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",h=e?m("Chat.Giveaway.Info.Months",A):m("Stars",w,"i"),g=m(l,[n,S,h],void 0,S),f=C?m("BoostingGiveawayHowItWorksIncludeText",[n,S,C],void 0,S):void 0;let v;v=e?r?"BoostingGiveawayHowItWorksSubTextSeveralEnd":"BoostingGiveawayHowItWorksSubTextEnd":r?"BoostingGiveawayHowItWorksSubTextSeveral":"BoostingGiveawayHowItWorksSubText";let I=m(v,[o,S,n,s],void 0,S);e&&u.activatedCount&&(I+=` ${m("BoostingGiveawayUsedLinksPlural",u.activatedCount)}`);let b="";e&&(b=u.isRefunded?m("BoostingGiveawayCanceledByPayment"):m(u.isWinner?"BoostingGiveawayYouWon":"BoostingGiveawayYouNotWon"));let M="";if(e);else if(u.disallowedCountry)M=m("BoostingGiveawayNotEligibleCountry");else if(u.adminDisallowedChatId){const e=(0,i.mS)().chats.byId[u.adminDisallowedChatId],t=e&&(0,d.Js)(m,e);M=m("BoostingGiveawayNotEligibleAdmin",t)}else if(u.joinedTooEarlyDate){const e=(0,Dt.U)(m,1e3*u.joinedTooEarlyDate);M=m("BoostingGiveawayNotEligible",e)}else M=u.isParticipating?r?m("Chat.Giveaway.Info.ParticipatingMany",[n,s]):m("Chat.Giveaway.Info.Participating",n):r?m("Chat.Giveaway.Info.NotQualifiedMany",[n,a,o]):m("Chat.Giveaway.Info.NotQualified",[n,o]);return(0,Ie.FD)(Ie.FK,{children:[b&&(0,Ie.Y)("p",{className:"ZQ4aVVkI",children:(0,N.A)(b,["simple_markdown"])}),(0,Ie.Y)("p",{children:(0,N.A)(g,["simple_markdown"])}),f&&(0,Ie.Y)("p",{children:(0,N.A)(f,["simple_markdown"])}),(0,Ie.Y)("p",{children:(0,N.A)(I,["simple_markdown"])}),M&&(0,Ie.Y)("p",{children:(0,N.A)(M,["simple_markdown"])})]})}()})]})}));var Gt=n(7065),Jt=n(17142),qt=n(40435),$t=n(37859),Ht=n(61097);const Wt=(0,o.ph)(({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:i,theme:s,forcedWidth:a})=>{const c=(0,o.li)(),l=(0,j.A)(),u=(0,z.A)(),h=(0,d.NO)(e),{title:m,description:p,amount:g,currency:f,isTest:v,photo:y}=h,C=(0,qe.A)((0,d.cy)(y)),w=Boolean(a),I=(0,Ht.A)(C,!w),b=e.id;(0,$t.A)(([e])=>{if(t){if(C){const e=c.current.closest(r.KFG);(0,qt.A)(C,!1,b,i,s).then(t=>{(0,te.RK)(()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")})})}}else e&&c.current.closest(r.KFG).removeAttribute(r.D3G)},[t,C,n,i,s,b]);const S=a||y?.dimensions?.width,M=(0,A.A)(y?.dimensions&&`width: ${S}px`,y?.dimensions&&`aspect-ratio: ${y.dimensions.width} / ${y.dimensions.height}`,Boolean(!y?.dimensions&&a)&&`width: ${a}px`);return(0,Ie.FD)("div",{ref:c,className:"Invoice",children:[m&&(0,Ie.Y)("p",{className:"title",children:(0,N.A)(m)}),p&&(0,Ie.Y)("div",{className:"info",children:(0,N.A)(p,["emoji","br"])}),(0,Ie.FD)("div",{className:"description "+(y?"has-image":""),children:[Boolean(y)&&(0,Ie.FD)("div",{className:"invoice-image-container",children:[w&&(0,Ie.Y)("canvas",{ref:I,className:"thumbnail blurred-bg"}),C&&(0,Ie.Y)("img",{className:"invoice-image",src:C,alt:"",style:M,crossOrigin:"anonymous",draggable:!1}),!C&&y&&(0,Ie.Y)(Pt.A,{width:S,height:y.dimensions?.height,forceAspectRatio:!0,animation:"pulse"})]}),(0,Ie.FD)("p",{className:"description-text",children:[(0,Jt.vv)(u,g,f,{iconClassName:"invoice-currency-icon"}),v&&(0,Ie.Y)("span",{className:"test-invoice",children:l("PaymentTestInvoice")})]})]})]})});var _t=n(32625),Qt=n(27860);const Zt={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Xt=(0,o.ph)(({message:e,isConnected:t})=>{const{openInvoice:n,loadExtendedMedia:o}=(0,i.ko)(),s=(0,j.A)(),a=(0,d.NO)(e),{chatId:r,id:c}=e,l=(0,V.A)(()=>{o({chatId:r,ids:[c]})});(0,_t.A)(l,t?3e4:void 0);const{amount:u,currency:h,extendedMedia:m}=a,{width:p,height:g,thumbnail:f,duration:A}=m,y=(0,V.A)(()=>{n({type:"message",chatId:r,messageId:c,isExtendedMedia:!0})});return(0,Ie.FD)("div",{className:(0,v.A)(Zt.root,"media-inner"),onClick:y,children:[(0,Ie.Y)(Qt.A,{thumbDataUri:f?.dataUri,width:p,height:g,isVisible:!0,className:Zt.spoiler}),Boolean(A)&&(0,Ie.Y)("div",{className:Zt.duration,children:(0,Dt.QO)(A)}),(0,Ie.FD)("div",{className:Zt.buy,children:[(0,Ie.Y)(Ce.A,{name:"lock",className:Zt.lock}),s("Checkout.PayPrice",(0,Jt.Ad)(u,h))]})]})});var en=n(47526),tn=n(14737),nn=n(30857),on=n(38691),sn=n(56534);const an=24*Math.PI,rn=1e-4,dn={width:400,height:300,zoom:16};function cn(){return(0,Ie.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,Ie.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,Ie.Y)("path",{d:"M32 8c13.23 0 24 10.77 24 24S45.23 56 32 56 8 45.23 8 32 18.77 8 32 8m0-1C18.19 7 7 18.19 7 32s11.19 25 25 25 25-11.19 25-25S45.81 7 32 7z"}),(0,Ie.Y)("path",{d:"m29.38 57.67-1.98-1.59 3.02-1.66L32 51.54l1.58 2.88 3.02 1.66-1.91 1.53L32 60.73z"}),(0,Ie.Y)("path",{d:"m32 52.58 1.07 1.95.14.26.26.14 2.24 1.22-1.33 1.06-.07.06-.06.07L32 59.96l-2.24-2.61-.06-.07-.07-.06-1.33-1.06 2.24-1.22.26-.14.14-.26L32 52.58m0-2.08-1.94 3.56L26.5 56l2.5 2 3 3.5 3-3.5 2.5-2-3.56-1.94L32 50.5z"})]})}const ln=(0,o.ph)(({message:e,peer:t})=>{const{openMapModal:n}=(0,i.ko)(),s=(0,o.li)(),a=(0,o.li)(),r=(0,j.A)(),c=(0,nn.A)(),l=(0,d.fB)(e),{mediaType:u,geo:h}=l,m=(0,I.Fm)(),p=(0,d.vz)(e),g="geoLive"!==u||p?void 0:e.date+l.period-m,[f,A]=(0,o.J0)(h),y="venue"===u||"geoLive"===u&&!p,{width:C,height:w,zoom:b}=dn,S=(0,on.A)(),M=(0,d.rt)(f,C,w,b,S),N=(0,qe.A)(M),k=(0,J.A)(N,!0),Y=N||k,F=(0,o.Kr)(()=>{if("geoLive"!==u||!f.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=f;return t/(0,en._u)(e,b)},[u,f,b]),P=(0,V.A)(t=>{if("geoLive"!==u)return;const n=t.lastElementChild,o=t.firstElementChild,i=e.date+l.period-(0,I.Fm)(),s=(1-i/l.period)*an,a=(0,Dt.dq)(r,1e3*i);o.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)});function T(){const e=(0,v.A)("pin",u,p&&"expired");if("geoLive"===u)return(0,Ie.FD)("div",{className:e,children:[(0,Ie.Y)(cn,{}),(0,Ie.Y)(me.A,{peer:t,className:"location-avatar"}),void 0!==l.heading&&(0,Ie.Y)("div",{className:"direction",style:`--direction: ${l.heading}deg`})]});if("venue"===u){const t=(0,en.PP)(l.venueType),n=(0,en.KE)(l.venueType);if(n)return(0,Ie.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,Ie.Y)(cn,{}),(0,Ie.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,Ie.Y)("img",{className:e,draggable:!1,src:sn,alt:""})}return(0,o.Nf)(()=>{a.current&&P(a.current)},[P]),(0,o.vJ)(()=>{Math.abs(h.lat-f.lat){c()},p?void 0:1e3*(g||0)),(0,_t.A)(()=>{(0,te.RK)(()=>{const e=a.current;e&&P(e)})},g?1e3:void 0),(0,Ie.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:f,zoom:b})},children:[(0,Ie.FD)("div",{className:"map-wrapper",children:[Y?(0,Ie.Y)("img",{className:"full-media map",src:Y,alt:"Location on a map",draggable:!1,style:`width: ${dn.width}px; height: ${dn.height}px;`}):(0,Ie.Y)(Pt.A,{width:C,height:w,animation:"pulse"}),function(){if(Y)return(0,Ie.FD)(Ie.FK,{children:[Boolean(F)&&!p&&(0,Ie.Y)("div",{className:"location-accuracy",style:`width: ${2*F}px; height: ${2*F}px`}),T()]})}()]}),function(){if(y)return"venue"===u?(0,Ie.FD)("div",{className:"location-info",children:[(0,Ie.Y)("div",{className:"location-info-title",children:l.title}),(0,Ie.Y)("div",{className:"location-info-subtitle",children:l.address})]}):"geoLive"===u?(0,Ie.FD)("div",{className:"location-info",children:[(0,Ie.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,Ie.Y)("div",{className:"location-info-subtitle",children:(0,Dt.IF)(r,m,e.editDate)}),!p&&(0,Ie.FD)("div",{className:"geo-countdown",ref:a,children:[(0,Ie.Y)("span",{className:"geo-countdown-text"}),(0,Ie.Y)("svg",{width:"32px",height:"32px",children:(0,Ie.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":an,"stroke-dashoffset":"0"})})]})]}):void 0}()]})});var un=n(48906),hn=n(97676),mn=n(48775),pn=n(15379),gn=n(45);const fn=(0,o.ph)(({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:d,isTranslated:c,isPinned:l,withFullDate:u,effectEmoji:h,onClick:m,onTranslationClick:p,onEffectClick:g,onOpenThread:f,paidMessageStars:A})=>{const{showNotification:y}=(0,i.ko)(),[C,w]=(0,U.A)(),I=(0,j.A)(),b=(0,z.A)();function S(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const M=(0,o.Kr)(()=>(0,pn.Ee)(e.scheduleRepeatPeriod,b),[e.scheduleRepeatPeriod,b]),k=(0,o.Kr)(()=>{if(!C)return;const t=(0,Dt.L2)(1e3*e.date,I.code,void 0,I.timeFormat),n=e.isEdited&&(0,Dt.L2)(1e3*e.editDate,I.code,void 0,I.timeFormat),o=e.forwardInfo&&(0,Dt.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),I.code,void 0,I.timeFormat);let i=t;return n&&(i+="\n",i+=b("MessageTooltipEditedDate",{date:n})),o&&(i+="\n",i+=b("MessageTooltipForwardedDate",{date:o})),i},[C,I,e,I.timeFormat]),Y=(0,o.Kr)(()=>{if(!e.viewsCount)return;let t=b("MessageTooltipViews",{count:b.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=b("MessageTooltipForwards",{count:b.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t},[b,e.forwardsCount,e.viewsCount]),F=(0,o.Kr)(()=>{const e=a?.messagesCount;if(e)return b("MessageTooltipReplies",{count:e},{pluralValue:e})},[b,a]),P=(0,o.Kr)(()=>{const t=(0,Dt.fU)(I,1e3*e.date),n=u?(0,Dt.be)(I,1e3*(e.forwardInfo?.date||e.date),!0):t;return M?b("FormatDateAtTime",{date:M,time:n}):n},[I,e.date,e.forwardInfo?.date,u,M,b]),T=(0,v.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,Ie.FD)("span",{className:T,dir:b.isRtl?"rtl":"ltr",onClick:m,"data-ignore-on-paste":!0,children:[h&&(0,Ie.Y)("span",{className:"message-effect-icon",onClick:g,children:(0,N.A)(h)}),c&&(0,Ie.Y)(Ce.A,{name:"language",className:"message-translated",onClick:p}),Boolean(e.viewsCount)&&(0,Ie.FD)(Ie.FK,{children:[(0,Ie.Y)("span",{className:"message-views",title:Y,children:(0,Ze.Vw)(b,e.viewsCount)}),(0,Ie.Y)(Ce.A,{name:"channelviews"})]}),!d&&Boolean(a?.messagesCount)&&(0,Ie.FD)("span",{onClick:function(e){e.stopPropagation(),f()},className:"message-replies-wrapper",title:F,children:[(0,Ie.Y)("span",{className:"message-replies",children:(0,Ie.Y)(et.A,{text:(0,Ze.Vw)(b,a.messagesCount)})}),(0,Ie.Y)(Ce.A,{name:"reply-filled"})]}),l&&(0,Ie.Y)(Ce.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,Ie.Y)("span",{className:"message-signature",children:(0,N.A)(n)}),Boolean(A)&&(0,Ie.Y)("span",{className:"message-price",children:(0,mn.U2)(b,A,{asFont:!0})}),(0,Ie.FD)("span",{className:"message-time",title:k,onMouseEnter:w,children:[e.forwardInfo?.isImported&&(0,Ie.FD)(Ie.FK,{children:[(0,Ie.Y)("span",{className:"message-imported",onClick:S,children:(0,Dt.L2)(1e3*e.forwardInfo.date,b.code,!0)}),(0,Ie.Y)("span",{className:"message-imported",onClick:S,children:b("MessageMetaImported")})]}),e.isEdited&&`${b("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${b("MessageMetaApproximate")} `,P]}),t&&(0,Ie.Y)(gn.A,{status:t}),r&&r()]})});var vn=n(4262);const An=(0,o.ph)(({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,i.ko)(),a=(0,j.A)(),{isVideo:r,reason:d,duration:c}=e,l=t.isOutgoing,u="missed"===d,h="busy"===d||void 0===c,m=(0,V.A)(()=>{s({isVideo:r,userId:n})}),p=(0,o.Kr)(()=>e.duration?(0,Dt.zA)(a,e.duration):void 0,[a,e.duration]),g=(0,Dt.fU)(a,1e3*t.date);return(0,Ie.FD)("div",{className:"wqsZyy8u",children:[(0,Ie.Y)(Re.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:m,className:"NGmo4ADz",disabled:!f.OL,ariaLabel:a(l?"CallAgain":"CallBack"),iconName:r?"video-outlined":"phone"}),(0,Ie.FD)("div",{className:"iFn6m6hd",children:[(0,Ie.Y)("div",{className:"l8QfocIQ",children:a((0,vn.fB)(e,t.isOutgoing))}),(0,Ie.FD)("div",{className:"rF5tkx92",children:[(0,Ie.Y)(Ce.A,{name:"arrow-right",className:(0,v.A)("ONmpzmUS",u&&"Alra_BWu",h&&"J7xsuCAm",!l&&"BfgDXljM")}),(0,Ie.Y)("span",{className:"kKPKwFzu",children:p?a("CallMessageWithDuration",[g,p]):g})]})]})]})});var yn=n(98607);const Cn=(0,o.ph)(({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:d}=(0,i.ko)(),c=(0,j.A)(),l=(0,z.A)(),u=!e.isBought,h=(0,o.Kr)(()=>{const t=c("UnlockPaidContent",e.starsAmount);return(0,yn.i)(t,r.Cyx,(0,Ie.Y)(Me.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))},[c,e]),m=(0,V.A)(e=>{d({type:"message",chatId:t,messageId:n}),(0,b.A)(e)});return(0,Ie.FD)("div",{className:"mVaSjZRJ",onClick:u?m:void 0,children:[a,u&&(0,Ie.Y)(Re.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,Ie.Y)("span",{className:"gLaaVQXr",children:h})}),e.isBought&&(0,Ie.Y)("div",{className:(0,v.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,mn.U2)(l,e.starsAmount):c("Chat.PaidMedia.Purchased")})]})});var wn=n(87894),In=n(26875),bn=n(85637),Sn=n(61361),Mn=n(41036),Nn=n(69287),kn=n(65036);const Yn={root:"CNKyLQ3u",hasResults:"R6rf6PXe",selector:"HlcWfAnb",clickable:"dCtKl7pU",hasMediaColumn:"dheZUNXH",selectorSlide:"WVCRx3uN",addAnswerIcon:"c8yhwhA9",addAnswerInput:"UGsTEyik",spinner:"qUIHEG5_",percentage:"kJtPuybj",fullPercent:"j_FzjMK9",answer:"asX1G2oq",addAnswer:"dnzqkbl6",addAnswerContent:"WcJYrQ2e",sideMeta:"C72bqnQM",votersCount:"IlQHe70p",avatarList:"HChYnetd",media:"hZmKnsoB",mediaPreview:"lfSDjL4h",stickerPreview:"lKBBg5jS",chosenMarker:"eX8rEhz6",chosenMarkerIcon:"N7BDYMIg",square:"U9bxPzku",incorrect:"Lg6Chpre",progressFill:"y6C1JW3l",progress:"N9EeTkDM",progressTrack:"G4m5EPge",animated:"oEwXHvpP"},Fn=(0,o.ph)(({answer:e,result:t,isSelected:n,isQuiz:i,totalVotersCount:s,isMultipleChoice:a,hasResults:r,hasMaskedResults:d,isSendingVote:c,recentVoters:l,shouldReserveMediaColumn:u,mediaPreviewId:h,mediaPreviewIndex:m,isInScheduled:p,observeIntersectionForLoading:g,observeIntersectionForPlaying:f,onSelect:A,onOpenMedia:y,onOpenLocation:C})=>{const w=(0,z.A)(),I=(0,o.li)(),b=e.media,S=Boolean(u),M=t?.votersCount??0,N=s?Math.round(M/s*100):0,k=(0,o.li)(!1),Y=(0,o.li)({percentage:N,votersCount:M,totalVotersCount:s}),[F,P]=(0,o.J0)(N),[T,D]=(0,o.J0)(0),x=r&&!c&&F!==N,L=void 0!==s?Math.max(5,N):0,B=c?0:r&&!d?1:d?2:3,R=(0,o.Kr)(()=>(0,Mt.fd)({text:e.text.text,entities:e.text.entities}),[e.text.entities,e.text.text]);(0,o.vJ)(()=>{const e=Y.current;if(Y.current={percentage:N,votersCount:M,totalVotersCount:s},!k.current)return k.current=!0,void D(e=>e+1);r?M===e.votersCount&&s===e.totalVotersCount||(P(c?0:N!==e.percentage?e.percentage:0),D(e=>e+1)):P(N)},[r,c,N,s,M]),(0,_t.A)(()=>{P(e=>e===N?e:e{A(e.option)}),O=(0,V.A)(e=>{void 0!==m&&(e.stopPropagation(),y(m))}),U=(0,V.A)(e=>{b?.location&&(e.stopPropagation(),C(b.location))}),K=b?.photo||b?.video?(0,Ie.Y)(ye.A,{media:b,id:h,className:Yn.mediaPreview,size:48,observeIntersectionForLoading:g,observeIntersectionForPlaying:f,onClick:O}):b?.location?(0,Ie.Y)(bn.A,{className:Yn.mediaPreview,geo:b.location.geo,width:48,height:48,shouldShowPin:!1,onClick:U}):b?.sticker?(0,Ie.Y)("div",{className:Yn.stickerPreview,ref:I,onClick:e=>e.stopPropagation(),children:(0,Ie.Y)(ht.A,{containerRef:I,sticker:b.sticker,size:48,shouldLoop:!0,observeIntersectionForLoading:g,observeIntersectionForPlaying:f})}):void 0;return(0,Ie.FD)("div",{className:(0,v.A)(Yn.root,r&&!d&&Yn.hasResults,S&&Yn.hasMediaColumn,r&&!d&&i&&!t?.isCorrect&&Yn.incorrect,!r&&!p&&Yn.clickable),onClick:p?void 0:E,children:[(0,Ie.Y)(Mn.Ay,{name:"fade",activeKey:B,className:Yn.selector,slideClassName:Yn.selectorSlide,shouldCleanup:!0,direction:1,children:c?(0,Ie.Y)(tt.A,{className:Yn.spinner,color:"gray"}):r&&!d?(0,Ie.Y)(et.A,{className:(0,v.A)(Yn.percentage,100===N&&Yn.fullPercent),text:(0,Ze.l9)(F,0)}):a?(0,Ie.Y)(Nn.A,{className:Yn.input,checked:d?t?.isChosen:n,disabled:d||p}):(0,Ie.Y)(kn.A,{className:Yn.input,value:e.option,checked:d?t?.isChosen:n,disabled:d||p})}),(0,Ie.Y)("div",{className:Yn.answer,dir:"auto",children:R}),function(){if(r&&!d&&0!==M)return(0,Ie.FD)("div",{className:Yn.sideMeta,children:[(0,Ie.Y)("span",{className:Yn.votersCount,children:w.number(M)}),Boolean(l?.length)&&(0,Ie.Y)(In.A,{size:"micro",peers:l,className:Yn.avatarList,limit:2})]})}(),K&&(0,Ie.Y)("div",{className:Yn.media,children:K}),(0,Ie.Y)("div",{className:Yn.chosenMarker,children:function(){if(r&&t){if(d){if(!t.isChosen)return}else if(!(t.isChosen||i&&t.isCorrect))return;return(0,Ie.Y)("div",{className:(0,v.A)(Yn.chosenMarkerIcon,a&&Yn.square),children:(0,Ie.Y)(Ce.A,{name:d||!i||t.isCorrect?"check":"close"})})}}()}),(0,Ie.Y)("div",{className:Yn.progress,children:(0,Ie.Y)("div",{className:Yn.progressTrack,style:"--_progress: "+(r&&!d?L/100:0),children:(0,Ie.Y)("div",{className:(0,v.A)(Yn.progressFill,T>0&&Yn.animated)})})})]})}),Pn="t2KXUXUa",Tn="MCdcoBVq";function Dn(e){if(!e?.length)return;const t=(0,i.mS)();return e.map(e=>(0,u.PVB)(t,e)).filter(Boolean)}function xn(e,t){return`poll-media${(0,d.GZ)(e,t)}`}function Ln({content:e,theme:t,className:n,previewIndex:o,previewId:i,observeIntersectionForLoading:s,observeIntersectionForPlaying:a,onOpenLocation:r,onOpenPreview:d,locationWidth:c=350,locationHeight:l=200,isNestedMedia:u}){return e.photo?(0,Ie.Y)(Ke.A,{id:i,photo:e.photo,theme:t,className:n,isNestedMedia:u,canAutoLoad:!0,observeIntersection:s,clickArg:o,onClick:void 0!==o?Rn(d):void 0}):e.video?(0,Ie.Y)(ze.A,{id:i,video:e.video,className:n,isNestedMedia:u,canAutoLoad:!0,observeIntersectionForLoading:s,observeIntersectionForPlaying:a,clickArg:o,onClick:void 0!==o?Rn(d):void 0}):e.document?(0,Ie.Y)(ge.A,{id:i,document:e.document,className:n,observeIntersection:s,onMediaClick:void 0!==o?()=>d(o):void 0}):e.location?(0,Ie.Y)(bn.A,{className:(0,v.A)(n,"media-inner"),geo:e.location.geo,width:c,height:l,zoom:15,shouldShowPin:!1,onClick:()=>r(e.location)}):e.sticker?(0,Ie.Y)(Bn,{sticker:e.sticker,observeIntersectionForLoading:s,observeIntersectionForPlaying:a}):void 0}function Bn({sticker:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n}){const i=(0,o.li)();return(0,Ie.Y)("div",{className:"enxHhGTl",ref:i,children:(0,Ie.Y)(ht.A,{containerRef:i,sticker:e,size:96,shouldLoop:!0,observeIntersectionForLoading:t,observeIntersectionForPlaying:n})})}function Rn(e){return(t,n)=>{n.stopPropagation(),e(t)}}const En=(0,o.ph)((0,i.EK)(e=>({pollMaxAnswers:e.appConfig.pollMaxAnswers}))(({chatId:e,messageId:t,poll:n,messageText:s,theme:r,isInScheduled:d,observeIntersectionForLoading:c,observeIntersectionForPlaying:l,pollMaxAnswers:u})=>{const{openMapModal:h,openMediaViewer:m,openPollResults:p,requestConfetti:g,sendPollVote:f,loadMessage:A}=(0,i.ko)(),{appendPollAnswer:y}=(0,i.pv)(),C=(0,z.A)(),w=(0,I.Fm)(),{summary:b,results:S,attachedMedia:M}=n,{answers:N,question:k,isMultipleChoice:Y}=b,[F,P]=(0,o.J0)([]),[T,D]=(0,o.J0)(!1),[x,L]=(0,o.J0)(!1),[B,R]=(0,o.J0)(!1),[E,O]=(0,o.J0)(""),[U,K]=(0,o.J0)(!1),[j]=(0,o.J0)(()=>function(e,t){const n=e.map(e=>e.option);return t?(0,wn.k4)(n):n}(N,b.shouldShuffleAnswers)),G=(0,o.Kr)(()=>Object.values(S.resultByOption||{}).some(e=>e.isChosen),[S.resultByOption]),J=!b.isClosed&&b.closeDate&&b.closeDate>w?b.closeDate:void 0,q=Boolean(b.shouldHideResultsUntilClose&&J&&!b.isCreator),$=q&&G,H=!b.isClosed&&!G,W=b.isQuiz&&Boolean(S.solution?.trim()||S.solutionMedia),_=(0,o.Kr)(()=>N.some(e=>function(e){return Boolean(e.media?.photo||e.media?.video||e.media?.location||e.media?.sticker)}(e)),[N]),Q=(0,o.Kr)(()=>new Set(F),[F]),Z=Boolean(S.resultByOption),X=S.totalVoters||0,ee=b.isCreator&&H&&Z&&X>0,te=Z&&(!H&&!q||U),ne=G&&b.isPublic&&Z&&!q,oe=W&&G,ie=Boolean(b.canAddAnswers&&!b.isClosed&&!d&&N.length{H||(P([]),L(!1))},[H]),(0,tn.A)(()=>{L(!1)},x?5e3:void 0),(0,o.vJ)(()=>{if(!b.isQuiz||!x||q)return;const e=S.resultByOption;if(!e)return;const t=Object.values(e),n=t.filter(e=>e.isChosen),o=t.filter(e=>e.isCorrect);n.length&&n.length===o.length&&n.every(e=>e.isCorrect)&&g({})},[q,x,S.resultByOption,b.isQuiz]),(0,o.vJ)(()=>{ee||K(!1)},[ee]),(0,o.vJ)(()=>{oe||D(!1)},[oe]),(0,o.vJ)(()=>{ie||(O(""),R(!1))},[ie]);const ae=(0,o.Kr)(()=>(0,wn.dU)(N,"option"),[N]),re=(0,o.Kr)(()=>{const e=new Set(j);return[...j.map(e=>ae[e]).filter(Boolean),...N.filter(t=>!e.has(t.option))]},[j,N,ae]),de=(0,o.Kr)(()=>{const e=[];return M?.photo?e.push({key:"attached",media:M.photo}):M?.video?e.push({key:"attached",media:M.video}):M?.document&&e.push({key:"attached",media:M.document}),S.solutionMedia?.photo?e.push({key:"explanation",media:S.solutionMedia.photo}):S.solutionMedia?.video?e.push({key:"explanation",media:S.solutionMedia.video}):S.solutionMedia?.document&&e.push({key:"explanation",media:S.solutionMedia.document}),re.forEach(t=>{t.media?.photo?e.push({key:t.option,media:t.media.photo}):t.media?.video&&e.push({key:t.option,media:t.media.video})}),e},[M,re,S.solutionMedia]),ce=(0,o.Kr)(()=>de.reduce((e,t,n)=>(e[t.key]=n,e),{}),[de]),le=(0,o.Kr)(()=>de.map(e=>e.media),[de]),ue=(0,o.Kr)(()=>q?void 0:Dn(S.recentVoterIds),[q,S.recentVoterIds]),he=(0,V.A)(n=>{L(!0),f({chatId:e,messageId:t,options:n})}),me=(0,V.A)(e=>{!H||x||U||(Y?P(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):he([e]))}),pe=(0,V.A)(()=>{H&&F.length&&!x&&he(F)}),ge=(0,V.A)(e=>{O(e.currentTarget.value)}),fe=(0,V.A)(async()=>{if(ie&&se&&!B){R(!0);try{await y({chatId:e,messageId:t,text:se}),O("")}finally{R(!1)}}}),ve=(0,V.A)(e=>{"Enter"===e.key&&(e.preventDefault(),fe())}),Ae=(0,V.A)(n=>{le.length&&m({chatId:e,messageId:t,mediaIndex:n,standaloneMedia:le,origin:a.TQ.PollPreview})}),ye=(0,V.A)(e=>{h({geoPoint:e.geo,zoom:15})}),be=(0,V.A)(()=>{ne&&p({chatId:e,messageId:t})}),Se=(0,V.A)(()=>{ee&&K(e=>!e)}),Me=(0,V.A)(()=>{D(e=>!e)}),Ne=(0,V.A)(()=>{A({chatId:e,messageId:t})}),ke=M&&ce.attached,Ye=S.solutionMedia&&ce.explanation,Fe=M&&Ln({content:M,theme:r,previewIndex:ke,previewId:void 0!==ke?xn(t,ke):void 0,observeIntersectionForLoading:c,observeIntersectionForPlaying:l,onOpenLocation:ye,onOpenPreview:Ae}),Pe=S.solutionMedia&&Ln({content:S.solutionMedia,theme:r,previewIndex:Ye,previewId:void 0!==Ye?xn(t,Ye):void 0,isNestedMedia:!0,observeIntersectionForLoading:c,observeIntersectionForPlaying:l,onOpenLocation:ye,onOpenPreview:Ae,locationWidth:350,locationHeight:200}),Te=(0,o.Kr)(()=>(0,Mt.fd)({text:k.text,entities:k.entities}),[k.entities,k.text]),De=(0,o.Kr)(()=>s&&(0,Mt.fd)({text:s.text,entities:s.entities}),[s]),xe=(0,o.Kr)(()=>S.solution?.trim()?(0,Mt.fd)({text:S.solution,entities:S.solutionEntities}):void 0,[S.solution,S.solutionEntities]),Le=J?C(q?"PollResultsTime":"PollEndsTime",{time:(0,Ie.Y)(Sn.A,{endsAt:J,mode:"countdown",shouldShowZeroOnEnd:!0,onEnd:Ne})},{withNodes:!0}):void 0,Be=(0,o.Kr)(()=>{const e=e=>(0,Ie.FD)("div",{className:"diekBVAn",children:[(0,Ie.Y)("span",{children:e}),Boolean(Le)&&(0,Ie.Y)("div",{className:"GUejqscd",dir:"auto",children:Le})]});if(se)return(0,Ie.Y)(Re.A,{className:Pn,disabled:B||!ie,noForcedUpperCase:!0,isText:!0,inline:!0,size:"smaller",color:"adaptive",onClick:fe,children:e(C("Save"))});if(H&&Y&&F.length)return(0,Ie.Y)(Re.A,{className:Pn,disabled:x,noForcedUpperCase:!0,isText:!0,inline:!0,size:"smaller",color:"adaptive",onClick:pe,children:e(C(b.isQuiz?"PollSubmitAnswers":"PollSubmitVotes"))});if(ee){const t=U?C(b.isQuiz?"PollBackToAnswer":"PollBackToVote",void 0,{withNodes:!0,specialReplacement:mn.Ve}):C(b.isQuiz?"PollAnswerCountButton":"PollVoteCountButton",{count:X},{withNodes:!0,pluralValue:X,specialReplacement:mn.hG});return(0,Ie.Y)(Re.A,{className:Pn,noForcedUpperCase:!0,isText:!0,inline:!0,size:"smaller",color:"adaptive",onClick:Se,children:(0,Ie.Y)(Mn.Ay,{activeKey:Number(U),name:C.isRtl?"slideRtl":"slide",shouldCleanup:!0,slideClassName:"BLp6KZId",children:e(t)})})}return H&&Y?(0,Ie.Y)(Re.A,{className:Pn,disabled:x||!F.length,noForcedUpperCase:!0,isText:!0,inline:!0,size:"smaller",color:"adaptive",onClick:pe,children:e(C(b.isQuiz?"PollSubmitAnswers":"PollSubmitVotes"))}):ne?(0,Ie.Y)(Re.A,{className:Pn,noForcedUpperCase:!0,isText:!0,inline:!0,size:"smaller",color:"adaptive",onClick:be,children:e(C("PollViewResults"))}):X?(0,Ie.Y)("div",{className:Tn,children:e(C(b.isQuiz?"PollAnsweredCount":"VoteCount",{count:X},{pluralValue:X}))}):(0,Ie.Y)("div",{className:Tn,children:e(C(b.isQuiz?"ChatQuizTotalVotesEmpty":"ChatPollTotalVotesResultEmpty"))})},[ne,ee,H,ie,fe,B,Y,x,U,C,F.length,b.isQuiz,se,Le,X]);return(0,Ie.FD)(Ie.FK,{children:[Fe,(0,Ie.FD)("div",{className:"NKFOoVuL",dir:C.isRtl?"rtl":void 0,children:[T&&oe&&(0,Ie.FD)(we.A,{className:"bKDmdvV4",shouldReset:!0,children:[(0,Ie.FD)("div",{className:"LzNZHuMg",children:[(0,Ie.Y)("span",{className:"P3LRO59M",children:C("PollsSolutionTitle")}),xe&&(0,Ie.Y)("div",{className:"mD3QPuIp",dir:"auto",children:xe})]}),(0,Ie.Y)(Re.A,{round:!0,size:"tiny",color:"adaptive",isText:!0,iconName:"close",ariaLabel:C("Close"),onClick:Me,className:"pKanbROx"}),Pe&&(0,Ie.Y)("div",{className:"tAli2up3",children:Pe})]}),De&&(0,Ie.Y)("div",{dir:"auto",children:De}),(0,Ie.FD)("div",{className:"jY9nFuul",children:[(0,Ie.Y)("div",{className:"KaaEAUOh",dir:"auto",children:Te}),oe&&!T&&(0,Ie.Y)("div",{className:"fajI3U5s",children:(0,Ie.Y)(Re.A,{round:!0,size:"smaller",color:"adaptive",isText:!0,iconName:"lamp",ariaLabel:C("MediaPollSolutionAria"),onClick:Me})}),(0,Ie.Y)("div",{className:"auPovDLf",children:(0,Ie.FD)("div",{className:"d_YubLrt",children:[(0,Ie.Y)("span",{className:"HkQ5NP1t",children:b.isClosed?C("FinalResults"):b.isQuiz?C(b.isPublic?"QuizPoll":"AnonymousQuizPoll"):C(b.isPublic?"PublicPoll":"AnonymousPoll")}),Boolean(ue?.length)&&(0,Ie.Y)(In.A,{size:"micro",peers:ue,className:"U3URwtX6"})]})})]}),(0,Ie.FD)("div",{className:"xDqcB9z1",children:[re.map(e=>{const n=S.resultByOption?.[e.option],o=ce[e.option];return(0,Ie.Y)(Fn,{answer:e,result:n,isQuiz:b.isQuiz,totalVotersCount:S.totalVoters,hasResults:te||$,hasMaskedResults:$,isSendingVote:x,isInScheduled:d,isSelected:Q.has(e.option),isMultipleChoice:Y,recentVoters:$?void 0:Dn(n?.recentVoterIds),shouldReserveMediaColumn:_,mediaPreviewId:void 0!==o?xn(t,o):void 0,mediaPreviewIndex:o,observeIntersectionForLoading:c,observeIntersectionForPlaying:l,onSelect:me,onOpenMedia:Ae,onOpenLocation:ye},e.option)}),ie&&(0,Ie.FD)("div",{className:(0,v.A)(Yn.root,Yn.addAnswer,_&&Yn.hasMediaColumn),children:[(0,Ie.Y)("div",{className:Yn.selector,children:(0,Ie.Y)(Ce.A,{name:"add",className:Yn.addAnswerIcon})}),(0,Ie.Y)("div",{className:(0,v.A)(Yn.answer,Yn.addAnswerContent),children:(0,Ie.Y)("input",{className:Yn.addAnswerInput,value:E,placeholder:C("CreatePollAddOption"),maxLength:100,dir:"auto",disabled:B,onChange:ge,onKeyDown:ve})})]})]}),Be&&(0,Ie.Y)("div",{className:"GdgRw6Gx",children:Be})]})]})}));var On=n(43581),Un=n(84555),Kn=n(10221),zn=n(14413),Vn=n(3325);const jn="GydRBA08",Gn=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({message:e,shouldLoop:t,shouldPlayEffect:n,withEffect:a,isMediaNsfw:r,onStopEffect:c,observeIntersection:l,observeIntersectionForPlaying:u,needsAgeVerification:h})=>{const{showNotification:m,openStickerSet:p,updateContentSettings:g,openAgeVerificationModal:A}=(0,i.ko)(),y=(0,j.A)(),{isMobile:C}=(0,L.Ay)(),w=(0,o.li)(),I=(0,o.li)(),b=e.content.sticker,{stickerSetInfo:S,isVideo:N,hasEffect:k}=b,Y=!e.isOutgoing,[F,P,T]=(0,U.A)(),[D,x]=(0,o.J0)(!1),B=r,[R,E,O]=(0,U.A)(B);(0,o.vJ)(()=>{B?E():O()},[B]);const z=(0,V.A)(()=>{T(),O(),D&&g({isSensitiveEnabled:!0})}),G=b.isPreloadedGlobally?void 0:(0,d.Mw)(b,N&&!f.OF?"pictogram":"inline"),J=(0,K.Vz)(w,l),q=(0,K.Vz)(w,u),$=`sticker${b.id}?size=f`,H=(0,qe.A)($,!J||!k||!a,s.qZ.BlobUrl),[W,_,Q]=(0,U.A)(),Z=(0,d.VD)(b),X=(0,V.A)(()=>{Q(),c?.()});(0,o.vJ)(()=>{k&&a&&q&&n&&_()},[k,q,n,_,a]);const ee=k&&a&&H&&W;(0,Kn.A)({anchorRef:w,overlayRef:I,isMirrored:Y,isDisabled:!ee});const te=(0,V.A)(()=>{p({stickerSetInfo:b.stickerSetInfo})}),ne=(0,V.A)(()=>{if(R)return r?h?void A():void P():void O();if(k){if(W||!a)return void m({message:y("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:b.stickerSetInfo}},actionText:y("ViewAction")});if(a)return void _()}te()}),oe="isMissing"in S,{width:ie,height:se}=(0,M.bu)(b,C),ae=(0,v.A)("media-inner","FPceNkgD",oe&&"hruUWBuj",k&&Y&&jn);return(0,Ie.FD)("div",{ref:w,className:ae,style:`width: ${ie}px; height: ${se}px;`,onClick:oe?void 0:ne,children:[(0,Ie.Y)(ht.A,{containerRef:w,sticker:b,fullMediaHash:G,fullMediaClassName:"full-media",size:ie,shouldLoop:t,noLoad:!J,noPlay:!q,withSharedAnimation:!0}),(0,Ie.Y)(Qt.A,{isVisible:R,withAnimation:!0,thumbDataUri:Z,width:ie,height:se,className:"media-spoiler",isNsfw:r}),ee&&(0,Ie.Y)(Vn.A,{children:(0,Ie.Y)(wt.A,{ref:I,className:(0,v.A)("WMMaWlOL",Y&&jn),tgsUrl:H,size:1.49*ie,play:!0,isLowPriority:!0,noLoop:!0,onEnded:X},$)}),(0,Ie.Y)(zn.A,{isOpen:F,onClose:T,shouldAlwaysShow:D,onAlwaysShowChanged:x,confirmHandler:z})]})}));var Jn=n(45470),qn=n(14),$n=n(50680),Hn=n(59816);const Wn=(0,o.ph)(function({story:e,isPreview:t,isProtected:n,isConnected:s}){const{openStoryViewer:a,loadPeerStoriesByIds:r,showNotification:c}=(0,i.ko)(),l=(0,j.A)(),{isMobile:u}=(0,L.Ay)(),h=e&&"isDeleted"in e,m=e&&"content"in e,p=m?e.content.video:void 0,g=m?(0,d.EN)(e):void 0,A=(0,qe.A)(g),y=m?p?p.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,C=(0,qn.A)(A,!0),{shouldRender:w,transitionClassNames:I}=(0,$n.A)(Boolean(C)),b=(0,Jn.A)(y,h&&!t,u&&!f.QH),S=(0,v.A)("EVLTkrt1","media-inner",(!s||h)&&"AQWPv0bP",h&&"tprkr7qf",t&&"V3HabdKr");(0,o.vJ)(()=>{!e||m||h||r({peerId:e.peerId,storyIds:[e.id]})},[e,h,m]);const M=(0,V.A)(()=>{h?c({message:l("StoryNotFound")}):a({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})});return(0,Ie.FD)("div",{className:S,onClick:s?M:void 0,children:[!h&&t&&(0,Ie.Y)("canvas",{ref:b,className:"thumbnail blurred-bg"}),w&&(0,Ie.FD)(Ie.FK,{children:[(0,Ie.Y)("img",{src:C,alt:"",className:(0,v.A)("WAItYc5d",t&&"ClGe8yij",I),draggable:!1}),m&&(0,Ie.Y)(Hn.A,{story:e,className:I})]}),h&&(0,Ie.FD)("span",{children:[(0,Ie.Y)(Ce.A,{name:"story-expired",className:"nLA7VEhv"}),l("StoryExpiredSubtitle")]}),Boolean(p?.duration)&&(0,Ie.Y)("div",{className:"message-media-duration",children:(0,Dt.QO)(p.duration)}),n&&(0,Ie.Y)("span",{className:"protector"})]})}),_n=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData;return{story:(0,u.Msb)(e,o,n),isConnected:"connectionStateReady"===e.connectionState}})(function({message:e,story:t,isProtected:n,isConnected:o}){const{storyData:i}=e.content;return(0,Ie.Y)(Wn,{story:t||i,isProtected:n,isConnected:o})})),Qn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData,i=(0,u._bp)(e,o)?.lastReadId;return{story:(0,u.Msb)(e,o,n),peer:(0,u.PVB)(e,o),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(i&&i{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}),h=t&&"isDeleted"in t,m=t&&"content"in t,p=m?t.content.video:void 0,g=m?(0,d.EN)(t,"pictogram"):void 0,f=(0,qe.A)(g)||p?.thumbnail?.dataUri;return(0,O.A)(l.peerId,l.id,t),(0,Ie.FD)("div",{className:(0,v.A)("action-message-story-mention",o&&"is-unread",m&&"with-preview"),tabIndex:0,role:"button",onClick:m?u:void 0,children:[m&&(0,Ie.Y)("span",{className:"story-media-wrapper",children:f&&(0,Ie.Y)("img",{src:f,alt:"",className:"story-media"})}),(0,Ie.Y)("span",{className:"story-title",children:(0,N.A)(n&&"isSelf"in n&&n.isSelf?r(h?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,d.u0)(s)):h?r("ExpiredStoryMention"):r("StoryMentionedTitle",(0,c.F9)(r,n)),["emoji","simple_markdown"])})]})}));var Zn=n(77561);const Xn=(0,o.ph)((0,i.EK)((e,{message:t})=>({sender:(0,u.Y7C)(e,t),isCurrentUserPremium:(0,u.g29)(e),isSynced:e.isSynced}))(({message:e,todoList:t,sender:n,isCurrentUserPremium:s,isSynced:a})=>{const{toggleTodoCompleted:r,showNotification:d,requestConfetti:l}=(0,i.ko)(),{todo:h,completions:m}=t,{title:p,items:g,othersCanComplete:f}=h,[A,y]=(0,o.J0)([]),C=(0,o.Kr)(()=>new Set(A),[A]),w=!e.isScheduled&&s&&a;(0,o.Nf)(()=>{const e=m?.map(e=>e.itemId.toString())||[];y(e)},[m]);const I=(0,z.A)(),b=(0,V.A)(e=>{e.preventDefault(),e.stopPropagation(),s||d({message:I("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:I("PremiumMore")})}),S=(0,V.A)(t=>{const n=t.find(e=>!C.has(e)),o=Array.from(C).find(e=>!t.includes(e));r({chatId:e.chatId,messageId:e.id,completedIds:n?[Number(n)]:[],incompletedIds:o?[Number(o)]:[]}),t.length===g.length&&l({})}),M=Boolean(e.forwardInfo)||!f&&!e.isOutgoing,N=e.isOutgoing,k=(0,o.Kr)(()=>g.map(e=>{const t=m?.find(t=>t.itemId===e.id)?.completedBy,n=f&&t?(0,u.PVB)((0,i.mS)(),t):void 0,o=n?(0,c.em)(I,n):void 0;return{label:(0,Mt.fd)(e.title),value:e.id.toString(),peer:n,subLabel:o}}),[g,f,m,I]);return(0,Ie.FD)("div",{className:"todo-list",dir:I.isRtl?"auto":"ltr",children:[(0,Ie.FD)("div",{className:"todo-list-header",children:[(0,Ie.Y)("div",{className:"todo-list-title",children:(0,Mt.fd)(p)}),(0,Ie.Y)("div",{className:"list-type",children:e.forwardInfo?I("TitleToDoList"):f?I("TitleGroupToDoList"):N?I("TitleYourToDoList"):n?I("TitleUserToDoList",{peer:(0,c.F9)(I,n)},{withNodes:!0}):I("TitleToDoList")})]}),(0,Ie.Y)("div",{className:"todo-list-items",children:M?(0,Ie.Y)("div",{className:"todo-list-items",children:k.map(e=>(0,Ie.FD)("div",{className:"todo-list-readonly-item",children:[(0,Ie.Y)("div",{className:"todo-readonly-item-checkbox",children:C.has(e.value)?(0,Ie.Y)(Ce.A,{name:"check"}):(0,Ie.Y)("div",{className:"todo-item-bullet-point"})}),(0,Ie.Y)("div",{className:(0,v.A)("readonly-item-label",C.has(e.value)&&"completed-label"),children:e.label})]},e.value))}):(0,Ie.Y)(Zn.A,{options:k,selected:A,onChange:S,onClickLabel:s?void 0:b,disabled:!w,isRound:!0})}),(0,Ie.Y)("div",{className:"completed-tasks-count",children:(0,Ie.Y)(et.A,{text:I("DescriptionCompletedToDoTasks",{number:A.length,count:k.length})})})]})}));var eo=n(58849),to=n(87094),no=n(39877),oo=n(84685),io=n(95773),so=n(40558);const ao=(0,o.ph)(({auction:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,z.A)(),a=(0,o.li)(),[r,d,c]=(0,U.A)(),{gift:l,endDate:u}=e,{background:h,title:m,availabilityTotal:p,isSoldOut:g}=l,A=h?.textColor||"#ffffff",[y,C]=(0,o.J0)(()=>u<(0,I.Fm)()),w=(0,V.A)(()=>{C(!0)}),b=(0,o.Kr)(()=>[h?.centerColor||"#254e7a",h?.edgeColor||"#0f2a49"],[h]),S=(0,o.Kr)(()=>y||g?s("GiftAuctionSoldOut"):s("GiftAuctionGifts",{count:p||0},{pluralValue:p||0}),[p,y,g,s]);return(0,Ie.FD)("div",{className:(0,v.A)("interactive-gift","rK3ug8nc"),style:`color: ${A}`,onClick:i,onMouseEnter:f.TF?void 0:d,onMouseLeave:f.TF?void 0:c,children:[(0,Ie.Y)(so.A,{className:"PsJFZPEc",backgroundColors:b,withAdaptiveHeight:!0}),(0,Ie.Y)("div",{className:"rV1S0P1o",style:`background-color: ${b[0]}`,children:y?s("GiftAuctionFinished"):(0,Ie.Y)(Sn.A,{endsAt:u,onEnd:w})}),(0,Ie.Y)(io.A,{ref:a,className:"g5kNvwaj",withSparkles:!0,sparklesColor:A,children:(0,Ie.Y)(ht.A,{containerRef:a,sticker:l.sticker,size:120,shouldLoop:r,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})}),(0,Ie.Y)("div",{className:"WHFbvlSl",children:m}),(0,Ie.Y)("div",{className:"GWFm_Jl4",children:S})]})});var ro=n(66833);const co=(0,o.ph)(({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,o.li)(),{backdrop:a,model:r,pattern:d}=(0,ro.uc)(e),[c,l,u]=(0,U.A)(),h=[a.centerColor,a.edgeColor];return(0,Ie.FD)("div",{className:(0,v.A)("interactive-gift","LaOdPURl"),onClick:i,onMouseEnter:f.TF?void 0:l,onMouseLeave:f.TF?void 0:u,children:[(0,Ie.Y)(so.A,{className:"EdXfeKWY",backgroundColors:h,patternIcon:d.sticker,centerEmptiness:.15,ringsCount:2,ovalFactor:1.2,withAdaptiveHeight:!0}),(0,Ie.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,Ie.Y)(ht.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:c,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})}),lo=(0,o.ph)(({messageWebPage:e,webPage:t,message:n,noAvatars:s,canAutoLoad:r,canAutoPlay:c,asForwarded:l,isDownloading:u=!1,isProtected:h,isConnected:m,story:p,theme:g,backgroundEmojiId:f,shouldWarnAboutFiles:A,autoLoadFileMaxSizeMb:y,lastPlaybackTimestamp:C,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onMediaClick:S,onDocumentClick:M,onContainerClick:k,onAudioPlay:Y,onCancelMediaTransfer:F})=>{const{openUrl:P,openTelegramLink:T}=(0,i.ko)(),D=(0,o.li)(),x=(0,z.A)(),L=(0,V.A)(()=>{S()}),B=(0,V.A)(e=>{k?.(e)}),R="full"===t?.webpageType?t:void 0,{story:E,stickers:U}=R||{};(0,O.A)(E?.peerId,E?.id,p);const K=U?.isWithTextColor||U?.documents?.[0]?.shouldUseTextColor,j=(0,to.A)(D,void 0,!K),G=(0,o.Kr)(()=>{const e=t?.url&&(0,X.vG)(t?.url);if(e&&"timestamp"in e)return e.timestamp},[t?.url]),J=(0,V.A)(n=>{n.stopPropagation(),P({url:t.url,shouldSkipModal:e.isSafe})}),q=(0,V.A)(()=>{T({url:t.url})});if("full"!==t?.webpageType)return;const{siteName:$,url:H,displayUrl:W,title:_,description:Q,photo:Z,video:ee,audio:te,type:ne,document:oe}=t,{mediaSize:ie}=e,se="telegram_story"===ne,ae="telegram_nft"===ne,re="telegram_auction"===ne,de=p&&"isDeleted"in p,ce=U?.isEmoji?"telegram_emojiset":ne,le=re&&t.auction?t.auction.endDate:void 0,ue=de?void 0:function(e,t){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"ViewButtonRequestJoin";case"telegram_message":return"ViewButtonMessage";case"telegram_bot":return"ViewButtonBot";case"telegram_voicechat":return"ViewButtonVoiceChat";case"telegram_livestream":return"ViewButtonVoiceChatChannel";case"telegram_megagroup":case"telegram_chat":return"ViewButtonGroup";case"telegram_channel":return"ViewButtonChannel";case"telegram_user":return"ViewButtonUser";case"telegram_botapp":return"ViewButtonBotApp";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"ViewButtonStory";case"telegram_channel_boost":case"telegram_group_boost":return"ViewButtonBoost";case"telegram_stickerset":return"ViewButtonStickerset";case"telegram_emojiset":return"ViewButtonEmojiset";case"telegram_nft":return"ViewButtonGiftUnique";case"telegram_auction":return void 0!==t&&t<(0,I.Fm)()?"PollViewResults":"GiftAuctionJoin";default:return}}(ce,le),me=ue&&x(ue),pe=function(e){if("telegram_auction"===e)return"auction-filled"}(ce),fe=(0,eo.A)(Q,170),ve=Boolean(fe||_||$);let Ae=Boolean(U);ve&&t?.photo&&!t.video&&!t.document&&(Ae=function(e,t){if(!e?.photo)return!1;if("small"===t)return!0;if("large"===t)return!1;const{width:n,height:o}=(0,d.Xn)(e.photo)||{};return!(!n||!o||n!==o||e.hasLargeMedia)}(t,ie));const ye=(Z||ee)&&S&&!Ae,be=(0,v.A)("WebPage",Ae&&"with-square-photo",!Z&&!ee&&"without-media",ee&&"with-video",!ve&&"no-article",oe&&"with-document",me&&"with-quick-button",(ae||re)&&"with-gift");return(0,Ie.FD)(we.A,{className:be,"data-initial":($||W)[0],dir:x.isRtl?"rtl":"auto",onClick:B,children:[(0,Ie.FD)("div",{className:(0,v.A)("WebPage--content",se&&"is-story",(ae||re)&&"is-gift"),children:[f&&(0,Ie.Y)(no.A,{emojiDocumentId:f,className:"WebPage--background-icons"}),se&&(0,Ie.Y)(Wn,{story:p,isProtected:h,isConnected:m,isPreview:!0}),ae&&(0,Ie.Y)(co,{gift:t.gift,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onClick:q}),re&&t.auction&&(0,Ie.Y)(ao,{auction:t.auction,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onClick:q}),ve&&(0,Ie.FD)("div",{className:(0,v.A)("WebPage-text","WebPage-text_interactive"),onClick:J,children:[(0,Ie.Y)(oo.A,{className:"site-name",url:H,text:$||W}),_&&(0,Ie.Y)("p",{className:"site-title",children:(0,N.A)(_)}),fe&&!ae&&!re&&(0,Ie.Y)("p",{className:"site-description",children:(0,N.A)(fe,["emoji","br"])})]}),Z&&!ae&&!re&&!ee&&(0,Ie.Y)(Ke.A,{photo:Z,isOwn:n?.isOutgoing,isNestedMedia:!0,observeIntersection:w,noAvatars:s,canAutoLoad:r,size:Ae?"pictogram":"inline",asForwarded:l,nonInteractive:!ye,isDownloading:u,isProtected:h,theme:g,onClick:ye?L:void 0,onCancelUpload:F}),ee&&(0,Ie.Y)(ze.A,{video:ee,isOwn:n?.isOutgoing,isNestedMedia:!0,observeIntersectionForLoading:w,noAvatars:s,canAutoLoad:r,canAutoPlay:c,asForwarded:l,isDownloading:u,isProtected:h,lastPlaybackTimestamp:C||G,onClick:ye?L:void 0,onCancelUpload:F}),te&&(0,Ie.Y)(he.Ay,{theme:g,message:n,origin:a.d9.Inline,noAvatars:s,isDownloading:u,onPlay:Y,onCancelUpload:F}),oe&&!Z&&(0,Ie.Y)(ge.A,{document:oe,message:n,observeIntersection:w,autoLoadFileMaxSizeMb:y,onMediaClick:M,onCancelUpload:F,isDownloading:u,shouldWarnAboutFiles:A}),U&&(0,Ie.Y)("div",{ref:D,className:(0,v.A)("media-inner","square-image",U.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:U.documents.map(e=>(0,Ie.Y)("div",{className:"WebPage--sticker",children:(0,Ie.Y)(ht.A,{containerRef:D,sticker:e,shouldLoop:!0,size:U.isEmoji?38:80,customColor:j,observeIntersectionForPlaying:b,observeIntersectionForLoading:w})},e.id))})]}),me&&(0,Ie.FD)(Re.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!re,onClick:q,children:[pe&&(0,Ie.Y)(Ce.A,{name:pe}),me]})]})}),uo=1.75*M.$,ho=2.25*M.$,mo=(0,o.ph)((0,i.EK)((e,t)=>{const{focusedMessage:n,forwardMessages:o,activeReactions:i,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:c,album:g,documentGroup:v,withSenderName:A,withAvatar:w,threadId:I,messageListType:b,isLastInDocumentGroup:S,isFirstInGroup:M}=t,{id:N,chatId:k,viaBotId:Y,isOutgoing:F,forwardInfo:P,transcriptionId:T,isPinned:D,viaBusinessBotId:x,effectId:L,paidMessageStars:B}=c,R=(0,u.k9R)(e,c),{shouldWarnAboutFiles:E}=(0,m.lS)(e),O=(0,y.L8)(k),U=(0,u.hds)(e,k),K=(0,u.nZ4)(e,k),z=(0,u.ALW)(e,k),V=(0,d.DX)(k),j=(0,d.Qe)(k),G=U&&(0,d.WX)(U),J=U&&(0,d.YE)(U),q=O?void 0:(0,u.AWZ)(e,k),{adminMembersById:$,members:H,boostsApplied:W}=q||{},_=R?.story,Q=_?(0,u.Msb)(e,_.peerId,_.id):void 0,Z=o.messageIds&&o.messageIds.includes(N),X=!K&&(0,d.zP)(c),ee=A||w||X,te=(0,u.Y7C)(e,c),ne=(0,u.Szq)(e,c),oe=Y?(0,u.mBe)(e,Y):void 0,ie=te?.id?$?.[te?.id]||H?.find(e=>e.userId===te?.id):void 0,{replyToMsgId:se,replyToPeerId:ae,replyFrom:re}=(0,l.Q)(c)||{},{peerId:de,storyId:ce}=(0,l.W)(c)||{},le=se&&se===I,ue=(0,u.gMr)(e,c),he=P||re,me=ue?(0,u.Y7C)(e,ue):!he||V||j?void 0:(0,u.HdA)(e,he),pe=ue&&(0,u.Szq)(e,ue),ge=ae?(0,u.hds)(e,ae):void 0,fe=!V&&!j&&ge&&!(0,d.gA)(ge)&&(ge.isNotJoined||(0,u._ls)(e,ge.id)),ve="topicCreate"===ue?.content.action?.type,Ae=ce&&de?(0,u.Msb)(e,de,ce):void 0,ye=de?(0,u.PVB)(e,de):void 0,Ce=(0,u.ldX)(e,c),we="thread"===b&&(g?g.messages.some(t=>(0,u.nJv)(e,t,I)):(0,u.nJv)(e,c,I)),{direction:Ie,noHighlight:be,isResizingContainer:Se,quote:Me,quoteOffset:Ne,scrollTargetPosition:ke}=we&&n||{},Ye=(0,u.TCk)(e),Fe=Ye?.results?.query&&`${Ye.isHashtag?"#":""}${Ye.results.query}`,Pe=(0,d.wb)(c),Te=Pe&&(0,u.oei)(e,Pe)?Pe:void 0,De=(0,d.Jw)(c);let xe;xe=g?.messages?g.messages.every(({id:t})=>(0,u.H1_)(e,t)):(0,u.H1_)(e,N);const Le="thread"===b&&(0,u.tOf)(e,c,I),Be=(0,u.yuw)(e),Re=(0,h.iS)(e,c),Ee=Re&&(0,d.$r)(Be,Re),Oe=Boolean(c.groupedId)&&!c.isInAlbum,Ue=(0,p.Vw)(e,k,g?.commentsMessage?.id||v?.commentsMessage?.id||N),Ke=Oe?S&&v?.firstMessageId?(0,u.O5q)(e,k,v.firstMessageId):void 0:c,ze=(0,p.a1)(e,k,I),Ve=ze?.unreadReactions?.includes(c.id),je=ze?.unreadPollVotes?.includes(c.id),Ge=I===s.l3&&U?.isForum&&!U.isBotForum&&M,Je=(0,u.nkm)(e,c),qe=(0,u.RnX)(e,k),$e=(0,u.Rny)(e,k,c.id),He=(0,u.qZq)(e,k),We=(0,u.g9e)(e,k),_e=f.CM&&e.settings.byKey.canTranslate&&!He,Qe="connectionStateReady"===e.connectionState,Ze=Boolean(Ke&&i[(0,C.bj)(Ke)]?.length),Xe=(0,u.g29)(e),et=te&&(0,u.nZ4)(e,te.id)?W??c.senderBoosts:c.senderBoosts,tt=U?.boostLevel||0,nt=e.appConfig.groupTranscribeLevelMin,ot=Xe||Boolean(nt&&tt>=nt),it=x?(0,u.mBe)(e,x):void 0,st=L?e.availableEffectById[L]:void 0,at=(0,u.zcZ)(e,c),rt=(0,h.me)(e,c),dt=(0,h.xd)(e,k,c.id),ct=(0,u.trm)(e),lt=e.appConfig.starsSuggestedPostFutureMin,ut=(0,h.B9)(e,c),ht=ue&&(0,h.B9)(e,ue),mt=(0,u.g5w)(e,k,c.id,$e),pt=(0,d.Q_)(U,q,z);return{theme:(0,u.SJA)(e),forceSenderName:X,sender:te,canShowSender:ee,originSender:ne,botSender:oe,shouldHideReply:le||ve,replyMessage:ue,replyMessageSender:me,replyMessageForwardSender:pe,replyMessageChat:ge,replyStory:Ae,isReplyPrivate:fe,storySender:ye,isInDocumentGroup:Oe,isProtected:(0,u.ynf)(e,c),isChatProtected:(0,u.ryq)(e,k),isFocused:we,isForwarding:Z,reactionMessage:Ke,isChatWithSelf:K,isBotForum:U?.isBotForum,isRepliesChat:V,isAnonymousForwards:j,isChannel:G,isGroup:J,canReply:Le,highlight:Fe,animatedEmoji:Te,animatedCustomEmoji:De,isInSelectMode:(0,u.rTV)(e),isSelected:xe,isGroupSelected:Boolean(c.groupedId)&&!c.isInAlbum&&(0,u.SLS)(e,k,c.groupedId),threadId:I,isDownloading:Ee,isPinnedList:"pinned"===b,isPinned:D,canAutoLoadMedia:(0,u.wwb)(e,c),canAutoPlayMedia:(0,u.OEt)(e,c),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:Ue,availableReactions:e.reactions.availableReactions,defaultReaction:(0,d.Nb)(c)||"scheduled"===b?void 0:(0,u.nTJ)(e,k),hasActiveReactions:Ze,activeEmojiInteractions:a,hasUnreadReaction:Ve,hasUnreadPollVote:je,isTranscribing:void 0!==T&&e.transcriptions[T]?.isPending,transcribedText:void 0!==T?e.transcriptions[T]?.text:void 0,isPremium:Xe,senderChatMember:ie,messageTopic:Je,hasTopicChip:Ge,chatTranslations:qe,areTranslationsEnabled:_e,shouldDetectChatLanguage:(0,u.LRV)(e,k),requestedTranslationLanguage:$e,requestedChatTranslationLanguage:He,requestedTranslationTone:We,hasLinkedChat:Boolean(q?.linkedChatId),withAnimatedEffects:(0,u.xYJ)(e,"stickerEffects"),canAnimateTextStreaming:(0,u.xYJ)(e,"textStreaming"),webPageStory:Q,isConnected:Qe,isLoadingComments:Ue?.isCommentsInfo&&r?.loadingChatId===Ue?.originChannelId&&r?.loadingMessageId===Ue?.originMessageId,shouldWarnAboutFiles:E,outgoingStatus:F?(0,u.Tl2)(e,k,I,c.id,b):void 0,uploadProgress:"number"==typeof Ce?Ce:void 0,focusDirection:we?Ie:void 0,noFocusHighlight:we?be:void 0,isResizingContainer:we?Se:void 0,focusedQuote:we?Me:void 0,focusedQuoteOffset:we?Ne:void 0,scrollTargetPosition:we?ke:void 0,senderBoosts:et,tags:e.savedReactionTags?.byKey,canTranscribeVoice:ot,viaBusinessBot:it,minFutureTime:lt,effect:st,poll:at,maxTimestamp:rt,lastPlaybackTimestamp:dt,paidMessageStars:B,isChatWithUser:O,isAccountFrozen:ct,isMediaNsfw:ut,isReplyMediaNsfw:ht,webPage:R,summary:mt,canSendStickers:pt.canSendStickers}})(({message:e,album:t,noAvatars:n,withAvatar:u,withSenderName:h,noComments:m,noReplies:p,appearanceOrder:y,isJustAdded:C,isFirstInGroup:F,isPremium:T,isLastInGroup:D,isFirstInDocumentGroup:W,isLastInDocumentGroup:te,isTranscribing:ne,transcribedText:oe,isLastInList:ie,theme:se,forceSenderName:ae,sender:re,canShowSender:de,originSender:le,botSender:ue,isThreadTop:Ae,shouldHideReply:ye,replyMessage:Pe,replyMessageSender:Te,replyMessageForwardSender:De,replyMessageChat:xe,replyStory:Ue,isReplyPrivate:Ve,storySender:je,outgoingStatus:Je,uploadProgress:qe,isInDocumentGroup:$e,isLoadingComments:He,isProtected:_e,isChatProtected:Ze,isFocused:Xe,focusDirection:et,focusedQuote:tt,focusedQuoteOffset:ot,noFocusHighlight:it,scrollTargetPosition:st,isResizingContainer:at,isForwarding:dt,isChatWithSelf:ct,isBotForum:ut,isRepliesChat:ht,isAnonymousForwards:mt,isChannel:pt,isGroup:gt,canReply:ft,highlight:vt,animatedEmoji:At,animatedCustomEmoji:yt,hasActiveReactions:Ct,hasLinkedChat:wt,isInSelectMode:It,isSelected:bt,isGroupSelected:Mt,threadId:Nt,reactionMessage:kt,availableReactions:Yt,defaultReaction:Pt,activeEmojiInteractions:Dt,messageListType:xt,isPinnedList:Lt,isPinned:Bt,isDownloading:Rt,canAutoLoadMedia:Et,canAutoPlayMedia:Ot,shouldLoopStickers:Ut,autoLoadFileMaxSizeMb:Kt,repliesThreadInfo:zt,hasUnreadReaction:Vt,hasUnreadPollVote:Jt,memoFirstUnreadIdRef:qt,senderChatMember:$t,messageTopic:Ht,hasTopicChip:_t,chatTranslations:Qt,areTranslationsEnabled:Zt,shouldDetectChatLanguage:en,requestedTranslationLanguage:tn,requestedChatTranslationLanguage:nn,requestedTranslationTone:on,withAnimatedEffects:sn,canAnimateTextStreaming:an,webPageStory:rn,isConnected:dn,getIsMessageListReady:cn,shouldWarnAboutFiles:mn,senderBoosts:pn,tags:gn,canTranscribeVoice:vn,viaBusinessBot:yn,effect:wn,poll:In,maxTimestamp:bn,lastPlaybackTimestamp:Sn,isMediaNsfw:Mn,isReplyMediaNsfw:Nn,paidMessageStars:kn,isChatWithUser:Yn,isAccountFrozen:Fn,minFutureTime:Pn,webPage:Tn,summary:Dn,canSendStickers:xn,observeIntersectionForBottom:Ln,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,observeIntersectionForTopExit:Kn,onMessageUnmount:zn,onTallTypingDraft:Vn})=>{const{toggleMessageSelection:jn,clickBotInlineButton:Jn,clickSuggestedMessageButton:qn,rejectSuggestedPost:$n,openSuggestedPostApprovalModal:Hn,disableContextMenuHint:Wn,animateUnreadReaction:Zn,focusMessage:eo,markTypingDraftDone:to,markMentionsRead:no,markPollVotesRead:oo,openThread:io,summarizeMessage:so}=(0,i.ko)(),ao=(0,o.li)(),ro=(0,o.li)(),co=(0,o.li)(),mo=(0,o.li)(),po=(0,j.A)(),go=(0,z.A)(),{id:fo,chatId:vo,forwardInfo:Ao,viaBotId:yo,isTranscriptionError:Co,factCheck:wo,isTypingDraft:Io,previousLocalId:bo,fromRank:So}=e,[Mo,No]=(0,o.J0)(!1),[ko,Yo]=(0,o.J0)(!1),[Fo,Po]=(0,o.J0)(!1),[To,Do,xo]=(0,U.A)(),[Lo,Bo,Ro]=(0,U.A)(),[Eo,Oo,Uo]=(0,U.A)(),[Ko,zo,Vo]=(0,U.A)(),[jo,Go]=(0,o.J0)(""),{isMobile:Jo,isTouchScreen:qo}=(0,L.Ay)();(0,K.mv)(co,Ln);const $o=(0,V.A)(({isIntersecting:e})=>{Vn?.(fo,!e)});(0,K.mv)(ro,Io&&ie?Kn:void 0,$o);const{isContextMenuOpen:Ho,contextMenuAnchor:Wo,contextMenuTarget:_o,handleBeforeContextMenu:Qo,handleContextMenu:Zo,handleContextMenuClose:Xo,handleContextMenuHide:ei}=(0,B.A)(ao,qo&&It||Fn,!g.Vq,f.Ni,cn);(0,o.vJ)(()=>{Ho&&Wn()},[Ho,Wn]);const ti=y<=0,[ni,oi]=(0,U.A)(ti);(0,o.vJ)(()=>{ti||setTimeout(oi,y*r.zq7)},[y,ti]),(0,q.A)({ref:ao,isOpen:ni||C,noMountTransition:ti&&!C,className:!1}),(0,o._W)(()=>{zn?.(fo)});const ii=Boolean(e.summaryLanguageCode),si=(0,d.Nb)(e),ai=(0,d.Ie)(e),ri="scheduled"===xt||e.isScheduled,di=(0,d.Tv)(e)&&!ye,{paidMedia:ci}=(0,d.r_)(e),{photo:li,video:ui}=Y(ci),{photo:hi=li,video:mi=ui,audio:pi,voice:gi,document:fi,sticker:vi,contact:Ai,invoice:yi,location:Ci,action:wi,game:Ii,storyData:bi,giveaway:Si,giveawayResults:Mi,todo:Ni,dice:ki}=(0,d.r_)(e),Yi=(0,l.Q)(e),Fi=(0,l.W)(e),Pi=Boolean(!Mo&&(Co||oe)),Ti=Boolean(Fi),Di=Boolean(zt)&&"thread"===xt,xi=!Pi&&(0,d.aN)(e),Li=xi&&(At||yt),Bi=kt?.reactions&&!(0,d.G)(kt.reactions),Ri=Ao&&(!ct||ri)&&!ht&&!Ao.isLinkedChannelPost&&!mt&&!ue||Boolean(bi&&!bi.isMention),Ei=Boolean(pn)&&!Ri&&F,Oi=bi?.isMention,Ui="video"===mi?.mediaType&&mi.isRound,Ki=Boolean(t)&&(t.isPaidMedia&&ci.extendedMedia.length>1||t.messages.length>1)&&!t.messages.some(e=>0===Object.keys(e.content).length),zi=$e&&!W,Vi=$e&&!te,ji=void 0!==Wo,Gi=!(ji||It||dt||Vi||Oi),Ji=pt&&!ri&&e.isForwardingAllowed&&!Ze,qi=Boolean(Lt||Ao&&(Ao.isChannelPost||ct||ht||mt)&&Ao.fromMessageId),$i=Boolean(wo?.text),Hi=Ri&&xi,Wi=_t||di||Ti||Hi||Boolean(Ko&&Dn?.text),_i=(0,V.A)((e,n)=>{Fn||jn({messageId:fo,groupedId:n,...e?.shiftKey&&{withShift:!0},...Ki&&{childMessageIds:t.messages.map(({id:e})=>e)}})}),Qi=de?re:void 0,Zi=Ao&&(ct||ht||mt||!Qi)?le:Qi,Xi=Ri?le:re,es=ai&&!xi,ts=Ao||bi?le:Qi,ns=(0,d.G5)(e),{handleMouseDown:os,handleClick:is,handleContextMenu:ss,handleDoubleClick:as,handleContentDoubleClick:rs,handleMouseMove:ds,handleSendQuickReaction:cs,handleMouseLeave:ls,isSwiped:us,isQuickReactionVisible:hs,handleDocumentGroupMouseEnter:ms}=ce(_i,ao,fo,Boolean(It),Boolean(ft),Boolean(_e),Zo,Qo,vo,ji,mo,Vi,cn),{handleSenderClick:ps,handleViaBotClick:gs,handleReplyClick:fs,handleMediaClick:vs,handleDocumentClick:As,handleAudioPlay:ys,handleAlbumMediaClick:Cs,handlePhotoMediaClick:ws,handleVideoMediaClick:Is,handleMetaClick:bs,handleTranslationClick:Ss,handleOpenThread:Ms,handleReadMedia:Ns,handleCancelUpload:ks,handleGroupForward:Ys,handleForward:Fs,handleFocus:Ps,handleFocusForwarded:Ts,handleDocumentGroupSelectAll:Ds,handleTopicChipClick:xs,handleStoryClick:Ls}=function({lang:e,selectMessage:t,message:n,webPage:o,chatId:r,threadId:c,isInDocumentGroup:u,asForwarded:h,isScheduled:m,album:p,senderPeer:g,botSender:f,messageTopic:v,isTranslatingChat:A,story:y,isReplyPrivate:C,isRepliesChat:w,isSavedMessages:I,lastPlaybackTimestamp:b}){const{openChat:S,openChatWithDraft:M,showNotification:N,focusMessage:k,openMediaViewer:Y,openAudioPlayer:F,markMessagesRead:P,cancelUploadMedia:T,openForwardMenu:D,openChatLanguageModal:x,openThread:L,openStoryViewer:B,searchChatMediaMessages:R}=(0,i.ko)(),{id:E,forwardInfo:O,groupedId:U,content:{paidMedia:K,video:z}}=n,{replyToMsgId:j,replyToPeerId:G,replyToTopId:J,isQuote:q,quoteText:$,quoteOffset:H}=(0,l.Q)(n)||{},W=(0,V.A)(()=>{g?h&&O?.channelPostId?k({chatId:g.id,messageId:O.channelPostId}):S({id:g.id}):N({message:e("HidAccount")})}),_=(0,V.A)(()=>{f&&M({chatId:r,threadId:c,text:{text:`@${(0,d.Kl)(f)} `}})}),Q=(0,V.A)(()=>{j&&!C?w&&G&&J?L({isComments:!0,originChannelId:G,originMessageId:J,focusMessageId:j}):k({chatId:G||r,threadId:w?J:c,messageId:j,replyMessageId:G?void 0:E,noForumTopicPanel:!G,...q&&{quote:$?.text,quoteOffset:H}}):N({message:e(q?"QuotePrivate":"ReplyPrivate")})}),Z=(0,V.A)(()=>{Y({chatId:r,threadId:c,messageId:E,origin:m?a.TQ.ScheduledInline:a.TQ.Inline})}),ee=(0,V.A)(e=>{if(K&&!K.isBought)return;e&&R({chatId:r,threadId:c,currentMediaMessageId:E});const t=o?.url&&(0,X.vG)(o.url),n=z||(0,d.rU)(o),i=t&&"timestamp"in t?t.timestamp:void 0;Y({chatId:r,threadId:c,messageId:E,origin:m?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:b||n?.timestamp||i,withDynamicLoading:e})}),te=(0,V.A)(()=>{ee(!m&&!K)}),ne=(0,V.A)(()=>{const e=n.content?.video?.isGif;ee(!e&&!m&&!K)}),oe=(0,V.A)(()=>{((0,d.yl)(n)||(0,d.eY)(o))&&te(),ne()}),ie=(0,V.A)(()=>{F({chatId:r,messageId:E})}),se=(0,V.A)((e,t)=>{K&&!K.isBought||(R({chatId:r,threadId:c,currentMediaMessageId:E}),Y({chatId:r,threadId:c,messageId:e,mediaIndex:t,origin:m?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!K}))}),ae=(0,V.A)(()=>{P({chatId:r,messageIds:[E]})}),re=(0,V.A)(()=>{T({chatId:r,messageId:E})}),de=(0,V.A)(()=>{D({fromChatId:r,groupedId:U})}),ce=(0,V.A)(()=>{if(p&&p.messages){const e=p.messages.map(({id:e})=>e);D({fromChatId:r,messageIds:e})}else D({fromChatId:r,messageIds:[E]})}),le=(0,V.A)(()=>{k({chatId:r,threadId:s.l3,messageId:E})}),ue=(0,V.A)(()=>{const e=I&&O.savedFromPeerId||O.fromChatId;u?k({chatId:e,groupedId:U,groupedChatId:r,messageId:O.fromMessageId}):G&&J?w?L({isComments:!0,originChannelId:G,originMessageId:J,focusMessageId:O.fromMessageId}):k({chatId:G,threadId:J,messageId:O.fromMessageId}):k({chatId:e,messageId:O.fromMessageId})}),he=(0,V.A)(e=>{e.stopPropagation(),t(e,U)}),me=(0,V.A)(e=>{e.stopPropagation(),x({chatId:r,messageId:A?void 0:E})}),pe=(0,V.A)(()=>{L({chatId:n.chatId,threadId:n.id})}),ge=(0,V.A)(()=>{v&&k({chatId:G||r,threadId:v.id,messageId:E})}),fe=(0,V.A)(()=>{y&&B({peerId:y.peerId,storyId:y.id,isSingleStory:!0})});return{handleSenderClick:W,handleViaBotClick:_,handleReplyClick:Q,handleDocumentClick:Z,handleMediaClick:oe,handleAudioPlay:ie,handleAlbumMediaClick:se,handlePhotoMediaClick:te,handleVideoMediaClick:ne,handleMetaClick:he,handleTranslationClick:me,handleOpenThread:pe,handleReadMedia:ae,handleCancelUpload:re,handleGroupForward:de,handleForward:ce,handleFocus:le,handleFocusForwarded:ue,handleDocumentGroupSelectAll:he,handleTopicChipClick:ge,handleStoryClick:fe}}({lang:po,selectMessage:_i,message:e,webPage:Tn,chatId:vo,threadId:Nt,isInDocumentGroup:$e,asForwarded:Ri,isScheduled:ri,album:t,avatarPeer:Zi,senderPeer:ts,botSender:ue,messageTopic:Ht,isTranslatingChat:Boolean(nn),story:Ue&&"content"in Ue?Ue:void 0,isReplyPrivate:Ve,isRepliesChat:ht,isSavedMessages:ct,lastPlaybackTimestamp:Sn});(0,o.vJ)(()=>{ii&&Ko&&!Dn&&so({chatId:vo,id:e.id,toLanguageCode:tn})},[ii,vo,e.id,tn,Ko,Dn]);const Bs=(0,V.A)(e=>{e.stopPropagation(),Do()}),Rs=(0,V.A)(()=>{eo({chatId:vo,threadId:Nt,messageId:fo,scrollTargetPosition:"start",noHighlight:!0})});(0,o.vJ)(()=>{ie&&Pi&&oe&&Rs()},[ie,oe,Pi]),(0,o.vJ)(()=>{const n=ao.current,o=e.isInAlbum&&t?.messages.some(e=>!e.isDeleting);e.isDeleting&&n&&!o&&((0,Be.U)(n)?Yo(!0):Po(!0))},[e.isDeleting]);const Es=t?.hasMultipleCaptions?void 0:t?.captionMessage||e,Os=Es&&(0,d.XR)(Es),Us=Os||$i,Ks=(0,v.A)("Message message-list-item",F&&"first-in-group",_e&&"hide-on-print",_e&&!Os?"is-protected":"allow-selection",D&&"last-in-group",W&&"first-in-document-group",te&&"last-in-document-group",ie&&"last-in-list",ai&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",di&&"has-reply",Ho&&"has-menu-open",Xe&&!it&&"focused",dt&&"is-forwarding",Fo&&"is-deleting",ko&&"is-dissolving",$e&&"is-in-document-group",Ki&&"is-album",e.hasUnreadMention&&"has-unread-mention",bt&&"is-selected",It&&"is-in-selection-mode",Ae&&!u&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",us&&"is-swiped",C&&"is-just-added",(Ct||To)&&"has-active-effect",Oi&&"is-story-mention"),zs=Es&&(0,d.r_)(Es).text,Vs=Boolean(e.isInvertedMedia),{replyToMsgId:js,replyToPeerId:Gs}=Yi||{},{peerId:Js,storyId:qs}=Fi||{};(0,o.vJ)(()=>{(vi?.hasEffect||wn)&&(qt?.current&&fo>=qt.current||si)&&Do()},[wn,si,qt,fo,vi?.hasEffect]),(0,o.vJ)(()=>{ki&&(qt?.current&&fo>=qt.current||si)&&Bo()},[ki,qt,fo,si]);const $s=(0,$.A)(zs?.text,!(Zt&&en)||Io,cn);!function(e,t,n,i){(0,o.vJ)(()=>{if(n||i&&!i())return;const o=Boolean(e.content.text?.text.length);!function({chatId:e,id:t,isTranslatable:n,detectedLanguage:o}){const i=_.get(e)||new H.A(150),s=i.get(t);s&&s.detectedLanguage===o&&s.isTranslatable===n||(i.set(t,{id:t,isTranslatable:n,detectedLanguage:o}),_.set(e,i),Q(e))}({chatId:e.chatId,id:e.id,isTranslatable:o,detectedLanguage:t})},[e,t,n,i])}(e,$s,!en,cn);const Hs=(0,d.ZR)(e,!nn),Ws=!nn&&tn?(0,w.C)(tn):void 0,_s=Ws?.languageCode||nn,Qs=Ws?.tone||on,{isPending:Zs,translatedText:Xs}=(0,ee.A)(Qt,vo,Hs?fo:void 0,_s,Qs),ea=Boolean(Dn?.isPending),ta=Zs||ea,na=(0,J.A)(Xs,Boolean(Hs));(0,R.A)(([e])=>{(Dn?.text||e&&!Ko)&&Rs()},[Ko,Dn?.text]);const oa=Xs||na,ia="phoneCall"===wi?.type?wi:void 0,sa=zt?.isCommentsInfo?zt:void 0,aa=wt&&pt&&si,ra=(sa||aa)&&!Vi&&"thread"===xt&&!m,da=(sa||aa)&&!Vi&&"thread"===xt&&!m,ca=!qo&&!ia&&!It&&Pt&&!Vi&&!Oi&&!ns&&!Fn,la=!Pi&&Bi&&(xi||(hi||mi||bi||"geo"===Ci?.mediaType)&&(!Us||Vs)),{className:ua,style:ha}=(0,G.Ay)({peer:Xi,noUserColors:es,shouldReset:!0,theme:se}),ma=function(e,t,{poll:n,webPage:o,hasSubheader:i,isCustomShape:s,isLastInGroup:a,asForwarded:c,hasThread:l,forceSenderName:u,hasCommentCounter:h,hasBottomCommentButton:m,hasActionButton:p,hasReactions:g,isGeoLiveActive:f,withVoiceTranscription:v,peerColorClass:A,hasOutsideReactions:y}={}){const{paidMedia:C}=(0,d.r_)(e),{photo:w,video:I}=Y(C),b=(0,d.r_)(e),{photo:S=w,video:M=I,audio:N,voice:k,document:F,contact:P,location:T,invoice:D,storyData:x,giveaway:L,giveawayResults:B}=b,R=t?.hasMultipleCaptions?void 0:(0,d.r_)(t?.captionMessage||e).text,E=Boolean(e.factCheck?.text),O="video"===M?.mediaType&&M.isRound,U=e.isInvertedMedia,K=S||M&&!O||t||o,z=[r.zPk],V=n?.attachedMedia,j=x||S||M||T||D?.extendedMedia||C||V?.photo||V?.video||V?.location,G=R||"venue"===T?.mediaType||f||E||n,J=j&&!G,q=Boolean(e.inlineButtons),$=Boolean(e.viaBotId),H=U&&K?!(!g||y)||!!E||!(!o||!G):G;return A&&z.push(A),!j&&R?.emojiOnlyCount?(z.push("emoji-only"),R.emojiOnlyCount<=r.Apc&&z.push(`emoji-only-${R.emojiOnlyCount}`)):G?z.push("text"):z.push("no-text"),Object.keys(b).length||z.push("unsupported"),p&&z.push("has-action-button"),s&&(z.push("custom-shape"),O&&z.push("round"),h&&z.push("has-comment-counter")),j&&!v?z.push("media"):M?z.push("video"):N?z.push("audio"):k?(z.push("voice"),v&&z.push("with-voice-transcription")):F?z.push("document"):P?z.push("contact"):n?z.push("poll"):L||B?z.push("giveaway"):"full"===o?.webpageType&&(z.push("web-page"),(o.photo||o.video)&&z.push("media"),o.document&&z.push("document"),o.gift&&z.push("gift"),o.auction&&z.push("auction")),D&&!D.extendedMedia&&z.push("invoice"),D&&D.photo&&z.push("has-photo"),x&&z.push("story"),c&&z.push("is-forwarded"),i&&z.push("has-subheader"),l&&z.push("has-replies"),g&&z.push("has-reactions"),y&&z.push("has-outside-reactions"),$&&z.push("is-via-bot"),u&&z.push("force-sender-name"),s||(z.push("has-shadow"),j&&l&&z.push("has-background"),(i||c||$||!J||u||E||v)&&z.push("has-solid-background"),E&&z.push("has-fact-check"),!a||q||!S&&J&&!m||z.push("has-appendix")),K&&U&&z.push("is-inverted-media"),H?z.push("has-footer"):z.push("no-footer"),z.join(" ")}(e,t,{poll:In,webPage:Tn,hasSubheader:Wi,isCustomShape:xi,isLastInGroup:D,asForwarded:Ri,hasThread:Di&&!m,forceSenderName:ae,hasCommentCounter:Di&&void 0!==zt.messagesCount&&zt.messagesCount>0,hasBottomCommentButton:da&&!xi,hasActionButton:Ji||qi||da&&xi,hasReactions:Bi,isGeoLiveActive:"geoLive"===Ci?.mediaType&&!(0,d.vz)(e),withVoiceTranscription:Pi,peerColorClass:ua,hasOutsideReactions:la}),pa=ma.includes("has-appendix"),ga=(0,k.Rr)(zs?.emojiOnlyCount),fa=Yn?void 0:Ki&&kn?t.messages.length*kn:kn;let va,Aa;va=ia||Vi?"none":!Us||Tn||ga||Vs?Vs&&!ga&&($i||Tn)?"in-text":"standalone":"in-text",Bi?la?Aa="outside":Ri?(va="standalone",Aa="inside"):Aa="inside":Aa="none";const ya=xi?"in-meta":"in-content";(0,E.A)(Gs||vo,js,Pe,e.id,ye||Ve),(0,O.A)(Js||vo,qs,Ue),(0,Z.A)({elementRef:ao,isFocused:Xe,focusDirection:et,noFocusHighlight:it,isResizingContainer:at,isJustAdded:C,isQuote:Boolean(tt),scrollTargetPosition:st});const Ca=yn?(0,c.em)(po,yn):void 0,wa=!e.senderId,Ia=Ca||wa&&e.postAuthorTitle||(Ri||ct)&&Ao?.postAuthorTitle||void 0;(0,o.vJ)(()=>{const n=co.current;if(!n||!(0,S.Y)(n))return;Vt&&Zn({chatId:vo,messageIds:[fo]}),Jt&&oo({chatId:vo,messageIds:[fo]});let o=[];e.hasUnreadMention&&(o=[fo]),t&&(o=t.messages.filter(e=>e.hasUnreadMention).map(e=>e.id)),o.length&&no({chatId:vo,messageIds:o})},[Vt,Jt,t,vo,fo,Zn,oo,e.hasUnreadMention]);const ba=(0,o.Kr)(()=>Ki?x(ai,Boolean(n),t,Jo):void 0,[Ki,ai,n,t,Jo]),Sa=Ri&&!xi?28:0,Ma=(0,o.Kr)(()=>{let e,t,o,i="";if(!Ki&&(hi||mi||yi?.extendedMedia)){let o;if(hi||mi){const e=hi||mi;e&&!Ui&&(o=(0,P.yA)({media:e,isOwn:ai,asForwarded:Ri,noAvatars:n,isMobile:Jo}).width)}else if(yi?.extendedMedia&&yi.extendedMedia.width&&yi.extendedMedia.height){const{width:e,height:t}=yi.extendedMedia;o=(0,M.kn)({width:e,height:t,fromOwnMessage:ai,asForwarded:Ri,noAvatars:n,isMobile:Jo}).width}o&&(o<(0,P.Ay)(Jo)&&(t=o),e=Math.max((0,P.nP)(zs?.text,Jo,ra),o))}else if(ba){const t=(0,P.nP)(zs?.text,Jo,ra);e=Math.max(t,ba.containerStyle.width)}if(e)i=`width: ${e}px`,o=e+ho;else if(vi&&!Wi){const{width:e}=(0,M.bu)(vi,Jo);i=`width: ${e+Sa}px`,o=e+ho}return{contentWidth:t,style:i,reactionsMaxWidth:o}},[ba,Ri,Sa,Wi,yi?.extendedMedia,Ki,ra,Jo,ai,n,hi,vi,zs?.text,mi,Ui]),{contentWidth:Na,style:ka,reactionsMaxWidth:Ya}=Ma,Fa=(0,A.A)(ha,ka),Pa=(0,V.A)(()=>{Io&&bo&&to({chatId:vo,messageId:fo})});function Ta(e){if(!Es)return;const t=Ko&&Dn?.text||(tn?oa:void 0);return(0,Ie.Y)(Ne.A,{messageOrStory:Es,forcedText:t,isForAnimation:e,focusedQuote:tt,focusedQuoteOffset:ot,emojiSize:ga,highlight:vt,isProtected:_e,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,withTranslucentThumbs:xi,isInSelectMode:It,canBeEmpty:$i,maxTimestamp:bn,threadId:Nt,shouldAnimateTyping:Io,canAnimateTextStreaming:an,onTypingAnimationEnd:Pa})}function Da(){return(0,Ie.Y)("div",{className:"translation-animation",children:(0,Ie.Y)("div",{className:"text-loading",children:Ta(!0)})})}const xa=(0,o.hb)(()=>{if(Pt)return(0,Ie.Y)("div",{className:(0,v.A)("quick-reaction","no-selection",hs&&!Ct&&"visible"),onClick:cs,ref:mo,children:(0,Ie.Y)(Ye.A,{reaction:Pt,size:uo,availableReactions:Yt,observeIntersection:Rn})})},[Ct,Yt,Pt,cs,hs,Rn]);function La(){const t=(0,Ie.Y)(fn,{message:e,isPinned:Bt,withFullDate:ct&&!ai,noReplies:p,repliesThreadInfo:zt,outgoingStatus:Je,signature:Ia,withReactionOffset:"inside"===Aa,renderQuickReactionButton:ca&&"in-meta"===ya?xa:void 0,availableReactions:Yt,isTranslated:Boolean(tn?oa:void 0),effectEmoji:wn?.emoticon,onClick:bs,onEffectClick:Bs,onTranslationClick:Ss,onOpenThread:Ms,paidMessageStars:fa});return"inside"!==Aa?t:(0,Ie.Y)(On.A,{message:kt,threadId:Nt,metaChildren:t,observeIntersection:Rn,noRecentReactors:pt,tags:gn,isCurrentUserPremium:T,isAccountFrozen:Fn})}function Ba(e){const t=(0,v.A)("text-content","clearfix"),n=(0,v.A)("text-content","clearfix","in-text"===va&&"with-meta",Je&&"with-outgoing-icon"),o=Ki||!Ki&&hi||!Ki&&mi&&!Ui||!Li&&$i,i="in-text"===va;return(0,Ie.FD)(Ie.FK,{children:[Ra(),Us&&!Li&&(0,Ie.FD)("div",{className:t,dir:"auto",children:[Ta(),ta&&Da(),!o&&i&&La()]}),o&&(0,Ie.FD)(Ie.FK,{children:[Ea(e),!Li&&(0,Ie.FD)("div",{className:n,dir:"auto",children:[$i&&(0,Ie.Y)(Ft,{factCheck:wo,isToggleDisabled:It}),i&&La()]})]})]})}function Ra(){const t=(0,d.T_)(e);if(t&&Tn)return(0,Ie.Y)(lo,{messageWebPage:t,webPage:Tn,message:e,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,noAvatars:n,canAutoLoad:Et,canAutoPlay:Ot,asForwarded:Ri,isDownloading:Rt,isProtected:_e,theme:se,story:rn,isConnected:dn,lastPlaybackTimestamp:Sn,backgroundEmojiId:Xi?.color?.backgroundEmojiId,shouldWarnAboutFiles:mn,autoLoadFileMaxSizeMb:Kt,onAudioPlay:ys,onMediaClick:vs,onDocumentClick:As,onCancelMediaTransfer:ks})}function Ea(e){const o=(0,Ie.FD)(Ie.FK,{children:[Ki&&Bn&&(0,Ie.Y)(Ge,{album:t,albumLayout:ba,observeIntersection:Bn,isOwn:ai,isProtected:_e,hasCustomAppendix:e,onMediaClick:Cs}),!Ki&&hi&&(0,Ie.Y)(Ke.A,{messageText:zs?.text,photo:hi,isOwn:ai,observeIntersection:Bn,noAvatars:n,canAutoLoad:Et,uploadProgress:qe,shouldAffectAppendix:e,isDownloading:Rt,isProtected:_e,asForwarded:Ri,theme:se,isMediaNsfw:Mn,forcedWidth:Na,onClick:ws,onCancelUpload:ks}),!Ki&&mi&&!Ui&&(0,Ie.Y)(ze.A,{video:mi,isOwn:ai,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,forcedWidth:Na,noAvatars:n,canAutoLoad:Et,canAutoPlay:Ot,uploadProgress:qe,isDownloading:Rt,isProtected:_e,asForwarded:Ri,isMediaNsfw:Mn,lastPlaybackTimestamp:Sn,onClick:Is,onCancelUpload:ks})]});return ci?(0,Ie.Y)(Cn,{chatId:vo,messageId:fo,paidMedia:ci,isOutgoing:ai,children:o}):o}function Oa(){return!(xi&&!yo)&&(h&&(!(hi||mi||Ci||ci)||_t)||Ri||yo||ae)&&!zi&&!(di&&xi)}function Ua(){return(0,Ie.FD)("span",{className:"forward-title-container",children:[Ri&&(0,Ie.Y)(Ce.A,{name:Ao?.hiddenUserName?"forward":"share-filled"}),Ri&&(0,Ie.Y)("span",{className:"forward-title",children:po("ForwardedFrom")})]})}const Ka=(0,V.A)(t=>{Jn({chatId:vo,messageId:e.id,threadId:Nt,button:t})}),za=(0,V.A)(t=>{if("openThread"!==t.type)return"suggestedMessage"===t.type?"approve"===t.buttonType?void Hn({chatId:vo,messageId:e.id}):"decline"===t.buttonType?void Oo():void qn({chatId:vo,messageId:e.id,button:t}):void 0;io({chatId:vo,threadId:Ht.id})}),Va=(0,V.A)(e=>{Go(e.target.value)}),ja=(0,V.A)(()=>{$n({chatId:vo,messageId:e.id,rejectComment:jo.trim()||void 0}),Uo(),Go("")});function Ga(t=!1,n=!1){let o;!ts||xi&&yo?Ao?.hiddenUserName?o=Ao.hiddenUserName:bi&&le&&(o=(0,c.em)(po,le)):o=(0,c.em)(po,ts);const i=ts&&"emojiStatus"in ts&&ts.emojiStatus,s=ts&&"isPremium"in ts&&ts.isPremium,a=Ri&&ts;return(0,Ie.FD)("div",{className:"message-title",dir:"ltr",children:[o||Ri?(0,Ie.FD)("span",{className:(0,v.A)("message-title-name-container",Ao?.hiddenUserName?"sender-hidden":"interactive"),dir:"ltr",children:[!t&&Ua(),(0,Ie.FD)("span",{className:"message-title-name",children:[bi&&(0,Ie.Y)(Ce.A,{name:"play-story"}),a&&(0,Ie.Y)(me.A,{className:"forward-avatar",peer:ts,size:"micro"}),(0,Ie.Y)("span",{className:"sender-title",onClick:ps,children:o?(0,N.A)(o):Ri?" ":void 0}),!Ri&&i&&(0,Ie.Y)(pe.A,{documentId:i.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn}),!Ri&&!i&&s&&(0,Ie.Y)(Me.A,{}),ts?.fakeType&&(0,Ie.Y)(Se.A,{fakeType:ts.fakeType})]})]}):ue?void 0:" ",ue?.hasUsername&&(0,Ie.FD)("span",{className:"interactive",children:[(0,Ie.Y)("span",{className:"via",children:po("ViaBot")}),(0,Ie.Y)("span",{className:"sender-title",onClick:gs,children:(0,N.A)(`@${(0,d.Kl)(ue)}`)})]}),(0,Ie.Y)("div",{className:"title-spacer"}),(!n&&!Ia||Ei)&&(0,Ie.FD)("span",{className:"message-title-meta",children:[n||Ia?void 0:Ao?.isLinkedChannelPost?(0,Ie.Y)("span",{className:"admin-title",dir:"auto",children:po("DiscussChannel")}):e.postAuthorTitle&>&&!Ri?(0,Ie.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!$t&&!So||Ri?void 0:(0,Ie.Y)(ke.A,{chatId:vo,userId:$t?.userId||re?.id,isAdmin:$t?.isAdmin,isOwner:$t?.isOwner,rank:$t?.rank||So,className:"admin-title-badge",isClickable:!0}),Ei&&(0,Ie.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,Ie.Y)(Ce.A,{name:pn>1?"boosts":"boost"}),pn>1?pn:void 0]})]})]})}const Ja=gt&&Ri?e.postAuthorTitle:void 0,qa=e.suggestedPostInfo&&!e.isOutgoing&&!e.suggestedPostInfo.isAccepted&&!e.suggestedPostInfo.isRejected,$a=(()=>{if(!e.suggestedPostInfo?.scheduleDate||!Pn)return!1;const t=(0,I.Fm)();return e.suggestedPostInfo.scheduleDate<=t+Pn})(),Ha=(0,o.Kr)(()=>{if(qa)return[[{type:"suggestedMessage",buttonType:"decline",text:go("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:go("SuggestedPostApprove"),disabled:$a}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:go("SuggestedPostSuggestChanges")}]]},[$a,go,qa]),Wa=(0,o.Kr)(()=>{if(ut&&!e.inlineButtons&&Ht&&ie&&Nt===s.l3)return[[{type:"openThread",text:go("BotForumContinueThreadButton")}]]},[ut,go,e.inlineButtons,Ht,ie,Nt]),_a=Ha||Wa;return(0,Ie.FD)("div",{ref:ao,id:(0,d.GZ)(e.id),className:Ks,"data-message-id":fo,onCopy:_e?b.A:void 0,onMouseDown:os,onClick:is,onContextMenu:ss,onDoubleClick:as,onMouseEnter:Vi?ms:void 0,onMouseMove:ca?ds:void 0,onMouseLeave:ca||Vi?ls:void 0,children:[(0,Ie.Y)("div",{ref:ro,className:"top-marker"}),(0,Ie.Y)("div",{ref:co,className:"bottom-marker","data-message-id":fo,"data-last-message-id":t?t.messages[t.messages.length-1].id:void 0,"data-album-main-id":t?t.mainMessage.id:void 0,"data-has-unread-mention":e.hasUnreadMention||void 0,"data-has-unread-poll-vote":Jt||void 0,"data-has-unread-reaction":Vt||void 0,"data-is-pinned":Bt||void 0,"data-should-update-views":void 0!==e.viewsCount}),!$e&&(0,Ie.Y)("div",{className:"message-select-control no-selection",children:bt&&(0,Ie.Y)(Ce.A,{name:"check",className:"message-select-control-icon"})}),te&&(0,Ie.Y)("div",{className:(0,v.A)("message-select-control group-select no-selection",Mt&&"is-selected"),onClick:Ds,children:Mt&&(0,Ie.Y)(Ce.A,{name:"check",className:"message-select-control-icon"})}),(0,Ie.FD)("div",{className:(0,v.A)("message-content-wrapper",ma.includes("text")&&"can-select-text",ma.includes("giveaway")&&"giveaway-result-content"),children:[(0,Ie.FD)("div",{className:ma,style:Fa,dir:"auto",children:[Ri&&!zi&&(0,Ie.FD)(Ie.FK,{children:[Oa()&&Ga(),Ja&&(0,Ie.Y)("span",{className:"admin-title",dir:"auto",children:Ja})]}),function(){const t=(0,v.A)("content-inner",Ri&&"forwarded-message",Hi&&"forwarded-custom-shape",Wi&&"with-subheader"),o=D&&(!Us||Vs&&!$i&&"inside"!==Aa)&&!da,i=(0,v.A)("text-content","clearfix","in-text"===va&&"with-meta",Je&&"with-outgoing-icon"),s=!ns||!ai||ct;return(0,Ie.FD)("div",{className:t,onDoubleClick:rs,dir:"auto",children:[!Ri&&Oa()&&Ga(),Wi&&(0,Ie.FD)("div",{className:"message-subheader",children:[_t&&(0,Ie.Y)(Le,{topic:Ht,onClick:xs,className:"message-topic"}),Hi&&(0,Ie.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,Ie.Y)("div",{className:"message-title",children:Ua()}),Ga(!0,!0)]}),di&&(0,Ie.Y)(ve.A,{message:Pe,replyInfo:Yi,noUserColors:es,isProtected:_e,sender:Te,senderChat:xe,forwardSender:De,chatTranslations:Qt,isMediaNsfw:Nn,requestedChatTranslationLanguage:nn,requestedChatTranslationTone:on,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,onClick:fs}),Ti&&(0,Ie.Y)(be,{story:Ue,sender:je,noUserColors:es,isProtected:_e,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,onClick:Ls}),ii&&Ko&&!Dn?.isPending&&(0,Ie.FD)(we.A,{className:"message-summary",onClick:Vo,children:[(0,Ie.Y)(Fe.A,{preset:"button",className:"message-summary-sparkles"}),(0,Ie.Y)("span",{className:"message-summary-title",children:go("MessageSummaryTitle")}),(0,Ie.Y)("span",{className:"message-summary-description",children:go("MessageSummaryDescription")})]})]}),vi&&Bn&&Rn&&(0,Ie.Y)(Gn,{message:e,observeIntersection:Bn,observeIntersectionForPlaying:Rn,shouldLoop:Ut,shouldPlayEffect:To,withEffect:sn,isMediaNsfw:Mn,onStopEffect:xo}),Li&&yt&&(0,Ie.Y)(We,{customEmojiId:yt,withEffects:sn&&Yn&&!wn,isOwn:ai,observeIntersection:Bn,forceLoadPreview:si,messageId:fo,chatId:vo,activeEmojiInteractions:Dt}),Li&&At&&(0,Ie.Y)(Qe,{emoji:At,withEffects:sn&&Yn&&!wn,isOwn:ai,observeIntersection:Bn,forceLoadPreview:si,messageId:fo,chatId:vo,activeEmojiInteractions:Dt}),sn&&wn&&!si&&(0,Ie.Y)(hn.A,{shouldPlay:To,messageId:e.id,isMirrored:!e.isOutgoing,effect:wn,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,onStop:xo}),ia&&(0,Ie.Y)(An,{message:e,phoneCall:ia,chatId:vo}),!Ki&&Ui&&!Pi&&(0,Ie.Y)(Un.A,{message:e,observeIntersection:Bn,canAutoLoad:Et,isDownloading:Rt,onReadMedia:s?Ns:void 0,onHideTranscription:No,isTranscriptionError:Co,isTranscribed:Boolean(oe),canTranscribe:vn&&!ns,isTranscriptionHidden:Mo,isTranscribing:ne}),(pi||gi||Pi)&&(0,Ie.Y)(he.Ay,{theme:se,message:e,origin:a.d9.Inline,uploadProgress:qe,isSelectable:$e,isSelected:bt,noAvatars:n,onPlay:ys,onReadMedia:gi&&s?Ns:void 0,onCancelUpload:ks,isDownloading:Rt,isTranscribing:ne,isTranscriptionHidden:Mo,isTranscribed:Boolean(oe),isTranscriptionError:Co,canDownload:!_e,onHideTranscription:No,canTranscribe:vn&&!ns}),fi&&(0,Ie.Y)(ge.A,{document:fi,message:e,observeIntersection:Bn,canAutoLoad:Et,autoLoadFileMaxSizeMb:Kt,uploadProgress:qe,isSelectable:$e,isSelected:bt,onMediaClick:As,onCancelUpload:ks,isDownloading:Rt,shouldWarnAboutFiles:mn}),bi&&!Oi&&(0,Ie.Y)(_n,{message:e,isProtected:_e}),Oi&&(0,Ie.Y)(Qn,{message:e}),Ai&&(0,Ie.Y)(rt,{contact:Ai,noUserColors:ai}),In&&(0,Ie.Y)(En,{chatId:vo,messageId:fo,poll:In,messageText:zs,theme:se,isInScheduled:ri,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn},In.summary.id),Ni&&(0,Ie.Y)(Xn,{message:e,todoList:Ni}),(Si||Mi)&&(0,Ie.Y)(jt,{message:e}),Ii&&(0,Ie.Y)(Tt,{message:e,threadId:Nt,canAutoLoadMedia:Et}),ki&&(0,Ie.Y)(St,{canSendDice:xn,isLocal:si,dice:ki,isOutgoing:ai,canPlayWinEffect:Lo,onEffectPlayed:Ro}),yi?.extendedMedia&&(0,Ie.Y)(Xt,{message:e,isConnected:dn}),Pi&&(0,Ie.Y)("p",{className:(0,v.A)("transcription",!Mo&&Co&&"transcription-error"),dir:"auto",children:Co?po("NoWordsRecognized"):ne&&oe?(0,Ie.Y)(fe.A,{content:oe}):oe}),Vs&&Ba(o),!Vs&&(0,Ie.FD)(Ie.FK,{children:[Ea(o),Us&&!Li&&(0,Ie.FD)("div",{className:i,dir:"auto",children:[Ta(),ta&&Da(),$i&&(0,Ie.Y)(Ft,{factCheck:wo,isToggleDisabled:It}),"in-text"===va&&La()]}),Ra()]}),yi&&!yi.extendedMedia&&(0,Ie.Y)(Wt,{message:e,shouldAffectAppendix:o&&!Bi,isInSelectMode:It,isSelected:bt,theme:se,forcedWidth:Na}),Ci&&(0,Ie.Y)(ln,{message:e,isInSelectMode:It,isSelected:bt,theme:se,peer:re})]})}(),!Vi&&"standalone"===va&&!Oi&&La(),Gi&&(0,Ie.FD)("div",{className:"message-action-buttons-container",children:[(0,Ie.Y)("div",{className:"message-action-buttons-sticky-zone",children:(0,Ie.Y)("div",{className:"message-action-buttons message-action-button-sticky",children:ii&&(0,Ie.Y)(Re.A,{className:"message-action-button action-summary",color:"translucent-white",round:!0,withSparkleEffect:!0,ariaLabel:go(Ko?"AriaHideSummary":"AriaShowSummary"),onClick:Ko?Vo:zo,iconName:Ko?"expand":"collapse"})})}),(0,Ie.FD)("div",{className:(0,v.A)("message-action-buttons",He&&"message-action-buttons-shown"),children:[da&&xi&&(0,Ie.Y)(nt,{threadInfo:sa,disabled:m||!sa,isLoading:He,isCustomShape:!0}),Ji&&(0,Ie.Y)(Re.A,{className:"message-action-button",color:"translucent-white",round:!0,ariaLabel:po("lng_context_forward_msg"),onClick:te?Ys:Fs,iconName:"share-filled"}),qi&&(0,Ie.Y)(Re.A,{className:"message-action-button",color:"translucent-white",round:!0,ariaLabel:go("FocusMessage"),onClick:Lt?Ps:Ts,iconName:"arrow-right"})]})]}),da&&!xi&&(0,Ie.Y)(nt,{threadInfo:sa,disabled:m||!sa,isLoading:He}),pa&&(0,Ie.Y)(un.A,{isOwn:ai}),ca&&"in-content"===ya&&xa()]}),e.inlineButtons&&(0,Ie.Y)(Gt.A,{inlineButtons:e.inlineButtons,onClick:Ka}),_a&&(0,Ie.Y)(Gt.A,{inlineButtons:_a,onClick:za}),"outside"===Aa&&!Oi&&(0,Ie.Y)(On.A,{message:kt,threadId:Nt,isOutside:!0,isCurrentUserPremium:T,maxWidth:Ya,observeIntersection:Rn,noRecentReactors:pt,tags:gn,isAccountFrozen:Fn})]}),Wo&&(0,Ie.Y)(lt,{isOpen:Ho,anchor:Wo,targetHref:_o?.matches("a[href]")?_o.href:void 0,message:e,album:t,messageListType:xt,onClose:Xo,onCloseAnimationEnd:ei,repliesThreadInfo:zt,noReplies:p,detectedLanguage:$s}),Eo&&(0,Ie.FD)(Ee.A,{isOpen:Eo,onClose:Uo,title:go("SuggestedPostDecline"),confirmLabel:go("SuggestedPostDecline"),confirmHandler:ja,confirmIsDestructive:!0,children:[(0,Ie.Y)("div",{className:"decline-dialog-question",children:(0,N.A)(go("DeclinePostDialogQuestion",{sender:re?(0,c.em)(po,re):""},{withNodes:!0,withMarkdown:!0}))}),(0,Ie.Y)(Oe.A,{placeholder:go("DeclineReasonPlaceholder"),value:jo,onChange:Va,maxLength:200})]})]})}))},48906(e,t,n){n.d(t,{A:()=>i});var o=n(20021);const i=function({isOwn:e}){const t=e?"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":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,o.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,o.Y)("defs",{children:(0,o.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,o.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,o.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,o.Y)("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"})]})}),(0,o.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,o.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,o.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},97676(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(87357),s=n(37661),a=n(5912),r=n(17712),d=n(62587),c=n(10221),l=n(18104),u=n(3325);var h=n(20021);const m=(0,o.ph)(({messageId:e,isMirrored:t,effect:n,shouldPlay:m,observeIntersectionForLoading:p,observeIntersectionForPlaying:g,onStop:f})=>{const v=(0,o.li)(),A=(0,o.li)(),y=(0,a.Vz)(v,p),C=(0,a.Vz)(v,g),[w,I,b]=(0,s.A)(),[S,M,N]=(0,s.A)(),k=function(e){return e.effectAnimationId?`sticker${e.effectAnimationId}`:`sticker${e.effectStickerId}?size=f`}(n),Y=(0,d.A)(k,!y),F=(0,r.A)(()=>{b(),f?.()}),P=(0,c.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,o.vJ)(()=>{S&&P(),N()},[P,N,S]),(0,o.vJ)(()=>{C&&m&&Y&&(I(),M())},[C,Y,m,P]);const T=(0,i.A)("McmbiWZE",t&&"wNvU2uqi");return(0,h.Y)("div",{className:(0,i.A)("IYu2f7FM",t&&"GsTZawTE"),ref:v,children:w&&(0,h.Y)(u.A,{children:(0,h.Y)(l.A,{ref:A,className:T,tgsUrl:Y,size:256,play:!0,isLowPriority:!0,noLoop:!0,forceAlways:!0,onEnded:F},`effect-${e??n.id}`)})})})},51644(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(90709),d=n(87357),c=n(95807),l=n(40435),u=n(35127),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(37859),v=n(37960),A=n(69419),y=n(29886),C=n(73767),w=n(34201),I=n(61097),b=n(18276),S=n(27860),M=n(14413),N=n(35913),k=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,photo:t,messageText:n,isOwn:Y,noAvatars:F,canAutoLoad:P,isInSelectMode:T,isSelected:D,uploadProgress:x,forcedWidth:L,size:B="inline",dimensions:R,asForwarded:E,nonInteractive:O,shouldAffectAppendix:U,isDownloading:K,isProtected:z,theme:V,isNestedMedia:j,clickArg:G,className:J,isMediaNsfw:q,observeIntersection:$,onClick:H,onCancelUpload:W,needsAgeVerification:_})=>{const Q=(0,o.li)(),Z="extendedMediaPreview"===t.mediaType,X=Z?void 0:t.blobUrl,ee=(0,p.Vz)(Q,$),{isMobile:te}=(0,h.Ay)(),[ne,oe]=(0,o.J0)(P),ie=ne&&ee&&!Z,{mediaData:se,loadProgress:ae}=(0,A.A)(Z?void 0:(0,r.rI)(t,B),!ie),re=(0,y.A)(se),de=X||se,{ref:ce,shouldRender:le}=(0,v.A)({hasMediaData:Boolean(de),withShouldRender:!0}),ue=Boolean(L),[he]=(0,o.J0)(!de),me=Boolean(de),pe=(0,I.A)(t,me);(0,v.A)({ref:pe,hasMediaData:!me});const ge=(0,I.A)(t,!ue),fe=(0,r.VD)(t),{updateContentSettings:ve,openAgeVerificationModal:Ae}=(0,i.ko)(),[ye,Ce,we]=(0,m.A)(),[Ie,be]=(0,o.J0)(!1),Se=Z||t.isSpoiler||q,[Me,Ne,ke]=(0,m.A)(Se);(0,o.vJ)(()=>{Se?Ne():ke()},[Se]);const Ye=(0,g.A)(()=>{we(),ke(),Ie&&ve({isSensitiveEnabled:!0})}),{loadProgress:Fe}=(0,A.A)(Z?void 0:(0,r.rI)(t,"download"),!K,Z?void 0:(0,r.Cz)(t,"download")),{isUploading:Pe,isTransferring:Te,transferProgress:De}=(0,r.LK)(x||(K?Fe:ae),ie&&!de,void 0!==x),xe=!1===(0,C.A)(ne),{ref:Le,shouldRender:Be}=(0,w.A)({isOpen:Te,noMountTransition:xe,className:"slow",withShouldRender:!0}),{ref:Re,shouldRender:Ee}=(0,w.A)({isOpen:!de&&!ne,withShouldRender:!0}),{ref:Oe,shouldRender:Ue}=(0,w.A)({isOpen:Te,noMountTransition:xe,withShouldRender:!0}),Ke=(0,g.A)(e=>{if(Pe)W?.(G);else{if(de)return Me?q?_?void Ae():void Ce():void ke():void H?.(G,e);oe(e=>!e)}});(0,f.A)(([e])=>{if(!U)return void(e&&Q.current.closest(s.KFG).removeAttribute(s.D3G));const t=Q.current.closest(s.KFG);if(de){const e=Number(t.closest(".Message").dataset.messageId);(0,l.A)(de,Boolean(Y),e,D,V).then(e=>{(0,a.RK)(()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(s.D3G,"")})})}else t.classList.add("has-appendix-thumb")},[U,de,Y,T,D,V]);const{width:ze,height:Ve,isSmall:je}=R||(0,u.yA)({media:t,isOwn:Y,asForwarded:E,noAvatars:F,isMobile:te,messageText:n,isNestedMedia:j}),Ge=(0,d.A)("media-inner",!Pe&&!O&&"interactive",je&&"small-image",(ze===Ve||"pictogram"===B)&&"square-image",VeT});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(53827),d=n(87357),c=n(58744),l=n(41733),u=n(76023),h=n(2338),m=n(63988),p=n(37661),g=n(5912),f=n(17712),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(64493),M=n(65843),N=n(35913),k=n(20021);const Y=u.Wd/2,F=2*(Y-6)*Math.PI;let P;const T=({message:e,className:t,canAutoLoad:n,isDownloading:T,origin:D,observeIntersection:x,onStop:L,onReadMedia:B,isTranscriptionError:R,isTranscribed:E,canTranscribe:O,onHideTranscription:U,isTranscriptionHidden:K,isTranscribing:z})=>{const V=(0,o.li)(),j=(0,o.li)(),G=(0,o.li)(),{cancelMediaDownload:J,openOneTimeMediaModal:q,transcribeAudio:$}=(0,i.ko)(),H=(0,g.Vz)(V,x),W=e.content.video,_=e.isMediaUnread,[Q,Z]=(0,o.J0)(n),X=Boolean(Q&&H),{mediaData:ee,loadProgress:te}=(0,A.A)((0,a.sC)(W,"inline"),!X,(0,a.Cz)(W,"inline")),{loadProgress:ne}=(0,A.A)((0,a.sC)(W,"download"),!T,s.qZ.BlobUrl),[oe,ie]=(0,p.A)(),se=(0,a.G5)(e),ae="oneTimeModal"===D,re=se&&!ae,de=(0,h.A)(e),ce=!Boolean(de)||oe||re,le=(0,w.A)(W,ce);(0,v.A)({hasMediaData:!ce,ref:le});const ue=Q&&!oe||T,he=!1===(0,y.A)(Q),{ref:me,shouldRender:pe}=(0,C.A)({isOpen:ue,noMountTransition:he,withShouldRender:!0}),[ge,fe]=(0,o.J0)(!1),[ve,Ae]=(0,o.J0)(0),[ye,Ce]=(0,o.Ul)(0),we=(0,m.aG)(ye,16);(0,o.vJ)(()=>{if(!ge)return;const e=j.current;Ce(e.currentTime/e.duration)},[Ce,ge,we]),(0,o.Nf)(()=>{if(!ge||!G.current)return;const e=F-we()*F;G.current.setAttribute("stroke-dashoffset",e.toString())},[ge,we]);const Ie=Boolean(ee&&H),be=(0,f.A)(()=>{j.current&&(fe(!1),Ce(0),(0,l.A)(j.current))}),Se=(0,f.A)(()=>{P?.(),P=be}),Me=(0,f.A)(()=>{const e=j.current;ge?e.paused?((0,l.A)(e),(0,r._K)()):e.pause():(Se(),e.pause(),e.currentTime=0,(0,l.A)(e),(0,r._K)(),fe(!0))});(0,o.vJ)(()=>{ae&&Me()},[ae]);const Ne=(0,f.A)(t=>{if(!t.target.closest(".transcribe-button"))if(ee){if(!T)return se&&!ae?(q({message:e}),void B?.()):void Me();J({media:W})}else Z(e=>!e)});(0,o.vJ)(()=>{B&&_&&ge&&B()},[ge,_,B]);const ke=(0,f.A)(e=>{const t=e.currentTarget;Ce(t.currentTime/t.duration),Ae(Math.floor(t.currentTime))}),Ye=(0,f.A)(()=>{$({chatId:e.chatId,messageId:e.id})}),Fe=(0,f.A)(()=>{(E||R)&&U?U(!K):z||Ye()});return(0,k.FD)("div",{ref:V,className:(0,d.A)("RoundVideo","media-inner",ae&&"non-interactive",t),onClick:Ne,children:[ee&&(0,k.FD)("div",{className:"video-wrapper",children:[re&&(0,k.Y)(b.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,k.Y)(M.A,{canPlay:Ie,ref:j,src:ee,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!re,disablePictureInPicture:!0,muted:!ge,defaultMuted:!0,loop:!ge,playsInline:!0,isPriority:!0,onEnded:ge?L??be:void 0,onTimeUpdate:ge?ke:void 0,onReady:ie})]}),!re&&(0,k.Y)("canvas",{ref:le,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,k.Y)("div",{className:"progress",children:ge&&(0,k.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,k.Y)("circle",{ref:G,cx:Y,cy:Y,r:Y-6,className:"progress-circle",transform:`rotate(-90, ${Y}, ${Y})`,"stroke-dasharray":F,"stroke-dashoffset":F})})}),pe&&(0,k.Y)("div",{ref:me,className:"media-loading",children:(0,k.Y)(N.A,{progress:T?ne:te})}),re&&!pe&&(0,k.FD)("div",{className:"play-wrapper",children:[(0,k.Y)(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,iconName:"play"}),(0,k.Y)(I.A,{name:"view-once"})]}),!ee&&!Q&&(0,k.Y)(I.A,{name:"download"}),!ae&&(0,k.FD)("div",{className:(0,d.A)("message-media-duration",_&&"unread"),children:[ge?(0,c.QO)(ve):(0,c.QO)(W.duration),(!ge||j.current.paused)&&(0,k.Y)(I.A,{name:"muted"})]}),O&&(0,k.FD)(S.A,{onClick:Fe,className:"transcribe-button",children:[E||R?(0,k.Y)(I.A,{name:"down"}):(0,k.Y)(I.A,{name:"transcribe"}),z&&(0,k.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,k.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]})}},89873(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(17712),a=n(34201),r=n(59030),d=n(71429),c=n(24433),l=n(60859),u=n(20021);const h=(0,o.ph)(({isOpen:e,sponsorInfo:t,canReport:n,anchor:i,triggerRef:a,shouldSkipAbout:h,onClose:m,onCloseAnimationEnd:p,onAboutAdsClick:g,onSponsoredHide:f,onSponsorInfo:v,onSponsoredReport:A})=>{const y=(0,o.li)(),C=(0,r.A)(),w=(0,s.A)(()=>a.current),I=(0,s.A)(()=>({withPortal:!0})),b=(0,s.A)(()=>y.current),S=(0,s.A)(()=>document.body),M=t||!h||n;return(0,u.FD)(d.A,{ref:y,isOpen:e,anchor:i,withPortal:!0,className:"with-menu-transitions",getLayout:I,getTriggerElement:w,getMenuElement:b,getRootElement:S,onClose:m,onCloseAnimationEnd:p,children:[t&&v&&(0,u.Y)(c.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!h&&(0,u.Y)(c.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(c.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(l.A,{}),(0,u.Y)(c.A,{icon:"close-circle",onClick:f,children:C("HideAd")})]})}),m=(0,o.ph)(({isOpen:e,randomId:t,sponsorInfo:n,additionalInfo:o,canReport:r,anchor:d,triggerRef:c,shouldSkipAbout:l,onItemClick:m,onClose:p,onCloseAnimationEnd:g})=>{const{openAboutAdsModal:f,showDialog:v,reportSponsored:A,hideSponsored:y}=(0,i.ko)(),{ref:C}=(0,a.A)({isOpen:e,onCloseAnimationEnd:g}),w=(0,s.A)(()=>{m?.(),p()}),I=(0,s.A)(()=>{f({randomId:t,additionalInfo:o,canReport:r,sponsorInfo:n}),w()}),b=(0,s.A)(()=>{y(),w()}),S=(0,s.A)(()=>{v({data:{type:"message",text:{text:[n,o].filter(Boolean).join("\n")}}}),w()}),M=(0,s.A)(()=>{A({randomId:t}),w()});if(d)return(0,u.Y)("div",{ref:C,className:"ContextMenuContainer",children:(0,u.Y)(h,{isOpen:e,anchor:d,triggerRef:c,canReport:r,sponsorInfo:n,shouldSkipAbout:l,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:I,onSponsoredHide:b,onSponsorInfo:S,onSponsoredReport:M})})})},25477(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(58744),d=n(58554),c=n(76023),l=n(35127),u=n(84313),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(62587),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(14413),M=n(65843),N=n(35913),k=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,video:t,isOwn:n,isNestedMedia:Y,noAvatars:F,canAutoLoad:P,canAutoPlay:T,uploadProgress:D,forcedWidth:x,dimensions:L,asForwarded:B,isDownloading:R,isProtected:E,className:O,lastPlaybackTimestamp:U,clickArg:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:G,onCancelUpload:J,needsAgeVerification:q})=>{const{cancelMediaDownload:$,updateContentSettings:H,openAgeVerificationModal:W}=(0,i.ko)(),_=(0,o.li)(),Q=(0,o.li)(),[Z,X,ee]=(0,m.A)(),[te,ne]=(0,o.J0)(!1),oe="extendedMediaPreview"===t.mediaType,ie=oe?void 0:t.blobUrl,se=oe||t.isSpoiler||z,[ae,re,de]=(0,m.A)(se);(0,o.vJ)(()=>{se?re():de()},[se]);const ce=(0,g.A)(()=>{ee(),de(),te&&H({isSensitiveEnabled:!0})}),le=(0,p.Vz)(_,V),ue=(0,p.Vz)(_,j)&&le,he=(0,o.li)(le);ue&&!he.current&&(he.current=!0);const{isMobile:me}=(0,h.Ay)(),[pe,ge]=(0,o.J0)(P),fe=Boolean(pe&&le&&!oe),[ve,Ae]=(0,o.J0)(Boolean(T&&!ae)),ye=oe?void 0:(0,s.sC)(t,"inline"),[Ce]=(0,o.J0)(Boolean(ye&&d.Ih(ye))),{mediaData:we,loadProgress:Ie}=(0,A.A)(ye,!fe,oe?void 0:(0,s.Cz)(t,"inline")),be=ie||we,[Se,Me]=(0,m.A)(),Ne=(0,s.VD)(t),ke=Boolean(Ne),Ye=Boolean(x),Fe=be&&he.current,Pe=(0,u.A)(Q,!0,!Fe),Te=oe?void 0:(0,s.sC)(t,"preview"),[De]=(0,o.J0)(Boolean(Te&&d.Ih(Te))),xe=le,Le=(0,f.A)(Te,!xe),Be=Se&&!Pe,{ref:Re}=(0,v.A)({hasMediaData:Boolean((ke||Le)&&!Be)}),Ee=Boolean(!ke||Le||Se),Oe=(0,w.A)(t,Ee);(0,v.A)({ref:Oe,hasMediaData:!Ee});const Ue=(0,w.A)(t,!Ye),{loadProgress:Ke}=(0,A.A)(oe?void 0:(0,s.sC)(t,"download"),!R,oe?void 0:(0,s.Cz)(t,"download")),{isUploading:ze,isTransferring:Ve,transferProgress:je}=(0,s.LK)(D||(R?Ke:Ie),fe&&!Se&&!Ce||R,void 0!==D),Ge=!1===(0,y.A)(pe),{ref:Je,shouldRender:qe}=(0,C.A)({isOpen:Ve&&!Pe,noMountTransition:Ge,withShouldRender:!0}),{ref:$e}=(0,C.A)({isOpen:Boolean((pe||be)&&!ve&&!qe)}),{ref:He,shouldRender:We}=(0,C.A)({isOpen:Ve&&(!Pe||R),noMountTransition:Ge,withShouldRender:!0}),[_e,Qe]=(0,o.J0)(0),Ze=(0,g.A)(e=>{Qe(Math.max(0,e.currentTarget.currentTime-1))}),Xe=(Number.isFinite(Q.current?.duration)&&!Pe?Q.current?.duration:t.duration)||0,{width:et,height:tt}=L||(oe?(0,c.ri)(t,Boolean(n),B,Y,F,me):(0,c.rO)(t,Boolean(n),B,Y,F,me)),nt=(0,g.A)((e,n)=>{if(ze)J?.(K);else if(oe||!R){if(be)return be&&!ve&&Ae(!0),ae?z?q?void W():void X():void de():n&&fe&&!Se&&!Ce?(ge(!1),void e.stopPropagation()):void G?.(K,e);ge(e=>!e)}else $({media:t})}),ot=(0,g.A)(e=>{nt(e,!0)}),it=(0,a.A)("media-inner dark",!ze&&"interactive",ttnt(e),children:[Ye&&(0,k.Y)("canvas",{ref:Ue,className:"thumbnail blurred-bg"}),Fe&&(0,k.Y)(M.A,{ref:Q,src:be,className:(0,a.A)("full-media",Ye&&"with-blurred-bg"),canPlay:ve&&ue&&!Pe,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!E,onTimeUpdate:Ze,onReady:Me,style:x?`width: ${x}px`:void 0}),Le&&(0,k.Y)("img",{ref:Re,src:Le,className:(0,a.A)("thumbnail",Ye&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px;`:void 0,draggable:!E}),ke&&!De&&(0,k.Y)("canvas",{ref:Oe,className:"thumbnail"}),E&&(0,k.Y)("span",{className:"protector"}),(0,k.Y)(I.A,{ref:$e,name:"large-play"}),(0,k.Y)(b.A,{isVisible:ae,withAnimation:!0,thumbDataUri:Ne,isNsfw:z,width:et,height:tt,className:"media-spoiler"}),qe&&(0,k.Y)("div",{ref:Je,className:"media-loading",children:(0,k.Y)(N.A,{progress:je,onClick:ot})}),!pe&&!be&&(0,k.Y)(I.A,{name:"download"}),We?(0,k.Y)("span",{ref:He,className:"message-transfer-progress",children:ze||R?`${Math.round(100*je)}%`:"..."}):(0,k.FD)("div",{className:"message-media-duration",children:[!oe&&t.isGif?"GIF":(0,r.QO)(Math.max(Xe-_e,0)),Pe&&(0,k.Y)(I.A,{name:"message-failed",className:"playback-failed"})]}),Boolean(U)&&(0,k.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(U/Xe*100)}%`}),(0,k.Y)(S.A,{isOpen:Z,onClose:ee,shouldAlwaysShow:te,onAlwaysShowChanged:ne,confirmHandler:ce})]})}))},40435(e,t,n){n.d(t,{A:()=>s});var o=n(41074);const i={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(i[a||"light"][t?"outgoing":"incoming"]):(0,o.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%o.bP)}},35127(e,t,n){n.d(t,{Ay:()=>a,ej:()=>s,nP:()=>r,yA:()=>d});var o=n(76023);const i=12*o.$,s=5*o.$;function a(e){return(e?14:20)*o.$}function r(e="",t,n){return e.length>40||n?a(t):i}function d({media:e,messageText:t,isOwn:n,isNestedMedia:i,asForwarded:a,noAvatars:d,isMobile:c}){const l="photo"===e.mediaType,u="video"===e.mediaType,h=l&&i,m=u&&i,{width:p,height:g}=l?(0,o.ck)(e,n,a,h,d,c):u?(0,o.rO)(e,n,a,m,d,c):(0,o.ri)(e,n,a,i,d,c),f=r(t,c);let v=1;pu});var o=n(90709),i=n(84051),s=n(66644),a=n(67054),r=n(87679),d=n(41074),c=n(17712);let l=-1;function u(e,t){return function(e,t=!1){const n=(0,i.li)(),o=(0,i.Kr)(()=>(0,a.A)(d.bP,++l),[]),u=(0,i.li)(),h=(0,c.A)(async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)(()=>{e.width=n.width,e.height=n.height,u.current=e.transferControlToOffscreen();const i=Math.ceil(.1*Math.min(n.width,n.height));(0,d.M1)({name:"offscreen-canvas:blurThumb",args:[u.current,t,i],transferables:[u.current]},o)})});return(0,i.Nf)(()=>{if(!e||t||u.current)return;const o=n.current;o&&h(o,e)},[h,t,e]),n}(e?"string"==typeof e?e:(0,o.VD)(e):void 0,t)}},64154(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(13439),s=n(6211),a=n(37836);const r=new Map;function d(e,t,n,a,d){const l=a?(0,s.r)(a,d):void 0,u=l&&n?e?.byLangCode[l]?.[n]:void 0,{isPending:h,text:m}=u||{};return(0,o.vJ)(()=>{t&&n&&l&&a&&(m||void 0!==h||function(e,t,n,o){const a=(0,s.r)(n,o),d=r.get(a)||new Map,l=d.get(e)||[];l.includes(t)||(l.push(t),d.set(e,l),r.set(a,d),(0,i.ko)().markMessagesTranslationPending({chatId:e,messageIds:l,toLanguageCode:n,tone:o})),c()}(t,n,a,d))},[t,m,h,n,l,a,d]),t&&n?{isPending:h,translatedText:m}:{isPending:!1,translatedText:void 0}}const c=(0,a.nF)(function(){const{translateMessages:e}=(0,i.ko)();let t=!1;r.forEach((n,o)=>{const{languageCode:i,tone:a}=(0,s.C)(o);n.forEach((n,s)=>{const d=n.slice(0,20);d.length!t.includes(e));if(!s?.length)return o.delete(e),void(o.size||r.delete(n));o.set(e,s)}(s,d,o)})}),t&&c()},500)},10221(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(66644),s=n(76023),a=n(17712);const r=s.$;function d({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:d,id:c}){const l=(0,a.A)(()=>{const o=t.current,a=e.current;if(!o||!a)return;const d=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=window.innerWidth;(0,i.RK)(()=>{const e=d.top+d.height/2,t=d.bottom,i=s?t:e;o.style.top=i-c.height/2+"px",n?o.style.left=d.left-r+"px":o.style.right=l-d.right-r+"px"})});return(0,o.vJ)(()=>{d||l()},[d,c]),(0,o.vJ)(()=>{if(d)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",l,{passive:!0}),()=>{t.removeEventListener("scroll",l)}):void 0},[d,e]),l}},285(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(4961),d=n(59030),c=n(94189),l=n(20021);const u=(0,o.ph)((0,i.EK)((e,{userId:t})=>{const n=(0,a.meB)(e),o=t&&(0,a.mBe)(e,t);return{chat:n,contactName:o?(0,s.u0)(o):void 0}})(({isOpen:e,chat:t,userId:n,contactName:s,onClose:a})=>{const{deleteChatMember:u}=(0,i.ko)(),h=(0,d.A)(),m=(0,o.hb)(()=>{u({chatId:t.id,userId:n}),a()},[t,u,a,n]);if(t&&n)return(0,l.Y)(c.A,{isOpen:e,onClose:a,title:h("GroupRemoved.Remove"),textParts:(0,r.A)(h("PeerInfo.Confirm.RemovePeer",s)),confirmLabel:h("lng_box_remove"),confirmHandler:m,confirmIsDestructive:!0})}))},93809(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(35297);function a(e,t){const n=void 0===t,a=(0,o.li)(n),r=(0,o.li)(),d=(0,i.A)();return(0,s.A)(()=>{n||(a.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))},e),(0,o.vJ)(()=>{if(n||a.current)return;const e=()=>{a.current=!0,d()};t>0?r.current=window.setTimeout(e,t):e()},e),a.current}},71950(e,t,n){n.d(t,{A:()=>C});var o=n(84051),i=n(87357),s=n(58744),a=n(17142),r=n(14242),d=n(39351),c=n(59030),l=n(18276);const u="gvrp3KoR",h="IHb3ZATQ",m="zAPFdKbZ";var p=n(20021);const g=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],f=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],v=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],A=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],y=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],C=(0,o.ph)(({title:e,type:t,statistics:n,isToncoin:o,className:C,subtitle:w})=>{const I=(0,c.A)(),b=(0,d.A)(),S=({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return(0,p.FD)("span",{className:(0,i.A)("idLrmbhS",n&&"SLfwGHQC"),children:[n?`-${(0,r.Vw)(b,Math.abs(e))}`:`+${(0,r.Vw)(b,e)}`,t&&(0,p.FD)(p.FK,{children:[" ","(",t,"%)"]})]})},M=(e,t,n)=>{const[o,i]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,p.FD)("div",{children:[(0,p.Y)(l.A,{className:"it39BC_c",name:"toncoin"}),(0,p.FD)("b",{className:m,children:[o,(0,p.FD)("span",{className:"ZAfXkuWL",children:[".",i]})]})," ",(0,p.FD)("span",{className:h,children:["≈ $",s,(0,p.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,p.Y)("h3",{className:h,children:I(n)})]})},{period:N}=n,{balances:k,usdRate:Y}=n,F=function(e){switch(e){case"group":return f;case"message":return v;case"boost":return y;case"story":return A;default:return g}}(t);return(0,p.FD)("div",{className:(0,i.A)("Gi8Nokbl",C),children:[(0,p.FD)("div",{className:"H01lE7mv",children:[e&&(0,p.Y)("div",{className:"VQbs04hT",children:e}),N&&(0,p.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(I,1e3*N.minDate)," ","—",(0,s.Lu)(I,1e3*N.maxDate)]})]}),(0,p.Y)("table",{className:"s5beXqqL",children:o?(0,p.Y)("tr",{children:(0,p.FD)("td",{className:u,children:[M(k?.availableBalance?(0,a.wD)(k.availableBalance.amount):0,Y||0,"lng_channel_earn_available"),M(k?.currentBalance?(0,a.wD)(k.currentBalance.amount):0,Y||0,"lng_channel_earn_reward"),M(k?.overallRevenue?(0,a.wD)(k.overallRevenue.amount):0,Y||0,"lng_channel_earn_total")]})}):F.map(e=>(0,p.Y)("tr",{children:e.map(e=>{const t=n?.[e.name];if(e.isPlain)return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:`${e.isApproximate?"≈ ":""}${(0,r.Sm)(t??0)}`}),(0,p.Y)("h3",{className:h,children:I(e.title)})]});if(e.isPercentage){const n=t?.part??0,o=t?.percentage??0;return(0,p.FD)("td",{className:u,children:[e.withAbsoluteValue&&(0,p.Y)("span",{className:m,children:`${e.isApproximate?"≈ ":""}${(0,r.Sm)(n)}`}),(0,p.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":m,children:[o,"%"]}),(0,p.Y)("h3",{className:h,children:I(e.title)})]})}return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:(0,r.Vw)(b,t?.current??0)})," ",S(t),(0,p.Y)("h3",{className:h,children:I(e.title)})]})})}))}),w]})})},75319(e,t,n){function o(e){return"object"==typeof e&&null!==e&&"graphType"in e}n.d(t,{R:()=>o})},75343(e,t,n){n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(87357),a=n(43874),r=n(36838),d=n(39351),c=n(89925),l=n(70636),u=n(58744),h=n(48899),m=n(80140),p=n(54464),g=n(10722),f=n(17712),v=n(92111),A=n(21849),y=n(71429),C=n(24433),w=n(2429),I=n(20021);const b=(0,o.ph)(function({peer:e,isArchived:t,stealthModeActiveUntil:n}){const{openChat:a,openChatWithInfo:r,openStoryViewer:b,toggleStoriesHidden:S,openStealthModal:M,showNotification:N}=(0,i.ko)(),k=(0,d.A)(),Y=(0,o.li)(),F="isSelf"in e&&e.isSelf,P=!(0,h.L8)(e.id);(0,v.A)(e.id);const{isContextMenuOpen:T,contextMenuAnchor:D,handleBeforeContextMenu:x,handleContextMenu:L,handleContextMenuClose:B,handleContextMenuHide:R}=(0,g.A)(Y),E=(0,f.A)(()=>Y.current),O=(0,f.A)(()=>document.body),U=(0,f.A)(()=>Y.current.querySelector(".story-peer-context-menu .bubble")),K=(0,f.A)(()=>({withPortal:!0,isDense:!0})),z=(0,f.A)(()=>{T||b({peerId:e.id,origin:c.G9.StoryRibbon})}),V=(0,f.A)(e=>{(0,p.u)(e),x(e)}),j=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})}),G=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})}),J=(0,f.A)(()=>{a({id:e.id,shouldReplaceHistory:!0})}),q=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0})}),$=(0,f.A)(()=>{S({peerId:e.id,isHidden:!t})}),H=(0,f.A)(()=>{const t=n?n-(0,m.Fm)():0;if(t>0)return N({title:k("StealthModeOnTitle"),message:k("StealthModeOnHint",{time:(0,u.QO)(t)}),duration:1e3}),void b({peerId:e.id,origin:c.G9.StoryRibbon});M({targetPeerId:e.id})});return(0,I.FD)("div",{ref:Y,role:"button","data-peer-id":e.id,tabIndex:0,className:w.A.peer,onMouseDown:V,onClick:z,onContextMenu:L,children:[(0,I.Y)(A.A,{peer:e,withStory:!0,storyViewerOrigin:c.G9.StoryRibbon,storyViewerMode:"full"}),(0,I.Y)("div",{className:(0,s.A)(w.A.name,e.hasUnreadStories&&w.A.name_hasUnreadStory),children:F?k("StoryRibbonMyStory"):(0,l.F9)(k,e)}),void 0!==D&&(0,I.Y)(y.A,{isOpen:T,anchor:D,getTriggerElement:E,getRootElement:O,getMenuElement:U,getLayout:K,className:(0,s.A)("story-peer-context-menu",w.A.contextMenu),autoClose:!0,withPortal:!0,onClose:B,onCloseAnimationEnd:R,children:F?(0,I.FD)(I.FK,{children:[(0,I.Y)(C.A,{onClick:j,icon:"play-story",children:k("StoryMenuSavedStories")}),(0,I.Y)(C.A,{onClick:G,icon:"archive",children:k("StoryMenuArchivedStories")})]}):(0,I.FD)(I.FK,{children:[!P&&(0,I.Y)(C.A,{onClick:J,icon:"message",children:k("StoryMenuSendMessage")}),P?(0,I.Y)(C.A,{onClick:q,icon:"channel",children:k("StoryMenuViewChannel")}):(0,I.Y)(C.A,{onClick:q,icon:"user",children:k("StoryMenuViewProfile")}),!P&&(0,I.Y)(C.A,{onClick:H,icon:"eye-crossed-outline",children:k("StoryMenuOpenStealth")}),(0,I.Y)(C.A,{onClick:$,icon:t?"unarchive":"archive",children:k(t?"StoryMenuUnarchivePeer":"StoryMenuArchivePeer")})]})})]})}),S=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:o}}=e.stories,i=e.users.byId,s=e.chats.byId;return{orderedPeerIds:t?o:n,stealthModeActiveUntil:e.stories.stealthMode.activeUntil,usersById:i,chatsById:s}})(function({isArchived:e,className:t,orderedPeerIds:n,stealthModeActiveUntil:i,usersById:c,chatsById:l,isClosing:u}){const h=(0,d.A)(),m=(0,s.A)(w.A.root,!n.length&&w.A.hidden,u&&w.A.closing,t,"no-scrollbar"),p=(0,o.li)();return(0,r.A)(p,(0,a.Ny)()),(0,I.Y)("div",{ref:p,id:"StoryRibbon",className:m,dir:h.isRtl?"rtl":void 0,children:n.map(t=>{const n=c[t]||l[t];if(n)return(0,I.Y)(b,{peer:n,isArchived:e,stealthModeActiveUntil:i},t)})})}))},40175(e,t,n){n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(31481),a=n(11597),r=n(34458),d=n(39351),c=n(34201),l=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:o},byPeerId:i}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),d=(0,a.clw)(e),c=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:o,isShown:t?!r:!s,isForumPanelOpen:d,withAnimation:c,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:i}})(function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:a,canShow:p,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:A,peerStories:y}){const{toggleStoryRibbon:C}=(0,i.ko)(),w=(0,d.A)(),I=(0,o.Kr)(()=>1===t.length?[n[t[0]]||a[t[0]]]:t.map(e=>n[e]||a[e]).filter(t=>t&&t.id!==e).slice(0,s.dqH).reverse(),[e,t,n,a]),b=(0,o.Kr)(()=>I?.length?I.reduce((e,t)=>{const n=y[t.id];if(!n)return e;const o=n.orderedIds.some(e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const o=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!o});return e[t.id]=o,e},{}):{},[y,I]),S=(0,o.Kr)(()=>t.slice(0,5),[t]);(0,l.A)(S);const M=p&&g,{ref:N,shouldRender:k}=(0,c.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,o.vJ)(()=>{A&&!f&&(M?((0,o.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,o.VK)(r.UG+s.xB5),(0,r.wV)(v)))},[v,M,A,f]),k)return(0,m.Y)("button",{ref:N,type:"button",id:"StoryToggler",className:h.A.root,"aria-label":w("AriaStoryTogglerOpen"),onClick:()=>C({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0,children:I.map(e=>(0,m.Y)(u.A,{peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:b[e.id]},e.id))})}))},34458(e,t,n){n.d(t,{$:()=>v,UG:()=>l,wV:()=>f});var o=n(31481),i=n(66644),s=n(19822),a=n(83868),r=n(76023),d=n(2429),c=n(17169);const l=250,u=.25*r.$,h=11,m=.1875*r.$,p=.125*r.$,g=new Set;function f(e){b();const{container:t,toggler:n,leftMainHeader:a,ribbonPeers:r,toggleAvatars:d,sidebar:p}=A(e);if(!(n&&d&&r&&t&&a))return;const{bottom:f,right:v}=a.getBoundingClientRect(),S=f+u,M=p?p.getBoundingClientRect().width:0,N=d[0],k=d[d.length-1],Y=C(N);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===Y;let p=w(n,d),f=h+a+1;if(p||(p=a===r-1?k:N,f=h),!p)return;let{top:A,left:b,width:F}=p.getBoundingClientRect();b-=M;const P=e.getBoundingClientRect(),T=P.left-M,D=P.width;if(T>v)return;b-=m,F+=2*m;const x=b-T,L=A-S,B=F/D;A-=m;const R=T-b+2*m,E=S-A+m,O=D/(F+2*m);(0,i.RK)(()=>{if(!p)return;const n=y(e);let a;f>h?(a=y(p),u&&a.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName),(0,s.ZM)(n,{top:`${S}px`,left:`${T}px`,zIndex:String(f),opacity:a?"0":"",transform:`translate3d(${x}px, ${L}px, 0) scale(${B})`}),a&&(0,s.ZM)(a,{top:`${A}px`,left:`${b}px`,zIndex:String(f)}),t.appendChild(n),a&&t.appendChild(a),p.classList.add("animating"),e.classList.add("animating"),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${R}px, ${E}px, 0) scale(${O})`}):n.classList.add(c.A.ghostRevealName);const r=I(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),p?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)})},l+o.xB5);g.add(r)})})})}function v(e){b();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:d,sidebar:u}=A(e);if(!(n&&a&&r&&t&&d))return;const{right:f}=d.getBoundingClientRect(),v=u?u.getBoundingClientRect().width:0,S=a[0],M=a[a.length-1],N=C(S);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===N;let A=w(n,d),b=h+a+1;if(A||(A=a===r-1?M:S,b=h),!A)return;const k=e.getBoundingClientRect(),Y=k.top,F=k.left-v,P=k.width;let{left:T,width:D,top:x}=A.getBoundingClientRect();if(T-=v,F>f)return;T-=m,D+=2*m;const L=T-F,B=x-Y-p,R=D/P;x-=m;const E=F-T+2*m,O=Y-x+m,U=P/(D+2*m);(0,i.RK)(()=>{const n=y(e);let a;b>h?(a=y(A),u&&a.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName,c.A.ghostRevealName),(0,s.ZM)(n,{top:`${Y}px`,left:`${F}px`,width:`${P}px`,zIndex:String(b)}),a&&(0,s.ZM)(a,{top:`${x}px`,left:`${T}px`,zIndex:String(b),opacity:"0",transform:`translate3d(${E}px, ${O}px, 0) scale(${U})`}),e.classList.add("animating"),A.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${L}px, ${B}px, 0) scale(${R})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(c.A.ghostRevealName);const r=I(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),A.classList.remove("animating")}),g.delete(r)},l+o.xB5);g.add(r)})})})}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),o=t.querySelector("#StoryRibbon"),i=t.querySelector(".left-header"),s=o?.querySelectorAll(`.${d.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:i,ribbonPeers:s,toggleAvatars:a,sidebar:document.getElementById("FoldersSidebar")}}function y(e){const t=e.cloneNode(!0);t.classList.add(c.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=a.A;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function C(e){return e?.getAttribute("data-peer-id")}function w(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function I(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function b(){g.forEach(e=>e()),g.clear()}},46051(e,t,n){n.d(t,{G:()=>o,w:()=>i});const o="video/mp4; codecs=hvc1.1.6.L63.00",i="video/mp4; codecs=avc1.64001E"},92111(e,t,n){n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(11597),d=n(39761),c=n(87679),l=n(58554),u=n(95704),h=n(37836),m=n(46051),p=n(66991);const g={},f=(0,h.v7)(1e3),v=function(e,t){(0,o.vJ)(()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach(e=>{const n=t||(0,i.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await f,e.forEach(({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,u.h)((0,l.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):l.hd(e,t).then(e=>{e&&(t===s.qZ.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout(()=>{(0,d.A)(n),t.removeChild(n)},1e3)}(e),t===s.qZ.BlobUrl&&(0,c.NN)(e))})})})(function(e,t){const n=(0,r._bp)((0,i.mS)(),e);if(!n||!n.orderedIds?.length)return[];const o=function(e,t){const n=e.indexOf(t),o=Math.max(n-5,0),i=Math.min(n+5,e.length);return e.slice(o,i)}(n.orderedIds,t),d=[];return o.forEach(t=>{if(g[e]?.has(t))return;const o=n.byId[t];if(!o||!("content"in o))return;const i=Boolean(o.content.video);d.push({hash:(0,a.EN)(o,"full"),format:i?s.qZ.Progressive:s.qZ.BlobUrl,isStream:i&&(0,p.c)(m.G)}),d.push({hash:(0,a.EN)(o),format:s.qZ.BlobUrl}),o.content.video?.altVideos&&d.push({hash:(0,a.EN)(o,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)}),d}(e,n))})},[t,e])}},59816(e,t,n){n.d(t,{A:()=>F});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(87357),d=n(95807),c=n(39751),l=n(90709),u=n(48899),h=n(76023),m=n(82117),p=n(17712),g=n(93545),f=n(11241);const v="pruw1nLm";var A=n(20021);const y=(0,o.ph)(({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:c})=>{const{sendStoryReaction:v}=(0,i.ko)(),y=(0,o.li)(),[C,w]=(0,o.J0)(1.5*h.$),{peerId:I,id:b,views:S}=e,{reactions:M}=S||{},{reaction:N,isDark:k,isFlipped:Y}=t,F=!(0,u.L8)(I),P=`${(0,l.$_)(I,b)}-${n}-${c?"preview":"viewer"}`,T=(0,o.Kr)(()=>M?.find(e=>(0,l.a0)(e.reaction,N))?.count,[N,M]),D=!c&&Boolean(T)&&F,x=(0,p.A)(()=>{if(!y.current)return;const e=y.current.clientHeight;w(Math.round(.6*e))});(0,m.A)(([e])=>{Boolean(T)!==Boolean(e)&&x()},[T]),(0,g.A)(y,x);const L=(0,p.A)(()=>{v({peerId:I,storyId:b,containerId:P,reaction:N})});return(0,A.FD)("div",{ref:y,className:(0,r.A)(k?"eic2vQ8c":"_7esBA3m",s),style:(0,d.A)(a,`--custom-emoji-size: ${C}px`),onClick:L,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",Y&&"furSXGdL")}),Boolean(C)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",D&&"mFTLUHm2"),reaction:N,containerId:P,size:C,effectSize:4*C,shouldPause:c,shouldLoop:!c}),D&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})});var C=n(61433),w=n(11597),I=n(48894);const b=e=>Boolean("en-US"===navigator.language)?`${Math.round(9*e/5+32)}°F`:`${Math.round(e)}°C`;var S=n(87412);const M=(0,o.ph)((0,i.EK)((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}})(({mediaArea:e,className:t,style:n,restrictedEmoji:i,isPreview:s})=>{const c=(0,o.li)(),[l,u]=(0,o.J0)(0),{temperatureC:h,color:m}=e,f=(0,I.t)(m),v=(0,I.vG)(m),y=(0,p.A)(e=>{if(!c.current)return;const t=c.current,n=t.clientHeight,o=Math.round(.7*n);u(o);const i=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${o}px`,"font-size":n/32+"rem"})};if(e)return i;(0,a.RK)(i)});return(0,o.Nf)(()=>{(0,a.gm)(()=>y(!0))},[]),(0,g.A)(c,()=>y()),(0,A.Y)("div",{ref:c,className:(0,r.A)("KBjMtRUS",t),style:(0,d.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[i&&(0,A.Y)(S.A,{documentId:i.id,size:l,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},i.id),(0,A.Y)("p",{className:"_ke1UBIl",children:b(h)})]})})})),N=9/16,k=new Set(["channelPost","uniqueGift"]);function Y(e,t){const{x:n,y:o,width:i,height:s,rotation:a,radius:r}=e.coordinates;let c="";if(t&&r&&t>0){const e=t*(i/100),n=t*(s/100);c=Math.min(e,n)*(r/100)+"px"}return(0,d.A)(`left: ${n}%`,`top: ${o}%`,`width: ${i}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,c&&`border-radius: ${c}`)}const F=(0,o.ph)(({story:e,isActive:t,className:n,isStoryPlaying:d})=>{const{openMapModal:l,openUniqueGiftBySlug:u,focusMessage:h,closeStoryViewer:m,openUrl:p}=(0,i.ko)(),g=(0,o.li)(),[f,C]=(0,o.J0)(0),w=(0,c.A)();(0,o.vJ)(()=>{if(!g.current)return;const e=g.current;if(C(e.clientWidth),w.width>s.c2m)return void(0,a.RK)(()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")});const t=w.width/w.height,n=t{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${o}px`)})},[t,w]);const I=e.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!t&&"_5HkplWee",n),ref:g,children:I?.map((n,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const e=t&&!k.has(n.type);return(0,A.Y)("div",{className:(0,r.A)(v,e&&"xFjJpeOA"),style:Y(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":l({geoPoint:e.geo});break;case"channelPost":h({chatId:e.channelId,messageId:e.messageId}),m();break;case"url":p({url:e.url});break;case"uniqueGift":u({slug:e.slug})}})(n)})}case"suggestedReaction":return(0,A.Y)(y,{story:e,mediaArea:n,index:o,isPreview:!t,className:v,style:Y(n)},`${n.type}-${o}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:Y(n,f),isPreview:!t||d},`${n.type}-${o}`);default:return}})})})},71331(e,t,n){n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>l,mD:()=>a,n5:()=>d,qI:()=>c,uu:()=>u});var o=n(90709),i=n(21133),s=n(19926);function a(e,t){const n=(0,i.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function d(e,t,n){return r(e,t)?.participants[n]}function c(e){const t=l(e)?.chatId;if(!t)return!1;const n=(0,i.hd)(e,t);return!!n&&((0,o.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function l(e){const{groupCalls:{activeGroupCallId:t}}=e;if(t)return r(e,t)}function u(e){const{phoneCall:t,currentUserId:n}=e;if(!t||!t.participantId||!t.adminId)return;const o=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,o)}function h(e){const t=l(e);if(!t||!t.chatId)return!1;const n=(0,i.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,o.Kl)(n)))return!0;const s=(0,i.AW)(e,n.id)?.inviteLink;return Boolean(s)}},54839(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(19129);function s(e){const t=(0,o.DG)(e);return(0,i.A)(t)}},35749(e,t,n){n.d(t,{A:()=>a});var o=n(77312),i=n(63527);function s(e){return e.messages.webPageById}function a(e,t){const n=(0,i.Ay)(s);if(!e)return;const a=e.content.webPage?.id,r=a?n[a]:void 0;return(0,o.EO)(e,{webPage:r},t)}},84313(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(13439),s=n(96454),a=n(17712),r=n(59030);function d(e,t,n){const{showNotification:d}=(0,i.ko)(),c=(0,r.A)(),[l,u]=(0,o.J0)(!1),h=(0,a.A)(()=>{u(!0),t||d({message:s.yS?c("Video.Unsupported.Mobile"):c("Video.Unsupported.Desktop"),duration:8e3})}),m=(0,a.A)(e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||h())}),p=(0,a.A)(e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||h()});return(0,o.vJ)(()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",m),t.addEventListener("canplay",p),()=>{t.removeEventListener("error",m),t.removeEventListener("canplay",p)}):void 0},[n,e]),l}},23459(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(48899),d=n(37836);const c=new Map;let l=new Set;const u=(0,d.nF)(()=>{const e=Array.from(l),t=e.slice(0,100),n=e.slice(100);(0,i.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach(e=>c.set(e,Date.now())),l=new Set(n),l.size&&u()},500);function h(e){const t=(0,o.Kr)(()=>{const t=(0,i.mS)();return e?.map(e=>(0,a.PVB)(t,e)).filter(Boolean)},[e]),n=(0,o.Kr)(()=>{const e=(0,i.mS)();return t?.filter(t=>{const n=c.get(t.id)||0;if(Date.now()-n<36e5)return!1;if((0,r.L8)(t.id)){const n=t,o=(0,a.K0y)(e,n.id),i=o&&"userStatusEmpty"!==o.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&i}{const n=t,o=(0,a._ls)(e,n.id);return(0,s.WX)(n)&&!o}}).map(e=>e.id)},[t]);(0,o.vJ)(()=>{n?.length&&(n.forEach(e=>l.add(e)),u())},[n])}},31880(e,t,n){n.d(t,{A:()=>m,a:()=>c});var o=n(13439),i=n(11597),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],d=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a,c;if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],c=Object.keys(o).filter(e=>Boolean(o[e]))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,d);a=t||[],c=Object.keys(o).filter(e=>Boolean(o[e]))}const l=(0,o.mS)();return{selectedChatIds:a.filter(e=>(0,i.hds)(l,e)),selectedChatTypes:c}}function l(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:{text:""},includedChatIds:[],excludedChatIds:[]}},h=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:"string"==typeof t.payload?{...e.folder.title,text:t.payload}:{...e.folder.title,...t.payload}},isTouched:!0};case"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,s.Up)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,s.Up)(e.folder,d)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,s.cJ)(e.folder,r),title:e.folder.title?e.folder.title:{text:l(e.includeFilters)},...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,s.cJ)(e.folder,d),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,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"setColor":return{...e,folder:{...e.folder,color:t.payload},isTouched:!0};case"setEmoticon":return{...e,folder:{...e.folder,emoticon:t.payload},isTouched:!0};case"reset":return u;default:return e}},m=()=>(0,a.A)(h,u)},7985(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(66644),s=n(83868),a=n(82117),r=n(17712);const d="no-overscroll",c="no-touch",l={lastDeltas:new Array(7).fill(0),lastAverageDelta:0,isStartedAtTop:!1,resetStartTopAt:void 0,timeout:void 0};function u({containerRef:e,isOverscrolled:t,isDisabled:n,onOverscroll:u,onReset:h}){const[m,p]=(0,o.Ul)("normal"),g=(0,o.li)({...l}),f=(0,o.li)(),v=(0,o.li)(),A=(0,r.A)(()=>{clearTimeout(f.current),p("overscroll"),u?.()}),y=(0,r.A)(()=>{p("animating"),f.current=window.setTimeout(()=>{p("normal")},350),h?.()}),C=(0,r.A)(e=>{clearTimeout(g.current.timeout),g.current.timeout=window.setTimeout(()=>{g.current={...l}},e)}),w=(0,r.A)(t=>{const n=e.current;if(!n||t.defaultPrevented)return;const{deltaY:o}=t,{scrollTop:i}=n,a=m(),r=g.current,d=r.lastAverageDelta,c=0===r.lastDeltas.at(-1)||r.resetStartTopAt&&Date.now()>=r.resetStartTopAt;0===i&&c&&(r.isStartedAtTop=!0,r.resetStartTopAt=void 0);const l=g.current.lastDeltas.slice();l.push(o),l.length>7&&l.shift(),g.current.lastDeltas=l;const u=l.reduce((e,t)=>e+t,0)/l.length;g.current.lastAverageDelta=u;const h=Math.abs(u)-Math.abs(d)>7;return C(100),0===i&&o<0&&"overscroll"!==a?(r.resetStartTopAt||(r.resetStartTopAt=Date.now()+100),void(h&&r.isStartedAtTop&&A())):"animating"===a&&o>0?void(0,s.A)(t):"overscroll"===a&&o>0?(y(),void(0,s.A)(t)):void 0}),I=(0,r.A)(t=>{const n=e.current;if(!n||1!==t.touches.length)return;const{scrollTop:o}=n,i=m();0!==o&&"overscroll"!==i||(v.current=t.touches[0].clientY)}),b=(0,r.A)(t=>{const n=e.current,o=v.current;if(!n||void 0===o||1!==t.touches.length)return;const{scrollTop:i}=n,s=m(),a=t.touches[0].clientY-o;return"animating"!==s?0===i&&a>75&&"overscroll"!==s?(A(),void(v.current=void 0)):"overscroll"===s&&a<-75?(y(),void(v.current=void 0)):void 0:void 0}),S=(0,r.A)(()=>{v.current=void 0});(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.add(d)}),()=>{(0,i.RK)(()=>{t.classList.remove(d)})}},[e,n]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.toggle(c,"normal"!==m())}),()=>{(0,i.RK)(()=>{t.classList.remove(c)})}},[e,n,m]),(0,a.A)(([e])=>{e!==t&&(t||"animating"!==m())&&p(t?"overscroll":"normal")},[t,m,p]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return t.addEventListener("wheel",w,{passive:"normal"===m()}),t.addEventListener("touchstart",I,{passive:!0}),t.addEventListener("touchmove",b,{passive:!0}),t.addEventListener("touchend",S,{passive:!0}),t.addEventListener("touchcancel",S,{passive:!0}),()=>{t.removeEventListener("wheel",w),t.removeEventListener("touchstart",I),t.removeEventListener("touchmove",b),t.removeEventListener("touchend",S),t.removeEventListener("touchcancel",S);const e=g.current;e?.timeout&&clearTimeout(e.timeout)}},[e,w,I,b,S,m,n])}},63988(e,t,n){n.d(t,{D7:()=>c,aG:()=>r,gs:()=>a,tF:()=>d});var o=n(16581),i=n(83414),s=n(672);function a(e,t,n,o=!1){return(0,s.A)(t=>{t(e())},t,n,o)}function r(e,t,n=!1){const o=a(()=>e(),[e],t,n);return(0,i.A)(o,[o,e],!0)}function d(e,t,n,i=!1,s=!1){return(0,o.A)(t=>{t(e())},t,n,i,s)}function c(e,t,n=!1,o=!1){const s=d(()=>e(),[e],t,n,o);return(0,i.A)(s,[s,e],!0)}},88792(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(11597),r=n(53827),d=n(49642),c=n(80853),l=n(82117),u=n(17712),h=n(35297);const m=(e,t,n,m,p,g,f,v=!1,A,y,C=!1,w=!1,I,b=!1,S=!1)=>{const M=(0,o.li)(),[N,k]=(0,o.J0)(!1);let Y=N;const[F,P]=(0,o.J0)(0),T=(0,u.A)(()=>{k(!1),y&&y()});(0,h.A)(()=>{if(!e)return;M.current=(0,r.kz)(e,n,(e,o)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:r,proxy:c}=M.current,l=(0,i.mS)();k(!0),"oneTimeVoice"!==n&&(0,d.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:o,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:d,isFirst:c,isLast:l}=e.current;t={play:()=>{n(a.src)},pause:()=>{o()},stop:()=>{o(),s(0),(0,i.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(a.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(a.currentTime+t,a.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},l()||(t.nexttrack=()=>{r()}),c()||(t.previoustrack=()=>{d()})}return t}(M)),(0,d.HW)("playing");const{audioPlayer:u}=(0,a.nTw)(l),{audioPlayer:h}=l;e(h.volume),r(Boolean(u.isMuted));const m=c.duration&&Number.isFinite(c.duration)?c.duration:t;("voice"===n||m>s.CVm)&&o(u.playbackRate),(0,d.hm)({duration:c.duration||0,playbackRate:c.playbackRate,position:c.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,d.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":k(!1),(0,d.HW)("paused"),I?.();break;case"onTimeUpdate":{const{proxy:e}=M.current;if(b&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;w||P(e.currentTime/n);break}case"onEnded":(0,d.HW)("paused")}p?.[e]?.(o)}},A,T);const{proxy:o}=M.current;N||o.paused||(k(!0),Y=!0),f&&!S&&f(o)},[e]),(0,o.vJ)(()=>{N&&g&&(0,d.D5)(g)},[g,N]);const{play:D,pause:x,setCurrentTime:L,proxy:B,destroy:R,setVolume:E,stop:O,isFirst:U,isLast:K,requestNextTrack:z,requestPreviousTrack:V,setPlaybackRate:j,toggleMuted:G}=M.current??{},J=(0,o.Kr)(()=>B?.duration&&Number.isFinite(B.duration)?B.duration:t,[B?.duration,t]);(0,o.vJ)(()=>{B&&(b&&0===B.currentTime||!J||(0,c.f)(B)||w||P(B.currentTime/J))},[J,F,B,w,b]),(0,o.vJ)(()=>()=>{R?.(C)},[R,C]),(0,l.A)(([e,t])=>{e===v&&m===t||B?.src&&B?.paused||v&&m&&!N&&D?.(m)},[v,m,N,D,B?.src,B?.paused,n]);const q=(0,u.A)(()=>{m&&D?.(m)}),$=(0,u.A)(()=>{N?x?.():q()}),H=(0,u.A)(e=>{L?.(e),J&&B&&P(B.currentTime/J)});return{isPlaying:Y,playProgress:F,playPause:$,pause:x,play:q,stop:O,setCurrentTime:H,setVolume:E,audioProxy:B,duration:J,requestNextTrack:z,requestPreviousTrack:V,isFirst:U,isLast:K,setPlaybackRate:j,toggleMuted:G}}},47067(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(90709),d=n(96115),c=n(63495),l=n(96454),u=n(48899),h=n(87894),m=n(63527),p=n(39351);const g=({chat:e,user:t,folderId:n,isPinned:g,isMuted:f,canChangeFolder:v,isSavedDialog:A,currentUserId:y,isPreview:C,topicIds:w,handleDelete:I,handleMute:b,handleUnmute:S,handleChatFolderChange:M,handleReport:N},k=!1)=>{const{toggleChatPinned:Y,toggleSavedDialogPinned:F,toggleChatArchived:P,markChatMessagesRead:T,markChatUnread:D,openChatInNewTab:x,openQuickPreview:L}=(0,i.ko)(),B=(0,p.A)(),{isSelf:R}=t||{},E=t?.id===a.zv8,O=(0,o.hb)(t=>{if(e?.id)return(0,h.pA)(w||[],n=>[n,(0,d.a1)(t,e?.id,n)])},[e?.id,w]),U=(0,m.LV)(O),K=(0,o.hb)(t=>{if(e?.id)return(0,d.a1)(t,e.id,s.l3)},[e?.id]),z=(0,m.Ay)(K),V=(0,o.Kr)(()=>{if(e)return A?B("Delete"):(0,u.L8)(e.id)||(0,r.IC)(e)?B("DeleteChat"):(0,r.WX)(e)?B("ChannelLeave"):B("GroupLeaveGroup")},[e,A,B]);return(0,o.Kr)(()=>{if(!e||C)return;const o=l.OS&&{title:c.Vq?B("ChatListOpenInNewWindow"):B("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{x(A?{chatId:y,threadId:e.id}:{chatId:e.id})}},i=!A&&!e.isForum&&{title:B("QuickPreview"),icon:"eye-outline",handler:()=>{L({id:e.id})}},s=()=>{A?F({id:e.id}):Y({id:e.id,folderId:n})},a=g?{title:B("ChatListUnpinFromTop"),icon:"unpin",handler:s}:{title:B("ChatListPinToTop"),icon:"pin",handler:s},d=V?{title:V,icon:"delete",destructive:!0,handler:I}:void 0;if(A)return(0,h.oE)([o,i,a,d]);const u=v?{title:B("ChatListContextAddToFolder"),icon:"folder",handler:M}:void 0,m=f?{title:B("ChatsUnmute"),icon:"unmute",handler:S}:{title:`${B("ChatsMute")}...`,icon:"mute",handler:b};if(k)return(0,h.oE)([o,i,a,u,m]);const p=z?.unreadCount||z?.hasUnreadMark||Object.values(U||{}).some(e=>e?.unreadCount)?{title:B("ChatListContextMarkAsRead"),icon:"readchats",handler:()=>T({id:e.id})}:void 0,w=z?.unreadCount||z?.hasUnreadMark||e.isForum?void 0:{title:B("ChatListContextMarkAsUnread"),icon:"unread",handler:()=>D({id:e.id})},O=(0,r.TJ)(e)?{title:B("Unarchive"),icon:"unarchive",handler:()=>P({id:e.id})}:{title:B("Archive"),icon:"archive",handler:()=>P({id:e.id})},K=N&&!t&&((0,r.WX)(e)||(0,r.YE)(e))?{title:B("ReportPeerReport"),icon:"flag",handler:N}:void 0,j=void 0!==n;return(0,h.oE)([o,i,u,p,w,a,!R&&m,!R&&!E&&!j&&O,K,d])},[e,C,B,A,g,V,I,v,M,f,S,b,k,z,U,N,t,n,R,E,y])}},76786(e,t,n){n.d(t,{A:()=>s});var o=n(84051);let i=function(e){return e[e.waitingForNetwork=0]="waitingForNetwork",e[e.syncing=1]="syncing",e[e.online=2]="online",e}({});function s(e,t,n,s,a,r){let d,c,l;return d=function(){const[e,t]=(0,o.J0)(window.navigator.onLine);return(0,o.vJ)(()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}},[]),e}()&&"connectionStateConnecting"!==t?n?i.syncing:i.online:i.waitingForNetwork,c=d===i.online||r?"none":s?"middleHeader":a?"minimized":"overlay",d===i.waitingForNetwork?l=e("WaitingForNetwork"):d===i.syncing&&(l=e("Updating")),"middleHeader"===c&&(l=l.toLowerCase().replace(/\.+$/,"")),{connectionStatus:d,connectionStatusPosition:c,connectionStatusText:l}}},21488(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,i.ko)(),r=(0,o.Kr)(()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}},[t,e]);(0,o.vJ)(()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()},[r,n,t,e])}},8247(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(11597),c=n(79824),l=n(69282),u=n(43874),h=n(74984),m=n(39351),p=n(17712);const g=e=>{const{sidebarMode:t,orderedFolderIds:n,chatFoldersById:g,maxFolders:f,noEmoticons:v,isReadOnly:A}=e,{maxChatLists:y,folderInvitesById:C,maxFolderInvites:w}=A?{}:e,I=(0,m.A)(),{isMobile:b}=(0,u.Ay)(),{openShareChatFolderModal:S,openDeleteChatFolderModal:M,openEditChatFolder:N,openLimitReachedModal:k,markChatMessagesRead:Y,openSettingsScreen:F,setSharedSettingOption:P}=(0,i.ko)(),T=(0,o.Kr)(()=>({id:r.DSF,title:{text:n?.[0]===r.DSF?I("FilterAllChatsShort"):I("FilterAllChats")},includedChatIds:c.p,excludedChatIds:c.p,emoticon:"💬"}),[n,I]),D=(0,o.Kr)(()=>n?n.map(e=>e===r.DSF?T:g[e]||{}).filter(Boolean):void 0,[g,T,n]),x=(0,h.Jm)(),L=(0,p.A)(e=>{const t=x[e];t?.length&&t.forEach(e=>{Y({id:e})})}),B=(0,h.ic)(),R=(0,o.Kr)(()=>{if(D&&D.length)return D.map((e,n)=>{const{id:o,title:c}=e,u=o!==r.DSF&&n>f-1,h=(0,d.w5O)((0,i.mS)(),o),m=[];A||(h&&m.push({title:I("FilterShare"),icon:"link",handler:()=>{Object.values(g).reduce((e,t)=>e+(t.isChatList?1:0),0)>=y&&!e.isChatList?k({limit:"chatlistJoined"}):C[o]?.length>=w?k({limit:"chatlistInvites"}):S({folderId:o})}}),o===r.DSF?(m.push({title:I("FilterEditFolders"),icon:"edit",handler:()=>{F({screen:a.VS.Folders})}}),x[o]?.length&&m.push({title:I("ChatListMarkAllAsRead"),icon:"readchats",handler:()=>L(e.id)})):(m.push({title:I("EditFolder"),icon:"edit",handler:()=>{N({folderId:o})}}),x[o]?.length&&m.push({title:I("ChatListMarkAllAsRead"),icon:"readchats",handler:()=>L(e.id)}),m.push({title:I("FilterMenuDelete"),icon:"delete",destructive:!0,handler:()=>{M({folderId:o})}})),b||(m.push({isSeparator:!0}),m.push({title:I(t?"TabsPositionTop":"TabsPositionLeft"),icon:"forums",handler:()=>{P({foldersPosition:t?"top":"left"})}})));const p={text:c.text,entities:c.entities,noCustomEmojiPlayback:e.noTitleAnimations};let Y=e.emoticon;if(t){p.emojiSize=10;const e=c.entities?.find(e=>e.type===s.C7.CustomEmoji&&0===e.offset);if(e){Y=e;const{offset:t,length:n}=e;p.text=c.text.replace(c.text.substring(t,t+n),""),p.entities=c.entities?.filter(e=>e.offset!==t).map(e=>({...e,offset:e.offset-n}))}}const T=(0,l.fd)(p);return{id:o,title:T,badgeCount:B[o]?.chatsCount,isBadgeActive:Boolean(B[o]?.notificationsCount),isBlocked:u,contextActions:m.length?m:void 0,emoticon:v?void 0:Y,noTitleAnimations:e.noTitleAnimations}})},[D,f,B,I,g,y,C,w,x,A,t,b,v]);return{displayedFolders:D,folderTabs:R}}},11462(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,o.li)(e),n=(0,o.li)(!1),r=(0,i.A)();(0,a.A)(()=>{e&&(t.current=!0)},[e]);const d=(0,s.A)(()=>{t.current=!1,n.current=!1,r()}),c=(0,s.A)(()=>{n.current=!0,r()});return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:d,handleForumPanelAnimationStart:c}}},41316(e,t,n){n.d(t,{A:()=>i});var o=n(84051);function i(e){const[t,n]=(0,o.Ul)();return(0,o.vJ)(()=>{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:i}=o;(i instanceof Element?i:i.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,n]),t}},2178(e,t,n){n.d(t,{v:()=>r});var o=n(84051),i=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,i.h)();function r(e){(0,o.vJ)(()=>{if(!e)return;const t=Object.entries(e);return a.addCallback(function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach(([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:o,meta:i,mod:s,shift:a,key:r}=e,{altKey:d,ctrlKey:c,metaKey:l,shiftKey:u,key:h}=t;if(n!==d)return!1;if(s){if(!c&&!l)return!1}else{if(o!==c)return!1;if(i!==l)return!1}return a===u&&Boolean(r&&(h.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.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)})(t)(e)&&n(e)})})},[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},38218(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(17712);const s=function({onClick:e,onStart:t,onEnd:n,threshold:s=250}){const a=(0,o.li)(!1),r=(0,o.li)(!1),d=(0,o.li)(void 0),c=(0,i.A)(e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!r.current&&n&&(r.current=!0,d.current=window.setTimeout(()=>{t?.(),a.current=!0},s))}),l=(0,i.A)(t=>{r.current&&(a.current?n?.():e?.(t),u())}),u=(0,i.A)(()=>{a.current=!1,r.current=!1,window.clearTimeout(d.current)});return(0,o._W)(()=>{window.clearTimeout(d.current)}),{onMouseDown:c,onMouseUp:l,onMouseLeave:l,onTouchStart:c,onTouchEnd:l}}},69419(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(23174),s=n(11597),a=n(96454),r=n(58554),d=n(63527),c=n(30857),l=n(672),u=n(14745);function h(e,t=!1,n=i.qZ.BlobUrl,h,m=!1){const p=a.Uz&&n===i.qZ.Progressive,g=e?p&&!t?r.RB(e):r.Ih(e):void 0,f=(0,c.A)(),v=(0,d.Ay)(s.nIz),A=(0,u.A)(),[y,C]=(0,o.J0)(g&&!p?1:0),w=(0,o.li)(),I=(0,l.A)(e=>{w.current&&A&&(!h||Date.now()-w.current>h)&&C(e)},[h,A],500,!0);return(0,o.vJ)(()=>{!t&&e&&(g?p&&setTimeout(()=>{C(.75)},1500):(C(0),w.current&&r.ch(I),w.current=Date.now(),r.hd(e,n,m,I,A).then(()=>{const e=Date.now()-w.current;w.current=void 0,!h||e>=h?f():setTimeout(f,h-e)})))},[t,e,g,n,p,h,I,m,A,v]),(0,o.vJ)(()=>{t&&w.current&&(r.ch(I),C(0),w.current=void 0)},[I,t]),(0,o.vJ)(()=>()=>{e&&r.Cn(e,A)},[A,e]),{mediaData:g,loadProgress:y}}},36680(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(96454),s=n(17712);let a;function r(e,t,n=250,r=!1){const d=(0,o.li)(!1),c=(0,s.A)(()=>{d.current=!0});return(0,o.vJ)(()=>{a&&(clearTimeout(a),a=void 0),!e||i.TF||r||(a=window.setTimeout(()=>{d.current||t()},2*n))},[r,e,n,t]),[(0,s.A)(()=>{d.current=!0}),(0,s.A)(()=>{d.current=!1,a&&(clearTimeout(a),a=void 0),a=window.setTimeout(()=>{d.current||t()},n)}),c]}},93855(e,t,n){n.d(t,{A:()=>f});var o=n(84051),i=n(13439),s=n(31481),a=n(90709),r=n(11597),d=n(87679),c=n(24909),l=n(4350),u=n(63527),h=n(32625),m=n(17712),p=n(62587),g=n(672);function f(e){const t=Boolean(e)&&(0,i.mS)().auth.rememberMe,n=(0,u.Ay)(r.nIz),[f,v]=(0,o.J0)(()=>(0,l.zk)()),A=e&&(0,a.cP)(e),y=(0,p.A)(A,!t),C=(0,g.A)(()=>{v((0,l.zk)())},[],1e3);(0,o.vJ)(()=>{if(!t||!n)return;const o="regular"===e.color?.type?e.color.color:void 0;(0,l.Ph)(l.Xz,{userId:e.id,firstName:e.firstName,lastName:e.lastName,emojiStatusId:e.emojiStatus?.documentId,color:o,isPremium:e.isPremium,phone:e.phoneNumber}),C()},[t,e?.emojiStatus?.documentId,e?.firstName,e?.id,e?.lastName,e?.color,e?.isPremium,e?.phoneNumber,C,n]);const w=(0,m.A)(async(e,t)=>{const n=await(0,c.y)(e,72,72),o=await(0,d.NN)(n);if(t?.aborted)return;const i=document.createElement("canvas"),s=i.getContext("2d");i.width=o.width,i.height=o.height,s.drawImage(o,0,0);const a=i.toDataURL("image/png");(0,l.Ph)(l.Xz,{avatarUri:a}),C()});return(0,o.vJ)(()=>{if(!y||!t||!n)return;const e=new AbortController;return w(y,e.signal),()=>{e.abort()}},[y,n,t]),(0,h.A)(C,6e4),(0,o.vJ)(()=>{function e(e){e.key?.startsWith(s.um6)&&C()}return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[C]),f}},23565(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,o.li)(),d=(0,i.A)(),c=null!=e,l=null!=n;return c&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)(()=>{t&&!c&&l&&!r.current&&(r.current=window.setTimeout(()=>{r.current=void 0,d()},t))},[t,d,c,l]),r.current&&t&&!c?n:e}},42215(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(30857);function s(e,t){const n=(0,i.A)(),s=(0,o.li)(e),a=(0,o.li)(t),r=(0,o.hb)(e=>(a.current=s.current(a.current,e),n(),a.current),[]);return[a.current,r]}},47366(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(17712);function s(e=5){const[t,n]=(0,o.J0)(!0),[s,a]=(0,o.J0)(!0);return{isAtBeginning:t,isAtEnd:s,handleScroll:(0,i.A)(t=>{const{scrollHeight:o,scrollTop:i,clientHeight:s}=t.target;n(i{if(!t)return n(!0),void a(!0);const{scrollHeight:o,scrollTop:i,clientHeight:s}=t;n(ir});var o=n(84051),i=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,o.Kr)(()=>(0,a.nF)(n=>{e&&t&&(0,i.ko)().sendMessageAction({chatId:e,threadId:t,action:n})},s.cqp),[e,t])},66991(e,t,n){n.d(t,{Y:()=>l,c:()=>u});var o=n(84051),i=n(31481),s=n(66644),a=n(19822),r=n(39761),d=n(96454),c=n(95704);function l(e,t,n){return(0,o.vJ)(()=>{if(!t||!e.current)return;const o=p(),i=e.current;if(!d.Yw||!n||!o?.isTypeSupported(n))return;const l=new o;function u(){if(!t||!n)return;const e=l.addSourceBuffer(n),o=(0,c.h)(t);e.addEventListener("updateend",function(){o.next().then(({value:t,done:n})=>{"open"===l.readyState&&(n?m(l):h(e,t))})}),o.next().then(({value:t,done:n})=>{n||"open"!==l.readyState||((0,s.RK)(()=>{i.style.display="block",setTimeout(()=>{(0,s.RK)(()=>{(0,a.ZM)(i,{opacity:"1"})})},100)}),h(e,t))})}return l.addEventListener("sourceopen",u,{once:!0}),(0,s.RK)(()=>{(0,a.ZM)(i,{display:"none",opacity:"0"}),i.src=URL.createObjectURL(l)}),()=>{(0,s.RK)(()=>{const e=i.src;(0,r.A)(i),l.removeEventListener("sourceopen",u),"open"===l.readyState&&m(l),URL.revokeObjectURL(e)})}},[n,t,e]),u(n)}function u(e){return!(!d.Yw||!e)&&Boolean(p()?.isTypeSupported(e))}function h(e,t){try{e.appendBuffer(t)}catch(e){i.Oig&&console.warn("[Stream] failed to append buffer",e)}}function m(e){try{e.endOfStream()}catch(e){i.Oig&&console.warn("[Stream] failed to end stream",e)}}function p(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},52603(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(31481),s=n(96454),a=n(9705),r=n(5130);let d,c;const l=new a.A;function u(){return Boolean(c||d)}function h(e,t,n){const[s,a]=(0,o.J0)(),r=(0,o.li)();return(0,o.vJ)(()=>{if(t||n&&!n()||r.current===e)return;let o=!1;return e?(async function(e,t=.2){if(u()||await l.promise,c)try{const n=(await c.detect(e))[0];if(!n||"und"===n.detectedLanguage||!n.confidence||n.confidence{o||a(e)}).finally(()=>{o||(r.current=e)}),()=>{o=!0}):(a(void 0),void(r.current=void 0))},[t,e,n]),s}s.CM&&setTimeout(async function(){if(!u()){if(s.zf)try{return c=await LanguageDetector.create(),void l.resolve()}catch(e){i.Oig&&console.error("Failed to initialize language detector: ",e)}d||(d=(0,r.U)(new Worker(new URL(n.p+n.u(667),n.b))),l.resolve())}},4e3)},60138(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,o.vJ)(()=>(0,i.yu)(t),[t])}},90423(e,t,n){n.d(t,{Ay:()=>r,j9:()=>l,zk:()=>d});var o=n(84051),i=n(63495),s=n(96454);const a=c();function r(e,t,n){const[i,r]=(0,o.J0)(Boolean(a&&document[a]));return(0,o.Nf)(()=>{const o=e.current,i=()=>{const e=Boolean(a&&document[a]);r(e),e?n?.(!1):t?.(!1),o instanceof HTMLVideoElement&&(o.controls=e)},s=()=>{r(!0),n&&n(!0)},d=()=>{r(!1),t&&t(!1)};return document.addEventListener("fullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),o&&(o.addEventListener("webkitbeginfullscreen",s,!1),o.addEventListener("webkitendfullscreen",d,!1)),()=>{document.removeEventListener("fullscreenchange",i,!1),document.removeEventListener("webkitfullscreenchange",i,!1),document.removeEventListener("mozfullscreenchange",i,!1),o&&(o.removeEventListener("webkitbeginfullscreen",s,!1),o.removeEventListener("webkitendfullscreen",d,!1))}},[]),a||s.pz?[i,()=>{var t;e.current&&(a||s.pz)&&!i&&((t=e.current).requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen(),r(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),r(!1))}]:[!1]}const d=()=>{const[e,t]=(0,o.J0)(!1);return(0,o.vJ)(()=>{const e=()=>{t(l())};let n;return i.Vq&&(window.tauri?.getCurrentWindow().then(e=>{e.isFullscreen().then(t)}),(async()=>{const e=await(window.tauri?.getCurrentWindow());n=await e.onResized(()=>{e.isFullscreen().then(t)})})()),document.addEventListener("fullscreenchange",e,!1),document.addEventListener("webkitfullscreenchange",e,!1),document.addEventListener("mozfullscreenchange",e,!1),()=>{n?.(),document.removeEventListener("fullscreenchange",e,!1),document.removeEventListener("webkitfullscreenchange",e,!1),document.removeEventListener("mozfullscreenchange",e,!1)}},[]),e};function c(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function l(){const e=c();return Boolean(e&&document[e])}},5130(e,t,n){n.d(t,{U:()=>a});var o=n(14235),i=n(37836);class s{requestStates=new Map;requestStatesByCallback=new Map;pendingPayloads=[];pendingTransferables=[];constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n}destroy(){}init(...e){this.postMessageOnTickEnd({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,{transferables:i,...s}=e,a=(0,o.A)(),r={type:"callMethod",messageId:a,...s},d={messageId:a},c=new Promise((e,t)=>{Object.assign(d,{resolve:e,reject:t})});if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();d.callback=e,n.set(e,d)}return t.set(a,d),c.catch(()=>{}).finally(()=>{t.delete(a),d.callback&&n.delete(d.callback)}),this.postMessageOnTickEnd(r,i),c}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessageOnTickEnd({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;e.channel===n&&e.payloads.forEach(e=>{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){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)})}postMessageOnTickEnd(e,t){this.pendingPayloads.push(e),t&&this.pendingTransferables.push(...t),this.postMessagesOnTickEnd()}postMessagesOnTickEnd=(0,i.Fe)(()=>{const{channel:e}=this,t=this.pendingPayloads,n=this.pendingTransferables;this.pendingPayloads=[],this.pendingTransferables=[],this.target.postMessage({channel:e,payloads:t},n)})}function a(e,t,n){const o=new s(e,t,n);function i({data:e}){o.onMessage(e)}return e.addEventListener("message",i),o.destroy=()=>{e.removeEventListener("message",i)},o}},53827(e,t,n){n.d(t,{_K:()=>g,dj:()=>A,kz:()=>f});var o=n(13439),i=n(89925),s=n(11597),a=n(96454),r=n(60343),d=n(80853),c=n(41733);const l=new Map;let u,h=[],m=[];function p(e,t){const n=u&&l.get(u);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const a=v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin||i.d9.Inline,t);if(!a)return;if(!l.has(a))return void(0,o.ko)().openAudioPlayer((0,r.ES)(y(a).messageKey));const d=l.get(a);d.onForcePlay&&d.onForcePlay(),u=a,d.audio.src&&(0,c.A)(d.audio)}function g(){const e=u&&l.get(u);e&&e.audio.pause()}function f(e,t,n,g,f){if(!l.has(e)){const n=function(e,t,n,o){const i=new Audio;function s(t){return n=>{l.has(e)&&((0,d.f)(i)||l.get(e).handlers.forEach(e=>{e(t,n)}))}}return i.addEventListener("timeupdate",s("onTimeUpdate")),i.addEventListener("play",s("onPlay")),i.addEventListener("pause",s("onPause")),i.addEventListener("loadstart",s("onLoadStart")),i.addEventListener("loadeddata",s("onLoadedData")),i.addEventListener("playing",s("onPlaying")),i.addEventListener("ended",()=>{l.has(e)&&((0,d.f)(i)||p(e))}),{audio:i,type:t,proxy:new Proxy(i,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(e,t,g,f);l.set(e,n),function(e,t){"audio"!==e.type||m.includes(t)||(m.push(t),m.sort(C)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(C))}(n,e)}const{audio:A,proxy:w,handlers:I}=l.get(e);return I.push(n),{play(n){if(!A.paused)return;const p=u&&l.get(u);p&&u!==e&&(p.audio.pause(),p.audio.currentTime=0,(0,d.f)(p.audio)&&(p.audio.dataset.preventPlayAfterPatch="true"),p.onTrackChange&&p.onTrackChange()),u=e,A.src||(A.src=n,A.preload="auto",n.includes("/progressive/")&&a.Yw&&(delete A.dataset.preventPlayAfterPatch,(0,d.C)(A))),(0,c.A)(A),function(e,t){if((0,s.nTw)((0,o.mS)()).globalSearch.currentContent===i.$C.Music)return;const{chatId:n}=(0,r.ES)(y(t).messageKey),a=(0,s.Xf0)((0,o.mS)())?.chatId,d=e=>e.startsWith(`msg${n}`)||a&&e.startsWith(`msg${a}`);"audio"===e&&(m=m.filter(d)),"voice"===e&&(h=h.filter(d))}(t,e)},pause(){u===e&&A.pause()},stop(){if(u===e){const e=A.src;A.pause(),A.addEventListener("pause",()=>{A.src="",A.src=e},{once:!0})}},setCurrentTime(t){u===e&&(A.fastSeek?A.fastSeek(t):A.currentTime=t)},setVolume(t){u===e&&(A.volume=t,A.muted=!1)},setPlaybackRate(t){u===e&&(A.playbackRate=t)},toggleMuted(e){A.muted=void 0===e?!A.muted:e},proxy:w,requestNextTrack(){p(e)},isLast:()=>!v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin),isFirst:()=>!v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){p(e,!0)},destroy(t=!1){const o=l.get(e);o&&(o.handlers=o.handlers.filter(e=>e!==n),o.handlers.length||(o.audio.pause(),l.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(m=m.filter(n)),"voice"===e.type&&(h=h.filter(n))}(o,e),e===u&&(u=void 0)))}}}function v(e,t=i.d9.Inline,n){const o=function(e){switch(e.type){case"audio":return m;case"voice":return h;default:return}}(l.get(e));if(!o)return;if(t===i.d9.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:s}=(0,r.ES)(y(e).messageKey),a=o.filter(e=>e.startsWith(`msg${s}`)),d=a.indexOf(e);if(d<0)return;let c=t===i.d9.Inline?-1:1;return n&&(c*=-1),a[d+c]}function A(e){const t=(0,r.AD)(e);if(t)return`${t}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=y(e),{date:i,messageKey:s}=y(t),a=i-n;return 0===a?s.localeCompare(o):a}},85679(e,t,n){function o(e,t){return Boolean(t?.contentWindow&&e.source===t.contentWindow)}n.d(t,{S:()=>o})},67054(e,t,n){function o(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>o})},95362(e,t,n){n.d(t,{A:()=>a});var o=n(37836);let i=[],s=!1;function a(e,t){i.push({url:e,filename:t}),s||(s=!0,setTimeout(async()=>{await async function(){let e=0;for(const t of i)r(t),e++,10===e&&(await(0,o.v7)(1e3),e=0);i=[]}(),s=!1},1e3))}function r({url:e,filename:t}){const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.download=t;try{n.click()}catch(e){console.error(e)}}},75956(e,t,n){n.d(t,{W:()=>a,d:()=>r});var o=n(37836);let i,s=!1;const a=(0,o.sg)((e,t=!1)=>{i&&(clearTimeout(i),i=void 0),s?s=!1:i=window.setTimeout(()=>{t&&(s=!0),e()},500)},50,!1);function r(){i&&(clearTimeout(i),i=void 0)}},36353(e,t,n){n.d(t,{A:()=>i});var o=n(96454);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),s=document.createRange(),a=e.lastChild||e;o.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),i.removeAllRanges(),i.addRange(s)):e.focus()}},98021(e,t,n){n.d(t,{E6:()=>o,FQ:()=>i});const o={"🗂":"folder-tabs-folder","⭐":"folder-tabs-star","🤖":"folder-tabs-bot","👥":"folder-tabs-group","👤":"folder-tabs-user","✅":"folder-tabs-chat","📢":"folder-tabs-channel","💬":"folder-tabs-chats"},i=e=>o[e]},24909(e,t,n){n.d(t,{s:()=>i,y:()=>s});var o=n(48894);function i(e,t,n="image/png"){const o=e instanceof Blob?URL.createObjectURL(e):e,i=new Image;return new Promise(s=>{i.onload=()=>{a(i,i.width*t,i.height*t,n).then(e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)}).then(s).finally(()=>{e instanceof Blob&&URL.revokeObjectURL(o)})},i.src=o})}function s(e,t,n,o="image/png"){const i=e instanceof Blob?URL.createObjectURL(e):e,s=new Image;return new Promise(r=>{s.onload=()=>{a(s,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(i)})},s.src=i})}async function a(e,t,n,i="image/png"){if(!("createImageBitmap"in window))return r(e,t,n,void 0,i);try{const s=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(s.height!==n||s.width!==t)throw new Error("Image bitmap resize not supported!");const a=await(0,o.rX)(e.src),r=(0,o.LS)(a)<240?"#fff":"#000";return await new Promise(e=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const n=t.getContext("2d");n.fillStyle=r,n.fillRect(0,0,t.width,t.height);const o=t.getContext("bitmaprenderer");o?o.transferFromImageBitmap(s):n.drawImage(s,0,0),t.toBlob(e,i)})}catch(o){return r(e,t,n,void 0,i)}}async function r(e,t,n,i=.5,s="image/png"){const a=document.createElement("canvas"),r=a.getContext("2d"),d=document.createElement("canvas"),c=d.getContext("2d");if(a.width=t,a.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(d.width=o.width,d.height=o.height,c.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)},c.drawImage(d,0,0,o.width*n,o.height*n,0,0,o.width,o.height);r.drawImage(d,0,0,o.width,o.height,0,0,a.width,a.height)}else r.drawImage(e,0,0,a.width,a.height);const l=await(0,o.rX)(e.src),u=(0,o.LS)(l)<240?"#fff":"#000";return r.fillStyle=u,r.globalCompositeOperation="destination-over",r.fillRect(0,0,a.width,a.height),new Promise(e=>{a.toBlob(e,s)})}},41074(e,t,n){n.d(t,{Ay:()=>r,M1:()=>d,bP:()=>s});var o=n(31481),i=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return o.W75?[]:(a||(a=new Array(s).fill(void 0).map(()=>{const e=new Worker(new URL(n.p+n.u(6805),n.b));return{worker:e,connector:(0,i.U)(e,void 0,"media")}})),a)}function d(e,t){return r()[t].connector.request(e)}},47526(e,t,n){n.d(t,{KE:()=>d,PP:()=>c,_u:()=>r,zS:()=>a});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"},i=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"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t,n=15){const{lat:i,long:s}=t,a=o[e];switch(e){case"google":return`${a}/place/${i}+${s}/@${i},${s},${n}z`;case"bing":return`${a}?cp=${i}~${s}&lvl=${n}&sp=point.${i}_${s}`;case"apple":return`${a}?q=${i},${s}`;default:return`${a}/?mlat=${i}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function d(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function c(e){return e?i.get(e)||i.get(e.split("/")[0])||s[t=e,t.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%s.length]:"#008df2";var t}},49642(e,t,n){n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>d,MV:()=>i,hm:()=>c,wp:()=>l});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 i(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach(([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}})}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function d(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(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 l({title:e,artist:t,album:n,artwork:o}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:o})}},37830(e,t,n){n.d(t,{A:()=>s});var o=n(87894);const i=new WeakMap;function s(e){return(...t)=>{const n=i.get(e);if(n&&(0,o.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return i.set(e,{lastArgs:t,lastResult:s}),s}}},95704(e,t,n){n.d(t,{h:()=>d});var o=n(23174),i=n(4875);const s=new Map,a=new Map,r=new Map;async function*d(e,t=0,n=262144){const d=e.match(/fileSize=(\d+)/);let c;for(c=d?d&&Number(d[1]):a.get(e);;){if(c&&t>=c)return;let d=t+n-1;c&&d>c&&(d=c-1);const l=`${e}:${t}-${d}`;let u=s.get(l);if(!u){let n=r.get(l);n||(n=(0,i.px)("downloadMedia",{mediaFormat:o.qZ.Progressive,url:e,start:t,end:d}),r.set(l,n));const h=await n.finally(()=>{r.delete(l)});if(!h?.arrayBuffer)return;h.fullSize&&!c&&(c=h.fullSize,a.set(e,h.fullSize)),u=h.arrayBuffer,d<=5242879&&s.set(l,h.arrayBuffer)}yield u,t=d+1}}},39074(e,t,n){n.d(t,{DY:()=>d,JC:()=>a,LV:()=>s,oR:()=>i,vZ:()=>r});const o=document.createElement("div");function i(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),i=o.lastChild;n.insertNode(o),i?(n.setStartAfter(i),n.setEndAfter(i)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const i=n.getRangeAt(0).cloneRange();return i.intersectsNode(e)?t||e.contains(i.commonAncestorContainer)?(i.collapse(!0),i.setStart(e,0),o.innerHTML="",o.appendChild(i.cloneContents()),o.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),i=o.cloneRange();return i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),t=i.toString().length,t}function r(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=r(n,t)))return-1;return t}function d(){const e=window.getSelection();e?.removeAllRanges()}},52844(e,t,n){let o;function i(e="*",t,n=!1){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,{p:()=>i})},2429(e,t,n){n.d(t,{A:()=>o});const o={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},17169(e,t,n){n.d(t,{A:()=>o});const o={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},38353(e,t,n){n.d(t,{A:()=>o});const o={background:"LzylDSXD",customBgImage:"iBGWkDsW",customBgColor:"HnpqkkHj",withTransition:"V96TOnoY",blurred:"K_W7XNrk",withRightColumn:"EiMC9Ymb"}},89755(e,t,n){e.exports=n.p+"encoderWorker.min.41c911dd9e2bbe20c518.js"},56534(e,t,n){e.exports=n.p+"map-pin.899635f6fe777c28998a.svg"},72078(e,t,n){e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},68153(e,t,n){e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},65741(e,t,n){e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},45318(e,t,n){e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"}}]); //# sourceMappingURL=3952.668580de461b6bd3c4cf.js.map