TelegramPWA/dist/8013.091a25ce0ea50fd3fb5c.js
Alexander Zinchuk fb411a3125 [Build]
2025-06-04 20:43:36 +02:00

2 lines
334 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[8013],{45:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(84051),o=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 c=(0,i.ph)((({status:e})=>(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(o.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}`})})})))},285:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(90709),a=n(29807),r=n(4961),c=n(59030),d=n(94189),l=n(20021);const u=(0,i.ph)((0,o.EK)(((e,{userId:t})=>{const n=(0,a.meB)(e),i=t&&(0,a.mBe)(e,t);return{chat:n,contactName:i?(0,s.u0)(i):void 0}}))((({isOpen:e,chat:t,userId:n,contactName:s,onClose:a})=>{const{deleteChatMember:u}=(0,o.ko)(),h=(0,c.A)(),m=(0,i.hb)((()=>{u({chatId:t.id,userId:n}),a()}),[t,u,a,n]);if(t&&n)return(0,l.Y)(d.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})})))},2178:(e,t,n)=>{n.d(t,{v:()=>r});var i=n(84051),o=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,o.h)();function r(e){(0,i.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:i,meta:o,mod:s,shift:a,key:r}=e,{altKey:c,ctrlKey:d,metaKey:l,shiftKey:u,key:h}=t;if(n!==c)return!1;if(s){if(!d&&!l)return!1}else{if(i!==d)return!1;if(o!==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")},i=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!i.includes(e)))}}(e),t)})(t)(e)&&n(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},2429:(e,t,n)=>{n.d(t,{A:()=>i});const i={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},3225:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(16120),c=n(96454),d=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=300,A=new RegExp(`(${r.A.source})$`,"g"),y=new RegExp(`${s.bpX.source}$`,"g");function C(e,t,n,C,w,b){const{loadCustomEmojiForEmoji:I,clearCustomEmojiForEmoji:S}=(0,o.ko)(),[M,N,k]=(0,g.A)(!1),Y=(0,h.gs)((()=>{const n=t();if(!e||!n||!C()?.collapsed)return;if(!n.match(c.TL?r.A:s.bpX))return;const i=(0,l.LV)(w.current);return i.match(c.TL?A:y)?.[0]}),[t,C,w,e],v),P=(0,m.A)(Y,[Y,t,C],!0),F=(0,p.A)((()=>Boolean(P())),[P]),T=Boolean(b?.length);(0,i.vJ)((()=>{if(!e||!F)return;const t=P();if(t){if(!T){const e=c.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&I({emoji:e})}}else S()}),[e,F,P,T,S,I]);const x=(0,f.A)((t=>{const i=P();if(!e||!i)return;const o=w.current,s=(0,l.LV)(o),r=c.TL?i:i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/i.length,p=s.replace(h,(0,u.hB)(t).repeat(m)),g=o.innerHTML.substring(s.length);n(`${p}${g}`),(0,a.Uz)((()=>{(0,d.A)(o,!0,!0)}))}));return(0,i.vJ)(k,[k,t]),{isCustomEmojiTooltipOpen:Boolean(F&&T&&!M),closeCustomEmojiTooltip:N,insertCustomEmoji:x}}},5130:(e,t,n)=>{n.d(t,{U:()=>a});var i=n(14235),o=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:o,...s}=e,a=(0,i.A)(),r={type:"callMethod",messageId:a,...s},c={messageId:a},d=new Promise(((e,t)=>{Object.assign(c,{resolve:e,reject:t})}));if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();c.callback=e,n.set(e,c)}return t.set(a,c),d.catch((()=>{})).finally((()=>{t.delete(a),c.callback&&n.delete(c.callback)})),this.postMessageOnTickEnd(r,o),d}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,o.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 i=new s(e,t,n);function o({data:e}){i.onMessage(e)}return e.addEventListener("message",o),i.destroy=()=>{e.removeEventListener("message",o)},i}},9442:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(23174),a=n(66644),r=n(90709),c=n(70636),d=n(36353),l=n(87894),u=n(39074),h=n(17778),m=n(63988),p=n(83414),g=n(37661),f=n(39351),v=n(17712);const A=300;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,b,I,S,M){const N=(0,f.A)(),[k,Y]=(0,i.J0)(),[P,F,T]=(0,g.A)(!1),x=(0,m.gs)((()=>{const n=t();if(!e||!C()?.collapsed||!n.includes("@"))return;const i=(0,u.LV)(b.current);return(0,h.S)(i).match(y)?.[0].trim()}),[e,t,C,b],A),D=(0,p.A)(x,[x,t,C],!0),E=(0,p.A)((()=>e&&t().startsWith("@")),[t,e]);(0,i.vJ)((()=>{const e=D();if(!e||!I&&!S)return void Y(void 0);const t=(0,o.mS)().users.byId;if(!t)return void Y(void 0);const n=I?.reduce(((e,t)=>(t.userId!==M&&e.push(t.userId),e)),[]),i=e.substring(1),s=(0,c.PU)({ids:(0,l.Am)([...E()&&S||[],...n||[]]),query:i,type:"user"});Y(Object.values((0,l._E)(t,s)))}),[M,I,S,D,E]);const L=(0,v.A)(((e,t=!1,i=!1)=>{if(!e.hasUsername&&!(0,c.F9)(N,e))return;const o=(0,r.Kl)(e),l=(0,c.F9)(N,e)||"",h=o?`@${o}`:`<a\n class="text-entity-link"\n data-entity-type="${s.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${l}</a>`,m=b.current,p=w((0,u.LV)(m)),g=i?p.length:p.lastIndexOf("@"),f=(o?o.length+1:l.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${h}&nbsp;`,i=w(m.innerHTML).substring(p.length),o=(0,u.JC)(m);n(`${e}${i}`),(0,a.Uz)((()=>{const e=o+f+1;(0,d.A)(m,t),e>=0&&(0,u.vZ)(m,e)}))}Y(void 0)}));return(0,i.vJ)(T,[T,t]),{isMentionTooltipOpen:Boolean(k?.length&&!P),closeMentionTooltip:F,insertMention:L,mentionFilteredUsers:k}}function w(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},9717:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(87894),s=n(79882),a=n(73767);function r(e,t){const n=(0,i.Kr)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),r=(0,a.A)(n),c=(0,a.A)(t),d=(0,i.Kr)((()=>n&&r&&t===c?(0,o.LG)(n,((e,t)=>void 0!==r[t]?e-r[t]:-1/0)):{}),[t,n,c,r]);return{orderDiffById:d,getAnimationType:(0,s.W)(d)}}},10221:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(84051),o=n(66644),s=n(76023),a=n(17712);const r=s.$;function c({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:c,id:d}){const l=(0,a.A)((()=>{const i=t.current,a=e.current;if(!i||!a)return;const c=a.getBoundingClientRect(),d=i.getBoundingClientRect(),l=window.innerWidth;(0,o.RK)((()=>{const e=c.top+c.height/2,t=c.bottom,o=s?t:e;i.style.top=o-d.height/2+"px",n?i.style.left=c.left-r+"px":i.style.right=l-c.right-r+"px"}))}));return(0,i.vJ)((()=>{c||l()}),[c,d]),(0,i.vJ)((()=>{if(c)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",l,{passive:!0}),()=>{t.removeEventListener("scroll",l)}):void 0}),[c,e]),l}},11359:(e,t,n)=>{n.d(t,{L:()=>o});const i=5;function o(e,t){const{commonAncestorContainer:n}=e;let o=n,s=1;for(;o&&o.id!==t&&s<i;)o=o.parentElement,s++;return Boolean(o&&o.id===t)}},11462:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,i.li)(e),n=(0,i.li)(!1),r=(0,o.A)();(0,a.A)((()=>{e&&(t.current=!0)}),[e]);const c=(0,s.A)((()=>{t.current=!1,n.current=!1,r()})),d=(0,s.A)((()=>{n.current=!0,r()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:c,handleForumPanelAnimationStart:d}}},14647:(e,t,n)=>{n.d(t,{A:()=>D});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(29807),c=n(87357),d=n(46275),l=n(58849),u=n(4961),h=n(35127),m=n(87094),p=n(43874),g=n(21488),f=n(39351),v=n(17712),A=n(59030),y=n(65240),C=n(44589),w=n(39877),b=n(86070),I=n(84685),S=n(82855),M=n(64493),N=n(70297),k=n(51644),Y=n(25477),P=n(66833),F=n(40558);var T=n(20021);const x=(0,i.ph)((({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:o})=>{const s=(0,i.li)(),{backdrop:a,model:r,pattern:c}=(0,P.uc)(e),d=[a.centerColor,a.edgeColor];return(0,T.FD)("div",{className:"LaOdPURl",onClick:o,children:[(0,T.Y)("div",{className:"zDnMa37m",children:(0,T.Y)(F.A,{className:"EdXfeKWY",backgroundColors:d,patternColor:a.patternColor,patternIcon:c.sticker})}),(0,T.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,T.Y)(S.A,{containerRef:s,sticker:r.sticker,size:120,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})})),D=(0,i.ph)((0,o.EK)((e=>({canPlayAnimatedEmojis:(0,r.BWX)(e)})))((({message:e,noAvatars:t,canAutoLoad:n,canAutoPlay:r,inPreview:P,asForwarded:F,isDownloading:D=!1,isProtected:E,isConnected:L,story:B,theme:R,backgroundEmojiId:O,shouldWarnAboutSvg:U,autoLoadFileMaxSizeMb:z,lastPlaybackTimestamp:K,isEditing:j,observeIntersectionForLoading:V,observeIntersectionForPlaying:J,onMediaClick:$,onDocumentClick:q,onContainerClick:G,onAudioPlay:H,onCancelMediaTransfer:W})=>{const{openUrl:_,openTelegramLink:Q}=(0,o.ko)(),Z=(0,a.T_)(e),{isMobile:X}=(0,p.Ay)(),ee=(0,i.li)(),te=(0,A.A)(),ne=(0,f.A)(),ie=(0,v.A)((()=>{$()})),oe=(0,v.A)((e=>{G?.(e)})),se=(0,v.A)((()=>{Z&&Q({url:Z.url})})),{story:ae,stickers:re}=Z||{};(0,g.A)(ae?.peerId,ae?.id,B);const ce=re?.isWithTextColor||re?.documents?.[0]?.shouldUseTextColor,de=(0,m.A)(ee,void 0,!ce),le=(0,i.Kr)((()=>{const e=Z?.url&&(0,d.vG)(Z?.url);if(e&&"timestamp"in e)return e.timestamp}),[Z?.url]);if(!Z)return;const{siteName:ue,url:he,displayUrl:me,title:pe,description:ge,photo:fe,video:ve,audio:Ae,type:ye,document:Ce,mediaSize:we}=Z,be="telegram_story"===ye,Ie="telegram_nft"===ye,Se=P||B&&"isDeleted"in B?void 0:function(e){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";default:return}}(re?.isEmoji?"telegram_emojiset":ye),Me=Se&&ne(Se),Ne=(0,l.A)(ge,170),ke=Boolean(Ne||pe||ue);let Ye=Boolean(re);if(ke&&Z?.photo&&!Z.video&&!Z.document){const{width:n,height:i}=(0,h.yA)({media:Z.photo,isOwn:e.isOutgoing,isInWebPage:!0,asForwarded:F,noAvatars:t,isMobile:X});Ye=(n===i||"small"===we)&&"large"!==we}const Pe=(fe||ve)&&$&&!Ye,Fe=(0,c.A)("WebPage",P&&"in-preview",!j&&P&&"interactive",Ye&&"with-square-photo",!fe&&!ve&&!P&&"without-media",ve&&"with-video",!ke&&"no-article",Ce&&"with-document",Me&&"with-quick-button",Ie&&"with-gift");return(0,T.FD)(b.A,{className:Fe,"data-initial":(ue||me)[0],dir:te.isRtl?"rtl":"auto",onClick:oe,children:[(0,T.FD)("div",{className:(0,c.A)("WebPage--content",be&&"is-story",Ie&&"is-gift"),children:[O&&(0,T.Y)(w.A,{emojiDocumentId:O,className:"WebPage--background-icons"}),be&&(0,T.Y)(N.A,{story:B,isProtected:E,isConnected:L,isPreview:!0}),Ie&&!P&&(0,T.Y)(x,{gift:Z.gift,observeIntersectionForLoading:V,observeIntersectionForPlaying:J,onClick:se}),ke&&(0,T.FD)("div",{className:(0,c.A)("WebPage-text",!P&&"WebPage-text_interactive"),onClick:P?void 0:()=>_({url:he,shouldSkipModal:!0}),children:[(0,T.Y)(I.A,{className:"site-name",url:he,text:ue||me}),(!P||Ie)&&pe&&(0,T.Y)("p",{className:"site-title",children:(0,u.A)(pe)}),Ne&&!Ie&&(0,T.Y)("p",{className:"site-description",children:(0,u.A)(Ne,["emoji","br"])})]}),fe&&!Ie&&!ve&&!Ce&&(0,T.Y)(k.A,{photo:fe,isOwn:e.isOutgoing,isInWebPage:!0,observeIntersection:V,noAvatars:t,canAutoLoad:n,size:Ye?"pictogram":"inline",asForwarded:F,nonInteractive:!Pe,isDownloading:D,isProtected:E,theme:R,onClick:Pe?ie:void 0,onCancelUpload:W}),!P&&ve&&(0,T.Y)(Y.A,{video:ve,isOwn:e.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:V,noAvatars:t,canAutoLoad:n,canAutoPlay:r,asForwarded:F,isDownloading:D,isProtected:E,lastPlaybackTimestamp:K||le,onClick:Pe?ie:void 0,onCancelUpload:W}),!P&&Ae&&(0,T.Y)(y.Ay,{theme:R,message:e,origin:s.d9.Inline,noAvatars:t,isDownloading:D,onPlay:H,onCancelUpload:W}),!P&&Ce&&(0,T.Y)(C.A,{document:Ce,message:e,observeIntersection:V,autoLoadFileMaxSizeMb:z,onMediaClick:q,onCancelUpload:W,isDownloading:D,shouldWarnAboutSvg:U}),!P&&re&&(0,T.Y)("div",{ref:ee,className:(0,c.A)("media-inner","square-image",re.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:re.documents.map((e=>(0,T.Y)("div",{className:"WebPage--sticker",children:(0,T.Y)(S.A,{containerRef:ee,sticker:e,shouldLoop:!0,size:re.isEmoji?38:80,customColor:de,observeIntersectionForPlaying:J,observeIntersectionForLoading:V})},e.id)))}),P&&me&&!ke&&(0,T.FD)("div",{className:"WebPage-text",children:[(0,T.Y)("p",{className:"site-name",children:me}),(0,T.Y)("p",{className:"site-description",children:te("Chat.Empty.LinkPreview")})]})]}),Me&&(Te=Me,(0,T.Y)(M.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!0,onClick:se,children:Te}))]});var Te})))},15006:(e,t,n)=>{n.d(t,{U:()=>p,A:()=>m});var i=n(84051),o=n(13439),s=n(31481),a=n(29807),r=n(6842),c=n(14235);const d={root:"AN8wkEiR",ghost:"ANWk2pWP",scale:"kMHxyoSt",elementContainer:"UDCMfXxs"};var l=n(20021);const u=50,h=1e3,m=(0,i.ph)((()=>(0,l.Y)("div",{className:d.root,id:s.Lj4})));function p(e){const t=(0,o.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),i=n.left+window.scrollX,h=n.top+window.scrollY,m=n.width,p=n.height;if(i+m+u<0||i-u>window.innerWidth||h+p+u<0||h-u>window.innerHeight)return!1;const f=Math.floor(Date.now()/1e3),v=`${s.xcU}-${(0,c.A)()}`,A=(0,l.FD)("svg",{className:d.ghost,width:m,height:p,style:`left: ${i}px; top: ${h}px;`,viewBox:`0 0 ${m} ${p}`,children:[(0,l.Y)("defs",{children:g(v,Math.min(m,p),f)}),(0,l.Y)("g",{filter:`url(#${v})`,children:(0,l.Y)("foreignObject",{className:d.elementContainer,width:m,height:p})})]}),y=(0,r.A)(A)[0],C=y.querySelector("foreignObject"),w=window.getComputedStyle(e),b=e.cloneNode(!0);Array.from(w).forEach((e=>b.style.setProperty(e,w.getPropertyValue(e),"important"))),C.appendChild(b);const I=document.getElementById(s.Lj4);return I.appendChild(y),y.addEventListener("animationend",(()=>{I.removeChild(y)}),{once:!0}),!0}function g(e,t,n=42){return(0,l.FD)("filter",{xmlns:s.jNX,id:e,x:"-150%",y:"-150%",width:"400%",height:"400%","color-interpolation-filters":"sRGB",children:[(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"1",result:"dustNoise",seed:n}),(0,l.Y)("feComponentTransfer",{in:"dustNoise",result:"dustNoiseMask",children:(0,l.Y)("feFuncA",{type:"linear",slope:"5",intercept:"0",children:(0,l.Y)("animate",{attributeName:"slope",values:"5; 2; 1; 0",dur:`${h}ms`,fill:"freeze"})})}),(0,l.Y)("feComposite",{in:"SourceGraphic",in2:"dustNoiseMask",operator:"in",result:"dustySource"}),(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.015",numOctaves:"1",result:"displacementNoise1",seed:n+1}),(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"1",numOctaves:"2",result:"displacementNoise2",seed:n+2}),(0,l.FD)("feMerge",{result:"combinedNoise",children:[(0,l.Y)("feMergeNode",{in:"displacementNoise1"}),(0,l.Y)("feMergeNode",{in:"displacementNoise2"})]}),(0,l.Y)("feDisplacementMap",{in:"dustySource",in2:"combinedNoise",scale:"0",xChannelSelector:"R",yChannelSelector:"G",children:(0,l.Y)("animate",{attributeName:"scale",values:"0; "+3*t,dur:`${h}ms`,fill:"freeze"})})]})}},17010:(e,t,n)=>{n.d(t,{A:()=>kn});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(31481),c=n(90709),d=n(70636),l=n(26129),u=n(29807),h=n(30708),m=n(96454),p=n(87357),g=n(9716),f=n(60343),v=n(83868),A=n(41512),y=n(76023),C=n(35049),w=n(4961),b=n(58734);function I(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 S=n(43336),M=n(35127);function N(e,t){return e.reduce(((e,t)=>e+t),t)}function k(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 Y(e,t,n,i){const o=function(e,t,n){const i=e[0].isOutgoing;return(t?e[0].content.paidMedia.extendedMedia.map((e=>"mediaType"in e?e:e.photo||e.video)):e.map((e=>(0,c.r_)(e).photo||(0,c.r_)(e).video))).filter(Boolean).map((e=>{const t=(0,M.yA)({media:e,isOwn:i,isMobile:n});return t.width/t.height}))}(n.messages,n.isPaidMedia,i),s=function(e){return e.map((e=>e>1.2?"w":e<.8?"n":"q")).join("")}(o),a=function(e){return e.reduce(((e,t)=>t+e),1)/e.length}(o),r=o.length,d=o.some((e=>e>2)),l=(0,y.w4)(e,!1,t,i);let u;const h={ratios:o,proportions:s,averageRatio:a,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return u=r>=5||d?function({ratios:e,averageRatio:t,maxWidth:n,minWidth:i,spacing:o,maxHeight:s=4*n/3}){const a=function(e,t){return e.map((e=>t>1.1?(0,S.qE)(e,1,2.75):(0,S.qE)(e,.6667,1)))}(e,t),r=e.length,c=new Array(r),d=[],l=e=>{const t=[];let i=0;e.forEach((e=>{t.push(((e,t)=>{const i=N(a.slice(e,e+t),0);return(n-(t-1)*o)/i})(i,e)),i+=e})),d.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 i=r-e-n;e<=3&&n<=(t<.85?4:3)&&i<=3&&l([e,n,i])}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 i=r-e-t-n;e<=3&&t<=3&&n<=3&&i<=4&&l([e,t,n,i])}let u,h=0;for(let e=0;e<d.length;e++){const{heights:t,lineCounts:n}=d[e],a=n.length,r=N(t,0)+o*(a-1),c=Math.min(...t)<i?1.5:1,l=(()=>{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),m=Math.abs(r-s)*c*l;(!u||m<h)&&(u=d[e],h=m)}const m=u.lineCounts,p=u.heights,g=m.length;let f=0,v=0;for(let e=0;e!==g;++e){const t=m[e],i=p[e],s=Math.round(i);let r=0;for(let d=0;d!==t;++d){const l=0|(0===e?1:0)|(e===g-1?4:0)|(0===d?8:0)|(d===t-1?2:0),u=a[f],h=d===t-1?n-r:Math.round(u*i);c[f]={dimensions:{x:r,y:v,width:h,height:s},sides:l},r+=h+o,++f}v+=s+o}return c}(h):2===r?function(e){const{ratios:t,proportions:n,averageRatio:i}=e;return"ww"===n&&i>1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:i,maxHeight:o}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(o-i)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+i,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:i,maxHeight:o}=e,s=(n-i)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],o)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+i,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:i,spacing:o,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(i-o),(i-o)/t[0]/(1/t[0]+1/t[1]))),i-o-a),c=i-r-o,d=Math.min(s,Math.round(Math.min(c/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:c,height:d},sides:13},{dimensions:{x:c+o,y:0,width:r,height:d},sides:7}]}(e)}(h):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:i,maxWidth:o,minWidth:s}=e,a=t,r=Math.round(Math.min((t-n)/2,i[1]*(o-n)/(i[2]+i[1]))),c=a-r-n,d=Math.max(s,Math.round(Math.min((o-n)/2,Math.min(r*i[2],c*i[1])))),l=Math.min(Math.round(a*i[0]),o-n-d);return[{dimensions:{x:0,y:0,width:l,height:a},sides:13},{dimensions:{x:l+n,y:0,width:d,height:c},sides:3},{dimensions:{x:l+n,y:c+n,width:d,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:i,spacing:o}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(i-o))),r=(t-o)/2,c=Math.min(i-a-o,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+o,width:r,height:c},sides:12},{dimensions:{x:r+o,y:a+o,width:s-r-o,height:c},sides:6}]}(e)}(h):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:n,maxHeight:i,minWidth:o}){const s=e,a=Math.round(Math.min(s/t[0],.66*(i-n))),r=Math.round((e-2*n)/(t[1]+t[2]+t[3])),c=Math.max(o,Math.round(Math.min(.4*(e-2*n),r*t[1]))),d=Math.round(Math.max(Math.max(o,.33*(e-2*n)),r*t[3])),l=s-c-d-2*n,u=Math.min(i-a-n,r);return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+n,width:c,height:u},sides:12},{dimensions:{x:c+n,y:a+n,width:l,height:u},sides:4},{dimensions:{x:c+n+l+n,y:a+n,width:d,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:n,spacing:i,minWidth:o}){const s=e,a=Math.round(Math.min(s*t[0],.6*(n-i))),r=Math.round((e-2*i)/(1/t[1]+1/t[2]+1/t[3])),c=Math.round(r/t[1]),d=Math.round(r/t[2]),l=s-c-d-2*i,u=Math.max(o,Math.min(n-a-i,r));return[{dimensions:{x:0,y:0,width:a,height:s},sides:13},{dimensions:{x:a+i,y:0,width:u,height:c},sides:3},{dimensions:{x:a+i,y:c+i,width:u,height:d},sides:2},{dimensions:{x:a+i,y:c+d+2*i,width:u,height:l},sides:6}]}(e)}(h),{layout:u,containerStyle:k(u)}}var P=n(43874),F=n(10722),T=n(49746),x=n(21488),D=n(37661),E=n(5912),L=n(17712),B=n(59030),R=n(73767),O=n(14622),U=n(21511),z=n(9705),K=n(5130);let j;const V=new z.A;m.CM&&setTimeout((function(){j||(j=(0,K.U)(new Worker(new URL(n.p+n.u(520),n.b))),V.resolve())}),4e3);var J=n(84947),$=n(37836);const q=new Map;const G=(0,$.nF)((function(e){const{updateChatDetectedLanguage:t}=(0,o.ko)(),n=q.get(e);if(!n)return;const i=n.size;if(i<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/i<.3||a/i<.6)return;t({chatId:e,detectedLanguage:Array.from(r.entries()).sort((([,e],[,t])=>t-e))[0][0]})}),1e3);var H=n(79519),W=n(46275),_=n(64154),Q=n(66644),Z=n(50442),X=n(43503),ee=n(54464),te=n(672);const ne=3*y.$,ie=Number(y.$),oe="data-is-document-group-hover";function se(e,t,n,s,a,r,c,d,l,u,h,p,g){const{updateDraftReplyInfo:f,sendDefaultReaction:A}=(0,o.ko)(),[y,C,w]=(0,D.A)(),[b,I,S]=(0,D.A)(),M=(0,i.li)(),N=(0,te.A)((e=>{const t=h.current;if(!t)return;const{clientX:n,clientY:i}=e,{x:o,width:s,y:a,height:r}=t.getBoundingClientRect(),c=o+s/2,d=a+r/2,l=Math.abs(c-n)<ne,u=Math.abs(d-i)<ie;l&&u?C():w()}),[h],Q.YS);return(0,i.vJ)((()=>{if(!m.TF||s||!a||u||!g?.())return;let e;return(0,Z.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===Z.ez.Left&&(e||(e=Date.now()),I(),!0),onRelease:()=>{e&&a&&(f({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})}),[t,s,n,I,S,a,u,g]),{handleMouseDown:s?void 0:function(e){(0,ee.l)(e),d(e)},handleClick:function(t){if(s)e(t);else if(m.TF)return M.current?(clearInterval(M.current),M.current=void 0,void A({chatId:l,messageId:n})):void(M.current=setTimeout((()=>{M.current=void 0,function(e){if(m.Ni){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;X.A.getIsKeyboardVisible()?setTimeout((()=>{c(e)}),350):c(e)}}(t)}),200))},handleContextMenu:s?r?v.A:void 0:function(t){if(m.Ni){if(t.target.matches("a[href]")||u)return;t.preventDefault(),e()}else c(t)},handleDoubleClick:s?void 0:function(){!m.TF&&a&&f({replyToMsgId:n,replyToPeerId:void 0,quoteText:void 0,quoteOffset:void 0})},handleContentDoubleClick:m.TF?void 0:function(e){e.stopPropagation()},handleMouseMove:N,handleSendQuickReaction:function(e){e.stopPropagation(),A({chatId:l,messageId:n})},handleMouseLeave:function(e){(0,Q.YS)(w),p&&function(e){const t=re(e.currentTarget);t&&t.removeAttribute(oe)}(e)},isSwiped:b,isQuickReactionVisible:y,handleDocumentGroupMouseEnter:ae}}function ae(e){const t=re(e.currentTarget);t&&t.setAttribute(oe,"")}function re(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var ce=n(65240),de=n(21849),le=n(87412),ue=n(44589),he=n(80999),me=n(91930),pe=n(11217),ge=n(62587),fe=n(18276),ve=n(86070),Ae=n(20021);function ye(e,t){const{width:n,height:i}=(0,y.mr)();return(0,Ae.FD)("div",{className:"embedded-thumb",children:[(0,Ae.Y)("img",{src:e,width:n,height:i,alt:"",className:"pictogram",draggable:!1}),t&&(0,Ae.Y)("span",{className:"protector"})]})}const Ce=({story:e,sender:t,noUserColors:n,isProtected:s,observeIntersectionForLoading:a,onClick:r})=>{const{showNotification:l}=(0,o.ko)(),u=(0,B.A)(),h=(0,i.li)(),m=(0,E.Vz)(h,a),g=e&&"content"in e,f=e&&"isDeleted"in e,v=g&&Boolean(e.content.video),A=g?"Story":f?"ExpiredStory":"Loading",y=(0,ge.A)(g&&(0,c.EN)(e,"pictogram"),!m),C=v?e.content.video.thumbnail?.dataUri:void 0,b=y||C,I=t?(0,d.F9)(u,t):void 0,S=(0,L.A)((()=>{e&&!f?r():l({message:u("StoryNotFound")})})),{handleClick:M,handleMouseDown:N}=(0,pe.Q)(S);return(0,Ae.FD)(ve.A,{ref:h,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,p.A)("EmbeddedMessage",b&&"with-thumb"),onClick:M,onMouseDown:N,children:[b&&ye(b,s),(0,Ae.FD)("div",{className:"message-text with-message-color",children:[(0,Ae.FD)("p",{className:"embedded-text-wrapper",children:[f&&(0,Ae.Y)(fe.A,{name:"story-expired",className:"embedded-origin-icon"}),g&&(0,Ae.Y)(fe.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,Ae.Y)("div",{className:"message-title",children:(0,w.A)(I||" ")})]})]})};var we=n(2578),be=n(9267),Ie=n(74936),Se=n(17794),Me=n(90603),Ne=n(38102);var ke=n(61911);const Ye=1.125*y.$,Pe=(0,i.ph)((({topic:e,className:t,onClick:n})=>{const i=(0,B.A)();return(0,Ae.FD)("div",{className:(0,p.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Me.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,Ae.Y)(Ne.A,{topic:e,size:Ye}):(0,Ae.Y)("img",{src:ke,alt:"",draggable:!1}),e?.title?(0,w.A)(e.title):i("Loading"),e?.isClosed&&(0,Ae.Y)(fe.A,{name:"lock"}),(0,Ae.Y)(fe.A,{name:"next"})]})}));var Fe=n(15006),Te=n(64493);function xe(e){return(0,i.ph)((0,o.EK)(((e,t)=>{const{clickArg:n,noSelectControls:i}=t;return{isInSelectMode:!i&&(0,u.rTV)(e),isSelected:!i&&(0,u.H1_)(e,n)}}))((t=>{const{isInSelectMode:n,isSelected:s,dimensions:a,clickArg:r}=t,{toggleMessageSelection:c}=(0,o.ko)(),d=(0,L.A)((e=>{e.stopPropagation(),c({messageId:r,withShift:e?.shiftKey})})),l=(0,i.Kr)((()=>{const{dimensions:e,onClick:i}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:i}}),[t,n,s]);return(0,Ae.FD)("div",{className:(0,p.A)("album-item-select-wrapper",s&&"is-selected"),style:a?`left: ${a.x}px; top: ${a.y}px;`:"",onClick:n?d:void 0,children:[n&&(0,Ae.Y)("div",{className:"message-select-control",children:s&&(0,Ae.Y)(fe.A,{name:"select"})}),(0,Ae.Y)(e,{...l})]})})))}var De=n(51644),Ee=n(25477);const Le=xe(De.A),Be=xe(Ee.A),Re=(0,o.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:d,uploadsByKey:l,activeDownloads:h,theme:m})=>{const{cancelUploadMedia:p}=(0,o.ko)(),{content:{paidMedia:g}}=e.mainMessage,v=e.isPaidMedia?g.extendedMedia.length:e.messages.length,A=(0,L.A)((t=>{d(e.mainMessage.id,t)})),y=(0,L.A)((e=>{d(e)})),C=(0,L.A)((t=>{p({chatId:e.mainMessage.chatId,messageId:t})})),w=(0,i.Kr)((()=>e.isPaidMedia?e.mainMessage.content.paidMedia.extendedMedia.map((()=>e.mainMessage)):e.messages),[e]),{width:b,height:I}=r.containerStyle;return(0,Ae.Y)("div",{className:"Album",style:`width: ${b}px; height: ${I}px;`,children:w.map((function(i,d){const p=e.isPaidMedia?i.content.paidMedia?.extendedMedia[d]:void 0,g=p&&"mediaType"in p?p:p?.photo,w=p&&"mediaType"in p?p:p?.video,b=g||(0,c.yl)(i),I=w||(0,c.r_)(i).video,S=l[(0,f.bj)(i)],M=S?.progress,{dimensions:N,sides:k}=r.layout[d],Y=(0,u.wwb)((0,o.mS)(),i),P=(0,u.OEt)((0,o.mS)(),i);if(b){const o=n&&(s?d===v-1:Boolean(8&k&&4&k));return(0,Ae.Y)(Le,{id:`album-media-${(0,c.GZ)(i.id,e.isPaidMedia?d:void 0)}`,photo:b,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:Y,shouldAffectAppendix:o,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?d:i.id,onClick:e.isPaidMedia?A:y,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,c.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})}if(I)return(0,Ae.Y)(Be,{id:`album-media-${(0,c.GZ)(i.id)}`,video:I,observeIntersectionForLoading:t,canAutoLoad:Y,canAutoPlay:P,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?d:i.id,onClick:e.isPaidMedia?A:y,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,c.$r)(h,I),theme:m,noSelectControls:e.isPaidMedia})}))})}));var Oe=n(95807),Ue=n(41733);const ze=7*y.$;function Ke(e,t,n,s,a,r,c){const{interactWithAnimatedEmoji:d,sendEmojiInteraction:l,sendWatchingEmojiInteraction:u}=(0,o.ko)(),h=(0,i.li)(),p=(0,i.li)(),g=(0,ge.A)(n?`document${n}`:void 0,!n),f=c||ze,v=(0,Oe.A)(`width: ${f}px`,`height: ${f}px`,r&&!m.cp&&"cursor: pointer"),A=(0,i.li)(void 0),y=(0,i.li)(void 0),C=(0,L.A)((()=>{h.current&&(l({chatId:e,messageId:t,emoji:r,interactions:A.current}),y.current=void 0,A.current=void 0)})),w=(0,L.A)((()=>{const e=p.current;g&&(e&&(e.pause(),e.remove()),p.current=new Audio,p.current.src=g,(0,Ue.A)(p.current),p.current.addEventListener("ended",(()=>{p.current=void 0}),{once:!0}))})),b=(0,L.A)((()=>{w();const n=h.current;if(!(r&&n&&t&&e))return;const{x:i,y:o}=n.getBoundingClientRect();d({emoji:r,x:i,y:o,startSize:f,isReversed:!a}),A.current||(A.current=[],y.current=performance.now(),setTimeout(C,1e3)),A.current.push(y.current?(performance.now()-y.current)/1e3:0)}));return(0,i.vJ)((()=>{const n=h.current;n&&s&&s.forEach((({id:i,startSize:o,messageId:s})=>{if(o||t!==s)return;const{x:c,y:d}=n.getBoundingClientRect();u({id:i,chatId:e,emoticon:r,startSize:f,x:c,y:d,isReversed:!a}),w()}))}),[s,e,r,a,t,w,u,f]),{ref:h,size:f,style:v,handleClick:b}}const je=(0,i.ph)((0,o.EK)(((e,{customEmojiId:t,withEffects:n})=>{const i=e.customEmojis.byId[t];return{sticker:i,effect:i?.emoji&&n?(0,u.Nr8)(e,i.emoji):void 0,soundId:i?.emoji&&(0,u.tKM)(e,i.emoji),noPlay:!(0,u.BWX)(e)}}))((({isOwn:e,customEmojiId:t,messageId:n,chatId:i,activeEmojiInteractions:o,sticker:s,effect:a,soundId:r,noPlay:c,observeIntersection:d})=>{const{ref:l,size:u,style:h,handleClick:m}=Ke(i,n,r,o,e,a?.emoji,(0,b.Rr)(1));return(0,Ae.Y)(le.A,{ref:l,documentId:t,className:(0,p.A)("AnimatedEmoji media-inner",s?.id===y.AC&&"like-sticker-thumb"),style:h,size:u,isBig:!0,noPlay:c,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(a&&o?.length),observeIntersectionForLoading:d,onClick:m})})));var Ve=n(79577);const Je=(0,i.ph)((0,o.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:i,chatId:o,activeEmojiInteractions:s,sticker:a,effect:r,soundId:c})=>{const{ref:d,size:l,style:u,handleClick:h}=Ke(o,i,c,s,e,r?.emoji),m=(0,E.Vz)(d,t);return(0,Ae.Y)(Ve.A,{sticker:a,size:l,quality:1,noLoad:!m,forcePreview:n,play:m,forceAlways:!0,ref:d,className:(0,p.A)("AnimatedEmoji media-inner",a?.id===y.AC&&"like-sticker-thumb"),style:u,onClick:h})})));var $e=n(14242),qe=n(39351),Ge=n(93809),He=n(68292),We=n(57474);const _e=(0,i.ph)((({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s,asActionButton:a})=>{const{openThread:r,openFrozenAccountModal:c}=(0,o.ko)(),d=(0,Ge.A)([s],450),l=(0,B.A)(),h=(0,qe.A)(),{originMessageId:m,chatId:g,messagesCount:f,lastMessageId:v,lastReadInboxMessageId:A,recentReplierIds:y,originChannelId:C}=t,w=(0,L.A)((()=>{const e=(0,o.mS)();(0,u.trm)(e)?c():r({isComments:!0,chatId:g,originMessageId:m,originChannelId:C})})),b=(0,i.Kr)((()=>{if(!y?.length)return;const e=(0,o.mS)();return y.map((t=>(0,u.PVB)(e,t))).filter(Boolean)}),[y]);if(void 0===f)return;const I=Boolean(A&&v&&A<v),S=f?l("CommentsCount","%COMMENTS_COUNT%",void 0,f).split("%").map((e=>"COMMENTS_COUNT"===e?(0,Ae.Y)(He.A,{text:(0,$e.Vw)(h,f)}):e)):void 0;return(0,Ae.FD)("div",{"data-cnt":(0,$e.Vw)(h,f),className:(0,p.A)("CommentButton",I&&"has-unread",n&&"disabled",e&&"CommentButton-custom-shape",s&&"loading",a&&"as-action-button"),dir:l.isRtl?"rtl":"ltr",onClick:w,role:"button",tabIndex:0,children:[(0,Ae.Y)(fe.A,{name:"comments-sticker",className:(0,p.A)("CommentButton_icon-comments",s&&d&&"CommentButton_hidden")}),!b?.length&&(0,Ae.Y)(fe.A,{name:"comments"}),Boolean(b?.length)&&(0,Ae.Y)("div",{className:"recent-repliers",dir:l.isRtl?"rtl":"ltr",children:b.map((e=>(0,Ae.Y)(de.A,{size:"small",peer:e},e.id)))}),(0,Ae.Y)("div",{className:"label",dir:"auto",children:f?S:l("LeaveAComment")}),(0,Ae.FD)("div",{className:"CommentButton_right",children:[s&&(0,Ae.Y)(We.A,{className:(0,p.A)("CommentButton_loading",!d&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,Ae.Y)(fe.A,{name:"next",className:(0,p.A)("CommentButton_icon-open",s&&d&&"CommentButton_hidden")})]})]})}));var Qe=n(85982),Ze=n(64713);const Xe="ReDHhQHm";function et(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const tt=(0,o.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:i})=>{const s=(0,B.A)(),{openChat:a,openAddContactDialog:r,showNotification:d,openChatWithInfo:l}=(0,o.ko)(),{phoneNumber:u,userId:h}=e,m="0"!==h,p=m&&t&&(0,c.Gh)(t),g=(0,L.A)((()=>{a({id:h})})),f=(0,L.A)((()=>{r({userId:t?.id})})),v=(0,L.A)((()=>{t?l({id:h}):((0,Qe.eM)(u),d({message:s("PhoneCopied")}))}));return(0,Ae.FD)(ve.A,{noUserColors:i,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,Ae.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,Ae.Y)(de.A,{size:"medium",peer:t,text:et(e)}),(0,Ae.FD)("div",{className:"fpYynE5s",children:[(0,Ae.Y)("div",{className:"_PNTJc_V",children:t?(0,c.Yg)(t):et(e)}),(0,Ae.Y)("div",{className:"JP_3wes8",children:(0,Ze.Ox)(n,u)})]})]}),m&&(0,Ae.FD)(Ae.FK,{children:[(0,Ae.Y)("div",{className:"_OSJcuqH"}),(0,Ae.FD)("div",{className:"Blui4M4G",children:[(0,Ae.Y)(Te.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:Xe,children:s("SharedContactMessage")}),p&&(0,Ae.Y)(Te.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:Xe,children:s("SharedContactAdd")})]})]})]})}));var nt=n(80089),it=n(80464);const ot=e=>{const{isOpen:t}=e,n=(0,it.A)(nt.ar.Extra,"ContextMenuContainer",!t);return n?(0,Ae.Y)(n,{...e}):void 0};var st=n(18501),at=n(57675),rt=n(32581);const ct={color:0},dt=(0,i.ph)((({factCheck:e,isToggleDisabled:t})=>{const n=(0,B.A)(),o=(0,i.li)(),s=(0,i.li)(),{isCollapsed:a,isCollapsible:r,setIsCollapsed:c}=(0,at.A)(o,4,s),d=(0,i.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,L.A)((()=>{c(!1)})),h=(0,L.A)((()=>{c((e=>!e))}));if(e.text)return(0,Ae.FD)(ve.A,{peerColor:ct,className:"HMB5LgeX",onClick:l?u:void 0,children:[(0,Ae.FD)("div",{ref:s,className:(0,p.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,Ae.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,Ae.Y)("div",{ref:o,className:"k_dGolcu",children:(0,st.fd)({text:e.text.text,entities:e.text.entities})}),(0,Ae.Y)(rt.A,{className:"qRaSs5iA"}),(0,Ae.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",d)})]}),r&&(0,Ae.Y)("div",{className:(0,p.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:h,"aria-hidden":!0,children:(0,Ae.Y)(fe.A,{name:a?"down":"up"})})]})}));var lt=n(55158);const ut=(0,i.ph)((({message:e,canAutoLoadMedia:t})=>{const{clickBotInlineButton:n}=(0,o.ko)(),i=e.content.game,{title:s,description:a}=i,r=(0,c.zb)(i),d=(0,c.ih)(i),l=(0,ge.A)(r,!t),u=(0,ge.A)(d,!t);return(0,Ae.FD)("div",{className:"Game",children:[(0,Ae.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{n({chatId:e.chatId,messageId:e.id,button:e.inlineButtons[0][0]})},children:[!l&&!u&&(0,Ae.Y)(lt.A,{className:"skeleton preview-content"}),l&&(0,Ae.Y)("img",{className:"preview-content",src:l,alt:s,draggable:!1}),u&&(0,Ae.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:u})]}),(0,Ae.Y)("div",{className:"title",children:s}),!(0,c.P5)(e)&&(0,Ae.Y)("div",{className:"description",children:a})]})}));var ht=n(17663),mt=n(52491),pt=n(80140),gt=n(4875),ft=n(78376),vt=n(64489),At=n(10187),yt=n(94189);const Ct="ogvcv3mr",wt="MSFa9BPf",bt="HfZ6SuLI",It="rPyyNYxK",St="FV70u896",Mt=(0,i.ph)((0,o.EK)(((e,{message:t})=>{const{giveaway:n}=t.content,i=(0,u.hds)(e,t.chatId);return{chat:i,sender:(n?.channelIds[0]?(0,u.hds)(e,n.channelIds[0]):void 0)||(0,u.Szq)(e,t)||i,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,o.ko)(),l=(0,i.li)(!1),[u,h]=(0,i.J0)(),m=(0,B.A)(),{giveaway:g,giveawayResults:f}=n.content,v=Boolean(f),{months:A,untilDate:y,prizeDescription:C,stars:b}=g||f,I=(0,c.Ie)(n),S=v?f.winnersCount:g.quantity,M=(0,pt.Fm)()>y,N=(0,i.Kr)((()=>{if(v)return;const e=new Intl.DisplayNames([m.code,"en"].filter(Boolean),{type:"region"});return g?.countries?.map((t=>`${(0,mt.D0)(t)} ${e.of(t)}`)).join(", ")}),[g,v,m.code]),k=(0,L.A)((e=>{r({id:e})})),Y=(0,L.A)((async()=>{if(l.current)return;l.current=!0;const t=await(0,gt.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});h(t),l.current=!1})),P=(0,L.A)((()=>{h(void 0)})),F=(0,i.Kr)((()=>{if(u)return m("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")}),[u,m]);return(0,Ae.FD)("div",{className:"CbpKtOey",children:[(0,Ae.FD)("div",{className:(0,p.A)("hjjKhvVv",v&&"JEiR48jJ"),children:[v?(0,Ae.Y)(vt.A,{size:150,tgsUrl:ft.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,Ae.Y)(Ve.A,{sticker:a,play:s&&M,noLoop:!0,nonInteractive:!0,size:175}),(0,Ae.Y)("span",{className:"n_QCMv_A",children:`x${S}`})]}),v?function(e){const t=e.winnerIds;return(0,Ae.FD)(Ae.FK,{children:[(0,Ae.FD)("div",{className:wt,children:[(0,Ae.Y)("strong",{className:Ct,children:(0,w.A)(m("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,Ae.Y)("p",{className:bt,children:(0,w.A)(m("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,Ae.Y)("strong",{className:Ct,children:m("lng_prizes_results_winners")}),(0,Ae.Y)("div",{className:It,children:t.map((e=>(0,Ae.Y)(At.A,{peerId:e,forceShowSelf:!0,withPeerColors:!I,className:St,clickArg:e,onClick:k})))})]}),(0,Ae.Y)("div",{className:wt,children:(0,Ae.Y)("p",{className:bt,children:m("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(f):function(e){const t=e.channelIds;return(0,Ae.FD)(Ae.FK,{children:[(0,Ae.FD)("div",{className:wt,children:[(0,Ae.Y)("strong",{className:Ct,children:(0,w.A)(m("BoostingGiveawayPrizes"),["simple_markdown"])}),C&&(0,Ae.FD)(Ae.FK,{children:[(0,Ae.Y)("p",{className:bt,children:(0,w.A)(m("BoostingGiveawayMsgPrizes",[S,C],void 0,S),["simple_markdown"])}),(0,Ae.Y)(rt.A,{children:m("BoostingGiveawayMsgWithDivider")})]}),(0,Ae.Y)("p",{className:bt,children:n?.content?.giveaway?.stars?(0,Ae.FD)(Ae.FK,{children:[(0,w.A)(m("Chat.Giveaway.Message.Stars.PrizeText",m("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,Ae.Y)("br",{}),(0,w.A)(m("AmongWinners",S),["simple_markdown"])]}):(0,Ae.FD)(Ae.FK,{children:[(0,w.A)(m("Chat.Giveaway.Info.Subscriptions",S),["simple_markdown"]),(0,Ae.Y)("br",{}),(0,w.A)(m("ActionGiftPremiumSubtitle",m("Chat.Giveaway.Info.Months",A)),["simple_markdown"])]})})]}),(0,Ae.FD)("div",{className:wt,children:[(0,Ae.Y)("strong",{className:Ct,children:(0,w.A)(m("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,Ae.Y)("p",{className:bt,children:(0,w.A)(m("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,Ae.Y)("div",{className:It,children:t.map((e=>(0,Ae.Y)(At.A,{peerId:e,forceShowSelf:!0,withPeerColors:!I,className:St,clickArg:e,onClick:k})))}),N&&(0,Ae.Y)("span",{children:(0,w.A)(m("Chat.Giveaway.Message.CountriesFrom",N))})]}),(0,Ae.FD)("div",{className:wt,children:[(0,Ae.Y)("strong",{className:Ct,children:(0,w.A)(m("BoostingWinnersDate"),["simple_markdown"])}),(0,Ae.Y)("p",{className:bt,children:(0,ht.L2)(1e3*y,m.code,!0)})]})]})}(g),(0,Ae.Y)(Te.A,{className:"jMBw7STU",color:"adaptive",size:"smaller",onClick:Y,children:m("BoostingHowItWork")}),(0,Ae.Y)(yt.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:F,confirmHandler:P,onClose:P,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,d.vj)(t)?(0,c.Js)(m,t):(0,c.Yg)(t),i=(0,ht.U)(m,1e3*y),s=g?.channelIds?g.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",b,"i"),p=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,[i,S,n,s],void 0,S);e&&u.activatedCount&&(I+=` ${m("BoostingGiveawayUsedLinksPlural",u.activatedCount)}`);let M="";e&&(M=u.isRefunded?m("BoostingGiveawayCanceledByPayment"):m(u.isWinner?"BoostingGiveawayYouWon":"BoostingGiveawayYouNotWon"));let N="";if(e);else if(u.disallowedCountry)N=m("BoostingGiveawayNotEligibleCountry");else if(u.adminDisallowedChatId){const e=(0,o.mS)().chats.byId[u.adminDisallowedChatId],t=e&&(0,c.Js)(m,e);N=m("BoostingGiveawayNotEligibleAdmin",t)}else if(u.joinedTooEarlyDate){const e=(0,ht.U)(m,1e3*u.joinedTooEarlyDate);N=m("BoostingGiveawayNotEligible",e)}else N=u.isParticipating?r?m("Chat.Giveaway.Info.ParticipatingMany",[n,s]):m("Chat.Giveaway.Info.Participating",n):r?m("Chat.Giveaway.Info.NotQualifiedMany",[n,a,i]):m("Chat.Giveaway.Info.NotQualified",[n,i]);return(0,Ae.FD)(Ae.FK,{children:[M&&(0,Ae.Y)("p",{className:"ZQ4aVVkI",children:(0,w.A)(M,["simple_markdown"])}),(0,Ae.Y)("p",{children:(0,w.A)(p,["simple_markdown"])}),f&&(0,Ae.Y)("p",{children:(0,w.A)(f,["simple_markdown"])}),(0,Ae.Y)("p",{children:(0,w.A)(I,["simple_markdown"])}),N&&(0,Ae.Y)("p",{children:(0,w.A)(N,["simple_markdown"])})]})}()})]})})));var Nt=n(85449);const kt=(0,i.ph)((({message:e,onClick:t})=>{const n=(0,B.A)(),o=e=>{const{type:t}=e;switch(t){case"url":if(!r.OFc.test(e.url))return(0,Ae.Y)(fe.A,{className:"corner-icon",name:"arrow-right"});break;case"urlAuth":return(0,Ae.Y)(fe.A,{className:"corner-icon",name:"arrow-right"});case"buy":case"receipt":return(0,Ae.Y)(fe.A,{className:"corner-icon",name:"card"});case"switchBotInline":return(0,Ae.Y)(fe.A,{className:"corner-icon",name:"share-filled"});case"webView":case"simpleWebView":return(0,Ae.Y)(fe.A,{className:"corner-icon",name:"webapp"});case"copy":return(0,Ae.Y)(fe.A,{className:"corner-icon",name:"copy"})}},s=(0,i.Kr)((()=>{const t=[];return e.inlineButtons.forEach((e=>{t.push(e.map((e=>(0,Nt.A)(n,e))))})),t}),[n,e.inlineButtons]);return(0,Ae.Y)("div",{className:"InlineButtons",children:e.inlineButtons.map(((n,i)=>(0,Ae.Y)("div",{className:"row",children:n.map(((n,a)=>(0,Ae.FD)(Te.A,{size:"tiny",ripple:!0,disabled:"unsupported"===n.type,onClick:()=>t({chatId:e.chatId,messageId:e.id,button:n}),children:[(0,Ae.Y)("span",{className:"inline-button-text",children:s[i][a]}),o(n)]})))})))})}));var Yt=n(17142),Pt=n(40435),Ft=n(37859),Tt=n(61097);const xt=(0,i.ph)((({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:o,theme:s,forcedWidth:a})=>{const d=(0,i.li)(),l=(0,B.A)(),u=(0,qe.A)(),h=(0,c.NO)(e),{title:m,description:p,amount:g,currency:f,isTest:v,photo:A}=h,y=(0,ge.A)((0,c.cy)(A)),C=Boolean(a),b=(0,Tt.A)(y,!C),I=e.id;(0,Ft.A)((([e])=>{if(t){if(y){const e=d.current.closest(r.KFG);(0,Pt.A)(y,!1,I,o,s).then((t=>{(0,Q.RK)((()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")}))}))}}else e&&d.current.closest(r.KFG).removeAttribute(r.D3G)}),[t,y,n,o,s,I]);const S=a||A?.dimensions?.width,M=(0,Oe.A)(A?.dimensions&&`width: ${S}px`,A?.dimensions&&`aspect-ratio: ${A.dimensions.width} / ${A.dimensions.height}`,Boolean(!A?.dimensions&&a)&&`width: ${a}px`);return(0,Ae.FD)("div",{ref:d,className:"Invoice",children:[m&&(0,Ae.Y)("p",{className:"title",children:(0,w.A)(m)}),p&&(0,Ae.Y)("div",{className:"info",children:(0,w.A)(p,["emoji","br"])}),(0,Ae.FD)("div",{className:"description "+(A?"has-image":""),children:[Boolean(A)&&(0,Ae.FD)("div",{className:"invoice-image-container",children:[C&&(0,Ae.Y)("canvas",{ref:b,className:"thumbnail blurred-bg"}),y&&(0,Ae.Y)("img",{className:"invoice-image",src:y,alt:"",style:M,crossOrigin:"anonymous",draggable:!1}),!y&&A&&(0,Ae.Y)(lt.A,{width:S,height:A.dimensions?.height,forceAspectRatio:!0})]}),(0,Ae.FD)("p",{className:"description-text",children:[(0,Yt.v)(u,g,f,{iconClassName:"invoice-currency-icon"}),v&&(0,Ae.Y)("span",{className:"test-invoice",children:l("PaymentTestInvoice")})]})]})]})}));var Dt=n(32625),Et=n(27860);const Lt={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Bt=(0,i.ph)((({message:e,isConnected:t})=>{const{openInvoice:n,loadExtendedMedia:i}=(0,o.ko)(),s=(0,B.A)(),a=(0,c.NO)(e),{chatId:r,id:d}=e,l=(0,L.A)((()=>{i({chatId:r,ids:[d]})}));(0,Dt.A)(l,t?3e4:void 0);const{amount:u,currency:h,extendedMedia:m}=a,{width:g,height:f,thumbnail:v,duration:A}=m,y=(0,L.A)((()=>{n({type:"message",chatId:r,messageId:d,isExtendedMedia:!0})}));return(0,Ae.FD)("div",{className:(0,p.A)(Lt.root,"media-inner"),onClick:y,children:[(0,Ae.Y)(Et.A,{thumbDataUri:v?.dataUri,width:g,height:f,isVisible:!0,className:Lt.spoiler}),Boolean(A)&&(0,Ae.Y)("div",{className:Lt.duration,children:(0,ht.QO)(A)}),(0,Ae.FD)("div",{className:Lt.buy,children:[(0,Ae.Y)(fe.A,{name:"lock",className:Lt.lock}),s("Checkout.PayPrice",(0,Yt.A)(u,h))]})]})}));var Rt=n(47526),Ot=n(14737),Ut=n(30857),zt=n(38691);const Kt=n.p+"map-pin.899635f6fe777c28998a.svg",jt=24*Math.PI,Vt=1e-4,Jt={width:400,height:300,zoom:16};function $t(){return(0,Ae.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,Ae.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,Ae.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,Ae.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,Ae.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 qt=(0,i.ph)((({message:e,peer:t})=>{const{openMapModal:n}=(0,o.ko)(),s=(0,i.li)(),a=(0,i.li)(),r=(0,B.A)(),d=(0,Ut.A)(),l=(0,c.fB)(e),{mediaType:u,geo:h}=l,m=(0,pt.Fm)(),g=(0,c.vz)(e),f="geoLive"!==u||g?void 0:e.date+l.period-m,[v,A]=(0,i.J0)(h),y="venue"===u||"geoLive"===u&&!g,{width:C,height:w,zoom:b}=Jt,I=(0,zt.A)(),S=(0,c.rt)(v,C,w,b,I),M=(0,ge.A)(S),N=(0,R.A)(M,!0),k=M||N,Y=(0,i.Kr)((()=>{if("geoLive"!==u||!v.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=v;return t/(0,Rt._u)(e,b)}),[u,v,b]),P=(0,L.A)((t=>{if("geoLive"!==u)return;const n=t.lastElementChild,i=t.firstElementChild,o=e.date+l.period-(0,pt.Fm)(),s=(1-o/l.period)*jt,a=(0,ht.dq)(r,1e3*o);i.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)}));function F(){const e=(0,p.A)("pin",u,g&&"expired");if("geoLive"===u)return(0,Ae.FD)("div",{className:e,children:[(0,Ae.Y)($t,{}),(0,Ae.Y)(de.A,{peer:t,className:"location-avatar"}),void 0!==l.heading&&(0,Ae.Y)("div",{className:"direction",style:`--direction: ${l.heading}deg`})]});if("venue"===u){const t=(0,Rt.PP)(l.venueType),n=(0,Rt.KE)(l.venueType);if(n)return(0,Ae.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,Ae.Y)($t,{}),(0,Ae.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,Ae.Y)("img",{className:e,draggable:!1,src:Kt,alt:""})}return(0,i.Nf)((()=>{a.current&&P(a.current)}),[P]),(0,i.vJ)((()=>{Math.abs(h.lat-v.lat)<Vt&&Math.abs(h.long-v.long)<Vt?v.accuracyRadius!==h.accuracyRadius&&A({...v,accuracyRadius:h.accuracyRadius}):A(h)}),[h,v]),(0,Ot.A)((()=>{d()}),g?void 0:1e3*(f||0)),(0,Dt.A)((()=>{(0,Q.RK)((()=>{const e=a.current;e&&P(e)}))}),f?1e3:void 0),(0,Ae.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:v,zoom:b})},children:[(0,Ae.FD)("div",{className:"map-wrapper",children:[k?(0,Ae.Y)("img",{className:"full-media map",src:k,alt:"Location on a map",draggable:!1,style:`width: ${Jt.width}px; height: ${Jt.height}px;`}):(0,Ae.Y)(lt.A,{width:C,height:w}),function(){if(k)return(0,Ae.FD)(Ae.FK,{children:[Boolean(Y)&&!g&&(0,Ae.Y)("div",{className:"location-accuracy",style:`width: ${2*Y}px; height: ${2*Y}px`}),F()]})}()]}),function(){if(y)return"venue"===u?(0,Ae.FD)("div",{className:"location-info",children:[(0,Ae.Y)("div",{className:"location-info-title",children:l.title}),(0,Ae.Y)("div",{className:"location-info-subtitle",children:l.address})]}):"geoLive"===u?(0,Ae.FD)("div",{className:"location-info",children:[(0,Ae.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,Ae.Y)("div",{className:"location-info-subtitle",children:(0,ht.IF)(r,m,e.editDate)}),!g&&(0,Ae.FD)("div",{className:"geo-countdown",ref:a,children:[(0,Ae.Y)("span",{className:"geo-countdown-text"}),(0,Ae.Y)("svg",{width:"32px",height:"32px",children:(0,Ae.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":jt,"stroke-dashoffset":"0"})})]})]}):void 0}()]})}));var Gt=n(48906),Ht=n(97676),Wt=n(48775),_t=n(45);const Qt=(0,i.ph)((({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:c,isTranslated:d,isPinned:l,withFullDate:u,effectEmoji:h,onClick:m,onTranslationClick:g,onEffectClick:f,onOpenThread:v,paidMessageStars:A})=>{const{showNotification:y}=(0,o.ko)(),[C,b]=(0,D.A)(),I=(0,B.A)(),S=(0,qe.A)();function M(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const N=(0,i.Kr)((()=>{if(!C)return;const t=(0,ht.L2)(1e3*e.date,I.code,void 0,I.timeFormat),n=e.isEdited&&(0,ht.L2)(1e3*e.editDate,I.code,void 0,I.timeFormat),i=e.forwardInfo&&(0,ht.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),I.code,void 0,I.timeFormat);let o=t;return n&&(o+="\n",o+=S("MessageTooltipEditedDate",{date:n})),i&&(o+="\n",o+=S("MessageTooltipForwardedDate",{date:i})),o}),[C,I,e,I.timeFormat]),k=(0,i.Kr)((()=>{if(!e.viewsCount)return;let t=S("MessageTooltipViews",{count:S.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=S("MessageTooltipForwards",{count:S.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t}),[S,e.forwardsCount,e.viewsCount]),Y=(0,i.Kr)((()=>{const e=a?.messagesCount;if(e)return S("MessageTooltipReplies",{count:e},{pluralValue:e})}),[S,a]),P=(0,i.Kr)((()=>{const t=(0,ht.fU)(I,1e3*e.date);return u?(0,ht.be)(I,1e3*(e.forwardInfo?.date||e.date),!0):t}),[I,e.date,e.forwardInfo?.date,u]),F=(0,p.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,Ae.FD)("span",{className:F,dir:S.isRtl?"rtl":"ltr",onClick:m,"data-ignore-on-paste":!0,children:[h&&(0,Ae.Y)("span",{className:"message-effect-icon",onClick:f,children:(0,w.A)(h)}),d&&(0,Ae.Y)(fe.A,{name:"language",className:"message-translated",onClick:g}),Boolean(e.viewsCount)&&(0,Ae.FD)(Ae.FK,{children:[(0,Ae.Y)("span",{className:"message-views",title:k,children:(0,$e.Vw)(S,e.viewsCount)}),(0,Ae.Y)(fe.A,{name:"channelviews"})]}),!c&&Boolean(a?.messagesCount)&&(0,Ae.FD)("span",{onClick:function(e){e.stopPropagation(),v()},className:"message-replies-wrapper",title:Y,children:[(0,Ae.Y)("span",{className:"message-replies",children:(0,Ae.Y)(He.A,{text:(0,$e.Vw)(S,a.messagesCount)})}),(0,Ae.Y)(fe.A,{name:"reply-filled"})]}),l&&(0,Ae.Y)(fe.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,Ae.Y)("span",{className:"message-signature",children:(0,w.A)(n)}),Boolean(A)&&(0,Ae.Y)("span",{className:"message-price",children:(0,Wt.U)(S,A,{asFont:!0,className:"message-price-star-icon",containerClassName:"message-price-stars-container"})}),(0,Ae.FD)("span",{className:"message-time",title:N,onMouseEnter:b,children:[e.forwardInfo?.isImported&&(0,Ae.FD)(Ae.FK,{children:[(0,Ae.Y)("span",{className:"message-imported",onClick:M,children:(0,ht.L2)(1e3*e.forwardInfo.date,S.code,!0)}),(0,Ae.Y)("span",{className:"message-imported",onClick:M,children:S("MessageMetaImported")})]}),e.isEdited&&`${S("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${S("MessageMetaApproximate")} `,P]}),t&&(0,Ae.Y)(_t.A,{status:t}),r&&r()]})}));var Zt=n(4262);const Xt=(0,i.ph)((({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,o.ko)(),a=(0,B.A)(),{isVideo:r,reason:c,duration:d}=e,l=t.isOutgoing,u="missed"===c,h="busy"===c||void 0===d,g=(0,L.A)((()=>{s({isVideo:r,userId:n})})),f=(0,i.Kr)((()=>e.duration?(0,ht.zA)(a,e.duration):void 0),[a,e.duration]),v=(0,ht.fU)(a,1e3*t.date);return(0,Ae.FD)("div",{className:"wqsZyy8u",children:[(0,Ae.Y)(Te.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:g,className:"NGmo4ADz",disabled:!m.OL,ariaLabel:a(l?"CallAgain":"CallBack"),children:(0,Ae.Y)(fe.A,{name:r?"video-outlined":"phone"})}),(0,Ae.FD)("div",{className:"iFn6m6hd",children:[(0,Ae.Y)("div",{className:"l8QfocIQ",children:a((0,Zt.fB)(e,t.isOutgoing))}),(0,Ae.FD)("div",{className:"rF5tkx92",children:[(0,Ae.Y)(fe.A,{name:"arrow-right",className:(0,p.A)("ONmpzmUS",u&&"Alra_BWu",h&&"J7xsuCAm",!l&&"BfgDXljM")}),(0,Ae.Y)("span",{className:"kKPKwFzu",children:f?a("CallMessageWithDuration",[v,f]):v})]})]})]})}));var en=n(98607);const tn=(0,i.ph)((({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:c}=(0,o.ko)(),d=(0,B.A)(),l=(0,qe.A)(),u=!e.isBought,h=(0,i.Kr)((()=>{const t=d("UnlockPaidContent",e.starsAmount);return(0,en.i)(t,r.Cyx,(0,Ae.Y)(be.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))}),[d,e]),m=(0,L.A)((e=>{c({type:"message",chatId:t,messageId:n}),(0,v.A)(e)}));return(0,Ae.FD)("div",{className:"mVaSjZRJ",onClick:u?m:void 0,children:[a,u&&(0,Ae.Y)(Te.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,Ae.Y)("span",{className:"gLaaVQXr",children:h})}),e.isBought&&(0,Ae.Y)("div",{className:(0,p.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,Wt.U)(l,e.starsAmount):d("Chat.PaidMedia.Purchased")})]})}));var nn=n(26875),on=n(77561),sn=n(1087);function an(e,t){return t>0?(e/t*100).toFixed():0}const rn=({answer:e,voteResults:t,totalVoters:n,maxVotersCount:o,correctResults:s,shouldAnimate:a})=>{const r=(0,qe.A)(),c=t&&t.find((t=>t.option===e.option)),d=0===s.length||-1!==s.indexOf(e.option),l=s.length>0&&d||c?.isChosen,u=c?an(c.votersCount,n||0):0,[h,m]=(0,i.J0)(a?0:u),g=c?an(c.votersCount,o||0):0,f=h!==u;if((0,i.vJ)((()=>{a&&m(u)}),[a,u]),!t||!c)return;const v=`width: ${g}%; transform:scaleX(${f?0:1})`;return(0,Ae.FD)("div",{className:"PollOption",dir:r.isRtl?"rtl":void 0,children:[(0,Ae.FD)("div",{className:"poll-option-share "+("100"===u?"limit-width":""),children:[u,"%",l&&(0,Ae.Y)("span",{className:(0,p.A)("poll-option-chosen",!d&&"wrong",a&&"animate"),children:(0,Ae.Y)(fe.A,{name:d?"check":"close",className:"poll-option-icon"})})]}),(0,Ae.FD)("div",{className:"poll-option-right",children:[(0,Ae.Y)("div",{className:"poll-option-text",dir:"auto",children:(0,st.fd)({text:e.text.text,entities:e.text.entities})}),(0,Ae.FD)("div",{className:(0,p.A)("poll-option-answer",l&&!d&&"wrong"),children:[a&&(0,Ae.Y)("svg",{className:"poll-line",style:f?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44",children:(0,Ae.Y)("path",{d:"M4.47 5.33v13.6a9 9 0 009 9h13"})}),(0,Ae.Y)("div",{className:"poll-option-line",style:v})]})]})]})},cn=12*Math.PI;function dn(e){return void 0===e.isPublic?" ":e.closed?"FinalResults":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.isPublic?"PublicPoll":"AnonymousPoll"}function ln(e,t,n){return n?e(t?"Answer":"Vote",n,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}function un(e){e.stopPropagation()}const hn=(0,i.ph)((({message:e,poll:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:s,onSendVote:a})=>{const{loadMessage:r,openPollResults:c,requestConfetti:d,showNotification:l}=(0,o.ko)(),{id:h,chatId:m}=e,{summary:p,results:g}=t,[v,A]=(0,i.J0)(!1),[y,C]=(0,i.J0)([]),[w,b]=(0,i.J0)(!1),[I,S]=(0,i.J0)(!p.closed&&p.closeDate&&p.closeDate>0?Math.min(p.closeDate-(0,pt.Fm)(),p.closePeriod):0),M=(0,i.li)(),N=(0,i.li)(),{results:k,totalVoters:Y}=g,P=k&&k.some((e=>e.isChosen)),F=!p.closed&&!P,T=!F&&p.isPublic&&Number(g.totalVoters)>0,x=F&&p.multipleChoice,D=g.recentVoterIds,E=k?Math.max(...k.map((e=>e.votersCount))):Y,R=(0,i.Kr)((()=>k?.filter((e=>e.isCorrect)).map((e=>e.option))||[]),[k]),O=(0,i.Kr)((()=>p.answers.map((e=>({label:(0,st.fd)({text:e.text.text,entities:e.text.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s}),value:e.option,hidden:Boolean(p.quiz&&p.closePeriod&&I<=0)})))),[I,n,s,p.answers,p.closePeriod,p.quiz]);(0,i.vJ)((()=>{const e=t.results.results?.find((e=>e.isChosen));v&&e&&(e.isCorrect&&d({}),A(!1))}),[v,t.results.results,d]),(0,i.Nf)((()=>{if(I>0&&setTimeout((()=>S(I-1)),1e3),!N.current)return;I<=5&&M.current.classList.add("hurry-up");const e=(p.closePeriod-I)/p.closePeriod*cn;N.current.setAttribute("stroke-dashoffset",`-${e}`)}),[I,p.closePeriod]),(0,i.vJ)((()=>{p.quiz&&(I<=0||P&&!p.closed)&&r({chatId:m,messageId:h})}),[m,I,P,r,h,p.closed,p.quiz]),(0,i.vJ)((()=>{let e;return p.quiz&&!p.closed&&p.closePeriod&&p.closePeriod>0&&(e=window.setTimeout((()=>{r({chatId:m,messageId:h})}),1e3*p.closePeriod)),()=>{e&&window.clearTimeout(e)}}),[F,m,r,h,p.closePeriod,p.closed,p.quiz]);const U=(0,i.Kr)((()=>{const e=(0,o.mS)();return D?D.reduce(((t,n)=>{const i=(0,u.PVB)(e,n);return i&&t.push(i),t}),[]):[]}),[D]),z=(0,L.A)((e=>{C([e]),A(!0),b(!0),a([e])})),K=(0,L.A)((e=>{C(e)})),j=(0,L.A)((()=>{A(!0),b(!0),a(y)})),V=(0,L.A)((()=>{c({chatId:m,messageId:h})})),J=(0,L.A)((()=>{l({localId:(0,f.bj)(e),message:(0,st.fd)({text:t.results.solution,entities:t.results.solutionEntities}),duration:5e3,containerSelector:"#middle-column-portals"})}));(0,i.vJ)((()=>{w&&P&&p.quiz&&g.results&&t.results.solution&&(g.results.find((e=>e.isChosen&&e.isCorrect))||J())}),[P,w,g.results,p.quiz,t.results.solution]);const $=(0,B.A)();return(0,Ae.FD)("div",{className:"Poll",dir:$.isRtl?"auto":"ltr",children:[(0,Ae.Y)("div",{className:"poll-question",children:(0,st.fd)({text:p.question.text,entities:p.question.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s})}),(0,Ae.FD)("div",{className:"poll-type",children:[$(dn(p)),U.length>0&&(0,Ae.Y)("div",{className:"poll-recent-voters",children:(0,Ae.Y)(nn.A,{size:"micro",peers:U})}),I>0&&F&&(0,Ae.FD)("div",{ref:M,className:"poll-countdown",children:[(0,Ae.Y)("span",{children:(0,ht.QO)(I)}),(0,Ae.Y)("svg",{width:"16px",height:"16px",children:(0,Ae.Y)("circle",{ref:N,cx:"8",cy:"8",r:6,className:"poll-countdown-progress",transform:"rotate(-90, 8, 8)","stroke-dasharray":cn,"stroke-dashoffset":"0"})})]}),p.quiz&&t.results.solution&&!F&&(0,Ae.Y)(Te.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:J,ariaLabel:"Show Solution",children:(0,Ae.Y)(fe.A,{name:"lamp"})})]}),F&&(0,Ae.Y)("div",{className:"poll-answers",onClick:un,children:x?(0,Ae.Y)(on.A,{options:O,selected:y,onChange:K,disabled:e.isScheduled||v,loadingOptions:v?y:void 0,isRound:!0}):(0,Ae.Y)(sn.A,{name:`poll-${h}`,options:O,onChange:z,disabled:e.isScheduled||v,loadingOption:v?y[0]:void 0})}),!F&&(0,Ae.Y)("div",{className:"poll-results",children:p.answers.map((function(e){return(0,Ae.Y)(rn,{shouldAnimate:w||!F,answer:e,voteResults:k,totalVoters:Y,maxVotersCount:E,correctResults:R},e.option)}))}),!T&&!x&&(0,Ae.Y)("div",{className:"poll-voters-count",children:ln($,p.quiz,g.totalVoters)}),x&&(0,Ae.Y)(Te.A,{isText:!0,disabled:0===y.length,size:"tiny",onClick:j,children:$("PollSubmitVotes")}),T&&(0,Ae.Y)(Te.A,{isText:!0,size:"tiny",onClick:V,children:$("PollViewResults")})]})}));var mn=n(43581),pn=n(84555),gn=n(10221),fn=n(18104),vn=n(82855),An=n(3325);const yn="GydRBA08",Cn=({message:e,observeIntersection:t,observeIntersectionForPlaying:n,shouldLoop:a,shouldPlayEffect:r,withEffect:d,onStopEffect:l})=>{const{showNotification:u,openStickerSet:h}=(0,o.ko)(),g=(0,B.A)(),{isMobile:f}=(0,P.Ay)(),v=(0,i.li)(),A=(0,i.li)(),C=e.content.sticker,{stickerSetInfo:w,isVideo:b,hasEffect:I}=C,S=!e.isOutgoing,M=C.isPreloadedGlobally?void 0:(0,c.Mw)(C,b&&!m.OF?"pictogram":"inline"),N=(0,E.Vz)(v,t),k=(0,E.Vz)(v,n),Y=`sticker${C.id}?size=f`,F=(0,ge.A)(Y,!N||!I||!d,s.qZ.BlobUrl),[T,x,R]=(0,D.A)(),O=(0,L.A)((()=>{R(),l?.()}));(0,i.vJ)((()=>{I&&d&&k&&r&&x()}),[I,k,r,x,d]);const U=I&&d&&F&&T;(0,gn.A)({anchorRef:v,overlayRef:A,isMirrored:S,isDisabled:!U});const z=(0,L.A)((()=>{h({stickerSetInfo:C.stickerSetInfo})})),K=(0,L.A)((()=>{if(I){if(T||!d)return void u({message:g("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:C.stickerSetInfo}},actionText:g("ViewAction")});if(d)return void x()}z()})),j="isMissing"in w,{width:V,height:J}=(0,y.bu)(C,f),$=(0,p.A)("media-inner","FPceNkgD",j&&"hruUWBuj",I&&S&&yn);return(0,Ae.FD)("div",{ref:v,className:$,style:`width: ${V}px; height: ${J}px;`,onClick:j?void 0:K,children:[(0,Ae.Y)(vn.A,{containerRef:v,sticker:C,fullMediaHash:M,fullMediaClassName:"full-media",size:V,shouldLoop:a,noLoad:!N,noPlay:!k,withSharedAnimation:!0}),U&&(0,Ae.Y)(An.A,{children:(0,Ae.Y)(fn.A,{ref:A,className:(0,p.A)("WMMaWlOL",S&&yn),tgsUrl:F,size:1.49*V,play:!0,isLowPriority:!0,noLoop:!0,onEnded:O},Y)})]})};var wn=n(70297);const bn=(0,i.ph)((0,o.EK)(((e,{message:t})=>{const{id:n,peerId:i}=t.content.storyData;return{story:(0,u.Msb)(e,i,n),isConnected:"connectionStateReady"===e.connectionState}}))((function({message:e,story:t,isProtected:n,isConnected:i}){const{storyData:o}=e.content;return(0,Ae.Y)(wn.A,{story:t||o,isProtected:n,isConnected:i})}))),In=(0,i.ph)((0,o.EK)(((e,{message:t})=>{const{id:n,peerId:i}=t.content.storyData,o=(0,u._bp)(e,i)?.lastReadId;return{story:(0,u.Msb)(e,i,n),peer:(0,u.PVB)(e,i),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(o&&o<n)}}))((function({message:e,story:t,peer:n,isUnread:i,targetUser:s}){const{openStoryViewer:a}=(0,o.ko)(),r=(0,B.A)(),{storyData:l}=e.content,u=(0,L.A)((()=>{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})})),h=t&&"isDeleted"in t,m=t&&"content"in t,g=m?t.content.video:void 0,f=m?(0,c.EN)(t,"pictogram"):void 0,v=(0,ge.A)(f)||g?.thumbnail?.dataUri;return(0,x.A)(l.peerId,l.id,t),(0,Ae.FD)("div",{className:(0,p.A)("action-message-story-mention",i&&"is-unread",m&&"with-preview"),tabIndex:0,role:"button",onClick:m?u:void 0,children:[m&&(0,Ae.Y)("span",{className:"story-media-wrapper",children:v&&(0,Ae.Y)("img",{src:v,alt:"",className:"story-media"})}),(0,Ae.Y)("span",{className:"story-title",children:(0,w.A)(n&&"isSelf"in n&&n.isSelf?r(h?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,c.u0)(s)):h?r("ExpiredStoryMention"):r("StoryMentionedTitle",(0,d.F9)(r,n)),["emoji","simple_markdown"])})]})})));var Sn=n(14647);const Mn=1.75*y.$,Nn=2.25*y.$,kn=(0,i.ph)((0,o.EK)(((e,t)=>{const{focusedMessage:n,forwardMessages:i,activeReactions:o,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:d,album:p,withSenderName:v,withAvatar:A,threadId:y,messageListType:C,isLastInDocumentGroup:w,isFirstInGroup:b}=t,{id:I,chatId:S,viaBotId:M,isOutgoing:N,forwardInfo:k,transcriptionId:Y,isPinned:P,viaBusinessBotId:F,effectId:T,paidMessageStars:x}=d,{shouldWarnAboutSvg:D}=(0,h.l)(e),E=(0,g.L8)(S),L=(0,u.hds)(e,S),B=(0,u.nZ4)(e,S),R=(0,c.DX)(S),O=(0,c.Qe)(S),U=L&&(0,c.WX)(L),z=L&&(0,c.YE)(L),K=E?void 0:(0,u.AWZ)(e,S),j=d.content.webPage?.story,V=j?(0,u.Msb)(e,j.peerId,j.id):void 0,J=i.messageIds&&i.messageIds.includes(I),$=!B&&(0,c.zP)(d),q=v||A||$,G=(0,u.Y7C)(e,d),H=(0,u.Szq)(e,d),W=M?(0,u.mBe)(e,M):void 0,_=G?.id&&z?K?.adminMembersById?.[G?.id]:void 0,Q=d.id===y,{replyToMsgId:Z,replyToPeerId:X,replyFrom:ee}=(0,l.Q)(d)||{},{peerId:te,storyId:ne}=(0,l.W)(d)||{},ie=Z&&Z===y,oe=(0,u.gMr)(e,d),se=k||ee,ae=oe?(0,u.Y7C)(e,oe):!se||R||O?void 0:(0,u.HdA)(e,se),re=oe&&(0,u.Szq)(e,oe),ce=X?(0,u.hds)(e,X):void 0,de=!R&&!O&&ce&&!(0,c.gA)(ce)&&(ce.isNotJoined||ce.isRestricted),le="topicCreate"===oe?.content.action?.type,ue=ne&&te?(0,u.Msb)(e,te,ne):void 0,he=te?(0,u.PVB)(e,te):void 0,me=(0,u.ldX)(e,d),pe="thread"===C&&(p?p.messages.some((t=>(0,u.nJv)(e,t,y))):(0,u.nJv)(e,d,y)),{direction:ge,noHighlight:fe,isResizingContainer:ve,quote:Ae,quoteOffset:ye,scrollTargetPosition:Ce}=pe&&n||{},we=(0,u.TCk)(e),be=we?.results?.query&&`${we.isHashtag?"#":""}${we.results.query}`,Ie=(0,c.wb)(d),Se=Ie&&(0,u.oei)(e,Ie)?Ie:void 0,Me=(0,c.Jw)(d);let Ne;Ne=p?.messages?p.messages.every((({id:t})=>(0,u.H1_)(e,t))):(0,u.H1_)(e,I);const ke="thread"===C&&(0,u.tOf)(e,d,y),Ye=(0,u.yuw)(e),Pe=(0,c.ed)(d),Fe=Pe&&(0,c.$r)(Ye,Pe),Te=(0,u.Vw0)(e,S,p?.commentsMessage?.id||I),xe=Boolean(d.groupedId)&&!d.isInAlbum,De=xe?(0,u.D_S)(e,S,d.groupedId)[0]:void 0,Ee=xe?w?(0,u.O5q)(e,S,De):void 0:d,Le=L?.unreadReactions?.includes(d.id),Be=y===s.l3&&L?.isForum&&b,Re=Be?(0,u.nkm)(e,d):void 0,Oe=(0,u.RnX)(e,S),Ue=(0,u.Rny)(e,S,d.id),ze=(0,u.qZq)(e,S),Ke=m.CM&&e.settings.byKey.canTranslate&&!ze,je="connectionStateReady"===e.connectionState,Ve=Boolean(Ee&&o[(0,f.bj)(Ee)]?.length),Je=(0,u.g29)(e),$e=G&&(0,u.nZ4)(e,G.id)?K?.boostsApplied??d.senderBoosts:d.senderBoosts,qe=L?.boostLevel||0,Ge=e.appConfig?.groupTranscribeLevelMin,He=Je||Boolean(Ge&&qe>=Ge),We=F?(0,u.mBe)(e,F):void 0,_e=T?e.availableEffectById[T]:void 0,Qe=(0,u.zcZ)(e,d),Ze=(0,u.meW)(e,d),Xe=(0,u.xd0)(e,S,d.id),et=(0,u.trm)(e);return{theme:(0,u.SJA)(e),forceSenderName:$,sender:G,canShowSender:q,originSender:H,botSender:W,shouldHideReply:ie||le,isThreadTop:Q,replyMessage:oe,replyMessageSender:ae,replyMessageForwardSender:re,replyMessageChat:ce,replyStory:ue,isReplyPrivate:de,storySender:he,isInDocumentGroup:xe,isProtected:(0,u.ynf)(e,d),isChatProtected:(0,u.ryq)(e,S),isFocused:pe,isForwarding:J,reactionMessage:Ee,isChatWithSelf:B,isRepliesChat:R,isAnonymousForwards:O,isChannel:U,isGroup:z,canReply:ke,highlight:be,animatedEmoji:Se,animatedCustomEmoji:Me,isInSelectMode:(0,u.rTV)(e),isSelected:Ne,isGroupSelected:Boolean(d.groupedId)&&!d.isInAlbum&&(0,u.SLS)(e,S,d.groupedId),threadId:y,isDownloading:Fe,isPinnedList:"pinned"===C,isPinned:P,canAutoLoadMedia:(0,u.wwb)(e,d),canAutoPlayMedia:(0,u.OEt)(e,d),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:Te,availableReactions:e.reactions.availableReactions,defaultReaction:(0,c.Nb)(d)||"scheduled"===C?void 0:(0,u.nTJ)(e,S),hasActiveReactions:Ve,activeEmojiInteractions:a,hasUnreadReaction:Le,isTranscribing:void 0!==Y&&e.transcriptions[Y]?.isPending,transcribedText:void 0!==Y?e.transcriptions[Y]?.text:void 0,isPremium:Je,senderAdminMember:_,messageTopic:Re,hasTopicChip:Be,chatTranslations:Oe,areTranslationsEnabled:Ke,shouldDetectChatLanguage:(0,u.LRV)(e,S),requestedTranslationLanguage:Ue,requestedChatTranslationLanguage:ze,hasLinkedChat:Boolean(K?.linkedChatId),withAnimatedEffects:(0,u.xYJ)(e,"stickerEffects"),webPageStory:V,isConnected:je,isLoadingComments:Te?.isCommentsInfo&&r?.loadingChatId===Te?.originChannelId&&r?.loadingMessageId===Te?.originMessageId,shouldWarnAboutSvg:D,...N&&{outgoingStatus:(0,u.Tl2)(e,d,"scheduled"===C)},..."number"==typeof me&&{uploadProgress:me},...pe&&{focusDirection:ge,noFocusHighlight:fe,isResizingContainer:ve,focusedQuote:Ae,focusedQuoteOffset:ye,scrollTargetPosition:Ce},senderBoosts:$e,tags:e.savedReactionTags?.byKey,canTranscribeVoice:He,viaBusinessBot:We,effect:_e,poll:Qe,maxTimestamp:Ze,lastPlaybackTimestamp:Xe,paidMessageStars:x,isChatWithUser:E,isAccountFrozen:et}}))((({message:e,observeIntersectionForBottom:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,album:h,noAvatars:g,withAvatar:f,withSenderName:S,noComments:N,noReplies:k,appearanceOrder:z,isJustAdded:K,isFirstInGroup:$,isPremium:Q,isLastInGroup:Z,isFirstInDocumentGroup:X,isLastInDocumentGroup:ee,isTranscribing:te,transcribedText:ne,isLastInList:ie,theme:oe,forceSenderName:ae,sender:re,canShowSender:pe,originSender:ge,botSender:ve,isThreadTop:ye,shouldHideReply:Me,replyMessage:Ne,replyMessageSender:ke,replyMessageForwardSender:Ye,replyMessageChat:xe,replyStory:Le,isReplyPrivate:Be,storySender:Oe,outgoingStatus:Ue,uploadProgress:ze,isInDocumentGroup:Ke,isLoadingComments:Ve,isProtected:$e,isChatProtected:qe,isFocused:Ge,focusDirection:He,focusedQuote:We,focusedQuoteOffset:Qe,noFocusHighlight:Ze,scrollTargetPosition:Xe,isResizingContainer:et,isForwarding:nt,isChatWithSelf:it,isRepliesChat:st,isAnonymousForwards:at,isChannel:rt,isGroup:ct,canReply:lt,highlight:ht,animatedEmoji:mt,animatedCustomEmoji:pt,hasActiveReactions:gt,hasLinkedChat:ft,isInSelectMode:vt,isSelected:At,isGroupSelected:yt,threadId:Ct,reactionMessage:wt,availableReactions:bt,defaultReaction:It,activeEmojiInteractions:St,messageListType:Nt,isPinnedList:Yt,isPinned:Pt,isDownloading:Ft,canAutoLoadMedia:Tt,canAutoPlayMedia:Dt,shouldLoopStickers:Et,autoLoadFileMaxSizeMb:Lt,repliesThreadInfo:Rt,hasUnreadReaction:Ot,memoFirstUnreadIdRef:Ut,senderAdminMember:zt,messageTopic:Kt,hasTopicChip:jt,chatTranslations:Vt,areTranslationsEnabled:Jt,shouldDetectChatLanguage:$t,requestedTranslationLanguage:Wt,requestedChatTranslationLanguage:_t,withAnimatedEffects:Zt,webPageStory:en,isConnected:nn,getIsMessageListReady:on,shouldWarnAboutSvg:sn,senderBoosts:an,tags:rn,canTranscribeVoice:cn,viaBusinessBot:dn,effect:ln,poll:un,maxTimestamp:gn,lastPlaybackTimestamp:fn,onIntersectPinnedMessage:vn,paidMessageStars:An,isChatWithUser:yn,isAccountFrozen:wn})=>{const{toggleMessageSelection:kn,clickBotInlineButton:Yn,disableContextMenuHint:Pn,animateUnreadReaction:Fn,focusLastMessage:Tn,markMentionsRead:xn}=(0,o.ko)(),Dn=(0,i.li)(),En=(0,i.li)(),Ln=(0,i.li)(),Bn=(0,B.A)(),[Rn,On]=(0,i.J0)(!1),[Un,zn]=(0,i.J0)(!1),[Kn,jn]=(0,i.J0)(!1),[Vn,Jn,$n]=(0,D.A)(),{isMobile:qn,isTouchScreen:Gn}=(0,P.Ay)();(0,E.mv)(En,t);const{isContextMenuOpen:Hn,contextMenuAnchor:Wn,contextMenuTarget:_n,handleBeforeContextMenu:Qn,handleContextMenu:Zn,handleContextMenuClose:Xn,handleContextMenuHide:ei}=(0,F.A)(Dn,Gn&&vt||wn,!m.cp,m.Ni,on);(0,i.vJ)((()=>{Hn&&Pn()}),[Hn,Pn]);const ti=z<=0,[ni,ii]=(0,D.A)(ti);(0,i.vJ)((()=>{ti||setTimeout(ii,z*r.zq7)}),[z,ii,ti]),(0,U.A)({ref:Dn,isOpen:ni||K,noMountTransition:ti&&!K,className:!1});const{id:oi,chatId:si,forwardInfo:ai,viaBotId:ri,isTranscriptionError:ci,factCheck:di}=e;(0,i._W)((()=>{if(e.isPinned){const e=h?h.mainMessage.id:oi;vn?.({viewportPinnedIdsToRemove:[e]})}}));const li=(0,c.Nb)(e),ui=(0,c.Ie)(e),hi="scheduled"===Nt||e.isScheduled,mi=(0,c.Tv)(e)&&!Me,{paidMedia:pi}=(0,c.r_)(e),{photo:gi,video:fi}=I(pi),{photo:vi=gi,video:Ai=fi,audio:yi,voice:Ci,document:wi,sticker:bi,contact:Ii,webPage:Si,invoice:Mi,location:Ni,action:ki,game:Yi,storyData:Pi,giveaway:Fi,giveawayResults:Ti}=(0,c.r_)(e),xi=(0,l.Q)(e),Di=(0,l.W)(e),Ei=Boolean(!Rn&&(ci||ne)),Li=Boolean(Di),Bi=Boolean(Rt)&&"thread"===Nt,Ri=!Ei&&(0,c.aN)(e),Oi=Ri&&(mt||pt),Ui=wt?.reactions&&!(0,c.G)(wt.reactions),zi=ai&&(!it||hi)&&!st&&!ai.isLinkedChannelPost&&!at&&!ve||Boolean(Pi&&!Pi.isMention),Ki=Boolean(an)&&!zi&&$,ji=Pi?.isMention,Vi="video"===Ai?.mediaType&&Ai.isRound,Ji=Boolean(h)&&(h.isPaidMedia&&pi.extendedMedia.length>1||h.messages.length>1)&&!h.messages.some((e=>0===Object.keys(e.content).length)),$i=Ke&&!X,qi=Ke&&!ee,Gi=void 0!==Wn,Hi=!(Gi||vt||nt||qi||ji||(bi||Oi)&&zi),Wi=rt&&!hi&&e.isForwardingAllowed&&!qe,_i=Boolean(Yt||ai&&(ai.isChannelPost||it||st||at)&&ai.fromMessageId),Qi=Boolean(di?.text),Zi=zi&&Ri,Xi=jt||mi||Li||Zi,eo=(0,L.A)(((e,t)=>{wn||kn({messageId:oi,groupedId:t,...e?.shiftKey&&{withShift:!0},...Ji&&{childMessageIds:h.messages.map((({id:e})=>e))}})})),to=pe?re:void 0,no=ai&&(it||st||at||!to)?ge:to,io=zi?ge:re,oo=ui&&!Ri,so=ai||Pi?ge:to,ao=(0,c.G5)(e),{handleMouseDown:ro,handleClick:co,handleContextMenu:lo,handleDoubleClick:uo,handleContentDoubleClick:ho,handleMouseMove:mo,handleSendQuickReaction:po,handleMouseLeave:go,isSwiped:fo,isQuickReactionVisible:vo,handleDocumentGroupMouseEnter:Ao}=se(eo,Dn,oi,Boolean(vt),Boolean(lt),Boolean($e),Zn,Qn,si,Gi,Ln,qi,on),{handleSenderClick:yo,handleViaBotClick:Co,handleReplyClick:wo,handleMediaClick:bo,handleDocumentClick:Io,handleAudioPlay:So,handleAlbumMediaClick:Mo,handlePhotoMediaClick:No,handleVideoMediaClick:ko,handleMetaClick:Yo,handleTranslationClick:Po,handleOpenThread:Fo,handleReadMedia:To,handleCancelUpload:xo,handleVoteSend:Do,handleGroupForward:Eo,handleForward:Lo,handleFocus:Bo,handleFocusForwarded:Ro,handleDocumentGroupSelectAll:Oo,handleTopicChipClick:Uo,handleStoryClick:zo}=function({lang:e,selectMessage:t,message:n,chatId:i,threadId:r,isInDocumentGroup:d,asForwarded:u,isScheduled:h,album:m,senderPeer:p,botSender:g,messageTopic:f,isTranslatingChat:v,story:A,isReplyPrivate:y,isRepliesChat:C,isSavedMessages:w,lastPlaybackTimestamp:b}){const{openChat:I,showNotification:S,focusMessage:M,openMediaViewer:N,openAudioPlayer:k,markMessagesRead:Y,cancelUploadMedia:P,sendPollVote:F,openForwardMenu:T,openChatLanguageModal:x,openThread:D,openStoryViewer:E,searchChatMediaMessages:B}=(0,o.ko)(),{id:R,forwardInfo:O,groupedId:U,content:{paidMedia:z,video:K,webPage:j}}=n,{replyToMsgId:V,replyToPeerId:J,replyToTopId:$,isQuote:q,quoteText:G,quoteOffset:H}=(0,l.Q)(n)||{},_=(0,L.A)((()=>{p?u&&O?.channelPostId?M({chatId:p.id,messageId:O.channelPostId}):I({id:p.id}):S({message:e("HidAccount")})})),Q=(0,L.A)((()=>{g&&I({id:g.id})})),Z=(0,L.A)((()=>{V&&!y?C&&J&&$?D({isComments:!0,originChannelId:J,originMessageId:$,focusMessageId:V}):M({chatId:J||i,threadId:C?$:r,messageId:V,replyMessageId:J?void 0:R,noForumTopicPanel:!J,...q&&{quote:G?.text,quoteOffset:H}}):S({message:e(q?"QuotePrivate":"ReplyPrivate")})})),X=(0,L.A)((()=>{N({chatId:i,threadId:r,messageId:R,origin:h?a.TQ.ScheduledInline:a.TQ.Inline})})),ee=(0,L.A)((e=>{if(z&&!z.isBought)return;e&&B({chatId:i,threadId:r,currentMediaMessageId:R});const t=j?.url&&(0,W.vG)(j.url),n=K||j?.video,o=t&&"timestamp"in t?t.timestamp:void 0;N({chatId:i,threadId:r,messageId:R,origin:h?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:b||n?.timestamp||o,withDynamicLoading:e})})),te=(0,L.A)((()=>{ee(!h&&!z)})),ne=(0,L.A)((()=>{const e=n.content?.video?.isGif;ee(!e&&!h&&!z)})),ie=(0,L.A)((()=>{((0,c.yl)(n)||(0,c.dc)(n))&&te(),ne()})),oe=(0,L.A)((()=>{k({chatId:i,messageId:R})})),se=(0,L.A)(((e,t)=>{z&&!z.isBought||(B({chatId:i,threadId:r,currentMediaMessageId:R}),N({chatId:i,threadId:r,messageId:e,mediaIndex:t,origin:h?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!z}))})),ae=(0,L.A)((()=>{Y({messageIds:[R]})})),re=(0,L.A)((()=>{P({chatId:i,messageId:R})})),ce=(0,L.A)((e=>{F({chatId:i,messageId:R,options:e})})),de=(0,L.A)((()=>{T({fromChatId:i,groupedId:U})})),le=(0,L.A)((()=>{if(m&&m.messages){const e=m.messages.map((({id:e})=>e));T({fromChatId:i,messageIds:e})}else T({fromChatId:i,messageIds:[R]})})),ue=(0,L.A)((()=>{M({chatId:i,threadId:s.l3,messageId:R})})),he=(0,L.A)((()=>{const e=w&&O.savedFromPeerId||O.fromChatId;d?M({chatId:e,groupedId:U,groupedChatId:i,messageId:O.fromMessageId}):J&&$?C?D({isComments:!0,originChannelId:J,originMessageId:$,focusMessageId:O.fromMessageId}):M({chatId:J,threadId:$,messageId:O.fromMessageId}):M({chatId:e,messageId:O.fromMessageId})})),me=(0,L.A)((e=>{e.stopPropagation(),t(e,U)})),pe=(0,L.A)((e=>{e.stopPropagation(),x({chatId:i,messageId:v?void 0:R})})),ge=(0,L.A)((()=>{D({chatId:n.chatId,threadId:n.id})})),fe=(0,L.A)((()=>{f&&M({chatId:J||i,threadId:f.id,messageId:R})})),ve=(0,L.A)((()=>{A&&E({peerId:A.peerId,storyId:A.id,isSingleStory:!0})}));return{handleSenderClick:_,handleViaBotClick:Q,handleReplyClick:Z,handleDocumentClick:X,handleMediaClick:ie,handleAudioPlay:oe,handleAlbumMediaClick:se,handlePhotoMediaClick:te,handleVideoMediaClick:ne,handleMetaClick:me,handleTranslationClick:pe,handleOpenThread:ge,handleReadMedia:ae,handleCancelUpload:re,handleVoteSend:ce,handleGroupForward:de,handleForward:le,handleFocus:ue,handleFocusForwarded:he,handleDocumentGroupSelectAll:me,handleTopicChipClick:fe,handleStoryClick:ve}}({lang:Bn,selectMessage:eo,message:e,chatId:si,threadId:Ct,isInDocumentGroup:Ke,asForwarded:zi,isScheduled:hi,album:h,avatarPeer:no,senderPeer:so,botSender:ve,messageTopic:Kt,isTranslatingChat:Boolean(_t),story:Le&&"content"in Le?Le:void 0,isReplyPrivate:Be,isRepliesChat:st,isSavedMessages:it,lastPlaybackTimestamp:fn}),Ko=(0,L.A)((e=>{e.stopPropagation(),Jn()}));(0,i.vJ)((()=>{ie&&Ei&&ne&&Tn()}),[Tn,ie,ne,Ei]),(0,i.vJ)((()=>{const t=Dn.current,n=e.isInAlbum&&h?.messages.some((e=>!e.isDeleting));e.isDeleting&&t&&!n&&((0,Fe.U)(t)?zn(!0):jn(!0))}),[e.isDeleting]);const jo=h?.hasMultipleCaptions?void 0:h?.captionMessage||e,Vo=jo&&(0,c.XR)(jo),Jo=Vo||Qi,$o=(0,p.A)("Message message-list-item",$&&"first-in-group",$e&&"hide-on-print",$e&&!Vo?"is-protected":"allow-selection",Z&&"last-in-group",X&&"first-in-document-group",ee&&"last-in-document-group",ie&&"last-in-list",ui&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",mi&&"has-reply",Hn&&"has-menu-open",Ge&&!Ze&&"focused",nt&&"is-forwarding",Kn&&"is-deleting",Un&&"is-dissolving",Ke&&"is-in-document-group",Ji&&"is-album",e.hasUnreadMention&&"has-unread-mention",At&&"is-selected",vt&&"is-in-selection-mode",ye&&!f&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",fo&&"is-swiped",K&&"is-just-added",(gt||Vn)&&"has-active-effect",ji&&"is-story-mention",!Hi&&"no-action-button"),qo=jo&&(0,c.r_)(jo).text,Go=Boolean(e.isInvertedMedia),{replyToMsgId:Ho,replyToPeerId:Wo}=xi||{},{peerId:_o,storyId:Qo}=Di||{};(0,i.vJ)((()=>{(bi?.hasEffect||ln)&&(Ut?.current&&oi>=Ut.current||li)&&Jn()}),[ln,li,Ut,oi,bi?.hasEffect]);const Zo=function(e,t,n){const[o,s]=(0,i.J0)();return(0,i.vJ)((()=>{t||n&&!n()||(e?async function(e,t=.2){return j||await V.promise,await j.request({name:"detectLanguage",args:[e,t]})}(e).then(s):s(void 0))}),[t,e,n]),o}(qo?.text,!(Jt||$t),on);!function(e,t,n,o){(0,i.vJ)((()=>{if(n||o&&!o())return;const i=Boolean(e.content.text?.text.length);!function(e,t,n,i){const o=q.get(e)||new J.A(150),s=o.get(t);s&&s.detectedLanguage===i&&s.isTranslatable===n||(o.set(t,{id:t,isTranslatable:n,detectedLanguage:i}),q.set(e,o),G(e))}(e.chatId,e.id,i,t)}),[e,t,n,o])}(e,Zo,!$t,on);const Xo=(0,c.ZR)(e,!_t),{isPending:es,translatedText:ts}=(0,_.A)(Vt,si,Xo?oi:void 0,Wt),ns=(0,R.A)(ts,Boolean(Xo)),is=ts||ns,os="phoneCall"===ki?.type?ki:void 0,ss=(Rt||ft&&rt&&li)&&!qi&&"thread"===Nt&&!N,as=Rt?.isCommentsInfo&&!qi&&"thread"===Nt&&!N,rs=!Gn&&!os&&!vt&&It&&!qi&&!ji&&!ao&&!wn,cs=!Ei&&Ui&&(Ri||(vi||Ai||Pi||"geo"===Ni?.mediaType)&&!Jo),ds=function(e,t,{poll:n,hasSubheader:i,isCustomShape:o,isLastInGroup:s,asForwarded:a,hasThread:d,forceSenderName:l,hasCommentCounter:u,hasCommentButton:h,hasActionButton:m,hasReactions:p,isGeoLiveActive:g,withVoiceTranscription:f,peerColorClass:v,hasOutsideReactions:A}={}){const{paidMedia:y}=(0,c.r_)(e),{photo:C,video:w}=I(y),b=(0,c.r_)(e),{photo:S=C,video:M=w,audio:N,voice:k,document:Y,webPage:P,contact:F,location:T,invoice:x,storyData:D,giveaway:E,giveawayResults:L}=b,B=t?.hasMultipleCaptions?void 0:(0,c.r_)(t?.captionMessage||e).text,R=Boolean(e.factCheck?.text),O="video"===M?.mediaType&&M.isRound,U=e.isInvertedMedia,z=S||M&&!O||t||P,K=[r.zPk],j=D||S||M||T||x?.extendedMedia||y,V=B||"venue"===T?.mediaType||g||R,J=j&&!V,$=Boolean(e.inlineButtons),q=Boolean(e.viaBotId),G=U&&z?!(!p||A)||!!R||!(!P||!V):V;return v&&K.push(v),!j&&e.emojiOnlyCount?(K.push("emoji-only"),e.emojiOnlyCount<=r.Apc&&K.push(`emoji-only-${e.emojiOnlyCount}`)):V?K.push("text"):K.push("no-text"),Object.keys(b).length||K.push("unsupported"),m&&K.push("has-action-button"),o&&(K.push("custom-shape"),O&&K.push("round"),u&&K.push("has-comment-counter")),j&&!f?K.push("media"):M?K.push("video"):N?K.push("audio"):k?(K.push("voice"),f&&K.push("with-voice-transcription")):Y?K.push("document"):F?K.push("contact"):n?K.push("poll"):E||L?K.push("giveaway"):P&&(K.push("web-page"),(P.photo||P.video)&&K.push("media"),P.document&&K.push("document"),P.gift&&K.push("gift")),x&&!x.extendedMedia&&K.push("invoice"),x&&x.photo&&K.push("has-photo"),D&&K.push("story"),a&&K.push("is-forwarded"),i&&K.push("has-subheader"),d&&K.push("has-replies"),p&&K.push("has-reactions"),A&&K.push("has-outside-reactions"),q&&K.push("is-via-bot"),l&&K.push("force-sender-name"),o||(K.push("has-shadow"),j&&d&&K.push("has-background"),(i||a||q||!J||l||R||f)&&K.push("has-solid-background"),R&&K.push("has-fact-check"),!s||$||!S&&J&&!h||K.push("has-appendix")),z&&U&&K.push("is-inverted-media"),G?K.push("has-footer"):K.push("no-footer"),K.join(" ")}(e,h,{poll:un,hasSubheader:Xi,isCustomShape:Ri,isLastInGroup:Z,asForwarded:zi,hasThread:Bi&&!N,forceSenderName:ae,hasCommentCounter:Bi&&Rt.messagesCount>0,hasCommentButton:as,hasActionButton:Wi||_i,hasReactions:Ui,isGeoLiveActive:"geoLive"===Ni?.mediaType&&!(0,c.vz)(e),withVoiceTranscription:Ei,peerColorClass:(0,C.y)(io,oo,!0),hasOutsideReactions:cs}),ls=ds.includes("has-appendix"),us=(0,b.Rr)(e.emojiOnlyCount),hs=yn?void 0:Ji&&An?h.messages.length*An:An;let ms,ps;ms=os||qi?"none":!Jo||Si||us||Go?Go&&!us&&(Qi||Si)?"in-text":"standalone":"in-text",Ui?cs?ps="outside":zi?(ms="standalone",ps="inside"):ps="inside":ps="none";const gs=Ri?"in-meta":"in-content";(0,T.A)(Wo||si,Ho,Ne,e.id,Me||Be),(0,x.A)(_o||si,Qo,Le),(0,H.A)({elementRef:Dn,chatId:si,isFocused:Ge,focusDirection:He,noFocusHighlight:Ze,isResizingContainer:et,isJustAdded:K,isQuote:Boolean(We),scrollTargetPosition:Xe});const fs=dn?(0,d.em)(Bn,dn):void 0,vs=!e.senderId,As=fs||vs&&e.postAuthorTitle||(zi||it)&&ai?.postAuthorTitle||void 0;(0,O.A)(Dn,ie),(0,i.vJ)((()=>{const t=En.current;if(!t||!(0,A.Y)(t))return;Ot&&Fn({messageIds:[oi]});let n=[];e.hasUnreadMention&&(n=[oi]),h&&(n=h.messages.filter((e=>e.hasUnreadMention)).map((e=>e.id))),n.length&&xn({chatId:si,messageIds:n})}),[Ot,h,si,oi,Fn,e.hasUnreadMention]);const ys=(0,i.Kr)((()=>Ji?Y(ui,Boolean(g),h,qn):void 0),[Ji,ui,g,h,qn]),Cs=zi&&!Ri?28:0,ws=(0,i.Kr)((()=>{let e,t,n,i=!1,o="";if(!Ji&&(vi||Ai||Mi?.extendedMedia)){let n;if(vi||Ai){const e=vi||Ai;e&&!Vi&&(n=(0,M.yA)({media:e,isOwn:ui,asForwarded:zi,noAvatars:g,isMobile:qn}).width)}else if(Mi?.extendedMedia&&Mi.extendedMedia.width&&Mi.extendedMedia.height){const{width:e,height:t}=Mi.extendedMedia;n=(0,y.kn)({width:e,height:t,fromOwnMessage:ui,asForwarded:zi,noAvatars:g,isMobile:qn}).width}n&&(n<M.MC&&(t=n),e=Math.max((0,M.nP)(qo?.text,ss),n),!zi&&Mi?.extendedMedia&&e-n>18&&(i=!0))}else ys&&(e=Math.max((0,M.nP)(qo?.text,ss),ys.containerStyle.width),e-ys.containerStyle.width>18&&(i=!0));if(e)o=`width: ${e}px`,n=e+Nn;else if(bi&&!Xi){const{width:e}=(0,y.bu)(bi,qn);o=`width: ${e+Cs}px`,n=e+Nn}return{contentWidth:t,noMediaCorners:i,style:o,reactionsMaxWidth:n}}),[ys,zi,Cs,Xi,Mi?.extendedMedia,Ji,ss,qn,ui,g,vi,bi,qo?.text,Ai,Vi]),{contentWidth:bs,noMediaCorners:Is,style:Ss,reactionsMaxWidth:Ms}=ws;function Ns(e){if(jo)return(0,Ae.Y)(Ie.A,{messageOrStory:jo,translatedText:Wt?is:void 0,isForAnimation:e,focusedQuote:We,focusedQuoteOffset:Qe,emojiSize:us,highlight:ht,isProtected:$e,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,withTranslucentThumbs:Ri,isInSelectMode:vt,canBeEmpty:Qi,maxTimestamp:gn,threadId:Ct})}const ks=(0,i.hb)((()=>{if(It)return(0,Ae.Y)("div",{className:(0,p.A)("quick-reaction",vo&&!gt&&"visible"),onClick:po,ref:Ln,children:(0,Ae.Y)(Se.A,{reaction:It,size:Mn,availableReactions:bt,observeIntersection:u})})}),[gt,bt,It,po,vo,u]);function Ys(){const t=(0,Ae.Y)(Qt,{message:e,isPinned:Pt,withFullDate:it&&!ui,noReplies:k,repliesThreadInfo:Rt,outgoingStatus:Ue,signature:As,withReactionOffset:"inside"===ps,renderQuickReactionButton:rs&&"in-meta"===gs?ks:void 0,availableReactions:bt,isTranslated:Boolean(Wt?is:void 0),effectEmoji:ln?.emoticon,onClick:Yo,onEffectClick:Ko,onTranslationClick:Po,onOpenThread:Fo,paidMessageStars:hs});return"inside"!==ps?t:(0,Ae.Y)(mn.A,{message:wt,threadId:Ct,metaChildren:t,observeIntersection:u,noRecentReactors:rt,tags:rn,isCurrentUserPremium:Q,isAccountFrozen:wn})}function Ps(e){const t=(0,p.A)("text-content","clearfix"),n=(0,p.A)("text-content","clearfix","in-text"===ms&&"with-meta",Ue&&"with-outgoing-icon"),i=Ji||!Ji&&vi||!Ji&&Ai&&!Vi||!Oi&&Qi,o="in-text"===ms;return(0,Ae.FD)(Ae.FK,{children:[Fs(),Jo&&!Oi&&(0,Ae.FD)("div",{className:t,dir:"auto",children:[Ns(),es&&(0,Ae.Y)("div",{className:"translation-animation",children:(0,Ae.Y)("div",{className:"text-loading",children:Ns(!0)})}),!i&&o&&Ys()]}),i&&(0,Ae.FD)(Ae.FK,{children:[Ts(e),!Oi&&(0,Ae.FD)("div",{className:n,dir:"auto",children:[Qi&&(0,Ae.Y)(dt,{factCheck:di,isToggleDisabled:vt}),o&&Ys()]})]})]})}function Fs(){return Si&&(0,Ae.Y)(Sn.A,{message:e,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,noAvatars:g,canAutoLoad:Tt,canAutoPlay:Dt,asForwarded:zi,isDownloading:Ft,isProtected:$e,theme:oe,story:en,isConnected:nn,lastPlaybackTimestamp:fn,backgroundEmojiId:io?.color?.backgroundEmojiId,shouldWarnAboutSvg:sn,autoLoadFileMaxSizeMb:Lt,onAudioPlay:So,onMediaClick:bo,onDocumentClick:Io,onCancelMediaTransfer:xo})}function Ts(e){const t=(0,Ae.FD)(Ae.FK,{children:[Ji&&n&&(0,Ae.Y)(Re,{album:h,albumLayout:ys,observeIntersection:n,isOwn:ui,isProtected:$e,hasCustomAppendix:e,onMediaClick:Mo}),!Ji&&vi&&(0,Ae.Y)(De.A,{messageText:qo?.text,photo:vi,isOwn:ui,observeIntersection:n,noAvatars:g,canAutoLoad:Tt,uploadProgress:ze,shouldAffectAppendix:e,isDownloading:Ft,isProtected:$e,asForwarded:zi,theme:oe,forcedWidth:bs,onClick:No,onCancelUpload:xo}),!Ji&&Ai&&!Vi&&(0,Ae.Y)(Ee.A,{video:Ai,isOwn:ui,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,forcedWidth:bs,noAvatars:g,canAutoLoad:Tt,canAutoPlay:Dt,uploadProgress:ze,isDownloading:Ft,isProtected:$e,asForwarded:zi,lastPlaybackTimestamp:fn,onClick:ko,onCancelUpload:xo})]});return pi?(0,Ae.Y)(tn,{chatId:si,messageId:oi,paidMedia:pi,isOutgoing:ui,children:t}):t}function xs(){return!(Ri&&!ri)&&(S&&(!(vi||Ai||Ni||pi)||jt)||zi||ri||ae)&&!$i&&!(mi&&Ri)}function Ds(){return(0,Ae.FD)("span",{className:"forward-title-container",children:[zi&&(0,Ae.Y)(fe.A,{name:ai?.hiddenUserName?"forward":"share-filled"}),zi&&(0,Ae.Y)("span",{className:"forward-title",children:Bn("ForwardedFrom")})]})}function Es(t=!1,i=!1){let o;!so||Ri&&ri?ai?.hiddenUserName?o=ai.hiddenUserName:Pi&&ge&&(o=(0,d.em)(Bn,ge)):o=(0,d.em)(Bn,so);const s=so&&"emojiStatus"in so&&so.emojiStatus,a=so&&"isPremium"in so&&so.isPremium,l=zi&&so,h=ve?.hasUsername;return(0,Ae.FD)("div",{className:"message-title",dir:"ltr",children:[o||zi?(0,Ae.FD)("span",{className:(0,p.A)("message-title-name-container",ai?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!t&&Ds(),(0,Ae.FD)("span",{className:"message-title-name",children:[Pi&&(0,Ae.Y)(fe.A,{name:"play-story"}),l&&(0,Ae.Y)(de.A,{className:"forward-avatar",peer:so,size:"micro"}),(0,Ae.Y)("span",{className:"sender-title",onClick:yo,children:o?(0,w.A)(o):zi?" ":void 0}),!zi&&s&&(0,Ae.Y)(le.A,{documentId:s.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:n,observeIntersectionForPlaying:u}),!zi&&!s&&a&&(0,Ae.Y)(be.A,{}),so?.fakeType&&(0,Ae.Y)(we.A,{fakeType:so.fakeType})]})]}):ve?void 0:" ",ve?.hasUsername&&(0,Ae.FD)("span",{className:"interactive",children:[(0,Ae.Y)("span",{className:"via",children:Bn("ViaBot")}),(0,Ae.Y)("span",{className:"sender-title",onClick:Co,children:(0,w.A)(`@${(0,c.Kl)(ve)}`)})]}),(0,Ae.Y)("div",{className:"title-spacer"}),i||h?void 0:ai?.isLinkedChannelPost?(0,Ae.Y)("span",{className:"admin-title",dir:"auto",children:Bn("DiscussChannel")}):e.postAuthorTitle&&ct&&!zi?(0,Ae.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!zt||zi||ri?void 0:(0,Ae.Y)("span",{className:"admin-title",dir:"auto",children:zt.customTitle||Bn(zt.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),Ki&&(0,Ae.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,Ae.Y)(fe.A,{name:an>1?"boosts":"boost"}),an>1?an:void 0]})]})}const Ls=ct&&zi?e.postAuthorTitle:void 0;return(0,Ae.FD)("div",{ref:Dn,id:(0,c.GZ)(e.id),className:$o,"data-message-id":oi,onCopy:$e?v.A:void 0,onMouseDown:ro,onClick:co,onContextMenu:lo,onDoubleClick:uo,onMouseEnter:qi?Ao:void 0,onMouseMove:rs?mo:void 0,onMouseLeave:rs||qi?go:void 0,children:[(0,Ae.Y)("div",{ref:En,className:"bottom-marker","data-message-id":oi,"data-last-message-id":h?h.messages[h.messages.length-1].id:void 0,"data-album-main-id":h?h.mainMessage.id:void 0,"data-has-unread-mention":e.hasUnreadMention||void 0,"data-has-unread-reaction":Ot||void 0,"data-is-pinned":Pt||void 0,"data-should-update-views":void 0!==e.viewsCount}),!Ke&&(0,Ae.Y)("div",{className:"message-select-control no-selection",children:At&&(0,Ae.Y)(fe.A,{name:"select"})}),ee&&(0,Ae.Y)("div",{className:(0,p.A)("message-select-control group-select no-selection",yt&&"is-selected"),onClick:Oo,children:yt&&(0,Ae.Y)(fe.A,{name:"select"})}),(0,Ae.FD)("div",{className:(0,p.A)("message-content-wrapper",ds.includes("text")&&"can-select-text",ds.includes("giveaway")&&"giveaway-result-content"),children:[(0,Ae.FD)("div",{className:ds,style:Ss,dir:"auto",children:[zi&&!$i&&(0,Ae.FD)(Ae.FK,{children:[xs()&&Es(),Ls&&(0,Ae.Y)("span",{className:"admin-title",dir:"auto",children:Ls})]}),function(){const t=(0,p.A)("content-inner",zi&&"forwarded-message",Zi&&"forwarded-custom-shape",Xi&&"with-subheader",Is&&"no-media-corners"),i=Z&&(!Jo||Go&&!Qi&&!Ui)&&!as,o=(0,p.A)("text-content","clearfix","in-text"===ms&&"with-meta",Ue&&"with-outgoing-icon"),s=!ao||!ui||it;return(0,Ae.FD)("div",{className:t,onDoubleClick:ho,dir:"auto",children:[!zi&&xs()&&Es(),Xi&&(0,Ae.FD)("div",{className:"message-subheader",children:[jt&&(0,Ae.Y)(Pe,{topic:Kt,onClick:Uo,className:"message-topic"}),Zi&&(0,Ae.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,Ae.Y)("div",{className:"message-title",children:Ds()}),Es(!0,!0)]}),mi&&(0,Ae.Y)(me.A,{message:Ne,replyInfo:xi,noUserColors:oo,isProtected:$e,sender:ke,senderChat:xe,forwardSender:Ye,chatTranslations:Vt,requestedChatTranslationLanguage:_t,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onClick:wo}),Li&&(0,Ae.Y)(Ce,{story:Le,sender:Oe,noUserColors:oo,isProtected:$e,observeIntersectionForLoading:n,onClick:zo})]}),bi&&n&&u&&(0,Ae.Y)(Cn,{message:e,observeIntersection:n,observeIntersectionForPlaying:u,shouldLoop:Et,shouldPlayEffect:Vn,withEffect:Zt,onStopEffect:$n}),Oi&&pt&&(0,Ae.Y)(je,{customEmojiId:pt,withEffects:Zt&&yn&&!ln,isOwn:ui,observeIntersection:n,forceLoadPreview:li,messageId:oi,chatId:si,activeEmojiInteractions:St}),Oi&&mt&&(0,Ae.Y)(Je,{emoji:mt,withEffects:Zt&&yn&&!ln,isOwn:ui,observeIntersection:n,forceLoadPreview:li,messageId:oi,chatId:si,activeEmojiInteractions:St}),Zt&&ln&&!li&&(0,Ae.Y)(Ht.A,{shouldPlay:Vn,messageId:e.id,isMirrored:!e.isOutgoing,effect:ln,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onStop:$n}),os&&(0,Ae.Y)(Xt,{message:e,phoneCall:os,chatId:si}),!Ji&&Vi&&!Ei&&(0,Ae.Y)(pn.A,{message:e,observeIntersection:n,canAutoLoad:Tt,isDownloading:Ft,onReadMedia:s?To:void 0,onHideTranscription:On,isTranscriptionError:ci,isTranscribed:Boolean(ne),canTranscribe:cn&&!ao,isTranscriptionHidden:Rn,isTranscribing:te}),(yi||Ci||Ei)&&(0,Ae.Y)(ce.Ay,{theme:oe,message:e,origin:a.d9.Inline,uploadProgress:ze,isSelectable:Ke,isSelected:At,noAvatars:g,onPlay:So,onReadMedia:Ci&&s?To:void 0,onCancelUpload:xo,isDownloading:Ft,isTranscribing:te,isTranscriptionHidden:Rn,isTranscribed:Boolean(ne),isTranscriptionError:ci,canDownload:!$e,onHideTranscription:On,canTranscribe:cn&&!ao}),wi&&(0,Ae.Y)(ue.A,{document:wi,message:e,observeIntersection:n,canAutoLoad:Tt,autoLoadFileMaxSizeMb:Lt,uploadProgress:ze,isSelectable:Ke,isSelected:At,onMediaClick:Io,onCancelUpload:xo,isDownloading:Ft,shouldWarnAboutSvg:sn}),Pi&&!ji&&(0,Ae.Y)(bn,{message:e,isProtected:$e}),ji&&(0,Ae.Y)(In,{message:e}),Ii&&(0,Ae.Y)(tt,{contact:Ii,noUserColors:ui}),un&&(0,Ae.Y)(hn,{message:e,poll:un,onSendVote:Do}),(Fi||Ti)&&(0,Ae.Y)(Mt,{message:e}),Yi&&(0,Ae.Y)(ut,{message:e,canAutoLoadMedia:Tt}),Mi?.extendedMedia&&(0,Ae.Y)(Bt,{message:e,isConnected:nn}),Ei&&(0,Ae.Y)("p",{className:(0,p.A)("transcription",!Rn&&ci&&"transcription-error"),dir:"auto",children:ci?Bn("NoWordsRecognized"):te&&ne?(0,Ae.Y)(he.A,{content:ne}):ne}),Go&&Ps(i),!Go&&(0,Ae.FD)(Ae.FK,{children:[Ts(i),Jo&&!Oi&&(0,Ae.FD)("div",{className:o,dir:"auto",children:[Ns(),es&&(0,Ae.Y)("div",{className:"translation-animation",children:(0,Ae.Y)("div",{className:"text-loading",children:Ns(!0)})}),Qi&&(0,Ae.Y)(dt,{factCheck:di,isToggleDisabled:vt}),"in-text"===ms&&Ys()]}),Fs()]}),Mi&&!Mi.extendedMedia&&(0,Ae.Y)(xt,{message:e,shouldAffectAppendix:i&&!Ui,isInSelectMode:vt,isSelected:At,theme:oe,forcedWidth:bs}),Ni&&(0,Ae.Y)(qt,{message:e,isInSelectMode:vt,isSelected:At,theme:oe,peer:re})]})}(),!qi&&"standalone"===ms&&!ji&&Ys(),Hi&&(0,Ae.FD)("div",{className:(0,p.A)("message-action-buttons",Ve&&"message-action-buttons-shown"),children:[as&&Ri&&(0,Ae.Y)(_e,{threadInfo:Rt,disabled:N,isLoading:Ve,isCustomShape:!0,asActionButton:!0}),Wi&&(0,Ae.Y)(Te.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:Bn("lng_context_forward_msg"),onClick:ee?Eo:Lo,children:(0,Ae.Y)(fe.A,{name:"share-filled"})}),_i&&(0,Ae.Y)(Te.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:Yt?Bo:Ro,children:(0,Ae.Y)(fe.A,{name:"arrow-right"})})]}),as&&!(Hi&&Ri)&&(0,Ae.Y)(_e,{threadInfo:Rt,disabled:N,isLoading:Ve}),ls&&(0,Ae.Y)(Gt.A,{isOwn:ui}),rs&&"in-content"===gs&&ks()]}),e.inlineButtons&&(0,Ae.Y)(kt,{message:e,onClick:Yn}),"outside"===ps&&!ji&&(0,Ae.Y)(mn.A,{message:wt,threadId:Ct,isOutside:!0,isCurrentUserPremium:Q,maxWidth:Ms,observeIntersection:u,noRecentReactors:rt,tags:rn,isAccountFrozen:wn})]}),Wn&&(0,Ae.Y)(ot,{isOpen:Hn,anchor:Wn,targetHref:_n?.matches("a[href]")?_n.href:void 0,message:e,album:h,messageListType:Nt,onClose:Xn,onCloseAnimationEnd:ei,repliesThreadInfo:Rt,noReplies:k,detectedLanguage:Zo})]})})))},17169:(e,t,n)=>{n.d(t,{A:()=>i});const i={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},17751:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(29807),c=n(87357),d=n(4961),l=n(54699),u=n(17712),h=n(59030),m=n(42452),p=n(21849),g=n(80999),f=n(34431),v=n(18276),A=n(80477),y=n(20021);const C=(0,i.ph)((0,o.EK)(((e,{userId:t,forceShowSelf:n})=>{const{isSynced:i}=e,o=t?(0,r.mBe)(e,t):void 0,s=t?(0,r.K0y)(e,t):void 0,a=!n&&o&&o.isSelf,c=a?o:(0,r.mBe)(e,e.currentUserId);return{user:o,userStatus:s,isSavedMessages:a,areMessagesLoaded:Boolean(t&&(0,r.zeq)(e,t)),self:c,isSynced:i}}))((({customPeer:e,typingStatus:t,avatarSize:n="medium",status:r,statusIcon:C,withDots:w,withMediaViewer:b,withUsername:I,withStory:S,withFullInfo:M,withUpdatingStatus:N,emojiStatusSize:k,noStatusOrTyping:Y,noEmojiStatus:P,noFake:F,noVerified:T,noRtl:x,user:D,userStatus:E,self:L,isSavedMessages:B,isSavedDialog:R,areMessagesLoaded:O,adminMember:U,ripple:z,className:K,storyViewerOrigin:j,isSynced:V,onEmojiStatusClick:J,iconElement:$,rightElement:q})=>{const{loadFullUser:G,openMediaViewer:H,loadMoreProfilePhotos:W}=(0,o.ko)(),_=(0,h.A)(),{id:Q}=D||{},Z=b&&!B;(0,i.vJ)((()=>{Q&&(M&&V&&G({userId:Q}),b&&W({peerId:Q,isPreload:!0}))}),[Q,M,b,V]),(0,l.A)(6e4);const X=(0,u.A)(((e,t)=>{D&&t&&(e.stopPropagation(),H({isAvatarView:!0,chatId:D.id,mediaIndex:0,origin:"jumbo"===n?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))})),ee=(0,i.Kr)((()=>D&&I&&(0,a.Kl)(D)),[D,I]);if(!D&&!e)return;const te=U?U.customTitle||_(U.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,y.FD)("div",{className:(0,c.A)("ChatInfo",K),dir:!x&&_.isRtl?"rtl":void 0,children:[R&&L&&(0,y.Y)(p.A,{size:n,peer:L,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,y.Y)(p.A,{size:n,peer:e||D,className:(0,c.A)(R&&"overlay-avatar"),isSavedMessages:B,isSavedDialog:R,withStory:S,storyViewerOrigin:j,storyViewerMode:"single-peer",onClick:Z?X:void 0},D?.id),(0,y.FD)("div",{className:"info",children:[te?(0,y.FD)("div",{className:"info-name-title",children:[(0,y.Y)(f.A,{peer:D,withEmojiStatus:!P,emojiStatusSize:k,isSavedMessages:B,isSavedDialog:R,onEmojiStatusClick:J}),te&&(0,y.Y)("span",{className:"custom-title",children:te})]}):(0,y.Y)(f.A,{peer:e||D,noFake:F,noVerified:T,withEmojiStatus:!P,emojiStatusSize:k,isSavedMessages:B,isSavedDialog:R,onEmojiStatusClick:J,iconElement:$}),(r||!B&&!Y)&&function(){if(r)return w?(0,y.Y)(g.A,{className:"status",content:r}):(0,y.FD)("span",{className:"status",dir:"auto",children:[C&&(0,y.Y)(v.A,{className:"status-icon",name:C}),(0,d.A)(r)]});if(N&&!O)return(0,y.Y)(g.A,{className:"status",content:_("Updating")});if(e?.subtitleKey)return(0,y.Y)("span",{className:"status",dir:"auto",children:(0,y.Y)("span",{className:"user-status",dir:"auto",children:_(e.subtitleKey)})});if(!D)return;if(t)return(0,y.Y)(A.A,{typingStatus:t});if((0,a.DX)(D.id))return;const n=(0,a.CD)(_,D,E),i=(0,c.A)("handle",n&&"withStatus");return(0,y.FD)("span",{className:(0,c.A)("status",(0,a.PF)(D,E,!0)&&"online"),children:[ee&&(0,y.Y)("span",{className:i,children:ee}),n&&(0,y.Y)("span",{className:"user-status",dir:"auto",children:n})]})}()]}),z&&(0,y.Y)(m.A,{}),q]})})))},17778:(e,t,n)=>{n.d(t,{S:()=>r});const i=/(<br>|<br\s?\/>)/g,o=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(o," ").replace(i,"\n").replace(s,"").replace(a,"")}},20247:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(31481),a=n(17712);function r(e,t,n){const{shouldPaidMessageAutoApprove:r}=(0,o.mS)().settings.byKey,[c,d]=(0,i.J0)(Boolean(r)),[l,u]=(0,i.J0)(!1),h=(0,i.li)(void 0),m=(0,a.A)((()=>{(0,o.ko)().closePaymentMessageConfirmDialogOpen()}));(0,i.vJ)((()=>{l&&!t&&(u(!1),n>e&&h?.current?.())}),[l,t,n,e]);const p=(0,a.A)((()=>{(0,o.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)}));return{closeConfirmDialog:m,handleWithConfirmation:(t,...i)=>{if(e){if(h.current=()=>t(...i),!r)return void(0,o.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...i)},dialogHandler:(0,a.A)((()=>{e>n?p():h?.current?.(),(0,o.ko)().closePaymentMessageConfirmDialogOpen(),c&&(0,o.ko)().setPaidMessageAutoApprove()})),shouldAutoApprove:c,setAutoApprove:d}}},21488:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,o.ko)(),r=(0,i.Kr)((()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}}),[t,e]);(0,i.vJ)((()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()}),[r,n,t,e])}},23459:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(13439),s=n(90709),a=n(29807),r=n(9716),c=n(37836);const d=36e5,l=new Map;let u=new Set;const h=(0,c.nF)((()=>{const e=Array.from(u),t=e.slice(0,100),n=e.slice(101);(0,o.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach((e=>l.set(e,Date.now()))),u=new Set(n),u.size&&h()}),500);function m(e){const t=(0,i.Kr)((()=>{const t=(0,o.mS)();return e?.map((e=>(0,a.PVB)(t,e))).filter(Boolean)}),[e]),n=(0,i.Kr)((()=>{const e=(0,o.mS)();return t?.filter((t=>{const n=l.get(t.id)||0;if(Date.now()-n<d)return!1;if((0,r.L8)(t.id)){const n=t,i=(0,a.K0y)(e,n.id),o=i&&"userStatusEmpty"!==i.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&o}{const e=t;return(0,s.WX)(e)&&!e.isRestricted}})).map((e=>e.id))}),[t]);(0,i.vJ)((()=>{n?.length&&(n.forEach((e=>u.add(e))),h())}),[n])}},23565:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,i.li)(),c=(0,o.A)(),d=null!=e,l=null!=n;return d&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)((()=>{t&&!d&&l&&!r.current&&(r.current=window.setTimeout((()=>{r.current=void 0,c()}),t))}),[t,c,d,l]),r.current&&t&&!d?n:e}},24807:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(87357),a=n(80140),r=n(22237),c=n(14242),d=n(59852),l=n(19129),u=n(39351),h=n(17712),m=n(59030),p=n(68292),g=n(18276),f=n(64493),v=n(26607),A=n(20021);const y=(0,i.ph)((({topic:e,topics:t,chat:n,isPinned:y,isMuted:C,shouldShowOnlyMostImportant:w,wasTopicOpened:b,forceHidden:I,isSavedDialog:S,hasMiniApp:M,isSelected:N})=>{const{requestMainWebView:k}=(0,o.ko)(),Y=(0,m.A)(),P=(0,u.A)(),{unreadMentionsCount:F=0,unreadReactionsCount:T=0}=n.isForum?{}:n,x=!y&&e&&!b,D=n.isForum&&!e,E=(0,i.Kr)((()=>D&&t?Object.values(t).filter((({unreadCount:e})=>e)):void 0),[t,D]),L=(0,i.Kr)((()=>D?E?.length:(e||n).unreadCount),[n,e,E,D]),B=(0,i.Kr)((()=>{if(!D)return!C||0===e?.notifySettings.mutedUntil;if(C)return E?.some((e=>0===e.notifySettings.mutedUntil));const t=E?.every((e=>e.notifySettings.mutedUntil&&e.notifySettings.mutedUntil>(0,a.Fm)()));return!t}),[D,C,E,e?.notifySettings.mutedUntil]),R=!e&&n.hasUnreadMark,O=!(0,l.A)((()=>(0,r.Hp)(I)?I():I),[I])&&Boolean(L||F||R||y||T||x||M),U=Boolean((L||R)&&!S),z=(0,s.A)("ChatBadge",!B&&"muted",!U&&y&&"pinned",U&&"unread"),K=(0,h.A)((e=>{e.stopPropagation();const t=(0,d.A)();k({botId:n.id,peerId:n.id,theme:t})}));return(0,A.Y)(v.A,{isCustom:!0,className:"ChatBadge-transition",isOpen:O,children:function(){const e=T&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge reaction",!B&&"muted"),children:(0,A.Y)(g.A,{name:"heart"})}),t=F&&(0,A.Y)("div",{className:"ChatBadge mention",children:(0,A.Y)(g.A,{name:"mention"})}),n=x&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge unopened",!B&&"muted")}),i=R||L?(0,A.Y)("div",{className:z,children:!R&&(0,A.Y)(p.A,{text:(0,c.Vw)(P,L)})}):void 0,o=y&&(0,A.Y)("div",{className:z,children:(0,A.Y)(g.A,{name:"pinned-chat"})}),a=M&&(0,A.Y)(f.A,{color:N?"secondary":"primary",className:"ChatBadge miniapp",pill:!0,size:"tiny",onClick:K,children:Y("BotOpen")}),r=!i&&!t&&!e&&o,d=[n,e,t,i,r].filter(Boolean);return S?o:M&&(0===d.length||r)?a:0!==d.length?1===d.length?d[0]:w?[t,i,e,o].filter(Boolean)[0]:(0,A.Y)("div",{className:"ChatBadge-wrapper",children:d}):void 0}()})}))},24899:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(31481);function o(e,t){return t?`${i.jsp}${e}`:`@${e}`}},24920:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(30857),s=n(73767);function a(e){const t=(0,o.A)(),n=(0,i.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},25477:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(84051),o=n(13439),s=n(90709),a=n(87357),r=n(17663),c=n(58554),d=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(21511),w=n(61097),b=n(18276),I=n(27860),S=n(65843),M=n(35913),N=n(20021);const k=({id:e,video:t,isOwn:n,isInWebPage:k,observeIntersectionForLoading:Y,observeIntersectionForPlaying:P,noAvatars:F,canAutoLoad:T,canAutoPlay:x,uploadProgress:D,forcedWidth:E,dimensions:L,asForwarded:B,isDownloading:R,isProtected:O,className:U,lastPlaybackTimestamp:z,clickArg:K,onClick:j,onCancelUpload:V})=>{const{cancelMediaDownload:J}=(0,o.ko)(),$=(0,i.li)(),q=(0,i.li)(),G="extendedMediaPreview"===t.mediaType,H=G?void 0:t.blobUrl,[W,_,Q]=(0,m.A)(G||t.isSpoiler);(0,i.vJ)((()=>{G||t.isSpoiler?_():Q()}),[G,t]);const Z=(0,p.Vz)($,Y),X=(0,p.Vz)($,P)&&Z,ee=(0,i.li)(Z);X&&!ee.current&&(ee.current=!0);const{isMobile:te}=(0,h.Ay)(),[ne,ie]=(0,i.J0)(T),oe=Boolean(ne&&Z&&!G),[se,ae]=(0,i.J0)(Boolean(x&&!W)),re=G?void 0:(0,s.sC)(t,"inline"),[ce]=(0,i.J0)(Boolean(re&&c.Ih(re))),{mediaData:de,loadProgress:le}=(0,A.A)(re,!oe,G?void 0:(0,s.Cz)(t,"inline")),ue=H||de,[he,me]=(0,m.A)(),pe=(0,s.VD)(t),ge=Boolean(pe),fe=Boolean(E),ve=ue&&ee.current,Ae=(0,u.A)(q,!0,!ve),ye=G?void 0:(0,s.sC)(t,"preview"),[Ce]=(0,i.J0)(Boolean(ye&&c.Ih(ye))),we=Z,be=(0,f.A)(ye,!we),Ie=he&&!Ae,Se=(0,v.A)((ge||be)&&!Ie),Me=Boolean(!ge||be||he),Ne=(0,w.A)(t,Me);(0,v.A)(!Me,{ref:Ne});const ke=(0,w.A)(t,!fe),{loadProgress:Ye}=(0,A.A)(G?void 0:(0,s.sC)(t,"download"),!R,G?void 0:(0,s.Cz)(t,"download")),{isUploading:Pe,isTransferring:Fe,transferProgress:Te}=(0,s.LK)(D||(R?Ye:le),oe&&!he&&!ce||R,void 0!==D),xe=!1===(0,y.A)(ne),{ref:De,shouldRender:Ee}=(0,C.A)({isOpen:Fe&&!Ae,noMountTransition:xe,withShouldRender:!0}),{ref:Le}=(0,C.A)({isOpen:Boolean((ne||ue)&&!se&&!Ee)}),[Be,Re]=(0,i.J0)(0),Oe=(0,g.A)((e=>{Re(Math.max(0,e.currentTarget.currentTime-1))})),Ue=(Number.isFinite(q.current?.duration)&&!Ae?q.current?.duration:t.duration)||0,{width:ze,height:Ke}=L||(G?(0,d.ri)(t,Boolean(n),B,k,F,te):(0,d.rO)(t,Boolean(n),B,k,F,te)),je=(0,g.A)(((e,n)=>{if(Pe)V?.(K);else if(G||!R)if(ue){if(ue&&!se&&ae(!0),!W)return n&&oe&&!he&&!ce?(ie(!1),void e.stopPropagation()):void j?.(K,e);Q()}else ie((e=>!e));else J({media:t})})),Ve=(0,g.A)((e=>{je(e,!0)})),Je=(0,a.A)("media-inner dark",!Pe&&"interactive",Ke<l.ej&&"fix-min-height",U),$e=`height: ${Ke}px;${L?` width: ${ze}px; left: ${L.x}px; top: ${L.y}px;`:""}`;return(0,N.FD)("div",{ref:$,id:e,className:Je,style:$e,onClick:Pe?void 0:e=>je(e),children:[fe&&(0,N.Y)("canvas",{ref:ke,className:"thumbnail blurred-bg"}),ve&&(0,N.Y)(S.A,{ref:q,src:ue,className:(0,a.A)("full-media",fe&&"with-blurred-bg"),canPlay:se&&X&&!Ae,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!O,onTimeUpdate:Oe,onReady:me,style:E?`width: ${E}px`:void 0}),(0,N.Y)("img",{ref:Se,src:be,className:(0,a.A)("thumbnail",fe&&"with-blurred-bg"),alt:"",style:E?`width: ${E}px;`:void 0,draggable:!O}),ge&&!Ce&&(0,N.Y)("canvas",{ref:Ne,className:"thumbnail"}),O&&(0,N.Y)("span",{className:"protector"}),(0,N.Y)(b.A,{ref:Le,name:"large-play"}),(0,N.Y)(I.A,{isVisible:W,withAnimation:!0,thumbDataUri:pe,width:ze,height:Ke,className:"media-spoiler"}),Ee&&(0,N.Y)("div",{ref:De,className:"media-loading",children:(0,N.Y)(M.A,{progress:Te,onClick:Ve})}),!ne&&!ue&&(0,N.Y)(b.A,{name:"download"}),!Fe||Ae&&!R?(0,N.FD)("div",{className:"message-media-duration",children:[!G&&t.isGif?"GIF":(0,r.QO)(Math.max(Ue-Be,0)),Ae&&(0,N.Y)(b.A,{name:"message-failed",className:"playback-failed"})]}):(0,N.Y)("span",{className:"message-transfer-progress",children:Pe||R?`${Math.round(100*Te)}%`:"..."}),Boolean(z)&&(0,N.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(z/Ue*100)}%`})]})}},25498:(e,t,n)=>{n.d(t,{A:()=>T});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(29807),c=n(52491),d=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,b,I,S;const M=36,N=2,k=300,Y=(0,h.A)((function(e,t,n){return e&&t.length?Object.values((0,l._E)(e,t)).slice(0,n):u.p})),P=(0,h.A)((function(e,t,n){const i=Object.values(e),o=(0,l.dU)(i,"native"),s=t?(0,l.LG)(t,(e=>Object.values((0,l._E)(o,e)))):{},a=n?(0,l.LG)(n,(e=>Object.values((0,l._E)(o,e)))):{},r={...s,...a},c=[].concat(Object.keys(s),Object.keys(a)),d=i.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),u=Object.keys(d),h=c.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:r,keywords:c,byName:d,names:u,maxKeyLength:h}})),F=(0,h.A)((function(e,t,n){const{byKeyword:i,keywords:o,byName:s,names:a,maxKeyLength:r}=e;let c=[];if(t.length>r)return u.p;const d=o.filter((e=>e.startsWith(t))).sort();c=c.concat(Object.values((0,l._E)(i,d)).flat());const h=a.filter((e=>e.startsWith(t)));return c=c.concat(Object.values((0,l._E)(s,h)).flat()),c=(0,l.Am)(c),c.length?c.slice(0,n):u.p}));try{I=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){I=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function T(e,t,h,T=s.CfG,x,D,E){const[L,B,R]=(0,A.A)(!1),[O,U]=(0,i.J0)(),[z,K]=(0,i.J0)(u.p),[j,V]=(0,i.J0)(u.p);(0,i.vJ)((()=>{function t(){U(b.emojis)}e&&(b?t():async function(){return C||(C=n.e(996).then(n.t.bind(n,20996,19)),w=(await C).default,b=(0,c.cp)(w)),C}().then(t))}),[e]);const J=(0,f.gs)((()=>{const n=t();return e&&n.includes(":")?(0,g.S)(n).match(I)?.[0].trim():void 0}),[t,e],k),$=(0,v.A)(J,[J,t],!0),q=(0,y.A)((e=>{if(K(e),e===u.p)return void V(u.p);const t=e.map((e=>e.native)),n=(0,l.Xd)((0,r.oZ0)((0,o.mS)(),t),"id");V(n)})),G=(0,y.A)(((e,n=!1)=>{const i=t();if(!i)return;const o=i.lastIndexOf(":",n?i.lastIndexOf(":")-1:void 0);if(-1!==o){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${i.substring(0,o)}${t}`);const n=T===s.CfG?document.querySelector(s.m$5):document.getElementById(T);(0,a.Uz)((()=>{(0,d.A)(n,!0,!0)}))}q(u.p)}));return(0,i.vJ)((()=>{const e=$();if(!e||!O)return void q(u.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let i=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=N){const e=P(O,D,E);i=F(e,n.toLowerCase(),M)}}else i=Y(O,x,M);i.length?t?G(i[0].native,!0):q(i):q(u.p)}),[D,O,$,E,G,x,q]),(0,i.vJ)(R,[R,t]),{isEmojiTooltipOpen:Boolean(z.length||j.length)&&!L,closeEmojiTooltip:B,filteredEmojis:z,filteredCustomEmojis:j,insertEmoji:G}}},25897:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},26440:(e,t,n)=>{n.d(t,{A:()=>v});var i=n(84051),o=n(13439),s=n(31481),a=n(87357),r=n(37661),c=n(17712),d=n(18276),l=n(64493),u=n(66469),h=n(57474),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,i.ph)((({chatId:e,threadId:t,isMobile:n,canSendGifs:m,canSendStickers:p,isMessageComposer:v,isReady:A,isSymbolMenuOpen:y,idPrefix:C,isAttachmentModal:w,canSendPlainText:b,isSymbolMenuForced:I,className:S,forceDarkTheme:M,inputCssSelector:N=s.m$5,openSymbolMenu:k,closeSymbolMenu:Y,onCustomEmojiSelect:P,onStickerSelect:F,onGifSelect:T,onRemoveSymbol:x,onEmojiSelect:D,closeBotCommandMenu:E,closeSendAsMenu:L})=>{const{setStickerSearchQuery:B,setGifSearchQuery:R,addRecentEmoji:O,addRecentCustomEmoji:U}=(0,o.ko)(),z=(0,i.li)(),[K,j]=(0,r.A)(),[V,J]=(0,i.J0)(void 0),$=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",K?y&&"menu-opened":y&&"is-loading"),q=(0,c.A)((()=>{E?.(),L?.(),k();const e=z.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})})),G=(0,c.A)((e=>{"stickers"===e?(B({query:""}),R({query:void 0})):(R({query:""}),B({query:void 0}))})),H=(0,c.A)((()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout((()=>{E?.(),k()}),100)):k()})),W=(0,c.A)((()=>z.current)),_=(0,c.A)((()=>z.current?.closest(".custom-scroll, .no-scrollbar"))),Q=(0,c.A)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),Z=(0,c.A)((()=>({withPortal:!0})));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(l.A,{className:$,round:!0,color:"translucent",onClick:y?Y:H,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(d.A,{name:"smile"}),(0,g.Y)(d.A,{name:"keyboard"}),y&&!K&&(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:q,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:z,className:"symbol-menu-trigger"}),(0,g.Y)(d.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(I),canSendGifs:m,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:j,onClose:Y,onEmojiSelect:D,onStickerSelect:F,onCustomEmojiSelect:P,onGifSelect:T,onRemoveSymbol:x,onSearchOpen:G,addRecentEmoji:O,addRecentCustomEmoji:U,isAttachmentModal:w,canSendPlainText:b,className:(0,a.A)(S,M&&"component-theme-dark"),anchor:w?V:void 0,getTriggerElement:w?W:void 0,getRootElement:w?_:void 0,getMenuElement:w?Q:void 0,getLayout:w?Z:void 0})]})}))},31791:(e,t,n)=>{n.d(t,{v:()=>i});let i=function(e){return e.FULLSCREEN_CHANGE="fullscreen-change",e.UPDATE_ERROR="update-error",e.UPDATE_AVAILABLE="update-available",e.DEEPLINK="deeplink",e}({})},31880:(e,t,n)=>{n.d(t,{A:()=>m,a:()=>d});var i=n(13439),o=n(29807),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function d(e,t,n){let a=[],d=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],d=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,c);a=t||[],d=Object.keys(i).filter((e=>Boolean(i[e])))}const l=(0,i.mS)();return{selectedChatIds:a.filter((e=>(0,o.hds)(l,e))),selectedChatTypes:d}}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:{text: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,c)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,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,c),...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"reset":return u;default:return e}},m=()=>(0,a.A)(h,u)},32754:(e,t,n)=>{n.d(t,{A:()=>B});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(90709),c=n(27109),d=n(29807),l=n(96454),u=n(87357),h=n(9716),m=n(66414),p=n(98255),g=n(43874),f=n(47067),v=n(49746),A=n(37661),y=n(5912),C=n(17712),w=n(50680),b=n(53188),I=n(21849),S=n(54314),M=n(34431),N=n(18276),k=n(9267),Y=n(81642),P=n(22720),F=n(97967),T=n(97046),x=n(24807);const D="AA5s1Pu4";var E=n(20021);const L=(0,i.ph)((({isSelected:e,isActive:t,isMobile:n})=>(0,E.Y)("div",{className:(0,u.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,E.FD)("div",{className:"nl36F75B",children:[(0,E.Y)("div",{className:D}),(0,E.Y)("div",{className:D}),(0,E.Y)("div",{className:D})]})}))),B=(0,i.ph)((0,o.EK)(((e,{chatId:t,isSavedDialog:n,isPreview:i,previewMessageId:o})=>{const a=(0,d.hds)(e,t),r=(0,d.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const l=o||(0,d.ZZX)(e,t,n?"saved":"all"),u=o?(0,d.O5q)(e,t,o):(0,d.yHC)(e,t,n?"saved":"all"),{isOutgoing:h,forwardInfo:m}=u||{},p=n&&m?.fromId?(0,d.PVB)(e,m.fromId):void 0,g=u?(0,d.Y7C)(e,u):void 0,f=p||g,{chatId:v,threadId:A,type:y}=(0,d.Xf0)(e)||{},C=!i&&t===v&&(n?t===A:A===s.l3),w=a.isForum&&t===v||t===(0,d.nTw)(e).forumPanelChatId,b=(0,d.K0y)(e,t),I=u&&(0,d.nkm)(e,u),S=(0,d.C5H)(e,t,s.l3,"typingStatus"),M=(0,d.xyP)(e,t),N=u?.content.storyData,k=N&&(0,d.Msb)(e,N.peerId,N.id),Y=(0,d.trm)(e);return{chat:a,isMuted:(0,c.If)(a,(0,d.K52)(e),(0,d.P5N)(e,a.id)),lastMessageSender:f,draft:(0,d.GA4)(e,t,s.l3),isSelected:C,isSelectedForum:w,isForumPanelOpen:(0,d.clw)(e),canScrollDown:C&&"thread"===y,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...h&&u&&{lastMessageOutgoingStatus:(0,d.Tl2)(e,u)},user:r,userStatus:b,lastMessageTopic:I,typingStatus:S,withInterfaceAnimations:(0,d.PKK)(e),lastMessage:u,lastMessageId:l,currentUserId:e.currentUserId,listedTopicIds:M?.listedTopicIds,topics:M?.topicsById,isSynced:e.isSynced,lastMessageStory:k,isAccountFrozen:Y}}))((({chatId:e,folderId:t,orderDiff:n,animationType:c,isPinned:D,listedTopicIds:B,topics:R,observeIntersection:O,chat:U,lastMessageStory:z,isMuted:K,user:j,userStatus:V,lastMessageSender:J,lastMessageOutgoingStatus:$,offsetTop:q,draft:G,withInterfaceAnimations:H,isSelected:W,isSelectedForum:_,isForumPanelOpen:Q,canScrollDown:Z,canChangeFolder:X,lastMessageTopic:ee,typingStatus:te,lastMessageId:ne,lastMessage:ie,isSavedDialog:oe,currentUserId:se,isPreview:ae,previewMessageId:re,className:ce,isSynced:de,onDragEnter:le,isAccountFrozen:ue})=>{const{openChat:he,openSavedDialog:me,toggleChatInfo:pe,focusLastMessage:ge,focusMessage:fe,loadTopics:ve,openForumPanel:Ae,closeForumPanel:ye,setShouldCloseRightColumn:Ce,reportMessages:we,openFrozenAccountModal:be}=(0,o.ko)(),{isMobile:Ie}=(0,g.Ay)(),[Se,Me,Ne]=(0,A.A)(),[ke,Ye,Pe]=(0,A.A)(),[Fe,Te,xe]=(0,A.A)(),[De,Ee,Le]=(0,A.A)(),[Be,Re,Oe]=(0,A.A)(),[Ue,ze,Ke]=(0,A.A)(),{isForum:je,isForumAsMessages:Ve}=U||{};(0,v.A)(oe?se:e,ne,ie);const{renderSubtitle:Je,ref:$e}=(0,b.A)({chat:U,chatId:e,lastMessage:ie,typingStatus:te,draft:G,statefulMediaContent:(0,r.FE)({story:z}),lastMessageTopic:ee,lastMessageSender:J,observeIntersection:O,animationType:c,withInterfaceAnimations:H,orderDiff:n,isSavedDialog:oe,isPreview:ae,topics:R}),qe=(0,p.A)(d.sRo),Ge=(0,C.A)((()=>{const t=Ie&&Ve;if(Ie&&Ce({value:!0}),ae)fe({chatId:e,messageId:re});else{if(oe)return me({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Ie&&pe({force:!1}));if(je){if(Q)return void ye(void 0,{forceOnHeavyAnimation:!0});if(t||Ae({chatId:e},{forceOnHeavyAnimation:!0}),!Ve)return}he({id:e,noForumTopicPanel:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),W&&Z&&ge()}})),He=(0,C.A)((t=>{t.preventDefault(),le?.(e)})),We=(0,C.A)((()=>{ue?be():(Ee(),Me())})),_e=(0,C.A)((()=>{ue?be():(Re(),Ye())})),Qe=(0,C.A)((()=>{ze(),Te()})),Ze=(0,C.A)((()=>{ue?be():U&&we({chatId:U.id,messageIds:[]})})),Xe=(0,f.A)({chat:U,user:j,handleDelete:We,handleMute:_e,handleChatFolderChange:Qe,handleReport:Ze,folderId:t,isPinned:D,isMuted:K,canChangeFolder:X,isSavedDialog:oe,currentUserId:se,isPreview:ae,topics:R}),et=(0,y.Vz)($e,U?O:void 0);(0,i.vJ)((()=>{et&&je&&de&&void 0===B&&ve({chatId:e})}),[e,B,de,je,et]);const tt=j&&V&&(0,r.PF)(j,V),{hasShownClass:nt}=(0,w.A)(tt),it=(0,i.Kr)((()=>{if(l.OS)return oe?`#${(0,m.az)(se,"thread",e)}`:`#${(0,m.az)(e,"thread",s.l3)}`}),[e,se,oe]);if(!U)return;const ot=j||U,st=(0,u.A)("Chat chat-item-clickable",(0,h.L8)(e)?"private":"group",je&&"forum",W&&"selected",_&&"selected-forum",ae&&"standalone",ce);return(0,E.FD)(P.A,{ref:$e,className:st,href:it,style:`top: ${q}px`,ripple:!je&&!Ie,contextActions:Xe,onClick:Ge,onDragEnter:He,withPortalForMenu:!0,children:[(0,E.FD)("div",{className:(0,u.A)("status","status-clickable"),children:[(0,E.Y)(I.A,{peer:ot,isSavedMessages:j?.isSelf,isSavedDialog:oe,size:ae?"medium":"large",withStory:!j?.isSelf,withStoryGap:nt||Boolean(U.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,E.FD)("div",{className:"avatar-badge-wrapper",children:[(0,E.Y)("div",{className:(0,u.A)("avatar-online","avatar-badge",nt&&"avatar-online-shown")}),!nt&&Boolean(U.subscriptionUntil)&&(0,E.Y)(k.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,E.Y)(x.A,{chat:U,isMuted:K,shouldShowOnlyMostImportant:!0,forceHidden:qe,topics:R,isSelected:W})]}),U.isCallActive&&U.isCallNotEmpty&&(0,E.Y)(L,{isMobile:Ie,isSelected:W,isActive:H})]}),(0,E.FD)("div",{className:"info",children:[(0,E.FD)("div",{className:"info-row",children:[(0,E.Y)(M.A,{peer:ot,withEmojiStatus:!0,isSavedMessages:e===j?.id&&j?.isSelf,isSavedDialog:oe,observeIntersection:O}),K&&!oe&&(0,E.Y)(N.A,{name:"muted"}),(0,E.Y)("div",{className:"separator"}),ie&&(0,E.Y)(Y.A,{message:ie,outgoingStatus:oe?void 0:$,draftDate:G?.date})]}),(0,E.FD)("div",{className:"subtitle",children:[Je(),!ae&&(0,E.Y)(x.A,{chat:U,isPinned:D,isMuted:K,isSavedDialog:oe,hasMiniApp:j?.hasMainMiniApp,topics:R,isSelected:W})]})]}),De&&(0,E.Y)(S.A,{isOpen:Se,onClose:Ne,onCloseAnimationEnd:Le,chat:U,isSavedDialog:oe}),Be&&(0,E.Y)(T.A,{isOpen:ke,onClose:Pe,onCloseAnimationEnd:Oe,chatId:e}),Ue&&(0,E.Y)(F.A,{isOpen:Fe,onClose:xe,onCloseAnimationEnd:Ke,chatId:e})]})})))},34458:(e,t,n)=>{n.d(t,{$:()=>v,UG:()=>l,wV:()=>f});var i=n(31481),o=n(66644),s=n(19822),a=n(83868),r=n(76023),c=n(2429),d=n(17169);const l=250,u=.25*r.$,h=11,m=.1875*r.$,p=.125*r.$,g=new Set;function f(e){I();const{container:t,toggler:n,leftMainHeader:a,ribbonPeers:r,toggleAvatars:c}=A(e);if(!(n&&c&&r&&t&&a))return;const{bottom:p,right:f}=a.getBoundingClientRect(),v=p+u,S=c[0],M=c[c.length-1],N=C(S);Array.from(r).reverse().forEach(((e,a,{length:r})=>{const c=C(e);if(!c)return;const u=c===N;let p=w(n,c),A=h+a+1;if(p||(p=a===r-1?M:S,A=h),!p)return;let{top:I,left:k,width:Y}=p.getBoundingClientRect();const{left:P,width:F}=e.getBoundingClientRect();if(P>f)return;k-=m,Y+=2*m;const T=k-P,x=I-v,D=Y/F;I-=m;const E=P-k+2*m,L=v-I+m,B=F/(Y+2*m);(0,o.RK)((()=>{if(!p)return;const n=y(e);let a;A>h?(a=y(p),u&&a.classList.add(d.A.ghostLast)):n.classList.add(d.A.ghostAnimateName),(0,s.ZM)(n,{top:`${v}px`,left:`${P}px`,zIndex:String(A),opacity:a?"0":"",transform:`translate3d(${T}px, ${x}px, 0) scale(${D})`}),a&&(0,s.ZM)(a,{top:`${I}px`,left:`${k}px`,zIndex:String(A)}),t.appendChild(n),a&&t.appendChild(a),p.classList.add("animating"),e.classList.add("animating"),(0,o.RK)((()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${E}px, ${L}px, 0) scale(${B})`}):n.classList.add(d.A.ghostRevealName);const r=b((()=>{(0,o.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+i.xB5);g.add(r)}))}))}))}function v(e){I();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:c}=A(e);if(!(n&&a&&r&&t&&c))return;const{right:u}=c.getBoundingClientRect(),f=a[0],v=a[a.length-1],S=C(f);Array.from(r).reverse().forEach(((e,a,{length:r})=>{const c=C(e);if(!c)return;const A=c===S;let I=w(n,c),M=h+a+1;if(I||(I=a===r-1?v:f,M=h),!I)return;const{top:N,left:k,width:Y}=e.getBoundingClientRect();let{left:P,width:F,top:T}=I.getBoundingClientRect();if(k>u)return;P-=m,F+=2*m;const x=P-k,D=T-N-p,E=F/Y;T-=m;const L=k-P+2*m,B=N-T+m,R=Y/(F+2*m);(0,o.RK)((()=>{const n=y(e);let a;M>h?(a=y(I),A&&a.classList.add(d.A.ghostLast)):n.classList.add(d.A.ghostAnimateName,d.A.ghostRevealName),(0,s.ZM)(n,{top:`${N}px`,left:`${k}px`,width:`${Y}px`,zIndex:String(M)}),a&&(0,s.ZM)(a,{top:`${T}px`,left:`${P}px`,zIndex:String(M),opacity:"0",transform:`translate3d(${L}px, ${B}px, 0) scale(${R})`}),e.classList.add("animating"),I.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,o.RK)((()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${x}px, ${D}px, 0) scale(${E})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(d.A.ghostRevealName);const r=b((()=>{(0,o.RK)((()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),I.classList.remove("animating")})),g.delete(r)}),l+i.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"),i=t.querySelector("#StoryRibbon"),o=t.querySelector(".left-header"),s=i?.querySelectorAll(`.${c.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:o,ribbonPeers:s,toggleAvatars:a}}function y(e){const t=e.cloneNode(!0);t.classList.add(d.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 b(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function I(){g.forEach((e=>e())),g.clear()}},35127:(e,t,n)=>{n.d(t,{MC:()=>a,ej:()=>c,nP:()=>d,yA:()=>l});var i=n(76023);const o=12,s=40,a=20*i.$,r=o*i.$,c=5*i.$;function d(e,t){return(e?.length??0)>s||t?a:r}function l({media:e,messageText:t,isOwn:n,isInWebPage:s,asForwarded:a,noAvatars:r,isMobile:l}){const u="photo"===e.mediaType,h="video"===e.mediaType,m=u&&s,p=h&&s,{width:g,height:f}=u?(0,i.ck)(e,n,a,m,r,l):h?(0,i.rO)(e,n,a,p,r,l):(0,i.ri)(e,n,a,s,r,l),v=d(t);let A=1;g<v&&v-g<o&&(A=v/g),f*A<c&&c-f*A<o&&(A=c/f);const y=Math.round(g*A),C=Math.round(f*A);return{width:y,height:C,isSmall:y<v||C<c}}},36353:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(96454);function o(e,t,n){if(!t&&e===document.activeElement)return;const o=window.getSelection(),s=document.createRange(),a=e.lastChild||e;i.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),o.removeAllRanges(),o.addRange(s)):e.focus()}},36680:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(84051),o=n(96454),s=n(17712);const a=250;let r;function c(e,t,n=a,c=!1){const d=(0,i.li)(!1),l=(0,s.A)((()=>{d.current=!0}));return(0,i.vJ)((()=>{r&&(clearTimeout(r),r=void 0),!e||o.TF||c||(r=window.setTimeout((()=>{d.current||t()}),2*n))}),[c,e,n,t]),[(0,s.A)((()=>{d.current=!0})),(0,s.A)((()=>{d.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout((()=>{d.current||t()}),n)})),l]}},37378:(e,t,n)=>{n.d(t,{A:()=>f});var i=n(84051),o=n(90709),s=n(87357),a=n(17663),r=n(58849),c=n(49086),d=n(4961),l=n(17712),u=n(59030),h=n(96530),m=n(81524),p=n(84685),g=n(20021);const f=(0,i.ph)((({message:e,senderTitle:t,isProtected:n,observeIntersection:i,onMessageClick:f})=>{const v=(0,u.A)();let A=(0,o.T_)(e);if(!A){const t=(0,o.ZD)(e);if(t){const{url:n,domain:i}=t;A={siteName:i.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,o.P5)(e)?.text!==n?(0,c.C)(v,e,void 0,void 0,170):void 0}}}const y=(0,l.A)((()=>{f(e)}));if(!A)return;const{siteName:C,url:w,displayUrl:b,title:I,description:S,formattedDescription:M,photo:N,video:k}=A,Y=!t&&S&&(0,r.A)(S,170),P=(0,s.A)("WebLink scroll-item",!N&&!k&&"without-media"),F=w.replace("mailto:","")||b;return(0,g.FD)("div",{className:P,"data-initial":(C||b)[0],dir:v.isRtl?"rtl":void 0,children:[N&&(0,g.Y)(m.A,{message:e,isProtected:n,observeIntersection:i}),(0,g.FD)("div",{className:"content",children:[(0,g.Y)(h.A,{isRtl:v.isRtl,className:"site-title",onClick:y,children:(0,d.A)(I||C||b)}),(Y||M)&&(0,g.Y)(h.A,{isRtl:v.isRtl,className:"site-description",onClick:y,children:M||Y&&(0,d.A)(Y)}),(0,g.Y)(p.A,{url:w,className:"site-name",text:F,isRtl:v.isRtl}),t&&(0,g.Y)("div",{className:"sender-name",children:(0,d.A)(t)})]}),t&&(0,g.Y)("div",{className:"message-date",children:(0,g.Y)(h.A,{className:"date",onClick:y,isRtl:v.isRtl,children:(0,a.be)(v,1e3*e.date)})})]})}))},37830:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(87894);const o=new WeakMap;function s(e){return(...t)=>{const n=o.get(e);if(n&&(0,i.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return o.set(e,{lastArgs:t,lastResult:s}),s}}},38102:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(87412),s=n(76471),a=n(20021);const r=(0,i.ph)((({topic:e,className:t,letterClassName:n,size:i,noLoopLimit:r,observeIntersection:c,onClick:d})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(o.A,{documentId:e.iconEmojiId,className:t,size:i,observeIntersectionForPlaying:c,loopLimit:r?void 0:2,onClick:d}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:d})))},38218:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(31481),s=n(17712);const a=function({onClick:e,onStart:t,onEnd:n,threshold:a=250}){const r=(0,i.li)(!1),c=(0,i.li)(!1),d=(0,i.li)(void 0),l=(0,s.A)((e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!c.current&&n&&(c.current=!0,d.current=window.setTimeout((()=>{t?.(),r.current=!0}),a))})),u=(0,s.A)((t=>{c.current&&(r.current?n?.():e?.(t),h())})),h=(0,s.A)((()=>{r.current=!1,c.current=!1,window.clearTimeout(d.current)}));return(0,i._W)((()=>{window.clearTimeout(d.current)})),(0,i.vJ)((()=>(document.body.addEventListener(o.D2Y,h),()=>{document.body.removeEventListener(o.D2Y,h)})),[]),{onMouseDown:l,onMouseUp:u,onMouseLeave:u,onTouchStart:l,onTouchEnd:u}}},39074:(e,t,n)=>{n.d(t,{DY:()=>c,JC:()=>a,LV:()=>s,oR:()=>o,vZ:()=>r});const i=document.createElement("div");function o(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const i=n.createContextualFragment(e),o=i.lastChild;n.insertNode(i),o?(n.setStartAfter(o),n.setEndAfter(o)):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 o=n.getRangeAt(0).cloneRange();return o.intersectsNode(e)?t||e.contains(o.commonAncestorContainer)?(o.collapse(!0),o.setStart(e,0),i.innerHTML="",i.appendChild(o.cloneContents()),i.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const i=n.getRangeAt(0),o=i.cloneRange();return o.selectNodeContents(e),o.setEnd(i.endContainer,i.endOffset),t=o.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(),i=window.getSelection();return e.setStart(n,t),e.collapse(!0),i.removeAllRanges(),i.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function c(){const e=window.getSelection();e?.removeAllRanges()}},40175:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(84051),o=n(13439),s=n(31481),a=n(29807),r=n(34458),c=n(59030),d=n(21511),l=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,i.ph)((0,o.EK)(((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:i},byPeerId:o}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),c=(0,a.clw)(e),d=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:i,isShown:t?!r:!s,isForumPanelOpen:c,withAnimation:d,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:o}}))((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,o.ko)(),w=(0,c.A)(),b=(0,i.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]),I=(0,i.Kr)((()=>b?.length?b.reduce(((e,t)=>{const n=y[t.id];if(!n)return e;const i=n.orderedIds.some((e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const i=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!i}));return e[t.id]=i,e}),{}):{}),[y,b]),S=(0,i.Kr)((()=>t.slice(0,5)),[t]);(0,l.A)(S);const M=p&&g,{ref:N,shouldRender:k}=(0,d.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,i.vJ)((()=>{A&&!f&&(M?((0,i.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,i.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("Chat.Context.Peer.OpenStory"),onClick:()=>C({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0,children:b.map((e=>(0,m.Y)(u.A,{peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:I[e.id]},e.id)))})})))},40435:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(41074);const o={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(o[a||"light"][t?"outgoing":"incoming"]):(0,i.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%i.bP)}},41074:(e,t,n)=>{n.d(t,{Ay:()=>r,M1:()=>c,bP:()=>s});var i=n(31481),o=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return i.W75?[]:(a||(a=new Array(s).fill(void 0).map((()=>{const e=new Worker(new URL(n.p+n.u(9443),n.b));return{worker:e,connector:(0,o.U)(e,void 0,"media")}}))),a)}function c(e,t){return r()[t].connector.request(e)}},41118:(e,t,n)=>{n.d(t,{A:()=>H});var i=n(84051),o=n(13439),s=n(89925),a=n(31481),r=n(96454),c=n(87357),d=n(49763),l=n(80140),u=n(23459),h=n(66644),m=n(9718),p=n(16581),g=n(17712),f=n(20021),v=n(74984),A=n(2178),y=n(96374),C=n(5912),w=n(9717),b=n(46222),I=n(52745),S=n(90709),M=n(87894),N=n(14242),k=n(4961),Y=n(39351),P=n(21849),F=n(18276),T=n(24713),x=n(22720);const D={root:"sG8AAzvK",minimized:"lTOui0dp",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"},E={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},L=(0,i.ph)((({archiveSettings:e,onDragEnter:t,onClick:n})=>{const{updateArchiveSettings:s}=(0,o.ko)(),r=(0,Y.A)(),d=(0,v.Rh)(a._E9),l=(0,v.ic)(),u=l[a._E9]?.chatsCount,h=(0,i.Kr)((()=>{if(!d?.length)return r("Loading");const e=(0,o.mS)().chats.byId;return d.slice(0,5).map(((t,n,i)=>{const o=n===i.length-1,s=e[t];if(!s)return;const a=(0,S.Js)(r,s);return(0,f.FD)(f.FK,{children:[(0,f.Y)("span",{className:(0,c.A)(D.chat,u&&s.unreadCount&&D.unread),children:(0,k.A)(a)}),o?"":", "]})}))}),[d,r,u]),m=(0,i.Kr)((()=>{const t=!e.isMinimized&&{title:r("ContextArchiveCollapse"),icon:"collapse",handler:()=>{s({isMinimized:!0})}},n=e.isMinimized&&{title:r("ContextArchiveExpand"),icon:"expand",handler:()=>{s({isMinimized:!1})}},i={title:r("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{s({isHidden:!0})}};return(0,M.oE)([t,n,i])}),[e.isMinimized,r,s]),p=(0,i.hb)((e=>{e.preventDefault(),t?.()}),[t]);return(0,f.Y)(x.A,{onClick:n,onDragEnter:p,className:(0,c.A)(D.root,e.isMinimized&&D.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:D.button,contextActions:m,withPortalForMenu:!0,children:e.isMinimized?(0,f.Y)("div",{className:(0,c.A)(D.info,"info"),children:(0,f.FD)("div",{className:"info-row",children:[(0,f.Y)("div",{className:(0,c.A)("title",D.title),children:(0,f.FD)("h3",{dir:"auto",className:(0,c.A)(D.name,"fullName"),children:[(0,f.Y)(F.A,{name:"archive-filled",className:D.icon}),r("ArchivedChats")]})}),(0,f.Y)(T.A,{className:D.unreadCount,text:u?(0,N.Vw)(r,u):void 0})]})}):(0,f.FD)(f.FK,{children:[(0,f.Y)("div",{className:(0,c.A)("status",D.avatarWrapper),children:(0,f.Y)(P.A,{peer:E})}),(0,f.FD)("div",{className:(0,c.A)(D.info,"info"),children:[(0,f.Y)("div",{className:"info-row",children:(0,f.Y)("div",{className:(0,c.A)("title",D.title),children:(0,f.Y)("h3",{dir:"auto",className:(0,c.A)(D.name,"fullName"),children:r("ArchivedChats")})})}),(0,f.FD)("div",{className:"subtitle",children:[(0,f.Y)("div",{className:(0,c.A)("status",D.chatsPreview),children:h}),(0,f.Y)(T.A,{className:D.unreadCount,text:u?(0,N.Vw)(r,u):void 0})]})]})]})})}));var B=n(32754),R=n(29807),O=n(43874),U=n(59030),z=n(79577),K=n(64493);const j=(0,i.ph)((0,o.EK)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,R.$aQ)(e,t):void 0,animatedEmoji:(0,R.oei)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,o.ko)(),r=(0,U.A)(),{isMobile:c}=(0,O.Ay)(),d=(0,i.hb)((()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})}),[e,n]);return(0,f.FD)("div",{className:"yftKUVDQ",children:[(0,f.Y)("div",{className:"UCBfMOiz",children:t&&(0,f.Y)(z.A,{sticker:t,size:96})}),(0,f.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,f.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,f.FD)(K.A,{ripple:!c,fluid:!0,pill:!0,onClick:d,size:"smaller",isRtl:r.isRtl,children:[(0,f.Y)(F.A,{name:"settings"}),(0,f.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})]})]})}))),V=(0,i.ph)((({onClick:e})=>{const t=(0,Y.A)();return(0,f.FD)("div",{className:"fOmerTkM",onClick:e,children:[(0,f.Y)("div",{className:"URLYINJA",children:t("TitleFrozenAccount")}),(0,f.Y)("div",{className:"mCFsx7Tv",children:t("SubtitleFrozenAccount")})]})}));var J=n(93545);const $="pedMJD_v",q=(0,i.ph)((({sessions:e,onHeightChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,o.ko)(),r=(0,i.li)(),c=(0,U.A)();(0,J.A)(r,(e=>{const n=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;t(n)}));const d=(0,i.Kr)((()=>Object.values(e).sort(((e,t)=>t.dateCreated-e.dateCreated)).find((e=>e.isUnconfirmed))),[e]),l=(0,i.Kr)((()=>[d.deviceModel,d.region,d.country].filter(Boolean).join(", ")),[d]),u=(0,g.A)((()=>{n({hash:d.hash,isConfirmed:!0})})),h=(0,g.A)((()=>{s({hash:d.hash}),a({title:c("UnconfirmedAuthDeniedTitle",1),message:c("UnconfirmedAuthDeniedMessageSingle",l)})}));return(0,f.FD)("div",{className:"yEkGgZVL",ref:r,children:[(0,f.Y)("h2",{className:"VhAJDrnz",children:c("UnconfirmedAuthTitle")}),(0,f.Y)("p",{className:"WmyL1NJ8",children:c("UnconfirmedAuthSingle",l)}),(0,f.FD)("div",{className:"_40UGD1Y",children:[(0,f.Y)(K.A,{fluid:!0,isText:!0,size:"smaller",className:$,onClick:u,children:c("UnconfirmedAuthConfirm")}),(0,f.Y)(K.A,{fluid:!0,isText:!0,size:"smaller",color:"danger",onClick:h,className:$,children:c("UnconfirmedAuthDeny")})]})]})})),G=new Set(["9","0"]),H=(0,i.ph)((({className:e,folderType:t,folderId:n,isActive:S,isForumPanelOpen:M,canDisplayArchive:N,archiveSettings:k,sessions:Y,isAccountFrozen:P,isMainList:F,foldersDispatch:T})=>{const{openChat:x,openNextChat:D,closeForumPanel:E,toggleStoryRibbon:R,openFrozenAccountModal:O,openLeftColumnContent:U}=(0,o.ko)(),z=(0,i.li)(),K=(0,i.li)(!1),[J,$]=(0,i.J0)(0),H="archived"===t,W="all"===t,_="saved"===t,Q=W?a.DSF:H?a._E9:_?a.pX9:n,Z=W&&N&&k,X=P&&W,ee=(0,v.Rh)(Q);(0,u.A)(ee);const te=(ee?.length||0)*a.yq1,ne=Z?k?.isMinimized?a.eqO:a.yq1:0,ie=X?68:0,{orderDiffById:oe,getAnimationType:se}=(0,w.A)(ee),[ae,re]=(0,y.A)(void 0,ee,void 0,a.T7t),ce=(0,i.Kr)((()=>{const e=Object.values(Y||{}),t=e.find((e=>e.isCurrent));return!(!t||(0,l.Fm)()-t.dateCreated<a.C7Y)&&!P&&W&&e.some((e=>e.isUnconfirmed))}),[W,Y,P]);(0,i.vJ)((()=>{ce||$(0)}),[ce]),(0,A.v)((0,i.Kr)((()=>S&&ee?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),D({targetIndexDelta:-1,orderedIds:ee})},"Alt+ArrowDown":e=>{e.preventDefault(),D({targetIndexDelta:1,orderedIds:ee})}}:void 0),[S,ee])),(0,i.vJ)((()=>{if(S&&!_&&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||G.has(t))return;const n=Z&&k&&!k.isMinimized,i=n?-1:0,o=Number(t)+i-1;if(n&&-1===o)return void(F&&U({contentKey:s.Bn.Archived}));if(o>ee.length-1)return;x({id:ee[o],shouldReplaceHistory:!0})}}}),[k,_,S,x,D,ee,Z,F]);const{observe:de}=(0,C.BL)({rootRef:z,throttleMs:200}),le=(0,g.A)((()=>{U({contentKey:s.Bn.Archived}),E()})),ue=(0,g.A)((()=>{O()})),he=(0,g.A)((()=>{K.current?K.current=!1:le()})),me=(0,p.A)((e=>{K.current?K.current=!1:x({id:e,shouldReplaceHistory:!0})}),[x],500,!0),pe=(0,g.A)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,i=e.clientY-t.top;n<t.width||i<t.y||(K.current=!0)})),ge=function(e,t,n,o){const s=(0,i.li)(),a=(0,i.li)(!1),c=(0,i.li)(0),d=(0,i.li)(!1),l=(0,i.li)(!0),u=(0,i.li)(0),v=(0,i.li)(!1),A=(0,g.A)(((t=!1)=>{d.current||s.current&&e.current&&(s.current.style.display="block",e.current.scrollTop=1,r.Yw||t||(0,m.E)(e.current),a.current=!0,c.current=1,d.current=!0,l.current=!0)})),y=(0,g.A)((()=>{d.current&&s.current&&(s.current.style.display="none",d.current=!1)})),C=(0,g.A)((()=>{if(!e.current)return;if(a.current)return void(a.current=!1);const i=e.current.scrollTop,o=i>c.current,r=i<c.current,m=0===i,p=Date.now()-u.current;if(s.current){if(m&&!d.current)return void(0,h.dL)(A,[e.current,s.current]);(0,h.dL)(y,s.current)}r&&(l.current&&p>100||i<0&&v.current)?t?.():o&&i>0&&n?.(),c.current=i,l.current=m,u.current=Date.now(),v.current=o&&i<0})),w=(0,p.A)((i=>{if(!e.current)return;const o=e.current;o.scrollHeight>o.offsetHeight||0===i.deltaY||(i.deltaY<0?t?.():n?.())}),[e,t,n],250);return(0,i.vJ)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,h.RK)((()=>{A(!0)})),t.addEventListener("scroll",C,{passive:!0}),t.addEventListener("wheel",w,{passive:!0}),()=>{t.removeEventListener("scroll",C),t.removeEventListener("wheel",w)}}),[e,w]),r.pz||o?void 0:(0,f.Y)("div",{ref:s,className:"overscroll-trigger"},"overscroll-trigger")}(z,(0,g.A)((()=>{R({isShown:!0,isArchived:H})})),(0,g.A)((()=>{R({isShown:!1,isArchived:H})})),_);return(0,f.FD)(b.A,{className:(0,c.A)("chat-list custom-scroll",M&&"forum-panel-open",e),ref:z,items:ae,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,beforeChildren:ge,maxHeight:te+ne+ie+J,onLoadMore:re,onDragLeave:pe,children:[ce&&(0,f.Y)(q,{sessions:Y,onHeightChange:$},"unconfirmed"),X&&(0,f.Y)(V,{onClick:ue},"frozen"),Z&&(0,f.Y)(L,{archiveSettings:k,onClick:le,onDragEnter:he},"archive"),ae?.length?function(){const e=ee.indexOf(ae[0]),t=(0,d.zm)(Q)||0;return ae.map(((i,o)=>{const s=e+o<t,r=J+ne+ie+(e+o)*a.yq1;return(0,f.Y)(B.A,{teactOrderKey:s?o:(0,d.uk)(i,_),chatId:i,isPinned:s,folderId:n,isSavedDialog:_,animationType:se(i),orderDiff:oe[i],offsetTop:r,observeIntersection:de,onDragEnter:me},i)}))}():!ae||ae.length||_?(0,f.Y)(I.A,{},"loading"):(0,f.Y)(j,{folderId:n,folderType:t,foldersDispatch:T})]})}))},41316:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(84051);function o(e){const[t,n]=(0,i.Ul)();return(0,i.vJ)((()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const i=t.getRangeAt(0);if(!i)return;if(!document.querySelector(e))return;const{commonAncestorContainer:o}=i;(o instanceof Element?o:o.parentElement).closest(e)&&n(i)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)}),[e,n]),t}},41510:(e,t,n)=>{n.d(t,{I:()=>w,A:()=>b});var i=n(84051),o=n(13439),s=n(90709),a=n(87357),r=n(11778),c=n(55153),d=n(45761),l=n(39351),u=n(17712),h=n(73767),m=n(50680),p=n(3325),g=n(15283),f=n(37661),v=n(93545),A=n(18276),y=n(20021);const C=(0,i.ph)((({isQuick:e,isGeneric:t,onFileSelect:n})=>{const o=(0,i.li)(),s=(0,i.li)(),[r,c,d]=(0,f.A)(),l=(0,u.A)((e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),d()})),h=(0,u.A)((()=>{const e=s.current;if(!e)return;const{width:t,height:n}=e.getBoundingClientRect();e.viewBox.baseVal.width=t,e.viewBox.baseVal.height=n}));(0,v.A)(o,h),(0,g.A)(h);const m=(0,a.A)("DropTarget",r&&"hovered");return(0,y.FD)("div",{className:m,ref:o,onDrop:n,onDragEnter:c,onDragLeave:l,"data-dropzone":!0,children:[(0,y.Y)("svg",{className:"target-outline-container",children:(0,y.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,y.FD)("div",{className:"target-content",children:[(0,y.Y)(A.A,{name:e?"photo":"document"}),(0,y.Y)("div",{className:"title",children:"Drop files here to send them"}),!t&&(0,y.Y)("div",{className:"description",children:e?"in a quick way":"without compression"})]})]})}));let w=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const b=(0,i.ph)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:g,editingMessage:f})=>{const v=(0,l.A)(),{showNotification:A}=(0,o.ko)(),w=(0,i.li)(),b=(0,h.A)(t),{shouldRender:I,transitionClassNames:S}=(0,m.A)(e);(0,i.vJ)((()=>e?(0,r.A)(n):void 0),[e,n]);const M=(0,u.A)((async e=>{const{dataTransfer:i}=e;let o=[];if(!(i.files&&i.files.length>0)||i.items&&i.items.length){if(i.items&&i.items.length>0){const e=await(0,d.A)(i.items);e?.length&&(o=o.concat(e))}}else o=o.concat(Array.from(i.files));if(f){if(o.length>1)return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:o.length})});if(1===o.length){const e=await(0,c.A)(o[0].name,o[0]);if(!(f&&e&&(0,s.eh)(f,e)))return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:o.length})})}}n(),g(o,!t&&void 0)})),N=(0,u.A)((async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(f){if(e.length>1)return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,c.A)(e[0].name,e[0]);if(!(f&&t&&(0,s.eh)(f,t)))return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}n(),g(e,!0)}})),k=(0,u.A)((e=>{e.stopPropagation();const{target:t,relatedTarget:i}=e;!t.matches(".DropTarget, .DropArea")||i&&i.matches(".DropTarget, .DropArea")||(w.current=window.setTimeout((()=>{n()}),150))}));if(!I)return;const Y=t||b,P=(0,a.A)("DropArea",S);return(0,y.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,y.FD)("div",{className:P,onDragLeave:k,onDragOver:()=>{w.current&&window.clearTimeout(w.current)},onDrop:n,onClick:n,children:[(0,y.Y)(C,{onFileSelect:M,isGeneric:!Y}),Y&&(0,y.Y)(C,{onFileSelect:N,isQuick:!0})]})})}))},42215:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(84051),o=n(30857);function s(e,t){const n=(0,o.A)(),s=(0,i.li)(e),a=(0,i.li)(t),r=(0,i.hb)((e=>(a.current=s.current(a.current,e),n(),a.current)),[]);return[a.current,r]}},42827:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(87357),s=n(4961),a=n(59030),r=n(50680),c=n(20021);const d=(0,i.ph)((({text:e="Nothing found.",description:t})=>{const n=(0,a.A)(),{transitionClassNames:i}=(0,r.A)(!0);return(0,c.FD)("div",{className:(0,o.A)("NothingFound",i,t&&"with-description"),children:[e,t&&(0,c.Y)("p",{className:"description",children:(0,s.A)(n(t),["br"])})]})}))},44589:(e,t,n)=>{n.d(t,{A:()=>A});var i=n(84051),o=n(13439),s=n(31481),a=n(90709),r=n(91525),c=n(37661),d=n(5912),l=n(17712),u=n(62587),h=n(69419),m=n(59030),p=n(19806),g=n(94189),f=n(52988),v=n(20021);const A=(0,i.ph)((({document:e,observeIntersection:t,smaller:n,canAutoLoad:A,autoLoadFileMaxSizeMb:y,uploadProgress:C,withDate:w,datetime:b,className:I,sender:S,isSelected:M,isSelectable:N,shouldWarnAboutSvg:k,isDownloading:Y,message:P,onCancelUpload:F,onMediaClick:T,onDateClick:x})=>{const{cancelMediaDownload:D,downloadMedia:E,setSharedSettingOption:L}=(0,o.ko)(),B=(0,i.li)(),R=(0,m.A)(),[O,U,z]=(0,c.A)(),[K,j]=(0,i.J0)(!1),{fileName:V,size:J,timestamp:$}=e,q=(0,r.rK)(e)||"",G=(0,d.Vz)(B,t),[H,W]=(0,c.A)();(0,i.vJ)((()=>{G&&W()}),[G,W]);const[_,Q]=(0,i.J0)(A&&(!y||J<=1048576*y)),Z=Boolean(Y||_&&H),X=(0,a.mr)(e,"download"),{loadProgress:ee,mediaData:te}=(0,h.A)(X,!Z,(0,a.Cz)(e,"download"),void 0,!0),ne=Boolean(te),{isUploading:ie,isTransferring:oe,transferProgress:se}=(0,a.LK)(C||ee,Z&&!ne,void 0!==C),ae=(0,r.ON)(e),re=ae?(0,a.VD)(e):void 0,ce=ae?e.previewBlobUrl:void 0,de=(0,u.A)((0,a.mr)(e,"pictogram"),!G),le=T&&e.innerMediaType,ue=(0,l.A)((()=>{E({media:e,originMessage:P})})),he=(0,l.A)((()=>{ie?F&&F():Y?D({media:e}):oe?Q(!1):le?T():s.c59.has(q)&&k?U():ue()})),me=(0,l.A)((()=>{L({shouldWarnAboutSvg:!K}),z(),ue()})),pe=(0,l.A)((()=>{x?.(P)}));return(0,v.FD)(v.FK,{children:[(0,v.Y)(f.A,{ref:B,name:V,extension:q,size:J,timestamp:w?b||$:void 0,thumbnailDataUri:re,previewData:ce||de,smaller:n,isTransferring:oe,isUploading:ie,transferProgress:se,className:I,sender:S,isSelectable:N,isSelected:M,actionIcon:le?(0,a.hr)(e)?"play":"eye":"download",onClick:he,onDateClick:x?pe:void 0}),(0,v.FD)(g.A,{isOpen:O,onClose:z,confirmHandler:me,children:[R("lng_launch_svg_warning"),(0,v.Y)(p.A,{className:"dialog-checkbox",checked:K,label:R("lng_launch_exe_dont_ask"),onCheck:j})]})]})}))},44784:(e,t,n)=>{n.d(t,{A:()=>oe});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(90709),c=n(27109),d=n(29807),l=n(85982),u=n(64713),h=n(83868),m=n(59852),p=n(79882),g=n(24899),f=n(4961),v=n(82117),A=n(39351),y=n(17712),C=n(62587),w=n(59030),b=n(38691),I=n(32754),S=n(64493),M=n(22720),N=n(55158),k=n(63152),Y=n(87412),P=n(84685),F=n(66644),T=n(96454),x=n(87357),D=n(17663);const E=1440,L=10080;function B(){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 R(e,t){if(0===t)return e;const n=[];for(const i of e){let e=(i.startMinute+t)%L,o=(i.endMinute+t)%L;e<0&&(e+=L),o<=0&&(o+=L),e>o?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:o})):n.push({startMinute:e,endMinute:o})}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 O=n(98255),U=n(32625),z=n(19129),K=n(37661),j=n(30857),V=n(41036),J=n(18276);const $="MPBKHdZL";var q=n(20021);const G=Array.from({length:7},((e,t)=>t)),H=(0,i.ph)((({businessHours:e})=>{const t=(0,i.li)(),[n,o,s]=(0,K.A)(!1),[a,r,c]=(0,K.A)(!1),d=(0,w.A)(),l=(0,j.A)();(0,U.A)(l,6e4);const u=(0,O.A)((e=>e.timezones?.byId)),h=(0,z.A)(u,[u]),m=(0,i.Kr)((()=>{if(!h)return 0;const t=h[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60}),[e.timezoneId,h]),p=(0,i.Kr)((()=>{const t=B(),n=function(e){const t={};for(const n of e){const e=n.startMinute,i=n.endMinute,o=Math.floor(e/E),s=Math.floor((i-1)/E);for(let n=o;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*E),endMinute:Math.min(E,i-n*E)})}return t}(R(e.workHours,a?m:0)),i={};return G.forEach((e=>{const o=n[e];i[e]=o?o.map((({startMinute:e,endMinute:n})=>n-e===1440?d("BusinessHoursDayFullOpened"):`${(0,D.fU)(d,t+60*e*1e3)} ${(0,D.fU)(d,t+60*n*1e3)}`)):[d("BusinessHoursDayClosed")]})),i}),[e.workHours,a,d,m]),g=(0,i.Kr)((()=>{const t=R(e.workHours,m),n=B(),i=((new Date).getTime()-n)/1e3/60;return t.some((({startMinute:e,endMinute:t})=>e<=i&&i<=t))}),[e.workHours,m]),f=(0,i.Kr)((()=>(new Date(Date.now()-(a?0:60*m*1e3)).getDay()+6)%7),[a,m]),v=(0,y.A)((()=>{n?s():o()})),A=(0,y.A)((e=>{e.stopPropagation(),a?c():r()}));(0,i.vJ)((()=>{if(!n)return;const e=document.querySelector(`.${V.uo} > .${$}`);if(!e)return;const i=e.offsetHeight;(0,F.RK)((()=>{t.current.style.height=`${i}px`}))}),[n]);const C=(0,y.A)((()=>{const e=document.querySelector(`.${V.VY} > .${$}`);(0,F.YS)((()=>{const n=e.offsetHeight;(0,F.RK)((()=>{t.current.style.height=`${n}px`}))}))}));return(0,q.FD)(M.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:v,children:[(0,q.FD)("div",{className:"nHSmCUNs",children:[(0,q.FD)("div",{className:"JTZ8UnnP",children:[(0,q.Y)("div",{children:d("BusinessHoursProfile")}),(0,q.Y)("div",{className:(0,x.A)("JVL7ZnnJ",g&&"segAfYXs"),children:d(g?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,q.Y)(J.A,{className:"dYxw2cFn",name:n?"up":"down"})]}),n&&(0,q.FD)("div",{className:"lp9VIV1o",children:[Boolean(m)&&(0,q.Y)("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:T.TF?void 0:A,onClick:T.TF?A:void 0,children:d(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,q.Y)(V.Ay,{className:"WKgL_XiP",ref:t,name:"fade",activeKey:Number(a),onStart:C,children:(0,q.Y)("dl",{className:$,children:G.map((e=>(0,q.FD)(q.FK,{children:[(0,q.Y)("dt",{className:(0,x.A)("cmxPqAof",e===f&&"YZVvP_56"),children:(0,D.wv)(d,6===e?0:e+1)}),(0,q.Y)("dd",{className:"Rs0VPgpq",children:p[e].map((e=>(0,q.Y)("div",{children:e})))})]})))})})]})]})}));var W=n(87894),_=n(58554),Q=n(14737),Z=n(82855);const X=["🎉","🎆","🎈"],ee=(0,i.ph)((0,o.EK)((e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,d.n_C)(e)}}))((({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:c,isInSettings:d})=>{const{openGiftModal:l,requestConfetti:u}=(0,o.ko)(),h=(0,i.li)(),m=(0,i.li)(!1),[p,g,v]=(0,K.A)(),A=(0,w.A)(),{formattedDate:C,isToday:b,age:I}=(0,i.Kr)((()=>{const e=new Date,n=new Date;return t.year&&n.setFullYear(t.year),n.setMonth(t.month-1),n.setDate(t.day),n.setHours(0,0,0,0),{formattedDate:(0,D.A)(n,A.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&te(n)}}),[t,A]),S=(0,i.Kr)((()=>{if(!I||!b)return;const e=a?.stickers?.filter((({emoji:e})=>e?.endsWith("️⃣")));if(!e)return;const t=(0,W.dU)(e,"emoji");return I.toString().split("").map((e=>t[e+"️⃣"]))}),[I,a?.stickers,b]),N=(0,i.Kr)((()=>{if(!b)return;const e=X[Math.floor(Math.random()*X.length)];return c?.stickers?.find((({emoji:t})=>t===e))}),[c?.stickers,b]);(0,i.vJ)((()=>{if(b&&S&&(S.forEach((e=>{const t=(0,r.Mw)(e,"preview");_.hd(t,s.qZ.BlobUrl)})),N)){const e=(0,r.Mw)(N,"preview");_.hd(e,s.qZ.BlobUrl)}}),[N,b,S]),(0,Q.A)(v,p?3e3:void 0),(0,i.vJ)((()=>{if(p){m.current=!0;const e=document.getElementById(d?"LeftColumn":"RightColumn");if(!e)return;(0,F.YS)((()=>{const{top:t,left:n,width:i,height:o}=e.getBoundingClientRect();u({top:t,left:n,width:i,height:o,style:"top-down"})}))}}),[d,p]);const k=`ProfileBirthday${b?"Today":""}Value${I?"Year":""}`,Y=b&&!e.isPremium&&!e.isSelf&&!n,P=(0,y.A)((()=>{l({forUserId:e.id})})),E=(0,y.A)((()=>{b&&(Y&&m.current?P():g())})),L=!b&&!Y;return(0,q.FD)("div",{className:"wCp6TBYF",children:[(0,q.FD)(M.A,{icon:"calendar",secondaryIcon:Y?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:h,ripple:!L,onClick:E,isStatic:L,onSecondaryIconClick:P,children:[(0,q.Y)("div",{className:"title",dir:A.isRtl?"rtl":void 0,children:(0,f.A)(A(k,[C,I],void 0,I))}),(0,q.Y)("span",{className:"subtitle",children:A(b?"ProfileBirthdayToday":"ProfileBirthday")})]}),p&&T.ol&&S?.map(((e,t)=>(0,q.Y)("div",{className:(0,x.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,q.Y)(Z.A,{containerRef:h,sticker:e,size:128,forceAlways:!0})}))),p&&N&&(0,q.Y)("div",{className:"cFEXGUih",children:(0,q.Y)(Z.A,{containerRef:h,sticker:N,size:288,shouldLoop:!0,forceAlways:!0})})]})})));function te(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const i=t.getMonth()-e.getMonth();return(i<0||0===i&&t.getDate()<e.getDate())&&n--,n}const ne="UZbkeFDB",ie={width:64,height:64,zoom:15},oe=(0,i.ph)((0,o.EK)(((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:i}}=e,o=t?(0,d.hds)(e,t):void 0,s=t?(0,d.mBe)(e,t):void 0,a=t?(0,d.XOs)(e,t):void 0,l=o?.isForum,u=o&&(0,c.If)(o,(0,d.K52)(e),(0,d.P5N)(e,o.id)),{threadId:h}=(0,d.Xf0)(e)||{},m=l&&h?Number(h):void 0,p=o&&(0,d.AWZ)(e,o.id),g=s&&(0,d.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=o&&!s&&(!(0,r.WX)(o)&&!(0,r.Sq)(o,"inviteUsers")||(0,r.ub)(o,"inviteUsers")),C=m?(0,d.sZk)(e,t,m):void 0,w=!n&&e.chats.listIds.saved?.includes(t),b=g?.personalChannelId?(0,d.hds)(e,g.personalChannelId):void 0,I=s?.hasMainMiniApp;return{phoneCodeList:i,chat:o,user:s,userFullInfo:g,canInviteUsers:y,botAppPermissions:a,isMuted:u,topicId:m,chatInviteLink:v,description:A,topicLink:C,hasSavedMessages:w,personalChannel:b,hasMainMiniApp:I,isBotCanManageEmojiStatus:g?.isBotCanManageEmojiStatus,botVerification:f}}))((({chatOrUserId:e,user:t,chat:n,userFullInfo:c,isInSettings:d,canInviteUsers:F,isMuted:T,phoneCodeList:x,topicId:D,description:E,chatInviteLink:L,topicLink:B,hasSavedMessages:R,personalChannel:O,hasMainMiniApp:U,isBotCanManageEmojiStatus:z,botAppPermissions:K,botVerification:j})=>{const{showNotification:V,updateChatMutedState:J,updateTopicMutedState:$,loadPeerStories:G,openSavedDialog:W,openMapModal:_,requestCollectibleInfo:Q,requestMainWebView:Z,toggleUserEmojiStatusPermission:X,toggleUserLocationPermission:te}=(0,o.ko)(),{id:oe,usernames:se,phoneNumber:ae,isSelf:re}=t||{},{id:ce,usernames:de}=n||{},le=oe||ce,{businessLocation:ue,businessWorkHours:he,personalChannelMessageId:me,birthday:pe}=c||{},ge=(0,w.A)(),fe=(0,A.A)();(0,v.A)((([e])=>{le&&e!==le&&(t||n&&(0,r.WX)(n))&&G({peerId:le})}),[le,n,t]);const{width:ve,height:Ae,zoom:ye}=ie,Ce=(0,b.A)(),we=ue?.geo&&(0,r.rt)(ue.geo,ve,Ae,ye,Ce),be=(0,C.A)(we),Ie=(0,i.Kr)((()=>{if(ue?.geo)return be?(0,q.Y)("img",{src:be,alt:"",className:ne}):(0,q.Y)(N.A,{className:ne})}),[ue,be]),Se=Boolean(D&&D!==s.l3),Me=n&&(0,r.WX)(n)||t?.isPremium,Ne=(0,i.Kr)((()=>{const e=se?.filter((e=>e.isActive));return e?.length?e:void 0}),[se]),ke=(0,i.Kr)((()=>{const e=t?void 0:de?.filter((e=>e.isActive));return e?.length?e:void 0}),[de,t]),Ye=(0,i.Kr)((()=>{if(n)return Se?B:(0,r.L7)(n)||L}),[n,Se,B,L]),Pe=(0,y.A)((()=>{const{address:e,geo:t}=ue;if(!t)return(0,l.eM)(e),void V({message:ge("BusinessLocationCopied")});_({geoPoint:t,zoom:ye})})),Fe=(0,y.A)((()=>{Se?$({chatId:ce,topicId:D,isMuted:!T}):J({chatId:ce,isMuted:!T})})),Te=(0,y.A)((()=>{t&&X({botId:t.id,isEnabled:!z})})),xe=(0,y.A)((()=>{t&&te({botId:t.id,isAccessGranted:!K?.geolocation})})),De=(0,y.A)((()=>{W({chatId:e})}));function Ee(e,t){(0,l.eM)(e),V({message:`${t} was copied`})}const Le=ae&&(0,u.Ox)(x,ae),Be=(0,y.A)((()=>{ae?.length===a.PGI&&ae.startsWith(a._Bb)?Q({collectible:ae,peerId:le,type:"phone"}):Ee(Le,ge("Phone"))})),Re=(0,y.A)(((e,t)=>{e.isEditable?Ee((0,g.A)(e.username,t),ge(t?"Link":"Username")):Q({collectible:e.username,peerId:le,type:"username"})})),Oe=(0,y.A)((()=>{const e=t?.id;if(!e)return;const n=(0,m.A)();Z({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})})),Ue=fe("ProfileOpenAppAbout",{terms:(0,q.Y)(P.A,{text:fe("ProfileOpenAppTerms"),url:fe("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if(!(n?.isRestricted||re&&!d))return(0,q.FD)("div",{className:"ChatExtra",children:[O&&(0,q.FD)("div",{className:"HP5EJx7s",children:[(0,q.Y)("h3",{className:"cHyTGri2",children:ge("ProfileChannel")}),(0,q.Y)("span",{className:"kYd2GrmU",children:ge("Subscribers",O.membersCount,"i")}),(0,q.Y)(I.A,{chatId:O.id,orderDiff:0,animationType:p.I.None,isPreview:!0,previewMessageId:me,className:"qOJwhXMC"})]}),Boolean(Le?.length)&&(0,q.FD)(M.A,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:Be,children:[(0,q.Y)("span",{className:"title",dir:fe.isRtl?"rtl":void 0,children:Le}),(0,q.Y)("span",{className:"subtitle",children:ge("Phone")})]}),Ne&&ze(Ne),E&&Boolean(E.length)&&(0,q.FD)(M.A,{icon:"info",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,children:[(0,q.Y)("span",{className:"title word-break allow-selection",dir:fe.isRtl?"rtl":void 0,children:(0,f.A)(E,["br",Me?"links":"tg_links","emoji"])}),(0,q.Y)("span",{className:"subtitle",children:ge(oe?"UserBio":"Info")})]}),ke&&!Se&&ze(ke,!0),(!ke&&F||Se)&&Ye&&(0,q.FD)(M.A,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>Ee(Ye,ge("SetUrlPlaceholder")),children:[(0,q.Y)("div",{className:"title",children:Ye}),(0,q.Y)("span",{className:"subtitle",children:ge("SetUrlPlaceholder")})]}),pe&&(0,q.Y)(ee,{birthday:pe,user:t,isInSettings:d},le),U&&(0,q.FD)(M.A,{multiline:!0,isStatic:!0,narrow:!0,children:[(0,q.Y)(S.A,{className:"x925YeS3",size:"smaller",onClick:Oe,children:ge("ProfileBotOpenApp")}),(0,q.Y)("div",{className:"IrqRJFxm",children:Ue})]}),!d&&(0,q.FD)(M.A,{icon:"unmute",narrow:!0,ripple:!0,onClick:Fe,children:[(0,q.Y)("span",{children:ge("Notifications")}),(0,q.Y)(k.A,{id:"group-notifications",label:oe?"Toggle User Notifications":"Toggle Chat Notifications",checked:!T,inactive:!0})]}),he&&(0,q.Y)(H,{businessHours:he}),ue&&(0,q.FD)(M.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:Ie,onClick:Pe,children:[(0,q.Y)("div",{className:"title",children:ue.address}),(0,q.Y)("span",{className:"subtitle",children:ge("BusinessProfileLocation")})]}),R&&!d&&(0,q.Y)(M.A,{icon:"saved-messages",narrow:!0,ripple:!0,onClick:De,children:(0,q.Y)("span",{children:ge("SavedMessagesTab")})}),c&&"isBotAccessEmojiGranted"in c&&(0,q.FD)(M.A,{icon:"user",narrow:!0,ripple:!0,onClick:Te,children:[(0,q.Y)("span",{children:ge("BotProfilePermissionEmojiStatus")}),(0,q.Y)(k.A,{label:ge("BotProfilePermissionEmojiStatus"),checked:z,inactive:!0})]}),void 0!==K?.geolocation&&(0,q.FD)(M.A,{icon:"location",narrow:!0,ripple:!0,onClick:xe,children:[(0,q.Y)("span",{children:ge("BotProfilePermissionLocation")}),(0,q.Y)(k.A,{label:ge("BotProfilePermissionLocation"),checked:K?.geolocation,inactive:!0})]}),j&&(0,q.FD)("div",{className:"RWFu5ENh",children:[(0,q.Y)(Y.A,{className:"b32hsSPS",documentId:j.iconId,size:16}),j.description]})]});function ze(e,t){const[n,...i]=e,o=i.length?ge("UsernameAlso","%USERNAMES%").split("%").map((e=>"USERNAMES"===e?(0,q.Y)(q.FK,{children:i.map(((e,n)=>(0,q.FD)(q.FK,{children:[n>0?", ":"",(0,q.Y)("a",{href:(0,g.A)(e.username,!0),onMouseDown:h.A,onClick:n=>{(0,h.A)(n),Re(e,t)},className:"text-entity-link username-link",children:(0,g.A)(e.username)},e.username)]})))}):e)):void 0;return(0,q.FD)(M.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{Re(n,t)},children:[(0,q.Y)("span",{className:"title",dir:fe.isRtl?"rtl":void 0,children:(0,g.A)(n.username,t)}),(0,q.FD)("span",{className:"subtitle",children:[o&&(0,q.Y)("span",{className:"other-usernames",children:o}),ge(t?"Link":"Username")]})]})}})))},45318:(e,t,n)=>{e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"},45761:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(87679);async function o(e){const t=[];function n(e,i){return new Promise((o=>{if(e instanceof File)t.push(e),o(e);else if(e.isFile){const n=i.getAsFile();e.file((e=>{t.push(e),o(e)}),(()=>{n&&t.push(n),o(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let o=0;o<e.length;o++)t.push(n(e[o],i));o(Promise.all(t))}))}))}const o=[];for(let t=0;t<e.length;t++){const i=e[t];if("file"===i.kind){const e=i.webkitGetAsEntry()||i.getAsFile();e&&o.push(n(e,i))}}return await Promise.all(o),(0,i.kc)(t)}},46051:(e,t,n)=>{n.d(t,{G:()=>i,w:()=>o});const i="video/mp4; codecs=hvc1.1.6.L63.00",o="video/mp4; codecs=avc1.64001E"},47058:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(13439),s=n(87357),a=n(85982),r=n(43874),c=n(17712),d=n(59030),l=n(64493),u=n(22699),h=n(24433),m=n(18276);var p=n(20021);const g=(0,i.ph)((({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,d.A)(),{showNotification:y,openChatWithDraft:C}=(0,o.ko)(),{isMobile:w}=(0,r.Ay)(),b=!v,I=(0,c.A)((()=>{(0,a.eM)(t),y({message:{key:"LinkCopied"}})})),S=(0,c.A)((()=>{n||I()})),M=(0,c.A)((()=>{C({text:{text:t}})})),N=(0,i.Kr)((()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(l.A,{round:!0,ripple:!w,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:A("AccDescrOpenMenu2"),children:(0,p.Y)(m.A,{name:"more"})})),[w,A]);return(0,p.FD)("div",{className:g,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:A(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:S}),b?(0,p.Y)(l.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,disabled:n,onClick:S,children:(0,p.Y)(m.A,{name:"copy"})}):(0,p.FD)(u.A,{className:"p7t3macG",trigger:N,positionX:"right",children:[(0,p.Y)(h.A,{icon:"copy",onClick:S,disabled:n,children:A("Copy")}),v&&(0,p.Y)(h.A,{icon:"delete",onClick:v,destructive:!0,children:A("RevokeButton")})]})]}),f&&(0,p.Y)(l.A,{size:"smaller",disabled:n,onClick:M,className:"Sbagy_Tm",children:A("FolderLinkScreen.LinkActionShare")})]})}))},47067:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(31481),a=n(90709),r=n(96454),c=n(9716),d=n(87894),l=n(39351);const u=({chat:e,user:t,folderId:n,isPinned:u,isMuted:h,canChangeFolder:m,isSavedDialog:p,currentUserId:g,isPreview:f,topics:v,handleDelete:A,handleMute:y,handleChatFolderChange:C,handleReport:w},b=!1)=>{const I=(0,l.A)(),{isSelf:S}=t||{},M=t?.id===s.zv8,N=(0,i.Kr)((()=>{if(e)return p?I("Delete"):(0,c.L8)(e.id)||(0,a.IC)(e)?I("DeleteChat"):(0,a.WX)(e)?I("ChannelLeave"):I("GroupLeaveGroup")}),[e,p,I]);return(0,i.Kr)((()=>{if(!e||f)return;const{toggleChatPinned:i,toggleSavedDialogPinned:s,updateChatMutedState:c,toggleChatArchived:l,markChatMessagesRead:k,markChatUnread:Y,openChatInNewTab:P}=(0,o.ko)(),F=r.OS&&{title:r.cp?I("ChatListOpenInNewWindow"):I("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{P(p?{chatId:g,threadId:e.id}:{chatId:e.id})}},T=()=>{p?s({id:e.id}):i({id:e.id,folderId:n})},x=u?{title:I("ChatListUnpinFromTop"),icon:"unpin",handler:T}:{title:I("ChatListPinToTop"),icon:"pin",handler:T},D={title:N,icon:"delete",destructive:!0,handler:A};if(p)return(0,d.oE)([F,x,D]);const E=m?{title:I("ChatListContextAddToFolder"),icon:"folder",handler:C}:void 0,L=h?{title:I("ChatsUnmute"),icon:"unmute",handler:()=>c({chatId:e.id,isMuted:!1})}:{title:`${I("ChatsMute")}...`,icon:"mute",handler:y};if(b)return(0,d.oE)([F,x,E,L]);const B=e.unreadCount||e.hasUnreadMark||Object.values(v||{}).some((({unreadCount:e})=>e))?{title:I("ChatListContextMaskAsRead"),icon:"readchats",handler:()=>k({id:e.id})}:void 0,R=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:I("ChatListContextMaskAsUnread"),icon:"unread",handler:()=>Y({id:e.id})},O=(0,a.TJ)(e)?{title:I("Unarchive"),icon:"unarchive",handler:()=>l({id:e.id})}:{title:I("Archive"),icon:"archive",handler:()=>l({id:e.id})},U=w&&!t&&((0,a.WX)(e)||(0,a.YE)(e))?{title:I("ReportPeerReport"),icon:"flag",handler:w}:void 0,z=void 0!==n;return(0,d.oE)([F,E,B,R,x,!S&&L,!S&&!M&&!z&&O,U,D])}),[e,t,m,I,C,u,b,h,g,A,y,w,n,S,M,p,N,f,v])}},47526:(e,t,n)=>{n.d(t,{KE:()=>c,PP:()=>d,_u:()=>r,zS:()=>a});const i={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},o=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:o,long:s}=t,a=i[e];switch(e){case"google":return`${a}/place/${o}+${s}/@${o},${s},${n}z`;case"bing":return`${a}?cp=${o}~${s}&lvl=${n}&sp=point.${o}_${s}`;case"apple":return`${a}?q=${o},${s}`;default:return`${a}/?mlat=${o}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function c(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function d(e){return e?o.get(e)||o.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}},48227:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(48775),s=n(39351),a=n(19806),r=n(94189);var c=n(20021);const d=(0,i.ph)((({isOpen:e,onClose:t,userName:n,messagePriceInStars:i,messagesCount:d,shouldAutoApprove:l,setAutoApprove:u,confirmHandler:h})=>{const m=(0,s.A)(),p=m("ConfirmationModalPaymentForMessage",{user:n,amount:(0,o.K)(m,i),totalAmount:(0,o.K)(m,i*d),count:d},{withMarkdown:!0,withNodes:!0,pluralValue:d}),g=m("PayForMessage",{count:d},{withNodes:!0,pluralValue:d});return(0,c.FD)(r.A,{title:m("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:h,children:[p,(0,c.Y)(a.A,{className:"eScpikxM",label:m("DoNotAskAgain"),checked:l,onCheck:u})]})}))},48553:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(66644),c=n(90709),d=n(29807),l=n(96454),u=n(9716),h=n(2178),m=n(17712),p=n(59030),g=n(18276),f=n(64493),v=n(22699),A=n(24433),y=n(60859),C=n(80089),w=n(80464),b=n(20021);const I=e=>{const{isOpen:t}=e,n=(0,w.A)(C.ar.Extra,"HeaderMenuContainer",!t);return n?(0,b.Y)(n,{...e}):void 0},S=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n,messageListType:i,isMobile:o})=>{const a=(0,d.hds)(e,t),r=Boolean(a&&(0,c.WX)(a)),h=Boolean(a&&(0,c.Vs)(a)),m=(0,d.wmb)(e),p=(0,d.Qq_)(e),g=(0,u.L8)(t),{doNotTranslate:f}=e.settings.byKey;if(!a||a.isRestricted||(0,d.rTV)(e))return{noMenu:!0,language:m,translationLanguage:p,doNotTranslate:f};const v=(0,d.yps)(e,t),A=g?void 0:(0,d.AWZ)(e,t),y=g?(0,d.vGo)(e,t):void 0,C=A||y,w=(0,d.nZ4)(e,t),b="thread"===i&&n===s.l3,I="thread"===i&&n!==s.l3,S=(0,d.gjV)(e,o),M=(0,c.cG)(t,n,e.currentUserId),N=!!g&&(0,d.apd)(e,t),k=Boolean(v&&N),Y=!k&&Boolean((0,d.I_m)(e,t)),P=N&&!v,F=Boolean((b||a.isForum)&&(r||h)&&a.isNotJoined),T=b||I,x=l.OL&&(0,u.L8)(a.id)&&!w&&!v&&!a.isSupport&&!(0,c.Qe)(a.id),D=b&&!w&&!F,E=M||b&&!F,L=l.OL&&b&&a.isCallActive,B=l.OL&&b&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,c.yn)(a)),R=b&&A?.canViewStatistics,O=b&&A?.canViewMonetization,U=b&&(h||r)&&(R||(0,c.ub)(a,"postStories")),z=!U&&(h||r),K=b?A?.requestsPending:void 0,j=Boolean(a?.isNotJoined&&a.isJoinToSend),V=Boolean(a?.isNotJoined&&a.isJoinRequest),J=!(0,d.PKK)(e),$=Boolean((0,d.qZq)(e,t)),q=(0,d.jGY)(e,t)&&!C?.isTranslationDisabled,G=(0,d.trm)(e);return{noMenu:!1,isChannel:r,isRightColumnShown:S,canStartBot:Y,canRestartBot:k,canSubscribe:F,canSearch:T,canCall:x,canMute:D,canViewStatistics:R,canViewMonetization:O,canViewBoosts:U,canShowBoostModal:z,canLeave:E,canEnterVoiceChat:L,canCreateVoiceChat:B,pendingJoinRequests:K,shouldJoinToSend:j,shouldSendJoinRequest:V,noAnimation:J,canTranslate:q,isTranslating:$,translationLanguage:p,language:m,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:P,isAccountFrozen:G}}))((({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:c,canStartBot:d,canRestartBot:u,canUnblock:C,canSubscribe:w,canSearch:S,canCall:N,canMute:k,canViewStatistics:Y,canViewMonetization:P,canViewBoosts:F,canShowBoostModal:T,canLeave:x,canEnterVoiceChat:D,canCreateVoiceChat:E,pendingJoinRequests:L,isRightColumnShown:B,isForForum:R,canExpandActions:O,shouldJoinToSend:U,shouldSendJoinRequest:z,noAnimation:K,canTranslate:j,isTranslating:V,translationLanguage:J,language:$,detectedChatLanguage:q,doNotTranslate:G,onTopicSearch:H,isAccountFrozen:W})=>{const{joinChannel:_,sendBotCommand:Q,openMiddleSearch:Z,restartBot:X,requestMasterAndRequestCall:ee,requestNextManagementScreen:te,showNotification:ne,openChat:ie,requestChatTranslation:oe,togglePeerTranslations:se,openChatLanguageModal:ae,setSettingOption:re,unblockUser:ce,setViewForumAsMessages:de,openFrozenAccountModal:le}=(0,o.ko)(),ue=(0,i.li)(),he=(0,p.A)(),[me,pe]=(0,i.J0)(!1),[ge,fe]=(0,i.J0)(void 0),ve=(0,m.A)((()=>{pe(!0);const e=ue.current.getBoundingClientRect();fe({x:e.right,y:e.bottom})})),Ae=(0,m.A)((()=>{pe(!1)})),ye=(0,m.A)((()=>{fe(void 0)})),Ce=(0,m.A)((()=>{_({chatId:e}),z&&ne({message:he(c?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),we=(0,m.A)((()=>{Q({command:"/start"})})),be=(0,m.A)((()=>{X({chatId:e})})),Ie=(0,m.A)((()=>{ce({userId:e})})),Se=(0,m.A)((()=>{oe(V?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:J})})),Me=(0,m.A)((()=>{te({screen:a.je.JoinRequests})})),Ne=(0,m.A)((()=>{R?H?.():(Z(),s?M():K?(0,r.YS)((()=>{(0,r.Uz)(M)})):setTimeout(M,320))})),ke=(0,m.A)((()=>{ie({id:e}),de({chatId:e,isEnabled:!0})})),Ye=(0,m.A)((()=>{W?le():ee({userId:e})})),Pe=(0,m.A)((e=>{S&&l.lE&&!e.shiftKey&&(e.preventDefault(),Ne())})),Fe=(0,m.A)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,i=he(n);if(i!==n)return he(e,i);const o=new Intl.DisplayNames([$],{type:"language"}).of(t);return he(`${e}Other`,o)})),Te=(0,i.Kr)((()=>V?he("ShowOriginalButton"):Fe("TranslateToButton",J)),[J,Fe,V,he]),xe=(0,i.Kr)((()=>{if(q)return Fe("DoNotTranslateLanguage",q)}),[Fe,q]),De=(0,m.A)((()=>{se({chatId:e,isEnabled:!1}),oe({chatId:e,toLanguageCode:void 0})})),Ee=(0,m.A)((()=>{ae({chatId:e})})),Le=(0,m.A)((()=>{q&&(re({doNotTranslate:[...G,q]}),oe({chatId:e,toLanguageCode:void 0}),ne({message:Fe("AddedToDoNotTranslate",q)}))}));(0,h.v)((0,i.Kr)((()=>({"Mod+F":Pe})),[]));const Be=(0,i.Kr)((()=>({onTrigger:e,isOpen:t})=>(0,b.Y)(f.A,{round:!0,ripple:B,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:he("TranslateMessage"),children:(0,b.Y)(g.A,{name:"language"})})),[B,he]);return(0,b.FD)("div",{className:"HeaderActions",children:[!R&&j&&(0,b.FD)(v.A,{className:"stickers-more-menu with-menu-transitions",trigger:Be,positionX:"right",children:[(0,b.Y)(A.A,{icon:"language",onClick:Se,children:Te}),(0,b.Y)(A.A,{icon:"replace",onClick:Ee,children:he("Chat.Translate.Menu.To")}),(0,b.Y)(y.A,{}),q&&(0,b.Y)(A.A,{icon:"hand-stop",onClick:Le,children:xe}),(0,b.Y)(A.A,{icon:"close-circle",onClick:De,children:he("Hide")})]}),!s&&(0,b.FD)(b.FK,{children:[O&&!z&&(w||U)&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Ce,children:he(c?"ProfileJoinChannel":"ProfileJoinGroup")}),O&&z&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Ce,children:he("ChannelJoinRequest")}),O&&d&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:we,children:he("BotStart")}),O&&u&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:be,children:he("BotRestart")}),O&&C&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Ie,children:he("Unblock")}),S&&(0,b.Y)(f.A,{round:!0,ripple:B,color:"translucent",size:"smaller",onClick:Ne,ariaLabel:he("Conversation.SearchPlaceholder"),children:(0,b.Y)(g.A,{name:"search"})}),N&&(0,b.Y)(f.A,{round:!0,color:"translucent",size:"smaller",onClick:Ye,ariaLabel:"Call",children:(0,b.Y)(g.A,{name:"phone"})})]}),!R&&Boolean(L)&&(0,b.FD)(f.A,{round:!0,className:"badge-button",ripple:B,color:"translucent",size:"smaller",onClick:Me,ariaLabel:he(c?"SubscribeRequests":"MemberRequests"),children:[(0,b.Y)(g.A,{name:"user"}),(0,b.Y)("div",{className:"badge",children:L})]}),(0,b.Y)(f.A,{ref:ue,className:me?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:ve,children:(0,b.Y)(g.A,{name:"more"})}),ge&&(0,b.Y)(I,{chatId:e,threadId:t,isOpen:me,anchor:ge,withExtraActions:s||!O,isChannel:c,canStartBot:d,canSubscribe:w,canSearch:S,canCall:N,canMute:k,canViewStatistics:Y,canViewBoosts:F,canViewMonetization:P,canShowBoostModal:T,canLeave:x,canEnterVoiceChat:D,canCreateVoiceChat:E,pendingJoinRequests:L,onJoinRequestsClick:Me,withForumActions:R,onSubscribeChannel:Ce,onSearchClick:Ne,onAsMessagesClick:ke,onClose:Ae,onCloseAnimationEnd:ye})]})})));function M(){const e=document.querySelector("#MiddleSearch input");e?.focus()}},48885:(e,t,n)=>{n.d(t,{A:()=>h,S:()=>m});var i=n(84051),o=n(61433),s=n(66644),a=n(14737),r=n(17712),c=n(93545),d=n(672);const l=450,u=100;function h({ref:e,isOpen:t,isDisabled:n,withResizeObserver:o,onStateChange:h}){const[m,p]=(0,i.J0)(t),g=(0,i.li)(),f=e||g,v=(0,i.li)(0),A=(0,r.A)((()=>{p(!0),h?.({element:void 0,height:0,isOpen:!1})}));(0,i.vJ)((()=>{n&&A()}),[n]),(0,i.vJ)((()=>{t&&p(!0)}),[t]),(0,i._W)(A),(0,a.A)((()=>{p(!1),h?.({height:0,isOpen:!1})}),t?void 0:l);const y=(0,i.hb)((()=>{const e=f.current;!n&&e&&m&&(t?(0,s.gm)((()=>{const n=e.offsetHeight;return v.current=n,()=>{h?.({element:e,height:n,isOpen:t})}})):h?.({element:e,height:0,isOpen:!1}))}),[t,m,n,f,h]),C=(0,d.A)((()=>{const e=f.current;e&&e.offsetHeight!==v.current&&y()}),[y,f],u,!0);return(0,i.Nf)(y,[y]),(0,c.A)(f,C,!o||!m),{shouldRender:m,ref:f}}function m(e,t=!1){let n=0;for(let i=0;i<e.length;i++){const a=e[i],r=a.element;if(!r)continue;const c=`${n}px`,d=()=>{(0,o.Tv)(r,{transform:`translateY(${a.isOpen?c:`calc(${c} - 100%)`})`,zIndex:String(-i),transition:t?"none":""})};r.dataset.isPanelOpen||!a.isOpen||t?d():((0,o.Tv)(r,{transform:`translateY(calc(${c} - 100%))`,zIndex:String(-i),transition:"none"}),r.dataset.isPanelOpen="true",(0,s.Uz)(d)),n+=a.height}}},48906:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(20021);const o=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,i.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,i.Y)("defs",{children:(0,i.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,i.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,i.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,i.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,i.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,i.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,i.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642:(e,t,n)=>{n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>c,MV:()=>o,hm:()=>d,wp:()=>l});const i={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 o(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({...i,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(i),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function c(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function d(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:i}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:i})}},51083:(e,t,n)=>{n.d(t,{A:()=>b});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(29807),c=n(87357),d=n(76023),l=n(4961),u=n(17712),h=n(59030),m=n(41036),p=n(21849),g=n(80999),f=n(34431),v=n(18276),A=n(38102),y=n(80477),C=n(20021);const w=2.5*d.$,b=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n})=>{const i=(0,r.hds)(e,t),o=n?(0,r.Vw0)(e,t,n):void 0,s=i?(0,r.ToO)(e,i):void 0,a=Boolean((0,r.zeq)(e,t)),c=n?(0,r.S0q)(e,t,n):void 0;return{chat:i,threadInfo:o,onlineCount:s,topic:c,areMessagesLoaded:a,messagesCount:c&&(0,r.QbG)(e,t,n),self:(0,r.mBe)(e,e.currentUserId)}}))((({typingStatus:e,className:t,statusIcon:n,avatarSize:r="medium",noAvatar:d,status:b,withDots:I,withMediaViewer:S,withUsername:M,withFullInfo:N,withUpdatingStatus:k,withChatType:Y,threadInfo:P,noRtl:F,chat:T,onlineCount:x,areMessagesLoaded:D,topic:E,messagesCount:L,noStatusOrTyping:B,withStory:R,storyViewerOrigin:O,noEmojiStatus:U,emojiStatusSize:z,isSavedDialog:K,self:j,onClick:V,onEmojiStatusClick:J})=>{const{loadFullChat:$,openMediaViewer:q,loadMoreProfilePhotos:G}=(0,o.ko)(),H=(0,h.A)(),W=T&&(0,a.Vs)(T),_=Boolean(T?.isForum&&P&&E),{id:Q,isMin:Z,isRestricted:X}=T||{};(0,i.vJ)((()=>{Q&&!Z&&(N&&$({chatId:Q}),S&&G({peerId:Q,isPreload:!0}))}),[Q,Z,N,W,S]);const ee=(0,u.A)(((e,t)=>{T&&t&&(e.stopPropagation(),q({isAvatarView:!0,chatId:T.id,mediaIndex:0,origin:"jumbo"===r?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))})),te=(0,i.Kr)((()=>T&&M&&(0,a.Kl)(T)),[T,M]);if(T)return(0,C.FD)("div",{className:(0,c.A)("ChatInfo",t),dir:!F&&H.isRtl?"rtl":void 0,onClick:V,children:[!d&&!_&&(0,C.FD)(C.FK,{children:[K&&j&&(0,C.Y)(p.A,{size:r,peer:j,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,C.Y)(p.A,{className:(0,c.A)(K&&"overlay-avatar"),size:r,peer:T,withStory:R,storyViewerOrigin:O,storyViewerMode:"single-peer",isSavedDialog:K,onClick:S?ee:void 0},T.id)]}),_&&(0,C.Y)(A.A,{topic:E,className:"topic-header-icon",size:w}),(0,C.FD)("div",{className:"info",children:[E?(0,C.Y)("h3",{dir:"auto",className:"fullName",children:(0,l.A)(E.title)}):(0,C.Y)(f.A,{peer:T,emojiStatusSize:z,withEmojiStatus:!U,isSavedDialog:K,onEmojiStatusClick:J}),!B&&function(){if(b)return I?(0,C.Y)(g.A,{className:"status",content:b}):(0,C.FD)("span",{className:"status",dir:"auto",children:[n&&(0,C.Y)(v.A,{className:"status-icon",name:n}),(0,l.A)(b)]});if(k&&!D&&!X)return(0,C.Y)(g.A,{className:"status",content:H("Updating")});if(!T)return;if(e)return(0,C.Y)(y.A,{typingStatus:e});if(_)return(0,C.Y)("span",{className:"status",dir:"auto",children:(0,C.Y)(m.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==L?1:2,className:"message-count-transition",children:void 0!==L&&H("messages",L,"i")})});if(Y)return(0,C.Y)("span",{className:"status",dir:"auto",children:H((0,a.Gg)(T))});const t=(0,a.sT)(H,T),i=x?`, ${H("OnlineCount",x,"i")}`:void 0;return(0,C.FD)("span",{className:"status",children:[te&&(0,C.Y)("span",{className:"handle withStatus",children:te}),(0,C.Y)("span",{className:"group-status",children:t}),i&&(0,C.Y)("span",{className:"online-status",children:i})]})}()]})]})})))},51644:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(84051),o=n(31481),s=n(66644),a=n(90709),r=n(87357),c=n(40435),d=n(35127),l=n(43874),u=n(37661),h=n(5912),m=n(17712),p=n(37859),g=n(37960),f=n(69419),v=n(73767),A=n(21511),y=n(61097),C=n(18276),w=n(27860),b=n(35913),I=n(20021);const S=({id:e,photo:t,messageText:n,isOwn:S,observeIntersection:M,noAvatars:N,canAutoLoad:k,isInSelectMode:Y,isSelected:P,uploadProgress:F,forcedWidth:T,size:x="inline",dimensions:D,asForwarded:E,nonInteractive:L,shouldAffectAppendix:B,isDownloading:R,isProtected:O,theme:U,isInWebPage:z,clickArg:K,className:j,onClick:V,onCancelUpload:J})=>{const $=(0,i.li)(),q="extendedMediaPreview"===t.mediaType,G=q?void 0:t.blobUrl,H=(0,h.Vz)($,M),{isMobile:W}=(0,l.Ay)(),[_,Q]=(0,i.J0)(k),Z=_&&H&&!q,{mediaData:X,loadProgress:ee}=(0,f.A)(q?void 0:(0,a.rI)(t,x),!Z),te=G||X,ne=Boolean(T),[ie]=(0,i.J0)(!te),oe=Boolean(te),se=(0,y.A)(t,oe);(0,g.A)(!oe,{ref:se});const ae=(0,y.A)(t,!ne),re=(0,a.VD)(t),[ce,de,le]=(0,u.A)(q||t.isSpoiler);(0,i.vJ)((()=>{q||t.isSpoiler?de():le()}),[q,t]);const{loadProgress:ue}=(0,f.A)(q?void 0:(0,a.rI)(t,"download"),!R,q?void 0:(0,a.Cz)(t,"download")),{isUploading:he,isTransferring:me,transferProgress:pe}=(0,a.LK)(F||(R?ue:ee),Z&&!te,void 0!==F),ge=!1===(0,v.A)(_),{ref:fe,shouldRender:ve}=(0,A.A)({isOpen:me,noMountTransition:ge,className:"slow",withShouldRender:!0}),{ref:Ae,shouldRender:ye}=(0,A.A)({isOpen:!te&&!_,withShouldRender:!0}),Ce=(0,m.A)((e=>{he?J?.(K):te?ce?le():V?.(K,e):Q((e=>!e))}));(0,p.A)((([e])=>{if(!B)return void(e&&$.current.closest(o.KFG).removeAttribute(o.D3G));const t=$.current.closest(o.KFG);if(te){const e=Number(t.closest(".Message").dataset.messageId);(0,c.A)(te,Boolean(S),e,P,U).then((e=>{(0,s.RK)((()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(o.D3G,"")}))}))}else t.classList.add("has-appendix-thumb")}),[B,te,S,Y,P,U]);const{width:we,height:be,isSmall:Ie}=D||(0,d.yA)({media:t,isOwn:S,asForwarded:E,noAvatars:N,isMobile:W,messageText:n,isInWebPage:z}),Se=(0,r.A)("media-inner",!he&&!L&&"interactive",Ie&&"small-image",(we===be||"pictogram"===x)&&"square-image",be<d.ej&&"fix-min-height",j),Me=D?` width: ${we}px; left: ${D.x}px; top: ${D.y}px;`:"",Ne="inline"===x?`height: ${be}px;${Me}`:void 0;return(0,I.FD)("div",{id:e,ref:$,className:Se,style:Ne,onClick:he?void 0:Ce,children:[ne&&(0,I.Y)("canvas",{ref:ae,className:"thumbnail blurred-bg"}),te&&(0,I.Y)("img",{src:te,className:(0,r.A)("full-media",ne&&"with-blurred-bg"),alt:"",style:T?`width: ${T}px`:void 0,draggable:!O}),ie&&(0,I.Y)("canvas",{ref:se,className:"thumbnail"}),O&&(0,I.Y)("span",{className:"protector"}),ve&&!ye&&(0,I.Y)("div",{ref:fe,className:"media-loading",children:(0,I.Y)(b.A,{progress:pe,onClick:he?Ce:void 0})}),ye&&(0,I.Y)(C.A,{ref:Ae,name:"download"}),(0,I.Y)(w.A,{isVisible:ce,withAnimation:!0,thumbDataUri:re,width:we,height:be,className:"media-spoiler"}),me&&(0,I.FD)("span",{className:"message-transfer-progress",children:[Math.round(100*pe),"%"]})]})}},52844:(e,t,n)=>{let i;function o(e="*",t,n=!1){i||(i=document.createElement("input"),i.setAttribute("type","file")),i.setAttribute("accept",e),n?i.removeAttribute("multiple"):i.setAttribute("multiple","multiple"),i.onchange=null,i.value="",i.onchange=t,i.click()}n.d(t,{p:()=>o})},52988:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(96454),s=n(87357),a=n(17663),r=n(91525),c=n(76023),d=n(4961),l=n(43874),u=n(45470),h=n(83057),m=n(59030),p=n(50680),g=n(96530),f=n(35913),v=n(18276),A=n(20021);const y=(0,i.ph)((({ref:e,name:t,size:n,extension:y="",timestamp:C,sender:w,thumbnailDataUri:b,previewData:I,className:S,smaller:M,isTransferring:N,isUploading:k,isSelectable:Y,isSelected:P,transferProgress:F,actionIcon:T,onClick:x,onDateClick:D})=>{const E=(0,m.A)();let L=(0,i.li)();e&&(L=e);const{isMobile:B}=(0,l.Ay)(),[R]=(0,i.J0)(!I),O=Boolean(I),U=(0,u.A)(b,O,B&&!o.QH),z=(0,h.A)(!O),{shouldRender:K,transitionClassNames:j}=(0,p.A)(N,void 0,!0),V=(0,r.fE)(y),J=(0,r.zV)(n),$=(0,i.Kr)((()=>N&&F?`${(0,r.zV)(n*F)} / ${J}`:J),[N,n,J,F]),{width:q,height:G}=(0,c.tP)(M),H=(0,s.A)("File",S,M&&"smaller",x&&!k&&"interactive",P&&"file-is-selected");return(0,A.FD)("div",{ref:L,className:H,dir:E.isRtl?"rtl":void 0,children:[Y&&(0,A.Y)("div",{className:"message-select-control no-selection",children:P&&(0,A.Y)(v.A,{name:"select"})}),(0,A.FD)("div",{className:"file-icon-container",onClick:k?void 0:x,children:[b||I?(0,A.FD)("div",{className:"file-preview media-inner",children:[(0,A.Y)("img",{src:I,className:"full-media",width:q,height:G,draggable:!1,alt:""}),R&&(0,A.Y)("canvas",{ref:U,className:(0,s.A)("thumbnail",z)})]}):(0,A.Y)("div",{className:`file-icon ${V}`,children:y.length<=4&&(0,A.Y)("span",{className:"file-ext",dir:"auto",children:y})}),K&&(0,A.Y)("div",{className:(0,s.A)("file-progress",V,j),children:(0,A.Y)(f.A,{progress:F,size:M?"s":"m",onClick:k?x:void 0})}),x&&(0,A.Y)(v.A,{name:T||"download",className:(0,s.A)("action-icon",K&&"hidden")})]}),(0,A.FD)("div",{className:"file-info",children:[(0,A.Y)("div",{className:"file-title",dir:"auto",title:t,children:(0,d.A)(t)}),(0,A.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,A.Y)("span",{children:$}),w&&(0,A.Y)("span",{className:"file-sender",children:(0,d.A)(w)}),!w&&Boolean(C)&&(0,A.FD)(A.FK,{children:[(0,A.Y)("span",{className:"bullet"}),(0,A.Y)(g.A,{onClick:D,children:(0,a.fS)(E,1e3*C,!0)})]})]})]}),w&&Boolean(C)&&(0,A.Y)(g.A,{onClick:D,children:(0,a.be)(E,1e3*C)})]})}))},53188:(e,t,n)=>{n.d(t,{A:()=>T});var i=n(84051),o=n(31481),s=n(66644),a=n(90709),r=n(70636),c=n(87357),d=n(4961),l=n(18501),u=n(79882),h=n(21488),m=n(62587),p=n(59030),g=n(13439),f=n(76023),v=n(43874),A=n(11217),y=n(38102);const C="CBda1UmC",w="BhS75ocD",b="uWo2dhui",I="g3XnC73g";var S=n(20021);const M=Number(f.$),N=(0,i.ph)((({chat:e,topics:t,renderLastMessage:n,observeIntersection:o})=>{const{openThread:s}=(0,g.ko)(),r=(0,i.li)(),l=(0,i.li)(),u=(0,p.A)(),[h,...m]=(0,i.Kr)((()=>t?(0,a.CO)(Object.values(t),void 0,!0).slice(0,3):[]),[t]),[f,N]=(0,i.J0)(!1),[k,Y]=(0,i.J0)(void 0),{handleClick:P,handleMouseDown:F}=(0,A.Q)((t=>{0===h.unreadCount||e.isForumAsMessages||(t.stopPropagation(),t.preventDefault(),s({chatId:e.id,threadId:h.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,v.Ny)()}))}));return(0,i.vJ)((()=>{const e=r.current,t=l.current;if(!e||!t)return;const n=e.offsetWidth,i=t.offsetWidth;Math.abs(n-i)<M?Y(Math.max(n,i)):Y(void 0),N(n>i)}),[h,n]),(0,S.FD)("div",{className:(0,c.A)("Ow6Ij9O5",f&&"U_yhhC0w",k&&"HV0wCR4O"),dir:u.isRtl?"rtl":void 0,style:k?`--overwritten-width: ${k}px`:void 0,children:[h&&(0,S.FD)("div",{className:C,children:[(0,S.FD)("div",{className:(0,c.A)("lEbV6HrI",h.unreadCount&&w),ref:l,onClick:P,onMouseDown:F,children:[(0,S.Y)(y.A,{topic:h,observeIntersection:o}),(0,S.Y)("div",{className:"k3Ch25ZQ",children:(0,d.A)(h.title)}),!k&&f&&(0,S.Y)("div",{className:b,children:(0,S.Y)("div",{className:I})})]}),(0,S.Y)("div",{className:"IkuCBmvA",children:m.map((e=>(0,S.FD)("div",{className:(0,c.A)("d0hTIVJn",e.unreadCount&&w),children:[(0,S.Y)(y.A,{topic:e,className:"oknhG11L",observeIntersection:o}),(0,S.Y)("span",{className:"ZUj3xAjs",children:(0,d.A)(e.title)})]},e.id)))}),(0,S.Y)("div",{className:"_m_2xcPW"})]}),!h&&(0,S.Y)("div",{className:(0,c.A)(C,"L4Zk0yMN"),children:u("Loading")}),(0,S.FD)("div",{className:(0,c.A)("KJ16dBus",h?.unreadCount&&w),ref:r,onClick:P,onMouseDown:F,children:[n(),!k&&!f&&(0,S.Y)("div",{className:b,children:(0,S.Y)("div",{className:I})})]})]})}));var k=n(18276),Y=n(18653),P=n(80477);const F=200;function T({chat:e,topics:t,lastMessage:n,statefulMediaContent:c,chatId:g,typingStatus:f,draft:v,lastMessageTopic:A,lastMessageSender:y,observeIntersection:C,animationType:w,orderDiff:b,withInterfaceAnimations:I,isTopic:M,isSavedDialog:Y,isPreview:T}){const D=(0,p.A)(),E=(0,i.li)(),L=n?.content.storyData,B=c&&!c.story;(0,h.A)(B?L?.peerId:void 0,L?.id,c?.story);const R=c?.story||n,O=R&&!(0,a.fP)(R),U=O?(0,a.CI)(R):void 0,z=(0,m.A)(O?(0,a.EO)(R,"micro"):void 0),K=Boolean(n&&(0,a.lk)(n)),j=(0,i.hb)((()=>{if(!Y&&!T&&f&&n&&f.timestamp>1e3*n.date)return(0,S.Y)(P.A,{typingStatus:f});const t=v&&v.replyInfo?.replyToMsgId===A?.id,i=v?.replyInfo&&!v.text&&v.isLocal;if(!e?.isForum&&!Y&&!T&&v&&!i&&(!M||!t))return(0,S.FD)("p",{className:"last-message",dir:D.isRtl?"auto":"ltr",children:[(0,S.Y)("span",{className:"draft",children:D("Draft")}),(0,l.fd)({text:v.text?.text||"",entities:v.text?.entities,asPreview:!0,withTranslucentThumbs:!0})]});if(!n)return;const o=y?(0,r.Q5)(D,g,y):void 0;return(0,S.FD)("p",{className:"last-message shared-canvas-container",dir:D.isRtl?"auto":"ltr",children:[o&&(0,S.FD)(S.FK,{children:[(0,S.Y)("span",{className:"sender-name",children:(0,d.A)(o)}),(0,S.Y)("span",{className:"colon",children:":"})]}),!Y&&n.forwardInfo&&(0,S.Y)(k.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,S.Y)(k.A,{name:"story-reply",className:"chat-prefix-icon"}),x(n,C,z||U,K)]})}),[e,g,v,K,M,D,n,y,A,z,U,C,f,Y,T]);return(0,i.Nf)((()=>{const e=E.current;if(I&&e){if(w===u.I.Opacity)e.style.opacity="0",(0,s.RK)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(w!==u.I.Move)return;e.style.transform=`translate3d(0, ${-b*o.yq1}px, 0)`,(0,s.RK)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,s.RK)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),F+o.xB5)}}),[I,b,w]),{renderSubtitle:function(){return e?.isForum&&!M?(0,S.Y)(N,{chat:e,renderLastMessage:j,observeIntersection:C,topics:t}):j()},ref:E}}function x(e,t,n,i){const o=(0,S.Y)(Y.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return o;const s=(0,a.y2)(e);return(0,S.FD)("span",{className:"media-preview",children:[(0,S.Y)("img",{src:n,alt:"",className:(0,c.A)("media-preview--image",i&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,S.Y)(k.A,{name:"play"}),o]})}},53827:(e,t,n)=>{n.d(t,{_K:()=>f,dj:()=>y,kz:()=>v});var i=n(13439),o=n(89925),s=n(66644),a=n(29807),r=n(96454),c=n(60343),d=n(80853),l=n(41733);const u=new Map;let h,m=[],p=[];function g(e,t){const n=h&&u.get(h);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const s=A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin||o.d9.Inline,t);if(!s)return;if(!u.has(s))return void(0,i.ko)().openAudioPlayer((0,c.ES)(C(s).messageKey));const r=u.get(s);r.onForcePlay&&r.onForcePlay(),h=s,r.audio.src&&(0,l.A)(r.audio)}function f(){const e=h&&u.get(h);e&&e.audio.pause()}function v(e,t,n,f,v){if(!u.has(e)){const n=function(e,t,n,i){const o=new Audio;function s(t){return n=>{u.has(e)&&((0,d.f)(o)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return o.addEventListener("timeupdate",s("onTimeUpdate")),o.addEventListener("play",s("onPlay")),o.addEventListener("pause",s("onPause")),o.addEventListener("loadstart",s("onLoadStart")),o.addEventListener("loadeddata",s("onLoadedData")),o.addEventListener("playing",s("onPlaying")),o.addEventListener("ended",(()=>{u.has(e)&&((0,d.f)(o)||g(e))})),{audio:o,type:t,proxy:new Proxy(o,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:i}}(e,t,f,v);u.set(e,n),function(e,t){"audio"!==e.type||p.includes(t)||(p.push(t),p.sort(w)),"voice"!==e.type||m.includes(t)||(m.push(t),m.sort(w))}(n,e)}const{audio:y,proxy:b,handlers:I}=u.get(e);return I.push(n),{play(n){if(!y.paused)return;const s=h&&u.get(h);s&&h!==e&&(s.audio.pause(),s.audio.currentTime=0,(0,d.f)(s.audio)&&(s.audio.dataset.preventPlayAfterPatch="true"),s.onTrackChange&&s.onTrackChange()),h=e,y.src||(y.src=n,y.preload="auto",n.includes("/progressive/")&&r.Yw&&(delete y.dataset.preventPlayAfterPatch,(0,d.C)(y))),(0,l.A)(y),function(e,t){if((0,a.nTw)((0,i.mS)()).globalSearch.currentContent===o.$C.Music)return;const{chatId:n}=(0,c.ES)(C(t).messageKey),s=(0,a.Xf0)((0,i.mS)())?.chatId,r=e=>e.startsWith(`msg${n}`)||s&&e.startsWith(`msg${s}`);"audio"===e&&(p=p.filter(r)),"voice"===e&&(m=m.filter(r))}(t,e)},pause(){h===e&&y.pause()},stop(){if(h===e){const e=y.src;y.pause(),(0,s.Uz)((()=>{y.src="",y.src=e}))}},setCurrentTime(t){h===e&&(y.fastSeek?y.fastSeek(t):y.currentTime=t)},setVolume(t){h===e&&(y.volume=t,y.muted=!1)},setPlaybackRate(t){h===e&&(y.playbackRate=t)},toggleMuted(e){y.muted=void 0===e?!y.muted:e},proxy:b,requestNextTrack(){g(e)},isLast:()=>!A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin),isFirst:()=>!A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(t=!1){const i=u.get(e);i&&(i.handlers=i.handlers.filter((e=>e!==n)),i.handlers.length||(i.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(m=m.filter(n))}(i,e),e===h&&(h=void 0)))}}}function A(e,t=o.d9.Inline,n){const i=function(e){switch(e.type){case"audio":return p;case"voice":return m;default:return}}(u.get(e));if(!i)return;if(t===o.d9.Search){const t=i.indexOf(e);if(t<0)return;return i[t+(n?-1:1)]}const{chatId:s}=(0,c.ES)(C(e).messageKey),a=i.filter((e=>e.startsWith(`msg${s}`))),r=a.indexOf(e);if(r<0)return;let d=t===o.d9.Inline?-1:1;return n&&(d*=-1),a[r+d]}function y(e){const t=(0,c.AD)(e);if(t)return`${t}-${e.date}`}function C(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function w(e,t){if(!e||!t)return 0;const{date:n,messageKey:i}=C(e),{date:o,messageKey:s}=C(t),a=o-n;return 0===a?s.localeCompare(i):a}},54314:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(13439),s=n(90709),a=n(29807),r=n(9716),c=n(4961),d=n(17712),l=n(59030),u=n(64493),h=n(22337),m=n(21849),p=n(20021);const g=(0,i.ph)((0,o.EK)(((e,{chat:t,isSavedDialog:n})=>{const i=(0,r.L8)(t.id),o=(0,a.nZ4)(e,t.id),c=i&&(0,a.mBe)(e,(0,s.e7)(t)),d=c&&(0,s.tv)(c)&&!t.isSupport,l=i&&!o&&!d&&!n,u=i?(0,s.u0)((0,a.mBe)(e,(0,s.e7)(t))):void 0;return{isPrivateChat:i,isChatWithSelf:o,isBot:d,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:i,isPrivateChat:a,isChatWithSelf:r,isBot:g,isBasicGroup:f,isSuperGroup:v,currentUserId:A,canDeleteForAll:y,contactName:C,onClose:w,onCloseAnimationEnd:b})=>{const{leaveChannel:I,deleteHistory:S,deleteSavedHistory:M,deleteChannel:N,deleteChatUser:k,blockUser:Y,deleteChat:P}=(0,o.ko)(),F=(0,l.A)(),T=(0,s.Js)(F,t),x=(0,d.A)((()=>{S({chatId:t.id,shouldDeleteForAll:!0}),w()})),D=(0,d.A)((()=>{S({chatId:t.id,shouldDeleteForAll:!0}),Y({userId:t.id}),w()})),E=(0,d.A)((()=>{n?M({chatId:t.id}):a?S({chatId:t.id,shouldDeleteForAll:!1}):f?t.isCreator?(S({chatId:t.id,shouldDeleteForAll:!0}),P({chatId:t.id})):(S({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:A})):!i&&!v||t.isCreator?(i||v)&&t.isCreator&&N({chatId:t.id}):I({chatId:t.id}),w()})),L=(0,d.A)((()=>{i||v?(I({chatId:t.id}),w()):f&&t.isCreator?(S({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:A})):E()}));return(0,p.FD)(h.A,{isOpen:e,className:"DeleteChatModal",header:(0,p.FD)("div",{className:"modal-header",dir:F.isRtl?"rtl":void 0,children:[(0,p.Y)(m.A,{size:"tiny",peer:t,isSavedMessages:r}),(0,p.Y)("h3",{className:"modal-title",children:F(n?r?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":i&&!t.isCreator?"LeaveChannel":i&&t.isCreator?"ChannelDelete":f||v?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:w,onCloseAnimationEnd:b,children:[n?(0,p.Y)("p",{children:(0,c.A)(r?F("ClearHistoryMyNotesMessage"):F("ClearHistoryMessageSingle",T),["simple_markdown","emoji"])}):i&&t.isCreator?(0,p.Y)("p",{children:(0,c.A)(F("ChatList.DeleteAndLeaveGroupConfirmation",T),["simple_markdown","emoji"])}):i&&!t.isCreator||f||v?(0,p.Y)("p",{children:(0,c.A)(F("ChannelLeaveAlertWithName",T),["simple_markdown","emoji"])}):(0,p.Y)("p",{children:(0,c.A)(F("ChatList.DeleteChatConfirmation",C),["simple_markdown","emoji"])}),(0,p.FD)("div",{className:"dialog-buttons-column",children:[g&&!n&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:D,children:F("DeleteAndStop")}),y&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x,children:C?(0,c.A)(F("ChatList.DeleteForEveryone",C)):F("DeleteForAll")}),!a&&t.isCreator&&!n&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:F("DeleteForAll")}),(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:a||n?E:L,children:F(n?"Delete":i&&!t.isCreator?"LeaveChannel":i&&t.isCreator?"Chat.Input.Delete":f||v?"Group.LeaveGroup":y?"ChatList.DeleteForCurrentUser":"Delete")}),(0,p.Y)(u.A,{className:"confirm-dialog-button",isText:!0,onClick:w,children:F("Cancel")})]})]})})))},54639:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(37661),a=n(17712),r=n(59030),c=n(71429),d=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,i.ph)((({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,m.Ay)(),o=(0,p.A)((0,u.mr)(e,"full"),!1,l.qZ.Text),s=(0,i.Kr)((()=>{if(!o)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=o.replace(v,e),i=(new DOMParser).parseFromString(n,"image/svg+xml");return i.querySelectorAll("path").forEach((t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"})),`data:image/svg+xml;utf8,${i.documentElement.outerHTML}`}),[o,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,i.ph)((({bot:e,theme:t,chatId:n,threadId:l,isInSideMenu:u,canShowNew:h,onMenuOpened:m,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,o.ko)(),y=(0,r.A)(),C=(0,i.Kr)((()=>e.icons.find((({name:e})=>"default_static"===e))?.document),[e.icons]),[w,b,I]=(0,s.A)(),[S,M]=(0,i.J0)(void 0),N=(0,a.A)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),m(),b()})),k=(0,a.A)((()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:l})})),Y=(0,a.A)((()=>{I(),p()})),P=(0,a.A)((()=>{M(void 0)})),F=(0,a.A)((()=>{v({botId:e.id,isEnabled:!1})}));return(0,f.FD)(d.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)(c.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:P,children:(0,f.Y)(d.A,{icon:"stop",destructive:!0,onClick:F,children:y("WebApp.RemoveBot")})})]},e.id)}))},54699:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(30857),o=n(32625);function s(e){const t=(0,i.A)();(0,o.A)(t,e,!0)}},55153:(e,t,n)=>{n.d(t,{A:()=>l,L:()=>u});var i=n(31481),o=n(87679),s=n(24909);const a=1280,r=40,c=20,d=/\.[^/.]+$/;async function l(e,t,c){const u=URL.createObjectURL(t),{type:m,size:p}=t;let g,f,v,A;if(i.gex.has(m)){const n=await(0,o.NN)(u),{width:p,height:f}=n;A=!h(p,f);const y=Math.max(p,f)>a,C=m===i.Vz3;if(!A){if(!c?.compressedBlobUrl&&!C&&(y||"image/jpeg"!==m)){const n=await(0,s.s)(u,y?a/Math.max(p,f):1,"image/jpeg");return URL.revokeObjectURL(u),l(e,t,{compressedBlobUrl:n})}"image/jpeg"===m&&(e=e.replace(d,".jpg")),g={width:p,height:f}}v=Math.max(p,f)>r?await(0,s.s)(u,r/Math.max(p,f),"image/jpeg"):u}else if(i.fNs.has(m)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,o.FW)(u);A=!h(e,t),A||(g={width:e,height:t,duration:n})}catch(e){A=!0}v=await(0,o.eT)(u)}else if(i.IH3.has(m)){const{duration:e,title:t,performer:i,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:i}=await n.e(3246).then(n.bind(n,3246)),s=await(0,o.sZ)(e),a=await t(s),{common:{title:r,artist:c,picture:d},format:{duration:l}}=a,u=i(d),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:c,duration:l,coverUrl:h?URL.createObjectURL(h):void 0}}(u);f={duration:e||0,title:t,performer:i},v=s}return{blobUrl:u,filename:e,mimeType:m,size:p,quick:g,audio:f,previewBlobUrl:v,shouldSendAsFile:A||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...c}}function u(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 h(e,t){return Math.max(e,t)/Math.min(e,t)<=c}},55317:(e,t,n)=>{function i(e,t){const{level:n,boosts:i,currentLevelBoosts:o,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,c=t&&i===o&&a;return{currentLevel:c?n-1:n,hasNextLevel:Boolean(s),boosts:i,levelProgress:!s||c?1:(i-o)/(s-o),remainingBoosts:s?s-i:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>i})},55429:(e,t,n)=>{n.d(t,{N:()=>a});var i=n(90709),o=n(70636),s=n(9716);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const c=(0,s.L8)(r)?a[r]:n[r];let d=(0,o.F9)(e,c);const l=n[t.chatId];return l&&("isSelf"in c&&c.isSelf?d=`${e("FromYou")}${(0,i.Js)(e,l)}`:(0,i.YE)(l)&&(d+=`${(0,i.Js)(e,l)}`)),d}},58674:(e,t,n)=>{n.d(t,{A:()=>Ot});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(66644),c=n(90709),d=n(27109),l=n(70636),u=n(29807),h=n(64520),m=n(30708),p=n(96454),g=n(87357),f=n(17663),v=n(55148),A=n(46275),y=n(60261),C=n(9716),w=n(36353),b=n(48775),I=n(79824),S=n(80539),M=n(39074),N=n(80140),k=n(43503);let Y;function P(e){Y.focus(),e.focus()}p.pz&&(Y=document.createElement("input"),Y.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(Y));var F=n(55153),T=n(58734),x=n(11359),D=n(35049),E=n(4961),L=n(18501),B=n(32625),R=n(14737),O=n(10722),U=n(19129),z=n(82117),K=n(37661),j=n(41316),V=n(39351),J=n(17712),$=n(59030),q=n(73767),G=n(24531),H=n(73172),W=n(50680),_=n(41257),Q=n(35297),Z=n(17778),X=n(63988),ee=n(83414);const te=/^\/([\w@]{1,32})?$/i;var ne=n(78396);const ie=/id="docs-internal-guid/i,oe=["H1","H2","H3","H4","H5","H6"];function se(e){return(new DOMParser).parseFromString(e,"text/html").body}function ae(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function re(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function ce(e,t){let n=t.cloneNode(!0);return e?(e.style&&"700"===e.style.fontWeight&&(n=re(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=re(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=re(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=re(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=re(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=re(n,"sub")),n):n}function de(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),i=t;return"A"===t.nodeName&&(n=ae(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(i=t.childNodes[0])),n=ce(i,n),n}function le(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const i=[];for(let t=0;t<e.childNodes.length;t++)i.push(...le(e.childNodes[t]));i.map((e=>n.appendChild(e)))}else-1!==oe.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=de(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),i=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(i=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=ae(n.cloneNode(!0),t.childNodes[0].href),i=t.childNodes[0].childNodes[0]),n=ce(i,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=de(e));return t?(t.appendChild(n),[t]):[e.cloneNode(!0)]}if(e.childNodes){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(...le(e.childNodes[n]));return t}return[e]}function ue(e){return 8!==e.nodeType}const he=/<style>(.*?)<\/style>/gs;var me=n(45761);const pe=new Set([a.CfG,a.e0F,a.YVZ]),ge=(e,t,n,r,d,l,u)=>{const{showNotification:h}=(0,o.ko)(),m=(0,V.A)();(0,i.vJ)((()=>{if(e)return document.addEventListener("paste",i,!1),()=>{document.removeEventListener("paste",i,!1)};async function i(e){if(!e.clipboardData)return;const i=e.target?.closest("div[contenteditable]");if(!i||!pe.has(i.id))return;if(e.preventDefault(),document.activeElement!==i)return;const o=e.clipboardData.getData("text"),p=e.clipboardData.getData("text/html");let g=p?(0,S.Ay)(function(e){let t=document.createElement("div");try{e=(n=e).match(ie)?function(e){const t=document.createElement("body"),n=e.childNodes,i=Array.from(n).filter(ue),o=[];for(const e of i)o.push(...le(e));for(let e=0;e<o.length;e++)t.appendChild(o[e].cloneNode(!0));return t}(se(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:se(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){a.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(he,"");const i=t.querySelectorAll(".text-content");return i.length&&(t=i[i.length-1]),Array.from(t.getElementsByTagName("*")).forEach((e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),S.qh[e.tagName]&&e.setAttribute("data-entity-type",S.qh[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case s.C7.MentionName:e.replaceWith(e.textContent||"");break;case s.C7.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()})),t.innerHTML.trimEnd()}(p),void 0,!0):void 0;g&&(0,ne.T8)(g)&&l&&(g=(0,ne.m4)(g),u?.());const{items:f}=e.clipboardData;let v=[];if(f.length>0&&(v=await(0,me.A)(f),d&&(v=v?.slice(0,1))),!v?.length&&!o)return;const A=g?.entities?.length?g:{text:o};let y=!1;try{y="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(p,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const C=A&&A.text;let w=v?.length&&!y;const b=v?await Promise.all(v.map((e=>(0,F.A)(e.name,e)))):[],I=d&&b?.length&&(0,c.eh)(d,b[0])||Boolean(C),M=(0,c.NK)(b[0]),N=d&&d?.groupedId;d&&b?.length>1?h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:b.length})}):d&&M?h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!N||(w=I,w)?(w&&n(d?b:e=>e.concat(b)),C&&(w?r(A):t(A,i?.id))):h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:b.length})})}}),[t,d,n,e,l,u,r,m])};var fe=n(3225),ve=n(37859),Ae=n(56133),ye=n(61157),Ce=n(60138);let we=!1;const be=new Set([s.C7.TextUrl,s.C7.Url]);var Ie=n(25498),Se=n(37830);const Me=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,Ne=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,ke={username:"",query:"",canShowHelp:!1,usernameLowered:""},Ye=document.createElement("div");const Pe=(0,Se.A)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})));var Fe=n(9442),Te=n(20247),xe=n(16120),De=n(17237);const Ee=new RegExp(`^${a.bpX.source}$`,"g");var Le=n(11778);const Be={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Re={type:"audio/ogg"};let Oe,Ue,ze;async function Ke(){return Oe||(Oe=n.e(4550).then(n.t.bind(n,14550,23)),Ue=(await Oe).default,ze=new Ue(Be)),Oe}async function je(e){await async function(){await Ke(),ze.start()}();const t=Date.now();let n;const i=[],o=[];ze.ondataavailable=e=>{i.push(e)};const s=function(t){const n=t.sourceNode,i=n.context.createAnalyser();i.fftSize=64,n.connect(i);const s=i.frequencyBinCount,a=new Uint8Array(s);let c=!1;return function t(){if(c)return;i.getByteFrequencyData(a);const n=a.reduce(((e,t)=>e+t),0)/s/255;(t=>{o.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{c=!0}}(ze);return{stop:()=>new Promise(((e,a)=>{ze.onstop=()=>{e({blob:new Blob(i,Re),duration:Math.round(((n||Date.now())-t)/1e3),waveform:o})},ze.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout((()=>{ze.stop(),s()}),r)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{ze.pause(),n=Date.now(),s()}),e)}}}var Ve=n(80089),Je=n(80464),$e=n(20021);const qe=e=>{const{attachments:t}=e,n=(0,Je.A)(Ve.ar.Extra,"AttachmentModal",!t.length);return n?(0,$e.Y)(n,{...e}):void 0};var Ge=n(61182),He=n(87679),We=n(52844),_e=n(36680),Qe=n(18276),Ze=n(71429),Xe=n(24433),et=n(66469),tt=n(54639);const nt=(0,i.ph)((({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:o,canAttachPolls:s,canSendPhotos:r,canSendVideos:d,canSendDocuments:l,canSendAudios:u,attachBots:h,peerType:m,isScheduled:f,theme:v,shouldCollectDebugLogs:A,onFileSelect:y,onMenuOpen:C,onMenuClose:w,onPollCreate:b,canEditMedia:I,editingMessage:S,messageListType:M,paidMessagesStars:N})=>{const[k,Y,P]=(0,K.A)(),[F,T,x]=(0,_e.A)(k,P),D=r&&d,E=r||d,[L,B,R]=(0,K.A)(),O=k||L,U=S&&S?.groupedId&&Boolean((0,c.yl)(S)||(0,c.dc)(S)||Boolean((0,c.zX)(S)||(0,c.QC)(S))),z=S&&S?.groupedId&&Boolean((0,c.wp)(S)||(0,c.gB)(S)||(0,c.zC)(S));(0,i.vJ)((()=>{k&&x()}),[k,x]),(0,i.vJ)((()=>{O?C():w()}),[O,w,C]);const j=(0,J.A)((()=>{k?P():Y()})),q=(0,J.A)(((e,t)=>{const{files:n}=e.target,i=(0,He.kc)(n);i?.length&&y(i,t)})),G=(0,J.A)((()=>{(0,We.p)(Array.from(D?a.mxD:r?a.gex:a.fNs).join(","),(e=>q(e,!0)))})),H=(0,J.A)((()=>{(0,We.p)(!l&&u?Array.from(a.IH3).join(","):"*",(e=>q(e,!1)))})),W=(0,J.A)((()=>{const e=new File([(0,Ge.F8)()],a.lFE,{type:"text/plain"});y([e])})),_=(0,i.Kr)((()=>h?Object.values(h).filter((t=>!(!m||!t.isForAttachMenu)&&(!("bots"!==m||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(m)))):void 0),[h,e,m]),Q=(0,$.A)(),Z=(0,V.A)();if(n)return(0,$e.FD)("div",{className:"AttachMenu",children:[S&&I?(0,$e.Y)(et.A,{id:"replace-menu-button",className:(0,g.A)("AttachMenu--button composer-action-button",k&&"activated"),round:!0,color:"translucent",onActivate:j,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,$e.Y)(Qe.A,{name:"replace"})}):(0,$e.Y)(et.A,{id:"attach-menu-button",disabled:Boolean(S),className:(0,g.A)("AttachMenu--button composer-action-button",k&&"activated"),round:!0,color:"translucent",onActivate:j,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,$e.Y)(Qe.A,{name:"attach"})}),(0,$e.FD)(Ze.A,{id:"attach-menu-controls",isOpen:O,autoClose:!0,positionX:"right",positionY:"bottom",onClose:P,className:"AttachMenu--menu fluid",onCloseAnimationEnd:P,onMouseEnter:p.TF?void 0:F,onMouseLeave:p.TF?void 0:T,noCloseOnBackdrop:!p.TF,ariaLabelledBy:"attach-menu-button",children:[!o&&(0,$e.Y)(Xe.A,{className:"media-disabled",disabled:!0,children:Z("scheduled"===M&&N?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),o&&(0,$e.FD)($e.FK,{children:[E&&!z&&(0,$e.Y)(Xe.A,{icon:"photo",onClick:G,children:Q(D?"AttachmentMenu.PhotoOrVideo":r?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(l||u)&&!U&&(0,$e.Y)(Xe.A,{icon:"document",onClick:H,children:Q(!l&&u?"InputAttach.Popover.Music":"AttachDocument")}),l&&A&&(0,$e.Y)(Xe.A,{icon:"bug",onClick:W,children:Q("DebugSendLogs")})]}),s&&!S&&(0,$e.Y)(Xe.A,{icon:"poll",onClick:b,children:Q("Poll")}),!S&&!I&&!f&&_?.map((n=>(0,$e.Y)(tt.A,{bot:n,chatId:e,threadId:t,theme:v,onMenuOpened:B,onMenuClosed:R})))]})]})})),it=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"BotCommandMenu",!t);return n?(0,$e.Y)(n,{...e}):void 0};var ot=n(85449),st=n(64493);const at=(0,i.ph)((0,o.EK)(((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return n?{message:(0,u.O5q)(e,n,t)}:{}}))((({isOpen:e,message:t,onClose:n})=>{const{clickBotInlineButton:s}=(0,o.ko)(),a=(0,$.A)(),[r,c]=(0,_e.A)(e,n),{isKeyboardSingleUse:d}=t||{},l=(0,i.Kr)((()=>{const e=[];return t?.keyboardButtons.forEach((t=>{e.push(t.map((e=>(0,ot.A)(a,e))))})),e}),[a,t?.keyboardButtons]);if(t&&t.keyboardButtons)return(0,$e.Y)(Ze.A,{isOpen:e,autoClose:d,positionX:"right",positionY:"bottom",onClose:n,className:"BotKeyboardMenu",onCloseAnimationEnd:n,onMouseEnter:p.TF?void 0:r,onMouseLeave:p.TF?void 0:c,noCompact:!0,children:(0,$e.Y)("div",{className:"content custom-scroll",children:t.keyboardButtons.map(((e,n)=>(0,$e.Y)("div",{className:"row",children:e.map(((e,i)=>(0,$e.Y)(st.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>s({chatId:t.chatId,messageId:t.id,button:e}),children:l?.[n][i]})))})))})})}))),rt=(0,i.ph)((({isOpen:e,onClick:t,text:n,isDisabled:o})=>{const s=(0,i.li)();return(0,i.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,i.vJ)((()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),(0,$e.FD)(st.A,{className:(0,g.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:o,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,$e.Y)(Qe.A,{name:"webapp",className:(0,g.A)("bot-menu-icon",e&&"open")}),(0,$e.Y)("span",{ref:s,className:"bot-menu-text",children:(0,E.A)(n)})]})})),ct=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"ChatCommandTooltip",!t);return n?(0,$e.Y)(n,{...e}):void 0};var dt=n(87894),lt=n(14),ut=n(91930),ht=n(60859);const mt=(0,i.ph)((0,o.EK)(((e,{shouldForceShowEditing:t,chatId:n,threadId:i,messageListType:o})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:d,noCaptions:l},isShareMessageModalShown:h,shouldPreventComposerAnimation:m}=(0,u.nTw)(e),p="scheduled"===o?(0,u.VlN)(e,n):(0,u.Ys6)(e,n,i),g=(0,u.PKK)(e)&&!m,f=a===n,v=r?.map((t=>(0,u.O5q)(e,s,t))),A=(0,u.GA4)(e,n,i),y=A?.replyInfo,C=y?.replyToPeerId,w=C?(0,u.hds)(e,C):void 0;let b,I;if(p?b=(0,u.KLw)(e,n,i,o):f&&1===r.length?b=v?.[0]:y&&!t&&(b=(0,u.O5q)(e,y.replyToPeerId||n,y.replyToMsgId)),p&&b)I=(0,u.Y7C)(e,b);else if(f){let t=v?.map((t=>{return n=t,I=(0,u.Szq)(e,n),I||(I=(0,u.Y7C)(e,n)),I;var n})).filter(Boolean);t=t?(0,dt.Am)(t):void 0,I=1===t?.length?t?.[0]:void 0}else if(y&&b&&!t){const{forwardInfo:t}=b,i=(0,u.nZ4)(e,n);t&&(t.isChannelPost||i)&&(I=(0,u.Szq)(e,b)),I||t?.hiddenUserName&&!Boolean(y.quoteText)||(I=(0,u.Y7C)(e,b))}const S=I&&(0,u.hds)(e,I.id),M=S&&(0,c.WX)(S),N=v?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),k=f&&1===r.length&&Boolean(b?.content.storyData),Y=y?.replyToMsgId===i&&!y.replyToPeerId;return{replyInfo:y,editingId:p,message:b,sender:I,shouldAnimate:g,forwardedMessagesCount:f?r.length:void 0,noAuthors:d,noCaptions:l,forwardsHaveCaptions:N,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:k,isReplyToDiscussion:Y,isInChangingRecipientMode:h,shouldPreventComposerAnimation:m,senderChat:w,currentUserId:e.currentUserId,isSenderChannel:M,forwardMessageIds:r,fromChatId:s}}))((({replyInfo:e,editingId:t,message:n,sender:s,shouldAnimate:a,forwardedMessagesCount:r,noAuthors:d,noCaptions:l,forwardsHaveCaptions:h,shouldForceShowEditing:m,isCurrentUserPremium:p,isContextMenuDisabled:f,isReplyToDiscussion:v,onClear:A,isInChangingRecipientMode:y,shouldPreventComposerAnimation:C,senderChat:w,chatId:b,currentUserId:I,isSenderChannel:S,forwardMessageIds:M,fromChatId:N})=>{const{resetDraftReplyInfo:k,updateDraftReplyInfo:Y,setEditingId:P,focusMessage:F,changeRecipient:T,openChatOrTopicWithReplyInDraft:x,setForwardNoAuthors:E,setForwardNoCaptions:L,exitForwardMode:B,setShouldPreventComposerAnimation:R}=(0,o.ko)(),U=(0,i.li)(),z=(0,$.A)(),K=(0,V.A)(),j="topicCreate"===n?.content.action?.type,q=e&&!m,G=Boolean(e?.quoteText),H=Boolean(r),_=(0,J.A)((e=>{const t=(0,o.mS)();return(s=(0,u.Szq)(t,e))||(s=(0,u.Y7C)(t,e)),s})),Q=(0,i.Kr)((()=>{if(!H)return;const e=M?.map((e=>(0,u.O5q)((0,o.mS)(),N,e))).filter(Boolean),t=e?.map((e=>_(e))).filter(Boolean);return t?(0,dt.Am)(t):void 0}),[H,M,N]),Z=!(y||(!n||!e&&!t)&&(!Q||!H)),{shouldRender:X,transitionClassNames:ee}=(0,W.A)(Z&&!j&&!v,void 0,!a,void 0,!a,350,!a);(0,i.vJ)((()=>{C&&R({shouldPreventComposerAnimation:!1})}));const te=(0,J.A)((()=>{t?P({messageId:void 0}):r?B():e&&!m&&k(),A?.()}));(0,i.vJ)((()=>Z?(0,Le.A)(te):void 0),[Z,te]);const{isContextMenuOpen:ne,contextMenuAnchor:ie,handleContextMenu:oe,handleContextMenuClose:se,handleContextMenuHide:ae}=(0,O.A)(U),re=(0,J.A)((e=>{oe(e)})),ce=(0,J.A)((e=>{e.stopPropagation(),te(),ae()})),de=e=>()=>{se(),e()},le=(0,J.A)(de(T)),ue=(0,J.A)(de((()=>{F({chatId:n.chatId,messageId:n.id,noForumTopicPanel:!0})}))),he=(0,J.A)(de((()=>Y({quoteText:void 0})))),me=(0,J.A)(de(T)),pe=(0,J.A)((()=>{se(),s&&x({chatId:s.id})})),ge=(0,J.A)(de(te)),fe=(0,J.A)((()=>U.current)),ve=(0,J.A)((()=>U.current)),Ae=(0,J.A)((()=>U.current.querySelector(".forward-context-menu .bubble")));(0,i.vJ)((()=>{X||(se(),ae())}),[se,ae,X]);const ye=(0,g.A)("ComposerEmbeddedMessage",ee),Ce=(0,lt.A)(s,!0),we=(0,g.A)("ComposerEmbeddedMessage_inner",(0,D.y)(Ce)),be=(0,i.Kr)((()=>t?"edit":H?"forward":q?"reply":void 0),[t,H,q]),Ie=r&&r>1?z("ForwardedMessageCount",r):void 0,Se=(0,i.Kr)((()=>{if(!n||!H||!n.content.text||!d||p)return n;const e=(0,c.m4)(n.content.text);return{...n,content:{...n.content,text:e}}}),[p,H,n,d]),Me=(0,lt.A)(be,!0);if(!X)return;const Ne=s&&!S&&b!==s.id&&s.id!==I;return(0,$e.Y)("div",{className:ye,ref:U,onContextMenu:oe,children:(0,$e.FD)("div",{className:we,children:[(0,$e.FD)("div",{className:"embedded-left-icon",onClick:oe,children:[Me&&(0,$e.Y)(Qe.A,{name:Me}),Boolean(e?.quoteText)&&(0,$e.Y)(Qe.A,{name:"quote",className:"quote-reply"})]}),(0,$e.Y)(ut.b,{isOpen:Z,className:"inside-input",replyInfo:e,isInComposer:!0,message:Se,sender:d?void 0:s,composerForwardSenders:Q,customText:Ie,title:t&&!q?z("EditMessage"):d?z("HiddenSendersNameDescription"):void 0,onClick:re,senderChat:w}),(0,$e.Y)(st.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:z("Cancel"),onClick:ce,children:(0,$e.Y)(Qe.A,{name:"close"})}),(q||H)&&!f&&(0,$e.FD)(Ze.A,{isOpen:ne,anchor:ie,getTriggerElement:fe,getRootElement:ve,getMenuElement:Ae,className:"forward-context-menu",onClose:se,onCloseAnimationEnd:ae,children:[H&&(0,$e.FD)($e.FK,{children:[(0,$e.Y)(Xe.A,{icon:d?void 0:"message-succeeded",customIcon:d?(0,$e.Y)(Qe.A,{name:"placeholder"}):void 0,onClick:()=>E({noAuthors:!1}),children:z(r>1?"ShowSenderNames":"ShowSendersName")}),(0,$e.Y)(Xe.A,{icon:d?"message-succeeded":void 0,customIcon:d?void 0:(0,$e.Y)(Qe.A,{name:"placeholder"}),onClick:()=>E({noAuthors:!0}),children:z(r>1?"HideSenderNames":"HideSendersName")}),h&&(0,$e.FD)($e.FK,{children:[(0,$e.Y)(ht.A,{}),(0,$e.Y)(Xe.A,{icon:l?void 0:"message-succeeded",customIcon:l?(0,$e.Y)(Qe.A,{name:"placeholder"}):void 0,onClick:()=>L({noCaptions:!1}),children:z(r>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,$e.Y)(Xe.A,{icon:l?"message-succeeded":void 0,customIcon:l?void 0:(0,$e.Y)(Qe.A,{name:"placeholder"}),onClick:()=>L({noCaptions:!0}),children:z(r>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,$e.Y)(ht.A,{}),(0,$e.Y)(Xe.A,{icon:"replace",onClick:le,children:z("ForwardAnotherChat")})]}),q&&(0,$e.FD)($e.FK,{children:[(0,$e.Y)(Xe.A,{icon:"show-message",onClick:ue,children:z("Message.Context.Goto")}),G&&(0,$e.Y)(Xe.A,{icon:"remove-quote",onClick:he,children:z("RemoveQuote")}),Ne&&(0,$e.Y)(Xe.A,{icon:"user",onClick:pe,children:K("ReplyInPrivateMessage")}),(0,$e.Y)(Xe.A,{icon:"replace",onClick:me,children:z("ReplyToAnotherChat")}),(0,$e.Y)(Xe.A,{icon:"delete",onClick:ge,children:z("DoNotReply")})]})]})]})})})));var pt=n(25897),gt=n(83689),ft=n(41510);const vt=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"DropArea",!t);return n?(0,$e.Y)(n,{...e}):void 0};var At=n(49068);const yt=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"InlineBotTooltip",!t);return n?(0,$e.Y)(n,{...e}):void 0},Ct=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"MentionTooltip",!t);return n?(0,$e.Y)(n,{...e}):void 0};var wt=n(78407);const bt=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"PollModal",!t);return n?(0,$e.Y)(n,{...e}):void 0},It=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"SendAsMenu",!t);return n?(0,$e.Y)(n,{...e}):void 0},St=e=>{const{isOpen:t}=e,n=(0,Je.A)(Ve.ar.Extra,"StickerTooltip",!t);return n?(0,$e.Y)(n,{...e}):void 0};var Mt=n(26440),Nt=n(14647);const kt=new RegExp(a.kNZ,"i"),Yt=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n})=>{const i=(0,u.rQx)(e,t,n),{attachmentSettings:o}=e;return{theme:(0,u.SJA)(e),webPagePreview:(0,u.nTw)(e).webPagePreview,noWebPage:i,attachmentSettings:o}}))((({chatId:e,threadId:t,getHtml:n,isDisabled:a,webPagePreview:r,noWebPage:c,theme:d,attachmentSettings:l,isEditing:u})=>{const{loadWebPagePreview:h,clearWebPagePreview:m,toggleMessageWebPage:p,updateAttachmentSettings:f}=(0,o.ko)(),v=(0,$.A)(),A=(0,i.li)(),y=(0,i.li)(),C=l.isInvertedMedia,w="small"===l.webPageMediaSize,b=(0,X.tF)((()=>{const e=(0,S.Ay)(n()),t=e.entities?.find((e=>e.type===s.C7.TextUrl));return A.current=e,t?.url||e.text.match(kt)?.[0]}),[n],300,!0),I=(0,ee.A)(b,[b,n],!0);(0,i.vJ)((()=>{const n=I(),i=A.current;n?h({text:i}):(m(),p({chatId:e,threadId:t}))}),[I,e,t]),(0,Q.A)((()=>{m(),p({chatId:e,threadId:t})}),[e,m,t,p]);const M=(0,U.A)((()=>Boolean(r&&n()&&!c&&!a)),[a,n,c,r]),{shouldRender:N,transitionClassNames:k}=(0,W.A)(M),Y=r?.hasLargeMedia,P=(0,lt.A)(r,!0),F=(0,J.A)((()=>{p({chatId:e,threadId:t,noWebPage:!0})})),{isContextMenuOpen:T,contextMenuAnchor:x,handleContextMenu:D,handleContextMenuClose:E,handleContextMenuHide:L}=(0,O.A)(y,u,!0),B=(0,J.A)((()=>y.current)),R=(0,J.A)((()=>y.current)),z=(0,J.A)((()=>y.current.querySelector(".web-page-preview-context-menu .bubble"))),K=(0,J.A)((e=>{D(e)}));function j(e){f({isInvertedMedia:e})}function V(e){f({webPageMediaSize:e})}if((0,i.vJ)((()=>{N&&P||(E(),L())}),[E,L,N,P]),!N||!P)return;const{photo:q,...G}=P,H={content:{webPage:G}};return(0,$e.Y)("div",{className:(0,g.A)("WebPagePreview",k),ref:y,children:(0,$e.FD)("div",{className:"WebPagePreview_inner",children:[(0,$e.Y)("div",{className:"WebPagePreview-left-icon",onClick:K,children:(0,$e.Y)(Qe.A,{name:"link"})}),(0,$e.Y)(Nt.A,{message:H,inPreview:!0,theme:d,onContainerClick:K,isEditing:u}),(0,$e.Y)(st.A,{className:"WebPagePreview-clear",round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:F,children:(0,$e.Y)(Qe.A,{name:"close"})}),!u&&(0,$e.Y)(Ze.A,{isOpen:T,anchor:x,getTriggerElement:B,getRootElement:R,getMenuElement:z,className:"web-page-preview-context-menu",onClose:E,onCloseAnimationEnd:L,autoClose:!0,children:(0,$e.FD)($e.FK,{children:[C?(0,$e.Y)(Xe.A,{icon:"move-caption-up",onClick:()=>j(void 0),children:v("PreviewSender.MoveTextUp")}):(0,$e.Y)(Xe.A,{icon:"move-caption-down",onClick:()=>j(!0),children:v("PreviewSender.MoveTextDown")}),Y&&(w?(0,$e.Y)(Xe.A,{icon:"expand",onClick:()=>V("large"),children:v("ChatInput.EditLink.LargerMedia")}):(0,$e.Y)(Xe.A,{icon:"collapse",onClick:()=>V("small"),children:v("ChatInput.EditLink.SmallerMedia")})),(0,$e.Y)(Xe.A,{icon:"delete",onClick:F,children:v("ChatInput.EditLink.RemovePreview")})]})})]})})})));var Pt=n(97676),Ft=n(76283),Tt=n(57474),xt=n(41036),Dt=n(68292),Et=n(21849),Lt=n(48227),Bt=n(11241),Rt=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}(Rt||{});const Ot=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n,storyId:i,messageListType:o,isMobile:r,type:l})=>{const p=(0,u.hds)(e,t),g=(0,c.DX)(t)?void 0:(0,u.yps)(e,t),f=Boolean(g),v=(0,u.nZ4)(e,t),A=(0,C.L8)(t),y=A?(0,u.vGo)(e,t):void 0,w=(0,u.WA9)(e,t),b=A?void 0:(0,u.AWZ)(e,t),I=(f||!A)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:S,shouldSuggestCustomEmoji:M,shouldUpdateStickerSetOrder:N,shouldPaidMessageAutoApprove:k}=e.settings.byKey,{language:Y,shouldCollectDebugLogs:P}=(0,m.l)(e),{forwardMessages:{messageIds:F}}=(0,u.nTw)(e),T=e.emojiKeywords[a.cUY],x=Y!==a.cUY?e.emojiKeywords[Y]:void 0,D=I?I.id:void 0,E=D?(0,u.O5q)(e,t,D):void 0,{currentUserId:L}=e,B=(0,u.mBe)(e,L),R=b?b?.sendAsId||L:void 0,O=R?(0,u.PVB)(e,R):void 0,U=(0,u.sam)(e,t),z=(0,u.p6T)(e,t),K=(0,u.nTw)(e),j=Boolean(K.storyViewer.storyId),V=(0,u.Xf0)(e),J=t===V?.chatId&&n===V?.threadId&&o===V?.type&&!j,$=((0,u.mBe)(e,t)&&!y?.noVoiceMessages)??!0,q=b?.slowMode,G=(0,u.g29)(e),H="scheduled"===o?(0,u.dkp)(e,t):(0,u.U0A)(e,t,n),W=i&&(0,u.Msb)(e,t,i),_=W&&"sentReaction"in W?W.sentReaction:void 0,Q=(0,u.GA4)(e,t,n),Z=Q?.replyInfo?(0,u.O5q)(e,t,Q.replyInfo.replyToMsgId):void 0,X=p?.isForum&&p.isForumAsMessages&&n===s.l3&&Z?(0,u.nkm)(e,Z):void 0,ee="scheduled"===o,te=A&&!f&&!ee&&!v,ne=(0,u.rQx)(e,t,n),ie=p&&(0,d.RY)(p,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,oe=A&&!f&&!ee&&!v&&"story"!==l&&t!==a.zv8,se=(0,u.xYJ)(e,"stickerEffects"),ae=K.shouldPlayEffectInComposer,re=oe&&Q?.effectId,ce=re?e.availableEffectById[re]:void 0,de=e.reactions.effectReactions,le=e.config?.maxMessageLength||a.YfK,ue=t===K.forwardMessages.toChatId,he=e.stars?.balance.amount||0,me=Boolean(K.starsBalanceModal),pe=(0,u.trm)(e),ge=e.isAppConfigLoaded,fe=K.insertingPeerIdMention;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===l?e.reactions.topReactions:void 0,isOnActiveTab:!K.isBlurred,editingMessage:(0,u.KLw)(e,t,n,o),draft:Q,chat:p,isChatWithBot:f,isChatWithSelf:v,isForCurrentMessageList:J,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:p?(0,c.WX)(p):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===o&&(y||b)?.hasScheduledMessages,isInScheduledList:ee,botKeyboardMessageId:D,botKeyboardPlaceholder:E?.keyboardPlaceholder,isForwarding:ue,forwardedMessagesCount:ue?F.length:void 0,pollModal:K.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:b,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:L,currentUser:B,contentToBeScheduled:K.contentToBeScheduled,shouldSuggestStickers:S,shouldSuggestCustomEmoji:M,shouldUpdateStickerSetOrder:N,recentEmojis:e.recentEmojis,baseEmojiKeywords:T?.keywords,emojiKeywords:x?.keywords,inlineBots:K.inlineBots.byUsername,isInlineBotLoading:K.inlineBots.isLoading,botCommands:y?y.botInfo?.commands||!1:void 0,botMenuButton:y?.botInfo?.menuButton,sendAsPeer:O,sendAsId:R,editingDraft:H,requestedDraft:U,requestedDraftFiles:z,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:G,canSendVoiceByPrivacy:$,attachmentSettings:e.attachmentSettings,slowMode:q,currentMessageList:V,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!G&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!v&&A&&!f&&!ee,shouldCollectDebugLogs:P,sentStoryReaction:_,stealthMode:e.stories.stealthMode,replyToTopic:X,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:te,noWebPage:ne,webPagePreview:(0,u.nTw)(e).webPagePreview,isContactRequirePremium:y?.isContactRequirePremium,effect:ce,effectReactions:de,areEffectsSupported:oe,canPlayEffect:se,shouldPlayEffect:ae,maxMessageLength:le,paidMessagesStars:w,shouldPaidMessageAutoApprove:k,isSilentPosting:ie,isPaymentMessageConfirmDialogOpen:K.isPaymentMessageConfirmDialogOpen,starsBalance:he,isStarsBalanceModalOpen:me,shouldDisplayGiftsButton:y?.shouldDisplayGiftsButton,disallowedGifts:y?.disallowedGifts,isAccountFrozen:pe,isAppConfigLoaded:ge,insertingPeerIdMention:fe}}))((({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:d,canScheduleUntilOnline:h,isReady:m,isMobile:C,editingMessage:Y,chatId:ne,threadId:ie,storyId:oe,currentMessageList:se,messageListType:ae,draft:re,chat:ce,chatFullInfo:de,replyToTopic:le,isForCurrentMessageList:ue,isCurrentUserPremium:he,canSendVoiceByPrivacy:me,isChatWithBot:pe,isChatWithSelf:Se,isChannel:Be,fileSizeLimit:Re,isRightColumnShown:Oe,isSelectModeActive:Ue,isReactionPickerOpen:ze,shouldDisplayGiftsButton:Ve,isForwarding:Je,forwardedMessagesCount:Ge,pollModal:He,botKeyboardMessageId:We,botKeyboardPlaceholder:_e,inputPlaceholder:Ze,withScheduledButton:Xe,stickersForEmoji:tt,customEmojiForEmoji:ot,topInlineBotIds:dt,currentUserId:lt,currentUser:ut,captionLimit:ht,contentToBeScheduled:Nt,shouldSuggestStickers:kt,shouldSuggestCustomEmoji:Ot,baseEmojiKeywords:Ut,emojiKeywords:zt,recentEmojis:Kt,inlineBots:jt,isInlineBotLoading:Vt,botCommands:Jt,sendAsPeer:$t,sendAsId:qt,editingDraft:Gt,requestedDraft:Ht,requestedDraftFiles:Wt,botMenuButton:_t,attachBots:Qt,attachMenuPeerType:Zt,attachmentSettings:Xt,theme:en,slowMode:tn,shouldUpdateStickerSetOrder:nn,editableInputCssSelector:on,editableInputId:sn,inputId:an,className:rn,availableReactions:cn,topReactions:dn,canBuyPremium:ln,canPlayAnimatedEmojis:un,shouldCollectDebugLogs:hn,sentStoryReaction:mn,stealthMode:pn,canSendOneTimeMedia:gn,quickReplyMessages:fn,quickReplies:vn,canSendQuickReplies:An,webPagePreview:yn,noWebPage:Cn,isContactRequirePremium:wn,paidMessagesStars:bn,effect:In,effectReactions:Sn,areEffectsSupported:Mn,canPlayEffect:Nn,shouldPlayEffect:kn,maxMessageLength:Yn,isSilentPosting:Pn,onDropHide:Fn,onFocus:Tn,onBlur:xn,onForward:Dn,isPaymentMessageConfirmDialogOpen:En,starsBalance:Ln,isStarsBalanceModalOpen:Bn,disallowedGifts:Rn,isAccountFrozen:On,isAppConfigLoaded:Un,insertingPeerIdMention:zn})=>{const{sendMessage:Kn,clearDraft:jn,showDialog:Vn,openPollModal:Jn,closePollModal:$n,loadScheduledHistory:qn,openThread:Gn,addRecentEmoji:Hn,sendInlineBotResult:Wn,loadSendAs:_n,resetOpenChatWithDraft:Qn,callAttachBot:Zn,addRecentCustomEmoji:Xn,showNotification:ei,showAllowedMessageTypesNotification:ti,openStoryReactionPicker:ni,openGiftModal:ii,closeReactionPicker:oi,sendStoryReaction:si,editMessage:ai,updateAttachmentSettings:ri,saveEffectInDraft:ci,setReactionEffect:di,hideEffectInComposer:li,updateChatSilentPosting:ui,updateInsertingPeerIdMention:hi}=(0,o.ko)(),mi=(0,$.A)(),pi=(0,V.A)(),gi=(0,i.li)(),fi=(0,i.li)(),vi=(0,i.li)(),[Ai,yi]=(0,i.Ul)(""),[Ci,wi]=(0,i.J0)(!1),bi=(0,j.A)(on),Ii=(0,i.li)(),Si=(0,q.A)(n),{width:Mi}=k.A.get(),Ni="messageList"===e,ki="story"===e,Yi=Ni?ce?.sendAsPeerIds:void 0,Pi=Boolean(Yi?.length),[Fi,Ti,xi]=(0,K.A)(),Di=(0,H.A)(ne,ie),[Ei,Li,Bi]=(0,K.A)(),[Ri,Oi,Ui]=(0,K.A)(),zi=Y&&(0,c.ZV)(Y),{emojiSet:Ki,members:ji,botCommands:Vi}=de||{},Ji=Ki?.id,$i=mn&&(0,c.a0)(mn,a.tNZ);(0,i.vJ)(y.VU,[Ai]);const qi=(0,i.li)(0),[Gi,Hi]=(0,G.A)(Ni&&h,xi);(0,R.A)((()=>{wi(!0)}),430),(0,i.vJ)((()=>{Ni||oi()}),[Ni,oe]),(0,i.vJ)((()=>{Ii.current=void 0}),[ne]),(0,i.vJ)((()=>{Un&&ne&&m&&!ki&&qn({chatId:ne})}),[m,ne,ie,ki,Un]),(0,i.vJ)((()=>{const e=Be&&ce?.areProfilesShown,t=ce&&(0,c.Vs)(ce)&&Boolean((0,c.gA)(ce)||ce.isLinkedInDiscussion||ce.hasGeo);!Yi&&m&&(t||e)&&_n({chatId:ne})}),[ce,ne,Be,m,_n,Yi]);const Wi=(0,i.li)(!1);(0,Q.A)((([e,t])=>{Wi.current=Boolean(ne===e&&Yi&&!t)}),[ne,Yi]);const[_i,Qi]=(0,i.J0)([]),Zi=Boolean(_i.length),[Xi,eo]=(0,i.J0)(void 0),{canSendStickers:to,canSendGifs:no,canAttachMedia:io,canAttachPolls:oo,canAttachEmbedLinks:so,canSendVoices:ao,canSendPlainText:ro,canSendAudios:co,canSendVideos:lo,canSendPhotos:uo,canSendDocuments:ho}=(0,i.Kr)((()=>(0,c.Q_)(ce,de,pe,ki,bn,d)),[ce,de,pe,ki,bn,d]),mo=wn&&ki,po=mo||!ro,go=(0,U.A)((()=>{if(Zi)return _i.length;const e=Ai()||Zi?1:0;return Je&&Ge?Ge+e:e||1}),[Ai,Zi,_i,Je,Ge]),fo=bn?go*bn:0,{closeConfirmDialog:vo,dialogHandler:Ao,shouldAutoApprove:yo,setAutoApprove:Co,handleWithConfirmation:wo}=(0,Te.A)(fo,Bn,Ln),bo=!Zi&&so&&!Cn&&Boolean(yn),Io=po&&!Y;(0,i.vJ)((()=>{bo||ri({isInvertedMedia:void 0})}),[bo]);const So=(0,J.A)(((e,t=sn)=>{if(t===sn&&Io)return;const n=window.getSelection();let i;if(i=t===sn?document.querySelector(on):document.getElementById(t),n.rangeCount){const o=n.getRangeAt(0);if((0,x.L)(o,t))return(0,M.oR)(e),void i.dispatchEvent(new Event("input",{bubbles:!0}))}yi(`${Ai()}${e}`),(0,r.Uz)((()=>{(0,w.A)(i)}))})),Mo=(0,J.A)(((e,t=sn)=>{const n=(0,E.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");So(n,t)})),No=(0,J.A)(((e,t=sn)=>{const n=(0,L.QY)(e);So(n,t)})),ko=(0,J.A)(((e,t=sn)=>{So((0,T.hB)(e),t)})),Yo=(0,J.A)((()=>{Xi&&(No(Xi,sn),eo(void 0))})),{shouldSuggestCompression:Po,shouldForceCompression:Fo,shouldForceAsFile:To,handleAppendFiles:xo,handleFileSelect:Do,onCaptionUpdate:Eo,handleClearAttachments:Lo,handleSetAttachments:Bo}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:a,canSendAudios:r,canSendVideos:d,canSendPhotos:l,canSendDocuments:u,insertNextText:h,editedMessage:m}){const p=(0,V.A)(),{openLimitReachedModal:g,showAllowedMessageTypesNotification:f,showNotification:v}=(0,o.ko)(),[A,y]=(0,i.J0)(!1),[C,w]=(0,i.J0)(!1),[b,S]=(0,i.J0)(void 0),M=(0,J.A)((()=>{s(I.p),h()})),N=(0,J.A)((n=>{const i="function"==typeof n?n(e):n;if(i.length)if(i.some((e=>{const t=(0,c.ES)(e);return"audio"===t&&!r&&!u||"video"===t&&!d&&!u||"photo"===t&&!l&&!u||"file"===t&&!u})))f({chatId:a});else if(i.some((({size:e})=>e>t)))g({limit:"uploadMaxFileparts"});else{s(i);const e=i.some((e=>{const t=(0,c.ES)(e);return"audio"===t&&!r||"video"===t&&!d||"photo"===t&&!l}));y(Boolean(e&&u)),w(!u)}else M()}));return{shouldSuggestCompression:b,handleAppendFiles:(0,J.A)((async(t,n)=>{if(m){const e=await(0,F.A)(t[0].name,t[0]),n=m&&(0,c.eh)(m,e);m?.groupedId?n?N([e]):v({message:p("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):N([e])}else{const i=await Promise.all(t.map((e=>(0,F.A)(e.name,e,{shouldSendAsSpoiler:n||void 0}))));N([...e,...i])}})),handleFileSelect:(0,J.A)((async(e,t)=>{if(m){const t=await(0,F.A)(e[0].name,e[0]),n=m&&(0,c.eh)(m,t);m?.groupedId?n?N([t]):v({message:p("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):N([t])}else{const t=await Promise.all(e.map((e=>(0,F.A)(e.name,e))));N(t)}S(t)})),onCaptionUpdate:n,handleClearAttachments:M,handleSetAttachments:N,shouldForceCompression:C,shouldForceAsFile:A}}({attachments:_i,setHtml:yi,setAttachments:Qi,fileSizeLimit:Re,chatId:ne,canSendAudios:co,canSendVideos:lo,canSendPhotos:uo,canSendDocuments:ho,insertNextText:Yo,editedMessage:Y}),[Ro,Oo,Uo]=(0,K.A)(),[zo,Ko,jo]=(0,K.A)(),[Vo,Jo,$o]=(0,K.A)(),[qo,Go,Ho]=(0,K.A)(),[Wo,_o,Qo]=(0,K.A)(),{startRecordingVoice:Zo,stopRecordingVoice:Xo,pauseRecordingVoice:es,activeVoiceRecording:ts,currentRecordTime:ns,recordButtonRef:is,startRecordTimeRef:os,isViewOnceEnabled:ss,setIsViewOnceEnabled:as,toogleViewOnceEnabled:rs}=(()=>{const e=(0,i.li)(),[t,n]=(0,i.J0)(),o=(0,i.li)(),[s,a]=(0,i.J0)(),[c,d]=(0,i.J0)(!1);(0,i.vJ)((()=>{p.Yw&&p.pW&&Ke()}),[]);const l=(0,J.A)((async()=>{try{const{stop:t,pause:i}=await je((t=>{e.current&&(o.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()))}));o.current=Date.now(),a(Date.now()),n({stop:t,pause:i})}catch(e){console.error(e)}})),u=(0,J.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,J.A)((()=>{if(t){n(void 0),o.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,i.vJ)((()=>t?(0,Le.A)(h):void 0),[t,h]);const m=(0,J.A)((()=>{d(!c)}));return{startRecordingVoice:l,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:o,isViewOnceEnabled:c,setIsViewOnceEnabled:d,toogleViewOnceEnabled:m}})(),cs=ue&&!ki;(0,B.A)((()=>{Di({type:"recordAudio"})}),cs?ts&&a.cqp:void 0),(0,i.vJ)((()=>{ue&&!ki&&(ts||Di({type:"cancel"}))}),[ts,ue,ki,Di]);const ds=(0,_.i)(Boolean(Y));(0,i.vJ)((()=>{ue&&!ki&&Ai()&&!ds.current&&Di({type:"typing"})}),[Ai,ds,ue,ki,Di]);const ls=ce&&(0,c.SJ)(ce),{isEmojiTooltipOpen:us,closeEmojiTooltip:hs,filteredEmojis:ms,filteredCustomEmojis:ps,insertEmoji:gs}=(0,Ie.A)(Boolean(m&&t&&(ki||ue)&&kt&&!Zi),Ai,yi,void 0,Kt,Ut,zt),{isCustomEmojiTooltipOpen:fs,closeCustomEmojiTooltip:vs,insertCustomEmoji:As}=(0,fe.A)(Boolean(m&&t&&(ki||ue)&&Ot&&!Zi),Ai,yi,bi,gi,ot),{isStickerTooltipOpen:ys,closeStickerTooltip:Cs}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,o.ko)(),[c,d,l]=(0,K.A)(!1),u=(0,ee.A)((()=>{const n=t();if(!e||!n||p.TL&&n.length>8)return;if(!n.match(p.TL?xe.A:a.bpX))return;const i=(0,Z.S)(n);return i&&(p.TL&&1===(0,De.A)(i)||!p.TL&&Boolean(n.match(Ee)))?p.TL?i:i.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),h=(0,U.A)((()=>Boolean(u())),[u]),m=Boolean(n?.length);return(0,i.vJ)((()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()}),[e,h,u,m,s,r]),(0,i.vJ)(l,[l,t]),{isStickerTooltipOpen:Boolean(h&&m&&!c),closeStickerTooltip:d}}(Boolean(m&&t&&(ki||ue)&&kt&&to&&!Zi),Ai,tt),{isMentionTooltipOpen:ws,closeMentionTooltip:bs,insertMention:Is,mentionFilteredUsers:Ss}=(0,Fe.A)(Boolean(Ni&&m&&ue&&!Zi),Ai,yi,bi,gi,ji,dt,lt);(0,i.vJ)((()=>{if(!zn)return;const e=(0,u.PVB)((0,o.mS)(),zn);e&&Is(e,!0,!0),hi({peerId:void 0})}),[zn,Is]);const{isOpen:Ms,botId:Ns,isGallery:ks,switchPm:Ys,switchWebview:Ps,results:Fs,closeTooltip:Ts,help:xs,loadMore:Ds}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:c}=(0,o.ko)(),[d,l,u]=(0,K.A)(!1),h=(0,X.gs)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return ke;const t=function(e){return Ye.innerHTML=e.replace(/<br>/g,"\n"),Ye.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),Ye.innerText}(e),n=t.match(Me);return n?Pe(n[1],n[2],""===n[2]&&!t.match(Ne)):ke}(t):ke}),[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,U.A)(h,[h,n],!0);(0,Q.A)((([e])=>{e&&r({username:e})}),[m,r]),(0,i.vJ)((()=>{f&&a({chatId:t,username:f,query:p})}),[t,p,a,f]),(0,i.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:b,help:I}=f&&s?.[f]||{},S=Boolean((w?.length||A)&&!d);(0,i.vJ)((()=>{S||m||c()}),[S,c,m]);const M=(0,J.A)((()=>{f&&a({chatId:t,username:f,query:p,offset:C})}));return{isOpen:S,botId:v,isGallery:b,switchPm:A,switchWebview:y,results:w,closeTooltip:l,help:g&&I?`@${m} ${I}`:void 0,loadMore:M}}(Boolean(Ni&&m&&ue&&!Zi),ne,Ai,jt),Es=Boolean(vn&&Object.keys(vn).length),{isOpen:Ls,close:Bs,filteredBotCommands:Rs,filteredQuickReplies:Os}=function(e,t,n,o,s){const[a,r]=(0,i.J0)(),[c,d]=(0,i.J0)(),[l,u,h]=(0,K.A)(!1),m=(0,X.gs)((()=>{const n=t();return e&&n.startsWith("/")?(0,Z.S)(n).match(te)?.[0].trim():void 0}),[t,e],300),p=(0,ee.A)(m,[m,t],!0);return(0,i.vJ)((()=>{const e=p(),t=n||o;if(!e||!t&&!s)return r(void 0),void d(void 0);const i=e.substring(1),a=t?.filter((e=>!i||e.command.startsWith(i)));r(a?.length?a:void 0);const c=Object.values(s||{}).filter((e=>!i||e.shortcut.startsWith(i)));d(c?.length?c:void 0)}),[p,n,o,s]),(0,i.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||c?.length)&&!l),close:u,filteredBotCommands:a,filteredQuickReplies:c}}(Boolean(Ni&&m&&ue&&(Jt&&Jt?.length||Vi?.length||Es&&An)),Ai,Jt,Vi,An?vn:void 0);(({draft:e,chatId:t,threadId:n,getHtml:c,setHtml:d,editedMessage:l,isDisabled:u})=>{const{saveDraft:h,clearDraft:m,loadCustomEmojis:p}=(0,o.ko)(),g=(0,i.li)(!1);(0,i.vJ)((()=>{const t=c(),n=void 0!==e?.isLocal;(0,L.QY)(e?.text)!==t||n?g.current=!0:g.current=!1}),[e,c]),(0,i.vJ)((()=>{g.current=!1}),[t,n]);const f=Boolean(l),v=(0,J.A)(((e={})=>{if(u||f||!g.current)return;const i=c();i?(0,r.YS)((()=>{h({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,S.Ay)(i)})})):m({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0})})),A=(0,Ae.A)(a.mPG,!0,void 0,[t,n]);(0,ve.A)((([i,o,a])=>{if(u)return;const r=g.current;if(t===i&&n===o){if(r&&!e)return;if(!e&&a&&d(""),r)return}if(l||!e)return;d((0,L.QY)(e.text));const c=e.text?.entities?.map((e=>e.type===s.C7.CustomEmoji&&e.documentId)).filter(Boolean)||[];c.length&&p({ids:c})}),[t,n,e,c,d,l,u]),(0,i.Nf)((()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),we=!0,(0,r.YS)((()=>{we=!1}))}}),[t,n,f,v,u]);const y=(0,_.i)(t),C=(0,_.i)(n);(0,i.vJ)((()=>{if(u||we)return;if(!c())return void v();const e=y.current,t=C.current;A((()=>{y.current===e&&C.current===t&&v()}))}),[y,c,u,A,C,v]),(0,ye.A)(v),(0,Ce.A)(v)})({draft:re,chatId:ne,threadId:ie,getHtml:Ai,setHtml:yi,editedMessage:Y,isDisabled:ki||Boolean(Ht)});const Us=(0,J.A)(((e=!1)=>{e||yi(""),Qi(I.p),eo(void 0),hs(),vs(),Cs(),bs(),C?setTimeout((()=>$o()),350):$o()})),[zs,Ks,js]=((e,t,n,s,d,l,u,h,m)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,o.ko)(),[A,y]=(0,i.J0)(!1),C=h?.replyInfo?.replyToMsgId;(0,z.A)((([e,i])=>{if(!n)return;if(C&&i!==C)return t(""),void y(!1);if(e?.id===n.id&&C===i)return;const o=!e&&m?.text.length?m:n.content.text,s=(0,L.QY)(o);t(s),y(!0),(0,r.Uz)((()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)}))}),[n,C,m,t]),(0,i.vJ)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>be.has(e.type)));f({chatId:d,threadId:l,noWebPage:e})}),[d,l,n]),(0,i.vJ)((()=>{if(n)return()=>{const t=(0,S.Ay)(e()),n=t.text.length?t:void 0;g({chatId:d,threadId:l,type:u,text:n})}}),[d,n,e,g,l,u]);const b=(0,X.tF)((()=>{if(!n)return!1;const t=(0,S.Ay)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>be.has(e.type)))&&!t.entities?.some((e=>be.has(e.type)))}),[n,e],300,!0),I=(0,ee.A)(b,[b,e],!0);(0,z.A)((([e])=>{n&&e?.id===n.id&&I()&&f({chatId:d,threadId:l,noWebPage:!1})}),[n,d,e,l,I]);const M=(0,J.A)((()=>{h&&(0,r.YS)((()=>{t((0,L.QY)(h.text)),(0,r.Uz)((()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)}))}))})),N=(0,J.A)((()=>{s(),M()})),k=(0,J.A)((()=>{const{text:t,entities:i}=(0,S.Ay)(e());n&&(t||(0,c.mR)(n)?(p({messageList:{chatId:d,threadId:l,type:u},text:t,entities:i}),s(),M()):v({chatId:d,messageIds:[n.id],isSchedule:"scheduled"===u}))})),Y=(0,J.A)((()=>{if(!n)return;const t=(0,S.Ay)(e()),i=t.text.length?t:void 0;g({chatId:d,threadId:l,type:u,text:i})}));return(0,ye.A)(Y),(0,Ce.A)(Y),[k,N,A]})(Ai,yi,Y,Us,ne,ie,ae,re,Gt),Vs=(0,_.i)(Us),Js=(0,_.i)(Xo);(0,i.vJ)((()=>()=>{Js.current(),Vs.current()}),[ne,ie,Vs,Js]);const $s=(0,i.Kr)((()=>{if(Rn)return Object.values(Rn).every(Boolean)}),[Rn]),qs=Boolean(!Se&&Ve&&!$s),Gs=(0,J.A)((()=>{const e=qi.current;ei(e?{message:mi("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:lt,shouldReplaceHistory:!0}},actionText:mi("Open")}:{message:mi("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:mi("PremiumMore")}),qi.current=Number(!e)})),Hs=(0,U.A)((()=>Ei||!Dn||Ai()&&!Zi?Y&&js?Rt.Edit:!p.pW||ts||Je||Ai()&&!Zi?d?Rt.Schedule:Rt.Send:Rt.Record:Rt.Forward),[ts,Y,Ai,Zi,Je,Ei,Dn,js,d]),Ws=!d,{isContextMenuOpen:_s,handleContextMenu:Qs,handleContextMenuClose:Zs,handleContextMenuHide:Xs}=(0,O.A)(is,!(Hs===Rt.Send&&Ws)),{contextMenuAnchor:ea,handleContextMenu:ta,handleBeforeContextMenu:na,handleContextMenuHide:ia}=(0,O.A)(vi,!ki);(0,i.vJ)((()=>{ze||ea&&(ni({peerId:ne,storyId:oe,position:ea}),ia())}),[ne,ia,ze,oe,ea]),ge(ue||ki,No,Bo,eo,Y,!he&&!Se,Gs);const oa=(0,J.A)((()=>{Y&&Ks()})),sa=(0,J.A)(((e,t)=>{const n=t?ht:Yn;if(e?.length>n){const t=e.length-n;return Vn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),aa=(0,J.A)((()=>{if(tn&&!ls){const e=document.querySelector(on),t=(0,N.Fm)(),n=Ii.current&&Math.floor(t-Ii.current),i=tn.nextSendDate&&tn.nextSendDate>t;if(n&&n<tn.seconds||i){const o=i?tn.nextSendDate-t:tn.seconds-n;return Vn({data:{message:mi("SlowModeHint",(0,f.QO)(o)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),ra=e=>{if(!se&&!oe)return!1;const{text:t}=(0,S.Ay)(Ai());return!(!t&&!e.length||!sa(t,!0)||!aa())},ca=(0,J.A)((({attachments:e,sendCompressed:t=Xt.shouldCompress,sendGrouped:n=Xt.shouldSendGrouped,isSilent:i,scheduledAt:o,isInvertedMedia:s})=>{if(!se&&!oe)return;i=i||Pn;const{text:a,entities:c}=(0,S.Ay)(Ai());s=a&&t&&n?s:void 0,Y?ai({messageList:se,text:a,entities:c,attachments:(0,F.L)(e,t)}):Kn({messageList:se,text:a,entities:c,scheduledAt:o,isSilent:i,shouldUpdateStickerSetOrder:nn,attachments:(0,F.L)(e,t),shouldGroupMessages:n,isInvertedMedia:s}),Ii.current=(0,N.Fm)(),jn({chatId:ne,isLocalOnly:!0}),(0,r.YS)((()=>{Us()}))})),da=(0,J.A)(((e,t,n)=>{if(ra(_i)){if(Y)return void ca({attachments:_i,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});wo(ca,{attachments:_i,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}})),la=(0,J.A)(((e,t,n,i,o)=>{ra(_i)&&ca({attachments:_i,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:i,isInvertedMedia:o})})),ua=(0,J.A)(((e,t=!1,n)=>{const{text:i,entities:o}=(0,S.Ay)(Ai());if(e.length)return void(ra(e)&&ca({attachments:e,scheduledAt:n,isSilent:t}));if(!i&&!Je)return;if(!sa(i))return;const s=document.querySelector(on),a=In?.id;if(i||Je){if(!aa())return;const e=bo?Xt.isInvertedMedia:void 0;Mn&&ci({chatId:ne,threadId:ie,effectId:void 0}),Kn({messageList:se,text:i,entities:o,scheduledAt:n,isSilent:t,shouldUpdateStickerSetOrder:nn,isInvertedMedia:e,effectId:a,webPageMediaSize:Xt.webPageMediaSize,webPageUrl:bo?yn.url:void 0,isForwarding:Je})}Ii.current=(0,N.Fm)(),jn({chatId:ne,threadId:ie,isLocalOnly:!0,shouldKeepReply:Je}),p.pz&&s&&s===document.activeElement&&P(s),(0,r.YS)((()=>{Us()}))})),ha=(0,J.A)((async(e=!1,t)=>{if(!se&&!oe)return;e=e||Pn;let n=_i;if(ts){const e=await Xo(),t=ss?a.dxe:void 0;if(e){const{blob:i,duration:o,waveform:s}=e;n=[await(0,F.A)("wonderful-voice-message.ogg",i,{voice:{duration:o,waveform:s},ttlSeconds:t})]}}ua(n,e,t)})),ma=(0,J.A)(((e=!1,t)=>{wo(ha,e,t)})),pa=(0,J.A)((()=>{if("webApp"!==_t?.type)return;const e=(0,A.vG)(_t.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,v._)(_t.url):Zn({chatId:ne,url:_t.url,threadId:ie})})),ga=(0,J.A)((()=>{$o(),Ko()})),fa=(0,J.A)(((e,t,n,i)=>{if(e&&"queryId"in e){const{id:n,queryId:i,isSilent:o}=e;return void Wn({id:n,chatId:ne,threadId:ie,queryId:i,scheduledAt:t,isSilent:o||Pn})}const{isSilent:o,...s}=e||{};if(e&&0!==Object.keys(s).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:i=!1,isInvertedMedia:s}=e;la(n,i,o,t,s)}else Kn({...e,messageList:n,scheduledAt:t,effectId:i});else ha(Boolean(o),t)}));(0,z.A)((([e])=>{se&&Nt&&Nt!==e&&Gi((e=>{fa(Nt,e,se)}))}),[Nt,se,fa,Gi]),(0,i.vJ)((()=>{Ht&&(No(Ht),Qn(),(0,r.Uz)((()=>{const e=document.getElementById(sn);(0,w.A)(e,!0)})))}),[sn,Ht,Qn,yi]),(0,i.vJ)((()=>{Wt?.length&&(Do(Wt),Qn())}),[Do,Wt,Qn]);const va=(0,J.A)(((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||he||Se||n===Ji?ko(e,t):Gs()})),Aa=(0,J.A)((e=>{va(e,a.e0F)})),ya=(0,J.A)(((e,t,n)=>{(se||oe)&&(t=t||Pn,d||n?(Ti(),Gi((n=>{xi(),wo(fa,{gif:e,isSilent:t},n,se),(0,r.YS)((()=>{Us(!0)}))}))):(wo(Kn,{messageList:se,gif:e,isSilent:t}),(0,r.YS)((()=>{Us(!0)}))))})),Ca=(0,J.A)(((e,t,n,i=!1,o)=>{(se||oe)&&(t=t||Pn,e={...e,isPreloadedGlobally:!0},d||n?(Ti(),Gi((n=>{xi(),wo(fa,{sticker:e,isSilent:t},n,se),(0,r.YS)((()=>{Us(i)}))}))):(wo(Kn,{messageList:se,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:nn&&o}),jn({chatId:ne,threadId:ie,isLocalOnly:!0}),(0,r.YS)((()=>{Us(i)}))))})),wa=(0,J.A)(((e,t,n)=>{if(!se&&!oe)return;t=t||Pn,d||n?Gi((n=>{wo(fa,{id:e.id,queryId:e.queryId,isSilent:t},n,se)})):wo(Wn,{id:e.id,queryId:e.queryId,threadId:ie,chatId:ne,isSilent:t});const i=document.querySelector(on);p.pz&&i&&i===document.activeElement&&P(i),jn({chatId:ne,isLocalOnly:!0}),(0,r.YS)((()=>{Us()}))})),ba=(0,J.A)((()=>{jn({chatId:ne,isLocalOnly:!0}),(0,r.YS)((()=>{Us()}))})),Ia=(0,J.A)((e=>{se&&(d?(Gi((t=>{wo(fa,{poll:e},t,se)})),$n()):(wo(Kn,{messageList:se,poll:e,isSilent:Pn}),$n()))})),Sa=(0,J.A)((e=>{if(d)Gi((t=>{fa({...e,isSilent:!0},t,se)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:i}=e;la(t,n,!0,void 0,i)}else ha(!0)})),Ma=(0,J.A)((()=>{const e=document.querySelector(on);if(!C||e!==document.activeElement)return jo(),$o(),void Go();e?.blur(),setTimeout((()=>{jo(),$o(),Go()}),100)}));(0,i.vJ)((()=>{Io&&yi("")}),[Io,yi,_i]);const Na=(0,J.A)((e=>{Mo(e,a.e0F)})),ka=(0,J.A)(((e=sn)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.L)(n,e))return void document.execCommand("delete",!1)}yi(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 i=n.textContent.length,o=document.createRange(),s=window.getSelection();o.setStart(n,i),o.setEnd(n,i),s.removeAllRanges(),s.addRange(o),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(Ai()))})),Ya=(0,J.A)((()=>{ka(a.e0F)})),Pa=(0,J.A)((()=>{Gn({chatId:ne,threadId:ie,type:"scheduled",noForumTopicPanel:!0})})),Fa=(0,J.A)((()=>{ii({forUserId:ne})})),Ta=(0,J.A)((()=>{const e=!Pn;ui({chatId:ne,isEnabled:e}),ei({localId:"silentPosting",icon:e?"mute":"unmute",message:pi(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})}));(0,i.vJ)((()=>{Oe&&C&&$o()}),[Oe,$o,C]),(0,i.vJ)((()=>{m&&(Ue?_o():setTimeout((()=>{Qo()}),200))}),[Ue,Qo,_o,m]);const xa=(0,U.A)((()=>Boolean(Ai())),[Ai]),Da=pe&&"webApp"===_t?.type&&!Y&&"thread"===ae,Ea=Da&&!xa&&!ts,[La,Ba]=(0,i.Kr)((()=>tn?.nextSendDate?["SlowModeWait",tn.nextSendDate]:pn?.activeUntil&&ki?["StealthModeActiveHint",pn.activeUntil]:[]),[ki,tn?.nextSendDate,pn?.activeUntil]),Ra=Ro||Vo||us||qo||ws||Ms||zo||Ri||ys||Ls||fs||Ea||_s||Boolean(ts)||_i.length>0||Ei,Oa=Ra&&!ze&&ki&&!Ri&&!Vo,Ua=(0,i.Kr)((()=>ts&&Mi<=600?"":Io?pi(ki?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):_e||Ze||(bn?pi("ComposerPlaceholderPaidMessage",{amount:(0,b.U)(pi,bn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):ce?.adminRights?.anonymous?pi("ComposerPlaceholderAnonymous"):ce?.isForum&&ce?.isForumAsMessages&&ie===s.l3?le?pi("ComposerPlaceholderTopic",{topic:le.title}):pi("ComposerPlaceholderTopicGeneral"):pi(Be?Pn?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder"))),[ts,_e,ce,Ze,Be,Io,ki,Pn,pi,le,ie,Mi,bn]);(0,i.vJ)((()=>{Ra?Tn?.():xn?.()}),[Ra,xn,Tn]);const{shouldRender:za,transitionClassNames:Ka}=(0,W.A)(Oa),ja=!(Hs!==Rt.Record||io&&me&&ao),Va=(0,J.A)((()=>{switch(Hs){case Rt.Forward:Dn?.();break;case Rt.Send:ma();break;case Rt.Record:ja?me?ao||ti({chatId:ne,messageListType:ae}):ei({message:mi("VoiceMessagesRestrictedByPrivacy",ce?.title)}):(as(!1),Zo());break;case Rt.Edit:zs();break;case Rt.Schedule:if(ts&&es(),!se)return;Gi((e=>{fa({},e,se,In?.id)}))}})),Ja=new Date;Ja.setSeconds(0),Ja.setMilliseconds(0);const $a=new Date;$a.setFullYear($a.getFullYear()+1);let qa="SendMessage";switch(Hs){case Rt.Forward:qa="Forward";break;case Rt.Edit:qa="Save edited message";break;case Rt.Record:qa=io?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Ga=(0,g.A)("Composer",!Ue&&"shown",Wo&&"hover-disabled",Ci&&"mounted",rn),Ha=(0,J.A)((e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const i=(0,o.mS)().customEmojis.byId[e.documentId];if(!i)return;if(!i.isFree&&!he&&!Se)return void Gs();const s=(0,S.Ay)((0,T.hB)(i));t=s.text,n=s.entities}wo(Kn,{text:t,entities:n,isReaction:!0}),oi()})),Wa=(0,J.A)((e=>{di({chatId:ne,threadId:ie,reaction:e}),oi()})),_a=(0,J.A)((e=>{ni({peerId:ne,storyId:oe,position:e,sendAsMessage:!0})})),Qa=(0,J.A)((()=>{const e=mn?void 0:a.tNZ;si({peerId:ne,storyId:oe,containerId:(0,c.$_)(ne,oe),reaction:e})})),Za=(0,J.A)((()=>{Gi((e=>{fa({},e,se)}))})),Xa=(0,J.A)((()=>{wo(Sa)})),er=(0,J.A)((()=>{wo(fa,{},a.NkL,se,In?.id)})),tr=(0,J.A)(((e,t,n)=>{Gi((i=>{wo(fa,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},i,se)}))})),nr=(0,J.A)(((e,t,n)=>{wo(Sa,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})})),ir=(0,J.A)((()=>{ci({chatId:ne,threadId:ie,effectId:void 0})})),or=(0,J.A)((()=>{li({})})),sr=(0,i.Kr)((()=>{switch(Hs){case Rt.Edit:return zs;case Rt.Schedule:return Za;default:return ma}}),[Hs,zs,ma]),ar=pe&&"commands"===_t?.type&&!Y&&!1!==Jt&&!ts,rr=Mn&&In?.emoticon,cr=Boolean(bn&&Hs===Rt.Send);return(0,$e.FD)("div",{className:Ga,children:[Ni&&io&&m&&(0,$e.Y)(vt,{isOpen:n!==ft.I.None,withQuick:n===ft.I.QuickFile||Si===ft.I.QuickFile,onHide:Fn,onFileSelect:Do,editingMessage:Y}),za&&!mo&&(0,$e.Y)(Ft.A,{topReactions:dn,allAvailableReactions:cn,onToggleReaction:Ha,isPrivate:!0,isReady:m,canBuyPremium:ln,isCurrentUserPremium:he,isInSavedMessages:Se,isInStoryViewer:ki,canPlayAnimatedEmojis:un,onShowMore:_a,className:Ka}),(0,$e.Y)(qe,{chatId:ne,threadId:ie,canShowCustomSendMenu:Ws,attachments:_i,getHtml:Ai,isReady:m,shouldSuggestCompression:Po,shouldForceCompression:Fo,shouldForceAsFile:To,isForCurrentMessageList:ue,isForMessage:Ni,shouldSchedule:!bn&&d,canSchedule:!bn,forceDarkTheme:ki,onCaptionUpdate:Eo,onSendSilent:nr,onSend:da,onSendScheduled:tr,onFileAppend:xo,onClear:Lo,onAttachmentsUpdate:Bo,onCustomEmojiSelect:Aa,onRemoveSymbol:Ya,onEmojiSelect:Na,editingMessage:Y,onSendWhenOnline:er,canScheduleUntilOnline:h&&!ss,paidMessagesStars:bn}),(0,$e.Y)(bt,{isOpen:He.isOpen,isQuiz:He.isQuiz,shouldBeAnonymous:Be,onClear:$n,onSend:Ia}),(0,$e.Y)(It,{isOpen:qo,onClose:Ho,chatId:ne,selectedSendAsId:qt,sendAsPeerIds:Yi,isCurrentUserPremium:he}),(0,$e.Y)(Ct,{isOpen:ws,filteredUsers:Ss,onInsertUserName:Is,onClose:bs}),(0,$e.Y)(ct,{isOpen:Ls,chatId:ne,withUsername:Boolean(Vi),botCommands:Rs,quickReplies:Os,getHtml:Ai,self:ut,quickReplyMessages:fn,onClick:ba,onClose:Bs}),(0,$e.FD)("div",{className:(0,g.A)("composer-wrapper",ki&&"with-story-tweaks",mo&&"is-need-premium"),children:[!mo&&(0,$e.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,$e.Y)("defs",{children:(0,$e.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,$e.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,$e.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,$e.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,$e.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,$e.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,$e.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"})]})]}),Ni&&(0,$e.FD)($e.FK,{children:[(0,$e.Y)(yt,{isOpen:Ms,botId:Ns,isGallery:ks,inlineBotResults:Fs,switchPm:Ys,switchWebview:Ps,loadMore:Ds,isSavedMessages:Se,canSendGifs:no,isCurrentUserPremium:he,onSelectResult:wa,onClose:Ts}),(0,$e.Y)(mt,{onClear:oa,shouldForceShowEditing:Boolean(js&&Y),chatId:ne,threadId:ie,messageListType:ae}),(0,$e.Y)(Yt,{chatId:ne,threadId:ie,getHtml:Ai,isDisabled:!so||Zi,isEditing:Boolean(Y)})]}),(0,$e.FD)("div",{className:(0,g.A)("message-input-wrapper",(0,D.y)(ut)),children:[Ni&&(0,$e.FD)($e.FK,{children:[Da&&(0,$e.Y)(rt,{isOpen:Ea,text:_t.text,isDisabled:Boolean(ts),onClick:pa}),ar&&(0,$e.Y)(et.A,{className:(0,g.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===Jt,color:"translucent",onActivate:ga,ariaLabel:"Open bot command keyboard",children:(0,$e.Y)(Qe.A,{name:"bot-commands-filled"})}),Pi&&$t&&(0,$e.Y)(st.A,{round:!0,color:"translucent",onClick:qo?Ho:Ma,ariaLabel:mi("SendMessageAsTitle"),className:(0,g.A)("send-as-button","composer-action-button",Wi.current&&"appear-animation"),children:(0,$e.Y)(Et.A,{peer:$t,size:"tiny"})})]}),(!Io||no||to)&&!mo&&!On&&(0,$e.Y)(Mt.A,{chatId:ne,threadId:ie,isMobile:C,isReady:m,isSymbolMenuOpen:Vo,openSymbolMenu:Jo,closeSymbolMenu:$o,canSendStickers:to,canSendGifs:no,isMessageComposer:Ni,onGifSelect:ya,onStickerSelect:Ca,onCustomEmojiSelect:va,onRemoveSymbol:ka,onEmojiSelect:Mo,closeBotCommandMenu:jo,closeSendAsMenu:Ho,isSymbolMenuForced:Fi,canSendPlainText:!Io,inputCssSelector:on,idPrefix:e,forceDarkTheme:ki}),(0,$e.Y)(wt.A,{ref:gi,id:an,editableInputId:sn,customEmojiPrefix:e,isStoryInput:ki,chatId:ne,canSendPlainText:!Io,threadId:ie,isReady:m,isActive:!Zi,getHtml:Ai,placeholder:Ua,timedPlaceholderDate:Ba,timedPlaceholderLangKey:La,forcedPlaceholder:xs,canAutoFocus:m&&ue&&!Zi&&Ni,noFocusInterception:Zi,shouldSuppressFocus:C&&Vo,shouldSuppressTextFormatter:us||ws||Ms,onUpdate:yi,onSend:sr,onSuppressedFocus:$o,onFocus:Li,onBlur:Bi,isNeedPremium:mo,messageListType:ae}),Ni&&(0,$e.FD)($e.FK,{children:[Vt&&Boolean(Ns)&&(0,$e.Y)(Tt.A,{color:"gray"}),(0,$e.Y)(xt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(xa),direction:"inverse",name:"slideFadeAndroid",children:!xa&&(0,$e.FD)($e.FK,{children:[Be&&(0,$e.Y)(xt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(Pn),children:(0,$e.Y)(st.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Ta,ariaLabel:pi(Pn?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),children:(0,$e.Y)(Qe.A,{name:Pn?"mute":"unmute"})})}),Xe&&(0,$e.Y)(st.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:Pa,ariaLabel:pi("AriaComposerOpenScheduled"),children:(0,$e.Y)(Qe.A,{name:"schedule"})}),qs&&(0,$e.Y)(st.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Fa,children:(0,$e.Y)(Qe.A,{name:"gift"})}),Boolean(We)&&!ts&&!Y&&(0,$e.Y)(et.A,{className:(0,g.A)("composer-action-button",Ro&&"activated"),round:!0,color:"translucent",onActivate:Oo,ariaLabel:pi("AriaComposerBotKeyboard"),children:(0,$e.Y)(Qe.A,{name:"bot-command"})})]})})]}),ts&&Boolean(ns)&&(0,$e.Y)("span",{className:"recording-state",children:(0,f.JW)(ns-os.current)}),!mo&&(0,$e.Y)(nt,{chatId:ne,threadId:ie,editingMessage:Y,canEditMedia:zi,isButtonVisible:!ts,canAttachMedia:io,canAttachPolls:oo,canSendPhotos:uo,canSendVideos:lo,canSendDocuments:ho,canSendAudios:co,onFileSelect:Do,onPollCreate:Jn,isScheduled:d,attachBots:Ni?Qt:void 0,peerType:Zt,shouldCollectDebugLogs:hn,theme:en,onMenuOpen:Oi,onMenuClose:Ui,messageListType:ae,paidMessagesStars:bn}),Ni&&Boolean(We)&&(0,$e.Y)(at,{messageId:We,isOpen:Ro,onClose:Uo}),Ni&&Jt&&(0,$e.Y)(it,{isOpen:zo,botCommands:Jt,onClose:jo}),(0,$e.Y)(pt.A,{chatId:ne,isOpen:fs,onCustomEmojiSelect:As,addRecentCustomEmoji:Xn,onClose:vs},`custom-emoji-tooltip-${sn}`),(0,$e.Y)(St,{chatId:ne,threadId:ie,isOpen:ys,onStickerSelect:Ca,onClose:Cs},`sticker-tooltip-${sn}`),(0,$e.Y)(At.A,{isOpen:us,emojis:ms,customEmojis:ps,addRecentEmoji:Hn,addRecentCustomEmoji:Xn,onEmojiSelect:gs,onCustomEmojiSelect:gs,onClose:hs},`emoji-tooltip-${sn}`)]})]}),gn&&ts&&(0,$e.FD)(st.A,{className:(0,g.A)("view-once",ss&&"active"),round:!0,color:"secondary",ariaLabel:mi("Chat.PlayOnceVoiceMessageTooltip"),onClick:rs,children:[(0,$e.Y)(Qe.A,{name:"view-once"}),(0,$e.Y)(Qe.A,{name:"one-filled"})]}),ts&&(0,$e.Y)(st.A,{round:!0,color:"danger",className:"cancel",onClick:Xo,ariaLabel:"Cancel voice recording",children:(0,$e.Y)(Qe.A,{name:"delete"})}),ki&&!ts&&(0,$e.FD)(st.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:Qa,onContextMenu:ta,onMouseDown:na,ariaLabel:mi("AccDescrLike"),ref:vi,children:[mn&&(0,$e.Y)(Bt.A,{containerId:(0,c.$_)(ne,oe),reaction:mn,withEffectOnly:$i},(0,c.Jj)(mn)),(!mn||$i)&&(0,$e.Y)(Qe.A,{name:"heart",className:(0,g.A)($i&&"story-reaction-heart")})]}),(0,$e.FD)(st.A,{ref:is,round:!0,color:"secondary",className:(0,g.A)(Hs,"main-button",!m&&"not-ready",ts&&"recording"),disabled:ja,allowDisabledClick:!0,noFastClick:!0,ariaLabel:mi(qa),onClick:Va,onContextMenu:Hs===Rt.Send&&Ws?Qs:void 0,children:[(0,$e.Y)(Qe.A,{name:"send"}),(0,$e.Y)(Qe.A,{name:"microphone-alt"}),Dn&&(0,$e.Y)(Qe.A,{name:"forward"}),Ni&&(0,$e.Y)(Qe.A,{name:"schedule"}),Ni&&(0,$e.Y)(Qe.A,{name:"check"}),(0,$e.Y)(st.A,{className:(0,g.A)("paidStarsBadge",cr&&"visible"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,$e.FD)("div",{className:"paidStarsBadgeText",children:[(0,$e.Y)(Qe.A,{name:"star",className:(0,g.A)("star-amount-icon",rn)}),(0,$e.Y)(Dt.A,{ref:fi,text:pi.number(fo)})]})})]}),rr&&(0,$e.Y)("span",{className:"effect-icon",onClick:ir,children:(0,E.A)(rr)}),In&&Nn&&(0,$e.Y)(Pt.A,{shouldPlay:kn,effect:In,onStop:or}),Ws&&(0,$e.Y)(gt.A,{isOpen:_s,canSchedule:!bn&&Ni&&!ss,canScheduleUntilOnline:h&&!ss,onSendSilent:Se?void 0:Xa,onSendSchedule:d?void 0:Za,onSendWhenOnline:er,onRemoveEffect:ir,onClose:Zs,onCloseAnimationEnd:Xs,isSavedMessages:Se,chatId:ne,withEffects:Mn,hasCurrentEffect:Boolean(In),effectReactions:Sn,allAvailableReactions:cn,onToggleReaction:Wa,isCurrentUserPremium:he,isInSavedMessages:Se,isInStoryViewer:ki,canPlayAnimatedEmojis:un}),Hi,(0,$e.Y)(Lt.A,{isOpen:En,onClose:vo,userName:ce?(0,l.F9)(pi,ce):void 0,messagePriceInStars:bn||0,messagesCount:go,shouldAutoApprove:yo,setAutoApprove:Co,confirmHandler:Ao})]})})))},59816:(e,t,n)=>{n.d(t,{A:()=>P});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(87357),c=n(95807),d=n(39751),l=n(90709),u=n(9716),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,i.ph)((({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:d})=>{const{sendStoryReaction:v}=(0,o.ko)(),y=(0,i.li)(),[C,w]=(0,i.J0)(1.5*h.$),{peerId:b,id:I,views:S}=e,{reactions:M}=S||{},{reaction:N,isDark:k,isFlipped:Y}=t,P=!(0,u.L8)(b),F=`${(0,l.$_)(b,I)}-${n}-${d?"preview":"viewer"}`,T=(0,i.Kr)((()=>M?.find((e=>(0,l.a0)(e.reaction,N)))?.count),[N,M]),x=!d&&Boolean(T)&&P,D=(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)&&D()}),[T]),(0,g.A)(y,D);const E=(0,p.A)((()=>{v({peerId:b,storyId:I,containerId:F,reaction:N})}));return(0,A.FD)("div",{ref:y,className:(0,r.A)(k?"eic2vQ8c":"_7esBA3m",s),style:(0,c.A)(a,`--custom-emoji-size: ${C}px`),onClick:E,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",Y&&"furSXGdL")}),Boolean(C)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",x&&"mFTLUHm2"),reaction:N,containerId:F,size:C,effectSize:4*C,shouldPause:d,shouldLoop:!d}),x&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})}));var C=n(61433),w=n(29807),b=n(48894);const I=e=>Boolean("en-US"===navigator.language)?`${Math.round(9*e/5+32)}°F`:`${Math.round(e)}°C`;var S=n(87412);const M=(0,i.ph)((0,o.EK)(((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}}))((({mediaArea:e,className:t,style:n,restrictedEmoji:o,isPreview:s})=>{const d=(0,i.li)(),[l,u]=(0,i.J0)(0),{temperatureC:h,color:m}=e,f=(0,b.Bz)(m),v=(0,b.vG)(m),y=(0,p.A)((e=>{if(!d.current)return;const t=d.current,n=t.clientHeight,i=Math.round(.7*n);u(i);const o=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${i}px`,"font-size":n/32+"rem"})};if(e)return o;(0,a.RK)(o)}));return(0,i.Nf)((()=>{(0,a.gm)((()=>y(!0)))}),[]),(0,g.A)(d,(()=>y())),(0,A.Y)("div",{ref:d,className:(0,r.A)("KBjMtRUS",t),style:(0,c.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[o&&(0,A.Y)(S.A,{documentId:o.id,size:l,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},o.id),(0,A.Y)("p",{className:"_ke1UBIl",children:I(h)})]})})}))),N=9/16,k=new Set(["channelPost","uniqueGift"]);function Y(e,t){const{x:n,y:i,width:o,height:s,rotation:a,radius:r}=e.coordinates;let d="";if(t&&r&&t>0){const e=t*(o/100),n=t*(s/100);d=Math.min(e,n)*(r/100)+"px"}return(0,c.A)(`left: ${n}%`,`top: ${i}%`,`width: ${o}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,d&&`border-radius: ${d}`)}const P=(0,i.ph)((({story:e,isActive:t,className:n,isStoryPlaying:c})=>{const{openMapModal:l,openUniqueGiftBySlug:u,focusMessage:h,closeStoryViewer:m,openUrl:p}=(0,o.ko)(),g=(0,i.li)(),[f,C]=(0,i.J0)(0),w=(0,d.A)();(0,i.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<N?e.clientHeight*N:e.clientWidth,i=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)((()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${i}px`)}))}),[t,w]);const b=e.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!t&&"_5HkplWee",n),ref:g,children:b?.map(((n,i)=>{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:i,isPreview:!t,className:v,style:Y(n)},`${n.type}-${i}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:Y(n,f),isPreview:!t||c},`${n.type}-${i}`);default:return}}))})}))},60138:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,i.vJ)((()=>(0,o.yu)(t)),[t])}},61097:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(90709),o=n(84051),s=n(66644),a=n(67054),r=n(87679),c=n(41074),d=n(17712);const l=.1;let u=-1;function h(e,t){return function(e,t=!1){const n=(0,o.li)(),i=(0,o.Kr)((()=>(0,a.A)(c.bP,++u)),[]),h=(0,o.li)(),m=(0,d.A)((async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)((()=>{e.width=n.width,e.height=n.height,h.current=e.transferControlToOffscreen();const o=Math.ceil(Math.min(n.width,n.height)*l);(0,c.M1)({name:"offscreen-canvas:blurThumb",args:[h.current,t,o],transferables:[h.current]},i)}))}));return(0,o.Nf)((()=>{if(!e||t||h.current)return;const i=n.current;i&&m(i,e)}),[m,t,e]),n}(e?"string"==typeof e?e:(0,i.VD)(e):void 0,t)}},63744:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(84051),o=n(13439),s=n(29807),a=n(71331),r=n(87357),c=n(14),d=n(59030),l=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,i.ph)((0,o.EK)(((e,{chatId:t})=>{const n=(0,s.hds)(e,t),i=(0,a.mD)(e,t);return{groupCall:i,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==i?.id&&Boolean(i?i.participantsCount>0&&i.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}}))((({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,o.ko)(),g=(0,d.A)(),f=(0,i.hb)((()=>{p({chatId:e})}),[p,e]),v=s?.participants,A=(0,i.Kr)((()=>{if(!v)return[];const e=(0,o.mS)().users.byId,t=(0,o.mS)().chats.byId;return Object.values(v).slice(0,3).map((({id:n})=>e[n]||t[n])).filter(Boolean)}),[v]),y=(0,c.A)(s?.participantsCount,!0),C=(0,c.A)(A,!0),w=Boolean(s&&t),{ref:b,shouldRender:I}=(0,l.A)({isOpen:w,onStateChange:a});if(I)return(0,m.FD)("div",{ref:b,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")})]})})))},63988:(e,t,n)=>{n.d(t,{D7:()=>d,aG:()=>r,gs:()=>a,tF:()=>c});var i=n(16581),o=n(83414),s=n(672);function a(e,t,n,i=!1){return(0,s.A)((t=>{t(e())}),t,n,i)}function r(e,t,n=!1){const i=a((()=>e()),[e],t,n);return(0,o.A)(i,[i,e],!0)}function c(e,t,n,o=!1,s=!1){return(0,i.A)((t=>{t(e())}),t,n,o,s)}function d(e,t,n=!1,i=!1){const s=c((()=>e()),[e],t,n,i);return(0,o.A)(s,[s,e],!0)}},64154:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(37836);const a=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:d,text:l}=r||{};return(0,i.vJ)((()=>{t&&n&&!l&&void 0===d&&s&&function(e,t,n){const i=a.get(n)||new Map,s=i.get(e)||[];s.includes(t)||(s.push(t),i.set(e,s),a.set(n,i),(0,o.ko)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),c()}(t,n,s)}),[t,l,d,n,s]),t&&n?{isPending:d,translatedText:l}:{isPending:!1,translatedText:void 0}}const c=(0,s.nF)((function(){const{translateMessages:e}=(0,o.ko)();let t=!1;a.forEach(((n,i)=>{n.forEach(((n,o)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:o,messageIds:s,toLanguageCode:i}),function(e,t,n){const i=a.get(n);if(!i?.size)return void a.delete(n);const o=i.get(e);if(!o?.length)return void i.delete(e);const s=o.filter((e=>!t.includes(e)));if(!s?.length)return i.delete(e),void(i.size||a.delete(n));i.set(e,s)}(o,s,i)}))})),t&&c()}),500)},64520:(e,t,n)=>{n.d(t,{B:()=>a,d:()=>s});var i=n(31481),o=n(19926);function s(e,t){const{appConfig:n}=e;if(!n)return i.dR$[t][0];const s=(0,o.g2)(e),{limits:a}=n,r=a[t]?.[s?1:0]??i.dR$[t][s?1:0];return"dialogFilters"===t?r+1:r}function a(e,t){const{appConfig:n}=e;if(!n)return i.dR$[t][1];const{limits:o}=n;return o[t][1]}},65240:(e,t,n)=>{n.d(t,{Ay:()=>E});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(90709),c=n(53827),d=n(87357),l=n(50442),u=n(17663),h=n(78376),m=n(91525),p=n(4961),g=n(43874),f=n(88792),v=n(71533),A=n(17712),y=n(62587),C=n(69419),w=n(59030),b=n(50680),I=n(64493),S=n(96530),M=n(35913),N=n(4438),k=n(18276),Y=n(20021);const P=window.matchMedia("(max-width: 375px)"),F=window.matchMedia("(max-width: 410px)");function T(e,t,n,i,o,s,a,r,c,d,l){const{title:h,performer:g,fileName:f}=t,v=i||o>0&&o<1,{isRtl:A}=e;return(0,Y.FD)("div",{className:"content",children:[(0,Y.Y)("p",{className:"title",dir:"auto",title:h,children:(0,p.A)(h||f)}),v&&(0,Y.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,Y.Y)("span",{className:"duration with-seekline",dir:"auto",children:(0,u.QO)(n*o,n)}),D(o,s,a)]}),!v&&r&&(0,Y.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[d?`${(0,m.zV)(t.size*d)} / `:void 0,(0,m.zV)(t.size)]}),!v&&!r&&(0,Y.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,Y.Y)("span",{className:"duration",dir:"auto",children:(0,u.QO)(n)}),g&&(0,Y.FD)(Y.FK,{children:[(0,Y.Y)("span",{className:"bullet",children:""}),(0,Y.Y)("span",{className:"performer",dir:"auto",title:g,children:(0,p.A)(g)})]}),Boolean(c)&&(0,Y.FD)(Y.FK,{children:[(0,Y.Y)("span",{className:"bullet",children:""}),(0,Y.Y)(S.A,{className:"date",onClick:l,children:(0,u.fS)(e,1e3*c,!0)})]})]})]})}function x(e,t,n,i,o,s,r,c,l,h,m,p){return(0,Y.FD)("div",{className:"content",children:[(0,Y.FD)("div",{className:"waveform-wrapper",children:[(0,Y.Y)("div",{className:"waveform",draggable:!1,ref:t,children:(0,Y.Y)("canvas",{ref:n})}),h&&(0,Y.FD)(I.A,{onClick:()=>{(c||l)&&m?m(!r):s||h()},children:[(0,Y.Y)(k.A,{name:c||l?"down":"transcribe",className:(0,d.A)("transcribe-icon",(c||l)&&!r&&"transcribe-shown")}),s&&(0,Y.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,Y.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,Y.Y)("p",{className:(0,d.A)("voice-duration",p!==a.d9.OneTimeModal&&o&&"unread"),dir:"auto",children:0===i||1===i?(0,u.QO)(e.duration):(0,u.QO)(e.duration*i)})]})}function D(e,t,n){return(0,Y.FD)("div",{className:"seekline",ref:n,children:[t.map((({start:e,end:t})=>(0,Y.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`}))),(0,Y.Y)("span",{className:"seekline-play-progress",children:(0,Y.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,Y.Y)("span",{className:"seekline-thumb",children:(0,Y.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const E=(0,i.ph)((({theme:e,message:t,senderTitle:n,uploadProgress:m,origin:E,date:L,noAvatars:B,className:R,isSelectable:O,isSelected:U,isDownloading:z,isTranscribing:K,isTranscriptionHidden:j,isTranscribed:V,isTranscriptionError:J,canDownload:$,canTranscribe:q,autoPlay:G,onHideTranscription:H,onPlay:W,onPause:_,onReadMedia:Q,onCancelUpload:Z,onDateClick:X})=>{const{cancelMediaDownload:ee,downloadMedia:te,transcribeAudio:ne,openOneTimeMediaModal:ie}=(0,o.ko)(),{content:{audio:oe,voice:se,video:ae},isMediaUnread:re}=t,ce=oe||(0,r.Rp)(t),de=se||ae||ce,le=se||ae,ue=Boolean(se||ae),he=(0,i.li)(!1),me=(0,i.li)(),pe=(0,w.A)(),{isRtl:ge}=pe,{isMobile:fe}=(0,g.Ay)(),[ve,Ae]=(0,i.J0)(!1),ye=ve||!0,Ce=(0,r.VO)(de,"pictogram"),we=(0,y.A)(Ce,!1,s.qZ.BlobUrl),be=(0,r.G5)(t),Ie=E===a.d9.OneTimeModal,Se=ue?be?"oneTimeVoice":"voice":"audio",Me=(0,y.A)((0,r.VO)(de,"inline"),!ye,(0,r.Cz)(de,"inline")),{loadProgress:Ne}=(0,C.A)((0,r.VO)(de,"download"),!z,(0,r.Cz)(de,"download")),ke=(0,A.A)((()=>{Ae(!0),W?.(t.id,t.chatId)})),Ye=(0,A.A)((()=>{Ae(!1)})),{isBuffered:Pe,bufferedRanges:Fe,bufferingHandlers:Te,checkBuffering:xe}=(0,v.A)(),De=Ie,{isPlaying:Ee,playProgress:Le,playPause:Be,setCurrentTime:Re,duration:Oe}=(0,f.A)((0,c.dj)(t),(0,r.Fk)(t),Se,Me,Te,void 0,xe,Boolean(ve||G),ke,Ye,(0,r.Nb)(t)||be,void 0,_,De,be&&!Ie),Ue=1-Le,ze=(0,r.Ie)(t),Ke=be&&Ie,je=function(e,t,n=0,o=!1,s=!1,a=!1,r=!1){const c=(0,i.li)(),{data:d,peak:l}=(0,i.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:i,MAX_SPIKES:o}=function(e,t){return{MIN_SPIKES:e?P.matches?16:20:25,MAX_SPIKES:e?P.matches?35:t&&F.matches?40:45:75}}(a,s),r=Math.min(n/10,1),c=Math.round(i+(o-i)*r);return function(e,t){let n=0;const i=new Array(t),o=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*o),c=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;i[r]=c,n<c&&(n=c)}return{data:i,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const i=Array(n),o=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=o[t]+(o[t+1]<<8);i[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=o[s]+(o[s+1]<<8);return i[n-1]=r>>a&31,i}(new Uint8Array(e)),c)}),[a,t,s])||{};return(0,i.Nf)((()=>{const t=c.current;t&&d&&void 0!==l&&function(e,t,n,{peak:i,fillStyle:o,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:o;const c=Math.max(2,e/Math.max(1,i)*23);!function(e,t,n,i,o,s){2<2*s&&(s=1),o<2*s&&(s=o/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-o,s),e.arcTo(t+2,n-o,t,n-o,s),e.arcTo(t,n-o,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+c)/2,0,c,1),r.fill()}))}(t,d,r?1-n:n,{peak:l,fillStyle:o?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:o?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[o,l,n,d,e,r]),c}(e,le,!re||ze||Ke?Le:1,ze,!B,fe,Ke),Ve=Ee||Le>0&&Le<1;(0,i.vJ)((()=>{Ae(Ee)}),[Ee]);const Je=ve&&!Pe,{isUploading:$e,isTransferring:qe,transferProgress:Ge}=(0,r.LK)(m||Ne,Je||z,void 0!==m),{shouldRender:He,transitionClassNames:We}=(0,b.A)(qe),_e=He&&(Je||$e),Qe=(0,A.A)((()=>{if($e)Z?.();else{if(be)return ie({message:t}),void Q?.();Ee||W?.(t.id,t.chatId),(0,o.ko)().setAudioPlayerOrigin({origin:E}),Ae(!ve),Be()}}));(0,i.vJ)((()=>{Q&&re&&Ee&&Q()}),[Ee,re,Q]);const Ze=(0,A.A)((()=>{z?ee({media:de}):te({media:de,originMessage:t})})),Xe=(0,A.A)((e=>{if(he.current&&me.current){const{width:t,left:n}=me.current.getBoundingClientRect(),i=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Re(Math.max(Math.min(Oe*((i-n)/t),Oe-.1),.001))}})),et=(0,A.A)((e=>{e instanceof MouseEvent&&2===e.button||(he.current=!0,Xe(e))})),tt=(0,A.A)((()=>{he.current=!1})),nt=(0,A.A)((()=>{X(t)})),it=(0,A.A)((()=>{ne({chatId:t.chatId,messageId:t.id})}));function ot(){if(ue)return n||"Voice";const{title:e,fileName:t}=ce;return e||t}function st(){if(ue)return(0,Y.Y)("div",{className:"meta",dir:ge?"rtl":void 0,children:(0,u.QO)((se||ae).duration)});const{performer:e}=ce;return(0,Y.FD)("div",{className:"meta",dir:ge?"rtl":void 0,children:[(0,u.QO)(Oe),(0,Y.Y)("span",{className:"bullet",children:""}),e&&(0,Y.Y)("span",{className:"performer",title:e,children:(0,p.A)(e)}),e&&n&&(0,Y.Y)("span",{className:"bullet",children:""}),n&&(0,Y.Y)("span",{title:n,children:(0,p.A)(n)})]})}(0,i.vJ)((()=>{if(me.current&&Ve&&!Ie)return(0,l.wJ)(me.current,{onCapture:et,onRelease:tt,onClick:tt,onDrag:Xe})}),[Ve,et,Xe,tt,Ie]);const at=(0,d.A)("Audio",R,Ie&&"non-interactive",E===a.d9.Inline&&"inline",ze&&E===a.d9.Inline&&"own",(E===a.d9.Search||E===a.d9.SharedMedia)&&"bigger",U&&"audio-is-selected"),rt=["toogle-play-wrapper"];_e?rt.push("loading"):rt.push(Ee?"pause":"play");const ct=(0,d.A)("content",Ve&&"with-seekline");function dt(){return(0,Y.FD)("div",{className:ct,children:[(0,Y.FD)("div",{className:"content-row",children:[(0,Y.Y)("p",{className:"title",dir:"auto",title:ot(),children:(0,p.A)(ot())}),(0,Y.Y)("div",{className:"message-date",children:Boolean(L)&&(0,Y.Y)(S.A,{className:"date",onClick:nt,children:(0,u.be)(pe,1e3*L)})})]}),Ve&&(0,Y.FD)("div",{className:"meta search-result",dir:ge?"rtl":void 0,children:[(0,Y.Y)("span",{className:"duration with-seekline",dir:"auto",children:Le<1&&(0,u.QO)(Oe*Le,Oe)}),D(Le,Fe,me)]}),!Ve&&st()]})}return(0,Y.FD)("div",{className:at,dir:pe.isRtl?"rtl":"ltr",children:[O&&(0,Y.Y)("div",{className:"message-select-control no-selection",children:U&&(0,Y.Y)(k.A,{name:"select"})}),(0,Y.FD)("div",{className:(0,d.A)(...rt),children:[(0,Y.FD)(I.A,{round:!0,ripple:!fe,size:"smaller",className:"toggle-play",color:we?"translucent-white":"primary",ariaLabel:Ee?"Pause audio":"Play audio",onClick:Qe,isRtl:pe.isRtl,backgroundImage:we,nonInteractive:Ie,children:[!Ie&&(0,Y.Y)(k.A,{name:"play"}),!Ie&&(0,Y.Y)(k.A,{name:"pause"}),Ie&&(0,Y.Y)(N.A,{className:"flame",tgsUrl:h.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),be&&!Ie&&(0,Y.Y)(k.A,{name:"view-once"})]}),He&&(0,Y.Y)("div",{className:(0,d.A)("media-loading",We,_e&&"interactive"),children:(0,Y.Y)(M.A,{progress:Ge,transparent:!0,withColor:!0,size:"m",onClick:_e?Qe:void 0,noCross:!_e})}),Ie&&!He&&(0,Y.Y)("div",{className:(0,d.A)("media-loading"),children:(0,Y.Y)(M.A,{progress:Le,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ce&&$&&!$e&&(0,Y.Y)(I.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:z?"Cancel download":"Download",onClick:Ze,children:(0,Y.Y)(k.A,{name:z?"close":"arrow-down"})}),E===a.d9.Search&&dt(),E!==a.d9.Search&&ce&&T(pe,ce,Oe,Ee,Le,Fe,me,z||$e,L,Ge,X?nt:void 0),E===a.d9.SharedMedia&&le&&dt(),(E===a.d9.Inline||Ie||V)&&le&&x(le,me,je,be?Ue:Le,re,K,j,V,J,q?it:void 0,H,E)]})}))},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991:(e,t,n)=>{n.d(t,{Y:()=>u,c:()=>h});var i=n(84051),o=n(31481),s=n(66644),a=n(19822),r=n(39761),c=n(96454),d=n(95704);const l=100;function u(e,t,n){return(0,i.vJ)((()=>{if(!t||!e.current)return;const i=g(),o=e.current;if(!c.Yw||!n||!i?.isTypeSupported(n))return;const u=new i;function h(){if(!t||!n)return;const e=u.addSourceBuffer(n),i=(0,d.h)(t);e.addEventListener("updateend",(function(){i.next().then((({value:t,done:n})=>{"open"===u.readyState&&(n?p(u):m(e,t))}))})),i.next().then((({value:t,done:n})=>{n||"open"!==u.readyState||((0,s.RK)((()=>{o.style.display="block",setTimeout((()=>{(0,s.RK)((()=>{(0,a.ZM)(o,{opacity:"1"})}))}),l)})),m(e,t))}))}return u.addEventListener("sourceopen",h,{once:!0}),(0,s.RK)((()=>{(0,a.ZM)(o,{display:"none",opacity:"0"}),o.src=URL.createObjectURL(u)})),()=>{(0,s.RK)((()=>{const e=o.src;(0,r.A)(o),u.removeEventListener("sourceopen",h),"open"===u.readyState&&p(u),URL.revokeObjectURL(e)}))}}),[n,t,e]),h(n)}function h(e){return!(!c.Yw||!e)&&Boolean(g()?.isTypeSupported(e))}function m(e,t){try{e.appendBuffer(t)}catch(e){o.Oig&&console.warn("[Stream] failed to append buffer",e)}}function p(e){try{e.endOfStream()}catch(e){o.Oig&&console.warn("[Stream] failed to end stream",e)}}function g(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},67054:(e,t,n)=>{function i(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>i})},68153:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},69419:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(23174),s=n(29807),a=n(96454),r=n(58554),c=n(37836),d=n(63527),l=n(30857),u=n(14745);const h=.75,m=1500,p=500;function g(e,t=!1,n=o.qZ.BlobUrl,g,f=!1){const v=e?r.Ih(e):void 0,A=a.Uz&&n===o.qZ.Progressive,y=(0,l.A)(),C=(0,d.A)(s.nIz),w=(0,u.A)(),[b,I]=(0,i.J0)(v&&!A?1:0),S=(0,i.li)(),M=(0,i.Kr)((()=>(0,c.nF)((e=>{S.current&&(!g||Date.now()-S.current>g)&&I(e)}),p,!0)),[g]);return(0,i.vJ)((()=>{!t&&e&&(v?A&&setTimeout((()=>{I(h)}),m):(I(0),S.current&&r.ch(M),S.current=Date.now(),r.hd(e,n,f,M,w).then((()=>{const e=Date.now()-S.current;S.current=void 0,!g||e>=g?y():setTimeout(y,g-e)}))))}),[t,e,v,n,A,g,M,f,w,C]),(0,i.vJ)((()=>{t&&S.current&&(r.ch(M),I(0),S.current=void 0)}),[M,t]),(0,i.vJ)((()=>()=>{e&&r.Cn(e,w)}),[w,e]),{mediaData:v,loadProgress:b}}},70195:(e,t,n)=>{n.d(t,{A:()=>j});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(29807),c=n(96454),d=n(87357),l=n(50442),u=n(79824),h=n(4961),m=n(54699),p=n(17712),g=n(59030),f=n(73767),v=n(23174),A=n(58554),y=n(41036),C=n(21849),w=n(34431),b=n(9716),I=n(14242),S=n(35049),M=n(43874),N=n(45470),k=n(37661),Y=n(62587),P=n(83057),F=n(65843),T=n(57474),x=n(18276),D=n(20021);const E=(0,i.ph)((({chat:e,user:t,photo:n,isSavedMessages:o,isSavedDialog:s,canPlayVideo:r,onClick:l})=>{const u=(0,i.li)(),m=(0,g.A)(),{isMobile:p}=(0,M.Ay)(),f=t&&(0,a.PL)(t),v=e&&(0,a.kE)(e.id),A=e&&(0,a.Qe)(e.id),y=t||e,C=y&&!o&&!f&&!v&&!A,{isVideo:w}=n||{},E=(!n||n.id===y.avatarPhotoId)&&(0,a.cP)(y,"normal"),L=C&&n&&!E&&(0,a.rI)(n,"pictogram"),B=(0,Y.A)(L||E),R=C&&n&&!w&&(0,a.mU)(n),O=(0,Y.A)(R),U=C&&n&&w&&(0,a.Pg)(n),z=(0,Y.A)(U)||O,[K,j]=(0,k.A)(),V=Boolean(z&&(!w||K)),J=(0,P.A)(V),$=C&&!V&&!B&&n?.thumbnail?.dataUri,q=(0,N.A)(n?.thumbnail?.dataUri,!$,p&&!c.QH),G=n||B||$;(0,i.vJ)((()=>{u.current&&!r&&(u.current.currentTime=0)}),[r]);const H=(0,i.Kr)((()=>o?s?"my-notes":"avatar-saved-messages":f?"avatar-deleted-account":v?"reply-filled":A?"author-hidden":void 0),[A,f,s,v,o]);let W;if(H)W=(0,D.Y)(x.A,{name:H,role:"img"});else if(G)W=(0,D.FD)(D.FK,{children:[$?(0,D.Y)("canvas",{ref:q,className:"thumb"}):(0,D.Y)("img",{src:B,draggable:!1,className:"thumb",alt:""}),n&&(w?(0,D.Y)(F.A,{canPlay:r,ref:u,src:z,className:(0,d.A)("avatar-media",J),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:j}):(0,D.Y)("img",{src:z,className:(0,d.A)("avatar-media",J),alt:""}))]});else if(t){const e=(0,a.Yg)(t);W=e?(0,I.Qh)(e,2):void 0}else if(e){const t=(0,a.Js)(m,e);W=t&&(0,I.Qh)(t,(0,b.L8)(e.id)?2:1)}else W=(0,D.Y)("div",{className:"spinner-wrapper",children:(0,D.Y)(T.A,{color:"white"})});const _=(0,d.A)("ProfilePhoto",(0,S.y)(y),o&&"saved-messages",A&&"anonymous-forwards",f&&"deleted-account",v&&"replies-bot-account",!o&&!G&&"no-photo");return(0,D.Y)("div",{className:_,onClick:G?l:void 0,children:"string"==typeof W?(0,h.A)(W,["hq_emoji"]):W})}));var L=n(38102);const B="Wm9Ygb23",R="nflKKT3R",O="tFkRrvxe",U="GBGLnrA7",z="ZZRcBh8v",K="cpyXyZDl",j=(0,i.ph)((0,o.EK)(((e,{peerId:t})=>{const n=(0,r.mBe)(e,t),i=(0,r.K0y)(e,t),o=(0,r.hds)(e,t),s=(0,r.IVq)(e,t),{mediaIndex:a,chatId:c}=(0,r.nTw)(e).mediaViewer,d=o?.isForum,{threadId:l}=(0,r.Xf0)(e)||{},u=d&&l?(0,r.S0q)(e,t,l):void 0,h=(n||o)?.emojiStatus;return{user:n,userStatus:i,chat:o,mediaIndex:a,avatarOwnerId:c,emojiStatusSticker:h?e.customEmojis.byId[h.documentId]:void 0,emojiStatusSlug:"collectible"===h?.type?h.slug:void 0,profilePhotos:s,...u&&{topic:u,messagesCount:(0,r.QbG)(e,t,l)}}}))((({forceShowSelf:e,canPlayVideo:t,user:n,userStatus:r,chat:b,mediaIndex:I,avatarOwnerId:S,topic:M,messagesCount:N,emojiStatusSticker:k,emojiStatusSlug:Y,profilePhotos:P,peerId:F})=>{const{openMediaViewer:T,openPremiumModal:x,openStickerSet:j,openPrivacySettingsNoticeModal:V,loadMoreProfilePhotos:J,openUniqueGiftBySlug:$}=(0,o.ko)(),q=(0,g.A)();(0,m.A)(n?6e4:void 0);const G=P?.photos||u.p,H=(0,f.A)(I),W=(0,f.A)(S),[_,Q]=(0,i.J0)(!0),Z=_?q.isRtl?"slideRtl":"slide":"none",[X,ee]=(0,i.J0)(0),te=G.length<=1||0===X,ne=G.length<=1||X===G.length-1;(0,i.vJ)((()=>{G.length-X<=3&&J({peerId:F})}),[X,F,G.length]),(0,i.vJ)((()=>{W&&void 0!==H&&void 0===I&&(Q(!1),ee(H))}),[I,H,W]),(0,i.vJ)((()=>{X>G.length&&(Q(!1),ee(Math.max(0,G.length-1)))}),[X,G.length]),function(e,t){(0,i.vJ)((()=>{e.slice(t,t+4).forEach((e=>{const t=(0,a.mU)(e);A.Ih(t)||A.hd(t,v.qZ.BlobUrl)}))}),[t,e])}(G,X);const ie=(0,p.A)((()=>{T({isAvatarView:!0,chatId:F,mediaIndex:X,origin:e?s.TQ.SettingsAvatar:s.TQ.ProfileAvatar})})),oe=(0,p.A)((()=>{Y?$({slug:Y}):F?x({fromUserId:F}):j({stickerSetInfo:k.stickerSetInfo})})),se=(0,p.A)((()=>{te||(Q(!0),ee(X-1))})),ae=(0,p.A)((()=>{ne||(Q(!0),ee(X+1))})),re=(0,p.A)((()=>{V({chatId:b.id,isReadDate:!1})}));if((0,i.vJ)((()=>{const e=document.querySelector(`.${U}`);if(e)return(0,l.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:c.TF?(e,t)=>t===l.ez.Right?(se(),!0):t===l.ez.Left&&(ae(),!0):void 0})}),[ae,se]),n||b)return M?(0,D.FD)("div",{className:"yzg267rr",children:[(0,D.Y)(L.A,{topic:M,size:120,className:"ZCxp0_t4",letterClassName:"lkfZNWOm",noLoopLimit:!0}),(0,D.Y)("h3",{className:"umOuiu3K",dir:q.isRtl?"rtl":void 0,children:(0,h.A)(M.title)}),(0,D.Y)("p",{className:"tLTzQ2ks",children:N?q("Chat.Title.Topic",N,"i"):q("lng_forum_no_messages")})]}):(0,D.FD)("div",{className:(0,d.A)("ProfileInfo"),dir:q.isRtl?"rtl":void 0,children:[(0,D.FD)("div",{className:U,children:[function(){const e=Math.max(G.length,P?.count||0);if(!G||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=X>=30?29:X;return(0,D.Y)("div",{className:"uyvKpR3B",children:t.map(((e,t)=>(0,D.Y)("span",{className:(0,d.A)("wB4yjvei",t===n&&"aZmp9FLh")})))})}(),!e&&P?.personalPhoto&&(0,D.Y)("div",{className:(0,d.A)(B,te&&O),children:(0,D.Y)("div",{className:R,children:q(P.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),e&&P?.fallbackPhoto&&(0,D.Y)("div",{className:(0,d.A)(B,(te||ne)&&O),children:(0,D.FD)("div",{className:R,onClick:function(){te&&(Q(!0),ee(G.length-1))},children:[!ne&&(0,D.Y)(C.A,{photo:P.fallbackPhoto,className:"R7w3H5eC",size:"mini"}),q(P.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,D.Y)(y.Ay,{activeKey:X,name:Z,children:function(e){const i=G.length>0?G[X]:void 0;return(0,D.Y)(E,{user:n,chat:b,photo:i,canPlayVideo:Boolean(e&&t),onClick:ie},X)}}),!te&&(0,D.Y)("button",{type:"button",dir:q.isRtl?"rtl":void 0,className:(0,d.A)(z,"RQITz4WQ"),"aria-label":q("AccDescrPrevious"),onClick:se}),!ne&&(0,D.Y)("button",{type:"button",dir:q.isRtl?"rtl":void 0,className:(0,d.A)(z,"_0F1Txru"),"aria-label":q("Next"),onClick:ae})]}),(0,D.FD)("div",{className:"UcyW7tVh",dir:q.isRtl?"rtl":"auto",children:[(n||b)&&(0,D.Y)(w.A,{peer:n||b,withEmojiStatus:!0,emojiStatusSize:24,onEmojiStatusClick:oe,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,a.Qe)(F),t=(0,a.DX)(F);if(!e&&!t)return n?(0,D.FD)("div",{className:(0,d.A)(K,"status",(0,a.PF)(n,r)&&"online"),children:[(0,D.Y)("span",{className:"_HDVUj4P",dir:"auto",children:(0,a.CD)(q,n,r)}),r?.isReadDateRestrictedByMe&&(0,D.Y)("span",{className:"Qga38M20",onClick:re,children:(0,D.Y)("span",{children:q("StatusHiddenShow")})})]}):(0,D.Y)("span",{className:(0,d.A)(K,"status"),dir:"auto",children:(0,a.WX)(b)?q("Subscribers",b.membersCount??0,"i"):q("Members",b.membersCount??0,"i")})}()]})]})})))},70297:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(90709),a=n(96454),r=n(87357),c=n(17663),d=n(43874),l=n(45470),u=n(14),h=n(17712),m=n(62587),p=n(59030),g=n(50680),f=n(18276),v=n(59816);var A=n(20021);const y=(0,i.ph)((function({story:e,isPreview:t,isProtected:n,isConnected:y}){const{openStoryViewer:C,loadPeerStoriesByIds:w,showNotification:b}=(0,o.ko)(),I=(0,p.A)(),{isMobile:S}=(0,d.Ay)(),M=e&&"isDeleted"in e,N=e&&"content"in e,k=N?e.content.video:void 0,Y=N?(0,s.EN)(e):void 0,P=(0,m.A)(Y),F=N?k?k.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,T=(0,u.A)(P,!0),{shouldRender:x,transitionClassNames:D}=(0,g.A)(Boolean(T)),E=(0,l.A)(F,M&&!t,S&&!a.QH),L=(0,r.A)("EVLTkrt1","media-inner",(!y||M)&&"AQWPv0bP",M&&"tprkr7qf",t&&"V3HabdKr");(0,i.vJ)((()=>{!e||N||M||w({peerId:e.peerId,storyIds:[e.id]})}),[e,M,N]);const B=(0,h.A)((()=>{M?b({message:I("StoryNotFound")}):C({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})}));return(0,A.FD)("div",{className:L,onClick:y?B:void 0,children:[!M&&t&&(0,A.Y)("canvas",{ref:E,className:"thumbnail blurred-bg"}),x&&(0,A.FD)(A.FK,{children:[(0,A.Y)("img",{src:T,alt:"",className:(0,r.A)("WAItYc5d",t&&"ClGe8yij",D),draggable:!1}),N&&(0,A.Y)(v.A,{story:e,className:D})]}),M&&(0,A.FD)("span",{children:[(0,A.Y)(f.A,{name:"story-expired",className:"nLA7VEhv"}),I("StoryExpiredSubtitle")]}),Boolean(k?.duration)&&(0,A.Y)("div",{className:"message-media-duration",children:(0,c.QO)(k.duration)}),n&&(0,A.Y)("span",{className:"protector"})]})}))},71331:(e,t,n)=>{n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>l,mD:()=>a,n5:()=>c,qI:()=>d,uu:()=>u});var i=n(90709),o=n(21133),s=n(19926);function a(e,t){const n=(0,o.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function c(e,t,n){return r(e,t)?.participants[n]}function d(e){const t=l(e)?.chatId;if(!t)return!1;const n=(0,o.hd)(e,t);return!!n&&((0,i.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 i=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,i)}function h(e){const t=l(e);if(!t||!t.chatId)return!1;const n=(0,o.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,i.Kl)(n)))return!0;const s=(0,o.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(87357),s=n(17663),a=n(14242),r=n(39351),c=n(59030),d=n(18276);const l="gvrp3KoR",u="IHb3ZATQ",h="zAPFdKbZ";var m=n(20021);const p=[[{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"}]],g=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],f=[[{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}]],v=[[{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}]],A=[[{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}]],y=(0,i.ph)((({title:e,type:t,statistics:n,isToncoin:i,className:y,subtitle:C})=>{const w=(0,c.A)(),b=(0,r.A)(),I=({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return(0,m.FD)("span",{className:(0,o.A)("idLrmbhS",n&&"SLfwGHQC"),children:[n?`-${(0,a.Vw)(b,Math.abs(e))}`:`+${(0,a.Vw)(b,e)}`,t&&(0,m.FD)(m.FK,{children:[" ","(",t,"%)"]})]})},S=(e,t,n)=>{const[i,o]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,m.FD)("div",{children:[(0,m.Y)(d.A,{className:"it39BC_c",name:"toncoin"}),(0,m.FD)("b",{className:h,children:[i,(0,m.FD)("span",{className:"ZAfXkuWL",children:[".",o]})]})," ",(0,m.FD)("span",{className:u,children:[" $",s,(0,m.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,m.Y)("h3",{className:u,children:w(n)})]})},{period:M}=n,{balances:N,usdRate:k}=n,Y=function(e){switch(e){case"group":return g;case"message":return f;case"boost":return A;case"story":return v;default:return p}}(t);return(0,m.FD)("div",{className:(0,o.A)("Gi8Nokbl",y),children:[(0,m.FD)("div",{className:"H01lE7mv",children:[e&&(0,m.Y)("div",{className:"VQbs04hT",children:e}),M&&(0,m.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(w,1e3*M.minDate)," ","",(0,s.Lu)(w,1e3*M.maxDate)]})]}),(0,m.Y)("table",{className:"s5beXqqL",children:i?(0,m.Y)("tr",{children:(0,m.FD)("td",{className:l,children:[S(N?.availableBalance||0,k||0,"lng_channel_earn_available"),S(N?.currentBalance||0,k||0,"lng_channel_earn_reward"),S(N?.overallRevenue||0,k||0,"lng_channel_earn_total")]})}):Y.map((e=>(0,m.Y)("tr",{children:e.map((e=>{const t=n[e.name];return e.isPlain?(0,m.FD)("td",{className:l,children:[(0,m.Y)("b",{className:h,children:`${e.isApproximate?"":""}${(0,a.Sm)(t)}`}),(0,m.Y)("h3",{className:u,children:w(e.title)})]}):e.isPercentage?(0,m.FD)("td",{className:l,children:[e.withAbsoluteValue&&(0,m.Y)("span",{className:h,children:`${e.isApproximate?"":""}${(0,a.Sm)(t.part)}`}),(0,m.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":h,children:[t.percentage,"%"]}),(0,m.Y)("h3",{className:u,children:w(e.title)})]}):(0,m.FD)("td",{className:l,children:[(0,m.Y)("b",{className:h,children:(0,a.Vw)(b,t.current)})," ",I(t),(0,m.Y)("h3",{className:u,children:w(e.title)})]})}))})))}),C]})}))},72078:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},73172:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,i.Kr)((()=>(0,a.nF)((n=>{e&&t&&(0,o.ko)().sendMessageAction({chatId:e,threadId:t,action:n})}),s.cqp)),[e,t])},75343:(e,t,n)=>{n.d(t,{A:()=>b});var i=n(84051),o=n(13439),s=n(87357),a=n(43874),r=n(36838),c=n(59030),d=n(89925),l=n(70636),u=n(9716),h=n(54464),m=n(10722),p=n(17712),g=n(92111),f=n(21849),v=n(71429),A=n(24433),y=n(2429),C=n(20021);const w=(0,i.ph)((function({peer:e,isArchived:t}){const{openChat:n,openChatWithInfo:a,openStoryViewer:r,toggleStoriesHidden:w}=(0,o.ko)(),b=(0,c.A)(),I=(0,i.li)(),S="isSelf"in e&&e.isSelf,M=!(0,u.L8)(e.id);(0,g.A)(e.id);const{isContextMenuOpen:N,contextMenuAnchor:k,handleBeforeContextMenu:Y,handleContextMenu:P,handleContextMenuClose:F,handleContextMenuHide:T}=(0,m.A)(I),x=(0,p.A)((()=>I.current)),D=(0,p.A)((()=>document.body)),E=(0,p.A)((()=>I.current.querySelector(".story-peer-context-menu .bubble"))),L=(0,p.A)((()=>({withPortal:!0,isDense:!0}))),B=(0,p.A)((()=>{N||r({peerId:e.id,origin:d.G9.StoryRibbon})})),R=(0,p.A)((e=>{(0,h.u)(e),Y(e)})),O=(0,p.A)((()=>{a({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})})),U=(0,p.A)((()=>{a({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),z=(0,p.A)((()=>{n({id:e.id,shouldReplaceHistory:!0})})),K=(0,p.A)((()=>{a({id:e.id,shouldReplaceHistory:!0})})),j=(0,p.A)((()=>{w({peerId:e.id,isHidden:!t})}));return(0,C.FD)("div",{ref:I,role:"button","data-peer-id":e.id,tabIndex:0,className:y.A.peer,onMouseDown:R,onClick:B,onContextMenu:P,children:[(0,C.Y)(f.A,{peer:e,withStory:!0,storyViewerOrigin:d.G9.StoryRibbon,storyViewerMode:"full"}),(0,C.Y)("div",{className:(0,s.A)(y.A.name,e.hasUnreadStories&&y.A.name_hasUnreadStory),children:S?b("MyStory"):(0,l.F9)(b,e)}),void 0!==k&&(0,C.Y)(v.A,{isOpen:N,anchor:k,getTriggerElement:x,getRootElement:D,getMenuElement:E,getLayout:L,className:(0,s.A)("story-peer-context-menu",y.A.contextMenu),autoClose:!0,withPortal:!0,onClose:F,onCloseAnimationEnd:T,children:S?(0,C.FD)(C.FK,{children:[(0,C.Y)(A.A,{onClick:O,icon:"play-story",children:b("StoryList.Context.SavedStories")}),(0,C.Y)(A.A,{onClick:U,icon:"archive",children:b("StoryList.Context.ArchivedStories")})]}):(0,C.FD)(C.FK,{children:[!M&&(0,C.Y)(A.A,{onClick:z,icon:"message",children:b("SendMessageTitle")}),M?(0,C.Y)(A.A,{onClick:K,icon:"channel",children:b("ChatList.ContextOpenChannel")}):(0,C.Y)(A.A,{onClick:K,icon:"user",children:b("StoryList.Context.ViewProfile")}),(0,C.Y)(A.A,{onClick:j,icon:t?"unarchive":"archive",children:b(t?"StoryList.Context.Unarchive":"StoryList.Context.Archive")})]})})]})})),b=(0,i.ph)((0,o.EK)(((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:i}}=e.stories;return{orderedPeerIds:t?i:n,usersById:e.users.byId,chatsById:e.chats.byId}}))((function({isArchived:e,className:t,orderedPeerIds:n,usersById:o,chatsById:d,isClosing:l}){const u=(0,c.A)(),h=(0,s.A)(y.A.root,!n.length&&y.A.hidden,l&&y.A.closing,t,"no-scrollbar"),m=(0,i.li)();return(0,r.A)(m,(0,a.Ny)()),(0,C.Y)("div",{ref:m,id:"StoryRibbon",className:h,dir:u.isRtl?"rtl":void 0,children:n.map((t=>{const n=o[t]||d[t];if(n)return(0,C.Y)(w,{peer:n,isArchived:e},t)}))})})))},78407:(e,t,n)=>{n.d(t,{A:()=>H});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(29807),c=n(30708),d=n(96454),l=n(87357),u=n(52674),h=n(14680),m=n(17237),p=n(36353),g=n(37836),f=n(4961),v=n(11359),A=n(43874),y=n(19129),C=n(37661),w=n(17712),b=n(59030),I=n(88458),S=n(41733);class M{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,S.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 i=this.video,{width:o,height:s}=this.container.getBoundingClientRect();(0,a.RK)((()=>{i.style.left=`${Math.round(t*o)}px`,i.style.top=`${Math.round(n*s)}px`,i.style.width=`${e}px`,i.style.height=`${e}px`}))}))}}var N=n(60261),k=n(43336),Y=n(71322),P=n(76023),F=n(37479),T=n(87094),x=n(82117),D=n(93545),E=n(672),L=n(61157),B=n(38691);const R=1.25*P.$;var O=n(18276),U=n(64493),z=n(61361),K=n(80089),j=n(80464),V=n(20021);const J=e=>{const{isOpen:t}=e,n=(0,j.A)(K.ar.Extra,"TextFormatter",!t);return n?(0,V.Y)(n,{...e}):void 0},$="input-scroller",q=140,G=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],H=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:i}=(0,c.l)(e);return{messageSendKeyCombo:i,replyInfo:t&&n?(0,r.GA4)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}}))((({ref:e,id:t,chatId:n,captionLimit:c,isAttachmentModalInput:S,isStoryInput:P,customEmojiPrefix:K,editableInputId:j,isReady:H,isActive:W,getHtml:_,placeholder:Q,timedPlaceholderLangKey:Z,timedPlaceholderDate:X,forcedPlaceholder:ee,canSendPlainText:te,canAutoFocus:ne,noFocusInterception:ie,shouldSuppressFocus:oe,shouldSuppressTextFormatter:se,replyInfo:ae,isSelectModeActive:re,canPlayAnimatedEmojis:ce,messageSendKeyCombo:de,onUpdate:le,onSuppressedFocus:ue,onSend:he,onScroll:me,onFocus:pe,onBlur:ge,isNeedPremium:fe,messageListType:ve})=>{const{editLastMessage:Ae,replyToNextMessage:ye,showAllowedMessageTypesNotification:Ce,openPremiumModal:we}=(0,o.ko)();let be=(0,i.li)();e&&(be=e);const Ie=(0,i.li)(),Se=(0,i.li)(),Me=(0,i.li)(),Ne=(0,i.li)(),ke=(0,i.li)(),Ye=(0,i.li)(),Pe=(0,b.A)(),Fe=(0,i.li)(!1),[Te,xe,De]=(0,C.A)(),[Ee,Le]=(0,i.J0)(),[Be,Re]=(0,i.J0)(),[Oe,Ue]=(0,i.J0)(!1),{isMobile:ze}=(0,A.Ay)(),Ke=ze&&(d.pz||d.Ni),[je,Ve]=(0,i.J0)(!1);(0,i.vJ)((()=>{Ve(Boolean(Z&&X))}),[X,Z]);const Je=(0,w.A)((()=>{Ve(!1)}));!function(e,t,n,s,c,d,l,u,h){const m=(0,T.A)(t,void 0,!u),p=(0,F.A)(m,!0),g=(0,B.A)(),f=(0,i.li)(new Map),v=(0,w.A)((e=>{e.forEach((e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))}))})),A=(0,w.A)((()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,o.mS)(),i=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const o=`${d}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;i.delete(o);const u=(0,N.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,k.LI)((v.left-h.left)/h.width,4),y=(0,k.LI)((v.top-h.top)/h.height,4);if(f.current.has(o))return void f.current.get(o).updatePosition(A,y);const C=e.customEmojis.byId[a];if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),b=[d,a,m,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:i,renderId:o,viewId:s,mediaUrl:a,position:r,isHq:c,textColor:d,colorFilter:l}){if(e.isLottie){const i=e.shouldUseTextColor&&d?(0,Y.E2)(d):void 0,l=(await(0,I.Y)()).init(a,c?n.current:t.current,o,{size:R,coords:r,isLowPriority:!c},s,i?[i.r,i.g,i.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 M(a,i.current,{size:R,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:c,renderId:b,viewId:o,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then((e=>{l&&e.play(),f.current.set(o,e)}))})),v(Array.from(i))}));(0,i.vJ)((()=>(0,N.K3)(A)),[A]),(0,i.vJ)((()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}}),[]),(0,i.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,i.Nf)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")}),[p]),(0,x.A)((([e])=>{void 0!==e&&m!==e&&A()}),[m,A]);const y=(0,E.A)(A,[A],300,!1);(0,D.A)(n,y),(0,x.A)((([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())}),[g,A]);const C=(0,w.A)((()=>{f.current.forEach((e=>{e.pause()}))})),b=(0,w.A)((()=>{l&&f.current?.forEach((e=>{e.play()}))})),S=(0,w.A)((()=>{(0,a.YS)(b)}));(0,L.A)(C,S)}(_,be,Ne,ke,Ye,K,ce,H,W);const $e=S?160:P?128:ze?256:416,qe=(0,w.A)(((e=!1)=>{(0,g.IJ)((()=>{(0,a.gm)((()=>{const t=be.current.closest(`.${$}`),n=Number(t.style.height.replace("px","")),i=Me.current,{scrollHeight:o}=i,s=Math.min(o,$e);if(s===n)return;const r=o>$e;function c(){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)(c):c}))}))}));(0,i.Nf)((()=>{S&&qe(!1)}),[S,qe]);const Ge=(0,i.li)(_());(0,i.Nf)((()=>{const e=W?_():"";e!==be.current.innerHTML&&(be.current.innerHTML=e),e!==Se.current.innerHTML&&(Se.current.innerHTML=e),e!==Ge.current&&(Ge.current=e,qe(!e))}),[_,W,qe]),(0,i.li)(n).current=n;const He=(0,w.A)((()=>{be.current&&!fe&&((0,i.OV)()?setTimeout(He,350):(0,p.A)(be.current))})),We=(0,w.A)((()=>{De(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function _e(){if(d.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Fe.current)return De(),d.Ni&&Ue(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(se||!(0,v.L)(t,j||s.CfG)||!n||(0,m.A)(n)||!t.START_TO_END)||(De(),!1)}function Qe(){if(!_e())return;if(Oe)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=be.current.closest(`.${$}`).getBoundingClientRect();let i=t.left+t.width/2-n.left;i<q?i=q:i>n.width-q&&(i=n.width-q),Le({x:i,y:t.top-n.top}),Re(e),xe()}function Ze(){Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(Qe,260)}const Xe=(0,w.A)((()=>we()));(0,i.vJ)((()=>{d.TF||ne&&He()}),[n,He,ae,ne]),(0,i.vJ)((()=>{if(!n||j!==s.CfG||ie||Ke||re)return;const e=e=>{if((0,h.ZJ)())return;const{key:t}=e,n=e.target;if(!n||G.includes(t))return;const i=be.current,o=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!o||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&i&&n!==i&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,p.A)(i,!0,!0);const t=new KeyboardEvent(e.type,e);i.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[n,j,Ke,re,ie]),(0,i.vJ)((()=>{const e=(0,g.sg)((e=>{"Tab"!==e.key||(0,h.ZJ)()||(e.preventDefault(),(0,a.RK)(He))}),2e3,!0,!1);return(0,u.A)({onTab:e})}),[He]),(0,i.vJ)((()=>{const e=be.current;function t(){e.blur()}return oe&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[oe]);const et=(0,y.A)((()=>Boolean(W&&_())),[W,_]),tt=(0,l.A)("form-control allow-selection",et&&"touched",oe&&"focus-disabled"),nt=(0,l.A)("input-scroller-content",fe&&"is-need-premium"),it="string"==typeof Q?Q:void 0;return(0,V.FD)("div",{id:t,onClick:oe?ue:void 0,dir:Pe.isRtl?"rtl":void 0,children:[(0,V.Y)("div",{className:(0,l.A)("custom-scroll",$,fe&&"is-need-premium"),onScroll:me,onClick:S||te?void 0:function(){S||te||P&&fe||Ce({chatId:n,messageListType:ve})},children:(0,V.FD)("div",{className:nt,children:[(0,V.Y)("div",{ref:be,id:j||s.CfG,className:tt,contentEditable:S||te,role:"textbox",dir:"auto",tabIndex:0,onClick:He,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(le("<br>"===t?"":t),!d.TF&&(!n||!n.length)&&(d.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(be.current.blur(),e.removeAllRanges(),(0,p.A)(be.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=_();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 ye({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Ze,{once:!0}):(e.preventDefault(),Ae()):!Ke&&("enter"===de&&!e.shiftKey||"ctrl-enter"===de&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),De(),he())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{Fe.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Fe.current||(Fe.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",Ze,{once:!0})},onContextMenu:d.Ni?function(e){_e()&&(Ue(!Oe),Oe?De():(e.preventDefault(),e.stopPropagation(),Qe()))}:void 0,onTouchCancel:d.Ni?Ze:void 0,"aria-label":it,onFocus:fe?void 0:pe,onBlur:fe?void 0:ge}),!ee&&(0,V.FD)("span",{className:(0,l.A)("placeholder-text",!S&&!te&&"with-icon",fe&&"is-need-premium"),dir:"auto",children:[!S&&!te&&(0,V.Y)(O.A,{name:"lock-badge",className:"placeholder-icon"}),je?(0,V.Y)(z.A,{langKey:Z,endsAt:X,onEnd:Je}):Q,P&&fe&&(0,V.Y)(U.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:Xe,children:Pe("StoryRepliesLockedButton")})]}),(0,V.Y)("canvas",{ref:Ne,className:"shared-canvas"}),(0,V.Y)("canvas",{ref:ke,className:"shared-canvas"}),(0,V.Y)("div",{ref:Ye,className:"absolute-video-container"})]})}),(0,V.Y)("div",{ref:Me,className:(0,l.A)("custom-scroll",$,"clone",fe&&"is-need-premium"),children:(0,V.Y)("div",{className:nt,children:(0,V.Y)("div",{ref:Se,className:(0,l.A)(tt,"clone"),dir:"auto"})})}),void 0!==c&&(0,V.Y)("div",{className:"max-length-indicator",dir:"auto",children:c}),(0,V.Y)(J,{isOpen:Te,anchorPosition:Ee,selectedRange:Be,setSelectedRange:Re,onClose:We}),ee&&(0,V.Y)("span",{className:"forced-placeholder",children:(0,f.A)(ee)})]})})))},79307:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(66644),s=n(37836);const a=({containerRef:e,selector:t},n)=>{(0,i.vJ)((()=>{const n=e?.current?.querySelectorAll(t);if(!n?.length)return;const i=(0,s.nF)((e=>{const t=e.target,n=t.scrollTop>0;(0,o.RK)((()=>{t.classList.toggle("scrolled",n)}))}),100);return n.forEach((e=>e.addEventListener("scroll",i,{passive:!0}))),n.forEach((e=>e.dispatchEvent(new Event("scroll",{bubbles:!1})))),()=>{n.forEach((e=>e.removeEventListener("scroll",i)))}}),[e,t,...n])}},79882:(e,t,n)=>{n.d(t,{I:()=>o,W:()=>s});var i=n(84051);let o=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function s(e){return(0,i.Kr)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,i=t.filter((e=>e>0)).length;return t=>{const s=e[t];return 0===s?o.None:s===1/0||s===-1/0||n<=i&&s<0||i<n&&s>0?o.Opacity:o.Move}}),[e])}},80477:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(90709),a=n(29807),r=n(4961),c=n(59030),d=n(80999),l=n(20021);const u=(0,i.ph)((0,o.EK)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,a.mBe)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.A)(),i=t&&!t.isSelf&&(0,s.u0)(t),o=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return(0,l.FD)("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto",children:[i&&(0,l.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(i)}),(0,l.Y)(d.A,{content:o})]})})))},80999:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(87357),o=n(4961),s=n(59030),a=n(20021);const r=({content:e,className:t})=>{const n=(0,s.A)();return(0,a.FD)("span",{className:(0,i.A)("DotAnimation",t),dir:n.isRtl?"rtl":"auto",children:[(0,o.A)(e),(0,a.Y)("span",{className:"ellipsis"})]})}},81524:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(90709),s=n(87357),a=n(17663),r=n(83868),c=n(37661),d=n(5912),l=n(17712),u=n(62587),h=n(83057),m=n(27860),p=n(20021);const g=(0,i.ph)((({message:e,idPrefix:t="shared-media",isProtected:n,observeIntersection:g,onClick:f})=>{const v=(0,i.li)(),A=(0,d.Vz)(v,g),y=(0,o.CI)(e),C=(0,u.A)((0,o.EO)(e,"pictogram"),!A),w=(0,h.A)(C),b=(0,o.zX)(e),I=(0,o.y2)(e),[S,,M]=(0,c.A)(I),N=(0,l.A)((()=>{M(),f(e.id,e.chatId)}));return(0,p.FD)("div",{ref:v,id:`${t}${(0,o.GZ)(e.id)}`,className:"Media scroll-item",onClick:f?N:void 0,children:[(0,p.Y)("img",{src:y,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.A:void 0}),(0,p.Y)("img",{src:C,className:(0,s.A)("full-media","media-miniature",w),alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.A:void 0}),I&&(0,p.Y)(m.A,{thumbDataUri:C||y,isVisible:S,className:"media-spoiler"}),b&&(0,p.Y)("span",{className:"video-duration",children:b.isGif?"GIF":(0,a.QO)(b.duration)}),n&&(0,p.Y)("span",{className:"protector"})]})}))},81642:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(87357),s=n(17663),a=n(59030),r=n(45),c=n(20021);const d=(0,i.ph)((({className:e,message:t,outgoingStatus:n,draftDate:i})=>{const d=(0,a.A)(),l=i&&i>t.date;return(0,c.FD)("div",{className:(0,o.A)("LastMessageMeta",e),children:[n&&!l&&(0,c.Y)(r.A,{status:n}),(0,c.Y)("span",{className:"time",children:(0,s.be)(d,1e3*(l?i:t.date))})]})}))},83689:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"CustomSendMenu",!t);return n?(0,s.Y)(n,{...e}):void 0}},84313:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(13439),s=n(96454),a=n(17712),r=n(59030);const c=8e3;function d(e,t,n){const{showNotification:d}=(0,o.ko)(),l=(0,r.A)(),[u,h]=(0,i.J0)(!1),m=(0,a.A)((()=>{h(!0),t||d({message:s.yS?l("Video.Unsupported.Mobile"):l("Video.Unsupported.Desktop"),duration:c})})),p=(0,a.A)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||m())})),g=(0,a.A)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||m()}));return(0,i.vJ)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",p),t.addEventListener("canplay",g),()=>{t.removeEventListener("error",p),t.removeEventListener("canplay",g)}):void 0}),[n,e]),u}},84555:(e,t,n)=>{n.d(t,{A:()=>F});var i=n(84051),o=n(13439),s=n(23174),a=n(90709),r=n(53827),c=n(87357),d=n(17663),l=n(41733),u=n(76023),h=n(63988),m=n(37661),p=n(5912),g=n(17712),f=n(37960),v=n(69419),A=n(73767),y=n(21511),C=n(61097),w=n(18276),b=n(27860),I=n(64493),S=n(65843),M=n(35913),N=n(20021);const k=u.Wd/2,Y=2*(k-6)*Math.PI;let P;const F=({message:e,className:t,canAutoLoad:n,isDownloading:F,origin:T,observeIntersection:x,onStop:D,onReadMedia:E,isTranscriptionError:L,isTranscribed:B,canTranscribe:R,onHideTranscription:O,isTranscriptionHidden:U,isTranscribing:z})=>{const K=(0,i.li)(),j=(0,i.li)(),V=(0,i.li)(),{cancelMediaDownload:J,openOneTimeMediaModal:$,transcribeAudio:q}=(0,o.ko)(),G=(0,p.Vz)(K,x),H=e.content.video,W=e.isMediaUnread,[_,Q]=(0,i.J0)(n),Z=Boolean(_&&G),{mediaData:X,loadProgress:ee}=(0,v.A)((0,a.sC)(H,"inline"),!Z,(0,a.Cz)(H,"inline")),{loadProgress:te}=(0,v.A)((0,a.sC)(H,"download"),!F,s.qZ.BlobUrl),[ne,ie]=(0,m.A)(),oe=(0,a.G5)(e),se="oneTimeModal"===T,ae=oe&&!se,re=!Boolean((0,a.CI)(e))||ne||ae,ce=(0,C.A)(H,re);(0,f.A)(!re,{ref:ce});const de=(0,a.CI)(e),le=_&&!ne||F,ue=!1===(0,A.A)(_),{ref:he,shouldRender:me}=(0,y.A)({isOpen:le,noMountTransition:ue,withShouldRender:!0}),[pe,ge]=(0,i.J0)(!1),[fe,ve]=(0,i.J0)(0),[Ae,ye]=(0,i.Ul)(0),Ce=(0,h.aG)(Ae,16);(0,i.vJ)((()=>{if(!pe)return;const e=j.current;ye(e.currentTime/e.duration)}),[ye,pe,Ce]),(0,i.Nf)((()=>{if(!pe||!V.current)return;const e=Y-Ce()*Y;V.current.setAttribute("stroke-dashoffset",e.toString())}),[pe,Ce]);const we=Boolean(X&&G),be=(0,g.A)((()=>{j.current&&(ge(!1),ye(0),(0,l.A)(j.current))})),Ie=(0,g.A)((()=>{P?.(),P=be})),Se=(0,g.A)((()=>{const e=j.current;pe?e.paused?((0,l.A)(e),(0,r._K)()):e.pause():(Ie(),e.pause(),e.currentTime=0,(0,l.A)(e),(0,r._K)(),ge(!0))}));(0,i.vJ)((()=>{se&&Se()}),[se]);const Me=(0,g.A)((t=>{if(!t.target.closest(".transcribe-button"))if(X){if(!F)return oe&&!se?($({message:e}),void E?.()):void Se();J({media:H})}else Q((e=>!e))}));(0,i.vJ)((()=>{E&&W&&pe&&E()}),[pe,W,E]);const Ne=(0,g.A)((e=>{const t=e.currentTarget;ye(t.currentTime/t.duration),ve(Math.floor(t.currentTime))})),ke=(0,g.A)((()=>{q({chatId:e.chatId,messageId:e.id})})),Ye=(0,g.A)((()=>{(B||L)&&O?O(!U):z||ke()}));return(0,N.FD)("div",{ref:K,className:(0,c.A)("RoundVideo","media-inner",se&&"non-interactive",t),onClick:Me,children:[X&&(0,N.FD)("div",{className:"video-wrapper",children:[ae&&(0,N.Y)(b.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,N.Y)(S.A,{canPlay:we,ref:j,src:X,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!ae,disablePictureInPicture:!0,muted:!pe,defaultMuted:!0,loop:!pe,playsInline:!0,isPriority:!0,onEnded:pe?D??be:void 0,onTimeUpdate:pe?Ne:void 0,onReady:ie})]}),!ae&&(0,N.Y)("canvas",{ref:ce,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,N.Y)("div",{className:"progress",children:pe&&(0,N.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,N.Y)("circle",{ref:V,cx:k,cy:k,r:k-6,className:"progress-circle",transform:`rotate(-90, ${k}, ${k})`,"stroke-dasharray":Y,"stroke-dashoffset":Y})})}),me&&(0,N.Y)("div",{ref:he,className:"media-loading",children:(0,N.Y)(M.A,{progress:F?te:ee})}),ae&&!me&&(0,N.FD)("div",{className:"play-wrapper",children:[(0,N.Y)(I.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,children:(0,N.Y)(w.A,{name:"play"})}),(0,N.Y)(w.A,{name:"view-once"})]}),!X&&!_&&(0,N.Y)(w.A,{name:"download"}),!se&&(0,N.FD)("div",{className:(0,c.A)("message-media-duration",W&&"unread"),children:[pe?(0,d.QO)(fe):(0,d.QO)(H.duration),(!pe||j.current.paused)&&(0,N.Y)(w.A,{name:"muted"})]}),R&&(0,N.FD)(I.A,{onClick:Ye,className:"transcribe-button",children:[B||L?(0,N.Y)(w.A,{name:"down"}):(0,N.Y)(w.A,{name:"transcribe"}),z&&(0,N.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,N.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"})})]})]})}},85449:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(31481),o=n(98607),s=n(4961),a=n(18276),r=n(20021);function c(e,t){return"receipt"===t.type?e("PaymentReceipt"):"buy"===t.type?(0,o.i)(t.text,i.Cyx,(0,r.Y)(a.A,{className:"star-currency-icon",name:"star"})):(0,s.A)(t.text)}},88792:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(13439),s=n(31481),a=n(29807),r=n(53827),c=n(49642),d=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,b,I=!1,S=!1)=>{const M=(0,i.li)(),[N,k]=(0,i.J0)(!1);let Y=N;const[P,F]=(0,i.J0)(0),T=(0,u.A)((()=>{k(!1),y&&y()}));(0,h.A)((()=>{if(!e)return;M.current=(0,r.kz)(e,n,((e,i)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:i,toggleMuted:r,proxy:d}=M.current;k(!0),"oneTimeVoice"!==n&&(0,c.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:i,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:c,isFirst:d,isLast:l}=e.current;t={play:()=>{n(a.src)},pause:()=>{i()},stop:()=>{i(),s(0),(0,o.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()}),d()||(t.previoustrack=()=>{c()})}return t}(M)),(0,c.HW)("playing");const{audioPlayer:l}=(0,a.nTw)((0,o.mS)());e(l.volume),r(Boolean(l.isMuted));const u=d.duration&&Number.isFinite(d.duration)?d.duration:t;("voice"===n||u>s.CVm)&&i(l.playbackRate),(0,c.hm)({duration:d.duration||0,playbackRate:d.playbackRate,position:d.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,c.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":k(!1),(0,c.HW)("paused"),b?.();break;case"onTimeUpdate":{const{proxy:e}=M.current;if(I&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;w||F(e.currentTime/n);break}case"onEnded":(0,c.HW)("paused")}p?.[e]?.(i)}}),A,T);const{proxy:i}=M.current;N||i.paused||(k(!0),Y=!0),f&&!S&&f(i)}),[e]),(0,i.vJ)((()=>{N&&g&&(0,c.D5)(g)}),[g,N]);const{play:x,pause:D,setCurrentTime:E,proxy:L,destroy:B,setVolume:R,stop:O,isFirst:U,isLast:z,requestNextTrack:K,requestPreviousTrack:j,setPlaybackRate:V,toggleMuted:J}=M.current??{},$=(0,i.Kr)((()=>L?.duration&&Number.isFinite(L.duration)?L.duration:t),[L?.duration,t]);(0,i.vJ)((()=>{L&&(I&&0===L.currentTime||!$||(0,d.f)(L)||w||F(L.currentTime/$))}),[$,P,L,w,I]),(0,i.vJ)((()=>()=>{B?.(C)}),[B,C]),(0,l.A)((([e,t])=>{e===v&&m===t||L?.src&&L?.paused||v&&m&&!N&&x?.(m)}),[v,m,N,x,L?.src,L?.paused,n]);const q=(0,u.A)((()=>{m&&x?.(m)})),G=(0,u.A)((()=>{N?D?.():q()})),H=(0,u.A)((e=>{E?.(e),$&&L&&F(L.currentTime/$)}));return{isPlaying:Y,playProgress:P,playPause:G,pause:D,play:q,stop:O,setCurrentTime:H,setVolume:R,audioProxy:L,duration:$,requestNextTrack:K,requestPreviousTrack:j,isFirst:U,isLast:z,setPlaybackRate:V,toggleMuted:J}}},89755:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.40a69ba9ec4d2c4cf3a7.js"},89873:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(13439),s=n(17712),a=n(21511),r=n(59030),c=n(71429),d=n(24433),l=n(60859),u=n(20021);const h=(0,i.ph)((({isOpen:e,sponsorInfo:t,canReport:n,anchor:o,triggerRef:a,shouldSkipAbout:h,onClose:m,onCloseAnimationEnd:p,onAboutAdsClick:g,onSponsoredHide:f,onSponsorInfo:v,onSponsoredReport:A})=>{const y=(0,i.li)(),C=(0,r.A)(),w=(0,s.A)((()=>a.current)),b=(0,s.A)((()=>({withPortal:!0}))),I=(0,s.A)((()=>y.current)),S=(0,s.A)((()=>document.body)),M=t||!h||n;return(0,u.FD)(c.A,{ref:y,isOpen:e,anchor:o,withPortal:!0,className:"with-menu-transitions",getLayout:b,getTriggerElement:w,getMenuElement:I,getRootElement:S,onClose:m,onCloseAnimationEnd:p,children:[t&&v&&(0,u.Y)(d.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!h&&(0,u.Y)(d.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(d.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(l.A,{}),(0,u.Y)(d.A,{icon:"close-circle",onClick:f,children:C("HideAd")})]})})),m=(0,i.ph)((({isOpen:e,randomId:t,sponsorInfo:n,additionalInfo:i,canReport:r,anchor:c,triggerRef:d,shouldSkipAbout:l,onItemClick:m,onClose:p,onCloseAnimationEnd:g})=>{const{openAboutAdsModal:f,showDialog:v,reportSponsored:A,hideSponsored:y}=(0,o.ko)(),{ref:C}=(0,a.A)({isOpen:e,onCloseAnimationEnd:g}),w=(0,s.A)((()=>{m?.(),p()})),b=(0,s.A)((()=>{f({randomId:t,additionalInfo:i,canReport:r,sponsorInfo:n}),w()})),I=(0,s.A)((()=>{y(),w()})),S=(0,s.A)((()=>{v({data:{message:[n,i].filter(Boolean).join("\n")}}),w()})),M=(0,s.A)((()=>{A({randomId:t}),w()}));if(c)return(0,u.Y)("div",{ref:C,className:"ContextMenuContainer",children:(0,u.Y)(h,{isOpen:e,anchor:c,triggerRef:d,canReport:r,sponsorInfo:n,shouldSkipAbout:l,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:b,onSponsoredHide:I,onSponsorInfo:S,onSponsoredReport:M})})}))},90054:(e,t,n)=>{n.d(t,{A:()=>W});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(66644),c=n(90709),d=n(29807),l=n(96454),u=n(87357),h=n(11778),m=n(50442),p=n(25903),g=n(43874),f=n(26072),v=n(96374),A=n(5912),y=n(17712),C=n(59030),w=n(73767),b=n(9717),I=n(63744),S=n(51083),M=n(18276),N=n(48553),k=n(64493),Y=n(46222),P=n(52745),F=n(76023),T=n(79577);const x={root:"Ky16H_sV","button-text":"W01t9CIf",buttonText:"W01t9CIf",sticker:"c8lE3XW5",title:"wlwD1B1Q",description:"V8OCFHmp","is-ios":"IxW_z_r0",isIos:"IxW_z_r0","is-macos":"OFxKGCEJ",isMacos:"OFxKGCEJ"};var D=n(20021);const E=7*F.$,L=(0,i.ph)((0,o.EK)(((e,{chatId:t})=>{const n=(0,d.hds)(e,t),i=n&&(n.isCreator||(0,c.ub)(n,"manageTopics"));return{animatedEmoji:(0,d.oei)(e,"🐣"),canManageTopics:i}}))((({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:s}=(0,o.ko)(),a=(0,C.A)(),{isMobile:r}=(0,g.Ay)(),c=(0,i.hb)((()=>{s({chatId:e})}),[e,s]);return(0,D.FD)("div",{className:x.root,children:[(0,D.Y)("div",{className:x.sticker,children:t&&(0,D.Y)(T.A,{sticker:t,size:E})}),(0,D.Y)("h3",{className:x.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,D.Y)("p",{className:(0,u.A)(x.description,x.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,D.Y)(k.A,{ripple:!r,fluid:!0,onClick:c,size:"smaller",isRtl:a.isRtl,children:(0,D.Y)("div",{className:x.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})})));var B=n(27109),R=n(66414),O=n(4961),U=n(37661),z=n(53188),K=n(87894),j=n(81642),V=n(38102),J=n(94189),$=n(22720),q=n(97046),G=n(24807);const H=(0,i.ph)((0,o.EK)(((e,{chatId:t,topic:n,isSelected:i})=>{const o=(0,d.hds)(e,t),s=(0,d.O5q)(e,t,n.lastMessageId),{isOutgoing:a}=s||{},r=s&&(0,d.Y7C)(e,s),c=(0,d.C5H)(e,t,n.id,"typingStatus"),l=(0,d.GA4)(e,t,n.id),u=(0,d.Vw0)(e,t,n.id),h=Boolean(u?.lastReadInboxMessageId),m=(0,d.pSx)(e,t),{chatId:p,threadId:g}=(0,d.Xf0)(e)||{},f=s?.content.storyData,v=f&&(0,d.Msb)(e,f.peerId,f.id);return{chat:o,lastMessage:s,lastMessageSender:r,typingStatus:c,isChatMuted:o&&(0,B.If)(o,(0,d.K52)(e),(0,d.P5N)(e,o.id)),canDelete:(0,d.DBV)(e,t,n.id),withInterfaceAnimations:(0,d.PKK)(e),draft:l,...a&&s&&{lastMessageOutgoingStatus:(0,d.Tl2)(e,s)},canScrollDown:i&&o?.id===p&&g===n.id,wasTopicOpened:h,topics:m,lastMessageStory:v}}))((({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:a,style:r,lastMessage:d,lastMessageStory:h,canScrollDown:m,lastMessageOutgoingStatus:p,observeIntersection:g,canDelete:f,lastMessageSender:v,animationType:A,withInterfaceAnimations:w,orderDiff:b,typingStatus:I,draft:S,wasTopicOpened:N,topics:k})=>{const{openThread:Y,deleteTopic:P,focusLastMessage:F,setViewForumAsMessages:T}=(0,o.ko)(),x=(0,C.A)(),[E,L,B]=(0,U.A)(),[H,W,_]=(0,U.A)(),[Q,Z,X]=(0,U.A)(),[ee,te,ne]=(0,U.A)(),{isPinned:ie,isClosed:oe,notifySettings:se}=e,ae=Boolean(se.mutedUntil||void 0===se.mutedUntil&&a),re=(0,y.A)((()=>{Z(),L()})),ce=(0,y.A)((()=>{P({chatId:s.id,topicId:e.id})})),de=(0,y.A)((()=>{te(),W()})),{renderSubtitle:le,ref:ue}=(0,z.A)({chat:s,chatId:n,lastMessage:d,draft:S,lastMessageSender:v,lastMessageTopic:e,observeIntersection:g,isTopic:!0,typingStatus:I,topics:k,statefulMediaContent:(0,c.FE)({story:h}),animationType:A,withInterfaceAnimations:w,orderDiff:b}),he=(0,y.A)((()=>{Y({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),T({chatId:n,isEnabled:!1}),m&&F()})),me=function({topic:e,chat:t,isChatMuted:n,wasOpened:s,canDelete:a,handleDelete:r,handleMute:d}){const u=(0,C.A)();return(0,i.Kr)((()=>{const{isPinned:i,notifySettings:h,isClosed:m,id:p}=e,g=t.id,{editTopic:f,toggleTopicPinned:v,markTopicRead:A,updateTopicMutedState:y,openChatInNewTab:C}=(0,o.ko)(),w=(0,c.l1)(t,e),b=t.isCreator||(0,c.ub)(t,"manageTopics"),I=l.OS&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{C({chatId:t.id,threadId:p})}},S=e.unreadCount||!s?{title:u("MarkAsRead"),icon:"readchats",handler:()=>{A({chatId:g,topicId:p})}}:void 0,M=b?i?{title:u("UnpinFromTop"),icon:"unpin",handler:()=>v({chatId:g,topicId:p,isPinned:!1})}:{title:u("PinToTop"),icon:"pin",handler:()=>v({chatId:g,topicId:p,isPinned:!0})}:void 0,N=n&&void 0===h.mutedUntil||h.mutedUntil?{title:u("ChatList.Unmute"),icon:"unmute",handler:()=>y({chatId:g,topicId:p,isMuted:!1})}:{title:`${u("ChatList.Mute")}...`,icon:"mute",handler:d},k=w?m?{title:u("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>f({chatId:g,topicId:p,isClosed:!1})}:{title:u("lng_forum_topic_close"),icon:"close-topic",handler:()=>f({chatId:g,topicId:p,isClosed:!0})}:void 0,Y=a?{title:u("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:r}:void 0;return(0,K.oE)([I,M,S,N,k,Y])}),[e,t,n,s,u,a,r,d])}({topic:e,chat:s,isChatMuted:a,wasOpened:N,canDelete:f,handleDelete:re,handleMute:de});return(0,D.FD)($.A,{className:(0,u.A)("Fn34Vu_9","Chat",t&&"selected","chat-item-clickable"),onClick:he,style:r,href:l.OS?`#${(0,R.az)(n,"thread",e.id)}`:void 0,contextActions:me,withPortalForMenu:!0,ref:ue,children:[(0,D.FD)("div",{className:"info",children:[(0,D.FD)("div",{className:"info-row",children:[(0,D.FD)("div",{className:(0,u.A)("title"),children:[(0,D.Y)(V.A,{topic:e,className:"oXJl4tra",observeIntersection:g}),(0,D.Y)("h3",{dir:"auto",className:"fullName",children:(0,O.A)(e.title)})]}),Boolean(se.mutedUntil)&&(0,D.Y)(M.A,{name:"muted"}),(0,D.Y)("div",{className:"separator"}),oe&&(0,D.Y)(M.A,{name:"lock-badge",className:"MB7Gomjn"}),d&&(0,D.Y)(j.A,{message:d,outgoingStatus:p})]}),(0,D.FD)("div",{className:"subtitle",children:[le(),(0,D.Y)(G.A,{chat:s,isPinned:ie,isMuted:ae,topic:e,wasTopicOpened:N,topics:k})]})]}),Q&&(0,D.Y)(J.A,{isOpen:E,onClose:B,onCloseAnimationEnd:X,confirmIsDestructive:!0,confirmHandler:ce,text:x("lng_forum_topic_delete_sure"),confirmLabel:x("Delete")}),ee&&(0,D.Y)(q.A,{isOpen:H,onClose:_,onCloseAnimationEnd:ne,chatId:n,topicId:e.id})]})}))),W=(0,i.ph)((0,o.EK)((e=>{const t=(0,d.nTw)(e).forumPanelChatId,n=t?(0,d.hds)(e,t):void 0,{chatId:i,threadId:o}=(0,d.Xf0)(e)||{},s=t?(0,d.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===i?Number(o):void 0,withInterfaceAnimations:(0,d.PKK)(e),topicsInfo:s}}),(e=>(0,d.clw)(e)))((({chat:e,currentTopicId:t,isOpen:n,isHidden:d,topicsInfo:F,onTopicSearch:T,onCloseAnimationEnd:x,onOpenAnimationStart:E,withInterfaceAnimations:B})=>{const{closeForumPanel:R,openChatWithInfo:O,loadTopics:U}=(0,o.ko)(),z=(0,i.li)(),K=(0,i.li)(),j=(0,i.li)(),{isMobile:V}=(0,g.Ay)(),J=e?.id;(0,i.vJ)((()=>{J&&!F&&U({chatId:J})}),[F,J]);const[$,q]=(0,i.J0)(!1),G=(0,C.A)(),W=(0,y.A)((()=>{R()}));(0,i.vJ)((()=>{B||n||x?.()}),[B,n,x]);const _=(0,y.A)((()=>{e&&O({id:e.id,shouldReplaceHistory:!0})})),{observe:Q}=(0,A.BL)({rootRef:K,throttleMs:200});(0,A.mv)(j,Q,(({isIntersecting:e})=>{q(!e)}));const Z=(0,i.Kr)((()=>F?(0,c.CO)(Object.values(F.topicsById),F.orderedPinnedTopicIds).map((({id:e})=>e)):[]),[F]),{orderDiffById:X,getAnimationType:ee}=(0,b.A)(Z,e?.id),[te,ne]=(0,v.A)((()=>{e&&U({chatId:e.id})}),Z,!F?.totalCount||Z.length>=F.totalCount,a.iIc),ie=(0,i.li)(!1),oe=n&&!d,se=(0,w.A)(oe);se!==oe&&(ie.current=!1),(0,f.A)({isActive:oe,onBack:W}),(0,i.vJ)((()=>oe?(0,h.A)(W):void 0),[W,oe]),(0,i.vJ)((()=>{se!==oe&&(0,r.Uz)((()=>{if(!z.current)return;const e=(0,i.VK)();(0,p.j)(z.current,e),E?.(),oe?(ie.current=!0,z.current.style.transform="none"):(ie.current=!1,z.current.style.transform="")}))}),[oe,E,se]),(0,i.vJ)((()=>{if(l.TF)return(0,m.wJ)(z.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(G.isRtl?m.ez.Left:m.ez.Right)&&(R(),!0)})}),[R,G.isRtl]);const ae=void 0===F;return(0,D.FD)("div",{ref:z,className:(0,u.A)("MlF2n1nb",$&&"SZ24u3cn",G.isRtl&&"Xs2y1fCE",!B&&"kmDMv6D8"),onTransitionEnd:n?void 0:x,children:[(0,D.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,D.Y)(k.A,{round:!0,size:"smaller",color:"translucent",onClick:W,ariaLabel:G("Close"),children:(0,D.Y)(M.A,{name:"close"})}),e&&(0,D.Y)(S.A,{noAvatar:!0,className:"Sf633zAP",chatId:e.id,onClick:_}),e&&(0,D.Y)(N.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:V,onTopicSearch:T})]}),e&&(0,D.Y)(I.A,{chatId:e.id}),(0,D.Y)("div",{className:"hGeb3TQJ"}),(0,D.FD)(Y.A,{className:"chat-list custom-scroll",ref:K,items:te,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(Z?.length||0)*a.HGU,onLoadMore:ne,sensitiveArea:a.C$_,beforeChildren:(0,D.Y)("div",{ref:j,className:"ERz3fcar"}),children:[Boolean(te?.length)&&function(){const n=Z.indexOf(te[0]);return te?.map(((i,o)=>(0,D.Y)(H,{chatId:e.id,topic:F.topicsById[i],style:`top: ${(n+o)*a.HGU}px;`,isSelected:t===i,observeIntersection:Q,animationType:ee(i),orderDiff:X[i]},i)))}(),ae&&!te?.length&&(0,D.Y)(P.A,{},"loading")]}),!ae&&1===te?.length&&te[0]===a.HxB&&(0,D.Y)(L,{chatId:J})]})})))},90423:(e,t,n)=>{n.d(t,{Ay:()=>r,j9:()=>l,zk:()=>c});var i=n(84051),o=n(31791),s=n(96454);const a=d();function r(e,t,n){const[o,r]=(0,i.J0)(Boolean(a&&document[a]));return(0,i.Nf)((()=>{const i=e.current,o=()=>{const e=Boolean(a&&document[a]);r(e),e?n?.(!1):t?.(!1),i instanceof HTMLVideoElement&&(i.controls=e)},s=()=>{r(!0),n&&n(!0)},c=()=>{r(!1),t&&t(!1)};return document.addEventListener("fullscreenchange",o,!1),document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),i&&(i.addEventListener("webkitbeginfullscreen",s,!1),i.addEventListener("webkitendfullscreen",c,!1)),()=>{document.removeEventListener("fullscreenchange",o,!1),document.removeEventListener("webkitfullscreenchange",o,!1),document.removeEventListener("mozfullscreenchange",o,!1),i&&(i.removeEventListener("webkitbeginfullscreen",s,!1),i.removeEventListener("webkitendfullscreen",c,!1))}}),[]),a||s.pz?[o,()=>{var t;e.current&&(a||s.pz)&&!o&&((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 c=()=>{const[e,t]=(0,i.J0)(!1);return(0,i.vJ)((()=>{const e=()=>{t(l())},n=window.electron?.on(o.v.FULLSCREEN_CHANGE,t);return window.electron?.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 d(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function l(){const e=d();return Boolean(e&&document[e])}},91930:(e,t,n)=>{n.d(t,{A:()=>T,b:()=>F});var i=n(84051),o=n(31481),s=n(90709),a=n(3544),r=n(70636),c=n(87357),d=n(9716),l=n(91034),u=n(76023),h=n(4961),m=n(18501),p=n(11217),g=n(5912),f=n(39351),v=n(62587),A=n(59030),y=n(22867),C=n(64154),w=n(42452),b=n(18276),I=n(27860),S=n(18653),M=n(86070),N=n(20021);const k=" ",Y=({className:e,message:t,replyInfo:n,sender:l,senderChat:u,forwardSender:I,composerForwardSenders:Y,title:F,customText:T,isProtected:x,isInComposer:D,noUserColors:E,chatTranslations:L,requestedChatTranslationLanguage:B,observeIntersectionForLoading:R,observeIntersectionForPlaying:O,onClick:U})=>{const z=(0,i.li)(),K=(0,g.Vz)(z,R),j=(0,i.Kr)((()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}}),[t,n]),V=j?.content?.video?.isGif?j.content.video:void 0,J=Boolean(V&&!V.previewPhotoSizes?.length),$=j&&(0,s.EO)(j,J?"full":"pictogram"),q=(0,v.A)($,!K),G=(0,y.A)(j),H=Boolean(j&&(0,s.lk)(j)),W=Boolean(j&&(0,s.y2)(j)),_=Boolean("message"===n?.type&&n.isQuote),Q="message"===n?.type?n.replyFrom:void 0,Z=t&&(0,s.ZR)(t),{translatedText:X}=(0,C.A)(L,t?.chatId,Z?t?.id:void 0,B),ee=(0,A.A)(),te=(0,f.A)(),ne=l?(0,r.F9)(ee,l):Q?.hiddenUserName||t?.forwardInfo?.hiddenUserName,ie=(0,i.Kr)((()=>{if(!Y)return;const e=Y.map((e=>(0,r.F9)(te,e))).filter(Boolean);return te.conjunction(e)}),[Y,te]),oe=u?(0,r.F9)(ee,u):void 0,se=I?(0,r.F9)(ee,I):t?.forwardInfo?.hiddenUserName,ae=l&&l.id===I?.id,{handleClick:re,handleMouseDown:ce}=(0,p.Q)(U);return(0,N.FD)(M.A,{peer:l,emojiIconClassName:"EmbeddedMessage--background-icons",ref:z,shouldReset:!0,noUserColors:E,className:(0,c.A)("EmbeddedMessage",e,_&&"is-quote",G&&"with-thumb","no-selection",Y&&"is-input-forward"),dir:te.isRtl?"rtl":void 0,onClick:re,onMouseDown:ce,children:[(0,N.Y)("div",{className:"hover-effect"}),(0,N.Y)(w.A,{}),G&&P(G,q,J,H,x,W),(0,N.FD)("div",{className:"message-text",children:[(0,N.Y)("p",{className:(0,c.A)("embedded-text-wrapper",_&&"multiline"),children:"message"===n?.type&&n.quoteText?(0,m.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?(0,N.Y)(S.A,{message:t,noEmoji:Boolean(G),translatedText:X,observeIntersectionForLoading:R,observeIntersectionForPlaying:O,emojiSize:17}):T||function(e){if(!e||e.content.text)return k;const t=(0,a.GG)(ee,e.content,{});return t&&t!==o.bVP?(0,N.Y)("span",{children:(0,h.A)(t)}):k}(j)||k}),(0,N.FD)("div",{className:"message-title",children:[function(){if(F)return(0,h.A)(F);if(!ne&&!ie)return k;let e;u&&((0,s.WX)(u)&&(e="channel-filled"),(0,s.YE)(u)&&(e="group-filled"));const t=D&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,N.FD)("span",{className:"embedded-sender-wrapper",children:[(!u||!!(0,d.L8)(u?.id)||u.id!==l?.id)&&(0,N.FD)("span",{className:"embedded-sender",children:[!Y&&ne&&(0,h.A)(t?ee("ReplyToQuote",ne):ne),ie&&(0,h.A)(te("ComposerTitleForwardFrom",{users:ie},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,N.Y)(b.A,{name:e,className:"embedded-chat-icon"}),e&&oe&&(0,N.Y)("span",{className:"embedded-sender-chat",children:(0,h.A)(oe)})]})}(),se&&!ae&&(0,N.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,N.Y)(b.A,{name:I?"share-filled":"forward",className:"embedded-origin-icon"}),(0,N.Y)("span",{className:"forward-sender-title",children:(0,h.A)(se)})]})]})]})]})};function P(e,t,n,i,o,s){const{width:a,height:r}=(0,u.mr)(),d=t||e,l=n&&t;return(0,N.FD)("div",{className:(0,c.A)("embedded-thumb",i&&"round"),children:[!s&&!l&&(0,N.Y)("img",{src:d,width:a,height:r,alt:"",className:"pictogram",draggable:!1}),!s&&l&&(0,N.Y)("video",{src:t,width:a,height:r,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,N.Y)(I.A,{thumbDataUri:l?e:d,isVisible:Boolean(s),width:a,height:r}),o&&(0,N.Y)("span",{className:"protector"})]})}const F=(0,l.A)(Y),T=Y},92111:(e,t,n)=>{n.d(t,{A:()=>v});var i=n(84051),o=n(13439),s=n(23174),a=n(90709),r=n(29807),c=n(39761),d=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,i.vJ)((()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,o.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,c.A)(n),t.removeChild(n)}),1e3)}(e),t===s.qZ.BlobUrl&&(0,d.NN)(e))}))}))})(function(e,t){const n=(0,r._bp)((0,o.mS)(),e);if(!n||!n.orderedIds?.length)return[];const i=function(e,t){const n=e.indexOf(t),i=Math.max(n-5,0),o=Math.min(n+5,e.length);return e.slice(i,o)}(n.orderedIds,t),c=[];return i.forEach((t=>{if(g[e]?.has(t))return;const i=n.byId[t];if(!i||!("content"in i))return;const o=Boolean(i.content.video);c.push({hash:(0,a.EN)(i,"full"),format:o?s.qZ.Progressive:s.qZ.BlobUrl,isStream:o&&(0,p.c)(m.G)}),c.push({hash:(0,a.EN)(i),format:s.qZ.BlobUrl}),i.content.altVideos&&c.push({hash:(0,a.EN)(i,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)})),c}(e,n))}))}),[t,e])}},93809:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(30857),s=n(35297);function a(e,t){const n=void 0===t,a=(0,i.li)(n),r=(0,i.li)(),c=(0,o.A)();return(0,s.A)((()=>{n||(a.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))}),e),(0,i.vJ)((()=>{if(n||a.current)return;const e=()=>{a.current=!0,c()};t>0?r.current=window.setTimeout(e,t):e()}),e),a.current}},95362:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(37836);const o=10,s=1e3;let a=[],r=!1;function c(e,t){a.push({url:e,filename:t}),r||(r=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of a)d(t),e++,e===o&&(await(0,i.v7)(s),e=0);a=[]}(),r=!1}),s))}function d({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)}}},95704:(e,t,n)=>{n.d(t,{h:()=>l});var i=n(23174),o=n(4875);const s=262144,a=5242879,r=new Map,c=new Map,d=new Map;async function*l(e,t=0,n=s){const l=e.match(/fileSize=(\d+)/);let u;for(u=l?l&&Number(l[1]):c.get(e);;){if(u&&t>=u)return;let s=t+n-1;u&&s>u&&(s=u-1);const l=`${e}:${t}-${s}`;let h=r.get(l);if(!h){let n=d.get(l);n||(n=(0,o.px)("downloadMedia",{mediaFormat:i.qZ.Progressive,url:e,start:t,end:s}),d.set(l,n));const m=await n.finally((()=>{d.delete(l)}));if(!m?.arrayBuffer)return;m.fullSize&&!u&&(u=m.fullSize,c.set(e,m.fullSize)),h=m.arrayBuffer,s<=a&&r.set(l,m.arrayBuffer)}yield h,t=s+1}}},97046:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97676:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(87357),s=n(37661),a=n(5912),r=n(17712),c=n(62587),d=n(10221),l=n(18104),u=n(3325);var h=n(20021);const m=(0,i.ph)((({messageId:e,isMirrored:t,effect:n,shouldPlay:m,observeIntersectionForLoading:p,observeIntersectionForPlaying:g,onStop:f})=>{const v=(0,i.li)(),A=(0,i.li)(),y=(0,a.Vz)(v,p),C=(0,a.Vz)(v,g),[w,b,I]=(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,c.A)(k,!y),P=(0,r.A)((()=>{I(),f?.()})),F=(0,d.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,i.vJ)((()=>{S&&F(),N()}),[F,N,S]),(0,i.vJ)((()=>{C&&m&&Y&&(b(),M())}),[C,Y,m,F]);const T=(0,o.A)("McmbiWZE",t&&"wNvU2uqi");return(0,h.Y)("div",{className:(0,o.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:P},`effect-${e??n.id}`)})})}))},97967:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}}}]);
//# sourceMappingURL=8013.091a25ce0ea50fd3fb5c.js.map