2 lines
353 KiB
JavaScript
2 lines
353 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1241],{45:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(84051),o=n(41036),s=n(18276),a=n(20021),r=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(r||{});const l=(0,i.ph)(e=>{let{status:t}=e;return(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(o.Ay,{name:"reveal",activeKey:r[t],children:"failed"===t?(0,a.Y)("div",{className:"MessageOutgoingStatus--failed",children:(0,a.Y)(s.A,{name:"message-failed"})}):(0,a.Y)(s.A,{name:`message-${t}`})})})})},285:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(90709),a=n(91048),r=n(4961),l=n(59030),d=n(94189),c=n(20021);const u=(0,i.ph)((0,o.EK)((e,t)=>{let{userId:n}=t;const i=(0,a.meB)(e),o=n&&(0,a.mBe)(e,n);return{chat:i,contactName:o?(0,s.u0)(o):void 0}})(e=>{let{isOpen:t,chat:n,userId:s,contactName:a,onClose:u}=e;const{deleteChatMember:h}=(0,o.ko)(),m=(0,l.A)(),p=(0,i.hb)(()=>{h({chatId:n.id,userId:s}),u()},[n,h,u,s]);if(n&&s)return(0,c.Y)(d.A,{isOpen:t,onClose:u,title:m("GroupRemoved.Remove"),textParts:(0,r.A)(m("PeerInfo.Confirm.RemovePeer",a)),confirmLabel:m("lng_box_remove"),confirmHandler:p,confirmIsDestructive:!0})}))},2178:(e,t,n)=>{n.d(t,{v:()=>r});var i=n(84051),o=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,o.h)();function r(e){(0,i.vJ)(()=>{if(!e)return;const t=Object.entries(e);return a.addCallback(function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach(t=>{let[n,i]=t;(function(e){return t=>function(e,t){const{alt:n,ctrl:i,meta:o,mod:s,shift:a,key:r}=e,{altKey:l,ctrlKey:d,metaKey:c,shiftKey:u,key:h}=t;if(n!==l)return!1;if(s){if(!d&&!c)return!1}else{if(i!==d)return!1;if(o!==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")},i=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find(e=>!i.includes(e))}}(e),t)})(n)(e)&&i(e)})})},[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},2429:(e,t,n)=>{n.d(t,{A:()=>i});const i={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},3225:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(16120),l=n(96454),d=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,o.ko)(),[M,N,Y]=(0,g.A)(!1),k=(0,h.gs)(()=>{const n=t();if(!e||!n||!C()?.collapsed)return;if(!n.match(l.TL?r.A:s.bpX))return;const i=(0,c.LV)(w.current);return i.match(l.TL?A:y)?.[0]},[t,C,w,e],v),P=(0,m.A)(k,[k,t,C],!0),F=(0,p.A)(()=>Boolean(P()),[P]),T=Boolean(b?.length);(0,i.vJ)(()=>{if(!e||!F)return;const t=P();if(t){if(!T){const e=l.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 i=P();if(!e||!i)return;const o=w.current,s=(0,c.LV)(o),r=l.TL?i:i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/i.length,p=s.replace(h,(0,u.hB)(t).repeat(m)),g=o.innerHTML.substring(s.length);n(`${p}${g}`),(0,a.Uz)(()=>{(0,d.A)(o,!0,!0)})});return(0,i.vJ)(Y,[Y,t]),{isCustomEmojiTooltipOpen:Boolean(F&&T&&!M),closeCustomEmojiTooltip:N,insertCustomEmoji:D}}},5130:(e,t,n)=>{n.d(t,{U:()=>a});var i=n(14235),o=n(37836);class s{requestStates=new Map;requestStatesByCallback=new Map;pendingPayloads=[];pendingTransferables=[];constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n}destroy(){}init(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.postMessageOnTickEnd({type:"init",args:t})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,{transferables:o,...s}=e,a=(0,i.A)(),r={type:"callMethod",messageId:a,...s},l={messageId:a},d=new Promise((e,t)=>{Object.assign(l,{resolve:e,reject:t})});if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();l.callback=e,n.set(e,l)}return t.set(a,l),d.catch(()=>{}).finally(()=>{t.delete(a),l.callback&&n.delete(l.callback)}),this.postMessageOnTickEnd(r,o),d}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessageOnTickEnd({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;e.channel===n&&e.payloads.forEach(e=>{if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)})}postMessageOnTickEnd(e,t){this.pendingPayloads.push(e),t&&this.pendingTransferables.push(...t),this.postMessagesOnTickEnd()}postMessagesOnTickEnd=(0,o.Fe)(()=>{const{channel:e}=this,t=this.pendingPayloads,n=this.pendingTransferables;this.pendingPayloads=[],this.pendingTransferables=[],this.target.postMessage({channel:e,payloads:t},n)})}function a(e,t,n){const i=new s(e,t,n);function o(e){let{data:t}=e;i.onMessage(t)}return e.addEventListener("message",o),i.destroy=()=>{e.removeEventListener("message",o)},i}},6070:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"CustomSendMenu",!t);return n?(0,s.Y)(n,{...e}):void 0}},9442:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(23174),a=n(66644),r=n(90709),l=n(70636),d=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)(),[Y,k]=(0,i.J0)(),[P,F,T]=(0,g.A)(!1),D=(0,m.gs)(()=>{const n=t();if(!e||!C()?.collapsed||!n.includes("@"))return;const i=(0,u.LV)(b.current);return(0,h.S)(i).match(y)?.[0].trim()},[e,t,C,b],A),x=(0,p.A)(D,[D,t,C],!0),E=(0,p.A)(()=>e&&t().startsWith("@"),[t,e]);(0,i.vJ)(()=>{const e=x();if(!e||!I&&!S)return void k(void 0);const t=(0,o.mS)().users.byId;if(!t)return void k(void 0);const n=I?.reduce((e,t)=>(t.userId!==M&&e.push(t.userId),e),[]),i=e.substring(1),s=(0,l.PU)({ids:(0,c.Am)([...E()&&S||[],...n||[]]),query:i,type:"user"});k(Object.values((0,c._E)(t,s)))},[M,I,S,x,E]);const L=(0,v.A)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e.hasUsername&&!(0,l.F9)(N,e))return;const o=(0,r.Kl)(e),c=(0,l.F9)(N,e)||"",h=o?`@${o}`:`<a\n class="text-entity-link"\n data-entity-type="${s.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${c}</a>`,m=b.current,p=w((0,u.LV)(m)),g=i?p.length:p.lastIndexOf("@"),f=(o?o.length+1:c.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${h} `,i=w(m.innerHTML).substring(p.length),o=(0,u.JC)(m);n(`${e}${i}`),(0,a.Uz)(()=>{const e=o+f+1;(0,d.A)(m,t),e>=0&&(0,u.vZ)(m,e)})}k(void 0)});return(0,i.vJ)(T,[T,t]),{isMentionTooltipOpen:Boolean(Y?.length&&!P),closeMentionTooltip:F,insertMention:L,mentionFilteredUsers:Y}}function w(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},9717:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(87894),s=n(79882),a=n(73767);function r(e,t){const n=(0,i.Kr)(()=>{if(e)return e.reduce((e,t,n)=>(e[t]=n,e),{})},[e]),r=(0,a.A)(n),l=(0,a.A)(t),d=(0,i.Kr)(()=>n&&r&&t===l?(0,o.LG)(n,(e,t)=>void 0!==r[t]?e-r[t]:-1/0):{},[t,n,l,r]);return{orderDiffById:d,getAnimationType:(0,s.W)(d)}}},10221:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(84051),o=n(66644),s=n(76023),a=n(17712);const r=s.$;function l(e){let{anchorRef:t,overlayRef:n,isMirrored:s,isForMessageEffect:l,isDisabled:d,id:c}=e;const u=(0,a.A)(()=>{const e=n.current,i=t.current;if(!e||!i)return;const a=i.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.innerWidth;(0,o.RK)(()=>{const t=a.top+a.height/2,n=a.bottom,i=l?n:t;e.style.top=i-d.height/2+"px",s?e.style.left=a.left-r+"px":e.style.right=c-a.right-r+"px"})});return(0,i.vJ)(()=>{d||u()},[d,c]),(0,i.vJ)(()=>{if(d)return;const e=t.current.closest(".MessageList");return e?(e.addEventListener("scroll",u,{passive:!0}),()=>{e.removeEventListener("scroll",u)}):void 0},[d,t]),u}},11359:(e,t,n)=>{n.d(t,{L:()=>o});const i=5;function o(e,t){const{commonAncestorContainer:n}=e;let o=n,s=1;for(;o&&o.id!==t&&s<i;)o=o.parentElement,s++;return Boolean(o&&o.id===t)}},11462:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(30857),s=n(17712),a=n(35297);function r(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,i.li)(e),n=(0,i.li)(!1),r=(0,o.A)();(0,a.A)(()=>{e&&(t.current=!0)},[e]);const l=(0,s.A)(()=>{t.current=!1,n.current=!1,r()}),d=(0,s.A)(()=>{n.current=!0,r()});return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:l,handleForumPanelAnimationStart:d}}},14413:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(84051),o=n(13439),s=n(31481),a=n(39351),r=n(19806),l=n(94189);var d=n(20021);const c=(0,i.ph)((0,o.EK)(e=>({verifyAgeMin:e.appConfig.verifyAgeMin||s.lYi}))(e=>{let{isOpen:t,onClose:n,shouldAlwaysShow:i,onAlwaysShowChanged:o,confirmHandler:s,verifyAgeMin:c}=e;const u=(0,a.A)();return(0,d.FD)(l.A,{title:u("TitleSensitiveModal",{years:c}),confirmLabel:u("ButtonSensitiveView"),isOpen:t,onClose:n,confirmHandler:s,children:[u("TextSensitiveModal"),(0,d.Y)(r.A,{className:"mYXi2mIC",label:u("ButtonSensitiveAlways",{years:c}),checked:i,onCheck:o})]})}))},15006:(e,t,n)=>{n.d(t,{U:()=>p,A:()=>m});var i=n(84051),o=n(13439),s=n(31481),a=n(91048),r=n(6842),l=n(14235);const d={root:"AN8wkEiR",ghost:"ANWk2pWP",scale:"kMHxyoSt",elementContainer:"UDCMfXxs"};var c=n(20021);const u=50,h=1e3,m=(0,i.ph)(()=>(0,c.Y)("div",{className:d.root,id:s.Lj4}));function p(e){const t=(0,o.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),i=n.left+window.scrollX,h=n.top+window.scrollY,m=n.width,p=n.height;if(i+m+u<0||i-u>window.innerWidth||h+p+u<0||h-u>window.innerHeight)return!1;const f=Math.floor(Date.now()/1e3),v=`${s.xcU}-${(0,l.A)()}`,A=(0,c.FD)("svg",{className:d.ghost,width:m,height:p,style:`left: ${i}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:d.elementContainer,width:m,height:p})})]}),y=(0,r.A)(A)[0],C=y.querySelector("foreignObject"),w=window.getComputedStyle(e),b=e.cloneNode(!0);Array.from(w).forEach(e=>b.style.setProperty(e,w.getPropertyValue(e),"important")),C.appendChild(b);const I=document.getElementById(s.Lj4);return I.appendChild(y),y.addEventListener("animationend",()=>{I.removeChild(y)},{once:!0}),!0}function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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:()=>i});const i={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},17751:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(91048),l=n(87357),d=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,i.ph)((0,o.EK)((e,t)=>{let{userId:n,forceShowSelf:i}=t;const{isSynced:o}=e,s=n?(0,r.mBe)(e,n):void 0,a=n?(0,r.K0y)(e,n):void 0,l=!i&&s&&s.isSelf,d=l?s:(0,r.mBe)(e,e.currentUserId);return{user:s,userStatus:a,isSavedMessages:l,areMessagesLoaded:Boolean(n&&(0,r.zeq)(e,n)),self:d,isSynced:o}})(e=>{let{customPeer:t,typingStatus:n,avatarSize:r="medium",status:C,statusIcon:w,withDots:b,withMediaViewer:I,withUsername:S,withStory:M,withFullInfo:N,withUpdatingStatus:Y,emojiStatusSize:k,noStatusOrTyping:P,noEmojiStatus:F,noFake:T,noVerified:D,noRtl:x,user:E,userStatus:L,self:B,isSavedMessages:R,isSavedDialog:O,areMessagesLoaded:U,adminMember:z,ripple:K,className:V,storyViewerOrigin:j,isSynced:J,onEmojiStatusClick:$,iconElement:q,rightElement:H}=e;const{loadFullUser:G,openMediaViewer:W,loadMoreProfilePhotos:_}=(0,o.ko)(),Q=(0,h.A)(),{id:Z}=E||{},X=I&&!R;(0,i.vJ)(()=>{Z&&(N&&J&&G({userId:Z}),I&&_({peerId:Z,isPreload:!0}))},[Z,N,I,J]),(0,c.A)(6e4);const ee=(0,u.A)((e,t)=>{E&&t&&(e.stopPropagation(),W({isAvatarView:!0,chatId:E.id,mediaIndex:0,origin:"jumbo"===r?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),te=(0,i.Kr)(()=>E&&S&&(0,a.Kl)(E),[E,S]);if(!E&&!t)return;const ne=z?z.customTitle||Q(z.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,y.FD)("div",{className:(0,l.A)("ChatInfo",V),dir:!x&&Q.isRtl?"rtl":void 0,children:[O&&B&&(0,y.Y)(p.A,{size:r,peer:B,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,y.Y)(p.A,{size:r,peer:t||E,className:(0,l.A)(O&&"overlay-avatar"),isSavedMessages:R,isSavedDialog:O,withStory:M,storyViewerOrigin:j,storyViewerMode:"single-peer",onClick:X?ee:void 0},E?.id),(0,y.FD)("div",{className:"info",children:[ne?(0,y.FD)("div",{className:"info-name-title",children:[(0,y.Y)(f.A,{peer:E,withEmojiStatus:!F,emojiStatusSize:k,isSavedMessages:R,isSavedDialog:O,onEmojiStatusClick:$}),ne&&(0,y.Y)("span",{className:"custom-title",children:ne})]}):(0,y.Y)(f.A,{peer:t||E,noFake:T,noVerified:D,withEmojiStatus:!F,emojiStatusSize:k,isSavedMessages:R,isSavedDialog:O,onEmojiStatusClick:$,iconElement:q}),(C||!R&&!P)&&function(){if(C)return b?(0,y.Y)(g.A,{className:"status",content:C}):(0,y.FD)("span",{className:"status",dir:"auto",children:[w&&(0,y.Y)(v.A,{className:"status-icon",name:w}),(0,d.A)(C)]});if(Y&&!U)return(0,y.Y)(g.A,{className:"status",content:Q("Updating")});if(t?.subtitleKey)return(0,y.Y)("span",{className:"status",dir:"auto",children:(0,y.Y)("span",{className:"user-status",dir:"auto",children:Q(t.subtitleKey)})});if(!E)return;if(n)return(0,y.Y)(A.A,{typingStatus:n});if((0,a.DX)(E.id))return;const e=(0,a.CD)(Q,E,L),i=(0,l.A)("handle",e&&"withStatus");return(0,y.FD)("span",{className:(0,l.A)("status",(0,a.PF)(E,L,!0)&&"online"),children:[te&&(0,y.Y)("span",{className:i,children:te}),e&&(0,y.Y)("span",{className:"user-status",dir:"auto",children:e})]})}()]}),K&&(0,y.Y)(m.A,{}),H]})}))},17778:(e,t,n)=>{n.d(t,{S:()=>r});const i=/(<br>|<br\s?\/>)/g,o=/( |\u00A0)/g,s=/(<div>|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(o," ").replace(i,"\n").replace(s,"").replace(a,"")}},19210:(e,t,n)=>{n.d(t,{A:()=>V});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(31481),l=n(90709),d=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),Y=n(34431),k=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,i.ph)(e=>{let{isSelected:t,isActive:n,isMobile:i}=e;return(0,B.Y)("div",{className:(0,h.A)("byPckqUT",n&&"IsUWP16T",t&&!i&&"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 z="oIgI9O0L",K=(0,i.ph)(e=>{let{folderIds:t,orderedIds:n,chatFoldersById:o,activeChatFolder:s}=e;const a=void 0!==s&&n?n[s]:void 0,l=(0,i.Kr)(()=>n?.filter(e=>{const n=t?.includes(e),i=e===a,s=e===r.DSF,l=o?.[e],d=void 0!==l?.color&&-1!==l.color;return n&&!i&&!s&&d})||[],[n,t,a,o]),d=l.slice(0,3),c=l.length-d.length;return(0,B.FD)("div",{className:"cgAMX02q",children:[d.map(e=>{const t=o?.[e];return t&&(0,B.Y)("div",{className:(0,h.A)("ChatTags",z,(0,O.a)({color:t.color})),children:(0,U.fd)({text:t.title.text,entities:t.title.entities,noCustomEmojiPlayback:t.noTitleAnimations,emojiSize:12})},t.id)}),c>0&&(0,B.FD)("div",{className:`ChatTags ${z} hZDqIz3W`,children:["+",c]})]})}),V=(0,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,isSavedDialog:i,isPreview:o,previewMessageId:a}=t;const r=(0,c.hds)(e,n),l=(0,c.mBe)(e,n);if(!r)return{currentUserId:e.currentUserId};const u=(0,p.N)(n),{areTagsEnabled:h}=e.chatFolders,m=(0,c.g29)(e),g=a||(0,c.ZZX)(e,n,i?"saved":"all"),f=a?(0,c.O5q)(e,n,a):(0,c.yHC)(e,n,i?"saved":"all"),{isOutgoing:v,forwardInfo:A}=f||{},y=i&&A?.fromId?(0,c.PVB)(e,A.fromId):void 0,C=f?(0,c.Y7C)(e,f):void 0,w=y||C,{chatId:b,threadId:I,type:S}=(0,c.Xf0)(e)||{},M=!o&&n===b&&(i?n===I:I===s.l3),N=r.isForum&&n===b||n===(0,c.nTw)(e).forumPanelChatId,Y=(0,c.K0y)(e,n),k=f&&(0,c.nkm)(e,f),P=(0,c.C5H)(e,n,s.l3,"typingStatus"),F=(0,c.xyP)(e,n),T=f?.content.storyData,D=T&&(0,c.Msb)(e,T.peerId,T.id),x=(0,c.trm)(e),E=(0,c.k2W)(e,n),L=(0,c.nTw)(e).activeChatFolder;return{chat:r,isMuted:(0,d.If)(r,(0,c.K52)(e),(0,c.P5N)(e,r.id)),lastMessageSender:w,draft:(0,c.GA4)(e,n,s.l3),isSelected:M,isSelectedForum:N,isForumPanelOpen:(0,c.clw)(e),canScrollDown:M&&"thread"===S,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,lastMessageOutgoingStatus:v&&f?(0,c.Tl2)(e,f):void 0,user:l,userStatus:Y,lastMessageTopic:k,typingStatus:P,withInterfaceAnimations:(0,c.PKK)(e),lastMessage:f,lastMessageId:g,currentUserId:e.currentUserId,listedTopicIds:F?.listedTopicIds,topics:F?.topicsById,isSynced:e.isSynced,lastMessageStory:D,isAccountFrozen:x,monoforumChannel:E,folderIds:u,orderedIds:e.chatFolders.orderedIds,activeChatFolder:L,chatFoldersById:e.chatFolders.byId,areTagsEnabled:h&&m}})(e=>{let{chatId:t,folderId:n,orderDiff:d,animationType:p,isPinned:L,listedTopicIds:O,topics:U,observeIntersection:z,chat:V,monoforumChannel:j,lastMessageStory:J,isMuted:$,user:q,userStatus:H,lastMessageSender:G,lastMessageOutgoingStatus:W,offsetTop:_,draft:Q,withInterfaceAnimations:Z,isSelected:X,isSelectedForum:ee,isForumPanelOpen:te,canScrollDown:ne,canChangeFolder:ie,lastMessageTopic:oe,typingStatus:se,lastMessageId:ae,lastMessage:re,isSavedDialog:le,currentUserId:de,isPreview:ce,previewMessageId:ue,className:he,isSynced:me,onDragEnter:pe,isAccountFrozen:ge,folderIds:fe,orderedIds:ve,chatFoldersById:Ae,activeChatFolder:ye,areTagsEnabled:Ce,withTags:we}=e;const{openChat:be,openSavedDialog:Ie,toggleChatInfo:Se,focusLastMessage:Me,focusMessage:Ne,loadTopics:Ye,openForumPanel:ke,closeForumPanel:Pe,setShouldCloseRightColumn:Fe,reportMessages:Te,openFrozenAccountModal:De,updateChatMutedState:xe}=(0,o.ko)(),{isMobile:Ee}=(0,v.Ay)(),[Le,Be,Re]=(0,C.A)(),[Oe,Ue,ze]=(0,C.A)(),[Ke,Ve,je]=(0,C.A)(),[Je,$e,qe]=(0,C.A)(),[He,Ge,We]=(0,C.A)(),[_e,Qe,Ze]=(0,C.A)(),{isForum:Xe,isForumAsMessages:et,isMonoforum:tt}=V||{};(0,y.A)(le?de:t,ae,re);const nt=Ce&&we&&fe&&fe.length>1,{renderSubtitle:it,ref:ot}=(0,S.A)({chat:V,chatId:t,lastMessage:re,typingStatus:se,draft:Q,statefulMediaContent:(0,l.FE)({story:J}),lastMessageTopic:oe,lastMessageSender:G,observeIntersection:z,animationType:p,withInterfaceAnimations:Z,orderDiff:d,isSavedDialog:le,isPreview:ce,topics:U,noForumTitle:nt}),st=(0,f.A)(c.sRo),at=(0,b.A)(()=>{const e=Ee&&et;if(Ee&&Fe({value:!0}),ce)Ne({chatId:t,messageId:ue});else{if(le)return Ie({chatId:t,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Ee&&Se({force:!1}));if(Xe){if(te)return void Pe(void 0,{forceOnHeavyAnimation:!0});if(e||ke({chatId:t},{forceOnHeavyAnimation:!0}),!et)return}be({id:t,noForumTopicPanel:e,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),X&&ne&&Me()}}),rt=(0,b.A)(e=>{e.preventDefault(),pe?.(t)}),lt=(0,b.A)(()=>{ge?De():($e(),Be())}),dt=(0,b.A)(()=>{ge?De():(Ge(),Ue())}),ct=(0,b.A)(()=>{ge?De():xe({chatId:t,mutedUntil:r.Os5})}),ut=(0,b.A)(()=>{Qe(),Ve()}),ht=(0,b.A)(()=>{ge?De():V&&Te({chatId:V.id,messageIds:[]})}),mt=(0,A.A)({chat:V,user:q,handleDelete:lt,handleMute:dt,handleUnmute:ct,handleChatFolderChange:ut,handleReport:ht,folderId:n,isPinned:L,isMuted:$,canChangeFolder:ie,isSavedDialog:le,currentUserId:de,isPreview:ce,topics:U}),pt=(0,w.Vz)(ot,V?z:void 0);(0,i.vJ)(()=>{pt&&Xe&&me&&void 0===O&&Ye({chatId:t})},[t,O,me,Xe,pt]);const gt=q&&H&&(0,l.PF)(q,H),{hasShownClass:ft}=(0,I.A)(gt),vt=(0,i.Kr)(()=>{if(u.OS)return le?`#${(0,g.az)(de,"thread",t)}`:`#${(0,g.az)(t,"thread",s.l3)}`},[t,de,le]);if(!V)return;const At=q||V,yt=(0,h.A)("Chat chat-item-clickable",(0,m.L8)(t)?"private":"group",Xe&&"forum",X&&"selected",ee&&"selected-forum",ce&&"standalone",nt&&"chat-item-with-tags",he);return(0,B.FD)(T.A,{ref:ot,className:yt,href:vt,style:`top: ${_}px`,ripple:!Xe&&!Ee,contextActions:mt,onClick:at,onDragEnter:rt,withPortalForMenu:!0,children:[(0,B.FD)("div",{className:(0,h.A)("status","status-clickable"),children:[(0,B.Y)(M.A,{peer:tt?j:At,isSavedMessages:q?.isSelf,isSavedDialog:le,size:ce?"medium":"large",asMessageBubble:tt,withStory:!q?.isSelf&&!tt,withStoryGap:ft||Boolean(V.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",ft&&"avatar-online-shown")}),!ft&&Boolean(V.subscriptionUntil)&&(0,B.Y)(P.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,B.Y)(E.A,{chat:V,isMuted:$,shouldShowOnlyMostImportant:!0,forceHidden:st,topics:U,isSelected:X})]}),V.isCallActive&&V.isCallNotEmpty&&(0,B.Y)(R,{isMobile:Ee,isSelected:X,isActive:Z})]}),(0,B.FD)("div",{className:(0,h.A)("info",nt&&"has-tags"),children:[(0,B.FD)("div",{className:"info-row",children:[(0,B.Y)(Y.A,{peer:tt?j:At,isMonoforum:tt,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:t===q?.id&&q?.isSelf,isSavedDialog:le,observeIntersection:z}),$&&!le&&(0,B.Y)(k.A,{name:"muted"}),(0,B.Y)("div",{className:"separator"}),re&&(0,B.Y)(F.A,{message:re,outgoingStatus:le?void 0:W,draftDate:Q?.date})]}),(0,B.FD)("div",{className:"subtitle",children:[it(),!ce&&(0,B.Y)(E.A,{chat:V,isPinned:L,isMuted:$,isSavedDialog:le,hasMiniApp:q?.hasMainMiniApp,topics:U,isSelected:X})]}),nt&&(0,B.Y)(K,{folderIds:fe,orderedIds:ve,chatFoldersById:Ae,activeChatFolder:ye})]}),Je&&(0,B.Y)(N.A,{isOpen:Le,onClose:Re,onCloseAnimationEnd:qe,chat:V,isSavedDialog:le}),He&&(0,B.Y)(x.A,{isOpen:Oe,onClose:ze,onCloseAnimationEnd:We,chatId:t}),_e&&(0,B.Y)(D.A,{isOpen:Ke,onClose:je,onCloseAnimationEnd:Ze,chatId:t})]})}))},20247:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(31481),a=n(17712);function r(e,t,n){const{shouldPaidMessageAutoApprove:r}=(0,o.mS)().settings.byKey,[l,d]=(0,i.J0)(Boolean(r)),[c,u]=(0,i.J0)(!1),h=(0,i.li)(void 0),m=(0,a.A)(()=>{(0,o.ko)().closePaymentMessageConfirmDialogOpen()});(0,i.vJ)(()=>{c&&!t&&(u(!1),n>e&&h?.current?.())},[c,t,n,e]);const p=(0,a.A)(()=>{(0,o.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)});return{closeConfirmDialog:m,handleWithConfirmation:function(t){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(e){if(h.current=()=>t(...s),!r)return void(0,o.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...s)},dialogHandler:(0,a.A)(()=>{e>n?p():h?.current?.(),(0,o.ko)().closePaymentMessageConfirmDialogOpen(),l&&(0,o.ko)().setPaidMessageAutoApprove()}),shouldAutoApprove:l,setAutoApprove:d}}},21488:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,o.ko)(),r=(0,i.Kr)(()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}},[t,e]);(0,i.vJ)(()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()},[r,n,t,e])}},22081:(e,t,n)=>{n.d(t,{A:()=>Ht});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(66644),l=n(90709),d=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),Y=n(43503),k=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),z=n(19129),K=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 ie=/^\/([\w@]{1,32})?$/i;var oe=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 le(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function de(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=de(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=de(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=de(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=de(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=de(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=de(n,"sub")),n):n}function ue(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),i=t;return"A"===t.nodeName&&(n=le(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(i=t.childNodes[0])),n=ce(i,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 i=[];for(let t=0;t<e.childNodes.length;t++)i.push(...he(e.childNodes[t]));i.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||""),i=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(i=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=le(n.cloneNode(!0),t.childNodes[0].href),i=t.childNodes[0].childNodes[0]),n=ce(i,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=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,d,c,u)=>{const{showNotification:h}=(0,o.ko)(),m=(0,J.A)();(0,i.vJ)(()=>{if(e)return document.addEventListener("paste",i,!1),()=>{document.removeEventListener("paste",i,!1)};async function i(e){if(!e.clipboardData)return;const i=e.target?.closest("div[contenteditable]");if(!i||!fe.has(i.id))return;if(e.preventDefault(),document.activeElement!==i)return;const o=e.clipboardData.getData("text"),p=e.clipboardData.getData("text/html");let g=p?(0,S.Ay)(function(e){let t=document.createElement("div");try{e=(n=e).match(se)?function(e){const t=document.createElement("body"),n=e.childNodes,i=Array.from(n).filter(me),o=[];for(const e of i)o.push(...he(e));for(let e=0;e<o.length;e++)t.appendChild(o[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 i=t.querySelectorAll(".text-content");return i.length&&(t=i[i.length-1]),Array.from(t.getElementsByTagName("*")).forEach(e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),S.qh[e.tagName]&&e.setAttribute("data-entity-type",S.qh[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case s.C7.MentionName:e.replaceWith(e.textContent||"");break;case s.C7.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()}),t.innerHTML.trimEnd()}(p),void 0,!0):void 0;g&&(0,oe.T8)(g)&&c&&(g=(0,oe.m4)(g),u?.());const{items:f}=e.clipboardData;let v=[];if(f.length>0&&(v=await(0,ge.A)(f),d&&(v=v?.slice(0,1))),!v?.length&&!o)return;const A=g?.entities?.length?g:{text:o};let y=!1;try{y="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(p,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const C=A&&A.text;let w=v?.length&&!y;const b=v?await Promise.all(v.map(e=>(0,T.A)(e.name,e))):[],I=d&&b?.length&&(0,l.eh)(d,b[0])||Boolean(C),M=(0,l.NK)(b[0]),N=d&&d?.groupedId;d&&b?.length>1?h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:b.length})}):d&&M?h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!N||(w=I,w)?(w&&n(d?b:e=>e.concat(b)),C&&(w?r(A):t(A,i?.id))):h({message:m("MediaReplaceInvalidError",void 0,{pluralValue:b.length})})}},[t,d,n,e,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 Ye=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,ke=/^@([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},ze={type:"audio/ogg"};let Ke,Ve,je;async function Je(){return Ke||(Ke=n.e(4550).then(n.t.bind(n,14550,23)),Ve=(await Ke).default,je=new Ve(Ue)),Ke}async function $e(e){await async function(){await Je(),await je.start()}();const t=Date.now();let n;const i=[],o=[];je.ondataavailable=e=>{i.push(e)};const s=function(t){const n=t.sourceNode,i=n.context.createAnalyser();i.fftSize=64,n.connect(i);const s=i.frequencyBinCount,a=new Uint8Array(s);let l=!1;return function t(){if(l)return;i.getByteFrequencyData(a);const n=a.reduce((e,t)=>e+t,0)/s/255;(t=>{o.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{l=!0}}(je);return{stop:()=>new Promise((e,a)=>{je.onstop=()=>{e({blob:new Blob(i,ze),duration:Math.round(((n||Date.now())-t)/1e3),waveform:o})},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),it=n(66469),ot=n(54639);const st=(0,i.ph)(e=>{let{chatId:t,threadId:n,isButtonVisible:s,canAttachMedia:r,canAttachPolls:d,canAttachToDoLists:c,canSendPhotos:u,canSendVideos:h,canSendDocuments:m,canSendAudios:f,attachBots:v,peerType:A,isScheduled:y,theme:C,shouldCollectDebugLogs:w,canEditMedia:b,editingMessage:I,messageListType:S,paidMessagesStars:M,onFileSelect:N,onMenuOpen:Y,onMenuClose:k,onPollCreate:P,onTodoListCreate:F}=e;const{updateAttachmentSettings:T}=(0,o.ko)(),[D,x,E]=(0,V.A)(),[L,B,R]=(0,Xe.A)(D,E),O=u&&h,U=u||h,[z,K,j]=(0,V.A)(),H=D||z,G=I&&I?.groupedId&&Boolean((0,l.yl)(I)||Boolean((0,l.zX)(I))),W=I&&I?.groupedId&&Boolean((0,l.wp)(I)||(0,l.gB)(I)||(0,l.zC)(I));(0,i.vJ)(()=>{D&&R()},[D,R]),(0,i.vJ)(()=>{H?Y():k()},[H,k,Y]);const _=(0,$.A)(()=>{D?E():x()}),Q=(0,$.A)(e=>{const{files:t}=e.target,n=(0,Qe.kc)(t);n?.length&&N(n)}),Z=(0,$.A)(()=>{T({shouldCompress:!0}),(0,Ze.p)(Array.from(O?a.mxD:u?a.gex:a.fNs).join(","),e=>Q(e))}),X=(0,$.A)(()=>{T({shouldCompress:!1}),(0,Ze.p)(!m&&f?Array.from(a.IH3).join(","):"*",e=>Q(e))}),ee=(0,$.A)(()=>{const e=new File([(0,_e.F8)()],a.lFE,{type:"text/plain"});N([e])}),te=(0,i.Kr)(()=>v?Object.values(v).filter(e=>!(!A||!e.isForAttachMenu)&&(!("bots"!==A||e.id!==t||!e.attachMenuPeerTypes||!e.attachMenuPeerTypes.includes("self"))||e.attachMenuPeerTypes.includes(A))):void 0,[v,t,A]),ne=(0,q.A)(),ie=(0,J.A)();if(s)return(0,Ge.FD)("div",{className:"AttachMenu",children:[I&&b?(0,Ge.Y)(it.A,{id:"replace-menu-button",className:(0,g.A)("AttachMenu--button composer-action-button",D&&"activated"),round:!0,color:"translucent",onActivate:_,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,Ge.Y)(et.A,{name:"replace"})}):(0,Ge.Y)(it.A,{id:"attach-menu-button",disabled:Boolean(I),className:(0,g.A)("AttachMenu--button composer-action-button",D&&"activated"),round:!0,color:"translucent",onActivate:_,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:H,autoClose:!0,positionX:"right",positionY:"bottom",onClose:E,className:"AttachMenu--menu fluid",onCloseAnimationEnd:E,onMouseEnter:p.TF?void 0:L,onMouseLeave:p.TF?void 0:B,noCloseOnBackdrop:!p.TF,ariaLabelledBy:"attach-menu-button",children:[!r&&(0,Ge.Y)(nt.A,{className:"media-disabled",disabled:!0,children:ie("scheduled"===S&&M?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),r&&(0,Ge.FD)(Ge.FK,{children:[U&&!W&&(0,Ge.Y)(nt.A,{icon:"photo",onClick:Z,children:ne(O?"AttachmentMenu.PhotoOrVideo":u?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(m||f)&&!G&&(0,Ge.Y)(nt.A,{icon:"document",onClick:X,children:ne(!m&&f?"InputAttach.Popover.Music":"AttachDocument")}),m&&w&&(0,Ge.Y)(nt.A,{icon:"bug",onClick:ee,children:ne("DebugSendLogs")})]}),d&&!I&&(0,Ge.Y)(nt.A,{icon:"poll",onClick:P,children:ne("Poll")}),c&&!I&&(0,Ge.Y)(nt.A,{icon:"select",onClick:F,children:ie("TitleToDoList")}),!I&&!b&&!y&&te?.map(e=>(0,Ge.Y)(ot.A,{bot:e,chatId:t,threadId:n,theme:C,onMenuOpened:K,onMenuClosed:j}))]})]})}),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),lt=n(64493);const dt=(0,i.ph)((0,o.EK)((e,t)=>{let{messageId:n}=t;const{chatId:i}=(0,u.Xf0)(e)||{};return{message:i?(0,u.O5q)(e,i,n):void 0}})(e=>{let{isOpen:t,threadId:n,message:s,onClose:a}=e;const{clickBotInlineButton:r}=(0,o.ko)(),l=(0,q.A)(),[d,c]=(0,Xe.A)(t,a),{isKeyboardSingleUse:u}=s||{},h=(0,i.Kr)(()=>{const e=[];return s?.keyboardButtons.forEach(t=>{e.push(t.map(e=>(0,rt.A)(l,e)))}),e},[l,s?.keyboardButtons]);if(s&&s.keyboardButtons)return(0,Ge.Y)(tt.A,{isOpen:t,autoClose:u,positionX:"right",positionY:"bottom",onClose:a,className:"BotKeyboardMenu",onCloseAnimationEnd:a,onMouseEnter:p.TF?void 0:d,onMouseLeave:p.TF?void 0:c,noCompact:!0,children:(0,Ge.Y)("div",{className:"content custom-scroll",children:s.keyboardButtons.map((e,t)=>(0,Ge.Y)("div",{className:"row",children:e.map((e,i)=>(0,Ge.Y)(lt.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>r({chatId:s.chatId,messageId:s.id,threadId:n,button:e}),children:h?.[t][i]}))}))})})})),ct=(0,i.ph)(e=>{let{isOpen:t,onClick:n,text:o,isDisabled:s}=e;const a=(0,i.li)();return(0,i.vJ)(()=>{const e=a.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)},[t,o]),(0,i.vJ)(()=>{const e=a.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}},[]),(0,Ge.FD)(lt.A,{className:(0,g.A)("composer-action-button bot-menu",t&&"open"),round:!0,color:"translucent",disabled:s,onClick:n,ariaLabel:"Open bot command keyboard",children:[(0,Ge.Y)(et.A,{name:"webapp",className:(0,g.A)("bot-menu-icon",t&&"open")}),(0,Ge.Y)("span",{ref:a,className:"bot-menu-text",children:(0,L.A)(o)})]})}),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,i.ph)((0,o.EK)((e,t)=>{let{shouldForceShowEditing:n,chatId:i,threadId:o,messageListType:s}=t;const{forwardMessages:{fromChatId:a,toChatId:r,messageIds:d,noAuthors:c,noCaptions:h},isShareMessageModalShown:m,shouldPreventComposerAnimation:p}=(0,u.nTw)(e),g="scheduled"===s?(0,u.VlN)(e,i):(0,u.Ys6)(e,i,o),f=(0,u.PKK)(e)&&!p,v=r===i,A=d?.map(t=>(0,u.O5q)(e,a,t)),y=(0,u.GA4)(e,i,o),C=y?.replyInfo,w=y?.suggestedPostInfo,b=C?.replyToPeerId,I=b?(0,u.hds)(e,b):void 0;let S,M;if(g?S=(0,u.KLw)(e,i,o,s):v&&1===d.length?S=A?.[0]:C&&!n&&(S=(0,u.O5q)(e,C.replyToPeerId||i,C.replyToMsgId)),g&&S)M=(0,u.Y7C)(e,S);else if(v){let t=A?.map(t=>{return n=t,M=(0,u.Szq)(e,n),M||(M=(0,u.Y7C)(e,n)),M;var n}).filter(Boolean);t=t?(0,mt.Am)(t):void 0,M=1===t?.length?t?.[0]:void 0}else if(C&&S&&!n){const{forwardInfo:t}=S,n=(0,u.nZ4)(e,i);t&&(t.isChannelPost||n)&&(M=(0,u.Szq)(e,S)),M||t?.hiddenUserName&&!Boolean(C.quoteText)||(M=(0,u.Y7C)(e,S))}const N=M&&(0,u.hds)(e,M.id),Y=N&&(0,l.WX)(N),k=A?.some(e=>e?.content.text&&Object.keys(e.content).length>1),P=v&&1===d.length&&Boolean(S?.content.storyData),F=C?.replyToMsgId===o&&!C.replyToPeerId,T=S&&(0,ht.B9)(e,S);return{replyInfo:C,suggestedPostInfo:w,editingId:g,message:S,sender:M,shouldAnimate:f,forwardedMessagesCount:v?d.length:void 0,noAuthors:c,noCaptions:h,forwardsHaveCaptions:k,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:P,isReplyToDiscussion:F,isInChangingRecipientMode:m,shouldPreventComposerAnimation:p,senderChat:I,currentUserId:e.currentUserId,isSenderChannel:Y,forwardMessageIds:d,fromChatId:a,isMediaNsfw:T}})(e=>{let{replyInfo:t,suggestedPostInfo:n,editingId:s,message:a,sender:r,shouldAnimate:d,forwardedMessagesCount:c,noAuthors:h,noCaptions:m,forwardsHaveCaptions:p,shouldForceShowEditing:f,isCurrentUserPremium:v,isContextMenuDisabled:A,isReplyToDiscussion:y,isInChangingRecipientMode:C,shouldPreventComposerAnimation:w,senderChat:b,chatId:I,currentUserId:S,isSenderChannel:M,forwardMessageIds:N,fromChatId:Y,isMediaNsfw:k,onClear:P}=e;const{resetDraftReplyInfo:F,resetDraftSuggestedPostInfo:T,updateDraftReplyInfo:D,setEditingId:x,focusMessage:L,changeRecipient:B,openChatOrTopicWithReplyInDraft:R,setForwardNoAuthors:O,setForwardNoCaptions:z,exitForwardMode:K,setShouldPreventComposerAnimation:V,openSuggestMessageModal:j}=(0,o.ko)(),H=(0,i.li)(),G=(0,q.A)(),W=(0,J.A)(),_="topicCreate"===a?.content.action?.type,Z=t&&!f,X=Boolean(t?.quoteText),ee=Boolean(n)&&!f,te=Boolean(c),ne=(0,$.A)(e=>{const t=(0,o.mS)();return r=(0,u.Szq)(t,e),r||(r=(0,u.Y7C)(t,e)),r}),ie=(0,i.Kr)(()=>{if(!te)return;const e=N?.map(e=>(0,u.O5q)((0,o.mS)(),Y,e)).filter(Boolean),t=e?.map(e=>ne(e)).filter(Boolean);return t?(0,mt.Am)(t):void 0},[te,N,Y]),oe=!(C||(!a||!t&&!s)&&(!ie||!te)&&!ee),{shouldRender:se,transitionClassNames:ae}=(0,Q.A)(oe&&!_&&!y,void 0,!d,void 0,!d,350,!d);(0,i.vJ)(()=>{w&&V({shouldPreventComposerAnimation:!1})});const re=(0,$.A)(()=>{s?x({messageId:void 0}):c?K():ee?(T(),F()):t&&!f&&F(),P?.()});(0,i.vJ)(()=>oe?(0,Oe.A)(re):void 0,[oe,re]);const{isContextMenuOpen:le,contextMenuAnchor:de,handleContextMenu:ce,handleContextMenuClose:ue,handleContextMenuHide:he}=(0,U.A)(H),me=(0,$.A)(e=>{n?j({chatId:I}):ce(e)}),pe=(0,$.A)(e=>{e.stopPropagation(),re(),he()}),ge=e=>()=>{ue(),e()},fe=(0,$.A)(ge(B)),ve=(0,$.A)(ge(()=>{L({chatId:a.chatId,messageId:a.id,noForumTopicPanel:!0})})),Ae=(0,$.A)(ge(()=>D({quoteText:void 0}))),ye=(0,$.A)(ge(B)),Ce=(0,$.A)(()=>{ue(),r&&R({chatId:r.id})}),we=(0,$.A)(ge(re)),be=(0,$.A)(()=>H.current),Ie=(0,$.A)(()=>H.current),Se=(0,$.A)(()=>H.current.querySelector(".forward-context-menu .bubble"));(0,i.vJ)(()=>{se||(ue(),he())},[ue,he,se]);const Me=(0,g.A)("ComposerEmbeddedMessage",ae),Ne=(0,pt.A)(r,!0),Ye=(0,g.A)("ComposerEmbeddedMessage_inner",(0,E.y)(Ne)),ke=(0,i.Kr)(()=>s?"edit":ee?"cash-circle":te?"forward":Z?"reply":void 0,[s,te,Z,ee]),Pe=c&&c>1?G("ForwardedMessageCount",c):void 0,Fe=(0,i.Kr)(()=>{if(!a||!te||!a.content.text||!h||v)return a;const e=(0,l.m4)(a.content.text);return{...a,content:{...a.content,text:e}}},[v,te,a,h]),Te=(0,pt.A)(ke,!0);if(!se)return;const De=r&&!M&&I!==r.id&&r.id!==S;return(0,Ge.Y)("div",{className:Me,ref:H,onContextMenu:ce,children:(0,Ge.FD)("div",{className:Ye,children:[(0,Ge.FD)("div",{className:"embedded-left-icon",onClick:ce,children:[Te&&(0,Ge.Y)(et.A,{name:Te}),Boolean(t?.quoteText)&&(0,Ge.Y)(et.A,{name:"quote",className:"quote-reply"})]}),(0,Ge.Y)(gt.b,{isOpen:oe,className:"inside-input",replyInfo:t,suggestedPostInfo:n,isMediaNsfw:k,isInComposer:!0,message:Fe,sender:h?void 0:r,composerForwardSenders:ie,customText:Pe,noCaptions:m,title:s&&!Z?G("EditMessage"):h?G("HiddenSendersNameDescription"):void 0,onClick:me,senderChat:b}),(0,Ge.Y)(lt.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:G("Cancel"),onClick:pe,children:(0,Ge.Y)(et.A,{name:"close"})}),(Z||te)&&!A&&(0,Ge.FD)(tt.A,{isOpen:le,anchor:de,getTriggerElement:be,getRootElement:Ie,getMenuElement:Se,className:"forward-context-menu",onClose:ue,onCloseAnimationEnd:he,children:[te&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(nt.A,{icon:h?void 0:"message-succeeded",customIcon:h?(0,Ge.Y)(et.A,{name:"placeholder"}):void 0,onClick:()=>O({noAuthors:!1}),children:G(c>1?"ShowSenderNames":"ShowSendersName")}),(0,Ge.Y)(nt.A,{icon:h?"message-succeeded":void 0,customIcon:h?void 0:(0,Ge.Y)(et.A,{name:"placeholder"}),onClick:()=>O({noAuthors:!0}),children:G(c>1?"HideSenderNames":"HideSendersName")}),p&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(ft.A,{}),(0,Ge.Y)(nt.A,{icon:m?void 0:"message-succeeded",customIcon:m?(0,Ge.Y)(et.A,{name:"placeholder"}):void 0,onClick:()=>z({noCaptions:!1}),children:G(c>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,Ge.Y)(nt.A,{icon:m?"message-succeeded":void 0,customIcon:m?void 0:(0,Ge.Y)(et.A,{name:"placeholder"}),onClick:()=>z({noCaptions:!0}),children:G(c>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,Ge.Y)(ft.A,{}),(0,Ge.Y)(nt.A,{icon:"replace",onClick:fe,children:G("ForwardAnotherChat")})]}),Z&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(nt.A,{icon:"show-message",onClick:ve,children:G("Message.Context.Goto")}),X&&(0,Ge.Y)(nt.A,{icon:"remove-quote",onClick:Ae,children:G("RemoveQuote")}),De&&(0,Ge.Y)(nt.A,{icon:"user",onClick:Ce,children:W("ReplyInPrivateMessage")}),(0,Ge.Y)(nt.A,{icon:"replace",onClick:ye,children:G("ReplyToAnotherChat")}),(0,Ge.Y)(nt.A,{icon:"delete",onClick:we,children:G("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},Yt=e=>{const{isOpen:t}=e,n=(0,He.A)(qe.ar.Extra,"SendAsMenu",!t);return n?(0,Ge.Y)(n,{...e}):void 0},kt=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,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,threadId:i}=t;const o=(0,u.nTw)(e),s=(0,u.rQx)(e,n,i),{attachmentSettings:a}=e,r=o.webPagePreviewId?(0,u.kgA)(e,o.webPagePreviewId):void 0;return{webPagePreview:"empty"===r?.webpageType?void 0:r,noWebPage:s,attachmentSettings:a}})(e=>{let{chatId:t,threadId:n,isDisabled:s,webPagePreview:a,noWebPage:r,attachmentSettings:d,isEditing:c}=e;const{toggleMessageWebPage:u,updateAttachmentSettings:h}=(0,o.ko)(),m=(0,J.A)(),p=(0,i.li)(),f=d.isInvertedMedia,v="small"===d.webPageMediaSize,A=(0,z.A)(()=>Boolean(a&&!r&&!s),[s,r,a]),{shouldRender:y}=(0,xt.A)({isOpen:A,ref:p,withShouldRender:!0}),C="full"===a?.webpageType&&a.hasLargeMedia,w=(0,i.li)(a);a&&a!==w.current&&(w.current=a);const b=a||w.current,I="full"===b?.webpageType,S=(0,Tt.A)(I?{content:b}:void 0),M=(0,l.eY)(b)||(0,l.rU)(b)||(0,l.y3)(b)||(0,l.rj)(b),N=M&&(0,l.VO)(M,"pictogram"),Y=(0,Dt.A)(N),{shouldRender:k,ref:P}=(0,xt.A)({isOpen:Boolean(Y),withShouldRender:!0,noCloseTransition:!0}),F=Boolean(Y||k),T=(0,$.A)(()=>{u({chatId:t,threadId:n,noWebPage:!0})}),{isContextMenuOpen:D,contextMenuAnchor:x,handleContextMenu:E,handleContextMenuClose:L,handleContextMenuHide:B,handleBeforeContextMenu:R}=(0,U.A)(p,c,!0),O=(0,$.A)(()=>p.current),K=(0,$.A)(()=>p.current),V=(0,$.A)(()=>p.current.querySelector(`.${Lt} .bubble`)),j=(0,$.A)(e=>{E(e)});function q(e){h({isInvertedMedia:e})}function H(e){h({webPageMediaSize:e})}if((0,i.vJ)(()=>{y&&b||(L(),B())},[L,B,y,b]),y&&b)return(0,Ge.Y)("div",{className:(0,g.A)("O3di3ULC",!c&&"G5_7x_Hn"),ref:p,children:(0,Ge.FD)("div",{className:"m3DBx9f5",children:[(0,Ge.Y)("div",{className:"vFWsMwfP",onClick:j,children:(0,Ge.Y)(et.A,{name:"link"})}),b&&"empty"!==b.webpageType&&(0,Ge.FD)(Et.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:E,onMouseDown:R,onClick:j,children:[F&&(0,Ge.FD)("div",{className:"VvwZOug9",children:[S&&(0,Ge.Y)("img",{src:S,alt:"",className:Bt}),k&&(0,Ge.Y)("img",{ref:P,src:Y,alt:"",className:Bt})]}),(0,Ge.FD)("div",{className:"itmZe2qi",children:[(0,Ge.Y)("span",{className:"ER149gdz",children:I?b.siteName||b.url:m("Loading")}),(0,Ge.Y)("span",{className:"FSYSqC60",children:I?b.description||m((G=b,G.photo?"AttachPhoto":G.video?"AttachVideo":G.audio?"AttachMusic":G.document?"AttachDocument":G.story?"AttachStory":"LinkPreview")):b.url})]})]}),(0,Ge.Y)(lt.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:m("AccLinkRemovePreview"),onClick:T,children:(0,Ge.Y)(et.A,{name:"close"})}),!c&&(0,Ge.Y)(tt.A,{isOpen:D,anchor:x,getTriggerElement:O,getRootElement:K,getMenuElement:V,className:Lt,onClose:L,onCloseAnimationEnd:B,autoClose:!0,children:(0,Ge.FD)(Ge.FK,{children:[f?(0,Ge.Y)(nt.A,{icon:"move-caption-up",onClick:()=>q(void 0),children:m("ContextMoveTextUp")}):(0,Ge.Y)(nt.A,{icon:"move-caption-down",onClick:()=>q(!0),children:m("ContextMoveTextDown")}),C&&(v?(0,Ge.Y)(nt.A,{icon:"expand",onClick:()=>H("large"),children:m("ContextLinkLargerMedia")}):(0,Ge.Y)(nt.A,{icon:"collapse",onClick:()=>H("small"),children:m("ContextLinkSmallerMedia")})),(0,Ge.Y)(nt.A,{icon:"delete",onClick:T,children:m("ContextLinkRemovePreview")})]})})]})});var G}));var Ot=n(97676),Ut=n(76283),zt=n(57474),Kt=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,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,threadId:i,storyId:o,messageListType:r,isMobile:c,type:p}=t;const g=e.appConfig,f=(0,u.hds)(e,n),v=(0,l.DX)(n)?void 0:(0,u.yps)(e,n),A=Boolean(v),y=(0,u.nZ4)(e,n),w=(0,C.L8)(n),b=w?(0,u.vGo)(e,n):void 0,I=(0,u.WA9)(e,n),S=w?void 0:(0,u.AWZ)(e,n),M=(A||!w)&&(0,u.tVS)(e,n,i),{shouldSuggestStickers:N,shouldSuggestCustomEmoji:Y,shouldUpdateStickerSetOrder:P,shouldPaidMessageAutoApprove:F}=e.settings.byKey,{language:T,shouldCollectDebugLogs:D}=(0,m.l)(e),{forwardMessages:{messageIds:x}}=(0,u.nTw)(e),E=e.emojiKeywords[a.cUY],L=T!==a.cUY?e.emojiKeywords[T]:void 0,B=M?M.id:void 0,R=B?(0,u.O5q)(e,n,B):void 0,{currentUserId:O}=e,U=(0,u.mBe)(e,O),z=S?S?.sendAsId||O:void 0,K=z?(0,u.PVB)(e,z):void 0,V=(0,u.sam)(e,n),j=(0,u.p6T)(e,n),J=(0,u.nTw)(e),$=Boolean(J.storyViewer.storyId),q=(0,u.Xf0)(e),H=n===q?.chatId&&i===q?.threadId&&r===q?.type&&!$,G=((0,u.mBe)(e,n)&&!b?.noVoiceMessages)??!0,W=S?.slowMode,_=(0,u.g29)(e),Q="scheduled"===r?(0,u.dkp)(e,n):(0,u.U0A)(e,n,i),Z=o&&(0,u.Msb)(e,n,o),X=Z&&"sentReaction"in Z?Z.sentReaction:void 0,ee=(0,u.GA4)(e,n,i),te=ee?.replyInfo?(0,u.O5q)(e,n,ee.replyInfo.replyToMsgId):void 0,ne=f?.isForum&&f.isForumAsMessages&&i===s.l3&&te?(0,u.nkm)(e,te):void 0,ie="scheduled"===r,oe=w&&!A&&!ie&&!y,se=(0,u.rQx)(e,n,i),ae=f&&(0,d.RY)(f,(0,u.K52)(e),(0,u.P5N)(e,n))?.isSilentPosting,re=w&&!A&&!ie&&!y&&"story"!==p&&n!==a.zv8,le=(0,u.xYJ)(e,"stickerEffects"),de=J.shouldPlayEffectInComposer,ce=re&&ee?.effectId,ue=ce?e.availableEffectById[ce]:void 0,he=e.reactions.effectReactions,me=e.config?.maxMessageLength||k.Yf,pe=n===J.forwardMessages.toChatId,ge=Boolean(ee?.replyInfo),fe=Boolean(ee?.suggestedPostInfo),ve=e.stars?.balance.amount||0,Ae=Boolean(J.starsBalanceModal),ye=(0,u.trm)(e),Ce=e.isAppConfigLoaded,we=J.insertingPeerIdMention,be=J.webPagePreviewId?(0,u.kgA)(e,J.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===p?e.reactions.topReactions:void 0,isOnActiveTab:!J.isBlurred,editingMessage:(0,u.KLw)(e,n,i,r),draft:ee,chat:f,isChatWithBot:A,isChatWithSelf:y,isForCurrentMessageList:H,canScheduleUntilOnline:(0,u.RBq)(e,n),isChannel:f?(0,l.WX)(f):void 0,isRightColumnShown:(0,u.gjV)(e,c),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===r&&(b||S)?.hasScheduledMessages,isInScheduledList:ie,botKeyboardMessageId:B,botKeyboardPlaceholder:R?.keyboardPlaceholder,isForwarding:pe,isReplying:ge,hasSuggestedPost:fe,forwardedMessagesCount:pe?x.length:void 0,pollModal:J.pollModal,todoListModal:J.todoListModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:S,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:O,currentUser:U,contentToBeScheduled:J.contentToBeScheduled,shouldSuggestStickers:N,shouldSuggestCustomEmoji:Y,shouldUpdateStickerSetOrder:P,recentEmojis:e.recentEmojis,baseEmojiKeywords:E?.keywords,emojiKeywords:L?.keywords,inlineBots:J.inlineBots.byUsername,isInlineBotLoading:J.inlineBots.isLoading,botCommands:b?b.botInfo?.commands||!1:void 0,botMenuButton:b?.botInfo?.menuButton,sendAsPeer:K,sendAsId:z,editingDraft:Q,requestedDraft:V,requestedDraftFiles:j,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,u.dfQ)(e,n),theme:(0,u.SJA)(e),fileSizeLimit:(0,h.d)(e,"uploadMaxFileparts")*a.dK5,captionLimit:(0,h.d)(e,"captionLength"),isCurrentUserPremium:_,canSendVoiceByPrivacy:G,attachmentSettings:e.attachmentSettings,slowMode:W,currentMessageList:q,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!_&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!y&&w&&!A&&!ie,shouldCollectDebugLogs:D,sentStoryReaction:X,stealthMode:e.stories.stealthMode,replyToTopic:ne,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:oe,noWebPage:se,webPagePreview:be,isContactRequirePremium:b?.isContactRequirePremium,effect:ue,effectReactions:he,areEffectsSupported:re,canPlayEffect:le,shouldPlayEffect:de,maxMessageLength:me,paidMessagesStars:I,shouldPaidMessageAutoApprove:F,isSilentPosting:ae,isPaymentMessageConfirmDialogOpen:J.isPaymentMessageConfirmDialogOpen,starsBalance:ve,isStarsBalanceModalOpen:Ae,shouldDisplayGiftsButton:b?.shouldDisplayGiftsButton,disallowedGifts:b?.disallowedGifts,isAccountFrozen:ye,isAppConfigLoaded:Ce,insertingPeerIdMention:we,pollMaxAnswers:g.pollMaxAnswers}})(e=>{let{type:t,isOnActiveTab:n,dropAreaState:d,isInScheduledList:h,canScheduleUntilOnline:m,isReady:C,isMobile:k,editingMessage:P,chatId:oe,threadId:se,storyId:ae,currentMessageList:re,messageListType:le,draft:de,chat:ce,chatFullInfo:ue,replyToTopic:he,isForCurrentMessageList:me,isCurrentUserPremium:pe,canSendVoiceByPrivacy:ge,isChatWithBot:fe,isChatWithSelf:Ne,isChannel:Ue,fileSizeLimit:ze,isRightColumnShown:Ke,isSelectModeActive:Ve,isReactionPickerOpen:je,shouldDisplayGiftsButton:qe,isForwarding:He,isReplying:_e,hasSuggestedPost:Qe,forwardedMessagesCount:Ze,pollModal:Xe,todoListModal:tt,botKeyboardMessageId:nt,botKeyboardPlaceholder:ot,inputPlaceholder:rt,withScheduledButton:ht,stickersForEmoji:mt,customEmojiForEmoji:pt,topInlineBotIds:gt,currentUserId:ft,currentUser:Tt,captionLimit:Dt,contentToBeScheduled:xt,shouldSuggestStickers:Et,shouldSuggestCustomEmoji:Lt,baseEmojiKeywords:Bt,emojiKeywords:Ht,recentEmojis:Gt,inlineBots:Wt,isInlineBotLoading:_t,botCommands:Qt,sendAsPeer:Zt,sendAsId:Xt,editingDraft:en,requestedDraft:tn,requestedDraftFiles:nn,botMenuButton:on,attachBots:sn,attachMenuPeerType:an,attachmentSettings:rn,theme:ln,slowMode:dn,shouldUpdateStickerSetOrder:cn,editableInputCssSelector:un,editableInputId:hn,inputId:mn,className:pn,availableReactions:gn,topReactions:fn,canBuyPremium:vn,canPlayAnimatedEmojis:An,shouldCollectDebugLogs:yn,sentStoryReaction:Cn,stealthMode:wn,canSendOneTimeMedia:bn,quickReplyMessages:In,quickReplies:Sn,canSendQuickReplies:Mn,webPagePreview:Nn,noWebPage:Yn,isContactRequirePremium:kn,paidMessagesStars:Pn,effect:Fn,effectReactions:Tn,areEffectsSupported:Dn,canPlayEffect:xn,shouldPlayEffect:En,maxMessageLength:Ln,isSilentPosting:Bn,isPaymentMessageConfirmDialogOpen:Rn,starsBalance:On,isStarsBalanceModalOpen:Un,disallowedGifts:zn,isAccountFrozen:Kn,isAppConfigLoaded:Vn,insertingPeerIdMention:jn,pollMaxAnswers:Jn,onDropHide:$n,onFocus:qn,onBlur:Hn,onForward:Gn}=e;const{sendMessage:Wn,clearDraft:_n,showDialog:Qn,openPollModal:Zn,closePollModal:Xn,openTodoListModal:ei,closeTodoListModal:ti,loadScheduledHistory:ni,openThread:ii,addRecentEmoji:oi,sendInlineBotResult:si,loadSendAs:ai,resetOpenChatWithDraft:ri,callAttachBot:li,addRecentCustomEmoji:di,showNotification:ci,showAllowedMessageTypesNotification:ui,openStoryReactionPicker:hi,openGiftModal:mi,closeReactionPicker:pi,sendStoryReaction:gi,editMessage:fi,updateAttachmentSettings:vi,saveEffectInDraft:Ai,setReactionEffect:yi,hideEffectInComposer:Ci,updateChatSilentPosting:wi,updateInsertingPeerIdMention:bi,updateDraftSuggestedPostInfo:Ii}=(0,o.ko)(),Si=(0,q.A)(),Mi=(0,J.A)(),Ni=(0,i.li)(),Yi=(0,i.li)(),ki=(0,i.li)(),[Pi,Fi]=(0,i.Ul)(""),[Ti,Di]=(0,i.J0)(!1),xi=(0,j.A)(un),Ei=(0,i.li)(),Li=(0,G.A)(d),{width:Bi}=Y.A.get(),Ri="messageList"===t,Oi="story"===t,Ui=Ri?ce?.sendAsPeerIds:void 0,zi=Boolean(Ui?.length),[Ki,Vi,ji]=(0,V.A)(),Ji=(0,_.A)(oe,se),[$i,qi,Hi]=(0,V.A)(),[Gi,Wi,_i]=(0,V.A)(),Qi=P&&(0,l.ZV)(P),Zi=ce?.isMonoforum,{emojiSet:Xi,members:eo,botCommands:to}=ue||{},no=Xi?.id,io=!Pn&&!Zi,oo=Cn&&(0,l.a0)(Cn,a.tNZ);(0,i.vJ)(y.VU,[Pi]);const so=(0,i.li)(0),[ao,ro]=(0,W.A)(Ri&&m,ji);(0,O.A)(()=>{Di(!0)},430),(0,i.vJ)(()=>{Ri||pi()},[Ri,ae]),(0,i.vJ)(()=>{Ei.current=void 0},[oe]),(0,i.vJ)(()=>{Vn&&oe&&C&&!Oi&&!Zi&&ni({chatId:oe})},[C,oe,se,Oi,Vn,Zi]),(0,i.vJ)(()=>{const e=Ue&&ce?.areProfilesShown,t=ce&&(0,l.Vs)(ce)&&Boolean((0,l.gA)(ce)||ce.isLinkedInDiscussion||ce.hasGeo);!Ui&&C&&(t||e)&&ai({chatId:oe})},[ce,oe,Ue,C,ai,Ui]);const lo=(0,i.li)(!1);(0,X.A)(e=>{let[t,n]=e;lo.current=Boolean(oe===t&&Ui&&!n)},[oe,Ui]);const[co,uo]=(0,i.J0)([]),ho=Boolean(co.length),[mo,po]=(0,i.J0)(void 0),{canSendStickers:go,canSendGifs:fo,canAttachMedia:vo,canAttachPolls:Ao,canAttachEmbedLinks:yo,canAttachToDoLists:Co,canSendVoices:wo,canSendPlainText:bo,canSendAudios:Io,canSendVideos:So,canSendPhotos:Mo,canSendDocuments:No}=(0,i.Kr)(()=>(0,l.Q_)(ce,ue,fe,Ne,Oi,Pn,h),[ce,ue,fe,Ne,Oi,Pn,h]),Yo=kn&&Oi,ko=Yo||!bo,Po=(0,z.A)(()=>{if(ho)return co.length;const e=Pi()||ho?1:0;return He&&Ze?Ze+e:e||1},[Pi,ho,co,He,Ze]),Fo=Pn?Po*Pn:0,{closeConfirmDialog:To,dialogHandler:Do,shouldAutoApprove:xo,setAutoApprove:Eo,handleWithConfirmation:Lo}=(0,Ee.A)(Fo,Un,On),Bo=!ho&&yo&&!Yn&&Boolean(Nn),Ro=ko&&!P;(0,i.vJ)(()=>{Bo||vi({isInvertedMedia:void 0})},[Bo]);const Oo=(0,$.A)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hn,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t===hn&&Ro)return;const i=window.getSelection();let o;if(o=t===hn?document.querySelector(un):document.getElementById(t),i.rangeCount&&!n){const n=i.getRangeAt(0);if((0,x.L)(n,t))return(0,M.oR)(e),void o.dispatchEvent(new Event("input",{bubbles:!0}))}if(n){const t=e.split(" ")[0],n=Pi().startsWith(t);Fi(n?e:`${e}${Pi()}`)}else Fi(`${Pi()}${e}`);(0,r.Uz)(()=>{(0,w.A)(o)})}),Uo=(0,$.A)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hn;const n=(0,L.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");Oo(n,t)}),zo=(0,$.A)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hn,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=(0,B.QY)(e);Oo(i,t,n)}),Ko=(0,$.A)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hn;Oo((0,D.hB)(e),t)}),Vo=(0,$.A)(()=>{mo&&(zo(mo,hn),po(void 0))}),{shouldForceCompression:jo,shouldForceAsFile:Jo,handleAppendFiles:$o,handleFileSelect:qo,onCaptionUpdate:Ho,handleClearAttachments:Go,handleSetAttachments:Wo}=function(e){let{attachments:t,fileSizeLimit:n,setHtml:s,setAttachments:a,chatId:r,canSendAudios:d,canSendVideos:c,canSendPhotos:u,canSendDocuments:h,insertNextText:m,editedMessage:p,shouldSendInHighQuality:g}=e;const f=(0,J.A)(),{openLimitReachedModal:v,showAllowedMessageTypesNotification:A,showNotification:y}=(0,o.ko)(),[C,w]=(0,i.J0)(!1),[b,S]=(0,i.J0)(!1),M=(0,$.A)(()=>{a(I.p),m()}),N=(0,$.A)(e=>{const i="function"==typeof e?e(t):e;if(i.length)if(i.some(e=>{const t=(0,l.ES)(e);return"audio"===t&&!d&&!h||"video"===t&&!c&&!h||"photo"===t&&!u&&!h||"file"===t&&!h}))A({chatId:r});else if(i.some(e=>{let{size:t}=e;return t>n}))v({limit:"uploadMaxFileparts"});else{a(i);const e=i.some(e=>{const t=(0,l.ES)(e);return"audio"===t&&!d||"video"===t&&!c||"photo"===t&&!u});w(Boolean(e&&h)),S(!h)}else M()}),Y=(0,$.A)(async(e,n)=>{if(p){const t=await(0,T.A)(e[0].name,e[0]),n=p&&(0,l.eh)(p,t);p?.groupedId?n?N([t]):y({message:f("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):N([t])}else{const i=await Promise.all(e.map(e=>(0,T.A)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:g})));N([...t,...i])}}),k=(0,$.A)(async e=>{if(p){const t=await(0,T.A)(e[0].name,e[0]),n=p&&(0,l.eh)(p,t);p?.groupedId?n?N([t]):y({message:f("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):N([t])}else{const t=await Promise.all(e.map(e=>(0,T.A)(e.name,e,{shouldSendInHighQuality:g})));N(t)}}),P=(0,$.A)(async()=>{const e=await Promise.all(t.map(e=>(0,T.A)(e.filename,e.blob,{shouldSendInHighQuality:g})));N(e)});return(0,i.vJ)(()=>{P()},[g]),{handleAppendFiles:Y,handleFileSelect:k,onCaptionUpdate:s,handleClearAttachments:M,handleSetAttachments:N,shouldForceCompression:b,shouldForceAsFile:C}}({attachments:co,setHtml:Fi,setAttachments:uo,fileSizeLimit:ze,chatId:oe,canSendAudios:Io,canSendVideos:So,canSendPhotos:Mo,canSendDocuments:No,insertNextText:Vo,editedMessage:P,shouldSendInHighQuality:rn.shouldSendInHighQuality}),[_o,Qo,Zo]=(0,V.A)(),[Xo,es,ts]=(0,V.A)(),[ns,is,os]=(0,V.A)(),[ss,as,rs]=(0,V.A)(),[ls,ds,cs]=(0,V.A)(),{startRecordingVoice:us,stopRecordingVoice:hs,pauseRecordingVoice:ms,activeVoiceRecording:ps,currentRecordTime:gs,recordButtonRef:fs,startRecordTimeRef:vs,isViewOnceEnabled:As,setIsViewOnceEnabled:ys,toogleViewOnceEnabled:Cs}=(()=>{const e=(0,i.li)(),[t,n]=(0,i.J0)(),o=(0,i.li)(),[s,a]=(0,i.J0)(),[l,d]=(0,i.J0)(!1);(0,i.vJ)(()=>{p.Yw&&p.pW&&Je()},[]);const c=(0,$.A)(async()=>{try{const{stop:t,pause:i}=await $e(t=>{e.current&&(o.current&&Date.now()%4==0&&(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)}),a(Date.now()))});o.current=Date.now(),a(Date.now()),n({stop:t,pause:i})}catch(e){console.error(e)}}),u=(0,$.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),o.current=void 0,a(void 0),(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.stop()}catch(e){return void console.error(e)}}});(0,i.vJ)(()=>t?(0,Oe.A)(h):void 0,[t,h]);const m=(0,$.A)(()=>{d(!l)});return{startRecordingVoice:c,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:o,isViewOnceEnabled:l,setIsViewOnceEnabled:d,toogleViewOnceEnabled:m}})(),ws=me&&!Oi;(0,R.A)(()=>{Ji({type:"recordAudio"})},ws?ps&&a.cqp:void 0),(0,i.vJ)(()=>{me&&!Oi&&(ps||Ji({type:"cancel"}))},[ps,me,Oi,Ji]);const bs=(0,Z.i)(Boolean(P));(0,i.vJ)(()=>{me&&!Oi&&Pi()&&!bs.current&&Ji({type:"typing"})},[Pi,bs,me,Oi,Ji]);const Is=ce&&(0,l.SJ)(ce),{isEmojiTooltipOpen:Ss,closeEmojiTooltip:Ms,filteredEmojis:Ns,filteredCustomEmojis:Ys,insertEmoji:ks}=(0,Me.A)(Boolean(C&&n&&(Oi||me)&&Et&&!ho),Pi,Fi,void 0,Gt,Bt,Ht),{isCustomEmojiTooltipOpen:Ps,closeCustomEmojiTooltip:Fs,insertCustomEmoji:Ts}=(0,Ae.A)(Boolean(C&&n&&(Oi||me)&&Lt&&!ho),Pi,Fi,xi,Ni,pt),{isStickerTooltipOpen:Ds,closeStickerTooltip:xs}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,o.ko)(),[l,d,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 i=(0,ee.S)(n);return i&&(p.TL&&1===(0,Be.A)(i)||!p.TL&&Boolean(n.match(Re)))?p.TL?i:i.match(/alt="(.+)"/)?.[1]:void 0},[t,e]),h=(0,z.A)(()=>Boolean(u()),[u]),m=Boolean(n?.length);return(0,i.vJ)(()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()},[e,h,u,m,s,r]),(0,i.vJ)(c,[c,t]),{isStickerTooltipOpen:Boolean(h&&m&&!l),closeStickerTooltip:d}}(Boolean(C&&n&&(Oi||me)&&Et&&go&&!ho),Pi,mt),{isMentionTooltipOpen:Es,closeMentionTooltip:Ls,insertMention:Bs,mentionFilteredUsers:Rs}=(0,xe.A)(Boolean(Ri&&C&&me&&!ho),Pi,Fi,xi,Ni,eo,gt,ft);(0,i.vJ)(()=>{if(!jn)return;const e=(0,u.PVB)((0,o.mS)(),jn);e&&Bs(e,!0,!0),bi({peerId:void 0})},[jn,Bs]);const{isOpen:Os,botId:Us,isGallery:zs,switchPm:Ks,switchWebview:Vs,results:js,closeTooltip:Js,help:$s,loadMore:qs}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:l}=(0,o.ko)(),[d,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(Ye);return n?Te(n[1],n[2],""===n[2]&&!t.match(ke)):Pe}(t):Pe},[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,z.A)(h,[h,n],!0);(0,X.A)(e=>{let[t]=e;t&&r({username:t})},[m,r]),(0,i.vJ)(()=>{f&&a({chatId:t,username:f,query:p})},[t,p,a,f]),(0,i.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:b,help:I}=f&&s?.[f]||{},S=Boolean((w?.length||A||y)&&!d);(0,i.vJ)(()=>{S||m||l()},[S,l,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(Ri&&C&&me&&!ho),oe,Pi,Wt),Hs=Boolean(Sn&&Object.keys(Sn).length),{isOpen:Gs,close:Ws,filteredBotCommands:_s,filteredQuickReplies:Qs}=function(e,t,n,o,s){const[a,r]=(0,i.J0)(),[l,d]=(0,i.J0)(),[c,u,h]=(0,V.A)(!1),m=(0,te.gs)(()=>{const n=t();return e&&n.startsWith("/")?(0,ee.S)(n).match(ie)?.[0].trim():void 0},[t,e],300),p=(0,ne.A)(m,[m,t],!0);return(0,i.vJ)(()=>{const e=p(),t=n||o;if(!e||!t&&!s)return r(void 0),void d(void 0);const i=e.substring(1),a=t?.filter(e=>!i||e.command.startsWith(i));r(a?.length?a:void 0);const l=Object.values(s||{}).filter(e=>!i||e.shortcut.startsWith(i));d(l?.length?l:void 0)},[p,n,o,s]),(0,i.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||l?.length)&&!c),close:u,filteredBotCommands:a,filteredQuickReplies:l}}(Boolean(Ri&&C&&me&&(Qt&&Qt?.length||to?.length||Hs&&Mn)),Pi,Qt,to,Mn?Sn:void 0);(e=>{let{draft:t,chatId:n,threadId:l,getHtml:d,setHtml:c,editedMessage:u,isDisabled:h}=e;const{saveDraft:m,clearDraft:p,loadCustomEmojis:g}=(0,o.ko)(),f=(0,i.li)(!1);(0,i.vJ)(()=>{const e=d(),n=void 0!==t?.isLocal;(0,B.QY)(t?.text)!==e||n?f.current=!0:f.current=!1},[t,d]),(0,i.vJ)(()=>{f.current=!1},[n,l]);const v=Boolean(u),A=(0,$.A)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(h||v||!f.current)return;const t=d();t?(0,r.YS)(()=>{m({chatId:e.chatId??n,threadId:e.threadId??l,text:(0,S.Ay)(t)})}):p({chatId:e.chatId??n,threadId:e.threadId??l,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})}),y=(0,Ce.A)(a.mPG,!0,void 0,[n,l]);(0,ye.A)(e=>{let[i,o,d]=e;if(h)return;const m=f.current,p=t?.suggestedPostInfo&&!d?.suggestedPostInfo;if(n===i&&l===o){if(m&&!t)return;if(!t&&d&&c(""),m&&!p)return}if(u||!t)return;c((0,B.QY)(t.text)),p&&(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)});const v=t.text?.entities?.map(e=>e.type===s.C7.CustomEmoji&&e.documentId).filter(Boolean)||[];v.length&&g({ids:v})},[n,l,t,d,c,u,h]),(0,i.Nf)(()=>{if(!h)return()=>{v||A({chatId:n,threadId:l}),Ie=!0,(0,r.YS)(()=>{Ie=!1})}},[n,l,v,A,h]);const C=(0,Z.i)(n),b=(0,Z.i)(l);(0,i.vJ)(()=>{if(h||Ie)return;if(!d())return void A();const e=C.current,t=b.current;y(()=>{C.current===e&&b.current===t&&A()})},[C,d,h,y,b,A]),(0,we.Ay)(A),(0,be.A)(A)})({draft:de,chatId:oe,threadId:se,getHtml:Pi,setHtml:Fi,editedMessage:P,isDisabled:Oi||Boolean(tn)||!Qe&&Zi}),function(e){let{getHtml:t,chatId:n,threadId:a}=e;const{loadWebPagePreview:r,clearWebPagePreview:l,toggleMessageWebPage:d}=(0,o.ko)(),c=(0,i.li)(),u=(0,te.tF)(()=>{const e=(0,S.Ay)(t()),n=e.entities?.find(e=>e.type===s.C7.TextUrl);return c.current=e,n?.url||e.text.match(De)?.[0]},[t],300,!0),h=(0,ne.A)(u,[u,t],!0);(0,i.vJ)(()=>{const e=h(),t=c.current;e?r({text:t}):(l(),d({chatId:n,threadId:a}))},[h,n,a]),(0,X.A)(()=>{l(),d({chatId:n,threadId:a})},[n,l,a,d])}({chatId:oe,threadId:se,getHtml:Pi});const Zs=(0,$.A)(function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||Fi(""),uo(I.p),po(void 0),Ms(),Fs(),xs(),Ls(),k?setTimeout(()=>os(),350):os()}),[Xs,ea,ta]=((e,t,n,s,d,c,u,h,m)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,o.ko)(),[A,y]=(0,i.J0)(!1),C=h?.replyInfo?.replyToMsgId;(0,K.A)(e=>{let[i,o]=e;if(!n)return;if(C&&o!==C)return t(""),void y(!1);if(i?.id===n.id&&C===o)return;const s=!i&&m?.text.length?m:n.content.text,l=(0,B.QY)(s);t(l),y(!0),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)})},[n,C,m,t]),(0,i.vJ)(()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Se.has(e.type));f({chatId:d,threadId:c,noWebPage:e})},[d,c,n]),(0,i.vJ)(()=>{if(n)return()=>{const t=(0,S.Ay)(e()),n=t.text.length?t:void 0;g({chatId:d,threadId:c,type:u,text:n})}},[d,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,K.A)(e=>{let[t]=e;n&&t?.id===n.id&&I()&&f({chatId:d,threadId:c,noWebPage:!1})},[n,d,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()}),Y=(0,$.A)(()=>{const{text:t,entities:i}=(0,S.Ay)(e());n&&(t||(0,l.mR)(n)?(p({messageList:{chatId:d,threadId:c,type:u},text:t,entities:i}),s(),M()):v({chatId:d,messageIds:[n.id],isSchedule:"scheduled"===u}))}),k=(0,$.A)(()=>{if(!n)return;const t=(0,S.Ay)(e()),i=t.text.length?t:void 0;g({chatId:d,threadId:c,type:u,text:i})});return(0,we.Ay)(k),(0,be.A)(k),[Y,N,A]})(Pi,Fi,P,Zs,oe,se,le,de,en),na=(0,Z.i)(Zs),ia=(0,Z.i)(hs);(0,i.vJ)(()=>()=>{ia.current(),na.current()},[oe,se,na,ia]);const oa=(0,i.Kr)(()=>{if(zn)return Object.values(zn).every(Boolean)},[zn]),sa=Boolean(!Ne&&qe&&!oa),aa=Zi&&!P&&!He&&!_e&&!de?.suggestedPostInfo,ra=(0,$.A)(()=>{const e=so.current;ci(e?{message:Si("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:ft,shouldReplaceHistory:!0}},actionText:Si("Open")}:{message:Si("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:Si("PremiumMore")}),so.current=Number(!e)}),la=(0,z.A)(()=>$i||!Gn||Pi()&&!ho?P&&ta?qt.Edit:!p.pW||ps||He||Pi()&&!ho?h?qt.Schedule:qt.Send:qt.Record:qt.Forward,[ps,P,Pi,ho,He,$i,Gn,ta,h]),da=!h,{isContextMenuOpen:ca,handleContextMenu:ua,handleContextMenuClose:ha,handleContextMenuHide:ma}=(0,U.A)(fs,!(la===qt.Send&&da)),{contextMenuAnchor:pa,handleContextMenu:ga,handleBeforeContextMenu:fa,handleContextMenuHide:va}=(0,U.A)(ki,!Oi);(0,i.vJ)(()=>{je||pa&&(hi({peerId:oe,storyId:ae,position:pa}),va())},[oe,va,je,ae,pa]),ve(me||Oi,zo,Wo,po,P,!pe&&!Ne,ra);const Aa=(0,$.A)(()=>{P&&ea()}),ya=(0,$.A)((e,t)=>{const n=t?Dt:Ln;if(e?.length>n){const t=e.length-n;return Qn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0}),Ca=(0,$.A)(()=>{if(dn&&!Is){const e=document.querySelector(un),t=(0,N.Fm)(),n=Ei.current&&Math.floor(t-Ei.current),i=dn.nextSendDate&&dn.nextSendDate>t;if(n&&n<dn.seconds||i){const o=i?dn.nextSendDate-t:dn.seconds-n;return Qn({data:{message:Si("SlowModeHint",(0,f.QO)(o)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0}),wa=e=>{if(!re&&!ae)return!1;const{text:t}=(0,S.Ay)(Pi());return!(!t&&!e.length||!ya(t,!0)||!Ca())},ba=(0,$.A)(e=>{let{attachments:t,sendCompressed:n=rn.shouldCompress,sendGrouped:i=rn.shouldSendGrouped,isSilent:o,scheduledAt:s,isInvertedMedia:a}=e;if(!re&&!ae)return;o=o||Bn;const{text:l,entities:d}=(0,S.Ay)(Pi());a=l&&n&&i?a:void 0,P?fi({messageList:re,text:l,entities:d,attachments:(0,T.L)(t,n)}):Wn({messageList:re,text:l,entities:d,scheduledAt:s,isSilent:o,shouldUpdateStickerSetOrder:cn,attachments:(0,T.L)(t,n),shouldGroupMessages:i,isInvertedMedia:a}),Ei.current=(0,N.Fm)(),_n({chatId:oe,isLocalOnly:!0}),(0,r.YS)(()=>{Zs()})}),Ia=(0,$.A)((e,t,n)=>{if(wa(co)){if(P)return void ba({attachments:co,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});Lo(ba,{attachments:co,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}}),Sa=(0,$.A)((e,t,n,i,o)=>{wa(co)&&ba({attachments:co,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:i,isInvertedMedia:o})}),Ma=(0,$.A)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const{text:i,entities:o}=(0,S.Ay)(Pi());if(e.length)return void(wa(e)&&ba({attachments:e,scheduledAt:n,isSilent:t}));if(!i&&!He)return;if(!ya(i))return;const s=document.querySelector(un),a=Fn?.id;if(i||He){if(!Ca())return;const e=Bo?rn.isInvertedMedia:void 0;Dn&&Ai({chatId:oe,threadId:se,effectId:void 0}),Wn({messageList:re,text:i,entities:o,scheduledAt:n,isSilent:t,shouldUpdateStickerSetOrder:cn,isInvertedMedia:e,effectId:a,webPageMediaSize:rn.webPageMediaSize,webPageUrl:Bo?Nn.url:void 0,isForwarding:He})}Ei.current=(0,N.Fm)(),_n({chatId:oe,threadId:se,isLocalOnly:!0,shouldKeepReply:He}),p.pz&&s&&s===document.activeElement&&F(s),(0,r.YS)(()=>{Zs()})}),Na=(0,$.A)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if(!re&&!ae)return;e=e||Bn;let n=co;if(ps){const e=await hs(),t=As?a.dxe:void 0;if(e){const{blob:i,duration:o,waveform:s}=e;n=[await(0,T.A)("wonderful-voice-message.ogg",i,{voice:{duration:o,waveform:s},ttlSeconds:t})]}}Ma(n,e,t)}),Ya=(0,$.A)(function(){Lo(Na,arguments.length>0&&void 0!==arguments[0]&&arguments[0],arguments.length>1?arguments[1]:void 0)}),ka=(0,$.A)(()=>{pe?ei({chatId:oe}):ci({message:Mi("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Mi("PremiumMore")})}),Pa=(0,$.A)(()=>{if("webApp"!==on?.type)return;const e=(0,A.vG)(on.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,v._)(on.url):li({chatId:oe,url:on.url,threadId:se})}),Fa=(0,$.A)(()=>{os(),es()}),Ta=(0,$.A)((e,t,n,i)=>{if(e&&"queryId"in e){const{id:n,queryId:i,isSilent:o}=e;return void si({id:n,chatId:oe,threadId:se,queryId:i,scheduledAt:t,isSilent:o||Bn})}const{isSilent:o,...s}=e||{};if(e&&0!==Object.keys(s).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:i=!1,isInvertedMedia:s}=e;Sa(n,i,o,t,s)}else Wn({...e,messageList:n,scheduledAt:t,effectId:i});else Na(Boolean(o),t)});(0,K.A)(e=>{let[t]=e;re&&xt&&xt!==t&&ao(e=>{Ta(xt,e,re)})},[xt,re,Ta,ao]),(0,i.vJ)(()=>{tn&&(zo(tn,void 0,!0),ri(),(0,r.Uz)(()=>{const e=document.getElementById(hn);(0,w.A)(e,!0)}))},[hn,tn,ri,Fi]),(0,i.vJ)(()=>{nn?.length&&(qo(nn),ri())},[qo,nn,ri]);const Da=(0,$.A)((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||pe||Ne||n===no?Ko(e,t):ra()}),xa=(0,$.A)(e=>{Da(e,a.e0F)}),Ea=(0,$.A)((e,t,n)=>{(re||ae)&&(t=t||Bn,h||n?(Vi(),ao(n=>{ji(),Lo(Ta,{gif:e,isSilent:t},n,re),(0,r.YS)(()=>{Zs(!0)})})):(Lo(Wn,{messageList:re,gif:e,isSilent:t}),(0,r.YS)(()=>{Zs(!0)})))}),La=(0,$.A)(function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;(re||ae)&&(t=t||Bn,e={...e,isPreloadedGlobally:!0},h||n?(Vi(),ao(n=>{ji(),Lo(Ta,{sticker:e,isSilent:t},n,re),(0,r.YS)(()=>{Zs(i)})})):(Lo(Wn,{messageList:re,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:cn&&o}),_n({chatId:oe,threadId:se,isLocalOnly:!0}),(0,r.YS)(()=>{Zs(i)})))}),Ba=(0,$.A)((e,t,n)=>{if(!re&&!ae)return;t=t||Bn,h||n?ao(n=>{Lo(Ta,{id:e.id,queryId:e.queryId,isSilent:t},n,re)}):Lo(si,{id:e.id,queryId:e.queryId,threadId:se,chatId:oe,isSilent:t});const i=document.querySelector(un);p.pz&&i&&i===document.activeElement&&F(i),_n({chatId:oe,isLocalOnly:!0}),(0,r.YS)(()=>{Zs()})}),Ra=(0,$.A)(()=>{_n({chatId:oe,isLocalOnly:!0}),(0,r.YS)(()=>{Zs()})}),Oa=(0,$.A)(e=>{re&&(h?(ao(t=>{Lo(Ta,{poll:e},t,re)}),Xn()):(Lo(Wn,{messageList:re,poll:e,isSilent:Bn}),Xn()))}),Ua=(0,$.A)(e=>{re&&(h?ao(t=>{Lo(Ta,{todo:e},t,re)}):Lo(Wn,{messageList:re,todo:e,isSilent:Bn}))}),za=(0,$.A)(e=>{if(h)ao(t=>{Ta({...e,isSilent:!0},t,re)});else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:i}=e;Sa(t,n,!0,void 0,i)}else Na(!0)}),Ka=(0,$.A)(()=>{const e=document.querySelector(un);if(!k||e!==document.activeElement)return ts(),os(),void as();e?.blur(),setTimeout(()=>{ts(),os(),as()},100)});(0,i.vJ)(()=>{Ro&&Fi("")},[Ro,Fi,co]);const Va=(0,$.A)(e=>{Uo(e,a.e0F)}),ja=(0,$.A)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hn;const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.L)(n,e))return void document.execCommand("delete",!1)}Fi(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const i=n.textContent.length,o=document.createRange(),s=window.getSelection();o.setStart(n,i),o.setEnd(n,i),s.removeAllRanges(),s.addRange(o),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(Pi()))}),Ja=(0,$.A)(()=>{ja(a.e0F)}),$a=(0,$.A)(()=>{ii({chatId:oe,threadId:se,type:"scheduled",noForumTopicPanel:!0})}),qa=(0,$.A)(()=>{mi({forUserId:oe})}),Ha=(0,$.A)(()=>{Ii({price:{currency:a.OUy,amount:0,nanos:0}})}),Ga=(0,$.A)(()=>{const e=!Bn;wi({chatId:oe,isEnabled:e}),ci({localId:"silentPosting",icon:e?"mute":"unmute",message:Mi(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})});(0,i.vJ)(()=>{Ke&&k&&os()},[Ke,os,k]),(0,i.vJ)(()=>{C&&(Ve?ds():setTimeout(()=>{cs()},200))},[Ve,cs,ds,C]);const Wa=(0,z.A)(()=>Boolean(Pi()),[Pi]),_a=fe&&"webApp"===on?.type&&!P&&"thread"===le,Qa=_a&&!Wa&&!ps,[Za,Xa]=(0,i.Kr)(()=>dn?.nextSendDate?["SlowModeWait",dn.nextSendDate]:wn?.activeUntil&&Oi?["StealthModeActiveHint",wn.activeUntil]:[],[Oi,dn?.nextSendDate,wn?.activeUntil]),er=_o||ns||Ss||ss||Es||Os||Xo||Gi||Ds||Gs||Ps||Qa||ca||Boolean(ps)||co.length>0||$i,tr=er&&!je&&Oi&&!Gi&&!ns,nr=(0,i.Kr)(()=>ps&&Bi<=600?"":Ro?Mi(Oi?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):ot||rt||(Pn?Mi("ComposerPlaceholderPaidMessage",{amount:(0,b.U2)(Mi,Pn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):_e&&Qe?Mi("ComposerPlaceholderCaption"):ce?.adminRights?.anonymous?Mi("ComposerPlaceholderAnonymous"):ce?.isForum&&ce?.isForumAsMessages&&se===s.l3?he?Mi("ComposerPlaceholderTopic",{topic:he.title}):Mi("ComposerPlaceholderTopicGeneral"):Mi(Ue?Bn?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder")),[ps,ot,ce,rt,Ue,Ro,Oi,Bn,Mi,he,_e,se,Bi,Pn,Qe]);(0,i.vJ)(()=>{er?qn?.():Hn?.()},[er,Hn,qn]);const{shouldRender:ir,transitionClassNames:or}=(0,Q.A)(tr),sr=!(la!==qt.Record||vo&&ge&&wo),ar=(0,$.A)(()=>{switch(la){case qt.Forward:Gn?.();break;case qt.Send:Ya();break;case qt.Record:sr?ge?wo||ui({chatId:oe,messageListType:le}):ci({message:Si("VoiceMessagesRestrictedByPrivacy",ce?.title)}):(ys(!1),us());break;case qt.Edit:Xs();break;case qt.Schedule:if(ps&&ms(),!re)return;ao(e=>{Ta({},e,re,Fn?.id)})}}),rr=new Date;rr.setSeconds(0),rr.setMilliseconds(0);const lr=new Date;lr.setFullYear(lr.getFullYear()+1);let dr="SendMessage";switch(la){case qt.Forward:dr="Forward";break;case qt.Edit:dr="Save edited message";break;case qt.Record:dr=vo?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const cr=(0,g.A)("Composer",!Ve&&"shown",ls&&"hover-disabled",Ti&&"mounted",pn),ur=(0,$.A)(e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const i=(0,u.O8F)((0,o.mS)(),e.documentId);if(!i)return;if(!i.isFree&&!pe&&!Ne)return void ra();const s=(0,S.Ay)((0,D.hB)(i));t=s.text,n=s.entities}Lo(Wn,{text:t,entities:n,isReaction:!0}),pi()}),hr=(0,$.A)(e=>{yi({chatId:oe,threadId:se,reaction:e}),pi()}),mr=(0,$.A)(e=>{hi({peerId:oe,storyId:ae,position:e,sendAsMessage:!0})}),pr=(0,$.A)(()=>{const e=Cn?void 0:a.tNZ;gi({peerId:oe,storyId:ae,containerId:(0,l.$_)(oe,ae),reaction:e})}),gr=(0,$.A)(()=>{ao(e=>{Ta({},e,re)})}),fr=(0,$.A)(()=>{Lo(za)}),vr=(0,$.A)(()=>{Lo(Ta,{},a.NkL,re,Fn?.id)}),Ar=(0,$.A)((e,t,n)=>{ao(i=>{Lo(Ta,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},i,re)})}),yr=(0,$.A)((e,t,n)=>{Lo(za,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}),Cr=(0,$.A)(()=>{Ai({chatId:oe,threadId:se,effectId:void 0})}),wr=(0,$.A)(()=>{Ci({})}),br=(0,i.Kr)(()=>{switch(la){case qt.Edit:return Xs;case qt.Schedule:return gr;default:return Ya}},[la,Xs,Ya]),Ir=fe&&"commands"===on?.type&&!P&&!1!==Qt&&!ps,Sr=Dn&&Fn?.emoticon,Mr=Boolean(Pn&&la===qt.Send),Nr=(0,H.A)(Mr);return(0,Ge.FD)("div",{className:cr,children:[Ri&&vo&&C&&(0,Ge.Y)(wt,{isOpen:d!==Ct.I.None,withQuick:d===Ct.I.QuickFile||Li===Ct.I.QuickFile,onHide:$n,onFileSelect:qo,editingMessage:P}),ir&&!Yo&&(0,Ge.Y)(Ut.A,{topReactions:fn,allAvailableReactions:gn,onToggleReaction:ur,isPrivate:!0,isReady:C,canBuyPremium:vn,isCurrentUserPremium:pe,isInSavedMessages:Ne,isInStoryViewer:Oi,canPlayAnimatedEmojis:An,onShowMore:mr,className:or}),(0,Ge.Y)(We,{chatId:oe,threadId:se,canShowCustomSendMenu:da,attachments:co,getHtml:Pi,isReady:C,shouldForceCompression:jo,shouldForceAsFile:Jo,isForCurrentMessageList:me,isForMessage:Ri,shouldSchedule:io&&h,canSchedule:io,forceDarkTheme:Oi,onCaptionUpdate:Ho,onSendSilent:yr,onSend:Ia,onSendScheduled:Ar,onFileAppend:$o,onClear:Go,onAttachmentsUpdate:Wo,onCustomEmojiSelect:xa,onRemoveSymbol:Ja,onEmojiSelect:Va,editingMessage:P,onSendWhenOnline:vr,canScheduleUntilOnline:m&&!As,paidMessagesStars:Pn}),(0,Ge.Y)(Nt,{isOpen:Xe.isOpen,isQuiz:Xe.isQuiz,shouldBeAnonymous:Ue,maxOptionsCount:Jn,onClear:Xn,onSend:Oa}),(0,Ge.Y)(Ft,{modal:tt,onClear:ti,onSend:Ua}),(0,Ge.Y)(Yt,{isOpen:ss,onClose:rs,chatId:oe,selectedSendAsId:Xt,sendAsPeerIds:Ui,isCurrentUserPremium:pe}),(0,Ge.Y)(St,{isOpen:Es,filteredUsers:Rs,onInsertUserName:Bs,onClose:Ls}),(0,Ge.Y)(ut,{isOpen:Gs,chatId:oe,withUsername:Boolean(to),botCommands:_s,quickReplies:Qs,getHtml:Pi,self:Tt,quickReplyMessages:In,onClick:Ra,onClose:Ws}),(0,Ge.FD)("div",{className:(0,g.A)("composer-wrapper",Oi&&"with-story-tweaks",Yo&&"is-need-premium"),children:[!Yo&&(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"})]})]}),Ri&&(0,Ge.FD)(Ge.FK,{children:[(0,Ge.Y)(It,{isOpen:Os,botId:Us,isGallery:zs,inlineBotResults:js,switchPm:Ks,switchWebview:Vs,loadMore:qs,isSavedMessages:Ne,canSendGifs:fo,isCurrentUserPremium:pe,onSelectResult:Ba,onClose:Js}),(0,Ge.Y)(vt,{onClear:Aa,shouldForceShowEditing:Boolean(ta&&P),chatId:oe,threadId:se,messageListType:le}),(0,Ge.Y)(Rt,{chatId:oe,threadId:se,isDisabled:!yo||ho||!Wa,isEditing:Boolean(P)})]}),(0,Ge.FD)("div",{className:(0,g.A)("message-input-wrapper",(0,E.y)(Tt)),children:[Ri&&(0,Ge.FD)(Ge.FK,{children:[_a&&(0,Ge.Y)(ct,{isOpen:Qa,text:on.text,isDisabled:Boolean(ps),onClick:Pa}),Ir&&(0,Ge.Y)(it.A,{className:(0,g.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===Qt,color:"translucent",onActivate:Fa,ariaLabel:"Open bot command keyboard",children:(0,Ge.Y)(et.A,{name:"bot-commands-filled"})}),zi&&Zt&&(0,Ge.Y)(lt.A,{round:!0,color:"translucent",onClick:ss?rs:Ka,ariaLabel:Si("SendMessageAsTitle"),className:(0,g.A)("send-as-button","composer-action-button",lo.current&&"appear-animation"),children:(0,Ge.Y)(jt.A,{peer:Zt,size:"tiny"})})]}),(!Ro||fo||go)&&!Yo&&!Kn&&(0,Ge.Y)(Pt.A,{chatId:oe,threadId:se,isMobile:k,isReady:C,isSymbolMenuOpen:ns,openSymbolMenu:is,closeSymbolMenu:os,canSendStickers:go,canSendGifs:fo,isMessageComposer:Ri,onGifSelect:Ea,onStickerSelect:La,onCustomEmojiSelect:Da,onRemoveSymbol:ja,onEmojiSelect:Uo,closeBotCommandMenu:ts,closeSendAsMenu:rs,isSymbolMenuForced:Ki,canSendPlainText:!Ro,inputCssSelector:un,idPrefix:t,forceDarkTheme:Oi}),(0,Ge.Y)(Mt.A,{ref:Ni,id:mn,editableInputId:hn,customEmojiPrefix:t,isStoryInput:Oi,chatId:oe,canSendPlainText:!Ro,threadId:se,isReady:C,isActive:!ho,getHtml:Pi,placeholder:nr,timedPlaceholderDate:Xa,timedPlaceholderLangKey:Za,forcedPlaceholder:$s,canAutoFocus:C&&me&&!ho&&Ri,noFocusInterception:ho,shouldSuppressFocus:k&&ns,shouldSuppressTextFormatter:Ss||Es||Os,onUpdate:Fi,onSend:br,onSuppressedFocus:os,onFocus:qi,onBlur:Hi,isNeedPremium:Yo,messageListType:le}),Ri&&(0,Ge.FD)(Ge.FK,{children:[_t&&Boolean(Us)&&(0,Ge.Y)(zt.A,{color:"gray"}),(0,Ge.Y)(Kt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(Wa),direction:"inverse",name:"slideFadeAndroid",children:!Wa&&(0,Ge.FD)(Ge.FK,{children:[Ue&&(0,Ge.Y)(Kt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(Bn),children:(0,Ge.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Ga,ariaLabel:Mi(Bn?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),children:(0,Ge.Y)(et.A,{name:Bn?"mute":"unmute"})})}),ht&&(0,Ge.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:$a,ariaLabel:Mi("AriaComposerOpenScheduled"),children:(0,Ge.Y)(et.A,{name:"scheduled"})}),sa&&(0,Ge.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:qa,children:(0,Ge.Y)(et.A,{name:"gift"})}),aa&&(0,Ge.Y)(lt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Ha,children:(0,Ge.Y)(et.A,{name:"cash-circle"})}),Boolean(nt)&&!ps&&!P&&(0,Ge.Y)(it.A,{className:(0,g.A)("composer-action-button",_o&&"activated"),round:!0,color:"translucent",onActivate:Qo,ariaLabel:Mi("AriaComposerBotKeyboard"),children:(0,Ge.Y)(et.A,{name:"bot-command"})})]})})]}),ps&&Boolean(gs)&&(0,Ge.Y)("span",{className:"recording-state",children:(0,f.JW)(gs-vs.current)}),!Yo&&(0,Ge.Y)(st,{chatId:oe,threadId:se,editingMessage:P,canEditMedia:Qi,isButtonVisible:!ps,canAttachMedia:vo,canAttachPolls:Ao,canAttachToDoLists:Co,canSendPhotos:Mo,canSendVideos:So,canSendDocuments:No,canSendAudios:Io,onFileSelect:qo,onPollCreate:Zn,onTodoListCreate:ka,isScheduled:h,attachBots:Ri?sn:void 0,peerType:an,shouldCollectDebugLogs:yn,theme:ln,onMenuOpen:Wi,onMenuClose:_i,messageListType:le,paidMessagesStars:Pn}),Ri&&Boolean(nt)&&(0,Ge.Y)(dt,{messageId:nt,threadId:se,isOpen:_o,onClose:Zo}),Ri&&Qt&&(0,Ge.Y)(at,{isOpen:Xo,botCommands:Qt,onClose:ts}),(0,Ge.Y)(At.A,{chatId:oe,isOpen:Ps,onCustomEmojiSelect:Ts,addRecentCustomEmoji:di,onClose:Fs},`custom-emoji-tooltip-${hn}`),(0,Ge.Y)(kt,{chatId:oe,threadId:se,isOpen:Ds,onStickerSelect:La,onClose:xs},`sticker-tooltip-${hn}`),(0,Ge.Y)(bt.A,{isOpen:Ss,emojis:Ns,customEmojis:Ys,addRecentEmoji:oi,addRecentCustomEmoji:di,onEmojiSelect:ks,onCustomEmojiSelect:ks,onClose:Ms},`emoji-tooltip-${hn}`)]})]}),bn&&ps&&(0,Ge.FD)(lt.A,{className:(0,g.A)("view-once",As&&"active"),round:!0,color:"secondary",ariaLabel:Si("Chat.PlayOnceVoiceMessageTooltip"),onClick:Cs,children:[(0,Ge.Y)(et.A,{name:"view-once"}),(0,Ge.Y)(et.A,{name:"one-filled"})]}),ps&&(0,Ge.Y)(lt.A,{round:!0,color:"danger",className:"cancel",onClick:hs,ariaLabel:"Cancel voice recording",children:(0,Ge.Y)(et.A,{name:"delete"})}),Oi&&!ps&&(0,Ge.FD)(lt.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:pr,onContextMenu:ga,onMouseDown:fa,ariaLabel:Si("AccDescrLike"),ref:ki,children:[Cn&&(0,Ge.Y)($t.A,{containerId:(0,l.$_)(oe,ae),reaction:Cn,withEffectOnly:oo},(0,l.Jj)(Cn)),(!Cn||oo)&&(0,Ge.Y)(et.A,{name:"heart",className:(0,g.A)(oo&&"story-reaction-heart")})]}),(0,Ge.FD)(lt.A,{ref:fs,round:!0,color:"secondary",className:(0,g.A)(la,"main-button",!C&&"not-ready",ps&&"recording"),disabled:sr,allowDisabledClick:!0,noFastClick:!0,ariaLabel:Si(dr),onClick:ar,onContextMenu:la===qt.Send&&da?ua:void 0,children:[(0,Ge.Y)(et.A,{name:"send"}),(0,Ge.Y)(et.A,{name:"microphone-alt"}),Gn&&(0,Ge.Y)(et.A,{name:"forward"}),Ri&&(0,Ge.Y)(et.A,{name:"schedule"}),Ri&&(0,Ge.Y)(et.A,{name:"check"}),(0,Ge.Y)(lt.A,{className:(0,g.A)("paidStarsBadge",Mr&&"visible",Nr&&!Mr&&"hiding",!Nr&&!Mr&&"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",pn)}),(0,Ge.Y)(Vt.A,{ref:Yi,text:Mi.number(Fo)})]})})]}),Sr&&(0,Ge.Y)("span",{className:"effect-icon",onClick:Cr,children:(0,L.A)(Sr)}),Fn&&xn&&(0,Ge.Y)(Ot.A,{shouldPlay:En,effect:Fn,onStop:wr}),da&&(0,Ge.Y)(yt.A,{isOpen:ca,canSchedule:io&&Ri&&!As,canScheduleUntilOnline:m&&!As,onSendSilent:Ne?void 0:fr,onSendSchedule:h?void 0:gr,onSendWhenOnline:vr,onRemoveEffect:Cr,onClose:ha,onCloseAnimationEnd:ma,isSavedMessages:Ne,chatId:oe,withEffects:Dn,hasCurrentEffect:Boolean(Fn),effectReactions:Tn,allAvailableReactions:gn,onToggleReaction:hr,isCurrentUserPremium:pe,isInSavedMessages:Ne,isInStoryViewer:Oi,canPlayAnimatedEmojis:An}),ro,(0,Ge.Y)(Jt.A,{isOpen:Rn,onClose:To,userName:ce?(0,c.F9)(Mi,ce):void 0,messagePriceInStars:Pn||0,messagesCount:Po,shouldAutoApprove:xo,setAutoApprove:Eo,confirmHandler:Do})]})}))},23459:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(13439),s=n(90709),a=n(91048),r=n(9716),l=n(37836);const d=36e5,c=new Map;let u=new Set;const h=(0,l.nF)(()=>{const e=Array.from(u),t=e.slice(0,100),n=e.slice(100);(0,o.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,i.Kr)(()=>{const t=(0,o.mS)();return e?.map(e=>(0,a.PVB)(t,e)).filter(Boolean)},[e]),n=(0,i.Kr)(()=>{const e=(0,o.mS)();return t?.filter(t=>{const n=c.get(t.id)||0;if(Date.now()-n<d)return!1;if((0,r.L8)(t.id)){const n=t,i=(0,a.K0y)(e,n.id),o=i&&"userStatusEmpty"!==i.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&o}{const n=t,i=(0,a._ls)(e,n.id);return(0,s.WX)(n)&&!i}}).map(e=>e.id)},[t]);(0,i.vJ)(()=>{n?.length&&(n.forEach(e=>u.add(e)),h())},[n])}},23565:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,i.li)(),l=(0,o.A)(),d=null!=e,c=null!=n;return d&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)(()=>{t&&!d&&c&&!r.current&&(r.current=window.setTimeout(()=>{r.current=void 0,l()},t))},[t,l,d,c]),r.current&&t&&!d?n:e}},24807:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(87357),a=n(80140),r=n(22237),l=n(14242),d=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,i.ph)(e=>{let{topic:t,topics:n,chat:y,isPinned:C,isMuted:w,shouldShowOnlyMostImportant:b,wasTopicOpened:I,forceHidden:S,isSavedDialog:M,hasMiniApp:N,isSelected:Y}=e;const{requestMainWebView:k}=(0,o.ko)(),P=(0,m.A)(),F=(0,u.A)(),{unreadMentionsCount:T=0,unreadReactionsCount:D=0}=y.isForum?{}:y,x=!C&&t&&!I,E=y.isForum&&!t,L=(0,i.Kr)(()=>E&&n?Object.values(n).filter(e=>{let{unreadCount:t}=e;return t}):void 0,[n,E]),B=(0,i.Kr)(()=>E?L?.length:(t||y).unreadCount,[y,t,L,E]),R=(0,i.Kr)(()=>{if(!E)return!w||0===t?.notifySettings.mutedUntil;if(w)return L?.some(e=>0===e.notifySettings.mutedUntil);const e=L?.every(e=>e.notifySettings.mutedUntil&&e.notifySettings.mutedUntil>(0,a.Fm)());return!e},[E,w,L,t?.notifySettings.mutedUntil]),O=!t&&y.hasUnreadMark,U=!(0,c.A)(()=>(0,r.Hp)(S)?S():S,[S])&&Boolean(B||T||O||C||D||x||N),z=Boolean((B||O)&&!M),K=(0,s.A)("ChatBadge",!R&&"muted",!z&&C&&"pinned",z&&"unread"),V=(0,h.A)(e=>{e.stopPropagation();const t=(0,d.A)();k({botId:y.id,peerId:y.id,theme:t})});return(0,A.Y)(v.A,{isCustom:!0,className:"ChatBadge-transition",isOpen:U,children:function(){const e=D&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge reaction",!R&&"muted"),children:(0,A.Y)(g.A,{name:"heart"})}),t=T&&(0,A.Y)("div",{className:"ChatBadge mention",children:(0,A.Y)(g.A,{name:"mention"})}),n=x&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge unopened",!R&&"muted")}),i=O||B?(0,A.Y)("div",{className:K,children:!O&&(0,A.Y)(p.A,{text:(0,l.Vw)(F,B)})}):void 0,o=C&&(0,A.Y)("div",{className:K,children:(0,A.Y)(g.A,{name:"pinned-chat"})}),a=N&&(0,A.Y)(f.A,{color:Y?"secondary":"primary",className:"ChatBadge miniapp",pill:!0,size:"tiny",onClick:V,children:P("BotOpen")}),r=!i&&!t&&!e&&o,d=[n,e,t,i,r].filter(Boolean);return M?o:N&&(0===d.length||r)?a:0!==d.length?1===d.length?d[0]:b?[t,i,e,o].filter(Boolean)[0]:(0,A.Y)("div",{className:"ChatBadge-wrapper",children:d}):void 0}()})})},24899:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(31481);function o(e,t){return t?`${i.jsp}${e}`:`@${e}`}},24920:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(30857),s=n(73767);function a(e){const t=(0,o.A)(),n=(0,i.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},25477:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(84051),o=n(13439),s=n(90709),a=n(87357),r=n(17663),l=n(58554),d=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),Y=n(20021);const k=(0,i.ph)((0,o.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(e=>{let{id:t,video:n,isOwn:k,isInWebPage:P,noAvatars:F,canAutoLoad:T,canAutoPlay:D,uploadProgress:x,forcedWidth:E,dimensions:L,asForwarded:B,isDownloading:R,isProtected:O,className:U,lastPlaybackTimestamp:z,clickArg:K,isMediaNsfw:V,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,onClick:$,onCancelUpload:q,needsAgeVerification:H}=e;const{cancelMediaDownload:G,updateContentSettings:W,openAgeVerificationModal:_}=(0,o.ko)(),Q=(0,i.li)(),Z=(0,i.li)(),[X,ee,te]=(0,m.A)(),[ne,ie]=(0,i.J0)(!1),oe="extendedMediaPreview"===n.mediaType,se=oe?void 0:n.blobUrl,ae=oe||n.isSpoiler||V,[re,le,de]=(0,m.A)(ae);(0,i.vJ)(()=>{ae?le():de()},[ae]);const ce=(0,g.A)(()=>{te(),de(),ne&&W({isSensitiveEnabled:!0})}),ue=(0,p.Vz)(Q,j),he=(0,p.Vz)(Q,J)&&ue,me=(0,i.li)(ue);he&&!me.current&&(me.current=!0);const{isMobile:pe}=(0,h.Ay)(),[ge,fe]=(0,i.J0)(T),ve=Boolean(ge&&ue&&!oe),[Ae,ye]=(0,i.J0)(Boolean(D&&!re)),Ce=oe?void 0:(0,s.sC)(n,"inline"),[we]=(0,i.J0)(Boolean(Ce&&l.Ih(Ce))),{mediaData:be,loadProgress:Ie}=(0,A.A)(Ce,!ve,oe?void 0:(0,s.Cz)(n,"inline")),Se=se||be,[Me,Ne]=(0,m.A)(),Ye=(0,s.VD)(n),ke=Boolean(Ye),Pe=Boolean(E),Fe=Se&&me.current,Te=(0,u.A)(Z,!0,!Fe),De=oe?void 0:(0,s.sC)(n,"preview"),[xe]=(0,i.J0)(Boolean(De&&l.Ih(De))),Ee=ue,Le=(0,f.A)(De,!Ee),Be=Me&&!Te,{ref:Re}=(0,v.A)({hasMediaData:Boolean((ke||Le)&&!Be)}),Oe=Boolean(!ke||Le||Me),Ue=(0,w.A)(n,Oe);(0,v.A)({ref:Ue,hasMediaData:!Oe});const ze=(0,w.A)(n,!Pe),{loadProgress:Ke}=(0,A.A)(oe?void 0:(0,s.sC)(n,"download"),!R,oe?void 0:(0,s.Cz)(n,"download")),{isUploading:Ve,isTransferring:je,transferProgress:Je}=(0,s.LK)(x||(R?Ke:Ie),ve&&!Me&&!we||R,void 0!==x),$e=!1===(0,y.A)(ge),{ref:qe,shouldRender:He}=(0,C.A)({isOpen:je&&!Te,noMountTransition:$e,withShouldRender:!0}),{ref:Ge}=(0,C.A)({isOpen:Boolean((ge||Se)&&!Ae&&!He)}),[We,_e]=(0,i.J0)(0),Qe=(0,g.A)(e=>{_e(Math.max(0,e.currentTarget.currentTime-1))}),Ze=(Number.isFinite(Z.current?.duration)&&!Te?Z.current?.duration:n.duration)||0,{width:Xe,height:et}=L||(oe?(0,d.ri)(n,Boolean(k),B,P,F,pe):(0,d.rO)(n,Boolean(k),B,P,F,pe)),tt=(0,g.A)((e,t)=>{if(Ve)q?.(K);else if(oe||!R){if(Se)return Se&&!Ae&&ye(!0),re?V?H?void _():void ee():void de():t&&ve&&!Me&&!we?(fe(!1),void e.stopPropagation()):void $?.(K,e);fe(e=>!e)}else G({media:n})}),nt=(0,g.A)(e=>{tt(e,!0)}),it=(0,a.A)("media-inner dark",!Ve&&"interactive",et<c.ej&&"fix-min-height",U),ot=`height: ${et}px;${L?` width: ${Xe}px; left: ${L.x}px; top: ${L.y}px;`:""}`;return(0,Y.FD)("div",{ref:Q,id:t,className:it,style:ot,onClick:Ve?void 0:e=>tt(e),children:[Pe&&(0,Y.Y)("canvas",{ref:ze,className:"thumbnail blurred-bg"}),Fe&&(0,Y.Y)(M.A,{ref:Z,src:Se,className:(0,a.A)("full-media",Pe&&"with-blurred-bg"),canPlay:Ae&&he&&!Te,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!O,onTimeUpdate:Qe,onReady:Ne,style:E?`width: ${E}px`:void 0}),(0,Y.Y)("img",{ref:Re,src:Le,className:(0,a.A)("thumbnail",Pe&&"with-blurred-bg"),alt:"",style:E?`width: ${E}px;`:void 0,draggable:!O}),ke&&!xe&&(0,Y.Y)("canvas",{ref:Ue,className:"thumbnail"}),O&&(0,Y.Y)("span",{className:"protector"}),(0,Y.Y)(b.A,{ref:Ge,name:"large-play"}),(0,Y.Y)(I.A,{isVisible:re,withAnimation:!0,thumbDataUri:Ye,isNsfw:V,width:Xe,height:et,className:"media-spoiler"}),He&&(0,Y.Y)("div",{ref:qe,className:"media-loading",children:(0,Y.Y)(N.A,{progress:Je,onClick:nt})}),!ge&&!Se&&(0,Y.Y)(b.A,{name:"download"}),!je||Te&&!R?(0,Y.FD)("div",{className:"message-media-duration",children:[!oe&&n.isGif?"GIF":(0,r.QO)(Math.max(Ze-We,0)),Te&&(0,Y.Y)(b.A,{name:"message-failed",className:"playback-failed"})]}):(0,Y.Y)("span",{className:"message-transfer-progress",children:Ve||R?`${Math.round(100*Je)}%`:"..."}),Boolean(z)&&(0,Y.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(z/Ze*100)}%`}),(0,Y.Y)(S.A,{isOpen:X,onClose:te,shouldAlwaysShow:ne,onAlwaysShowChanged:ie,confirmHandler:ce})]})}))},25498:(e,t,n)=>{n.d(t,{A:()=>T});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(91048),l=n(52491),d=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,Y=300,k=(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 i=Object.values(e),o=(0,c.dU)(i,"native"),s=t?(0,c.LG)(t,e=>Object.values((0,c._E)(o,e))):{},a=n?(0,c.LG)(n,e=>Object.values((0,c._E)(o,e))):{},r={...s,...a},l=[].concat(Object.keys(s),Object.keys(a)),d=i.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{}),u=Object.keys(d),h=l.reduce((e,t)=>Math.max(e,t.length),0);return{byKeyword:r,keywords:l,byName:d,names:u,maxKeyLength:h}}),F=(0,h.A)(function(e,t,n){const{byKeyword:i,keywords:o,byName:s,names:a,maxKeyLength:r}=e;let l=[];if(t.length>r)return u.p;const d=o.filter(e=>e.startsWith(t)).sort();l=l.concat(Object.values((0,c._E)(i,d)).flat());const h=a.filter(e=>e.startsWith(t));return l=l.concat(Object.values((0,c._E)(s,h)).flat()),l=(0,c.Am)(l),l.length?l.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){let T=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.CfG,D=arguments.length>4?arguments[4]:void 0,x=arguments.length>5?arguments[5]:void 0,E=arguments.length>6?arguments[6]:void 0;const[L,B,R]=(0,A.A)(!1),[O,U]=(0,i.J0)(),[z,K]=(0,i.J0)(u.p),[V,j]=(0,i.J0)(u.p);(0,i.vJ)(()=>{function t(){U(b.emojis)}e&&(b?t():async function(){return C||(C=n.e(996).then(n.t.bind(n,20996,19)),w=(await C).default,b=(0,l.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],Y),$=(0,v.A)(J,[J,t],!0),q=(0,y.A)(e=>{if(K(e),e===u.p)return void j(u.p);const t=e.map(e=>e.native),n=(0,c.Xd)((0,r.oZ0)((0,o.mS)(),t),"id");j(n)}),H=(0,y.A)(function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=t();if(!i)return;const o=i.lastIndexOf(":",n?i.lastIndexOf(":")-1:void 0);if(-1!==o){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${i.substring(0,o)}${t}`);const n=T===s.CfG?document.querySelector(s.m$5):document.getElementById(T);(0,a.Uz)(()=>{(0,d.A)(n,!0,!0)})}q(u.p)});return(0,i.vJ)(()=>{const e=$();if(!e||!O)return void q(u.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let i=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=N){const e=P(O,x,E);i=F(e,n.toLowerCase(),M)}}else i=k(O,D,M);i.length?t?H(i[0].native,!0):q(i):q(u.p)},[x,O,$,E,H,D,q]),(0,i.vJ)(R,[R,t]),{isEmojiTooltipOpen:Boolean(z.length||V.length)&&!L,closeEmojiTooltip:B,filteredEmojis:z,filteredCustomEmojis:V,insertEmoji:H}}},25897:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},26440:(e,t,n)=>{n.d(t,{A:()=>v});var i=n(84051),o=n(13439),s=n(31481),a=n(87357),r=n(37661),l=n(17712),d=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,i.ph)(e=>{let{chatId:t,threadId:n,isMobile:m,canSendGifs:p,canSendStickers:v,isMessageComposer:A,isReady:y,isSymbolMenuOpen:C,idPrefix:w,isAttachmentModal:b,canSendPlainText:I,isSymbolMenuForced:S,className:M,forceDarkTheme:N,inputCssSelector:Y=s.m$5,openSymbolMenu:k,closeSymbolMenu:P,onCustomEmojiSelect:F,onStickerSelect:T,onGifSelect:D,onRemoveSymbol:x,onEmojiSelect:E,closeBotCommandMenu:L,closeSendAsMenu:B}=e;const{setStickerSearchQuery:R,setGifSearchQuery:O,addRecentEmoji:U,addRecentCustomEmoji:z}=(0,o.ko)(),K=(0,i.li)(),[V,j]=(0,r.A)(),[J,$]=(0,i.J0)(void 0),q=(0,a.A)("composer-action-button mobile-symbol-menu-button",!y&&"not-ready",V?C&&"menu-opened":C&&"is-loading"),H=(0,l.A)(()=>{L?.(),B?.(),k();const e=K.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();$({x:t,y:n})}),G=(0,l.A)(e=>{"stickers"===e?(R({query:""}),O({query:void 0})):(O({query:""}),R({query:void 0}))}),W=(0,l.A)(()=>{const e=document.querySelector(b?s.wVm:Y);m&&e===document.activeElement?(e?.blur(),setTimeout(()=>{L?.(),k()},100)):k()}),_=(0,l.A)(()=>K.current),Q=(0,l.A)(()=>K.current?.closest(".custom-scroll, .no-scrollbar")),Z=(0,l.A)(()=>document.querySelector("#portals .SymbolMenu .bubble")),X=(0,l.A)(()=>({withPortal:!0}));return(0,g.FD)(g.FK,{children:[m?(0,g.FD)(c.A,{className:q,round:!0,color:"translucent",onClick:C?P:W,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(d.A,{name:"smile"}),(0,g.Y)(d.A,{name:"keyboard"}),C&&!V&&(0,g.Y)(h.A,{color:"gray"})]}):(0,g.FD)(u.A,{className:(0,a.A)("composer-action-button symbol-menu-button",C&&"activated"),round:!0,color:"translucent",onActivate:H,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:K,className:"symbol-menu-trigger"}),(0,g.Y)(d.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:t,threadId:n,isOpen:C||Boolean(S),canSendGifs:p,canSendStickers:v,isMessageComposer:A,idPrefix:w,onLoad:j,onClose:P,onEmojiSelect:E,onStickerSelect:T,onCustomEmojiSelect:F,onGifSelect:D,onRemoveSymbol:x,onSearchOpen:G,addRecentEmoji:U,addRecentCustomEmoji:z,isAttachmentModal:b,canSendPlainText:I,className:(0,a.A)(M,N&&"component-theme-dark"),anchor:b?J:void 0,getTriggerElement:b?_:void 0,getRootElement:b?Q:void 0,getMenuElement:b?Z:void 0,getLayout:b?X:void 0})]})})},31880:(e,t,n)=>{n.d(t,{A:()=>m,a:()=>d});var i=n(13439),o=n(91048),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function d(e,t,n){let a=[],d=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],d=Object.keys(i).filter(e=>Boolean(i[e]))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,l);a=t||[],d=Object.keys(i).filter(e=>Boolean(i[e]))}const c=(0,i.mS)();return{selectedChatIds:a.filter(e=>(0,o.hds)(c,e)),selectedChatTypes:d}}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,l)};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,l),...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 i=n(31481),o=n(66644),s=n(19822),a=n(83868),r=n(76023),l=n(2429),d=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:l}=A(e);if(!(n&&l&&r&&t&&a))return;const{bottom:p,right:f}=a.getBoundingClientRect(),v=p+u,S=l[0],M=l[l.length-1],N=C(S);Array.from(r).reverse().forEach((e,a,r)=>{let{length:l}=r;const u=C(e);if(!u)return;const p=u===N;let A=w(n,u),I=h+a+1;if(A||(A=a===l-1?M:S,I=h),!A)return;let{top:Y,left:k,width:P}=A.getBoundingClientRect();const{left:F,width:T}=e.getBoundingClientRect();if(F>f)return;k-=m,P+=2*m;const D=k-F,x=Y-v,E=P/T;Y-=m;const L=F-k+2*m,B=v-Y+m,R=T/(P+2*m);(0,o.RK)(()=>{if(!A)return;const n=y(e);let a;I>h?(a=y(A),p&&a.classList.add(d.A.ghostLast)):n.classList.add(d.A.ghostAnimateName),(0,s.ZM)(n,{top:`${v}px`,left:`${F}px`,zIndex:String(I),opacity:a?"0":"",transform:`translate3d(${D}px, ${x}px, 0) scale(${E})`}),a&&(0,s.ZM)(a,{top:`${Y}px`,left:`${k}px`,zIndex:String(I)}),t.appendChild(n),a&&t.appendChild(a),A.classList.add("animating"),e.classList.add("animating"),(0,o.RK)(()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${L}px, ${B}px, 0) scale(${R})`}):n.classList.add(d.A.ghostRevealName);const r=b(()=>{(0,o.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),A?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)})},c+i.xB5);g.add(r)})})})}function v(e){I();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:l}=A(e);if(!(n&&a&&r&&t&&l))return;const{right:u}=l.getBoundingClientRect(),f=a[0],v=a[a.length-1],S=C(f);Array.from(r).reverse().forEach((e,a,r)=>{let{length:l}=r;const A=C(e);if(!A)return;const I=A===S;let M=w(n,A),N=h+a+1;if(M||(M=a===l-1?v:f,N=h),!M)return;const{top:Y,left:k,width:P}=e.getBoundingClientRect();let{left:F,width:T,top:D}=M.getBoundingClientRect();if(k>u)return;F-=m,T+=2*m;const x=F-k,E=D-Y-p,L=T/P;D-=m;const B=k-F+2*m,R=Y-D+m,O=P/(T+2*m);(0,o.RK)(()=>{const n=y(e);let a;N>h?(a=y(M),I&&a.classList.add(d.A.ghostLast)):n.classList.add(d.A.ghostAnimateName,d.A.ghostRevealName),(0,s.ZM)(n,{top:`${Y}px`,left:`${k}px`,width:`${P}px`,zIndex:String(N)}),a&&(0,s.ZM)(a,{top:`${D}px`,left:`${F}px`,zIndex:String(N),opacity:"0",transform:`translate3d(${B}px, ${R}px, 0) scale(${O})`}),e.classList.add("animating"),M.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,o.RK)(()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${x}px, ${E}px, 0) scale(${L})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(d.A.ghostRevealName);const r=b(()=>{(0,o.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),M.classList.remove("animating")}),g.delete(r)},c+i.xB5);g.add(r)})})})}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),i=t.querySelector("#StoryRibbon"),o=t.querySelector(".left-header"),s=i?.querySelectorAll(`.${l.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:o,ribbonPeers:s,toggleAvatars:a}}function y(e){const t=e.cloneNode(!0);t.classList.add(d.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=a.A;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function C(e){return e?.getAttribute("data-peer-id")}function w(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function b(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function I(){g.forEach(e=>e()),g.clear()}},35127:(e,t,n)=>{n.d(t,{MC:()=>a,ej:()=>l,nP:()=>d,yA:()=>c});var i=n(76023);const o=12,s=40,a=20*i.$,r=o*i.$,l=5*i.$;function d(e,t){return(e?.length??0)>s||t?a:r}function c(e){let{media:t,messageText:n,isOwn:s,isInWebPage:a,asForwarded:r,noAvatars:c,isMobile:u}=e;const h="photo"===t.mediaType,m="video"===t.mediaType,p=h&&a,g=m&&a,{width:f,height:v}=h?(0,i.ck)(t,s,r,p,c,u):m?(0,i.rO)(t,s,r,g,c,u):(0,i.ri)(t,s,r,a,c,u),A=d(n);let y=1;f<A&&A-f<o&&(y=A/f),v*y<l&&l-v*y<o&&(y=l/v);const C=Math.round(f*y),w=Math.round(v*y);return{width:C,height:w,isSmall:C<A||w<l}}},35749:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(77312),o=n(63527);function s(e){return e.messages.webPageById}function a(e,t){const n=(0,o.A)(s);if(!e)return;const a=e.content.webPage?.id,r=a?n[a]:void 0;return(0,i.EO)(e,{webPage:r},t)}},36353:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(96454);function o(e,t,n){if(!t&&e===document.activeElement)return;const o=window.getSelection(),s=document.createRange(),a=e.lastChild||e;i.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),o.removeAllRanges(),o.addRange(s)):e.focus()}},36680:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(84051),o=n(96454),s=n(17712);const a=250;let r;function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const d=(0,i.li)(!1),c=(0,s.A)(()=>{d.current=!0});return(0,i.vJ)(()=>{r&&(clearTimeout(r),r=void 0),!e||o.TF||l||(r=window.setTimeout(()=>{d.current||t()},2*n))},[l,e,n,t]),[(0,s.A)(()=>{d.current=!0}),(0,s.A)(()=>{d.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout(()=>{d.current||t()},n)}),c]}},37378:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(90709),a=n(91048),r=n(87357),l=n(17663),d=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,i.ph)((0,o.EK)((e,t)=>{let{message:n}=t;return{webPage:(0,a.Pn$)(e,n)}})(e=>{let{message:t,webPage:n,senderTitle:i,isProtected:o,observeIntersection:a,onMessageClick:y}=e;const C=(0,h.A)(),w=(0,p.A)();let b=n;if(!b){const e=(0,s.ZD)(t);if(e){const{url:n,domain:i}=e;b={siteName:i.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.BN)(C,t)?.text!==n?(0,c.C)(C,t,void 0,void 0,170):void 0}}}const I=(0,m.A)(()=>{y(t)});if("full"!==b?.webpageType)return;const{siteName:S,url:M,displayUrl:N,title:Y,description:k,formattedDescription:P,photo:F,video:T}=b,D=!i&&k&&(0,d.A)(k,170),x=(0,r.A)("WebLink scroll-item",!F&&!T&&"without-media"),E=M.replace("mailto:","")||N;return(0,A.FD)("div",{className:x,"data-initial":(S||N)[0],dir:C.isRtl?"rtl":void 0,children:[F&&(0,A.Y)(f.A,{message:t,isProtected:o,observeIntersection:a}),(0,A.FD)("div",{className:"content",children:[(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-title",onClick:I,children:(0,u.A)(Y||S||N)}),(D||P)&&(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-description",onClick:I,children:P||D&&(0,u.A)(D)}),(0,A.Y)(v.A,{url:M,className:"site-name",text:E,isRtl:C.isRtl}),i&&(0,A.Y)("div",{className:"sender-name",children:(0,u.A)(i)})]}),i&&(0,A.Y)("div",{className:"message-date",children:(0,A.Y)(g.A,{className:"date",onClick:I,isRtl:C.isRtl,children:(0,l.be)(w,1e3*t.date)})})]})}))},37830:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(87894);const o=new WeakMap;function s(e){return function(){const t=o.get(e);for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];if(t&&(0,i.k)(t.lastArgs,s))return t.lastResult;const r=e(...s);return o.set(e,{lastArgs:s,lastResult:r}),r}}},38102:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(87412),s=n(76471),a=n(20021);const r=(0,i.ph)(e=>{let{topic:t,className:n,letterClassName:i,size:r,noLoopLimit:l,observeIntersection:d,onClick:c}=e;return t.iconEmojiId&&"0"!==t.iconEmojiId?(0,a.Y)(o.A,{documentId:t.iconEmojiId,className:n,size:r,observeIntersectionForPlaying:d,loopLimit:l?void 0:2,onClick:c}):(0,a.Y)(s.A,{iconColor:t.iconColor,title:t.title,topicId:t.id,className:n,letterClassName:i,onClick:c})})},38218:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(17712);const s=250,a=function(e){let{onClick:t,onStart:n,onEnd:a,threshold:r=s}=e;const l=(0,i.li)(!1),d=(0,i.li)(!1),c=(0,i.li)(void 0),u=(0,o.A)(e=>{const t="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!d.current&&t&&(d.current=!0,c.current=window.setTimeout(()=>{n?.(),l.current=!0},r))}),h=(0,o.A)(e=>{d.current&&(l.current?a?.():t?.(e),m())}),m=(0,o.A)(()=>{l.current=!1,d.current=!1,window.clearTimeout(c.current)});return(0,i._W)(()=>{window.clearTimeout(c.current)}),{onMouseDown:u,onMouseUp:h,onMouseLeave:h,onTouchStart:u,onTouchEnd:h}}},39074:(e,t,n)=>{n.d(t,{DY:()=>l,JC:()=>a,LV:()=>s,oR:()=>o,vZ:()=>r});const i=document.createElement("div");function o(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const i=n.createContextualFragment(e),o=i.lastChild;n.insertNode(i),o?(n.setStartAfter(o),n.setEndAfter(o)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const o=n.getRangeAt(0).cloneRange();return o.intersectsNode(e)?t||e.contains(o.commonAncestorContainer)?(o.collapse(!0),o.setStart(e,0),i.innerHTML="",i.appendChild(o.cloneContents()),i.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const i=n.getRangeAt(0),o=i.cloneRange();return o.selectNodeContents(e),o.setEnd(i.endContainer,i.endOffset),t=o.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),i=window.getSelection();return e.setStart(n,t),e.collapse(!0),i.removeAllRanges(),i.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function l(){const e=window.getSelection();e?.removeAllRanges()}},40175:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(84051),o=n(13439),s=n(31481),a=n(91048),r=n(34458),l=n(59030),d=n(34201),c=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,i.ph)((0,o.EK)((e,t)=>{let{isArchived:n}=t;const{orderedPeerIds:{archived:i,active:o},byPeerId:s}=e.stories,{storyViewer:{isRibbonShown:r,isArchivedRibbonShown:l}}=(0,a.nTw)(e),d=(0,a.clw)(e),c=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:n?i:o,isShown:n?!l:!r,isForumPanelOpen:d,withAnimation:c,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:s}})(function(e){let{currentUserId:t,orderedPeerIds:n,usersById:a,chatsById:p,canShow:g,isShown:f,isForumPanelOpen:v,isArchived:A,withAnimation:y,peerStories:C}=e;const{toggleStoryRibbon:w}=(0,o.ko)(),b=(0,l.A)(),I=(0,i.Kr)(()=>1===n.length?[a[n[0]]||p[n[0]]]:n.map(e=>a[e]||p[e]).filter(e=>e&&e.id!==t).slice(0,s.dqH).reverse(),[t,n,a,p]),S=(0,i.Kr)(()=>I?.length?I.reduce((e,t)=>{const n=C[t.id];if(!n)return e;const i=n.orderedIds.some(e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const i=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!i});return e[t.id]=i,e},{}):{},[C,I]),M=(0,i.Kr)(()=>n.slice(0,5),[n]);(0,c.A)(M);const N=g&&f,{ref:Y,shouldRender:k}=(0,d.A)({isOpen:N,className:"slow",withShouldRender:!0});if((0,i.vJ)(()=>{y&&!v&&(N?((0,i.VK)(r.UG+s.xB5),(0,r.$)(A)):((0,i.VK)(r.UG+s.xB5),(0,r.wV)(A)))},[A,N,y,v]),k)return(0,m.Y)("button",{ref:Y,type:"button",id:"StoryToggler",className:h.A.root,"aria-label":b("Chat.Context.Peer.OpenStory"),onClick:()=>w({isShown:!0,isArchived:A}),dir:b.isRtl?"rtl":void 0,children:I.map(e=>(0,m.Y)(u.A,{peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:S[e.id]},e.id))})}))},40435:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(41074);const o={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(o[a||"light"][t?"outgoing":"incoming"]):(0,i.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%i.bP)}},41074:(e,t,n)=>{n.d(t,{Ay:()=>r,M1:()=>l,bP:()=>s});var i=n(31481),o=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return i.W75?[]:(a||(a=new Array(s).fill(void 0).map(()=>{const e=new Worker(new URL(n.p+n.u(9443),n.b));return{worker:e,connector:(0,o.U)(e,void 0,"media")}})),a)}function l(e,t){return r()[t].connector.request(e)}},41118:(e,t,n)=>{n.d(t,{A:()=>W});var i=n(84051),o=n(13439),s=n(89925),a=n(31481),r=n(96454),l=n(87357),d=n(49763),c=n(80140),u=n(23459),h=n(66644),m=n(63495),p=n(9718),g=n(16581),f=n(17712),v=n(20021),A=n(74984),y=n(2178),C=n(96374),w=n(5912),b=n(9717),I=n(46222),S=n(52745),M=n(90709),N=n(87894),Y=n(14242),k=n(4961),P=n(39351),F=n(21849),T=n(18276),D=n(24713),x=n(22720);const E={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"},L={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},B=(0,i.ph)(e=>{let{archiveSettings:t,onDragEnter:n,onClick:s}=e;const{updateArchiveSettings:r}=(0,o.ko)(),d=(0,P.A)(),c=(0,A.Rh)(a._E9),u=(0,A.ic)(),h=u[a._E9]?.chatsCount,m=(0,i.Kr)(()=>{if(!c?.length)return d("Loading");const e=(0,o.mS)().chats.byId;return c.slice(0,5).map((t,n,i)=>{const o=n===i.length-1,s=e[t];if(!s)return;const a=(0,M.Js)(d,s);return(0,v.FD)(v.FK,{children:[(0,v.Y)("span",{className:(0,l.A)(E.chat,h&&s.unreadCount&&E.unread),children:(0,k.A)(a)}),o?"":", "]})})},[c,d,h]),p=(0,i.Kr)(()=>{const e=!t.isMinimized&&{title:d("ContextArchiveCollapse"),icon:"collapse",handler:()=>{r({isMinimized:!0})}},n=t.isMinimized&&{title:d("ContextArchiveExpand"),icon:"expand",handler:()=>{r({isMinimized:!1})}},i={title:d("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{r({isHidden:!0})}};return(0,N.oE)([e,n,i])},[t.isMinimized,d,r]),g=(0,i.hb)(e=>{e.preventDefault(),n?.()},[n]);return(0,v.Y)(x.A,{onClick:s,onDragEnter:g,className:(0,l.A)(E.root,t.isMinimized&&E.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:E.button,contextActions:p,withPortalForMenu:!0,children:t.isMinimized?(0,v.Y)("div",{className:(0,l.A)(E.info,"info"),children:(0,v.FD)("div",{className:"info-row",children:[(0,v.Y)("div",{className:(0,l.A)("title",E.title),children:(0,v.FD)("h3",{dir:"auto",className:(0,l.A)(E.name,"fullName"),children:[(0,v.Y)(T.A,{name:"archive-filled",className:E.icon}),d("ArchivedChats")]})}),(0,v.Y)(D.A,{className:E.unreadCount,text:h?(0,Y.Vw)(d,h):void 0})]})}):(0,v.FD)(v.FK,{children:[(0,v.Y)("div",{className:(0,l.A)("status",E.avatarWrapper),children:(0,v.Y)(F.A,{peer:L})}),(0,v.FD)("div",{className:(0,l.A)(E.info,"info"),children:[(0,v.Y)("div",{className:"info-row",children:(0,v.Y)("div",{className:(0,l.A)("title",E.title),children:(0,v.Y)("h3",{dir:"auto",className:(0,l.A)(E.name,"fullName"),children:d("ArchivedChats")})})}),(0,v.FD)("div",{className:"subtitle",children:[(0,v.Y)("div",{className:(0,l.A)("status",E.chatsPreview),children:m}),(0,v.Y)(D.A,{className:E.unreadCount,text:h?(0,Y.Vw)(d,h):void 0})]})]})]})})});var R=n(19210),O=n(91048),U=n(43874),z=n(59030),K=n(79577),V=n(64493);const j=(0,i.ph)((0,o.EK)((e,t)=>{let{folderId:n,folderType:i}=t;return{chatFolder:n&&"folder"===i?(0,O.$aQ)(e,n):void 0,animatedEmoji:(0,O.oei)(e,"📂")}})(e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:a}=e;const{openSettingsScreen:r}=(0,o.ko)(),l=(0,z.A)(),{isMobile:d}=(0,U.Ay)(),c=(0,i.hb)(()=>{a({type:"editFolder",payload:t}),r({screen:s.VS.FoldersEditFolderFromChatList})},[t,a]);return(0,v.FD)("div",{className:"yftKUVDQ",children:[(0,v.Y)("div",{className:"UCBfMOiz",children:n&&(0,v.Y)(K.A,{sticker:n,size:96})}),(0,v.Y)("h3",{className:"dB9cHelg",dir:"auto",children:l("FilterNoChatsToDisplay")}),(0,v.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:l(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),t&&(0,v.FD)(V.A,{ripple:!d,fluid:!0,pill:!0,onClick:c,isRtl:l.isRtl,children:[(0,v.Y)(T.A,{name:"settings"}),(0,v.Y)("div",{className:"aL7e0w4t",children:l("ChatList.EmptyChatListEditFilter")})]})]})})),J=(0,i.ph)(e=>{let{onClick:t}=e;const n=(0,P.A)();return(0,v.FD)("div",{className:"fOmerTkM",onClick:t,children:[(0,v.Y)("div",{className:"URLYINJA",children:n("TitleFrozenAccount")}),(0,v.Y)("div",{className:"mCFsx7Tv",children:n("SubtitleFrozenAccount")})]})});var $=n(93545);const q="pedMJD_v",H=(0,i.ph)(e=>{let{sessions:t,onHeightChange:n}=e;const{changeSessionSettings:s,terminateAuthorization:a,showNotification:r}=(0,o.ko)(),l=(0,i.li)(),d=(0,z.A)();(0,$.A)(l,e=>{const t=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;n(t)});const c=(0,i.Kr)(()=>Object.values(t).sort((e,t)=>t.dateCreated-e.dateCreated).find(e=>e.isUnconfirmed),[t]),u=(0,i.Kr)(()=>[c.deviceModel,c.region,c.country].filter(Boolean).join(", "),[c]),h=(0,f.A)(()=>{s({hash:c.hash,isConfirmed:!0})}),m=(0,f.A)(()=>{a({hash:c.hash}),r({title:d("UnconfirmedAuthDeniedTitle",1),message:d("UnconfirmedAuthDeniedMessageSingle",u)})});return(0,v.FD)("div",{className:"yEkGgZVL",ref:l,children:[(0,v.Y)("h2",{className:"VhAJDrnz",children:d("UnconfirmedAuthTitle")}),(0,v.Y)("p",{className:"WmyL1NJ8",children:d("UnconfirmedAuthSingle",u)}),(0,v.FD)("div",{className:"_40UGD1Y",children:[(0,v.Y)(V.A,{fluid:!0,isText:!0,className:q,onClick:h,children:d("UnconfirmedAuthConfirm")}),(0,v.Y)(V.A,{fluid:!0,isText:!0,color:"danger",onClick:m,className:q,children:d("UnconfirmedAuthDeny")})]})]})}),G=new Set(["9","0"]),W=(0,i.ph)(e=>{let{className:t,folderType:n,folderId:M,isActive:N,isForumPanelOpen:Y,canDisplayArchive:k,archiveSettings:P,sessions:F,isAccountFrozen:T,isMainList:D,foldersDispatch:x,withTags:E}=e;const{openChat:L,openNextChat:O,closeForumPanel:U,toggleStoryRibbon:z,openFrozenAccountModal:K,openLeftColumnContent:V}=(0,o.ko)(),$=(0,i.li)(),q=(0,i.li)(!1),[W,_]=(0,i.J0)(0),Q="archived"===n,Z="all"===n,X="saved"===n,ee=Z?a.DSF:Q?a._E9:X?a.pX9:M,te=Z&&k&&P,ne=T&&Z,ie=(0,A.Rh)(ee);(0,u.A)(ie);const oe=(ie?.length||0)*a.yq1,se=te?P?.isMinimized?a.eqO:a.yq1:0,ae=ne?68:0,{orderDiffById:re,getAnimationType:le}=(0,b.A)(ie),[de,ce]=(0,C.A)(void 0,ie,void 0,a.T7t),ue=(0,i.Kr)(()=>{const e=Object.values(F||{}),t=e.find(e=>e.isCurrent);return!(!t||(0,c.Fm)()-t.dateCreated<a.C7Y)&&!T&&Z&&e.some(e=>e.isUnconfirmed)},[Z,F,T]);(0,i.vJ)(()=>{ue||_(0)},[ue]),(0,y.v)((0,i.Kr)(()=>N&&ie?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),O({targetIndexDelta:-1,orderedIds:ie})},"Alt+ArrowDown":e=>{e.preventDefault(),O({targetIndexDelta:1,orderedIds:ie})}}:void 0,[N,ie])),(0,i.vJ)(()=>{if(N&&!X&&ie&&r.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((r.MP&&e.metaKey||!r.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||G.has(t))return;const n=te&&P&&!P.isMinimized,i=n?-1:0,o=Number(t)+i-1;if(n&&-1===o)return void(D&&V({contentKey:s.Bn.Archived}));if(o>ie.length-1)return;L({id:ie[o],shouldReplaceHistory:!0})}}},[P,X,N,L,O,ie,te,D]);const{observe:he}=(0,w.BL)({rootRef:$,throttleMs:200}),me=(0,f.A)(()=>{V({contentKey:s.Bn.Archived}),U()}),pe=(0,f.A)(()=>{K()}),ge=(0,f.A)(()=>{q.current?q.current=!1:me()}),fe=(0,g.A)(e=>{q.current?q.current=!1:L({id:e,shouldReplaceHistory:!0})},[L],500,!0),ve=(0,f.A)(e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,i=e.clientY-t.top;n<t.width||i<t.y||(q.current=!0)}),Ae=function(e,t,n,o){const s=(0,i.li)(),a=(0,i.li)(!1),l=(0,i.li)(0),d=(0,i.li)(!1),c=(0,i.li)(!0),u=(0,i.li)(0),A=(0,i.li)(!1),y=(0,f.A)(function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d.current||s.current&&e.current&&(s.current.style.display="block",e.current.scrollTop=1,r.Yw||t||m.Vq||(0,p.E)(e.current),a.current=!0,l.current=1,d.current=!0,c.current=!0)}),C=(0,f.A)(()=>{d.current&&s.current&&(s.current.style.display="none",d.current=!1)}),w=(0,f.A)(()=>{if(!e.current)return;if(a.current)return void(a.current=!1);const i=e.current.scrollTop,o=i>l.current,r=i<l.current,m=0===i,p=Date.now()-u.current;if(s.current){if(m&&!d.current)return void(0,h.dL)(y,[e.current,s.current]);(0,h.dL)(C,s.current)}r&&(c.current&&p>100||i<0&&A.current)?t?.():o&&i>0&&n?.(),l.current=i,c.current=m,u.current=Date.now(),A.current=o&&i<0}),b=(0,g.A)(i=>{if(!e.current)return;const o=e.current;o.scrollHeight>o.offsetHeight||0===i.deltaY||(i.deltaY<0?t?.():n?.())},[e,t,n],250);return(0,i.vJ)(()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,h.RK)(()=>{y(!0)}),t.addEventListener("scroll",w,{passive:!0}),t.addEventListener("wheel",b,{passive:!0}),()=>{t.removeEventListener("scroll",w),t.removeEventListener("wheel",b)}},[e,b]),r.pz||o?void 0:(0,v.Y)("div",{ref:s,className:"overscroll-trigger"},"overscroll-trigger")}($,(0,f.A)(()=>{z({isShown:!0,isArchived:Q})}),(0,f.A)(()=>{z({isShown:!1,isArchived:Q})}),X);return(0,v.FD)(I.A,{className:(0,l.A)("chat-list custom-scroll",Y&&"forum-panel-open",t),ref:$,items:de,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,beforeChildren:Ae,maxHeight:oe+se+ae+W,onLoadMore:ce,onDragLeave:ve,children:[ue&&(0,v.Y)(H,{sessions:F,onHeightChange:_},"unconfirmed"),ne&&(0,v.Y)(J,{onClick:pe},"frozen"),te&&(0,v.Y)(B,{archiveSettings:P,onClick:me,onDragEnter:ge},"archive"),de?.length?function(){const e=ie.indexOf(de[0]),t=(0,d.zm)(ee)||0;return de.map((n,i)=>{const o=e+i<t,s=W+se+ae+(e+i)*a.yq1;return(0,v.Y)(R.A,{teactOrderKey:o?i:(0,d.uk)(n,X),chatId:n,isPinned:o,folderId:M,isSavedDialog:X,animationType:le(n),orderDiff:re[n],offsetTop:s,observeIntersection:he,onDragEnter:fe,withTags:E},n)})}():!de||de.length||X?(0,v.Y)(S.A,{},"loading"):(0,v.Y)(j,{folderId:M,folderType:n,foldersDispatch:x})]})})},41316:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(84051);function o(e){const[t,n]=(0,i.Ul)();return(0,i.vJ)(()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const i=t.getRangeAt(0);if(!i)return;if(!document.querySelector(e))return;const{commonAncestorContainer:o}=i;(o instanceof Element?o:o.parentElement).closest(e)&&n(i)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,n]),t}},41510:(e,t,n)=>{n.d(t,{I:()=>y,A:()=>C});var i=n(84051),o=n(13439),s=n(90709),a=n(87357),r=n(11778),l=n(55153),d=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,i.ph)(e=>{let{isQuick:t,isGeneric:n,onFileSelect:o}=e;const s=(0,i.li)(),r=(0,c.A)(),[l,d,h]=(0,g.A)(),m=(0,u.A)(e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),h()}),p=(0,a.A)("DropTarget",l&&"hovered");return(0,v.FD)("div",{className:p,ref:s,onDrop:o,onDragEnter:d,onDragLeave:m,"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:t?"photo":"document"}),(0,v.Y)("div",{className:"title",children:r("FileDropZoneTitle")}),!n&&(0,v.Y)("div",{className:"description",children:r(t?"FileDropZoneQuick":"FileDropZoneNoCompression")})]})]})});let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const C=(0,i.ph)(e=>{let{isOpen:t,withQuick:n,editingMessage:g,onHide:f,onFileSelect:y}=e;const C=(0,c.A)(),{showNotification:w,updateAttachmentSettings:b}=(0,o.ko)(),I=(0,i.li)(),S=(0,h.A)(n),{shouldRender:M,transitionClassNames:N}=(0,m.A)(t);(0,i.vJ)(()=>t?(0,r.A)(f):void 0,[t,f]);const Y=(0,u.A)(async e=>{const{dataTransfer:t}=e;let i=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,d.A)(t.items);e?.length&&(i=i.concat(e))}}else i=i.concat(Array.from(t.files));if(g){if(i.length>1)return void w({message:C("MediaReplaceInvalidError",void 0,{pluralValue:i.length})});if(1===i.length){const e=await(0,l.A)(i[0].name,i[0]);if(!(g&&e&&(0,s.eh)(g,e)))return void w({message:C("MediaReplaceInvalidError",void 0,{pluralValue:i.length})})}}f(),b({shouldCompress:!n&&void 0}),y(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(g){if(e.length>1)return void w({message:C("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,l.A)(e[0].name,e[0]);if(!(g&&t&&(0,s.eh)(g,t)))return void w({message:C("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}f(),b({shouldCompress:!0}),y(e)}}),P=(0,u.A)(e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(I.current=window.setTimeout(()=>{f()},150))});if(!M)return;const F=n||S,T=(0,a.A)("DropArea",N);return(0,v.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,v.FD)("div",{className:T,onDragLeave:P,onDragOver:()=>{I.current&&window.clearTimeout(I.current)},onDrop:f,onClick:f,children:[(0,v.Y)(A,{onFileSelect:Y,isGeneric:!F}),F&&(0,v.Y)(A,{onFileSelect:k,isQuick:!0})]})})})},42215:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(84051),o=n(30857);function s(e,t){const n=(0,o.A)(),s=(0,i.li)(e),a=(0,i.li)(t),r=(0,i.hb)(e=>(a.current=s.current(a.current,e),n(),a.current),[]);return[a.current,r]}},42827:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(84051),o=n(87357),s=n(58443),a=n(4961),r=n(59030),l=n(50680),d=n(64489),c=n(20021);const u="Nothing found.",h=(0,i.ph)(e=>{let{text:t=u,description:n,withSticker:i}=e;const h=(0,r.A)(),{transitionClassNames:m}=(0,l.A)(!0);return(0,c.FD)("div",{className:(0,o.A)("NothingFound",m,n&&"with-description",i&&"with-sticker"),children:[i&&(0,c.Y)(d.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),t,n&&(0,c.Y)("p",{className:"description",children:(0,a.A)(h(n),["br"])})]})})},44784:(e,t,n)=>{n.d(t,{A:()=>oe});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(90709),l=n(27109),d=n(91048),c=n(85982),u=n(64713),h=n(83868),m=n(59852),p=n(79882),g=n(24899),f=n(4961),v=n(82117),A=n(39351),y=n(17712),C=n(62587),w=n(59030),b=n(38691),I=n(19210),S=n(64493),M=n(22720),N=n(55158),Y=n(63152),k=n(87412),P=n(84685),F=n(66644),T=n(96454),D=n(87357),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 i of e){let e=(i.startMinute+t)%L,o=(i.endMinute+t)%L;e<0&&(e+=L),o<=0&&(o+=L),e>o?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:o})):n.push({startMinute:e,endMinute:o})}return n.sort((e,t)=>e.startMinute-t.startMinute),n.reduce((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e},[])}var O=n(98255),U=n(32625),z=n(19129),K=n(37661),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,i.ph)(e=>{let{businessHours:t}=e;const n=(0,i.li)(),[o,s,a]=(0,K.A)(!1),[r,l,d]=(0,K.A)(!1),c=(0,w.A)(),u=(0,V.A)();(0,U.A)(u,6e4);const h=(0,O.A)(e=>e.timezones?.byId),m=(0,z.A)(h,[h]),p=(0,i.Kr)(()=>{if(!m)return 0;const e=m[t.timezoneId];return(-60*(new Date).getTimezoneOffset()-e.utcOffset)/60},[t.timezoneId,m]),g=(0,i.Kr)(()=>{const e=B(),n=function(e){const t={};for(const n of e){const e=n.startMinute,i=n.endMinute,o=Math.floor(e/E),s=Math.floor((i-1)/E);for(let n=o;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*E),endMinute:Math.min(E,i-n*E)})}return t}(R(t.workHours,r?p:0)),i={};return H.forEach(t=>{const o=n[t];i[t]=o?o.map(t=>{let{startMinute:n,endMinute:i}=t;return i-n===1440?c("BusinessHoursDayFullOpened"):`${(0,x.fU)(c,e+60*n*1e3)} – ${(0,x.fU)(c,e+60*i*1e3)}`}):[c("BusinessHoursDayClosed")]}),i},[t.workHours,r,c,p]),f=(0,i.Kr)(()=>{const e=R(t.workHours,p),n=B(),i=((new Date).getTime()-n)/1e3/60;return e.some(e=>{let{startMinute:t,endMinute:n}=e;return t<=i&&i<=n})},[t.workHours,p]),v=(0,i.Kr)(()=>(new Date(Date.now()-(r?0:60*p*1e3)).getDay()+6)%7,[r,p]),A=(0,y.A)(()=>{o?a():s()}),C=(0,y.A)(e=>{e.stopPropagation(),r?d():l()});(0,i.vJ)(()=>{if(!o)return;const e=document.querySelector(`.${j.uo} > .${$}`);if(!e)return;const t=e.offsetHeight;(0,F.RK)(()=>{n.current.style.height=`${t}px`})},[o]);const b=(0,y.A)(()=>{const e=document.querySelector(`.${j.VY} > .${$}`);(0,F.YS)(()=>{const t=e.offsetHeight;(0,F.RK)(()=>{n.current.style.height=`${t}px`})})});return(0,q.FD)(M.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:o,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:c("BusinessHoursProfile")}),(0,q.Y)("div",{className:(0,D.A)("JVL7ZnnJ",f&&"segAfYXs"),children:c(f?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,q.Y)(J.A,{className:"dYxw2cFn",name:o?"up":"down"})]}),o&&(0,q.FD)("div",{className:"lp9VIV1o",children:[Boolean(p)&&(0,q.Y)("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:T.TF?void 0:C,onClick:T.TF?C:void 0,children:c(r?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,q.Y)(j.Ay,{className:"WKgL_XiP",ref:n,name:"fade",activeKey:Number(r),onStart:b,children:(0,q.Y)("dl",{className:$,children:H.map(e=>(0,q.FD)(q.FK,{children:[(0,q.Y)("dt",{className:(0,D.A)("cmxPqAof",e===v&&"YZVvP_56"),children:(0,x.wv)(c,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,i.ph)((0,o.EK)(e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,d.n_C)(e)}})(e=>{let{user:t,birthday:n,isPremiumPurchaseBlocked:a,birthdayNumbers:l,animatedEmojiEffects:d,isInSettings:c}=e;const{openGiftModal:u,requestConfetti:h}=(0,o.ko)(),m=(0,i.li)(),p=(0,i.li)(!1),[g,v,C]=(0,K.A)(),w=(0,A.A)(),{formattedDate:b,isToday:I,age:S}=(0,i.Kr)(()=>{const e=new Date,t=new Date;return n.year&&t.setFullYear(n.year),t.setMonth(n.month-1),t.setDate(n.day),t.setHours(0,0,0,0),{formattedDate:(0,x.A)(t,w.code,!0,"long"),isToday:t.getDate()===e.getDate()&&t.getMonth()===e.getMonth(),age:n.year&&te(t)}},[n,w]),N=(0,i.Kr)(()=>{if(!S||!I)return;const e=l?.stickers?.filter(e=>{let{emoji:t}=e;return t?.endsWith("️⃣")});if(!e)return;const t=(0,W.dU)(e,"emoji");return S.toString().split("").map(e=>t[e+"️⃣"])},[S,l?.stickers,I]),Y=(0,i.Kr)(()=>{if(!I)return;const e=X[Math.floor(Math.random()*X.length)];return d?.stickers?.find(t=>{let{emoji:n}=t;return n===e})},[d?.stickers,I]);(0,i.vJ)(()=>{if(I&&N&&(N.forEach(e=>{const t=(0,r.Mw)(e,"preview");_.hd(t,s.qZ.BlobUrl)}),Y)){const e=(0,r.Mw)(Y,"preview");_.hd(e,s.qZ.BlobUrl)}},[Y,I,N]),(0,Q.A)(C,g?3e3:void 0),(0,i.vJ)(()=>{if(g){p.current=!0;const e=document.getElementById(c?"LeftColumn":"RightColumn");if(!e)return;(0,F.YS)(()=>{const{top:t,left:n,width:i,height:o}=e.getBoundingClientRect();h({top:t,left:n,width:i,height:o,style:"top-down"})})}},[c,g]);const k=(0,i.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&&!t.isPremium&&!t.isSelf&&!a,E=(0,y.A)(()=>{u({forUserId:t.id})}),L=(0,y.A)(()=>{I&&(P&&p.current?E():v())}),B=!I&&!P;return(0,q.FD)("div",{className:"wCp6TBYF",children:[(0,q.FD)(M.A,{icon:"calendar",secondaryIcon:P?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:m,ripple:!B,onClick:L,isStatic:B,onSecondaryIconClick:E,children:[(0,q.Y)("div",{className:"title",dir:w.isRtl?"rtl":void 0,children:(0,f.A)(k)}),(0,q.Y)("span",{className:"subtitle",children:w(I?"ProfileBirthdayToday":"ProfileBirthday")})]}),g&&T.ol&&N?.map((e,t)=>(0,q.Y)("div",{className:(0,D.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,q.Y)(Z.A,{containerRef:m,sticker:e,size:128,forceAlways:!0})})),g&&Y&&(0,q.Y)("div",{className:"cFEXGUih",children:(0,q.Y)(Z.A,{containerRef:m,sticker:Y,size:288,shouldLoop:!0,forceAlways:!0})})]})}));function te(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const i=t.getMonth()-e.getMonth();return(i<0||0===i&&t.getDate()<e.getDate())&&n--,n}const ne="UZbkeFDB",ie={width:64,height:64,zoom:15},oe=(0,i.ph)((0,o.EK)((e,t)=>{let{chatOrUserId:n,isSavedDialog:i}=t;const{countryList:{phoneCodes:o}}=e,s=n?(0,d.hds)(e,n):void 0,a=n?(0,d.mBe)(e,n):void 0,c=n?(0,d.XOs)(e,n):void 0,u=s?.isForum,h=s&&(0,l.If)(s,(0,d.K52)(e),(0,d.P5N)(e,s.id)),{threadId:m}=(0,d.Xf0)(e)||{},p=u&&m?Number(m):void 0,g=s&&(0,d.AWZ)(e,s.id),f=a&&(0,d.vGo)(e,a.id),v=f?.botVerification||g?.botVerification,A=g?.inviteLink,y=f?.bio||g?.about,C=s&&!a&&(!(0,r.WX)(s)&&!(0,r.Sq)(s,"inviteUsers")||(0,r.ub)(s,"inviteUsers")),w=p?(0,d.sZk)(e,n,p):void 0,b=!i&&e.chats.listIds.saved?.includes(n),I=f?.personalChannelId?(0,d.hds)(e,f.personalChannelId):void 0,S=a?.hasMainMiniApp;return{phoneCodeList:o,chat:s,user:a,userFullInfo:f,canInviteUsers:C,botAppPermissions:c,isMuted:h,topicId:p,chatInviteLink:A,description:y,topicLink:w,hasSavedMessages:b,personalChannel:I,hasMainMiniApp:S,isBotCanManageEmojiStatus:f?.isBotCanManageEmojiStatus,botVerification:v}})(e=>{let{chatOrUserId:t,user:n,chat:l,userFullInfo:F,isInSettings:T,canInviteUsers:D,isMuted:x,phoneCodeList:E,topicId:L,description:B,chatInviteLink:R,topicLink:O,hasSavedMessages:U,personalChannel:z,hasMainMiniApp:K,isBotCanManageEmojiStatus:V,botAppPermissions:j,botVerification:J}=e;const{showNotification:$,updateChatMutedState:H,updateTopicMutedState:W,loadPeerStories:_,openSavedDialog:Q,openMapModal:Z,requestCollectibleInfo:X,requestMainWebView:te,toggleUserEmojiStatusPermission:oe,toggleUserLocationPermission:se}=(0,o.ko)(),{id:ae,usernames:re,phoneNumber:le,isSelf:de}=n||{},{id:ce,usernames:ue}=l||{},he=ae||ce,{businessLocation:me,businessWorkHours:pe,personalChannelMessageId:ge,birthday:fe}=F||{},ve=(0,w.A)(),Ae=(0,A.A)();(0,v.A)(e=>{let[t]=e;he&&t!==he&&(n||l&&(0,r.WX)(l))&&_({peerId:he})},[he,l,n]);const{width:ye,height:Ce,zoom:we}=ie,be=(0,b.A)(),Ie=me?.geo&&(0,r.rt)(me.geo,ye,Ce,we,be),Se=(0,C.A)(Ie),Me=(0,i.Kr)(()=>{if(me?.geo)return Se?(0,q.Y)("img",{src:Se,alt:"",className:ne}):(0,q.Y)(N.A,{className:ne})},[me,Se]),Ne=Boolean(L&&L!==s.l3),Ye=l&&(0,r.WX)(l)||n?.isPremium,ke=(0,i.Kr)(()=>{const e=re?.filter(e=>e.isActive);return e?.length?e:void 0},[re]),Pe=(0,i.Kr)(()=>{const e=n?void 0:ue?.filter(e=>e.isActive);return e?.length?e:void 0},[ue,n]),Fe=(0,i.Kr)(()=>{if(l)return Ne?O:(0,r.L7)(l)||R},[l,Ne,O,R]),Te=(0,y.A)(()=>{const{address:e,geo:t}=me;if(!t)return(0,c.eM)(e),void $({message:ve("BusinessLocationCopied")});Z({geoPoint:t,zoom:we})}),De=(0,y.A)(()=>{const e=x?a.Os5:a.xEh;Ne?W({chatId:ce,topicId:L,mutedUntil:e}):H({chatId:ce,mutedUntil:e})}),xe=(0,y.A)(()=>{n&&oe({botId:n.id,isEnabled:!V})}),Ee=(0,y.A)(()=>{n&&se({botId:n.id,isAccessGranted:!j?.geolocation})}),Le=(0,y.A)(()=>{Q({chatId:t})});function Be(e,t){(0,c.eM)(e),$({message:`${t} was copied`})}const Re=le&&(0,u.Ox)(E,le),Oe=(0,y.A)(()=>{le?.length===a.PGI&&le.startsWith(a._Bb)?X({collectible:le,peerId:he,type:"phone"}):Be(Re,ve("Phone"))}),Ue=(0,y.A)((e,t)=>{e.isEditable?Be((0,g.A)(e.username,t),ve(t?"Link":"Username")):X({collectible:e.username,peerId:he,type:"username"})}),ze=(0,y.A)(()=>{const e=n?.id;if(!e)return;const t=(0,m.A)();te({botId:e,peerId:e,theme:t,shouldMarkBotTrusted:!0})}),Ke=Ae("ProfileOpenAppAbout",{terms:(0,q.Y)(P.A,{text:Ae("ProfileOpenAppTerms"),url:Ae("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if(!(ce&&(0,d._ls)((0,o.mS)(),ce)||de&&!T))return(0,q.FD)("div",{className:"ChatExtra",children:[z&&(0,q.FD)("div",{className:"HP5EJx7s",children:[(0,q.Y)("h3",{className:"cHyTGri2",children:ve("ProfileChannel")}),(0,q.Y)("span",{className:"kYd2GrmU",children:ve("Subscribers",z.membersCount,"i")}),(0,q.Y)(I.A,{chatId:z.id,orderDiff:0,animationType:p.I.None,isPreview:!0,previewMessageId:ge,className:"qOJwhXMC"})]}),Boolean(Re?.length)&&(0,q.FD)(M.A,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:Oe,children:[(0,q.Y)("span",{className:"title",dir:Ae.isRtl?"rtl":void 0,children:Re}),(0,q.Y)("span",{className:"subtitle",children:ve("Phone")})]}),ke&&Ve(ke),B&&Boolean(B.length)&&(0,q.FD)(M.A,{icon:"info",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,children:[(0,q.Y)("span",{className:"title word-break allow-selection",dir:Ae.isRtl?"rtl":void 0,children:(0,f.A)(B,["br",Ye?"links":"tg_links","emoji"])}),(0,q.Y)("span",{className:"subtitle",children:ve(ae?"UserBio":"Info")})]}),Pe&&!Ne&&Ve(Pe,!0),(!Pe&&D||Ne)&&Fe&&(0,q.FD)(M.A,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>Be(Fe,ve("SetUrlPlaceholder")),children:[(0,q.Y)("div",{className:"title",children:Fe}),(0,q.Y)("span",{className:"subtitle",children:ve("SetUrlPlaceholder")})]}),fe&&(0,q.Y)(ee,{birthday:fe,user:n,isInSettings:T},he),K&&(0,q.FD)(M.A,{multiline:!0,isStatic:!0,narrow:!0,children:[(0,q.Y)(S.A,{className:"x925YeS3",onClick:ze,children:ve("ProfileBotOpenApp")}),(0,q.Y)("div",{className:"IrqRJFxm",children:Ke})]}),!T&&(0,q.FD)(M.A,{icon:x?"unmute":"mute",narrow:!0,ripple:!0,onClick:De,children:[(0,q.Y)("span",{children:ve("Notifications")}),(0,q.Y)(Y.A,{id:"group-notifications",label:ae?"Toggle User Notifications":"Toggle Chat Notifications",checked:!x,inactive:!0})]}),pe&&(0,q.Y)(G,{businessHours:pe}),me&&(0,q.FD)(M.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:Me,onClick:Te,children:[(0,q.Y)("div",{className:"title",children:me.address}),(0,q.Y)("span",{className:"subtitle",children:ve("BusinessProfileLocation")})]}),U&&!T&&(0,q.Y)(M.A,{icon:"saved-messages",narrow:!0,ripple:!0,onClick:Le,children:(0,q.Y)("span",{children:ve("SavedMessagesTab")})}),F&&"isBotAccessEmojiGranted"in F&&(0,q.FD)(M.A,{icon:"user",narrow:!0,ripple:!0,onClick:xe,children:[(0,q.Y)("span",{children:ve("BotProfilePermissionEmojiStatus")}),(0,q.Y)(Y.A,{label:ve("BotProfilePermissionEmojiStatus"),checked:V,inactive:!0})]}),void 0!==j?.geolocation&&(0,q.FD)(M.A,{icon:"location",narrow:!0,ripple:!0,onClick:Ee,children:[(0,q.Y)("span",{children:ve("BotProfilePermissionLocation")}),(0,q.Y)(Y.A,{label:ve("BotProfilePermissionLocation"),checked:j?.geolocation,inactive:!0})]}),J&&(0,q.FD)("div",{className:"RWFu5ENh",children:[(0,q.Y)(k.A,{className:"b32hsSPS",documentId:J.iconId,size:16}),J.description]})]});function Ve(e,t){const[n,...i]=e,o=i.length?ve("UsernameAlso","%USERNAMES%").split("%").map(e=>"USERNAMES"===e?(0,q.Y)(q.FK,{children:i.map((e,n)=>(0,q.FD)(q.FK,{children:[n>0?", ":"",(0,q.Y)("a",{href:(0,g.A)(e.username,!0),onMouseDown:h.A,onClick:n=>{(0,h.A)(n),Ue(e,t)},className:"text-entity-link username-link",children:(0,g.A)(e.username)},e.username)]}))}):e):void 0;return(0,q.FD)(M.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{Ue(n,t)},children:[(0,q.Y)("span",{className:"title",dir:Ae.isRtl?"rtl":void 0,children:(0,g.A)(n.username,t)}),(0,q.FD)("span",{className:"subtitle",children:[o&&(0,q.Y)("span",{className:"other-usernames",children:o}),ve(t?"Link":"Username")]})]})}}))},45318:(e,t,n)=>{e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"},45761:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(87679);async function o(e){const t=[];function n(e,i){return new Promise(o=>{if(e instanceof File)t.push(e),o(e);else if(e.isFile){const n=i.getAsFile();e.file(e=>{t.push(e),o(e)},()=>{n&&t.push(n),o(n)})}else e.isDirectory&&e.createReader().readEntries(e=>{const t=[];for(let o=0;o<e.length;o++)t.push(n(e[o],i));o(Promise.all(t))})})}const o=[];for(let t=0;t<e.length;t++){const i=e[t];if("file"===i.kind){const e=i.webkitGetAsEntry()||i.getAsFile();e&&o.push(n(e,i))}}return await Promise.all(o),(0,i.kc)(t)}},46051:(e,t,n)=>{n.d(t,{G:()=>i,w:()=>o});const i="video/mp4; codecs=hvc1.1.6.L63.00",o="video/mp4; codecs=avc1.64001E"},47058:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(13439),s=n(87357),a=n(85982),r=n(43874),l=n(17712),d=n(59030),c=n(64493),u=n(22699),h=n(24433),m=n(18276);var p=n(20021);const g=(0,i.ph)(e=>{let{title:t,link:n,isDisabled:g,className:f,withShare:v,onRevoke:A}=e;const y=(0,d.A)(),{showNotification:C,openChatWithDraft:w}=(0,o.ko)(),{isMobile:b}=(0,r.Ay)(),I=!A,S=(0,l.A)(()=>{(0,a.eM)(n),C({message:{key:"LinkCopied"}})}),M=(0,l.A)(()=>{g||S()}),N=(0,l.A)(()=>{w({text:{text:n}})}),Y=(0,i.Kr)(()=>e=>{let{onTrigger:t,isOpen:n}=e;return(0,p.Y)(c.A,{round:!0,ripple:!b,size:"smaller",color:"translucent",className:n?"active":"",onClick:t,ariaLabel:y("AccDescrOpenMenu2"),children:(0,p.Y)(m.A,{name:"more"})})},[b,y]);return(0,p.FD)("div",{className:f,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:y(t||"InviteLink.InviteLink")}),(0,p.FD)("div",{className:"xNjJHI7j",children:[(0,p.Y)("input",{className:(0,s.A)("form-control","Ag6k_p7b"),value:n,readOnly:!0,onClick:M}),I?(0,p.Y)(c.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,disabled:g,onClick:M,children:(0,p.Y)(m.A,{name:"copy"})}):(0,p.FD)(u.A,{className:"p7t3macG",trigger:Y,positionX:"right",children:[(0,p.Y)(h.A,{icon:"copy",onClick:M,disabled:g,children:y("Copy")}),A&&(0,p.Y)(h.A,{icon:"delete",onClick:A,destructive:!0,children:y("RevokeButton")})]})]}),v&&(0,p.Y)(c.A,{disabled:g,onClick:N,className:"Sbagy_Tm",children:y("FolderLinkScreen.LinkActionShare")})]})})},47067:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(84051),o=n(13439),s=n(31481),a=n(90709),r=n(63495),l=n(96454),d=n(9716),c=n(87894),u=n(39351);const h=function(e){let{chat:t,user:n,folderId:h,isPinned:m,isMuted:p,canChangeFolder:g,isSavedDialog:f,currentUserId:v,isPreview:A,topics:y,handleDelete:C,handleMute:w,handleUnmute:b,handleChatFolderChange:I,handleReport:S}=e,M=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const N=(0,u.A)(),{isSelf:Y}=n||{},k=n?.id===s.zv8,P=(0,i.Kr)(()=>{if(t)return f?N("Delete"):(0,d.L8)(t.id)||(0,a.IC)(t)?N("DeleteChat"):(0,a.WX)(t)?N("ChannelLeave"):N("GroupLeaveGroup")},[t,f,N]);return(0,i.Kr)(()=>{if(!t||A)return;const{toggleChatPinned:e,toggleSavedDialogPinned:i,toggleChatArchived:s,markChatMessagesRead:d,markChatUnread:u,openChatInNewTab:F}=(0,o.ko)(),T=l.OS&&{title:r.Vq?N("ChatListOpenInNewWindow"):N("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{F(f?{chatId:v,threadId:t.id}:{chatId:t.id})}},D=()=>{f?i({id:t.id}):e({id:t.id,folderId:h})},x=m?{title:N("ChatListUnpinFromTop"),icon:"unpin",handler:D}:{title:N("ChatListPinToTop"),icon:"pin",handler:D},E={title:P,icon:"delete",destructive:!0,handler:C};if(f)return(0,c.oE)([T,x,E]);const L=g?{title:N("ChatListContextAddToFolder"),icon:"folder",handler:I}:void 0,B=p?{title:N("ChatsUnmute"),icon:"unmute",handler:b}:{title:`${N("ChatsMute")}...`,icon:"mute",handler:w};if(M)return(0,c.oE)([T,x,L,B]);const R=t.unreadCount||t.hasUnreadMark||Object.values(y||{}).some(e=>{let{unreadCount:t}=e;return t})?{title:N("ChatListContextMaskAsRead"),icon:"readchats",handler:()=>d({id:t.id})}:void 0,O=t.unreadCount||t.hasUnreadMark||t.isForum?void 0:{title:N("ChatListContextMaskAsUnread"),icon:"unread",handler:()=>u({id:t.id})},U=(0,a.TJ)(t)?{title:N("Unarchive"),icon:"unarchive",handler:()=>s({id:t.id})}:{title:N("Archive"),icon:"archive",handler:()=>s({id:t.id})},z=S&&!n&&((0,a.WX)(t)||(0,a.YE)(t))?{title:N("ReportPeerReport"),icon:"flag",handler:S}:void 0,K=void 0!==h;return(0,c.oE)([T,L,R,O,x,!Y&&B,!Y&&!k&&!K&&U,z,E])},[t,n,g,N,I,m,M,p,v,C,w,S,h,Y,k,f,P,A,y,b])}},47526:(e,t,n)=>{n.d(t,{KE:()=>l,PP:()=>d,_u:()=>r,zS:()=>a});const i={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},o=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15;const{lat:o,long:s}=t,a=i[e];switch(e){case"google":return`${a}/place/${o}+${s}/@${o},${s},${n}z`;case"bing":return`${a}?cp=${o}~${s}&lvl=${n}&sp=point.${o}_${s}`;case"apple":return`${a}?q=${o},${s}`;default:return`${a}/?mlat=${o}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function l(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function d(e){return e?o.get(e)||o.get(e.split("/")[0])||s[(t=e,t.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%s.length)]:"#008df2";var t}},48227:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(48775),s=n(39351),a=n(19806),r=n(94189);var l=n(20021);const d=(0,i.ph)(e=>{let{isOpen:t,onClose:n,userName:i,messagePriceInStars:d,messagesCount:c,shouldAutoApprove:u,setAutoApprove:h,confirmHandler:m}=e;const p=(0,s.A)(),g=p("ConfirmationModalPaymentForMessage",{user:i,amount:(0,o.Kk)(p,d),totalAmount:(0,o.Kk)(p,d*c),count:c},{withMarkdown:!0,withNodes:!0,pluralValue:c}),f=p("PayForMessage",{count:c},{withNodes:!0,pluralValue:c});return(0,l.FD)(r.A,{title:p("TitleConfirmPayment"),confirmLabel:f,isOpen:t,onClose:n,confirmHandler:m,children:[g,(0,l.Y)(a.A,{className:"eScpikxM",label:p("DoNotAskAgain"),checked:u,onCheck:h})]})})},48553:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(66644),l=n(90709),d=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,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,threadId:i,messageListType:o,isMobile:a}=t;const r=(0,d.hds)(e,n),h=Boolean(r&&(0,l.WX)(r)),m=Boolean(r&&(0,l.Vs)(r)),p=(0,d.wmb)(e),g=(0,d.Qq_)(e),f=(0,u.L8)(n),{doNotTranslate:v}=e.settings.byKey,A=(0,d._ls)(e,n);if(!r||A||(0,d.rTV)(e))return{noMenu:!0,language:p,translationLanguage:g,doNotTranslate:v};const y=(0,d.yps)(e,n),C=f?void 0:(0,d.AWZ)(e,n),w=f?(0,d.vGo)(e,n):void 0,b=C||w,I=(0,d.nZ4)(e,n),S="thread"===o&&i===s.l3,M="thread"===o&&i!==s.l3,N=(0,d.gjV)(e,a),Y=(0,l.cG)(n,i,e.currentUserId),k=!!f&&(0,d.apd)(e,n),P=Boolean(y&&k),F=!P&&Boolean((0,d.I_m)(e,n)),T=k&&!y,D=Boolean((S||r.isForum)&&(h||m)&&r.isNotJoined&&!r.isMonoforum),x=S||M,E=c.OL&&(0,u.L8)(r.id)&&!I&&!y&&!r.isSupport&&!(0,l.Qe)(r.id),L=S&&!I&&!D,B=Y||S&&!D,R=c.OL&&S&&r.isCallActive,O=c.OL&&S&&!r.isCallActive&&(r.adminRights?.manageCall||r.isCreator&&(0,l.yn)(r))&&!r.isMonoforum,U=S&&C?.canViewStatistics,z=S&&C?.canViewMonetization,K=S&&!r.isMonoforum&&(m||h)&&(U||(0,l.ub)(r,"postStories")),V=!K&&(m||h)&&!r.isMonoforum,j=S?C?.requestsPending:void 0,J=Boolean(r?.isNotJoined&&r.isJoinToSend),$=Boolean(r?.isNotJoined&&r.isJoinRequest),q=!(0,d.PKK)(e),H=Boolean((0,d.qZq)(e,n)),G=(0,d.jGY)(e,n)&&!b?.isTranslationDisabled,W=(0,d.trm)(e),_=(0,l.WX)(r)?r.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:h,isRightColumnShown:N,canStartBot:F,canRestartBot:P,canSubscribe:D,canSearch:x,canCall:E,canMute:L,canViewStatistics:U,canViewMonetization:z,canViewBoosts:K,canShowBoostModal:V,canLeave:B,canEnterVoiceChat:R,canCreateVoiceChat:O,pendingJoinRequests:j,shouldJoinToSend:J,shouldSendJoinRequest:$,noAnimation:q,canTranslate:G,isTranslating:H,translationLanguage:g,language:p,doNotTranslate:v,detectedChatLanguage:r.detectedLanguage,canUnblock:T,isAccountFrozen:W,channelMonoforumId:_}})(e=>{let{chatId:t,threadId:n,noMenu:s,isMobile:l,isChannel:d,canStartBot:u,canRestartBot:C,canUnblock:w,canSubscribe:S,canSearch:N,canCall:Y,canMute:k,canViewStatistics:P,canViewMonetization:F,canViewBoosts:T,canShowBoostModal:D,canLeave:x,canEnterVoiceChat:E,canCreateVoiceChat:L,channelMonoforumId:B,pendingJoinRequests:R,isRightColumnShown:O,isForForum:U,canExpandActions:z,shouldJoinToSend:K,shouldSendJoinRequest:V,noAnimation:j,canTranslate:J,isTranslating:$,translationLanguage:q,language:H,detectedChatLanguage:G,doNotTranslate:W,isAccountFrozen:_,onTopicSearch:Q}=e;const{joinChannel:Z,sendBotCommand:X,openMiddleSearch:ee,restartBot:te,requestMasterAndRequestCall:ne,requestNextManagementScreen:ie,showNotification:oe,openChat:se,requestChatTranslation:ae,togglePeerTranslations:re,openChatLanguageModal:le,setSettingOption:de,unblockUser:ce,setViewForumAsMessages:ue,openFrozenAccountModal:he}=(0,o.ko)(),me=(0,i.li)(),pe=(0,p.A)(),[ge,fe]=(0,i.J0)(!1),[ve,Ae]=(0,i.J0)(void 0),ye=(0,m.A)(()=>{fe(!0);const e=me.current.getBoundingClientRect();Ae({x:e.right,y:e.bottom})}),Ce=(0,m.A)(()=>{fe(!1)}),we=(0,m.A)(()=>{Ae(void 0)}),be=(0,m.A)(()=>{Z({chatId:t}),V&&oe({message:pe(d?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})}),Ie=(0,m.A)(()=>{X({command:"/start"})}),Se=(0,m.A)(()=>{te({chatId:t})}),Me=(0,m.A)(()=>{ce({userId:t})}),Ne=(0,m.A)(()=>{ae($?{chatId:t,toLanguageCode:void 0}:{chatId:t,toLanguageCode:q})}),Ye=(0,m.A)(()=>{ie({screen:a.je.JoinRequests})}),ke=(0,m.A)(()=>{U?Q?.():(ee(),l?M():j?(0,r.YS)(()=>{(0,r.Uz)(M)}):setTimeout(M,320))}),Pe=(0,m.A)(()=>{se({id:t}),ue({chatId:t,isEnabled:!0})}),Fe=(0,m.A)(()=>{_?he():ne({userId:t})}),Te=(0,m.A)(e=>{N&&c.lE&&!e.shiftKey&&(e.preventDefault(),ke())}),De=(0,i.hb)((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,i=pe(n);if(i!==n)return pe(e,i);const o=new Intl.DisplayNames([H],{type:"language"}).of(t);return pe(`${e}Other`,o)},[H,pe]),xe=(0,i.Kr)(()=>$?pe("ShowOriginalButton"):De("TranslateToButton",q),[q,De,$,pe]),Ee=(0,i.Kr)(()=>{if(G)return De("DoNotTranslateLanguage",G)},[De,G]),Le=(0,m.A)(()=>{re({chatId:t,isEnabled:!1}),ae({chatId:t,toLanguageCode:void 0})}),Be=(0,m.A)(()=>{le({chatId:t})}),Re=(0,m.A)(()=>{G&&(de({doNotTranslate:[...W,G]}),ae({chatId:t,toLanguageCode:void 0}),oe({message:De("AddedToDoNotTranslate",G)}))});(0,h.v)((0,i.Kr)(()=>({"Mod+F":Te}),[]));const Oe=(0,i.Kr)(()=>e=>{let{onTrigger:t,isOpen:n}=e;return(0,b.Y)(f.A,{round:!0,ripple:O,color:"translucent",size:"smaller",className:n?"active":"",onClick:t,ariaLabel:pe("TranslateMessage"),children:(0,b.Y)(g.A,{name:"language"})})},[O,pe]);return(0,b.FD)("div",{className:"HeaderActions",children:[!U&&J&&(0,b.FD)(v.A,{className:"stickers-more-menu with-menu-transitions",trigger:Oe,positionX:"right",children:[(0,b.Y)(A.A,{icon:"language",onClick:Ne,children:xe}),(0,b.Y)(A.A,{icon:"replace",onClick:Be,children:pe("Chat.Translate.Menu.To")}),(0,b.Y)(y.A,{}),G&&(0,b.Y)(A.A,{icon:"hand-stop",onClick:Re,children:Ee}),(0,b.Y)(A.A,{icon:"close-circle",onClick:Le,children:pe("Hide")})]}),!l&&(0,b.FD)(b.FK,{children:[z&&!V&&(S||K)&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:be,children:pe(d?"ProfileJoinChannel":"ProfileJoinGroup")}),z&&V&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:be,children:pe("ChannelJoinRequest")}),z&&u&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ie,children:pe("BotStart")}),z&&C&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Se,children:pe("BotRestart")}),z&&w&&(0,b.Y)(f.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Me,children:pe("Unblock")}),N&&(0,b.Y)(f.A,{round:!0,ripple:O,color:"translucent",size:"smaller",onClick:ke,ariaLabel:pe("Conversation.SearchPlaceholder"),children:(0,b.Y)(g.A,{name:"search"})}),Y&&(0,b.Y)(f.A,{round:!0,color:"translucent",size:"smaller",onClick:Fe,ariaLabel:"Call",children:(0,b.Y)(g.A,{name:"phone"})})]}),!U&&Boolean(R)&&(0,b.FD)(f.A,{round:!0,className:"badge-button",ripple:O,color:"translucent",size:"smaller",onClick:Ye,ariaLabel:pe(d?"SubscribeRequests":"MemberRequests"),children:[(0,b.Y)(g.A,{name:"user"}),(0,b.Y)("div",{className:"badge",children:R})]}),(0,b.Y)(f.A,{ref:me,className:ge?"active":"",round:!0,ripple:!l,size:"smaller",color:"translucent",disabled:s,ariaLabel:"More actions",onClick:ye,children:(0,b.Y)(g.A,{name:"more"})}),ve&&(0,b.Y)(I,{chatId:t,threadId:n,isOpen:ge,anchor:ve,withExtraActions:l||!z,isChannel:d,canStartBot:u,canSubscribe:S,canSearch:N,canCall:Y,canMute:k,canViewStatistics:P,canViewBoosts:T,canViewMonetization:F,canShowBoostModal:D,canLeave:x,canEnterVoiceChat:E,canCreateVoiceChat:L,pendingJoinRequests:R,onJoinRequestsClick:Ye,withForumActions:U,channelMonoforumId:B,onSubscribeChannel:be,onSearchClick:ke,onAsMessagesClick:Pe,onClose:Ce,onCloseAnimationEnd:we})]})}));function M(){const e=document.querySelector("#MiddleSearch input");e?.focus()}},48885:(e,t,n)=>{n.d(t,{A:()=>h,S:()=>m});var i=n(84051),o=n(61433),s=n(66644),a=n(14737),r=n(17712),l=n(93545),d=n(672);const c=450,u=100;function h(e){let{ref:t,isOpen:n,isDisabled:o,withResizeObserver:h,onStateChange:m}=e;const[p,g]=(0,i.J0)(n),f=(0,i.li)(),v=t||f,A=(0,i.li)(0),y=(0,r.A)(()=>{g(!0),m?.({element:void 0,height:0,isOpen:!1})});(0,i.vJ)(()=>{o&&y()},[o]),(0,i.vJ)(()=>{n&&g(!0)},[n]),(0,i._W)(y),(0,a.A)(()=>{g(!1),m?.({height:0,isOpen:!1})},n?void 0:c);const C=(0,i.hb)(()=>{const e=v.current;!o&&e&&p&&(n?(0,s.gm)(()=>{const t=e.offsetHeight;return A.current=t,()=>{m?.({element:e,height:t,isOpen:n})}}):m?.({element:e,height:0,isOpen:!1}))},[n,p,o,v,m]),w=(0,d.A)(()=>{const e=v.current;e&&e.offsetHeight!==A.current&&C()},[C,v],u,!0);return(0,i.Nf)(C,[C]),(0,l.A)(v,w,!h||!p),{shouldRender:p,ref:v}}function m(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0;for(let i=0;i<e.length;i++){const a=e[i],r=a.element;if(!r)continue;const l=`${n}px`,d=()=>{(0,o.Tv)(r,{transform:`translateY(${a.isOpen?l:`calc(${l} - 100%)`})`,zIndex:String(-i),transition:t?"none":""})};r.dataset.isPanelOpen||!a.isOpen||t?d():((0,o.Tv)(r,{transform:`translateY(calc(${l} - 100%))`,zIndex:String(-i),transition:"none"}),r.dataset.isPanelOpen="true",(0,s.Uz)(d)),n+=a.height}}},48906:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(20021);const o=function(e){let{isOwn:t}=e;const n=t?"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,i.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,i.Y)("defs",{children:(0,i.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,i.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,i.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,i.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,i.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,i.Y)("path",{d:n,fill:"#000",filter:"url(#messageAppendix)"}),(0,i.Y)("path",{d:n,fill:t?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642:(e,t,n)=>{n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>l,MV:()=>o,hm:()=>d,wp:()=>c});const i={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function o(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...i,...e}).forEach(e=>{let[n,i]=e;try{t.setActionHandler(n,i)}catch(e){}})}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(i),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function d(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function c(e){let{title:t,artist:n,album:i,artwork:o}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:i,artwork:o})}},51083:(e,t,n)=>{n.d(t,{A:()=>I});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(91048),l=n(87357),d=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*d.$,I=(0,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,threadId:i}=t;const o=(0,r.hds)(e,n),s=i?(0,r.Vw0)(e,n,i):void 0,a=o?(0,r.ToO)(e,o):void 0,l=Boolean((0,r.zeq)(e,n)),d=i?(0,r.S0q)(e,n,i):void 0;return{chat:o,threadInfo:s,onlineCount:a,topic:d,areMessagesLoaded:l,messagesCount:d&&(0,r.QbG)(e,n,i),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,n)}})(e=>{let{typingStatus:t,className:n,statusIcon:d,avatarSize:I="medium",noAvatar:S,status:M,withDots:N,withMediaViewer:Y,withUsername:k,withFullInfo:P,withUpdatingStatus:F,withChatType:T,threadInfo:D,noRtl:x,chat:E,onlineCount:L,areMessagesLoaded:B,topic:R,messagesCount:O,noStatusOrTyping:U,withStory:z,storyViewerOrigin:K,noEmojiStatus:V,emojiStatusSize:j,isSavedDialog:J,self:$,withMonoforumStatus:q,monoforumChannel:H,onClick:G,onEmojiStatusClick:W}=e;const{loadFullChat:_,openMediaViewer:Q,loadMoreProfilePhotos:Z}=(0,o.ko)(),X=!q&&H?H:E,ee=(0,m.A)(),te=(0,u.A)(),ne=X&&(0,a.Vs)(X),ie=Boolean(X?.isForum&&D&&R),{id:oe,isMin:se}=X||{},ae=(0,r._ls)((0,o.mS)(),oe);(0,i.vJ)(()=>{oe&&!se&&(P&&_({chatId:oe}),Y&&Z({peerId:oe,isPreload:!0}))},[oe,se,P,ne,Y]);const re=(0,h.A)((e,t)=>{X&&t&&(e.stopPropagation(),Q({isAvatarView:!0,chatId:X.id,mediaIndex:0,origin:"jumbo"===I?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),le=(0,i.Kr)(()=>X&&k&&(0,a.Kl)(X),[X,k]);if(X)return(0,w.FD)("div",{className:(0,l.A)("ChatInfo",n),dir:!x&&ee.isRtl?"rtl":void 0,onClick:G,children:[!S&&!ie&&(0,w.FD)(w.FK,{children:[J&&$&&(0,w.Y)(g.A,{size:I,peer:$,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,l.A)(J&&"overlay-avatar"),size:I,peer:X,withStory:z,asMessageBubble:Boolean(H),storyViewerOrigin:K,storyViewerMode:"single-peer",isSavedDialog:J,onClick:Y?re:void 0},X.id)]}),ie&&(0,w.Y)(y.A,{topic:R,className:"topic-header-icon",size:b}),(0,w.FD)("div",{className:"info",children:[R?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,c.A)(R.title)}):(0,w.Y)(v.A,{peer:X,isMonoforum:!q&&Boolean(H),emojiStatusSize:j,withEmojiStatus:!V,isSavedDialog:J,onEmojiStatusClick:W}),!U&&function(){if(F&&!B&&!ae)return(0,w.Y)(f.A,{className:"status",content:ee("Updating")});if(q)return(0,w.Y)("span",{className:"status",dir:"auto",children:te("MonoforumStatus")});if(E?.isMonoforum)return;if(M)return N?(0,w.Y)(f.A,{className:"status",content:M}):(0,w.FD)("span",{className:"status",dir:"auto",children:[d&&(0,w.Y)(A.A,{className:"status-icon",name:d}),(0,c.A)(M)]});if(!X)return;if(t)return(0,w.Y)(C.A,{typingStatus:t});if(ie)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==O?1:2,className:"message-count-transition",children:void 0!==O&&ee("messages",O,"i")})});if(T)return(0,w.Y)("span",{className:"status",dir:"auto",children:ee((0,a.Gg)(X))});const e=(0,a.sT)(ee,X),n=L?`, ${ee("OnlineCount",L,"i")}`:void 0;return(0,w.FD)("span",{className:"status",children:[le&&(0,w.Y)("span",{className:"handle withStatus",children:le}),(0,w.Y)("span",{className:"group-status",children:e}),n&&(0,w.Y)("span",{className:"online-status",children:n})]})}()]})]})}))},51644:(e,t,n)=>{n.d(t,{A:()=>Y});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(90709),l=n(87357),d=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 Y=(0,i.ph)((0,o.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(e=>{let{id:t,photo:n,messageText:Y,isOwn:k,noAvatars:P,canAutoLoad:F,isInSelectMode:T,isSelected:D,uploadProgress:x,forcedWidth:E,size:L="inline",dimensions:B,asForwarded:R,nonInteractive:O,shouldAffectAppendix:U,isDownloading:z,isProtected:K,theme:V,isInWebPage:j,clickArg:J,className:$,isMediaNsfw:q,observeIntersection:H,onClick:G,onCancelUpload:W,needsAgeVerification:_}=e;const Q=(0,i.li)(),Z="extendedMediaPreview"===n.mediaType,X=Z?void 0:n.blobUrl,ee=(0,m.Vz)(Q,H),{isMobile:te}=(0,u.Ay)(),[ne,ie]=(0,i.J0)(F),oe=ne&&ee&&!Z,{mediaData:se,loadProgress:ae}=(0,v.A)(Z?void 0:(0,r.rI)(n,L),!oe),re=(0,A.A)(se),le=X||se,{ref:de,shouldRender:ce}=(0,f.A)({hasMediaData:Boolean(le),withShouldRender:!0}),ue=Boolean(E),[he]=(0,i.J0)(!le),me=Boolean(le),pe=(0,w.A)(n,me);(0,f.A)({ref:pe,hasMediaData:!me});const ge=(0,w.A)(n,!ue),fe=(0,r.VD)(n),{updateContentSettings:ve,openAgeVerificationModal:Ae}=(0,o.ko)(),[ye,Ce,we]=(0,h.A)(),[be,Ie]=(0,i.J0)(!1),Se=Z||n.isSpoiler||q,[Me,Ne,Ye]=(0,h.A)(Se);(0,i.vJ)(()=>{Se?Ne():Ye()},[Se]);const ke=(0,p.A)(()=>{we(),Ye(),be&&ve({isSensitiveEnabled:!0})}),{loadProgress:Pe}=(0,v.A)(Z?void 0:(0,r.rI)(n,"download"),!z,Z?void 0:(0,r.Cz)(n,"download")),{isUploading:Fe,isTransferring:Te,transferProgress:De}=(0,r.LK)(x||(z?Pe:ae),oe&&!le,void 0!==x),xe=!1===(0,y.A)(ne),{ref:Ee,shouldRender:Le}=(0,C.A)({isOpen:Te,noMountTransition:xe,className:"slow",withShouldRender:!0}),{ref:Be,shouldRender:Re}=(0,C.A)({isOpen:!le&&!ne,withShouldRender:!0}),Oe=(0,p.A)(e=>{if(Fe)W?.(J);else{if(le)return Me?q?_?void Ae():void Ce():void Ye():void G?.(J,e);ie(e=>!e)}});(0,g.A)(e=>{let[t]=e;if(!U)return void(t&&Q.current.closest(s.KFG).removeAttribute(s.D3G));const n=Q.current.closest(s.KFG);if(le){const e=Number(n.closest(".Message").dataset.messageId);(0,d.A)(le,Boolean(k),e,D,V).then(e=>{(0,a.RK)(()=>{n.style.setProperty("--appendix-bg",e),n.setAttribute(s.D3G,"")})})}else n.classList.add("has-appendix-thumb")},[U,le,k,T,D,V]);const{width:Ue,height:ze,isSmall:Ke}=B||(0,c.yA)({media:n,isOwn:k,asForwarded:R,noAvatars:P,isMobile:te,messageText:Y,isInWebPage:j}),Ve=(0,l.A)("media-inner",!Fe&&!O&&"interactive",Ke&&"small-image",(Ue===ze||"pictogram"===L)&&"square-image",ze<c.ej&&"fix-min-height",$),je=B?` width: ${Ue}px; left: ${B.x}px; top: ${B.y}px;`:"",Je="inline"===L?`height: ${ze}px;${je}`:void 0;return(0,N.FD)("div",{id:t,ref:Q,className:Ve,style:Je,onClick:Fe?void 0:Oe,children:[ue&&(0,N.Y)("canvas",{ref:ge,className:"thumbnail blurred-bg"}),ce&&(0,N.Y)("img",{ref:de,src:le||re,className:(0,l.A)("full-media",ue&&"with-blurred-bg"),alt:"",style:E?`width: ${E}px`:void 0,draggable:!K}),he&&(0,N.Y)("canvas",{ref:pe,className:"thumbnail"}),K&&(0,N.Y)("span",{className:"protector"}),Le&&!Re&&(0,N.Y)("div",{ref:Ee,className:"media-loading",children:(0,N.Y)(M.A,{progress:De,onClick:Fe?Oe:void 0})}),Re&&(0,N.Y)(b.A,{ref:Be,name:"download"}),(0,N.Y)(I.A,{isVisible:Me,withAnimation:!0,thumbDataUri:fe,width:Ue,height:ze,className:"media-spoiler",isNsfw:q}),Te&&(0,N.FD)("span",{className:"message-transfer-progress",children:[Math.round(100*De),"%"]}),(0,N.Y)(S.A,{isOpen:ye,onClose:we,shouldAlwaysShow:be,onAlwaysShowChanged:Ie,confirmHandler:ke})]})}))},52844:(e,t,n)=>{let i;function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i||(i=document.createElement("input"),i.setAttribute("type","file")),i.setAttribute("accept",e),n?i.removeAttribute("multiple"):i.setAttribute("multiple","multiple"),i.onchange=null,i.value="",i.onchange=t,i.click()}n.d(t,{p:()=>o})},52988:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(96454),s=n(87357),a=n(17663),r=n(91525),l=n(76023),d=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,i.ph)(e=>{let{ref:t,name:n,size:y,extension:C="",timestamp:w,sender:b,thumbnailDataUri:I,previewData:S,className:M,smaller:N,isTransferring:Y,isUploading:k,isSelectable:P,isSelected:F,transferProgress:T,actionIcon:D,onClick:x,onDateClick:E}=e;const L=(0,m.A)();let B=(0,i.li)();t&&(B=t);const{isMobile:R}=(0,c.Ay)(),[O]=(0,i.J0)(!S),U=Boolean(S),z=(0,u.A)(I,U,R&&!o.QH),K=(0,h.A)(!U),{shouldRender:V,transitionClassNames:j}=(0,p.A)(Y,void 0,!0),J=(0,r.fE)(C),$=(0,r.zV)(y),q=(0,i.Kr)(()=>Y&&T?`${(0,r.zV)(y*T)} / ${$}`:$,[Y,y,$,T]),{width:H,height:G}=(0,l.tP)(N),W=(0,s.A)("File",M,N&&"smaller",x&&!k&&"interactive",F&&"file-is-selected");return(0,A.FD)("div",{ref:B,className:W,dir:L.isRtl?"rtl":void 0,children:[P&&(0,A.Y)("div",{className:"message-select-control no-selection",children:F&&(0,A.Y)(v.A,{name:"select"})}),(0,A.FD)("div",{className:"file-icon-container",onClick:k?void 0:x,children:[I||S?(0,A.FD)("div",{className:"file-preview media-inner",children:[(0,A.Y)("img",{src:S,className:"full-media",width:H,height:G,draggable:!1,alt:""}),O&&(0,A.Y)("canvas",{ref:z,className:(0,s.A)("thumbnail",K)})]}):(0,A.Y)("div",{className:`file-icon ${J}`,children:C.length<=4&&(0,A.Y)("span",{className:"file-ext",dir:"auto",children:C})}),V&&(0,A.Y)("div",{className:(0,s.A)("file-progress",J,j),children:(0,A.Y)(f.A,{progress:T,size:N?"s":"m",onClick:k?x:void 0})}),x&&(0,A.Y)(v.A,{name:D||"download",className:(0,s.A)("action-icon",V&&"hidden")})]}),(0,A.FD)("div",{className:"file-info",children:[(0,A.Y)("div",{className:"file-title",dir:"auto",title:n,children:(0,d.A)(n)}),(0,A.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,A.Y)("span",{children:q}),b&&(0,A.Y)("span",{className:"file-sender",children:(0,d.A)(b)}),!b&&Boolean(w)&&(0,A.FD)(A.FK,{children:[(0,A.Y)("span",{className:"bullet"}),(0,A.Y)(g.A,{onClick:E,children:(0,a.fS)(L,1e3*w,!0)})]})]})]}),b&&Boolean(w)&&(0,A.Y)(g.A,{onClick:E,children:(0,a.be)(L,1e3*w)})]})})},53188:(e,t,n)=>{n.d(t,{A:()=>E});var i=n(84051),o=n(31481),s=n(66644),a=n(90709),r=n(70636),l=n(87357),d=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 Y=n(20021);const k=Number(A.$),P=(0,i.ph)(e=>{let{chat:t,topics:n,renderLastMessage:o,observeIntersection:s,noForumTitle:r}=e;const{openThread:c}=(0,v.ko)(),u=(0,i.li)(),h=(0,i.li)(),m=(0,w.A)(),[p,...g]=(0,i.Kr)(()=>n?(0,a.CO)(Object.values(n),void 0,!0).slice(0,3):[],[n]),[f,A]=(0,i.J0)(!1),[P,F]=(0,i.J0)(void 0),{handleClick:T,handleMouseDown:D}=(0,C.Q)(e=>{0===p.unreadCount||t.isForumAsMessages||(e.stopPropagation(),e.preventDefault(),c({chatId:t.id,threadId:p.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,y.Ny)()}))});return(0,i.vJ)(()=>{const e=u.current,t=h.current;if(!e||!t)return;const n=e.offsetWidth,i=t.offsetWidth;Math.abs(n-i)<k?F(Math.max(n,i)):F(void 0),A(n>i)},[p,o]),(0,Y.FD)("div",{className:(0,l.A)("Ow6Ij9O5",f&&"U_yhhC0w",P&&"HV0wCR4O"),dir:m.isRtl?"rtl":void 0,style:P?`--overwritten-width: ${P}px`:void 0,children:[!r&&(0,Y.FD)(Y.FK,{children:[p&&(0,Y.FD)("div",{className:I,children:[(0,Y.FD)("div",{className:(0,l.A)("lEbV6HrI",p.unreadCount&&S),ref:h,onClick:T,onMouseDown:D,children:[(0,Y.Y)(b.A,{topic:p,observeIntersection:s}),(0,Y.Y)("div",{className:"k3Ch25ZQ",children:(0,d.A)(p.title)}),!P&&f&&(0,Y.Y)("div",{className:M,children:(0,Y.Y)("div",{className:N})})]}),(0,Y.Y)("div",{className:"IkuCBmvA",children:g.map(e=>(0,Y.FD)("div",{className:(0,l.A)("d0hTIVJn",e.unreadCount&&S),children:[(0,Y.Y)(b.A,{topic:e,className:"oknhG11L",observeIntersection:s}),(0,Y.Y)("span",{className:"ZUj3xAjs",children:(0,d.A)(e.title)})]},e.id))}),(0,Y.Y)("div",{className:"_m_2xcPW"})]}),!p&&(0,Y.Y)("div",{className:(0,l.A)(I,"L4Zk0yMN"),children:m("Loading")})]}),(0,Y.FD)("div",{className:(0,l.A)("KJ16dBus",p?.unreadCount&&!r&&S),ref:u,onClick:T,onMouseDown:D,children:[o(),!P&&!f&&(0,Y.Y)("div",{className:M,children:(0,Y.Y)("div",{className:N})})]})]})});var F=n(18276),T=n(18653),D=n(80477);const x=200;function E(e){let{chat:t,topics:n,lastMessage:l,statefulMediaContent:v,chatId:A,typingStatus:y,draft:C,lastMessageTopic:w,lastMessageSender:b,observeIntersection:I,animationType:S,orderDiff:M,withInterfaceAnimations:N,isTopic:k,isSavedDialog:T,isPreview:E,noForumTitle:B}=e;const R=(0,g.A)(),O=(0,i.li)(),U=l?.content.storyData,z=v&&!v.story;(0,p.A)(z?U?.peerId:void 0,U?.id,v?.story);const K=v?.story||l,V=K&&!(0,a.fP)(K),j=(0,m.A)(K),J=V?j:void 0,$=(0,h.A)(K,"micro"),q=(0,f.A)(V?$:void 0),H=Boolean(l&&(0,a.lk)(l)),G=(0,i.hb)(()=>{if(!T&&!E&&y&&l&&y.timestamp>1e3*l.date)return(0,Y.Y)(D.A,{typingStatus:y});const e=C&&C.replyInfo?.replyToMsgId===w?.id,n=C?.replyInfo&&!C.text&&C.isLocal;if(!t?.isForum&&!T&&!E&&C&&!n&&(!k||!e))return(0,Y.FD)("p",{className:"last-message",dir:R.isRtl?"auto":"ltr",children:[(0,Y.Y)("span",{className:"draft",children:R("ChatDraftPrefix")}),(0,Y.Y)("span",{className:"last-message-summary",dir:"auto",children:(0,c.fd)({text:C.text?.text||"",entities:C.text?.entities,asPreview:!0,withTranslucentThumbs:!0})})]});if(!l)return;const i=b?(0,r.Q5)(R,A,b):void 0;return(0,Y.FD)("p",{className:"last-message shared-canvas-container",dir:R.isRtl?"auto":"ltr",children:[i&&(0,Y.FD)(Y.FK,{children:[(0,Y.Y)("span",{className:"sender-name",children:(0,d.A)(i)}),(0,Y.Y)("span",{className:"colon",children:":"})]}),!T&&l.forwardInfo&&(0,Y.Y)(F.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===l.replyInfo?.type&&(0,Y.Y)(F.A,{name:"story-reply",className:"chat-prefix-icon"}),(0,Y.Y)("span",{className:"last-message-summary",dir:"auto",children:L(l,I,q||J,H)})]})},[t,A,C,H,k,R,l,b,w,q,J,I,y,T,E]);return(0,i.Nf)(()=>{const e=O.current;if(N&&e){if(S===u.I.Opacity)e.style.opacity="0",(0,s.RK)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1"});else{if(S!==u.I.Move)return;e.style.transform=`translate3d(0, ${-M*o.yq1}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform=""})}setTimeout(()=>{(0,s.RK)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""})},x+o.xB5)}},[N,M,S]),{renderSubtitle:function(){return t?.isForum&&!k?(0,Y.Y)(P,{chat:t,renderLastMessage:G,observeIntersection:I,topics:n,noForumTitle:B}):G()},ref:O}}function L(e,t,n,i){const o=(0,Y.Y)(T.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return o;const s=(0,a.y2)(e);return(0,Y.FD)("span",{className:"media-preview",children:[(0,Y.Y)("img",{src:n,alt:"",className:(0,l.A)("media-preview--image",i&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,Y.Y)(F.A,{name:"play"}),o]})}},53827:(e,t,n)=>{n.d(t,{_K:()=>f,dj:()=>y,kz:()=>v});var i=n(13439),o=n(89925),s=n(66644),a=n(91048),r=n(96454),l=n(60343),d=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,i.mS)()).audioPlayer.origin||o.d9.Inline,t);if(!s)return;if(!u.has(s))return void(0,i.ko)().openAudioPlayer((0,l.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,i){const o=new Audio;function s(t){return n=>{u.has(e)&&((0,d.f)(o)||u.get(e).handlers.forEach(e=>{e(t,n)}))}}return o.addEventListener("timeupdate",s("onTimeUpdate")),o.addEventListener("play",s("onPlay")),o.addEventListener("pause",s("onPause")),o.addEventListener("loadstart",s("onLoadStart")),o.addEventListener("loadeddata",s("onLoadedData")),o.addEventListener("playing",s("onPlaying")),o.addEventListener("ended",()=>{u.has(e)&&((0,d.f)(o)||g(e))}),{audio:o,type:t,proxy:new Proxy(o,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:i}}(e,t,f,v);u.set(e,n),function(e,t){"audio"!==e.type||p.includes(t)||(p.push(t),p.sort(w)),"voice"!==e.type||m.includes(t)||(m.push(t),m.sort(w))}(n,e)}const{audio:y,proxy:b,handlers:I}=u.get(e);return I.push(n),{play(n){if(!y.paused)return;const s=h&&u.get(h);s&&h!==e&&(s.audio.pause(),s.audio.currentTime=0,(0,d.f)(s.audio)&&(s.audio.dataset.preventPlayAfterPatch="true"),s.onTrackChange&&s.onTrackChange()),h=e,y.src||(y.src=n,y.preload="auto",n.includes("/progressive/")&&r.Yw&&(delete y.dataset.preventPlayAfterPatch,(0,d.C)(y))),(0,c.A)(y),function(e,t){if((0,a.nTw)((0,i.mS)()).globalSearch.currentContent===o.$C.Music)return;const{chatId:n}=(0,l.ES)(C(t).messageKey),s=(0,a.Xf0)((0,i.mS)())?.chatId,r=e=>e.startsWith(`msg${n}`)||s&&e.startsWith(`msg${s}`);"audio"===e&&(p=p.filter(r)),"voice"===e&&(m=m.filter(r))}(t,e)},pause(){h===e&&y.pause()},stop(){if(h===e){const e=y.src;y.pause(),(0,s.Uz)(()=>{y.src="",y.src=e})}},setCurrentTime(t){h===e&&(y.fastSeek?y.fastSeek(t):y.currentTime=t)},setVolume(t){h===e&&(y.volume=t,y.muted=!1)},setPlaybackRate(t){h===e&&(y.playbackRate=t)},toggleMuted(e){y.muted=void 0===e?!y.muted:e},proxy:b,requestNextTrack(){g(e)},isLast:()=>!A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin),isFirst:()=>!A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const i=u.get(e);i&&(i.handlers=i.handlers.filter(e=>e!==n),i.handlers.length||(i.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(m=m.filter(n))}(i,e),e===h&&(h=void 0)))}}}function A(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.d9.Inline,n=arguments.length>2?arguments[2]:void 0;const i=function(e){switch(e.type){case"audio":return p;case"voice":return m;default:return}}(u.get(e));if(!i)return;if(t===o.d9.Search){const t=i.indexOf(e);if(t<0)return;return i[t+(n?-1:1)]}const{chatId:s}=(0,l.ES)(C(e).messageKey),a=i.filter(e=>e.startsWith(`msg${s}`)),r=a.indexOf(e);if(r<0)return;let d=t===o.d9.Inline?-1:1;return n&&(d*=-1),a[r+d]}function y(e){const t=(0,l.AD)(e);if(t)return`${t}-${e.date}`}function C(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function w(e,t){if(!e||!t)return 0;const{date:n,messageKey:i}=C(e),{date:o,messageKey:s}=C(t),a=o-n;return 0===a?s.localeCompare(i):a}},54314:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(13439),s=n(90709),a=n(91048),r=n(9716),l=n(4961),d=n(17712),c=n(59030),u=n(64493),h=n(22337),m=n(21849),p=n(20021);const g=(0,i.ph)((0,o.EK)((e,t)=>{let{chat:n,isSavedDialog:i}=t;const o=(0,r.L8)(n.id),l=(0,a.nZ4)(e,n.id),d=o&&(0,a.mBe)(e,(0,s.e7)(n)),c=d&&(0,s.tv)(d)&&!n.isSupport,u=o&&!l&&!c&&!i,h=o?(0,s.u0)((0,a.mBe)(e,(0,s.e7)(n))):void 0;return{isPrivateChat:o,isChatWithSelf:l,isBot:c,isChannel:(0,s.WX)(n),isBasicGroup:(0,s.yn)(n),isSuperGroup:(0,s.Vs)(n),currentUserId:e.currentUserId,canDeleteForAll:u,contactName:h}})(e=>{let{isOpen:t,chat:n,isSavedDialog:i,isChannel:a,isPrivateChat:r,isChatWithSelf:g,isBot:f,isBasicGroup:v,isSuperGroup:A,currentUserId:y,canDeleteForAll:C,contactName:w,onClose:b,onCloseAnimationEnd:I}=e;const{leaveChannel:S,deleteHistory:M,deleteSavedHistory:N,deleteChannel:Y,deleteChatUser:k,blockUser:P,deleteChat:F}=(0,o.ko)(),T=(0,c.A)(),D=(0,s.Js)(T,n),x=(0,d.A)(()=>{M({chatId:n.id,shouldDeleteForAll:!0}),b()}),E=(0,d.A)(()=>{M({chatId:n.id,shouldDeleteForAll:!0}),P({userId:n.id}),b()}),L=(0,d.A)(()=>{i?N({chatId:n.id}):r?M({chatId:n.id,shouldDeleteForAll:!1}):v?n.isCreator?(M({chatId:n.id,shouldDeleteForAll:!0}),F({chatId:n.id})):(M({chatId:n.id,shouldDeleteForAll:!1}),k({chatId:n.id,userId:y})):!a&&!A||n.isCreator?(a||A)&&n.isCreator&&Y({chatId:n.id}):S({chatId:n.id}),b()}),B=(0,d.A)(()=>{a||A?(S({chatId:n.id}),b()):v&&n.isCreator?(M({chatId:n.id,shouldDeleteForAll:!1}),k({chatId:n.id,userId:y})):L()});return(0,p.FD)(h.A,{isOpen:t,className:"DeleteChatModal",header:(0,p.FD)("div",{className:"modal-header",dir:T.isRtl?"rtl":void 0,children:[(0,p.Y)(m.A,{size:"tiny",peer:n,isSavedMessages:g}),(0,p.Y)("h3",{className:"modal-title",children:T(i?g?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":a&&!n.isCreator?"LeaveChannel":a&&n.isCreator?"ChannelDelete":v||A?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:b,onCloseAnimationEnd:I,children:[i?(0,p.Y)("p",{children:(0,l.A)(g?T("ClearHistoryMyNotesMessage"):T("ClearHistoryMessageSingle",D),["simple_markdown","emoji"])}):a&&n.isCreator?(0,p.Y)("p",{children:(0,l.A)(T("ChatList.DeleteAndLeaveGroupConfirmation",D),["simple_markdown","emoji"])}):a&&!n.isCreator||v||A?(0,p.Y)("p",{children:(0,l.A)(T("ChannelLeaveAlertWithName",D),["simple_markdown","emoji"])}):(0,p.Y)("p",{children:(0,l.A)(T("ChatList.DeleteChatConfirmation",w),["simple_markdown","emoji"])}),(0,p.FD)("div",{className:"dialog-buttons-column",children:[f&&!i&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:T("DeleteAndStop")}),C&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x,children:w?(0,l.A)(T("ChatList.DeleteForEveryone",w)):T("DeleteForAll")}),!r&&n.isCreator&&!i&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:L,children:T("DeleteForAll")}),(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:r||i?L:B,children:T(i?"Delete":a&&!n.isCreator?"LeaveChannel":a&&n.isCreator?"Chat.Input.Delete":v||A?"Group.LeaveGroup":C?"ChatList.DeleteForCurrentUser":"Delete")}),(0,p.Y)(u.A,{className:"confirm-dialog-button",isText:!0,onClick:b,children:T("Cancel")})]})]})}))},54639:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(37661),a=n(17712),r=n(59030),l=n(71429),d=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,i.ph)(e=>{let{icon:t,theme:n}=e;const{isTouchScreen:o}=(0,m.Ay)(),s=(0,p.A)((0,u.mr)(t,"full"),!1,c.qZ.Text),a=(0,i.Kr)(()=>{if(!s)return"";const e="dark"===n?"rgb(170, 170, 170)":"rgb(112, 117, 121)",t=s.replace(v,e),i=(new DOMParser).parseFromString(t,"image/svg+xml");return i.querySelectorAll("path").forEach(t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"}),`data:image/svg+xml;utf8,${i.documentElement.outerHTML}`},[s,n]);return(0,f.Y)("i",{className:(0,h.A)("mklnEg0s","icon",!o&&g),children:(0,f.Y)("img",{src:a,alt:"",className:(0,h.A)("tT8KQwg0",!o&&g),draggable:!1})})}),y=(0,i.ph)(e=>{let{bot:t,theme:n,chatId:c,threadId:u,isInSideMenu:h,canShowNew:m,onMenuOpened:p,onMenuClosed:g}=e;const{callAttachBot:v,toggleAttachBot:y}=(0,o.ko)(),C=(0,r.A)(),w=(0,i.Kr)(()=>t.icons.find(e=>{let{name:t}=e;return"default_static"===t})?.document,[t.icons]),[b,I,S]=(0,s.A)(),[M,N]=(0,i.J0)(void 0),Y=(0,a.A)(e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();N({x:t.right,y:t.bottom}),p(),I()}),k=(0,a.A)(()=>{v(h?{bot:t,isFromSideMenu:!0}:{bot:t,chatId:c,threadId:u})}),P=(0,a.A)(()=>{S(),g()}),F=(0,a.A)(()=>{N(void 0)}),T=(0,a.A)(()=>{y({botId:t.id,isEnabled:!1})});return(0,f.FD)(d.A,{customIcon:w&&(0,f.Y)(A,{icon:w,theme:n}),icon:w?void 0:"bots",onClick:k,onContextMenu:Y,children:[t.shortName,m&&t.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:C("New")}),M&&(0,f.Y)(l.A,{isOpen:b,positionX:"right",style:`left: ${M.x}px;top: ${M.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:P,onCloseAnimationEnd:F,children:(0,f.Y)(d.A,{icon:"stop",destructive:!0,onClick:T,children:C("WebApp.RemoveBot")})})]},t.id)})},54699:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(30857),o=n(32625);function s(e){const t=(0,i.A)();(0,o.A)(t,e,!0)}},55153:(e,t,n)=>{n.d(t,{A:()=>u,L:()=>h});var i=n(31481),o=n(87679),s=n(24909);const a=1280,r=2560,l=40,d=20,c=/\.[^/.]+$/;async function u(e,t,d){const h=URL.createObjectURL(t),{type:p,size:g}=t;let f,v,A,y;const C=d?.shouldSendInHighQuality;if(i.gex.has(p)){const n=await(0,o.NN)(h),{width:g,height:v}=n;y=!m(g,v);const w=C?r:a,b=Math.max(g,v)>w,I=p===i.Vz3;if(!y){if(!d?.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,{...d,compressedBlobUrl:n})}"image/jpeg"===p&&(e=e.replace(c,".jpg")),f={width:g,height:v}}A=Math.max(g,v)>l?await(0,s.s)(h,l/Math.max(g,v),"image/jpeg"):h}else if(i.fNs.has(p)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,o.FW)(h);y=!m(e,t),y||(f={width:e,height:t,duration:n})}catch(e){y=!0}A=await(0,o.eT)(h)}else if(i.IH3.has(p)){const{duration:e,title:t,performer:i,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:i}=await n.e(3246).then(n.bind(n,3246)),s=await(0,o.sZ)(e),a=await t(s),{common:{title:r,artist:l,picture:d},format:{duration:c}}=a,u=i(d),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:l,duration:c,coverUrl:h?URL.createObjectURL(h):void 0}}(h);v={duration:e||0,title:t,performer:i},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()}`,...d}}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)<=d}},55317:(e,t,n)=>{function i(e,t){const{level:n,boosts:i,currentLevelBoosts:o,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,l=t&&i===o&&a;return{currentLevel:l?n-1:n,hasNextLevel:Boolean(s),boosts:i,levelProgress:!s||l?1:(i-o)/(s-o),remainingBoosts:s?s-i:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>i})},55429:(e,t,n)=>{n.d(t,{N:()=>a});var i=n(90709),o=n(70636),s=n(9716);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const l=(0,s.L8)(r)?a[r]:n[r];let d=(0,o.F9)(e,l);const c=n[t.chatId];return c&&("isSelf"in l&&l.isSelf?d=`${e("FromYou")} → ${(0,i.Js)(e,c)}`:(0,i.YE)(c)&&(d+=` → ${(0,i.Js)(e,c)}`)),d}},55723:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(84051),o=n(13439),s=n(90709),a=n(10315),r=n(91525),l=n(17872),d=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,i.ph)(e=>{let{document:t,observeIntersection:n,smaller:S,canAutoLoad:M,autoLoadFileMaxSizeMb:N,uploadProgress:Y,withDate:k,datetime:P,className:F,sender:T,isSelected:D,isSelectable:x,shouldWarnAboutFiles:E,isDownloading:L,message:B,onCancelUpload:R,onMediaClick:O,onDateClick:U}=e;const{cancelMediaDownload:z,downloadMedia:K,setSharedSettingOption:V}=(0,o.ko)(),j=(0,i.li)(),J=(0,y.A)(),[$,q,H]=(0,p.A)(),[G,W]=(0,i.J0)(!1),{fileName:_,size:Q,timestamp:Z,mimeType:X}=t,ee=(0,r.rK)(t)||"",te=(0,g.Vz)(j,n),[ne,ie]=(0,p.A)();(0,i.vJ)(()=>{te&&ie()},[te,ie]);const[oe,se]=(0,i.J0)(M&&(!N||Q<=1048576*N)),ae=Boolean(L||oe&&ne),re=(0,s.mr)(t,"download"),{loadProgress:le,mediaData:de}=(0,A.A)(re,!ae,(0,s.Cz)(t,"download"),void 0,!0),ce=Boolean(de),{isUploading:ue,isTransferring:he,transferProgress:me}=(0,s.LK)(Y||le,ae&&!ce,void 0!==Y),pe=(0,r.ON)(t),ge=pe?(0,s.VD)(t):void 0,fe=pe?t.previewBlobUrl:void 0,ve=(0,v.A)((0,s.mr)(t,"pictogram"),!te),Ae="photo"===t.innerMediaType&&t.mediaSize&&!t.mediaSize.fromDocumentAttribute&&!t.mediaSize.fromPreload,ye=O&&t.innerMediaType&&!Ae;(0,i.vJ)(()=>{const e=j.current;if(!ye||!e||!B)return;const t=()=>{!async function(e){const t=(0,s.Op)(e),n=(0,s.nd)(e),i=t||n,a=n&&n.mediaSize&&!n.mediaSize.fromDocumentAttribute;if(!i||i.previewBlobUrl||a)return;const r=(0,s.mr)(i,"full");if(!r||m.has(r))return;m.set(r,void 0);const p=await(0,h.hd)(r,(0,s.Cz)(i,"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,o.mS)();const v=(0,d.O5q)(f,e.chatId,e.id);v&&v.content.document&&(f=(0,l.r3y)(f,e.chatId,e.id,{content:{...v.content,document:{...v.content.document,mediaSize:g}}}),(0,o.UF)(f))}(B)};return e.addEventListener("mouseenter",t),()=>{e.removeEventListener("mouseenter",t)}},[ye,B]);const Ce=(0,f.A)(()=>{K({media:t,originMessage:B})}),we=(0,f.A)(()=>{ue?R&&R():L?z({media:t}):he?se(!1):ye?O():(0,a.N)({mimeType:X,extension:ee})&&E?q():Ce()}),be=(0,f.A)(()=>{V({shouldWarnAboutFiles:!G}),H(),Ce()}),Ie=(0,f.A)(()=>{U?.(B)});return(0,I.FD)(I.FK,{children:[(0,I.Y)(b.A,{ref:j,name:_,extension:ee,size:Q,timestamp:k?P||Z:void 0,thumbnailDataUri:ge,previewData:fe||ve,smaller:S,isTransferring:he,isUploading:ue,transferProgress:me,className:F,sender:T,isSelectable:x,isSelected:D,actionIcon:ye?(0,s.hr)(t)?"play":"eye":"download",onClick:we,onDateClick:U?Ie:void 0}),(0,I.FD)(w.A,{isOpen:$,onClose:H,confirmHandler:be,children:[J("lng_launch_svg_warning"),(0,I.Y)(C.A,{className:"dialog-checkbox",checked:G,label:J("lng_launch_exe_dont_ask"),onCheck:W})]})]})})},59816:(e,t,n)=>{n.d(t,{A:()=>P});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(87357),l=n(95807),d=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,i.ph)(e=>{let{story:t,mediaArea:n,index:s,className:a,style:d,isPreview:v}=e;const{sendStoryReaction:y}=(0,o.ko)(),C=(0,i.li)(),[w,b]=(0,i.J0)(1.5*h.$),{peerId:I,id:S,views:M}=t,{reactions:N}=M||{},{reaction:Y,isDark:k,isFlipped:P}=n,F=!(0,u.L8)(I),T=`${(0,c.$_)(I,S)}-${s}-${v?"preview":"viewer"}`,D=(0,i.Kr)(()=>N?.find(e=>(0,c.a0)(e.reaction,Y))?.count,[Y,N]),x=!v&&Boolean(D)&&F,E=(0,p.A)(()=>{if(!C.current)return;const e=C.current.clientHeight;b(Math.round(.6*e))});(0,m.A)(e=>{let[t]=e;Boolean(D)!==Boolean(t)&&E()},[D]),(0,g.A)(C,E);const L=(0,p.A)(()=>{y({peerId:I,storyId:S,containerId:T,reaction:Y})});return(0,A.FD)("div",{ref:C,className:(0,r.A)(k?"eic2vQ8c":"_7esBA3m",a),style:(0,l.A)(d,`--custom-emoji-size: ${w}px`),onClick:L,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",P&&"furSXGdL")}),Boolean(w)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",x&&"mFTLUHm2"),reaction:Y,containerId:T,size:w,effectSize:4*w,shouldPause:v,shouldLoop:!v}),x&&(0,A.Y)("span",{className:"Tr8mYyDk",children:D})]})});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,i.ph)((0,o.EK)((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}})(e=>{let{mediaArea:t,className:n,style:o,restrictedEmoji:s,isPreview:d}=e;const c=(0,i.li)(),[u,h]=(0,i.J0)(0),{temperatureC:m,color:f}=t,v=(0,b.Bz)(f),y=(0,b.vG)(f),w=(0,p.A)(e=>{if(!c.current)return;const t=c.current,n=t.clientHeight,i=Math.round(.7*n);h(i);const o=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${i}px`,"font-size":n/32+"rem"})};if(e)return o;(0,a.RK)(o)});return(0,i.Nf)(()=>{(0,a.gm)(()=>w(!0))},[]),(0,g.A)(c,()=>w()),(0,A.Y)("div",{ref:c,className:(0,r.A)("KBjMtRUS",n),style:(0,l.A)(o,`--custom-background-color: ${v}`,`color: ${y}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[s&&(0,A.Y)(S.A,{documentId:s.id,size:u,noPlay:d,withTranslucentThumb:!0,forceAlways:!0},s.id),(0,A.Y)("p",{className:"_ke1UBIl",children:I(m)})]})})})),N=9/16,Y=new Set(["channelPost","uniqueGift"]);function k(e,t){const{x:n,y:i,width:o,height:s,rotation:a,radius:r}=e.coordinates;let d="";if(t&&r&&t>0){const e=t*(o/100),n=t*(s/100);d=Math.min(e,n)*(r/100)+"px"}return(0,l.A)(`left: ${n}%`,`top: ${i}%`,`width: ${o}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,d&&`border-radius: ${d}`)}const P=(0,i.ph)(e=>{let{story:t,isActive:n,className:l,isStoryPlaying:c}=e;const{openMapModal:u,openUniqueGiftBySlug:h,focusMessage:m,closeStoryViewer:p,openUrl:g}=(0,o.ko)(),f=(0,i.li)(),[C,w]=(0,i.J0)(0),b=(0,d.A)();(0,i.vJ)(()=>{if(!f.current)return;const e=f.current;if(w(e.clientWidth),b.width>s.c2m)return void(0,a.RK)(()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")});const t=b.width/b.height,n=t<N?e.clientHeight*N:e.clientWidth,i=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)(()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${i}px`)})},[n,b]);const I=t.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!n&&"_5HkplWee",l),ref:f,children:I?.map((e,i)=>{switch(e.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const t=n&&!Y.has(e.type);return(0,A.Y)("div",{className:(0,r.A)(v,t&&"xFjJpeOA"),style:k(e),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":u({geoPoint:e.geo});break;case"channelPost":m({chatId:e.channelId,messageId:e.messageId}),p();break;case"url":g({url:e.url});break;case"uniqueGift":h({slug:e.slug})}})(e)})}case"suggestedReaction":return(0,A.Y)(y,{story:t,mediaArea:e,index:i,isPreview:!n,className:v,style:k(e)},`${e.type}-${i}`);case"weather":return(0,A.Y)(M,{mediaArea:e,className:v,style:k(e,C),isPreview:!n||c},`${e.type}-${i}`);default:return}})})})},60138:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,i.vJ)(()=>(0,o.yu)(t),[t])}},60406:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(61433),s=n(66644),a=n(37836);const r=(e,t)=>{let{containerRef:n,selector:r}=e;(0,i.Nf)(()=>{const e=n.current?.querySelectorAll(r);if(!e?.length)return;const t=(0,a.nF)(e=>{const t=e.target,n=t.scrollTop>0;(0,s.RK)(()=>{(0,o.dH)(t,"scrolled",n)})},100);return e.forEach(e=>{(0,o.YM)(e,"with-notch"),e.addEventListener("scroll",t,{passive:!0})}),()=>{e.forEach(e=>{e.removeEventListener("scroll",t),(0,o.HW)(e,"with-notch")})}},[n,r,...t]),(0,i.vJ)(()=>{const e=n.current?.querySelectorAll(r);e?.length&&e.forEach(e=>{const t=e.scrollTop>0;(0,s.RK)(()=>{(0,o.dH)(e,"scrolled",t)})})},[n,r,...t])}},61097:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(90709),o=n(84051),s=n(66644),a=n(67054),r=n(87679),l=n(41074),d=n(17712);const c=.1;let u=-1;function h(e,t){return function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,o.li)(),i=(0,o.Kr)(()=>(0,a.A)(l.bP,++u),[]),h=(0,o.li)(),m=(0,d.A)(async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)(()=>{e.width=n.width,e.height=n.height,h.current=e.transferControlToOffscreen();const o=Math.ceil(Math.min(n.width,n.height)*c);(0,l.M1)({name:"offscreen-canvas:blurThumb",args:[h.current,t,o],transferables:[h.current]},i)})});return(0,o.Nf)(()=>{if(!e||t||h.current)return;const i=n.current;i&&m(i,e)},[m,t,e]),n}(e?"string"==typeof e?e:(0,i.VD)(e):void 0,t)}},63744:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(84051),o=n(13439),s=n(91048),a=n(71331),r=n(87357),l=n(14),d=n(59030),c=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,i.ph)((0,o.EK)((e,t)=>{let{chatId:n}=t;const i=(0,s.hds)(e,n),o=(0,a.mD)(e,n);return{groupCall:o,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:i&&i.isCallNotEmpty&&i.isCallActive)}})(e=>{let{chatId:t,isActive:n,className:s,groupCall:a,onPaneStateChange:p}=e;const{requestMasterAndJoinGroupCall:g}=(0,o.ko)(),f=(0,d.A)(),v=(0,i.hb)(()=>{g({chatId:t})},[g,t]),A=a?.participants,y=(0,i.Kr)(()=>{if(!A)return[];const e=(0,o.mS)().users.byId,t=(0,o.mS)().chats.byId;return Object.values(A).slice(0,3).map(n=>{let{id:i}=n;return e[i]||t[i]}).filter(Boolean)},[A]),C=(0,l.A)(a?.participantsCount,!0),w=(0,l.A)(y,!0),b=Boolean(a&&n),{ref:I,shouldRender:S}=(0,c.A)({isOpen:b,onStateChange:p});if(S)return(0,m.FD)("div",{ref:I,className:(0,r.A)("GroupCallTopPane",s),onClick:v,children:[(0,m.FD)("div",{className:"info",children:[(0,m.Y)("span",{className:"title",children:f("VoipGroupVoiceChat")}),(0,m.Y)("span",{className:"participants",children:f("Participants",C??0,"i")})]}),Boolean(w?.length)&&(0,m.Y)(u.A,{size:"small",peers:w,className:"avatars"}),(0,m.Y)(h.A,{round:!0,className:"join",children:f("VoipChatJoin")})]})}))},63988:(e,t,n)=>{n.d(t,{D7:()=>d,aG:()=>r,gs:()=>a,tF:()=>l});var i=n(16581),o=n(83414),s=n(672);function a(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,s.A)(t=>{t(e())},t,n,i)}function r(e,t){const n=a(()=>e(),[e],t,arguments.length>2&&void 0!==arguments[2]&&arguments[2]);return(0,o.A)(n,[n,e],!0)}function l(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,i.A)(t=>{t(e())},t,n,o,s)}function d(e,t){const n=l(()=>e(),[e],t,arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3]);return(0,o.A)(n,[n,e],!0)}},64154:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(37836);const a=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:d,text:c}=r||{};return(0,i.vJ)(()=>{t&&n&&!c&&void 0===d&&s&&function(e,t,n){const i=a.get(n)||new Map,s=i.get(e)||[];s.includes(t)||(s.push(t),i.set(e,s),a.set(n,i),(0,o.ko)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),l()}(t,n,s)},[t,c,d,n,s]),t&&n?{isPending:d,translatedText:c}:{isPending:!1,translatedText:void 0}}const l=(0,s.nF)(function(){const{translateMessages:e}=(0,o.ko)();let t=!1;a.forEach((n,i)=>{n.forEach((n,o)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:o,messageIds:s,toLanguageCode:i}),function(e,t,n){const i=a.get(n);if(!i?.size)return void a.delete(n);const o=i.get(e);if(!o?.length)return void i.delete(e);const s=o.filter(e=>!t.includes(e));if(!s?.length)return i.delete(e),void(i.size||a.delete(n));i.set(e,s)}(o,s,i)})}),t&&l()},500)},65240:(e,t,n)=>{n.d(t,{Ay:()=>B});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(90709),l=n(91048),d=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),Y=n(35913),k=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,i,o,s,a,r,l,d,c){const{title:u,performer:h,fileName:p}=t,v=i||o>0&&o<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*o,n)}),L(o,s,a)]}),!v&&r&&(0,F.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[d?`${(0,g.zV)(t.size*d)} / `: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(l)&&(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*l,!0)})]})]})]})}function E(e,t,n,i,o,s,r,l,d,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:()=>{(l||d)&&h?h(!r):s||c()},children:[(0,F.Y)(P.A,{name:l||d?"down":"transcribe",className:(0,u.A)("transcribe-icon",(l||d)&&!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&&o&&"unread"),dir:"auto",children:0===i||1===i?(0,m.QO)(e.duration):(0,m.QO)(e.duration*i)})]})}function L(e,t,n){return(0,F.FD)("div",{className:"seekline",ref:n,children:[t.map(e=>{let{start:t,end:n}=e;return(0,F.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*t}%; right: ${100-100*n}%`})}),(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,i.ph)((0,o.EK)((e,t)=>{let{message:n}=t;return{webPage:(0,l.Pn$)(e,n),mediaDuration:(0,d.Y9)(e,n)}})(e=>{let{theme:t,message:n,senderTitle:l,uploadProgress:d,origin:g,date:B,noAvatars:R,className:O,isSelectable:U,isSelected:z,isDownloading:K,isTranscribing:V,isTranscriptionHidden:j,isTranscribed:J,isTranscriptionError:$,canDownload:q,canTranscribe:H,autoPlay:G,webPage:W,mediaDuration:_,onHideTranscription:Q,onPlay:Z,onPause:X,onReadMedia:ee,onCancelUpload:te,onDateClick:ne}=e;const{cancelMediaDownload:ie,downloadMedia:oe,transcribeAudio:se,openOneTimeMediaModal:ae}=(0,o.ko)(),{content:{audio:re,voice:le,video:de},isMediaUnread:ce}=n,ue=re||(0,r.y3)(W),he=le||de||ue,me=le||de,pe=Boolean(le||de),ge=(0,i.li)(!1),fe=(0,i.li)(),ve=(0,I.A)(),{isRtl:Ae}=ve,{isMobile:ye}=(0,v.Ay)(),[Ce,we]=(0,i.J0)(!1),be=Ce||!0,Ie=(0,r.VO)(he,"pictogram"),Se=(0,w.A)(Ie,!1,s.qZ.BlobUrl),Me=(0,r.G5)(n),Ne=g===a.d9.OneTimeModal,Ye=pe?Me?"oneTimeVoice":"voice":"audio",ke=(0,w.A)((0,r.VO)(he,"inline"),!be,(0,r.Cz)(he,"inline")),{loadProgress:Pe}=(0,b.A)((0,r.VO)(he,"download"),!K,(0,r.Cz)(he,"download")),Fe=(0,C.A)(()=>{we(!0),Z?.(n.id,n.chatId)}),Te=(0,C.A)(()=>{we(!1)}),{isBuffered:De,bufferedRanges:xe,bufferingHandlers:Ee,checkBuffering:Le}=(0,y.A)(),Be=Ne,{isPlaying:Re,playProgress:Oe,playPause:Ue,setCurrentTime:ze,duration:Ke}=(0,A.A)((0,c.dj)(n),_,Ye,ke,Ee,void 0,Le,Boolean(Ce||G),Fe,Te,(0,r.Nb)(n)||Me,void 0,X,Be,Me&&!Ne),Ve=1-Oe,je=(0,r.Ie)(n),Je=Me&&Ne,$e=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]&&arguments[6];const l=(0,i.li)(),{data:d,peak:c}=(0,i.Kr)(()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:i,MAX_SPIKES:o}=function(e,t){return{MIN_SPIKES:e?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),l=Math.round(i+(o-i)*r);return function(e,t){let n=0;const i=new Array(t),o=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*o),l=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;i[r]=l,n<l&&(n=l)}return{data:i,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const i=Array(n),o=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=o[t]+(o[t+1]<<8);i[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=o[s]+(o[s+1]<<8);return i[n-1]=r>>a&31,i}(new Uint8Array(e)),l)},[a,t,s])||{};return(0,i.Nf)(()=>{const t=l.current;t&&d&&void 0!==c&&function(e,t,n,i){let{peak:o,fillStyle:s,progressFillStyle:a}=i;const r=4*t.length;e.width=2*r,e.height=46,e.style.width=`${r}px`,e.style.height="23px";const l=e.getContext("2d");l.scale(2,2),t.forEach((e,i)=>{l.globalAlpha=i/t.length>=n?.5:1,l.fillStyle=n>i/t.length?a:s;const r=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,i,o,s){2<2*s&&(s=1),o<2*s&&(s=o/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-o,s),e.arcTo(t+2,n-o,t,n-o,s),e.arcTo(t,n-o,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(l,4*i,(23+r)/2,0,r,1),l.fill()})}(t,d,r?1-n:n,{peak:c,fillStyle:o?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:o?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})},[o,c,n,d,e,r]),l}(t,me,!ce||je||Je?Oe:1,je,!R,ye,Je),qe=Re||Oe>0&&Oe<1;(0,i.vJ)(()=>{we(Re)},[Re]);const He=Ce&&!De,{isUploading:Ge,isTransferring:We,transferProgress:_e}=(0,r.LK)(d||Pe,He||K,void 0!==d),{shouldRender:Qe,transitionClassNames:Ze}=(0,S.A)(We),Xe=Qe&&(He||Ge),et=(0,C.A)(()=>{if(Ge)te?.();else{if(Me)return ae({message:n}),void ee?.();Re||Z?.(n.id,n.chatId),(0,o.ko)().setAudioPlayerOrigin({origin:g}),we(!Ce),Ue()}});(0,i.vJ)(()=>{ee&&ce&&Re&&ee()},[Re,ce,ee]);const tt=(0,C.A)(()=>{K?ie({media:he}):oe({media:he,originMessage:n})}),nt=(0,C.A)(e=>{if(ge.current&&fe.current){const{width:t,left:n}=fe.current.getBoundingClientRect(),i=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),ze(Math.max(Math.min(Ke*((i-n)/t),Ke-.1),.001))}}),it=(0,C.A)(e=>{e instanceof MouseEvent&&2===e.button||(ge.current=!0,nt(e))}),ot=(0,C.A)(()=>{ge.current=!1}),st=(0,C.A)(()=>{ne(n)}),at=(0,C.A)(()=>{se({chatId:n.chatId,messageId:n.id})});function rt(){if(pe)return l||"Voice";const{title:e,fileName:t}=ue;return e||t}function lt(){if(pe)return(0,F.Y)("div",{className:"meta",dir:Ae?"rtl":void 0,children:(0,m.QO)((le||de).duration)});const{performer:e}=ue;return(0,F.FD)("div",{className:"meta",dir:Ae?"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&&l&&(0,F.Y)("span",{className:"bullet",children:"•"}),l&&(0,F.Y)("span",{title:l,children:(0,f.A)(l)})]})}(0,i.vJ)(()=>{if(fe.current&&qe&&!Ne)return(0,h.wJ)(fe.current,{onCapture:it,onRelease:ot,onClick:ot,onDrag:nt})},[qe,it,nt,ot,Ne]);const dt=(0,u.A)("Audio",O,Ne&&"non-interactive",g===a.d9.Inline&&"inline",je&&g===a.d9.Inline&&"own",(g===a.d9.Search||g===a.d9.SharedMedia)&&"bigger",z&&"audio-is-selected"),ct=["toogle-play-wrapper"];Xe?ct.push("loading"):ct.push(Re?"pause":"play");const ut=(0,u.A)("content",qe&&"with-seekline");function ht(){return(0,F.FD)("div",{className:ut,children:[(0,F.FD)("div",{className:"content-row",children:[(0,F.Y)("p",{className:"title",dir:"auto",title:rt(),children:(0,f.A)(rt())}),(0,F.Y)("div",{className:"message-date",children:Boolean(B)&&(0,F.Y)(N.A,{className:"date",onClick:st,children:(0,m.be)(ve,1e3*B)})})]}),qe&&(0,F.FD)("div",{className:"meta search-result",dir:Ae?"rtl":void 0,children:[(0,F.Y)("span",{className:"duration with-seekline",dir:"auto",children:Oe<1&&(0,m.QO)(Ke*Oe,Ke)}),L(Oe,xe,fe)]}),!qe&<()]})}return(0,F.FD)("div",{className:dt,dir:ve.isRtl?"rtl":"ltr",children:[U&&(0,F.Y)("div",{className:"message-select-control no-selection",children:z&&(0,F.Y)(P.A,{name:"select"})}),(0,F.FD)("div",{className:(0,u.A)(...ct),children:[(0,F.FD)(M.A,{round:!0,ripple:!ye,size:"smaller",className:"toggle-play",color:Se?"translucent-white":"primary",ariaLabel:Re?"Pause audio":"Play audio",onClick:et,isRtl:ve.isRtl,backgroundImage:Se,nonInteractive:Ne,children:[!Ne&&(0,F.Y)(P.A,{name:"play"}),!Ne&&(0,F.Y)(P.A,{name:"pause"}),Ne&&(0,F.Y)(k.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Me&&!Ne&&(0,F.Y)(P.A,{name:"view-once"})]}),Qe&&(0,F.Y)("div",{className:(0,u.A)("media-loading",Ze,Xe&&"interactive"),children:(0,F.Y)(Y.A,{progress:_e,transparent:!0,withColor:!0,size:"m",onClick:Xe?et:void 0,noCross:!Xe})}),Ne&&!Qe&&(0,F.Y)("div",{className:(0,u.A)("media-loading"),children:(0,F.Y)(Y.A,{progress:Oe,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ue&&q&&!Ge&&(0,F.Y)(M.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:K?"Cancel download":"Download",onClick:tt,children:(0,F.Y)(P.A,{name:K?"close":"arrow-down"})}),g===a.d9.Search&&ht(),g!==a.d9.Search&&ue&&x(ve,ue,Ke,Re,Oe,xe,fe,K||Ge,B,_e,ne?st:void 0),g===a.d9.SharedMedia&&me&&ht(),(g===a.d9.Inline||Ne||J)&&me&&E(me,fe,$e,Me?Ve:Oe,ce,V,j,J,$,H?at:void 0,Q,g)]})}))},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991:(e,t,n)=>{n.d(t,{Y:()=>u,c:()=>h});var i=n(84051),o=n(31481),s=n(66644),a=n(19822),r=n(39761),l=n(96454),d=n(95704);const c=100;function u(e,t,n){return(0,i.vJ)(()=>{if(!t||!e.current)return;const i=g(),o=e.current;if(!l.Yw||!n||!i?.isTypeSupported(n))return;const u=new i;function h(){if(!t||!n)return;const e=u.addSourceBuffer(n),i=(0,d.h)(t);e.addEventListener("updateend",function(){i.next().then(t=>{let{value:n,done:i}=t;"open"===u.readyState&&(i?p(u):m(e,n))})}),i.next().then(t=>{let{value:n,done:i}=t;i||"open"!==u.readyState||((0,s.RK)(()=>{o.style.display="block",setTimeout(()=>{(0,s.RK)(()=>{(0,a.ZM)(o,{opacity:"1"})})},c)}),m(e,n))})}return u.addEventListener("sourceopen",h,{once:!0}),(0,s.RK)(()=>{(0,a.ZM)(o,{display:"none",opacity:"0"}),o.src=URL.createObjectURL(u)}),()=>{(0,s.RK)(()=>{const e=o.src;(0,r.A)(o),u.removeEventListener("sourceopen",h),"open"===u.readyState&&p(u),URL.revokeObjectURL(e)})}},[n,t,e]),h(n)}function h(e){return!(!l.Yw||!e)&&Boolean(g()?.isTypeSupported(e))}function m(e,t){try{e.appendBuffer(t)}catch(e){o.Oig&&console.warn("[Stream] failed to append buffer",e)}}function p(e){try{e.endOfStream()}catch(e){o.Oig&&console.warn("[Stream] failed to end stream",e)}}function g(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},67054:(e,t,n)=>{function i(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>i})},68153:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},69419:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(84051),o=n(23174),s=n(91048),a=n(96454),r=n(58554),l=n(37836),d=n(63527),c=n(30857),u=n(14745);const h=.75,m=1500,p=500;function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.qZ.BlobUrl,g=arguments.length>3?arguments[3]:void 0,f=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const v=a.Uz&&n===o.qZ.Progressive,A=e?v?r.RB(e):r.Ih(e):void 0,y=(0,c.A)(),C=(0,d.A)(s.nIz),w=(0,u.A)(),[b,I]=(0,i.J0)(A&&!v?1:0),S=(0,i.li)(),M=(0,i.Kr)(()=>(0,l.nF)(e=>{S.current&&(!g||Date.now()-S.current>g)&&I(e)},p,!0),[g]);return(0,i.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,i.vJ)(()=>{t&&S.current&&(r.ch(M),I(0),S.current=void 0)},[M,t]),(0,i.vJ)(()=>()=>{e&&r.Cn(e,w)},[w,e]),{mediaData:A,loadProgress:b}}},70195:(e,t,n)=>{n.d(t,{A:()=>q});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(91048),l=n(30708),d=n(96454),c=n(87357),u=n(50442),h=n(79824),m=n(31460),p=n(4961),g=n(54699),f=n(39351),v=n(17712),A=n(59030),y=n(73767),C=n(23174),w=n(58554),b=n(41036),I=n(21849),S=n(34431),M=n(18276),N=n(9716),Y=n(14242),k=n(35049),P=n(43874),F=n(45470),T=n(37661),D=n(62587),x=n(83057),E=n(65843),L=n(57474),B=n(20021);const R=(0,i.ph)(e=>{let{chat:t,user:n,photo:o,isSavedMessages:s,isSavedDialog:r,canPlayVideo:l,onClick:u}=e;const h=(0,i.li)(),m=(0,A.A)(),{isMobile:g}=(0,P.Ay)(),f=n&&(0,a.PL)(n),v=t&&(0,a.kE)(t.id),y=t&&(0,a.Qe)(t.id),C=n||t,w=C&&!s&&!f&&!v&&!y,{isVideo:b}=o||{},I=(!o||o.id===C.avatarPhotoId)&&(0,a.cP)(C,"normal"),S=w&&o&&!I&&(0,a.rI)(o,"pictogram"),R=(0,D.A)(S||I),O=w&&o&&!b&&(0,a.mU)(o),U=(0,D.A)(O),z=w&&o&&b&&(0,a.Pg)(o),K=(0,D.A)(z)||U,[V,j]=(0,T.A)(),J=Boolean(K&&(!b||V)),$=(0,x.A)(J),q=w&&!J&&!R&&o?.thumbnail?.dataUri,H=(0,F.A)(o?.thumbnail?.dataUri,!q,g&&!d.QH),G=o||R||q;(0,i.vJ)(()=>{h.current&&!l&&(h.current.currentTime=0)},[l]);const W=(0,i.Kr)(()=>s?r?"my-notes":"avatar-saved-messages":f?"avatar-deleted-account":v?"reply-filled":y?"author-hidden":void 0,[y,f,r,v,s]);let _;if(W)_=(0,B.Y)(M.A,{name:W,role:"img"});else if(G)_=(0,B.FD)(B.FK,{children:[q?(0,B.Y)("canvas",{ref:H,className:"thumb"}):(0,B.Y)("img",{src:R,draggable:!1,className:"thumb",alt:""}),o&&(b?(0,B.Y)(E.A,{canPlay:l,ref:h,src:K,className:(0,c.A)("avatar-media",$),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:j}):(0,B.Y)("img",{src:K,className:(0,c.A)("avatar-media",$),alt:""}))]});else if(n){const e=(0,a.Yg)(n);_=e?(0,Y.Qh)(e,2):void 0}else if(t){const e=(0,a.Js)(m,t);_=e&&(0,Y.Qh)(e,(0,N.L8)(t.id)?2:1)}else _=(0,B.Y)("div",{className:"spinner-wrapper",children:(0,B.Y)(L.A,{color:"white"})});const Q=(0,c.A)("ProfilePhoto",(0,k.y)(C),s&&"saved-messages",y&&"anonymous-forwards",f&&"deleted-account",v&&"replies-bot-account",!s&&!G&&"no-photo");return(0,B.Y)("div",{className:Q,onClick:G?u:void 0,children:"string"==typeof _?(0,p.A)(_,["hq_emoji"]):_})});var O=n(38102);const U="Wm9Ygb23",z="nflKKT3R",K="tFkRrvxe",V="GBGLnrA7",j="ZZRcBh8v",J="cpyXyZDl",$="dco9YF7C",q=(0,i.ph)((0,o.EK)((e,t)=>{let{peerId:n}=t;const i=(0,r.mBe)(e,n),o=i?(0,r.vGo)(e,n):void 0,s=(0,r.K0y)(e,n),a=(0,r.hds)(e,n),d=(0,r.IVq)(e,n),{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,n,m):void 0,{animationLevel:g}=(0,l.l)(e),f=(i||a)?.emojiStatus;return{user:i,userFullInfo:o,userStatus:s,chat:a,mediaIndex:c,avatarOwnerId:u,animationLevel:g,emojiStatusSticker:f?(0,r.O8F)(e,f.documentId):void 0,emojiStatusSlug:"collectible"===f?.type?f.slug:void 0,profilePhotos:d,topic:p,messagesCount:p?(0,r.QbG)(e,n,m):void 0}})(e=>{let{forceShowSelf:t,canPlayVideo:n,user:r,userFullInfo:l,userStatus:N,chat:Y,mediaIndex:k,avatarOwnerId:P,topic:F,messagesCount:T,animationLevel:D,emojiStatusSticker:x,emojiStatusSlug:E,profilePhotos:L,peerId:q,isForMonoforum:H}=e;const{openMediaViewer:G,openPremiumModal:W,openStickerSet:_,openPrivacySettingsNoticeModal:Q,loadMoreProfilePhotos:Z,openUniqueGiftBySlug:X,openProfileRatingModal:ee}=(0,o.ko)(),te=(0,A.A)(),ne=(0,f.A)();(0,g.A)(r?6e4:void 0);const ie=L?.photos||h.p,oe=(0,y.A)(k),se=(0,y.A)(P),[ae,re]=(0,i.J0)(!0),[le,de]=(0,i.J0)(0),ce=ie.length<=1||0===le,ue=ie.length<=1||le===ie.length-1;(0,i.vJ)(()=>{ie.length-le<=3&&Z({peerId:q})},[le,q,ie.length]),(0,i.vJ)(()=>{se&&void 0!==oe&&void 0===k&&(re(!1),de(oe))},[k,oe,se]),(0,i.vJ)(()=>{le>ie.length&&(re(!1),de(Math.max(0,ie.length-1)))},[le,ie.length]),function(e,t){(0,i.vJ)(()=>{e.slice(t,t+4).forEach(e=>{const t=(0,a.mU)(e);w.Ih(t)||w.hd(t,C.qZ.BlobUrl)})},[t,e])}(ie,le);const he=(0,v.A)(()=>{G({isAvatarView:!0,chatId:q,mediaIndex:le,origin:t?s.TQ.SettingsAvatar:s.TQ.ProfileAvatar})}),me=(0,v.A)(()=>{E?X({slug:E}):q?W({fromUserId:q}):_({stickerSetInfo:x.stickerSetInfo})}),pe=(0,v.A)(()=>{ce||(re(!0),de(le-1))}),ge=(0,v.A)(()=>{ue||(re(!0),de(le+1))}),fe=(0,v.A)(()=>{Q({chatId:Y.id,isReadDate:!1})}),ve=(0,v.A)(e=>{r&&ee({userId:r.id,level:e})});if((0,i.vJ)(()=>{const e=document.querySelector(`.${V}`);if(e)return(0,u.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:d.TF?(e,t)=>t===u.ez.Right?(pe(),!0):t===u.ez.Left&&(ge(),!0):void 0})},[ge,pe]),r||Y)return F?(0,B.FD)("div",{className:"yzg267rr",children:[(0,B.Y)(O.A,{topic:F,size:120,className:"ZCxp0_t4",letterClassName:"lkfZNWOm",noLoopLimit:!0}),(0,B.Y)("h3",{className:"umOuiu3K",dir:te.isRtl?"rtl":void 0,children:(0,p.A)(F.title)}),(0,B.Y)("p",{className:"tLTzQ2ks",children:T?te("Chat.Title.Topic",T,"i"):te("lng_forum_no_messages")})]}):(0,B.FD)("div",{className:(0,c.A)("ProfileInfo"),dir:te.isRtl?"rtl":void 0,children:[(0,B.FD)("div",{className:V,children:[function(){const e=Math.max(ie.length,L?.count||0);if(!ie||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=le>=30?29:le;return(0,B.Y)("div",{className:"uyvKpR3B",children:t.map((e,t)=>(0,B.Y)("span",{className:(0,c.A)("wB4yjvei",t===n&&"aZmp9FLh")}))})}(),!t&&L?.personalPhoto&&(0,B.Y)("div",{className:(0,c.A)(U,ce&&K),children:(0,B.Y)("div",{className:z,children:te(L.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),t&&L?.fallbackPhoto&&(0,B.Y)("div",{className:(0,c.A)(U,(ce||ue)&&K),children:(0,B.FD)("div",{className:z,onClick:function(){ce&&(re(!0),de(ie.length-1))},children:[!ue&&(0,B.Y)(I.A,{photo:L.fallbackPhoto,className:"R7w3H5eC",size:"mini"}),te(L.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,B.Y)(b.Ay,{activeKey:le,name:(0,m.P)("slide",D,!ae,te.isRtl),children:function(e){const t=ie.length>0?ie[le]:void 0;return(0,B.Y)(R,{user:r,chat:Y,photo:t,canPlayVideo:Boolean(e&&n),onClick:he},le)}}),!ce&&(0,B.Y)("button",{type:"button",dir:te.isRtl?"rtl":void 0,className:(0,c.A)(j,"RQITz4WQ"),"aria-label":te("AccDescrPrevious"),onClick:pe}),!ue&&(0,B.Y)("button",{type:"button",dir:te.isRtl?"rtl":void 0,className:(0,c.A)(j,"_0F1Txru"),"aria-label":te("Next"),onClick:ge})]}),(0,B.FD)("div",{className:"UcyW7tVh",dir:te.isRtl?"rtl":"auto",children:[(r||Y)&&(0,B.Y)(S.A,{peer:r||Y,withEmojiStatus:!0,emojiStatusSize:24,onEmojiStatusClick:me,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,a.Qe)(q),t=(0,a.DX)(q);if(!e&&!t)return H?(0,B.Y)("span",{className:(0,c.A)(J,"status"),dir:"auto",children:ne("MonoforumStatus")}):r?(0,B.FD)("div",{className:(0,c.A)(J,"status",(0,a.PF)(r,N)&&"online"),children:[Ae(),(0,B.Y)("span",{className:"jwNQ18lU",dir:"auto",children:(0,a.CD)(te,r,N)}),N?.isReadDateRestrictedByMe&&(0,B.Y)("span",{className:"xzCgzBx8",onClick:fe,children:(0,B.Y)("span",{children:te("StatusHiddenShow")})})]}):(0,B.Y)("span",{className:(0,c.A)(J,"status"),dir:"auto",children:(0,a.WX)(Y)?te("Subscribers",Y.membersCount??0,"i"):te("Members",Y.membersCount??0,"i")})}()]})]});function Ae(){if(!l?.starsRating)return;const e=l.starsRating.level,t=()=>ve(e);if(e<0)return(0,B.FD)("span",{className:"_1NuEm_bF",onClick:t,children:[(0,B.Y)(M.A,{name:"rating-icons-negative",className:"MwbjmAph"}),(0,B.Y)("span",{className:$,children:"!"})]});const n=Math.max(e,1),i=Math.min(n,90),o=i<10?`rating-icons-level${i}`:"rating-icons-level"+10*Math.floor(i/10);return(0,B.FD)("span",{className:"Ura8xDvW",onClick:t,children:[(0,B.Y)(M.A,{name:o,className:"lks6uKRt"}),(0,B.Y)("span",{className:$,children:e})]})}}))},71331:(e,t,n)=>{n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>c,mD:()=>a,n5:()=>l,qI:()=>d,uu:()=>u});var i=n(90709),o=n(21133),s=n(19926);function a(e,t){const n=(0,o.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function l(e,t,n){return r(e,t)?.participants[n]}function d(e){const t=c(e)?.chatId;if(!t)return!1;const n=(0,o.hd)(e,t);return!!n&&((0,i.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function 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 i=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,i)}function h(e){const t=c(e);if(!t||!t.chatId)return!1;const n=(0,o.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,i.Kl)(n)))return!0;const s=(0,o.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(87357),s=n(17663),a=n(14242),r=n(39351),l=n(59030),d=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,i.ph)(e=>{let{title:t,type:n,statistics:i,isToncoin:y,className:C,subtitle:w}=e;const b=(0,l.A)(),I=(0,r.A)(),S=e=>{let{change:t,percentage:n}=e;if(!t)return;const i=Number(t)<0;return(0,m.FD)("span",{className:(0,o.A)("idLrmbhS",i&&"SLfwGHQC"),children:[i?`-${(0,a.Vw)(I,Math.abs(t))}`:`+${(0,a.Vw)(I,t)}`,n&&(0,m.FD)(m.FK,{children:[" ","(",n,"%)"]})]})},M=(e,t,n)=>{const[i,o]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,m.FD)("div",{children:[(0,m.Y)(d.A,{className:"it39BC_c",name:"toncoin"}),(0,m.FD)("b",{className:h,children:[i,(0,m.FD)("span",{className:"ZAfXkuWL",children:[".",o]})]})," ",(0,m.FD)("span",{className:u,children:["≈ $",s,(0,m.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,m.Y)("h3",{className:u,children:b(n)})]})},{period:N}=i,{balances:Y,usdRate:k}=i,P=function(e){switch(e){case"group":return g;case"message":return f;case"boost":return A;case"story":return v;default:return p}}(n);return(0,m.FD)("div",{className:(0,o.A)("Gi8Nokbl",C),children:[(0,m.FD)("div",{className:"H01lE7mv",children:[t&&(0,m.Y)("div",{className:"VQbs04hT",children:t}),N&&(0,m.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(b,1e3*N.minDate)," ","—",(0,s.Lu)(b,1e3*N.maxDate)]})]}),(0,m.Y)("table",{className:"s5beXqqL",children:y?(0,m.Y)("tr",{children:(0,m.FD)("td",{className:c,children:[M(Y?.availableBalance||0,k||0,"lng_channel_earn_available"),M(Y?.currentBalance||0,k||0,"lng_channel_earn_reward"),M(Y?.overallRevenue||0,k||0,"lng_channel_earn_total")]})}):P.map(e=>(0,m.Y)("tr",{children:e.map(e=>{const t=i?.[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:b(e.title)})]});if(e.isPercentage){const n=t?.part??0,i=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:[i,"%"]}),(0,m.Y)("h3",{className:u,children:b(e.title)})]})}return(0,m.FD)("td",{className:c,children:[(0,m.Y)("b",{className:h,children:(0,a.Vw)(I,t?.current??0)})," ",S(t),(0,m.Y)("h3",{className:u,children:b(e.title)})]})})}))}),w]})})},72078:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},73172:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,i.Kr)(()=>(0,a.nF)(n=>{e&&t&&(0,o.ko)().sendMessageAction({chatId:e,threadId:t,action:n})},s.cqp),[e,t])},75319:(e,t,n)=>{function i(e){return"object"==typeof e&&null!==e&&"graphType"in e}n.d(t,{R:()=>i})},75343:(e,t,n)=>{n.d(t,{A:()=>b});var i=n(84051),o=n(13439),s=n(87357),a=n(43874),r=n(36838),l=n(59030),d=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,i.ph)(function(e){let{peer:t,isArchived:n}=e;const{openChat:a,openChatWithInfo:r,openStoryViewer:w,toggleStoriesHidden:b}=(0,o.ko)(),I=(0,l.A)(),S=(0,i.li)(),M="isSelf"in t&&t.isSelf,N=!(0,u.L8)(t.id);(0,g.A)(t.id);const{isContextMenuOpen:Y,contextMenuAnchor:k,handleBeforeContextMenu:P,handleContextMenu:F,handleContextMenuClose:T,handleContextMenuHide:D}=(0,m.A)(S),x=(0,p.A)(()=>S.current),E=(0,p.A)(()=>document.body),L=(0,p.A)(()=>S.current.querySelector(".story-peer-context-menu .bubble")),B=(0,p.A)(()=>({withPortal:!0,isDense:!0})),R=(0,p.A)(()=>{Y||w({peerId:t.id,origin:d.G9.StoryRibbon})}),O=(0,p.A)(e=>{(0,h.u)(e),P(e)}),U=(0,p.A)(()=>{r({id:t.id,shouldReplaceHistory:!0,profileTab:"stories"})}),z=(0,p.A)(()=>{r({id:t.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})}),K=(0,p.A)(()=>{a({id:t.id,shouldReplaceHistory:!0})}),V=(0,p.A)(()=>{r({id:t.id,shouldReplaceHistory:!0})}),j=(0,p.A)(()=>{b({peerId:t.id,isHidden:!n})});return(0,C.FD)("div",{ref:S,role:"button","data-peer-id":t.id,tabIndex:0,className:y.A.peer,onMouseDown:O,onClick:R,onContextMenu:F,children:[(0,C.Y)(f.A,{peer:t,withStory:!0,storyViewerOrigin:d.G9.StoryRibbon,storyViewerMode:"full"}),(0,C.Y)("div",{className:(0,s.A)(y.A.name,t.hasUnreadStories&&y.A.name_hasUnreadStory),children:M?I("MyStory"):(0,c.F9)(I,t)}),void 0!==k&&(0,C.Y)(v.A,{isOpen:Y,anchor:k,getTriggerElement:x,getRootElement:E,getMenuElement:L,getLayout:B,className:(0,s.A)("story-peer-context-menu",y.A.contextMenu),autoClose:!0,withPortal:!0,onClose:T,onCloseAnimationEnd:D,children:M?(0,C.FD)(C.FK,{children:[(0,C.Y)(A.A,{onClick:U,icon:"play-story",children:I("StoryList.Context.SavedStories")}),(0,C.Y)(A.A,{onClick:z,icon:"archive",children:I("StoryList.Context.ArchivedStories")})]}):(0,C.FD)(C.FK,{children:[!N&&(0,C.Y)(A.A,{onClick:K,icon:"message",children:I("SendMessageTitle")}),N?(0,C.Y)(A.A,{onClick:V,icon:"channel",children:I("ChatList.ContextOpenChannel")}):(0,C.Y)(A.A,{onClick:V,icon:"user",children:I("StoryList.Context.ViewProfile")}),(0,C.Y)(A.A,{onClick:j,icon:n?"unarchive":"archive",children:I(n?"StoryList.Context.Unarchive":"StoryList.Context.Archive")})]})})]})}),b=(0,i.ph)((0,o.EK)((e,t)=>{let{isArchived:n}=t;const{orderedPeerIds:{active:i,archived:o}}=e.stories;return{orderedPeerIds:n?o:i,usersById:e.users.byId,chatsById:e.chats.byId}})(function(e){let{isArchived:t,className:n,orderedPeerIds:o,usersById:d,chatsById:c,isClosing:u}=e;const h=(0,l.A)(),m=(0,s.A)(y.A.root,!o.length&&y.A.hidden,u&&y.A.closing,n,"no-scrollbar"),p=(0,i.li)();return(0,r.A)(p,(0,a.Ny)()),(0,C.Y)("div",{ref:p,id:"StoryRibbon",className:m,dir:h.isRtl?"rtl":void 0,children:o.map(e=>{const n=d[e]||c[e];if(n)return(0,C.Y)(w,{peer:n,isArchived:t},e)})})}))},78407:(e,t,n)=>{n.d(t,{A:()=>W});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(91048),l=n(30708),d=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 i=this.video,{width:o,height:s}=this.container.getBoundingClientRect();(0,a.RK)(()=>{i.style.left=`${Math.round(t*o)}px`,i.style.top=`${Math.round(n*s)}px`,i.style.width=`${e}px`,i.style.height=`${e}px`})})}}var Y=n(60261),k=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),z=n(64493),K=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,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,threadId:i}=t;const{messageSendKeyCombo:o}=(0,l.l)(e);return{messageSendKeyCombo:o,replyInfo:n&&i?(0,r.GA4)(e,n,i)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}})(e=>{let{ref:t,id:n,chatId:l,captionLimit:M,isAttachmentModalInput:F,isStoryInput:V,customEmojiPrefix:j,editableInputId:W,isReady:_,isActive:Q,getHtml:Z,placeholder:X,timedPlaceholderLangKey:ee,timedPlaceholderDate:te,forcedPlaceholder:ne,canSendPlainText:ie,canAutoFocus:oe,noFocusInterception:se,shouldSuppressFocus:ae,shouldSuppressTextFormatter:re,replyInfo:le,isSelectModeActive:de,canPlayAnimatedEmojis:ce,messageSendKeyCombo:ue,onUpdate:he,onSuppressedFocus:me,onSend:pe,onScroll:ge,onFocus:fe,onBlur:ve,isNeedPremium:Ae,messageListType:ye}=e;const{editLastMessage:Ce,replyToNextMessage:we,showAllowedMessageTypesNotification:be,openPremiumModal:Ie}=(0,o.ko)();let Se=(0,i.li)();t&&(Se=t);const Me=(0,i.li)(),Ne=(0,i.li)(),Ye=(0,i.li)(),ke=(0,i.li)(),Pe=(0,i.li)(),Fe=(0,i.li)(),Te=(0,I.A)(),De=(0,i.li)(!1),[xe,Ee,Le]=(0,w.A)(),[Be,Re]=(0,i.J0)(),[Oe,Ue]=(0,i.J0)(),[ze,Ke]=(0,i.J0)(!1),{isMobile:Ve}=(0,y.Ay)(),je=Ve&&(c.pz||c.Ni),[Je,$e]=(0,i.J0)(!1);(0,i.vJ)(()=>{$e(Boolean(ee&&te))},[te,ee]);const qe=(0,b.A)(()=>{$e(!1)});!function(e,t,n,s,l,d,c,u,h){const m=(0,D.A)(t,void 0,!u),p=(0,T.A)(m,!0),g=(0,R.A)(),f=(0,i.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,o.mS)(),i=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach(t=>{if(!t.dataset.uniqueId)return;const o=`${d}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;i.delete(o);const u=(0,Y.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,k.LI)((v.left-h.left)/h.width,4),y=(0,k.LI)((v.top-h.top)/h.height,4);if(f.current.has(o))return void f.current.get(o).updatePosition(A,y);const C=(0,r.O8F)(e,a);if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),b=[d,a,m,g].filter(Boolean).join("_");(async function(e){let{customEmoji:t,sharedCanvasRef:n,sharedCanvasHqRef:i,absoluteContainerRef:o,renderId:s,viewId:a,mediaUrl:r,position:l,isHq:d,textColor:c,colorFilter:u}=e;if(t.isLottie){const e=t.shouldUseTextColor&&c?(0,P.E2)(c):void 0,o=(await(0,S.Y)()).init(r,d?i.current:n.current,s,{size:O,coords:l,isLowPriority:!d},a,e?[e.r,e.g,e.b]:void 0);return{play:()=>o.play(),pause:()=>o.pause(),destroy:()=>o.removeView(a),updatePosition:(e,t)=>o.setSharedCanvasCoords(a,{x:e,y:t})}}if(t.isVideo){const e=t.shouldUseTextColor&&u?`filter: ${u};`:void 0,n=new N(r,o.current,{size:O,position:l,style:e});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:l,renderId:b,viewId:o,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then(e=>{c&&e.play(),f.current.set(o,e)})}),v(Array.from(i))});(0,i.vJ)(()=>(0,Y.K3)(A),[A]),(0,i.vJ)(()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}},[]),(0,i.vJ)(()=>{e()&&t.current&&n.current&&h&&u?(0,a.YS)(()=>{A()}):v(Array.from(f.current.keys()))},[e,A,t,v,n,h,u]),(0,i.Nf)(()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")},[p]),(0,x.A)(e=>{let[t]=e;void 0!==t&&m!==t&&A()},[m,A]);const y=(0,L.A)(A,[A],300,!1);(0,E.A)(n,y),(0,x.A)(e=>{let[t]=e;g!==t&&(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)}(Z,Se,ke,Pe,Fe,j,ce,_,Q);const He=F?160:V?128:Ve?256:416,Ge=(0,b.A)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,f.IJ)(()=>{(0,a.gm)(()=>{const t=Se.current.closest(`.${q}`),n=Number(t.style.height.replace("px","")),i=Ye.current,{scrollHeight:o}=i,s=Math.min(o,He);if(s===n)return;const r=o>He;function l(){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)(l):l})})});(0,i.Nf)(()=>{F&&Ge(!1)},[F,Ge]);const We=(0,i.li)(Z());(0,i.Nf)(()=>{const e=Q?Z():"";e!==Se.current.innerHTML&&(Se.current.innerHTML=e),e!==Ne.current.innerHTML&&(Ne.current.innerHTML=e),e!==We.current&&(We.current=e,Ge(!e))},[Z,Q,Ge]),(0,i.li)(l).current=l;const _e=(0,b.A)(()=>{Se.current&&!Ae&&((0,i.OV)()?setTimeout(_e,350):(0,g.A)(Se.current))}),Qe=(0,b.A)(()=>{Le(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()});function Ze(){if(c.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||De.current)return Le(),c.Ni&&Ke(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(re||!(0,A.L)(t,W||s.CfG)||!n||(0,p.A)(n)||!t.START_TO_END)||(Le(),!1)}function Xe(){if(!Ze())return;if(ze)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=Se.current.closest(`.${q}`).getBoundingClientRect();let i=t.left+t.width/2-n.left;i<H?i=H:i>n.width-H&&(i=n.width-H),Re({x:i,y:t.top-n.top}),Ue(e),Ee()}function et(){Me.current&&window.clearTimeout(Me.current),Me.current=window.setTimeout(Xe,260)}const tt=(0,b.A)(()=>Ie());(0,i.vJ)(()=>{c.TF||oe&&_e()},[l,_e,le,oe]),(0,i.vJ)(()=>{if(!l||W!==s.CfG||se||je||de)return;const e=e=>{if((0,m.ZJ)())return;const{key:t}=e,n=e.target;if(!n||G.includes(t))return;const i=Se.current,o=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!o||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&i&&n!==i&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,g.A)(i,!0,!0);const t=new KeyboardEvent(e.type,e);i.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[l,W,je,de,se]),(0,i.vJ)(()=>{const e=(0,f.sg)(e=>{"Tab"!==e.key||(0,m.ZJ)()||(e.preventDefault(),(0,a.RK)(_e))},2e3,!0,!1);return(0,h.A)({onTab:e})},[_e]),(0,i.vJ)(()=>{const e=Se.current;function t(){e.blur()}return ae&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[ae]);const nt=(0,C.A)(()=>Boolean(Q&&Z()),[Q,Z]),it=(0,u.A)("form-control allow-selection",nt&&"touched",ae&&"focus-disabled"),ot=(0,u.A)("input-scroller-content",Ae&&"is-need-premium"),st="string"==typeof X?X:void 0;return(0,J.FD)("div",{id:n,onClick:ae?me:void 0,dir:Te.isRtl?"rtl":void 0,children:[(0,J.Y)("div",{className:(0,u.A)("custom-scroll",q,Ae&&"is-need-premium"),onScroll:ge,onClick:F||ie?void 0:function(){F||ie||V&&Ae||be({chatId:l,messageListType:ye})},children:(0,J.FD)("div",{className:ot,children:[(0,J.Y)("div",{ref:Se,id:W||s.CfG,className:it,contentEditable:F||ie,role:"textbox",dir:"auto",spellCheck:!d.Vq&&void 0,tabIndex:0,onClick:_e,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(he("<br>"===t?"":t),!c.TF&&(!n||!n.length)&&(c.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(Se.current.blur(),e.removeAllRanges(),(0,g.A)(Se.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=Z();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 we({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",et,{once:!0}):(e.preventDefault(),Ce()):!je&&("enter"===ue&&!e.shiftKey||"ctrl-enter"===ue&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),Le(),pe())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout(()=>{De.current=!1},100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?De.current||(De.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",et,{once:!0})},onContextMenu:c.Ni?function(e){Ze()&&(Ke(!ze),ze?Le():(e.preventDefault(),e.stopPropagation(),Xe()))}:void 0,onTouchCancel:c.Ni?et:void 0,"aria-label":st,onFocus:Ae?void 0:fe,onBlur:Ae?void 0:ve}),!ne&&(0,J.FD)("span",{className:(0,u.A)("placeholder-text",!F&&!ie&&"with-icon",Ae&&"is-need-premium"),dir:"auto",children:[!F&&!ie&&(0,J.Y)(U.A,{name:"lock-badge",className:"placeholder-icon"}),Je?(0,J.Y)(K.A,{langKey:ee,endsAt:te,onEnd:qe}):X,V&&Ae&&(0,J.Y)(z.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:tt,children:Te("StoryRepliesLockedButton")})]}),(0,J.Y)("canvas",{ref:ke,className:"shared-canvas"}),(0,J.Y)("canvas",{ref:Pe,className:"shared-canvas"}),(0,J.Y)("div",{ref:Fe,className:"absolute-video-container"})]})}),(0,J.Y)("div",{ref:Ye,className:(0,u.A)("custom-scroll",q,"clone",Ae&&"is-need-premium"),children:(0,J.Y)("div",{className:ot,children:(0,J.Y)("div",{ref:Ne,className:(0,u.A)(it,"clone"),dir:"auto"})})}),void 0!==M&&(0,J.Y)("div",{className:"max-length-indicator",dir:"auto",children:M}),(0,J.Y)($,{isOpen:xe,anchorPosition:Be,selectedRange:Oe,setSelectedRange:Ue,onClose:Qe}),ne&&(0,J.Y)("span",{className:"forced-placeholder",children:(0,v.A)(ne)})]})}))},79882:(e,t,n)=>{n.d(t,{I:()=>o,W:()=>s});var i=n(84051);let o=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function s(e){return(0,i.Kr)(()=>{const t=Object.values(e),n=t.filter(e=>e<0).length,i=t.filter(e=>e>0).length;return t=>{const s=e[t];return 0===s?o.None:s===1/0||s===-1/0||n<=i&&s<0||i<n&&s>0?o.Opacity:o.Move}},[e])}},80477:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(90709),a=n(91048),r=n(4961),l=n(59030),d=n(80999),c=n(20021);const u=(0,i.ph)((0,o.EK)((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,a.mBe)(e,n.userId)}:{typingUser:void 0}})(e=>{let{typingStatus:t,typingUser:n}=e;const i=(0,l.A)(),o=n&&!n.isSelf&&(0,s.u0)(n),a=i(t.action).replace("{user}","").replace("{emoji}",t.emoji||"").trim();return(0,c.FD)("p",{className:"typing-status",dir:i.isRtl?"rtl":"auto",children:[o&&(0,c.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(o)}),(0,c.Y)(d.A,{content:a})]})}))},80999:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(87357),o=n(4961),s=n(59030),a=n(20021);const r=e=>{let{content:t,className:n}=e;const r=(0,s.A)();return(0,a.FD)("span",{className:(0,i.A)("DotAnimation",n),dir:r.isRtl?"rtl":"auto",children:[(0,o.A)(t),(0,a.Y)("span",{className:"ellipsis"})]})}},81524:(e,t,n)=>{n.d(t,{A:()=>v});var i=n(84051),o=n(90709),s=n(87357),a=n(17663),r=n(83868),l=n(35749),d=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,i.ph)(e=>{let{message:t,idPrefix:n="shared-media",isProtected:v,observeIntersection:A,onClick:y}=e;const C=(0,i.li)(),w=(0,u.Vz)(C,A),b=(0,d.A)(t),I=(0,l.A)(t,"pictogram"),S=(0,m.A)(I,!w),M=(0,p.A)(S),N=(0,o.zX)(t),Y=(0,o.y2)(t),[k,,P]=(0,c.A)(Y),F=(0,h.A)(()=>{P(),y(t.id,t.chatId)});return(0,f.FD)("div",{ref:C,id:`${n}${(0,o.GZ)(t.id)}`,className:"Media scroll-item",onClick:y?F:void 0,children:[(0,f.Y)("img",{src:b,className:"media-miniature",alt:"",draggable:!v,decoding:"async",onContextMenu:v?r.A:void 0}),(0,f.Y)("img",{src:S,className:(0,s.A)("full-media","media-miniature",M),alt:"",draggable:!v,decoding:"async",onContextMenu:v?r.A:void 0}),Y&&(0,f.Y)(g.A,{thumbDataUri:S||b,isVisible:k,className:"media-spoiler"}),N&&(0,f.Y)("span",{className:"video-duration",children:N.isGif?"GIF":(0,a.QO)(N.duration)}),v&&(0,f.Y)("span",{className:"protector"})]})})},81642:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(87357),s=n(17663),a=n(59030),r=n(45),l=n(20021);const d=(0,i.ph)(e=>{let{className:t,message:n,outgoingStatus:i,draftDate:d}=e;const c=(0,a.A)(),u=d&&d>n.date;return(0,l.FD)("div",{className:(0,o.A)("LastMessageMeta",t),children:[i&&!u&&(0,l.Y)(r.A,{status:i}),(0,l.Y)("span",{className:"time",children:(0,s.be)(c,1e3*(u?d:n.date))})]})})},84313:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(13439),s=n(96454),a=n(17712),r=n(59030);const l=8e3;function d(e,t,n){const{showNotification:d}=(0,o.ko)(),c=(0,r.A)(),[u,h]=(0,i.J0)(!1),m=(0,a.A)(()=>{h(!0),t||d({message:s.yS?c("Video.Unsupported.Mobile"):c("Video.Unsupported.Desktop"),duration:l})}),p=(0,a.A)(e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||m())}),g=(0,a.A)(e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||m()});return(0,i.vJ)(()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",p),t.addEventListener("canplay",g),()=>{t.removeEventListener("error",p),t.removeEventListener("canplay",g)}):void 0},[n,e]),u}},84555:(e,t,n)=>{n.d(t,{A:()=>T});var i=n(84051),o=n(13439),s=n(23174),a=n(90709),r=n(53827),l=n(87357),d=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),Y=n(20021);const k=u.Wd/2,P=2*(k-6)*Math.PI;let F;const T=e=>{let{message:t,className:n,canAutoLoad:T,isDownloading:D,origin:x,observeIntersection:E,onStop:L,onReadMedia:B,isTranscriptionError:R,isTranscribed:O,canTranscribe:U,onHideTranscription:z,isTranscriptionHidden:K,isTranscribing:V}=e;const j=(0,i.li)(),J=(0,i.li)(),$=(0,i.li)(),{cancelMediaDownload:q,openOneTimeMediaModal:H,transcribeAudio:G}=(0,o.ko)(),W=(0,g.Vz)(j,E),_=t.content.video,Q=t.isMediaUnread,[Z,X]=(0,i.J0)(T),ee=Boolean(Z&&W),{mediaData:te,loadProgress:ne}=(0,A.A)((0,a.sC)(_,"inline"),!ee,(0,a.Cz)(_,"inline")),{loadProgress:ie}=(0,A.A)((0,a.sC)(_,"download"),!D,s.qZ.BlobUrl),[oe,se]=(0,p.A)(),ae=(0,a.G5)(t),re="oneTimeModal"===x,le=ae&&!re,de=(0,h.A)(t),ce=!Boolean(de)||oe||le,ue=(0,w.A)(_,ce);(0,v.A)({hasMediaData:!ce,ref:ue});const he=Z&&!oe||D,me=!1===(0,y.A)(Z),{ref:pe,shouldRender:ge}=(0,C.A)({isOpen:he,noMountTransition:me,withShouldRender:!0}),[fe,ve]=(0,i.J0)(!1),[Ae,ye]=(0,i.J0)(0),[Ce,we]=(0,i.Ul)(0),be=(0,m.aG)(Ce,16);(0,i.vJ)(()=>{if(!fe)return;const e=J.current;we(e.currentTime/e.duration)},[we,fe,be]),(0,i.Nf)(()=>{if(!fe||!$.current)return;const e=P-be()*P;$.current.setAttribute("stroke-dashoffset",e.toString())},[fe,be]);const Ie=Boolean(te&&W),Se=(0,f.A)(()=>{J.current&&(ve(!1),we(0),(0,c.A)(J.current))}),Me=(0,f.A)(()=>{F?.(),F=Se}),Ne=(0,f.A)(()=>{const e=J.current;fe?e.paused?((0,c.A)(e),(0,r._K)()):e.pause():(Me(),e.pause(),e.currentTime=0,(0,c.A)(e),(0,r._K)(),ve(!0))});(0,i.vJ)(()=>{re&&Ne()},[re]);const Ye=(0,f.A)(e=>{if(!e.target.closest(".transcribe-button"))if(te){if(!D)return ae&&!re?(H({message:t}),void B?.()):void Ne();q({media:_})}else X(e=>!e)});(0,i.vJ)(()=>{B&&Q&&fe&&B()},[fe,Q,B]);const ke=(0,f.A)(e=>{const t=e.currentTarget;we(t.currentTime/t.duration),ye(Math.floor(t.currentTime))}),Pe=(0,f.A)(()=>{G({chatId:t.chatId,messageId:t.id})}),Fe=(0,f.A)(()=>{(O||R)&&z?z(!K):V||Pe()});return(0,Y.FD)("div",{ref:j,className:(0,l.A)("RoundVideo","media-inner",re&&"non-interactive",n),onClick:Ye,children:[te&&(0,Y.FD)("div",{className:"video-wrapper",children:[le&&(0,Y.Y)(I.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,Y.Y)(M.A,{canPlay:Ie,ref:J,src:te,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!le,disablePictureInPicture:!0,muted:!fe,defaultMuted:!0,loop:!fe,playsInline:!0,isPriority:!0,onEnded:fe?L??Se:void 0,onTimeUpdate:fe?ke:void 0,onReady:se})]}),!le&&(0,Y.Y)("canvas",{ref:ue,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,Y.Y)("div",{className:"progress",children:fe&&(0,Y.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,Y.Y)("circle",{ref:$,cx:k,cy:k,r:k-6,className:"progress-circle",transform:`rotate(-90, ${k}, ${k})`,"stroke-dasharray":P,"stroke-dashoffset":P})})}),ge&&(0,Y.Y)("div",{ref:pe,className:"media-loading",children:(0,Y.Y)(N.A,{progress:D?ie:ne})}),le&&!ge&&(0,Y.FD)("div",{className:"play-wrapper",children:[(0,Y.Y)(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,children:(0,Y.Y)(b.A,{name:"play"})}),(0,Y.Y)(b.A,{name:"view-once"})]}),!te&&!Z&&(0,Y.Y)(b.A,{name:"download"}),!re&&(0,Y.FD)("div",{className:(0,l.A)("message-media-duration",Q&&"unread"),children:[fe?(0,d.QO)(Ae):(0,d.QO)(_.duration),(!fe||J.current.paused)&&(0,Y.Y)(b.A,{name:"muted"})]}),U&&(0,Y.FD)(S.A,{onClick:Fe,className:"transcribe-button",children:[O||R?(0,Y.Y)(b.A,{name:"down"}):(0,Y.Y)(b.A,{name:"transcribe"}),V&&(0,Y.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,Y.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]})}},85449:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(31481),o=n(98607),s=n(4961),a=n(18276),r=n(20021);function l(e,t){return"receipt"===t.type?e("PaymentReceipt"):"buy"===t.type?(0,o.i)(t.text,i.Cyx,(0,r.Y)(a.A,{className:"star-currency-icon",name:"star"})):(0,s.A)(t.text)}},88792:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(13439),s=n(31481),a=n(91048),r=n(53827),l=n(49642),d=n(80853),c=n(82117),u=n(17712),h=n(35297);const m=function(e,t,n,m,p,g,f){let v=arguments.length>7&&void 0!==arguments[7]&&arguments[7],A=arguments.length>8?arguments[8]:void 0,y=arguments.length>9?arguments[9]:void 0,C=arguments.length>10&&void 0!==arguments[10]&&arguments[10],w=arguments.length>11&&void 0!==arguments[11]&&arguments[11],b=arguments.length>12?arguments[12]:void 0,I=arguments.length>13&&void 0!==arguments[13]&&arguments[13],S=arguments.length>14&&void 0!==arguments[14]&&arguments[14];const M=(0,i.li)(),[N,Y]=(0,i.J0)(!1);let k=N;const[P,F]=(0,i.J0)(0),T=(0,u.A)(()=>{Y(!1),y&&y()});(0,h.A)(()=>{if(!e)return;M.current=(0,r.kz)(e,n,(e,i)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:i,toggleMuted:r,proxy:d}=M.current;Y(!0),"oneTimeVoice"!==n&&(0,l.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:i,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:l,isFirst:d,isLast:c}=e.current;t={play:()=>{n(a.src)},pause:()=>{i()},stop:()=>{i(),s(0),(0,o.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(a.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(a.currentTime+t,a.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},c()||(t.nexttrack=()=>{r()}),d()||(t.previoustrack=()=>{l()})}return t}(M)),(0,l.HW)("playing");const{audioPlayer:c}=(0,a.nTw)((0,o.mS)());e(c.volume),r(Boolean(c.isMuted));const u=d.duration&&Number.isFinite(d.duration)?d.duration:t;("voice"===n||u>s.CVm)&&i(c.playbackRate),(0,l.hm)({duration:d.duration||0,playbackRate:d.playbackRate,position:d.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,l.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":Y(!1),(0,l.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,l.HW)("paused")}p?.[e]?.(i)}},A,T);const{proxy:i}=M.current;N||i.paused||(Y(!0),k=!0),f&&!S&&f(i)},[e]),(0,i.vJ)(()=>{N&&g&&(0,l.D5)(g)},[g,N]);const{play:D,pause:x,setCurrentTime:E,proxy:L,destroy:B,setVolume:R,stop:O,isFirst:U,isLast:z,requestNextTrack:K,requestPreviousTrack:V,setPlaybackRate:j,toggleMuted:J}=M.current??{},$=(0,i.Kr)(()=>L?.duration&&Number.isFinite(L.duration)?L.duration:t,[L?.duration,t]);(0,i.vJ)(()=>{L&&(I&&0===L.currentTime||!$||(0,d.f)(L)||w||F(L.currentTime/$))},[$,P,L,w,I]),(0,i.vJ)(()=>()=>{B?.(C)},[B,C]),(0,c.A)(e=>{let[t,n]=e;t===v&&m===n||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:k,playProgress:P,playPause:H,pause:x,play:q,stop:O,setCurrentTime:G,setVolume:R,audioProxy:L,duration:$,requestNextTrack:K,requestPreviousTrack:V,isFirst:U,isLast:z,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 i=n(84051),o=n(13439),s=n(17712),a=n(34201),r=n(59030),l=n(71429),d=n(24433),c=n(60859),u=n(20021);const h=(0,i.ph)(e=>{let{isOpen:t,sponsorInfo:n,canReport:o,anchor:a,triggerRef:h,shouldSkipAbout:m,onClose:p,onCloseAnimationEnd:g,onAboutAdsClick:f,onSponsoredHide:v,onSponsorInfo:A,onSponsoredReport:y}=e;const C=(0,i.li)(),w=(0,r.A)(),b=(0,s.A)(()=>h.current),I=(0,s.A)(()=>({withPortal:!0})),S=(0,s.A)(()=>C.current),M=(0,s.A)(()=>document.body),N=n||!m||o;return(0,u.FD)(l.A,{ref:C,isOpen:t,anchor:a,withPortal:!0,className:"with-menu-transitions",getLayout:I,getTriggerElement:b,getMenuElement:S,getRootElement:M,onClose:p,onCloseAnimationEnd:g,children:[n&&A&&(0,u.Y)(d.A,{icon:"channel",onClick:A,children:w("SponsoredMessageSponsor")}),!m&&(0,u.Y)(d.A,{icon:"info",onClick:f,children:w(o?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),o&&y&&(0,u.Y)(d.A,{icon:"hand-stop",onClick:y,children:w("ReportAd")}),N&&(0,u.Y)(c.A,{}),(0,u.Y)(d.A,{icon:"close-circle",onClick:v,children:w("HideAd")})]})}),m=(0,i.ph)(e=>{let{isOpen:t,randomId:n,sponsorInfo:i,additionalInfo:r,canReport:l,anchor:d,triggerRef:c,shouldSkipAbout:m,onItemClick:p,onClose:g,onCloseAnimationEnd:f}=e;const{openAboutAdsModal:v,showDialog:A,reportSponsored:y,hideSponsored:C}=(0,o.ko)(),{ref:w}=(0,a.A)({isOpen:t,onCloseAnimationEnd:f}),b=(0,s.A)(()=>{p?.(),g()}),I=(0,s.A)(()=>{v({randomId:n,additionalInfo:r,canReport:l,sponsorInfo:i}),b()}),S=(0,s.A)(()=>{C(),b()}),M=(0,s.A)(()=>{A({data:{message:[i,r].filter(Boolean).join("\n")}}),b()}),N=(0,s.A)(()=>{y({randomId:n}),b()});if(d)return(0,u.Y)("div",{ref:w,className:"ContextMenuContainer",children:(0,u.Y)(h,{isOpen:t,anchor:d,triggerRef:c,canReport:l,sponsorInfo:i,shouldSkipAbout:m,onClose:g,onCloseAnimationEnd:g,onAboutAdsClick:I,onSponsoredHide:S,onSponsorInfo:M,onSponsoredReport:N})})})},90054:(e,t,n)=>{n.d(t,{A:()=>W});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(66644),l=n(90709),d=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),Y=n(64493),k=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,i.ph)((0,o.EK)((e,t)=>{let{chatId:n}=t;const i=(0,d.hds)(e,n),o=i&&(i.isCreator||(0,l.ub)(i,"manageTopics"));return{animatedEmoji:(0,d.oei)(e,"🐣"),canManageTopics:o}})(e=>{let{chatId:t,animatedEmoji:n,canManageTopics:s}=e;const{openCreateTopicPanel:a}=(0,o.ko)(),r=(0,C.A)(),{isMobile:l}=(0,g.Ay)(),d=(0,i.hb)(()=>{a({chatId:t})},[t,a]);return(0,x.FD)("div",{className:D.root,children:[(0,x.Y)("div",{className:D.sticker,children:n&&(0,x.Y)(T.A,{sticker:n,size:E})}),(0,x.Y)("h3",{className:D.title,dir:"auto",children:r("ChatList.EmptyTopicsTitle")}),(0,x.Y)("p",{className:(0,u.A)(D.description,D.centered),dir:"auto",children:r("ChatList.EmptyTopicsDescription")}),s&&(0,x.Y)(Y.A,{ripple:!l,fluid:!0,onClick:d,isRtl:r.isRtl,children:(0,x.Y)("div",{className:D.buttonText,children:r("ChatList.EmptyTopicsCreate")})})]})}));var B=n(27109),R=n(66414),O=n(4961),U=n(37661),z=n(53188),K=n(87894),V=n(81642),j=n(38102),J=n(94189),$=n(22720),q=n(97046),H=n(24807);const G=(0,i.ph)((0,o.EK)((e,t)=>{let{chatId:n,topic:i,isSelected:o}=t;const s=(0,d.hds)(e,n),a=(0,d.O5q)(e,n,i.lastMessageId),{isOutgoing:r}=a||{},l=a&&(0,d.Y7C)(e,a),c=(0,d.C5H)(e,n,i.id,"typingStatus"),u=(0,d.GA4)(e,n,i.id),h=(0,d.Vw0)(e,n,i.id),m=Boolean(h?.lastReadInboxMessageId),p=(0,d.pSx)(e,n),{chatId:g,threadId:f}=(0,d.Xf0)(e)||{},v=a?.content.storyData,A=v&&(0,d.Msb)(e,v.peerId,v.id);return{chat:s,lastMessage:a,lastMessageSender:l,typingStatus:c,isChatMuted:s&&(0,B.If)(s,(0,d.K52)(e),(0,d.P5N)(e,s.id)),canDelete:(0,d.DBV)(e,n,i.id),withInterfaceAnimations:(0,d.PKK)(e),draft:u,...r&&a&&{lastMessageOutgoingStatus:(0,d.Tl2)(e,a)},canScrollDown:o&&s?.id===g&&f===i.id,wasTopicOpened:m,topics:p,lastMessageStory:A}})(e=>{let{topic:t,isSelected:n,chatId:s,chat:r,isChatMuted:d,style:h,lastMessage:m,lastMessageStory:p,canScrollDown:g,lastMessageOutgoingStatus:f,observeIntersection:v,canDelete:A,lastMessageSender:w,animationType:b,withInterfaceAnimations:I,orderDiff:S,typingStatus:N,draft:Y,wasTopicOpened:k,topics:P}=e;const{openThread:F,deleteTopic:T,focusLastMessage:D,setViewForumAsMessages:E,updateTopicMutedState:L}=(0,o.ko)(),B=(0,C.A)(),[G,W,_]=(0,U.A)(),[Q,Z,X]=(0,U.A)(),[ee,te,ne]=(0,U.A)(),[ie,oe,se]=(0,U.A)(),{isPinned:ae,isClosed:re,notifySettings:le}=t,de=Boolean(le.mutedUntil||void 0===le.mutedUntil&&d),ce=(0,y.A)(()=>{te(),W()}),ue=(0,y.A)(()=>{T({chatId:r.id,topicId:t.id})}),he=(0,y.A)(()=>{oe(),Z()}),me=(0,y.A)(()=>{L({chatId:s,topicId:t.id,mutedUntil:a.Os5})}),{renderSubtitle:pe,ref:ge}=(0,z.A)({chat:r,chatId:s,lastMessage:m,draft:Y,lastMessageSender:w,lastMessageTopic:t,observeIntersection:v,isTopic:!0,typingStatus:N,topics:P,statefulMediaContent:(0,l.FE)({story:p}),animationType:b,withInterfaceAnimations:I,orderDiff:S}),fe=(0,y.A)(()=>{F({chatId:s,threadId:t.id,shouldReplaceHistory:!0}),E({chatId:s,isEnabled:!1}),g&&D()}),ve=function(e){let{topic:t,chat:n,isChatMuted:s,wasOpened:a,canDelete:r,handleDelete:d,handleMute:u,handleUnmute:h}=e;const m=(0,C.A)();return(0,i.Kr)(()=>{const{isPinned:e,notifySettings:i,isClosed:p,id:g}=t,f=n.id,{editTopic:v,toggleTopicPinned:A,markTopicRead:y,openChatInNewTab:C}=(0,o.ko)(),w=(0,l.l1)(n,t),b=n.isCreator||(0,l.ub)(n,"manageTopics"),I=c.OS&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{C({chatId:n.id,threadId:g})}},S=t.unreadCount||!a?{title:m("MarkAsRead"),icon:"readchats",handler:()=>{y({chatId:f,topicId:g})}}:void 0,M=b?e?{title:m("UnpinFromTop"),icon:"unpin",handler:()=>A({chatId:f,topicId:g,isPinned:!1})}:{title:m("PinToTop"),icon:"pin",handler:()=>A({chatId:f,topicId:g,isPinned:!0})}:void 0,N=s&&void 0===i.mutedUntil||i.mutedUntil?{title:m("ChatList.Unmute"),icon:"unmute",handler:h}:{title:`${m("ChatList.Mute")}...`,icon:"mute",handler:u},Y=w?p?{title:m("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>v({chatId:f,topicId:g,isClosed:!1})}:{title:m("lng_forum_topic_close"),icon:"close-topic",handler:()=>v({chatId:f,topicId:g,isClosed:!0})}:void 0,k=r?{title:m("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:d}:void 0;return(0,K.oE)([I,M,S,N,Y,k])},[t,n,s,a,m,r,d,u,h])}({topic:t,chat:r,isChatMuted:d,wasOpened:k,canDelete:A,handleDelete:ce,handleMute:he,handleUnmute:me});return(0,x.FD)($.A,{className:(0,u.A)("Fn34Vu_9","Chat",n&&"selected","chat-item-clickable"),onClick:fe,style:h,href:c.OS?`#${(0,R.az)(s,"thread",t.id)}`:void 0,contextActions:ve,withPortalForMenu:!0,ref:ge,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:t,className:"oXJl4tra",observeIntersection:v}),(0,x.Y)("h3",{dir:"auto",className:"fullName",children:(0,O.A)(t.title)})]}),Boolean(le.mutedUntil)&&(0,x.Y)(M.A,{name:"muted"}),(0,x.Y)("div",{className:"separator"}),re&&(0,x.Y)(M.A,{name:"lock-badge",className:"MB7Gomjn"}),m&&(0,x.Y)(V.A,{message:m,outgoingStatus:f})]}),(0,x.FD)("div",{className:"subtitle",children:[pe(),(0,x.Y)(H.A,{chat:r,isPinned:ae,isMuted:de,topic:t,wasTopicOpened:k,topics:P})]})]}),ee&&(0,x.Y)(J.A,{isOpen:G,onClose:_,onCloseAnimationEnd:ne,confirmIsDestructive:!0,confirmHandler:ue,text:B("lng_forum_topic_delete_sure"),confirmLabel:B("Delete")}),ie&&(0,x.Y)(q.A,{isOpen:Q,onClose:X,onCloseAnimationEnd:se,chatId:s,topicId:t.id})]})})),W=(0,i.ph)((0,o.EK)(e=>{const t=(0,d.nTw)(e).forumPanelChatId,n=t?(0,d.hds)(e,t):void 0,{chatId:i,threadId:o}=(0,d.Xf0)(e)||{},s=t?(0,d.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===i?Number(o):void 0,withInterfaceAnimations:(0,d.PKK)(e),topicsInfo:s}},e=>(0,d.clw)(e))(e=>{let{chat:t,currentTopicId:n,isOpen:d,isHidden:F,topicsInfo:T,onTopicSearch:D,onCloseAnimationEnd:E,onOpenAnimationStart:B,withInterfaceAnimations:R}=e;const{closeForumPanel:O,openChatWithInfo:U,loadTopics:z}=(0,o.ko)(),K=(0,i.li)(),V=(0,i.li)(),j=(0,i.li)(),{isMobile:J}=(0,g.Ay)(),$=t?.id;(0,i.vJ)(()=>{$&&!T&&z({chatId:$})},[T,$]);const[q,H]=(0,i.J0)(!1),W=(0,C.A)(),_=(0,y.A)(()=>{O()});(0,i.vJ)(()=>{R||d||E?.()},[R,d,E]);const Q=(0,y.A)(()=>{t&&U({id:t.id,shouldReplaceHistory:!0})}),{observe:Z}=(0,A.BL)({rootRef:V,throttleMs:200});(0,A.mv)(j,Z,e=>{let{isIntersecting:t}=e;H(!t)});const X=(0,i.Kr)(()=>T?(0,l.CO)(Object.values(T.topicsById),T.orderedPinnedTopicIds).map(e=>{let{id:t}=e;return t}):[],[T]),{orderDiffById:ee,getAnimationType:te}=(0,b.A)(X,t?.id),[ne,ie]=(0,v.A)(()=>{t&&z({chatId:t.id})},X,!T?.totalCount||X.length>=T.totalCount,a.iIc),oe=(0,i.li)(!1),se=d&&!F,ae=(0,w.A)(se);ae!==se&&(oe.current=!1),(0,f.A)({isActive:se,onBack:_}),(0,i.vJ)(()=>se?(0,h.A)(_):void 0,[_,se]),(0,i.vJ)(()=>{ae!==se&&(0,r.Uz)(()=>{if(!K.current)return;const e=(0,i.VK)();(0,p.j)(K.current,e),B?.(),se?(oe.current=!0,K.current.style.transform="none"):(oe.current=!1,K.current.style.transform="")})},[se,B,ae]),(0,i.vJ)(()=>{if(c.TF)return(0,m.wJ)(K.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(W.isRtl?m.ez.Left:m.ez.Right)&&(O(),!0)})},[O,W.isRtl]);const re=void 0===T;return(0,x.FD)("div",{ref:K,className:(0,u.A)("MlF2n1nb",q&&"SZ24u3cn",W.isRtl&&"Xs2y1fCE",!R&&"kmDMv6D8"),onTransitionEnd:d?void 0:E,children:[(0,x.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,x.Y)(Y.A,{round:!0,size:"smaller",color:"translucent",onClick:_,ariaLabel:W("Close"),children:(0,x.Y)(M.A,{name:"close"})}),t&&(0,x.Y)(S.A,{noAvatar:!0,className:"Sf633zAP",chatId:t.id,onClick:Q}),t&&(0,x.Y)(N.A,{chatId:t.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:J,onTopicSearch:D})]}),t&&(0,x.Y)(I.A,{chatId:t.id}),(0,x.Y)("div",{className:"hGeb3TQJ"}),(0,x.FD)(k.A,{className:"chat-list custom-scroll",ref:V,items:ne,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(X?.length||0)*a.HGU,onLoadMore:ie,sensitiveArea:a.C$_,beforeChildren:(0,x.Y)("div",{ref:j,className:"ERz3fcar"}),children:[Boolean(ne?.length)&&function(){const e=X.indexOf(ne[0]);return ne?.map((i,o)=>(0,x.Y)(G,{chatId:t.id,topic:T.topicsById[i],style:`top: ${(e+o)*a.HGU}px;`,isSelected:n===i,observeIntersection:Z,animationType:te(i),orderDiff:ee[i]},i))}(),re&&!ne?.length&&(0,x.Y)(P.A,{},"loading")]}),!re&&1===ne?.length&&ne[0]===a.HxB&&(0,x.Y)(L,{chatId:$})]})}))},90423:(e,t,n)=>{n.d(t,{Ay:()=>r,j9:()=>c,zk:()=>l});var i=n(84051),o=n(63495),s=n(96454);const a=d();function r(e,t,n){const[o,r]=(0,i.J0)(Boolean(a&&document[a]));return(0,i.Nf)(()=>{const i=e.current,o=()=>{const e=Boolean(a&&document[a]);r(e),e?n?.(!1):t?.(!1),i instanceof HTMLVideoElement&&(i.controls=e)},s=()=>{r(!0),n&&n(!0)},l=()=>{r(!1),t&&t(!1)};return document.addEventListener("fullscreenchange",o,!1),document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),i&&(i.addEventListener("webkitbeginfullscreen",s,!1),i.addEventListener("webkitendfullscreen",l,!1)),()=>{document.removeEventListener("fullscreenchange",o,!1),document.removeEventListener("webkitfullscreenchange",o,!1),document.removeEventListener("mozfullscreenchange",o,!1),i&&(i.removeEventListener("webkitbeginfullscreen",s,!1),i.removeEventListener("webkitendfullscreen",l,!1))}},[]),a||s.pz?[o,()=>{var t;e.current&&(a||s.pz)&&!o&&((t=e.current).requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen(),r(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),r(!1))}]:[!1]}const l=()=>{const[e,t]=(0,i.J0)(!1);return(0,i.vJ)(()=>{const e=()=>{t(c())};let n;return o.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 d(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function c(){const e=d();return Boolean(e&&document[e])}},90596:(e,t,n)=>{n.d(t,{A:()=>jn});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(31481),l=n(90709),d=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 Y=n(43336),k=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(e=>{let{dimensions:n,sides:i}=e;2&i&&(t.width=n.width+n.x),4&i&&(t.height=n.height+n.y)}),t}function T(e,t,n,i){const o=function(e,t,n){const i=e[0].isOutgoing,o=(t?e[0].content.paidMedia.extendedMedia.map(e=>"mediaType"in e?e:e.photo||e.video):e.map(e=>(0,l.r_)(e).photo||(0,l.r_)(e).video)).filter(Boolean);return o.map(e=>{const t=(0,k.yA)({media:e,isOwn:i,isMobile:n});return t.width/t.height})}(n.messages,n.isPaidMedia,i),s=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(o),a=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(o),r=o.length,d=o.some(e=>e>2),c=(0,b.w4)(e,!1,t,i);let u;const h={ratios:o,proportions:s,averageRatio:a,maxWidth:c,minWidth:100,maxHeight:c,spacing:2};return u=r>=5||d?function(e){let{ratios:t,averageRatio:n,maxWidth:i,minWidth:o,spacing:s,maxHeight:a=4*i/3}=e;const r=function(e,t){return e.map(e=>t>1.1?(0,Y.qE)(e,1,2.75):(0,Y.qE)(e,.6667,1))}(t,n),l=t.length,d=new Array(l),c=[],u=e=>{const t=[];let n=0;e.forEach(e=>{t.push(((e,t)=>{const n=P(r.slice(e,e+t),0);return(i-(t-1)*s)/n})(n,e)),n+=e}),c.push({lineCounts:e,heights:t})};for(let e=1;e!==l;++e){const t=l-e;e<=3&&t<=3&&u([e,t])}for(let e=1;e!==l-1;++e)for(let t=1;t!==l-e;++t){const i=l-e-t;e<=3&&t<=(n<.85?4:3)&&i<=3&&u([e,t,i])}for(let e=1;e!==l-1;++e)for(let t=1;t!==l-e;++t)for(let n=1;n!==l-e-t;++n){const i=l-e-t-n;e<=3&&t<=3&&n<=3&&i<=4&&u([e,t,n,i])}let h,m=0;for(let e=0;e<c.length;e++){const{heights:t,lineCounts:n}=c[e],i=n.length,r=P(t,0)+s*(i-1),l=Math.min(...t)<o?1.5:1,d=(()=>{for(let e=1;e!==i;++e)if(n[e-1]>n[e])return 1.5;return 1})(),u=Math.abs(r-a)*l*d;(!h||u<m)&&(h=c[e],m=u)}const p=h.lineCounts,g=h.heights,f=p.length;let v=0,A=0;for(let e=0;e!==f;++e){const t=p[e],n=g[e],o=Math.round(n);let a=0;for(let l=0;l!==t;++l){const c=0|(0===e?1:0)|(e===f-1?4:0)|(0===l?8:0)|(l===t-1?2:0),u=r[v],h=l===t-1?i-a:Math.round(u*n);d[v]={dimensions:{x:a,y:A,width:h,height:o},sides:c},a+=h+s,++v}A+=o+s}return d}(h):2===r?function(e){const{ratios:t,proportions:n,averageRatio:i}=e;return"ww"===n&&i>1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:i,maxHeight:o}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(o-i)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+i,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:i,maxHeight:o}=e,s=(n-i)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],o)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+i,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:i,spacing:o,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(i-o),(i-o)/t[0]/(1/t[0]+1/t[1]))),i-o-a),l=i-r-o,d=Math.min(s,Math.round(Math.min(l/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:l,height:d},sides:13},{dimensions:{x:l+o,y:0,width:r,height:d},sides:7}]}(e)}(h):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:i,maxWidth:o,minWidth:s}=e,a=t,r=Math.round(Math.min((t-n)/2,i[1]*(o-n)/(i[2]+i[1]))),l=a-r-n,d=Math.max(s,Math.round(Math.min((o-n)/2,Math.min(r*i[2],l*i[1])))),c=Math.min(Math.round(a*i[0]),o-n-d);return[{dimensions:{x:0,y:0,width:c,height:a},sides:13},{dimensions:{x:c+n,y:0,width:d,height:l},sides:3},{dimensions:{x:c+n,y:l+n,width:d,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:i,spacing:o}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(i-o))),r=(t-o)/2,l=Math.min(i-a-o,Math.round(Math.min(r/n[1],r/n[2])));return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+o,width:r,height:l},sides:12},{dimensions:{x:r+o,y:a+o,width:s-r-o,height:l},sides:6}]}(e)}(h):function(e){const{proportions:t}=e;return"w"===t[0]?function(e){let{maxWidth:t,ratios:n,spacing:i,maxHeight:o,minWidth:s}=e;const a=t,r=Math.round(Math.min(a/n[0],.66*(o-i))),l=Math.round((t-2*i)/(n[1]+n[2]+n[3])),d=Math.max(s,Math.round(Math.min(.4*(t-2*i),l*n[1]))),c=Math.round(Math.max(Math.max(s,.33*(t-2*i)),l*n[3])),u=a-d-c-2*i,h=Math.min(o-r-i,l);return[{dimensions:{x:0,y:0,width:a,height:r},sides:11},{dimensions:{x:0,y:r+i,width:d,height:h},sides:12},{dimensions:{x:d+i,y:r+i,width:u,height:h},sides:4},{dimensions:{x:d+i+u+i,y:r+i,width:c,height:h},sides:6}]}(e):function(e){let{maxHeight:t,ratios:n,maxWidth:i,spacing:o,minWidth:s}=e;const a=t,r=Math.round(Math.min(a*n[0],.6*(i-o))),l=Math.round((t-2*o)/(1/n[1]+1/n[2]+1/n[3])),d=Math.round(l/n[1]),c=Math.round(l/n[2]),u=a-d-c-2*o,h=Math.max(s,Math.min(i-r-o,l));return[{dimensions:{x:0,y:0,width:r,height:a},sides:13},{dimensions:{x:r+o,y:0,width:h,height:d},sides:3},{dimensions:{x:r+o,y:d+o,width:h,height:c},sides:2},{dimensions:{x:r+o,y:d+c+2*o,width:h,height:u},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),z=n(59030),K=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,o.ko)(),n=_.get(e);if(!n)return;const i=n.size;if(i<8)return;let s=0,a=0;const r=new Map;for(const e of n.values()){e.isTranslatable&&s++,e.detectedLanguage&&a++;const t=e.detectedLanguage;if(t){const e=r.get(t)||0;r.set(t,e+1)}}if(s/i<.3||a/s<.6)return;t({chatId:e,detectedLanguage:Array.from(r.entries()).sort((e,t)=>{let[,n]=e,[,i]=t;return i-n})[0][0]})},1e3);var Z=n(79519),X=n(46275),ee=n(64154),te=n(66644),ne=n(50442),ie=n(43503),oe=n(54464),se=n(672);const ae=3*b.$,re=Number(b.$),le="data-is-document-group-hover";function de(e,t,n,s,a,r,l,d,c,u,h,m,p){const{updateDraftReplyInfo:f,sendDefaultReaction:v}=(0,o.ko)(),[A,y,w]=(0,B.A)(),[b,I,S]=(0,B.A)(),M=(0,i.li)(),N=(0,se.A)(e=>{const t=h.current;if(!t)return;const{clientX:n,clientY:i}=e,{x:o,width:s,y:a,height:r}=t.getBoundingClientRect(),l=o+s/2,d=a+r/2,c=Math.abs(l-n)<ae,u=Math.abs(d-i)<re;c&&u?y():w()},[h],te.YS);return(0,i.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,oe.l)(e),d(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;ie.A.getIsKeyboardVisible()?setTimeout(()=>{l(e)},350):l(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 l(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(le)}(e)},isSwiped:b,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:ce}}function ce(e){const t=ue(e.currentTarget);t&&t.setAttribute(le,"")}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:i}=(0,b.mr)();return(0,be.FD)("div",{className:"embedded-thumb",children:[(0,be.Y)("img",{src:e,width:n,height:i,alt:"",className:"pictogram",draggable:!1}),t&&(0,be.Y)("span",{className:"protector"})]})}const Se=e=>{let{story:t,sender:n,noUserColors:s,isProtected:a,observeIntersectionForLoading:r,onClick:c}=e;const{showNotification:u}=(0,o.ko)(),h=(0,z.A)(),m=(0,i.li)(),p=(0,R.Vz)(m,r),g=t&&"content"in t,v=t&&"isDeleted"in t,A=g&&Boolean(t.content.video),y=g?"Story":v?"ExpiredStory":"Loading",C=(0,ye.A)(g&&(0,l.EN)(t,"pictogram"),!p),w=A?t.content.video.thumbnail?.dataUri:void 0,b=C||w,I=n?(0,d.F9)(h,n):void 0,M=(0,U.A)(()=>{t&&!v?c():u({message:h("StoryNotFound")})}),{handleClick:N,handleMouseDown:Y}=(0,Ae.Q)(M);return(0,be.FD)(we.A,{ref:m,peerColor:n?.color,noUserColors:s,shouldReset:!0,className:(0,f.A)("EmbeddedMessage",b&&"with-thumb"),onClick:N,onMouseDown:Y,children:[b&&Ie(b,a),(0,be.FD)("div",{className:"message-text with-message-color",children:[(0,be.FD)("p",{className:"embedded-text-wrapper",children:[v&&(0,be.Y)(Ce.A,{name:"story-expired",className:"embedded-origin-icon"}),g&&(0,be.Y)(Ce.A,{name:"story-reply",className:"embedded-origin-icon"}),h(y)]}),(0,be.Y)("div",{className:"message-title",children:(0,S.A)(I||" ")})]})]})};var Me=n(2578),Ne=n(9267),Ye=n(74936),ke=n(17794),Pe=n(90603),Fe=n(38102);var Te=n(61911);const De=1.125*b.$,xe=(0,i.ph)(e=>{let{topic:t,className:n,onClick:i}=e;const o=(0,z.A)();return(0,be.FD)("div",{className:(0,f.A)("JldIqqof",n),style:`--topic-button-accent-color: var(${(0,Pe.Mt)(t?.iconColor)})`,onClick:i,children:[t?(0,be.Y)(Fe.A,{topic:t,size:De}):(0,be.Y)("img",{src:Te,alt:"",draggable:!1}),t?.title?(0,S.A)(t.title):o("Loading"),t?.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,i.ph)((0,o.EK)((e,t)=>{const{clickArg:n,noSelectControls:i}=t;return{isInSelectMode:!i&&(0,u.rTV)(e),isSelected:!i&&(0,u.H1_)(e,n)}})(t=>{const{isInSelectMode:n,isSelected:s,dimensions:a,clickArg:r}=t,{toggleMessageSelection:l}=(0,o.ko)(),d=(0,U.A)(e=>{e.stopPropagation(),l({messageId:r,withShift:e?.shiftKey})}),c=(0,i.Kr)(()=>{const{dimensions:e,onClick:i}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:i}},[t,n,s]);return(0,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?d: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),ze=n(25477);const Ke=Oe(Ue.A),Ve=Oe(ze.A),je=(0,o.EK)(e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}})(e=>{let{album:t,observeIntersection:n,hasCustomAppendix:s,isOwn:a,isProtected:r,albumLayout:d,onMediaClick:c,uploadsByKey:h,activeDownloads:m,theme:p}=e;const{cancelUploadMedia:g}=(0,o.ko)(),{content:{paidMedia:f}}=t.mainMessage,v=t.isPaidMedia?f.extendedMedia.length:t.messages.length,y=(0,U.A)(e=>{c(t.mainMessage.id,e)}),C=(0,U.A)(e=>{c(e)}),w=(0,U.A)(e=>{g({chatId:t.mainMessage.chatId,messageId:e})}),b=(0,i.Kr)(()=>t.isPaidMedia?t.mainMessage.content.paidMedia.extendedMedia.map(()=>t.mainMessage):t.messages,[t]),{width:I,height:S}=d.containerStyle;return(0,be.Y)("div",{className:"Album",style:`width: ${I}px; height: ${S}px;`,children:b.map(function(e,i){const c=t.isPaidMedia?e.content.paidMedia?.extendedMedia[i]:void 0,g=c&&"mediaType"in c?c:c?.photo,f=c&&"mediaType"in c?c:c?.video,b=g||(0,l.yl)(e),I=f||(0,l.r_)(e).video,S=h[(0,A.bj)(e)],M=S?.progress,{dimensions:N,sides:Y}=d.layout[i],k=(0,u.wwb)((0,o.mS)(),e),P=(0,u.OEt)((0,o.mS)(),e);if(b){const o=s&&(a?i===v-1:Boolean(8&Y&&4&Y));return(0,be.Y)(Ke,{id:`album-media-${(0,l.GZ)(e.id,t.isPaidMedia?i:void 0)}`,photo:b,isOwn:a,observeIntersectionForLoading:n,canAutoLoad:k,shouldAffectAppendix:o,uploadProgress:M,dimensions:N,isProtected:r,clickArg:t.isPaidMedia?i:e.id,onClick:t.isPaidMedia?y:C,onCancelUpload:w,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,l.$r)(m,b),theme:p,noSelectControls:t.isPaidMedia})}if(I)return(0,be.Y)(Ve,{id:`album-media-${(0,l.GZ)(e.id)}`,video:I,observeIntersectionForLoading:n,canAutoLoad:k,canAutoPlay:P,uploadProgress:M,dimensions:N,isProtected:r,clickArg:t.isPaidMedia?i:e.id,onClick:t.isPaidMedia?y:C,onCancelUpload:w,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,l.$r)(m,I),theme:p,noSelectControls:t.isPaidMedia})})})});var Je=n(95807),$e=n(41733);const qe=7*b.$;function He(e,t,n,s,a,r,l){const{interactWithAnimatedEmoji:d,sendEmojiInteraction:c,sendWatchingEmojiInteraction:u}=(0,o.ko)(),h=(0,i.li)(),m=(0,i.li)(),g=(0,ye.A)(n?`document${n}`:void 0,!n),f=l||qe,v=(0,Je.A)(`width: ${f}px`,`height: ${f}px`,r&&!p.Vq&&"cursor: pointer"),A=(0,i.li)(void 0),y=(0,i.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:i,y:o}=n.getBoundingClientRect();d({emoji:r,x:i,y:o,startSize:f,isReversed:!a}),A.current||(A.current=[],y.current=performance.now(),setTimeout(C,1e3)),A.current.push(y.current?(performance.now()-y.current)/1e3:0)});return(0,i.vJ)(()=>{const n=h.current;n&&s&&s.forEach(i=>{let{id:o,startSize:s,messageId:l}=i;if(s||t!==l)return;const{x:d,y:c}=n.getBoundingClientRect();u({id:o,chatId:e,emoticon:r,startSize:f,x:d,y:c,isReversed:!a}),w()})},[s,e,r,a,t,w,u,f]),{ref:h,size:f,style:v,handleClick:b}}const Ge=(0,i.ph)((0,o.EK)((e,t)=>{let{customEmojiId:n,withEffects:i}=t;const o=(0,u.O8F)(e,n);return{sticker:o,effect:o?.emoji&&i?(0,u.Nr8)(e,o.emoji):void 0,soundId:o?.emoji&&(0,u.tKM)(e,o.emoji),noPlay:!(0,u.BWX)(e)}})(e=>{let{isOwn:t,customEmojiId:n,messageId:i,chatId:o,activeEmojiInteractions:s,sticker:a,effect:r,soundId:l,noPlay:d,observeIntersection:c}=e;const{ref:u,size:h,style:m,handleClick:p}=He(o,i,l,s,t,r?.emoji,(0,M.Rr)(1));return(0,be.Y)(pe.A,{ref:u,documentId:n,className:(0,f.A)("AnimatedEmoji media-inner",a?.id===b.AC&&"like-sticker-thumb"),style:m,size:h,isBig:!0,noPlay:d,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(r&&s?.length),observeIntersectionForLoading:c,onClick:p})}));var We=n(79577);const _e=(0,i.ph)((0,o.EK)((e,t)=>{let{emoji:n,withEffects:i}=t;return{sticker:(0,u.oei)(e,n),effect:i?(0,u.Nr8)(e,n):void 0,soundId:(0,u.tKM)(e,n)}})(e=>{let{isOwn:t,observeIntersection:n,forceLoadPreview:i,messageId:o,chatId:s,activeEmojiInteractions:a,sticker:r,effect:l,soundId:d}=e;const{ref:c,size:u,style:h,handleClick:m}=He(s,o,d,a,t,l?.emoji),p=(0,R.Vz)(c,n);return(0,be.Y)(We.A,{sticker:r,size:u,quality:1,noLoad:!p,forcePreview:i,play:p,forceAlways:!0,ref:c,className:(0,f.A)("AnimatedEmoji media-inner",r?.id===b.AC&&"like-sticker-thumb"),style:h,onClick:m})}));var Qe=n(14242),Ze=n(93809),Xe=n(68292),et=n(57474);const tt=(0,i.ph)(e=>{let{isCustomShape:t,threadInfo:n,disabled:s,isLoading:a,asActionButton:r}=e;const{openThread:l,openFrozenAccountModal:d}=(0,o.ko)(),c=(0,Ze.A)([a],450),h=(0,z.A)(),m=(0,O.A)(),{originMessageId:p,chatId:g,messagesCount:v,lastMessageId:A,lastReadInboxMessageId:y,recentReplierIds:C,originChannelId:w}=n,b=(0,U.A)(()=>{const e=(0,o.mS)();(0,u.trm)(e)?d():l({isComments:!0,chatId:g,originMessageId:p,originChannelId:w})}),I=(0,i.Kr)(()=>{if(!C?.length)return;const e=(0,o.mS)();return C.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[C]);if(void 0===v)return;const S=Boolean(y&&A&&y<A),M=v?h("CommentsCount","%COMMENTS_COUNT%",void 0,v).split("%").map(e=>"COMMENTS_COUNT"===e?(0,be.Y)(Xe.A,{text:(0,Qe.Vw)(m,v)}):e):void 0;return(0,be.FD)("div",{"data-cnt":(0,Qe.Vw)(m,v),className:(0,f.A)("CommentButton",S&&"has-unread",s&&"disabled",t&&"CommentButton-custom-shape",a&&"loading",r&&"as-action-button"),dir:h.isRtl?"rtl":"ltr",onClick:b,role:"button",tabIndex:0,children:[(0,be.Y)(Ce.A,{name:"comments-sticker",className:(0,f.A)("CommentButton_icon-comments",a&&c&&"CommentButton_hidden")}),!I?.length&&(0,be.Y)(Ce.A,{name:"comments"}),Boolean(I?.length)&&(0,be.Y)("div",{className:"recent-repliers",dir:h.isRtl?"rtl":"ltr",children:I.map(e=>(0,be.Y)(me.A,{size:"small",peer:e},e.id))}),(0,be.Y)("div",{className:"label",dir:"auto",children:v?M:h("LeaveAComment")}),(0,be.FD)("div",{className:"CommentButton_right",children:[a&&(0,be.Y)(et.A,{className:(0,f.A)("CommentButton_loading",!c&&"CommentButton_hidden"),color:t?"white":"blue"}),(0,be.Y)(Ce.A,{name:"next",className:(0,f.A)("CommentButton_icon-open",a&&c&&"CommentButton_hidden")})]})]})});var nt=n(85982),it=n(64713);const ot="ReDHhQHm";function st(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const at=(0,o.EK)((e,t)=>{let{contact:n}=t;const{countryList:{phoneCodes:i}}=e;return{user:(0,u.mBe)(e,n.userId),phoneCodeList:i}})(e=>{let{contact:t,user:n,phoneCodeList:i,noUserColors:s}=e;const a=(0,z.A)(),{openChat:r,openAddContactDialog:d,showNotification:c,openChatWithInfo:u}=(0,o.ko)(),{phoneNumber:h,userId:m}=t,p="0"!==m,g=p&&n&&(0,l.Gh)(n),f=(0,U.A)(()=>{r({id:m})}),v=(0,U.A)(()=>{d({userId:n?.id})}),A=(0,U.A)(()=>{n?u({id:m}):((0,nt.eM)(h),c({message:a("PhoneCopied")}))});return(0,be.FD)(we.A,{noUserColors:s,peer:n,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,be.FD)("div",{className:"tpDpg82n",onClick:A,children:[(0,be.Y)(me.A,{size:"medium",peer:n,text:st(t)}),(0,be.FD)("div",{className:"fpYynE5s",children:[(0,be.Y)("div",{className:"_PNTJc_V",children:n?(0,l.Yg)(n):st(t)}),(0,be.Y)("div",{className:"JP_3wes8",children:(0,it.Ox)(i,h)})]})]}),p&&(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:f,className:ot,children:a("SharedContactMessage")}),g&&(0,be.Y)(Le.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:v,className:ot,children:a("SharedContactAdd")})]})]})]})});var rt=n(80089),lt=n(80464);const dt=e=>{const{isOpen:t}=e,n=(0,lt.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,i.ph)(e=>{let{factCheck:t,isToggleDisabled:n}=e;const o=(0,z.A)(),s=(0,i.li)(),a=(0,i.li)(),{isCollapsed:r,isCollapsible:l,setIsCollapsed:d}=(0,ut.A)(s,4,a),c=(0,i.Kr)(()=>{if(t.countryCode&&o.code)return new Intl.DisplayNames([o.code],{type:"region"}).of(t.countryCode)},[t.countryCode,o.code]),u=!n&&r,h=(0,U.A)(()=>{d(!1)}),m=(0,U.A)(()=>{d(e=>!e)});if(t.text)return(0,be.FD)(we.A,{peerColor:mt,className:"HMB5LgeX",onClick:u?h:void 0,children:[(0,be.FD)("div",{ref:a,className:(0,f.A)("nfCzKu78",r&&"hYzpXwTM"),children:[(0,be.Y)("div",{className:"vZnCPl3t",children:o("FactCheck")}),(0,be.Y)("div",{ref:s,className:"k_dGolcu",children:(0,ct.fd)({text:t.text.text,entities:t.text.entities})}),(0,be.Y)(ht.A,{className:"qRaSs5iA"}),(0,be.Y)("div",{className:"EDmr0wJG",children:o("FactCheckFooter",c)})]}),l&&(0,be.Y)("div",{className:(0,f.A)("mxPizZpR",!n&&"Cj2cLczd"),onClick:n?void 0:m,"aria-hidden":!0,children:(0,be.Y)(Ce.A,{name:r?"down":"up"})})]})});var gt=n(55158);const ft=(0,i.ph)(e=>{let{message:t,threadId:n,canAutoLoadMedia:i}=e;const{clickBotInlineButton:s}=(0,o.ko)(),a=t.content.game,{title:r,description:d}=a,c=(0,l.zb)(a),u=(0,l.ih)(a),h=(0,ye.A)(c,!i),m=(0,ye.A)(u,!i);return(0,be.FD)("div",{className:"Game",children:[(0,be.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{s({chatId:t.chatId,messageId:t.id,threadId:n,button:t.inlineButtons[0][0]})},children:[!h&&!m&&(0,be.Y)(gt.A,{className:"skeleton preview-content"}),h&&(0,be.Y)("img",{className:"preview-content",src:h,alt:r,draggable:!1}),m&&(0,be.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:m})]}),(0,be.Y)("div",{className:"title",children:r}),!(0,l.P5)(t)&&(0,be.Y)("div",{className:"description",children:d})]})});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",Yt="FV70u896",kt=(0,i.ph)((0,o.EK)((e,t)=>{let{message:n}=t;const{giveaway:i}=n.content,o=(0,u.hds)(e,n.chatId);return{chat:o,sender:(i?.channelIds[0]?(0,u.hds)(e,i.channelIds[0]):void 0)||(0,u.Szq)(e,n)||o,giftSticker:i&&(0,u.t0O)(e,i.months),canPlayAnimatedEmojis:(0,u.BWX)(e)}})(e=>{let{chat:t,sender:n,message:s,canPlayAnimatedEmojis:a,giftSticker:r}=e;const{openChat:c}=(0,o.ko)(),u=(0,i.li)(!1),[h,m]=(0,i.J0)(),p=(0,z.A)(),{giveaway:g,giveawayResults:v}=s.content,A=Boolean(v),{months:C,untilDate:w,prizeDescription:b,stars:I}=g||v,M=(0,l.Ie)(s),N=A?v.winnersCount:g.quantity,Y=(0,y.Fm)()>w,k=(0,i.Kr)(()=>{if(A)return;const e=new Intl.DisplayNames([p.code,"en"].filter(Boolean),{type:"region"});return g?.countries?.map(t=>`${(0,At.D0)(t)} ${e.of(t)}`).join(", ")},[g,A,p.code]),P=(0,U.A)(e=>{c({id:e})}),F=(0,U.A)(async()=>{if(u.current)return;u.current=!0;const e=await(0,yt.px)("fetchGiveawayInfo",{peer:t,messageId:s.id});m(e),u.current=!1}),T=(0,U.A)(()=>{m(void 0)}),D=(0,i.Kr)(()=>{if(h)return p("results"===h.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")},[h,p]);return(0,be.FD)("div",{className:"CbpKtOey",children:[(0,be.FD)("div",{className:(0,f.A)("hjjKhvVv",A&&"JEiR48jJ"),children:[A?(0,be.Y)(wt.A,{size:150,tgsUrl:Ct.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,be.Y)(We.A,{sticker:r,play:a&&Y,noLoop:!0,nonInteractive:!0,size:175}),(0,be.Y)("span",{className:"n_QCMv_A",children:`x${N}`})]}),A?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)(p("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,S.A)(p("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,be.Y)("strong",{className:It,children:p("lng_prizes_results_winners")}),(0,be.Y)("div",{className:Nt,children:t.map(e=>(0,be.Y)(bt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!M,className:Yt,clickArg:e,onClick:P}))})]}),(0,be.Y)("div",{className:St,children:(0,be.Y)("p",{className:Mt,children:p("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(v):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)(p("BoostingGiveawayPrizes"),["simple_markdown"])}),b&&(0,be.FD)(be.FK,{children:[(0,be.Y)("p",{className:Mt,children:(0,S.A)(p("BoostingGiveawayMsgPrizes",[N,b],void 0,N),["simple_markdown"])}),(0,be.Y)(ht.A,{children:p("BoostingGiveawayMsgWithDivider")})]}),(0,be.Y)("p",{className:Mt,children:s?.content?.giveaway?.stars?(0,be.FD)(be.FK,{children:[(0,S.A)(p("Chat.Giveaway.Message.Stars.PrizeText",p("Stars",s?.content?.giveaway?.stars)),["simple_markdown"]),(0,be.Y)("br",{}),(0,S.A)(p("AmongWinners",N),["simple_markdown"])]}):(0,be.FD)(be.FK,{children:[(0,S.A)(p("Chat.Giveaway.Info.Subscriptions",N),["simple_markdown"]),(0,be.Y)("br",{}),(0,S.A)(p("ActionGiftPremiumSubtitle",p("Chat.Giveaway.Info.Months",C)),["simple_markdown"])]})})]}),(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:It,children:(0,S.A)(p("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,S.A)(p("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:!M,className:Yt,clickArg:e,onClick:P}))}),k&&(0,be.Y)("span",{children:(0,S.A)(p("Chat.Giveaway.Message.CountriesFrom",k))})]}),(0,be.FD)("div",{className:St,children:[(0,be.Y)("strong",{className:It,children:(0,S.A)(p("BoostingWinnersDate"),["simple_markdown"])}),(0,be.Y)("p",{className:Mt,children:(0,vt.L2)(1e3*w,p.code,!0)})]})]})}(g),(0,be.Y)(Le.A,{className:"jMBw7STU",color:"adaptive",onClick:F,children:p("BoostingHowItWork")}),(0,be.Y)(Be.A,{isOpen:Boolean(h),isOnlyConfirm:!0,title:D,confirmHandler:T,onClose:T,children:function(){if(!n||!h)return;const e="results"===h.type,t=(0,d.vj)(n)?(0,l.Js)(p,n):(0,l.Yg)(n),i=(0,vt.U)(p,1e3*w),s=g?.channelIds?g.channelIds.length-1:0,a=p("Chat.Giveaway.Info.OtherChannels",s),r=s>0,c=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",u=e?p("Chat.Giveaway.Info.Months",C):p("Stars",I,"i"),m=p(c,[t,N,u],void 0,N),f=b?p("BoostingGiveawayHowItWorksIncludeText",[t,N,b],void 0,N):void 0;let v="";v=e?r?"BoostingGiveawayHowItWorksSubTextSeveralEnd":"BoostingGiveawayHowItWorksSubTextEnd":r?"BoostingGiveawayHowItWorksSubTextSeveral":"BoostingGiveawayHowItWorksSubText";let A=p(v,[i,N,t,s],void 0,N);e&&h.activatedCount&&(A+=` ${p("BoostingGiveawayUsedLinksPlural",h.activatedCount)}`);let y="";e&&(y=h.isRefunded?p("BoostingGiveawayCanceledByPayment"):p(h.isWinner?"BoostingGiveawayYouWon":"BoostingGiveawayYouNotWon"));let M="";if(e);else if(h.disallowedCountry)M=p("BoostingGiveawayNotEligibleCountry");else if(h.adminDisallowedChatId){const e=(0,o.mS)().chats.byId[h.adminDisallowedChatId],t=e&&(0,l.Js)(p,e);M=p("BoostingGiveawayNotEligibleAdmin",t)}else if(h.joinedTooEarlyDate){const e=(0,vt.U)(p,1e3*h.joinedTooEarlyDate);M=p("BoostingGiveawayNotEligible",e)}else M=h.isParticipating?r?p("Chat.Giveaway.Info.ParticipatingMany",[t,s]):p("Chat.Giveaway.Info.Participating",t):r?p("Chat.Giveaway.Info.NotQualifiedMany",[t,a,i]):p("Chat.Giveaway.Info.NotQualified",[t,i]);return(0,be.FD)(be.FK,{children:[y&&(0,be.Y)("p",{className:"ZQ4aVVkI",children:(0,S.A)(y,["simple_markdown"])}),(0,be.Y)("p",{children:(0,S.A)(m,["simple_markdown"])}),f&&(0,be.Y)("p",{children:(0,S.A)(f,["simple_markdown"])}),(0,be.Y)("p",{children:(0,S.A)(A,["simple_markdown"])}),M&&(0,be.Y)("p",{children:(0,S.A)(M,["simple_markdown"])})]})}()})]})}));var Pt=n(85449);const Ft=(0,i.ph)(e=>{let{message:t,onClick:n}=e;const o=(0,z.A)(),s=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"})}},a=(0,i.Kr)(()=>{const e=[];return t.inlineButtons.forEach(t=>{e.push(t.map(e=>(0,Pt.A)(o,e)))}),e},[o,t.inlineButtons]);return(0,be.Y)("div",{className:"InlineButtons",children:t.inlineButtons.map((e,i)=>(0,be.Y)("div",{className:"row",children:e.map((e,o)=>(0,be.FD)(Le.A,{size:"tiny",ripple:!0,disabled:"unsupported"===e.type||"suggestedMessage"===e.type&&e.disabled,onClick:()=>n({chatId:t.chatId,messageId:t.id,button:e}),children:[s(e),(0,be.Y)("span",{className:"inline-button-text",children:a[i][o]})]}))}))})});var Tt=n(17142),Dt=n(40435),xt=n(37859),Et=n(61097);const Lt=(0,i.ph)(e=>{let{message:t,shouldAffectAppendix:n,isInSelectMode:o,isSelected:s,theme:a,forcedWidth:d}=e;const c=(0,i.li)(),u=(0,z.A)(),h=(0,O.A)(),m=(0,l.NO)(t),{title:p,description:g,amount:f,currency:v,isTest:A,photo:y}=m,C=(0,ye.A)((0,l.cy)(y)),w=Boolean(d),b=(0,Et.A)(C,!w),I=t.id;(0,xt.A)(e=>{let[t]=e;if(n){if(C){const e=c.current.closest(r.KFG);(0,Dt.A)(C,!1,I,s,a).then(t=>{(0,te.RK)(()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")})})}}else t&&c.current.closest(r.KFG).removeAttribute(r.D3G)},[n,C,o,s,a,I]);const M=d||y?.dimensions?.width,N=(0,Je.A)(y?.dimensions&&`width: ${M}px`,y?.dimensions&&`aspect-ratio: ${y.dimensions.width} / ${y.dimensions.height}`,Boolean(!y?.dimensions&&d)&&`width: ${d}px`);return(0,be.FD)("div",{ref:c,className:"Invoice",children:[p&&(0,be.Y)("p",{className:"title",children:(0,S.A)(p)}),g&&(0,be.Y)("div",{className:"info",children:(0,S.A)(g,["emoji","br"])}),(0,be.FD)("div",{className:"description "+(y?"has-image":""),children:[Boolean(y)&&(0,be.FD)("div",{className:"invoice-image-container",children:[w&&(0,be.Y)("canvas",{ref:b,className:"thumbnail blurred-bg"}),C&&(0,be.Y)("img",{className:"invoice-image",src:C,alt:"",style:N,crossOrigin:"anonymous",draggable:!1}),!C&&y&&(0,be.Y)(gt.A,{width:M,height:y.dimensions?.height,forceAspectRatio:!0})]}),(0,be.FD)("p",{className:"description-text",children:[(0,Tt.vv)(h,f,v,{iconClassName:"invoice-currency-icon"}),A&&(0,be.Y)("span",{className:"test-invoice",children:u("PaymentTestInvoice")})]})]})]})});var Bt=n(32625),Rt=n(27860);const Ot={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Ut=(0,i.ph)(e=>{let{message:t,isConnected:n}=e;const{openInvoice:i,loadExtendedMedia:s}=(0,o.ko)(),a=(0,z.A)(),r=(0,l.NO)(t),{chatId:d,id:c}=t,u=(0,U.A)(()=>{s({chatId:d,ids:[c]})});(0,Bt.A)(u,n?3e4:void 0);const{amount:h,currency:m,extendedMedia:p}=r,{width:g,height:v,thumbnail:A,duration:y}=p,C=(0,U.A)(()=>{i({type:"message",chatId:d,messageId:c,isExtendedMedia:!0})});return(0,be.FD)("div",{className:(0,f.A)(Ot.root,"media-inner"),onClick:C,children:[(0,be.Y)(Rt.A,{thumbDataUri:A?.dataUri,width:g,height:v,isVisible:!0,className:Ot.spoiler}),Boolean(y)&&(0,be.Y)("div",{className:Ot.duration,children:(0,vt.QO)(y)}),(0,be.FD)("div",{className:Ot.buy,children:[(0,be.Y)(Ce.A,{name:"lock",className:Ot.lock}),a("Checkout.PayPrice",(0,Tt.Ad)(h,m))]})]})});var zt=n(47526),Kt=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,i.ph)(e=>{let{message:t,peer:n}=e;const{openMapModal:s}=(0,o.ko)(),a=(0,i.li)(),r=(0,i.li)(),d=(0,z.A)(),c=(0,Vt.A)(),u=(0,l.fB)(t),{mediaType:h,geo:m}=u,p=(0,y.Fm)(),g=(0,l.vz)(t),v="geoLive"!==h||g?void 0:t.date+u.period-p,[A,C]=(0,i.J0)(m),w="venue"===h||"geoLive"===h&&!g,{width:b,height:I,zoom:S}=Ht,M=(0,jt.A)(),N=(0,l.rt)(A,b,I,S,M),Y=(0,ye.A)(N),k=(0,K.A)(Y,!0),P=Y||k,F=(0,i.Kr)(()=>{if("geoLive"!==h||!A.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=A;return t/(0,zt._u)(e,S)},[h,A,S]),T=(0,U.A)(e=>{if("geoLive"!==h)return;const n=e.lastElementChild,i=e.firstElementChild,o=t.date+u.period-(0,y.Fm)(),s=(1-o/u.period)*$t,a=(0,vt.dq)(d,1e3*o);i.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)});function D(){const e=(0,f.A)("pin",h,g&&"expired");if("geoLive"===h)return(0,be.FD)("div",{className:e,children:[(0,be.Y)(Gt,{}),(0,be.Y)(me.A,{peer:n,className:"location-avatar"}),void 0!==u.heading&&(0,be.Y)("div",{className:"direction",style:`--direction: ${u.heading}deg`})]});if("venue"===h){const t=(0,zt.PP)(u.venueType),n=(0,zt.KE)(u.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,i.Nf)(()=>{r.current&&T(r.current)},[T]),(0,i.vJ)(()=>{Math.abs(m.lat-A.lat)<qt&&Math.abs(m.long-A.long)<qt?A.accuracyRadius!==m.accuracyRadius&&C({...A,accuracyRadius:m.accuracyRadius}):C(m)},[m,A]),(0,Kt.A)(()=>{c()},g?void 0:1e3*(v||0)),(0,Bt.A)(()=>{(0,te.RK)(()=>{const e=r.current;e&&T(e)})},v?1e3:void 0),(0,be.FD)("div",{ref:a,className:"Location media-inner interactive",onClick:()=>{s({geoPoint:A,zoom:S})},children:[(0,be.FD)("div",{className:"map-wrapper",children:[P?(0,be.Y)("img",{className:"full-media map",src:P,alt:"Location on a map",draggable:!1,style:`width: ${Ht.width}px; height: ${Ht.height}px;`}):(0,be.Y)(gt.A,{width:b,height:I}),function(){if(P)return(0,be.FD)(be.FK,{children:[Boolean(F)&&!g&&(0,be.Y)("div",{className:"location-accuracy",style:`width: ${2*F}px; height: ${2*F}px`}),D()]})}()]}),function(){if(w)return"venue"===h?(0,be.FD)("div",{className:"location-info",children:[(0,be.Y)("div",{className:"location-info-title",children:u.title}),(0,be.Y)("div",{className:"location-info-subtitle",children:u.address})]}):"geoLive"===h?(0,be.FD)("div",{className:"location-info",children:[(0,be.Y)("div",{className:"location-info-title",children:d("AttachLiveLocation")}),(0,be.Y)("div",{className:"location-info-subtitle",children:(0,vt.IF)(d,p,t.editDate)}),!g&&(0,be.FD)("div",{className:"geo-countdown",ref:r,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,i.ph)(e=>{let{message:t,outgoingStatus:n,signature:s,withReactionOffset:a,repliesThreadInfo:r,renderQuickReactionButton:l,noReplies:d,isTranslated:c,isPinned:u,withFullDate:h,effectEmoji:m,onClick:p,onTranslationClick:g,onEffectClick:v,onOpenThread:A,paidMessageStars:y}=e;const{showNotification:C}=(0,o.ko)(),[w,b]=(0,B.A)(),I=(0,z.A)(),M=(0,O.A)();function N(e){e.stopPropagation(),C({message:{key:"ImportedInfo"}})}const Y=(0,i.Kr)(()=>{if(!w)return;const e=(0,vt.L2)(1e3*t.date,I.code,void 0,I.timeFormat),n=t.isEdited&&(0,vt.L2)(1e3*t.editDate,I.code,void 0,I.timeFormat),i=t.forwardInfo&&(0,vt.L2)(1e3*(t.forwardInfo.savedDate||t.forwardInfo.date),I.code,void 0,I.timeFormat);let o=e;return n&&(o+="\n",o+=M("MessageTooltipEditedDate",{date:n})),i&&(o+="\n",o+=M("MessageTooltipForwardedDate",{date:i})),o},[w,I,t,I.timeFormat]),k=(0,i.Kr)(()=>{if(!t.viewsCount)return;let e=M("MessageTooltipViews",{count:M.number(t.viewsCount)},{pluralValue:t.viewsCount});return t.forwardsCount&&(e+="\n",e+=M("MessageTooltipForwards",{count:M.number(t.forwardsCount)},{pluralValue:t.forwardsCount})),e},[M,t.forwardsCount,t.viewsCount]),P=(0,i.Kr)(()=>{const e=r?.messagesCount;if(e)return M("MessageTooltipReplies",{count:e},{pluralValue:e})},[M,r]),F=(0,i.Kr)(()=>{const e=(0,vt.fU)(I,1e3*t.date);return h?(0,vt.be)(I,1e3*(t.forwardInfo?.date||t.date),!0):e},[I,t.date,t.forwardInfo?.date,h]),T=(0,f.A)("MessageMeta",a&&"reactions-offset",t.forwardInfo?.isImported&&"is-imported");return(0,be.FD)("span",{className:T,dir:M.isRtl?"rtl":"ltr",onClick:p,"data-ignore-on-paste":!0,children:[m&&(0,be.Y)("span",{className:"message-effect-icon",onClick:v,children:(0,S.A)(m)}),c&&(0,be.Y)(Ce.A,{name:"language",className:"message-translated",onClick:g}),Boolean(t.viewsCount)&&(0,be.FD)(be.FK,{children:[(0,be.Y)("span",{className:"message-views",title:k,children:(0,Qe.Vw)(M,t.viewsCount)}),(0,be.Y)(Ce.A,{name:"channelviews"})]}),!d&&Boolean(r?.messagesCount)&&(0,be.FD)("span",{onClick:function(e){e.stopPropagation(),A()},className:"message-replies-wrapper",title:P,children:[(0,be.Y)("span",{className:"message-replies",children:(0,be.Y)(Xe.A,{text:(0,Qe.Vw)(M,r.messagesCount)})}),(0,be.Y)(Ce.A,{name:"reply-filled"})]}),u&&(0,be.Y)(Ce.A,{name:"pinned-message",className:"message-pinned"}),s&&(0,be.Y)("span",{className:"message-signature",children:(0,S.A)(s)}),Boolean(y)&&(0,be.Y)("span",{className:"message-price",children:(0,Zt.U2)(M,y,{asFont:!0,className:"message-price-star-icon",containerClassName:"message-price-stars-container"})}),(0,be.FD)("span",{className:"message-time",title:Y,onMouseEnter:b,children:[t.forwardInfo?.isImported&&(0,be.FD)(be.FK,{children:[(0,be.Y)("span",{className:"message-imported",onClick:N,children:(0,vt.L2)(1e3*t.forwardInfo.date,M.code,!0)}),(0,be.Y)("span",{className:"message-imported",onClick:N,children:M("MessageMetaImported")})]}),t.isEdited&&`${M("MessageMetaEdited")} `,t.isVideoProcessingPending&&`${M("MessageMetaApproximate")} `,F]}),n&&(0,be.Y)(Xt.A,{status:n}),l&&l()]})});var tn=n(4262);const nn=(0,i.ph)(e=>{let{phoneCall:t,message:n,chatId:s}=e;const{requestMasterAndRequestCall:a}=(0,o.ko)(),r=(0,z.A)(),{isVideo:l,reason:d,duration:c}=t,u=n.isOutgoing,h="missed"===d,m="busy"===d||void 0===c,p=(0,U.A)(()=>{a({isVideo:l,userId:s})}),v=(0,i.Kr)(()=>t.duration?(0,vt.zA)(r,t.duration):void 0,[r,t.duration]),A=(0,vt.fU)(r,1e3*n.date);return(0,be.FD)("div",{className:"wqsZyy8u",children:[(0,be.Y)(Le.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:p,className:"NGmo4ADz",disabled:!g.OL,ariaLabel:r(u?"CallAgain":"CallBack"),children:(0,be.Y)(Ce.A,{name:l?"video-outlined":"phone"})}),(0,be.FD)("div",{className:"iFn6m6hd",children:[(0,be.Y)("div",{className:"l8QfocIQ",children:r((0,tn.fB)(t,n.isOutgoing))}),(0,be.FD)("div",{className:"rF5tkx92",children:[(0,be.Y)(Ce.A,{name:"arrow-right",className:(0,f.A)("ONmpzmUS",h&&"Alra_BWu",m&&"J7xsuCAm",!u&&"BfgDXljM")}),(0,be.Y)("span",{className:"kKPKwFzu",children:v?r("CallMessageWithDuration",[A,v]):A})]})]})]})});var on=n(98607);const sn=(0,i.ph)(e=>{let{paidMedia:t,chatId:n,messageId:s,isOutgoing:a,children:l}=e;const{openInvoice:d}=(0,o.ko)(),c=(0,z.A)(),u=(0,O.A)(),h=!t.isBought,m=(0,i.Kr)(()=>{const e=c("UnlockPaidContent",t.starsAmount);return(0,on.i)(e,r.Cyx,(0,be.Y)(Ne.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))},[c,t]),p=(0,U.A)(e=>{d({type:"message",chatId:n,messageId:s}),(0,C.A)(e)});return(0,be.FD)("div",{className:"mVaSjZRJ",onClick:h?p:void 0,children:[l,h&&(0,be.Y)(Le.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,be.Y)("span",{className:"gLaaVQXr",children:m})}),t.isBought&&(0,be.Y)("div",{className:(0,f.A)("message-paid-media-status","IGXW5hWr"),children:a?(0,Zt.U2)(u,t.starsAmount):c("Chat.PaidMedia.Purchased")})]})});var an=n(26875),rn=n(77561),ln=n(1087);function dn(e,t){return t>0?(e/t*100).toFixed():0}const cn=e=>{let{answer:t,voteResults:n,totalVoters:o,maxVotersCount:s,correctResults:a,shouldAnimate:r}=e;const l=(0,O.A)(),d=n&&n.find(e=>e.option===t.option),c=0===a.length||-1!==a.indexOf(t.option),u=a.length>0&&c||d?.isChosen,h=d?dn(d.votersCount,o||0):0,[m,p]=(0,i.J0)(r?0:h),g=d?dn(d.votersCount,s||0):0,v=m!==h;if((0,i.vJ)(()=>{r&&p(h)},[r,h]),!n||!d)return;const A=`width: ${g}%; transform:scaleX(${v?0:1})`;return(0,be.FD)("div",{className:"PollOption",dir:l.isRtl?"rtl":void 0,children:[(0,be.FD)("div",{className:"poll-option-share "+("100"===h?"limit-width":""),children:[h,"%",u&&(0,be.Y)("span",{className:(0,f.A)("poll-option-chosen",!c&&"wrong",r&&"animate"),children:(0,be.Y)(Ce.A,{name:c?"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:t.text.text,entities:t.text.entities})}),(0,be.FD)("div",{className:(0,f.A)("poll-option-answer",u&&!c&&"wrong"),children:[r&&(0,be.Y)("svg",{className:"poll-line",style:v?"":"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:A})]})]})]})},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,i.ph)(e=>{let{message:t,poll:n,observeIntersectionForLoading:s,observeIntersectionForPlaying:a,onSendVote:r}=e;const{loadMessage:l,openPollResults:d,requestConfetti:c,showNotification:h}=(0,o.ko)(),{id:m,chatId:p}=t,{summary:g,results:f}=n,[v,C]=(0,i.J0)(!1),[w,b]=(0,i.J0)([]),[I,S]=(0,i.J0)(!1),[M,N]=(0,i.J0)(!g.closed&&g.closeDate&&g.closeDate>0?Math.min(g.closeDate-(0,y.Fm)(),g.closePeriod):0),Y=(0,i.li)(),k=(0,i.li)(),{results:P,totalVoters:F}=f,T=P&&P.some(e=>e.isChosen),D=!g.closed&&!T,x=!D&&g.isPublic&&Number(f.totalVoters)>0,E=D&&g.multipleChoice,L=f.recentVoterIds,B=P?Math.max(...P.map(e=>e.votersCount)):F,R=(0,i.Kr)(()=>P?.filter(e=>e.isCorrect).map(e=>e.option)||[],[P]),O=(0,i.Kr)(()=>g.answers.map(e=>({label:(0,ct.fd)({text:e.text.text,entities:e.text.entities,observeIntersectionForLoading:s,observeIntersectionForPlaying:a}),value:e.option,hidden:Boolean(g.quiz&&g.closePeriod&&M<=0)})),[M,s,a,g.answers,g.closePeriod,g.quiz]);(0,i.vJ)(()=>{const e=n.results.results?.find(e=>e.isChosen);v&&e&&(e.isCorrect&&c({}),C(!1))},[v,n.results.results,c]),(0,i.Nf)(()=>{if(M>0&&setTimeout(()=>N(M-1),1e3),!k.current)return;M<=5&&Y.current.classList.add("hurry-up");const e=(g.closePeriod-M)/g.closePeriod*un;k.current.setAttribute("stroke-dashoffset",`-${e}`)},[M,g.closePeriod]),(0,i.vJ)(()=>{g.quiz&&(M<=0||T&&!g.closed)&&l({chatId:p,messageId:m})},[p,M,T,l,m,g.closed,g.quiz]),(0,i.vJ)(()=>{let e;return g.quiz&&!g.closed&&g.closePeriod&&g.closePeriod>0&&(e=window.setTimeout(()=>{l({chatId:p,messageId:m})},1e3*g.closePeriod)),()=>{e&&window.clearTimeout(e)}},[D,p,l,m,g.closePeriod,g.closed,g.quiz]);const K=(0,i.Kr)(()=>{const e=(0,o.mS)();return L?L.reduce((t,n)=>{const i=(0,u.PVB)(e,n);return i&&t.push(i),t},[]):[]},[L]),V=(0,U.A)(e=>{b([e]),C(!0),S(!0),r([e])}),j=(0,U.A)(e=>{b(e)}),J=(0,U.A)(()=>{C(!0),S(!0),r(w)}),$=(0,U.A)(()=>{d({chatId:p,messageId:m})}),q=(0,U.A)(()=>{h({localId:(0,A.bj)(t),message:(0,ct.fd)({text:n.results.solution,entities:n.results.solutionEntities}),duration:5e3,containerSelector:"#middle-column-portals"})});(0,i.vJ)(()=>{I&&T&&g.quiz&&f.results&&n.results.solution&&(f.results.find(e=>e.isChosen&&e.isCorrect)||q())},[T,I,f.results,g.quiz,n.results.solution]);const H=(0,z.A)();return(0,be.FD)("div",{className:"Poll",dir:H.isRtl?"auto":"ltr",children:[(0,be.Y)("div",{className:"poll-question",children:(0,ct.fd)({text:g.question.text,entities:g.question.entities,observeIntersectionForLoading:s,observeIntersectionForPlaying:a})}),(0,be.FD)("div",{className:"poll-type",children:[H(hn(g)),K.length>0&&(0,be.Y)("div",{className:"poll-recent-voters",children:(0,be.Y)(an.A,{size:"micro",peers:K})}),M>0&&D&&(0,be.FD)("div",{ref:Y,className:"poll-countdown",children:[(0,be.Y)("span",{children:(0,vt.QO)(M)}),(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"})})]}),g.quiz&&n.results.solution&&!D&&(0,be.Y)(Le.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:q,ariaLabel:"Show Solution",children:(0,be.Y)(Ce.A,{name:"lamp"})})]}),D&&(0,be.Y)("div",{className:"poll-answers",onClick:pn,children:E?(0,be.Y)(rn.A,{options:O,selected:w,onChange:j,disabled:t.isScheduled||v,loadingOptions:v?w:void 0,isRound:!0}):(0,be.Y)(ln.A,{name:`poll-${m}`,options:O,onChange:V,disabled:t.isScheduled||v,loadingOption:v?w[0]:void 0})}),!D&&(0,be.Y)("div",{className:"poll-results",children:g.answers.map(function(e){return(0,be.Y)(cn,{shouldAnimate:I||!D,answer:e,voteResults:P,totalVoters:F,maxVotersCount:B,correctResults:R},e.option)})}),!x&&!E&&(0,be.Y)("div",{className:"poll-voters-count",children:mn(H,g.quiz,f.totalVoters)}),E&&(0,be.Y)(Le.A,{isText:!0,disabled:0===w.length,size:"tiny",onClick:J,children:H("PollSubmitVotes")}),x&&(0,be.Y)(Le.A,{isText:!0,size:"tiny",onClick:$,children:H("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,i.ph)((0,o.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(e=>{let{message:t,shouldLoop:n,shouldPlayEffect:a,withEffect:r,isMediaNsfw:d,onStopEffect:c,observeIntersection:u,observeIntersectionForPlaying:h,needsAgeVerification:m}=e;const{showNotification:p,openStickerSet:v,updateContentSettings:A,openAgeVerificationModal:y}=(0,o.ko)(),C=(0,z.A)(),{isMobile:w}=(0,D.Ay)(),I=(0,i.li)(),S=(0,i.li)(),M=t.content.sticker,{stickerSetInfo:N,isVideo:Y,hasEffect:k}=M,P=!t.isOutgoing,[F,T,x]=(0,B.A)(),[E,L]=(0,i.J0)(!1),O=d,[K,V,j]=(0,B.A)(O);(0,i.vJ)(()=>{O?V():j()},[O]);const J=(0,U.A)(()=>{x(),j(),E&&A({isSensitiveEnabled:!0})}),$=M.isPreloadedGlobally?void 0:(0,l.Mw)(M,Y&&!g.OF?"pictogram":"inline"),q=(0,R.Vz)(I,u),H=(0,R.Vz)(I,h),G=`sticker${M.id}?size=f`,W=(0,ye.A)(G,!q||!k||!r,s.qZ.BlobUrl),[_,Q,Z]=(0,B.A)(),X=(0,l.VD)(M),ee=(0,U.A)(()=>{Z(),c?.()});(0,i.vJ)(()=>{k&&r&&H&&a&&Q()},[k,H,a,Q,r]);const te=k&&r&&W&&_;(0,An.A)({anchorRef:I,overlayRef:S,isMirrored:P,isDisabled:!te});const ne=(0,U.A)(()=>{v({stickerSetInfo:M.stickerSetInfo})}),ie=(0,U.A)(()=>{if(K)return d?m?void y():void T():void j();if(k){if(_||!r)return void p({message:C("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:M.stickerSetInfo}},actionText:C("ViewAction")});if(r)return void Q()}ne()}),oe="isMissing"in N,{width:se,height:ae}=(0,b.bu)(M,w),re=(0,f.A)("media-inner","FPceNkgD",oe&&"hruUWBuj",k&&P&&In);return(0,be.FD)("div",{ref:I,className:re,style:`width: ${se}px; height: ${ae}px;`,onClick:oe?void 0:ie,children:[(0,be.Y)(wn.A,{containerRef:I,sticker:M,fullMediaHash:$,fullMediaClassName:"full-media",size:se,shouldLoop:n,noLoad:!q,noPlay:!H,withSharedAnimation:!0}),(0,be.Y)(Rt.A,{isVisible:K,withAnimation:!0,thumbDataUri:X,width:se,height:ae,className:"media-spoiler",isNsfw:d}),te&&(0,be.Y)(bn.A,{children:(0,be.Y)(yn.A,{ref:S,className:(0,f.A)("WMMaWlOL",P&&In),tgsUrl:W,size:1.49*se,play:!0,isLowPriority:!0,noLoop:!0,onEnded:ee},G)}),(0,be.Y)(Cn.A,{isOpen:F,onClose:x,shouldAlwaysShow:E,onAlwaysShowChanged:L,confirmHandler:J})]})}));var Mn=n(45470),Nn=n(14),Yn=n(50680),kn=n(59816);const Pn=(0,i.ph)(function(e){let{story:t,isPreview:n,isProtected:s,isConnected:a}=e;const{openStoryViewer:r,loadPeerStoriesByIds:d,showNotification:c}=(0,o.ko)(),u=(0,z.A)(),{isMobile:h}=(0,D.Ay)(),m=t&&"isDeleted"in t,p=t&&"content"in t,v=p?t.content.video:void 0,A=p?(0,l.EN)(t):void 0,y=(0,ye.A)(A),C=p?v?v.thumbnail?.dataUri:t.content.photo?.thumbnail?.dataUri:void 0,w=(0,Nn.A)(y,!0),{shouldRender:b,transitionClassNames:I}=(0,Yn.A)(Boolean(w)),S=(0,Mn.A)(C,m&&!n,h&&!g.QH),M=(0,f.A)("EVLTkrt1","media-inner",(!a||m)&&"AQWPv0bP",m&&"tprkr7qf",n&&"V3HabdKr");(0,i.vJ)(()=>{!t||p||m||d({peerId:t.peerId,storyIds:[t.id]})},[t,m,p]);const N=(0,U.A)(()=>{m?c({message:u("StoryNotFound")}):r({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})});return(0,be.FD)("div",{className:M,onClick:a?N:void 0,children:[!m&&n&&(0,be.Y)("canvas",{ref:S,className:"thumbnail blurred-bg"}),b&&(0,be.FD)(be.FK,{children:[(0,be.Y)("img",{src:w,alt:"",className:(0,f.A)("WAItYc5d",n&&"ClGe8yij",I),draggable:!1}),p&&(0,be.Y)(kn.A,{story:t,className:I})]}),m&&(0,be.FD)("span",{children:[(0,be.Y)(Ce.A,{name:"story-expired",className:"nLA7VEhv"}),u("StoryExpiredSubtitle")]}),Boolean(v?.duration)&&(0,be.Y)("div",{className:"message-media-duration",children:(0,vt.QO)(v.duration)}),s&&(0,be.Y)("span",{className:"protector"})]})}),Fn=(0,i.ph)((0,o.EK)((e,t)=>{let{message:n}=t;const{id:i,peerId:o}=n.content.storyData;return{story:(0,u.Msb)(e,o,i),isConnected:"connectionStateReady"===e.connectionState}})(function(e){let{message:t,story:n,isProtected:i,isConnected:o}=e;const{storyData:s}=t.content;return(0,be.Y)(Pn,{story:n||s,isProtected:i,isConnected:o})})),Tn=(0,i.ph)((0,o.EK)((e,t)=>{let{message:n}=t;const{id:i,peerId:o}=n.content.storyData,s=(0,u._bp)(e,o)?.lastReadId;return{story:(0,u.Msb)(e,o,i),peer:(0,u.PVB)(e,o),targetUser:(0,u.mBe)(e,n.chatId),isUnread:Boolean(s&&s<i)}})(function(e){let{message:t,story:n,peer:i,isUnread:s,targetUser:a}=e;const{openStoryViewer:r}=(0,o.ko)(),c=(0,z.A)(),{storyData:u}=t.content,h=(0,U.A)(()=>{r({peerId:n.peerId,storyId:n.id,isSinglePeer:!0,isSingleStory:!0})}),m=n&&"isDeleted"in n,p=n&&"content"in n,g=p?n.content.video:void 0,v=p?(0,l.EN)(n,"pictogram"):void 0,A=(0,ye.A)(v)||g?.thumbnail?.dataUri;return(0,L.A)(u.peerId,u.id,n),(0,be.FD)("div",{className:(0,f.A)("action-message-story-mention",s&&"is-unread",p&&"with-preview"),tabIndex:0,role:"button",onClick:p?h:void 0,children:[p&&(0,be.Y)("span",{className:"story-media-wrapper",children:A&&(0,be.Y)("img",{src:A,alt:"",className:"story-media"})}),(0,be.Y)("span",{className:"story-title",children:(0,S.A)(i&&"isSelf"in i&&i.isSelf?c(m?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,l.u0)(a)):m?c("ExpiredStoryMention"):c("StoryMentionedTitle",(0,d.F9)(c,i)),["emoji","simple_markdown"])})]})})),Dn=(0,i.ph)((0,o.EK)((e,t)=>{let{message:n}=t;return{sender:(0,u.Y7C)(e,n),isCurrentUserPremium:(0,u.g29)(e),isSynced:e.isSynced}})(e=>{let{message:t,todoList:n,sender:s,isCurrentUserPremium:a,isSynced:r}=e;const{toggleTodoCompleted:l,showNotification:c,requestConfetti:h}=(0,o.ko)(),{todo:m,completions:p}=n,{title:g,items:v,othersCanComplete:A}=m,[y,C]=(0,i.J0)([]),w=(0,i.Kr)(()=>new Set(y),[y]),b=!t.isScheduled&&a&&r;(0,i.Nf)(()=>{const e=p?.map(e=>e.itemId.toString())||[];C(e)},[p]);const I=(0,O.A)(),S=(0,U.A)(e=>{e.preventDefault(),e.stopPropagation(),a||c({message:I("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:I("PremiumMore")})}),M=(0,U.A)(e=>{const n=e.find(e=>!w.has(e)),i=Array.from(w).find(t=>!e.includes(t));l({chatId:t.chatId,messageId:t.id,completedIds:n?[Number(n)]:[],incompletedIds:i?[Number(i)]:[]}),e.length===v.length&&h({})}),N=Boolean(t.forwardInfo)||!A&&!t.isOutgoing,Y=t.isOutgoing,k=(0,i.Kr)(()=>v.map(e=>{const t=A?(0,u.mBe)((0,o.mS)(),p?.find(t=>t.itemId===e.id)?.completedBy||""):void 0,n=t?(0,d.em)(I,t):void 0;return{label:(0,ct.fd)(e.title),value:e.id.toString(),user:t,subLabel:n}}),[v,A,p,I]);return(0,be.FD)("div",{className:"todo-list",dir:I.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)(g)}),(0,be.Y)("div",{className:"list-type",children:t.forwardInfo?I("TitleToDoList"):A?I("TitleGroupToDoList"):Y?I("TitleYourToDoList"):s?I("TitleUserToDoList",{peer:(0,d.F9)(I,s)},{withNodes:!0}):I("TitleToDoList")})]}),(0,be.Y)("div",{className:"todo-list-items",children:N?(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:w.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",w.has(e.value)&&"completed-label"),children:e.label})]},e.value))}):(0,be.Y)(rn.A,{options:k,selected:y,onChange:M,onClickLabel:a?void 0:S,disabled:!b,isRound:!0})}),(0,be.Y)("div",{className:"completed-tasks-count",children:(0,be.Y)(Xe.A,{text:I("DescriptionCompletedToDoTasks",{number:y.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,i.ph)(e=>{let{gift:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:o,onClick:s}=e;const a=(0,i.li)(),{backdrop:r,model:l,pattern:d}=(0,Rn.uc)(t),[c,u,h]=(0,B.A)(),m=[r.centerColor,r.edgeColor];return(0,be.FD)("div",{className:(0,f.A)("interactive-gift","LaOdPURl"),onClick:s,onMouseEnter:g.TF?void 0:u,onMouseLeave:g.TF?void 0:h,children:[(0,be.Y)("div",{className:"zDnMa37m",children:(0,be.Y)(On.A,{className:"EdXfeKWY",backgroundColors:m,patternColor:r.patternColor,patternIcon:d.sticker})}),(0,be.Y)("div",{ref:a,className:"o_DYZEMV",children:(0,be.Y)(wn.A,{containerRef:a,sticker:l.sticker,size:120,shouldLoop:c,observeIntersectionForPlaying:o,observeIntersectionForLoading:n})})]})}),zn=(0,i.ph)((0,o.EK)(e=>({canPlayAnimatedEmojis:(0,u.BWX)(e)}))(e=>{let{messageWebPage:t,webPage:n,message:s,noAvatars:r,canAutoLoad:d,canAutoPlay:c,asForwarded:u,isDownloading:h=!1,isProtected:m,isConnected:p,story:g,theme:v,backgroundEmojiId:A,shouldWarnAboutFiles:y,autoLoadFileMaxSizeMb:C,lastPlaybackTimestamp:w,observeIntersectionForLoading:b,observeIntersectionForPlaying:I,onMediaClick:M,onDocumentClick:N,onContainerClick:Y,onAudioPlay:k,onCancelMediaTransfer:P}=e;const{openUrl:F,openTelegramLink:T}=(0,o.ko)(),D=(0,i.li)(),x=(0,z.A)(),E=(0,O.A)(),B=(0,U.A)(()=>{M()}),R=(0,U.A)(e=>{Y?.(e)}),K="full"===n?.webpageType?n:void 0,{story:V,stickers:j}=K||{};(0,L.A)(V?.peerId,V?.id,g);const J=j?.isWithTextColor||j?.documents?.[0]?.shouldUseTextColor,$=(0,En.A)(D,void 0,!J),q=(0,i.Kr)(()=>{const e=n?.url&&(0,X.vG)(n?.url);if(e&&"timestamp"in e)return e.timestamp},[n?.url]);if("full"!==n?.webpageType)return;const H=(0,U.A)(()=>{T({url:n.url})}),{siteName:G,url:W,displayUrl:_,title:Q,description:Z,photo:ee,video:te,audio:ne,type:ie,document:oe}=n,{mediaSize:se}=t,ae="telegram_story"===ie,re="telegram_nft"===ie,le=g&&"isDeleted"in g?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}}(j?.isEmoji?"telegram_emojiset":ie),de=le&&E(le),ce=(0,xn.A)(Z,170),ue=Boolean(ce||Q||G);let me=Boolean(j);ue&&n?.photo&&!n.video&&!n.document&&(me=function(e,t){if(!e?.photo)return!1;if("small"===t)return!0;if("large"===t)return!1;const{width:n,height:i}=(0,l.Xn)(e.photo)||{};return!(!n||!i||n!==i||e.hasLargeMedia)}(n,se));const pe=(ee||te)&&M&&!me,fe=(0,f.A)("WebPage",me&&"with-square-photo",!ee&&!te&&"without-media",te&&"with-video",!ue&&"no-article",oe&&"with-document",de&&"with-quick-button",re&&"with-gift");return(0,be.FD)(we.A,{className:fe,"data-initial":(G||_)[0],dir:x.isRtl?"rtl":"auto",onClick:R,children:[(0,be.FD)("div",{className:(0,f.A)("WebPage--content",ae&&"is-story",re&&"is-gift"),children:[A&&(0,be.Y)(Ln.A,{emojiDocumentId:A,className:"WebPage--background-icons"}),ae&&(0,be.Y)(Pn,{story:g,isProtected:m,isConnected:p,isPreview:!0}),re&&(0,be.Y)(Un,{gift:n.gift,observeIntersectionForLoading:b,observeIntersectionForPlaying:I,onClick:H}),ue&&(0,be.FD)("div",{className:(0,f.A)("WebPage-text","WebPage-text_interactive"),onClick:()=>F({url:W,shouldSkipModal:t.isSafe}),children:[(0,be.Y)(Bn.A,{className:"site-name",url:W,text:G||_}),Q&&(0,be.Y)("p",{className:"site-title",children:(0,S.A)(Q)}),ce&&!re&&(0,be.Y)("p",{className:"site-description",children:(0,S.A)(ce,["emoji","br"])})]}),ee&&!re&&!te&&!oe&&(0,be.Y)(Ue.A,{photo:ee,isOwn:s?.isOutgoing,isInWebPage:!0,observeIntersection:b,noAvatars:r,canAutoLoad:d,size:me?"pictogram":"inline",asForwarded:u,nonInteractive:!pe,isDownloading:h,isProtected:m,theme:v,onClick:pe?B:void 0,onCancelUpload:P}),te&&(0,be.Y)(ze.A,{video:te,isOwn:s?.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:b,noAvatars:r,canAutoLoad:d,canAutoPlay:c,asForwarded:u,isDownloading:h,isProtected:m,lastPlaybackTimestamp:w||q,onClick:pe?B:void 0,onCancelUpload:P}),ne&&(0,be.Y)(he.Ay,{theme:v,message:s,origin:a.d9.Inline,noAvatars:r,isDownloading:h,onPlay:k,onCancelUpload:P}),oe&&(0,be.Y)(ge.A,{document:oe,message:s,observeIntersection:b,autoLoadFileMaxSizeMb:C,onMediaClick:N,onCancelUpload:P,isDownloading:h,shouldWarnAboutFiles:y}),j&&(0,be.Y)("div",{ref:D,className:(0,f.A)("media-inner","square-image",j.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:j.documents.map(e=>(0,be.Y)("div",{className:"WebPage--sticker",children:(0,be.Y)(wn.A,{containerRef:D,sticker:e,shouldLoop:!0,size:j.isEmoji?38:80,customColor:$,observeIntersectionForPlaying:I,observeIntersectionForLoading:b})},e.id))})]}),de&&(ve=de,(0,be.Y)(Le.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!0,onClick:H,children:ve}))]});var ve})),Kn=1.75*b.$,Vn=2.25*b.$,jn=(0,i.ph)((0,o.EK)((e,t)=>{const{focusedMessage:n,forwardMessages:i,activeReactions:o,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:d,album:p,withSenderName:f,withAvatar:y,threadId:C,messageListType:w,isLastInDocumentGroup:b,isFirstInGroup:I}=t,{id:S,chatId:M,viaBotId:N,isOutgoing:Y,forwardInfo:k,transcriptionId:P,isPinned:F,viaBusinessBotId:T,effectId:D,paidMessageStars:x}=d,E=(0,u.k9R)(e,d),{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,l.DX)(M),z=(0,l.Qe)(M),K=R&&(0,l.WX)(R),V=R&&(0,l.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=i.messageIds&&i.messageIds.includes(S),H=!O&&(0,l.zP)(d),G=f||y||H,W=(0,u.Y7C)(e,d),_=(0,u.Szq)(e,d),Q=N?(0,u.mBe)(e,N):void 0,Z=W?.id&&V?j?.adminMembersById?.[W?.id]:void 0,X=d.id===C,{replyToMsgId:ee,replyToPeerId:te,replyFrom:ne}=(0,c.Q)(d)||{},{peerId:ie,storyId:oe}=(0,c.W)(d)||{},se=ee&&ee===C,ae=(0,u.gMr)(e,d),re=k||ne,le=ae?(0,u.Y7C)(e,ae):!re||U||z?void 0:(0,u.HdA)(e,re),de=ae&&(0,u.Szq)(e,ae),ce=te?(0,u.hds)(e,te):void 0,ue=!U&&!z&&ce&&!(0,l.gA)(ce)&&(ce.isNotJoined||(0,u._ls)(e,ce.id)),he="topicCreate"===ae?.content.action?.type,me=oe&&ie?(0,u.Msb)(e,ie,oe):void 0,pe=ie?(0,u.PVB)(e,ie):void 0,ge=(0,u.ldX)(e,d),fe="thread"===w&&(p?p.messages.some(t=>(0,u.nJv)(e,t,C)):(0,u.nJv)(e,d,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,l.wb)(d),Ne=Me&&(0,u.oei)(e,Me)?Me:void 0,Ye=(0,l.Jw)(d);let ke;ke=p?.messages?p.messages.every(t=>{let{id:n}=t;return(0,u.H1_)(e,n)}):(0,u.H1_)(e,S);const Pe="thread"===w&&(0,u.tOf)(e,d,C),Fe=(0,u.yuw)(e),Te=(0,h.iS)(e,d),De=Te&&(0,l.$r)(Fe,Te),xe=(0,u.Vw0)(e,M,p?.commentsMessage?.id||S),Ee=Boolean(d.groupedId)&&!d.isInAlbum,Le=Ee?(0,u.D_S)(e,M,d.groupedId)[0]:void 0,Be=Ee?b?(0,u.O5q)(e,M,Le):void 0:d,Re=R?.unreadReactions?.includes(d.id),Oe=C===s.l3&&R?.isForum&&I,Ue=Oe?(0,u.nkm)(e,d):void 0,ze=(0,u.RnX)(e,M),Ke=(0,u.Rny)(e,M,d.id),Ve=(0,u.qZq)(e,M),je=g.CM&&e.settings.byKey.canTranslate&&!Ve,Je="connectionStateReady"===e.connectionState,$e=Boolean(Be&&o[(0,A.bj)(Be)]?.length),qe=(0,u.g29)(e),He=W&&(0,u.nZ4)(e,W.id)?j?.boostsApplied??d.senderBoosts:d.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,d),et=(0,h.me)(e,d),tt=(0,h.xd)(e,M,d.id),nt=(0,u.trm)(e),it=e.appConfig.starsSuggestedPostFutureMin,ot=(0,h.B9)(e,d),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:le,replyMessageForwardSender:de,replyMessageChat:ce,replyStory:me,isReplyPrivate:ue,storySender:pe,isInDocumentGroup:Ee,isProtected:(0,u.ynf)(e,d),isChatProtected:(0,u.ryq)(e,M),isFocused:fe,isForwarding:q,reactionMessage:Be,isChatWithSelf:O,isRepliesChat:U,isAnonymousForwards:z,isChannel:K,isGroup:V,canReply:Pe,highlight:Se,animatedEmoji:Ne,animatedCustomEmoji:Ye,isInSelectMode:(0,u.rTV)(e),isSelected:ke,isGroupSelected:Boolean(d.groupedId)&&!d.isInAlbum&&(0,u.SLS)(e,M,d.groupedId),threadId:C,isDownloading:De,isPinnedList:"pinned"===w,isPinned:F,canAutoLoadMedia:(0,u.wwb)(e,d),canAutoPlayMedia:(0,u.OEt)(e,d),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:xe,availableReactions:e.reactions.availableReactions,defaultReaction:(0,l.Nb)(d)||"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:ze,areTranslationsEnabled:je,shouldDetectChatLanguage:(0,u.LRV)(e,M),requestedTranslationLanguage:Ke,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:Y?(0,u.Tl2)(e,d,"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:it,effect:Ze,poll:Xe,maxTimestamp:et,lastPlaybackTimestamp:tt,paidMessageStars:x,isChatWithUser:B,isAccountFrozen:nt,isMediaNsfw:ot,isReplyMediaNsfw:st,webPage:E}})(e=>{let{message:t,observeIntersectionForBottom:n,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,album:m,noAvatars:v,withAvatar:A,withSenderName:Y,noComments:P,noReplies:F,appearanceOrder:J,isJustAdded:$,isFirstInGroup:W,isPremium:te,isLastInGroup:ne,isFirstInDocumentGroup:ie,isLastInDocumentGroup:oe,isTranscribing:se,transcribedText:ae,isLastInList:re,theme:le,forceSenderName:ce,sender:ue,canShowSender:Ae,originSender:ye,botSender:we,isThreadTop:Ie,shouldHideReply:Pe,replyMessage:Fe,replyMessageSender:Te,replyMessageForwardSender:De,replyMessageChat:Oe,replyStory:Ke,isReplyPrivate:Ve,storySender:Je,outgoingStatus:$e,uploadProgress:qe,isInDocumentGroup:He,isLoadingComments:We,isProtected:Qe,isChatProtected:Ze,isFocused:Xe,focusDirection:et,focusedQuote:nt,focusedQuoteOffset:it,noFocusHighlight:ot,scrollTargetPosition:st,isResizingContainer:rt,isForwarding:lt,isChatWithSelf:ct,isRepliesChat:ut,isAnonymousForwards:ht,isChannel:mt,isGroup:gt,canReply:vt,highlight:At,animatedEmoji:yt,animatedCustomEmoji:Ct,hasActiveReactions:wt,hasLinkedChat:bt,isInSelectMode:It,isSelected:St,isGroupSelected:Mt,threadId:Nt,reactionMessage:Yt,availableReactions:Pt,defaultReaction:Tt,activeEmojiInteractions:Dt,messageListType:xt,isPinnedList:Et,isPinned:Bt,isDownloading:Rt,canAutoLoadMedia:Ot,canAutoPlayMedia:zt,shouldLoopStickers:Kt,autoLoadFileMaxSizeMb:Vt,repliesThreadInfo:jt,hasUnreadReaction:Jt,memoFirstUnreadIdRef:$t,senderAdminMember:qt,messageTopic:Ht,hasTopicChip:Gt,chatTranslations:Zt,areTranslationsEnabled:Xt,shouldDetectChatLanguage:tn,requestedTranslationLanguage:on,requestedChatTranslationLanguage:an,withAnimatedEffects:rn,webPageStory:ln,isConnected:dn,getIsMessageListReady:cn,shouldWarnAboutFiles:un,senderBoosts:hn,tags:mn,canTranscribeVoice:pn,viaBusinessBot:An,effect:yn,poll:Cn,maxTimestamp:wn,lastPlaybackTimestamp:bn,isMediaNsfw:In,isReplyMediaNsfw:Mn,paidMessageStars:Nn,isChatWithUser:Yn,isAccountFrozen:kn,minFutureTime:Pn,webPage:xn,onIntersectPinnedMessage:En}=e;const{toggleMessageSelection:Ln,clickBotInlineButton:Bn,clickSuggestedMessageButton:Rn,rejectSuggestedPost:On,openSuggestedPostApprovalModal:Un,disableContextMenuHint:jn,animateUnreadReaction:Jn,focusLastMessage:$n,markMentionsRead:qn}=(0,o.ko)(),Hn=(0,i.li)(),Gn=(0,i.li)(),Wn=(0,i.li)(),_n=(0,z.A)(),Qn=(0,O.A)(),[Zn,Xn]=(0,i.J0)(!1),[ei,ti]=(0,i.J0)(!1),[ni,ii]=(0,i.J0)(!1),[oi,si,ai]=(0,B.A)(),[ri,li,di]=(0,B.A)(),[ci,ui]=(0,i.J0)(""),{isMobile:hi,isTouchScreen:mi}=(0,D.Ay)();(0,R.mv)(Gn,n);const{isContextMenuOpen:pi,contextMenuAnchor:gi,contextMenuTarget:fi,handleBeforeContextMenu:vi,handleContextMenu:Ai,handleContextMenuClose:yi,handleContextMenuHide:Ci}=(0,x.A)(Hn,mi&&It||kn,!p.Vq,g.Ni,cn);(0,i.vJ)(()=>{pi&&jn()},[pi,jn]);const wi=J<=0,[bi,Ii]=(0,B.A)(wi);(0,i.vJ)(()=>{wi||setTimeout(Ii,J*r.zq7)},[J,Ii,wi]),(0,j.A)({ref:Hn,isOpen:bi||$,noMountTransition:wi&&!$,className:!1});const{id:Si,chatId:Mi,forwardInfo:Ni,viaBotId:Yi,isTranscriptionError:ki,factCheck:Pi}=t;(0,i._W)(()=>{if(t.isPinned){const e=m?m.mainMessage.id:Si;En?.({viewportPinnedIdsToRemove:[e]})}});const Fi=(0,l.Nb)(t),Ti=(0,l.Ie)(t),Di="scheduled"===xt||t.isScheduled,xi=(0,l.Tv)(t)&&!Pe,{paidMedia:Ei}=(0,l.r_)(t),{photo:Li,video:Bi}=N(Ei),{photo:Ri=Li,video:Oi=Bi,audio:Ui,voice:zi,document:Ki,sticker:Vi,contact:ji,invoice:Ji,location:$i,action:qi,game:Hi,storyData:Gi,giveaway:Wi,giveawayResults:_i,todo:Qi}=(0,l.r_)(t),Zi=(0,c.Q)(t),Xi=(0,c.W)(t),eo=Boolean(!Zn&&(ki||ae)),to=Boolean(Xi),no=Boolean(jt)&&"thread"===xt,io=!eo&&(0,l.aN)(t),oo=io&&(yt||Ct),so=Yt?.reactions&&!(0,l.G)(Yt.reactions),ao=Ni&&(!ct||Di)&&!ut&&!Ni.isLinkedChannelPost&&!ht&&!we||Boolean(Gi&&!Gi.isMention),ro=Boolean(hn)&&!ao&&W,lo=Gi?.isMention,co="video"===Oi?.mediaType&&Oi.isRound,uo=Boolean(m)&&(m.isPaidMedia&&Ei.extendedMedia.length>1||m.messages.length>1)&&!m.messages.some(e=>0===Object.keys(e.content).length),ho=He&&!ie,mo=He&&!oe,po=void 0!==gi,go=!(po||It||lt||mo||lo||(Vi||oo)&&ao),fo=mt&&!Di&&t.isForwardingAllowed&&!Ze,vo=Boolean(Et||Ni&&(Ni.isChannelPost||ct||ut||ht)&&Ni.fromMessageId),Ao=Boolean(Pi?.text),yo=ao&&io,Co=Gt||xi||to||yo,wo=(0,U.A)((e,t)=>{kn||Ln({messageId:Si,groupedId:t,...e?.shiftKey&&{withShift:!0},...uo&&{childMessageIds:m.messages.map(e=>{let{id:t}=e;return t})}})}),bo=Ae?ue:void 0,Io=Ni&&(ct||ut||ht||!bo)?ye:bo,So=ao?ye:ue,Mo=Ti&&!io,No=Ni||Gi?ye:bo,Yo=(0,l.G5)(t),{handleMouseDown:ko,handleClick:Po,handleContextMenu:Fo,handleDoubleClick:To,handleContentDoubleClick:Do,handleMouseMove:xo,handleSendQuickReaction:Eo,handleMouseLeave:Lo,isSwiped:Bo,isQuickReactionVisible:Ro,handleDocumentGroupMouseEnter:Oo}=de(wo,Hn,Si,Boolean(It),Boolean(vt),Boolean(Qe),Ai,vi,Mi,po,Wn,mo,cn),{handleSenderClick:Uo,handleViaBotClick:zo,handleReplyClick:Ko,handleMediaClick:Vo,handleDocumentClick:jo,handleAudioPlay:Jo,handleAlbumMediaClick:$o,handlePhotoMediaClick:qo,handleVideoMediaClick:Ho,handleMetaClick:Go,handleTranslationClick:Wo,handleOpenThread:_o,handleReadMedia:Qo,handleCancelUpload:Zo,handleVoteSend:Xo,handleGroupForward:es,handleForward:ts,handleFocus:ns,handleFocusForwarded:is,handleDocumentGroupSelectAll:os,handleTopicChipClick:ss,handleStoryClick:as}=function(e){let{lang:t,selectMessage:n,message:i,webPage:r,chatId:d,threadId:u,isInDocumentGroup:h,asForwarded:m,isScheduled:p,album:g,senderPeer:f,botSender:v,messageTopic:A,isTranslatingChat:y,story:C,isReplyPrivate:w,isRepliesChat:b,isSavedMessages:I,lastPlaybackTimestamp:S}=e;const{openChat:M,openChatWithDraft:N,showNotification:Y,focusMessage:k,openMediaViewer:P,openAudioPlayer:F,markMessagesRead:T,cancelUploadMedia:D,sendPollVote:x,openForwardMenu:E,openChatLanguageModal:L,openThread:B,openStoryViewer:R,searchChatMediaMessages:O}=(0,o.ko)(),{id:z,forwardInfo:K,groupedId:V,content:{paidMedia:j,video:J}}=i,{replyToMsgId:$,replyToPeerId:q,replyToTopId:H,isQuote:G,quoteText:W,quoteOffset:_}=(0,c.Q)(i)||{},Q=(0,U.A)(()=>{f?m&&K?.channelPostId?k({chatId:f.id,messageId:K.channelPostId}):M({id:f.id}):Y({message:t("HidAccount")})}),Z=(0,U.A)(()=>{v&&N({chatId:d,threadId:u,text:{text:`@${(0,l.Kl)(v)} `}})}),ee=(0,U.A)(()=>{$&&!w?b&&q&&H?B({isComments:!0,originChannelId:q,originMessageId:H,focusMessageId:$}):k({chatId:q||d,threadId:b?H:u,messageId:$,replyMessageId:q?void 0:z,noForumTopicPanel:!q,...G&&{quote:W?.text,quoteOffset:_}}):Y({message:t(G?"QuotePrivate":"ReplyPrivate")})}),te=(0,U.A)(()=>{P({chatId:d,threadId:u,messageId:z,origin:p?a.TQ.ScheduledInline:a.TQ.Inline})}),ne=(0,U.A)(e=>{if(j&&!j.isBought)return;e&&O({chatId:d,threadId:u,currentMediaMessageId:z});const t=r?.url&&(0,X.vG)(r.url),n=J||(0,l.rU)(r),i=t&&"timestamp"in t?t.timestamp:void 0;P({chatId:d,threadId:u,messageId:z,origin:p?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:S||n?.timestamp||i,withDynamicLoading:e})}),ie=(0,U.A)(()=>{ne(!p&&!j)}),oe=(0,U.A)(()=>{const e=i.content?.video?.isGif;ne(!e&&!p&&!j)}),se=(0,U.A)(()=>{((0,l.yl)(i)||(0,l.eY)(r))&&ie(),oe()}),ae=(0,U.A)(()=>{F({chatId:d,messageId:z})}),re=(0,U.A)((e,t)=>{j&&!j.isBought||(O({chatId:d,threadId:u,currentMediaMessageId:z}),P({chatId:d,threadId:u,messageId:e,mediaIndex:t,origin:p?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!j}))}),le=(0,U.A)(()=>{T({messageIds:[z]})}),de=(0,U.A)(()=>{D({chatId:d,messageId:z})}),ce=(0,U.A)(e=>{x({chatId:d,messageId:z,options:e})}),ue=(0,U.A)(()=>{E({fromChatId:d,groupedId:V})}),he=(0,U.A)(()=>{if(g&&g.messages){const e=g.messages.map(e=>{let{id:t}=e;return t});E({fromChatId:d,messageIds:e})}else E({fromChatId:d,messageIds:[z]})}),me=(0,U.A)(()=>{k({chatId:d,threadId:s.l3,messageId:z})}),pe=(0,U.A)(()=>{const e=I&&K.savedFromPeerId||K.fromChatId;h?k({chatId:e,groupedId:V,groupedChatId:d,messageId:K.fromMessageId}):q&&H?b?B({isComments:!0,originChannelId:q,originMessageId:H,focusMessageId:K.fromMessageId}):k({chatId:q,threadId:H,messageId:K.fromMessageId}):k({chatId:e,messageId:K.fromMessageId})}),ge=(0,U.A)(e=>{e.stopPropagation(),n(e,V)}),fe=(0,U.A)(e=>{e.stopPropagation(),L({chatId:d,messageId:y?void 0:z})}),ve=(0,U.A)(()=>{B({chatId:i.chatId,threadId:i.id})}),Ae=(0,U.A)(()=>{A&&k({chatId:q||d,threadId:A.id,messageId:z})}),ye=(0,U.A)(()=>{C&&R({peerId:C.peerId,storyId:C.id,isSingleStory:!0})});return{handleSenderClick:Q,handleViaBotClick:Z,handleReplyClick:ee,handleDocumentClick:te,handleMediaClick:se,handleAudioPlay:ae,handleAlbumMediaClick:re,handlePhotoMediaClick:ie,handleVideoMediaClick:oe,handleMetaClick:ge,handleTranslationClick:fe,handleOpenThread:ve,handleReadMedia:le,handleCancelUpload:de,handleVoteSend:ce,handleGroupForward:ue,handleForward:he,handleFocus:me,handleFocusForwarded:pe,handleDocumentGroupSelectAll:ge,handleTopicChipClick:Ae,handleStoryClick:ye}}({lang:_n,selectMessage:wo,message:t,webPage:xn,chatId:Mi,threadId:Nt,isInDocumentGroup:He,asForwarded:ao,isScheduled:Di,album:m,avatarPeer:Io,senderPeer:No,botSender:we,messageTopic:Ht,isTranslatingChat:Boolean(an),story:Ke&&"content"in Ke?Ke:void 0,isReplyPrivate:Ve,isRepliesChat:ut,isSavedMessages:ct,lastPlaybackTimestamp:bn}),rs=(0,U.A)(e=>{e.stopPropagation(),si()});(0,i.vJ)(()=>{re&&eo&&ae&&$n()},[$n,re,ae,eo]),(0,i.vJ)(()=>{const e=Hn.current,n=t.isInAlbum&&m?.messages.some(e=>!e.isDeleting);t.isDeleting&&e&&!n&&((0,Ee.U)(e)?ti(!0):ii(!0))},[t.isDeleting]);const ls=m?.hasMultipleCaptions?void 0:m?.captionMessage||t,ds=ls&&(0,l.XR)(ls),cs=ds||Ao,us=(0,f.A)("Message message-list-item",W&&"first-in-group",Qe&&"hide-on-print",Qe&&!ds?"is-protected":"allow-selection",ne&&"last-in-group",ie&&"first-in-document-group",oe&&"last-in-document-group",re&&"last-in-list",Ti&&"own",Boolean(t.viewsCount)&&"has-views",t.isEdited&&"was-edited",xi&&"has-reply",pi&&"has-menu-open",Xe&&!ot&&"focused",lt&&"is-forwarding",ni&&"is-deleting",ei&&"is-dissolving",He&&"is-in-document-group",uo&&"is-album",t.hasUnreadMention&&"has-unread-mention",St&&"is-selected",It&&"is-in-selection-mode",Ie&&!A&&"is-thread-top",Boolean(t.inlineButtons)&&"has-inline-buttons",Bo&&"is-swiped",$&&"is-just-added",(wt||oi)&&"has-active-effect",lo&&"is-story-mention",!go&&"no-action-button"),hs=ls&&(0,l.r_)(ls).text,ms=Boolean(t.isInvertedMedia),{replyToMsgId:ps,replyToPeerId:gs}=Zi||{},{peerId:fs,storyId:vs}=Xi||{};(0,i.vJ)(()=>{(Vi?.hasEffect||yn)&&($t?.current&&Si>=$t.current||Fi)&&si()},[yn,Fi,$t,Si,Vi?.hasEffect]);const As=function(e,t,n){const[o,s]=(0,i.J0)();return(0,i.vJ)(()=>{t||n&&!n()||(e?async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2;return q||await H.promise,await q.request({name:"detectLanguage",args:[e,t]})}(e).then(s):s(void 0))},[t,e,n]),o}(hs?.text,!(Xt&&tn),cn);!function(e,t,n,o){(0,i.vJ)(()=>{if(n||o&&!o())return;const i=Boolean(e.content.text?.text.length);!function(e){let{chatId:t,id:n,isTranslatable:i,detectedLanguage:o}=e;const s=_.get(t)||new G.A(150),a=s.get(n);a&&a.detectedLanguage===o&&a.isTranslatable===i||(s.set(n,{id:n,isTranslatable:i,detectedLanguage:o}),_.set(t,s),Q(t))}({chatId:e.chatId,id:e.id,isTranslatable:i,detectedLanguage:t})},[e,t,n,o])}(t,As,!tn,cn);const ys=(0,l.ZR)(t,!an),{isPending:Cs,translatedText:ws}=(0,ee.A)(Zt,Mi,ys?Si:void 0,on),bs=(0,K.A)(ws,Boolean(ys)),Is=ws||bs,Ss="phoneCall"===qi?.type?qi:void 0,Ms=(jt||bt&&mt&&Fi)&&!mo&&"thread"===xt&&!P,Ns=jt?.isCommentsInfo&&!mo&&"thread"===xt&&!P,Ys=!mi&&!Ss&&!It&&Tt&&!mo&&!lo&&!Yo&&!kn,ks=!eo&&so&&(io||(Ri||Oi||Gi||"geo"===$i?.mediaType)&&!cs),Ps=function(e,t){let{poll:n,webPage:i,hasSubheader:o,isCustomShape:s,isLastInGroup:a,asForwarded:d,hasThread:c,forceSenderName:u,hasCommentCounter:h,hasCommentButton:m,hasActionButton:p,hasReactions:g,isGeoLiveActive:f,withVoiceTranscription:v,peerColorClass:A,hasOutsideReactions:y}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{paidMedia:C}=(0,l.r_)(e),{photo:w,video:b}=N(C),I=(0,l.r_)(e),{photo:S=w,video:M=b,audio:Y,voice:k,document:P,contact:F,location:T,invoice:D,storyData:x,giveaway:E,giveawayResults:L}=I,B=t?.hasMultipleCaptions?void 0:(0,l.r_)(t?.captionMessage||e).text,R=Boolean(e.factCheck?.text),O="video"===M?.mediaType&&M.isRound,U=e.isInvertedMedia,z=S||M&&!O||t||i,K=[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&&z?!(!g||y)||!!R||!(!i||!j):j;return A&&K.push(A),!V&&e.emojiOnlyCount?(K.push("emoji-only"),e.emojiOnlyCount<=r.Apc&&K.push(`emoji-only-${e.emojiOnlyCount}`)):j?K.push("text"):K.push("no-text"),Object.keys(I).length||K.push("unsupported"),p&&K.push("has-action-button"),s&&(K.push("custom-shape"),O&&K.push("round"),h&&K.push("has-comment-counter")),V&&!v?K.push("media"):M?K.push("video"):Y?K.push("audio"):k?(K.push("voice"),v&&K.push("with-voice-transcription")):P?K.push("document"):F?K.push("contact"):n?K.push("poll"):E||L?K.push("giveaway"):"full"===i?.webpageType&&(K.push("web-page"),(i.photo||i.video)&&K.push("media"),i.document&&K.push("document"),i.gift&&K.push("gift")),D&&!D.extendedMedia&&K.push("invoice"),D&&D.photo&&K.push("has-photo"),x&&K.push("story"),d&&K.push("is-forwarded"),o&&K.push("has-subheader"),c&&K.push("has-replies"),g&&K.push("has-reactions"),y&&K.push("has-outside-reactions"),q&&K.push("is-via-bot"),u&&K.push("force-sender-name"),s||(K.push("has-shadow"),V&&c&&K.push("has-background"),(o||d||q||!J||u||R||v)&&K.push("has-solid-background"),R&&K.push("has-fact-check"),!a||$||!S&&J&&!m||K.push("has-appendix")),z&&U&&K.push("is-inverted-media"),H?K.push("has-footer"):K.push("no-footer"),K.join(" ")}(t,m,{poll:Cn,webPage:xn,hasSubheader:Co,isCustomShape:io,isLastInGroup:ne,asForwarded:ao,hasThread:no&&!P,forceSenderName:ce,hasCommentCounter:no&&jt.messagesCount>0,hasCommentButton:Ns,hasActionButton:fo||vo,hasReactions:so,isGeoLiveActive:"geoLive"===$i?.mediaType&&!(0,l.vz)(t),withVoiceTranscription:eo,peerColorClass:(0,I.y)(So,Mo,!0),hasOutsideReactions:ks}),Fs=Ps.includes("has-appendix"),Ts=(0,M.Rr)(t.emojiOnlyCount),Ds=Yn?void 0:uo&&Nn?m.messages.length*Nn:Nn;let xs,Es;xs=Ss||mo?"none":!cs||xn||Ts||ms?ms&&!Ts&&(Ao||xn)?"in-text":"standalone":"in-text",so?ks?Es="outside":ao?(xs="standalone",Es="inside"):Es="inside":Es="none";const Ls=io?"in-meta":"in-content";(0,E.A)(gs||Mi,ps,Fe,t.id,Pe||Ve),(0,L.A)(fs||Mi,vs,Ke),(0,Z.A)({elementRef:Hn,chatId:Mi,isFocused:Xe,focusDirection:et,noFocusHighlight:ot,isResizingContainer:rt,isJustAdded:$,isQuote:Boolean(nt),scrollTargetPosition:st});const Bs=An?(0,d.em)(_n,An):void 0,Rs=!t.senderId,Os=Bs||Rs&&t.postAuthorTitle||(ao||ct)&&Ni?.postAuthorTitle||void 0;(0,V.A)(Hn,re),(0,i.vJ)(()=>{const e=Gn.current;if(!e||!(0,w.Y)(e))return;Jt&&Jn({messageIds:[Si]});let n=[];t.hasUnreadMention&&(n=[Si]),m&&(n=m.messages.filter(e=>e.hasUnreadMention).map(e=>e.id)),n.length&&qn({chatId:Mi,messageIds:n})},[Jt,m,Mi,Si,Jn,t.hasUnreadMention]);const Us=(0,i.Kr)(()=>uo?T(Ti,Boolean(v),m,hi):void 0,[uo,Ti,v,m,hi]),zs=ao&&!io?28:0,Ks=(0,i.Kr)(()=>{let e,t,n,i=!1,o="";if(!uo&&(Ri||Oi||Ji?.extendedMedia)){let n;if(Ri||Oi){const e=Ri||Oi;e&&!co&&(n=(0,k.yA)({media:e,isOwn:Ti,asForwarded:ao,noAvatars:v,isMobile:hi}).width)}else if(Ji?.extendedMedia&&Ji.extendedMedia.width&&Ji.extendedMedia.height){const{width:e,height:t}=Ji.extendedMedia;n=(0,b.kn)({width:e,height:t,fromOwnMessage:Ti,asForwarded:ao,noAvatars:v,isMobile:hi}).width}n&&(n<k.MC&&(t=n),e=Math.max((0,k.nP)(hs?.text,Ms),n),!ao&&Ji?.extendedMedia&&e-n>18&&(i=!0))}else Us&&(e=Math.max((0,k.nP)(hs?.text,Ms),Us.containerStyle.width),e-Us.containerStyle.width>18&&(i=!0));if(e)o=`width: ${e}px`,n=e+Vn;else if(Vi&&!Co){const{width:e}=(0,b.bu)(Vi,hi);o=`width: ${e+zs}px`,n=e+Vn}return{contentWidth:t,noMediaCorners:i,style:o,reactionsMaxWidth:n}},[Us,ao,zs,Co,Ji?.extendedMedia,uo,Ms,hi,Ti,v,Ri,Vi,hs?.text,Oi,co]),{contentWidth:Vs,noMediaCorners:js,style:Js,reactionsMaxWidth:$s}=Ks;function qs(e){if(ls)return(0,be.Y)(Ye.A,{messageOrStory:ls,translatedText:on?Is:void 0,isForAnimation:e,focusedQuote:nt,focusedQuoteOffset:it,emojiSize:Ts,highlight:At,isProtected:Qe,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,withTranslucentThumbs:io,isInSelectMode:It,canBeEmpty:Ao,maxTimestamp:wn,threadId:Nt})}const Hs=(0,i.hb)(()=>{if(Tt)return(0,be.Y)("div",{className:(0,f.A)("quick-reaction","no-selection",Ro&&!wt&&"visible"),onClick:Eo,ref:Wn,children:(0,be.Y)(ke.A,{reaction:Tt,size:Kn,availableReactions:Pt,observeIntersection:h})})},[wt,Pt,Tt,Eo,Ro,h]);function Gs(){const e=(0,be.Y)(en,{message:t,isPinned:Bt,withFullDate:ct&&!Ti,noReplies:F,repliesThreadInfo:jt,outgoingStatus:$e,signature:Os,withReactionOffset:"inside"===Es,renderQuickReactionButton:Ys&&"in-meta"===Ls?Hs:void 0,availableReactions:Pt,isTranslated:Boolean(on?Is:void 0),effectEmoji:yn?.emoticon,onClick:Go,onEffectClick:rs,onTranslationClick:Wo,onOpenThread:_o,paidMessageStars:Ds});return"inside"!==Es?e:(0,be.Y)(fn.A,{message:Yt,threadId:Nt,metaChildren:e,observeIntersection:h,noRecentReactors:mt,tags:mn,isCurrentUserPremium:te,isAccountFrozen:kn})}function Ws(e){const t=(0,f.A)("text-content","clearfix"),n=(0,f.A)("text-content","clearfix","in-text"===xs&&"with-meta",$e&&"with-outgoing-icon"),i=uo||!uo&&Ri||!uo&&Oi&&!co||!oo&&Ao,o="in-text"===xs;return(0,be.FD)(be.FK,{children:[_s(),cs&&!oo&&(0,be.FD)("div",{className:t,dir:"auto",children:[qs(),Cs&&(0,be.Y)("div",{className:"translation-animation",children:(0,be.Y)("div",{className:"text-loading",children:qs(!0)})}),!i&&o&&Gs()]}),i&&(0,be.FD)(be.FK,{children:[Qs(e),!oo&&(0,be.FD)("div",{className:n,dir:"auto",children:[Ao&&(0,be.Y)(pt,{factCheck:Pi,isToggleDisabled:It}),o&&Gs()]})]})]})}function _s(){const e=(0,l.T_)(t);if(e&&xn)return(0,be.Y)(zn,{messageWebPage:e,webPage:xn,message:t,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,noAvatars:v,canAutoLoad:Ot,canAutoPlay:zt,asForwarded:ao,isDownloading:Rt,isProtected:Qe,theme:le,story:ln,isConnected:dn,lastPlaybackTimestamp:bn,backgroundEmojiId:So?.color?.backgroundEmojiId,shouldWarnAboutFiles:un,autoLoadFileMaxSizeMb:Vt,onAudioPlay:Jo,onMediaClick:Vo,onDocumentClick:jo,onCancelMediaTransfer:Zo})}function Qs(e){const t=(0,be.FD)(be.FK,{children:[uo&&u&&(0,be.Y)(je,{album:m,albumLayout:Us,observeIntersection:u,isOwn:Ti,isProtected:Qe,hasCustomAppendix:e,onMediaClick:$o}),!uo&&Ri&&(0,be.Y)(Ue.A,{messageText:hs?.text,photo:Ri,isOwn:Ti,observeIntersection:u,noAvatars:v,canAutoLoad:Ot,uploadProgress:qe,shouldAffectAppendix:e,isDownloading:Rt,isProtected:Qe,asForwarded:ao,theme:le,isMediaNsfw:In,forcedWidth:Vs,onClick:qo,onCancelUpload:Zo}),!uo&&Oi&&!co&&(0,be.Y)(ze.A,{video:Oi,isOwn:Ti,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,forcedWidth:Vs,noAvatars:v,canAutoLoad:Ot,canAutoPlay:zt,uploadProgress:qe,isDownloading:Rt,isProtected:Qe,asForwarded:ao,isMediaNsfw:In,lastPlaybackTimestamp:bn,onClick:Ho,onCancelUpload:Zo})]});return Ei?(0,be.Y)(sn,{chatId:Mi,messageId:Si,paidMedia:Ei,isOutgoing:Ti,children:t}):t}function Zs(){return!(io&&!Yi)&&(Y&&(!(Ri||Oi||$i||Ei)||Gt)||ao||Yi||ce)&&!ho&&!(xi&&io)}function Xs(){return(0,be.FD)("span",{className:"forward-title-container",children:[ao&&(0,be.Y)(Ce.A,{name:Ni?.hiddenUserName?"forward":"share-filled"}),ao&&(0,be.Y)("span",{className:"forward-title",children:_n("ForwardedFrom")})]})}const ea=(0,U.A)(e=>{"suggestedMessage"===e.button.type&&("approve"!==e.button.buttonType?"decline"!==e.button.buttonType?Rn({...e,button:e.button}):li():Un({chatId:Mi,messageId:t.id}))}),ta=(0,U.A)(e=>{ui(e.target.value)}),na=(0,U.A)(()=>{On({chatId:Mi,messageId:t.id,rejectComment:ci.trim()||void 0}),di(),ui("")});function ia(){let e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!No||io&&Yi?Ni?.hiddenUserName?e=Ni.hiddenUserName:Gi&&ye&&(e=(0,d.em)(_n,ye)):e=(0,d.em)(_n,No);const o=No&&"emojiStatus"in No&&No.emojiStatus,s=No&&"isPremium"in No&&No.isPremium,a=ao&&No,c=we?.hasUsername;return(0,be.FD)("div",{className:"message-title",dir:"ltr",children:[e||ao?(0,be.FD)("span",{className:(0,f.A)("message-title-name-container",Ni?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!n&&Xs(),(0,be.FD)("span",{className:"message-title-name",children:[Gi&&(0,be.Y)(Ce.A,{name:"play-story"}),a&&(0,be.Y)(me.A,{className:"forward-avatar",peer:No,size:"micro"}),(0,be.Y)("span",{className:"sender-title",onClick:Uo,children:e?(0,S.A)(e):ao?" ":void 0}),!ao&&o&&(0,be.Y)(pe.A,{documentId:o.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:u,observeIntersectionForPlaying:h}),!ao&&!o&&s&&(0,be.Y)(Ne.A,{}),No?.fakeType&&(0,be.Y)(Me.A,{fakeType:No.fakeType})]})]}):we?void 0:" ",we?.hasUsername&&(0,be.FD)("span",{className:"interactive",children:[(0,be.Y)("span",{className:"via",children:_n("ViaBot")}),(0,be.Y)("span",{className:"sender-title",onClick:zo,children:(0,S.A)(`@${(0,l.Kl)(we)}`)})]}),(0,be.Y)("div",{className:"title-spacer"}),i||c?void 0:Ni?.isLinkedChannelPost?(0,be.Y)("span",{className:"admin-title",dir:"auto",children:_n("DiscussChannel")}):t.postAuthorTitle&>&&!ao?(0,be.Y)("span",{className:"admin-title",dir:"auto",children:t.postAuthorTitle}):!qt||ao||Yi?void 0:(0,be.Y)("span",{className:"admin-title",dir:"auto",children:qt.customTitle||_n(qt.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),ro&&(0,be.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,be.Y)(Ce.A,{name:hn>1?"boosts":"boost"}),hn>1?hn:void 0]})]})}const oa=gt&&ao?t.postAuthorTitle:void 0,sa=t.suggestedPostInfo&&!t.isOutgoing&&!t.suggestedPostInfo.isAccepted&&!t.suggestedPostInfo.isRejected,aa=(0,i.Kr)(()=>{if(!t.suggestedPostInfo?.scheduleDate||!Pn)return!1;const e=(0,y.Fm)();return t.suggestedPostInfo.scheduleDate<=e+Pn},[t.suggestedPostInfo,Pn]);return(0,be.FD)("div",{ref:Hn,id:(0,l.GZ)(t.id),className:us,"data-message-id":Si,onCopy:Qe?C.A:void 0,onMouseDown:ko,onClick:Po,onContextMenu:Fo,onDoubleClick:To,onMouseEnter:mo?Oo:void 0,onMouseMove:Ys?xo:void 0,onMouseLeave:Ys||mo?Lo:void 0,children:[(0,be.Y)("div",{ref:Gn,className:"bottom-marker","data-message-id":Si,"data-last-message-id":m?m.messages[m.messages.length-1].id:void 0,"data-album-main-id":m?m.mainMessage.id:void 0,"data-has-unread-mention":t.hasUnreadMention||void 0,"data-has-unread-reaction":Jt||void 0,"data-is-pinned":Bt||void 0,"data-should-update-views":void 0!==t.viewsCount}),!He&&(0,be.Y)("div",{className:"message-select-control no-selection",children:St&&(0,be.Y)(Ce.A,{name:"select"})}),oe&&(0,be.Y)("div",{className:(0,f.A)("message-select-control group-select no-selection",Mt&&"is-selected"),onClick:os,children:Mt&&(0,be.Y)(Ce.A,{name:"select"})}),(0,be.FD)("div",{className:(0,f.A)("message-content-wrapper",Ps.includes("text")&&"can-select-text",Ps.includes("giveaway")&&"giveaway-result-content"),children:[(0,be.FD)("div",{className:Ps,style:Js,dir:"auto",children:[ao&&!ho&&(0,be.FD)(be.FK,{children:[Zs()&&ia(),oa&&(0,be.Y)("span",{className:"admin-title",dir:"auto",children:oa})]}),function(){const e=(0,f.A)("content-inner",ao&&"forwarded-message",yo&&"forwarded-custom-shape",Co&&"with-subheader",js&&"no-media-corners"),n=ne&&(!cs||ms&&!Ao&&!so)&&!Ns,i=(0,f.A)("text-content","clearfix","in-text"===xs&&"with-meta",$e&&"with-outgoing-icon"),o=!Yo||!Ti||ct;return(0,be.FD)("div",{className:e,onDoubleClick:Do,dir:"auto",children:[!ao&&Zs()&&ia(),Co&&(0,be.FD)("div",{className:"message-subheader",children:[Gt&&(0,be.Y)(xe,{topic:Ht,onClick:ss,className:"message-topic"}),yo&&(0,be.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,be.Y)("div",{className:"message-title",children:Xs()}),ia(!0,!0)]}),xi&&(0,be.Y)(ve.A,{message:Fe,replyInfo:Zi,noUserColors:Mo,isProtected:Qe,sender:Te,senderChat:Oe,forwardSender:De,chatTranslations:Zt,isMediaNsfw:Mn,requestedChatTranslationLanguage:an,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,onClick:Ko}),to&&(0,be.Y)(Se,{story:Ke,sender:Je,noUserColors:Mo,isProtected:Qe,observeIntersectionForLoading:u,onClick:as})]}),Vi&&u&&h&&(0,be.Y)(Sn,{message:t,observeIntersection:u,observeIntersectionForPlaying:h,shouldLoop:Kt,shouldPlayEffect:oi,withEffect:rn,isMediaNsfw:In,onStopEffect:ai}),oo&&Ct&&(0,be.Y)(Ge,{customEmojiId:Ct,withEffects:rn&&Yn&&!yn,isOwn:Ti,observeIntersection:u,forceLoadPreview:Fi,messageId:Si,chatId:Mi,activeEmojiInteractions:Dt}),oo&&yt&&(0,be.Y)(_e,{emoji:yt,withEffects:rn&&Yn&&!yn,isOwn:Ti,observeIntersection:u,forceLoadPreview:Fi,messageId:Si,chatId:Mi,activeEmojiInteractions:Dt}),rn&&yn&&!Fi&&(0,be.Y)(Qt.A,{shouldPlay:oi,messageId:t.id,isMirrored:!t.isOutgoing,effect:yn,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,onStop:ai}),Ss&&(0,be.Y)(nn,{message:t,phoneCall:Ss,chatId:Mi}),!uo&&co&&!eo&&(0,be.Y)(vn.A,{message:t,observeIntersection:u,canAutoLoad:Ot,isDownloading:Rt,onReadMedia:o?Qo:void 0,onHideTranscription:Xn,isTranscriptionError:ki,isTranscribed:Boolean(ae),canTranscribe:pn&&!Yo,isTranscriptionHidden:Zn,isTranscribing:se}),(Ui||zi||eo)&&(0,be.Y)(he.Ay,{theme:le,message:t,origin:a.d9.Inline,uploadProgress:qe,isSelectable:He,isSelected:St,noAvatars:v,onPlay:Jo,onReadMedia:zi&&o?Qo:void 0,onCancelUpload:Zo,isDownloading:Rt,isTranscribing:se,isTranscriptionHidden:Zn,isTranscribed:Boolean(ae),isTranscriptionError:ki,canDownload:!Qe,onHideTranscription:Xn,canTranscribe:pn&&!Yo}),Ki&&(0,be.Y)(ge.A,{document:Ki,message:t,observeIntersection:u,canAutoLoad:Ot,autoLoadFileMaxSizeMb:Vt,uploadProgress:qe,isSelectable:He,isSelected:St,onMediaClick:jo,onCancelUpload:Zo,isDownloading:Rt,shouldWarnAboutFiles:un}),Gi&&!lo&&(0,be.Y)(Fn,{message:t,isProtected:Qe}),lo&&(0,be.Y)(Tn,{message:t}),ji&&(0,be.Y)(at,{contact:ji,noUserColors:Ti}),Cn&&(0,be.Y)(gn,{message:t,poll:Cn,onSendVote:Xo}),Qi&&(0,be.Y)(Dn,{message:t,todoList:Qi}),(Wi||_i)&&(0,be.Y)(kt,{message:t}),Hi&&(0,be.Y)(ft,{message:t,threadId:Nt,canAutoLoadMedia:Ot}),Ji?.extendedMedia&&(0,be.Y)(Ut,{message:t,isConnected:dn}),eo&&(0,be.Y)("p",{className:(0,f.A)("transcription",!Zn&&ki&&"transcription-error"),dir:"auto",children:ki?_n("NoWordsRecognized"):se&&ae?(0,be.Y)(fe.A,{content:ae}):ae}),ms&&Ws(n),!ms&&(0,be.FD)(be.FK,{children:[Qs(n),cs&&!oo&&(0,be.FD)("div",{className:i,dir:"auto",children:[qs(),Cs&&(0,be.Y)("div",{className:"translation-animation",children:(0,be.Y)("div",{className:"text-loading",children:qs(!0)})}),Ao&&(0,be.Y)(pt,{factCheck:Pi,isToggleDisabled:It}),"in-text"===xs&&Gs()]}),_s()]}),Ji&&!Ji.extendedMedia&&(0,be.Y)(Lt,{message:t,shouldAffectAppendix:n&&!so,isInSelectMode:It,isSelected:St,theme:le,forcedWidth:Vs}),$i&&(0,be.Y)(Wt,{message:t,isInSelectMode:It,isSelected:St,theme:le,peer:ue})]})}(),!mo&&"standalone"===xs&&!lo&&Gs(),go&&(0,be.FD)("div",{className:(0,f.A)("message-action-buttons",We&&"message-action-buttons-shown"),children:[Ns&&io&&(0,be.Y)(tt,{threadInfo:jt,disabled:P,isLoading:We,isCustomShape:!0,asActionButton:!0}),fo&&(0,be.Y)(Le.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:_n("lng_context_forward_msg"),onClick:oe?es:ts,children:(0,be.Y)(Ce.A,{name:"share-filled"})}),vo&&(0,be.Y)(Le.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:Qn("FocusMessage"),onClick:Et?ns:is,children:(0,be.Y)(Ce.A,{name:"arrow-right"})})]}),Ns&&!(go&&io)&&(0,be.Y)(tt,{threadInfo:jt,disabled:P,isLoading:We}),Fs&&(0,be.Y)(_t.A,{isOwn:Ti}),Ys&&"in-content"===Ls&&Hs()]}),t.inlineButtons&&(0,be.Y)(Ft,{message:t,onClick:Bn}),sa&&(0,be.Y)(Ft,{message:{...t,inlineButtons:[[{type:"suggestedMessage",buttonType:"decline",text:Qn("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:Qn("SuggestedPostApprove"),disabled:aa}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:Qn("SuggestedPostSuggestChanges")}]]},onClick:ea}),"outside"===Es&&!lo&&(0,be.Y)(fn.A,{message:Yt,threadId:Nt,isOutside:!0,isCurrentUserPremium:te,maxWidth:$s,observeIntersection:h,noRecentReactors:mt,tags:mn,isAccountFrozen:kn})]}),gi&&(0,be.Y)(dt,{isOpen:pi,anchor:gi,targetHref:fi?.matches("a[href]")?fi.href:void 0,message:t,album:m,messageListType:xt,onClose:yi,onCloseAnimationEnd:Ci,repliesThreadInfo:jt,noReplies:F,detectedLanguage:As}),ri&&(0,be.FD)(Be.A,{isOpen:ri,onClose:di,title:Qn("SuggestedPostDecline"),confirmLabel:Qn("SuggestedPostDecline"),confirmHandler:na,confirmIsDestructive:!0,children:[(0,be.Y)("div",{className:"decline-dialog-question",children:(0,S.A)(Qn("DeclinePostDialogQuestion",{sender:ue?(0,d.em)(_n,ue):""},{withNodes:!0,withMarkdown:!0}))}),(0,be.Y)(Re.A,{placeholder:Qn("DeclineReasonPlaceholder"),value:ci,onChange:ta,maxLength:200})]})]})}))},91930:(e,t,n)=>{n.d(t,{A:()=>E,b:()=>x});var i=n(84051),o=n(31481),s=n(90709),a=n(3544),r=n(70636),l=n(87357),d=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),Y=n(18653),k=n(86070),P=n(20021);const F=" ",T=e=>{let{className:t,message:n,replyInfo:u,suggestedPostInfo:m,sender:N,senderChat:T,forwardSender:x,composerForwardSenders:E,title:L,customText:B,isProtected:R,isInComposer:O,noUserColors:U,chatTranslations:z,requestedChatTranslationLanguage:K,isMediaNsfw:V,noCaptions:j,observeIntersectionForLoading:J,observeIntersectionForPlaying:$,onClick:q}=e;const H=(0,i.li)(),G=(0,y.Vz)(H,J),W=(0,i.Kr)(()=>{const e="message"===u?.type&&u.replyMedia||n?.content;if(e)return{content:e}},[n,u]),_=W?.content?.video?.isGif?W.content.video:void 0,Q=Boolean(_&&!_.previewPhotoSizes?.length),Z=(0,f.A)(W,Q?"full":"pictogram"),X=(0,w.A)(Z,!G),ee=(0,v.A)(W),te=Boolean(W&&(0,s.lk)(W)),ne=Boolean(W&&(0,s.y2)(W))||V,ie=Boolean("message"===u?.type&&u.isQuote),oe="message"===u?.type?u.replyFrom:void 0,se=n&&(0,s.ZR)(n),{translatedText:ae}=(0,I.A)(z,n?.chatId,se?n?.id:void 0,K),re=(0,b.A)(),le=(0,C.A)(),de=N?(0,r.F9)(re,N):oe?.hiddenUserName||n?.forwardInfo?.hiddenUserName,ce=(0,i.Kr)(()=>{if(!E)return;const e=E.map(e=>(0,r.F9)(le,e)).filter(Boolean);return le.conjunction(e)},[E,le]),ue=T?(0,r.F9)(re,T):void 0,he=x?(0,r.F9)(re,x):n?.forwardInfo?.hiddenUserName,me=N&&N.id===x?.id,{handleClick:pe,handleMouseDown:ge}=(0,A.Q)(q);return(0,P.FD)(k.A,{peer:N,emojiIconClassName:"EmbeddedMessage--background-icons",ref:H,shouldReset:!0,noUserColors:U,className:(0,l.A)("EmbeddedMessage",t,ie&&"is-quote",ee&&"with-thumb","no-selection",E&&"is-input-forward",m&&"is-suggested-post"),dir:le.isRtl?"rtl":void 0,onClick:pe,onMouseDown:ge,children:[(0,P.Y)("div",{className:"hover-effect"}),(0,P.Y)(S.A,{}),ee&&D(ee,X,Q,te,R,ne),(0,P.FD)("div",{className:"message-text",children:[(0,P.Y)("p",{className:(0,l.A)("embedded-text-wrapper",ie&&"multiline"),children:function(){if(m){if(!m?.price?.amount&&!m.scheduleDate)return le("ComposerEmbeddedMessageSuggestedPostDescription");const e=m.price?m.price.currency===o.ykW?(0,h.Ms)(le,m.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,h.U2)(le,m.price.amount,{className:"suggested-price-star-icon"}):"",t=m.scheduleDate?(0,d.e0)(m.scheduleDate,le,re):"";return e&&!t?(0,P.Y)("span",{className:"suggested-post-price-wrapper",children:le("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,P.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` • ${t}`:""]})}return"message"===u?.type&&u.quoteText?(0,g.fd)({text:u.quoteText.text,entities:u.quoteText.entities,asPreview:!0,emojiSize:17}):n?j?le("EmbeddedMessageNoCaption"):(0,P.Y)(Y.A,{message:n,noEmoji:Boolean(ee),translatedText:ae,observeIntersectionForLoading:J,observeIntersectionForPlaying:$,emojiSize:17}):B||function(e){if(!e||e.content.text)return F;const t=(0,a.GG)(le,e.content,{});return t?(0,P.Y)("span",{children:(0,p.A)(t)}):F}(W)||F}()}),(0,P.FD)("div",{className:"message-title",children:[function(){if(L)return(0,p.A)(L);if(m&&u)return le("TitleSuggestedChanges");if(m)return le("ComposerEmbeddedMessageSuggestedPostTitle");if(!de&&!ce)return F;let e;T&&((0,s.WX)(T)&&(e="channel-filled"),(0,s.YE)(T)&&(e="group-filled"));const t=O&&Boolean(u&&"quoteText"in u&&u?.quoteText);return(0,P.FD)("span",{className:"embedded-sender-wrapper",children:[(!T||!!(0,c.L8)(T?.id)||T.id!==N?.id)&&(0,P.FD)("span",{className:"embedded-sender",children:[!E&&de&&(0,p.A)(t?re("ReplyToQuote",de):de),ce&&(0,p.A)(le("ComposerTitleForwardFrom",{users:ce},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,P.Y)(M.A,{name:e,className:"embedded-chat-icon"}),e&&ue&&(0,P.Y)("span",{className:"embedded-sender-chat",children:(0,p.A)(ue)})]})}(),he&&!me&&(0,P.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,P.Y)(M.A,{name:x?"share-filled":"forward",className:"embedded-origin-icon"}),(0,P.Y)("span",{className:"forward-sender-title",children:(0,p.A)(he)})]})]})]})]})};function D(e,t,n,i,o,s){const{width:a,height:r}=(0,m.mr)(),d=t||e,c=n&&t;return(0,P.FD)("div",{className:(0,l.A)("embedded-thumb",i&&"round"),children:[!s&&!c&&(0,P.Y)("img",{src:d,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:d,isVisible:Boolean(s),width:a,height:r}),o&&(0,P.Y)("span",{className:"protector"})]})}const x=(0,u.A)(T),E=T},92111:(e,t,n)=>{n.d(t,{A:()=>v});var i=n(84051),o=n(13439),s=n(23174),a=n(90709),r=n(91048),l=n(39761),d=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,i.vJ)(()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach(e=>{const n=t||(0,o.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await f,e.forEach(e=>{let{hash:t,format:n,isStream:i}=e;i?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}(t):c.hd(t,n).then(e=>{e&&(n===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,l.A)(n),t.removeChild(n)},1e3)}(e),n===s.qZ.BlobUrl&&(0,d.NN)(e))})})})(function(e,t){const n=(0,r._bp)((0,o.mS)(),e);if(!n||!n.orderedIds?.length)return[];const i=function(e,t){const n=e.indexOf(t),i=Math.max(n-5,0),o=Math.min(n+5,e.length);return e.slice(i,o)}(n.orderedIds,t),l=[];return i.forEach(t=>{if(g[e]?.has(t))return;const i=n.byId[t];if(!i||!("content"in i))return;const o=Boolean(i.content.video);l.push({hash:(0,a.EN)(i,"full"),format:o?s.qZ.Progressive:s.qZ.BlobUrl,isStream:o&&(0,p.c)(m.G)}),l.push({hash:(0,a.EN)(i),format:s.qZ.BlobUrl}),i.content.altVideos&&l.push({hash:(0,a.EN)(i,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)}),l}(e,n))})},[t,e])}},93809:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(30857),s=n(35297);function a(e,t){const n=void 0===t,a=(0,i.li)(n),r=(0,i.li)(),l=(0,o.A)();return(0,s.A)(()=>{n||(a.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))},e),(0,i.vJ)(()=>{if(n||a.current)return;const e=()=>{a.current=!0,l()};t>0?r.current=window.setTimeout(e,t):e()},e),a.current}},95362:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(37836);const o=10,s=1e3;let a=[],r=!1;function l(e,t){a.push({url:e,filename:t}),r||(r=!0,setTimeout(async()=>{await async function(){let e=0;for(const t of a)d(t),e++,e===o&&(await(0,i.v7)(s),e=0);a=[]}(),r=!1},s))}function d(e){let{url:t,filename:n}=e;const i=document.createElement("a");i.href=t,i.target="_blank",i.rel="noopener noreferrer",i.download=n;try{i.click()}catch(e){console.error(e)}}},95704:(e,t,n)=>{n.d(t,{h:()=>c});var i=n(23174),o=n(4875);const s=262144,a=5242879,r=new Map,l=new Map,d=new Map;function c(e){try{let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;return async function*(){const s=e.match(/fileSize=(\d+)/);let c;for(c=s?s&&Number(s[1]):l.get(e);;){if(c&&t>=c)return;let s=t+n-1;c&&s>c&&(s=c-1);const u=`${e}:${t}-${s}`;let h=r.get(u);if(!h){let n=d.get(u);n||(n=(0,o.px)("downloadMedia",{mediaFormat:i.qZ.Progressive,url:e,start:t,end:s}),d.set(u,n));const m=await n.finally(()=>{d.delete(u)});if(!m?.arrayBuffer)return;m.fullSize&&!c&&(c=m.fullSize,l.set(e,m.fullSize)),h=m.arrayBuffer,s<=a&&r.set(u,m.arrayBuffer)}yield h,t=s+1}}()}catch(e){return Promise.reject(e)}}},97046:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97676:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),o=n(87357),s=n(37661),a=n(5912),r=n(17712),l=n(62587),d=n(10221),c=n(18104),u=n(3325);var h=n(20021);const m=(0,i.ph)(e=>{let{messageId:t,isMirrored:n,effect:m,shouldPlay:p,observeIntersectionForLoading:g,observeIntersectionForPlaying:f,onStop:v}=e;const A=(0,i.li)(),y=(0,i.li)(),C=(0,a.Vz)(A,g),w=(0,a.Vz)(A,f),[b,I,S]=(0,s.A)(),[M,N,Y]=(0,s.A)(),k=function(e){return e.effectAnimationId?`sticker${e.effectAnimationId}`:`sticker${e.effectStickerId}?size=f`}(m),P=(0,l.A)(k,!C),F=(0,r.A)(()=>{S(),v?.()}),T=(0,d.A)({anchorRef:A,overlayRef:y,isMirrored:n,isDisabled:!b,isForMessageEffect:!0,id:m.id});(0,i.vJ)(()=>{M&&T(),Y()},[T,Y,M]),(0,i.vJ)(()=>{w&&p&&P&&(I(),N())},[w,P,p,T]);const D=(0,o.A)("McmbiWZE",n&&"wNvU2uqi");return(0,h.Y)("div",{className:(0,o.A)("IYu2f7FM",n&&"GsTZawTE"),ref:A,children:b&&(0,h.Y)(u.A,{children:(0,h.Y)(c.A,{ref:y,className:D,tgsUrl:P,size:256,play:!0,isLowPriority:!0,noLoop:!0,forceAlways:!0,onEnded:F},`effect-${t??m.id}`)})})})},97967:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}}}]);
|
||
//# sourceMappingURL=1241.6fc0ea6a7796eb00d010.js.map
|