TelegramPWA/dist/1533.3c81535df26ae9299c4b.js
Alexander Zinchuk 5625b75046 [Build]
2025-09-30 16:53:21 +02:00

2 lines
352 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([[1533],{45:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(41036),s=n(18276),a=n(20021),r=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(r||{});const d=(0,o.ph)(({status:e})=>(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(i.Ay,{name:"reveal",activeKey:r[e],children:"failed"===e?(0,a.Y)("div",{className:"MessageOutgoingStatus--failed",children:(0,a.Y)(s.A,{name:"message-failed"})}):(0,a.Y)(s.A,{name:`message-${e}`})})}))},285:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(4961),d=n(59030),l=n(94189),c=n(20021);const u=(0,o.ph)((0,i.EK)((e,{userId:t})=>{const n=(0,a.meB)(e),o=t&&(0,a.mBe)(e,t);return{chat:n,contactName:o?(0,s.u0)(o):void 0}})(({isOpen:e,chat:t,userId:n,contactName:s,onClose:a})=>{const{deleteChatMember:u}=(0,i.ko)(),h=(0,d.A)(),m=(0,o.hb)(()=>{u({chatId:t.id,userId:n}),a()},[t,u,a,n]);if(t&&n)return(0,c.Y)(l.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 o=n(84051),i=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,i.h)();function r(e){(0,o.vJ)(()=>{if(!e)return;const t=Object.entries(e);return a.addCallback(function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach(([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:o,meta:i,mod:s,shift:a,key:r}=e,{altKey:d,ctrlKey:l,metaKey:c,shiftKey:u,key:h}=t;if(n!==d)return!1;if(s){if(!l&&!c)return!1}else{if(o!==l)return!1;if(i!==c)return!1}return a===u&&Boolean(r&&(h.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map(e=>e.trim()),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},o=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find(e=>!o.includes(e))}}(e),t)})(t)(e)&&n(e)})})},[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},2429:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},3225:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(16120),d=n(96454),l=n(36353),c=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,i.ko)(),[M,N,k]=(0,g.A)(!1),Y=(0,h.gs)(()=>{const n=t();if(!e||!n||!C()?.collapsed)return;if(!n.match(d.TL?r.A:s.bpX))return;const o=(0,c.LV)(w.current);return o.match(d.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,o.vJ)(()=>{if(!e||!F)return;const t=P();if(t){if(!T){const e=d.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&I({emoji:e})}}else S()},[e,F,P,T,S,I]);const D=(0,f.A)(t=>{const o=P();if(!e||!o)return;const i=w.current,s=(0,c.LV)(i),r=d.TL?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/o.length,p=s.replace(h,(0,u.hB)(t).repeat(m)),g=i.innerHTML.substring(s.length);n(`${p}${g}`),(0,a.Uz)(()=>{(0,l.A)(i,!0,!0)})});return(0,o.vJ)(k,[k,t]),{isCustomEmojiTooltipOpen:Boolean(F&&T&&!M),closeCustomEmojiTooltip:N,insertCustomEmoji:D}}},5130:(e,t,n)=>{n.d(t,{U:()=>a});var o=n(14235),i=n(37836);class s{requestStates=new Map;requestStatesByCallback=new Map;pendingPayloads=[];pendingTransferables=[];constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n}destroy(){}init(...e){this.postMessageOnTickEnd({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,{transferables:i,...s}=e,a=(0,o.A)(),r={type:"callMethod",messageId:a,...s},d={messageId:a},l=new Promise((e,t)=>{Object.assign(d,{resolve:e,reject:t})});if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();d.callback=e,n.set(e,d)}return t.set(a,d),l.catch(()=>{}).finally(()=>{t.delete(a),d.callback&&n.delete(d.callback)}),this.postMessageOnTickEnd(r,i),l}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessageOnTickEnd({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;e.channel===n&&e.payloads.forEach(e=>{if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)})}postMessageOnTickEnd(e,t){this.pendingPayloads.push(e),t&&this.pendingTransferables.push(...t),this.postMessagesOnTickEnd()}postMessagesOnTickEnd=(0,i.Fe)(()=>{const{channel:e}=this,t=this.pendingPayloads,n=this.pendingTransferables;this.pendingPayloads=[],this.pendingTransferables=[],this.target.postMessage({channel:e,payloads:t},n)})}function a(e,t,n){const o=new s(e,t,n);function i({data:e}){o.onMessage(e)}return e.addEventListener("message",i),o.destroy=()=>{e.removeEventListener("message",i)},o}},6070:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomSendMenu",!t);return n?(0,s.Y)(n,{...e}):void 0}},7985:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(66644),s=n(83868),a=n(17712);const r=7,d=100,l=7,c="no-overscroll",u="no-touch",h=350,m=75,p={lastDeltas:new Array(r).fill(0),lastAverageDelta:0,isStartedAtTop:!1,resetStartTopAt:void 0,timeout:void 0};function g(e,t,n,g){const[f,v]=(0,o.Ul)("normal"),A=(0,o.li)({...p}),y=(0,o.li)(),C=(0,o.li)(),w=(0,a.A)(()=>{clearTimeout(y.current),v("overscroll"),t?.()}),b=(0,a.A)(()=>{v("animating"),y.current=window.setTimeout(()=>{v("normal")},h),n?.()}),I=(0,a.A)(e=>{clearTimeout(A.current.timeout),A.current.timeout=window.setTimeout(()=>{A.current={...p}},e)}),S=(0,a.A)(t=>{const n=e.current;if(!n||t.defaultPrevented)return;const{deltaY:o}=t,{scrollTop:i}=n,a=f(),c=A.current,u=c.lastAverageDelta,h=0===c.lastDeltas.at(-1)||c.resetStartTopAt&&Date.now()>=c.resetStartTopAt;0===i&&h&&(c.isStartedAtTop=!0,c.resetStartTopAt=void 0);const m=A.current.lastDeltas.slice();m.push(o),m.length>r&&m.shift(),A.current.lastDeltas=m;const p=m.reduce((e,t)=>e+t,0)/m.length;A.current.lastAverageDelta=p;const g=Math.abs(p)-Math.abs(u)>l;return I(d),0===i&&o<0&&"overscroll"!==a?(c.resetStartTopAt||(c.resetStartTopAt=Date.now()+d),void(g&&c.isStartedAtTop&&w())):"animating"===a&&o>0?void(0,s.A)(t):"overscroll"===a&&o>0?(b(),void(0,s.A)(t)):void 0}),M=(0,a.A)(t=>{const n=e.current;if(!n||1!==t.touches.length)return;const{scrollTop:o}=n,i=f();0!==o&&"overscroll"!==i||(C.current=t.touches[0].clientY)}),N=(0,a.A)(t=>{const n=e.current,o=C.current;if(!n||void 0===o||1!==t.touches.length)return;const{scrollTop:i}=n,s=f(),a=t.touches[0].clientY-o;return"animating"!==s?0===i&&a>m&&"overscroll"!==s?(w(),void(C.current=void 0)):"overscroll"===s&&a<-m?(b(),void(C.current=void 0)):void 0:void 0}),k=(0,a.A)(()=>{C.current=void 0});(0,o.vJ)(()=>{const t=e.current;if(!g&&t)return(0,i.RK)(()=>{t.classList.add(c)}),()=>{(0,i.RK)(()=>{t.classList.remove(c)})}},[e,g]),(0,o.vJ)(()=>{const t=e.current;if(!g&&t)return(0,i.RK)(()=>{t.classList.toggle(u,"normal"!==f())}),()=>{(0,i.RK)(()=>{t.classList.remove(u)})}},[e,g,f]),(0,o.vJ)(()=>{const t=e.current;if(!g&&t)return t.addEventListener("wheel",S,{passive:"normal"===f()}),t.addEventListener("touchstart",M,{passive:!0}),t.addEventListener("touchmove",N,{passive:!0}),t.addEventListener("touchend",k,{passive:!0}),t.addEventListener("touchcancel",k,{passive:!0}),()=>{t.removeEventListener("wheel",S),t.removeEventListener("touchstart",M),t.removeEventListener("touchmove",N),t.removeEventListener("touchend",k),t.removeEventListener("touchcancel",k);const e=A.current;e?.timeout&&clearTimeout(e.timeout)}},[e,S,M,N,k,f,g])}},9442:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(13439),s=n(23174),a=n(66644),r=n(90709),d=n(70636),l=n(36353),c=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,o.J0)(),[P,F,T]=(0,g.A)(!1),D=(0,m.gs)(()=>{const n=t();if(!e||!C()?.collapsed||!n.includes("@"))return;const o=(0,u.LV)(b.current);return(0,h.S)(o).match(y)?.[0].trim()},[e,t,C,b],A),x=(0,p.A)(D,[D,t,C],!0),E=(0,p.A)(()=>e&&t().startsWith("@"),[t,e]);(0,o.vJ)(()=>{const e=x();if(!e||!I&&!S)return void Y(void 0);const t=(0,i.mS)().users.byId;if(!t)return void Y(void 0);const n=I?.reduce((e,t)=>(t.userId!==M&&e.push(t.userId),e),[]),o=e.substring(1),s=(0,d.PU)({ids:(0,c.Am)([...E()&&S||[],...n||[]]),query:o,type:"user"});Y(Object.values((0,c._E)(t,s)))},[M,I,S,x,E]);const L=(0,v.A)((e,t=!1,o=!1)=>{if(!e.hasUsername&&!(0,d.F9)(N,e))return;const i=(0,r.Kl)(e),c=(0,d.F9)(N,e)||"",h=i?`@${i}`:`<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 >${c}</a>`,m=b.current,p=w((0,u.LV)(m)),g=o?p.length:p.lastIndexOf("@"),f=(i?i.length+1:c.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${h}&nbsp;`,o=w(m.innerHTML).substring(p.length),i=(0,u.JC)(m);n(`${e}${o}`),(0,a.Uz)(()=>{const e=i+f+1;(0,l.A)(m,t),e>=0&&(0,u.vZ)(m,e)})}Y(void 0)});return(0,o.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 o=n(84051),i=n(87894),s=n(79882),a=n(73767);function r(e,t){const n=(0,o.Kr)(()=>{if(e)return e.reduce((e,t,n)=>(e[t]=n,e),{})},[e]),r=(0,a.A)(n),d=(0,a.A)(t),l=(0,o.Kr)(()=>n&&r&&t===d?(0,i.LG)(n,(e,t)=>void 0!==r[t]?e-r[t]:-1/0):{},[t,n,d,r]);return{orderDiffById:l,getAnimationType:(0,s.W)(l)}}},10221:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(66644),s=n(76023),a=n(17712);const r=s.$;function d({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:d,id:l}){const c=(0,a.A)(()=>{const o=t.current,a=e.current;if(!o||!a)return;const d=a.getBoundingClientRect(),l=o.getBoundingClientRect(),c=window.innerWidth;(0,i.RK)(()=>{const e=d.top+d.height/2,t=d.bottom,i=s?t:e;o.style.top=i-l.height/2+"px",n?o.style.left=d.left-r+"px":o.style.right=c-d.right-r+"px"})});return(0,o.vJ)(()=>{d||c()},[d,l]),(0,o.vJ)(()=>{if(d)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",c,{passive:!0}),()=>{t.removeEventListener("scroll",c)}):void 0},[d,e]),c}},11359:(e,t,n)=>{n.d(t,{L:()=>i});const o=5;function i(e,t){const{commonAncestorContainer:n}=e;let i=n,s=1;for(;i&&i.id!==t&&s<o;)i=i.parentElement,s++;return Boolean(i&&i.id===t)}},11462:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,o.li)(e),n=(0,o.li)(!1),r=(0,i.A)();(0,a.A)(()=>{e&&(t.current=!0)},[e]);const d=(0,s.A)(()=>{t.current=!1,n.current=!1,r()}),l=(0,s.A)(()=>{n.current=!0,r()});return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:d,handleForumPanelAnimationStart:l}}},14413:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(84051),i=n(13439),s=n(31481),a=n(39351),r=n(19806),d=n(94189);var l=n(20021);const c=(0,o.ph)((0,i.EK)(e=>({verifyAgeMin:e.appConfig.verifyAgeMin||s.lYi}))(({isOpen:e,onClose:t,shouldAlwaysShow:n,onAlwaysShowChanged:o,confirmHandler:i,verifyAgeMin:s})=>{const c=(0,a.A)();return(0,l.FD)(d.A,{title:c("TitleSensitiveModal",{years:s}),confirmLabel:c("ButtonSensitiveView"),isOpen:e,onClose:t,confirmHandler:i,children:[c("TextSensitiveModal"),(0,l.Y)(r.A,{className:"mYXi2mIC",label:c("ButtonSensitiveAlways",{years:s}),checked:n,onCheck:o})]})}))},15006:(e,t,n)=>{n.d(t,{U:()=>p,A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(6842),d=n(14235);const l={root:"AN8wkEiR",ghost:"ANWk2pWP",scale:"kMHxyoSt",elementContainer:"UDCMfXxs"};var c=n(20021);const u=50,h=1e3,m=(0,o.ph)(()=>(0,c.Y)("div",{className:l.root,id:s.Lj4}));function p(e){const t=(0,i.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),o=n.left+window.scrollX,h=n.top+window.scrollY,m=n.width,p=n.height;if(o+m+u<0||o-u>window.innerWidth||h+p+u<0||h-u>window.innerHeight)return!1;const f=Math.floor(Date.now()/1e3),v=`${s.xcU}-${(0,d.A)()}`,A=(0,c.FD)("svg",{className:l.ghost,width:m,height:p,style:`left: ${o}px; top: ${h}px;`,viewBox:`0 0 ${m} ${p}`,children:[(0,c.Y)("defs",{children:g(v,Math.min(m,p),f)}),(0,c.Y)("g",{filter:`url(#${v})`,children:(0,c.Y)("foreignObject",{className:l.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,c.FD)("filter",{xmlns:s.jNX,id:e,x:"-150%",y:"-150%",width:"400%",height:"400%","color-interpolation-filters":"sRGB",children:[(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"1",result:"dustNoise",seed:n}),(0,c.Y)("feComponentTransfer",{in:"dustNoise",result:"dustNoiseMask",children:(0,c.Y)("feFuncA",{type:"linear",slope:"5",intercept:"0",children:(0,c.Y)("animate",{attributeName:"slope",values:"5; 2; 1; 0",dur:`${h}ms`,fill:"freeze"})})}),(0,c.Y)("feComposite",{in:"SourceGraphic",in2:"dustNoiseMask",operator:"in",result:"dustySource"}),(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.015",numOctaves:"1",result:"displacementNoise1",seed:n+1}),(0,c.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"1",numOctaves:"2",result:"displacementNoise2",seed:n+2}),(0,c.FD)("feMerge",{result:"combinedNoise",children:[(0,c.Y)("feMergeNode",{in:"displacementNoise1"}),(0,c.Y)("feMergeNode",{in:"displacementNoise2"})]}),(0,c.Y)("feDisplacementMap",{in:"dustySource",in2:"combinedNoise",scale:"0",xChannelSelector:"R",yChannelSelector:"G",children:(0,c.Y)("animate",{attributeName:"scale",values:"0; "+3*t,dur:`${h}ms`,fill:"freeze"})})]})}},17169:(e,t,n)=>{n.d(t,{A:()=>o});const o={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},17751:(e,t,n)=>{n.d(t,{A:()=>C});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(91048),d=n(87357),l=n(4961),c=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,o.ph)((0,i.EK)((e,{userId:t,forceShowSelf:n})=>{const{isSynced:o}=e,i=t?(0,r.mBe)(e,t):void 0,s=t?(0,r.K0y)(e,t):void 0,a=!n&&i&&i.isSelf,d=a?i:(0,r.mBe)(e,e.currentUserId);return{user:i,userStatus:s,isSavedMessages:a,areMessagesLoaded:Boolean(t&&(0,r.zeq)(e,t)),self:d,isSynced:o}})(({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:D,user:x,userStatus:E,self:L,isSavedMessages:B,isSavedDialog:R,areMessagesLoaded:O,adminMember:U,ripple:K,className:z,storyViewerOrigin:V,isSynced:j,onEmojiStatusClick:J,iconElement:$,rightElement:q})=>{const{loadFullUser:H,openMediaViewer:G,loadMoreProfilePhotos:W}=(0,i.ko)(),_=(0,h.A)(),{id:Q}=x||{},Z=b&&!B;(0,o.vJ)(()=>{Q&&(M&&j&&H({userId:Q}),b&&W({peerId:Q,isPreload:!0}))},[Q,M,b,j]),(0,c.A)(6e4);const X=(0,u.A)((e,t)=>{x&&t&&(e.stopPropagation(),G({isAvatarView:!0,chatId:x.id,mediaIndex:0,origin:"jumbo"===n?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ee=(0,o.Kr)(()=>x&&I&&(0,a.Kl)(x),[x,I]);if(!x&&!e)return;const te=U?U.customTitle||_(U.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,y.FD)("div",{className:(0,d.A)("ChatInfo",z),dir:!D&&_.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||x,className:(0,d.A)(R&&"overlay-avatar"),isSavedMessages:B,isSavedDialog:R,withStory:S,storyViewerOrigin:V,storyViewerMode:"single-peer",onClick:Z?X:void 0},x?.id),(0,y.FD)("div",{className:"info",children:[te?(0,y.FD)("div",{className:"info-name-title",children:[(0,y.Y)(f.A,{peer:x,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||x,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,l.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(!x)return;if(t)return(0,y.Y)(A.A,{typingStatus:t});if((0,a.DX)(x.id))return;const n=(0,a.CD)(_,x,E),o=(0,d.A)("handle",n&&"withStatus");return(0,y.FD)("span",{className:(0,d.A)("status",(0,a.PF)(x,E,!0)&&"online"),children:[ee&&(0,y.Y)("span",{className:o,children:ee}),n&&(0,y.Y)("span",{className:"user-status",dir:"auto",children:n})]})}()]}),K&&(0,y.Y)(m.A,{}),q]})}))},17778:(e,t,n)=>{n.d(t,{S:()=>r});const o=/(<br>|<br\s?\/>)/g,i=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(i," ").replace(o,"\n").replace(s,"").replace(a,"")}},19210:(e,t,n)=>{n.d(t,{A:()=>V});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(27109),c=n(91048),u=n(96454),h=n(87357),m=n(9716),p=n(49763),g=n(66414),f=n(98255),v=n(43874),A=n(47067),y=n(49746),C=n(37661),w=n(5912),b=n(17712),I=n(50680),S=n(53188),M=n(21849),N=n(54314),k=n(34431),Y=n(18276),P=n(9267),F=n(81642),T=n(22720),D=n(97967),x=n(97046),E=n(24807);const L="AA5s1Pu4";var B=n(20021);const R=(0,o.ph)(({isSelected:e,isActive:t,isMobile:n})=>(0,B.Y)("div",{className:(0,h.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,B.FD)("div",{className:"nl36F75B",children:[(0,B.Y)("div",{className:L}),(0,B.Y)("div",{className:L}),(0,B.Y)("div",{className:L})]})}));var O=n(35049),U=n(18501);const K="oIgI9O0L",z=(0,o.ph)(({orderedFolderIds:e,chatFoldersById:t})=>{if(!e)return;const n=e.slice(0,3),o=e.length-n.length;return(0,B.FD)("div",{className:"cgAMX02q",children:[n.map(e=>{const n=t?.[e];return n&&(0,B.Y)("div",{className:(0,h.A)("ChatTags",K,(0,O.a)({color:n.color})),children:(0,U.fd)({text:n.title.text,entities:n.title.entities,noCustomEmojiPlayback:n.noTitleAnimations,emojiSize:12})},n.id)}),o>0&&(0,B.FD)("div",{className:`ChatTags ${K} hZDqIz3W`,children:["+",o]})]})}),V=(0,o.ph)((0,i.EK)((e,{chatId:t,isSavedDialog:n,isPreview:o,previewMessageId:i})=>{const a=(0,c.hds)(e,t),r=(0,c.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const d=(0,p.N)(t),{areTagsEnabled:u}=e.chatFolders,h=(0,c.g29)(e),m=i||(0,c.ZZX)(e,t,n?"saved":"all"),g=i?(0,c.O5q)(e,t,i):(0,c.yHC)(e,t,n?"saved":"all"),{isOutgoing:f,forwardInfo:v}=g||{},A=n&&v?.fromId?(0,c.PVB)(e,v.fromId):void 0,y=g?(0,c.Y7C)(e,g):void 0,C=A||y,{chatId:w,threadId:b,type:I}=(0,c.Xf0)(e)||{},S=!o&&t===w&&(n?t===b:b===s.l3),M=a.isForum&&t===w||t===(0,c.nTw)(e).forumPanelChatId,N=(0,c.K0y)(e,t),k=g&&(0,c.nkm)(e,g),Y=(0,c.C5H)(e,t,s.l3,"typingStatus"),P=(0,c.xyP)(e,t),F=g?.content.storyData,T=F&&(0,c.Msb)(e,F.peerId,F.id),D=(0,c.trm)(e),x=(0,c.k2W)(e,t);return{chat:a,isMuted:(0,l.If)(a,(0,c.K52)(e),(0,c.P5N)(e,a.id)),lastMessageSender:C,draft:(0,c.GA4)(e,t,s.l3),isSelected:S,isSelectedForum:M,isForumPanelOpen:(0,c.clw)(e),canScrollDown:S&&"thread"===I,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,lastMessageOutgoingStatus:f&&g?(0,c.Tl2)(e,g):void 0,user:r,userStatus:N,lastMessageTopic:k,typingStatus:Y,withInterfaceAnimations:(0,c.PKK)(e),lastMessage:g,lastMessageId:m,currentUserId:e.currentUserId,listedTopicIds:P?.listedTopicIds,topics:P?.topicsById,isSynced:e.isSynced,lastMessageStory:T,isAccountFrozen:D,monoforumChannel:x,chatFolderIds:d,orderedFolderIds:e.chatFolders.orderedIds,chatFoldersById:e.chatFolders.byId,areTagsEnabled:u&&h}})(({chatId:e,folderId:t,orderDiff:n,animationType:l,isPinned:p,listedTopicIds:L,topics:O,observeIntersection:U,chat:K,monoforumChannel:V,lastMessageStory:j,isMuted:J,user:$,userStatus:q,lastMessageSender:H,lastMessageOutgoingStatus:G,offsetTop:W,draft:_,withInterfaceAnimations:Q,isSelected:Z,isSelectedForum:X,isForumPanelOpen:ee,canScrollDown:te,canChangeFolder:ne,lastMessageTopic:oe,typingStatus:ie,lastMessageId:se,lastMessage:ae,isSavedDialog:re,currentUserId:de,isPreview:le,previewMessageId:ce,className:ue,isSynced:he,onDragEnter:me,isAccountFrozen:pe,chatFolderIds:ge,orderedFolderIds:fe,chatFoldersById:ve,areTagsEnabled:Ae,withTags:ye})=>{const{openChat:Ce,openSavedDialog:we,toggleChatInfo:be,focusLastMessage:Ie,focusMessage:Se,loadTopics:Me,openForumPanel:Ne,closeForumPanel:ke,setShouldCloseRightColumn:Ye,reportMessages:Pe,openFrozenAccountModal:Fe,updateChatMutedState:Te}=(0,i.ko)(),{isMobile:De}=(0,v.Ay)(),[xe,Ee,Le]=(0,C.A)(),[Be,Re,Oe]=(0,C.A)(),[Ue,Ke,ze]=(0,C.A)(),[Ve,je,Je]=(0,C.A)(),[$e,qe,He]=(0,C.A)(),[Ge,We,_e]=(0,C.A)(),{isForum:Qe,isForumAsMessages:Ze,isMonoforum:Xe}=K||{};(0,y.A)(re?de:e,se,ae);const et=(0,o.Kr)(()=>{const e=new Set(ge);return fe?.filter(n=>{if(!e.has(n))return;const o=n===t,i=n===r.DSF,s=ve?.[n],a=void 0!==s?.color&&-1!==s.color;return!o&&!i&&a})},[fe,t,ve,ge]),tt=Ae&&ye&&Boolean(et?.length),{renderSubtitle:nt,ref:ot}=(0,S.A)({chat:K,chatId:e,lastMessage:ae,typingStatus:ie,draft:_,statefulMediaContent:(0,d.FE)({story:j}),lastMessageTopic:oe,lastMessageSender:H,observeIntersection:U,animationType:l,withInterfaceAnimations:Q,orderDiff:n,isSavedDialog:re,isPreview:le,topics:O,noForumTitle:tt}),it=(0,f.A)(c.sRo),st=(0,b.A)(()=>{const t=De&&Ze;if(De&&Ye({value:!0}),le)Se({chatId:e,messageId:ce});else{if(re)return we({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(De&&be({force:!1}));if(Qe){if(ee)return void ke(void 0,{forceOnHeavyAnimation:!0});if(t||Ne({chatId:e},{forceOnHeavyAnimation:!0}),!Ze)return}Ce({id:e,noForumTopicPanel:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),Z&&te&&Ie()}}),at=(0,b.A)(t=>{t.preventDefault(),me?.(e)}),rt=(0,b.A)(()=>{pe?Fe():(je(),Ee())}),dt=(0,b.A)(()=>{pe?Fe():(qe(),Re())}),lt=(0,b.A)(()=>{pe?Fe():Te({chatId:e,mutedUntil:r.Os5})}),ct=(0,b.A)(()=>{We(),Ke()}),ut=(0,b.A)(()=>{pe?Fe():K&&Pe({chatId:K.id,messageIds:[]})}),ht=(0,A.A)({chat:K,user:$,handleDelete:rt,handleMute:dt,handleUnmute:lt,handleChatFolderChange:ct,handleReport:ut,folderId:t,isPinned:p,isMuted:J,canChangeFolder:ne,isSavedDialog:re,currentUserId:de,isPreview:le,topics:O}),mt=(0,w.Vz)(ot,K?U:void 0);(0,o.vJ)(()=>{mt&&Qe&&he&&void 0===L&&Me({chatId:e})},[e,L,he,Qe,mt]);const pt=$&&q&&(0,d.PF)($,q),{hasShownClass:gt}=(0,I.A)(pt),ft=(0,o.Kr)(()=>{if(u.OS)return re?`#${(0,g.az)(de,"thread",e)}`:`#${(0,g.az)(e,"thread",s.l3)}`},[e,de,re]);if(!K)return;const vt=$||K,At=(0,h.A)("Chat chat-item-clickable",(0,m.L8)(e)?"private":"group",Qe&&"forum",Z&&"selected",X&&"selected-forum",le&&"standalone",Ae&&ye&&"chat-item-with-tags",ue);return(0,B.FD)(T.A,{ref:ot,className:At,href:ft,style:`top: ${W}px`,ripple:!Qe&&!De,contextActions:ht,onClick:st,onDragEnter:at,withPortalForMenu:!0,children:[(0,B.FD)("div",{className:(0,h.A)("status","status-clickable"),children:[(0,B.Y)(M.A,{peer:Xe?V:vt,isSavedMessages:$?.isSelf,isSavedDialog:re,size:le?"medium":"large",asMessageBubble:Xe,withStory:!$?.isSelf&&!Xe,withStoryGap:gt||Boolean(K.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,B.FD)("div",{className:"avatar-badge-wrapper",children:[(0,B.Y)("div",{className:(0,h.A)("avatar-online","avatar-badge",gt&&"avatar-online-shown")}),!gt&&Boolean(K.subscriptionUntil)&&(0,B.Y)(P.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,B.Y)(E.A,{chat:K,isMuted:J,shouldShowOnlyMostImportant:!0,forceHidden:it,topics:O,isSelected:Z})]}),K.isCallActive&&K.isCallNotEmpty&&(0,B.Y)(R,{isMobile:De,isSelected:Z,isActive:Q})]}),(0,B.FD)("div",{className:(0,h.A)("info",Ae&&ye&&"has-tags"),children:[(0,B.FD)("div",{className:"info-row",children:[(0,B.Y)(k.A,{peer:Xe?V:vt,isMonoforum:Xe,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:e===$?.id&&$?.isSelf,isSavedDialog:re,observeIntersection:U,withStatusTextColor:Z}),J&&!re&&(0,B.Y)(Y.A,{name:"muted"}),(0,B.Y)("div",{className:"separator"}),ae&&(0,B.Y)(F.A,{message:ae,outgoingStatus:re?void 0:G,draftDate:_?.date})]}),(0,B.FD)("div",{className:"subtitle",children:[nt(),!le&&(0,B.Y)(E.A,{chat:K,isPinned:p,isMuted:J,isSavedDialog:re,hasMiniApp:$?.hasMainMiniApp,topics:O,isSelected:Z})]}),tt&&(0,B.Y)(z,{orderedFolderIds:et,chatFoldersById:ve})]}),Ve&&(0,B.Y)(N.A,{isOpen:xe,onClose:Le,onCloseAnimationEnd:Je,chat:K,isSavedDialog:re}),$e&&(0,B.Y)(x.A,{isOpen:Be,onClose:Oe,onCloseAnimationEnd:He,chatId:e}),Ge&&(0,B.Y)(D.A,{isOpen:Ue,onClose:ze,onCloseAnimationEnd:_e,chatId:e})]})}))},20247:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(17712);function r(e,t,n){const{shouldPaidMessageAutoApprove:r}=(0,i.mS)().settings.byKey,[d,l]=(0,o.J0)(Boolean(r)),[c,u]=(0,o.J0)(!1),h=(0,o.li)(void 0),m=(0,a.A)(()=>{(0,i.ko)().closePaymentMessageConfirmDialogOpen()});(0,o.vJ)(()=>{c&&!t&&(u(!1),n>e&&h?.current?.())},[c,t,n,e]);const p=(0,a.A)(()=>{(0,i.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)});return{closeConfirmDialog:m,handleWithConfirmation:(t,...o)=>{if(e){if(h.current=()=>t(...o),!r)return void(0,i.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...o)},dialogHandler:(0,a.A)(()=>{e>n?p():h?.current?.(),(0,i.ko)().closePaymentMessageConfirmDialogOpen(),d&&(0,i.ko)().setPaidMessageAutoApprove()}),shouldAutoApprove:d,setAutoApprove:l}}},21488:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,i.ko)(),r=(0,o.Kr)(()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}},[t,e]);(0,o.vJ)(()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()},[r,n,t,e])}},22081:(e,t,n)=>{n.d(t,{A:()=>Ht});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),l=n(27109),c=n(70636),u=n(91048),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),Y=n(13235);let P;function F(e){P.focus(),e.focus()}p.pz&&(P=document.createElement("input"),P.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(P));var T=n(55153),D=n(58734),x=n(11359),E=n(35049),L=n(4961),B=n(18501),R=n(32625),O=n(14737),U=n(10722),K=n(19129),z=n(82117),V=n(37661),j=n(41316),J=n(39351),$=n(17712),q=n(59030),H=n(29886),G=n(73767),W=n(24531),_=n(73172),Q=n(50680),Z=n(41257),X=n(35297),ee=n(17778),te=n(63988),ne=n(83414);const oe=/^\/([\w@]{1,32})?$/i;var ie=n(78396);const se=/id="docs-internal-guid/i,ae=["H1","H2","H3","H4","H5","H6"];function re(e){return(new DOMParser).parseFromString(e,"text/html").body}function de(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function le(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=le(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=le(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=le(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=le(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=le(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=le(n,"sub")),n):n}function ue(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=de(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=ce(o,n),n}function he(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const o=[];for(let t=0;t<e.childNodes.length;t++)o.push(...he(e.childNodes[t]));o.map(e=>n.appendChild(e))}else-1!==ae.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=ue(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=de(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=ce(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=ue(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(...he(e.childNodes[n]));return t}return[e]}function me(e){return 8!==e.nodeType}const pe=/<style>(.*?)<\/style>/gs;var ge=n(45761);const fe=new Set([a.CfG,a.e0F,a.YVZ]),ve=(e,t,n,r,l,c,u)=>{const{showNotification:h}=(0,i.ko)(),m=(0,J.A)();(0,o.vJ)(()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=e.target?.closest("div[contenteditable]");if(!o||!fe.has(o.id))return;if(e.preventDefault(),document.activeElement!==o)return;const i=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(se)?function(e){const t=document.createElement("body"),n=e.childNodes,o=Array.from(n).filter(me),i=[];for(const e of o)i.push(...he(e));for(let e=0;e<i.length;e++)t.appendChild(i[e].cloneNode(!0));return t}(re(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:re(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){a.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(pe,"");const o=t.querySelectorAll(".text-content");return o.length&&(t=o[o.length-1]),Array.from(t.getElementsByTagName("*")).forEach(e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),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,ie.T8)(g)&&c&&(g=(0,ie.m4)(g),u?.());const{items:f}=e.clipboardData;let v=[];if(f.length>0&&(v=await(0,ge.A)(f),l&&(v=v?.slice(0,1))),!v?.length&&!i)return;const A=g?.entities?.length?g:{text:i};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,T.A)(e.name,e))):[],I=l&&b?.length&&(0,d.eh)(l,b[0])||Boolean(C),M=(0,d.NK)(b[0]),N=l&&l?.groupedId;l&&b?.length>1?h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:b.length})}):l&&M?h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!N||(w=I,w)?(w&&n(l?b:e=>e.concat(b)),C&&(w?r(A):t(A,o?.id))):h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:b.length})})}},[t,l,n,e,c,u,r,m])};var Ae=n(3225),ye=n(37859),Ce=n(56133),we=n(61157),be=n(60138);let Ie=!1;const Se=new Set([s.C7.TextUrl,s.C7.Url]);var Me=n(25498),Ne=n(37830);const ke=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,Ye=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Pe={username:"",query:"",canShowHelp:!1,usernameLowered:""},Fe=document.createElement("div");const Te=(0,Ne.A)((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})),De=new RegExp(a.kNZ,"i");var xe=n(9442),Ee=n(20247),Le=n(16120),Be=n(17237);const Re=new RegExp(`^${a.bpX.source}$`,"g");var Oe=n(11778);const Ue={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Ke={type:"audio/ogg"};let ze,Ve,je;async function Je(){return ze||(ze=n.e(4550).then(n.t.bind(n,14550,23)),Ve=(await ze).default,je=new Ve(Ue)),ze}async function $e(e){await async function(){await Je(),await je.start()}();const t=Date.now();let n;const o=[],i=[];je.ondataavailable=e=>{o.push(e)};const s=function(t){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const s=o.frequencyBinCount,a=new Uint8Array(s);let d=!1;return function t(){if(d)return;o.getByteFrequencyData(a);const n=a.reduce((e,t)=>e+t,0)/s/255;(t=>{i.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{d=!0}}(je);return{stop:()=>new Promise((e,a)=>{je.onstop=()=>{e({blob:new Blob(o,Ke),duration:Math.round(((n||Date.now())-t)/1e3),waveform:i})},je.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout(()=>{je.stop(),s()},r)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{je.pause(),n=Date.now(),s()},e)}}}var qe=n(80089),He=n(80464),Ge=n(20021);const We=e=>{const{attachments:t}=e,n=(0,He.A)(qe.ar.Extra,"AttachmentModal",!t.length);return n?(0,Ge.Y)(n,{...e}):void 0};var _e=n(61182),Qe=n(87679),Ze=n(52844),Xe=n(36680),et=n(18276),tt=n(71429),nt=n(24433),ot=n(66469),it=n(54639);const st=(0,o.ph)(({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:s,canAttachPolls:r,canAttachToDoLists:l,canSendPhotos:c,canSendVideos:u,canSendDocuments:h,canSendAudios:m,attachBots:f,peerType:v,isScheduled:A,theme:y,shouldCollectDebugLogs:C,canEditMedia:w,editingMessage:b,messageListType:I,paidMessagesStars:S,onFileSelect:M,onMenuOpen:N,onMenuClose:k,onPollCreate:Y,onTodoListCreate:P})=>{const{updateAttachmentSettings:F}=(0,i.ko)(),[T,D,x]=(0,V.A)(),[E,L,B]=(0,Xe.A)(T,x),R=c&&u,O=c||u,[U,K,z]=(0,V.A)(),j=T||U,H=b&&b?.groupedId&&Boolean((0,d.yl)(b)||Boolean((0,d.zX)(b))),G=b&&b?.groupedId&&Boolean((0,d.wp)(b)||(0,d.gB)(b)||(0,d.zC)(b));(0,o.vJ)(()=>{T&&B()},[T,B]),(0,o.vJ)(()=>{j?N():k()},[j,k,N]);const W=(0,$.A)(()=>{T?x():D()}),_=(0,$.A)(e=>{const{files:t}=e.target,n=(0,Qe.kc)(t);n?.length&&M(n)}),Q=(0,$.A)(()=>{F({shouldCompress:!0}),(0,Ze.p)(Array.from(R?a.mxD:c?a.gex:a.fNs).join(","),e=>_(e))}),Z=(0,$.A)(()=>{F({shouldCompress:!1}),(0,Ze.p)(!h&&m?Array.from(a.IH3).join(","):"*",e=>_(e))}),X=(0,$.A)(()=>{const e=new File([(0,_e.F8)()],a.lFE,{type:"text/plain"});M([e])}),ee=(0,o.Kr)(()=>f?Object.values(f).filter(t=>!(!v||!t.isForAttachMenu)&&(!("bots"!==v||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(v))):void 0,[f,e,v]),te=(0,q.A)(),ne=(0,J.A)();if(n)return(0,Ge.FD)("div",{className:"AttachMenu",children:[b&&w?(0,Ge.Y)(ot.A,{id:"replace-menu-button",className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,Ge.Y)(et.A,{name:"replace"})}):(0,Ge.Y)(ot.A,{id:"attach-menu-button",disabled:Boolean(b),className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,Ge.Y)(et.A,{name:"attach"})}),(0,Ge.FD)(tt.A,{id:"attach-menu-controls",isOpen:j,autoClose:!0,positionX:"right",positionY:"bottom",onClose:x,className:"AttachMenu--menu fluid",onCloseAnimationEnd:x,onMouseEnter:p.TF?void 0:E,onMouseLeave:p.TF?void 0:L,noCloseOnBackdrop:!p.TF,ariaLabelledBy:"attach-menu-button",children:[!s&&(0,Ge.Y)(nt.A,{className:"media-disabled",disabled:!0,children:ne("scheduled"===I&&S?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),s&&(0,Ge.FD)(Ge.FK,{children:[O&&!G&&(0,Ge.Y)(nt.A,{icon:"photo",onClick:Q,children:te(R?"AttachmentMenu.PhotoOrVideo":c?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(h||m)&&!H&&(0,Ge.Y)(nt.A,{icon:"document",onClick:Z,children:te(!h&&m?"InputAttach.Popover.Music":"AttachDocument")}),h&&C&&(0,Ge.Y)(nt.A,{icon:"bug",onClick:X,children:te("DebugSendLogs")})]}),r&&!b&&(0,Ge.Y)(nt.A,{icon:"poll",onClick:Y,children:te("Poll")}),l&&!b&&(0,Ge.Y)(nt.A,{icon:"select",onClick:P,children:ne("TitleToDoList")}),!b&&!w&&!A&&ee?.map(n=>(0,Ge.Y)(it.A,{bot:n,chatId:e,threadId:t,theme:y,onMenuOpened:K,onMenuClosed:z}))]})]})}),at=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"BotCommandMenu",!t);return n?(0,Ge.Y)(n,{...e}):void 0};var rt=n(85449),dt=n(64493);const lt=(0,o.ph)((0,i.EK)((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return{message:n?(0,u.O5q)(e,n,t):void 0}})(({isOpen:e,threadId:t,message:n,onClose:s})=>{const{clickBotInlineButton:a}=(0,i.ko)(),r=(0,q.A)(),[d,l]=(0,Xe.A)(e,s),{isKeyboardSingleUse:c}=n||{},u=(0,o.Kr)(()=>{const e=[];return n?.keyboardButtons.forEach(t=>{e.push(t.map(e=>(0,rt.A)(r,e)))}),e},[r,n?.keyboardButtons]);if(n&&n.keyboardButtons)return(0,Ge.Y)(tt.A,{isOpen:e,autoClose:c,positionX:"right",positionY:"bottom",onClose:s,className:"BotKeyboardMenu",onCloseAnimationEnd:s,onMouseEnter:p.TF?void 0:d,onMouseLeave:p.TF?void 0:l,noCompact:!0,children:(0,Ge.Y)("div",{className:"content custom-scroll",children:n.keyboardButtons.map((e,o)=>(0,Ge.Y)("div",{className:"row",children:e.map((e,i)=>(0,Ge.Y)(dt.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>a({chatId:n.chatId,messageId:n.id,threadId:t,button:e}),children:u?.[o][i]}))}))})})})),ct=(0,o.ph)(({isOpen:e,onClick:t,text:n,isDisabled:i})=>{const s=(0,o.li)();return(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)},[e,n]),(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}},[]),(0,Ge.FD)(dt.A,{className:(0,g.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:i,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,Ge.Y)(et.A,{name:"webapp",className:(0,g.A)("bot-menu-icon",e&&"open")}),(0,Ge.Y)("span",{ref:s,className:"bot-menu-text",children:(0,L.A)(n)})]})}),ut=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"ChatCommandTooltip",!t);return n?(0,Ge.Y)(n,{...e}):void 0};var ht=n(56494),mt=n(87894),pt=n(14),gt=n(91930),ft=n(60859);const vt=(0,o.ph)((0,i.EK)((e,{shouldForceShowEditing:t,chatId:n,threadId:o,messageListType:i})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:l,noCaptions:c},isShareMessageModalShown:h,shouldPreventComposerAnimation:m}=(0,u.nTw)(e),p="scheduled"===i?(0,u.VlN)(e,n):(0,u.Ys6)(e,n,o),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,o),y=A?.replyInfo,C=A?.suggestedPostInfo,w=y?.replyToPeerId,b=w?(0,u.hds)(e,w):void 0;let I,S;if(p?I=(0,u.KLw)(e,n,o,i):f&&1===r.length?I=v?.[0]:y&&!t&&(I=(0,u.O5q)(e,y.replyToPeerId||n,y.replyToMsgId)),p&&I)S=(0,u.Y7C)(e,I);else if(f){let t=v?.map(t=>{return n=t,S=(0,u.Szq)(e,n),S||(S=(0,u.Y7C)(e,n)),S;var n}).filter(Boolean);t=t?(0,mt.Am)(t):void 0,S=1===t?.length?t?.[0]:void 0}else if(y&&I&&!t){const{forwardInfo:t}=I,o=(0,u.nZ4)(e,n);t&&(t.isChannelPost||o)&&(S=(0,u.Szq)(e,I)),S||t?.hiddenUserName&&!Boolean(y.quoteText)||(S=(0,u.Y7C)(e,I))}const M=S&&(0,u.hds)(e,S.id),N=M&&(0,d.WX)(M),k=v?.some(e=>e?.content.text&&Object.keys(e.content).length>1),Y=f&&1===r.length&&Boolean(I?.content.storyData),P=y?.replyToMsgId===o&&!y.replyToPeerId,F=I&&(0,ht.B9)(e,I);return{replyInfo:y,suggestedPostInfo:C,editingId:p,message:I,sender:S,shouldAnimate:g,forwardedMessagesCount:f?r.length:void 0,noAuthors:l,noCaptions:c,forwardsHaveCaptions:k,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:Y,isReplyToDiscussion:P,isInChangingRecipientMode:h,shouldPreventComposerAnimation:m,senderChat:b,currentUserId:e.currentUserId,isSenderChannel:N,forwardMessageIds:r,fromChatId:s,isMediaNsfw:F}})(({replyInfo:e,suggestedPostInfo:t,editingId:n,message:s,sender:a,shouldAnimate:r,forwardedMessagesCount:l,noAuthors:c,noCaptions:h,forwardsHaveCaptions:m,shouldForceShowEditing:p,isCurrentUserPremium:f,isContextMenuDisabled:v,isReplyToDiscussion:A,isInChangingRecipientMode:y,shouldPreventComposerAnimation:C,senderChat:w,chatId:b,currentUserId:I,isSenderChannel:S,forwardMessageIds:M,fromChatId:N,isMediaNsfw:k,onClear:Y})=>{const{resetDraftReplyInfo:P,resetDraftSuggestedPostInfo:F,updateDraftReplyInfo:T,setEditingId:D,focusMessage:x,changeRecipient:L,openChatOrTopicWithReplyInDraft:B,setForwardNoAuthors:R,setForwardNoCaptions:O,exitForwardMode:K,setShouldPreventComposerAnimation:z,openSuggestMessageModal:V}=(0,i.ko)(),j=(0,o.li)(),H=(0,q.A)(),G=(0,J.A)(),W="topicCreate"===s?.content.action?.type,_=e&&!p,Z=Boolean(e?.quoteText),X=Boolean(t)&&!p,ee=Boolean(l),te=(0,$.A)(e=>{const t=(0,i.mS)();return(a=(0,u.Szq)(t,e))||(a=(0,u.Y7C)(t,e)),a}),ne=(0,o.Kr)(()=>{if(!ee)return;const e=M?.map(e=>(0,u.O5q)((0,i.mS)(),N,e)).filter(Boolean),t=e?.map(e=>te(e)).filter(Boolean);return t?(0,mt.Am)(t):void 0},[ee,M,N]),oe=!(y||(!s||!e&&!n)&&(!ne||!ee)&&!X),{shouldRender:ie,transitionClassNames:se}=(0,Q.A)(oe&&!W&&!A,void 0,!r,void 0,!r,350,!r);(0,o.vJ)(()=>{C&&z({shouldPreventComposerAnimation:!1})});const ae=(0,$.A)(()=>{n?D({messageId:void 0}):l?K():X?(F(),P()):e&&!p&&P(),Y?.()});(0,o.vJ)(()=>oe?(0,Oe.A)(ae):void 0,[oe,ae]);const{isContextMenuOpen:re,contextMenuAnchor:de,handleContextMenu:le,handleContextMenuClose:ce,handleContextMenuHide:ue}=(0,U.A)(j),he=(0,$.A)(e=>{t?V({chatId:b}):le(e)}),me=(0,$.A)(e=>{e.stopPropagation(),ae(),ue()}),pe=e=>()=>{ce(),e()},ge=(0,$.A)(pe(L)),fe=(0,$.A)(pe(()=>{x({chatId:s.chatId,messageId:s.id,noForumTopicPanel:!0})})),ve=(0,$.A)(pe(()=>T({quoteText:void 0}))),Ae=(0,$.A)(pe(L)),ye=(0,$.A)(()=>{ce(),a&&B({chatId:a.id})}),Ce=(0,$.A)(pe(ae)),we=(0,$.A)(()=>j.current),be=(0,$.A)(()=>j.current),Ie=(0,$.A)(()=>j.current.querySelector(".forward-context-menu .bubble"));(0,o.vJ)(()=>{ie||(ce(),ue())},[ce,ue,ie]);const Se=(0,g.A)("ComposerEmbeddedMessage",se),Me=(0,pt.A)(a,!0),Ne=(0,g.A)("ComposerEmbeddedMessage_inner",(0,E.y)(Me)),ke=(0,o.Kr)(()=>n?"edit":X?"cash-circle":ee?"forward":_?"reply":void 0,[n,ee,_,X]),Ye=l&&l>1?H("ForwardedMessageCount",l):void 0,Pe=(0,o.Kr)(()=>{if(!s||!ee||!s.content.text||!c||f)return s;const e=(0,d.m4)(s.content.text);return{...s,content:{...s.content,text:e}}},[f,ee,s,c]),Fe=(0,pt.A)(ke,!0);if(!ie)return;const Te=a&&!S&&b!==a.id&&a.id!==I;return(0,Ge.Y)("div",{className:Se,ref:j,onContextMenu:le,children:(0,Ge.FD)("div",{className:Ne,children:[(0,Ge.FD)("div",{className:"embedded-left-icon",onClick:le,children:[Fe&&(0,Ge.Y)(et.A,{name:Fe}),Boolean(e?.quoteText)&&(0,Ge.Y)(et.A,{name:"quote",className:"quote-reply"})]}),(0,Ge.Y)(gt.b,{isOpen:oe,className:"inside-input",replyInfo:e,suggestedPostInfo:t,isMediaNsfw:k,isInComposer:!0,message:Pe,sender:c?void 0:a,composerForwardSenders:ne,customText:Ye,noCaptions:h,title:n&&!_?H("EditMessage"):c?H("HiddenSendersNameDescription"):void 0,onClick:he,senderChat:w}),(0,Ge.Y)(dt.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:H("Cancel"),onClick:me,children:(0,Ge.Y)(et.A,{name:"close"})}),(_||ee)&&!v&&(0,Ge.FD)(tt.A,{isOpen:re,anchor:de,getTriggerElement:we,getRootElement:be,getMenuElement:Ie,className:"forward-context-menu",onClose:ce,onCloseAnimationEnd:ue,children:[ee&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(nt.A,{icon:c?void 0:"message-succeeded",customIcon:c?(0,Ge.Y)(et.A,{name:"placeholder"}):void 0,onClick:()=>R({noAuthors:!1}),children:H(l>1?"ShowSenderNames":"ShowSendersName")}),(0,Ge.Y)(nt.A,{icon:c?"message-succeeded":void 0,customIcon:c?void 0:(0,Ge.Y)(et.A,{name:"placeholder"}),onClick:()=>R({noAuthors:!0}),children:H(l>1?"HideSenderNames":"HideSendersName")}),m&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(ft.A,{}),(0,Ge.Y)(nt.A,{icon:h?void 0:"message-succeeded",customIcon:h?(0,Ge.Y)(et.A,{name:"placeholder"}):void 0,onClick:()=>O({noCaptions:!1}),children:H(l>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,Ge.Y)(nt.A,{icon:h?"message-succeeded":void 0,customIcon:h?void 0:(0,Ge.Y)(et.A,{name:"placeholder"}),onClick:()=>O({noCaptions:!0}),children:H(l>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,Ge.Y)(ft.A,{}),(0,Ge.Y)(nt.A,{icon:"replace",onClick:ge,children:H("ForwardAnotherChat")})]}),_&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(nt.A,{icon:"show-message",onClick:fe,children:H("Message.Context.Goto")}),Z&&(0,Ge.Y)(nt.A,{icon:"remove-quote",onClick:ve,children:H("RemoveQuote")}),Te&&(0,Ge.Y)(nt.A,{icon:"user",onClick:ye,children:G("ReplyInPrivateMessage")}),(0,Ge.Y)(nt.A,{icon:"replace",onClick:Ae,children:H("ReplyToAnotherChat")}),(0,Ge.Y)(nt.A,{icon:"delete",onClick:Ce,children:H("DoNotReply")})]})]})]})})}));var At=n(25897),yt=n(6070),Ct=n(41510);const wt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"DropArea",!t);return n?(0,Ge.Y)(n,{...e}):void 0};var bt=n(49068);const It=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"InlineBotTooltip",!t);return n?(0,Ge.Y)(n,{...e}):void 0},St=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"MentionTooltip",!t);return n?(0,Ge.Y)(n,{...e}):void 0};var Mt=n(78407);const Nt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"PollModal",!t);return n?(0,Ge.Y)(n,{...e}):void 0},kt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"SendAsMenu",!t);return n?(0,Ge.Y)(n,{...e}):void 0},Yt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"StickerTooltip",!t);return n?(0,Ge.Y)(n,{...e}):void 0};var Pt=n(26440);const Ft=e=>{const{modal:t}=e,n=(0,He.A)(qe.ar.Extra,"ToDoListModal",!t);return n?(0,Ge.Y)(n,{...e}):void 0};var Tt=n(2338),Dt=n(62587),xt=n(34201),Et=n(86070);const Lt="zqTOc7LU",Bt="b0A9Zfoa";const Rt=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,u.nTw)(e),i=(0,u.rQx)(e,t,n),{attachmentSettings:s}=e,a=o.webPagePreviewId?(0,u.kgA)(e,o.webPagePreviewId):void 0;return{webPagePreview:"empty"===a?.webpageType?void 0:a,noWebPage:i,attachmentSettings:s}})(({chatId:e,threadId:t,isDisabled:n,webPagePreview:s,noWebPage:a,attachmentSettings:r,isEditing:l})=>{const{toggleMessageWebPage:c,updateAttachmentSettings:u}=(0,i.ko)(),h=(0,J.A)(),m=(0,o.li)(),p=r.isInvertedMedia,f="small"===r.webPageMediaSize,v=(0,K.A)(()=>Boolean(s&&!a&&!n),[n,a,s]),{shouldRender:A}=(0,xt.A)({isOpen:v,ref:m,withShouldRender:!0}),y="full"===s?.webpageType&&s.hasLargeMedia,C=(0,o.li)(s);s&&s!==C.current&&(C.current=s);const w=s||C.current,b="full"===w?.webpageType,I=(0,Tt.A)(b?{content:w}:void 0),S=(0,d.eY)(w)||(0,d.rU)(w)||(0,d.y3)(w)||(0,d.rj)(w),M=S&&(0,d.VO)(S,"pictogram"),N=(0,Dt.A)(M),{shouldRender:k,ref:Y}=(0,xt.A)({isOpen:Boolean(N),withShouldRender:!0,noCloseTransition:!0}),P=Boolean(N||k),F=(0,$.A)(()=>{c({chatId:e,threadId:t,noWebPage:!0})}),{isContextMenuOpen:T,contextMenuAnchor:D,handleContextMenu:x,handleContextMenuClose:E,handleContextMenuHide:L,handleBeforeContextMenu:B}=(0,U.A)(m,l,!0),R=(0,$.A)(()=>m.current),O=(0,$.A)(()=>m.current),z=(0,$.A)(()=>m.current.querySelector(`.${Lt} .bubble`)),V=(0,$.A)(e=>{x(e)});function j(e){u({isInvertedMedia:e})}function q(e){u({webPageMediaSize:e})}if((0,o.vJ)(()=>{A&&w||(E(),L())},[E,L,A,w]),A&&w)return(0,Ge.Y)("div",{className:(0,g.A)("O3di3ULC",!l&&"G5_7x_Hn"),ref:m,children:(0,Ge.FD)("div",{className:"m3DBx9f5",children:[(0,Ge.Y)("div",{className:"vFWsMwfP",onClick:V,children:(0,Ge.Y)(et.A,{name:"link"})}),w&&"empty"!==w.webpageType&&(0,Ge.FD)(Et.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:x,onMouseDown:B,onClick:V,children:[P&&(0,Ge.FD)("div",{className:"VvwZOug9",children:[I&&(0,Ge.Y)("img",{src:I,alt:"",className:Bt}),k&&(0,Ge.Y)("img",{ref:Y,src:N,alt:"",className:Bt})]}),(0,Ge.FD)("div",{className:"itmZe2qi",children:[(0,Ge.Y)("span",{className:"ER149gdz",children:b?w.siteName||w.url:h("Loading")}),(0,Ge.Y)("span",{className:"FSYSqC60",children:b?w.description||h((H=w,H.photo?"AttachPhoto":H.video?"AttachVideo":H.audio?"AttachMusic":H.document?"AttachDocument":H.story?"AttachStory":"LinkPreview")):w.url})]})]}),(0,Ge.Y)(dt.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:h("AccLinkRemovePreview"),onClick:F,children:(0,Ge.Y)(et.A,{name:"close"})}),!l&&(0,Ge.Y)(tt.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:O,getMenuElement:z,className:Lt,onClose:E,onCloseAnimationEnd:L,autoClose:!0,children:(0,Ge.FD)(Ge.FK,{children:[p?(0,Ge.Y)(nt.A,{icon:"move-caption-up",onClick:()=>j(void 0),children:h("ContextMoveTextUp")}):(0,Ge.Y)(nt.A,{icon:"move-caption-down",onClick:()=>j(!0),children:h("ContextMoveTextDown")}),y&&(f?(0,Ge.Y)(nt.A,{icon:"expand",onClick:()=>q("large"),children:h("ContextLinkLargerMedia")}):(0,Ge.Y)(nt.A,{icon:"collapse",onClick:()=>q("small"),children:h("ContextLinkSmallerMedia")})),(0,Ge.Y)(nt.A,{icon:"delete",onClick:F,children:h("ContextLinkRemovePreview")})]})})]})});var H}));var Ot=n(97676),Ut=n(76283),Kt=n(57474),zt=n(41036),Vt=n(68292),jt=n(21849),Jt=n(48227),$t=n(11241),qt=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}(qt||{});const Ht=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,storyId:o,messageListType:i,isMobile:r,type:c})=>{const p=e.appConfig,g=(0,u.hds)(e,t),f=(0,d.DX)(t)?void 0:(0,u.yps)(e,t),v=Boolean(f),A=(0,u.nZ4)(e,t),y=(0,C.L8)(t),w=y?(0,u.vGo)(e,t):void 0,b=(0,u.WA9)(e,t),I=y?void 0:(0,u.AWZ)(e,t),S=(v||!y)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:k,shouldPaidMessageAutoApprove:P}=e.settings.byKey,{language:F,shouldCollectDebugLogs:T}=(0,m.l)(e),{forwardMessages:{messageIds:D}}=(0,u.nTw)(e),x=e.emojiKeywords[a.cUY],E=F!==a.cUY?e.emojiKeywords[F]:void 0,L=S?S.id:void 0,B=L?(0,u.O5q)(e,t,L):void 0,{currentUserId:R}=e,O=(0,u.mBe)(e,R),U=I?I?.sendAsId||R:void 0,K=U?(0,u.PVB)(e,U):void 0,z=(0,u.sam)(e,t),V=(0,u.p6T)(e,t),j=(0,u.nTw)(e),J=Boolean(j.storyViewer.storyId),$=(0,u.Xf0)(e),q=t===$?.chatId&&n===$?.threadId&&i===$?.type&&!J,H=((0,u.mBe)(e,t)&&!w?.noVoiceMessages)??!0,G=I?.slowMode,W=(0,u.g29)(e),_="scheduled"===i?(0,u.dkp)(e,t):(0,u.U0A)(e,t,n),Q=o&&(0,u.Msb)(e,t,o),Z=Q&&"sentReaction"in Q?Q.sentReaction:void 0,X=(0,u.GA4)(e,t,n),ee=X?.replyInfo?(0,u.O5q)(e,t,X.replyInfo.replyToMsgId):void 0,te=g?.isForum&&g.isForumAsMessages&&n===s.l3&&ee?(0,u.nkm)(e,ee):void 0,ne="scheduled"===i,oe=y&&!v&&!ne&&!A,ie=(0,u.rQx)(e,t,n),se=g&&(0,l.RY)(g,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,ae=y&&!v&&!ne&&!A&&"story"!==c&&t!==a.zv8,re=(0,u.xYJ)(e,"stickerEffects"),de=j.shouldPlayEffectInComposer,le=ae&&X?.effectId,ce=le?e.availableEffectById[le]:void 0,ue=e.reactions.effectReactions,he=e.config?.maxMessageLength||Y.Yf,me=t===j.forwardMessages.toChatId,pe=Boolean(X?.replyInfo),ge=Boolean(X?.suggestedPostInfo),fe=e.stars?.balance.amount||0,ve=Boolean(j.starsBalanceModal),Ae=(0,u.trm)(e),ye=e.isAppConfigLoaded,Ce=j.insertingPeerIdMention,we=j.webPagePreviewId?(0,u.kgA)(e,j.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===c?e.reactions.topReactions:void 0,isOnActiveTab:!j.isBlurred,editingMessage:(0,u.KLw)(e,t,n,i),draft:X,chat:g,isChatWithBot:v,isChatWithSelf:A,isForCurrentMessageList:q,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:g?(0,d.WX)(g):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===i&&(w||I)?.hasScheduledMessages,isInScheduledList:ne,botKeyboardMessageId:L,botKeyboardPlaceholder:B?.keyboardPlaceholder,isForwarding:me,isReplying:pe,hasSuggestedPost:ge,forwardedMessagesCount:me?D.length:void 0,pollModal:j.pollModal,todoListModal:j.todoListModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:I,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:R,currentUser:O,contentToBeScheduled:j.contentToBeScheduled,shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:k,recentEmojis:e.recentEmojis,baseEmojiKeywords:x?.keywords,emojiKeywords:E?.keywords,inlineBots:j.inlineBots.byUsername,isInlineBotLoading:j.inlineBots.isLoading,botCommands:w?w.botInfo?.commands||!1:void 0,botMenuButton:w?.botInfo?.menuButton,sendAsPeer:K,sendAsId:U,editingDraft:_,requestedDraft:z,requestedDraftFiles:V,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:W,canSendVoiceByPrivacy:H,attachmentSettings:e.attachmentSettings,slowMode:G,currentMessageList:$,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!W&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!A&&y&&!v&&!ne,shouldCollectDebugLogs:T,sentStoryReaction:Z,stealthMode:e.stories.stealthMode,replyToTopic:te,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:oe,noWebPage:ie,webPagePreview:we,isContactRequirePremium:w?.isContactRequirePremium,effect:ce,effectReactions:ue,areEffectsSupported:ae,canPlayEffect:re,shouldPlayEffect:de,maxMessageLength:he,paidMessagesStars:b,shouldPaidMessageAutoApprove:P,isSilentPosting:se,isPaymentMessageConfirmDialogOpen:j.isPaymentMessageConfirmDialogOpen,starsBalance:fe,isStarsBalanceModalOpen:ve,shouldDisplayGiftsButton:w?.shouldDisplayGiftsButton,disallowedGifts:w?.disallowedGifts,isAccountFrozen:Ae,isAppConfigLoaded:ye,insertingPeerIdMention:Ce,pollMaxAnswers:p.pollMaxAnswers}})(({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:l,canScheduleUntilOnline:h,isReady:m,isMobile:C,editingMessage:Y,chatId:P,threadId:ie,storyId:se,currentMessageList:ae,messageListType:re,draft:de,chat:le,chatFullInfo:ce,replyToTopic:ue,isForCurrentMessageList:he,isCurrentUserPremium:me,canSendVoiceByPrivacy:pe,isChatWithBot:ge,isChatWithSelf:fe,isChannel:Ne,fileSizeLimit:Ue,isRightColumnShown:Ke,isSelectModeActive:ze,isReactionPickerOpen:Ve,shouldDisplayGiftsButton:je,isForwarding:qe,isReplying:He,hasSuggestedPost:_e,forwardedMessagesCount:Qe,pollModal:Ze,todoListModal:Xe,botKeyboardMessageId:tt,botKeyboardPlaceholder:nt,inputPlaceholder:it,withScheduledButton:rt,stickersForEmoji:ht,customEmojiForEmoji:mt,topInlineBotIds:pt,currentUserId:gt,currentUser:ft,captionLimit:Tt,contentToBeScheduled:Dt,shouldSuggestStickers:xt,shouldSuggestCustomEmoji:Et,baseEmojiKeywords:Lt,emojiKeywords:Bt,recentEmojis:Ht,inlineBots:Gt,isInlineBotLoading:Wt,botCommands:_t,sendAsPeer:Qt,sendAsId:Zt,editingDraft:Xt,requestedDraft:en,requestedDraftFiles:tn,botMenuButton:nn,attachBots:on,attachMenuPeerType:sn,attachmentSettings:an,theme:rn,slowMode:dn,shouldUpdateStickerSetOrder:ln,editableInputCssSelector:cn,editableInputId:un,inputId:hn,className:mn,availableReactions:pn,topReactions:gn,canBuyPremium:fn,canPlayAnimatedEmojis:vn,shouldCollectDebugLogs:An,sentStoryReaction:yn,stealthMode:Cn,canSendOneTimeMedia:wn,quickReplyMessages:bn,quickReplies:In,canSendQuickReplies:Sn,webPagePreview:Mn,noWebPage:Nn,isContactRequirePremium:kn,paidMessagesStars:Yn,effect:Pn,effectReactions:Fn,areEffectsSupported:Tn,canPlayEffect:Dn,shouldPlayEffect:xn,maxMessageLength:En,isSilentPosting:Ln,isPaymentMessageConfirmDialogOpen:Bn,starsBalance:Rn,isStarsBalanceModalOpen:On,disallowedGifts:Un,isAccountFrozen:Kn,isAppConfigLoaded:zn,insertingPeerIdMention:Vn,pollMaxAnswers:jn,onDropHide:Jn,onFocus:$n,onBlur:qn,onForward:Hn})=>{const{sendMessage:Gn,clearDraft:Wn,showDialog:_n,openPollModal:Qn,closePollModal:Zn,openTodoListModal:Xn,closeTodoListModal:eo,loadScheduledHistory:to,openThread:no,addRecentEmoji:oo,sendInlineBotResult:io,loadSendAs:so,resetOpenChatWithDraft:ao,callAttachBot:ro,addRecentCustomEmoji:lo,showNotification:co,showAllowedMessageTypesNotification:uo,openStoryReactionPicker:ho,openGiftModal:mo,closeReactionPicker:po,sendStoryReaction:go,editMessage:fo,updateAttachmentSettings:vo,saveEffectInDraft:Ao,setReactionEffect:yo,hideEffectInComposer:Co,updateChatSilentPosting:wo,updateInsertingPeerIdMention:bo,updateDraftSuggestedPostInfo:Io}=(0,i.ko)(),So=(0,q.A)(),Mo=(0,J.A)(),No=(0,o.li)(),ko=(0,o.li)(),Yo=(0,o.li)(),[Po,Fo]=(0,o.Ul)(""),[To,Do]=(0,o.J0)(!1),xo=(0,j.A)(cn),Eo=(0,o.li)(),Lo=(0,G.A)(n),{width:Bo}=k.A.get(),Ro="messageList"===e,Oo="story"===e,Uo=Ro?le?.sendAsPeerIds:void 0,Ko=Boolean(Uo?.length),[zo,Vo,jo]=(0,V.A)(),Jo=(0,_.A)(P,ie),[$o,qo,Ho]=(0,V.A)(),[Go,Wo,_o]=(0,V.A)(),Qo=Y&&(0,d.ZV)(Y),Zo=le?.isMonoforum,{emojiSet:Xo,members:ei,botCommands:ti}=ce||{},ni=Xo?.id,oi=!Yn&&!Zo,ii=yn&&(0,d.a0)(yn,a.tNZ);(0,o.vJ)(y.VU,[Po]);const si=(0,o.li)(0),[ai,ri]=(0,W.A)(Ro&&h,jo);(0,O.A)(()=>{Do(!0)},430),(0,o.vJ)(()=>{Ro||po()},[Ro,se]),(0,o.vJ)(()=>{Eo.current=void 0},[P]),(0,o.vJ)(()=>{zn&&P&&m&&!Oo&&!Zo&&to({chatId:P})},[m,P,ie,Oo,zn,Zo]),(0,o.vJ)(()=>{const e=Ne&&le?.areProfilesShown,t=le&&(0,d.Vs)(le)&&Boolean((0,d.gA)(le)||le.isLinkedInDiscussion||le.hasGeo);!Uo&&m&&(t||e)&&so({chatId:P})},[le,P,Ne,m,so,Uo]);const di=(0,o.li)(!1);(0,X.A)(([e,t])=>{di.current=Boolean(P===e&&Uo&&!t)},[P,Uo]);const[li,ci]=(0,o.J0)([]),ui=Boolean(li.length),[hi,mi]=(0,o.J0)(void 0),{canSendStickers:pi,canSendGifs:gi,canAttachMedia:fi,canAttachPolls:vi,canAttachEmbedLinks:Ai,canAttachToDoLists:yi,canSendVoices:Ci,canSendPlainText:wi,canSendAudios:bi,canSendVideos:Ii,canSendPhotos:Si,canSendDocuments:Mi}=(0,o.Kr)(()=>(0,d.Q_)(le,ce,ge,fe,Oo,Yn,l),[le,ce,ge,fe,Oo,Yn,l]),Ni=kn&&Oo,ki=Ni||!wi,Yi=(0,K.A)(()=>{if(ui)return li.length;const e=Po()||ui?1:0;return qe&&Qe?Qe+e:e||1},[Po,ui,li,qe,Qe]),Pi=Yn?Yi*Yn:0,{closeConfirmDialog:Fi,dialogHandler:Ti,shouldAutoApprove:Di,setAutoApprove:xi,handleWithConfirmation:Ei}=(0,Ee.A)(Pi,On,Rn),Li=!ui&&Ai&&!Nn&&Boolean(Mn),Bi=ki&&!Y;(0,o.vJ)(()=>{Li||vo({isInvertedMedia:void 0})},[Li]);const Ri=(0,$.A)((e,t=un,n=!1)=>{if(t===un&&Bi)return;const o=window.getSelection();let i;if(i=t===un?document.querySelector(cn):document.getElementById(t),o.rangeCount&&!n){const n=o.getRangeAt(0);if((0,x.L)(n,t))return(0,M.oR)(e),void i.dispatchEvent(new Event("input",{bubbles:!0}))}if(n){const t=e.split(" ")[0],n=Po().startsWith(t);Fo(n?e:`${e}${Po()}`)}else Fo(`${Po()}${e}`);(0,r.Uz)(()=>{(0,w.A)(i)})}),Oi=(0,$.A)((e,t=un)=>{const n=(0,L.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");Ri(n,t)}),Ui=(0,$.A)((e,t=un,n=!1)=>{const o=(0,B.QY)(e);Ri(o,t,n)}),Ki=(0,$.A)((e,t=un)=>{Ri((0,D.hB)(e),t)}),zi=(0,$.A)(()=>{hi&&(Ui(hi,un),mi(void 0))}),{shouldForceCompression:Vi,shouldForceAsFile:ji,handleAppendFiles:Ji,handleFileSelect:$i,onCaptionUpdate:qi,handleClearAttachments:Hi,handleSetAttachments:Gi}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:a,canSendAudios:r,canSendVideos:l,canSendPhotos:c,canSendDocuments:u,insertNextText:h,editedMessage:m,shouldSendInHighQuality:p}){const g=(0,J.A)(),{openLimitReachedModal:f,showAllowedMessageTypesNotification:v,showNotification:A}=(0,i.ko)(),[y,C]=(0,o.J0)(!1),[w,b]=(0,o.J0)(!1),S=(0,$.A)(()=>{s(I.p),h()}),M=(0,$.A)(n=>{const o="function"==typeof n?n(e):n;if(o.length)if(o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r&&!u||"video"===t&&!l&&!u||"photo"===t&&!c&&!u||"file"===t&&!u}))v({chatId:a});else if(o.some(({size:e})=>e>t))f({limit:"uploadMaxFileparts"});else{s(o);const e=o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r||"video"===t&&!l||"photo"===t&&!c});C(Boolean(e&&u)),b(!u)}else S()}),N=(0,$.A)(async(t,n)=>{if(m){const e=await(0,T.A)(t[0].name,t[0]),n=m&&(0,d.eh)(m,e);m?.groupedId?n?M([e]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):M([e])}else{const o=await Promise.all(t.map(e=>(0,T.A)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:p})));M([...e,...o])}}),k=(0,$.A)(async e=>{if(m){const t=await(0,T.A)(e[0].name,e[0]),n=m&&(0,d.eh)(m,t);m?.groupedId?n?M([t]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):M([t])}else{const t=await Promise.all(e.map(e=>(0,T.A)(e.name,e,{shouldSendInHighQuality:p})));M(t)}}),Y=(0,$.A)(async()=>{const t=await Promise.all(e.map(e=>(0,T.A)(e.filename,e.blob,{shouldSendInHighQuality:p})));M(t)});return(0,o.vJ)(()=>{Y()},[p]),{handleAppendFiles:N,handleFileSelect:k,onCaptionUpdate:n,handleClearAttachments:S,handleSetAttachments:M,shouldForceCompression:w,shouldForceAsFile:y}}({attachments:li,setHtml:Fo,setAttachments:ci,fileSizeLimit:Ue,chatId:P,canSendAudios:bi,canSendVideos:Ii,canSendPhotos:Si,canSendDocuments:Mi,insertNextText:zi,editedMessage:Y,shouldSendInHighQuality:an.shouldSendInHighQuality}),[Wi,_i,Qi]=(0,V.A)(),[Zi,Xi,es]=(0,V.A)(),[ts,ns,os]=(0,V.A)(),[is,ss,as]=(0,V.A)(),[rs,ds,ls]=(0,V.A)(),{startRecordingVoice:cs,stopRecordingVoice:us,pauseRecordingVoice:hs,activeVoiceRecording:ms,currentRecordTime:ps,recordButtonRef:gs,startRecordTimeRef:fs,isViewOnceEnabled:vs,setIsViewOnceEnabled:As,toogleViewOnceEnabled:ys}=(()=>{const e=(0,o.li)(),[t,n]=(0,o.J0)(),i=(0,o.li)(),[s,a]=(0,o.J0)(),[d,l]=(0,o.J0)(!1);(0,o.vJ)(()=>{p.Yw&&p.pW&&Je()},[]);const c=(0,$.A)(async()=>{try{const{stop:t,pause:o}=await $e(t=>{e.current&&(i.current&&Date.now()%4==0&&(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)}),a(Date.now()))});i.current=Date.now(),a(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}}),u=(0,$.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,$.A)(()=>{if(t){n(void 0),i.current=void 0,a(void 0),(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.stop()}catch(e){return void console.error(e)}}});(0,o.vJ)(()=>t?(0,Oe.A)(h):void 0,[t,h]);const m=(0,$.A)(()=>{l(!d)});return{startRecordingVoice:c,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:i,isViewOnceEnabled:d,setIsViewOnceEnabled:l,toogleViewOnceEnabled:m}})(),Cs=he&&!Oo;(0,R.A)(()=>{Jo({type:"recordAudio"})},Cs?ms&&a.cqp:void 0),(0,o.vJ)(()=>{he&&!Oo&&(ms||Jo({type:"cancel"}))},[ms,he,Oo,Jo]);const ws=(0,Z.i)(Boolean(Y));(0,o.vJ)(()=>{he&&!Oo&&Po()&&!ws.current&&Jo({type:"typing"})},[Po,ws,he,Oo,Jo]);const bs=le&&(0,d.SJ)(le),{isEmojiTooltipOpen:Is,closeEmojiTooltip:Ss,filteredEmojis:Ms,filteredCustomEmojis:Ns,insertEmoji:ks}=(0,Me.A)(Boolean(m&&t&&(Oo||he)&&xt&&!ui),Po,Fo,void 0,Ht,Lt,Bt),{isCustomEmojiTooltipOpen:Ys,closeCustomEmojiTooltip:Ps,insertCustomEmoji:Fs}=(0,Ae.A)(Boolean(m&&t&&(Oo||he)&&Et&&!ui),Po,Fo,xo,No,mt),{isStickerTooltipOpen:Ts,closeStickerTooltip:Ds}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,i.ko)(),[d,l,c]=(0,V.A)(!1),u=(0,ne.A)(()=>{const n=t();if(!e||!n||p.TL&&n.length>8)return;if(!n.match(p.TL?Le.A:a.bpX))return;const o=(0,ee.S)(n);return o&&(p.TL&&1===(0,Be.A)(o)||!p.TL&&Boolean(n.match(Re)))?p.TL?o:o.match(/alt="(.+)"/)?.[1]:void 0},[t,e]),h=(0,K.A)(()=>Boolean(u()),[u]),m=Boolean(n?.length);return(0,o.vJ)(()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()},[e,h,u,m,s,r]),(0,o.vJ)(c,[c,t]),{isStickerTooltipOpen:Boolean(h&&m&&!d),closeStickerTooltip:l}}(Boolean(m&&t&&(Oo||he)&&xt&&pi&&!ui),Po,ht),{isMentionTooltipOpen:xs,closeMentionTooltip:Es,insertMention:Ls,mentionFilteredUsers:Bs}=(0,xe.A)(Boolean(Ro&&m&&he&&!ui),Po,Fo,xo,No,ei,pt,gt);(0,o.vJ)(()=>{if(!Vn)return;const e=(0,u.PVB)((0,i.mS)(),Vn);e&&Ls(e,!0,!0),bo({peerId:void 0})},[Vn,Ls]);const{isOpen:Rs,botId:Os,isGallery:Us,switchPm:Ks,switchWebview:zs,results:Vs,closeTooltip:js,help:Js,loadMore:$s}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:d}=(0,i.ko)(),[l,c,u]=(0,V.A)(!1),h=(0,te.gs)(()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Pe;const t=function(e){return Fe.innerHTML=e.replace(/<br>/g,"\n"),Fe.querySelectorAll("[alt]").forEach(e=>{e.innerText||(e.innerText=e.getAttribute("alt"))}),Fe.innerText}(e),n=t.match(ke);return n?Te(n[1],n[2],""===n[2]&&!t.match(Ye)):Pe}(t):Pe},[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,K.A)(h,[h,n],!0);(0,X.A)(([e])=>{e&&r({username:e})},[m,r]),(0,o.vJ)(()=>{f&&a({chatId:t,username:f,query:p})},[t,p,a,f]),(0,o.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:b,help:I}=f&&s?.[f]||{},S=Boolean((w?.length||A||y)&&!l);(0,o.vJ)(()=>{S||m||d()},[S,d,m]);const M=(0,$.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:c,help:g&&I?`@${m} ${I}`:void 0,loadMore:M}}(Boolean(Ro&&m&&he&&!ui),P,Po,Gt),qs=Boolean(In&&Object.keys(In).length),{isOpen:Hs,close:Gs,filteredBotCommands:Ws,filteredQuickReplies:_s}=function(e,t,n,i,s){const[a,r]=(0,o.J0)(),[d,l]=(0,o.J0)(),[c,u,h]=(0,V.A)(!1),m=(0,te.gs)(()=>{const n=t();return e&&n.startsWith("/")?(0,ee.S)(n).match(oe)?.[0].trim():void 0},[t,e],300),p=(0,ne.A)(m,[m,t],!0);return(0,o.vJ)(()=>{const e=p(),t=n||i;if(!e||!t&&!s)return r(void 0),void l(void 0);const o=e.substring(1),a=t?.filter(e=>!o||e.command.startsWith(o));r(a?.length?a:void 0);const d=Object.values(s||{}).filter(e=>!o||e.shortcut.startsWith(o));l(d?.length?d:void 0)},[p,n,i,s]),(0,o.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||d?.length)&&!c),close:u,filteredBotCommands:a,filteredQuickReplies:d}}(Boolean(Ro&&m&&he&&(_t&&_t?.length||ti?.length||qs&&Sn)),Po,_t,ti,Sn?In:void 0);(({draft:e,chatId:t,threadId:n,getHtml:d,setHtml:l,editedMessage:c,isDisabled:u})=>{const{saveDraft:h,clearDraft:m,loadCustomEmojis:p}=(0,i.ko)(),g=(0,o.li)(!1);(0,o.vJ)(()=>{const t=d(),n=void 0!==e?.isLocal;(0,B.QY)(e?.text)!==t||n?g.current=!0:g.current=!1},[e,d]),(0,o.vJ)(()=>{g.current=!1},[t,n]);const f=Boolean(c),v=(0,$.A)((e={})=>{if(u||f||!g.current)return;const o=d();o?(0,r.YS)(()=>{h({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,S.Ay)(o)})}):m({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})}),A=(0,Ce.A)(a.mPG,!0,void 0,[t,n]);(0,ye.A)(([o,i,d])=>{if(u)return;const h=g.current,m=e?.suggestedPostInfo&&!d?.suggestedPostInfo;if(t===o&&n===i){if(h&&!e)return;if(!e&&d&&l(""),h&&!m)return}if(c||!e)return;l((0,B.QY)(e.text)),m&&(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)});const f=e.text?.entities?.map(e=>e.type===s.C7.CustomEmoji&&e.documentId).filter(Boolean)||[];f.length&&p({ids:f})},[t,n,e,d,l,c,u]),(0,o.Nf)(()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),Ie=!0,(0,r.YS)(()=>{Ie=!1})}},[t,n,f,v,u]);const y=(0,Z.i)(t),C=(0,Z.i)(n);(0,o.vJ)(()=>{if(u||Ie)return;if(!d())return void v();const e=y.current,t=C.current;A(()=>{y.current===e&&C.current===t&&v()})},[y,d,u,A,C,v]),(0,we.Ay)(v),(0,be.A)(v)})({draft:de,chatId:P,threadId:ie,getHtml:Po,setHtml:Fo,editedMessage:Y,isDisabled:Oo||Boolean(en)||!_e&&Zo}),function({getHtml:e,chatId:t,threadId:n}){const{loadWebPagePreview:a,clearWebPagePreview:r,toggleMessageWebPage:d}=(0,i.ko)(),l=(0,o.li)(),c=(0,te.tF)(()=>{const t=(0,S.Ay)(e()),n=t.entities?.find(e=>e.type===s.C7.TextUrl);return l.current=t,n?.url||t.text.match(De)?.[0]},[e],300,!0),u=(0,ne.A)(c,[c,e],!0);(0,o.vJ)(()=>{const e=u(),o=l.current;e?a({text:o}):(r(),d({chatId:t,threadId:n}))},[u,t,n]),(0,X.A)(()=>{r(),d({chatId:t,threadId:n})},[t,r,n,d])}({chatId:P,threadId:ie,getHtml:Po});const Qs=(0,$.A)((e=!1)=>{e||Fo(""),ci(I.p),mi(void 0),Ss(),Ps(),Ds(),Es(),C?setTimeout(()=>os(),350):os()}),[Zs,Xs,ea]=((e,t,n,s,l,c,u,h,m)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,i.ko)(),[A,y]=(0,o.J0)(!1),C=h?.replyInfo?.replyToMsgId;(0,z.A)(([e,o])=>{if(!n)return;if(C&&o!==C)return t(""),void y(!1);if(e?.id===n.id&&C===o)return;const i=!e&&m?.text.length?m:n.content.text,s=(0,B.QY)(i);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,o.vJ)(()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Se.has(e.type));f({chatId:l,threadId:c,noWebPage:e})},[l,c,n]),(0,o.vJ)(()=>{if(n)return()=>{const t=(0,S.Ay)(e()),n=t.text.length?t:void 0;g({chatId:l,threadId:c,type:u,text:n})}},[l,n,e,g,c,u]);const b=(0,te.tF)(()=>{if(!n)return!1;const t=(0,S.Ay)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Se.has(e.type))&&!t.entities?.some(e=>Se.has(e.type))},[n,e],300,!0),I=(0,ne.A)(b,[b,e],!0);(0,z.A)(([e])=>{n&&e?.id===n.id&&I()&&f({chatId:l,threadId:c,noWebPage:!1})},[n,l,e,c,I]);const M=(0,$.A)(()=>{h&&(0,r.YS)(()=>{t((0,B.QY)(h.text)),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)})})}),N=(0,$.A)(()=>{s(),M()}),k=(0,$.A)(()=>{const{text:t,entities:o}=(0,S.Ay)(e());n&&(t||(0,d.mR)(n)?(p({messageList:{chatId:l,threadId:c,type:u},text:t,entities:o}),s(),M()):v({chatId:l,messageIds:[n.id],isSchedule:"scheduled"===u}))}),Y=(0,$.A)(()=>{if(!n)return;const t=(0,S.Ay)(e()),o=t.text.length?t:void 0;g({chatId:l,threadId:c,type:u,text:o})});return(0,we.Ay)(Y),(0,be.A)(Y),[k,N,A]})(Po,Fo,Y,Qs,P,ie,re,de,Xt),ta=(0,Z.i)(Qs),na=(0,Z.i)(us);(0,o.vJ)(()=>()=>{na.current(),ta.current()},[P,ie,ta,na]);const oa=(0,o.Kr)(()=>{if(Un)return Object.values(Un).every(Boolean)},[Un]),ia=Boolean(!fe&&je&&!oa),sa=Zo&&!Y&&!qe&&!He&&!de?.suggestedPostInfo,aa=(0,$.A)(()=>{const e=si.current;co(e?{message:So("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:gt,shouldReplaceHistory:!0}},actionText:So("Open")}:{message:So("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:So("PremiumMore")}),si.current=Number(!e)}),ra=(0,K.A)(()=>$o||!Hn||Po()&&!ui?Y&&ea?qt.Edit:!p.pW||ms||qe||Po()&&!ui?l?qt.Schedule:qt.Send:qt.Record:qt.Forward,[ms,Y,Po,ui,qe,$o,Hn,ea,l]),da=!l,{isContextMenuOpen:la,handleContextMenu:ca,handleContextMenuClose:ua,handleContextMenuHide:ha}=(0,U.A)(gs,!(ra===qt.Send&&da)),{contextMenuAnchor:ma,handleContextMenu:pa,handleBeforeContextMenu:ga,handleContextMenuHide:fa}=(0,U.A)(Yo,!Oo);(0,o.vJ)(()=>{Ve||ma&&(ho({peerId:P,storyId:se,position:ma}),fa())},[P,fa,Ve,se,ma]),ve(he||Oo,Ui,Gi,mi,Y,!me&&!fe,aa);const va=(0,$.A)(()=>{Y&&Xs()}),Aa=(0,$.A)((e,t)=>{const n=t?Tt:En;if(e?.length>n){const t=e.length-n;return _n({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0}),ya=(0,$.A)(()=>{if(dn&&!bs){const e=document.querySelector(cn),t=(0,N.Fm)(),n=Eo.current&&Math.floor(t-Eo.current),o=dn.nextSendDate&&dn.nextSendDate>t;if(n&&n<dn.seconds||o){const i=o?dn.nextSendDate-t:dn.seconds-n;return _n({data:{message:So("SlowModeHint",(0,f.QO)(i)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0}),Ca=e=>{if(!ae&&!se)return!1;const{text:t}=(0,S.Ay)(Po());return!(!t&&!e.length||!Aa(t,!0)||!ya())},wa=(0,$.A)(({attachments:e,sendCompressed:t=an.shouldCompress,sendGrouped:n=an.shouldSendGrouped,isSilent:o,scheduledAt:i,isInvertedMedia:s})=>{if(!ae&&!se)return;o=o||Ln;const{text:a,entities:d}=(0,S.Ay)(Po());s=a&&t&&n?s:void 0,Y?fo({messageList:ae,text:a,entities:d,attachments:(0,T.L)(e,t)}):Gn({messageList:ae,text:a,entities:d,scheduledAt:i,isSilent:o,shouldUpdateStickerSetOrder:ln,attachments:(0,T.L)(e,t),shouldGroupMessages:n,isInvertedMedia:s}),Eo.current=(0,N.Fm)(),Wn({chatId:P,isLocalOnly:!0}),(0,r.YS)(()=>{Qs()})}),ba=(0,$.A)((e,t,n)=>{if(Ca(li)){if(Y)return void wa({attachments:li,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});Ei(wa,{attachments:li,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}}),Ia=(0,$.A)((e,t,n,o,i)=>{Ca(li)&&wa({attachments:li,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o,isInvertedMedia:i})}),Sa=(0,$.A)((e,t=!1,n)=>{const{text:o,entities:i}=(0,S.Ay)(Po());if(e.length)return void(Ca(e)&&wa({attachments:e,scheduledAt:n,isSilent:t}));if(!o&&!qe)return;if(!Aa(o))return;const s=document.querySelector(cn),a=Pn?.id;if(o||qe){if(!ya())return;const e=Li?an.isInvertedMedia:void 0;Tn&&Ao({chatId:P,threadId:ie,effectId:void 0}),Gn({messageList:ae,text:o,entities:i,scheduledAt:n,isSilent:t,shouldUpdateStickerSetOrder:ln,isInvertedMedia:e,effectId:a,webPageMediaSize:an.webPageMediaSize,webPageUrl:Li?Mn.url:void 0,isForwarding:qe})}Eo.current=(0,N.Fm)(),Wn({chatId:P,threadId:ie,isLocalOnly:!0,shouldKeepReply:qe}),p.pz&&s&&s===document.activeElement&&F(s),(0,r.YS)(()=>{Qs()})}),Ma=(0,$.A)(async(e=!1,t)=>{if(!ae&&!se)return;e=e||Ln;let n=li;if(ms){const e=await us(),t=vs?a.dxe:void 0;if(e){const{blob:o,duration:i,waveform:s}=e;n=[await(0,T.A)("wonderful-voice-message.ogg",o,{voice:{duration:i,waveform:s},ttlSeconds:t})]}}Sa(n,e,t)}),Na=(0,$.A)((e=!1,t)=>{Ei(Ma,e,t)}),ka=(0,$.A)(()=>{me?Xn({chatId:P}):co({message:Mo("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Mo("PremiumMore")})}),Ya=(0,$.A)(()=>{if("webApp"!==nn?.type)return;const e=(0,A.vG)(nn.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,v._)(nn.url):ro({chatId:P,url:nn.url,threadId:ie})}),Pa=(0,$.A)(()=>{os(),Xi()}),Fa=(0,$.A)((e,t,n,o)=>{if(e&&"queryId"in e){const{id:n,queryId:o,isSilent:i}=e;return void io({id:n,chatId:P,threadId:ie,queryId:o,scheduledAt:t,isSilent:i||Ln})}const{isSilent:i,...s}=e||{};if(e&&0!==Object.keys(s).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:o=!1,isInvertedMedia:s}=e;Ia(n,o,i,t,s)}else Gn({...e,messageList:n,scheduledAt:t,effectId:o});else Ma(Boolean(i),t)});(0,z.A)(([e])=>{ae&&Dt&&Dt!==e&&ai(e=>{Fa(Dt,e,ae)})},[Dt,ae,Fa,ai]),(0,o.vJ)(()=>{en&&(Ui(en,void 0,!0),ao(),(0,r.Uz)(()=>{const e=document.getElementById(un);(0,w.A)(e,!0)}))},[un,en,ao,Fo]),(0,o.vJ)(()=>{tn?.length&&($i(tn),ao())},[$i,tn,ao]);const Ta=(0,$.A)((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||me||fe||n===ni?Ki(e,t):aa()}),Da=(0,$.A)(e=>{Ta(e,a.e0F)}),xa=(0,$.A)((e,t,n)=>{(ae||se)&&(t=t||Ln,l||n?(Vo(),ai(n=>{jo(),Ei(Fa,{gif:e,isSilent:t},n,ae),(0,r.YS)(()=>{Qs(!0)})})):(Ei(Gn,{messageList:ae,gif:e,isSilent:t}),(0,r.YS)(()=>{Qs(!0)})))}),Ea=(0,$.A)((e,t,n,o=!1,i)=>{(ae||se)&&(t=t||Ln,e={...e,isPreloadedGlobally:!0},l||n?(Vo(),ai(n=>{jo(),Ei(Fa,{sticker:e,isSilent:t},n,ae),(0,r.YS)(()=>{Qs(o)})})):(Ei(Gn,{messageList:ae,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:ln&&i}),Wn({chatId:P,threadId:ie,isLocalOnly:!0}),(0,r.YS)(()=>{Qs(o)})))}),La=(0,$.A)((e,t,n)=>{if(!ae&&!se)return;t=t||Ln,l||n?ai(n=>{Ei(Fa,{id:e.id,queryId:e.queryId,isSilent:t},n,ae)}):Ei(io,{id:e.id,queryId:e.queryId,threadId:ie,chatId:P,isSilent:t});const o=document.querySelector(cn);p.pz&&o&&o===document.activeElement&&F(o),Wn({chatId:P,isLocalOnly:!0}),(0,r.YS)(()=>{Qs()})}),Ba=(0,$.A)(()=>{Wn({chatId:P,isLocalOnly:!0}),(0,r.YS)(()=>{Qs()})}),Ra=(0,$.A)(e=>{ae&&(l?(ai(t=>{Ei(Fa,{poll:e},t,ae)}),Zn()):(Ei(Gn,{messageList:ae,poll:e,isSilent:Ln}),Zn()))}),Oa=(0,$.A)(e=>{ae&&(l?ai(t=>{Ei(Fa,{todo:e},t,ae)}):Ei(Gn,{messageList:ae,todo:e,isSilent:Ln}))}),Ua=(0,$.A)(e=>{if(l)ai(t=>{Fa({...e,isSilent:!0},t,ae)});else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:o}=e;Ia(t,n,!0,void 0,o)}else Ma(!0)}),Ka=(0,$.A)(()=>{const e=document.querySelector(cn);if(!C||e!==document.activeElement)return es(),os(),void ss();e?.blur(),setTimeout(()=>{es(),os(),ss()},100)});(0,o.vJ)(()=>{Bi&&Fo("")},[Bi,Fo,li]);const za=(0,$.A)(e=>{Oi(e,a.e0F)}),Va=(0,$.A)((e=un)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.L)(n,e))return void document.execCommand("delete",!1)}Fo(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const o=n.textContent.length,i=document.createRange(),s=window.getSelection();i.setStart(n,o),i.setEnd(n,o),s.removeAllRanges(),s.addRange(i),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(Po()))}),ja=(0,$.A)(()=>{Va(a.e0F)}),Ja=(0,$.A)(()=>{no({chatId:P,threadId:ie,type:"scheduled",noForumTopicPanel:!0})}),$a=(0,$.A)(()=>{mo({forUserId:P})}),qa=(0,$.A)(()=>{Io({price:{currency:a.OUy,amount:0,nanos:0}})}),Ha=(0,$.A)(()=>{const e=!Ln;wo({chatId:P,isEnabled:e}),co({localId:"silentPosting",icon:e?"mute":"unmute",message:Mo(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})});(0,o.vJ)(()=>{Ke&&C&&os()},[Ke,os,C]),(0,o.vJ)(()=>{m&&(ze?ds():setTimeout(()=>{ls()},200))},[ze,ls,ds,m]);const Ga=(0,K.A)(()=>Boolean(Po()),[Po]),Wa=ge&&"webApp"===nn?.type&&!Y&&"thread"===re,_a=Wa&&!Ga&&!ms,[Qa,Za]=(0,o.Kr)(()=>dn?.nextSendDate?["SlowModeWait",dn.nextSendDate]:Cn?.activeUntil&&Oo?["StealthModeActiveHint",Cn.activeUntil]:[],[Oo,dn?.nextSendDate,Cn?.activeUntil]),Xa=Wi||ts||Is||is||xs||Rs||Zi||Go||Ts||Hs||Ys||_a||la||Boolean(ms)||li.length>0||$o,er=Xa&&!Ve&&Oo&&!Go&&!ts,tr=(0,o.Kr)(()=>ms&&Bo<=600?"":Bi?Mo(Oo?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):nt||it||(Yn?Mo("ComposerPlaceholderPaidMessage",{amount:(0,b.U2)(Mo,Yn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):He&&_e?Mo("ComposerPlaceholderCaption"):le?.adminRights?.anonymous?Mo("ComposerPlaceholderAnonymous"):le?.isForum&&le?.isForumAsMessages&&ie===s.l3?ue?Mo("ComposerPlaceholderTopic",{topic:ue.title}):Mo("ComposerPlaceholderTopicGeneral"):Mo(Ne?Ln?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder")),[ms,nt,le,it,Ne,Bi,Oo,Ln,Mo,ue,He,ie,Bo,Yn,_e]);(0,o.vJ)(()=>{Xa?$n?.():qn?.()},[Xa,qn,$n]);const{shouldRender:nr,transitionClassNames:or}=(0,Q.A)(er),ir=!(ra!==qt.Record||fi&&pe&&Ci),sr=(0,$.A)(()=>{switch(ra){case qt.Forward:Hn?.();break;case qt.Send:Na();break;case qt.Record:ir?pe?Ci||uo({chatId:P,messageListType:re}):co({message:So("VoiceMessagesRestrictedByPrivacy",le?.title)}):(As(!1),cs());break;case qt.Edit:Zs();break;case qt.Schedule:if(ms&&hs(),!ae)return;ai(e=>{Fa({},e,ae,Pn?.id)})}}),ar=new Date;ar.setSeconds(0),ar.setMilliseconds(0);const rr=new Date;rr.setFullYear(rr.getFullYear()+1);let dr="SendMessage";switch(ra){case qt.Forward:dr="Forward";break;case qt.Edit:dr="Save edited message";break;case qt.Record:dr=fi?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const lr=(0,g.A)("Composer",!ze&&"shown",rs&&"hover-disabled",To&&"mounted",mn),cr=(0,$.A)(e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const o=(0,u.O8F)((0,i.mS)(),e.documentId);if(!o)return;if(!o.isFree&&!me&&!fe)return void aa();const s=(0,S.Ay)((0,D.hB)(o));t=s.text,n=s.entities}Ei(Gn,{text:t,entities:n,isReaction:!0}),po()}),ur=(0,$.A)(e=>{yo({chatId:P,threadId:ie,reaction:e}),po()}),hr=(0,$.A)(e=>{ho({peerId:P,storyId:se,position:e,sendAsMessage:!0})}),mr=(0,$.A)(()=>{const e=yn?void 0:a.tNZ;go({peerId:P,storyId:se,containerId:(0,d.$_)(P,se),reaction:e})}),pr=(0,$.A)(()=>{ai(e=>{Fa({},e,ae)})}),gr=(0,$.A)(()=>{Ei(Ua)}),fr=(0,$.A)(()=>{Ei(Fa,{},a.NkL,ae,Pn?.id)}),vr=(0,$.A)((e,t,n)=>{ai(o=>{Ei(Fa,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},o,ae)})}),Ar=(0,$.A)((e,t,n)=>{Ei(Ua,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}),yr=(0,$.A)(()=>{Ao({chatId:P,threadId:ie,effectId:void 0})}),Cr=(0,$.A)(()=>{Co({})}),wr=(0,o.Kr)(()=>{switch(ra){case qt.Edit:return Zs;case qt.Schedule:return pr;default:return Na}},[ra,Zs,Na]),br=ge&&"commands"===nn?.type&&!Y&&!1!==_t&&!ms,Ir=Tn&&Pn?.emoticon,Sr=Boolean(Yn&&ra===qt.Send),Mr=(0,H.A)(Sr);return(0,Ge.FD)("div",{className:lr,children:[Ro&&fi&&m&&(0,Ge.Y)(wt,{isOpen:n!==Ct.I.None,withQuick:n===Ct.I.QuickFile||Lo===Ct.I.QuickFile,onHide:Jn,onFileSelect:$i,editingMessage:Y}),nr&&!Ni&&(0,Ge.Y)(Ut.A,{topReactions:gn,allAvailableReactions:pn,onToggleReaction:cr,isPrivate:!0,isReady:m,canBuyPremium:fn,isCurrentUserPremium:me,isInSavedMessages:fe,isInStoryViewer:Oo,canPlayAnimatedEmojis:vn,onShowMore:hr,className:or}),(0,Ge.Y)(We,{chatId:P,threadId:ie,canShowCustomSendMenu:da,attachments:li,getHtml:Po,isReady:m,shouldForceCompression:Vi,shouldForceAsFile:ji,isForCurrentMessageList:he,isForMessage:Ro,shouldSchedule:oi&&l,canSchedule:oi,forceDarkTheme:Oo,onCaptionUpdate:qi,onSendSilent:Ar,onSend:ba,onSendScheduled:vr,onFileAppend:Ji,onClear:Hi,onAttachmentsUpdate:Gi,onCustomEmojiSelect:Da,onRemoveSymbol:ja,onEmojiSelect:za,editingMessage:Y,onSendWhenOnline:fr,canScheduleUntilOnline:h&&!vs,paidMessagesStars:Yn}),(0,Ge.Y)(Nt,{isOpen:Ze.isOpen,isQuiz:Ze.isQuiz,shouldBeAnonymous:Ne,maxOptionsCount:jn,onClear:Zn,onSend:Ra}),(0,Ge.Y)(Ft,{modal:Xe,onClear:eo,onSend:Oa}),(0,Ge.Y)(kt,{isOpen:is,onClose:as,chatId:P,selectedSendAsId:Zt,sendAsPeerIds:Uo,isCurrentUserPremium:me}),(0,Ge.Y)(St,{isOpen:xs,filteredUsers:Bs,onInsertUserName:Ls,onClose:Es}),(0,Ge.Y)(ut,{isOpen:Hs,chatId:P,withUsername:Boolean(ti),botCommands:Ws,quickReplies:_s,getHtml:Po,self:ft,quickReplyMessages:bn,onClick:Ba,onClose:Gs}),(0,Ge.FD)("div",{className:(0,g.A)("composer-wrapper",Oo&&"with-story-tweaks",Ni&&"is-need-premium"),children:[!Ni&&(0,Ge.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,Ge.Y)("defs",{children:(0,Ge.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,Ge.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Ge.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,Ge.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,Ge.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,Ge.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,Ge.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"})]})]}),Ro&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(It,{isOpen:Rs,botId:Os,isGallery:Us,inlineBotResults:Vs,switchPm:Ks,switchWebview:zs,loadMore:$s,isSavedMessages:fe,canSendGifs:gi,isCurrentUserPremium:me,onSelectResult:La,onClose:js}),(0,Ge.Y)(vt,{onClear:va,shouldForceShowEditing:Boolean(ea&&Y),chatId:P,threadId:ie,messageListType:re}),(0,Ge.Y)(Rt,{chatId:P,threadId:ie,isDisabled:!Ai||ui||!Ga,isEditing:Boolean(Y)})]}),(0,Ge.FD)("div",{className:(0,g.A)("message-input-wrapper",(0,E.y)(ft)),children:[Ro&&(0,Ge.FD)(Ge.FK,{children:[Wa&&(0,Ge.Y)(ct,{isOpen:_a,text:nn.text,isDisabled:Boolean(ms),onClick:Ya}),br&&(0,Ge.Y)(ot.A,{className:(0,g.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===_t,color:"translucent",onActivate:Pa,ariaLabel:"Open bot command keyboard",children:(0,Ge.Y)(et.A,{name:"bot-commands-filled"})}),Ko&&Qt&&(0,Ge.Y)(dt.A,{round:!0,color:"translucent",onClick:is?as:Ka,ariaLabel:So("SendMessageAsTitle"),className:(0,g.A)("send-as-button","composer-action-button",di.current&&"appear-animation"),children:(0,Ge.Y)(jt.A,{peer:Qt,size:"tiny"})})]}),(!Bi||gi||pi)&&!Ni&&!Kn&&(0,Ge.Y)(Pt.A,{chatId:P,threadId:ie,isMobile:C,isReady:m,isSymbolMenuOpen:ts,openSymbolMenu:ns,closeSymbolMenu:os,canSendStickers:pi,canSendGifs:gi,isMessageComposer:Ro,onGifSelect:xa,onStickerSelect:Ea,onCustomEmojiSelect:Ta,onRemoveSymbol:Va,onEmojiSelect:Oi,closeBotCommandMenu:es,closeSendAsMenu:as,isSymbolMenuForced:zo,canSendPlainText:!Bi,inputCssSelector:cn,idPrefix:e,forceDarkTheme:Oo}),(0,Ge.Y)(Mt.A,{ref:No,id:hn,editableInputId:un,customEmojiPrefix:e,isStoryInput:Oo,chatId:P,canSendPlainText:!Bi,threadId:ie,isReady:m,isActive:!ui,getHtml:Po,placeholder:tr,timedPlaceholderDate:Za,timedPlaceholderLangKey:Qa,forcedPlaceholder:Js,canAutoFocus:m&&he&&!ui&&Ro,noFocusInterception:ui,shouldSuppressFocus:C&&ts,shouldSuppressTextFormatter:Is||xs||Rs,onUpdate:Fo,onSend:wr,onSuppressedFocus:os,onFocus:qo,onBlur:Ho,isNeedPremium:Ni,messageListType:re}),Ro&&(0,Ge.FD)(Ge.FK,{children:[Wt&&Boolean(Os)&&(0,Ge.Y)(Kt.A,{color:"gray"}),(0,Ge.Y)(zt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(Ga),direction:"inverse",name:"slideFadeAndroid",children:!Ga&&(0,Ge.FD)(Ge.FK,{children:[Ne&&(0,Ge.Y)(zt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(Ln),children:(0,Ge.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Ha,ariaLabel:Mo(Ln?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),children:(0,Ge.Y)(et.A,{name:Ln?"mute":"unmute"})})}),rt&&(0,Ge.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:Ja,ariaLabel:Mo("AriaComposerOpenScheduled"),children:(0,Ge.Y)(et.A,{name:"scheduled"})}),ia&&(0,Ge.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:$a,children:(0,Ge.Y)(et.A,{name:"gift"})}),sa&&(0,Ge.Y)(dt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:qa,children:(0,Ge.Y)(et.A,{name:"cash-circle"})}),Boolean(tt)&&!ms&&!Y&&(0,Ge.Y)(ot.A,{className:(0,g.A)("composer-action-button",Wi&&"activated"),round:!0,color:"translucent",onActivate:_i,ariaLabel:Mo("AriaComposerBotKeyboard"),children:(0,Ge.Y)(et.A,{name:"bot-command"})})]})})]}),ms&&Boolean(ps)&&(0,Ge.Y)("span",{className:"recording-state",children:(0,f.JW)(ps-fs.current)}),!Ni&&(0,Ge.Y)(st,{chatId:P,threadId:ie,editingMessage:Y,canEditMedia:Qo,isButtonVisible:!ms,canAttachMedia:fi,canAttachPolls:vi,canAttachToDoLists:yi,canSendPhotos:Si,canSendVideos:Ii,canSendDocuments:Mi,canSendAudios:bi,onFileSelect:$i,onPollCreate:Qn,onTodoListCreate:ka,isScheduled:l,attachBots:Ro?on:void 0,peerType:sn,shouldCollectDebugLogs:An,theme:rn,onMenuOpen:Wo,onMenuClose:_o,messageListType:re,paidMessagesStars:Yn}),Ro&&Boolean(tt)&&(0,Ge.Y)(lt,{messageId:tt,threadId:ie,isOpen:Wi,onClose:Qi}),Ro&&_t&&(0,Ge.Y)(at,{isOpen:Zi,botCommands:_t,onClose:es}),(0,Ge.Y)(At.A,{chatId:P,isOpen:Ys,onCustomEmojiSelect:Fs,addRecentCustomEmoji:lo,onClose:Ps},`custom-emoji-tooltip-${un}`),(0,Ge.Y)(Yt,{chatId:P,threadId:ie,isOpen:Ts,onStickerSelect:Ea,onClose:Ds},`sticker-tooltip-${un}`),(0,Ge.Y)(bt.A,{isOpen:Is,emojis:Ms,customEmojis:Ns,addRecentEmoji:oo,addRecentCustomEmoji:lo,onEmojiSelect:ks,onCustomEmojiSelect:ks,onClose:Ss},`emoji-tooltip-${un}`)]})]}),wn&&ms&&(0,Ge.FD)(dt.A,{className:(0,g.A)("view-once",vs&&"active"),round:!0,color:"secondary",ariaLabel:So("Chat.PlayOnceVoiceMessageTooltip"),onClick:ys,children:[(0,Ge.Y)(et.A,{name:"view-once"}),(0,Ge.Y)(et.A,{name:"one-filled"})]}),ms&&(0,Ge.Y)(dt.A,{round:!0,color:"danger",className:"cancel",onClick:us,ariaLabel:"Cancel voice recording",children:(0,Ge.Y)(et.A,{name:"delete"})}),Oo&&!ms&&(0,Ge.FD)(dt.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:mr,onContextMenu:pa,onMouseDown:ga,ariaLabel:So("AccDescrLike"),ref:Yo,children:[yn&&(0,Ge.Y)($t.A,{containerId:(0,d.$_)(P,se),reaction:yn,withEffectOnly:ii},(0,d.Jj)(yn)),(!yn||ii)&&(0,Ge.Y)(et.A,{name:"heart",className:(0,g.A)(ii&&"story-reaction-heart")})]}),(0,Ge.FD)(dt.A,{ref:gs,round:!0,color:"secondary",className:(0,g.A)(ra,"main-button",!m&&"not-ready",ms&&"recording"),disabled:ir,allowDisabledClick:!0,noFastClick:!0,ariaLabel:So(dr),onClick:sr,onContextMenu:ra===qt.Send&&da?ca:void 0,children:[(0,Ge.Y)(et.A,{name:"send"}),(0,Ge.Y)(et.A,{name:"microphone-alt"}),Hn&&(0,Ge.Y)(et.A,{name:"forward"}),Ro&&(0,Ge.Y)(et.A,{name:"schedule"}),Ro&&(0,Ge.Y)(et.A,{name:"check"}),(0,Ge.Y)(dt.A,{className:(0,g.A)("paidStarsBadge",Sr&&"visible",Mr&&!Sr&&"hiding",!Mr&&!Sr&&"hidden"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,Ge.FD)("div",{className:"paidStarsBadgeText",children:[(0,Ge.Y)(et.A,{name:"star",className:(0,g.A)("star-amount-icon",mn)}),(0,Ge.Y)(Vt.A,{ref:ko,text:Mo.number(Pi)})]})})]}),Ir&&(0,Ge.Y)("span",{className:"effect-icon",onClick:yr,children:(0,L.A)(Ir)}),Pn&&Dn&&(0,Ge.Y)(Ot.A,{shouldPlay:xn,effect:Pn,onStop:Cr}),da&&(0,Ge.Y)(yt.A,{isOpen:la,canSchedule:oi&&Ro&&!vs,canScheduleUntilOnline:h&&!vs,onSendSilent:fe?void 0:gr,onSendSchedule:l?void 0:pr,onSendWhenOnline:fr,onRemoveEffect:yr,onClose:ua,onCloseAnimationEnd:ha,isSavedMessages:fe,chatId:P,withEffects:Tn,hasCurrentEffect:Boolean(Pn),effectReactions:Fn,allAvailableReactions:pn,onToggleReaction:ur,isCurrentUserPremium:me,isInSavedMessages:fe,isInStoryViewer:Oo,canPlayAnimatedEmojis:vn}),ri,(0,Ge.Y)(Jt.A,{isOpen:Bn,onClose:Fi,userName:le?(0,c.F9)(Mo,le):void 0,messagePriceInStars:Yn||0,messagesCount:Yi,shouldAutoApprove:Di,setAutoApprove:xi,confirmHandler:Ti})]})}))},23459:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(9716),d=n(37836);const l=36e5,c=new Map;let u=new Set;const h=(0,d.nF)(()=>{const e=Array.from(u),t=e.slice(0,100),n=e.slice(100);(0,i.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach(e=>c.set(e,Date.now())),u=new Set(n),u.size&&h()},500);function m(e){const t=(0,o.Kr)(()=>{const t=(0,i.mS)();return e?.map(e=>(0,a.PVB)(t,e)).filter(Boolean)},[e]),n=(0,o.Kr)(()=>{const e=(0,i.mS)();return t?.filter(t=>{const n=c.get(t.id)||0;if(Date.now()-n<l)return!1;if((0,r.L8)(t.id)){const n=t,o=(0,a.K0y)(e,n.id),i=o&&"userStatusEmpty"!==o.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&i}{const n=t,o=(0,a._ls)(e,n.id);return(0,s.WX)(n)&&!o}}).map(e=>e.id)},[t]);(0,o.vJ)(()=>{n?.length&&(n.forEach(e=>u.add(e)),h())},[n])}},23565:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,o.li)(),d=(0,i.A)(),l=null!=e,c=null!=n;return l&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)(()=>{t&&!l&&c&&!r.current&&(r.current=window.setTimeout(()=>{r.current=void 0,d()},t))},[t,d,l,c]),r.current&&t&&!l?n:e}},24807:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(87357),a=n(80140),r=n(22237),d=n(14242),l=n(59852),c=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,o.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,i.ko)(),Y=(0,m.A)(),P=(0,u.A)(),{unreadMentionsCount:F=0,unreadReactionsCount:T=0}=n.isForum?{}:n,D=!y&&e&&!b,x=n.isForum&&!e,E=(0,o.Kr)(()=>x&&t?Object.values(t).filter(({unreadCount:e})=>e):void 0,[t,x]),L=(0,o.Kr)(()=>x?E?.length:(e||n).unreadCount,[n,e,E,x]),B=(0,o.Kr)(()=>{if(!x)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},[x,C,E,e?.notifySettings.mutedUntil]),R=!e&&n.hasUnreadMark,O=!(0,c.A)(()=>(0,r.Hp)(I)?I():I,[I])&&Boolean(L||F||R||y||T||D||M),U=Boolean((L||R)&&!S),K=(0,s.A)("ChatBadge",!B&&"muted",!U&&y&&"pinned",U&&"unread"),z=(0,h.A)(e=>{e.stopPropagation();const t=(0,l.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=D&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge unopened",!B&&"muted")}),o=R||L?(0,A.Y)("div",{className:K,children:!R&&(0,A.Y)(p.A,{text:(0,d.Vw)(P,L)})}):void 0,i=y&&(0,A.Y)("div",{className:K,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:z,children:Y("BotOpen")}),r=!o&&!t&&!e&&i,l=[n,e,t,o,r].filter(Boolean);return S?i:M&&(0===l.length||r)?a:0!==l.length?1===l.length?l[0]:w?[t,o,e,i].filter(Boolean)[0]:(0,A.Y)("div",{className:"ChatBadge-wrapper",children:l}):void 0}()})})},24899:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(31481);function i(e,t){return t?`${o.jsp}${e}`:`@${e}`}},24920:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(73767);function a(e){const t=(0,i.A)(),n=(0,o.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},25477:(e,t,n)=>{n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(17663),d=n(58554),l=n(76023),c=n(35127),u=n(84313),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(62587),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),b=n(18276),I=n(27860),S=n(14413),M=n(65843),N=n(35913),k=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,video:t,isOwn:n,isInWebPage:Y,noAvatars:P,canAutoLoad:F,canAutoPlay:T,uploadProgress:D,forcedWidth:x,dimensions:E,asForwarded:L,isDownloading:B,isProtected:R,className:O,lastPlaybackTimestamp:U,clickArg:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:J,onCancelUpload:$,needsAgeVerification:q})=>{const{cancelMediaDownload:H,updateContentSettings:G,openAgeVerificationModal:W}=(0,i.ko)(),_=(0,o.li)(),Q=(0,o.li)(),[Z,X,ee]=(0,m.A)(),[te,ne]=(0,o.J0)(!1),oe="extendedMediaPreview"===t.mediaType,ie=oe?void 0:t.blobUrl,se=oe||t.isSpoiler||z,[ae,re,de]=(0,m.A)(se);(0,o.vJ)(()=>{se?re():de()},[se]);const le=(0,g.A)(()=>{ee(),de(),te&&G({isSensitiveEnabled:!0})}),ce=(0,p.Vz)(_,V),ue=(0,p.Vz)(_,j)&&ce,he=(0,o.li)(ce);ue&&!he.current&&(he.current=!0);const{isMobile:me}=(0,h.Ay)(),[pe,ge]=(0,o.J0)(F),fe=Boolean(pe&&ce&&!oe),[ve,Ae]=(0,o.J0)(Boolean(T&&!ae)),ye=oe?void 0:(0,s.sC)(t,"inline"),[Ce]=(0,o.J0)(Boolean(ye&&d.Ih(ye))),{mediaData:we,loadProgress:be}=(0,A.A)(ye,!fe,oe?void 0:(0,s.Cz)(t,"inline")),Ie=ie||we,[Se,Me]=(0,m.A)(),Ne=(0,s.VD)(t),ke=Boolean(Ne),Ye=Boolean(x),Pe=Ie&&he.current,Fe=(0,u.A)(Q,!0,!Pe),Te=oe?void 0:(0,s.sC)(t,"preview"),[De]=(0,o.J0)(Boolean(Te&&d.Ih(Te))),xe=ce,Ee=(0,f.A)(Te,!xe),Le=Se&&!Fe,{ref:Be}=(0,v.A)({hasMediaData:Boolean((ke||Ee)&&!Le)}),Re=Boolean(!ke||Ee||Se),Oe=(0,w.A)(t,Re);(0,v.A)({ref:Oe,hasMediaData:!Re});const Ue=(0,w.A)(t,!Ye),{loadProgress:Ke}=(0,A.A)(oe?void 0:(0,s.sC)(t,"download"),!B,oe?void 0:(0,s.Cz)(t,"download")),{isUploading:ze,isTransferring:Ve,transferProgress:je}=(0,s.LK)(D||(B?Ke:be),fe&&!Se&&!Ce||B,void 0!==D),Je=!1===(0,y.A)(pe),{ref:$e,shouldRender:qe}=(0,C.A)({isOpen:Ve&&!Fe,noMountTransition:Je,withShouldRender:!0}),{ref:He}=(0,C.A)({isOpen:Boolean((pe||Ie)&&!ve&&!qe)}),[Ge,We]=(0,o.J0)(0),_e=(0,g.A)(e=>{We(Math.max(0,e.currentTarget.currentTime-1))}),Qe=(Number.isFinite(Q.current?.duration)&&!Fe?Q.current?.duration:t.duration)||0,{width:Ze,height:Xe}=E||(oe?(0,l.ri)(t,Boolean(n),L,Y,P,me):(0,l.rO)(t,Boolean(n),L,Y,P,me)),et=(0,g.A)((e,n)=>{if(ze)$?.(K);else if(oe||!B){if(Ie)return Ie&&!ve&&Ae(!0),ae?z?q?void W():void X():void de():n&&fe&&!Se&&!Ce?(ge(!1),void e.stopPropagation()):void J?.(K,e);ge(e=>!e)}else H({media:t})}),tt=(0,g.A)(e=>{et(e,!0)}),nt=(0,a.A)("media-inner dark",!ze&&"interactive",Xe<c.ej&&"fix-min-height",O),ot=`height: ${Xe}px;${E?` width: ${Ze}px; left: ${E.x}px; top: ${E.y}px;`:""}`;return(0,k.FD)("div",{ref:_,id:e,className:nt,style:ot,onClick:ze?void 0:e=>et(e),children:[Ye&&(0,k.Y)("canvas",{ref:Ue,className:"thumbnail blurred-bg"}),Pe&&(0,k.Y)(M.A,{ref:Q,src:Ie,className:(0,a.A)("full-media",Ye&&"with-blurred-bg"),canPlay:ve&&ue&&!Fe,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!R,onTimeUpdate:_e,onReady:Me,style:x?`width: ${x}px`:void 0}),(0,k.Y)("img",{ref:Be,src:Ee,className:(0,a.A)("thumbnail",Ye&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px;`:void 0,draggable:!R}),ke&&!De&&(0,k.Y)("canvas",{ref:Oe,className:"thumbnail"}),R&&(0,k.Y)("span",{className:"protector"}),(0,k.Y)(b.A,{ref:He,name:"large-play"}),(0,k.Y)(I.A,{isVisible:ae,withAnimation:!0,thumbDataUri:Ne,isNsfw:z,width:Ze,height:Xe,className:"media-spoiler"}),qe&&(0,k.Y)("div",{ref:$e,className:"media-loading",children:(0,k.Y)(N.A,{progress:je,onClick:tt})}),!pe&&!Ie&&(0,k.Y)(b.A,{name:"download"}),!Ve||Fe&&!B?(0,k.FD)("div",{className:"message-media-duration",children:[!oe&&t.isGif?"GIF":(0,r.QO)(Math.max(Qe-Ge,0)),Fe&&(0,k.Y)(b.A,{name:"message-failed",className:"playback-failed"})]}):(0,k.Y)("span",{className:"message-transfer-progress",children:ze||B?`${Math.round(100*je)}%`:"..."}),Boolean(U)&&(0,k.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(U/Qe*100)}%`}),(0,k.Y)(S.A,{isOpen:Z,onClose:ee,shouldAlwaysShow:te,onAlwaysShowChanged:ne,confirmHandler:le})]})}))},25498:(e,t,n)=>{n.d(t,{A:()=>T});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(91048),d=n(52491),l=n(36353),c=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,c._E)(e,t)).slice(0,n):u.p}),P=(0,h.A)(function(e,t,n){const o=Object.values(e),i=(0,c.dU)(o,"native"),s=t?(0,c.LG)(t,e=>Object.values((0,c._E)(i,e))):{},a=n?(0,c.LG)(n,e=>Object.values((0,c._E)(i,e))):{},r={...s,...a},d=[].concat(Object.keys(s),Object.keys(a)),l=o.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{}),u=Object.keys(l),h=d.reduce((e,t)=>Math.max(e,t.length),0);return{byKeyword:r,keywords:d,byName:l,names:u,maxKeyLength:h}}),F=(0,h.A)(function(e,t,n){const{byKeyword:o,keywords:i,byName:s,names:a,maxKeyLength:r}=e;let d=[];if(t.length>r)return u.p;const l=i.filter(e=>e.startsWith(t)).sort();d=d.concat(Object.values((0,c._E)(o,l)).flat());const h=a.filter(e=>e.startsWith(t));return d=d.concat(Object.values((0,c._E)(s,h)).flat()),d=(0,c.Am)(d),d.length?d.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,D,x,E){const[L,B,R]=(0,A.A)(!1),[O,U]=(0,o.J0)(),[K,z]=(0,o.J0)(u.p),[V,j]=(0,o.J0)(u.p);(0,o.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,d.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(z(e),e===u.p)return void j(u.p);const t=e.map(e=>e.native),n=(0,c.Xd)((0,r.oZ0)((0,i.mS)(),t),"id");j(n)}),H=(0,y.A)((e,n=!1)=>{const o=t();if(!o)return;const i=o.lastIndexOf(":",n?o.lastIndexOf(":")-1:void 0);if(-1!==i){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${o.substring(0,i)}${t}`);const n=T===s.CfG?document.querySelector(s.m$5):document.getElementById(T);(0,a.Uz)(()=>{(0,l.A)(n,!0,!0)})}q(u.p)});return(0,o.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 o=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=N){const e=P(O,x,E);o=F(e,n.toLowerCase(),M)}}else o=Y(O,D,M);o.length?t?H(o[0].native,!0):q(o):q(u.p)},[x,O,$,E,H,D,q]),(0,o.vJ)(R,[R,t]),{isEmojiTooltipOpen:Boolean(K.length||V.length)&&!L,closeEmojiTooltip:B,filteredEmojis:K,filteredCustomEmojis:V,insertEmoji:H}}},25897:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},26440:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(31481),a=n(87357),r=n(37661),d=n(17712),l=n(18276),c=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,o.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:D,onEmojiSelect:x,closeBotCommandMenu:E,closeSendAsMenu:L})=>{const{setStickerSearchQuery:B,setGifSearchQuery:R,addRecentEmoji:O,addRecentCustomEmoji:U}=(0,i.ko)(),K=(0,o.li)(),[z,V]=(0,r.A)(),[j,J]=(0,o.J0)(void 0),$=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",z?y&&"menu-opened":y&&"is-loading"),q=(0,d.A)(()=>{E?.(),L?.(),k();const e=K.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})}),H=(0,d.A)(e=>{"stickers"===e?(B({query:""}),R({query:void 0})):(R({query:""}),B({query:void 0}))}),G=(0,d.A)(()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout(()=>{E?.(),k()},100)):k()}),W=(0,d.A)(()=>K.current),_=(0,d.A)(()=>K.current?.closest(".custom-scroll, .no-scrollbar")),Q=(0,d.A)(()=>document.querySelector("#portals .SymbolMenu .bubble")),Z=(0,d.A)(()=>({withPortal:!0}));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(c.A,{className:$,round:!0,color:"translucent",onClick:y?Y:G,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(l.A,{name:"smile"}),(0,g.Y)(l.A,{name:"keyboard"}),y&&!z&&(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:K,className:"symbol-menu-trigger"}),(0,g.Y)(l.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(I),canSendGifs:m,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:V,onClose:Y,onEmojiSelect:x,onStickerSelect:F,onCustomEmojiSelect:P,onGifSelect:T,onRemoveSymbol:D,onSearchOpen:H,addRecentEmoji:O,addRecentCustomEmoji:U,isAttachmentModal:w,canSendPlainText:b,className:(0,a.A)(S,M&&"component-theme-dark"),anchor:w?j:void 0,getTriggerElement:w?W:void 0,getRootElement:w?_:void 0,getMenuElement:w?Q:void 0,getLayout:w?Z:void 0})]})})},31880:(e,t,n)=>{n.d(t,{A:()=>m,a:()=>l});var o=n(13439),i=n(91048),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],d=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],l=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],l=Object.keys(o).filter(e=>Boolean(o[e]))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,d);a=t||[],l=Object.keys(o).filter(e=>Boolean(o[e]))}const c=(0,o.mS)();return{selectedChatIds:a.filter(e=>(0,i.hds)(c,e)),selectedChatTypes:l}}function c(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,d)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,s.cJ)(e.folder,r),title:e.folder.title?e.folder.title:{text:c(e.includeFilters)},...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,s.cJ)(e.folder,d),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"setColor":return{...e,folder:{...e.folder,color:t.payload},isTouched:!0};case"reset":return u;default:return e}},m=()=>(0,a.A)(h,u)},34458:(e,t,n)=>{n.d(t,{$:()=>v,UG:()=>c,wV:()=>f});var o=n(31481),i=n(66644),s=n(19822),a=n(83868),r=n(76023),d=n(2429),l=n(17169);const c=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:d}=A(e);if(!(n&&d&&r&&t&&a))return;const{bottom:p,right:f}=a.getBoundingClientRect(),v=p+u,S=d[0],M=d[d.length-1],N=C(S);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===N;let p=w(n,d),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,D=I-v,x=Y/F;I-=m;const E=P-k+2*m,L=v-I+m,B=F/(Y+2*m);(0,i.RK)(()=>{if(!p)return;const n=y(e);let a;A>h?(a=y(p),u&&a.classList.add(l.A.ghostLast)):n.classList.add(l.A.ghostAnimateName),(0,s.ZM)(n,{top:`${v}px`,left:`${P}px`,zIndex:String(A),opacity:a?"0":"",transform:`translate3d(${T}px, ${D}px, 0) scale(${x})`}),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,i.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(l.A.ghostRevealName);const r=b(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),p?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)})},c+o.xB5);g.add(r)})})})}function v(e){I();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:d}=A(e);if(!(n&&a&&r&&t&&d))return;const{right:u}=d.getBoundingClientRect(),f=a[0],v=a[a.length-1],S=C(f);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const A=d===S;let I=w(n,d),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 D=P-k,x=T-N-p,E=F/Y;T-=m;const L=k-P+2*m,B=N-T+m,R=Y/(F+2*m);(0,i.RK)(()=>{const n=y(e);let a;M>h?(a=y(I),A&&a.classList.add(l.A.ghostLast)):n.classList.add(l.A.ghostAnimateName,l.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,i.RK)(()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${D}px, ${x}px, 0) scale(${E})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(l.A.ghostRevealName);const r=b(()=>{(0,i.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)},c+o.xB5);g.add(r)})})})}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),o=t.querySelector("#StoryRibbon"),i=t.querySelector(".left-header"),s=o?.querySelectorAll(`.${d.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:i,ribbonPeers:s,toggleAvatars:a}}function y(e){const t=e.cloneNode(!0);t.classList.add(l.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,{Ay:()=>d,ej:()=>r,nP:()=>l,yA:()=>c});var o=n(76023);const i=12,s=40,a=i*o.$,r=5*o.$;function d(e){return(e?14:20)*o.$}function l(e="",t,n){return e.length>s||n?d(t):a}function c({media:e,messageText:t,isOwn:n,isInWebPage:s,asForwarded:a,noAvatars:d,isMobile:c}){const u="photo"===e.mediaType,h="video"===e.mediaType,m=u&&s,p=h&&s,{width:g,height:f}=u?(0,o.ck)(e,n,a,m,d,c):h?(0,o.rO)(e,n,a,p,d,c):(0,o.ri)(e,n,a,s,d,c),v=l(t,c);let A=1;g<v&&v-g<i&&(A=v/g),f*A<r&&r-f*A<i&&(A=r/f);const y=Math.round(g*A),C=Math.round(f*A);return{width:y,height:C,isSmall:y<v||C<r}}},35749:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(77312),i=n(63527);function s(e){return e.messages.webPageById}function a(e,t){const n=(0,i.A)(s);if(!e)return;const a=e.content.webPage?.id,r=a?n[a]:void 0;return(0,o.EO)(e,{webPage:r},t)}},36353:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(96454);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),s=document.createRange(),a=e.lastChild||e;o.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),i.removeAllRanges(),i.addRange(s)):e.focus()}},36680:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(96454),s=n(17712);const a=250;let r;function d(e,t,n=a,d=!1){const l=(0,o.li)(!1),c=(0,s.A)(()=>{l.current=!0});return(0,o.vJ)(()=>{r&&(clearTimeout(r),r=void 0),!e||i.TF||d||(r=window.setTimeout(()=>{l.current||t()},2*n))},[d,e,n,t]),[(0,s.A)(()=>{l.current=!0}),(0,s.A)(()=>{l.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout(()=>{l.current||t()},n)}),c]}},37378:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(87357),d=n(17663),l=n(58849),c=n(49086),u=n(4961),h=n(39351),m=n(17712),p=n(59030),g=n(96530),f=n(81524),v=n(84685),A=n(20021);const y=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,a.Pn$)(e,t)}))(({message:e,webPage:t,senderTitle:n,isProtected:o,observeIntersection:i,onMessageClick:a})=>{const y=(0,h.A)(),C=(0,p.A)();let w=t;if(!w){const t=(0,s.ZD)(e);if(t){const{url:n,domain:o}=t;w={siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.BN)(y,e)?.text!==n?(0,c.C)(y,e,void 0,void 0,170):void 0}}}const b=(0,m.A)(()=>{a(e)});if("full"!==w?.webpageType)return;const{siteName:I,url:S,displayUrl:M,title:N,description:k,formattedDescription:Y,photo:P,video:F}=w,T=!n&&k&&(0,l.A)(k,170),D=(0,r.A)("WebLink scroll-item",!P&&!F&&"without-media"),x=S.replace("mailto:","")||M;return(0,A.FD)("div",{className:D,"data-initial":(I||M)[0],dir:y.isRtl?"rtl":void 0,children:[P&&(0,A.Y)(f.A,{message:e,isProtected:o,observeIntersection:i}),(0,A.FD)("div",{className:"content",children:[(0,A.Y)(g.A,{isRtl:y.isRtl,className:"site-title",onClick:b,children:(0,u.A)(N||I||M)}),(T||Y)&&(0,A.Y)(g.A,{isRtl:y.isRtl,className:"site-description",onClick:b,children:Y||T&&(0,u.A)(T)}),(0,A.Y)(v.A,{url:S,className:"site-name",text:x,isRtl:y.isRtl}),n&&(0,A.Y)("div",{className:"sender-name",children:(0,u.A)(n)})]}),n&&(0,A.Y)("div",{className:"message-date",children:(0,A.Y)(g.A,{className:"date",onClick:b,isRtl:y.isRtl,children:(0,d.be)(C,1e3*e.date)})})]})}))},37830:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(87894);const i=new WeakMap;function s(e){return(...t)=>{const n=i.get(e);if(n&&(0,o.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return i.set(e,{lastArgs:t,lastResult:s}),s}}},38102:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(87412),s=n(76471),a=n(20021);const r=(0,o.ph)(({topic:e,className:t,letterClassName:n,size:o,noLoopLimit:r,observeIntersection:d,onClick:l})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(i.A,{documentId:e.iconEmojiId,className:t,size:o,observeIntersectionForPlaying:d,loopLimit:r?void 0:2,onClick:l}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:l}))},38218:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(17712);const s=function({onClick:e,onStart:t,onEnd:n,threshold:s=250}){const a=(0,o.li)(!1),r=(0,o.li)(!1),d=(0,o.li)(void 0),l=(0,i.A)(e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!r.current&&n&&(r.current=!0,d.current=window.setTimeout(()=>{t?.(),a.current=!0},s))}),c=(0,i.A)(t=>{r.current&&(a.current?n?.():e?.(t),u())}),u=(0,i.A)(()=>{a.current=!1,r.current=!1,window.clearTimeout(d.current)});return(0,o._W)(()=>{window.clearTimeout(d.current)}),{onMouseDown:l,onMouseUp:c,onMouseLeave:c,onTouchStart:l,onTouchEnd:c}}},39074:(e,t,n)=>{n.d(t,{DY:()=>d,JC:()=>a,LV:()=>s,oR:()=>i,vZ:()=>r});const o=document.createElement("div");function i(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),i=o.lastChild;n.insertNode(o),i?(n.setStartAfter(i),n.setEndAfter(i)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const i=n.getRangeAt(0).cloneRange();return i.intersectsNode(e)?t||e.contains(i.commonAncestorContainer)?(i.collapse(!0),i.setStart(e,0),o.innerHTML="",o.appendChild(i.cloneContents()),o.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),i=o.cloneRange();return i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),t=i.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),o=window.getSelection();return e.setStart(n,t),e.collapse(!0),o.removeAllRanges(),o.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function d(){const e=window.getSelection();e?.removeAllRanges()}},40175:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(34458),d=n(59030),l=n(34201),c=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:o},byPeerId:i}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),d=(0,a.clw)(e),l=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:o,isShown:t?!r:!s,isForumPanelOpen:d,withAnimation:l,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:i}})(function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:a,canShow:p,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:A,peerStories:y}){const{toggleStoryRibbon:C}=(0,i.ko)(),w=(0,d.A)(),b=(0,o.Kr)(()=>1===t.length?[n[t[0]]||a[t[0]]]:t.map(e=>n[e]||a[e]).filter(t=>t&&t.id!==e).slice(0,s.dqH).reverse(),[e,t,n,a]),I=(0,o.Kr)(()=>b?.length?b.reduce((e,t)=>{const n=y[t.id];if(!n)return e;const o=n.orderedIds.some(e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const o=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!o});return e[t.id]=o,e},{}):{},[y,b]),S=(0,o.Kr)(()=>t.slice(0,5),[t]);(0,c.A)(S);const M=p&&g,{ref:N,shouldRender:k}=(0,l.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,o.vJ)(()=>{A&&!f&&(M?((0,o.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,o.VK)(r.UG+s.xB5),(0,r.wV)(v)))},[v,M,A,f]),k)return(0,m.Y)("button",{ref:N,type:"button",id:"StoryToggler",className:h.A.root,"aria-label":w("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 o=n(41074);const i={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(i[a||"light"][t?"outgoing":"incoming"]):(0,o.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%o.bP)}},41074:(e,t,n)=>{n.d(t,{Ay:()=>r,M1:()=>d,bP:()=>s});var o=n(31481),i=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return o.W75?[]:(a||(a=new Array(s).fill(void 0).map(()=>{const e=new Worker(new URL(n.p+n.u(9443),n.b));return{worker:e,connector:(0,i.U)(e,void 0,"media")}})),a)}function d(e,t){return r()[t].connector.request(e)}},41316:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);function i(e){const[t,n]=(0,o.Ul)();return(0,o.vJ)(()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const o=t.getRangeAt(0);if(!o)return;if(!document.querySelector(e))return;const{commonAncestorContainer:i}=o;(i instanceof Element?i:i.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,n]),t}},41385:(e,t,n)=>{n.d(t,{k:()=>r});var o=n(95807),i=n(17712),s=n(14745);const a="--_vtn";function r(e){const t=(0,s.A)();return{createVtnStyle:(0,i.A)((n,i)=>{const s=!0===i?n:i||void 0;return(0,o.A)(`${a}: vtn-${n}-${e||t}`,s&&`view-transition-class: ${s}`)})}}CSS.registerProperty?.({name:a,syntax:"*",inherits:!1})},41510:(e,t,n)=>{n.d(t,{I:()=>y,A:()=>C});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(11778),d=n(55153),l=n(45761),c=n(39351),u=n(17712),h=n(73767),m=n(50680),p=n(3325),g=n(37661),f=n(18276),v=n(20021);const A=(0,o.ph)(({isQuick:e,isGeneric:t,onFileSelect:n})=>{const i=(0,o.li)(),s=(0,c.A)(),[r,d,l]=(0,g.A)(),h=(0,u.A)(e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),l()}),m=(0,a.A)("DropTarget",r&&"hovered");return(0,v.FD)("div",{className:m,ref:i,onDrop:n,onDragEnter:d,onDragLeave:h,"data-dropzone":!0,children:[(0,v.Y)("svg",{className:"target-outline-container",children:(0,v.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,v.FD)("div",{className:"target-content",children:[(0,v.Y)(f.A,{name:e?"photo":"document"}),(0,v.Y)("div",{className:"title",children:s("FileDropZoneTitle")}),!t&&(0,v.Y)("div",{className:"description",children:s(e?"FileDropZoneQuick":"FileDropZoneNoCompression")})]})]})});let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const C=(0,o.ph)(({isOpen:e,withQuick:t,editingMessage:n,onHide:g,onFileSelect:f})=>{const y=(0,c.A)(),{showNotification:C,updateAttachmentSettings:w}=(0,i.ko)(),b=(0,o.li)(),I=(0,h.A)(t),{shouldRender:S,transitionClassNames:M}=(0,m.A)(e);(0,o.vJ)(()=>e?(0,r.A)(g):void 0,[e,g]);const N=(0,u.A)(async e=>{const{dataTransfer:o}=e;let i=[];if(!(o.files&&o.files.length>0)||o.items&&o.items.length){if(o.items&&o.items.length>0){const e=await(0,l.A)(o.items);e?.length&&(i=i.concat(e))}}else i=i.concat(Array.from(o.files));if(n){if(i.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})});if(1===i.length){const e=await(0,d.A)(i[0].name,i[0]);if(!(n&&e&&(0,s.eh)(n,e)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})})}}g(),w({shouldCompress:!t&&void 0}),f(i)}),k=(0,u.A)(async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(n){if(e.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,d.A)(e[0].name,e[0]);if(!(n&&t&&(0,s.eh)(n,t)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}g(),w({shouldCompress:!0}),f(e)}}),Y=(0,u.A)(e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(b.current=window.setTimeout(()=>{g()},150))});if(!S)return;const P=t||I,F=(0,a.A)("DropArea",M);return(0,v.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,v.FD)("div",{className:F,onDragLeave:Y,onDragOver:()=>{b.current&&window.clearTimeout(b.current)},onDrop:g,onClick:g,children:[(0,v.Y)(A,{onFileSelect:N,isGeneric:!P}),P&&(0,v.Y)(A,{onFileSelect:k,isQuick:!0})]})})})},42215:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(30857);function s(e,t){const n=(0,i.A)(),s=(0,o.li)(e),a=(0,o.li)(t),r=(0,o.hb)(e=>(a.current=s.current(a.current,e),n(),a.current),[]);return[a.current,r]}},42827:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(87357),s=n(58443),a=n(4961),r=n(59030),d=n(50680),l=n(64489),c=n(20021);const u=(0,o.ph)(({text:e="Nothing found.",description:t,withSticker:n})=>{const o=(0,r.A)(),{transitionClassNames:u}=(0,d.A)(!0);return(0,c.FD)("div",{className:(0,i.A)("NothingFound",u,t&&"with-description",n&&"with-sticker"),children:[n&&(0,c.Y)(l.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),e,t&&(0,c.Y)("p",{className:"description",children:(0,a.A)(o(t),["br"])})]})})},44784:(e,t,n)=>{n.d(t,{A:()=>ie});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(90709),d=n(27109),l=n(91048),c=n(87357),u=n(85982),h=n(64713),m=n(83868),p=n(59852),g=n(79882),f=n(24899),v=n(4961),A=n(82117),y=n(39351),C=n(17712),w=n(62587),b=n(59030),I=n(38691),S=n(19210),M=n(64493),N=n(22720),k=n(55158),Y=n(63152),P=n(87412),F=n(84685),T=n(66644),D=n(96454),x=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 o of e){let e=(o.startMinute+t)%L,i=(o.endMinute+t)%L;e<0&&(e+=L),i<=0&&(i+=L),e>i?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:i})):n.push({startMinute:e,endMinute:i})}return n.sort((e,t)=>e.startMinute-t.startMinute),n.reduce((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e},[])}var O=n(98255),U=n(32625),K=n(19129),z=n(37661),V=n(30857),j=n(41036),J=n(18276);const $="MPBKHdZL";var q=n(20021);const H=Array.from({length:7},(e,t)=>t),G=(0,o.ph)(({businessHours:e})=>{const t=(0,o.li)(),[n,i,s]=(0,z.A)(!1),[a,r,d]=(0,z.A)(!1),l=(0,b.A)(),u=(0,V.A)();(0,U.A)(u,6e4);const h=(0,O.A)(e=>e.timezones?.byId),m=(0,K.A)(h,[h]),p=(0,o.Kr)(()=>{if(!m)return 0;const t=m[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60},[e.timezoneId,m]),g=(0,o.Kr)(()=>{const t=B(),n=function(e){const t={};for(const n of e){const e=n.startMinute,o=n.endMinute,i=Math.floor(e/E),s=Math.floor((o-1)/E);for(let n=i;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*E),endMinute:Math.min(E,o-n*E)})}return t}(R(e.workHours,a?p:0)),o={};return H.forEach(e=>{const i=n[e];o[e]=i?i.map(({startMinute:e,endMinute:n})=>n-e===1440?l("BusinessHoursDayFullOpened"):`${(0,x.fU)(l,t+60*e*1e3)} ${(0,x.fU)(l,t+60*n*1e3)}`):[l("BusinessHoursDayClosed")]}),o},[e.workHours,a,l,p]),f=(0,o.Kr)(()=>{const t=R(e.workHours,p),n=B(),o=((new Date).getTime()-n)/1e3/60;return t.some(({startMinute:e,endMinute:t})=>e<=o&&o<=t)},[e.workHours,p]),v=(0,o.Kr)(()=>(new Date(Date.now()-(a?0:60*p*1e3)).getDay()+6)%7,[a,p]),A=(0,C.A)(()=>{n?s():i()}),y=(0,C.A)(e=>{e.stopPropagation(),a?d():r()});(0,o.vJ)(()=>{if(!n)return;const e=document.querySelector(`.${j.uo} > .${$}`);if(!e)return;const o=e.offsetHeight;(0,T.RK)(()=>{t.current.style.height=`${o}px`})},[n]);const w=(0,C.A)(()=>{const e=document.querySelector(`.${j.VY} > .${$}`);(0,T.YS)(()=>{const n=e.offsetHeight;(0,T.RK)(()=>{t.current.style.height=`${n}px`})})});return(0,q.FD)(N.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:A,children:[(0,q.FD)("div",{className:"nHSmCUNs",children:[(0,q.FD)("div",{className:"JTZ8UnnP",children:[(0,q.Y)("div",{children:l("BusinessHoursProfile")}),(0,q.Y)("div",{className:(0,c.A)("JVL7ZnnJ",f&&"segAfYXs"),children:l(f?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,q.Y)(J.A,{className:"dYxw2cFn",name:n?"up":"down"})]}),n&&(0,q.FD)("div",{className:"lp9VIV1o",children:[Boolean(p)&&(0,q.Y)("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:D.TF?void 0:y,onClick:D.TF?y:void 0,children:l(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,q.Y)(j.Ay,{className:"WKgL_XiP",ref:t,name:"fade",activeKey:Number(a),onStart:w,children:(0,q.Y)("dl",{className:$,children:H.map(e=>(0,q.FD)(q.FK,{children:[(0,q.Y)("dt",{className:(0,c.A)("cmxPqAof",e===v&&"YZVvP_56"),children:(0,x.wv)(l,6===e?0:e+1)}),(0,q.Y)("dd",{className:"Rs0VPgpq",children:g[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,o.ph)((0,i.EK)(e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,l.n_C)(e)}})(({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:d,isInSettings:l})=>{const{openGiftModal:u,requestConfetti:h}=(0,i.ko)(),m=(0,o.li)(),p=(0,o.li)(!1),[g,f,A]=(0,z.A)(),w=(0,y.A)(),{formattedDate:b,isToday:I,age:S}=(0,o.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,x.A)(n,w.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&te(n)}},[t,w]),M=(0,o.Kr)(()=>{if(!S||!I)return;const e=a?.stickers?.filter(({emoji:e})=>e?.endsWith(""));if(!e)return;const t=(0,W.dU)(e,"emoji");return S.toString().split("").map(e=>t[e+""])},[S,a?.stickers,I]),k=(0,o.Kr)(()=>{if(!I)return;const e=X[Math.floor(Math.random()*X.length)];return d?.stickers?.find(({emoji:t})=>t===e)},[d?.stickers,I]);(0,o.vJ)(()=>{if(I&&M&&(M.forEach(e=>{const t=(0,r.Mw)(e,"preview");_.hd(t,s.qZ.BlobUrl)}),k)){const e=(0,r.Mw)(k,"preview");_.hd(e,s.qZ.BlobUrl)}},[k,I,M]),(0,Q.A)(A,g?3e3:void 0),(0,o.vJ)(()=>{if(g){p.current=!0;const e=document.getElementById(l?"LeftColumn":"RightColumn");if(!e)return;(0,T.YS)(()=>{const{top:t,left:n,width:o,height:i}=e.getBoundingClientRect();h({top:t,left:n,width:o,height:i,style:"top-down"})})}},[l,g]);const Y=(0,o.Kr)(()=>S?w(`ProfileBirthday${I?"Today":""}ValueYear`,{date:b,age:S},{pluralValue:S}):w(`ProfileBirthday${I?"Today":""}Value`,{date:b}),[S,b,I,w]),P=I&&!e.isPremium&&!e.isSelf&&!n,F=(0,C.A)(()=>{u({forUserId:e.id})}),E=(0,C.A)(()=>{I&&(P&&p.current?F():f())}),L=!I&&!P;return(0,q.FD)("div",{className:"wCp6TBYF",children:[(0,q.FD)(N.A,{icon:"calendar",secondaryIcon:P?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:m,ripple:!L,onClick:E,isStatic:L,onSecondaryIconClick:F,children:[(0,q.Y)("div",{className:"title",dir:w.isRtl?"rtl":void 0,children:(0,v.A)(Y)}),(0,q.Y)("span",{className:"subtitle",children:w(I?"ProfileBirthdayToday":"ProfileBirthday")})]}),g&&D.ol&&M?.map((e,t)=>(0,q.Y)("div",{className:(0,c.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,q.Y)(Z.A,{containerRef:m,sticker:e,size:128,forceAlways:!0})})),g&&k&&(0,q.Y)("div",{className:"cFEXGUih",children:(0,q.Y)(Z.A,{containerRef:m,sticker:k,size:288,shouldLoop:!0,forceAlways:!0})})]})}));function te(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const o=t.getMonth()-e.getMonth();return(o<0||0===o&&t.getDate()<e.getDate())&&n--,n}const ne="UZbkeFDB",oe={width:64,height:64,zoom:15},ie=(0,o.ph)((0,i.EK)((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:o}}=e,i=t?(0,l.hds)(e,t):void 0,s=t?(0,l.mBe)(e,t):void 0,a=t?(0,l.XOs)(e,t):void 0,c=i?.isForum,u=i&&(0,d.If)(i,(0,l.K52)(e),(0,l.P5N)(e,i.id)),{threadId:h}=(0,l.Xf0)(e)||{},m=c&&h?Number(h):void 0,p=i&&(0,l.AWZ)(e,i.id),g=s&&(0,l.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=i&&!s&&(!(0,r.WX)(i)&&!(0,r.Sq)(i,"inviteUsers")||(0,r.ub)(i,"inviteUsers")),C=m?(0,l.sZk)(e,t,m):void 0,w=!n&&e.chats.listIds.saved?.includes(t),b=g?.personalChannelId?(0,l.hds)(e,g.personalChannelId):void 0,I=s?.hasMainMiniApp;return{phoneCodeList:o,chat:i,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:d,isInSettings:T,canInviteUsers:D,isMuted:x,phoneCodeList:E,topicId:L,description:B,chatInviteLink:R,topicLink:O,hasSavedMessages:U,personalChannel:K,hasMainMiniApp:z,isBotCanManageEmojiStatus:V,botAppPermissions:j,botVerification:J,className:$,style:H})=>{const{showNotification:W,updateChatMutedState:_,updateTopicMutedState:Q,loadPeerStories:Z,openSavedDialog:X,openMapModal:te,requestCollectibleInfo:ie,requestMainWebView:se,toggleUserEmojiStatusPermission:ae,toggleUserLocationPermission:re}=(0,i.ko)(),{id:de,usernames:le,phoneNumber:ce,isSelf:ue}=t||{},{id:he,usernames:me}=n||{},pe=de||he,{businessLocation:ge,businessWorkHours:fe,personalChannelMessageId:ve,birthday:Ae}=d||{},ye=(0,b.A)(),Ce=(0,y.A)();(0,A.A)(([e])=>{pe&&e!==pe&&(t||n&&(0,r.WX)(n))&&Z({peerId:pe})},[pe,n,t]);const{width:we,height:be,zoom:Ie}=oe,Se=(0,I.A)(),Me=ge?.geo&&(0,r.rt)(ge.geo,we,be,Ie,Se),Ne=(0,w.A)(Me),ke=(0,o.Kr)(()=>{if(ge?.geo)return Ne?(0,q.Y)("img",{src:Ne,alt:"",className:ne}):(0,q.Y)(k.A,{className:ne})},[ge,Ne]),Ye=Boolean(L&&L!==s.l3),Pe=n&&(0,r.WX)(n)||t?.isPremium,Fe=(0,o.Kr)(()=>{const e=le?.filter(e=>e.isActive);return e?.length?e:void 0},[le]),Te=(0,o.Kr)(()=>{const e=t?void 0:me?.filter(e=>e.isActive);return e?.length?e:void 0},[me,t]),De=(0,o.Kr)(()=>{if(n)return Ye?O:(0,r.L7)(n)||R},[n,Ye,O,R]),xe=(0,C.A)(()=>{const{address:e,geo:t}=ge;if(!t)return(0,u.eM)(e),void W({message:ye("BusinessLocationCopied")});te({geoPoint:t,zoom:Ie})}),Ee=(0,C.A)(()=>{const e=x?a.Os5:a.xEh;Ye?Q({chatId:he,topicId:L,mutedUntil:e}):_({chatId:he,mutedUntil:e})}),Le=(0,C.A)(()=>{t&&ae({botId:t.id,isEnabled:!V})}),Be=(0,C.A)(()=>{t&&re({botId:t.id,isAccessGranted:!j?.geolocation})}),Re=(0,C.A)(()=>{X({chatId:e})});function Oe(e,t){(0,u.eM)(e),W({message:`${t} was copied`})}const Ue=ce&&(0,h.Ox)(E,ce),Ke=(0,C.A)(()=>{ce?.length===a.PGI&&ce.startsWith(a._Bb)?ie({collectible:ce,peerId:pe,type:"phone"}):Oe(Ue,ye("Phone"))}),ze=(0,C.A)((e,t)=>{e.isEditable?Oe((0,f.A)(e.username,t),ye(t?"Link":"Username")):ie({collectible:e.username,peerId:pe,type:"username"})}),Ve=(0,C.A)(()=>{const e=t?.id;if(!e)return;const n=(0,p.A)();se({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})}),je=Ce("ProfileOpenAppAbout",{terms:(0,q.Y)(F.A,{text:Ce("ProfileOpenAppTerms"),url:Ce("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if(!(he&&(0,l._ls)((0,i.mS)(),he)||ue&&!T))return(0,q.FD)("div",{className:(0,c.A)("ChatExtra",$),style:H,children:[K&&(0,q.FD)("div",{className:"HP5EJx7s",children:[(0,q.Y)("h3",{className:"cHyTGri2",children:ye("ProfileChannel")}),(0,q.Y)("span",{className:"kYd2GrmU",children:ye("Subscribers",K.membersCount,"i")}),(0,q.Y)(S.A,{chatId:K.id,orderDiff:0,animationType:g.I.None,isPreview:!0,previewMessageId:ve,className:"qOJwhXMC"})]}),Boolean(Ue?.length)&&(0,q.FD)(N.A,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:Ke,children:[(0,q.Y)("span",{className:"title",dir:Ce.isRtl?"rtl":void 0,children:Ue}),(0,q.Y)("span",{className:"subtitle",children:ye("Phone")})]}),Fe&&Je(Fe),B&&Boolean(B.length)&&(0,q.FD)(N.A,{icon:"info",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,children:[(0,q.Y)("span",{className:"title word-break allow-selection",dir:Ce.isRtl?"rtl":void 0,children:(0,v.A)(B,["br",Pe?"links":"tg_links","emoji"])}),(0,q.Y)("span",{className:"subtitle",children:ye(de?"UserBio":"Info")})]}),Te&&!Ye&&Je(Te,!0),(!Te&&D||Ye)&&De&&(0,q.FD)(N.A,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>Oe(De,ye("SetUrlPlaceholder")),children:[(0,q.Y)("div",{className:"title",children:De}),(0,q.Y)("span",{className:"subtitle",children:ye("SetUrlPlaceholder")})]}),Ae&&(0,q.Y)(ee,{birthday:Ae,user:t,isInSettings:T},pe),z&&(0,q.FD)(N.A,{multiline:!0,isStatic:!0,narrow:!0,children:[(0,q.Y)(M.A,{className:"x925YeS3",onClick:Ve,children:ye("ProfileBotOpenApp")}),(0,q.Y)("div",{className:"IrqRJFxm",children:je})]}),!T&&(0,q.FD)(N.A,{icon:x?"mute":"unmute",narrow:!0,ripple:!0,onClick:Ee,children:[(0,q.Y)("span",{children:Ce("Notifications")}),(0,q.Y)(Y.A,{id:"group-notifications",label:Ce(de?"AriaToggleUserNotifications":"AriaToggleChatNotifications"),checked:!x,inactive:!0})]}),fe&&(0,q.Y)(G,{businessHours:fe}),ge&&(0,q.FD)(N.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:ke,onClick:xe,children:[(0,q.Y)("div",{className:"title",children:ge.address}),(0,q.Y)("span",{className:"subtitle",children:ye("BusinessProfileLocation")})]}),U&&!T&&(0,q.Y)(N.A,{icon:"saved-messages",narrow:!0,ripple:!0,onClick:Re,children:(0,q.Y)("span",{children:ye("SavedMessagesTab")})}),d&&"isBotAccessEmojiGranted"in d&&(0,q.FD)(N.A,{icon:"user",narrow:!0,ripple:!0,onClick:Le,children:[(0,q.Y)("span",{children:ye("BotProfilePermissionEmojiStatus")}),(0,q.Y)(Y.A,{label:ye("BotProfilePermissionEmojiStatus"),checked:V,inactive:!0})]}),void 0!==j?.geolocation&&(0,q.FD)(N.A,{icon:"location",narrow:!0,ripple:!0,onClick:Be,children:[(0,q.Y)("span",{children:ye("BotProfilePermissionLocation")}),(0,q.Y)(Y.A,{label:ye("BotProfilePermissionLocation"),checked:j?.geolocation,inactive:!0})]}),J&&(0,q.FD)("div",{className:"RWFu5ENh",children:[(0,q.Y)(P.A,{className:"b32hsSPS",documentId:J.iconId,size:16}),J.description]})]});function Je(e,t){const[n,...o]=e,i=o.length?ye("UsernameAlso","%USERNAMES%").split("%").map(e=>"USERNAMES"===e?(0,q.Y)(q.FK,{children:o.map((e,n)=>(0,q.FD)(q.FK,{children:[n>0?", ":"",(0,q.Y)("a",{href:(0,f.A)(e.username,!0),onMouseDown:m.A,onClick:n=>{(0,m.A)(n),ze(e,t)},className:"text-entity-link username-link",children:(0,f.A)(e.username)},e.username)]}))}):e):void 0;return(0,q.FD)(N.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{ze(n,t)},children:[(0,q.Y)("span",{className:"title",dir:Ce.isRtl?"rtl":void 0,children:(0,f.A)(n.username,t)}),(0,q.FD)("span",{className:"subtitle",children:[i&&(0,q.Y)("span",{className:"other-usernames",children:i}),ye(t?"Link":"Username")]})]})}}))},45318:(e,t,n)=>{e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"},45761:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(87679);async function i(e){const t=[];function n(e,o){return new Promise(i=>{if(e instanceof File)t.push(e),i(e);else if(e.isFile){const n=o.getAsFile();e.file(e=>{t.push(e),i(e)},()=>{n&&t.push(n),i(n)})}else e.isDirectory&&e.createReader().readEntries(e=>{const t=[];for(let i=0;i<e.length;i++)t.push(n(e[i],o));i(Promise.all(t))})})}const i=[];for(let t=0;t<e.length;t++){const o=e[t];if("file"===o.kind){const e=o.webkitGetAsEntry()||o.getAsFile();e&&i.push(n(e,o))}}return await Promise.all(i),(0,o.kc)(t)}},46051:(e,t,n)=>{n.d(t,{G:()=>o,w:()=>i});const o="video/mp4; codecs=hvc1.1.6.L63.00",i="video/mp4; codecs=avc1.64001E"},47058:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(87357),a=n(85982),r=n(43874),d=n(17712),l=n(59030),c=n(64493),u=n(22699),h=n(24433),m=n(18276);var p=n(20021);const g=(0,o.ph)(({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,l.A)(),{showNotification:y,openChatWithDraft:C}=(0,i.ko)(),{isMobile:w}=(0,r.Ay)(),b=!v,I=(0,d.A)(()=>{(0,a.eM)(t),y({message:{key:"LinkCopied"}})}),S=(0,d.A)(()=>{n||I()}),M=(0,d.A)(()=>{C({text:{text:t}})}),N=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(c.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)(c.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)(c.A,{disabled:n,onClick:M,className:"Sbagy_Tm",children:A("FolderLinkScreen.LinkActionShare")})]})})},47067:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(13439),s=n(31481),a=n(90709),r=n(63495),d=n(96454),l=n(9716),c=n(87894),u=n(39351);const h=({chat:e,user:t,folderId:n,isPinned:h,isMuted:m,canChangeFolder:p,isSavedDialog:g,currentUserId:f,isPreview:v,topics:A,handleDelete:y,handleMute:C,handleUnmute:w,handleChatFolderChange:b,handleReport:I},S=!1)=>{const M=(0,u.A)(),{isSelf:N}=t||{},k=t?.id===s.zv8,Y=(0,o.Kr)(()=>{if(e)return g?M("Delete"):(0,l.L8)(e.id)||(0,a.IC)(e)?M("DeleteChat"):(0,a.WX)(e)?M("ChannelLeave"):M("GroupLeaveGroup")},[e,g,M]);return(0,o.Kr)(()=>{if(!e||v)return;const{toggleChatPinned:o,toggleSavedDialogPinned:s,toggleChatArchived:l,markChatMessagesRead:u,markChatUnread:P,openChatInNewTab:F}=(0,i.ko)(),T=d.OS&&{title:r.Vq?M("ChatListOpenInNewWindow"):M("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{F(g?{chatId:f,threadId:e.id}:{chatId:e.id})}},D=()=>{g?s({id:e.id}):o({id:e.id,folderId:n})},x=h?{title:M("ChatListUnpinFromTop"),icon:"unpin",handler:D}:{title:M("ChatListPinToTop"),icon:"pin",handler:D},E={title:Y,icon:"delete",destructive:!0,handler:y};if(g)return(0,c.oE)([T,x,E]);const L=p?{title:M("ChatListContextAddToFolder"),icon:"folder",handler:b}:void 0,B=m?{title:M("ChatsUnmute"),icon:"unmute",handler:w}:{title:`${M("ChatsMute")}...`,icon:"mute",handler:C};if(S)return(0,c.oE)([T,x,L,B]);const R=e.unreadCount||e.hasUnreadMark||Object.values(A||{}).some(({unreadCount:e})=>e)?{title:M("ChatListContextMaskAsRead"),icon:"readchats",handler:()=>u({id:e.id})}:void 0,O=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:M("ChatListContextMaskAsUnread"),icon:"unread",handler:()=>P({id:e.id})},U=(0,a.TJ)(e)?{title:M("Unarchive"),icon:"unarchive",handler:()=>l({id:e.id})}:{title:M("Archive"),icon:"archive",handler:()=>l({id:e.id})},K=I&&!t&&((0,a.WX)(e)||(0,a.YE)(e))?{title:M("ReportPeerReport"),icon:"flag",handler:I}:void 0,z=void 0!==n;return(0,c.oE)([T,L,R,O,x,!N&&B,!N&&!k&&!z&&U,K,E])},[e,t,p,M,b,h,S,m,f,y,C,I,n,N,k,g,Y,v,A,w])}},47526:(e,t,n)=>{n.d(t,{KE:()=>d,PP:()=>l,_u:()=>r,zS:()=>a});const o={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},i=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t,n=15){const{lat:i,long:s}=t,a=o[e];switch(e){case"google":return`${a}/place/${i}+${s}/@${i},${s},${n}z`;case"bing":return`${a}?cp=${i}~${s}&lvl=${n}&sp=point.${i}_${s}`;case"apple":return`${a}?q=${i},${s}`;default:return`${a}/?mlat=${i}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function d(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function l(e){return e?i.get(e)||i.get(e.split("/")[0])||s[(t=e,t.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%s.length)]:"#008df2";var t}},48227:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(48775),s=n(39351),a=n(19806),r=n(94189);var d=n(20021);const l=(0,o.ph)(({isOpen:e,onClose:t,userName:n,messagePriceInStars:o,messagesCount:l,shouldAutoApprove:c,setAutoApprove:u,confirmHandler:h})=>{const m=(0,s.A)(),p=m("ConfirmationModalPaymentForMessage",{user:n,amount:(0,i.Kk)(m,o),totalAmount:(0,i.Kk)(m,o*l),count:l},{withMarkdown:!0,withNodes:!0,pluralValue:l}),g=m("PayForMessage",{count:l},{withNodes:!0,pluralValue:l});return(0,d.FD)(r.A,{title:m("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:h,children:[p,(0,d.Y)(a.A,{className:"eScpikxM",label:m("DoNotAskAgain"),checked:c,onCheck:u})]})})},48553:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(66644),d=n(90709),l=n(91048),c=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,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,messageListType:o,isMobile:i})=>{const a=(0,l.hds)(e,t),r=Boolean(a&&(0,d.WX)(a)),h=Boolean(a&&(0,d.Vs)(a)),m=(0,l.wmb)(e),p=(0,l.Qq_)(e),g=(0,u.L8)(t),{doNotTranslate:f}=e.settings.byKey,v=(0,l._ls)(e,t);if(!a||v||(0,l.rTV)(e))return{noMenu:!0,language:m,translationLanguage:p,doNotTranslate:f};const A=(0,l.yps)(e,t),y=g?void 0:(0,l.AWZ)(e,t),C=g?(0,l.vGo)(e,t):void 0,w=y||C,b=(0,l.nZ4)(e,t),I="thread"===o&&n===s.l3,S="thread"===o&&n!==s.l3,M=(0,l.gjV)(e,i),N=(0,d.cG)(t,n,e.currentUserId),k=!!g&&(0,l.apd)(e,t),Y=Boolean(A&&k),P=!Y&&Boolean((0,l.I_m)(e,t)),F=k&&!A,T=Boolean((I||a.isForum)&&(r||h)&&a.isNotJoined&&!a.isMonoforum),D=I||S,x=c.OL&&(0,u.L8)(a.id)&&!b&&!A&&!a.isSupport&&!(0,d.Qe)(a.id),E=I&&!b&&!T,L=N||I&&!T,B=c.OL&&I&&a.isCallActive,R=c.OL&&I&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,d.yn)(a))&&!a.isMonoforum,O=I&&y?.canViewStatistics,U=I&&y?.canViewMonetization,K=I&&!a.isMonoforum&&(h||r)&&(O||(0,d.ub)(a,"postStories")),z=!K&&(h||r)&&!a.isMonoforum,V=I?y?.requestsPending:void 0,j=Boolean(a?.isNotJoined&&a.isJoinToSend),J=Boolean(a?.isNotJoined&&a.isJoinRequest),$=!(0,l.PKK)(e),q=Boolean((0,l.qZq)(e,t)),H=(0,l.jGY)(e,t)&&!w?.isTranslationDisabled,G=(0,l.trm)(e),W=(0,d.WX)(a)?a.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:r,isRightColumnShown:M,canStartBot:P,canRestartBot:Y,canSubscribe:T,canSearch:D,canCall:x,canMute:E,canViewStatistics:O,canViewMonetization:U,canViewBoosts:K,canShowBoostModal:z,canLeave:L,canEnterVoiceChat:B,canCreateVoiceChat:R,pendingJoinRequests:V,shouldJoinToSend:j,shouldSendJoinRequest:J,noAnimation:$,canTranslate:H,isTranslating:q,translationLanguage:p,language:m,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:F,isAccountFrozen:G,channelMonoforumId:W}})(({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:d,canStartBot:l,canRestartBot:u,canUnblock:C,canSubscribe:w,canSearch:S,canCall:N,canMute:k,canViewStatistics:Y,canViewMonetization:P,canViewBoosts:F,canShowBoostModal:T,canLeave:D,canEnterVoiceChat:x,canCreateVoiceChat:E,channelMonoforumId:L,pendingJoinRequests:B,isRightColumnShown:R,isForForum:O,canExpandActions:U,shouldJoinToSend:K,shouldSendJoinRequest:z,noAnimation:V,canTranslate:j,isTranslating:J,translationLanguage:$,language:q,detectedChatLanguage:H,doNotTranslate:G,isAccountFrozen:W,onTopicSearch:_})=>{const{joinChannel:Q,sendBotCommand:Z,openMiddleSearch:X,restartBot:ee,requestMasterAndRequestCall:te,requestNextManagementScreen:ne,showNotification:oe,openChat:ie,requestChatTranslation:se,togglePeerTranslations:ae,openChatLanguageModal:re,setSettingOption:de,unblockUser:le,setViewForumAsMessages:ce,openFrozenAccountModal:ue}=(0,i.ko)(),he=(0,o.li)(),me=(0,p.A)(),[pe,ge]=(0,o.J0)(!1),[fe,ve]=(0,o.J0)(void 0),Ae=(0,m.A)(()=>{ge(!0);const e=he.current.getBoundingClientRect();ve({x:e.right,y:e.bottom})}),ye=(0,m.A)(()=>{ge(!1)}),Ce=(0,m.A)(()=>{ve(void 0)}),we=(0,m.A)(()=>{Q({chatId:e}),z&&oe({message:me(d?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})}),be=(0,m.A)(()=>{Z({command:"/start"})}),Ie=(0,m.A)(()=>{ee({chatId:e})}),Se=(0,m.A)(()=>{le({userId:e})}),Me=(0,m.A)(()=>{se(J?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:$})}),Ne=(0,m.A)(()=>{ne({screen:a.je.JoinRequests})}),ke=(0,m.A)(()=>{O?_?.():(X(),s?M():V?(0,r.YS)(()=>{(0,r.Uz)(M)}):setTimeout(M,320))}),Ye=(0,m.A)(()=>{ie({id:e}),ce({chatId:e,isEnabled:!0})}),Pe=(0,m.A)(()=>{W?ue():te({userId:e})}),Fe=(0,m.A)(e=>{S&&c.lE&&!e.shiftKey&&(e.preventDefault(),ke())}),Te=(0,o.hb)((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=me(n);if(o!==n)return me(e,o);const i=new Intl.DisplayNames([q],{type:"language"}).of(t);return me(`${e}Other`,i)},[q,me]),De=(0,o.Kr)(()=>J?me("ShowOriginalButton"):Te("TranslateToButton",$),[$,Te,J,me]),xe=(0,o.Kr)(()=>{if(H)return Te("DoNotTranslateLanguage",H)},[Te,H]),Ee=(0,m.A)(()=>{ae({chatId:e,isEnabled:!1}),se({chatId:e,toLanguageCode:void 0})}),Le=(0,m.A)(()=>{re({chatId:e})}),Be=(0,m.A)(()=>{H&&(de({doNotTranslate:[...G,H]}),se({chatId:e,toLanguageCode:void 0}),oe({message:Te("AddedToDoNotTranslate",H)}))});(0,h.v)((0,o.Kr)(()=>({"Mod+F":Fe}),[]));const Re=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,b.Y)(f.A,{round:!0,ripple:R,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:me("TranslateMessage"),children:(0,b.Y)(g.A,{name:"language"})}),[R,me]);return(0,b.FD)("div",{className:"HeaderActions",children:[!O&&j&&(0,b.FD)(v.A,{className:"stickers-more-menu with-menu-transitions",trigger:Re,positionX:"right",children:[(0,b.Y)(A.A,{icon:"language",onClick:Me,children:De}),(0,b.Y)(A.A,{icon:"replace",onClick:Le,children:me("Chat.Translate.Menu.To")}),(0,b.Y)(y.A,{}),H&&(0,b.Y)(A.A,{icon:"hand-stop",onClick:Be,children:xe}),(0,b.Y)(A.A,{icon:"close-circle",onClick:Ee,children:me("Hide")})]}),!s&&(0,b.FD)(b.FK,{children:[U&&!z&&(w||K)&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:we,children:me(d?"ProfileJoinChannel":"ProfileJoinGroup")}),U&&z&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:we,children:me("ChannelJoinRequest")}),U&&l&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:be,children:me("BotStart")}),U&&u&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Ie,children:me("BotRestart")}),U&&C&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Se,children:me("Unblock")}),S&&(0,b.Y)(f.A,{round:!0,ripple:R,color:"translucent",size:"smaller",onClick:ke,ariaLabel:me("Conversation.SearchPlaceholder"),children:(0,b.Y)(g.A,{name:"search"})}),N&&(0,b.Y)(f.A,{round:!0,color:"translucent",size:"smaller",onClick:Pe,ariaLabel:"Call",children:(0,b.Y)(g.A,{name:"phone"})})]}),!O&&Boolean(B)&&(0,b.FD)(f.A,{round:!0,className:"badge-button",ripple:R,color:"translucent",size:"smaller",onClick:Ne,ariaLabel:me(d?"SubscribeRequests":"MemberRequests"),children:[(0,b.Y)(g.A,{name:"user"}),(0,b.Y)("div",{className:"badge",children:B})]}),(0,b.Y)(f.A,{ref:he,className:pe?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:Ae,children:(0,b.Y)(g.A,{name:"more"})}),fe&&(0,b.Y)(I,{chatId:e,threadId:t,isOpen:pe,anchor:fe,withExtraActions:s||!U,isChannel:d,canStartBot:l,canSubscribe:w,canSearch:S,canCall:N,canMute:k,canViewStatistics:Y,canViewBoosts:F,canViewMonetization:P,canShowBoostModal:T,canLeave:D,canEnterVoiceChat:x,canCreateVoiceChat:E,pendingJoinRequests:B,onJoinRequestsClick:Ne,withForumActions:O,channelMonoforumId:L,onSubscribeChannel:we,onSearchClick:ke,onAsMessagesClick:Ye,onClose:ye,onCloseAnimationEnd:Ce})]})}));function M(){const e=document.querySelector("#MiddleSearch input");e?.focus()}},48885:(e,t,n)=>{n.d(t,{A:()=>h,S:()=>m});var o=n(84051),i=n(61433),s=n(66644),a=n(14737),r=n(17712),d=n(93545),l=n(672);const c=450,u=100;function h({ref:e,isOpen:t,isDisabled:n,withResizeObserver:i,onStateChange:h}){const[m,p]=(0,o.J0)(t),g=(0,o.li)(),f=e||g,v=(0,o.li)(0),A=(0,r.A)(()=>{p(!0),h?.({element:void 0,height:0,isOpen:!1})});(0,o.vJ)(()=>{n&&A()},[n]),(0,o.vJ)(()=>{t&&p(!0)},[t]),(0,o._W)(A),(0,a.A)(()=>{p(!1),h?.({height:0,isOpen:!1})},t?void 0:c);const y=(0,o.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,l.A)(()=>{const e=f.current;e&&e.offsetHeight!==v.current&&y()},[y,f],u,!0);return(0,o.Nf)(y,[y]),(0,d.A)(f,C,!i||!m),{shouldRender:m,ref:f}}function m(e,t=!1){let n=0;for(let o=0;o<e.length;o++){const a=e[o],r=a.element;if(!r)continue;const d=`${n}px`,l=()=>{(0,i.Tv)(r,{transform:`translateY(${a.isOpen?d:`calc(${d} - 100%)`})`,zIndex:String(-o),transition:t?"none":""})};r.dataset.isPanelOpen||!a.isOpen||t?l():((0,i.Tv)(r,{transform:`translateY(calc(${d} - 100%))`,zIndex:String(-o),transition:"none"}),r.dataset.isPanelOpen="true",(0,s.Uz)(l)),n+=a.height}}},48906:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(20021);const i=function({isOwn:e}){const t=e?"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,o.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,o.Y)("defs",{children:(0,o.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,o.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,o.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,o.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,o.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,o.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,o.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642:(e,t,n)=>{n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>d,MV:()=>i,hm:()=>l,wp:()=>c});const o={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function i(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach(([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}})}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function d(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function c({title:e,artist:t,album:n,artwork:o}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:o})}},51067:(e,t,n)=>{n.d(t,{A:()=>H});var o=n(84051),i=n(13439),s=n(89925),a=n(31481),r=n(96454),d=n(87357),l=n(49763),c=n(80140),u=n(23459),h=n(7985),m=n(16581),p=n(74984),g=n(2178),f=n(96374),v=n(5912),A=n(17712),y=n(9717),C=n(46222),w=n(52745),b=n(90709),I=n(87894),S=n(14242),M=n(4961),N=n(39351),k=n(21849),Y=n(18276),P=n(24713),F=n(22720);const T={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"};var D=n(20021);const x={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},E=(0,o.ph)(({archiveSettings:e,onDragEnter:t,onClick:n})=>{const{updateArchiveSettings:s}=(0,i.ko)(),r=(0,N.A)(),l=(0,p.Rh)(a._E9),c=(0,p.ic)(),u=c[a._E9]?.chatsCount,h=(0,o.Kr)(()=>{if(!l?.length)return r("Loading");const e=(0,i.mS)().chats.byId;return l.slice(0,5).map((t,n,o)=>{const i=n===o.length-1,s=e[t];if(!s)return;const a=(0,b.Js)(r,s);return(0,D.FD)(D.FK,{children:[(0,D.Y)("span",{className:(0,d.A)(T.chat,u&&s.unreadCount&&T.unread),children:(0,M.A)(a)}),i?"":", "]})})},[l,r,u]),m=(0,o.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})}},o={title:r("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{s({isHidden:!0})}};return(0,I.oE)([t,n,o])},[e.isMinimized,r,s]),g=(0,o.hb)(e=>{e.preventDefault(),t?.()},[t]);return(0,D.Y)(F.A,{onClick:n,onDragEnter:g,className:(0,d.A)(T.root,e.isMinimized&&T.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:T.button,contextActions:m,withPortalForMenu:!0,children:e.isMinimized?(0,D.Y)("div",{className:(0,d.A)(T.info,"info"),children:(0,D.FD)("div",{className:"info-row",children:[(0,D.Y)("div",{className:(0,d.A)("title",T.title),children:(0,D.FD)("h3",{dir:"auto",className:(0,d.A)(T.name,"fullName"),children:[(0,D.Y)(Y.A,{name:"archive-filled",className:T.icon}),r("ArchivedChats")]})}),(0,D.Y)(P.A,{className:T.unreadCount,text:u?(0,S.Vw)(r,u):void 0})]})}):(0,D.FD)(D.FK,{children:[(0,D.Y)("div",{className:(0,d.A)("status",T.avatarWrapper),children:(0,D.Y)(k.A,{peer:x})}),(0,D.FD)("div",{className:(0,d.A)(T.info,"info"),children:[(0,D.Y)("div",{className:"info-row",children:(0,D.Y)("div",{className:(0,d.A)("title",T.title),children:(0,D.Y)("h3",{dir:"auto",className:(0,d.A)(T.name,"fullName"),children:r("ArchivedChats")})})}),(0,D.FD)("div",{className:"subtitle",children:[(0,D.Y)("div",{className:(0,d.A)("status",T.chatsPreview),children:h}),(0,D.Y)(P.A,{className:T.unreadCount,text:u?(0,S.Vw)(r,u):void 0})]})]})]})})});var L=n(19210),B=n(91048),R=n(43874),O=n(59030),U=n(79577),K=n(64493);const z=(0,o.ph)((0,i.EK)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,B.$aQ)(e,t):void 0,animatedEmoji:(0,B.oei)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,i.ko)(),r=(0,O.A)(),{isMobile:d}=(0,R.Ay)(),l=(0,o.hb)(()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})},[e,n]);return(0,D.FD)("div",{className:"yftKUVDQ",children:[(0,D.Y)("div",{className:"UCBfMOiz",children:t&&(0,D.Y)(U.A,{sticker:t,size:96})}),(0,D.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,D.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,D.FD)(K.A,{ripple:!d,fluid:!0,pill:!0,onClick:l,isRtl:r.isRtl,children:[(0,D.Y)(Y.A,{name:"settings"}),(0,D.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})]})]})})),V=(0,o.ph)(({onClick:e})=>{const t=(0,N.A)();return(0,D.FD)("div",{className:"fOmerTkM",onClick:e,children:[(0,D.Y)("div",{className:"URLYINJA",children:t("TitleFrozenAccount")}),(0,D.Y)("div",{className:"mCFsx7Tv",children:t("SubtitleFrozenAccount")})]})});var j=n(93545);const J="pedMJD_v",$=(0,o.ph)(({sessions:e,onHeightChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,i.ko)(),r=(0,o.li)(),d=(0,O.A)();(0,j.A)(r,e=>{const n=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;t(n)});const l=(0,o.Kr)(()=>Object.values(e).sort((e,t)=>t.dateCreated-e.dateCreated).find(e=>e.isUnconfirmed),[e]),c=(0,o.Kr)(()=>[l.deviceModel,l.region,l.country].filter(Boolean).join(", "),[l]),u=(0,A.A)(()=>{n({hash:l.hash,isConfirmed:!0})}),h=(0,A.A)(()=>{s({hash:l.hash}),a({title:d("UnconfirmedAuthDeniedTitle",1),message:d("UnconfirmedAuthDeniedMessageSingle",c)})});return(0,D.FD)("div",{className:"yEkGgZVL",ref:r,children:[(0,D.Y)("h2",{className:"VhAJDrnz",children:d("UnconfirmedAuthTitle")}),(0,D.Y)("p",{className:"WmyL1NJ8",children:d("UnconfirmedAuthSingle",c)}),(0,D.FD)("div",{className:"_40UGD1Y",children:[(0,D.Y)(K.A,{fluid:!0,isText:!0,className:J,onClick:u,children:d("UnconfirmedAuthConfirm")}),(0,D.Y)(K.A,{fluid:!0,isText:!0,color:"danger",onClick:h,className:J,children:d("UnconfirmedAuthDeny")})]})]})}),q=new Set(["9","0"]),H=(0,o.ph)(({className:e,folderType:t,folderId:n,isActive:b,isForumPanelOpen:I,canDisplayArchive:S,archiveSettings:M,sessions:N,isAccountFrozen:k,isMainList:Y,foldersDispatch:P,withTags:F})=>{const{openChat:T,openNextChat:x,closeForumPanel:B,toggleStoryRibbon:R,openFrozenAccountModal:O,openLeftColumnContent:U}=(0,i.ko)(),K=(0,o.li)(),j=(0,o.li)(!1),[J,H]=(0,o.J0)(0),G="archived"===t,W="all"===t,_="saved"===t,Q=W?a.DSF:G?a._E9:_?a.pX9:n,Z=W&&S&&M,X=k&&W,ee=(0,p.Rh)(Q);(0,u.A)(ee);const te=(ee?.length||0)*a.yq1,ne=Z?M?.isMinimized?a.eqO:a.yq1:0,oe=X?68:0,{orderDiffById:ie,getAnimationType:se}=(0,y.A)(ee),[ae,re]=(0,f.A)(void 0,ee,void 0,a.T7t),de=(0,o.Kr)(()=>{const e=Object.values(N||{}),t=e.find(e=>e.isCurrent);return!(!t||(0,c.Fm)()-t.dateCreated<a.C7Y)&&!k&&W&&e.some(e=>e.isUnconfirmed)},[W,N,k]);(0,o.vJ)(()=>{de||H(0)},[de]),(0,g.v)((0,o.Kr)(()=>b&&ee?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),x({targetIndexDelta:-1,orderedIds:ee})},"Alt+ArrowDown":e=>{e.preventDefault(),x({targetIndexDelta:1,orderedIds:ee})}}:void 0,[b,ee])),(0,o.vJ)(()=>{if(b&&!_&&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||q.has(t))return;const n=Z&&M&&!M.isMinimized,o=n?-1:0,i=Number(t)+o-1;if(n&&-1===i)return void(Y&&U({contentKey:s.Bn.Archived}));if(i>ee.length-1)return;T({id:ee[i],shouldReplaceHistory:!0})}}},[M,_,b,T,x,ee,Z,Y]);const{observe:le}=(0,v.BL)({rootRef:K,throttleMs:200}),ce=(0,A.A)(()=>{U({contentKey:s.Bn.Archived}),B()}),ue=(0,A.A)(()=>{O()}),he=(0,A.A)(()=>{j.current?j.current=!1:ce()}),me=(0,m.A)(e=>{j.current?j.current=!1:T({id:e,shouldReplaceHistory:!0})},[T],500,!0),pe=(0,A.A)(e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top;n<t.width||o<t.y||(j.current=!0)}),ge=(0,A.A)(()=>{R({isShown:!0,isArchived:G})}),fe=(0,A.A)(()=>{R({isShown:!1,isArchived:G})});return(0,h.A)(K,ge,fe,_),(0,D.FD)(C.A,{className:(0,d.A)("chat-list custom-scroll",I&&"forum-panel-open",e),ref:K,items:ae,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,maxHeight:te+ne+oe+J,onLoadMore:re,onDragLeave:pe,children:[de&&(0,D.Y)($,{sessions:N,onHeightChange:H},"unconfirmed"),X&&(0,D.Y)(V,{onClick:ue},"frozen"),Z&&(0,D.Y)(E,{archiveSettings:M,onClick:ce,onDragEnter:he},"archive"),ae?.length?function(){const e=ee.indexOf(ae[0]),t=(0,l.zm)(Q)||0;return ae.map((o,i)=>{const s=e+i<t,r=J+ne+oe+(e+i)*a.yq1;return(0,D.Y)(L.A,{teactOrderKey:s?i:(0,l.uk)(o,_),chatId:o,isPinned:s,folderId:n,isSavedDialog:_,animationType:se(o),orderDiff:ie[o],offsetTop:r,observeIntersection:le,onDragEnter:me,withTags:F},o)})}():!ae||ae.length||_?(0,D.Y)(w.A,{},"loading"):(0,D.Y)(z,{folderId:n,folderType:t,foldersDispatch:P})]})})},51083:(e,t,n)=>{n.d(t,{A:()=>I});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(91048),d=n(87357),l=n(76023),c=n(4961),u=n(39351),h=n(17712),m=n(59030),p=n(41036),g=n(21849),f=n(80999),v=n(34431),A=n(18276),y=n(38102),C=n(80477),w=n(20021);const b=2.5*l.$,I=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,r.hds)(e,t),i=n?(0,r.Vw0)(e,t,n):void 0,s=o?(0,r.ToO)(e,o):void 0,a=Boolean((0,r.zeq)(e,t)),d=n?(0,r.S0q)(e,t,n):void 0;return{chat:o,threadInfo:i,onlineCount:s,topic:d,areMessagesLoaded:a,messagesCount:d&&(0,r.QbG)(e,t,n),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,t)}})(({typingStatus:e,className:t,statusIcon:n,avatarSize:l="medium",noAvatar:I,status:S,withDots:M,withMediaViewer:N,withUsername:k,withFullInfo:Y,withUpdatingStatus:P,withChatType:F,threadInfo:T,noRtl:D,chat:x,onlineCount:E,areMessagesLoaded:L,topic:B,messagesCount:R,noStatusOrTyping:O,withStory:U,storyViewerOrigin:K,noEmojiStatus:z,emojiStatusSize:V,isSavedDialog:j,self:J,withMonoforumStatus:$,monoforumChannel:q,onClick:H,onEmojiStatusClick:G})=>{const{loadFullChat:W,openMediaViewer:_,loadMoreProfilePhotos:Q}=(0,i.ko)(),Z=!$&&q?q:x,X=(0,m.A)(),ee=(0,u.A)(),te=Z&&(0,a.Vs)(Z),ne=Boolean(Z?.isForum&&T&&B),{id:oe,isMin:ie}=Z||{},se=(0,r._ls)((0,i.mS)(),oe);(0,o.vJ)(()=>{oe&&!ie&&(Y&&W({chatId:oe}),N&&Q({peerId:oe,isPreload:!0}))},[oe,ie,Y,te,N]);const ae=(0,h.A)((e,t)=>{Z&&t&&(e.stopPropagation(),_({isAvatarView:!0,chatId:Z.id,mediaIndex:0,origin:"jumbo"===l?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),re=(0,o.Kr)(()=>Z&&k&&(0,a.Kl)(Z),[Z,k]);if(Z)return(0,w.FD)("div",{className:(0,d.A)("ChatInfo",t),dir:!D&&X.isRtl?"rtl":void 0,onClick:H,children:[!I&&!ne&&(0,w.FD)(w.FK,{children:[j&&J&&(0,w.Y)(g.A,{size:l,peer:J,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,d.A)(j&&"overlay-avatar"),size:l,peer:Z,withStory:U,asMessageBubble:Boolean(q),storyViewerOrigin:K,storyViewerMode:"single-peer",isSavedDialog:j,onClick:N?ae:void 0},Z.id)]}),ne&&(0,w.Y)(y.A,{topic:B,className:"topic-header-icon",size:b}),(0,w.FD)("div",{className:"info",children:[B?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,c.A)(B.title)}):(0,w.Y)(v.A,{peer:Z,isMonoforum:!$&&Boolean(q),emojiStatusSize:V,withEmojiStatus:!z,isSavedDialog:j,onEmojiStatusClick:G}),!O&&function(){if(P&&!L&&!se)return(0,w.Y)(f.A,{className:"status",content:X("Updating")});if($)return(0,w.Y)("span",{className:"status",dir:"auto",children:ee("MonoforumStatus")});if(x?.isMonoforum)return;if(S)return M?(0,w.Y)(f.A,{className:"status",content:S}):(0,w.FD)("span",{className:"status",dir:"auto",children:[n&&(0,w.Y)(A.A,{className:"status-icon",name:n}),(0,c.A)(S)]});if(!Z)return;if(e)return(0,w.Y)(C.A,{typingStatus:e});if(ne)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==R?1:2,className:"message-count-transition",children:void 0!==R&&X("messages",R,"i")})});if(F)return(0,w.Y)("span",{className:"status",dir:"auto",children:X((0,a.Gg)(Z))});const t=(0,a.sT)(X,Z),o=E?`, ${X("OnlineCount",E,"i")}`:void 0;return(0,w.FD)("span",{className:"status",children:[re&&(0,w.Y)("span",{className:"handle withStatus",children:re}),(0,w.Y)("span",{className:"group-status",children:t}),o&&(0,w.Y)("span",{className:"online-status",children:o})]})}()]})]})}))},51644:(e,t,n)=>{n.d(t,{A:()=>k});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(90709),d=n(87357),l=n(40435),c=n(35127),u=n(43874),h=n(37661),m=n(5912),p=n(17712),g=n(37859),f=n(37960),v=n(69419),A=n(29886),y=n(73767),C=n(34201),w=n(61097),b=n(18276),I=n(27860),S=n(14413),M=n(35913),N=n(20021);const k=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,photo:t,messageText:n,isOwn:k,noAvatars:Y,canAutoLoad:P,isInSelectMode:F,isSelected:T,uploadProgress:D,forcedWidth:x,size:E="inline",dimensions:L,asForwarded:B,nonInteractive:R,shouldAffectAppendix:O,isDownloading:U,isProtected:K,theme:z,isInWebPage:V,clickArg:j,className:J,isMediaNsfw:$,observeIntersection:q,onClick:H,onCancelUpload:G,needsAgeVerification:W})=>{const _=(0,o.li)(),Q="extendedMediaPreview"===t.mediaType,Z=Q?void 0:t.blobUrl,X=(0,m.Vz)(_,q),{isMobile:ee}=(0,u.Ay)(),[te,ne]=(0,o.J0)(P),oe=te&&X&&!Q,{mediaData:ie,loadProgress:se}=(0,v.A)(Q?void 0:(0,r.rI)(t,E),!oe),ae=(0,A.A)(ie),re=Z||ie,{ref:de,shouldRender:le}=(0,f.A)({hasMediaData:Boolean(re),withShouldRender:!0}),ce=Boolean(x),[ue]=(0,o.J0)(!re),he=Boolean(re),me=(0,w.A)(t,he);(0,f.A)({ref:me,hasMediaData:!he});const pe=(0,w.A)(t,!ce),ge=(0,r.VD)(t),{updateContentSettings:fe,openAgeVerificationModal:ve}=(0,i.ko)(),[Ae,ye,Ce]=(0,h.A)(),[we,be]=(0,o.J0)(!1),Ie=Q||t.isSpoiler||$,[Se,Me,Ne]=(0,h.A)(Ie);(0,o.vJ)(()=>{Ie?Me():Ne()},[Ie]);const ke=(0,p.A)(()=>{Ce(),Ne(),we&&fe({isSensitiveEnabled:!0})}),{loadProgress:Ye}=(0,v.A)(Q?void 0:(0,r.rI)(t,"download"),!U,Q?void 0:(0,r.Cz)(t,"download")),{isUploading:Pe,isTransferring:Fe,transferProgress:Te}=(0,r.LK)(D||(U?Ye:se),oe&&!re,void 0!==D),De=!1===(0,y.A)(te),{ref:xe,shouldRender:Ee}=(0,C.A)({isOpen:Fe,noMountTransition:De,className:"slow",withShouldRender:!0}),{ref:Le,shouldRender:Be}=(0,C.A)({isOpen:!re&&!te,withShouldRender:!0}),Re=(0,p.A)(e=>{if(Pe)G?.(j);else{if(re)return Se?$?W?void ve():void ye():void Ne():void H?.(j,e);ne(e=>!e)}});(0,g.A)(([e])=>{if(!O)return void(e&&_.current.closest(s.KFG).removeAttribute(s.D3G));const t=_.current.closest(s.KFG);if(re){const e=Number(t.closest(".Message").dataset.messageId);(0,l.A)(re,Boolean(k),e,T,z).then(e=>{(0,a.RK)(()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(s.D3G,"")})})}else t.classList.add("has-appendix-thumb")},[O,re,k,F,T,z]);const{width:Oe,height:Ue,isSmall:Ke}=L||(0,c.yA)({media:t,isOwn:k,asForwarded:B,noAvatars:Y,isMobile:ee,messageText:n,isInWebPage:V}),ze=(0,d.A)("media-inner",!Pe&&!R&&"interactive",Ke&&"small-image",(Oe===Ue||"pictogram"===E)&&"square-image",Ue<c.ej&&"fix-min-height",J),Ve=L?` width: ${Oe}px; left: ${L.x}px; top: ${L.y}px;`:"",je="inline"===E?`height: ${Ue}px;${Ve}`:void 0;return(0,N.FD)("div",{id:e,ref:_,className:ze,style:je,onClick:Pe?void 0:Re,children:[ce&&(0,N.Y)("canvas",{ref:pe,className:"thumbnail blurred-bg"}),le&&(0,N.Y)("img",{ref:de,src:re||ae,className:(0,d.A)("full-media",ce&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px`:void 0,draggable:!K}),ue&&(0,N.Y)("canvas",{ref:me,className:"thumbnail"}),K&&(0,N.Y)("span",{className:"protector"}),Ee&&!Be&&(0,N.Y)("div",{ref:xe,className:"media-loading",children:(0,N.Y)(M.A,{progress:Te,onClick:Pe?Re:void 0})}),Be&&(0,N.Y)(b.A,{ref:Le,name:"download"}),(0,N.Y)(I.A,{isVisible:Se,withAnimation:!0,thumbDataUri:ge,width:Oe,height:Ue,className:"media-spoiler",isNsfw:$}),Fe&&(0,N.FD)("span",{className:"message-transfer-progress",children:[Math.round(100*Te),"%"]}),(0,N.Y)(S.A,{isOpen:Ae,onClose:Ce,shouldAlwaysShow:we,onAlwaysShowChanged:be,confirmHandler:ke})]})}))},52844:(e,t,n)=>{let o;function i(e="*",t,n=!1){o||(o=document.createElement("input"),o.setAttribute("type","file")),o.setAttribute("accept",e),n?o.removeAttribute("multiple"):o.setAttribute("multiple","multiple"),o.onchange=null,o.value="",o.onchange=t,o.click()}n.d(t,{p:()=>i})},52988:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(96454),s=n(87357),a=n(17663),r=n(91525),d=n(76023),l=n(4961),c=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,o.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:D,onDateClick:x})=>{const E=(0,m.A)();let L=(0,o.li)();e&&(L=e);const{isMobile:B}=(0,c.Ay)(),[R]=(0,o.J0)(!I),O=Boolean(I),U=(0,u.A)(b,O,B&&!i.QH),K=(0,h.A)(!O),{shouldRender:z,transitionClassNames:V}=(0,p.A)(N,void 0,!0),j=(0,r.fE)(y),J=(0,r.zV)(n),$=(0,o.Kr)(()=>N&&F?`${(0,r.zV)(n*F)} / ${J}`:J,[N,n,J,F]),{width:q,height:H}=(0,d.tP)(M),G=(0,s.A)("File",S,M&&"smaller",D&&!k&&"interactive",P&&"file-is-selected");return(0,A.FD)("div",{ref:L,className:G,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:D,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:H,draggable:!1,alt:""}),R&&(0,A.Y)("canvas",{ref:U,className:(0,s.A)("thumbnail",K)})]}):(0,A.Y)("div",{className:`file-icon ${j}`,children:y.length<=4&&(0,A.Y)("span",{className:"file-ext",dir:"auto",children:y})}),z&&(0,A.Y)("div",{className:(0,s.A)("file-progress",j,V),children:(0,A.Y)(f.A,{progress:F,size:M?"s":"m",onClick:k?D:void 0})}),D&&(0,A.Y)(v.A,{name:T||"download",className:(0,s.A)("action-icon",z&&"hidden")})]}),(0,A.FD)("div",{className:"file-info",children:[(0,A.Y)("div",{className:"file-title",dir:"auto",title:t,children:(0,l.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,l.A)(w)}),!w&&Boolean(C)&&(0,A.FD)(A.FK,{children:[(0,A.Y)("span",{className:"bullet"}),(0,A.Y)(g.A,{onClick:x,children:(0,a.fS)(E,1e3*C,!0)})]})]})]}),w&&Boolean(C)&&(0,A.Y)(g.A,{onClick:x,children:(0,a.be)(E,1e3*C)})]})})},53188:(e,t,n)=>{n.d(t,{A:()=>E});var o=n(84051),i=n(31481),s=n(66644),a=n(90709),r=n(70636),d=n(87357),l=n(4961),c=n(18501),u=n(79882),h=n(35749),m=n(2338),p=n(21488),g=n(39351),f=n(62587),v=n(13439),A=n(76023),y=n(43874),C=n(11217),w=n(59030),b=n(38102);const I="CBda1UmC",S="BhS75ocD",M="uWo2dhui",N="g3XnC73g";var k=n(20021);const Y=Number(A.$),P=(0,o.ph)(({chat:e,topics:t,renderLastMessage:n,observeIntersection:i,noForumTitle:s})=>{const{openThread:r}=(0,v.ko)(),c=(0,o.li)(),u=(0,o.li)(),h=(0,w.A)(),[m,...p]=(0,o.Kr)(()=>t?(0,a.CO)(Object.values(t),void 0,!0).slice(0,3):[],[t]),[g,f]=(0,o.J0)(!1),[A,P]=(0,o.J0)(void 0),{handleClick:F,handleMouseDown:T}=(0,C.Q)(t=>{0===m.unreadCount||e.isForumAsMessages||(t.stopPropagation(),t.preventDefault(),r({chatId:e.id,threadId:m.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,y.Ny)()}))});return(0,o.vJ)(()=>{const e=c.current,t=u.current;if(!e||!t)return;const n=e.offsetWidth,o=t.offsetWidth;Math.abs(n-o)<Y?P(Math.max(n,o)):P(void 0),f(n>o)},[m,n]),(0,k.FD)("div",{className:(0,d.A)("Ow6Ij9O5",g&&"U_yhhC0w",A&&"HV0wCR4O"),dir:h.isRtl?"rtl":void 0,style:A?`--overwritten-width: ${A}px`:void 0,children:[!s&&(0,k.FD)(k.FK,{children:[m&&(0,k.FD)("div",{className:I,children:[(0,k.FD)("div",{className:(0,d.A)("lEbV6HrI",m.unreadCount&&S),ref:u,onClick:F,onMouseDown:T,children:[(0,k.Y)(b.A,{topic:m,observeIntersection:i}),(0,k.Y)("div",{className:"k3Ch25ZQ",children:(0,l.A)(m.title)}),!A&&g&&(0,k.Y)("div",{className:M,children:(0,k.Y)("div",{className:N})})]}),(0,k.Y)("div",{className:"IkuCBmvA",children:p.map(e=>(0,k.FD)("div",{className:(0,d.A)("d0hTIVJn",e.unreadCount&&S),children:[(0,k.Y)(b.A,{topic:e,className:"oknhG11L",observeIntersection:i}),(0,k.Y)("span",{className:"ZUj3xAjs",children:(0,l.A)(e.title)})]},e.id))}),(0,k.Y)("div",{className:"_m_2xcPW"})]}),!m&&(0,k.Y)("div",{className:(0,d.A)(I,"L4Zk0yMN"),children:h("Loading")})]}),(0,k.FD)("div",{className:(0,d.A)("KJ16dBus",m?.unreadCount&&!s&&S),ref:c,onClick:F,onMouseDown:T,children:[n(),!A&&!g&&(0,k.Y)("div",{className:M,children:(0,k.Y)("div",{className:N})})]})]})});var F=n(18276),T=n(18653),D=n(80477);const x=200;function E({chat:e,topics:t,lastMessage:n,statefulMediaContent:d,chatId:v,typingStatus:A,draft:y,lastMessageTopic:C,lastMessageSender:w,observeIntersection:b,animationType:I,orderDiff:S,withInterfaceAnimations:M,isTopic:N,isSavedDialog:Y,isPreview:T,noForumTitle:E}){const B=(0,g.A)(),R=(0,o.li)(),O=n?.content.storyData,U=d&&!d.story;(0,p.A)(U?O?.peerId:void 0,O?.id,d?.story);const K=d?.story||n,z=K&&!(0,a.fP)(K),V=(0,m.A)(K),j=z?V:void 0,J=(0,h.A)(K,"micro"),$=(0,f.A)(z?J:void 0),q=Boolean(n&&(0,a.lk)(n)),H=(0,o.hb)(()=>{if(!Y&&!T&&A&&n&&A.timestamp>1e3*n.date)return(0,k.Y)(D.A,{typingStatus:A});const t=y&&y.replyInfo?.replyToMsgId===C?.id,o=y?.replyInfo&&!y.text&&y.isLocal;if(!e?.isForum&&!Y&&!T&&y&&!o&&(!N||!t))return(0,k.FD)("p",{className:"last-message",dir:B.isRtl?"auto":"ltr",children:[(0,k.Y)("span",{className:"draft",children:B("ChatDraftPrefix")}),(0,k.Y)("span",{className:"last-message-summary",dir:"auto",children:(0,c.fd)({text:y.text?.text||"",entities:y.text?.entities,asPreview:!0,withTranslucentThumbs:!0})})]});if(!n)return;const i=w?(0,r.Q5)(B,v,w):void 0;return(0,k.FD)("p",{className:"last-message shared-canvas-container",dir:B.isRtl?"auto":"ltr",children:[i&&(0,k.FD)(k.FK,{children:[(0,k.Y)("span",{className:"sender-name",children:(0,l.A)(i)}),(0,k.Y)("span",{className:"colon",children:":"})]}),!Y&&n.forwardInfo&&(0,k.Y)(F.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,k.Y)(F.A,{name:"story-reply",className:"chat-prefix-icon"}),(0,k.Y)("span",{className:"last-message-summary",dir:"auto",children:L(n,b,$||j,q)})]})},[e,v,y,q,N,B,n,w,C,$,j,b,A,Y,T]);return(0,o.Nf)(()=>{const e=R.current;if(M&&e){if(I===u.I.Opacity)e.style.opacity="0",(0,s.RK)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1"});else{if(I!==u.I.Move)return;e.style.transform=`translate3d(0, ${-S*i.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=""})},x+i.xB5)}},[M,S,I]),{renderSubtitle:function(){return e?.isForum&&!N?(0,k.Y)(P,{chat:e,renderLastMessage:H,observeIntersection:b,topics:t,noForumTitle:E}):H()},ref:R}}function L(e,t,n,o){const i=(0,k.Y)(T.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return i;const s=(0,a.y2)(e);return(0,k.FD)("span",{className:"media-preview",children:[(0,k.Y)("img",{src:n,alt:"",className:(0,d.A)("media-preview--image",o&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,k.Y)(F.A,{name:"play"}),i]})}},53827:(e,t,n)=>{n.d(t,{_K:()=>f,dj:()=>y,kz:()=>v});var o=n(13439),i=n(89925),s=n(66644),a=n(91048),r=n(96454),d=n(60343),l=n(80853),c=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,o.mS)()).audioPlayer.origin||i.d9.Inline,t);if(!s)return;if(!u.has(s))return void(0,o.ko)().openAudioPlayer((0,d.ES)(C(s).messageKey));const r=u.get(s);r.onForcePlay&&r.onForcePlay(),h=s,r.audio.src&&(0,c.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,o){const i=new Audio;function s(t){return n=>{u.has(e)&&((0,l.f)(i)||u.get(e).handlers.forEach(e=>{e(t,n)}))}}return i.addEventListener("timeupdate",s("onTimeUpdate")),i.addEventListener("play",s("onPlay")),i.addEventListener("pause",s("onPause")),i.addEventListener("loadstart",s("onLoadStart")),i.addEventListener("loadeddata",s("onLoadedData")),i.addEventListener("playing",s("onPlaying")),i.addEventListener("ended",()=>{u.has(e)&&((0,l.f)(i)||g(e))}),{audio:i,type:t,proxy:new Proxy(i,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(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,l.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,l.C)(y))),(0,c.A)(y),function(e,t){if((0,a.nTw)((0,o.mS)()).globalSearch.currentContent===i.$C.Music)return;const{chatId:n}=(0,d.ES)(C(t).messageKey),s=(0,a.Xf0)((0,o.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,o.mS)()).audioPlayer.origin),isFirst:()=>!A(e,(0,a.nTw)((0,o.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(t=!1){const o=u.get(e);o&&(o.handlers=o.handlers.filter(e=>e!==n),o.handlers.length||(o.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(m=m.filter(n))}(o,e),e===h&&(h=void 0)))}}}function A(e,t=i.d9.Inline,n){const o=function(e){switch(e.type){case"audio":return p;case"voice":return m;default:return}}(u.get(e));if(!o)return;if(t===i.d9.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:s}=(0,d.ES)(C(e).messageKey),a=o.filter(e=>e.startsWith(`msg${s}`)),r=a.indexOf(e);if(r<0)return;let l=t===i.d9.Inline?-1:1;return n&&(l*=-1),a[r+l]}function y(e){const t=(0,d.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:o}=C(e),{date:i,messageKey:s}=C(t),a=i-n;return 0===a?s.localeCompare(o):a}},54314:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(9716),d=n(4961),l=n(17712),c=n(59030),u=n(64493),h=n(22337),m=n(21849),p=n(20021);const g=(0,o.ph)((0,i.EK)((e,{chat:t,isSavedDialog:n})=>{const o=(0,r.L8)(t.id),i=(0,a.nZ4)(e,t.id),d=o&&(0,a.mBe)(e,(0,s.e7)(t)),l=d&&(0,s.tv)(d)&&!t.isSupport,c=o&&!i&&!l&&!n,u=o?(0,s.u0)((0,a.mBe)(e,(0,s.e7)(t))):void 0;return{isPrivateChat:o,isChatWithSelf:i,isBot:l,isChannel:(0,s.WX)(t),isBasicGroup:(0,s.yn)(t),isSuperGroup:(0,s.Vs)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:u}})(({isOpen:e,chat:t,isSavedDialog:n,isChannel:o,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,i.ko)(),F=(0,c.A)(),T=(0,s.Js)(F,t),D=(0,l.A)(()=>{S({chatId:t.id,shouldDeleteForAll:!0}),w()}),x=(0,l.A)(()=>{S({chatId:t.id,shouldDeleteForAll:!0}),Y({userId:t.id}),w()}),E=(0,l.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})):!o&&!v||t.isCreator?(o||v)&&t.isCreator&&N({chatId:t.id}):I({chatId:t.id}),w()}),L=(0,l.A)(()=>{o||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":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"ChannelDelete":f||v?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:w,onCloseAnimationEnd:b,children:[n?(0,p.Y)("p",{children:(0,d.A)(r?F("ClearHistoryMyNotesMessage"):F("ClearHistoryMessageSingle",T),["simple_markdown","emoji"])}):o&&t.isCreator?(0,p.Y)("p",{children:(0,d.A)(F("ChatList.DeleteAndLeaveGroupConfirmation",T),["simple_markdown","emoji"])}):o&&!t.isCreator||f||v?(0,p.Y)("p",{children:(0,d.A)(F("ChannelLeaveAlertWithName",T),["simple_markdown","emoji"])}):(0,p.Y)("p",{children:(0,d.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:x,children:F("DeleteAndStop")}),y&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:D,children:C?(0,d.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":o&&!t.isCreator?"LeaveChannel":o&&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 o=n(84051),i=n(13439),s=n(37661),a=n(17712),r=n(59030),d=n(71429),l=n(24433),c=n(23174),u=n(90709),h=n(87357),m=n(43874),p=n(62587);const g="VGmPJoga";var f=n(20021);const v=/#fff/gi,A=(0,o.ph)(({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,m.Ay)(),i=(0,p.A)((0,u.mr)(e,"full"),!1,c.qZ.Text),s=(0,o.Kr)(()=>{if(!i)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=i.replace(v,e),o=(new DOMParser).parseFromString(n,"image/svg+xml");return o.querySelectorAll("path").forEach(t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"}),`data:image/svg+xml;utf8,${o.documentElement.outerHTML}`},[i,t]);return(0,f.Y)("i",{className:(0,h.A)("mklnEg0s","icon",!n&&g),children:(0,f.Y)("img",{src:s,alt:"",className:(0,h.A)("tT8KQwg0",!n&&g),draggable:!1})})}),y=(0,o.ph)(({bot:e,theme:t,chatId:n,threadId:c,isInSideMenu:u,canShowNew:h,onMenuOpened:m,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,i.ko)(),y=(0,r.A)(),C=(0,o.Kr)(()=>e.icons.find(({name:e})=>"default_static"===e)?.document,[e.icons]),[w,b,I]=(0,s.A)(),[S,M]=(0,o.J0)(void 0),N=(0,a.A)(e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),m(),b()}),k=(0,a.A)(()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:c})}),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)(l.A,{customIcon:C&&(0,f.Y)(A,{icon:C,theme:t}),icon:C?void 0:"bots",onClick:k,onContextMenu:N,children:[e.shortName,h&&e.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:y("New")}),S&&(0,f.Y)(d.A,{isOpen:w,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:Y,onCloseAnimationEnd:P,children:(0,f.Y)(l.A,{icon:"stop",destructive:!0,onClick:F,children:y("WebApp.RemoveBot")})})]},e.id)})},54699:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(30857),i=n(32625);function s(e){const t=(0,o.A)();(0,i.A)(t,e,!0)}},55153:(e,t,n)=>{n.d(t,{A:()=>u,L:()=>h});var o=n(31481),i=n(87679),s=n(24909);const a=1280,r=2560,d=40,l=20,c=/\.[^/.]+$/;async function u(e,t,l){const h=URL.createObjectURL(t),{type:p,size:g}=t;let f,v,A,y;const C=l?.shouldSendInHighQuality;if(o.gex.has(p)){const n=await(0,i.NN)(h),{width:g,height:v}=n;y=!m(g,v);const w=C?r:a,b=Math.max(g,v)>w,I=p===o.Vz3;if(!y){if(!l?.compressedBlobUrl&&!I&&(b||"image/jpeg"!==p)){const n=await(0,s.s)(h,b?w/Math.max(g,v):1,"image/jpeg");return URL.revokeObjectURL(h),u(e,t,{...l,compressedBlobUrl:n})}"image/jpeg"===p&&(e=e.replace(c,".jpg")),f={width:g,height:v}}A=Math.max(g,v)>d?await(0,s.s)(h,d/Math.max(g,v),"image/jpeg"):h}else if(o.fNs.has(p)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,i.FW)(h);y=!m(e,t),y||(f={width:e,height:t,duration:n})}catch(e){y=!0}A=await(0,i.eT)(h)}else if(o.IH3.has(p)){const{duration:e,title:t,performer:o,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:o}=await n.e(3246).then(n.bind(n,3246)),s=await(0,i.sZ)(e),a=await t(s),{common:{title:r,artist:d,picture:l},format:{duration:c}}=a,u=o(l),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:d,duration:c,coverUrl:h?URL.createObjectURL(h):void 0}}(h);v={duration:e||0,title:t,performer:o},A=s}return{blob:t,blobUrl:h,filename:e,mimeType:p,size:g,quick:f,audio:v,previewBlobUrl:A,shouldSendAsFile:y||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...l}}function h(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 m(e,t){return Math.max(e,t)/Math.min(e,t)<=l}},55317:(e,t,n)=>{function o(e,t){const{level:n,boosts:o,currentLevelBoosts:i,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,d=t&&o===i&&a;return{currentLevel:d?n-1:n,hasNextLevel:Boolean(s),boosts:o,levelProgress:!s||d?1:(o-i)/(s-i),remainingBoosts:s?s-o:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>o})},55429:(e,t,n)=>{n.d(t,{N:()=>a});var o=n(90709),i=n(70636),s=n(9716);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const d=(0,s.L8)(r)?a[r]:n[r];let l=(0,i.F9)(e,d);const c=n[t.chatId];return c&&("isSelf"in d&&d.isSelf?l=`${e("FromYou")} ${(0,o.Js)(e,c)}`:(0,o.YE)(c)&&(l+=` ${(0,o.Js)(e,c)}`)),l}},55723:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(90709),a=n(10315),r=n(91525),d=n(17872),l=n(91048),c=n(96454),u=n(87679),h=n(58554);const m=new(n(84947).A)(100);var p=n(37661),g=n(5912),f=n(17712),v=n(62587),A=n(69419),y=n(59030),C=n(19806),w=n(94189),b=n(52988),I=n(20021);const S=(0,o.ph)(({document:e,observeIntersection:t,smaller:n,canAutoLoad:S,autoLoadFileMaxSizeMb:M,uploadProgress:N,withDate:k,datetime:Y,className:P,sender:F,isSelected:T,isSelectable:D,shouldWarnAboutFiles:x,isDownloading:E,message:L,onCancelUpload:B,onMediaClick:R,onDateClick:O})=>{const{cancelMediaDownload:U,downloadMedia:K,setSharedSettingOption:z}=(0,i.ko)(),V=(0,o.li)(),j=(0,y.A)(),[J,$,q]=(0,p.A)(),[H,G]=(0,o.J0)(!1),{fileName:W,size:_,timestamp:Q,mimeType:Z}=e,X=(0,r.rK)(e)||"",ee=(0,g.Vz)(V,t),[te,ne]=(0,p.A)();(0,o.vJ)(()=>{ee&&ne()},[ee,ne]);const[oe,ie]=(0,o.J0)(S&&(!M||_<=1048576*M)),se=Boolean(E||oe&&te),ae=(0,s.mr)(e,"download"),{loadProgress:re,mediaData:de}=(0,A.A)(ae,!se,(0,s.Cz)(e,"download"),void 0,!0),le=Boolean(de),{isUploading:ce,isTransferring:ue,transferProgress:he}=(0,s.LK)(N||re,se&&!le,void 0!==N),me=(0,r.ON)(e),pe=me?(0,s.VD)(e):void 0,ge=me?e.previewBlobUrl:void 0,fe=(0,v.A)((0,s.mr)(e,"pictogram"),!ee),ve="photo"===e.innerMediaType&&e.mediaSize&&!e.mediaSize.fromDocumentAttribute&&!e.mediaSize.fromPreload,Ae=R&&e.innerMediaType&&!ve;(0,o.vJ)(()=>{const e=V.current;if(!Ae||!e||!L)return;const t=()=>{!async function(e){const t=(0,s.Op)(e),n=(0,s.nd)(e),o=t||n,a=n&&n.mediaSize&&!n.mediaSize.fromDocumentAttribute;if(!o||o.previewBlobUrl||a)return;const r=(0,s.mr)(o,"full");if(!r||m.has(r))return;m.set(r,void 0);const p=await(0,h.hd)(r,(0,s.Cz)(o,"full"));if(!p)return;let g;if(t&&c.Uz){const e=await(0,u.FW)(p);g={width:e.videoWidth,height:e.videoHeight,fromPreload:!0}}if(n){const e=await(0,u.NN)(p);g={width:e.naturalWidth,height:e.naturalHeight,fromPreload:!0}}if(!g||g.width<=0||g.height<=0)return;let f=(0,i.mS)();const v=(0,l.O5q)(f,e.chatId,e.id);v&&v.content.document&&(f=(0,d.r3y)(f,e.chatId,e.id,{content:{...v.content,document:{...v.content.document,mediaSize:g}}}),(0,i.UF)(f))}(L)};return e.addEventListener("mouseenter",t),()=>{e.removeEventListener("mouseenter",t)}},[Ae,L]);const ye=(0,f.A)(()=>{K({media:e,originMessage:L})}),Ce=(0,f.A)(()=>{ce?B&&B():E?U({media:e}):ue?ie(!1):Ae?R():(0,a.N)({mimeType:Z,extension:X})&&x?$():ye()}),we=(0,f.A)(()=>{z({shouldWarnAboutFiles:!H}),q(),ye()}),be=(0,f.A)(()=>{O?.(L)});return(0,I.FD)(I.FK,{children:[(0,I.Y)(b.A,{ref:V,name:W,extension:X,size:_,timestamp:k?Y||Q:void 0,thumbnailDataUri:pe,previewData:ge||fe,smaller:n,isTransferring:ue,isUploading:ce,transferProgress:he,className:P,sender:F,isSelectable:D,isSelected:T,actionIcon:Ae?(0,s.hr)(e)?"play":"eye":"download",onClick:Ce,onDateClick:O?be:void 0}),(0,I.FD)(w.A,{isOpen:J,onClose:q,confirmHandler:we,children:[j("lng_launch_svg_warning"),(0,I.Y)(C.A,{className:"dialog-checkbox",checked:H,label:j("lng_launch_exe_dont_ask"),onCheck:G})]})]})})},59816:(e,t,n)=>{n.d(t,{A:()=>P});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(87357),d=n(95807),l=n(39751),c=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,o.ph)(({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:l})=>{const{sendStoryReaction:v}=(0,i.ko)(),y=(0,o.li)(),[C,w]=(0,o.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,c.$_)(b,I)}-${n}-${l?"preview":"viewer"}`,T=(0,o.Kr)(()=>M?.find(e=>(0,c.a0)(e.reaction,N))?.count,[N,M]),D=!l&&Boolean(T)&&P,x=(0,p.A)(()=>{if(!y.current)return;const e=y.current.clientHeight;w(Math.round(.6*e))});(0,m.A)(([e])=>{Boolean(T)!==Boolean(e)&&x()},[T]),(0,g.A)(y,x);const 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,d.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",D&&"mFTLUHm2"),reaction:N,containerId:F,size:C,effectSize:4*C,shouldPause:l,shouldLoop:!l}),D&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})});var C=n(61433),w=n(91048),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,o.ph)((0,i.EK)((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}})(({mediaArea:e,className:t,style:n,restrictedEmoji:i,isPreview:s})=>{const l=(0,o.li)(),[c,u]=(0,o.J0)(0),{temperatureC:h,color:m}=e,f=(0,b.Bz)(m),v=(0,b.vG)(m),y=(0,p.A)(e=>{if(!l.current)return;const t=l.current,n=t.clientHeight,o=Math.round(.7*n);u(o);const i=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${o}px`,"font-size":n/32+"rem"})};if(e)return i;(0,a.RK)(i)});return(0,o.Nf)(()=>{(0,a.gm)(()=>y(!0))},[]),(0,g.A)(l,()=>y()),(0,A.Y)("div",{ref:l,className:(0,r.A)("KBjMtRUS",t),style:(0,d.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[i&&(0,A.Y)(S.A,{documentId:i.id,size:c,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},i.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:o,width:i,height:s,rotation:a,radius:r}=e.coordinates;let l="";if(t&&r&&t>0){const e=t*(i/100),n=t*(s/100);l=Math.min(e,n)*(r/100)+"px"}return(0,d.A)(`left: ${n}%`,`top: ${o}%`,`width: ${i}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,l&&`border-radius: ${l}`)}const P=(0,o.ph)(({story:e,isActive:t,className:n,isStoryPlaying:d})=>{const{openMapModal:c,openUniqueGiftBySlug:u,focusMessage:h,closeStoryViewer:m,openUrl:p}=(0,i.ko)(),g=(0,o.li)(),[f,C]=(0,o.J0)(0),w=(0,l.A)();(0,o.vJ)(()=>{if(!g.current)return;const e=g.current;if(C(e.clientWidth),w.width>s.c2m)return void(0,a.RK)(()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")});const t=w.width/w.height,n=t<N?e.clientHeight*N:e.clientWidth,o=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)(()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${o}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,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const e=t&&!k.has(n.type);return(0,A.Y)("div",{className:(0,r.A)(v,e&&"xFjJpeOA"),style:Y(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":c({geoPoint:e.geo});break;case"channelPost":h({chatId:e.channelId,messageId:e.messageId}),m();break;case"url":p({url:e.url});break;case"uniqueGift":u({slug:e.slug})}})(n)})}case"suggestedReaction":return(0,A.Y)(y,{story:e,mediaArea:n,index:o,isPreview:!t,className:v,style:Y(n)},`${n.type}-${o}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:Y(n,f),isPreview:!t||d},`${n.type}-${o}`);default:return}})})})},60138:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,o.vJ)(()=>(0,i.yu)(t),[t])}},60406:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(61433),s=n(66644),a=n(37836);const r=({containerRef:e,selector:t},n)=>{(0,o.Nf)(()=>{const n=e.current?.querySelectorAll(t);if(!n?.length)return;const o=(0,a.nF)(e=>{const t=e.target,n=t.scrollTop>0;(0,s.RK)(()=>{(0,i.dH)(t,"scrolled",n)})},100);return n.forEach(e=>{(0,i.YM)(e,"with-notch"),e.addEventListener("scroll",o,{passive:!0})}),()=>{n.forEach(e=>{e.removeEventListener("scroll",o),(0,i.HW)(e,"with-notch")})}},[e,t,...n]),(0,o.vJ)(()=>{const n=e.current?.querySelectorAll(t);n?.length&&n.forEach(e=>{const t=e.scrollTop>0;(0,s.RK)(()=>{(0,i.dH)(e,"scrolled",t)})})},[e,t,...n])}},61097:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(90709),i=n(84051),s=n(66644),a=n(67054),r=n(87679),d=n(41074),l=n(17712);const c=.1;let u=-1;function h(e,t){return function(e,t=!1){const n=(0,i.li)(),o=(0,i.Kr)(()=>(0,a.A)(d.bP,++u),[]),h=(0,i.li)(),m=(0,l.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 i=Math.ceil(Math.min(n.width,n.height)*c);(0,d.M1)({name:"offscreen-canvas:blurThumb",args:[h.current,t,i],transferables:[h.current]},o)})});return(0,i.Nf)(()=>{if(!e||t||h.current)return;const o=n.current;o&&m(o,e)},[m,t,e]),n}(e?"string"==typeof e?e:(0,o.VD)(e):void 0,t)}},63744:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(91048),a=n(71331),r=n(87357),d=n(14),l=n(59030),c=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,s.hds)(e,t),o=(0,a.mD)(e,t);return{groupCall:o,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}})(({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,i.ko)(),g=(0,l.A)(),f=(0,o.hb)(()=>{p({chatId:e})},[p,e]),v=s?.participants,A=(0,o.Kr)(()=>{if(!v)return[];const e=(0,i.mS)().users.byId,t=(0,i.mS)().chats.byId;return Object.values(v).slice(0,3).map(({id:n})=>e[n]||t[n]).filter(Boolean)},[v]),y=(0,d.A)(s?.participantsCount,!0),C=(0,d.A)(A,!0),w=Boolean(s&&t),{ref:b,shouldRender:I}=(0,c.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:()=>l,aG:()=>r,gs:()=>a,tF:()=>d});var o=n(16581),i=n(83414),s=n(672);function a(e,t,n,o=!1){return(0,s.A)(t=>{t(e())},t,n,o)}function r(e,t,n=!1){const o=a(()=>e(),[e],t,n);return(0,i.A)(o,[o,e],!0)}function d(e,t,n,i=!1,s=!1){return(0,o.A)(t=>{t(e())},t,n,i,s)}function l(e,t,n=!1,o=!1){const s=d(()=>e(),[e],t,n,o);return(0,i.A)(s,[s,e],!0)}},64154:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=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:l,text:c}=r||{};return(0,o.vJ)(()=>{t&&n&&!c&&void 0===l&&s&&function(e,t,n){const o=a.get(n)||new Map,s=o.get(e)||[];s.includes(t)||(s.push(t),o.set(e,s),a.set(n,o),(0,i.ko)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),d()}(t,n,s)},[t,c,l,n,s]),t&&n?{isPending:l,translatedText:c}:{isPending:!1,translatedText:void 0}}const d=(0,s.nF)(function(){const{translateMessages:e}=(0,i.ko)();let t=!1;a.forEach((n,o)=>{n.forEach((n,i)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:i,messageIds:s,toLanguageCode:o}),function(e,t,n){const o=a.get(n);if(!o?.size)return void a.delete(n);const i=o.get(e);if(!i?.length)return void o.delete(e);const s=i.filter(e=>!t.includes(e));if(!s?.length)return o.delete(e),void(o.size||a.delete(n));o.set(e,s)}(i,s,o)})}),t&&d()},500)},65240:(e,t,n)=>{n.d(t,{Ay:()=>B});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(91048),l=n(56494),c=n(53827),u=n(87357),h=n(50442),m=n(17663),p=n(58443),g=n(91525),f=n(4961),v=n(43874),A=n(88792),y=n(71533),C=n(17712),w=n(62587),b=n(69419),I=n(59030),S=n(50680),M=n(64493),N=n(96530),k=n(35913),Y=n(4438),P=n(18276),F=n(20021);const T=window.matchMedia("(max-width: 375px)"),D=window.matchMedia("(max-width: 410px)");function x(e,t,n,o,i,s,a,r,d,l,c){const{title:u,performer:h,fileName:p}=t,v=o||i>0&&i<1,{isRtl:A}=e;return(0,F.FD)("div",{className:"content",children:[(0,F.Y)("p",{className:"title",dir:"auto",title:u,children:(0,f.A)(u||p)}),v&&(0,F.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,F.Y)("span",{className:"duration with-seekline",dir:"auto",children:(0,m.QO)(n*i,n)}),L(i,s,a)]}),!v&&r&&(0,F.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[l?`${(0,g.zV)(t.size*l)} / `:void 0,(0,g.zV)(t.size)]}),!v&&!r&&(0,F.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,F.Y)("span",{className:"duration",dir:"auto",children:(0,m.QO)(n)}),h&&(0,F.FD)(F.FK,{children:[(0,F.Y)("span",{className:"bullet",children:""}),(0,F.Y)("span",{className:"performer",dir:"auto",title:h,children:(0,f.A)(h)})]}),Boolean(d)&&(0,F.FD)(F.FK,{children:[(0,F.Y)("span",{className:"bullet",children:""}),(0,F.Y)(N.A,{className:"date",onClick:c,children:(0,m.fS)(e,1e3*d,!0)})]})]})]})}function E(e,t,n,o,i,s,r,d,l,c,h,p){return(0,F.FD)("div",{className:"content",children:[(0,F.FD)("div",{className:"waveform-wrapper",children:[(0,F.Y)("div",{className:"waveform",draggable:!1,ref:t,children:(0,F.Y)("canvas",{ref:n})}),c&&(0,F.FD)(M.A,{onClick:()=>{(d||l)&&h?h(!r):s||c()},children:[(0,F.Y)(P.A,{name:d||l?"down":"transcribe",className:(0,u.A)("transcribe-icon",(d||l)&&!r&&"transcribe-shown")}),s&&(0,F.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,F.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,F.Y)("p",{className:(0,u.A)("voice-duration",p!==a.d9.OneTimeModal&&i&&"unread"),dir:"auto",children:0===o||1===o?(0,m.QO)(e.duration):(0,m.QO)(e.duration*o)})]})}function L(e,t,n){return(0,F.FD)("div",{className:"seekline",ref:n,children:[t.map(({start:e,end:t})=>(0,F.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`})),(0,F.Y)("span",{className:"seekline-play-progress",children:(0,F.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,F.Y)("span",{className:"seekline-thumb",children:(0,F.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const B=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,d.Pn$)(e,t),mediaDuration:(0,l.Y9)(e,t)}))(({theme:e,message:t,senderTitle:n,uploadProgress:d,origin:l,date:g,noAvatars:B,className:R,isSelectable:O,isSelected:U,isDownloading:K,isTranscribing:z,isTranscriptionHidden:V,isTranscribed:j,isTranscriptionError:J,canDownload:$,canTranscribe:q,autoPlay:H,webPage:G,mediaDuration:W,onHideTranscription:_,onPlay:Q,onPause:Z,onReadMedia:X,onCancelUpload:ee,onDateClick:te})=>{const{cancelMediaDownload:ne,downloadMedia:oe,transcribeAudio:ie,openOneTimeMediaModal:se}=(0,i.ko)(),{content:{audio:ae,voice:re,video:de},isMediaUnread:le}=t,ce=ae||(0,r.y3)(G),ue=re||de||ce,he=re||de,me=Boolean(re||de),pe=(0,o.li)(!1),ge=(0,o.li)(),fe=(0,I.A)(),{isRtl:ve}=fe,{isMobile:Ae}=(0,v.Ay)(),[ye,Ce]=(0,o.J0)(!1),we=ye||!0,be=(0,r.VO)(ue,"pictogram"),Ie=(0,w.A)(be,!1,s.qZ.BlobUrl),Se=(0,r.G5)(t),Me=l===a.d9.OneTimeModal,Ne=me?Se?"oneTimeVoice":"voice":"audio",ke=(0,w.A)((0,r.VO)(ue,"inline"),!we,(0,r.Cz)(ue,"inline")),{loadProgress:Ye}=(0,b.A)((0,r.VO)(ue,"download"),!K,(0,r.Cz)(ue,"download")),Pe=(0,C.A)(()=>{Ce(!0),Q?.(t.id,t.chatId)}),Fe=(0,C.A)(()=>{Ce(!1)}),{isBuffered:Te,bufferedRanges:De,bufferingHandlers:xe,checkBuffering:Ee}=(0,y.A)(),Le=Me,{isPlaying:Be,playProgress:Re,playPause:Oe,setCurrentTime:Ue,duration:Ke}=(0,A.A)((0,c.dj)(t),W,Ne,ke,xe,void 0,Ee,Boolean(ye||H),Pe,Fe,(0,r.Nb)(t)||Se,void 0,Z,Le,Se&&!Me),ze=1-Re,Ve=(0,r.Ie)(t),je=Se&&Me,Je=function(e,t,n=0,i=!1,s=!1,a=!1,r=!1){const d=(0,o.li)(),{data:l,peak:c}=(0,o.Kr)(()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:o,MAX_SPIKES:i}=function(e,t){return{MIN_SPIKES:e?T.matches?16:20:25,MAX_SPIKES:e?T.matches?35:t&&D.matches?40:45:75}}(a,s),r=Math.min(n/10,1),d=Math.round(o+(i-o)*r);return function(e,t){let n=0;const o=new Array(t),i=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*i),d=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;o[r]=d,n<d&&(n=d)}return{data:o,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const o=Array(n),i=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=i[t]+(i[t+1]<<8);o[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=i[s]+(i[s+1]<<8);return o[n-1]=r>>a&31,o}(new Uint8Array(e)),d)},[a,t,s])||{};return(0,o.Nf)(()=>{const t=d.current;t&&l&&void 0!==c&&function(e,t,n,{peak:o,fillStyle:i,progressFillStyle:s}){const a=4*t.length;e.width=2*a,e.height=46,e.style.width=`${a}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach((e,a)=>{r.globalAlpha=a/t.length>=n?.5:1,r.fillStyle=n>a/t.length?s:i;const d=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,o,i,s){2<2*s&&(s=1),i<2*s&&(s=i/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-i,s),e.arcTo(t+2,n-i,t,n-i,s),e.arcTo(t,n-i,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+d)/2,0,d,1),r.fill()})}(t,l,r?1-n:n,{peak:c,fillStyle:i?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:i?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})},[i,c,n,l,e,r]),d}(e,he,!le||Ve||je?Re:1,Ve,!B,Ae,je),$e=Be||Re>0&&Re<1;(0,o.vJ)(()=>{Ce(Be)},[Be]);const qe=ye&&!Te,{isUploading:He,isTransferring:Ge,transferProgress:We}=(0,r.LK)(d||Ye,qe||K,void 0!==d),{shouldRender:_e,transitionClassNames:Qe}=(0,S.A)(Ge),Ze=_e&&(qe||He),Xe=(0,C.A)(()=>{if(He)ee?.();else{if(Se)return se({message:t}),void X?.();Be||Q?.(t.id,t.chatId),(0,i.ko)().setAudioPlayerOrigin({origin:l}),Ce(!ye),Oe()}});(0,o.vJ)(()=>{X&&le&&Be&&X()},[Be,le,X]);const et=(0,C.A)(()=>{K?ne({media:ue}):oe({media:ue,originMessage:t})}),tt=(0,C.A)(e=>{if(pe.current&&ge.current){const{width:t,left:n}=ge.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ue(Math.max(Math.min(Ke*((o-n)/t),Ke-.1),.001))}}),nt=(0,C.A)(e=>{e instanceof MouseEvent&&2===e.button||(pe.current=!0,tt(e))}),ot=(0,C.A)(()=>{pe.current=!1}),it=(0,C.A)(()=>{te(t)}),st=(0,C.A)(()=>{ie({chatId:t.chatId,messageId:t.id})});function at(){if(me)return n||"Voice";const{title:e,fileName:t}=ce;return e||t}function rt(){if(me)return(0,F.Y)("div",{className:"meta",dir:ve?"rtl":void 0,children:(0,m.QO)((re||de).duration)});const{performer:e}=ce;return(0,F.FD)("div",{className:"meta",dir:ve?"rtl":void 0,children:[(0,m.QO)(Ke),(0,F.Y)("span",{className:"bullet",children:""}),e&&(0,F.Y)("span",{className:"performer",title:e,children:(0,f.A)(e)}),e&&n&&(0,F.Y)("span",{className:"bullet",children:""}),n&&(0,F.Y)("span",{title:n,children:(0,f.A)(n)})]})}(0,o.vJ)(()=>{if(ge.current&&$e&&!Me)return(0,h.wJ)(ge.current,{onCapture:nt,onRelease:ot,onClick:ot,onDrag:tt})},[$e,nt,tt,ot,Me]);const dt=(0,u.A)("Audio",R,Me&&"non-interactive",l===a.d9.Inline&&"inline",Ve&&l===a.d9.Inline&&"own",(l===a.d9.Search||l===a.d9.SharedMedia)&&"bigger",U&&"audio-is-selected"),lt=["toogle-play-wrapper"];Ze?lt.push("loading"):lt.push(Be?"pause":"play");const ct=(0,u.A)("content",$e&&"with-seekline");function ut(){return(0,F.FD)("div",{className:ct,children:[(0,F.FD)("div",{className:"content-row",children:[(0,F.Y)("p",{className:"title",dir:"auto",title:at(),children:(0,f.A)(at())}),(0,F.Y)("div",{className:"message-date",children:Boolean(g)&&(0,F.Y)(N.A,{className:"date",onClick:it,children:(0,m.be)(fe,1e3*g)})})]}),$e&&(0,F.FD)("div",{className:"meta search-result",dir:ve?"rtl":void 0,children:[(0,F.Y)("span",{className:"duration with-seekline",dir:"auto",children:Re<1&&(0,m.QO)(Ke*Re,Ke)}),L(Re,De,ge)]}),!$e&&rt()]})}return(0,F.FD)("div",{className:dt,dir:fe.isRtl?"rtl":"ltr",children:[O&&(0,F.Y)("div",{className:"message-select-control no-selection",children:U&&(0,F.Y)(P.A,{name:"select"})}),(0,F.FD)("div",{className:(0,u.A)(...lt),children:[(0,F.FD)(M.A,{round:!0,ripple:!Ae,size:"smaller",className:"toggle-play",color:Ie?"translucent-white":"primary",ariaLabel:Be?"Pause audio":"Play audio",onClick:Xe,isRtl:fe.isRtl,backgroundImage:Ie,nonInteractive:Me,children:[!Me&&(0,F.Y)(P.A,{name:"play"}),!Me&&(0,F.Y)(P.A,{name:"pause"}),Me&&(0,F.Y)(Y.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Se&&!Me&&(0,F.Y)(P.A,{name:"view-once"})]}),_e&&(0,F.Y)("div",{className:(0,u.A)("media-loading",Qe,Ze&&"interactive"),children:(0,F.Y)(k.A,{progress:We,transparent:!0,withColor:!0,size:"m",onClick:Ze?Xe:void 0,noCross:!Ze})}),Me&&!_e&&(0,F.Y)("div",{className:(0,u.A)("media-loading"),children:(0,F.Y)(k.A,{progress:Re,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ce&&$&&!He&&(0,F.Y)(M.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:K?"Cancel download":"Download",onClick:et,children:(0,F.Y)(P.A,{name:K?"close":"arrow-down"})}),l===a.d9.Search&&ut(),l!==a.d9.Search&&ce&&x(fe,ce,Ke,Be,Re,De,ge,K||He,g,We,te?it:void 0),l===a.d9.SharedMedia&&he&&ut(),(l===a.d9.Inline||Me||j)&&he&&E(he,ge,Je,Se?ze:Re,le,z,V,j,J,q?st:void 0,_,l)]})}))},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991:(e,t,n)=>{n.d(t,{Y:()=>u,c:()=>h});var o=n(84051),i=n(31481),s=n(66644),a=n(19822),r=n(39761),d=n(96454),l=n(95704);const c=100;function u(e,t,n){return(0,o.vJ)(()=>{if(!t||!e.current)return;const o=g(),i=e.current;if(!d.Yw||!n||!o?.isTypeSupported(n))return;const u=new o;function h(){if(!t||!n)return;const e=u.addSourceBuffer(n),o=(0,l.h)(t);e.addEventListener("updateend",function(){o.next().then(({value:t,done:n})=>{"open"===u.readyState&&(n?p(u):m(e,t))})}),o.next().then(({value:t,done:n})=>{n||"open"!==u.readyState||((0,s.RK)(()=>{i.style.display="block",setTimeout(()=>{(0,s.RK)(()=>{(0,a.ZM)(i,{opacity:"1"})})},c)}),m(e,t))})}return u.addEventListener("sourceopen",h,{once:!0}),(0,s.RK)(()=>{(0,a.ZM)(i,{display:"none",opacity:"0"}),i.src=URL.createObjectURL(u)}),()=>{(0,s.RK)(()=>{const e=i.src;(0,r.A)(i),u.removeEventListener("sourceopen",h),"open"===u.readyState&&p(u),URL.revokeObjectURL(e)})}},[n,t,e]),h(n)}function h(e){return!(!d.Yw||!e)&&Boolean(g()?.isTypeSupported(e))}function m(e,t){try{e.appendBuffer(t)}catch(e){i.Oig&&console.warn("[Stream] failed to append buffer",e)}}function p(e){try{e.endOfStream()}catch(e){i.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 o(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>o})},68153:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},69419:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),i=n(23174),s=n(91048),a=n(96454),r=n(58554),d=n(37836),l=n(63527),c=n(30857),u=n(14745);const h=.75,m=1500,p=500;function g(e,t=!1,n=i.qZ.BlobUrl,g,f=!1){const v=a.Uz&&n===i.qZ.Progressive,A=e?v?r.RB(e):r.Ih(e):void 0,y=(0,c.A)(),C=(0,l.A)(s.nIz),w=(0,u.A)(),[b,I]=(0,o.J0)(A&&!v?1:0),S=(0,o.li)(),M=(0,o.Kr)(()=>(0,d.nF)(e=>{S.current&&(!g||Date.now()-S.current>g)&&I(e)},p,!0),[g]);return(0,o.vJ)(()=>{!t&&e&&(A?v&&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,A,n,v,g,M,f,w,C]),(0,o.vJ)(()=>{t&&S.current&&(r.ch(M),I(0),S.current=void 0)},[M,t]),(0,o.vJ)(()=>()=>{e&&r.Cn(e,w)},[w,e]),{mediaData:A,loadProgress:b}}},71331:(e,t,n)=>{n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>c,mD:()=>a,n5:()=>d,qI:()=>l,uu:()=>u});var o=n(90709),i=n(21133),s=n(19926);function a(e,t){const n=(0,i.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function d(e,t,n){return r(e,t)?.participants[n]}function l(e){const t=c(e)?.chatId;if(!t)return!1;const n=(0,i.hd)(e,t);return!!n&&((0,o.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function c(e){const{groupCalls:{activeGroupCallId:t}}=e;if(t)return r(e,t)}function u(e){const{phoneCall:t,currentUserId:n}=e;if(!t||!t.participantId||!t.adminId)return;const o=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,o)}function h(e){const t=c(e);if(!t||!t.chatId)return!1;const n=(0,i.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,o.Kl)(n)))return!0;const s=(0,i.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(87357),s=n(17663),a=n(14242),r=n(39351),d=n(59030),l=n(18276);const c="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,o.ph)(({title:e,type:t,statistics:n,isToncoin:o,className:y,subtitle:C})=>{const w=(0,d.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,i.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[o,i]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,m.FD)("div",{children:[(0,m.Y)(l.A,{className:"it39BC_c",name:"toncoin"}),(0,m.FD)("b",{className:h,children:[o,(0,m.FD)("span",{className:"ZAfXkuWL",children:[".",i]})]})," ",(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,i.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:o?(0,m.Y)("tr",{children:(0,m.FD)("td",{className:c,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];if(e.isPlain)return(0,m.FD)("td",{className:c,children:[(0,m.Y)("b",{className:h,children:`${e.isApproximate?" ":""}${(0,a.Sm)(t??0)}`}),(0,m.Y)("h3",{className:u,children:w(e.title)})]});if(e.isPercentage){const n=t?.part??0,o=t?.percentage??0;return(0,m.FD)("td",{className:c,children:[e.withAbsoluteValue&&(0,m.Y)("span",{className:h,children:`${e.isApproximate?" ":""}${(0,a.Sm)(n)}`}),(0,m.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":h,children:[o,"%"]}),(0,m.Y)("h3",{className:u,children:w(e.title)})]})}return(0,m.FD)("td",{className:c,children:[(0,m.Y)("b",{className:h,children:(0,a.Vw)(b,t?.current??0)})," ",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 o=n(84051),i=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,o.Kr)(()=>(0,a.nF)(n=>{e&&t&&(0,i.ko)().sendMessageAction({chatId:e,threadId:t,action:n})},s.cqp),[e,t])},75319:(e,t,n)=>{function o(e){return"object"==typeof e&&null!==e&&"graphType"in e}n.d(t,{R:()=>o})},75343:(e,t,n)=>{n.d(t,{A:()=>b});var o=n(84051),i=n(13439),s=n(87357),a=n(43874),r=n(36838),d=n(59030),l=n(89925),c=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,o.ph)(function({peer:e,isArchived:t}){const{openChat:n,openChatWithInfo:a,openStoryViewer:r,toggleStoriesHidden:w}=(0,i.ko)(),b=(0,d.A)(),I=(0,o.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),D=(0,p.A)(()=>I.current),x=(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:l.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"})}),K=(0,p.A)(()=>{n({id:e.id,shouldReplaceHistory:!0})}),z=(0,p.A)(()=>{a({id:e.id,shouldReplaceHistory:!0})}),V=(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:l.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,c.F9)(b,e)}),void 0!==k&&(0,C.Y)(v.A,{isOpen:N,anchor:k,getTriggerElement:D,getRootElement:x,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:K,icon:"message",children:b("SendMessageTitle")}),M?(0,C.Y)(A.A,{onClick:z,icon:"channel",children:b("ChatList.ContextOpenChannel")}):(0,C.Y)(A.A,{onClick:z,icon:"user",children:b("StoryList.Context.ViewProfile")}),(0,C.Y)(A.A,{onClick:V,icon:t?"unarchive":"archive",children:b(t?"StoryList.Context.Unarchive":"StoryList.Context.Archive")})]})})]})}),b=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:o}}=e.stories;return{orderedPeerIds:t?o:n,usersById:e.users.byId,chatsById:e.chats.byId}})(function({isArchived:e,className:t,orderedPeerIds:n,usersById:i,chatsById:l,isClosing:c}){const u=(0,d.A)(),h=(0,s.A)(y.A.root,!n.length&&y.A.hidden,c&&y.A.closing,t,"no-scrollbar"),m=(0,o.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=i[t]||l[t];if(n)return(0,C.Y)(w,{peer:n,isArchived:e},t)})})}))},78407:(e,t,n)=>{n.d(t,{A:()=>W});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(91048),d=n(30708),l=n(63495),c=n(96454),u=n(87357),h=n(52674),m=n(14680),p=n(17237),g=n(36353),f=n(37836),v=n(4961),A=n(11359),y=n(43874),C=n(19129),w=n(37661),b=n(17712),I=n(59030),S=n(88458),M=n(41733);class N{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,M.A)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,a.YS)(()=>{if(!this.video)return;const o=this.video,{width:i,height:s}=this.container.getBoundingClientRect();(0,a.RK)(()=>{o.style.left=`${Math.round(t*i)}px`,o.style.top=`${Math.round(n*s)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`})})}}var k=n(60261),Y=n(43336),P=n(71322),F=n(76023),T=n(37479),D=n(87094),x=n(82117),E=n(93545),L=n(672),B=n(61157),R=n(38691);const O=1.25*F.$;var U=n(18276),K=n(64493),z=n(61361),V=n(80089),j=n(80464),J=n(20021);const $=e=>{const{isOpen:t}=e,n=(0,j.A)(V.ar.Extra,"TextFormatter",!t);return n?(0,J.Y)(n,{...e}):void 0},q="input-scroller",H=140,G=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],W=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:o}=(0,d.l)(e);return{messageSendKeyCombo:o,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:d,isAttachmentModalInput:M,isStoryInput:F,customEmojiPrefix:V,editableInputId:j,isReady:W,isActive:_,getHtml:Q,placeholder:Z,timedPlaceholderLangKey:X,timedPlaceholderDate:ee,forcedPlaceholder:te,canSendPlainText:ne,canAutoFocus:oe,noFocusInterception:ie,shouldSuppressFocus:se,shouldSuppressTextFormatter:ae,replyInfo:re,isSelectModeActive:de,canPlayAnimatedEmojis:le,messageSendKeyCombo:ce,onUpdate:ue,onSuppressedFocus:he,onSend:me,onScroll:pe,onFocus:ge,onBlur:fe,isNeedPremium:ve,messageListType:Ae})=>{const{editLastMessage:ye,replyToNextMessage:Ce,showAllowedMessageTypesNotification:we,openPremiumModal:be}=(0,i.ko)();let Ie=(0,o.li)();e&&(Ie=e);const Se=(0,o.li)(),Me=(0,o.li)(),Ne=(0,o.li)(),ke=(0,o.li)(),Ye=(0,o.li)(),Pe=(0,o.li)(),Fe=(0,I.A)(),Te=(0,o.li)(!1),[De,xe,Ee]=(0,w.A)(),[Le,Be]=(0,o.J0)(),[Re,Oe]=(0,o.J0)(),[Ue,Ke]=(0,o.J0)(!1),{isMobile:ze}=(0,y.Ay)(),Ve=ze&&(c.pz||c.Ni),[je,Je]=(0,o.J0)(!1);(0,o.vJ)(()=>{Je(Boolean(X&&ee))},[ee,X]);const $e=(0,b.A)(()=>{Je(!1)});!function(e,t,n,s,d,l,c,u,h){const m=(0,D.A)(t,void 0,!u),p=(0,T.A)(m,!0),g=(0,R.A)(),f=(0,o.li)(new Map),v=(0,b.A)(e=>{e.forEach(e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))})}),A=(0,b.A)(()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,i.mS)(),o=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach(t=>{if(!t.dataset.uniqueId)return;const i=`${l}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;o.delete(i);const u=(0,k.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,Y.LI)((v.left-h.left)/h.width,4),y=(0,Y.LI)((v.top-h.top)/h.height,4);if(f.current.has(i))return void f.current.get(i).updatePosition(A,y);const C=(0,r.O8F)(e,a);if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),b=[l,a,m,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:o,renderId:i,viewId:s,mediaUrl:a,position:r,isHq:d,textColor:l,colorFilter:c}){if(e.isLottie){const o=e.shouldUseTextColor&&l?(0,P.E2)(l):void 0,c=(await(0,S.Y)()).init(a,d?n.current:t.current,i,{size:O,coords:r,isLowPriority:!d},s,o?[o.r,o.g,o.b]:void 0);return{play:()=>c.play(),pause:()=>c.pause(),destroy:()=>c.removeView(s),updatePosition:(e,t)=>c.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&c?`filter: ${c};`:void 0,n=new N(a,o.current,{size:O,position:r,style:t});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:d,renderId:b,viewId:i,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then(e=>{c&&e.play(),f.current.set(i,e)})}),v(Array.from(o))});(0,o.vJ)(()=>(0,k.K3)(A),[A]),(0,o.vJ)(()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}},[]),(0,o.vJ)(()=>{e()&&t.current&&n.current&&h&&u?(0,a.YS)(()=>{A()}):v(Array.from(f.current.keys()))},[e,A,t,v,n,h,u]),(0,o.Nf)(()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")},[p]),(0,x.A)(([e])=>{void 0!==e&&m!==e&&A()},[m,A]);const y=(0,L.A)(A,[A],300,!1);(0,E.A)(n,y),(0,x.A)(([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())},[g,A]);const C=(0,b.A)(()=>{f.current.forEach(e=>{e.pause()})}),w=(0,b.A)(()=>{c&&f.current?.forEach(e=>{e.play()})}),I=(0,b.A)(()=>{(0,a.YS)(w)});(0,B.Ay)(C,I)}(Q,Ie,ke,Ye,Pe,V,le,W,_);const qe=M?160:F?128:ze?256:416,He=(0,b.A)((e=!1)=>{(0,f.IJ)(()=>{(0,a.gm)(()=>{const t=Ie.current.closest(`.${q}`),n=Number(t.style.height.replace("px","")),o=Ne.current,{scrollHeight:i}=o,s=Math.min(i,qe);if(s===n)return;const r=i>qe;function d(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,a.RK)(d):d})})});(0,o.Nf)(()=>{M&&He(!1)},[M,He]);const Ge=(0,o.li)(Q());(0,o.Nf)(()=>{const e=_?Q():"";e!==Ie.current.innerHTML&&(Ie.current.innerHTML=e),e!==Me.current.innerHTML&&(Me.current.innerHTML=e),e!==Ge.current&&(Ge.current=e,He(!e))},[Q,_,He]),(0,o.li)(n).current=n;const We=(0,b.A)(()=>{Ie.current&&!ve&&((0,o.OV)()?setTimeout(We,350):(0,g.A)(Ie.current))}),_e=(0,b.A)(()=>{Ee(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()});function Qe(){if(c.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Te.current)return Ee(),c.Ni&&Ke(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(ae||!(0,A.L)(t,j||s.CfG)||!n||(0,p.A)(n)||!t.START_TO_END)||(Ee(),!1)}function Ze(){if(!Qe())return;if(Ue)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=Ie.current.closest(`.${q}`).getBoundingClientRect();let o=t.left+t.width/2-n.left;o<H?o=H:o>n.width-H&&(o=n.width-H),Be({x:o,y:t.top-n.top}),Oe(e),xe()}function Xe(){Se.current&&window.clearTimeout(Se.current),Se.current=window.setTimeout(Ze,260)}const et=(0,b.A)(()=>be());(0,o.vJ)(()=>{c.TF||oe&&We()},[n,We,re,oe]),(0,o.vJ)(()=>{if(!n||j!==s.CfG||ie||Ve||de)return;const e=e=>{if((0,m.ZJ)())return;const{key:t}=e,n=e.target;if(!n||G.includes(t))return;const o=Ie.current,i=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!i||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&o&&n!==o&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,g.A)(o,!0,!0);const t=new KeyboardEvent(e.type,e);o.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[n,j,Ve,de,ie]),(0,o.vJ)(()=>{const e=(0,f.sg)(e=>{"Tab"!==e.key||(0,m.ZJ)()||(e.preventDefault(),(0,a.RK)(We))},2e3,!0,!1);return(0,h.A)({onTab:e})},[We]),(0,o.vJ)(()=>{const e=Ie.current;function t(){e.blur()}return se&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[se]);const tt=(0,C.A)(()=>Boolean(_&&Q()),[_,Q]),nt=(0,u.A)("form-control allow-selection",tt&&"touched",se&&"focus-disabled"),ot=(0,u.A)("input-scroller-content",ve&&"is-need-premium"),it="string"==typeof Z?Z:void 0;return(0,J.FD)("div",{id:t,onClick:se?he:void 0,dir:Fe.isRtl?"rtl":void 0,children:[(0,J.Y)("div",{className:(0,u.A)("custom-scroll",q,ve&&"is-need-premium"),onScroll:pe,onClick:M||ne?void 0:function(){M||ne||F&&ve||we({chatId:n,messageListType:Ae})},children:(0,J.FD)("div",{className:ot,children:[(0,J.Y)("div",{ref:Ie,id:j||s.CfG,className:nt,contentEditable:M||ne,role:"textbox",dir:"auto",spellCheck:!l.Vq&&void 0,tabIndex:0,onClick:We,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ue("<br>"===t?"":t),!c.TF&&(!n||!n.length)&&(c.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(Ie.current.blur(),e.removeAllRanges(),(0,g.A)(Ie.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=Q();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void Ce({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Xe,{once:!0}):(e.preventDefault(),ye()):!Ve&&("enter"===ce&&!e.shiftKey||"ctrl-enter"===ce&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),Ee(),me())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout(()=>{Te.current=!1},100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Te.current||(Te.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",Xe,{once:!0})},onContextMenu:c.Ni?function(e){Qe()&&(Ke(!Ue),Ue?Ee():(e.preventDefault(),e.stopPropagation(),Ze()))}:void 0,onTouchCancel:c.Ni?Xe:void 0,"aria-label":it,onFocus:ve?void 0:ge,onBlur:ve?void 0:fe}),!te&&(0,J.FD)("span",{className:(0,u.A)("placeholder-text",!M&&!ne&&"with-icon",ve&&"is-need-premium"),dir:"auto",children:[!M&&!ne&&(0,J.Y)(U.A,{name:"lock-badge",className:"placeholder-icon"}),je?(0,J.Y)(z.A,{langKey:X,endsAt:ee,onEnd:$e}):Z,F&&ve&&(0,J.Y)(K.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:et,children:Fe("StoryRepliesLockedButton")})]}),(0,J.Y)("canvas",{ref:ke,className:"shared-canvas"}),(0,J.Y)("canvas",{ref:Ye,className:"shared-canvas"}),(0,J.Y)("div",{ref:Pe,className:"absolute-video-container"})]})}),(0,J.Y)("div",{ref:Ne,className:(0,u.A)("custom-scroll",q,"clone",ve&&"is-need-premium"),children:(0,J.Y)("div",{className:ot,children:(0,J.Y)("div",{ref:Me,className:(0,u.A)(nt,"clone"),dir:"auto"})})}),void 0!==d&&(0,J.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,J.Y)($,{isOpen:De,anchorPosition:Le,selectedRange:Re,setSelectedRange:Oe,onClose:_e}),te&&(0,J.Y)("span",{className:"forced-placeholder",children:(0,v.A)(te)})]})}))},79882:(e,t,n)=>{n.d(t,{I:()=>i,W:()=>s});var o=n(84051);let i=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function s(e){return(0,o.Kr)(()=>{const t=Object.values(e),n=t.filter(e=>e<0).length,o=t.filter(e=>e>0).length;return t=>{const s=e[t];return 0===s?i.None:s===1/0||s===-1/0||n<=o&&s<0||o<n&&s>0?i.Opacity:i.Move}},[e])}},80477:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(90709),a=n(91048),r=n(4961),d=n(59030),l=n(80999),c=n(20021);const u=(0,o.ph)((0,i.EK)((e,{typingStatus:t})=>t.userId?{typingUser:(0,a.mBe)(e,t.userId)}:{typingUser:void 0})(({typingStatus:e,typingUser:t})=>{const n=(0,d.A)(),o=t&&!t.isSelf&&(0,s.u0)(t),i=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return(0,c.FD)("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto",children:[o&&(0,c.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(o)}),(0,c.Y)(l.A,{content:i})]})}))},80999:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(87357),i=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,o.A)("DotAnimation",t),dir:n.isRtl?"rtl":"auto",children:[(0,i.A)(e),(0,a.Y)("span",{className:"ellipsis"})]})}},81524:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(90709),s=n(87357),a=n(17663),r=n(83868),d=n(35749),l=n(2338),c=n(37661),u=n(5912),h=n(17712),m=n(62587),p=n(83057),g=n(27860),f=n(20021);const v=(0,o.ph)(({message:e,idPrefix:t="shared-media",isProtected:n,observeIntersection:v,onClick:A})=>{const y=(0,o.li)(),C=(0,u.Vz)(y,v),w=(0,l.A)(e),b=(0,d.A)(e,"pictogram"),I=(0,m.A)(b,!C),S=(0,p.A)(I),M=(0,i.zX)(e),N=(0,i.y2)(e),[k,,Y]=(0,c.A)(N),P=(0,h.A)(()=>{Y(),A(e.id,e.chatId)});return(0,f.FD)("div",{ref:y,id:`${t}${(0,i.GZ)(e.id)}`,className:"Media scroll-item",onClick:A?P:void 0,children:[(0,f.Y)("img",{src:w,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.A:void 0}),(0,f.Y)("img",{src:I,className:(0,s.A)("full-media","media-miniature",S),alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.A:void 0}),N&&(0,f.Y)(g.A,{thumbDataUri:I||w,isVisible:k,className:"media-spoiler"}),M&&(0,f.Y)("span",{className:"video-duration",children:M.isGif?"GIF":(0,a.QO)(M.duration)}),n&&(0,f.Y)("span",{className:"protector"})]})})},81642:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(87357),s=n(17663),a=n(59030),r=n(45),d=n(20021);const l=(0,o.ph)(({className:e,message:t,outgoingStatus:n,draftDate:o})=>{const l=(0,a.A)(),c=o&&o>t.date;return(0,d.FD)("div",{className:(0,i.A)("LastMessageMeta",e),children:[n&&!c&&(0,d.Y)(r.A,{status:n}),(0,d.Y)("span",{className:"time",children:(0,s.be)(l,1e3*(c?o:t.date))})]})})},84313:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(13439),s=n(96454),a=n(17712),r=n(59030);const d=8e3;function l(e,t,n){const{showNotification:l}=(0,i.ko)(),c=(0,r.A)(),[u,h]=(0,o.J0)(!1),m=(0,a.A)(()=>{h(!0),t||l({message:s.yS?c("Video.Unsupported.Mobile"):c("Video.Unsupported.Desktop"),duration:d})}),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,o.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:()=>T});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(53827),d=n(87357),l=n(17663),c=n(41733),u=n(76023),h=n(2338),m=n(63988),p=n(37661),g=n(5912),f=n(17712),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),b=n(18276),I=n(27860),S=n(64493),M=n(65843),N=n(35913),k=n(20021);const Y=u.Wd/2,P=2*(Y-6)*Math.PI;let F;const T=({message:e,className:t,canAutoLoad:n,isDownloading:T,origin:D,observeIntersection:x,onStop:E,onReadMedia:L,isTranscriptionError:B,isTranscribed:R,canTranscribe:O,onHideTranscription:U,isTranscriptionHidden:K,isTranscribing:z})=>{const V=(0,o.li)(),j=(0,o.li)(),J=(0,o.li)(),{cancelMediaDownload:$,openOneTimeMediaModal:q,transcribeAudio:H}=(0,i.ko)(),G=(0,g.Vz)(V,x),W=e.content.video,_=e.isMediaUnread,[Q,Z]=(0,o.J0)(n),X=Boolean(Q&&G),{mediaData:ee,loadProgress:te}=(0,A.A)((0,a.sC)(W,"inline"),!X,(0,a.Cz)(W,"inline")),{loadProgress:ne}=(0,A.A)((0,a.sC)(W,"download"),!T,s.qZ.BlobUrl),[oe,ie]=(0,p.A)(),se=(0,a.G5)(e),ae="oneTimeModal"===D,re=se&&!ae,de=(0,h.A)(e),le=!Boolean(de)||oe||re,ce=(0,w.A)(W,le);(0,v.A)({hasMediaData:!le,ref:ce});const ue=Q&&!oe||T,he=!1===(0,y.A)(Q),{ref:me,shouldRender:pe}=(0,C.A)({isOpen:ue,noMountTransition:he,withShouldRender:!0}),[ge,fe]=(0,o.J0)(!1),[ve,Ae]=(0,o.J0)(0),[ye,Ce]=(0,o.Ul)(0),we=(0,m.aG)(ye,16);(0,o.vJ)(()=>{if(!ge)return;const e=j.current;Ce(e.currentTime/e.duration)},[Ce,ge,we]),(0,o.Nf)(()=>{if(!ge||!J.current)return;const e=P-we()*P;J.current.setAttribute("stroke-dashoffset",e.toString())},[ge,we]);const be=Boolean(ee&&G),Ie=(0,f.A)(()=>{j.current&&(fe(!1),Ce(0),(0,c.A)(j.current))}),Se=(0,f.A)(()=>{F?.(),F=Ie}),Me=(0,f.A)(()=>{const e=j.current;ge?e.paused?((0,c.A)(e),(0,r._K)()):e.pause():(Se(),e.pause(),e.currentTime=0,(0,c.A)(e),(0,r._K)(),fe(!0))});(0,o.vJ)(()=>{ae&&Me()},[ae]);const Ne=(0,f.A)(t=>{if(!t.target.closest(".transcribe-button"))if(ee){if(!T)return se&&!ae?(q({message:e}),void L?.()):void Me();$({media:W})}else Z(e=>!e)});(0,o.vJ)(()=>{L&&_&&ge&&L()},[ge,_,L]);const ke=(0,f.A)(e=>{const t=e.currentTarget;Ce(t.currentTime/t.duration),Ae(Math.floor(t.currentTime))}),Ye=(0,f.A)(()=>{H({chatId:e.chatId,messageId:e.id})}),Pe=(0,f.A)(()=>{(R||B)&&U?U(!K):z||Ye()});return(0,k.FD)("div",{ref:V,className:(0,d.A)("RoundVideo","media-inner",ae&&"non-interactive",t),onClick:Ne,children:[ee&&(0,k.FD)("div",{className:"video-wrapper",children:[re&&(0,k.Y)(I.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,k.Y)(M.A,{canPlay:be,ref:j,src:ee,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!re,disablePictureInPicture:!0,muted:!ge,defaultMuted:!0,loop:!ge,playsInline:!0,isPriority:!0,onEnded:ge?E??Ie:void 0,onTimeUpdate:ge?ke:void 0,onReady:ie})]}),!re&&(0,k.Y)("canvas",{ref:ce,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,k.Y)("div",{className:"progress",children:ge&&(0,k.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,k.Y)("circle",{ref:J,cx:Y,cy:Y,r:Y-6,className:"progress-circle",transform:`rotate(-90, ${Y}, ${Y})`,"stroke-dasharray":P,"stroke-dashoffset":P})})}),pe&&(0,k.Y)("div",{ref:me,className:"media-loading",children:(0,k.Y)(N.A,{progress:T?ne:te})}),re&&!pe&&(0,k.FD)("div",{className:"play-wrapper",children:[(0,k.Y)(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,children:(0,k.Y)(b.A,{name:"play"})}),(0,k.Y)(b.A,{name:"view-once"})]}),!ee&&!Q&&(0,k.Y)(b.A,{name:"download"}),!ae&&(0,k.FD)("div",{className:(0,d.A)("message-media-duration",_&&"unread"),children:[ge?(0,l.QO)(ve):(0,l.QO)(W.duration),(!ge||j.current.paused)&&(0,k.Y)(b.A,{name:"muted"})]}),O&&(0,k.FD)(S.A,{onClick:Pe,className:"transcribe-button",children:[R||B?(0,k.Y)(b.A,{name:"down"}):(0,k.Y)(b.A,{name:"transcribe"}),z&&(0,k.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,k.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]})}},85449:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(31481),i=n(98607),s=n(4961),a=n(18276),r=n(20021);function d(e,t){return"receipt"===t.type?e("PaymentReceipt"):"buy"===t.type?(0,i.i)(t.text,o.Cyx,(0,r.Y)(a.A,{className:"star-currency-icon",name:"star"})):(0,s.A)(t.text)}},87970:(e,t,n)=>{n.d(t,{A:()=>se});var o=n(84051),i=n(89925),s=n(90709),a=n(13439),r=n(91048),d=n(30708),l=n(96454),c=n(87357),u=n(95807),h=n(50442),m=n(79824),p=n(31460),g=n(4961),f=n(41385),v=n(54699),A=n(39351),y=n(17712),C=n(59030),w=n(73767),b=n(47483),I=n(23174),S=n(58554),M=n(41036),N=n(21849),k=n(34431),Y=n(18276),P=n(38102),F=n(9716),T=n(14242),D=n(35049),x=n(43874),E=n(45470),L=n(37661),B=n(62587),R=n(83057),O=n(65843),U=n(57474),K=n(20021);const z=(0,o.ph)(({chat:e,user:t,photo:n,isSavedMessages:i,isSavedDialog:a,canPlayVideo:r,className:d,style:u,onClick:h})=>{const m=(0,o.li)(),p=(0,A.A)(),{isMobile:f}=(0,x.Ay)(),v=t&&(0,s.PL)(t),y=e&&(0,s.kE)(e.id),C=e&&(0,s.Qe)(e.id),w=t||e,b=w&&!i&&!v&&!y&&!C,{isVideo:I}=n||{},S=(!n||n.id===w.avatarPhotoId)&&(0,s.cP)(w,"normal"),M=b&&n&&!S&&(0,s.rI)(n,"pictogram"),N=(0,B.A)(M||S),k=b&&n&&!I&&(0,s.mU)(n),P=(0,B.A)(k),z=b&&n&&I&&(0,s.Pg)(n),V=(0,B.A)(z)||P,[j,J]=(0,L.A)(),$=Boolean(V&&(!I||j)),q=(0,R.A)($),H=b&&!$&&!N&&n?.thumbnail?.dataUri,G=(0,E.A)(n?.thumbnail?.dataUri,!H,f&&!l.QH),W=n||N||H;(0,o.vJ)(()=>{m.current&&!r&&(m.current.currentTime=0)},[r]);const _=(0,o.Kr)(()=>i?a?"my-notes":"avatar-saved-messages":v?"avatar-deleted-account":y?"reply-filled":C?"author-hidden":void 0,[C,v,a,y,i]);let Q;if(_)Q=(0,K.Y)(Y.A,{name:_,role:"img"});else if(W)Q=(0,K.FD)(K.FK,{children:[H?(0,K.Y)("canvas",{ref:G,className:"thumb"}):(0,K.Y)("img",{src:N,draggable:!1,className:"thumb",alt:""}),n&&(I?(0,K.Y)(O.A,{canPlay:r,ref:m,src:V,className:(0,c.A)("avatar-media",q),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:J}):(0,K.Y)("img",{src:V,draggable:!1,className:(0,c.A)("avatar-media",q),alt:""}))]});else if(t){const e=(0,s.Yg)(t);Q=e?(0,T.Qh)(e,2):void 0}else if(e){const t=(0,s.Js)(p,e);Q=t&&(0,T.Qh)(t,(0,F.L8)(e.id)?2:1)}else Q=(0,K.Y)("div",{className:"spinner-wrapper",children:(0,K.Y)(U.A,{color:"white"})});const Z=(0,c.A)("ProfilePhoto",(0,D.y)(w),i&&"saved-messages",C&&"anonymous-forwards",v&&"deleted-account",y&&"replies-bot-account",!i&&!W&&"no-photo",d);return(0,K.Y)("div",{className:Z,onClick:W?h:void 0,style:u,children:"string"==typeof Q?(0,g.A)(Q,["hq_emoji"]):Q})});var V=n(43336),j=n(66833),J=n(76023),$=n(95773),q=n(82855);const H=2*J.$,G=[{x:-.2,y:-.3},{x:.3,y:.1},{x:-.4,y:-.1},{x:.4,y:-.1},{x:-.25,y:.1},{x:.25,y:-.25}],W=({gift:e,style:t,className:n,withGlow:i,peerId:s})=>{const{openGiftInfoModal:r}=(0,a.ko)(),d=(0,o.li)(),l=(0,o.Kr)(()=>(0,j.uc)(e.gift),[e]),c=(0,y.A)(()=>{r({peerId:s,gift:e})});if(l?.model&&l.backdrop)return(0,K.Y)($.A,{withSparkles:!0,sparklesColor:l.backdrop.textColor,glowColor:i?l.backdrop.edgeColor:void 0,ref:d,className:n,style:t,onClick:c,children:(0,K.Y)(q.A,{containerRef:d,sticker:l.model.sticker,size:H,withTranslucentThumb:!0,noPlay:!0})})},_=(0,o.ph)(({peerId:e,gifts:t,isExpanded:n,className:o,withGlow:i})=>{const{createVtnStyle:s}=(0,f.k)();if(t)return(0,K.Y)("div",{className:(0,c.A)("dspICZx5",o),children:t.slice(0,G.length).map((t,o)=>{const a=n?function(e){return{x:(0,V.qE)(1.5*e.x,-.45,.45),y:(0,V.qE)(1.5*e.y,-.45,.45)}}(G[o]):G[o],r=(0,u.A)(`top: ${100*(.5+a.y)}%`,`left: ${100*(.5+a.x)}%`);return(0,K.Y)(W,{peerId:e,className:"GtRefNqT",gift:t,style:(0,u.A)(r,s(`profilePinnedGift${o}`,"profilePinnedGift")),withGlow:i},t.gift.id)})})});var Q=n(40558);const Z="eZ2DGNou",X="ldzIKEUp",ee="uNvH08Qp",te="UZ7NDj8N",ne="Yr9FHqbF",oe="XxRtPe_4",ie="eFsZljMG",se=(0,o.ph)((0,a.EK)((e,{peerId:t})=>{const n=(0,r.PVB)(e,t),o=(0,r.mBe)(e,t),i=o?(0,r.vGo)(e,t):void 0,s=(0,r.K0y)(e,t),a=(0,r.hds)(e,t),l=(0,r.IVq)(e,t),{mediaIndex:c,chatId:u}=(0,r.nTw)(e).mediaViewer,h=a?.isForum,{threadId:m}=(0,r.Xf0)(e)||{},p=h&&m?(0,r.S0q)(e,t,m):void 0,{animationLevel:g}=(0,d.l)(e),f=n?.emojiStatus,v=f?(0,r.O8F)(e,f.documentId):void 0,A="collectible"===f?.type?f.slug:void 0,y=n&&(0,r.Vi6)(e,n),C=(0,r.SJA)(e),w=(0,r.c7s)(e,t),b=(0,r.FDg)(e,t);return{user:o,userFullInfo:i,userStatus:s,chat:a,mediaIndex:c,avatarOwnerId:u,animationLevel:g,emojiStatusSticker:v,emojiStatusSlug:A,emojiStatus:f,profilePhotos:l,topic:p,messagesCount:p?(0,r.QbG)(e,t,m):void 0,profileColorOption:y,theme:C,isPlain:!w,savedGifts:b}})(({isExpanded:e,isForSettings:t,canPlayVideo:n,user:r,userFullInfo:d,userStatus:F,chat:T,mediaIndex:D,avatarOwnerId:x,topic:E,messagesCount:L,animationLevel:B,emojiStatus:R,emojiStatusSticker:O,emojiStatusSlug:U,profilePhotos:V,peerId:j,isForMonoforum:J,profileColorOption:$,theme:q,isPlain:H,savedGifts:G})=>{const{openMediaViewer:W,openPremiumModal:se,openStickerSet:ae,openPrivacySettingsNoticeModal:re,loadMoreProfilePhotos:de,openUniqueGiftBySlug:le,openProfileRatingModal:ce,loadPeerSavedGifts:ue}=(0,a.ko)(),he=(0,C.A)(),me=(0,A.A)();(0,v.A)(r?6e4:void 0);const{createVtnStyle:pe}=(0,f.k)(),ge=V?.photos||m.p,fe=(0,w.A)(D),ve=(0,w.A)(x),[Ae,ye]=(0,o.J0)(!0),[Ce,we]=(0,o.J0)(0),be=ge.length<=1||0===Ce,Ie=ge.length<=1||Ce===ge.length-1,Se="collectible"===R?.type?R:void 0,Me=r||T,{customEmoji:Ne}=(0,b.A)(Se?.patternDocumentId||Me?.profileColor?.backgroundEmojiId),ke=(0,o.Kr)(()=>{if(Se)return{bgColors:[Se.centerColor,Se.edgeColor],storyColors:[Se.textColor,Se.textColor]};const e=$&&("dark"===q?$.darkColors:$.colors);return e?{bgColors:[...e.bgColors].reverse(),storyColors:[...e.storyColors].reverse()}:void 0},[$,q,Se]),Ye=(0,o.Kr)(()=>G?.gifts.filter(e=>"starGiftUnique"===e.gift.type?e.isPinned&&e.gift.slug!==Se?.slug:e.isPinned),[G,Se?.slug]);(0,o.vJ)(()=>{ge.length-Ce<=3&&de({peerId:j})},[Ce,j,ge.length]),(0,o.vJ)(()=>{ue({peerId:j})},[j]),(0,o.vJ)(()=>{ve&&void 0!==fe&&void 0===D&&(ye(!1),we(fe))},[D,fe,ve]),(0,o.vJ)(()=>{Ce>ge.length&&(ye(!1),we(Math.max(0,ge.length-1)))},[Ce,ge.length]),(0,o.vJ)(()=>{e||we(0)},[e]),function(e,t){(0,o.vJ)(()=>{e.slice(t,t+4).forEach(e=>{const t=(0,s.mU)(e);S.Ih(t)||S.hd(t,I.qZ.BlobUrl)})},[t,e])}(ge,Ce);const Pe=(0,y.A)(()=>{W({isAvatarView:!0,chatId:j,mediaIndex:Ce,origin:t?i.TQ.SettingsAvatar:i.TQ.ProfileAvatar})}),Fe=(0,y.A)(()=>{U?le({slug:U}):j?se({fromUserId:j}):ae({stickerSetInfo:O.stickerSetInfo})}),Te=(0,y.A)(()=>{be||(ye(!0),we(Ce-1))}),De=(0,y.A)(()=>{Ie||(ye(!0),we(Ce+1))}),xe=(0,y.A)(()=>{re({chatId:T.id,isReadDate:!1})}),Ee=(0,y.A)(e=>{r&&ce({userId:r.id,level:e})});if((0,o.vJ)(()=>{const e=document.querySelector(`.${te}`);if(e)return(0,h.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:l.TF?(e,t)=>t===h.ez.Right?(Te(),!0):t===h.ez.Left&&(De(),!0):void 0})},[De,Te]),r||T)return E?(0,K.FD)("div",{className:"dNcezQH8",children:[(0,K.Y)(P.A,{topic:E,size:120,className:"YwVcTLvK",letterClassName:"_sQEevF7",noLoopLimit:!0}),(0,K.Y)("h3",{className:"hjk4U031",dir:me.isRtl?"rtl":void 0,children:(0,g.A)(E.title)}),(0,K.Y)("p",{className:"GXxwbzqF",children:L?he("Chat.Title.Topic",L,"i"):he("lng_forum_no_messages")})]}):(0,K.FD)("div",{className:(0,c.A)("ProfileInfo","Z_HM0Jqg",!e&&"blI_IH7j",H&&"YIhgPXW6"),style:(0,u.A)(ke&&`--rating-outline-color: ${e?"transparent":ke?.bgColors[1]}`,ke&&!e&&`--rating-text-color: ${ke?.bgColors[1]}`,pe("profileInfo",!0)),dir:me.isRtl?"rtl":void 0,children:[ke?.bgColors&&(0,K.Y)(Q.A,{backgroundColors:ke.bgColors,patternIcon:Ne,patternColor:Se?.patternColor||"#000000",className:"BvunKb6r",patternSize:.75,patternOpacity:Se?1:.75}),Ye&&(0,K.Y)(_,{peerId:j,gifts:Ye,isExpanded:e,className:"JX3wjADD",withGlow:!H}),e&&(0,K.FD)("div",{className:te,style:pe("photoWrapper",!0),children:[function(){const e=Math.max(ge.length,V?.count||0);if(!ge||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=Ce>=30?29:Ce;return(0,K.Y)("div",{className:"e7iOf_3T",children:t.map((e,t)=>(0,K.Y)("span",{className:(0,c.A)("eD0Is6TL",t===n&&"MSdiAM06")}))})}(),!t&&V?.personalPhoto&&(0,K.Y)("div",{className:(0,c.A)(Z,be&&ee),children:(0,K.Y)("div",{className:X,children:he(V.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),t&&V?.fallbackPhoto&&(0,K.Y)("div",{className:(0,c.A)(Z,(be||Ie)&&ee),children:(0,K.FD)("div",{className:X,onClick:function(){be&&(ye(!0),we(ge.length-1))},children:[!Ie&&(0,K.Y)(N.A,{photo:V.fallbackPhoto,className:"a9OwsvOP",size:"mini"}),he(V.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,K.Y)(M.Ay,{activeKey:Ce,name:(0,p.P)("slide",B,!Ae,me.isRtl),children:function(e){const t=ge.length>0?ge[Ce]:void 0;return(0,K.Y)(z,{user:r,chat:T,photo:t,canPlayVideo:Boolean(e&&n),className:(0,c.A)(e&&"yltXKQri"),style:e?pe("avatar",!0):void 0,onClick:Pe},Ce)}}),!be&&(0,K.Y)("button",{type:"button",dir:me.isRtl?"rtl":void 0,className:(0,c.A)(ne,"Z1ZX2xot"),"aria-label":he("AccDescrPrevious"),onClick:Te}),!Ie&&(0,K.Y)("button",{type:"button",dir:me.isRtl?"rtl":void 0,className:(0,c.A)(ne,"X0stLWTl"),"aria-label":he("Next"),onClick:De})]}),!e&&(0,K.Y)(N.A,{withStory:!0,storyColors:ke?.storyColors,className:"rLHO_VQT",size:"jumbo",peer:Me,style:pe("avatar",!0),onClick:t?Pe:void 0},Me?.id),(0,K.FD)("div",{className:"ZFBuRDGK",dir:me.isRtl?"rtl":"auto",style:pe("info",!0),children:[(r||T)&&(0,K.Y)(k.A,{className:"atYgxkWV",style:pe("title",!0),peer:r||T,withEmojiStatus:!0,withStatusTextColor:!0,emojiStatusSize:24,onEmojiStatusClick:Fe,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,s.Qe)(j),t=(0,s.DX)(j);if(!e&&!t)return J?(0,K.Y)("span",{className:(0,c.A)(oe,"status"),dir:"auto",style:pe("status",!0),children:me("MonoforumStatus")}):r?(0,K.FD)("div",{className:(0,c.A)(oe,"status",(0,s.PF)(r,F)&&"online"),style:pe("status",!0),children:[Le(),(0,K.Y)("span",{className:"F4JyLH2c",dir:"auto",children:(0,s.CD)(he,r,F)}),F?.isReadDateRestrictedByMe&&(0,K.Y)("span",{className:"wCXGPPTY",onClick:xe,children:(0,K.Y)("span",{children:he("StatusHiddenShow")})})]}):(0,K.Y)("span",{className:(0,c.A)(oe,"status"),dir:"auto",style:pe("status",!0),children:(0,s.WX)(T)?he("Subscribers",T.membersCount??0,"i"):he("Members",T.membersCount??0,"i")})}()]})]});function Le(){if(!d?.starsRating)return;const e=d.starsRating.level,t=()=>Ee(e);if(e<0)return(0,K.FD)("span",{role:"button",tabIndex:0,className:"vuUzgWI1",onClick:t,children:[(0,K.Y)(Y.A,{name:"rating-icons-negative",className:"JZBCjHv0"}),(0,K.Y)("span",{className:ie,children:"!"})]});const n=Math.max(e,1),o=Math.min(n,90),i=o<10?`rating-icons-level${o}`:"rating-icons-level"+10*Math.floor(o/10);return(0,K.FD)("span",{role:"button",tabIndex:0,className:"P6tsZMON",onClick:t,children:[(0,K.Y)(Y.A,{name:i,className:"Yvu9iM5n"}),(0,K.Y)("span",{className:ie,children:e})]})}}))},88792:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(91048),r=n(53827),d=n(49642),l=n(80853),c=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,o.li)(),[N,k]=(0,o.J0)(!1);let Y=N;const[P,F]=(0,o.J0)(0),T=(0,u.A)(()=>{k(!1),y&&y()});(0,h.A)(()=>{if(!e)return;M.current=(0,r.kz)(e,n,(e,o)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:r,proxy:l}=M.current;k(!0),"oneTimeVoice"!==n&&(0,d.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:o,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:d,isFirst:l,isLast:c}=e.current;t={play:()=>{n(a.src)},pause:()=>{o()},stop:()=>{o(),s(0),(0,i.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(a.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(a.currentTime+t,a.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},c()||(t.nexttrack=()=>{r()}),l()||(t.previoustrack=()=>{d()})}return t}(M)),(0,d.HW)("playing");const{audioPlayer:c}=(0,a.nTw)((0,i.mS)());e(c.volume),r(Boolean(c.isMuted));const u=l.duration&&Number.isFinite(l.duration)?l.duration:t;("voice"===n||u>s.CVm)&&o(c.playbackRate),(0,d.hm)({duration:l.duration||0,playbackRate:l.playbackRate,position:l.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,d.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":k(!1),(0,d.HW)("paused"),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,d.HW)("paused")}p?.[e]?.(o)}},A,T);const{proxy:o}=M.current;N||o.paused||(k(!0),Y=!0),f&&!S&&f(o)},[e]),(0,o.vJ)(()=>{N&&g&&(0,d.D5)(g)},[g,N]);const{play:D,pause:x,setCurrentTime:E,proxy:L,destroy:B,setVolume:R,stop:O,isFirst:U,isLast:K,requestNextTrack:z,requestPreviousTrack:V,setPlaybackRate:j,toggleMuted:J}=M.current??{},$=(0,o.Kr)(()=>L?.duration&&Number.isFinite(L.duration)?L.duration:t,[L?.duration,t]);(0,o.vJ)(()=>{L&&(I&&0===L.currentTime||!$||(0,l.f)(L)||w||F(L.currentTime/$))},[$,P,L,w,I]),(0,o.vJ)(()=>()=>{B?.(C)},[B,C]),(0,c.A)(([e,t])=>{e===v&&m===t||L?.src&&L?.paused||v&&m&&!N&&D?.(m)},[v,m,N,D,L?.src,L?.paused,n]);const q=(0,u.A)(()=>{m&&D?.(m)}),H=(0,u.A)(()=>{N?x?.():q()}),G=(0,u.A)(e=>{E?.(e),$&&L&&F(L.currentTime/$)});return{isPlaying:Y,playProgress:P,playPause:H,pause:x,play:q,stop:O,setCurrentTime:G,setVolume:R,audioProxy:L,duration:$,requestNextTrack:z,requestPreviousTrack:V,isFirst:U,isLast:K,setPlaybackRate:j,toggleMuted:J}}},89755:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.41c911dd9e2bbe20c518.js"},89873:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(17712),a=n(34201),r=n(59030),d=n(71429),l=n(24433),c=n(60859),u=n(20021);const h=(0,o.ph)(({isOpen:e,sponsorInfo:t,canReport:n,anchor:i,triggerRef:a,shouldSkipAbout:h,onClose:m,onCloseAnimationEnd:p,onAboutAdsClick:g,onSponsoredHide:f,onSponsorInfo:v,onSponsoredReport:A})=>{const y=(0,o.li)(),C=(0,r.A)(),w=(0,s.A)(()=>a.current),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)(d.A,{ref:y,isOpen:e,anchor:i,withPortal:!0,className:"with-menu-transitions",getLayout:b,getTriggerElement:w,getMenuElement:I,getRootElement:S,onClose:m,onCloseAnimationEnd:p,children:[t&&v&&(0,u.Y)(l.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!h&&(0,u.Y)(l.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(l.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(c.A,{}),(0,u.Y)(l.A,{icon:"close-circle",onClick:f,children:C("HideAd")})]})}),m=(0,o.ph)(({isOpen:e,randomId:t,sponsorInfo:n,additionalInfo:o,canReport:r,anchor:d,triggerRef:l,shouldSkipAbout:c,onItemClick:m,onClose:p,onCloseAnimationEnd:g})=>{const{openAboutAdsModal:f,showDialog:v,reportSponsored:A,hideSponsored:y}=(0,i.ko)(),{ref:C}=(0,a.A)({isOpen:e,onCloseAnimationEnd:g}),w=(0,s.A)(()=>{m?.(),p()}),b=(0,s.A)(()=>{f({randomId:t,additionalInfo:o,canReport:r,sponsorInfo:n}),w()}),I=(0,s.A)(()=>{y(),w()}),S=(0,s.A)(()=>{v({data:{message:[n,o].filter(Boolean).join("\n")}}),w()}),M=(0,s.A)(()=>{A({randomId:t}),w()});if(d)return(0,u.Y)("div",{ref:C,className:"ContextMenuContainer",children:(0,u.Y)(h,{isOpen:e,anchor:d,triggerRef:l,canReport:r,sponsorInfo:n,shouldSkipAbout:c,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:b,onSponsoredHide:I,onSponsorInfo:S,onSponsoredReport:M})})})},90054:(e,t,n)=>{n.d(t,{A:()=>W});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),l=n(91048),c=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 D={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 x=n(20021);const E=7*F.$,L=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,l.hds)(e,t),o=n&&(n.isCreator||(0,d.ub)(n,"manageTopics"));return{animatedEmoji:(0,l.oei)(e,"🐣"),canManageTopics:o}})(({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:s}=(0,i.ko)(),a=(0,C.A)(),{isMobile:r}=(0,g.Ay)(),d=(0,o.hb)(()=>{s({chatId:e})},[e,s]);return(0,x.FD)("div",{className:D.root,children:[(0,x.Y)("div",{className:D.sticker,children:t&&(0,x.Y)(T.A,{sticker:t,size:E})}),(0,x.Y)("h3",{className:D.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,x.Y)("p",{className:(0,u.A)(D.description,D.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,x.Y)(k.A,{ripple:!r,fluid:!0,onClick:d,isRtl:a.isRtl,children:(0,x.Y)("div",{className:D.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})}));var B=n(27109),R=n(66414),O=n(4961),U=n(37661),K=n(53188),z=n(87894),V=n(81642),j=n(38102),J=n(94189),$=n(22720),q=n(97046),H=n(24807);const G=(0,o.ph)((0,i.EK)((e,{chatId:t,topic:n,isSelected:o})=>{const i=(0,l.hds)(e,t),s=(0,l.O5q)(e,t,n.lastMessageId),{isOutgoing:a}=s||{},r=s&&(0,l.Y7C)(e,s),d=(0,l.C5H)(e,t,n.id,"typingStatus"),c=(0,l.GA4)(e,t,n.id),u=(0,l.Vw0)(e,t,n.id),h=Boolean(u?.lastReadInboxMessageId),m=(0,l.pSx)(e,t),{chatId:p,threadId:g}=(0,l.Xf0)(e)||{},f=s?.content.storyData,v=f&&(0,l.Msb)(e,f.peerId,f.id);return{chat:i,lastMessage:s,lastMessageSender:r,typingStatus:d,isChatMuted:i&&(0,B.If)(i,(0,l.K52)(e),(0,l.P5N)(e,i.id)),canDelete:(0,l.DBV)(e,t,n.id),withInterfaceAnimations:(0,l.PKK)(e),draft:c,...a&&s&&{lastMessageOutgoingStatus:(0,l.Tl2)(e,s)},canScrollDown:o&&i?.id===p&&g===n.id,wasTopicOpened:h,topics:m,lastMessageStory:v}})(({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:r,style:l,lastMessage:h,lastMessageStory:m,canScrollDown:p,lastMessageOutgoingStatus:g,observeIntersection:f,canDelete:v,lastMessageSender:A,animationType:w,withInterfaceAnimations:b,orderDiff:I,typingStatus:S,draft:N,wasTopicOpened:k,topics:Y})=>{const{openThread:P,deleteTopic:F,focusLastMessage:T,setViewForumAsMessages:D,updateTopicMutedState:E}=(0,i.ko)(),L=(0,C.A)(),[B,G,W]=(0,U.A)(),[_,Q,Z]=(0,U.A)(),[X,ee,te]=(0,U.A)(),[ne,oe,ie]=(0,U.A)(),{isPinned:se,isClosed:ae,notifySettings:re}=e,de=Boolean(re.mutedUntil||void 0===re.mutedUntil&&r),le=(0,y.A)(()=>{ee(),G()}),ce=(0,y.A)(()=>{F({chatId:s.id,topicId:e.id})}),ue=(0,y.A)(()=>{oe(),Q()}),he=(0,y.A)(()=>{E({chatId:n,topicId:e.id,mutedUntil:a.Os5})}),{renderSubtitle:me,ref:pe}=(0,K.A)({chat:s,chatId:n,lastMessage:h,draft:N,lastMessageSender:A,lastMessageTopic:e,observeIntersection:f,isTopic:!0,typingStatus:S,topics:Y,statefulMediaContent:(0,d.FE)({story:m}),animationType:w,withInterfaceAnimations:b,orderDiff:I}),ge=(0,y.A)(()=>{P({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),D({chatId:n,isEnabled:!1}),p&&T()}),fe=function({topic:e,chat:t,isChatMuted:n,wasOpened:s,canDelete:a,handleDelete:r,handleMute:l,handleUnmute:u}){const h=(0,C.A)();return(0,o.Kr)(()=>{const{isPinned:o,notifySettings:m,isClosed:p,id:g}=e,f=t.id,{editTopic:v,toggleTopicPinned:A,markTopicRead:y,openChatInNewTab:C}=(0,i.ko)(),w=(0,d.l1)(t,e),b=t.isCreator||(0,d.ub)(t,"manageTopics"),I=c.OS&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{C({chatId:t.id,threadId:g})}},S=e.unreadCount||!s?{title:h("MarkAsRead"),icon:"readchats",handler:()=>{y({chatId:f,topicId:g})}}:void 0,M=b?o?{title:h("UnpinFromTop"),icon:"unpin",handler:()=>A({chatId:f,topicId:g,isPinned:!1})}:{title:h("PinToTop"),icon:"pin",handler:()=>A({chatId:f,topicId:g,isPinned:!0})}:void 0,N=n&&void 0===m.mutedUntil||m.mutedUntil?{title:h("ChatList.Unmute"),icon:"unmute",handler:u}:{title:`${h("ChatList.Mute")}...`,icon:"mute",handler:l},k=w?p?{title:h("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>v({chatId:f,topicId:g,isClosed:!1})}:{title:h("lng_forum_topic_close"),icon:"close-topic",handler:()=>v({chatId:f,topicId:g,isClosed:!0})}:void 0,Y=a?{title:h("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:r}:void 0;return(0,z.oE)([I,M,S,N,k,Y])},[e,t,n,s,h,a,r,l,u])}({topic:e,chat:s,isChatMuted:r,wasOpened:k,canDelete:v,handleDelete:le,handleMute:ue,handleUnmute:he});return(0,x.FD)($.A,{className:(0,u.A)("Fn34Vu_9","Chat",t&&"selected","chat-item-clickable"),onClick:ge,style:l,href:c.OS?`#${(0,R.az)(n,"thread",e.id)}`:void 0,contextActions:fe,withPortalForMenu:!0,ref:pe,children:[(0,x.FD)("div",{className:"info",children:[(0,x.FD)("div",{className:"info-row",children:[(0,x.FD)("div",{className:(0,u.A)("title"),children:[(0,x.Y)(j.A,{topic:e,className:"oXJl4tra",observeIntersection:f}),(0,x.Y)("h3",{dir:"auto",className:"fullName",children:(0,O.A)(e.title)})]}),Boolean(re.mutedUntil)&&(0,x.Y)(M.A,{name:"muted"}),(0,x.Y)("div",{className:"separator"}),ae&&(0,x.Y)(M.A,{name:"lock-badge",className:"MB7Gomjn"}),h&&(0,x.Y)(V.A,{message:h,outgoingStatus:g})]}),(0,x.FD)("div",{className:"subtitle",children:[me(),(0,x.Y)(H.A,{chat:s,isPinned:se,isMuted:de,topic:e,wasTopicOpened:k,topics:Y})]})]}),X&&(0,x.Y)(J.A,{isOpen:B,onClose:W,onCloseAnimationEnd:te,confirmIsDestructive:!0,confirmHandler:ce,text:L("lng_forum_topic_delete_sure"),confirmLabel:L("Delete")}),ne&&(0,x.Y)(q.A,{isOpen:_,onClose:Z,onCloseAnimationEnd:ie,chatId:n,topicId:e.id})]})})),W=(0,o.ph)((0,i.EK)(e=>{const t=(0,l.nTw)(e).forumPanelChatId,n=t?(0,l.hds)(e,t):void 0,{chatId:o,threadId:i}=(0,l.Xf0)(e)||{},s=t?(0,l.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===o?Number(i):void 0,withInterfaceAnimations:(0,l.PKK)(e),topicsInfo:s}},e=>(0,l.clw)(e))(({chat:e,currentTopicId:t,isOpen:n,isHidden:l,topicsInfo:F,onTopicSearch:T,onCloseAnimationEnd:D,onOpenAnimationStart:E,withInterfaceAnimations:B})=>{const{closeForumPanel:R,openChatWithInfo:O,loadTopics:U}=(0,i.ko)(),K=(0,o.li)(),z=(0,o.li)(),V=(0,o.li)(),{isMobile:j}=(0,g.Ay)(),J=e?.id;(0,o.vJ)(()=>{J&&!F&&U({chatId:J})},[F,J]);const[$,q]=(0,o.J0)(!1),H=(0,C.A)(),W=(0,y.A)(()=>{R()});(0,o.vJ)(()=>{B||n||D?.()},[B,n,D]);const _=(0,y.A)(()=>{e&&O({id:e.id,shouldReplaceHistory:!0})}),{observe:Q}=(0,A.BL)({rootRef:z,throttleMs:200});(0,A.mv)(V,Q,({isIntersecting:e})=>{q(!e)});const Z=(0,o.Kr)(()=>F?(0,d.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),oe=(0,o.li)(!1),ie=n&&!l,se=(0,w.A)(ie);se!==ie&&(oe.current=!1),(0,f.A)({isActive:ie,onBack:W}),(0,o.vJ)(()=>ie?(0,h.A)(W):void 0,[W,ie]),(0,o.vJ)(()=>{se!==ie&&(0,r.Uz)(()=>{if(!K.current)return;const e=(0,o.VK)();(0,p.j)(K.current,e),E?.(),ie?(oe.current=!0,K.current.style.transform="none"):(oe.current=!1,K.current.style.transform="")})},[ie,E,se]),(0,o.vJ)(()=>{if(c.TF)return(0,m.wJ)(K.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(H.isRtl?m.ez.Left:m.ez.Right)&&(R(),!0)})},[R,H.isRtl]);const ae=void 0===F;return(0,x.FD)("div",{ref:K,className:(0,u.A)("MlF2n1nb",$&&"SZ24u3cn",H.isRtl&&"Xs2y1fCE",!B&&"kmDMv6D8"),onTransitionEnd:n?void 0:D,children:[(0,x.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,x.Y)(k.A,{round:!0,size:"smaller",color:"translucent",onClick:W,ariaLabel:H("Close"),children:(0,x.Y)(M.A,{name:"close"})}),e&&(0,x.Y)(S.A,{noAvatar:!0,className:"Sf633zAP",chatId:e.id,onClick:_}),e&&(0,x.Y)(N.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:j,onTopicSearch:T})]}),e&&(0,x.Y)(I.A,{chatId:e.id}),(0,x.Y)("div",{className:"hGeb3TQJ"}),(0,x.FD)(Y.A,{className:"chat-list custom-scroll",ref:z,items:te,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(Z?.length||0)*a.HGU,onLoadMore:ne,sensitiveArea:a.C$_,beforeChildren:(0,x.Y)("div",{ref:V,className:"ERz3fcar"}),children:[Boolean(te?.length)&&function(){const n=Z.indexOf(te[0]);return te?.map((o,i)=>(0,x.Y)(G,{chatId:e.id,topic:F.topicsById[o],style:`top: ${(n+i)*a.HGU}px;`,isSelected:t===o,observeIntersection:Q,animationType:ee(o),orderDiff:X[o]},o))}(),ae&&!te?.length&&(0,x.Y)(P.A,{},"loading")]}),!ae&&1===te?.length&&te[0]===a.HxB&&(0,x.Y)(L,{chatId:J})]})}))},90423:(e,t,n)=>{n.d(t,{Ay:()=>r,j9:()=>c,zk:()=>d});var o=n(84051),i=n(63495),s=n(96454);const a=l();function r(e,t,n){const[i,r]=(0,o.J0)(Boolean(a&&document[a]));return(0,o.Nf)(()=>{const o=e.current,i=()=>{const e=Boolean(a&&document[a]);r(e),e?n?.(!1):t?.(!1),o instanceof HTMLVideoElement&&(o.controls=e)},s=()=>{r(!0),n&&n(!0)},d=()=>{r(!1),t&&t(!1)};return document.addEventListener("fullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),o&&(o.addEventListener("webkitbeginfullscreen",s,!1),o.addEventListener("webkitendfullscreen",d,!1)),()=>{document.removeEventListener("fullscreenchange",i,!1),document.removeEventListener("webkitfullscreenchange",i,!1),document.removeEventListener("mozfullscreenchange",i,!1),o&&(o.removeEventListener("webkitbeginfullscreen",s,!1),o.removeEventListener("webkitendfullscreen",d,!1))}},[]),a||s.pz?[i,()=>{var t;e.current&&(a||s.pz)&&!i&&((t=e.current).requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen(),r(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),r(!1))}]:[!1]}const d=()=>{const[e,t]=(0,o.J0)(!1);return(0,o.vJ)(()=>{const e=()=>{t(c())};let n;return i.Vq&&(window.tauri?.getCurrentWindow().then(e=>{e.isFullscreen().then(t)}),(async()=>{const e=await(window.tauri?.getCurrentWindow());n=await e.onResized(()=>{e.isFullscreen().then(t)})})()),document.addEventListener("fullscreenchange",e,!1),document.addEventListener("webkitfullscreenchange",e,!1),document.addEventListener("mozfullscreenchange",e,!1),()=>{n?.(),document.removeEventListener("fullscreenchange",e,!1),document.removeEventListener("webkitfullscreenchange",e,!1),document.removeEventListener("mozfullscreenchange",e,!1)}},[]),e};function l(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function c(){const e=l();return Boolean(e&&document[e])}},90596:(e,t,n)=>{n.d(t,{A:()=>jn});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(70636),c=n(26129),u=n(91048),h=n(56494),m=n(30708),p=n(63495),g=n(96454),f=n(87357),v=n(9716),A=n(60343),y=n(80140),C=n(83868),w=n(41512),b=n(76023),I=n(35049),S=n(4961),M=n(58734);function N(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 k=n(43336),Y=n(35127);function P(e,t){return e.reduce((e,t)=>e+t,t)}function F(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 T(e,t,n,o){const i=function(e,t,n){const o=e[0].isOutgoing,i=(t?e[0].content.paidMedia.extendedMedia.map(e=>"mediaType"in e?e:e.photo||e.video):e.map(e=>(0,d.r_)(e).photo||(0,d.r_)(e).video)).filter(Boolean);return i.map(e=>{const t=(0,Y.yA)({media:e,isOwn:o,isMobile:n});return t.width/t.height})}(n.messages,Boolean(n.isPaidMedia),o),s=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(i),a=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(i),r=i.length,l=i.some(e=>e>2),c=(0,b.w4)(e,!1,t,o);let u;const h={ratios:i,proportions:s,averageRatio:a,maxWidth:c,minWidth:100,maxHeight:c,spacing:2};return u=r>=5||l?function({ratios:e,averageRatio:t,maxWidth:n,minWidth:o,spacing:i,maxHeight:s=4*n/3}){const a=function(e,t){return e.map(e=>t>1.1?(0,k.qE)(e,1,2.75):(0,k.qE)(e,.6667,1))}(e,t),r=e.length,d=new Array(r),l=[],c=e=>{const t=[];let o=0;e.forEach(e=>{t.push(((e,t)=>{const o=P(a.slice(e,e+t),0);return(n-(t-1)*i)/o})(o,e)),o+=e}),l.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&c([e,t])}for(let e=1;e!==r-1;++e)for(let n=1;n!==r-e;++n){const o=r-e-n;e<=3&&n<=(t<.85?4:3)&&o<=3&&c([e,n,o])}for(let e=1;e!==r-1;++e)for(let t=1;t!==r-e;++t)for(let n=1;n!==r-e-t;++n){const o=r-e-t-n;e<=3&&t<=3&&n<=3&&o<=4&&c([e,t,n,o])}let u,h=0;for(let e=0;e<l.length;e++){const{heights:t,lineCounts:n}=l[e],a=n.length,r=P(t,0)+i*(a-1),d=Math.min(...t)<o?1.5:1,c=(()=>{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),m=Math.abs(r-s)*d*c;(!u||m<h)&&(u=l[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],o=p[e],s=Math.round(o);let r=0;for(let l=0;l!==t;++l){const c=0|(0===e?1:0)|(e===g-1?4:0)|(0===l?8:0)|(l===t-1?2:0),u=a[f],h=l===t-1?n-r:Math.round(u*o);d[f]={dimensions:{x:r,y:v,width:h,height:s},sides:c},r+=h+i,++f}v+=s+i}return d}(h):2===r?function(e){const{ratios:t,proportions:n,averageRatio:o}=e;return"ww"===n&&o>1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(i-o)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+o,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=(n-o)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],i)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+o,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:o,spacing:i,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(o-i),(o-i)/t[0]/(1/t[0]+1/t[1]))),o-i-a),d=o-r-i,l=Math.min(s,Math.round(Math.min(d/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:d,height:l},sides:13},{dimensions:{x:d+i,y:0,width:r,height:l},sides:7}]}(e)}(h):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:o,maxWidth:i,minWidth:s}=e,a=t,r=Math.round(Math.min((t-n)/2,o[1]*(i-n)/(o[2]+o[1]))),d=a-r-n,l=Math.max(s,Math.round(Math.min((i-n)/2,Math.min(r*o[2],d*o[1])))),c=Math.min(Math.round(a*o[0]),i-n-l);return[{dimensions:{x:0,y:0,width:c,height:a},sides:13},{dimensions:{x:c+n,y:0,width:l,height:d},sides:3},{dimensions:{x:c+n,y:d+n,width:l,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:o,spacing:i}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(o-i))),r=(t-i)/2,d=Math.min(o-a-i,Math.round(Math.min(r/n[1],r/n[2])));return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+i,width:r,height:d},sides:12},{dimensions:{x:r+i,y:a+i,width:s-r-i,height:d},sides:6}]}(e)}(h):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:n,maxHeight:o,minWidth:i}){const s=e,a=Math.round(Math.min(s/t[0],.66*(o-n))),r=Math.round((e-2*n)/(t[1]+t[2]+t[3])),d=Math.max(i,Math.round(Math.min(.4*(e-2*n),r*t[1]))),l=Math.round(Math.max(Math.max(i,.33*(e-2*n)),r*t[3])),c=s-d-l-2*n,u=Math.min(o-a-n,r);return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+n,width:d,height:u},sides:12},{dimensions:{x:d+n,y:a+n,width:c,height:u},sides:4},{dimensions:{x:d+n+c+n,y:a+n,width:l,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:n,spacing:o,minWidth:i}){const s=e,a=Math.round(Math.min(s*t[0],.6*(n-o))),r=Math.round((e-2*o)/(1/t[1]+1/t[2]+1/t[3])),d=Math.round(r/t[1]),l=Math.round(r/t[2]),c=s-d-l-2*o,u=Math.max(i,Math.min(n-a-o,r));return[{dimensions:{x:0,y:0,width:a,height:s},sides:13},{dimensions:{x:a+o,y:0,width:u,height:d},sides:3},{dimensions:{x:a+o,y:d+o,width:u,height:l},sides:2},{dimensions:{x:a+o,y:d+l+2*o,width:u,height:c},sides:6}]}(e)}(h),{layout:u,containerStyle:F(u)}}var D=n(43874),x=n(10722),E=n(49746),L=n(21488),B=n(37661),R=n(5912),O=n(39351),U=n(17712),K=n(59030),z=n(73767),V=n(14622),j=n(34201),J=n(9705),$=n(5130);let q;const H=new J.A;g.CM&&setTimeout(function(){q||(q=(0,$.U)(new Worker(new URL(n.p+n.u(520),n.b))),H.resolve())},4e3);var G=n(84947),W=n(37836);const _=new Map;const Q=(0,W.nF)(function(e){const{updateChatDetectedLanguage:t}=(0,i.ko)(),n=_.get(e);if(!n)return;const o=n.size;if(o<8)return;let s=0,a=0;const r=new Map;for(const e of n.values()){e.isTranslatable&&s++,e.detectedLanguage&&a++;const t=e.detectedLanguage;if(t){const e=r.get(t)||0;r.set(t,e+1)}}if(s/o<.3||a/s<.6)return;t({chatId:e,detectedLanguage:Array.from(r.entries()).sort(([,e],[,t])=>t-e)[0][0]})},1e3);var Z=n(79519),X=n(46275),ee=n(64154),te=n(66644),ne=n(50442),oe=n(43503),ie=n(54464),se=n(672);const ae=3*b.$,re=Number(b.$),de="data-is-document-group-hover";function le(e,t,n,s,a,r,d,l,c,u,h,m,p){const{updateDraftReplyInfo:f,sendDefaultReaction:v}=(0,i.ko)(),[A,y,w]=(0,B.A)(),[b,I,S]=(0,B.A)(),M=(0,o.li)(),N=(0,se.A)(e=>{const t=h.current;if(!t)return;const{clientX:n,clientY:o}=e,{x:i,width:s,y:a,height:r}=t.getBoundingClientRect(),d=i+s/2,l=a+r/2,c=Math.abs(d-n)<ae,u=Math.abs(l-o)<re;c&&u?y():w()},[h],te.YS);return(0,o.vJ)(()=>{if(!g.TF||s||!a||u||!p?.())return;let e;return(0,ne.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===ne.ez.Left&&(e||(e=Date.now()),I(),!0),onRelease:()=>{e&&a&&(f({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})},[t,s,n,I,S,a,u,p]),{handleMouseDown:s?void 0:function(e){(0,ie.l)(e),l(e)},handleClick:function(t){if(s)e(t);else if(g.TF)return M.current?(clearInterval(M.current),M.current=void 0,void v({chatId:c,messageId:n})):void(M.current=setTimeout(()=>{M.current=void 0,function(e){if(g.Ni){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;oe.A.getIsKeyboardVisible()?setTimeout(()=>{d(e)},350):d(e)}}(t)},200))},handleContextMenu:s?r?C.A:void 0:function(t){if(g.Ni){if(t.target.matches("a[href]")||u)return;t.preventDefault(),e()}else d(t)},handleDoubleClick:s?void 0:function(){!g.TF&&a&&f({replyToMsgId:n,replyToPeerId:void 0,quoteText:void 0,quoteOffset:void 0})},handleContentDoubleClick:g.TF?void 0:function(e){e.stopPropagation()},handleMouseMove:N,handleSendQuickReaction:function(e){e.stopPropagation(),v({chatId:c,messageId:n})},handleMouseLeave:function(e){(0,te.YS)(w),m&&function(e){const t=ue(e.currentTarget);t&&t.removeAttribute(de)}(e)},isSwiped:b,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:ce}}function ce(e){const t=ue(e.currentTarget);t&&t.setAttribute(de,"")}function ue(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var he=n(65240),me=n(21849),pe=n(87412),ge=n(55723),fe=n(80999),ve=n(91930),Ae=n(11217),ye=n(62587),Ce=n(18276),we=n(86070),be=n(20021);function Ie(e,t){const{width:n,height:o}=(0,b.mr)();return(0,be.FD)("div",{className:"embedded-thumb",children:[(0,be.Y)("img",{src:e,width:n,height:o,alt:"",className:"pictogram",draggable:!1}),t&&(0,be.Y)("span",{className:"protector"})]})}const Se=({story:e,sender:t,noUserColors:n,isProtected:s,observeIntersectionForLoading:a,onClick:r})=>{const{showNotification:c}=(0,i.ko)(),u=(0,K.A)(),h=(0,o.li)(),m=(0,R.Vz)(h,a),p=e&&"content"in e,g=e&&"isDeleted"in e,v=p&&Boolean(e.content.video),A=p?"Story":g?"ExpiredStory":"Loading",y=(0,ye.A)(p&&(0,d.EN)(e,"pictogram"),!m),C=v?e.content.video.thumbnail?.dataUri:void 0,w=y||C,b=t?(0,l.F9)(u,t):void 0,I=(0,U.A)(()=>{e&&!g?r():c({message:u("StoryNotFound")})}),{handleClick:M,handleMouseDown:N}=(0,Ae.Q)(I);return(0,be.FD)(we.A,{ref:h,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,f.A)("EmbeddedMessage",w&&"with-thumb"),onClick:M,onMouseDown:N,children:[w&&Ie(w,s),(0,be.FD)("div",{className:"message-text with-message-color",children:[(0,be.FD)("p",{className:"embedded-text-wrapper",children:[g&&(0,be.Y)(Ce.A,{name:"story-expired",className:"embedded-origin-icon"}),p&&(0,be.Y)(Ce.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,be.Y)("div",{className:"message-title",children:(0,S.A)(b||" ")})]})]})};var Me=n(2578),Ne=n(9267),ke=n(74936),Ye=n(17794),Pe=n(90603),Fe=n(38102);var Te=n(61911);const De=1.125*b.$,xe=(0,o.ph)(({topic:e,className:t,onClick:n})=>{const o=(0,K.A)();return(0,be.FD)("div",{className:(0,f.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Pe.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,be.Y)(Fe.A,{topic:e,size:De}):(0,be.Y)("img",{src:Te,alt:"",draggable:!1}),e?.title?(0,S.A)(e.title):o("Loading"),e?.isClosed&&(0,be.Y)(Ce.A,{name:"lock"}),(0,be.Y)(Ce.A,{name:"next"})]})});var Ee=n(15006),Le=n(64493),Be=n(94189),Re=n(40664);function Oe(e){return(0,o.ph)((0,i.EK)((e,t)=>{const{clickArg:n,noSelectControls:o}=t;return{isInSelectMode:!o&&(0,u.rTV)(e),isSelected:!o&&(0,u.H1_)(e,n)}})(t=>{const{isInSelectMode:n,isSelected:s,dimensions:a,clickArg:r}=t,{toggleMessageSelection:d}=(0,i.ko)(),l=(0,U.A)(e=>{e.stopPropagation(),d({messageId:r,withShift:e?.shiftKey})}),c=(0,o.Kr)(()=>{const{dimensions:e,onClick:o}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:o}},[t,n,s]);return(0,be.FD)("div",{className:(0,f.A)("album-item-select-wrapper",s&&"is-selected"),style:a?`left: ${a.x}px; top: ${a.y}px;`:"",onClick:n?l:void 0,children:[n&&(0,be.Y)("div",{className:"message-select-control",children:s&&(0,be.Y)(Ce.A,{name:"select"})}),(0,be.Y)(e,{...c})]})}))}var Ue=n(51644),Ke=n(25477);const ze=Oe(Ue.A),Ve=Oe(Ke.A),je=(0,i.EK)(e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}})(({album:e,observeIntersection:t,hasCustomAppendix:n,isOwn:s,isProtected:a,albumLayout:r,onMediaClick:l,uploadsByKey:c,activeDownloads:h,theme:m})=>{const{cancelUploadMedia:p}=(0,i.ko)(),{content:{paidMedia:g}}=e.mainMessage,f=e.isPaidMedia?g.extendedMedia.length:e.messages.length,v=(0,U.A)(t=>{l(e.mainMessage.id,t)}),y=(0,U.A)(e=>{l(e)}),C=(0,U.A)(t=>{p({chatId:e.mainMessage.chatId,messageId:t})}),w=(0,o.Kr)(()=>e.isPaidMedia?e.mainMessage.content.paidMedia.extendedMedia.map(()=>e.mainMessage):e.messages,[e]),{width:b,height:I}=r.containerStyle;return(0,be.Y)("div",{className:"Album",style:`width: ${b}px; height: ${I}px;`,children:w.map(function(o,l){const p=e.isPaidMedia?o.content.paidMedia?.extendedMedia[l]:void 0,g=p&&"mediaType"in p?p:p?.photo,w=p&&"mediaType"in p?p:p?.video,b=g||(0,d.yl)(o),I=w||(0,d.r_)(o).video,S=c[(0,A.bj)(o)],M=S?.progress,{dimensions:N,sides:k}=r.layout[l],Y=(0,u.wwb)((0,i.mS)(),o),P=(0,u.OEt)((0,i.mS)(),o);if(b){const i=n&&(s?l===f-1:Boolean(8&k&&4&k));return(0,be.Y)(ze,{id:`album-media-${(0,d.GZ)(o.id,e.isPaidMedia?l:void 0)}`,photo:b,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:Y,shouldAffectAppendix:i,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?l:o.id,onClick:e.isPaidMedia?v:y,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,d.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})}if(I)return(0,be.Y)(Ve,{id:`album-media-${(0,d.GZ)(o.id)}`,video:I,observeIntersectionForLoading:t,canAutoLoad:Y,canAutoPlay:P,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?l:o.id,onClick:e.isPaidMedia?v:y,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,d.$r)(h,I),theme:m,noSelectControls:e.isPaidMedia})})})});var Je=n(95807),$e=n(41733);const qe=7*b.$;function He(e,t,n,s,a,r,d){const{interactWithAnimatedEmoji:l,sendEmojiInteraction:c,sendWatchingEmojiInteraction:u}=(0,i.ko)(),h=(0,o.li)(),m=(0,o.li)(),g=(0,ye.A)(n?`document${n}`:void 0,!n),f=d||qe,v=(0,Je.A)(`width: ${f}px`,`height: ${f}px`,r&&!p.Vq&&"cursor: pointer"),A=(0,o.li)(void 0),y=(0,o.li)(void 0),C=(0,U.A)(()=>{h.current&&(c({chatId:e,messageId:t,emoji:r,interactions:A.current}),y.current=void 0,A.current=void 0)}),w=(0,U.A)(()=>{const e=m.current;g&&(e&&(e.pause(),e.remove()),m.current=new Audio,m.current.src=g,(0,$e.A)(m.current),m.current.addEventListener("ended",()=>{m.current=void 0},{once:!0}))}),b=(0,U.A)(()=>{w();const n=h.current;if(!(r&&n&&t&&e))return;const{x:o,y:i}=n.getBoundingClientRect();l({emoji:r,x:o,y:i,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,o.vJ)(()=>{const n=h.current;n&&s&&s.forEach(({id:o,startSize:i,messageId:s})=>{if(i||t!==s)return;const{x:d,y:l}=n.getBoundingClientRect();u({id:o,chatId:e,emoticon:r,startSize:f,x:d,y:l,isReversed:!a}),w()})},[s,e,r,a,t,w,u,f]),{ref:h,size:f,style:v,handleClick:b}}const Ge=(0,o.ph)((0,i.EK)((e,{customEmojiId:t,withEffects:n})=>{const o=(0,u.O8F)(e,t);return{sticker:o,effect:o?.emoji&&n?(0,u.Nr8)(e,o.emoji):void 0,soundId:o?.emoji&&(0,u.tKM)(e,o.emoji),noPlay:!(0,u.BWX)(e)}})(({isOwn:e,customEmojiId:t,messageId:n,chatId:o,activeEmojiInteractions:i,sticker:s,effect:a,soundId:r,noPlay:d,observeIntersection:l})=>{const{ref:c,size:u,style:h,handleClick:m}=He(o,n,r,i,e,a?.emoji,(0,M.Rr)(1));return(0,be.Y)(pe.A,{ref:c,documentId:t,className:(0,f.A)("AnimatedEmoji media-inner",s?.id===b.AC&&"like-sticker-thumb"),style:h,size:u,isBig:!0,noPlay:d,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(a&&i?.length),observeIntersectionForLoading:l,onClick:m})}));var We=n(79577);const _e=(0,o.ph)((0,i.EK)((e,{emoji:t,withEffects:n})=>({sticker:(0,u.oei)(e,t),effect:n?(0,u.Nr8)(e,t):void 0,soundId:(0,u.tKM)(e,t)}))(({isOwn:e,observeIntersection:t,forceLoadPreview:n,messageId:o,chatId:i,activeEmojiInteractions:s,sticker:a,effect:r,soundId:d})=>{const{ref:l,size:c,style:u,handleClick:h}=He(i,o,d,s,e,r?.emoji),m=(0,R.Vz)(l,t);return(0,be.Y)(We.A,{sticker:a,size:c,quality:1,noLoad:!m,forcePreview:n,play:m,forceAlways:!0,ref:l,className:(0,f.A)("AnimatedEmoji media-inner",a?.id===b.AC&&"like-sticker-thumb"),style:u,onClick:h})}));var Qe=n(14242),Ze=n(93809),Xe=n(68292),et=n(57474);const tt=(0,o.ph)(({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s,asActionButton:a})=>{const{openThread:r,openFrozenAccountModal:d}=(0,i.ko)(),l=(0,Ze.A)([s],450),c=(0,K.A)(),h=(0,O.A)(),{originMessageId:m,chatId:p,messagesCount:g,lastMessageId:v,lastReadInboxMessageId:A,recentReplierIds:y,originChannelId:C}=t,w=(0,U.A)(()=>{const e=(0,i.mS)();(0,u.trm)(e)?d():r({isComments:!0,chatId:p,originMessageId:m,originChannelId:C})}),b=(0,o.Kr)(()=>{if(!y?.length)return;const e=(0,i.mS)();return y.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[y]);if(void 0===g)return;const I=Boolean(A&&v&&A<v),S=g?c("CommentsCount","%COMMENTS_COUNT%",void 0,g).split("%").map(e=>"COMMENTS_COUNT"===e?(0,be.Y)(Xe.A,{text:(0,Qe.Vw)(h,g)}):e):void 0;return(0,be.FD)("div",{"data-cnt":(0,Qe.Vw)(h,g),className:(0,f.A)("CommentButton",I&&"has-unread",n&&"disabled",e&&"CommentButton-custom-shape",s&&"loading",a&&"as-action-button"),dir:c.isRtl?"rtl":"ltr",onClick:w,role:"button",tabIndex:0,children:[(0,be.Y)(Ce.A,{name:"comments-sticker",className:(0,f.A)("CommentButton_icon-comments",s&&l&&"CommentButton_hidden")}),!b?.length&&(0,be.Y)(Ce.A,{name:"comments"}),Boolean(b?.length)&&(0,be.Y)("div",{className:"recent-repliers",dir:c.isRtl?"rtl":"ltr",children:b.map(e=>(0,be.Y)(me.A,{size:"small",peer:e},e.id))}),(0,be.Y)("div",{className:"label",dir:"auto",children:g?S:c("LeaveAComment")}),(0,be.FD)("div",{className:"CommentButton_right",children:[s&&(0,be.Y)(et.A,{className:(0,f.A)("CommentButton_loading",!l&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,be.Y)(Ce.A,{name:"next",className:(0,f.A)("CommentButton_icon-open",s&&l&&"CommentButton_hidden")})]})]})});var nt=n(85982),ot=n(64713);const it="ReDHhQHm";function st(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const at=(0,i.EK)((e,{contact:t})=>{const{countryList:{phoneCodes:n}}=e;return{user:(0,u.mBe)(e,t.userId),phoneCodeList:n}})(({contact:e,user:t,phoneCodeList:n,noUserColors:o})=>{const s=(0,K.A)(),{openChat:a,openAddContactDialog:r,showNotification:l,openChatWithInfo:c}=(0,i.ko)(),{phoneNumber:u,userId:h}=e,m="0"!==h,p=m&&t&&(0,d.Gh)(t),g=(0,U.A)(()=>{a({id:h})}),f=(0,U.A)(()=>{r({userId:t?.id})}),v=(0,U.A)(()=>{t?c({id:h}):((0,nt.eM)(u),l({message:s("PhoneCopied")}))});return(0,be.FD)(we.A,{noUserColors:o,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,be.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,be.Y)(me.A,{size:"medium",peer:t,text:st(e)}),(0,be.FD)("div",{className:"fpYynE5s",children:[(0,be.Y)("div",{className:"_PNTJc_V",children:t?(0,d.Yg)(t):st(e)}),(0,be.Y)("div",{className:"JP_3wes8",children:(0,ot.Ox)(n,u)})]})]}),m&&(0,be.FD)(be.FK,{children:[(0,be.Y)("div",{className:"_OSJcuqH"}),(0,be.FD)("div",{className:"Blui4M4G",children:[(0,be.Y)(Le.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:it,children:s("SharedContactMessage")}),p&&(0,be.Y)(Le.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:it,children:s("SharedContactAdd")})]})]})]})});var rt=n(80089),dt=n(80464);const lt=e=>{const{isOpen:t}=e,n=(0,dt.A)(rt.ar.Extra,"ContextMenuContainer",!t);return n?(0,be.Y)(n,{...e}):void 0};var ct=n(18501),ut=n(57675),ht=n(32581);const mt={color:0},pt=(0,o.ph)(({factCheck:e,isToggleDisabled:t})=>{const n=(0,K.A)(),i=(0,o.li)(),s=(0,o.li)(),{isCollapsed:a,isCollapsible:r,setIsCollapsed:d}=(0,ut.A)(i,4,s),l=(0,o.Kr)(()=>{if(e.countryCode&&n.code)return new Intl.DisplayNames([n.code],{type:"region"}).of(e.countryCode)},[e.countryCode,n.code]),c=!t&&a,u=(0,U.A)(()=>{d(!1)}),h=(0,U.A)(()=>{d(e=>!e)});if(e.text)return(0,be.FD)(we.A,{peerColor:mt,className:"HMB5LgeX",onClick:c?u:void 0,children:[(0,be.FD)("div",{ref:s,className:(0,f.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,be.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,be.Y)("div",{ref:i,className:"k_dGolcu",children:(0,ct.fd)({text:e.text.text,entities:e.text.entities})}),(0,be.Y)(ht.A,{className:"qRaSs5iA"}),(0,be.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",l)})]}),r&&(0,be.Y)("div",{className:(0,f.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:h,"aria-hidden":!0,children:(0,be.Y)(Ce.A,{name:a?"down":"up"})})]})});var gt=n(55158);const ft=(0,o.ph)(({message:e,threadId:t,canAutoLoadMedia:n})=>{const{clickBotInlineButton:o}=(0,i.ko)(),s=e.content.game,{title:a,description:r}=s,l=(0,d.zb)(s),c=(0,d.ih)(s),u=(0,ye.A)(l,!n),h=(0,ye.A)(c,!n);return(0,be.FD)("div",{className:"Game",children:[(0,be.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{o({chatId:e.chatId,messageId:e.id,threadId:t,button:e.inlineButtons[0][0]})},children:[!u&&!h&&(0,be.Y)(gt.A,{className:"skeleton preview-content"}),u&&(0,be.Y)("img",{className:"preview-content",src:u,alt:a,draggable:!1}),h&&(0,be.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:h})]}),(0,be.Y)("div",{className:"title",children:a}),!(0,d.P5)(e)&&(0,be.Y)("div",{className:"description",children:r})]})});var vt=n(17663),At=n(52491),yt=n(4875),Ct=n(58443),wt=n(64489),bt=n(10187);const It="ogvcv3mr",St="MSFa9BPf",Mt="HfZ6SuLI",Nt="rPyyNYxK",kt="FV70u896",Yt=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{giveaway:n}=t.content,o=(0,u.hds)(e,t.chatId);return{chat:o,sender:(n?.channelIds[0]?(0,u.hds)(e,n.channelIds[0]):void 0)||(0,u.Szq)(e,t)||o,giftSticker:n&&(0,u.t0O)(e,n.months),canPlayAnimatedEmojis:(0,u.BWX)(e)}})(({chat:e,sender:t,message:n,canPlayAnimatedEmojis:s,giftSticker:a})=>{const{openChat:r}=(0,i.ko)(),c=(0,o.li)(!1),[u,h]=(0,o.J0)(),m=(0,K.A)(),{giveaway:p,giveawayResults:g}=n.content,v=Boolean(g),{months:A,untilDate:C,prizeDescription:w,stars:b}=p||g,I=(0,d.Ie)(n),M=v?g.winnersCount:p.quantity,N=(0,y.Fm)()>C,k=(0,o.Kr)(()=>{if(v)return;const e=new Intl.DisplayNames([m.code,"en"].filter(Boolean),{type:"region"});return p?.countries?.map(t=>`${(0,At.D0)(t)} ${e.of(t)}`).join(", ")},[p,v,m.code]),Y=(0,U.A)(e=>{r({id:e})}),P=(0,U.A)(async()=>{if(c.current)return;c.current=!0;const t=await(0,yt.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});h(t),c.current=!1}),F=(0,U.A)(()=>{h(void 0)}),T=(0,o.Kr)(()=>{if(u)return m("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")},[u,m]);return(0,be.FD)("div",{className:"CbpKtOey",children:[(0,be.FD)("div",{className:(0,f.A)("hjjKhvVv",v&&"JEiR48jJ"),children:[v?(0,be.Y)(wt.A,{size:150,tgsUrl:Ct.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,be.Y)(We.A,{sticker:a,play:s&&N,noLoop:!0,nonInteractive:!0,size:175}),(0,be.Y)("span",{className:"n_QCMv_A",children:`x${M}`})]}),v?function(e){const t=e.winnerIds;return(0,be.FD)(be.FK,{children:[(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:It,children:(0,S.A)(m("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,S.A)(m("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,be.Y)("strong",{className:It,children:m("lng_prizes_results_winners")}),(0,be.Y)("div",{className:Nt,children:t.map(e=>(0,be.Y)(bt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!I,className:kt,clickArg:e,onClick:Y}))})]}),(0,be.Y)("div",{className:St,children:(0,be.Y)("p",{className:Mt,children:m("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(g):function(e){const t=e.channelIds;return(0,be.FD)(be.FK,{children:[(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:It,children:(0,S.A)(m("BoostingGiveawayPrizes"),["simple_markdown"])}),w&&(0,be.FD)(be.FK,{children:[(0,be.Y)("p",{className:Mt,children:(0,S.A)(m("BoostingGiveawayMsgPrizes",[M,w],void 0,M),["simple_markdown"])}),(0,be.Y)(ht.A,{children:m("BoostingGiveawayMsgWithDivider")})]}),(0,be.Y)("p",{className:Mt,children:n?.content?.giveaway?.stars?(0,be.FD)(be.FK,{children:[(0,S.A)(m("Chat.Giveaway.Message.Stars.PrizeText",m("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,be.Y)("br",{}),(0,S.A)(m("AmongWinners",M),["simple_markdown"])]}):(0,be.FD)(be.FK,{children:[(0,S.A)(m("Chat.Giveaway.Info.Subscriptions",M),["simple_markdown"]),(0,be.Y)("br",{}),(0,S.A)(m("ActionGiftPremiumSubtitle",m("Chat.Giveaway.Info.Months",A)),["simple_markdown"])]})})]}),(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:It,children:(0,S.A)(m("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,S.A)(m("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,be.Y)("div",{className:Nt,children:t.map(e=>(0,be.Y)(bt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!I,className:kt,clickArg:e,onClick:Y}))}),k&&(0,be.Y)("span",{children:(0,S.A)(m("Chat.Giveaway.Message.CountriesFrom",k))})]}),(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:It,children:(0,S.A)(m("BoostingWinnersDate"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,vt.L2)(1e3*C,m.code,!0)})]})]})}(p),(0,be.Y)(Le.A,{className:"jMBw7STU",color:"adaptive",onClick:P,children:m("BoostingHowItWork")}),(0,be.Y)(Be.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:T,confirmHandler:F,onClose:F,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,l.vj)(t)?(0,d.Js)(m,t):(0,d.Yg)(t),o=(0,vt.U)(m,1e3*C),s=p?.channelIds?p.channelIds.length-1:0,a=m("Chat.Giveaway.Info.OtherChannels",s),r=s>0,c=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",h=e?m("Chat.Giveaway.Info.Months",A):m("Stars",b,"i"),g=m(c,[n,M,h],void 0,M),f=w?m("BoostingGiveawayHowItWorksIncludeText",[n,M,w],void 0,M):void 0;let v="";v=e?r?"BoostingGiveawayHowItWorksSubTextSeveralEnd":"BoostingGiveawayHowItWorksSubTextEnd":r?"BoostingGiveawayHowItWorksSubTextSeveral":"BoostingGiveawayHowItWorksSubText";let y=m(v,[o,M,n,s],void 0,M);e&&u.activatedCount&&(y+=` ${m("BoostingGiveawayUsedLinksPlural",u.activatedCount)}`);let I="";e&&(I=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,i.mS)().chats.byId[u.adminDisallowedChatId],t=e&&(0,d.Js)(m,e);N=m("BoostingGiveawayNotEligibleAdmin",t)}else if(u.joinedTooEarlyDate){const e=(0,vt.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,o]):m("Chat.Giveaway.Info.NotQualified",[n,o]);return(0,be.FD)(be.FK,{children:[I&&(0,be.Y)("p",{className:"ZQ4aVVkI",children:(0,S.A)(I,["simple_markdown"])}),(0,be.Y)("p",{children:(0,S.A)(g,["simple_markdown"])}),f&&(0,be.Y)("p",{children:(0,S.A)(f,["simple_markdown"])}),(0,be.Y)("p",{children:(0,S.A)(y,["simple_markdown"])}),N&&(0,be.Y)("p",{children:(0,S.A)(N,["simple_markdown"])})]})}()})]})}));var Pt=n(85449);const Ft=(0,o.ph)(({message:e,onClick:t})=>{const n=(0,K.A)(),i=e=>{const{type:t}=e;switch(t){case"url":if(!r.OFc.test(e.url))return(0,be.Y)(Ce.A,{className:"corner-icon",name:"arrow-right"});break;case"urlAuth":return(0,be.Y)(Ce.A,{className:"corner-icon",name:"arrow-right"});case"buy":case"receipt":return(0,be.Y)(Ce.A,{className:"corner-icon",name:"card"});case"switchBotInline":return(0,be.Y)(Ce.A,{className:"corner-icon",name:"share-filled"});case"webView":case"simpleWebView":return(0,be.Y)(Ce.A,{className:"corner-icon",name:"webapp"});case"copy":return(0,be.Y)(Ce.A,{className:"corner-icon",name:"copy"});case"suggestedMessage":if("suggestChanges"===e.buttonType)return(0,be.Y)(Ce.A,{className:"left-icon",name:"edit"});if("approve"===e.buttonType)return(0,be.Y)(Ce.A,{className:"left-icon",name:"check"});if("decline"===e.buttonType)return(0,be.Y)(Ce.A,{className:"left-icon",name:"close"})}},s=(0,o.Kr)(()=>{const t=[];return e.inlineButtons.forEach(e=>{t.push(e.map(e=>(0,Pt.A)(n,e)))}),t},[n,e.inlineButtons]);return(0,be.Y)("div",{className:"InlineButtons",children:e.inlineButtons.map((n,o)=>(0,be.Y)("div",{className:"row",children:n.map((n,a)=>(0,be.FD)(Le.A,{size:"tiny",ripple:!0,disabled:"unsupported"===n.type||"suggestedMessage"===n.type&&n.disabled,onClick:()=>t({chatId:e.chatId,messageId:e.id,button:n}),children:[i(n),(0,be.Y)("span",{className:"inline-button-text",children:s[o][a]})]}))}))})});var Tt=n(17142),Dt=n(40435),xt=n(37859),Et=n(61097);const Lt=(0,o.ph)(({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:i,theme:s,forcedWidth:a})=>{const l=(0,o.li)(),c=(0,K.A)(),u=(0,O.A)(),h=(0,d.NO)(e),{title:m,description:p,amount:g,currency:f,isTest:v,photo:A}=h,y=(0,ye.A)((0,d.cy)(A)),C=Boolean(a),w=(0,Et.A)(y,!C),b=e.id;(0,xt.A)(([e])=>{if(t){if(y){const e=l.current.closest(r.KFG);(0,Dt.A)(y,!1,b,i,s).then(t=>{(0,te.RK)(()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")})})}}else e&&l.current.closest(r.KFG).removeAttribute(r.D3G)},[t,y,n,i,s,b]);const I=a||A?.dimensions?.width,M=(0,Je.A)(A?.dimensions&&`width: ${I}px`,A?.dimensions&&`aspect-ratio: ${A.dimensions.width} / ${A.dimensions.height}`,Boolean(!A?.dimensions&&a)&&`width: ${a}px`);return(0,be.FD)("div",{ref:l,className:"Invoice",children:[m&&(0,be.Y)("p",{className:"title",children:(0,S.A)(m)}),p&&(0,be.Y)("div",{className:"info",children:(0,S.A)(p,["emoji","br"])}),(0,be.FD)("div",{className:"description "+(A?"has-image":""),children:[Boolean(A)&&(0,be.FD)("div",{className:"invoice-image-container",children:[C&&(0,be.Y)("canvas",{ref:w,className:"thumbnail blurred-bg"}),y&&(0,be.Y)("img",{className:"invoice-image",src:y,alt:"",style:M,crossOrigin:"anonymous",draggable:!1}),!y&&A&&(0,be.Y)(gt.A,{width:I,height:A.dimensions?.height,forceAspectRatio:!0})]}),(0,be.FD)("p",{className:"description-text",children:[(0,Tt.vv)(u,g,f,{iconClassName:"invoice-currency-icon"}),v&&(0,be.Y)("span",{className:"test-invoice",children:c("PaymentTestInvoice")})]})]})]})});var Bt=n(32625),Rt=n(27860);const Ot={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Ut=(0,o.ph)(({message:e,isConnected:t})=>{const{openInvoice:n,loadExtendedMedia:o}=(0,i.ko)(),s=(0,K.A)(),a=(0,d.NO)(e),{chatId:r,id:l}=e,c=(0,U.A)(()=>{o({chatId:r,ids:[l]})});(0,Bt.A)(c,t?3e4:void 0);const{amount:u,currency:h,extendedMedia:m}=a,{width:p,height:g,thumbnail:v,duration:A}=m,y=(0,U.A)(()=>{n({type:"message",chatId:r,messageId:l,isExtendedMedia:!0})});return(0,be.FD)("div",{className:(0,f.A)(Ot.root,"media-inner"),onClick:y,children:[(0,be.Y)(Rt.A,{thumbDataUri:v?.dataUri,width:p,height:g,isVisible:!0,className:Ot.spoiler}),Boolean(A)&&(0,be.Y)("div",{className:Ot.duration,children:(0,vt.QO)(A)}),(0,be.FD)("div",{className:Ot.buy,children:[(0,be.Y)(Ce.A,{name:"lock",className:Ot.lock}),s("Checkout.PayPrice",(0,Tt.Ad)(u,h))]})]})});var Kt=n(47526),zt=n(14737),Vt=n(30857),jt=n(38691);const Jt=n.p+"map-pin.899635f6fe777c28998a.svg",$t=24*Math.PI,qt=1e-4,Ht={width:400,height:300,zoom:16};function Gt(){return(0,be.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,be.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,be.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,be.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,be.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 Wt=(0,o.ph)(({message:e,peer:t})=>{const{openMapModal:n}=(0,i.ko)(),s=(0,o.li)(),a=(0,o.li)(),r=(0,K.A)(),l=(0,Vt.A)(),c=(0,d.fB)(e),{mediaType:u,geo:h}=c,m=(0,y.Fm)(),p=(0,d.vz)(e),g="geoLive"!==u||p?void 0:e.date+c.period-m,[v,A]=(0,o.J0)(h),C="venue"===u||"geoLive"===u&&!p,{width:w,height:b,zoom:I}=Ht,S=(0,jt.A)(),M=(0,d.rt)(v,w,b,I,S),N=(0,ye.A)(M),k=(0,z.A)(N,!0),Y=N||k,P=(0,o.Kr)(()=>{if("geoLive"!==u||!v.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=v;return t/(0,Kt._u)(e,I)},[u,v,I]),F=(0,U.A)(t=>{if("geoLive"!==u)return;const n=t.lastElementChild,o=t.firstElementChild,i=e.date+c.period-(0,y.Fm)(),s=(1-i/c.period)*$t,a=(0,vt.dq)(r,1e3*i);o.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)});function T(){const e=(0,f.A)("pin",u,p&&"expired");if("geoLive"===u)return(0,be.FD)("div",{className:e,children:[(0,be.Y)(Gt,{}),(0,be.Y)(me.A,{peer:t,className:"location-avatar"}),void 0!==c.heading&&(0,be.Y)("div",{className:"direction",style:`--direction: ${c.heading}deg`})]});if("venue"===u){const t=(0,Kt.PP)(c.venueType),n=(0,Kt.KE)(c.venueType);if(n)return(0,be.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,be.Y)(Gt,{}),(0,be.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,be.Y)("img",{className:e,draggable:!1,src:Jt,alt:""})}return(0,o.Nf)(()=>{a.current&&F(a.current)},[F]),(0,o.vJ)(()=>{Math.abs(h.lat-v.lat)<qt&&Math.abs(h.long-v.long)<qt?v.accuracyRadius!==h.accuracyRadius&&A({...v,accuracyRadius:h.accuracyRadius}):A(h)},[h,v]),(0,zt.A)(()=>{l()},p?void 0:1e3*(g||0)),(0,Bt.A)(()=>{(0,te.RK)(()=>{const e=a.current;e&&F(e)})},g?1e3:void 0),(0,be.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:v,zoom:I})},children:[(0,be.FD)("div",{className:"map-wrapper",children:[Y?(0,be.Y)("img",{className:"full-media map",src:Y,alt:"Location on a map",draggable:!1,style:`width: ${Ht.width}px; height: ${Ht.height}px;`}):(0,be.Y)(gt.A,{width:w,height:b}),function(){if(Y)return(0,be.FD)(be.FK,{children:[Boolean(P)&&!p&&(0,be.Y)("div",{className:"location-accuracy",style:`width: ${2*P}px; height: ${2*P}px`}),T()]})}()]}),function(){if(C)return"venue"===u?(0,be.FD)("div",{className:"location-info",children:[(0,be.Y)("div",{className:"location-info-title",children:c.title}),(0,be.Y)("div",{className:"location-info-subtitle",children:c.address})]}):"geoLive"===u?(0,be.FD)("div",{className:"location-info",children:[(0,be.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,be.Y)("div",{className:"location-info-subtitle",children:(0,vt.IF)(r,m,e.editDate)}),!p&&(0,be.FD)("div",{className:"geo-countdown",ref:a,children:[(0,be.Y)("span",{className:"geo-countdown-text"}),(0,be.Y)("svg",{width:"32px",height:"32px",children:(0,be.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":$t,"stroke-dashoffset":"0"})})]})]}):void 0}()]})});var _t=n(48906),Qt=n(97676),Zt=n(48775),Xt=n(45);const en=(0,o.ph)(({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:d,isTranslated:l,isPinned:c,withFullDate:u,effectEmoji:h,onClick:m,onTranslationClick:p,onEffectClick:g,onOpenThread:v,paidMessageStars:A})=>{const{showNotification:y}=(0,i.ko)(),[C,w]=(0,B.A)(),b=(0,K.A)(),I=(0,O.A)();function M(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const N=(0,o.Kr)(()=>{if(!C)return;const t=(0,vt.L2)(1e3*e.date,b.code,void 0,b.timeFormat),n=e.isEdited&&(0,vt.L2)(1e3*e.editDate,b.code,void 0,b.timeFormat),o=e.forwardInfo&&(0,vt.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),b.code,void 0,b.timeFormat);let i=t;return n&&(i+="\n",i+=I("MessageTooltipEditedDate",{date:n})),o&&(i+="\n",i+=I("MessageTooltipForwardedDate",{date:o})),i},[C,b,e,b.timeFormat]),k=(0,o.Kr)(()=>{if(!e.viewsCount)return;let t=I("MessageTooltipViews",{count:I.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=I("MessageTooltipForwards",{count:I.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t},[I,e.forwardsCount,e.viewsCount]),Y=(0,o.Kr)(()=>{const e=a?.messagesCount;if(e)return I("MessageTooltipReplies",{count:e},{pluralValue:e})},[I,a]),P=(0,o.Kr)(()=>{const t=(0,vt.fU)(b,1e3*e.date);return u?(0,vt.be)(b,1e3*(e.forwardInfo?.date||e.date),!0):t},[b,e.date,e.forwardInfo?.date,u]),F=(0,f.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,be.FD)("span",{className:F,dir:I.isRtl?"rtl":"ltr",onClick:m,"data-ignore-on-paste":!0,children:[h&&(0,be.Y)("span",{className:"message-effect-icon",onClick:g,children:(0,S.A)(h)}),l&&(0,be.Y)(Ce.A,{name:"language",className:"message-translated",onClick:p}),Boolean(e.viewsCount)&&(0,be.FD)(be.FK,{children:[(0,be.Y)("span",{className:"message-views",title:k,children:(0,Qe.Vw)(I,e.viewsCount)}),(0,be.Y)(Ce.A,{name:"channelviews"})]}),!d&&Boolean(a?.messagesCount)&&(0,be.FD)("span",{onClick:function(e){e.stopPropagation(),v()},className:"message-replies-wrapper",title:Y,children:[(0,be.Y)("span",{className:"message-replies",children:(0,be.Y)(Xe.A,{text:(0,Qe.Vw)(I,a.messagesCount)})}),(0,be.Y)(Ce.A,{name:"reply-filled"})]}),c&&(0,be.Y)(Ce.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,be.Y)("span",{className:"message-signature",children:(0,S.A)(n)}),Boolean(A)&&(0,be.Y)("span",{className:"message-price",children:(0,Zt.U2)(I,A,{asFont:!0,className:"message-price-star-icon",containerClassName:"message-price-stars-container"})}),(0,be.FD)("span",{className:"message-time",title:N,onMouseEnter:w,children:[e.forwardInfo?.isImported&&(0,be.FD)(be.FK,{children:[(0,be.Y)("span",{className:"message-imported",onClick:M,children:(0,vt.L2)(1e3*e.forwardInfo.date,I.code,!0)}),(0,be.Y)("span",{className:"message-imported",onClick:M,children:I("MessageMetaImported")})]}),e.isEdited&&`${I("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${I("MessageMetaApproximate")} `,P]}),t&&(0,be.Y)(Xt.A,{status:t}),r&&r()]})});var tn=n(4262);const nn=(0,o.ph)(({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,i.ko)(),a=(0,K.A)(),{isVideo:r,reason:d,duration:l}=e,c=t.isOutgoing,u="missed"===d,h="busy"===d||void 0===l,m=(0,U.A)(()=>{s({isVideo:r,userId:n})}),p=(0,o.Kr)(()=>e.duration?(0,vt.zA)(a,e.duration):void 0,[a,e.duration]),v=(0,vt.fU)(a,1e3*t.date);return(0,be.FD)("div",{className:"wqsZyy8u",children:[(0,be.Y)(Le.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:m,className:"NGmo4ADz",disabled:!g.OL,ariaLabel:a(c?"CallAgain":"CallBack"),children:(0,be.Y)(Ce.A,{name:r?"video-outlined":"phone"})}),(0,be.FD)("div",{className:"iFn6m6hd",children:[(0,be.Y)("div",{className:"l8QfocIQ",children:a((0,tn.fB)(e,t.isOutgoing))}),(0,be.FD)("div",{className:"rF5tkx92",children:[(0,be.Y)(Ce.A,{name:"arrow-right",className:(0,f.A)("ONmpzmUS",u&&"Alra_BWu",h&&"J7xsuCAm",!c&&"BfgDXljM")}),(0,be.Y)("span",{className:"kKPKwFzu",children:p?a("CallMessageWithDuration",[v,p]):v})]})]})]})});var on=n(98607);const sn=(0,o.ph)(({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:d}=(0,i.ko)(),l=(0,K.A)(),c=(0,O.A)(),u=!e.isBought,h=(0,o.Kr)(()=>{const t=l("UnlockPaidContent",e.starsAmount);return(0,on.i)(t,r.Cyx,(0,be.Y)(Ne.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))},[l,e]),m=(0,U.A)(e=>{d({type:"message",chatId:t,messageId:n}),(0,C.A)(e)});return(0,be.FD)("div",{className:"mVaSjZRJ",onClick:u?m:void 0,children:[a,u&&(0,be.Y)(Le.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,be.Y)("span",{className:"gLaaVQXr",children:h})}),e.isBought&&(0,be.Y)("div",{className:(0,f.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,Zt.U2)(c,e.starsAmount):l("Chat.PaidMedia.Purchased")})]})});var an=n(26875),rn=n(77561),dn=n(1087);function ln(e,t){return t>0?(e/t*100).toFixed():0}const cn=({answer:e,voteResults:t,totalVoters:n,maxVotersCount:i,correctResults:s,shouldAnimate:a})=>{const r=(0,O.A)(),d=t&&t.find(t=>t.option===e.option),l=0===s.length||-1!==s.indexOf(e.option),c=s.length>0&&l||d?.isChosen,u=d?ln(d.votersCount,n||0):0,[h,m]=(0,o.J0)(a?0:u),p=d?ln(d.votersCount,i||0):0,g=h!==u;if((0,o.vJ)(()=>{a&&m(u)},[a,u]),!t||!d)return;const v=`width: ${p}%; transform:scaleX(${g?0:1})`;return(0,be.FD)("div",{className:"PollOption",dir:r.isRtl?"rtl":void 0,children:[(0,be.FD)("div",{className:"poll-option-share "+("100"===u?"limit-width":""),children:[u,"%",c&&(0,be.Y)("span",{className:(0,f.A)("poll-option-chosen",!l&&"wrong",a&&"animate"),children:(0,be.Y)(Ce.A,{name:l?"check":"close",className:"poll-option-icon"})})]}),(0,be.FD)("div",{className:"poll-option-right",children:[(0,be.Y)("div",{className:"poll-option-text",dir:"auto",children:(0,ct.fd)({text:e.text.text,entities:e.text.entities})}),(0,be.FD)("div",{className:(0,f.A)("poll-option-answer",c&&!l&&"wrong"),children:[a&&(0,be.Y)("svg",{className:"poll-line",style:g?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44",children:(0,be.Y)("path",{d:"M4.47 5.33v13.6a9 9 0 009 9h13"})}),(0,be.Y)("div",{className:"poll-option-line",style:v})]})]})]})},un=12*Math.PI;function hn(e){return void 0===e.isPublic?" ":e.closed?"FinalResults":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.isPublic?"PublicPoll":"AnonymousPoll"}function mn(e,t,n){return n?e(t?"Answer":"Vote",n,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}function pn(e){e.stopPropagation()}const gn=(0,o.ph)(({message:e,poll:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:s,onSendVote:a})=>{const{loadMessage:r,openPollResults:d,requestConfetti:l,showNotification:c}=(0,i.ko)(),{id:h,chatId:m}=e,{summary:p,results:g}=t,[f,v]=(0,o.J0)(!1),[C,w]=(0,o.J0)([]),[b,I]=(0,o.J0)(!1),[S,M]=(0,o.J0)(!p.closed&&p.closeDate&&p.closeDate>0?Math.min(p.closeDate-(0,y.Fm)(),p.closePeriod):0),N=(0,o.li)(),k=(0,o.li)(),{results:Y,totalVoters:P}=g,F=Y&&Y.some(e=>e.isChosen),T=!p.closed&&!F,D=!T&&p.isPublic&&Number(g.totalVoters)>0,x=T&&p.multipleChoice,E=g.recentVoterIds,L=Y?Math.max(...Y.map(e=>e.votersCount)):P,B=(0,o.Kr)(()=>Y?.filter(e=>e.isCorrect).map(e=>e.option)||[],[Y]),R=(0,o.Kr)(()=>p.answers.map(e=>({label:(0,ct.fd)({text:e.text.text,entities:e.text.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s}),value:e.option,hidden:Boolean(p.quiz&&p.closePeriod&&S<=0)})),[S,n,s,p.answers,p.closePeriod,p.quiz]);(0,o.vJ)(()=>{const e=t.results.results?.find(e=>e.isChosen);f&&e&&(e.isCorrect&&l({}),v(!1))},[f,t.results.results,l]),(0,o.Nf)(()=>{if(S>0&&setTimeout(()=>M(S-1),1e3),!k.current)return;S<=5&&N.current.classList.add("hurry-up");const e=(p.closePeriod-S)/p.closePeriod*un;k.current.setAttribute("stroke-dashoffset",`-${e}`)},[S,p.closePeriod]),(0,o.vJ)(()=>{p.quiz&&(S<=0||F&&!p.closed)&&r({chatId:m,messageId:h})},[m,S,F,r,h,p.closed,p.quiz]),(0,o.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)}},[T,m,r,h,p.closePeriod,p.closed,p.quiz]);const O=(0,o.Kr)(()=>{const e=(0,i.mS)();return E?E.reduce((t,n)=>{const o=(0,u.PVB)(e,n);return o&&t.push(o),t},[]):[]},[E]),z=(0,U.A)(e=>{w([e]),v(!0),I(!0),a([e])}),V=(0,U.A)(e=>{w(e)}),j=(0,U.A)(()=>{v(!0),I(!0),a(C)}),J=(0,U.A)(()=>{d({chatId:m,messageId:h})}),$=(0,U.A)(()=>{c({localId:(0,A.bj)(e),message:(0,ct.fd)({text:t.results.solution,entities:t.results.solutionEntities}),duration:5e3,containerSelector:"#middle-column-portals"})});(0,o.vJ)(()=>{b&&F&&p.quiz&&g.results&&t.results.solution&&(g.results.find(e=>e.isChosen&&e.isCorrect)||$())},[F,b,g.results,p.quiz,t.results.solution]);const q=(0,K.A)();return(0,be.FD)("div",{className:"Poll",dir:q.isRtl?"auto":"ltr",children:[(0,be.Y)("div",{className:"poll-question",children:(0,ct.fd)({text:p.question.text,entities:p.question.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s})}),(0,be.FD)("div",{className:"poll-type",children:[q(hn(p)),O.length>0&&(0,be.Y)("div",{className:"poll-recent-voters",children:(0,be.Y)(an.A,{size:"micro",peers:O})}),S>0&&T&&(0,be.FD)("div",{ref:N,className:"poll-countdown",children:[(0,be.Y)("span",{children:(0,vt.QO)(S)}),(0,be.Y)("svg",{width:"16px",height:"16px",children:(0,be.Y)("circle",{ref:k,cx:"8",cy:"8",r:6,className:"poll-countdown-progress",transform:"rotate(-90, 8, 8)","stroke-dasharray":un,"stroke-dashoffset":"0"})})]}),p.quiz&&t.results.solution&&!T&&(0,be.Y)(Le.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:$,ariaLabel:"Show Solution",children:(0,be.Y)(Ce.A,{name:"lamp"})})]}),T&&(0,be.Y)("div",{className:"poll-answers",onClick:pn,children:x?(0,be.Y)(rn.A,{options:R,selected:C,onChange:V,disabled:e.isScheduled||f,loadingOptions:f?C:void 0,isRound:!0}):(0,be.Y)(dn.A,{name:`poll-${h}`,options:R,onChange:z,disabled:e.isScheduled||f,loadingOption:f?C[0]:void 0})}),!T&&(0,be.Y)("div",{className:"poll-results",children:p.answers.map(function(e){return(0,be.Y)(cn,{shouldAnimate:b||!T,answer:e,voteResults:Y,totalVoters:P,maxVotersCount:L,correctResults:B},e.option)})}),!D&&!x&&(0,be.Y)("div",{className:"poll-voters-count",children:mn(q,p.quiz,g.totalVoters)}),x&&(0,be.Y)(Le.A,{isText:!0,disabled:0===C.length,size:"tiny",onClick:j,children:q("PollSubmitVotes")}),D&&(0,be.Y)(Le.A,{isText:!0,size:"tiny",onClick:J,children:q("PollViewResults")})]})});var fn=n(43581),vn=n(84555),An=n(10221),yn=n(18104),Cn=n(14413),wn=n(82855),bn=n(3325);const In="GydRBA08",Sn=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({message:e,shouldLoop:t,shouldPlayEffect:n,withEffect:a,isMediaNsfw:r,onStopEffect:l,observeIntersection:c,observeIntersectionForPlaying:u,needsAgeVerification:h})=>{const{showNotification:m,openStickerSet:p,updateContentSettings:v,openAgeVerificationModal:A}=(0,i.ko)(),y=(0,K.A)(),{isMobile:C}=(0,D.Ay)(),w=(0,o.li)(),I=(0,o.li)(),S=e.content.sticker,{stickerSetInfo:M,isVideo:N,hasEffect:k}=S,Y=!e.isOutgoing,[P,F,T]=(0,B.A)(),[x,E]=(0,o.J0)(!1),L=r,[O,z,V]=(0,B.A)(L);(0,o.vJ)(()=>{L?z():V()},[L]);const j=(0,U.A)(()=>{T(),V(),x&&v({isSensitiveEnabled:!0})}),J=S.isPreloadedGlobally?void 0:(0,d.Mw)(S,N&&!g.OF?"pictogram":"inline"),$=(0,R.Vz)(w,c),q=(0,R.Vz)(w,u),H=`sticker${S.id}?size=f`,G=(0,ye.A)(H,!$||!k||!a,s.qZ.BlobUrl),[W,_,Q]=(0,B.A)(),Z=(0,d.VD)(S),X=(0,U.A)(()=>{Q(),l?.()});(0,o.vJ)(()=>{k&&a&&q&&n&&_()},[k,q,n,_,a]);const ee=k&&a&&G&&W;(0,An.A)({anchorRef:w,overlayRef:I,isMirrored:Y,isDisabled:!ee});const te=(0,U.A)(()=>{p({stickerSetInfo:S.stickerSetInfo})}),ne=(0,U.A)(()=>{if(O)return r?h?void A():void F():void V();if(k){if(W||!a)return void m({message:y("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:S.stickerSetInfo}},actionText:y("ViewAction")});if(a)return void _()}te()}),oe="isMissing"in M,{width:ie,height:se}=(0,b.bu)(S,C),ae=(0,f.A)("media-inner","FPceNkgD",oe&&"hruUWBuj",k&&Y&&In);return(0,be.FD)("div",{ref:w,className:ae,style:`width: ${ie}px; height: ${se}px;`,onClick:oe?void 0:ne,children:[(0,be.Y)(wn.A,{containerRef:w,sticker:S,fullMediaHash:J,fullMediaClassName:"full-media",size:ie,shouldLoop:t,noLoad:!$,noPlay:!q,withSharedAnimation:!0}),(0,be.Y)(Rt.A,{isVisible:O,withAnimation:!0,thumbDataUri:Z,width:ie,height:se,className:"media-spoiler",isNsfw:r}),ee&&(0,be.Y)(bn.A,{children:(0,be.Y)(yn.A,{ref:I,className:(0,f.A)("WMMaWlOL",Y&&In),tgsUrl:G,size:1.49*ie,play:!0,isLowPriority:!0,noLoop:!0,onEnded:X},H)}),(0,be.Y)(Cn.A,{isOpen:P,onClose:T,shouldAlwaysShow:x,onAlwaysShowChanged:E,confirmHandler:j})]})}));var Mn=n(45470),Nn=n(14),kn=n(50680),Yn=n(59816);const Pn=(0,o.ph)(function({story:e,isPreview:t,isProtected:n,isConnected:s}){const{openStoryViewer:a,loadPeerStoriesByIds:r,showNotification:l}=(0,i.ko)(),c=(0,K.A)(),{isMobile:u}=(0,D.Ay)(),h=e&&"isDeleted"in e,m=e&&"content"in e,p=m?e.content.video:void 0,v=m?(0,d.EN)(e):void 0,A=(0,ye.A)(v),y=m?p?p.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,C=(0,Nn.A)(A,!0),{shouldRender:w,transitionClassNames:b}=(0,kn.A)(Boolean(C)),I=(0,Mn.A)(y,h&&!t,u&&!g.QH),S=(0,f.A)("EVLTkrt1","media-inner",(!s||h)&&"AQWPv0bP",h&&"tprkr7qf",t&&"V3HabdKr");(0,o.vJ)(()=>{!e||m||h||r({peerId:e.peerId,storyIds:[e.id]})},[e,h,m]);const M=(0,U.A)(()=>{h?l({message:c("StoryNotFound")}):a({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})});return(0,be.FD)("div",{className:S,onClick:s?M:void 0,children:[!h&&t&&(0,be.Y)("canvas",{ref:I,className:"thumbnail blurred-bg"}),w&&(0,be.FD)(be.FK,{children:[(0,be.Y)("img",{src:C,alt:"",className:(0,f.A)("WAItYc5d",t&&"ClGe8yij",b),draggable:!1}),m&&(0,be.Y)(Yn.A,{story:e,className:b})]}),h&&(0,be.FD)("span",{children:[(0,be.Y)(Ce.A,{name:"story-expired",className:"nLA7VEhv"}),c("StoryExpiredSubtitle")]}),Boolean(p?.duration)&&(0,be.Y)("div",{className:"message-media-duration",children:(0,vt.QO)(p.duration)}),n&&(0,be.Y)("span",{className:"protector"})]})}),Fn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData;return{story:(0,u.Msb)(e,o,n),isConnected:"connectionStateReady"===e.connectionState}})(function({message:e,story:t,isProtected:n,isConnected:o}){const{storyData:i}=e.content;return(0,be.Y)(Pn,{story:t||i,isProtected:n,isConnected:o})})),Tn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData,i=(0,u._bp)(e,o)?.lastReadId;return{story:(0,u.Msb)(e,o,n),peer:(0,u.PVB)(e,o),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(i&&i<n)}})(function({message:e,story:t,peer:n,isUnread:o,targetUser:s}){const{openStoryViewer:a}=(0,i.ko)(),r=(0,K.A)(),{storyData:c}=e.content,u=(0,U.A)(()=>{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}),h=t&&"isDeleted"in t,m=t&&"content"in t,p=m?t.content.video:void 0,g=m?(0,d.EN)(t,"pictogram"):void 0,v=(0,ye.A)(g)||p?.thumbnail?.dataUri;return(0,L.A)(c.peerId,c.id,t),(0,be.FD)("div",{className:(0,f.A)("action-message-story-mention",o&&"is-unread",m&&"with-preview"),tabIndex:0,role:"button",onClick:m?u:void 0,children:[m&&(0,be.Y)("span",{className:"story-media-wrapper",children:v&&(0,be.Y)("img",{src:v,alt:"",className:"story-media"})}),(0,be.Y)("span",{className:"story-title",children:(0,S.A)(n&&"isSelf"in n&&n.isSelf?r(h?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,d.u0)(s)):h?r("ExpiredStoryMention"):r("StoryMentionedTitle",(0,l.F9)(r,n)),["emoji","simple_markdown"])})]})})),Dn=(0,o.ph)((0,i.EK)((e,{message:t})=>({sender:(0,u.Y7C)(e,t),isCurrentUserPremium:(0,u.g29)(e),isSynced:e.isSynced}))(({message:e,todoList:t,sender:n,isCurrentUserPremium:s,isSynced:a})=>{const{toggleTodoCompleted:r,showNotification:d,requestConfetti:c}=(0,i.ko)(),{todo:h,completions:m}=t,{title:p,items:g,othersCanComplete:v}=h,[A,y]=(0,o.J0)([]),C=(0,o.Kr)(()=>new Set(A),[A]),w=!e.isScheduled&&s&&a;(0,o.Nf)(()=>{const e=m?.map(e=>e.itemId.toString())||[];y(e)},[m]);const b=(0,O.A)(),I=(0,U.A)(e=>{e.preventDefault(),e.stopPropagation(),s||d({message:b("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:b("PremiumMore")})}),S=(0,U.A)(t=>{const n=t.find(e=>!C.has(e)),o=Array.from(C).find(e=>!t.includes(e));r({chatId:e.chatId,messageId:e.id,completedIds:n?[Number(n)]:[],incompletedIds:o?[Number(o)]:[]}),t.length===g.length&&c({})}),M=Boolean(e.forwardInfo)||!v&&!e.isOutgoing,N=e.isOutgoing,k=(0,o.Kr)(()=>g.map(e=>{const t=v?(0,u.mBe)((0,i.mS)(),m?.find(t=>t.itemId===e.id)?.completedBy||""):void 0,n=t?(0,l.em)(b,t):void 0;return{label:(0,ct.fd)(e.title),value:e.id.toString(),user:t,subLabel:n}}),[g,v,m,b]);return(0,be.FD)("div",{className:"todo-list",dir:b.isRtl?"auto":"ltr",children:[(0,be.FD)("div",{className:"todo-list-header",children:[(0,be.Y)("div",{className:"todo-list-title",children:(0,ct.fd)(p)}),(0,be.Y)("div",{className:"list-type",children:e.forwardInfo?b("TitleToDoList"):v?b("TitleGroupToDoList"):N?b("TitleYourToDoList"):n?b("TitleUserToDoList",{peer:(0,l.F9)(b,n)},{withNodes:!0}):b("TitleToDoList")})]}),(0,be.Y)("div",{className:"todo-list-items",children:M?(0,be.Y)("div",{className:"todo-list-items",children:k.map(e=>(0,be.FD)("div",{className:"todo-list-readonly-item",children:[(0,be.Y)("div",{className:"todo-readonly-item-checkbox",children:C.has(e.value)?(0,be.Y)(Ce.A,{name:"check"}):(0,be.Y)("div",{className:"todo-item-bullet-point"})}),(0,be.Y)("div",{className:(0,f.A)("readonly-item-label",C.has(e.value)&&"completed-label"),children:e.label})]},e.value))}):(0,be.Y)(rn.A,{options:k,selected:A,onChange:S,onClickLabel:s?void 0:I,disabled:!w,isRound:!0})}),(0,be.Y)("div",{className:"completed-tasks-count",children:(0,be.Y)(Xe.A,{text:b("DescriptionCompletedToDoTasks",{number:A.length,count:k.length})})})]})}));var xn=n(58849),En=n(87094),Ln=n(39877),Bn=n(84685),Rn=n(66833),On=n(40558);const Un=(0,o.ph)(({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,o.li)(),{backdrop:a,model:r,pattern:d}=(0,Rn.uc)(e),[l,c,u]=(0,B.A)(),h=[a.centerColor,a.edgeColor];return(0,be.FD)("div",{className:(0,f.A)("interactive-gift","LaOdPURl"),onClick:i,onMouseEnter:g.TF?void 0:c,onMouseLeave:g.TF?void 0:u,children:[(0,be.Y)("div",{className:"zDnMa37m",children:(0,be.Y)(On.A,{className:"EdXfeKWY",backgroundColors:h,patternColor:a.patternColor,patternIcon:d.sticker})}),(0,be.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,be.Y)(wn.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:l,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})}),Kn=(0,o.ph)((0,i.EK)(e=>({canPlayAnimatedEmojis:(0,u.BWX)(e)}))(({messageWebPage:e,webPage:t,message:n,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u=!1,isProtected:h,isConnected:m,story:p,theme:g,backgroundEmojiId:v,shouldWarnAboutFiles:A,autoLoadFileMaxSizeMb:y,lastPlaybackTimestamp:C,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onMediaClick:I,onDocumentClick:M,onContainerClick:N,onAudioPlay:k,onCancelMediaTransfer:Y})=>{const{openUrl:P,openTelegramLink:F}=(0,i.ko)(),T=(0,o.li)(),D=(0,K.A)(),x=(0,O.A)(),E=(0,U.A)(()=>{I()}),B=(0,U.A)(e=>{N?.(e)}),R="full"===t?.webpageType?t:void 0,{story:z,stickers:V}=R||{};(0,L.A)(z?.peerId,z?.id,p);const j=V?.isWithTextColor||V?.documents?.[0]?.shouldUseTextColor,J=(0,En.A)(T,void 0,!j),$=(0,o.Kr)(()=>{const e=t?.url&&(0,X.vG)(t?.url);if(e&&"timestamp"in e)return e.timestamp},[t?.url]);if("full"!==t?.webpageType)return;const q=(0,U.A)(()=>{F({url:t.url})}),{siteName:H,url:G,displayUrl:W,title:_,description:Q,photo:Z,video:ee,audio:te,type:ne,document:oe}=t,{mediaSize:ie}=e,se="telegram_story"===ne,ae="telegram_nft"===ne,re=p&&"isDeleted"in p?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}}(V?.isEmoji?"telegram_emojiset":ne),de=re&&x(re),le=(0,xn.A)(Q,170),ce=Boolean(le||_||H);let ue=Boolean(V);ce&&t?.photo&&!t.video&&!t.document&&(ue=function(e,t){if(!e?.photo)return!1;if("small"===t)return!0;if("large"===t)return!1;const{width:n,height:o}=(0,d.Xn)(e.photo)||{};return!(!n||!o||n!==o||e.hasLargeMedia)}(t,ie));const me=(Z||ee)&&I&&!ue,pe=(0,f.A)("WebPage",ue&&"with-square-photo",!Z&&!ee&&"without-media",ee&&"with-video",!ce&&"no-article",oe&&"with-document",de&&"with-quick-button",ae&&"with-gift");return(0,be.FD)(we.A,{className:pe,"data-initial":(H||W)[0],dir:D.isRtl?"rtl":"auto",onClick:B,children:[(0,be.FD)("div",{className:(0,f.A)("WebPage--content",se&&"is-story",ae&&"is-gift"),children:[v&&(0,be.Y)(Ln.A,{emojiDocumentId:v,className:"WebPage--background-icons"}),se&&(0,be.Y)(Pn,{story:p,isProtected:h,isConnected:m,isPreview:!0}),ae&&(0,be.Y)(Un,{gift:t.gift,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onClick:q}),ce&&(0,be.FD)("div",{className:(0,f.A)("WebPage-text","WebPage-text_interactive"),onClick:()=>P({url:G,shouldSkipModal:e.isSafe}),children:[(0,be.Y)(Bn.A,{className:"site-name",url:G,text:H||W}),_&&(0,be.Y)("p",{className:"site-title",children:(0,S.A)(_)}),le&&!ae&&(0,be.Y)("p",{className:"site-description",children:(0,S.A)(le,["emoji","br"])})]}),Z&&!ae&&!ee&&!oe&&(0,be.Y)(Ue.A,{photo:Z,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersection:w,noAvatars:s,canAutoLoad:r,size:ue?"pictogram":"inline",asForwarded:c,nonInteractive:!me,isDownloading:u,isProtected:h,theme:g,onClick:me?E:void 0,onCancelUpload:Y}),ee&&(0,be.Y)(Ke.A,{video:ee,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:w,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u,isProtected:h,lastPlaybackTimestamp:C||$,onClick:me?E:void 0,onCancelUpload:Y}),te&&(0,be.Y)(he.Ay,{theme:g,message:n,origin:a.d9.Inline,noAvatars:s,isDownloading:u,onPlay:k,onCancelUpload:Y}),oe&&(0,be.Y)(ge.A,{document:oe,message:n,observeIntersection:w,autoLoadFileMaxSizeMb:y,onMediaClick:M,onCancelUpload:Y,isDownloading:u,shouldWarnAboutFiles:A}),V&&(0,be.Y)("div",{ref:T,className:(0,f.A)("media-inner","square-image",V.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:V.documents.map(e=>(0,be.Y)("div",{className:"WebPage--sticker",children:(0,be.Y)(wn.A,{containerRef:T,sticker:e,shouldLoop:!0,size:V.isEmoji?38:80,customColor:J,observeIntersectionForPlaying:b,observeIntersectionForLoading:w})},e.id))})]}),de&&(fe=de,(0,be.Y)(Le.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!0,onClick:q,children:fe}))]});var fe})),zn=1.75*b.$,Vn=2.25*b.$,jn=(0,o.ph)((0,i.EK)((e,t)=>{const{focusedMessage:n,forwardMessages:o,activeReactions:i,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:l,album:p,withSenderName:f,withAvatar:y,threadId:C,messageListType:w,isLastInDocumentGroup:b,isFirstInGroup:I}=t,{id:S,chatId:M,viaBotId:N,isOutgoing:k,forwardInfo:Y,transcriptionId:P,isPinned:F,viaBusinessBotId:T,effectId:D,paidMessageStars:x}=l,E=(0,u.k9R)(e,l),{shouldWarnAboutFiles:L}=(0,m.l)(e),B=(0,v.L8)(M),R=(0,u.hds)(e,M),O=(0,u.nZ4)(e,M),U=(0,d.DX)(M),K=(0,d.Qe)(M),z=R&&(0,d.WX)(R),V=R&&(0,d.YE)(R),j=B?void 0:(0,u.AWZ)(e,M),J=E?.story,$=J?(0,u.Msb)(e,J.peerId,J.id):void 0,q=o.messageIds&&o.messageIds.includes(S),H=!O&&(0,d.zP)(l),G=f||y||H,W=(0,u.Y7C)(e,l),_=(0,u.Szq)(e,l),Q=N?(0,u.mBe)(e,N):void 0,Z=W?.id&&V?j?.adminMembersById?.[W?.id]:void 0,X=l.id===C,{replyToMsgId:ee,replyToPeerId:te,replyFrom:ne}=(0,c.Q)(l)||{},{peerId:oe,storyId:ie}=(0,c.W)(l)||{},se=ee&&ee===C,ae=(0,u.gMr)(e,l),re=Y||ne,de=ae?(0,u.Y7C)(e,ae):!re||U||K?void 0:(0,u.HdA)(e,re),le=ae&&(0,u.Szq)(e,ae),ce=te?(0,u.hds)(e,te):void 0,ue=!U&&!K&&ce&&!(0,d.gA)(ce)&&(ce.isNotJoined||(0,u._ls)(e,ce.id)),he="topicCreate"===ae?.content.action?.type,me=ie&&oe?(0,u.Msb)(e,oe,ie):void 0,pe=oe?(0,u.PVB)(e,oe):void 0,ge=(0,u.ldX)(e,l),fe="thread"===w&&(p?p.messages.some(t=>(0,u.nJv)(e,t,C)):(0,u.nJv)(e,l,C)),{direction:ve,noHighlight:Ae,isResizingContainer:ye,quote:Ce,quoteOffset:we,scrollTargetPosition:be}=fe&&n||{},Ie=(0,u.TCk)(e),Se=Ie?.results?.query&&`${Ie.isHashtag?"#":""}${Ie.results.query}`,Me=(0,d.wb)(l),Ne=Me&&(0,u.oei)(e,Me)?Me:void 0,ke=(0,d.Jw)(l);let Ye;Ye=p?.messages?p.messages.every(({id:t})=>(0,u.H1_)(e,t)):(0,u.H1_)(e,S);const Pe="thread"===w&&(0,u.tOf)(e,l,C),Fe=(0,u.yuw)(e),Te=(0,h.iS)(e,l),De=Te&&(0,d.$r)(Fe,Te),xe=(0,u.Vw0)(e,M,p?.commentsMessage?.id||S),Ee=Boolean(l.groupedId)&&!l.isInAlbum,Le=Ee?(0,u.D_S)(e,M,l.groupedId)[0]:void 0,Be=Ee?b?(0,u.O5q)(e,M,Le):void 0:l,Re=R?.unreadReactions?.includes(l.id),Oe=C===s.l3&&R?.isForum&&I,Ue=Oe?(0,u.nkm)(e,l):void 0,Ke=(0,u.RnX)(e,M),ze=(0,u.Rny)(e,M,l.id),Ve=(0,u.qZq)(e,M),je=g.CM&&e.settings.byKey.canTranslate&&!Ve,Je="connectionStateReady"===e.connectionState,$e=Boolean(Be&&i[(0,A.bj)(Be)]?.length),qe=(0,u.g29)(e),He=W&&(0,u.nZ4)(e,W.id)?j?.boostsApplied??l.senderBoosts:l.senderBoosts,Ge=R?.boostLevel||0,We=e.appConfig.groupTranscribeLevelMin,_e=qe||Boolean(We&&Ge>=We),Qe=T?(0,u.mBe)(e,T):void 0,Ze=D?e.availableEffectById[D]:void 0,Xe=(0,u.zcZ)(e,l),et=(0,h.me)(e,l),tt=(0,h.xd)(e,M,l.id),nt=(0,u.trm)(e),ot=e.appConfig.starsSuggestedPostFutureMin,it=(0,h.B9)(e,l),st=ae&&(0,h.B9)(e,ae);return{theme:(0,u.SJA)(e),forceSenderName:H,sender:W,canShowSender:G,originSender:_,botSender:Q,shouldHideReply:se||he,isThreadTop:X,replyMessage:ae,replyMessageSender:de,replyMessageForwardSender:le,replyMessageChat:ce,replyStory:me,isReplyPrivate:ue,storySender:pe,isInDocumentGroup:Ee,isProtected:(0,u.ynf)(e,l),isChatProtected:(0,u.ryq)(e,M),isFocused:fe,isForwarding:q,reactionMessage:Be,isChatWithSelf:O,isRepliesChat:U,isAnonymousForwards:K,isChannel:z,isGroup:V,canReply:Pe,highlight:Se,animatedEmoji:Ne,animatedCustomEmoji:ke,isInSelectMode:(0,u.rTV)(e),isSelected:Ye,isGroupSelected:Boolean(l.groupedId)&&!l.isInAlbum&&(0,u.SLS)(e,M,l.groupedId),threadId:C,isDownloading:De,isPinnedList:"pinned"===w,isPinned:F,canAutoLoadMedia:(0,u.wwb)(e,l),canAutoPlayMedia:(0,u.OEt)(e,l),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:xe,availableReactions:e.reactions.availableReactions,defaultReaction:(0,d.Nb)(l)||"scheduled"===w?void 0:(0,u.nTJ)(e,M),hasActiveReactions:$e,activeEmojiInteractions:a,hasUnreadReaction:Re,isTranscribing:void 0!==P&&e.transcriptions[P]?.isPending,transcribedText:void 0!==P?e.transcriptions[P]?.text:void 0,isPremium:qe,senderAdminMember:Z,messageTopic:Ue,hasTopicChip:Oe,chatTranslations:Ke,areTranslationsEnabled:je,shouldDetectChatLanguage:(0,u.LRV)(e,M),requestedTranslationLanguage:ze,requestedChatTranslationLanguage:Ve,hasLinkedChat:Boolean(j?.linkedChatId),withAnimatedEffects:(0,u.xYJ)(e,"stickerEffects"),webPageStory:$,isConnected:Je,isLoadingComments:xe?.isCommentsInfo&&r?.loadingChatId===xe?.originChannelId&&r?.loadingMessageId===xe?.originMessageId,shouldWarnAboutFiles:L,outgoingStatus:k?(0,u.Tl2)(e,l,"scheduled"===w):void 0,uploadProgress:"number"==typeof ge?ge:void 0,focusDirection:fe?ve:void 0,noFocusHighlight:fe?Ae:void 0,isResizingContainer:fe?ye:void 0,focusedQuote:fe?Ce:void 0,focusedQuoteOffset:fe?we:void 0,scrollTargetPosition:fe?be:void 0,senderBoosts:He,tags:e.savedReactionTags?.byKey,canTranscribeVoice:_e,viaBusinessBot:Qe,minFutureTime:ot,effect:Ze,poll:Xe,maxTimestamp:et,lastPlaybackTimestamp:tt,paidMessageStars:x,isChatWithUser:B,isAccountFrozen:nt,isMediaNsfw:it,isReplyMediaNsfw:st,webPage:E}})(({message:e,observeIntersectionForBottom:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,album:h,noAvatars:m,withAvatar:v,withSenderName:A,noComments:k,noReplies:P,appearanceOrder:F,isJustAdded:J,isFirstInGroup:$,isPremium:W,isLastInGroup:te,isFirstInDocumentGroup:ne,isLastInDocumentGroup:oe,isTranscribing:ie,transcribedText:se,isLastInList:ae,theme:re,forceSenderName:de,sender:ce,canShowSender:ue,originSender:Ae,botSender:ye,isThreadTop:we,shouldHideReply:Ie,replyMessage:Pe,replyMessageSender:Fe,replyMessageForwardSender:Te,replyMessageChat:De,replyStory:Oe,isReplyPrivate:ze,storySender:Ve,outgoingStatus:Je,uploadProgress:$e,isInDocumentGroup:qe,isLoadingComments:He,isProtected:We,isChatProtected:Qe,isFocused:Ze,focusDirection:Xe,focusedQuote:et,focusedQuoteOffset:nt,noFocusHighlight:ot,scrollTargetPosition:it,isResizingContainer:st,isForwarding:rt,isChatWithSelf:dt,isRepliesChat:ct,isAnonymousForwards:ut,isChannel:ht,isGroup:mt,canReply:gt,highlight:vt,animatedEmoji:At,animatedCustomEmoji:yt,hasActiveReactions:Ct,hasLinkedChat:wt,isInSelectMode:bt,isSelected:It,isGroupSelected:St,threadId:Mt,reactionMessage:Nt,availableReactions:kt,defaultReaction:Pt,activeEmojiInteractions:Tt,messageListType:Dt,isPinnedList:xt,isPinned:Et,isDownloading:Bt,canAutoLoadMedia:Rt,canAutoPlayMedia:Ot,shouldLoopStickers:Kt,autoLoadFileMaxSizeMb:zt,repliesThreadInfo:Vt,hasUnreadReaction:jt,memoFirstUnreadIdRef:Jt,senderAdminMember:$t,messageTopic:qt,hasTopicChip:Ht,chatTranslations:Gt,areTranslationsEnabled:Zt,shouldDetectChatLanguage:Xt,requestedTranslationLanguage:tn,requestedChatTranslationLanguage:on,withAnimatedEffects:an,webPageStory:rn,isConnected:dn,getIsMessageListReady:ln,shouldWarnAboutFiles:cn,senderBoosts:un,tags:hn,canTranscribeVoice:mn,viaBusinessBot:pn,effect:An,poll:yn,maxTimestamp:Cn,lastPlaybackTimestamp:wn,isMediaNsfw:bn,isReplyMediaNsfw:In,paidMessageStars:Mn,isChatWithUser:Nn,isAccountFrozen:kn,minFutureTime:Yn,webPage:Pn,onIntersectPinnedMessage:xn})=>{const{toggleMessageSelection:En,clickBotInlineButton:Ln,clickSuggestedMessageButton:Bn,rejectSuggestedPost:Rn,openSuggestedPostApprovalModal:On,disableContextMenuHint:Un,animateUnreadReaction:jn,focusLastMessage:Jn,markMentionsRead:$n}=(0,i.ko)(),qn=(0,o.li)(),Hn=(0,o.li)(),Gn=(0,o.li)(),Wn=(0,K.A)(),_n=(0,O.A)(),[Qn,Zn]=(0,o.J0)(!1),[Xn,eo]=(0,o.J0)(!1),[to,no]=(0,o.J0)(!1),[oo,io,so]=(0,B.A)(),[ao,ro,lo]=(0,B.A)(),[co,uo]=(0,o.J0)(""),{isMobile:ho,isTouchScreen:mo}=(0,D.Ay)();(0,R.mv)(Hn,t);const{isContextMenuOpen:po,contextMenuAnchor:go,contextMenuTarget:fo,handleBeforeContextMenu:vo,handleContextMenu:Ao,handleContextMenuClose:yo,handleContextMenuHide:Co}=(0,x.A)(qn,mo&&bt||kn,!p.Vq,g.Ni,ln);(0,o.vJ)(()=>{po&&Un()},[po,Un]);const wo=F<=0,[bo,Io]=(0,B.A)(wo);(0,o.vJ)(()=>{wo||setTimeout(Io,F*r.zq7)},[F,Io,wo]),(0,j.A)({ref:qn,isOpen:bo||J,noMountTransition:wo&&!J,className:!1});const{id:So,chatId:Mo,forwardInfo:No,viaBotId:ko,isTranscriptionError:Yo,factCheck:Po}=e;(0,o._W)(()=>{if(e.isPinned){const e=h?h.mainMessage.id:So;xn?.({viewportPinnedIdsToRemove:[e]})}});const Fo=(0,d.Nb)(e),To=(0,d.Ie)(e),Do="scheduled"===Dt||e.isScheduled,xo=(0,d.Tv)(e)&&!Ie,{paidMedia:Eo}=(0,d.r_)(e),{photo:Lo,video:Bo}=N(Eo),{photo:Ro=Lo,video:Oo=Bo,audio:Uo,voice:Ko,document:zo,sticker:Vo,contact:jo,invoice:Jo,location:$o,action:qo,game:Ho,storyData:Go,giveaway:Wo,giveawayResults:_o,todo:Qo}=(0,d.r_)(e),Zo=(0,c.Q)(e),Xo=(0,c.W)(e),ei=Boolean(!Qn&&(Yo||se)),ti=Boolean(Xo),ni=Boolean(Vt)&&"thread"===Dt,oi=!ei&&(0,d.aN)(e),ii=oi&&(At||yt),si=Nt?.reactions&&!(0,d.G)(Nt.reactions),ai=No&&(!dt||Do)&&!ct&&!No.isLinkedChannelPost&&!ut&&!ye||Boolean(Go&&!Go.isMention),ri=Boolean(un)&&!ai&&$,di=Go?.isMention,li="video"===Oo?.mediaType&&Oo.isRound,ci=Boolean(h)&&(h.isPaidMedia&&Eo.extendedMedia.length>1||h.messages.length>1)&&!h.messages.some(e=>0===Object.keys(e.content).length),ui=qe&&!ne,hi=qe&&!oe,mi=void 0!==go,pi=!(mi||bt||rt||hi||di||(Vo||ii)&&ai),gi=ht&&!Do&&e.isForwardingAllowed&&!Qe,fi=Boolean(xt||No&&(No.isChannelPost||dt||ct||ut)&&No.fromMessageId),vi=Boolean(Po?.text),Ai=ai&&oi,yi=Ht||xo||ti||Ai,Ci=(0,U.A)((e,t)=>{kn||En({messageId:So,groupedId:t,...e?.shiftKey&&{withShift:!0},...ci&&{childMessageIds:h.messages.map(({id:e})=>e)}})}),wi=ue?ce:void 0,bi=No&&(dt||ct||ut||!wi)?Ae:wi,Ii=ai?Ae:ce,Si=To&&!oi,Mi=No||Go?Ae:wi,Ni=(0,d.G5)(e),{handleMouseDown:ki,handleClick:Yi,handleContextMenu:Pi,handleDoubleClick:Fi,handleContentDoubleClick:Ti,handleMouseMove:Di,handleSendQuickReaction:xi,handleMouseLeave:Ei,isSwiped:Li,isQuickReactionVisible:Bi,handleDocumentGroupMouseEnter:Ri}=le(Ci,qn,So,Boolean(bt),Boolean(gt),Boolean(We),Ao,vo,Mo,mi,Gn,hi,ln),{handleSenderClick:Oi,handleViaBotClick:Ui,handleReplyClick:Ki,handleMediaClick:zi,handleDocumentClick:Vi,handleAudioPlay:ji,handleAlbumMediaClick:Ji,handlePhotoMediaClick:$i,handleVideoMediaClick:qi,handleMetaClick:Hi,handleTranslationClick:Gi,handleOpenThread:Wi,handleReadMedia:_i,handleCancelUpload:Qi,handleVoteSend:Zi,handleGroupForward:Xi,handleForward:es,handleFocus:ts,handleFocusForwarded:ns,handleDocumentGroupSelectAll:os,handleTopicChipClick:is,handleStoryClick:ss}=function({lang:e,selectMessage:t,message:n,webPage:o,chatId:r,threadId:l,isInDocumentGroup:u,asForwarded:h,isScheduled:m,album:p,senderPeer:g,botSender:f,messageTopic:v,isTranslatingChat:A,story:y,isReplyPrivate:C,isRepliesChat:w,isSavedMessages:b,lastPlaybackTimestamp:I}){const{openChat:S,openChatWithDraft:M,showNotification:N,focusMessage:k,openMediaViewer:Y,openAudioPlayer:P,markMessagesRead:F,cancelUploadMedia:T,sendPollVote:D,openForwardMenu:x,openChatLanguageModal:E,openThread:L,openStoryViewer:B,searchChatMediaMessages:R}=(0,i.ko)(),{id:O,forwardInfo:K,groupedId:z,content:{paidMedia:V,video:j}}=n,{replyToMsgId:J,replyToPeerId:$,replyToTopId:q,isQuote:H,quoteText:G,quoteOffset:W}=(0,c.Q)(n)||{},_=(0,U.A)(()=>{g?h&&K?.channelPostId?k({chatId:g.id,messageId:K.channelPostId}):S({id:g.id}):N({message:e("HidAccount")})}),Q=(0,U.A)(()=>{f&&M({chatId:r,threadId:l,text:{text:`@${(0,d.Kl)(f)} `}})}),Z=(0,U.A)(()=>{J&&!C?w&&$&&q?L({isComments:!0,originChannelId:$,originMessageId:q,focusMessageId:J}):k({chatId:$||r,threadId:w?q:l,messageId:J,replyMessageId:$?void 0:O,noForumTopicPanel:!$,...H&&{quote:G?.text,quoteOffset:W}}):N({message:e(H?"QuotePrivate":"ReplyPrivate")})}),ee=(0,U.A)(()=>{Y({chatId:r,threadId:l,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline})}),te=(0,U.A)(e=>{if(V&&!V.isBought)return;e&&R({chatId:r,threadId:l,currentMediaMessageId:O});const t=o?.url&&(0,X.vG)(o.url),n=j||(0,d.rU)(o),i=t&&"timestamp"in t?t.timestamp:void 0;Y({chatId:r,threadId:l,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:I||n?.timestamp||i,withDynamicLoading:e})}),ne=(0,U.A)(()=>{te(!m&&!V)}),oe=(0,U.A)(()=>{const e=n.content?.video?.isGif;te(!e&&!m&&!V)}),ie=(0,U.A)(()=>{((0,d.yl)(n)||(0,d.eY)(o))&&ne(),oe()}),se=(0,U.A)(()=>{P({chatId:r,messageId:O})}),ae=(0,U.A)((e,t)=>{V&&!V.isBought||(R({chatId:r,threadId:l,currentMediaMessageId:O}),Y({chatId:r,threadId:l,messageId:e,mediaIndex:t,origin:m?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!V}))}),re=(0,U.A)(()=>{F({messageIds:[O]})}),de=(0,U.A)(()=>{T({chatId:r,messageId:O})}),le=(0,U.A)(e=>{D({chatId:r,messageId:O,options:e})}),ce=(0,U.A)(()=>{x({fromChatId:r,groupedId:z})}),ue=(0,U.A)(()=>{if(p&&p.messages){const e=p.messages.map(({id:e})=>e);x({fromChatId:r,messageIds:e})}else x({fromChatId:r,messageIds:[O]})}),he=(0,U.A)(()=>{k({chatId:r,threadId:s.l3,messageId:O})}),me=(0,U.A)(()=>{const e=b&&K.savedFromPeerId||K.fromChatId;u?k({chatId:e,groupedId:z,groupedChatId:r,messageId:K.fromMessageId}):$&&q?w?L({isComments:!0,originChannelId:$,originMessageId:q,focusMessageId:K.fromMessageId}):k({chatId:$,threadId:q,messageId:K.fromMessageId}):k({chatId:e,messageId:K.fromMessageId})}),pe=(0,U.A)(e=>{e.stopPropagation(),t(e,z)}),ge=(0,U.A)(e=>{e.stopPropagation(),E({chatId:r,messageId:A?void 0:O})}),fe=(0,U.A)(()=>{L({chatId:n.chatId,threadId:n.id})}),ve=(0,U.A)(()=>{v&&k({chatId:$||r,threadId:v.id,messageId:O})}),Ae=(0,U.A)(()=>{y&&B({peerId:y.peerId,storyId:y.id,isSingleStory:!0})});return{handleSenderClick:_,handleViaBotClick:Q,handleReplyClick:Z,handleDocumentClick:ee,handleMediaClick:ie,handleAudioPlay:se,handleAlbumMediaClick:ae,handlePhotoMediaClick:ne,handleVideoMediaClick:oe,handleMetaClick:pe,handleTranslationClick:ge,handleOpenThread:fe,handleReadMedia:re,handleCancelUpload:de,handleVoteSend:le,handleGroupForward:ce,handleForward:ue,handleFocus:he,handleFocusForwarded:me,handleDocumentGroupSelectAll:pe,handleTopicChipClick:ve,handleStoryClick:Ae}}({lang:Wn,selectMessage:Ci,message:e,webPage:Pn,chatId:Mo,threadId:Mt,isInDocumentGroup:qe,asForwarded:ai,isScheduled:Do,album:h,avatarPeer:bi,senderPeer:Mi,botSender:ye,messageTopic:qt,isTranslatingChat:Boolean(on),story:Oe&&"content"in Oe?Oe:void 0,isReplyPrivate:ze,isRepliesChat:ct,isSavedMessages:dt,lastPlaybackTimestamp:wn}),as=(0,U.A)(e=>{e.stopPropagation(),io()});(0,o.vJ)(()=>{ae&&ei&&se&&Jn()},[Jn,ae,se,ei]),(0,o.vJ)(()=>{const t=qn.current,n=e.isInAlbum&&h?.messages.some(e=>!e.isDeleting);e.isDeleting&&t&&!n&&((0,Ee.U)(t)?eo(!0):no(!0))},[e.isDeleting]);const rs=h?.hasMultipleCaptions?void 0:h?.captionMessage||e,ds=rs&&(0,d.XR)(rs),ls=ds||vi,cs=(0,f.A)("Message message-list-item",$&&"first-in-group",We&&"hide-on-print",We&&!ds?"is-protected":"allow-selection",te&&"last-in-group",ne&&"first-in-document-group",oe&&"last-in-document-group",ae&&"last-in-list",To&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",xo&&"has-reply",po&&"has-menu-open",Ze&&!ot&&"focused",rt&&"is-forwarding",to&&"is-deleting",Xn&&"is-dissolving",qe&&"is-in-document-group",ci&&"is-album",e.hasUnreadMention&&"has-unread-mention",It&&"is-selected",bt&&"is-in-selection-mode",we&&!v&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",Li&&"is-swiped",J&&"is-just-added",(Ct||oo)&&"has-active-effect",di&&"is-story-mention",!pi&&"no-action-button"),us=rs&&(0,d.r_)(rs).text,hs=Boolean(e.isInvertedMedia),{replyToMsgId:ms,replyToPeerId:ps}=Zo||{},{peerId:gs,storyId:fs}=Xo||{};(0,o.vJ)(()=>{(Vo?.hasEffect||An)&&(Jt?.current&&So>=Jt.current||Fo)&&io()},[An,Fo,Jt,So,Vo?.hasEffect]);const vs=function(e,t,n){const[i,s]=(0,o.J0)();return(0,o.vJ)(()=>{t||n&&!n()||(e?async function(e,t=.2){return q||await H.promise,await q.request({name:"detectLanguage",args:[e,t]})}(e).then(s):s(void 0))},[t,e,n]),i}(us?.text,!(Zt&&Xt),ln);!function(e,t,n,i){(0,o.vJ)(()=>{if(n||i&&!i())return;const o=Boolean(e.content.text?.text.length);!function({chatId:e,id:t,isTranslatable:n,detectedLanguage:o}){const i=_.get(e)||new G.A(150),s=i.get(t);s&&s.detectedLanguage===o&&s.isTranslatable===n||(i.set(t,{id:t,isTranslatable:n,detectedLanguage:o}),_.set(e,i),Q(e))}({chatId:e.chatId,id:e.id,isTranslatable:o,detectedLanguage:t})},[e,t,n,i])}(e,vs,!Xt,ln);const As=(0,d.ZR)(e,!on),{isPending:ys,translatedText:Cs}=(0,ee.A)(Gt,Mo,As?So:void 0,tn),ws=(0,z.A)(Cs,Boolean(As)),bs=Cs||ws,Is="phoneCall"===qo?.type?qo:void 0,Ss=(Vt||wt&&ht&&Fo)&&!hi&&"thread"===Dt&&!k,Ms=Vt?.isCommentsInfo&&!hi&&"thread"===Dt&&!k,Ns=!mo&&!Is&&!bt&&Pt&&!hi&&!di&&!Ni&&!kn,ks=!ei&&si&&(oi||(Ro||Oo||Go||"geo"===$o?.mediaType)&&(!ls||hs)),Ys=function(e,t,{poll:n,webPage:o,hasSubheader:i,isCustomShape:s,isLastInGroup:a,asForwarded:l,hasThread:c,forceSenderName:u,hasCommentCounter:h,hasCommentButton:m,hasActionButton:p,hasReactions:g,isGeoLiveActive:f,withVoiceTranscription:v,peerColorClass:A,hasOutsideReactions:y}={}){const{paidMedia:C}=(0,d.r_)(e),{photo:w,video:b}=N(C),I=(0,d.r_)(e),{photo:S=w,video:M=b,audio:k,voice:Y,document:P,contact:F,location:T,invoice:D,storyData:x,giveaway:E,giveawayResults:L}=I,B=t?.hasMultipleCaptions?void 0:(0,d.r_)(t?.captionMessage||e).text,R=Boolean(e.factCheck?.text),O="video"===M?.mediaType&&M.isRound,U=e.isInvertedMedia,K=S||M&&!O||t||o,z=[r.zPk],V=x||S||M||T||D?.extendedMedia||C,j=B||"venue"===T?.mediaType||f||R,J=V&&!j,$=Boolean(e.inlineButtons),q=Boolean(e.viaBotId),H=U&&K?!(!g||y)||!!R||!(!o||!j):j;return A&&z.push(A),!V&&e.emojiOnlyCount?(z.push("emoji-only"),e.emojiOnlyCount<=r.Apc&&z.push(`emoji-only-${e.emojiOnlyCount}`)):j?z.push("text"):z.push("no-text"),Object.keys(I).length||z.push("unsupported"),p&&z.push("has-action-button"),s&&(z.push("custom-shape"),O&&z.push("round"),h&&z.push("has-comment-counter")),V&&!v?z.push("media"):M?z.push("video"):k?z.push("audio"):Y?(z.push("voice"),v&&z.push("with-voice-transcription")):P?z.push("document"):F?z.push("contact"):n?z.push("poll"):E||L?z.push("giveaway"):"full"===o?.webpageType&&(z.push("web-page"),(o.photo||o.video)&&z.push("media"),o.document&&z.push("document"),o.gift&&z.push("gift")),D&&!D.extendedMedia&&z.push("invoice"),D&&D.photo&&z.push("has-photo"),x&&z.push("story"),l&&z.push("is-forwarded"),i&&z.push("has-subheader"),c&&z.push("has-replies"),g&&z.push("has-reactions"),y&&z.push("has-outside-reactions"),q&&z.push("is-via-bot"),u&&z.push("force-sender-name"),s||(z.push("has-shadow"),V&&c&&z.push("has-background"),(i||l||q||!J||u||R||v)&&z.push("has-solid-background"),R&&z.push("has-fact-check"),!a||$||!S&&J&&!m||z.push("has-appendix")),K&&U&&z.push("is-inverted-media"),H?z.push("has-footer"):z.push("no-footer"),z.join(" ")}(e,h,{poll:yn,webPage:Pn,hasSubheader:yi,isCustomShape:oi,isLastInGroup:te,asForwarded:ai,hasThread:ni&&!k,forceSenderName:de,hasCommentCounter:ni&&Vt.messagesCount>0,hasCommentButton:Ms,hasActionButton:gi||fi,hasReactions:si,isGeoLiveActive:"geoLive"===$o?.mediaType&&!(0,d.vz)(e),withVoiceTranscription:ei,peerColorClass:(0,I.y)(Ii,Si,!0),hasOutsideReactions:ks}),Ps=Ys.includes("has-appendix"),Fs=(0,M.Rr)(e.emojiOnlyCount),Ts=Nn?void 0:ci&&Mn?h.messages.length*Mn:Mn;let Ds,xs;Ds=Is||hi?"none":!ls||Pn||Fs||hs?hs&&!Fs&&(vi||Pn)?"in-text":"standalone":"in-text",si?ks?xs="outside":ai?(Ds="standalone",xs="inside"):xs="inside":xs="none";const Es=oi?"in-meta":"in-content";(0,E.A)(ps||Mo,ms,Pe,e.id,Ie||ze),(0,L.A)(gs||Mo,fs,Oe),(0,Z.A)({elementRef:qn,chatId:Mo,isFocused:Ze,focusDirection:Xe,noFocusHighlight:ot,isResizingContainer:st,isJustAdded:J,isQuote:Boolean(et),scrollTargetPosition:it});const Ls=pn?(0,l.em)(Wn,pn):void 0,Bs=!e.senderId,Rs=Ls||Bs&&e.postAuthorTitle||(ai||dt)&&No?.postAuthorTitle||void 0;(0,V.A)(qn,ae),(0,o.vJ)(()=>{const t=Hn.current;if(!t||!(0,w.Y)(t))return;jt&&jn({messageIds:[So]});let n=[];e.hasUnreadMention&&(n=[So]),h&&(n=h.messages.filter(e=>e.hasUnreadMention).map(e=>e.id)),n.length&&$n({chatId:Mo,messageIds:n})},[jt,h,Mo,So,jn,e.hasUnreadMention]);const Os=(0,o.Kr)(()=>ci?T(To,Boolean(m),h,ho):void 0,[ci,To,m,h,ho]),Us=ai&&!oi?28:0,Ks=(0,o.Kr)(()=>{let e,t,n,o="";if(!ci&&(Ro||Oo||Jo?.extendedMedia)){let n;if(Ro||Oo){const e=Ro||Oo;e&&!li&&(n=(0,Y.yA)({media:e,isOwn:To,asForwarded:ai,noAvatars:m,isMobile:ho}).width)}else if(Jo?.extendedMedia&&Jo.extendedMedia.width&&Jo.extendedMedia.height){const{width:e,height:t}=Jo.extendedMedia;n=(0,b.kn)({width:e,height:t,fromOwnMessage:To,asForwarded:ai,noAvatars:m,isMobile:ho}).width}n&&(n<(0,Y.Ay)(ho)&&(t=n),e=Math.max((0,Y.nP)(us?.text,ho,Ss),n))}else if(Os){const t=(0,Y.nP)(us?.text,ho,Ss);e=Math.max(t,Os.containerStyle.width)}if(e)o=`width: ${e}px`,n=e+Vn;else if(Vo&&!yi){const{width:e}=(0,b.bu)(Vo,ho);o=`width: ${e+Us}px`,n=e+Vn}return{contentWidth:t,style:o,reactionsMaxWidth:n}},[Os,ai,Us,yi,Jo?.extendedMedia,ci,Ss,ho,To,m,Ro,Vo,us?.text,Oo,li]),{contentWidth:zs,style:Vs,reactionsMaxWidth:js}=Ks;function Js(e){if(rs)return(0,be.Y)(ke.A,{messageOrStory:rs,translatedText:tn?bs:void 0,isForAnimation:e,focusedQuote:et,focusedQuoteOffset:nt,emojiSize:Fs,highlight:vt,isProtected:We,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,withTranslucentThumbs:oi,isInSelectMode:bt,canBeEmpty:vi,maxTimestamp:Cn,threadId:Mt})}const $s=(0,o.hb)(()=>{if(Pt)return(0,be.Y)("div",{className:(0,f.A)("quick-reaction","no-selection",Bi&&!Ct&&"visible"),onClick:xi,ref:Gn,children:(0,be.Y)(Ye.A,{reaction:Pt,size:zn,availableReactions:kt,observeIntersection:u})})},[Ct,kt,Pt,xi,Bi,u]);function qs(){const t=(0,be.Y)(en,{message:e,isPinned:Et,withFullDate:dt&&!To,noReplies:P,repliesThreadInfo:Vt,outgoingStatus:Je,signature:Rs,withReactionOffset:"inside"===xs,renderQuickReactionButton:Ns&&"in-meta"===Es?$s:void 0,availableReactions:kt,isTranslated:Boolean(tn?bs:void 0),effectEmoji:An?.emoticon,onClick:Hi,onEffectClick:as,onTranslationClick:Gi,onOpenThread:Wi,paidMessageStars:Ts});return"inside"!==xs?t:(0,be.Y)(fn.A,{message:Nt,threadId:Mt,metaChildren:t,observeIntersection:u,noRecentReactors:ht,tags:hn,isCurrentUserPremium:W,isAccountFrozen:kn})}function Hs(e){const t=(0,f.A)("text-content","clearfix"),n=(0,f.A)("text-content","clearfix","in-text"===Ds&&"with-meta",Je&&"with-outgoing-icon"),o=ci||!ci&&Ro||!ci&&Oo&&!li||!ii&&vi,i="in-text"===Ds;return(0,be.FD)(be.FK,{children:[Gs(),ls&&!ii&&(0,be.FD)("div",{className:t,dir:"auto",children:[Js(),ys&&(0,be.Y)("div",{className:"translation-animation",children:(0,be.Y)("div",{className:"text-loading",children:Js(!0)})}),!o&&i&&qs()]}),o&&(0,be.FD)(be.FK,{children:[Ws(e),!ii&&(0,be.FD)("div",{className:n,dir:"auto",children:[vi&&(0,be.Y)(pt,{factCheck:Po,isToggleDisabled:bt}),i&&qs()]})]})]})}function Gs(){const t=(0,d.T_)(e);if(t&&Pn)return(0,be.Y)(Kn,{messageWebPage:t,webPage:Pn,message:e,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,noAvatars:m,canAutoLoad:Rt,canAutoPlay:Ot,asForwarded:ai,isDownloading:Bt,isProtected:We,theme:re,story:rn,isConnected:dn,lastPlaybackTimestamp:wn,backgroundEmojiId:Ii?.color?.backgroundEmojiId,shouldWarnAboutFiles:cn,autoLoadFileMaxSizeMb:zt,onAudioPlay:ji,onMediaClick:zi,onDocumentClick:Vi,onCancelMediaTransfer:Qi})}function Ws(e){const t=(0,be.FD)(be.FK,{children:[ci&&n&&(0,be.Y)(je,{album:h,albumLayout:Os,observeIntersection:n,isOwn:To,isProtected:We,hasCustomAppendix:e,onMediaClick:Ji}),!ci&&Ro&&(0,be.Y)(Ue.A,{messageText:us?.text,photo:Ro,isOwn:To,observeIntersection:n,noAvatars:m,canAutoLoad:Rt,uploadProgress:$e,shouldAffectAppendix:e,isDownloading:Bt,isProtected:We,asForwarded:ai,theme:re,isMediaNsfw:bn,forcedWidth:zs,onClick:$i,onCancelUpload:Qi}),!ci&&Oo&&!li&&(0,be.Y)(Ke.A,{video:Oo,isOwn:To,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,forcedWidth:zs,noAvatars:m,canAutoLoad:Rt,canAutoPlay:Ot,uploadProgress:$e,isDownloading:Bt,isProtected:We,asForwarded:ai,isMediaNsfw:bn,lastPlaybackTimestamp:wn,onClick:qi,onCancelUpload:Qi})]});return Eo?(0,be.Y)(sn,{chatId:Mo,messageId:So,paidMedia:Eo,isOutgoing:To,children:t}):t}function _s(){return!(oi&&!ko)&&(A&&(!(Ro||Oo||$o||Eo)||Ht)||ai||ko||de)&&!ui&&!(xo&&oi)}function Qs(){return(0,be.FD)("span",{className:"forward-title-container",children:[ai&&(0,be.Y)(Ce.A,{name:No?.hiddenUserName?"forward":"share-filled"}),ai&&(0,be.Y)("span",{className:"forward-title",children:Wn("ForwardedFrom")})]})}const Zs=(0,U.A)(t=>{"suggestedMessage"===t.button.type&&("approve"!==t.button.buttonType?"decline"!==t.button.buttonType?Bn({...t,button:t.button}):ro():On({chatId:Mo,messageId:e.id}))}),Xs=(0,U.A)(e=>{uo(e.target.value)}),ea=(0,U.A)(()=>{Rn({chatId:Mo,messageId:e.id,rejectComment:co.trim()||void 0}),lo(),uo("")});function ta(t=!1,o=!1){let i;!Mi||oi&&ko?No?.hiddenUserName?i=No.hiddenUserName:Go&&Ae&&(i=(0,l.em)(Wn,Ae)):i=(0,l.em)(Wn,Mi);const s=Mi&&"emojiStatus"in Mi&&Mi.emojiStatus,a=Mi&&"isPremium"in Mi&&Mi.isPremium,c=ai&&Mi,h=ye?.hasUsername;return(0,be.FD)("div",{className:"message-title",dir:"ltr",children:[i||ai?(0,be.FD)("span",{className:(0,f.A)("message-title-name-container",No?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!t&&Qs(),(0,be.FD)("span",{className:"message-title-name",children:[Go&&(0,be.Y)(Ce.A,{name:"play-story"}),c&&(0,be.Y)(me.A,{className:"forward-avatar",peer:Mi,size:"micro"}),(0,be.Y)("span",{className:"sender-title",onClick:Oi,children:i?(0,S.A)(i):ai?" ":void 0}),!ai&&s&&(0,be.Y)(pe.A,{documentId:s.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:n,observeIntersectionForPlaying:u}),!ai&&!s&&a&&(0,be.Y)(Ne.A,{}),Mi?.fakeType&&(0,be.Y)(Me.A,{fakeType:Mi.fakeType})]})]}):ye?void 0:" ",ye?.hasUsername&&(0,be.FD)("span",{className:"interactive",children:[(0,be.Y)("span",{className:"via",children:Wn("ViaBot")}),(0,be.Y)("span",{className:"sender-title",onClick:Ui,children:(0,S.A)(`@${(0,d.Kl)(ye)}`)})]}),(0,be.Y)("div",{className:"title-spacer"}),o||h?void 0:No?.isLinkedChannelPost?(0,be.Y)("span",{className:"admin-title",dir:"auto",children:Wn("DiscussChannel")}):e.postAuthorTitle&&mt&&!ai?(0,be.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!$t||ai||ko?void 0:(0,be.Y)("span",{className:"admin-title",dir:"auto",children:$t.customTitle||Wn($t.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),ri&&(0,be.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,be.Y)(Ce.A,{name:un>1?"boosts":"boost"}),un>1?un:void 0]})]})}const na=mt&&ai?e.postAuthorTitle:void 0,oa=e.suggestedPostInfo&&!e.isOutgoing&&!e.suggestedPostInfo.isAccepted&&!e.suggestedPostInfo.isRejected,ia=(0,o.Kr)(()=>{if(!e.suggestedPostInfo?.scheduleDate||!Yn)return!1;const t=(0,y.Fm)();return e.suggestedPostInfo.scheduleDate<=t+Yn},[e.suggestedPostInfo,Yn]);return(0,be.FD)("div",{ref:qn,id:(0,d.GZ)(e.id),className:cs,"data-message-id":So,onCopy:We?C.A:void 0,onMouseDown:ki,onClick:Yi,onContextMenu:Pi,onDoubleClick:Fi,onMouseEnter:hi?Ri:void 0,onMouseMove:Ns?Di:void 0,onMouseLeave:Ns||hi?Ei:void 0,children:[(0,be.Y)("div",{ref:Hn,className:"bottom-marker","data-message-id":So,"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":jt||void 0,"data-is-pinned":Et||void 0,"data-should-update-views":void 0!==e.viewsCount}),!qe&&(0,be.Y)("div",{className:"message-select-control no-selection",children:It&&(0,be.Y)(Ce.A,{name:"select"})}),oe&&(0,be.Y)("div",{className:(0,f.A)("message-select-control group-select no-selection",St&&"is-selected"),onClick:os,children:St&&(0,be.Y)(Ce.A,{name:"select"})}),(0,be.FD)("div",{className:(0,f.A)("message-content-wrapper",Ys.includes("text")&&"can-select-text",Ys.includes("giveaway")&&"giveaway-result-content"),children:[(0,be.FD)("div",{className:Ys,style:Vs,dir:"auto",children:[ai&&!ui&&(0,be.FD)(be.FK,{children:[_s()&&ta(),na&&(0,be.Y)("span",{className:"admin-title",dir:"auto",children:na})]}),function(){const t=(0,f.A)("content-inner",ai&&"forwarded-message",Ai&&"forwarded-custom-shape",yi&&"with-subheader"),o=te&&(!ls||hs&&!vi&&"inside"!==xs)&&!Ms,i=(0,f.A)("text-content","clearfix","in-text"===Ds&&"with-meta",Je&&"with-outgoing-icon"),s=!Ni||!To||dt;return(0,be.FD)("div",{className:t,onDoubleClick:Ti,dir:"auto",children:[!ai&&_s()&&ta(),yi&&(0,be.FD)("div",{className:"message-subheader",children:[Ht&&(0,be.Y)(xe,{topic:qt,onClick:is,className:"message-topic"}),Ai&&(0,be.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,be.Y)("div",{className:"message-title",children:Qs()}),ta(!0,!0)]}),xo&&(0,be.Y)(ve.A,{message:Pe,replyInfo:Zo,noUserColors:Si,isProtected:We,sender:Fe,senderChat:De,forwardSender:Te,chatTranslations:Gt,isMediaNsfw:In,requestedChatTranslationLanguage:on,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onClick:Ki}),ti&&(0,be.Y)(Se,{story:Oe,sender:Ve,noUserColors:Si,isProtected:We,observeIntersectionForLoading:n,onClick:ss})]}),Vo&&n&&u&&(0,be.Y)(Sn,{message:e,observeIntersection:n,observeIntersectionForPlaying:u,shouldLoop:Kt,shouldPlayEffect:oo,withEffect:an,isMediaNsfw:bn,onStopEffect:so}),ii&&yt&&(0,be.Y)(Ge,{customEmojiId:yt,withEffects:an&&Nn&&!An,isOwn:To,observeIntersection:n,forceLoadPreview:Fo,messageId:So,chatId:Mo,activeEmojiInteractions:Tt}),ii&&At&&(0,be.Y)(_e,{emoji:At,withEffects:an&&Nn&&!An,isOwn:To,observeIntersection:n,forceLoadPreview:Fo,messageId:So,chatId:Mo,activeEmojiInteractions:Tt}),an&&An&&!Fo&&(0,be.Y)(Qt.A,{shouldPlay:oo,messageId:e.id,isMirrored:!e.isOutgoing,effect:An,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onStop:so}),Is&&(0,be.Y)(nn,{message:e,phoneCall:Is,chatId:Mo}),!ci&&li&&!ei&&(0,be.Y)(vn.A,{message:e,observeIntersection:n,canAutoLoad:Rt,isDownloading:Bt,onReadMedia:s?_i:void 0,onHideTranscription:Zn,isTranscriptionError:Yo,isTranscribed:Boolean(se),canTranscribe:mn&&!Ni,isTranscriptionHidden:Qn,isTranscribing:ie}),(Uo||Ko||ei)&&(0,be.Y)(he.Ay,{theme:re,message:e,origin:a.d9.Inline,uploadProgress:$e,isSelectable:qe,isSelected:It,noAvatars:m,onPlay:ji,onReadMedia:Ko&&s?_i:void 0,onCancelUpload:Qi,isDownloading:Bt,isTranscribing:ie,isTranscriptionHidden:Qn,isTranscribed:Boolean(se),isTranscriptionError:Yo,canDownload:!We,onHideTranscription:Zn,canTranscribe:mn&&!Ni}),zo&&(0,be.Y)(ge.A,{document:zo,message:e,observeIntersection:n,canAutoLoad:Rt,autoLoadFileMaxSizeMb:zt,uploadProgress:$e,isSelectable:qe,isSelected:It,onMediaClick:Vi,onCancelUpload:Qi,isDownloading:Bt,shouldWarnAboutFiles:cn}),Go&&!di&&(0,be.Y)(Fn,{message:e,isProtected:We}),di&&(0,be.Y)(Tn,{message:e}),jo&&(0,be.Y)(at,{contact:jo,noUserColors:To}),yn&&(0,be.Y)(gn,{message:e,poll:yn,onSendVote:Zi}),Qo&&(0,be.Y)(Dn,{message:e,todoList:Qo}),(Wo||_o)&&(0,be.Y)(Yt,{message:e}),Ho&&(0,be.Y)(ft,{message:e,threadId:Mt,canAutoLoadMedia:Rt}),Jo?.extendedMedia&&(0,be.Y)(Ut,{message:e,isConnected:dn}),ei&&(0,be.Y)("p",{className:(0,f.A)("transcription",!Qn&&Yo&&"transcription-error"),dir:"auto",children:Yo?Wn("NoWordsRecognized"):ie&&se?(0,be.Y)(fe.A,{content:se}):se}),hs&&Hs(o),!hs&&(0,be.FD)(be.FK,{children:[Ws(o),ls&&!ii&&(0,be.FD)("div",{className:i,dir:"auto",children:[Js(),ys&&(0,be.Y)("div",{className:"translation-animation",children:(0,be.Y)("div",{className:"text-loading",children:Js(!0)})}),vi&&(0,be.Y)(pt,{factCheck:Po,isToggleDisabled:bt}),"in-text"===Ds&&qs()]}),Gs()]}),Jo&&!Jo.extendedMedia&&(0,be.Y)(Lt,{message:e,shouldAffectAppendix:o&&!si,isInSelectMode:bt,isSelected:It,theme:re,forcedWidth:zs}),$o&&(0,be.Y)(Wt,{message:e,isInSelectMode:bt,isSelected:It,theme:re,peer:ce})]})}(),!hi&&"standalone"===Ds&&!di&&qs(),pi&&(0,be.FD)("div",{className:(0,f.A)("message-action-buttons",He&&"message-action-buttons-shown"),children:[Ms&&oi&&(0,be.Y)(tt,{threadInfo:Vt,disabled:k,isLoading:He,isCustomShape:!0,asActionButton:!0}),gi&&(0,be.Y)(Le.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:Wn("lng_context_forward_msg"),onClick:oe?Xi:es,children:(0,be.Y)(Ce.A,{name:"share-filled"})}),fi&&(0,be.Y)(Le.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:_n("FocusMessage"),onClick:xt?ts:ns,children:(0,be.Y)(Ce.A,{name:"arrow-right"})})]}),Ms&&!(pi&&oi)&&(0,be.Y)(tt,{threadInfo:Vt,disabled:k,isLoading:He}),Ps&&(0,be.Y)(_t.A,{isOwn:To}),Ns&&"in-content"===Es&&$s()]}),e.inlineButtons&&(0,be.Y)(Ft,{message:e,onClick:Ln}),oa&&(0,be.Y)(Ft,{message:{...e,inlineButtons:[[{type:"suggestedMessage",buttonType:"decline",text:_n("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:_n("SuggestedPostApprove"),disabled:ia}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:_n("SuggestedPostSuggestChanges")}]]},onClick:Zs}),"outside"===xs&&!di&&(0,be.Y)(fn.A,{message:Nt,threadId:Mt,isOutside:!0,isCurrentUserPremium:W,maxWidth:js,observeIntersection:u,noRecentReactors:ht,tags:hn,isAccountFrozen:kn})]}),go&&(0,be.Y)(lt,{isOpen:po,anchor:go,targetHref:fo?.matches("a[href]")?fo.href:void 0,message:e,album:h,messageListType:Dt,onClose:yo,onCloseAnimationEnd:Co,repliesThreadInfo:Vt,noReplies:P,detectedLanguage:vs}),ao&&(0,be.FD)(Be.A,{isOpen:ao,onClose:lo,title:_n("SuggestedPostDecline"),confirmLabel:_n("SuggestedPostDecline"),confirmHandler:ea,confirmIsDestructive:!0,children:[(0,be.Y)("div",{className:"decline-dialog-question",children:(0,S.A)(_n("DeclinePostDialogQuestion",{sender:ce?(0,l.em)(Wn,ce):""},{withNodes:!0,withMarkdown:!0}))}),(0,be.Y)(Re.A,{placeholder:_n("DeclineReasonPlaceholder"),value:co,onChange:Xs,maxLength:200})]})]})}))},91930:(e,t,n)=>{n.d(t,{A:()=>E,b:()=>x});var o=n(84051),i=n(31481),s=n(90709),a=n(3544),r=n(70636),d=n(87357),l=n(17663),c=n(9716),u=n(91034),h=n(48775),m=n(76023),p=n(4961),g=n(18501),f=n(35749),v=n(2338),A=n(11217),y=n(5912),C=n(39351),w=n(62587),b=n(59030),I=n(64154),S=n(42452),M=n(18276),N=n(27860),k=n(18653),Y=n(86070),P=n(20021);const F=" ",T=({className:e,message:t,replyInfo:n,suggestedPostInfo:u,sender:m,senderChat:N,forwardSender:T,composerForwardSenders:x,title:E,customText:L,isProtected:B,isInComposer:R,noUserColors:O,chatTranslations:U,requestedChatTranslationLanguage:K,isMediaNsfw:z,noCaptions:V,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,onClick:$})=>{const q=(0,o.li)(),H=(0,y.Vz)(q,j),G=(0,o.Kr)(()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}},[t,n]),W=G?.content?.video?.isGif?G.content.video:void 0,_=Boolean(W&&!W.previewPhotoSizes?.length),Q=(0,f.A)(G,_?"full":"pictogram"),Z=(0,w.A)(Q,!H),X=(0,v.A)(G),ee=Boolean(G&&(0,s.lk)(G)),te=Boolean(G&&(0,s.y2)(G))||z,ne=Boolean("message"===n?.type&&n.isQuote),oe="message"===n?.type?n.replyFrom:void 0,ie=t&&(0,s.ZR)(t),{translatedText:se}=(0,I.A)(U,t?.chatId,ie?t?.id:void 0,K),ae=(0,b.A)(),re=(0,C.A)(),de=m?(0,r.F9)(ae,m):oe?.hiddenUserName||t?.forwardInfo?.hiddenUserName,le=(0,o.Kr)(()=>{if(!x)return;const e=x.map(e=>(0,r.F9)(re,e)).filter(Boolean);return re.conjunction(e)},[x,re]),ce=N?(0,r.F9)(ae,N):void 0,ue=T?(0,r.F9)(ae,T):t?.forwardInfo?.hiddenUserName,he=m&&m.id===T?.id,{handleClick:me,handleMouseDown:pe}=(0,A.Q)($);return(0,P.FD)(Y.A,{peer:m,emojiIconClassName:"EmbeddedMessage--background-icons",ref:q,shouldReset:!0,noUserColors:O,className:(0,d.A)("EmbeddedMessage",e,ne&&"is-quote",X&&"with-thumb","no-selection",x&&"is-input-forward",u&&"is-suggested-post"),dir:re.isRtl?"rtl":void 0,onClick:me,onMouseDown:pe,children:[(0,P.Y)("div",{className:"hover-effect"}),(0,P.Y)(S.A,{}),X&&D(X,Z,_,ee,B,te),(0,P.FD)("div",{className:"message-text",children:[(0,P.Y)("p",{className:(0,d.A)("embedded-text-wrapper",ne&&"multiline"),children:function(){if(u){if(!u?.price?.amount&&!u.scheduleDate)return re("ComposerEmbeddedMessageSuggestedPostDescription");const e=u.price?u.price.currency===i.ykW?(0,h.Ms)(re,u.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,h.U2)(re,u.price.amount,{className:"suggested-price-star-icon"}):"",t=u.scheduleDate?(0,l.e0)(u.scheduleDate,re,ae):"";return e&&!t?(0,P.Y)("span",{className:"suggested-post-price-wrapper",children:re("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,P.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,g.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?V?re("EmbeddedMessageNoCaption"):(0,P.Y)(k.A,{message:t,noEmoji:Boolean(X),translatedText:se,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,emojiSize:17}):L||function(e){if(!e||e.content.text)return F;const t=(0,a.GG)(re,e.content,{});return t?(0,P.Y)("span",{children:(0,p.A)(t)}):F}(G)||F}()}),(0,P.FD)("div",{className:"message-title",children:[function(){if(E)return(0,p.A)(E);if(u&&n)return re("TitleSuggestedChanges");if(u)return re("ComposerEmbeddedMessageSuggestedPostTitle");if(!de&&!le)return F;let e;N&&((0,s.WX)(N)&&(e="channel-filled"),(0,s.YE)(N)&&(e="group-filled"));const t=R&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,P.FD)("span",{className:"embedded-sender-wrapper",children:[(!N||!!(0,c.L8)(N?.id)||N.id!==m?.id)&&(0,P.FD)("span",{className:"embedded-sender",children:[!x&&de&&(0,p.A)(t?ae("ReplyToQuote",de):de),le&&(0,p.A)(re("ComposerTitleForwardFrom",{users:le},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,P.Y)(M.A,{name:e,className:"embedded-chat-icon"}),e&&ce&&(0,P.Y)("span",{className:"embedded-sender-chat",children:(0,p.A)(ce)})]})}(),ue&&!he&&(0,P.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,P.Y)(M.A,{name:T?"share-filled":"forward",className:"embedded-origin-icon"}),(0,P.Y)("span",{className:"forward-sender-title",children:(0,p.A)(ue)})]})]})]})]})};function D(e,t,n,o,i,s){const{width:a,height:r}=(0,m.mr)(),l=t||e,c=n&&t;return(0,P.FD)("div",{className:(0,d.A)("embedded-thumb",o&&"round"),children:[!s&&!c&&(0,P.Y)("img",{src:l,width:a,height:r,alt:"",className:"pictogram",draggable:!1}),!s&&c&&(0,P.Y)("video",{src:t,width:a,height:r,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,P.Y)(N.A,{thumbDataUri:c?e:l,isVisible:Boolean(s),width:a,height:r}),i&&(0,P.Y)("span",{className:"protector"})]})}const x=(0,u.A)(T),E=T},92111:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(91048),d=n(39761),l=n(87679),c=n(58554),u=n(95704),h=n(37836),m=n(46051),p=n(66991);const g={},f=(0,h.v7)(1e3),v=function(e,t){(0,o.vJ)(()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach(e=>{const n=t||(0,i.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await f,e.forEach(({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,u.h)((0,c.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):c.hd(e,t).then(e=>{e&&(t===s.qZ.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout(()=>{(0,d.A)(n),t.removeChild(n)},1e3)}(e),t===s.qZ.BlobUrl&&(0,l.NN)(e))})})})(function(e,t){const n=(0,r._bp)((0,i.mS)(),e);if(!n||!n.orderedIds?.length)return[];const o=function(e,t){const n=e.indexOf(t),o=Math.max(n-5,0),i=Math.min(n+5,e.length);return e.slice(o,i)}(n.orderedIds,t),d=[];return o.forEach(t=>{if(g[e]?.has(t))return;const o=n.byId[t];if(!o||!("content"in o))return;const i=Boolean(o.content.video);d.push({hash:(0,a.EN)(o,"full"),format:i?s.qZ.Progressive:s.qZ.BlobUrl,isStream:i&&(0,p.c)(m.G)}),d.push({hash:(0,a.EN)(o),format:s.qZ.BlobUrl}),o.content.altVideos&&d.push({hash:(0,a.EN)(o,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)}),d}(e,n))})},[t,e])}},93809:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(35297);function a(e,t){const n=void 0===t,a=(0,o.li)(n),r=(0,o.li)(),d=(0,i.A)();return(0,s.A)(()=>{n||(a.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))},e),(0,o.vJ)(()=>{if(n||a.current)return;const e=()=>{a.current=!0,d()};t>0?r.current=window.setTimeout(e,t):e()},e),a.current}},95362:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(37836);const i=10,s=1e3;let a=[],r=!1;function d(e,t){a.push({url:e,filename:t}),r||(r=!0,setTimeout(async()=>{await async function(){let e=0;for(const t of a)l(t),e++,e===i&&(await(0,o.v7)(s),e=0);a=[]}(),r=!1},s))}function l({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:()=>c});var o=n(23174),i=n(4875);const s=262144,a=5242879,r=new Map,d=new Map,l=new Map;async function*c(e,t=0,n=s){const c=e.match(/fileSize=(\d+)/);let u;for(u=c?c&&Number(c[1]):d.get(e);;){if(u&&t>=u)return;let s=t+n-1;u&&s>u&&(s=u-1);const c=`${e}:${t}-${s}`;let h=r.get(c);if(!h){let n=l.get(c);n||(n=(0,i.px)("downloadMedia",{mediaFormat:o.qZ.Progressive,url:e,start:t,end:s}),l.set(c,n));const m=await n.finally(()=>{l.delete(c)});if(!m?.arrayBuffer)return;m.fullSize&&!u&&(u=m.fullSize,d.set(e,m.fullSize)),h=m.arrayBuffer,s<=a&&r.set(c,m.arrayBuffer)}yield h,t=s+1}}},97046:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97676:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(87357),s=n(37661),a=n(5912),r=n(17712),d=n(62587),l=n(10221),c=n(18104),u=n(3325);var h=n(20021);const m=(0,o.ph)(({messageId:e,isMirrored:t,effect:n,shouldPlay:m,observeIntersectionForLoading:p,observeIntersectionForPlaying:g,onStop:f})=>{const v=(0,o.li)(),A=(0,o.li)(),y=(0,a.Vz)(v,p),C=(0,a.Vz)(v,g),[w,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,d.A)(k,!y),P=(0,r.A)(()=>{I(),f?.()}),F=(0,l.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,o.vJ)(()=>{S&&F(),N()},[F,N,S]),(0,o.vJ)(()=>{C&&m&&Y&&(b(),M())},[C,Y,m,F]);const T=(0,i.A)("McmbiWZE",t&&"wNvU2uqi");return(0,h.Y)("div",{className:(0,i.A)("IYu2f7FM",t&&"GsTZawTE"),ref:v,children:w&&(0,h.Y)(u.A,{children:(0,h.Y)(c.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 o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}}}]);
//# sourceMappingURL=1533.3c81535df26ae9299c4b.js.map