2 lines
346 KiB
JavaScript
2 lines
346 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3944],{45:(e,t,n)=>{n.d(t,{A:()=>d});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 d=(0,i.ph)((({status:e})=>(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(o.Ay,{name:"reveal",activeKey:r[e],children:"failed"===e?(0,a.Y)("div",{className:"MessageOutgoingStatus--failed",children:(0,a.Y)(s.A,{name:"message-failed"})}):(0,a.Y)(s.A,{name:`message-${e}`})})})))},285:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(90709),a=n(60919),r=n(4961),d=n(59030),c=n(94189),l=n(20021);const u=(0,i.ph)((0,o.EK)(((e,{userId:t})=>{const n=(0,a.meB)(e),i=t&&(0,a.mBe)(e,t);return{chat:n,contactName:i?(0,s.u0)(i):void 0}}))((({isOpen:e,chat:t,userId:n,contactName:s,onClose:a})=>{const{deleteChatMember:u}=(0,o.ko)(),m=(0,d.A)(),h=(0,i.hb)((()=>{u({chatId:t.id,userId:n}),a()}),[t,u,a,n]);if(t&&n)return(0,l.Y)(c.A,{isOpen:e,onClose:a,title:m("GroupRemoved.Remove"),textParts:(0,r.A)(m("PeerInfo.Confirm.RemovePeer",s)),confirmLabel:m("lng_box_remove"),confirmHandler:h,confirmIsDestructive:!0})})))},2178:(e,t,n)=>{n.d(t,{v:()=>r});var i=n(84051),o=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,o.h)();function r(e){(0,i.vJ)((()=>{if(!e)return;const t=Object.entries(e);return a.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach((([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:i,meta:o,mod:s,shift:a,key:r}=e,{altKey:d,ctrlKey:c,metaKey:l,shiftKey:u,key:m}=t;if(n!==d)return!1;if(s){if(!c&&!l)return!1}else{if(i!==c)return!1;if(o!==l)return!1}return a===u&&Boolean(r&&(m.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},i=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!i.includes(e)))}}(e),t)})(t)(e)&&n(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},2429:(e,t,n)=>{n.d(t,{A:()=>i});const i={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},3225:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(16120),d=n(96454),c=n(36353),l=n(39074),u=n(58734),m=n(63988),h=n(83414),p=n(19129),g=n(37661),f=n(17712);const v=300,A=new RegExp(`(${r.A.source})$`,"g"),y=new RegExp(`${s.bpX.source}$`,"g");function C(e,t,n,C,w,b){const{loadCustomEmojiForEmoji:I,clearCustomEmojiForEmoji:S}=(0,o.ko)(),[M,N,k]=(0,g.A)(!1),Y=(0,m.gs)((()=>{const n=t();if(!e||!n||!C()?.collapsed)return;if(!n.match(d.TL?r.A:s.bpX))return;const i=(0,l.LV)(w.current);return i.match(d.TL?A:y)?.[0]}),[t,C,w,e],v),P=(0,h.A)(Y,[Y,t,C],!0),F=(0,p.A)((()=>Boolean(P())),[P]),T=Boolean(b?.length);(0,i.vJ)((()=>{if(!e||!F)return;const t=P();if(t){if(!T){const e=d.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&I({emoji:e})}}else S()}),[e,F,P,T,S,I]);const D=(0,f.A)((t=>{const i=P();if(!e||!i)return;const o=w.current,s=(0,l.LV)(o),r=d.TL?i:i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),m=new RegExp(`(${r})\\1*$`,""),h=s.match(m)[0].length/i.length,p=s.replace(m,(0,u.hB)(t).repeat(h)),g=o.innerHTML.substring(s.length);n(`${p}${g}`),(0,a.Uz)((()=>{(0,c.A)(o,!0,!0)}))}));return(0,i.vJ)(k,[k,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(...e){this.postMessageOnTickEnd({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,{transferables:o,...s}=e,a=(0,i.A)(),r={type:"callMethod",messageId:a,...s},d={messageId:a},c=new Promise(((e,t)=>{Object.assign(d,{resolve:e,reject:t})}));if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();d.callback=e,n.set(e,d)}return t.set(a,d),c.catch((()=>{})).finally((()=>{t.delete(a),d.callback&&n.delete(d.callback)})),this.postMessageOnTickEnd(r,o),c}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessageOnTickEnd({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;e.channel===n&&e.payloads.forEach((e=>{if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)}))}postMessageOnTickEnd(e,t){this.pendingPayloads.push(e),t&&this.pendingTransferables.push(...t),this.postMessagesOnTickEnd()}postMessagesOnTickEnd=(0,o.Fe)((()=>{const{channel:e}=this,t=this.pendingPayloads,n=this.pendingTransferables;this.pendingPayloads=[],this.pendingTransferables=[],this.target.postMessage({channel:e,payloads:t},n)}))}function a(e,t,n){const i=new s(e,t,n);function o({data:e}){i.onMessage(e)}return e.addEventListener("message",o),i.destroy=()=>{e.removeEventListener("message",o)},i}},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),d=n(70636),c=n(36353),l=n(87894),u=n(39074),m=n(17778),h=n(63988),p=n(83414),g=n(37661),f=n(39351),v=n(17712);const A=300;let y;try{y=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){y=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function C(e,t,n,C,b,I,S,M){const N=(0,f.A)(),[k,Y]=(0,i.J0)(),[P,F,T]=(0,g.A)(!1),D=(0,h.gs)((()=>{const n=t();if(!e||!C()?.collapsed||!n.includes("@"))return;const i=(0,u.LV)(b.current);return(0,m.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 Y(void 0);const t=(0,o.mS)().users.byId;if(!t)return void Y(void 0);const n=I?.reduce(((e,t)=>(t.userId!==M&&e.push(t.userId),e)),[]),i=e.substring(1),s=(0,d.PU)({ids:(0,l.Am)([...E()&&S||[],...n||[]]),query:i,type:"user"});Y(Object.values((0,l._E)(t,s)))}),[M,I,S,x,E]);const L=(0,v.A)(((e,t=!1,i=!1)=>{if(!e.hasUsername&&!(0,d.F9)(N,e))return;const o=(0,r.Kl)(e),l=(0,d.F9)(N,e)||"",m=o?`@${o}`:`<a\n class="text-entity-link"\n data-entity-type="${s.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${l}</a>`,h=b.current,p=w((0,u.LV)(h)),g=i?p.length:p.lastIndexOf("@"),f=(o?o.length+1:l.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${m} `,i=w(h.innerHTML).substring(p.length),o=(0,u.JC)(h);n(`${e}${i}`),(0,a.Uz)((()=>{const e=o+f+1;(0,c.A)(h,t),e>=0&&(0,u.vZ)(h,e)}))}Y(void 0)}));return(0,i.vJ)(T,[T,t]),{isMentionTooltipOpen:Boolean(k?.length&&!P),closeMentionTooltip:F,insertMention:L,mentionFilteredUsers:k}}function w(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},9717:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(87894),s=n(79882),a=n(73767);function r(e,t){const n=(0,i.Kr)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),r=(0,a.A)(n),d=(0,a.A)(t),c=(0,i.Kr)((()=>n&&r&&t===d?(0,o.LG)(n,((e,t)=>void 0!==r[t]?e-r[t]:-1/0)):{}),[t,n,d,r]);return{orderDiffById:c,getAnimationType:(0,s.W)(c)}}},10221:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(84051),o=n(66644),s=n(76023),a=n(17712);const r=s.$;function d({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:d,id:c}){const l=(0,a.A)((()=>{const i=t.current,a=e.current;if(!i||!a)return;const d=a.getBoundingClientRect(),c=i.getBoundingClientRect(),l=window.innerWidth;(0,o.RK)((()=>{const e=d.top+d.height/2,t=d.bottom,o=s?t:e;i.style.top=o-c.height/2+"px",n?i.style.left=d.left-r+"px":i.style.right=l-d.right-r+"px"}))}));return(0,i.vJ)((()=>{d||l()}),[d,c]),(0,i.vJ)((()=>{if(d)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",l,{passive:!0}),()=>{t.removeEventListener("scroll",l)}):void 0}),[d,e]),l}},11359:(e,t,n)=>{n.d(t,{L:()=>o});const i=5;function o(e,t){const{commonAncestorContainer:n}=e;let o=n,s=1;for(;o&&o.id!==t&&s<i;)o=o.parentElement,s++;return Boolean(o&&o.id===t)}},11462:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,i.li)(e),n=(0,i.li)(!1),r=(0,o.A)();(0,a.A)((()=>{e&&(t.current=!0)}),[e]);const d=(0,s.A)((()=>{t.current=!1,n.current=!1,r()})),c=(0,s.A)((()=>{n.current=!0,r()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:d,handleForumPanelAnimationStart:c}}},14413:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(84051),o=n(13439),s=n(31481),a=n(39351),r=n(19806),d=n(94189);var c=n(20021);const l=(0,i.ph)((0,o.EK)((e=>{const t=e.appConfig,n=t?.verifyAgeMin;return{verifyAgeMin:n||s.lYi}}))((({isOpen:e,onClose:t,shouldAlwaysShow:n,onAlwaysShowChanged:i,confirmHandler:o,verifyAgeMin:s})=>{const l=(0,a.A)();return(0,c.FD)(d.A,{title:l("TitleSensitiveModal",{years:s}),confirmLabel:l("ButtonSensitiveView"),isOpen:e,onClose:t,confirmHandler:o,children:[l("TextSensitiveModal"),(0,c.Y)(r.A,{className:"mYXi2mIC",label:l("ButtonSensitiveAlways",{years:s}),checked:n,onCheck:i})]})})))},15006:(e,t,n)=>{n.d(t,{U:()=>p,A:()=>h});var i=n(84051),o=n(13439),s=n(31481),a=n(60919),r=n(6842),d=n(14235);const c={root:"AN8wkEiR",ghost:"ANWk2pWP",scale:"kMHxyoSt",elementContainer:"UDCMfXxs"};var l=n(20021);const u=50,m=1e3,h=(0,i.ph)((()=>(0,l.Y)("div",{className:c.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,m=n.top+window.scrollY,h=n.width,p=n.height;if(i+h+u<0||i-u>window.innerWidth||m+p+u<0||m-u>window.innerHeight)return!1;const f=Math.floor(Date.now()/1e3),v=`${s.xcU}-${(0,d.A)()}`,A=(0,l.FD)("svg",{className:c.ghost,width:h,height:p,style:`left: ${i}px; top: ${m}px;`,viewBox:`0 0 ${h} ${p}`,children:[(0,l.Y)("defs",{children:g(v,Math.min(h,p),f)}),(0,l.Y)("g",{filter:`url(#${v})`,children:(0,l.Y)("foreignObject",{className:c.elementContainer,width:h,height:p})})]}),y=(0,r.A)(A)[0],C=y.querySelector("foreignObject"),w=window.getComputedStyle(e),b=e.cloneNode(!0);Array.from(w).forEach((e=>b.style.setProperty(e,w.getPropertyValue(e),"important"))),C.appendChild(b);const I=document.getElementById(s.Lj4);return I.appendChild(y),y.addEventListener("animationend",(()=>{I.removeChild(y)}),{once:!0}),!0}function g(e,t,n=42){return(0,l.FD)("filter",{xmlns:s.jNX,id:e,x:"-150%",y:"-150%",width:"400%",height:"400%","color-interpolation-filters":"sRGB",children:[(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"1",result:"dustNoise",seed:n}),(0,l.Y)("feComponentTransfer",{in:"dustNoise",result:"dustNoiseMask",children:(0,l.Y)("feFuncA",{type:"linear",slope:"5",intercept:"0",children:(0,l.Y)("animate",{attributeName:"slope",values:"5; 2; 1; 0",dur:`${m}ms`,fill:"freeze"})})}),(0,l.Y)("feComposite",{in:"SourceGraphic",in2:"dustNoiseMask",operator:"in",result:"dustySource"}),(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"0.015",numOctaves:"1",result:"displacementNoise1",seed:n+1}),(0,l.Y)("feTurbulence",{type:"fractalNoise",baseFrequency:"1",numOctaves:"2",result:"displacementNoise2",seed:n+2}),(0,l.FD)("feMerge",{result:"combinedNoise",children:[(0,l.Y)("feMergeNode",{in:"displacementNoise1"}),(0,l.Y)("feMergeNode",{in:"displacementNoise2"})]}),(0,l.Y)("feDisplacementMap",{in:"dustySource",in2:"combinedNoise",scale:"0",xChannelSelector:"R",yChannelSelector:"G",children:(0,l.Y)("animate",{attributeName:"scale",values:"0; "+3*t,dur:`${m}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(60919),d=n(87357),c=n(4961),l=n(54699),u=n(17712),m=n(59030),h=n(42452),p=n(21849),g=n(80999),f=n(34431),v=n(18276),A=n(80477),y=n(20021);const C=(0,i.ph)((0,o.EK)(((e,{userId:t,forceShowSelf:n})=>{const{isSynced:i}=e,o=t?(0,r.mBe)(e,t):void 0,s=t?(0,r.K0y)(e,t):void 0,a=!n&&o&&o.isSelf,d=a?o:(0,r.mBe)(e,e.currentUserId);return{user:o,userStatus:s,isSavedMessages:a,areMessagesLoaded:Boolean(t&&(0,r.zeq)(e,t)),self:d,isSynced:i}}))((({customPeer:e,typingStatus:t,avatarSize:n="medium",status:r,statusIcon:C,withDots:w,withMediaViewer:b,withUsername:I,withStory:S,withFullInfo:M,withUpdatingStatus:N,emojiStatusSize:k,noStatusOrTyping:Y,noEmojiStatus:P,noFake:F,noVerified:T,noRtl:D,user:x,userStatus:E,self:L,isSavedMessages:B,isSavedDialog:R,areMessagesLoaded:O,adminMember:U,ripple:K,className:z,storyViewerOrigin:V,isSynced:j,onEmojiStatusClick:J,iconElement:$,rightElement:q})=>{const{loadFullUser:H,openMediaViewer:G,loadMoreProfilePhotos:W}=(0,o.ko)(),_=(0,m.A)(),{id:Q}=x||{},Z=b&&!B;(0,i.vJ)((()=>{Q&&(M&&j&&H({userId:Q}),b&&W({peerId:Q,isPreload:!0}))}),[Q,M,b,j]),(0,l.A)(6e4);const X=(0,u.A)(((e,t)=>{x&&t&&(e.stopPropagation(),G({isAvatarView:!0,chatId:x.id,mediaIndex:0,origin:"jumbo"===n?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))})),ee=(0,i.Kr)((()=>x&&I&&(0,a.Kl)(x)),[x,I]);if(!x&&!e)return;const te=U?U.customTitle||_(U.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,y.FD)("div",{className:(0,d.A)("ChatInfo",z),dir:!D&&_.isRtl?"rtl":void 0,children:[R&&L&&(0,y.Y)(p.A,{size:n,peer:L,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,y.Y)(p.A,{size:n,peer:e||x,className:(0,d.A)(R&&"overlay-avatar"),isSavedMessages:B,isSavedDialog:R,withStory:S,storyViewerOrigin:V,storyViewerMode:"single-peer",onClick:Z?X:void 0},x?.id),(0,y.FD)("div",{className:"info",children:[te?(0,y.FD)("div",{className:"info-name-title",children:[(0,y.Y)(f.A,{peer:x,withEmojiStatus:!P,emojiStatusSize:k,isSavedMessages:B,isSavedDialog:R,onEmojiStatusClick:J}),te&&(0,y.Y)("span",{className:"custom-title",children:te})]}):(0,y.Y)(f.A,{peer:e||x,noFake:F,noVerified:T,withEmojiStatus:!P,emojiStatusSize:k,isSavedMessages:B,isSavedDialog:R,onEmojiStatusClick:J,iconElement:$}),(r||!B&&!Y)&&function(){if(r)return w?(0,y.Y)(g.A,{className:"status",content:r}):(0,y.FD)("span",{className:"status",dir:"auto",children:[C&&(0,y.Y)(v.A,{className:"status-icon",name:C}),(0,c.A)(r)]});if(N&&!O)return(0,y.Y)(g.A,{className:"status",content:_("Updating")});if(e?.subtitleKey)return(0,y.Y)("span",{className:"status",dir:"auto",children:(0,y.Y)("span",{className:"user-status",dir:"auto",children:_(e.subtitleKey)})});if(!x)return;if(t)return(0,y.Y)(A.A,{typingStatus:t});if((0,a.DX)(x.id))return;const n=(0,a.CD)(_,x,E),i=(0,d.A)("handle",n&&"withStatus");return(0,y.FD)("span",{className:(0,d.A)("status",(0,a.PF)(x,E,!0)&&"online"),children:[ee&&(0,y.Y)("span",{className:i,children:ee}),n&&(0,y.Y)("span",{className:"user-status",dir:"auto",children:n})]})}()]}),K&&(0,y.Y)(h.A,{}),q]})})))},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,"")}},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,[d,c]=(0,i.J0)(Boolean(r)),[l,u]=(0,i.J0)(!1),m=(0,i.li)(void 0),h=(0,a.A)((()=>{(0,o.ko)().closePaymentMessageConfirmDialogOpen()}));(0,i.vJ)((()=>{l&&!t&&(u(!1),n>e&&m?.current?.())}),[l,t,n,e]);const p=(0,a.A)((()=>{(0,o.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)}));return{closeConfirmDialog:h,handleWithConfirmation:(t,...i)=>{if(e){if(m.current=()=>t(...i),!r)return void(0,o.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...i)},dialogHandler:(0,a.A)((()=>{e>n?p():m?.current?.(),(0,o.ko)().closePaymentMessageConfirmDialogOpen(),d&&(0,o.ko)().setPaidMessageAutoApprove()})),shouldAutoApprove:d,setAutoApprove:c}}},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:()=>qt});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),c=n(27109),l=n(70636),u=n(60919),m=n(64520),h=n(30708),p=n(96454),g=n(87357),f=n(17663),v=n(55148),A=n(46275),y=n(60261),C=n(9716),w=n(36353),b=n(48775),I=n(79824),S=n(80539),M=n(39074),N=n(80140),k=n(43503);let Y;function P(e){Y.focus(),e.focus()}p.pz&&(Y=document.createElement("input"),Y.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(Y));var F=n(55153),T=n(58734),D=n(11359),x=n(35049),E=n(4961),L=n(18501),B=n(32625),R=n(14737),O=n(10722),U=n(19129),K=n(82117),z=n(37661),V=n(41316),j=n(39351),J=n(17712),$=n(59030),q=n(29886),H=n(73767),G=n(24531),W=n(73172),_=n(50680),Q=n(41257),Z=n(35297),X=n(17778),ee=n(63988),te=n(83414);const ne=/^\/([\w@]{1,32})?$/i;var ie=n(78396);const oe=/id="docs-internal-guid/i,se=["H1","H2","H3","H4","H5","H6"];function ae(e){return(new DOMParser).parseFromString(e,"text/html").body}function re(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 le(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),i=t;return"A"===t.nodeName&&(n=re(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(i=t.childNodes[0])),n=ce(i,n),n}function ue(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(...ue(e.childNodes[t]));i.map((e=>n.appendChild(e)))}else-1!==se.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=le(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=re(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=le(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(...ue(e.childNodes[n]));return t}return[e]}function me(e){return 8!==e.nodeType}const he=/<style>(.*?)<\/style>/gs;var pe=n(45761);const ge=new Set([a.CfG,a.e0F,a.YVZ]),fe=(e,t,n,r,c,l,u)=>{const{showNotification:m}=(0,o.ko)(),h=(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||!ge.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(oe)?function(e){const t=document.createElement("body"),n=e.childNodes,i=Array.from(n).filter(me),o=[];for(const e of i)o.push(...ue(e));for(let e=0;e<o.length;e++)t.appendChild(o[e].cloneNode(!0));return t}(ae(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:ae(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){a.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(he,"");const i=t.querySelectorAll(".text-content");return i.length&&(t=i[i.length-1]),Array.from(t.getElementsByTagName("*")).forEach((e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),S.qh[e.tagName]&&e.setAttribute("data-entity-type",S.qh[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case s.C7.MentionName:e.replaceWith(e.textContent||"");break;case s.C7.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()})),t.innerHTML.trimEnd()}(p),void 0,!0):void 0;g&&(0,ie.T8)(g)&&l&&(g=(0,ie.m4)(g),u?.());const{items:f}=e.clipboardData;let v=[];if(f.length>0&&(v=await(0,pe.A)(f),c&&(v=v?.slice(0,1))),!v?.length&&!o)return;const A=g?.entities?.length?g:{text:o};let y=!1;try{y="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(p,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const C=A&&A.text;let w=v?.length&&!y;const b=v?await Promise.all(v.map((e=>(0,F.A)(e.name,e)))):[],I=c&&b?.length&&(0,d.eh)(c,b[0])||Boolean(C),M=(0,d.NK)(b[0]),N=c&&c?.groupedId;c&&b?.length>1?m({message:h("MediaReplaceInvalidError",void 0,{pluralValue:b.length})}):c&&M?m({message:h("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!N||(w=I,w)?(w&&n(c?b:e=>e.concat(b)),C&&(w?r(A):t(A,i?.id))):m({message:h("MediaReplaceInvalidError",void 0,{pluralValue:b.length})})}}),[t,c,n,e,l,u,r,h])};var ve=n(3225),Ae=n(37859),ye=n(56133),Ce=n(61157),we=n(60138);let be=!1;const Ie=new Set([s.C7.TextUrl,s.C7.Url]);var Se=n(25498),Me=n(37830);const Ne=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,ke=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Ye={username:"",query:"",canShowHelp:!1,usernameLowered:""},Pe=document.createElement("div");const Fe=(0,Me.A)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()}))),Te=new RegExp(a.kNZ,"i");var De=n(9442),xe=n(20247),Ee=n(16120),Le=n(17237);const Be=new RegExp(`^${a.bpX.source}$`,"g");var Re=n(11778);const Oe={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Ue={type:"audio/ogg"};let Ke,ze,Ve;async function je(){return Ke||(Ke=n.e(4550).then(n.t.bind(n,14550,23)),ze=(await Ke).default,Ve=new ze(Oe)),Ke}async function Je(e){await async function(){await je(),await Ve.start()}();const t=Date.now();let n;const i=[],o=[];Ve.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 d=!1;return function t(){if(d)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)}(),()=>{d=!0}}(Ve);return{stop:()=>new Promise(((e,a)=>{Ve.onstop=()=>{e({blob:new Blob(i,Ue),duration:Math.round(((n||Date.now())-t)/1e3),waveform:o})},Ve.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Ve.stop(),s()}),r)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Ve.pause(),n=Date.now(),s()}),e)}}}var $e=n(80089),qe=n(80464),He=n(20021);const Ge=e=>{const{attachments:t}=e,n=(0,qe.A)($e.ar.Extra,"AttachmentModal",!t.length);return n?(0,He.Y)(n,{...e}):void 0};var We=n(61182),_e=n(87679),Qe=n(52844),Ze=n(36680),Xe=n(18276),et=n(71429),tt=n(24433),nt=n(66469),it=n(54639);const ot=(0,i.ph)((({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:s,canAttachPolls:r,canAttachToDoLists:c,canSendPhotos:l,canSendVideos:u,canSendDocuments:m,canSendAudios:h,attachBots:f,peerType:v,isScheduled:A,theme:y,shouldCollectDebugLogs:C,canEditMedia:w,editingMessage:b,messageListType:I,paidMessagesStars:S,onFileSelect:M,onMenuOpen:N,onMenuClose:k,onPollCreate:Y,onTodoListCreate:P})=>{const{updateAttachmentSettings:F}=(0,o.ko)(),[T,D,x]=(0,z.A)(),[E,L,B]=(0,Ze.A)(T,x),R=l&&u,O=l||u,[U,K,V]=(0,z.A)(),q=T||U,H=b&&b?.groupedId&&Boolean((0,d.yl)(b)||Boolean((0,d.zX)(b))),G=b&&b?.groupedId&&Boolean((0,d.wp)(b)||(0,d.gB)(b)||(0,d.zC)(b));(0,i.vJ)((()=>{T&&B()}),[T,B]),(0,i.vJ)((()=>{q?N():k()}),[q,k,N]);const W=(0,J.A)((()=>{T?x():D()})),_=(0,J.A)((e=>{const{files:t}=e.target,n=(0,_e.kc)(t);n?.length&&M(n)})),Q=(0,J.A)((()=>{F({shouldCompress:!0}),(0,Qe.p)(Array.from(R?a.mxD:l?a.gex:a.fNs).join(","),(e=>_(e)))})),Z=(0,J.A)((()=>{F({shouldCompress:!1}),(0,Qe.p)(!m&&h?Array.from(a.IH3).join(","):"*",(e=>_(e)))})),X=(0,J.A)((()=>{const e=new File([(0,We.F8)()],a.lFE,{type:"text/plain"});M([e])})),ee=(0,i.Kr)((()=>f?Object.values(f).filter((t=>!(!v||!t.isForAttachMenu)&&(!("bots"!==v||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(v)))):void 0),[f,e,v]),te=(0,$.A)(),ne=(0,j.A)();if(n)return(0,He.FD)("div",{className:"AttachMenu",children:[b&&w?(0,He.Y)(nt.A,{id:"replace-menu-button",className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,He.Y)(Xe.A,{name:"replace"})}):(0,He.Y)(nt.A,{id:"attach-menu-button",disabled:Boolean(b),className:(0,g.A)("AttachMenu--button composer-action-button",T&&"activated"),round:!0,color:"translucent",onActivate:W,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,He.Y)(Xe.A,{name:"attach"})}),(0,He.FD)(et.A,{id:"attach-menu-controls",isOpen:q,autoClose:!0,positionX:"right",positionY:"bottom",onClose:x,className:"AttachMenu--menu fluid",onCloseAnimationEnd:x,onMouseEnter:p.TF?void 0:E,onMouseLeave:p.TF?void 0:L,noCloseOnBackdrop:!p.TF,ariaLabelledBy:"attach-menu-button",children:[!s&&(0,He.Y)(tt.A,{className:"media-disabled",disabled:!0,children:ne("scheduled"===I&&S?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),s&&(0,He.FD)(He.FK,{children:[O&&!G&&(0,He.Y)(tt.A,{icon:"photo",onClick:Q,children:te(R?"AttachmentMenu.PhotoOrVideo":l?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(m||h)&&!H&&(0,He.Y)(tt.A,{icon:"document",onClick:Z,children:te(!m&&h?"InputAttach.Popover.Music":"AttachDocument")}),m&&C&&(0,He.Y)(tt.A,{icon:"bug",onClick:X,children:te("DebugSendLogs")})]}),r&&!b&&(0,He.Y)(tt.A,{icon:"poll",onClick:Y,children:te("Poll")}),c&&!b&&(0,He.Y)(tt.A,{icon:"select",onClick:P,children:ne("TitleToDoList")}),!b&&!w&&!A&&ee?.map((n=>(0,He.Y)(it.A,{bot:n,chatId:e,threadId:t,theme:y,onMenuOpened:K,onMenuClosed:V})))]})]})})),st=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"BotCommandMenu",!t);return n?(0,He.Y)(n,{...e}):void 0};var at=n(85449),rt=n(64493);const dt=(0,i.ph)((0,o.EK)(((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return n?{message:(0,u.O5q)(e,n,t)}:{}}))((({isOpen:e,message:t,onClose:n})=>{const{clickBotInlineButton:s}=(0,o.ko)(),a=(0,$.A)(),[r,d]=(0,Ze.A)(e,n),{isKeyboardSingleUse:c}=t||{},l=(0,i.Kr)((()=>{const e=[];return t?.keyboardButtons.forEach((t=>{e.push(t.map((e=>(0,at.A)(a,e))))})),e}),[a,t?.keyboardButtons]);if(t&&t.keyboardButtons)return(0,He.Y)(et.A,{isOpen:e,autoClose:c,positionX:"right",positionY:"bottom",onClose:n,className:"BotKeyboardMenu",onCloseAnimationEnd:n,onMouseEnter:p.TF?void 0:r,onMouseLeave:p.TF?void 0:d,noCompact:!0,children:(0,He.Y)("div",{className:"content custom-scroll",children:t.keyboardButtons.map(((e,n)=>(0,He.Y)("div",{className:"row",children:e.map(((e,i)=>(0,He.Y)(rt.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>s({chatId:t.chatId,messageId:t.id,button:e}),children:l?.[n][i]})))})))})})}))),ct=(0,i.ph)((({isOpen:e,onClick:t,text:n,isDisabled:o})=>{const s=(0,i.li)();return(0,i.vJ)((()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)}),[e,n]),(0,i.vJ)((()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),(0,He.FD)(rt.A,{className:(0,g.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:o,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,He.Y)(Xe.A,{name:"webapp",className:(0,g.A)("bot-menu-icon",e&&"open")}),(0,He.Y)("span",{ref:s,className:"bot-menu-text",children:(0,E.A)(n)})]})})),lt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"ChatCommandTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0};var ut=n(56494),mt=n(87894),ht=n(14),pt=n(91930),gt=n(60859);const ft=(0,i.ph)((0,o.EK)(((e,{shouldForceShowEditing:t,chatId:n,threadId:i,messageListType:o})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:c,noCaptions:l},isShareMessageModalShown:m,shouldPreventComposerAnimation:h}=(0,u.nTw)(e),p="scheduled"===o?(0,u.VlN)(e,n):(0,u.Ys6)(e,n,i),g=(0,u.PKK)(e)&&!h,f=a===n,v=r?.map((t=>(0,u.O5q)(e,s,t))),A=(0,u.GA4)(e,n,i),y=A?.replyInfo,C=A?.suggestedPostInfo,w=y?.replyToPeerId,b=w?(0,u.hds)(e,w):void 0;let I,S;if(p?I=(0,u.KLw)(e,n,i,o):f&&1===r.length?I=v?.[0]:y&&!t&&(I=(0,u.O5q)(e,y.replyToPeerId||n,y.replyToMsgId)),p&&I)S=(0,u.Y7C)(e,I);else if(f){let t=v?.map((t=>{return n=t,S=(0,u.Szq)(e,n),S||(S=(0,u.Y7C)(e,n)),S;var n})).filter(Boolean);t=t?(0,mt.Am)(t):void 0,S=1===t?.length?t?.[0]:void 0}else if(y&&I&&!t){const{forwardInfo:t}=I,i=(0,u.nZ4)(e,n);t&&(t.isChannelPost||i)&&(S=(0,u.Szq)(e,I)),S||t?.hiddenUserName&&!Boolean(y.quoteText)||(S=(0,u.Y7C)(e,I))}const M=S&&(0,u.hds)(e,S.id),N=M&&(0,d.WX)(M),k=v?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),Y=f&&1===r.length&&Boolean(I?.content.storyData),P=y?.replyToMsgId===i&&!y.replyToPeerId,F=I&&(0,ut.B9)(e,I);return{replyInfo:y,suggestedPostInfo:C,editingId:p,message:I,sender:S,shouldAnimate:g,forwardedMessagesCount:f?r.length:void 0,noAuthors:c,noCaptions:l,forwardsHaveCaptions:k,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:Y,isReplyToDiscussion:P,isInChangingRecipientMode:m,shouldPreventComposerAnimation:h,senderChat:b,currentUserId:e.currentUserId,isSenderChannel:N,forwardMessageIds:r,fromChatId:s,isMediaNsfw:F}}))((({replyInfo:e,suggestedPostInfo:t,editingId:n,message:s,sender:a,shouldAnimate:r,forwardedMessagesCount:c,noAuthors:l,noCaptions:m,forwardsHaveCaptions:h,shouldForceShowEditing:p,isCurrentUserPremium:f,isContextMenuDisabled:v,isReplyToDiscussion:A,isInChangingRecipientMode:y,shouldPreventComposerAnimation:C,senderChat:w,chatId:b,currentUserId:I,isSenderChannel:S,forwardMessageIds:M,fromChatId:N,isMediaNsfw:k,onClear:Y})=>{const{resetDraftReplyInfo:P,resetDraftSuggestedPostInfo:F,updateDraftReplyInfo:T,setEditingId:D,focusMessage:E,changeRecipient:L,openChatOrTopicWithReplyInDraft:B,setForwardNoAuthors:R,setForwardNoCaptions:U,exitForwardMode:K,setShouldPreventComposerAnimation:z,openSuggestMessageModal:V}=(0,o.ko)(),q=(0,i.li)(),H=(0,$.A)(),G=(0,j.A)(),W="topicCreate"===s?.content.action?.type,Q=e&&!p,Z=Boolean(e?.quoteText),X=Boolean(t)&&!p,ee=Boolean(c),te=(0,J.A)((e=>{const t=(0,o.mS)();return(a=(0,u.Szq)(t,e))||(a=(0,u.Y7C)(t,e)),a})),ne=(0,i.Kr)((()=>{if(!ee)return;const e=M?.map((e=>(0,u.O5q)((0,o.mS)(),N,e))).filter(Boolean),t=e?.map((e=>te(e))).filter(Boolean);return t?(0,mt.Am)(t):void 0}),[ee,M,N]),ie=!(y||(!s||!e&&!n)&&(!ne||!ee)&&!X),{shouldRender:oe,transitionClassNames:se}=(0,_.A)(ie&&!W&&!A,void 0,!r,void 0,!r,350,!r);(0,i.vJ)((()=>{C&&z({shouldPreventComposerAnimation:!1})}));const ae=(0,J.A)((()=>{n?D({messageId:void 0}):c?K():X?(F(),P()):e&&!p&&P(),Y?.()}));(0,i.vJ)((()=>ie?(0,Re.A)(ae):void 0),[ie,ae]);const{isContextMenuOpen:re,contextMenuAnchor:de,handleContextMenu:ce,handleContextMenuClose:le,handleContextMenuHide:ue}=(0,O.A)(q),me=(0,J.A)((e=>{t?V({chatId:b}):ce(e)})),he=(0,J.A)((e=>{e.stopPropagation(),ae(),ue()})),pe=e=>()=>{le(),e()},ge=(0,J.A)(pe(L)),fe=(0,J.A)(pe((()=>{E({chatId:s.chatId,messageId:s.id,noForumTopicPanel:!0})}))),ve=(0,J.A)(pe((()=>T({quoteText:void 0})))),Ae=(0,J.A)(pe(L)),ye=(0,J.A)((()=>{le(),a&&B({chatId:a.id})})),Ce=(0,J.A)(pe(ae)),we=(0,J.A)((()=>q.current)),be=(0,J.A)((()=>q.current)),Ie=(0,J.A)((()=>q.current.querySelector(".forward-context-menu .bubble")));(0,i.vJ)((()=>{oe||(le(),ue())}),[le,ue,oe]);const Se=(0,g.A)("ComposerEmbeddedMessage",se),Me=(0,ht.A)(a,!0),Ne=(0,g.A)("ComposerEmbeddedMessage_inner",(0,x.y)(Me)),ke=(0,i.Kr)((()=>n?"edit":X?"cash-circle":ee?"forward":Q?"reply":void 0),[n,ee,Q,X]),Ye=c&&c>1?H("ForwardedMessageCount",c):void 0,Pe=(0,i.Kr)((()=>{if(!s||!ee||!s.content.text||!l||f)return s;const e=(0,d.m4)(s.content.text);return{...s,content:{...s.content,text:e}}}),[f,ee,s,l]),Fe=(0,ht.A)(ke,!0);if(!oe)return;const Te=a&&!S&&b!==a.id&&a.id!==I;return(0,He.Y)("div",{className:Se,ref:q,onContextMenu:ce,children:(0,He.FD)("div",{className:Ne,children:[(0,He.FD)("div",{className:"embedded-left-icon",onClick:ce,children:[Fe&&(0,He.Y)(Xe.A,{name:Fe}),Boolean(e?.quoteText)&&(0,He.Y)(Xe.A,{name:"quote",className:"quote-reply"})]}),(0,He.Y)(pt.b,{isOpen:ie,className:"inside-input",replyInfo:e,suggestedPostInfo:t,isMediaNsfw:k,isInComposer:!0,message:Pe,sender:l?void 0:a,composerForwardSenders:ne,customText:Ye,title:n&&!Q?H("EditMessage"):l?H("HiddenSendersNameDescription"):void 0,onClick:me,senderChat:w}),(0,He.Y)(rt.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:H("Cancel"),onClick:he,children:(0,He.Y)(Xe.A,{name:"close"})}),(Q||ee)&&!v&&(0,He.FD)(et.A,{isOpen:re,anchor:de,getTriggerElement:we,getRootElement:be,getMenuElement:Ie,className:"forward-context-menu",onClose:le,onCloseAnimationEnd:ue,children:[ee&&(0,He.FD)(He.FK,{children:[(0,He.Y)(tt.A,{icon:l?void 0:"message-succeeded",customIcon:l?(0,He.Y)(Xe.A,{name:"placeholder"}):void 0,onClick:()=>R({noAuthors:!1}),children:H(c>1?"ShowSenderNames":"ShowSendersName")}),(0,He.Y)(tt.A,{icon:l?"message-succeeded":void 0,customIcon:l?void 0:(0,He.Y)(Xe.A,{name:"placeholder"}),onClick:()=>R({noAuthors:!0}),children:H(c>1?"HideSenderNames":"HideSendersName")}),h&&(0,He.FD)(He.FK,{children:[(0,He.Y)(gt.A,{}),(0,He.Y)(tt.A,{icon:m?void 0:"message-succeeded",customIcon:m?(0,He.Y)(Xe.A,{name:"placeholder"}):void 0,onClick:()=>U({noCaptions:!1}),children:H(c>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,He.Y)(tt.A,{icon:m?"message-succeeded":void 0,customIcon:m?void 0:(0,He.Y)(Xe.A,{name:"placeholder"}),onClick:()=>U({noCaptions:!0}),children:H(c>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,He.Y)(gt.A,{}),(0,He.Y)(tt.A,{icon:"replace",onClick:ge,children:H("ForwardAnotherChat")})]}),Q&&(0,He.FD)(He.FK,{children:[(0,He.Y)(tt.A,{icon:"show-message",onClick:fe,children:H("Message.Context.Goto")}),Z&&(0,He.Y)(tt.A,{icon:"remove-quote",onClick:ve,children:H("RemoveQuote")}),Te&&(0,He.Y)(tt.A,{icon:"user",onClick:ye,children:G("ReplyInPrivateMessage")}),(0,He.Y)(tt.A,{icon:"replace",onClick:Ae,children:H("ReplyToAnotherChat")}),(0,He.Y)(tt.A,{icon:"delete",onClick:Ce,children:H("DoNotReply")})]})]})]})})})));var vt=n(25897),At=n(6070),yt=n(41510);const Ct=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"DropArea",!t);return n?(0,He.Y)(n,{...e}):void 0};var wt=n(49068);const bt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"InlineBotTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0},It=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"MentionTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0};var St=n(78407);const Mt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"PollModal",!t);return n?(0,He.Y)(n,{...e}):void 0},Nt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"SendAsMenu",!t);return n?(0,He.Y)(n,{...e}):void 0},kt=e=>{const{isOpen:t}=e,n=(0,qe.A)($e.ar.Extra,"StickerTooltip",!t);return n?(0,He.Y)(n,{...e}):void 0};var Yt=n(26440);const Pt=e=>{const{modal:t}=e,n=(0,qe.A)($e.ar.Extra,"ToDoListModal",!t);return n?(0,He.Y)(n,{...e}):void 0};var Ft=n(2338),Tt=n(62587),Dt=n(21511),xt=n(86070);const Et="zqTOc7LU",Lt="b0A9Zfoa";const Bt=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n})=>{const i=(0,u.nTw)(e),o=(0,u.rQx)(e,t,n),{attachmentSettings:s}=e,a=i.webPagePreviewId?(0,u.kgA)(e,i.webPagePreviewId):void 0;return{webPagePreview:"empty"===a?.webpageType?void 0:a,noWebPage:o,attachmentSettings:s}}))((({chatId:e,threadId:t,isDisabled:n,webPagePreview:s,noWebPage:a,attachmentSettings:r,isEditing:c})=>{const{toggleMessageWebPage:l,updateAttachmentSettings:u}=(0,o.ko)(),m=(0,j.A)(),h=(0,i.li)(),p=r.isInvertedMedia,f="small"===r.webPageMediaSize,v=(0,U.A)((()=>Boolean(s&&!a&&!n)),[n,a,s]),{shouldRender:A}=(0,Dt.A)({isOpen:v,ref:h,withShouldRender:!0}),y="full"===s?.webpageType&&s.hasLargeMedia,C=(0,i.li)(s);s&&s!==C.current&&(C.current=s);const w=s||C.current,b="full"===w?.webpageType,I=(0,Ft.A)(b?{content:w}:void 0),S=(0,d.eY)(w)||(0,d.rU)(w)||(0,d.y3)(w)||(0,d.rj)(w),M=S&&(0,d.VO)(S,"pictogram"),N=(0,Tt.A)(M),{shouldRender:k,ref:Y}=(0,Dt.A)({isOpen:Boolean(N),withShouldRender:!0,noCloseTransition:!0}),P=Boolean(N||k),F=(0,J.A)((()=>{l({chatId:e,threadId:t,noWebPage:!0})})),{isContextMenuOpen:T,contextMenuAnchor:D,handleContextMenu:x,handleContextMenuClose:E,handleContextMenuHide:L,handleBeforeContextMenu:B}=(0,O.A)(h,c,!0),R=(0,J.A)((()=>h.current)),K=(0,J.A)((()=>h.current)),z=(0,J.A)((()=>h.current.querySelector(`.${Et} .bubble`))),V=(0,J.A)((e=>{x(e)}));function $(e){u({isInvertedMedia:e})}function q(e){u({webPageMediaSize:e})}if((0,i.vJ)((()=>{A&&w||(E(),L())}),[E,L,A,w]),A&&w)return(0,He.Y)("div",{className:(0,g.A)("O3di3ULC",!c&&"G5_7x_Hn"),ref:h,children:(0,He.FD)("div",{className:"m3DBx9f5",children:[(0,He.Y)("div",{className:"vFWsMwfP",onClick:V,children:(0,He.Y)(Xe.A,{name:"link"})}),w&&"empty"!==w.webpageType&&(0,He.FD)(xt.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:x,onMouseDown:B,onClick:V,children:[P&&(0,He.FD)("div",{className:"VvwZOug9",children:[I&&(0,He.Y)("img",{src:I,alt:"",className:Lt}),k&&(0,He.Y)("img",{ref:Y,src:N,alt:"",className:Lt})]}),(0,He.FD)("div",{className:"itmZe2qi",children:[(0,He.Y)("span",{className:"ER149gdz",children:b?w.siteName||w.url:m("Loading")}),(0,He.Y)("span",{className:"FSYSqC60",children:b?w.description||m((H=w,H.photo?"AttachPhoto":H.video?"AttachVideo":H.audio?"AttachMusic":H.document?"AttachDocument":H.story?"AttachStory":"LinkPreview")):w.url})]})]}),(0,He.Y)(rt.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:m("AccLinkRemovePreview"),onClick:F,children:(0,He.Y)(Xe.A,{name:"close"})}),!c&&(0,He.Y)(et.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:K,getMenuElement:z,className:Et,onClose:E,onCloseAnimationEnd:L,autoClose:!0,children:(0,He.FD)(He.FK,{children:[p?(0,He.Y)(tt.A,{icon:"move-caption-up",onClick:()=>$(void 0),children:m("ContextMoveTextUp")}):(0,He.Y)(tt.A,{icon:"move-caption-down",onClick:()=>$(!0),children:m("ContextMoveTextDown")}),y&&(f?(0,He.Y)(tt.A,{icon:"expand",onClick:()=>q("large"),children:m("ContextLinkLargerMedia")}):(0,He.Y)(tt.A,{icon:"collapse",onClick:()=>q("small"),children:m("ContextLinkSmallerMedia")})),(0,He.Y)(tt.A,{icon:"delete",onClick:F,children:m("ContextLinkRemovePreview")})]})})]})});var H})));var Rt=n(97676),Ot=n(76283),Ut=n(57474),Kt=n(41036),zt=n(68292),Vt=n(21849),jt=n(48227),Jt=n(11241),$t=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}($t||{});const qt=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n,storyId:i,messageListType:o,isMobile:r,type:l})=>{const p=e.appConfig,g=(0,u.hds)(e,t),f=(0,d.DX)(t)?void 0:(0,u.yps)(e,t),v=Boolean(f),A=(0,u.nZ4)(e,t),y=(0,C.L8)(t),w=y?(0,u.vGo)(e,t):void 0,b=(0,u.WA9)(e,t),I=y?void 0:(0,u.AWZ)(e,t),S=(v||!y)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:k,shouldPaidMessageAutoApprove:Y}=e.settings.byKey,{language:P,shouldCollectDebugLogs:F}=(0,h.l)(e),{forwardMessages:{messageIds:T}}=(0,u.nTw)(e),D=e.emojiKeywords[a.cUY],x=P!==a.cUY?e.emojiKeywords[P]:void 0,E=S?S.id:void 0,L=E?(0,u.O5q)(e,t,E):void 0,{currentUserId:B}=e,R=(0,u.mBe)(e,B),O=I?I?.sendAsId||B:void 0,U=O?(0,u.PVB)(e,O):void 0,K=(0,u.sam)(e,t),z=(0,u.p6T)(e,t),V=(0,u.nTw)(e),j=Boolean(V.storyViewer.storyId),J=(0,u.Xf0)(e),$=t===J?.chatId&&n===J?.threadId&&o===J?.type&&!j,q=((0,u.mBe)(e,t)&&!w?.noVoiceMessages)??!0,H=I?.slowMode,G=(0,u.g29)(e),W="scheduled"===o?(0,u.dkp)(e,t):(0,u.U0A)(e,t,n),_=i&&(0,u.Msb)(e,t,i),Q=_&&"sentReaction"in _?_.sentReaction:void 0,Z=(0,u.GA4)(e,t,n),X=Z?.replyInfo?(0,u.O5q)(e,t,Z.replyInfo.replyToMsgId):void 0,ee=g?.isForum&&g.isForumAsMessages&&n===s.l3&&X?(0,u.nkm)(e,X):void 0,te="scheduled"===o,ne=y&&!v&&!te&&!A,ie=(0,u.rQx)(e,t,n),oe=g&&(0,c.RY)(g,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,se=y&&!v&&!te&&!A&&"story"!==l&&t!==a.zv8,ae=(0,u.xYJ)(e,"stickerEffects"),re=V.shouldPlayEffectInComposer,de=se&&Z?.effectId,ce=de?e.availableEffectById[de]:void 0,le=e.reactions.effectReactions,ue=e.config?.maxMessageLength||a.YfK,me=t===V.forwardMessages.toChatId,he=Boolean(Z?.replyInfo),pe=Boolean(Z?.suggestedPostInfo),ge=e.stars?.balance.amount||0,fe=Boolean(V.starsBalanceModal),ve=(0,u.trm)(e),Ae=e.isAppConfigLoaded,ye=V.insertingPeerIdMention,Ce=V.webPagePreviewId?(0,u.kgA)(e,V.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===l?e.reactions.topReactions:void 0,isOnActiveTab:!V.isBlurred,editingMessage:(0,u.KLw)(e,t,n,o),draft:Z,chat:g,isChatWithBot:v,isChatWithSelf:A,isForCurrentMessageList:$,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:g?(0,d.WX)(g):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===o&&(w||I)?.hasScheduledMessages,isInScheduledList:te,botKeyboardMessageId:E,botKeyboardPlaceholder:L?.keyboardPlaceholder,isForwarding:me,isReplying:he,hasSuggestedPost:pe,forwardedMessagesCount:me?T.length:void 0,pollModal:V.pollModal,todoListModal:V.todoListModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:I,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:B,currentUser:R,contentToBeScheduled:V.contentToBeScheduled,shouldSuggestStickers:M,shouldSuggestCustomEmoji:N,shouldUpdateStickerSetOrder:k,recentEmojis:e.recentEmojis,baseEmojiKeywords:D?.keywords,emojiKeywords:x?.keywords,inlineBots:V.inlineBots.byUsername,isInlineBotLoading:V.inlineBots.isLoading,botCommands:w?w.botInfo?.commands||!1:void 0,botMenuButton:w?.botInfo?.menuButton,sendAsPeer:U,sendAsId:O,editingDraft:W,requestedDraft:K,requestedDraftFiles:z,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,u.dfQ)(e,t),theme:(0,u.SJA)(e),fileSizeLimit:(0,m.d)(e,"uploadMaxFileparts")*a.dK5,captionLimit:(0,m.d)(e,"captionLength"),isCurrentUserPremium:G,canSendVoiceByPrivacy:q,attachmentSettings:e.attachmentSettings,slowMode:H,currentMessageList:J,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!G&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!A&&y&&!v&&!te,shouldCollectDebugLogs:F,sentStoryReaction:Q,stealthMode:e.stories.stealthMode,replyToTopic:ee,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:ne,noWebPage:ie,webPagePreview:Ce,isContactRequirePremium:w?.isContactRequirePremium,effect:ce,effectReactions:le,areEffectsSupported:se,canPlayEffect:ae,shouldPlayEffect:re,maxMessageLength:ue,paidMessagesStars:b,shouldPaidMessageAutoApprove:Y,isSilentPosting:oe,isPaymentMessageConfirmDialogOpen:V.isPaymentMessageConfirmDialogOpen,starsBalance:ge,isStarsBalanceModalOpen:fe,shouldDisplayGiftsButton:w?.shouldDisplayGiftsButton,disallowedGifts:w?.disallowedGifts,isAccountFrozen:ve,isAppConfigLoaded:Ae,insertingPeerIdMention:ye,pollMaxAnswers:p?.pollMaxAnswers}}))((({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:c,canScheduleUntilOnline:m,isReady:h,isMobile:C,editingMessage:Y,chatId:ie,threadId:oe,storyId:se,currentMessageList:ae,messageListType:re,draft:de,chat:ce,chatFullInfo:le,replyToTopic:ue,isForCurrentMessageList:me,isCurrentUserPremium:he,canSendVoiceByPrivacy:pe,isChatWithBot:ge,isChatWithSelf:Me,isChannel:Oe,fileSizeLimit:Ue,isRightColumnShown:Ke,isSelectModeActive:ze,isReactionPickerOpen:Ve,shouldDisplayGiftsButton:$e,isForwarding:qe,isReplying:We,hasSuggestedPost:_e,forwardedMessagesCount:Qe,pollModal:Ze,todoListModal:et,botKeyboardMessageId:tt,botKeyboardPlaceholder:it,inputPlaceholder:at,withScheduledButton:ut,stickersForEmoji:mt,customEmojiForEmoji:ht,topInlineBotIds:pt,currentUserId:gt,currentUser:Ft,captionLimit:Tt,contentToBeScheduled:Dt,shouldSuggestStickers:xt,shouldSuggestCustomEmoji:Et,baseEmojiKeywords:Lt,emojiKeywords:qt,recentEmojis:Ht,inlineBots:Gt,isInlineBotLoading:Wt,botCommands:_t,sendAsPeer:Qt,sendAsId:Zt,editingDraft:Xt,requestedDraft:en,requestedDraftFiles:tn,botMenuButton:nn,attachBots:on,attachMenuPeerType:sn,attachmentSettings:an,theme:rn,slowMode:dn,shouldUpdateStickerSetOrder:cn,editableInputCssSelector:ln,editableInputId:un,inputId:mn,className:hn,availableReactions:pn,topReactions:gn,canBuyPremium:fn,canPlayAnimatedEmojis:vn,shouldCollectDebugLogs:An,sentStoryReaction:yn,stealthMode:Cn,canSendOneTimeMedia:wn,quickReplyMessages:bn,quickReplies:In,canSendQuickReplies:Sn,webPagePreview:Mn,noWebPage:Nn,isContactRequirePremium:kn,paidMessagesStars:Yn,effect:Pn,effectReactions:Fn,areEffectsSupported:Tn,canPlayEffect:Dn,shouldPlayEffect:xn,maxMessageLength:En,isSilentPosting:Ln,isPaymentMessageConfirmDialogOpen:Bn,starsBalance:Rn,isStarsBalanceModalOpen:On,disallowedGifts:Un,isAccountFrozen:Kn,isAppConfigLoaded:zn,insertingPeerIdMention:Vn,pollMaxAnswers:jn,onDropHide:Jn,onFocus:$n,onBlur:qn,onForward:Hn})=>{const{sendMessage:Gn,clearDraft:Wn,showDialog:_n,openPollModal:Qn,closePollModal:Zn,openTodoListModal:Xn,closeTodoListModal:ei,loadScheduledHistory:ti,openThread:ni,addRecentEmoji:ii,sendInlineBotResult:oi,loadSendAs:si,resetOpenChatWithDraft:ai,callAttachBot:ri,addRecentCustomEmoji:di,showNotification:ci,showAllowedMessageTypesNotification:li,openStoryReactionPicker:ui,openGiftModal:mi,closeReactionPicker:hi,sendStoryReaction:pi,editMessage:gi,updateAttachmentSettings:fi,saveEffectInDraft:vi,setReactionEffect:Ai,hideEffectInComposer:yi,updateChatSilentPosting:Ci,updateInsertingPeerIdMention:wi,updateDraftSuggestedPostInfo:bi}=(0,o.ko)(),Ii=(0,$.A)(),Si=(0,j.A)(),Mi=(0,i.li)(),Ni=(0,i.li)(),ki=(0,i.li)(),[Yi,Pi]=(0,i.Ul)(""),[Fi,Ti]=(0,i.J0)(!1),Di=(0,V.A)(ln),xi=(0,i.li)(),Ei=(0,H.A)(n),{width:Li}=k.A.get(),Bi="messageList"===e,Ri="story"===e,Oi=Bi?ce?.sendAsPeerIds:void 0,Ui=Boolean(Oi?.length),[Ki,zi,Vi]=(0,z.A)(),ji=(0,W.A)(ie,oe),[Ji,$i,qi]=(0,z.A)(),[Hi,Gi,Wi]=(0,z.A)(),_i=Y&&(0,d.ZV)(Y),Qi=ce?.isMonoforum,{emojiSet:Zi,members:Xi,botCommands:eo}=le||{},to=Zi?.id,no=!Yn&&!Qi,io=yn&&(0,d.a0)(yn,a.tNZ);(0,i.vJ)(y.VU,[Yi]);const oo=(0,i.li)(0),[so,ao]=(0,G.A)(Bi&&m,Vi);(0,R.A)((()=>{Ti(!0)}),430),(0,i.vJ)((()=>{Bi||hi()}),[Bi,se]),(0,i.vJ)((()=>{xi.current=void 0}),[ie]),(0,i.vJ)((()=>{zn&&ie&&h&&!Ri&&!Qi&&ti({chatId:ie})}),[h,ie,oe,Ri,zn,Qi]),(0,i.vJ)((()=>{const e=Oe&&ce?.areProfilesShown,t=ce&&(0,d.Vs)(ce)&&Boolean((0,d.gA)(ce)||ce.isLinkedInDiscussion||ce.hasGeo);!Oi&&h&&(t||e)&&si({chatId:ie})}),[ce,ie,Oe,h,si,Oi]);const ro=(0,i.li)(!1);(0,Z.A)((([e,t])=>{ro.current=Boolean(ie===e&&Oi&&!t)}),[ie,Oi]);const[co,lo]=(0,i.J0)([]),uo=Boolean(co.length),[mo,ho]=(0,i.J0)(void 0),{canSendStickers:po,canSendGifs:go,canAttachMedia:fo,canAttachPolls:vo,canAttachEmbedLinks:Ao,canAttachToDoLists:yo,canSendVoices:Co,canSendPlainText:wo,canSendAudios:bo,canSendVideos:Io,canSendPhotos:So,canSendDocuments:Mo}=(0,i.Kr)((()=>(0,d.Q_)(ce,le,ge,Me,Ri,Yn,c)),[ce,le,ge,Me,Ri,Yn,c]),No=kn&&Ri,ko=No||!wo,Yo=(0,U.A)((()=>{if(uo)return co.length;const e=Yi()||uo?1:0;return qe&&Qe?Qe+e:e||1}),[Yi,uo,co,qe,Qe]),Po=Yn?Yo*Yn:0,{closeConfirmDialog:Fo,dialogHandler:To,shouldAutoApprove:Do,setAutoApprove:xo,handleWithConfirmation:Eo}=(0,xe.A)(Po,On,Rn),Lo=!uo&&Ao&&!Nn&&Boolean(Mn),Bo=ko&&!Y;(0,i.vJ)((()=>{Lo||fi({isInvertedMedia:void 0})}),[Lo]);const Ro=(0,J.A)(((e,t=un)=>{if(t===un&&Bo)return;const n=window.getSelection();let i;if(i=t===un?document.querySelector(ln):document.getElementById(t),n.rangeCount){const o=n.getRangeAt(0);if((0,D.L)(o,t))return(0,M.oR)(e),void i.dispatchEvent(new Event("input",{bubbles:!0}))}Pi(`${Yi()}${e}`),(0,r.Uz)((()=>{(0,w.A)(i)}))})),Oo=(0,J.A)(((e,t=un)=>{const n=(0,E.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");Ro(n,t)})),Uo=(0,J.A)(((e,t=un)=>{const n=(0,L.QY)(e);Ro(n,t)})),Ko=(0,J.A)(((e,t=un)=>{Ro((0,T.hB)(e),t)})),zo=(0,J.A)((()=>{mo&&(Uo(mo,un),ho(void 0))})),{shouldForceCompression:Vo,shouldForceAsFile:jo,handleAppendFiles:Jo,handleFileSelect:$o,onCaptionUpdate:qo,handleClearAttachments:Ho,handleSetAttachments:Go}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:a,canSendAudios:r,canSendVideos:c,canSendPhotos:l,canSendDocuments:u,insertNextText:m,editedMessage:h,shouldSendInHighQuality:p}){const g=(0,j.A)(),{openLimitReachedModal:f,showAllowedMessageTypesNotification:v,showNotification:A}=(0,o.ko)(),[y,C]=(0,i.J0)(!1),[w,b]=(0,i.J0)(!1),S=(0,J.A)((()=>{s(I.p),m()})),M=(0,J.A)((n=>{const i="function"==typeof n?n(e):n;if(i.length)if(i.some((e=>{const t=(0,d.ES)(e);return"audio"===t&&!r&&!u||"video"===t&&!c&&!u||"photo"===t&&!l&&!u||"file"===t&&!u})))v({chatId:a});else if(i.some((({size:e})=>e>t)))f({limit:"uploadMaxFileparts"});else{s(i);const e=i.some((e=>{const t=(0,d.ES)(e);return"audio"===t&&!r||"video"===t&&!c||"photo"===t&&!l}));C(Boolean(e&&u)),b(!u)}else S()})),N=(0,J.A)((async(t,n)=>{if(h){const e=await(0,F.A)(t[0].name,t[0]),n=h&&(0,d.eh)(h,e);h?.groupedId?n?M([e]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):M([e])}else{const i=await Promise.all(t.map((e=>(0,F.A)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:p}))));M([...e,...i])}})),k=(0,J.A)((async e=>{if(h){const t=await(0,F.A)(e[0].name,e[0]),n=h&&(0,d.eh)(h,t);h?.groupedId?n?M([t]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):M([t])}else{const t=await Promise.all(e.map((e=>(0,F.A)(e.name,e,{shouldSendInHighQuality:p}))));M(t)}})),Y=(0,J.A)((async()=>{const t=await Promise.all(e.map((e=>(0,F.A)(e.filename,e.blob,{shouldSendInHighQuality:p}))));M(t)}));return(0,i.vJ)((()=>{Y()}),[p]),{handleAppendFiles:N,handleFileSelect:k,onCaptionUpdate:n,handleClearAttachments:S,handleSetAttachments:M,shouldForceCompression:w,shouldForceAsFile:y}}({attachments:co,setHtml:Pi,setAttachments:lo,fileSizeLimit:Ue,chatId:ie,canSendAudios:bo,canSendVideos:Io,canSendPhotos:So,canSendDocuments:Mo,insertNextText:zo,editedMessage:Y,shouldSendInHighQuality:an.shouldSendInHighQuality}),[Wo,_o,Qo]=(0,z.A)(),[Zo,Xo,es]=(0,z.A)(),[ts,ns,is]=(0,z.A)(),[os,ss,as]=(0,z.A)(),[rs,ds,cs]=(0,z.A)(),{startRecordingVoice:ls,stopRecordingVoice:us,pauseRecordingVoice:ms,activeVoiceRecording:hs,currentRecordTime:ps,recordButtonRef:gs,startRecordTimeRef:fs,isViewOnceEnabled:vs,setIsViewOnceEnabled:As,toogleViewOnceEnabled:ys}=(()=>{const e=(0,i.li)(),[t,n]=(0,i.J0)(),o=(0,i.li)(),[s,a]=(0,i.J0)(),[d,c]=(0,i.J0)(!1);(0,i.vJ)((()=>{p.Yw&&p.pW&&je()}),[]);const l=(0,J.A)((async()=>{try{const{stop:t,pause:i}=await Je((t=>{e.current&&(o.current&&Date.now()%4==0&&(0,r.RK)((()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)})),a(Date.now()))}));o.current=Date.now(),a(Date.now()),n({stop:t,pause:i})}catch(e){console.error(e)}})),u=(0,J.A)((()=>{if(t){(0,r.RK)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.pause()}catch(e){return void console.error(e)}}})),m=(0,J.A)((()=>{if(t){n(void 0),o.current=void 0,a(void 0),(0,r.RK)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.stop()}catch(e){return void console.error(e)}}}));(0,i.vJ)((()=>t?(0,Re.A)(m):void 0),[t,m]);const h=(0,J.A)((()=>{c(!d)}));return{startRecordingVoice:l,pauseRecordingVoice:u,stopRecordingVoice:m,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:o,isViewOnceEnabled:d,setIsViewOnceEnabled:c,toogleViewOnceEnabled:h}})(),Cs=me&&!Ri;(0,B.A)((()=>{ji({type:"recordAudio"})}),Cs?hs&&a.cqp:void 0),(0,i.vJ)((()=>{me&&!Ri&&(hs||ji({type:"cancel"}))}),[hs,me,Ri,ji]);const ws=(0,Q.i)(Boolean(Y));(0,i.vJ)((()=>{me&&!Ri&&Yi()&&!ws.current&&ji({type:"typing"})}),[Yi,ws,me,Ri,ji]);const bs=ce&&(0,d.SJ)(ce),{isEmojiTooltipOpen:Is,closeEmojiTooltip:Ss,filteredEmojis:Ms,filteredCustomEmojis:Ns,insertEmoji:ks}=(0,Se.A)(Boolean(h&&t&&(Ri||me)&&xt&&!uo),Yi,Pi,void 0,Ht,Lt,qt),{isCustomEmojiTooltipOpen:Ys,closeCustomEmojiTooltip:Ps,insertCustomEmoji:Fs}=(0,ve.A)(Boolean(h&&t&&(Ri||me)&&Et&&!uo),Yi,Pi,Di,Mi,ht),{isStickerTooltipOpen:Ts,closeStickerTooltip:Ds}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,o.ko)(),[d,c,l]=(0,z.A)(!1),u=(0,te.A)((()=>{const n=t();if(!e||!n||p.TL&&n.length>8)return;if(!n.match(p.TL?Ee.A:a.bpX))return;const i=(0,X.S)(n);return i&&(p.TL&&1===(0,Le.A)(i)||!p.TL&&Boolean(n.match(Be)))?p.TL?i:i.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),m=(0,U.A)((()=>Boolean(u())),[u]),h=Boolean(n?.length);return(0,i.vJ)((()=>{if(!e||!m)return;const t=u();t?h||s({emoji:t}):r()}),[e,m,u,h,s,r]),(0,i.vJ)(l,[l,t]),{isStickerTooltipOpen:Boolean(m&&h&&!d),closeStickerTooltip:c}}(Boolean(h&&t&&(Ri||me)&&xt&&po&&!uo),Yi,mt),{isMentionTooltipOpen:xs,closeMentionTooltip:Es,insertMention:Ls,mentionFilteredUsers:Bs}=(0,De.A)(Boolean(Bi&&h&&me&&!uo),Yi,Pi,Di,Mi,Xi,pt,gt);(0,i.vJ)((()=>{if(!Vn)return;const e=(0,u.PVB)((0,o.mS)(),Vn);e&&Ls(e,!0,!0),wi({peerId:void 0})}),[Vn,Ls]);const{isOpen:Rs,botId:Os,isGallery:Us,switchPm:Ks,switchWebview:zs,results:Vs,closeTooltip:js,help:Js,loadMore:$s}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:d}=(0,o.ko)(),[c,l,u]=(0,z.A)(!1),m=(0,ee.gs)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Ye;const t=function(e){return Pe.innerHTML=e.replace(/<br>/g,"\n"),Pe.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),Pe.innerText}(e),n=t.match(Ne);return n?Fe(n[1],n[2],""===n[2]&&!t.match(ke)):Ye}(t):Ye}),[n,e],300),{username:h,query:p,canShowHelp:g,usernameLowered:f}=(0,U.A)(m,[m,n],!0);(0,Z.A)((([e])=>{e&&r({username:e})}),[h,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)&&!c);(0,i.vJ)((()=>{S||h||d()}),[S,d,h]);const M=(0,J.A)((()=>{f&&a({chatId:t,username:f,query:p,offset:C})}));return{isOpen:S,botId:v,isGallery:b,switchPm:A,switchWebview:y,results:w,closeTooltip:l,help:g&&I?`@${h} ${I}`:void 0,loadMore:M}}(Boolean(Bi&&h&&me&&!uo),ie,Yi,Gt),qs=Boolean(In&&Object.keys(In).length),{isOpen:Hs,close:Gs,filteredBotCommands:Ws,filteredQuickReplies:_s}=function(e,t,n,o,s){const[a,r]=(0,i.J0)(),[d,c]=(0,i.J0)(),[l,u,m]=(0,z.A)(!1),h=(0,ee.gs)((()=>{const n=t();return e&&n.startsWith("/")?(0,X.S)(n).match(ne)?.[0].trim():void 0}),[t,e],300),p=(0,te.A)(h,[h,t],!0);return(0,i.vJ)((()=>{const e=p(),t=n||o;if(!e||!t&&!s)return r(void 0),void c(void 0);const i=e.substring(1),a=t?.filter((e=>!i||e.command.startsWith(i)));r(a?.length?a:void 0);const d=Object.values(s||{}).filter((e=>!i||e.shortcut.startsWith(i)));c(d?.length?d:void 0)}),[p,n,o,s]),(0,i.vJ)(m,[m,t]),{isOpen:Boolean((a?.length||d?.length)&&!l),close:u,filteredBotCommands:a,filteredQuickReplies:d}}(Boolean(Bi&&h&&me&&(_t&&_t?.length||eo?.length||qs&&Sn)),Yi,_t,eo,Sn?In:void 0);(({draft:e,chatId:t,threadId:n,getHtml:d,setHtml:c,editedMessage:l,isDisabled:u})=>{const{saveDraft:m,clearDraft:h,loadCustomEmojis:p}=(0,o.ko)(),g=(0,i.li)(!1);(0,i.vJ)((()=>{const t=d(),n=void 0!==e?.isLocal;(0,L.QY)(e?.text)!==t||n?g.current=!0:g.current=!1}),[e,d]),(0,i.vJ)((()=>{g.current=!1}),[t,n]);const f=Boolean(l),v=(0,J.A)(((e={})=>{if(u||f||!g.current)return;const i=d();i?(0,r.YS)((()=>{m({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,S.Ay)(i)})})):h({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})})),A=(0,ye.A)(a.mPG,!0,void 0,[t,n]);(0,Ae.A)((([i,o,d])=>{if(u)return;const m=g.current,h=e?.suggestedPostInfo&&!d?.suggestedPostInfo;if(t===i&&n===o){if(m&&!e)return;if(!e&&d&&c(""),m&&!h)return}if(l||!e)return;c((0,L.QY)(e.text)),h&&(0,r.Uz)((()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)}));const f=e.text?.entities?.map((e=>e.type===s.C7.CustomEmoji&&e.documentId)).filter(Boolean)||[];f.length&&p({ids:f})}),[t,n,e,d,c,l,u]),(0,i.Nf)((()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),be=!0,(0,r.YS)((()=>{be=!1}))}}),[t,n,f,v,u]);const y=(0,Q.i)(t),C=(0,Q.i)(n);(0,i.vJ)((()=>{if(u||be)return;if(!d())return void v();const e=y.current,t=C.current;A((()=>{y.current===e&&C.current===t&&v()}))}),[y,d,u,A,C,v]),(0,Ce.Ay)(v),(0,we.A)(v)})({draft:de,chatId:ie,threadId:oe,getHtml:Yi,setHtml:Pi,editedMessage:Y,isDisabled:Ri||Boolean(en)||!_e&&Qi}),function({getHtml:e,chatId:t,threadId:n}){const{loadWebPagePreview:a,clearWebPagePreview:r,toggleMessageWebPage:d}=(0,o.ko)(),c=(0,i.li)(),l=(0,ee.tF)((()=>{const t=(0,S.Ay)(e()),n=t.entities?.find((e=>e.type===s.C7.TextUrl));return c.current=t,n?.url||t.text.match(Te)?.[0]}),[e],300,!0),u=(0,te.A)(l,[l,e],!0);(0,i.vJ)((()=>{const e=u(),i=c.current;e?a({text:i}):(r(),d({chatId:t,threadId:n}))}),[u,t,n]),(0,Z.A)((()=>{r(),d({chatId:t,threadId:n})}),[t,r,n,d])}({chatId:ie,threadId:oe,getHtml:Yi});const Qs=(0,J.A)(((e=!1)=>{e||Pi(""),lo(I.p),ho(void 0),Ss(),Ps(),Ds(),Es(),C?setTimeout((()=>is()),350):is()})),[Zs,Xs,ea]=((e,t,n,s,c,l,u,m,h)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,o.ko)(),[A,y]=(0,i.J0)(!1),C=m?.replyInfo?.replyToMsgId;(0,K.A)((([e,i])=>{if(!n)return;if(C&&i!==C)return t(""),void y(!1);if(e?.id===n.id&&C===i)return;const o=!e&&h?.text.length?h:n.content.text,s=(0,L.QY)(o);t(s),y(!0),(0,r.Uz)((()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)}))}),[n,C,h,t]),(0,i.vJ)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>Ie.has(e.type)));f({chatId:c,threadId:l,noWebPage:e})}),[c,l,n]),(0,i.vJ)((()=>{if(n)return()=>{const t=(0,S.Ay)(e()),n=t.text.length?t:void 0;g({chatId:c,threadId:l,type:u,text:n})}}),[c,n,e,g,l,u]);const b=(0,ee.tF)((()=>{if(!n)return!1;const t=(0,S.Ay)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>Ie.has(e.type)))&&!t.entities?.some((e=>Ie.has(e.type)))}),[n,e],300,!0),I=(0,te.A)(b,[b,e],!0);(0,K.A)((([e])=>{n&&e?.id===n.id&&I()&&f({chatId:c,threadId:l,noWebPage:!1})}),[n,c,e,l,I]);const M=(0,J.A)((()=>{m&&(0,r.YS)((()=>{t((0,L.QY)(m.text)),(0,r.Uz)((()=>{const e=document.querySelector(a.m$5);e&&(0,w.A)(e,!0)}))}))})),N=(0,J.A)((()=>{s(),M()})),k=(0,J.A)((()=>{const{text:t,entities:i}=(0,S.Ay)(e());n&&(t||(0,d.mR)(n)?(p({messageList:{chatId:c,threadId:l,type:u},text:t,entities:i}),s(),M()):v({chatId:c,messageIds:[n.id],isSchedule:"scheduled"===u}))})),Y=(0,J.A)((()=>{if(!n)return;const t=(0,S.Ay)(e()),i=t.text.length?t:void 0;g({chatId:c,threadId:l,type:u,text:i})}));return(0,Ce.Ay)(Y),(0,we.A)(Y),[k,N,A]})(Yi,Pi,Y,Qs,ie,oe,re,de,Xt),ta=(0,Q.i)(Qs),na=(0,Q.i)(us);(0,i.vJ)((()=>()=>{na.current(),ta.current()}),[ie,oe,ta,na]);const ia=(0,i.Kr)((()=>{if(Un)return Object.values(Un).every(Boolean)}),[Un]),oa=Boolean(!Me&&$e&&!ia),sa=Qi&&!Y&&!qe&&!We&&!de?.suggestedPostInfo,aa=(0,J.A)((()=>{const e=oo.current;ci(e?{message:Ii("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:gt,shouldReplaceHistory:!0}},actionText:Ii("Open")}:{message:Ii("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:Ii("PremiumMore")}),oo.current=Number(!e)})),ra=(0,U.A)((()=>Ji||!Hn||Yi()&&!uo?Y&&ea?$t.Edit:!p.pW||hs||qe||Yi()&&!uo?c?$t.Schedule:$t.Send:$t.Record:$t.Forward),[hs,Y,Yi,uo,qe,Ji,Hn,ea,c]),da=!c,{isContextMenuOpen:ca,handleContextMenu:la,handleContextMenuClose:ua,handleContextMenuHide:ma}=(0,O.A)(gs,!(ra===$t.Send&&da)),{contextMenuAnchor:ha,handleContextMenu:pa,handleBeforeContextMenu:ga,handleContextMenuHide:fa}=(0,O.A)(ki,!Ri);(0,i.vJ)((()=>{Ve||ha&&(ui({peerId:ie,storyId:se,position:ha}),fa())}),[ie,fa,Ve,se,ha]),fe(me||Ri,Uo,Go,ho,Y,!he&&!Me,aa);const va=(0,J.A)((()=>{Y&&Xs()})),Aa=(0,J.A)(((e,t)=>{const n=t?Tt:En;if(e?.length>n){const t=e.length-n;return _n({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),ya=(0,J.A)((()=>{if(dn&&!bs){const e=document.querySelector(ln),t=(0,N.Fm)(),n=xi.current&&Math.floor(t-xi.current),i=dn.nextSendDate&&dn.nextSendDate>t;if(n&&n<dn.seconds||i){const o=i?dn.nextSendDate-t:dn.seconds-n;return _n({data:{message:Ii("SlowModeHint",(0,f.QO)(o)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),Ca=e=>{if(!ae&&!se)return!1;const{text:t}=(0,S.Ay)(Yi());return!(!t&&!e.length||!Aa(t,!0)||!ya())},wa=(0,J.A)((({attachments:e,sendCompressed:t=an.shouldCompress,sendGrouped:n=an.shouldSendGrouped,isSilent:i,scheduledAt:o,isInvertedMedia:s})=>{if(!ae&&!se)return;i=i||Ln;const{text:a,entities:d}=(0,S.Ay)(Yi());s=a&&t&&n?s:void 0,Y?gi({messageList:ae,text:a,entities:d,attachments:(0,F.L)(e,t)}):Gn({messageList:ae,text:a,entities:d,scheduledAt:o,isSilent:i,shouldUpdateStickerSetOrder:cn,attachments:(0,F.L)(e,t),shouldGroupMessages:n,isInvertedMedia:s}),xi.current=(0,N.Fm)(),Wn({chatId:ie,isLocalOnly:!0}),(0,r.YS)((()=>{Qs()}))})),ba=(0,J.A)(((e,t,n)=>{if(Ca(co)){if(Y)return void wa({attachments:co,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});Eo(wa,{attachments:co,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}})),Ia=(0,J.A)(((e,t,n,i,o)=>{Ca(co)&&wa({attachments:co,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:i,isInvertedMedia:o})})),Sa=(0,J.A)(((e,t=!1,n)=>{const{text:i,entities:o}=(0,S.Ay)(Yi());if(e.length)return void(Ca(e)&&wa({attachments:e,scheduledAt:n,isSilent:t}));if(!i&&!qe)return;if(!Aa(i))return;const s=document.querySelector(ln),a=Pn?.id;if(i||qe){if(!ya())return;const e=Lo?an.isInvertedMedia:void 0;Tn&&vi({chatId:ie,threadId:oe,effectId:void 0}),Gn({messageList:ae,text:i,entities:o,scheduledAt:n,isSilent:t,shouldUpdateStickerSetOrder:cn,isInvertedMedia:e,effectId:a,webPageMediaSize:an.webPageMediaSize,webPageUrl:Lo?Mn.url:void 0,isForwarding:qe})}xi.current=(0,N.Fm)(),Wn({chatId:ie,threadId:oe,isLocalOnly:!0,shouldKeepReply:qe}),p.pz&&s&&s===document.activeElement&&P(s),(0,r.YS)((()=>{Qs()}))})),Ma=(0,J.A)((async(e=!1,t)=>{if(!ae&&!se)return;e=e||Ln;let n=co;if(hs){const e=await us(),t=vs?a.dxe:void 0;if(e){const{blob:i,duration:o,waveform:s}=e;n=[await(0,F.A)("wonderful-voice-message.ogg",i,{voice:{duration:o,waveform:s},ttlSeconds:t})]}}Sa(n,e,t)})),Na=(0,J.A)(((e=!1,t)=>{Eo(Ma,e,t)})),ka=(0,J.A)((()=>{he?Xn({chatId:ie}):ci({message:Si("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Si("PremiumMore")})})),Ya=(0,J.A)((()=>{if("webApp"!==nn?.type)return;const e=(0,A.vG)(nn.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,v._)(nn.url):ri({chatId:ie,url:nn.url,threadId:oe})})),Pa=(0,J.A)((()=>{is(),Xo()})),Fa=(0,J.A)(((e,t,n,i)=>{if(e&&"queryId"in e){const{id:n,queryId:i,isSilent:o}=e;return void oi({id:n,chatId:ie,threadId:oe,queryId:i,scheduledAt:t,isSilent:o||Ln})}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;Ia(n,i,o,t,s)}else Gn({...e,messageList:n,scheduledAt:t,effectId:i});else Ma(Boolean(o),t)}));(0,K.A)((([e])=>{ae&&Dt&&Dt!==e&&so((e=>{Fa(Dt,e,ae)}))}),[Dt,ae,Fa,so]),(0,i.vJ)((()=>{en&&(Uo(en),ai(),(0,r.Uz)((()=>{const e=document.getElementById(un);(0,w.A)(e,!0)})))}),[un,en,ai,Pi]),(0,i.vJ)((()=>{tn?.length&&($o(tn),ai())}),[$o,tn,ai]);const Ta=(0,J.A)(((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||he||Me||n===to?Ko(e,t):aa()})),Da=(0,J.A)((e=>{Ta(e,a.e0F)})),xa=(0,J.A)(((e,t,n)=>{(ae||se)&&(t=t||Ln,c||n?(zi(),so((n=>{Vi(),Eo(Fa,{gif:e,isSilent:t},n,ae),(0,r.YS)((()=>{Qs(!0)}))}))):(Eo(Gn,{messageList:ae,gif:e,isSilent:t}),(0,r.YS)((()=>{Qs(!0)}))))})),Ea=(0,J.A)(((e,t,n,i=!1,o)=>{(ae||se)&&(t=t||Ln,e={...e,isPreloadedGlobally:!0},c||n?(zi(),so((n=>{Vi(),Eo(Fa,{sticker:e,isSilent:t},n,ae),(0,r.YS)((()=>{Qs(i)}))}))):(Eo(Gn,{messageList:ae,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:cn&&o}),Wn({chatId:ie,threadId:oe,isLocalOnly:!0}),(0,r.YS)((()=>{Qs(i)}))))})),La=(0,J.A)(((e,t,n)=>{if(!ae&&!se)return;t=t||Ln,c||n?so((n=>{Eo(Fa,{id:e.id,queryId:e.queryId,isSilent:t},n,ae)})):Eo(oi,{id:e.id,queryId:e.queryId,threadId:oe,chatId:ie,isSilent:t});const i=document.querySelector(ln);p.pz&&i&&i===document.activeElement&&P(i),Wn({chatId:ie,isLocalOnly:!0}),(0,r.YS)((()=>{Qs()}))})),Ba=(0,J.A)((()=>{Wn({chatId:ie,isLocalOnly:!0}),(0,r.YS)((()=>{Qs()}))})),Ra=(0,J.A)((e=>{ae&&(c?(so((t=>{Eo(Fa,{poll:e},t,ae)})),Zn()):(Eo(Gn,{messageList:ae,poll:e,isSilent:Ln}),Zn()))})),Oa=(0,J.A)((e=>{ae&&(c?so((t=>{Eo(Fa,{todo:e},t,ae)})):Eo(Gn,{messageList:ae,todo:e,isSilent:Ln}))})),Ua=(0,J.A)((e=>{if(c)so((t=>{Fa({...e,isSilent:!0},t,ae)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:i}=e;Ia(t,n,!0,void 0,i)}else Ma(!0)})),Ka=(0,J.A)((()=>{const e=document.querySelector(ln);if(!C||e!==document.activeElement)return es(),is(),void ss();e?.blur(),setTimeout((()=>{es(),is(),ss()}),100)}));(0,i.vJ)((()=>{Bo&&Pi("")}),[Bo,Pi,co]);const za=(0,J.A)((e=>{Oo(e,a.e0F)})),Va=(0,J.A)(((e=un)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,D.L)(n,e))return void document.execCommand("delete",!1)}Pi(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}(Yi()))})),ja=(0,J.A)((()=>{Va(a.e0F)})),Ja=(0,J.A)((()=>{ni({chatId:ie,threadId:oe,type:"scheduled",noForumTopicPanel:!0})})),$a=(0,J.A)((()=>{mi({forUserId:ie})})),qa=(0,J.A)((()=>{bi({price:{currency:a.OUy,amount:0,nanos:0}})})),Ha=(0,J.A)((()=>{const e=!Ln;Ci({chatId:ie,isEnabled:e}),ci({localId:"silentPosting",icon:e?"mute":"unmute",message:Si(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})}));(0,i.vJ)((()=>{Ke&&C&&is()}),[Ke,is,C]),(0,i.vJ)((()=>{h&&(ze?ds():setTimeout((()=>{cs()}),200))}),[ze,cs,ds,h]);const Ga=(0,U.A)((()=>Boolean(Yi())),[Yi]),Wa=ge&&"webApp"===nn?.type&&!Y&&"thread"===re,_a=Wa&&!Ga&&!hs,[Qa,Za]=(0,i.Kr)((()=>dn?.nextSendDate?["SlowModeWait",dn.nextSendDate]:Cn?.activeUntil&&Ri?["StealthModeActiveHint",Cn.activeUntil]:[]),[Ri,dn?.nextSendDate,Cn?.activeUntil]),Xa=Wo||ts||Is||os||xs||Rs||Zo||Hi||Ts||Hs||Ys||_a||ca||Boolean(hs)||co.length>0||Ji,er=Xa&&!Ve&&Ri&&!Hi&&!ts,tr=(0,i.Kr)((()=>hs&&Li<=600?"":Bo?Si(Ri?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):it||at||(Yn?Si("ComposerPlaceholderPaidMessage",{amount:(0,b.U2)(Si,Yn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):We&&_e?Si("ComposerPlaceholderCaption"):ce?.adminRights?.anonymous?Si("ComposerPlaceholderAnonymous"):ce?.isForum&&ce?.isForumAsMessages&&oe===s.l3?ue?Si("ComposerPlaceholderTopic",{topic:ue.title}):Si("ComposerPlaceholderTopicGeneral"):Si(Oe?Ln?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder"))),[hs,it,ce,at,Oe,Bo,Ri,Ln,Si,ue,We,oe,Li,Yn,_e]);(0,i.vJ)((()=>{Xa?$n?.():qn?.()}),[Xa,qn,$n]);const{shouldRender:nr,transitionClassNames:ir}=(0,_.A)(er),or=!(ra!==$t.Record||fo&&pe&&Co),sr=(0,J.A)((()=>{switch(ra){case $t.Forward:Hn?.();break;case $t.Send:Na();break;case $t.Record:or?pe?Co||li({chatId:ie,messageListType:re}):ci({message:Ii("VoiceMessagesRestrictedByPrivacy",ce?.title)}):(As(!1),ls());break;case $t.Edit:Zs();break;case $t.Schedule:if(hs&&ms(),!ae)return;so((e=>{Fa({},e,ae,Pn?.id)}))}})),ar=new Date;ar.setSeconds(0),ar.setMilliseconds(0);const rr=new Date;rr.setFullYear(rr.getFullYear()+1);let dr="SendMessage";switch(ra){case $t.Forward:dr="Forward";break;case $t.Edit:dr="Save edited message";break;case $t.Record:dr=fo?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const cr=(0,g.A)("Composer",!ze&&"shown",rs&&"hover-disabled",Fi&&"mounted",hn),lr=(0,J.A)((e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const i=(0,o.mS)().customEmojis.byId[e.documentId];if(!i)return;if(!i.isFree&&!he&&!Me)return void aa();const s=(0,S.Ay)((0,T.hB)(i));t=s.text,n=s.entities}Eo(Gn,{text:t,entities:n,isReaction:!0}),hi()})),ur=(0,J.A)((e=>{Ai({chatId:ie,threadId:oe,reaction:e}),hi()})),mr=(0,J.A)((e=>{ui({peerId:ie,storyId:se,position:e,sendAsMessage:!0})})),hr=(0,J.A)((()=>{const e=yn?void 0:a.tNZ;pi({peerId:ie,storyId:se,containerId:(0,d.$_)(ie,se),reaction:e})})),pr=(0,J.A)((()=>{so((e=>{Fa({},e,ae)}))})),gr=(0,J.A)((()=>{Eo(Ua)})),fr=(0,J.A)((()=>{Eo(Fa,{},a.NkL,ae,Pn?.id)})),vr=(0,J.A)(((e,t,n)=>{so((i=>{Eo(Fa,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},i,ae)}))})),Ar=(0,J.A)(((e,t,n)=>{Eo(Ua,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})})),yr=(0,J.A)((()=>{vi({chatId:ie,threadId:oe,effectId:void 0})})),Cr=(0,J.A)((()=>{yi({})})),wr=(0,i.Kr)((()=>{switch(ra){case $t.Edit:return Zs;case $t.Schedule:return pr;default:return Na}}),[ra,Zs,Na]),br=ge&&"commands"===nn?.type&&!Y&&!1!==_t&&!hs,Ir=Tn&&Pn?.emoticon,Sr=Boolean(Yn&&ra===$t.Send),Mr=(0,q.A)(Sr);return(0,He.FD)("div",{className:cr,children:[Bi&&fo&&h&&(0,He.Y)(Ct,{isOpen:n!==yt.I.None,withQuick:n===yt.I.QuickFile||Ei===yt.I.QuickFile,onHide:Jn,onFileSelect:$o,editingMessage:Y}),nr&&!No&&(0,He.Y)(Ot.A,{topReactions:gn,allAvailableReactions:pn,onToggleReaction:lr,isPrivate:!0,isReady:h,canBuyPremium:fn,isCurrentUserPremium:he,isInSavedMessages:Me,isInStoryViewer:Ri,canPlayAnimatedEmojis:vn,onShowMore:mr,className:ir}),(0,He.Y)(Ge,{chatId:ie,threadId:oe,canShowCustomSendMenu:da,attachments:co,getHtml:Yi,isReady:h,shouldForceCompression:Vo,shouldForceAsFile:jo,isForCurrentMessageList:me,isForMessage:Bi,shouldSchedule:no&&c,canSchedule:no,forceDarkTheme:Ri,onCaptionUpdate:qo,onSendSilent:Ar,onSend:ba,onSendScheduled:vr,onFileAppend:Jo,onClear:Ho,onAttachmentsUpdate:Go,onCustomEmojiSelect:Da,onRemoveSymbol:ja,onEmojiSelect:za,editingMessage:Y,onSendWhenOnline:fr,canScheduleUntilOnline:m&&!vs,paidMessagesStars:Yn}),(0,He.Y)(Mt,{isOpen:Ze.isOpen,isQuiz:Ze.isQuiz,shouldBeAnonymous:Oe,maxOptionsCount:jn,onClear:Zn,onSend:Ra}),(0,He.Y)(Pt,{modal:et,onClear:ei,onSend:Oa}),(0,He.Y)(Nt,{isOpen:os,onClose:as,chatId:ie,selectedSendAsId:Zt,sendAsPeerIds:Oi,isCurrentUserPremium:he}),(0,He.Y)(It,{isOpen:xs,filteredUsers:Bs,onInsertUserName:Ls,onClose:Es}),(0,He.Y)(lt,{isOpen:Hs,chatId:ie,withUsername:Boolean(eo),botCommands:Ws,quickReplies:_s,getHtml:Yi,self:Ft,quickReplyMessages:bn,onClick:Ba,onClose:Gs}),(0,He.FD)("div",{className:(0,g.A)("composer-wrapper",Ri&&"with-story-tweaks",No&&"is-need-premium"),children:[!No&&(0,He.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,He.Y)("defs",{children:(0,He.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,He.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,He.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,He.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,He.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,He.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,He.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"})]})]}),Bi&&(0,He.FD)(He.FK,{children:[(0,He.Y)(bt,{isOpen:Rs,botId:Os,isGallery:Us,inlineBotResults:Vs,switchPm:Ks,switchWebview:zs,loadMore:$s,isSavedMessages:Me,canSendGifs:go,isCurrentUserPremium:he,onSelectResult:La,onClose:js}),(0,He.Y)(ft,{onClear:va,shouldForceShowEditing:Boolean(ea&&Y),chatId:ie,threadId:oe,messageListType:re}),(0,He.Y)(Bt,{chatId:ie,threadId:oe,isDisabled:!Ao||uo||!Ga,isEditing:Boolean(Y)})]}),(0,He.FD)("div",{className:(0,g.A)("message-input-wrapper",(0,x.y)(Ft)),children:[Bi&&(0,He.FD)(He.FK,{children:[Wa&&(0,He.Y)(ct,{isOpen:_a,text:nn.text,isDisabled:Boolean(hs),onClick:Ya}),br&&(0,He.Y)(nt.A,{className:(0,g.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===_t,color:"translucent",onActivate:Pa,ariaLabel:"Open bot command keyboard",children:(0,He.Y)(Xe.A,{name:"bot-commands-filled"})}),Ui&&Qt&&(0,He.Y)(rt.A,{round:!0,color:"translucent",onClick:os?as:Ka,ariaLabel:Ii("SendMessageAsTitle"),className:(0,g.A)("send-as-button","composer-action-button",ro.current&&"appear-animation"),children:(0,He.Y)(Vt.A,{peer:Qt,size:"tiny"})})]}),(!Bo||go||po)&&!No&&!Kn&&(0,He.Y)(Yt.A,{chatId:ie,threadId:oe,isMobile:C,isReady:h,isSymbolMenuOpen:ts,openSymbolMenu:ns,closeSymbolMenu:is,canSendStickers:po,canSendGifs:go,isMessageComposer:Bi,onGifSelect:xa,onStickerSelect:Ea,onCustomEmojiSelect:Ta,onRemoveSymbol:Va,onEmojiSelect:Oo,closeBotCommandMenu:es,closeSendAsMenu:as,isSymbolMenuForced:Ki,canSendPlainText:!Bo,inputCssSelector:ln,idPrefix:e,forceDarkTheme:Ri}),(0,He.Y)(St.A,{ref:Mi,id:mn,editableInputId:un,customEmojiPrefix:e,isStoryInput:Ri,chatId:ie,canSendPlainText:!Bo,threadId:oe,isReady:h,isActive:!uo,getHtml:Yi,placeholder:tr,timedPlaceholderDate:Za,timedPlaceholderLangKey:Qa,forcedPlaceholder:Js,canAutoFocus:h&&me&&!uo&&Bi,noFocusInterception:uo,shouldSuppressFocus:C&&ts,shouldSuppressTextFormatter:Is||xs||Rs,onUpdate:Pi,onSend:wr,onSuppressedFocus:is,onFocus:$i,onBlur:qi,isNeedPremium:No,messageListType:re}),Bi&&(0,He.FD)(He.FK,{children:[Wt&&Boolean(Os)&&(0,He.Y)(Ut.A,{color:"gray"}),(0,He.Y)(Kt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(Ga),direction:"inverse",name:"slideFadeAndroid",children:!Ga&&(0,He.FD)(He.FK,{children:[Oe&&(0,He.Y)(Kt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(Ln),children:(0,He.Y)(rt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:Ha,ariaLabel:Si(Ln?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),children:(0,He.Y)(Xe.A,{name:Ln?"mute":"unmute"})})}),ut&&(0,He.Y)(rt.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:Ja,ariaLabel:Si("AriaComposerOpenScheduled"),children:(0,He.Y)(Xe.A,{name:"schedule"})}),oa&&(0,He.Y)(rt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:$a,children:(0,He.Y)(Xe.A,{name:"gift"})}),sa&&(0,He.Y)(rt.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:qa,children:(0,He.Y)(Xe.A,{name:"cash-circle"})}),Boolean(tt)&&!hs&&!Y&&(0,He.Y)(nt.A,{className:(0,g.A)("composer-action-button",Wo&&"activated"),round:!0,color:"translucent",onActivate:_o,ariaLabel:Si("AriaComposerBotKeyboard"),children:(0,He.Y)(Xe.A,{name:"bot-command"})})]})})]}),hs&&Boolean(ps)&&(0,He.Y)("span",{className:"recording-state",children:(0,f.JW)(ps-fs.current)}),!No&&(0,He.Y)(ot,{chatId:ie,threadId:oe,editingMessage:Y,canEditMedia:_i,isButtonVisible:!hs,canAttachMedia:fo,canAttachPolls:vo,canAttachToDoLists:yo,canSendPhotos:So,canSendVideos:Io,canSendDocuments:Mo,canSendAudios:bo,onFileSelect:$o,onPollCreate:Qn,onTodoListCreate:ka,isScheduled:c,attachBots:Bi?on:void 0,peerType:sn,shouldCollectDebugLogs:An,theme:rn,onMenuOpen:Gi,onMenuClose:Wi,messageListType:re,paidMessagesStars:Yn}),Bi&&Boolean(tt)&&(0,He.Y)(dt,{messageId:tt,isOpen:Wo,onClose:Qo}),Bi&&_t&&(0,He.Y)(st,{isOpen:Zo,botCommands:_t,onClose:es}),(0,He.Y)(vt.A,{chatId:ie,isOpen:Ys,onCustomEmojiSelect:Fs,addRecentCustomEmoji:di,onClose:Ps},`custom-emoji-tooltip-${un}`),(0,He.Y)(kt,{chatId:ie,threadId:oe,isOpen:Ts,onStickerSelect:Ea,onClose:Ds},`sticker-tooltip-${un}`),(0,He.Y)(wt.A,{isOpen:Is,emojis:Ms,customEmojis:Ns,addRecentEmoji:ii,addRecentCustomEmoji:di,onEmojiSelect:ks,onCustomEmojiSelect:ks,onClose:Ss},`emoji-tooltip-${un}`)]})]}),wn&&hs&&(0,He.FD)(rt.A,{className:(0,g.A)("view-once",vs&&"active"),round:!0,color:"secondary",ariaLabel:Ii("Chat.PlayOnceVoiceMessageTooltip"),onClick:ys,children:[(0,He.Y)(Xe.A,{name:"view-once"}),(0,He.Y)(Xe.A,{name:"one-filled"})]}),hs&&(0,He.Y)(rt.A,{round:!0,color:"danger",className:"cancel",onClick:us,ariaLabel:"Cancel voice recording",children:(0,He.Y)(Xe.A,{name:"delete"})}),Ri&&!hs&&(0,He.FD)(rt.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:hr,onContextMenu:pa,onMouseDown:ga,ariaLabel:Ii("AccDescrLike"),ref:ki,children:[yn&&(0,He.Y)(Jt.A,{containerId:(0,d.$_)(ie,se),reaction:yn,withEffectOnly:io},(0,d.Jj)(yn)),(!yn||io)&&(0,He.Y)(Xe.A,{name:"heart",className:(0,g.A)(io&&"story-reaction-heart")})]}),(0,He.FD)(rt.A,{ref:gs,round:!0,color:"secondary",className:(0,g.A)(ra,"main-button",!h&&"not-ready",hs&&"recording"),disabled:or,allowDisabledClick:!0,noFastClick:!0,ariaLabel:Ii(dr),onClick:sr,onContextMenu:ra===$t.Send&&da?la:void 0,children:[(0,He.Y)(Xe.A,{name:"send"}),(0,He.Y)(Xe.A,{name:"microphone-alt"}),Hn&&(0,He.Y)(Xe.A,{name:"forward"}),Bi&&(0,He.Y)(Xe.A,{name:"schedule"}),Bi&&(0,He.Y)(Xe.A,{name:"check"}),(0,He.Y)(rt.A,{className:(0,g.A)("paidStarsBadge",Sr&&"visible",Mr&&!Sr&&"hiding",!Mr&&!Sr&&"hidden"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,He.FD)("div",{className:"paidStarsBadgeText",children:[(0,He.Y)(Xe.A,{name:"star",className:(0,g.A)("star-amount-icon",hn)}),(0,He.Y)(zt.A,{ref:Ni,text:Si.number(Po)})]})})]}),Ir&&(0,He.Y)("span",{className:"effect-icon",onClick:yr,children:(0,E.A)(Ir)}),Pn&&Dn&&(0,He.Y)(Rt.A,{shouldPlay:xn,effect:Pn,onStop:Cr}),da&&(0,He.Y)(At.A,{isOpen:ca,canSchedule:no&&Bi&&!vs,canScheduleUntilOnline:m&&!vs,onSendSilent:Me?void 0:gr,onSendSchedule:c?void 0:pr,onSendWhenOnline:fr,onRemoveEffect:yr,onClose:ua,onCloseAnimationEnd:ma,isSavedMessages:Me,chatId:ie,withEffects:Tn,hasCurrentEffect:Boolean(Pn),effectReactions:Fn,allAvailableReactions:pn,onToggleReaction:ur,isCurrentUserPremium:he,isInSavedMessages:Me,isInStoryViewer:Ri,canPlayAnimatedEmojis:vn}),ao,(0,He.Y)(jt.A,{isOpen:Bn,onClose:Fo,userName:ce?(0,l.F9)(Si,ce):void 0,messagePriceInStars:Yn||0,messagesCount:Yo,shouldAutoApprove:Do,setAutoApprove:xo,confirmHandler:To})]})})))},23459:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(84051),o=n(13439),s=n(90709),a=n(60919),r=n(9716),d=n(37836);const c=36e5,l=new Map;let u=new Set;const m=(0,d.nF)((()=>{const e=Array.from(u),t=e.slice(0,100),n=e.slice(101);(0,o.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach((e=>l.set(e,Date.now()))),u=new Set(n),u.size&&m()}),500);function h(e){const t=(0,i.Kr)((()=>{const t=(0,o.mS)();return e?.map((e=>(0,a.PVB)(t,e))).filter(Boolean)}),[e]),n=(0,i.Kr)((()=>{const e=(0,o.mS)();return t?.filter((t=>{const n=l.get(t.id)||0;if(Date.now()-n<c)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))),m())}),[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)(),d=(0,o.A)(),c=null!=e,l=null!=n;return c&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)((()=>{t&&!c&&l&&!r.current&&(r.current=window.setTimeout((()=>{r.current=void 0,d()}),t))}),[t,d,c,l]),r.current&&t&&!c?n:e}},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),d=n(14242),c=n(59852),l=n(19129),u=n(39351),m=n(17712),h=n(59030),p=n(68292),g=n(18276),f=n(64493),v=n(26607),A=n(20021);const y=(0,i.ph)((({topic:e,topics:t,chat:n,isPinned:y,isMuted:C,shouldShowOnlyMostImportant:w,wasTopicOpened:b,forceHidden:I,isSavedDialog:S,hasMiniApp:M,isSelected:N})=>{const{requestMainWebView:k}=(0,o.ko)(),Y=(0,h.A)(),P=(0,u.A)(),{unreadMentionsCount:F=0,unreadReactionsCount:T=0}=n.isForum?{}:n,D=!y&&e&&!b,x=n.isForum&&!e,E=(0,i.Kr)((()=>x&&t?Object.values(t).filter((({unreadCount:e})=>e)):void 0),[t,x]),L=(0,i.Kr)((()=>x?E?.length:(e||n).unreadCount),[n,e,E,x]),B=(0,i.Kr)((()=>{if(!x)return!C||0===e?.notifySettings.mutedUntil;if(C)return E?.some((e=>0===e.notifySettings.mutedUntil));const t=E?.every((e=>e.notifySettings.mutedUntil&&e.notifySettings.mutedUntil>(0,a.Fm)()));return!t}),[x,C,E,e?.notifySettings.mutedUntil]),R=!e&&n.hasUnreadMark,O=!(0,l.A)((()=>(0,r.Hp)(I)?I():I),[I])&&Boolean(L||F||R||y||T||D||M),U=Boolean((L||R)&&!S),K=(0,s.A)("ChatBadge",!B&&"muted",!U&&y&&"pinned",U&&"unread"),z=(0,m.A)((e=>{e.stopPropagation();const t=(0,c.A)();k({botId:n.id,peerId:n.id,theme:t})}));return(0,A.Y)(v.A,{isCustom:!0,className:"ChatBadge-transition",isOpen:O,children:function(){const e=T&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge reaction",!B&&"muted"),children:(0,A.Y)(g.A,{name:"heart"})}),t=F&&(0,A.Y)("div",{className:"ChatBadge mention",children:(0,A.Y)(g.A,{name:"mention"})}),n=D&&(0,A.Y)("div",{className:(0,s.A)("ChatBadge unopened",!B&&"muted")}),i=R||L?(0,A.Y)("div",{className:K,children:!R&&(0,A.Y)(p.A,{text:(0,d.Vw)(P,L)})}):void 0,o=y&&(0,A.Y)("div",{className:K,children:(0,A.Y)(g.A,{name:"pinned-chat"})}),a=M&&(0,A.Y)(f.A,{color:N?"secondary":"primary",className:"ChatBadge miniapp",pill:!0,size:"tiny",onClick:z,children:Y("BotOpen")}),r=!i&&!t&&!e&&o,c=[n,e,t,i,r].filter(Boolean);return S?o:M&&(0===c.length||r)?a:0!==c.length?1===c.length?c[0]:w?[t,i,e,o].filter(Boolean)[0]:(0,A.Y)("div",{className:"ChatBadge-wrapper",children:c}):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:()=>Y});var i=n(84051),o=n(13439),s=n(90709),a=n(87357),r=n(17663),d=n(58554),c=n(76023),l=n(35127),u=n(84313),m=n(43874),h=n(37661),p=n(5912),g=n(17712),f=n(62587),v=n(37960),A=n(69419),y=n(73767),C=n(21511),w=n(61097),b=n(18276),I=n(27860),S=n(14413),M=n(65843),N=n(35913),k=n(20021);const Y=(0,i.ph)((0,o.EK)((e=>{const t=e.appConfig,n=t?.needAgeVideoVerification;return{needsAgeVerification:n}}))((({id:e,video:t,isOwn:n,isInWebPage:Y,noAvatars:P,canAutoLoad:F,canAutoPlay:T,uploadProgress:D,forcedWidth:x,dimensions:E,asForwarded:L,isDownloading:B,isProtected:R,className:O,lastPlaybackTimestamp:U,clickArg:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:J,onCancelUpload:$,needsAgeVerification:q})=>{const{cancelMediaDownload:H,updateContentSettings:G,openAgeVerificationModal:W}=(0,o.ko)(),_=(0,i.li)(),Q=(0,i.li)(),[Z,X,ee]=(0,h.A)(),[te,ne]=(0,i.J0)(!1),ie="extendedMediaPreview"===t.mediaType,oe=ie?void 0:t.blobUrl,se=ie||t.isSpoiler||z,[ae,re,de]=(0,h.A)(se);(0,i.vJ)((()=>{se?re():de()}),[se]);const ce=(0,g.A)((()=>{ee(),de(),te&&G({isSensitiveEnabled:!0})})),le=(0,p.Vz)(_,V),ue=(0,p.Vz)(_,j)&&le,me=(0,i.li)(le);ue&&!me.current&&(me.current=!0);const{isMobile:he}=(0,m.Ay)(),[pe,ge]=(0,i.J0)(F),fe=Boolean(pe&&le&&!ie),[ve,Ae]=(0,i.J0)(Boolean(T&&!ae)),ye=ie?void 0:(0,s.sC)(t,"inline"),[Ce]=(0,i.J0)(Boolean(ye&&d.Ih(ye))),{mediaData:we,loadProgress:be}=(0,A.A)(ye,!fe,ie?void 0:(0,s.Cz)(t,"inline")),Ie=oe||we,[Se,Me]=(0,h.A)(),Ne=(0,s.VD)(t),ke=Boolean(Ne),Ye=Boolean(x),Pe=Ie&&me.current,Fe=(0,u.A)(Q,!0,!Pe),Te=ie?void 0:(0,s.sC)(t,"preview"),[De]=(0,i.J0)(Boolean(Te&&d.Ih(Te))),xe=le,Ee=(0,f.A)(Te,!xe),Le=Se&&!Fe,{ref:Be}=(0,v.A)({hasMediaData:Boolean((ke||Ee)&&!Le)}),Re=Boolean(!ke||Ee||Se),Oe=(0,w.A)(t,Re);(0,v.A)({ref:Oe,hasMediaData:!Re});const Ue=(0,w.A)(t,!Ye),{loadProgress:Ke}=(0,A.A)(ie?void 0:(0,s.sC)(t,"download"),!B,ie?void 0:(0,s.Cz)(t,"download")),{isUploading:ze,isTransferring:Ve,transferProgress:je}=(0,s.LK)(D||(B?Ke:be),fe&&!Se&&!Ce||B,void 0!==D),Je=!1===(0,y.A)(pe),{ref:$e,shouldRender:qe}=(0,C.A)({isOpen:Ve&&!Fe,noMountTransition:Je,withShouldRender:!0}),{ref:He}=(0,C.A)({isOpen:Boolean((pe||Ie)&&!ve&&!qe)}),[Ge,We]=(0,i.J0)(0),_e=(0,g.A)((e=>{We(Math.max(0,e.currentTarget.currentTime-1))})),Qe=(Number.isFinite(Q.current?.duration)&&!Fe?Q.current?.duration:t.duration)||0,{width:Ze,height:Xe}=E||(ie?(0,c.ri)(t,Boolean(n),L,Y,P,he):(0,c.rO)(t,Boolean(n),L,Y,P,he)),et=(0,g.A)(((e,n)=>{if(ze)$?.(K);else if(ie||!B){if(Ie)return Ie&&!ve&&Ae(!0),ae?z?q?void W():void X():void de():n&&fe&&!Se&&!Ce?(ge(!1),void e.stopPropagation()):void J?.(K,e);ge((e=>!e))}else H({media:t})})),tt=(0,g.A)((e=>{et(e,!0)})),nt=(0,a.A)("media-inner dark",!ze&&"interactive",Xe<l.ej&&"fix-min-height",O),it=`height: ${Xe}px;${E?` width: ${Ze}px; left: ${E.x}px; top: ${E.y}px;`:""}`;return(0,k.FD)("div",{ref:_,id:e,className:nt,style:it,onClick:ze?void 0:e=>et(e),children:[Ye&&(0,k.Y)("canvas",{ref:Ue,className:"thumbnail blurred-bg"}),Pe&&(0,k.Y)(M.A,{ref:Q,src:Ie,className:(0,a.A)("full-media",Ye&&"with-blurred-bg"),canPlay:ve&&ue&&!Fe,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!R,onTimeUpdate:_e,onReady:Me,style:x?`width: ${x}px`:void 0}),(0,k.Y)("img",{ref:Be,src:Ee,className:(0,a.A)("thumbnail",Ye&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px;`:void 0,draggable:!R}),ke&&!De&&(0,k.Y)("canvas",{ref:Oe,className:"thumbnail"}),R&&(0,k.Y)("span",{className:"protector"}),(0,k.Y)(b.A,{ref:He,name:"large-play"}),(0,k.Y)(I.A,{isVisible:ae,withAnimation:!0,thumbDataUri:Ne,isNsfw:z,width:Ze,height:Xe,className:"media-spoiler"}),qe&&(0,k.Y)("div",{ref:$e,className:"media-loading",children:(0,k.Y)(N.A,{progress:je,onClick:tt})}),!pe&&!Ie&&(0,k.Y)(b.A,{name:"download"}),!Ve||Fe&&!B?(0,k.FD)("div",{className:"message-media-duration",children:[!ie&&t.isGif?"GIF":(0,r.QO)(Math.max(Qe-Ge,0)),Fe&&(0,k.Y)(b.A,{name:"message-failed",className:"playback-failed"})]}):(0,k.Y)("span",{className:"message-transfer-progress",children:ze||B?`${Math.round(100*je)}%`:"..."}),Boolean(U)&&(0,k.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(U/Qe*100)}%`}),(0,k.Y)(S.A,{isOpen:Z,onClose:ee,shouldAlwaysShow:te,onAlwaysShowChanged:ne,confirmHandler: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(60919),d=n(52491),c=n(36353),l=n(87894),u=n(79824),m=n(37830),h=n(4961),p=n(58734),g=n(17778),f=n(63988),v=n(83414),A=n(37661),y=n(17712);let C,w,b,I,S;const M=36,N=2,k=300,Y=(0,m.A)((function(e,t,n){return e&&t.length?Object.values((0,l._E)(e,t)).slice(0,n):u.p})),P=(0,m.A)((function(e,t,n){const i=Object.values(e),o=(0,l.dU)(i,"native"),s=t?(0,l.LG)(t,(e=>Object.values((0,l._E)(o,e)))):{},a=n?(0,l.LG)(n,(e=>Object.values((0,l._E)(o,e)))):{},r={...s,...a},d=[].concat(Object.keys(s),Object.keys(a)),c=i.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),u=Object.keys(c),m=d.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:r,keywords:d,byName:c,names:u,maxKeyLength:m}})),F=(0,m.A)((function(e,t,n){const{byKeyword:i,keywords:o,byName:s,names:a,maxKeyLength:r}=e;let d=[];if(t.length>r)return u.p;const c=o.filter((e=>e.startsWith(t))).sort();d=d.concat(Object.values((0,l._E)(i,c)).flat());const m=a.filter((e=>e.startsWith(t)));return d=d.concat(Object.values((0,l._E)(s,m)).flat()),d=(0,l.Am)(d),d.length?d.slice(0,n):u.p}));try{I=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){I=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function T(e,t,m,T=s.CfG,D,x,E){const[L,B,R]=(0,A.A)(!1),[O,U]=(0,i.J0)(),[K,z]=(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,d.cp)(w)),C}().then(t))}),[e]);const J=(0,f.gs)((()=>{const n=t();return e&&n.includes(":")?(0,g.S)(n).match(I)?.[0].trim():void 0}),[t,e],k),$=(0,v.A)(J,[J,t],!0),q=(0,y.A)((e=>{if(z(e),e===u.p)return void j(u.p);const t=e.map((e=>e.native)),n=(0,l.Xd)((0,r.oZ0)((0,o.mS)(),t),"id");j(n)})),H=(0,y.A)(((e,n=!1)=>{const i=t();if(!i)return;const o=i.lastIndexOf(":",n?i.lastIndexOf(":")-1:void 0);if(-1!==o){const t="string"==typeof e?(0,h.A)(e,["emoji_html"])[0]:(0,p.hB)(e);m(`${i.substring(0,o)}${t}`);const n=T===s.CfG?document.querySelector(s.m$5):document.getElementById(T);(0,a.Uz)((()=>{(0,c.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=Y(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(K.length||V.length)&&!L,closeEmojiTooltip:B,filteredEmojis:K,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),d=n(17712),c=n(18276),l=n(64493),u=n(66469),m=n(57474),h=n(80089),p=n(80464),g=n(20021);const f=e=>{const{isOpen:t}=e,n=(0,p.A)(h.ar.Extra,"SymbolMenu",!t);return n?(0,g.Y)(n,{...e}):void 0},v=(0,i.ph)((({chatId:e,threadId:t,isMobile:n,canSendGifs:h,canSendStickers:p,isMessageComposer:v,isReady:A,isSymbolMenuOpen:y,idPrefix:C,isAttachmentModal:w,canSendPlainText:b,isSymbolMenuForced:I,className:S,forceDarkTheme:M,inputCssSelector:N=s.m$5,openSymbolMenu:k,closeSymbolMenu:Y,onCustomEmojiSelect:P,onStickerSelect:F,onGifSelect:T,onRemoveSymbol:D,onEmojiSelect:x,closeBotCommandMenu:E,closeSendAsMenu:L})=>{const{setStickerSearchQuery:B,setGifSearchQuery:R,addRecentEmoji:O,addRecentCustomEmoji:U}=(0,o.ko)(),K=(0,i.li)(),[z,V]=(0,r.A)(),[j,J]=(0,i.J0)(void 0),$=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",z?y&&"menu-opened":y&&"is-loading"),q=(0,d.A)((()=>{E?.(),L?.(),k();const e=K.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})})),H=(0,d.A)((e=>{"stickers"===e?(B({query:""}),R({query:void 0})):(R({query:""}),B({query:void 0}))})),G=(0,d.A)((()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout((()=>{E?.(),k()}),100)):k()})),W=(0,d.A)((()=>K.current)),_=(0,d.A)((()=>K.current?.closest(".custom-scroll, .no-scrollbar"))),Q=(0,d.A)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),Z=(0,d.A)((()=>({withPortal:!0})));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(l.A,{className:$,round:!0,color:"translucent",onClick:y?Y:G,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(c.A,{name:"smile"}),(0,g.Y)(c.A,{name:"keyboard"}),y&&!z&&(0,g.Y)(m.A,{color:"gray"})]}):(0,g.FD)(u.A,{className:(0,a.A)("composer-action-button symbol-menu-button",y&&"activated"),round:!0,color:"translucent",onActivate:q,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:K,className:"symbol-menu-trigger"}),(0,g.Y)(c.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(I),canSendGifs:h,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:V,onClose:Y,onEmojiSelect:x,onStickerSelect:F,onCustomEmojiSelect:P,onGifSelect:T,onRemoveSymbol:D,onSearchOpen:H,addRecentEmoji:O,addRecentCustomEmoji:U,isAttachmentModal:w,canSendPlainText:b,className:(0,a.A)(S,M&&"component-theme-dark"),anchor:w?j:void 0,getTriggerElement:w?W:void 0,getRootElement:w?_:void 0,getMenuElement:w?Q:void 0,getLayout:w?Z:void 0})]})}))},31791:(e,t,n)=>{n.d(t,{v:()=>i});let i=function(e){return e.FULLSCREEN_CHANGE="fullscreen-change",e.UPDATE_ERROR="update-error",e.UPDATE_AVAILABLE="update-available",e.DEEPLINK="deeplink",e}({})},31880:(e,t,n)=>{n.d(t,{A:()=>h,a:()=>c});var i=n(13439),o=n(60919),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],d=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a=[],c=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],c=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,d);a=t||[],c=Object.keys(i).filter((e=>Boolean(i[e])))}const l=(0,i.mS)();return{selectedChatIds:a.filter((e=>(0,o.hds)(l,e))),selectedChatTypes:c}}function l(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||t?.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:{text:""},includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:{text:t.payload}},isTouched:!0};case"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,s.Up)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,s.Up)(e.folder,d)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,s.cJ)(e.folder,r),title:e.folder.title?e.folder.title:{text:l(e.includeFilters)},...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,s.cJ)(e.folder,d),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"reset":return u;default:return e}},h=()=>(0,a.A)(m,u)},32754:(e,t,n)=>{n.d(t,{A:()=>B});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(27109),c=n(60919),l=n(96454),u=n(87357),m=n(9716),h=n(66414),p=n(98255),g=n(43874),f=n(47067),v=n(49746),A=n(37661),y=n(5912),C=n(17712),w=n(50680),b=n(53188),I=n(21849),S=n(54314),M=n(34431),N=n(18276),k=n(9267),Y=n(81642),P=n(22720),F=n(97967),T=n(97046),D=n(24807);const x="AA5s1Pu4";var E=n(20021);const L=(0,i.ph)((({isSelected:e,isActive:t,isMobile:n})=>(0,E.Y)("div",{className:(0,u.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,E.FD)("div",{className:"nl36F75B",children:[(0,E.Y)("div",{className:x}),(0,E.Y)("div",{className:x}),(0,E.Y)("div",{className:x})]})}))),B=(0,i.ph)((0,o.EK)(((e,{chatId:t,isSavedDialog:n,isPreview:i,previewMessageId:o})=>{const a=(0,c.hds)(e,t),r=(0,c.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const l=o||(0,c.ZZX)(e,t,n?"saved":"all"),u=o?(0,c.O5q)(e,t,o):(0,c.yHC)(e,t,n?"saved":"all"),{isOutgoing:m,forwardInfo:h}=u||{},p=n&&h?.fromId?(0,c.PVB)(e,h.fromId):void 0,g=u?(0,c.Y7C)(e,u):void 0,f=p||g,{chatId:v,threadId:A,type:y}=(0,c.Xf0)(e)||{},C=!i&&t===v&&(n?t===A:A===s.l3),w=a.isForum&&t===v||t===(0,c.nTw)(e).forumPanelChatId,b=(0,c.K0y)(e,t),I=u&&(0,c.nkm)(e,u),S=(0,c.C5H)(e,t,s.l3,"typingStatus"),M=(0,c.xyP)(e,t),N=u?.content.storyData,k=N&&(0,c.Msb)(e,N.peerId,N.id),Y=(0,c.trm)(e),P=(0,c.k2W)(e,t);return{chat:a,isMuted:(0,d.If)(a,(0,c.K52)(e),(0,c.P5N)(e,a.id)),lastMessageSender:f,draft:(0,c.GA4)(e,t,s.l3),isSelected:C,isSelectedForum:w,isForumPanelOpen:(0,c.clw)(e),canScrollDown:C&&"thread"===y,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...m&&u&&{lastMessageOutgoingStatus:(0,c.Tl2)(e,u)},user:r,userStatus:b,lastMessageTopic:I,typingStatus:S,withInterfaceAnimations:(0,c.PKK)(e),lastMessage:u,lastMessageId:l,currentUserId:e.currentUserId,listedTopicIds:M?.listedTopicIds,topics:M?.topicsById,isSynced:e.isSynced,lastMessageStory:k,isAccountFrozen:Y,monoforumChannel:P}}))((({chatId:e,folderId:t,orderDiff:n,animationType:d,isPinned:x,listedTopicIds:B,topics:R,observeIntersection:O,chat:U,monoforumChannel:K,lastMessageStory:z,isMuted:V,user:j,userStatus:J,lastMessageSender:$,lastMessageOutgoingStatus:q,offsetTop:H,draft:G,withInterfaceAnimations:W,isSelected:_,isSelectedForum:Q,isForumPanelOpen:Z,canScrollDown:X,canChangeFolder:ee,lastMessageTopic:te,typingStatus:ne,lastMessageId:ie,lastMessage:oe,isSavedDialog:se,currentUserId:ae,isPreview:re,previewMessageId:de,className:ce,isSynced:le,onDragEnter:ue,isAccountFrozen:me})=>{const{openChat:he,openSavedDialog:pe,toggleChatInfo:ge,focusLastMessage:fe,focusMessage:ve,loadTopics:Ae,openForumPanel:ye,closeForumPanel:Ce,setShouldCloseRightColumn:we,reportMessages:be,openFrozenAccountModal:Ie}=(0,o.ko)(),{isMobile:Se}=(0,g.Ay)(),[Me,Ne,ke]=(0,A.A)(),[Ye,Pe,Fe]=(0,A.A)(),[Te,De,xe]=(0,A.A)(),[Ee,Le,Be]=(0,A.A)(),[Re,Oe,Ue]=(0,A.A)(),[Ke,ze,Ve]=(0,A.A)(),{isForum:je,isForumAsMessages:Je,isMonoforum:$e}=U||{};(0,v.A)(se?ae:e,ie,oe);const{renderSubtitle:qe,ref:He}=(0,b.A)({chat:U,chatId:e,lastMessage:oe,typingStatus:ne,draft:G,statefulMediaContent:(0,r.FE)({story:z}),lastMessageTopic:te,lastMessageSender:$,observeIntersection:O,animationType:d,withInterfaceAnimations:W,orderDiff:n,isSavedDialog:se,isPreview:re,topics:R}),Ge=(0,p.A)(c.sRo),We=(0,C.A)((()=>{const t=Se&&Je;if(Se&&we({value:!0}),re)ve({chatId:e,messageId:de});else{if(se)return pe({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Se&&ge({force:!1}));if(je){if(Z)return void Ce(void 0,{forceOnHeavyAnimation:!0});if(t||ye({chatId:e},{forceOnHeavyAnimation:!0}),!Je)return}he({id:e,noForumTopicPanel:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),_&&X&&fe()}})),_e=(0,C.A)((t=>{t.preventDefault(),ue?.(e)})),Qe=(0,C.A)((()=>{me?Ie():(Le(),Ne())})),Ze=(0,C.A)((()=>{me?Ie():(Oe(),Pe())})),Xe=(0,C.A)((()=>{ze(),De()})),et=(0,C.A)((()=>{me?Ie():U&&be({chatId:U.id,messageIds:[]})})),tt=(0,f.A)({chat:U,user:j,handleDelete:Qe,handleMute:Ze,handleChatFolderChange:Xe,handleReport:et,folderId:t,isPinned:x,isMuted:V,canChangeFolder:ee,isSavedDialog:se,currentUserId:ae,isPreview:re,topics:R}),nt=(0,y.Vz)(He,U?O:void 0);(0,i.vJ)((()=>{nt&&je&&le&&void 0===B&&Ae({chatId:e})}),[e,B,le,je,nt]);const it=j&&J&&(0,r.PF)(j,J),{hasShownClass:ot}=(0,w.A)(it),st=(0,i.Kr)((()=>{if(l.OS)return se?`#${(0,h.az)(ae,"thread",e)}`:`#${(0,h.az)(e,"thread",s.l3)}`}),[e,ae,se]);if(!U)return;const at=j||U,rt=(0,u.A)("Chat chat-item-clickable",(0,m.L8)(e)?"private":"group",je&&"forum",_&&"selected",Q&&"selected-forum",re&&"standalone",ce);return(0,E.FD)(P.A,{ref:He,className:rt,href:st,style:`top: ${H}px`,ripple:!je&&!Se,contextActions:tt,onClick:We,onDragEnter:_e,withPortalForMenu:!0,children:[(0,E.FD)("div",{className:(0,u.A)("status","status-clickable"),children:[(0,E.Y)(I.A,{peer:$e?K:at,isSavedMessages:j?.isSelf,isSavedDialog:se,size:re?"medium":"large",asMessageBubble:$e,withStory:!j?.isSelf&&!$e,withStoryGap:ot||Boolean(U.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,E.FD)("div",{className:"avatar-badge-wrapper",children:[(0,E.Y)("div",{className:(0,u.A)("avatar-online","avatar-badge",ot&&"avatar-online-shown")}),!ot&&Boolean(U.subscriptionUntil)&&(0,E.Y)(k.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,E.Y)(D.A,{chat:U,isMuted:V,shouldShowOnlyMostImportant:!0,forceHidden:Ge,topics:R,isSelected:_})]}),U.isCallActive&&U.isCallNotEmpty&&(0,E.Y)(L,{isMobile:Se,isSelected:_,isActive:W})]}),(0,E.FD)("div",{className:"info",children:[(0,E.FD)("div",{className:"info-row",children:[(0,E.Y)(M.A,{peer:$e?K:at,isMonoforum:$e,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:e===j?.id&&j?.isSelf,isSavedDialog:se,observeIntersection:O}),V&&!se&&(0,E.Y)(N.A,{name:"muted"}),(0,E.Y)("div",{className:"separator"}),oe&&(0,E.Y)(Y.A,{message:oe,outgoingStatus:se?void 0:q,draftDate:G?.date})]}),(0,E.FD)("div",{className:"subtitle",children:[qe(),!re&&(0,E.Y)(D.A,{chat:U,isPinned:x,isMuted:V,isSavedDialog:se,hasMiniApp:j?.hasMainMiniApp,topics:R,isSelected:_})]})]}),Ee&&(0,E.Y)(S.A,{isOpen:Me,onClose:ke,onCloseAnimationEnd:Be,chat:U,isSavedDialog:se}),Re&&(0,E.Y)(T.A,{isOpen:Ye,onClose:Fe,onCloseAnimationEnd:Ue,chatId:e}),Ke&&(0,E.Y)(F.A,{isOpen:Te,onClose:xe,onCloseAnimationEnd:Ve,chatId:e})]})})))},34458:(e,t,n)=>{n.d(t,{$:()=>v,UG:()=>l,wV:()=>f});var i=n(31481),o=n(66644),s=n(19822),a=n(83868),r=n(76023),d=n(2429),c=n(17169);const l=250,u=.25*r.$,m=11,h=.1875*r.$,p=.125*r.$,g=new Set;function f(e){I();const{container:t,toggler:n,leftMainHeader:a,ribbonPeers:r,toggleAvatars:d}=A(e);if(!(n&&d&&r&&t&&a))return;const{bottom:p,right:f}=a.getBoundingClientRect(),v=p+u,S=d[0],M=d[d.length-1],N=C(S);Array.from(r).reverse().forEach(((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===N;let p=w(n,d),A=m+a+1;if(p||(p=a===r-1?M:S,A=m),!p)return;let{top:I,left:k,width:Y}=p.getBoundingClientRect();const{left:P,width:F}=e.getBoundingClientRect();if(P>f)return;k-=h,Y+=2*h;const T=k-P,D=I-v,x=Y/F;I-=h;const E=P-k+2*h,L=v-I+h,B=F/(Y+2*h);(0,o.RK)((()=>{if(!p)return;const n=y(e);let a;A>m?(a=y(p),u&&a.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName),(0,s.ZM)(n,{top:`${v}px`,left:`${P}px`,zIndex:String(A),opacity:a?"0":"",transform:`translate3d(${T}px, ${D}px, 0) scale(${x})`}),a&&(0,s.ZM)(a,{top:`${I}px`,left:`${k}px`,zIndex:String(A)}),t.appendChild(n),a&&t.appendChild(a),p.classList.add("animating"),e.classList.add("animating"),(0,o.RK)((()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${E}px, ${L}px, 0) scale(${B})`}):n.classList.add(c.A.ghostRevealName);const r=b((()=>{(0,o.RK)((()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),p?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)}))}),l+i.xB5);g.add(r)}))}))}))}function v(e){I();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:d}=A(e);if(!(n&&a&&r&&t&&d))return;const{right:u}=d.getBoundingClientRect(),f=a[0],v=a[a.length-1],S=C(f);Array.from(r).reverse().forEach(((e,a,{length:r})=>{const d=C(e);if(!d)return;const A=d===S;let I=w(n,d),M=m+a+1;if(I||(I=a===r-1?v:f,M=m),!I)return;const{top:N,left:k,width:Y}=e.getBoundingClientRect();let{left:P,width:F,top:T}=I.getBoundingClientRect();if(k>u)return;P-=h,F+=2*h;const D=P-k,x=T-N-p,E=F/Y;T-=h;const L=k-P+2*h,B=N-T+h,R=Y/(F+2*h);(0,o.RK)((()=>{const n=y(e);let a;M>m?(a=y(I),A&&a.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName,c.A.ghostRevealName),(0,s.ZM)(n,{top:`${N}px`,left:`${k}px`,width:`${Y}px`,zIndex:String(M)}),a&&(0,s.ZM)(a,{top:`${T}px`,left:`${P}px`,zIndex:String(M),opacity:"0",transform:`translate3d(${L}px, ${B}px, 0) scale(${R})`}),e.classList.add("animating"),I.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,o.RK)((()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${D}px, ${x}px, 0) scale(${E})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(c.A.ghostRevealName);const r=b((()=>{(0,o.RK)((()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),I.classList.remove("animating")})),g.delete(r)}),l+i.xB5);g.add(r)}))}))}))}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),i=t.querySelector("#StoryRibbon"),o=t.querySelector(".left-header"),s=i?.querySelectorAll(`.${d.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(c.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=a.A;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function C(e){return e?.getAttribute("data-peer-id")}function w(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function 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:()=>d,nP:()=>c,yA:()=>l});var i=n(76023);const o=12,s=40,a=20*i.$,r=o*i.$,d=5*i.$;function c(e,t){return(e?.length??0)>s||t?a:r}function l({media:e,messageText:t,isOwn:n,isInWebPage:s,asForwarded:a,noAvatars:r,isMobile:l}){const u="photo"===e.mediaType,m="video"===e.mediaType,h=u&&s,p=m&&s,{width:g,height:f}=u?(0,i.ck)(e,n,a,h,r,l):m?(0,i.rO)(e,n,a,p,r,l):(0,i.ri)(e,n,a,s,r,l),v=c(t);let A=1;g<v&&v-g<o&&(A=v/g),f*A<d&&d-f*A<o&&(A=d/f);const y=Math.round(g*A),C=Math.round(f*A);return{width:y,height:C,isSmall:y<v||C<d}}},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:()=>d});var i=n(84051),o=n(96454),s=n(17712);const a=250;let r;function d(e,t,n=a,d=!1){const c=(0,i.li)(!1),l=(0,s.A)((()=>{c.current=!0}));return(0,i.vJ)((()=>{r&&(clearTimeout(r),r=void 0),!e||o.TF||d||(r=window.setTimeout((()=>{c.current||t()}),2*n))}),[d,e,n,t]),[(0,s.A)((()=>{c.current=!0})),(0,s.A)((()=>{c.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout((()=>{c.current||t()}),n)})),l]}},37378:(e,t,n)=>{n.d(t,{A:()=>A});var i=n(84051),o=n(13439),s=n(90709),a=n(60919),r=n(87357),d=n(17663),c=n(58849),l=n(49086),u=n(4961),m=n(17712),h=n(59030),p=n(96530),g=n(81524),f=n(84685),v=n(20021);const A=(0,i.ph)((0,o.EK)(((e,{message:t})=>({webPage:(0,a.Pn$)(e,t)})))((({message:e,webPage:t,senderTitle:n,isProtected:i,observeIntersection:o,onMessageClick:a})=>{const A=(0,h.A)();let y=t;if(!y){const t=(0,s.ZD)(e);if(t){const{url:n,domain:i}=t;y={siteName:i.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.P5)(e)?.text!==n?(0,l.C)(A,e,void 0,void 0,170):void 0}}}const C=(0,m.A)((()=>{a(e)}));if("full"!==y?.webpageType)return;const{siteName:w,url:b,displayUrl:I,title:S,description:M,formattedDescription:N,photo:k,video:Y}=y,P=!n&&M&&(0,c.A)(M,170),F=(0,r.A)("WebLink scroll-item",!k&&!Y&&"without-media"),T=b.replace("mailto:","")||I;return(0,v.FD)("div",{className:F,"data-initial":(w||I)[0],dir:A.isRtl?"rtl":void 0,children:[k&&(0,v.Y)(g.A,{message:e,isProtected:i,observeIntersection:o}),(0,v.FD)("div",{className:"content",children:[(0,v.Y)(p.A,{isRtl:A.isRtl,className:"site-title",onClick:C,children:(0,u.A)(S||w||I)}),(P||N)&&(0,v.Y)(p.A,{isRtl:A.isRtl,className:"site-description",onClick:C,children:N||P&&(0,u.A)(P)}),(0,v.Y)(f.A,{url:b,className:"site-name",text:T,isRtl:A.isRtl}),n&&(0,v.Y)("div",{className:"sender-name",children:(0,u.A)(n)})]}),n&&(0,v.Y)("div",{className:"message-date",children:(0,v.Y)(p.A,{className:"date",onClick:C,isRtl:A.isRtl,children:(0,d.be)(A,1e3*e.date)})})]})})))},37830:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(87894);const o=new WeakMap;function s(e){return(...t)=>{const n=o.get(e);if(n&&(0,i.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return o.set(e,{lastArgs:t,lastResult:s}),s}}},38102:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(87412),s=n(76471),a=n(20021);const r=(0,i.ph)((({topic:e,className:t,letterClassName:n,size:i,noLoopLimit:r,observeIntersection:d,onClick:c})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(o.A,{documentId:e.iconEmojiId,className:t,size:i,observeIntersectionForPlaying:d,loopLimit:r?void 0:2,onClick:c}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:c})))},38218:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(31481),s=n(17712);const a=function({onClick:e,onStart:t,onEnd:n,threshold:a=250}){const r=(0,i.li)(!1),d=(0,i.li)(!1),c=(0,i.li)(void 0),l=(0,s.A)((e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!d.current&&n&&(d.current=!0,c.current=window.setTimeout((()=>{t?.(),r.current=!0}),a))})),u=(0,s.A)((t=>{d.current&&(r.current?n?.():e?.(t),m())})),m=(0,s.A)((()=>{r.current=!1,d.current=!1,window.clearTimeout(c.current)}));return(0,i._W)((()=>{window.clearTimeout(c.current)})),(0,i.vJ)((()=>(document.body.addEventListener(o.D2Y,m),()=>{document.body.removeEventListener(o.D2Y,m)})),[]),{onMouseDown:l,onMouseUp:u,onMouseLeave:u,onTouchStart:l,onTouchEnd:u}}},39074:(e,t,n)=>{n.d(t,{DY:()=>d,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 d(){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(60919),r=n(34458),d=n(59030),c=n(21511),l=n(92111),u=n(21849),m=n(17169),h=n(20021);const p=(0,i.ph)((0,o.EK)(((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:i},byPeerId:o}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),d=(0,a.clw)(e),c=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:i,isShown:t?!r:!s,isForumPanelOpen:d,withAnimation:c,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:o}}))((function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:a,canShow:p,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:A,peerStories:y}){const{toggleStoryRibbon:C}=(0,o.ko)(),w=(0,d.A)(),b=(0,i.Kr)((()=>1===t.length?[n[t[0]]||a[t[0]]]:t.map((e=>n[e]||a[e])).filter((t=>t&&t.id!==e)).slice(0,s.dqH).reverse()),[e,t,n,a]),I=(0,i.Kr)((()=>b?.length?b.reduce(((e,t)=>{const n=y[t.id];if(!n)return e;const i=n.orderedIds.some((e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const i=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!i}));return e[t.id]=i,e}),{}):{}),[y,b]),S=(0,i.Kr)((()=>t.slice(0,5)),[t]);(0,l.A)(S);const M=p&&g,{ref:N,shouldRender:k}=(0,c.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,i.vJ)((()=>{A&&!f&&(M?((0,i.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,i.VK)(r.UG+s.xB5),(0,r.wV)(v)))}),[v,M,A,f]),k)return(0,h.Y)("button",{ref:N,type:"button",id:"StoryToggler",className:m.A.root,"aria-label":w("Chat.Context.Peer.OpenStory"),onClick:()=>C({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0,children:b.map((e=>(0,h.Y)(u.A,{peer:e,size:"tiny",className:m.A.avatar,withStorySolid:!0,forceFriendStorySolid:I[e.id]},e.id)))})})))},40435:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(41074);const o={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(o[a||"light"][t?"outgoing":"incoming"]):(0,i.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%i.bP)}},41074:(e,t,n)=>{n.d(t,{Ay:()=>r,M1:()=>d,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 d(e,t){return r()[t].connector.request(e)}},41118:(e,t,n)=>{n.d(t,{A:()=>G});var i=n(84051),o=n(13439),s=n(89925),a=n(31481),r=n(96454),d=n(87357),c=n(49763),l=n(80140),u=n(23459),m=n(66644),h=n(9718),p=n(16581),g=n(17712),f=n(20021),v=n(74984),A=n(2178),y=n(96374),C=n(5912),w=n(9717),b=n(46222),I=n(52745),S=n(90709),M=n(87894),N=n(14242),k=n(4961),Y=n(39351),P=n(21849),F=n(18276),T=n(24713),D=n(22720);const x={root:"sG8AAzvK",minimized:"lTOui0dp",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"},E={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},L=(0,i.ph)((({archiveSettings:e,onDragEnter:t,onClick:n})=>{const{updateArchiveSettings:s}=(0,o.ko)(),r=(0,Y.A)(),c=(0,v.Rh)(a._E9),l=(0,v.ic)(),u=l[a._E9]?.chatsCount,m=(0,i.Kr)((()=>{if(!c?.length)return r("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,S.Js)(r,s);return(0,f.FD)(f.FK,{children:[(0,f.Y)("span",{className:(0,d.A)(x.chat,u&&s.unreadCount&&x.unread),children:(0,k.A)(a)}),o?"":", "]})}))}),[c,r,u]),h=(0,i.Kr)((()=>{const t=!e.isMinimized&&{title:r("ContextArchiveCollapse"),icon:"collapse",handler:()=>{s({isMinimized:!0})}},n=e.isMinimized&&{title:r("ContextArchiveExpand"),icon:"expand",handler:()=>{s({isMinimized:!1})}},i={title:r("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{s({isHidden:!0})}};return(0,M.oE)([t,n,i])}),[e.isMinimized,r,s]),p=(0,i.hb)((e=>{e.preventDefault(),t?.()}),[t]);return(0,f.Y)(D.A,{onClick:n,onDragEnter:p,className:(0,d.A)(x.root,e.isMinimized&&x.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:x.button,contextActions:h,withPortalForMenu:!0,children:e.isMinimized?(0,f.Y)("div",{className:(0,d.A)(x.info,"info"),children:(0,f.FD)("div",{className:"info-row",children:[(0,f.Y)("div",{className:(0,d.A)("title",x.title),children:(0,f.FD)("h3",{dir:"auto",className:(0,d.A)(x.name,"fullName"),children:[(0,f.Y)(F.A,{name:"archive-filled",className:x.icon}),r("ArchivedChats")]})}),(0,f.Y)(T.A,{className:x.unreadCount,text:u?(0,N.Vw)(r,u):void 0})]})}):(0,f.FD)(f.FK,{children:[(0,f.Y)("div",{className:(0,d.A)("status",x.avatarWrapper),children:(0,f.Y)(P.A,{peer:E})}),(0,f.FD)("div",{className:(0,d.A)(x.info,"info"),children:[(0,f.Y)("div",{className:"info-row",children:(0,f.Y)("div",{className:(0,d.A)("title",x.title),children:(0,f.Y)("h3",{dir:"auto",className:(0,d.A)(x.name,"fullName"),children:r("ArchivedChats")})})}),(0,f.FD)("div",{className:"subtitle",children:[(0,f.Y)("div",{className:(0,d.A)("status",x.chatsPreview),children:m}),(0,f.Y)(T.A,{className:x.unreadCount,text:u?(0,N.Vw)(r,u):void 0})]})]})]})})}));var B=n(32754),R=n(60919),O=n(43874),U=n(59030),K=n(79577),z=n(64493);const V=(0,i.ph)((0,o.EK)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,R.$aQ)(e,t):void 0,animatedEmoji:(0,R.oei)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,o.ko)(),r=(0,U.A)(),{isMobile:d}=(0,O.Ay)(),c=(0,i.hb)((()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})}),[e,n]);return(0,f.FD)("div",{className:"yftKUVDQ",children:[(0,f.Y)("div",{className:"UCBfMOiz",children:t&&(0,f.Y)(K.A,{sticker:t,size:96})}),(0,f.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,f.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,f.FD)(z.A,{ripple:!d,fluid:!0,pill:!0,onClick:c,size:"smaller",isRtl:r.isRtl,children:[(0,f.Y)(F.A,{name:"settings"}),(0,f.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})]})]})}))),j=(0,i.ph)((({onClick:e})=>{const t=(0,Y.A)();return(0,f.FD)("div",{className:"fOmerTkM",onClick:e,children:[(0,f.Y)("div",{className:"URLYINJA",children:t("TitleFrozenAccount")}),(0,f.Y)("div",{className:"mCFsx7Tv",children:t("SubtitleFrozenAccount")})]})}));var J=n(93545);const $="pedMJD_v",q=(0,i.ph)((({sessions:e,onHeightChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,o.ko)(),r=(0,i.li)(),d=(0,U.A)();(0,J.A)(r,(e=>{const n=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;t(n)}));const c=(0,i.Kr)((()=>Object.values(e).sort(((e,t)=>t.dateCreated-e.dateCreated)).find((e=>e.isUnconfirmed))),[e]),l=(0,i.Kr)((()=>[c.deviceModel,c.region,c.country].filter(Boolean).join(", ")),[c]),u=(0,g.A)((()=>{n({hash:c.hash,isConfirmed:!0})})),m=(0,g.A)((()=>{s({hash:c.hash}),a({title:d("UnconfirmedAuthDeniedTitle",1),message:d("UnconfirmedAuthDeniedMessageSingle",l)})}));return(0,f.FD)("div",{className:"yEkGgZVL",ref:r,children:[(0,f.Y)("h2",{className:"VhAJDrnz",children:d("UnconfirmedAuthTitle")}),(0,f.Y)("p",{className:"WmyL1NJ8",children:d("UnconfirmedAuthSingle",l)}),(0,f.FD)("div",{className:"_40UGD1Y",children:[(0,f.Y)(z.A,{fluid:!0,isText:!0,size:"smaller",className:$,onClick:u,children:d("UnconfirmedAuthConfirm")}),(0,f.Y)(z.A,{fluid:!0,isText:!0,size:"smaller",color:"danger",onClick:m,className:$,children:d("UnconfirmedAuthDeny")})]})]})})),H=new Set(["9","0"]),G=(0,i.ph)((({className:e,folderType:t,folderId:n,isActive:S,isForumPanelOpen:M,canDisplayArchive:N,archiveSettings:k,sessions:Y,isAccountFrozen:P,isMainList:F,foldersDispatch:T})=>{const{openChat:D,openNextChat:x,closeForumPanel:E,toggleStoryRibbon:R,openFrozenAccountModal:O,openLeftColumnContent:U}=(0,o.ko)(),K=(0,i.li)(),z=(0,i.li)(!1),[J,$]=(0,i.J0)(0),G="archived"===t,W="all"===t,_="saved"===t,Q=W?a.DSF:G?a._E9:_?a.pX9:n,Z=W&&N&&k,X=P&&W,ee=(0,v.Rh)(Q);(0,u.A)(ee);const te=(ee?.length||0)*a.yq1,ne=Z?k?.isMinimized?a.eqO:a.yq1:0,ie=X?68:0,{orderDiffById:oe,getAnimationType:se}=(0,w.A)(ee),[ae,re]=(0,y.A)(void 0,ee,void 0,a.T7t),de=(0,i.Kr)((()=>{const e=Object.values(Y||{}),t=e.find((e=>e.isCurrent));return!(!t||(0,l.Fm)()-t.dateCreated<a.C7Y)&&!P&&W&&e.some((e=>e.isUnconfirmed))}),[W,Y,P]);(0,i.vJ)((()=>{de||$(0)}),[de]),(0,A.v)((0,i.Kr)((()=>S&&ee?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),x({targetIndexDelta:-1,orderedIds:ee})},"Alt+ArrowDown":e=>{e.preventDefault(),x({targetIndexDelta:1,orderedIds:ee})}}:void 0),[S,ee])),(0,i.vJ)((()=>{if(S&&!_&&ee&&r.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((r.MP&&e.metaKey||!r.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||H.has(t))return;const n=Z&&k&&!k.isMinimized,i=n?-1:0,o=Number(t)+i-1;if(n&&-1===o)return void(F&&U({contentKey:s.Bn.Archived}));if(o>ee.length-1)return;D({id:ee[o],shouldReplaceHistory:!0})}}}),[k,_,S,D,x,ee,Z,F]);const{observe:ce}=(0,C.BL)({rootRef:K,throttleMs:200}),le=(0,g.A)((()=>{U({contentKey:s.Bn.Archived}),E()})),ue=(0,g.A)((()=>{O()})),me=(0,g.A)((()=>{z.current?z.current=!1:le()})),he=(0,p.A)((e=>{z.current?z.current=!1:D({id:e,shouldReplaceHistory:!0})}),[D],500,!0),pe=(0,g.A)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,i=e.clientY-t.top;n<t.width||i<t.y||(z.current=!0)})),ge=function(e,t,n,o){const s=(0,i.li)(),a=(0,i.li)(!1),d=(0,i.li)(0),c=(0,i.li)(!1),l=(0,i.li)(!0),u=(0,i.li)(0),v=(0,i.li)(!1),A=(0,g.A)(((t=!1)=>{c.current||s.current&&e.current&&(s.current.style.display="block",e.current.scrollTop=1,r.Yw||t||(0,h.E)(e.current),a.current=!0,d.current=1,c.current=!0,l.current=!0)})),y=(0,g.A)((()=>{c.current&&s.current&&(s.current.style.display="none",c.current=!1)})),C=(0,g.A)((()=>{if(!e.current)return;if(a.current)return void(a.current=!1);const i=e.current.scrollTop,o=i>d.current,r=i<d.current,h=0===i,p=Date.now()-u.current;if(s.current){if(h&&!c.current)return void(0,m.dL)(A,[e.current,s.current]);(0,m.dL)(y,s.current)}r&&(l.current&&p>100||i<0&&v.current)?t?.():o&&i>0&&n?.(),d.current=i,l.current=h,u.current=Date.now(),v.current=o&&i<0})),w=(0,p.A)((i=>{if(!e.current)return;const o=e.current;o.scrollHeight>o.offsetHeight||0===i.deltaY||(i.deltaY<0?t?.():n?.())}),[e,t,n],250);return(0,i.vJ)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,m.RK)((()=>{A(!0)})),t.addEventListener("scroll",C,{passive:!0}),t.addEventListener("wheel",w,{passive:!0}),()=>{t.removeEventListener("scroll",C),t.removeEventListener("wheel",w)}}),[e,w]),r.pz||o?void 0:(0,f.Y)("div",{ref:s,className:"overscroll-trigger"},"overscroll-trigger")}(K,(0,g.A)((()=>{R({isShown:!0,isArchived:G})})),(0,g.A)((()=>{R({isShown:!1,isArchived:G})})),_);return(0,f.FD)(b.A,{className:(0,d.A)("chat-list custom-scroll",M&&"forum-panel-open",e),ref:K,items:ae,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,beforeChildren:ge,maxHeight:te+ne+ie+J,onLoadMore:re,onDragLeave:pe,children:[de&&(0,f.Y)(q,{sessions:Y,onHeightChange:$},"unconfirmed"),X&&(0,f.Y)(j,{onClick:ue},"frozen"),Z&&(0,f.Y)(L,{archiveSettings:k,onClick:le,onDragEnter:me},"archive"),ae?.length?function(){const e=ee.indexOf(ae[0]),t=(0,c.zm)(Q)||0;return ae.map(((i,o)=>{const s=e+o<t,r=J+ne+ie+(e+o)*a.yq1;return(0,f.Y)(B.A,{teactOrderKey:s?o:(0,c.uk)(i,_),chatId:i,isPinned:s,folderId:n,isSavedDialog:_,animationType:se(i),orderDiff:oe[i],offsetTop:r,observeIntersection:ce,onDragEnter:he},i)}))}():!ae||ae.length||_?(0,f.Y)(I.A,{},"loading"):(0,f.Y)(V,{folderId:n,folderType:t,foldersDispatch:T})]})}))},41316:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(84051);function o(e){const[t,n]=(0,i.Ul)();return(0,i.vJ)((()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const i=t.getRangeAt(0);if(!i)return;if(!document.querySelector(e))return;const{commonAncestorContainer:o}=i;(o instanceof Element?o:o.parentElement).closest(e)&&n(i)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)}),[e,n]),t}},41510:(e,t,n)=>{n.d(t,{I:()=>w,A:()=>b});var i=n(84051),o=n(13439),s=n(90709),a=n(87357),r=n(11778),d=n(55153),c=n(45761),l=n(39351),u=n(17712),m=n(73767),h=n(50680),p=n(3325),g=n(15283),f=n(37661),v=n(93545),A=n(18276),y=n(20021);const C=(0,i.ph)((({isQuick:e,isGeneric:t,onFileSelect:n})=>{const o=(0,i.li)(),s=(0,i.li)(),[r,d,c]=(0,f.A)(),l=(0,u.A)((e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),c()})),m=(0,u.A)((()=>{const e=s.current;if(!e)return;const{width:t,height:n}=e.getBoundingClientRect();e.viewBox.baseVal.width=t,e.viewBox.baseVal.height=n}));(0,v.A)(o,m),(0,g.A)(m);const h=(0,a.A)("DropTarget",r&&"hovered");return(0,y.FD)("div",{className:h,ref:o,onDrop:n,onDragEnter:d,onDragLeave:l,"data-dropzone":!0,children:[(0,y.Y)("svg",{className:"target-outline-container",children:(0,y.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,y.FD)("div",{className:"target-content",children:[(0,y.Y)(A.A,{name:e?"photo":"document"}),(0,y.Y)("div",{className:"title",children:"Drop files here to send them"}),!t&&(0,y.Y)("div",{className:"description",children:e?"in a quick way":"without compression"})]})]})}));let w=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const b=(0,i.ph)((({isOpen:e,withQuick:t,editingMessage:n,onHide:g,onFileSelect:f})=>{const v=(0,l.A)(),{showNotification:A,updateAttachmentSettings:w}=(0,o.ko)(),b=(0,i.li)(),I=(0,m.A)(t),{shouldRender:S,transitionClassNames:M}=(0,h.A)(e);(0,i.vJ)((()=>e?(0,r.A)(g):void 0),[e,g]);const N=(0,u.A)((async e=>{const{dataTransfer:i}=e;let o=[];if(!(i.files&&i.files.length>0)||i.items&&i.items.length){if(i.items&&i.items.length>0){const e=await(0,c.A)(i.items);e?.length&&(o=o.concat(e))}}else o=o.concat(Array.from(i.files));if(n){if(o.length>1)return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:o.length})});if(1===o.length){const e=await(0,d.A)(o[0].name,o[0]);if(!(n&&e&&(0,s.eh)(n,e)))return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:o.length})})}}g(),w({shouldCompress:!t&&void 0}),f(o)})),k=(0,u.A)((async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(n){if(e.length>1)return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,d.A)(e[0].name,e[0]);if(!(n&&t&&(0,s.eh)(n,t)))return void A({message:v("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}g(),w({shouldCompress:!0}),f(e)}})),Y=(0,u.A)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(b.current=window.setTimeout((()=>{g()}),150))}));if(!S)return;const P=t||I,F=(0,a.A)("DropArea",M);return(0,y.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,y.FD)("div",{className:F,onDragLeave:Y,onDragOver:()=>{b.current&&window.clearTimeout(b.current)},onDrop:g,onClick:g,children:[(0,y.Y)(C,{onFileSelect:N,isGeneric:!P}),P&&(0,y.Y)(C,{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:()=>u});var i=n(84051),o=n(87357),s=n(58443),a=n(4961),r=n(59030),d=n(50680),c=n(64489),l=n(20021);const u=(0,i.ph)((({text:e="Nothing found.",description:t,withSticker:n})=>{const i=(0,r.A)(),{transitionClassNames:u}=(0,d.A)(!0);return(0,l.FD)("div",{className:(0,o.A)("NothingFound",u,t&&"with-description",n&&"with-sticker"),children:[n&&(0,l.Y)(c.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),e,t&&(0,l.Y)("p",{className:"description",children:(0,a.A)(i(t),["br"])})]})}))},44589:(e,t,n)=>{n.d(t,{A:()=>A});var i=n(84051),o=n(13439),s=n(31481),a=n(90709),r=n(91525),d=n(37661),c=n(5912),l=n(17712),u=n(62587),m=n(69419),h=n(59030),p=n(19806),g=n(94189),f=n(52988),v=n(20021);const A=(0,i.ph)((({document:e,observeIntersection:t,smaller:n,canAutoLoad:A,autoLoadFileMaxSizeMb:y,uploadProgress:C,withDate:w,datetime:b,className:I,sender:S,isSelected:M,isSelectable:N,shouldWarnAboutSvg:k,isDownloading:Y,message:P,onCancelUpload:F,onMediaClick:T,onDateClick:D})=>{const{cancelMediaDownload:x,downloadMedia:E,setSharedSettingOption:L}=(0,o.ko)(),B=(0,i.li)(),R=(0,h.A)(),[O,U,K]=(0,d.A)(),[z,V]=(0,i.J0)(!1),{fileName:j,size:J,timestamp:$}=e,q=(0,r.rK)(e)||"",H=(0,c.Vz)(B,t),[G,W]=(0,d.A)();(0,i.vJ)((()=>{H&&W()}),[H,W]);const[_,Q]=(0,i.J0)(A&&(!y||J<=1048576*y)),Z=Boolean(Y||_&&G),X=(0,a.mr)(e,"download"),{loadProgress:ee,mediaData:te}=(0,m.A)(X,!Z,(0,a.Cz)(e,"download"),void 0,!0),ne=Boolean(te),{isUploading:ie,isTransferring:oe,transferProgress:se}=(0,a.LK)(C||ee,Z&&!ne,void 0!==C),ae=(0,r.ON)(e),re=ae?(0,a.VD)(e):void 0,de=ae?e.previewBlobUrl:void 0,ce=(0,u.A)((0,a.mr)(e,"pictogram"),!H),le=T&&e.innerMediaType,ue=(0,l.A)((()=>{E({media:e,originMessage:P})})),me=(0,l.A)((()=>{ie?F&&F():Y?x({media:e}):oe?Q(!1):le?T():s.c59.has(q)&&k?U():ue()})),he=(0,l.A)((()=>{L({shouldWarnAboutSvg:!z}),K(),ue()})),pe=(0,l.A)((()=>{D?.(P)}));return(0,v.FD)(v.FK,{children:[(0,v.Y)(f.A,{ref:B,name:j,extension:q,size:J,timestamp:w?b||$:void 0,thumbnailDataUri:re,previewData:de||ce,smaller:n,isTransferring:oe,isUploading:ie,transferProgress:se,className:I,sender:S,isSelectable:N,isSelected:M,actionIcon:le?(0,a.hr)(e)?"play":"eye":"download",onClick:me,onDateClick:D?pe:void 0}),(0,v.FD)(g.A,{isOpen:O,onClose:K,confirmHandler:he,children:[R("lng_launch_svg_warning"),(0,v.Y)(p.A,{className:"dialog-checkbox",checked:z,label:R("lng_launch_exe_dont_ask"),onCheck:V})]})]})}))},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),d=n(27109),c=n(60919),l=n(85982),u=n(64713),m=n(83868),h=n(59852),p=n(79882),g=n(24899),f=n(4961),v=n(82117),A=n(39351),y=n(17712),C=n(62587),w=n(59030),b=n(38691),I=n(32754),S=n(64493),M=n(22720),N=n(55158),k=n(63152),Y=n(87412),P=n(84685),F=n(66644),T=n(96454),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),K=n(19129),z=n(37661),V=n(30857),j=n(41036),J=n(18276);const $="MPBKHdZL";var q=n(20021);const H=Array.from({length:7},((e,t)=>t)),G=(0,i.ph)((({businessHours:e})=>{const t=(0,i.li)(),[n,o,s]=(0,z.A)(!1),[a,r,d]=(0,z.A)(!1),c=(0,w.A)(),l=(0,V.A)();(0,U.A)(l,6e4);const u=(0,O.A)((e=>e.timezones?.byId)),m=(0,K.A)(u,[u]),h=(0,i.Kr)((()=>{if(!m)return 0;const t=m[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60}),[e.timezoneId,m]),p=(0,i.Kr)((()=>{const t=B(),n=function(e){const t={};for(const n of e){const e=n.startMinute,i=n.endMinute,o=Math.floor(e/E),s=Math.floor((i-1)/E);for(let n=o;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*E),endMinute:Math.min(E,i-n*E)})}return t}(R(e.workHours,a?h:0)),i={};return H.forEach((e=>{const o=n[e];i[e]=o?o.map((({startMinute:e,endMinute:n})=>n-e===1440?c("BusinessHoursDayFullOpened"):`${(0,x.fU)(c,t+60*e*1e3)} – ${(0,x.fU)(c,t+60*n*1e3)}`)):[c("BusinessHoursDayClosed")]})),i}),[e.workHours,a,c,h]),g=(0,i.Kr)((()=>{const t=R(e.workHours,h),n=B(),i=((new Date).getTime()-n)/1e3/60;return t.some((({startMinute:e,endMinute:t})=>e<=i&&i<=t))}),[e.workHours,h]),f=(0,i.Kr)((()=>(new Date(Date.now()-(a?0:60*h*1e3)).getDay()+6)%7),[a,h]),v=(0,y.A)((()=>{n?s():o()})),A=(0,y.A)((e=>{e.stopPropagation(),a?d():r()}));(0,i.vJ)((()=>{if(!n)return;const e=document.querySelector(`.${j.uo} > .${$}`);if(!e)return;const i=e.offsetHeight;(0,F.RK)((()=>{t.current.style.height=`${i}px`}))}),[n]);const C=(0,y.A)((()=>{const e=document.querySelector(`.${j.VY} > .${$}`);(0,F.YS)((()=>{const n=e.offsetHeight;(0,F.RK)((()=>{t.current.style.height=`${n}px`}))}))}));return(0,q.FD)(M.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:v,children:[(0,q.FD)("div",{className:"nHSmCUNs",children:[(0,q.FD)("div",{className:"JTZ8UnnP",children:[(0,q.Y)("div",{children:c("BusinessHoursProfile")}),(0,q.Y)("div",{className:(0,D.A)("JVL7ZnnJ",g&&"segAfYXs"),children:c(g?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,q.Y)(J.A,{className:"dYxw2cFn",name:n?"up":"down"})]}),n&&(0,q.FD)("div",{className:"lp9VIV1o",children:[Boolean(h)&&(0,q.Y)("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:T.TF?void 0:A,onClick:T.TF?A:void 0,children:c(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,q.Y)(j.Ay,{className:"WKgL_XiP",ref:t,name:"fade",activeKey:Number(a),onStart:C,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===f&&"YZVvP_56"),children:(0,x.wv)(c,6===e?0:e+1)}),(0,q.Y)("dd",{className:"Rs0VPgpq",children:p[e].map((e=>(0,q.Y)("div",{children:e})))})]})))})})]})]})}));var W=n(87894),_=n(58554),Q=n(14737),Z=n(82855);const X=["🎉","🎆","🎈"],ee=(0,i.ph)((0,o.EK)((e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,c.n_C)(e)}}))((({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:d,isInSettings:c})=>{const{openGiftModal:l,requestConfetti:u}=(0,o.ko)(),m=(0,i.li)(),h=(0,i.li)(!1),[p,g,v]=(0,z.A)(),A=(0,w.A)(),{formattedDate:C,isToday:b,age:I}=(0,i.Kr)((()=>{const e=new Date,n=new Date;return t.year&&n.setFullYear(t.year),n.setMonth(t.month-1),n.setDate(t.day),n.setHours(0,0,0,0),{formattedDate:(0,x.A)(n,A.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&te(n)}}),[t,A]),S=(0,i.Kr)((()=>{if(!I||!b)return;const e=a?.stickers?.filter((({emoji:e})=>e?.endsWith("️⃣")));if(!e)return;const t=(0,W.dU)(e,"emoji");return I.toString().split("").map((e=>t[e+"️⃣"]))}),[I,a?.stickers,b]),N=(0,i.Kr)((()=>{if(!b)return;const e=X[Math.floor(Math.random()*X.length)];return d?.stickers?.find((({emoji:t})=>t===e))}),[d?.stickers,b]);(0,i.vJ)((()=>{if(b&&S&&(S.forEach((e=>{const t=(0,r.Mw)(e,"preview");_.hd(t,s.qZ.BlobUrl)})),N)){const e=(0,r.Mw)(N,"preview");_.hd(e,s.qZ.BlobUrl)}}),[N,b,S]),(0,Q.A)(v,p?3e3:void 0),(0,i.vJ)((()=>{if(p){h.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();u({top:t,left:n,width:i,height:o,style:"top-down"})}))}}),[c,p]);const k=`ProfileBirthday${b?"Today":""}Value${I?"Year":""}`,Y=b&&!e.isPremium&&!e.isSelf&&!n,P=(0,y.A)((()=>{l({forUserId:e.id})})),E=(0,y.A)((()=>{b&&(Y&&h.current?P():g())})),L=!b&&!Y;return(0,q.FD)("div",{className:"wCp6TBYF",children:[(0,q.FD)(M.A,{icon:"calendar",secondaryIcon:Y?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:m,ripple:!L,onClick:E,isStatic:L,onSecondaryIconClick:P,children:[(0,q.Y)("div",{className:"title",dir:A.isRtl?"rtl":void 0,children:(0,f.A)(A(k,[C,I],void 0,I))}),(0,q.Y)("span",{className:"subtitle",children:A(b?"ProfileBirthdayToday":"ProfileBirthday")})]}),p&&T.ol&&S?.map(((e,t)=>(0,q.Y)("div",{className:(0,D.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,q.Y)(Z.A,{containerRef:m,sticker:e,size:128,forceAlways:!0})}))),p&&N&&(0,q.Y)("div",{className:"cFEXGUih",children:(0,q.Y)(Z.A,{containerRef:m,sticker:N,size:288,shouldLoop:!0,forceAlways:!0})})]})})));function te(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const i=t.getMonth()-e.getMonth();return(i<0||0===i&&t.getDate()<e.getDate())&&n--,n}const ne="UZbkeFDB",ie={width:64,height:64,zoom:15},oe=(0,i.ph)((0,o.EK)(((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:i}}=e,o=t?(0,c.hds)(e,t):void 0,s=t?(0,c.mBe)(e,t):void 0,a=t?(0,c.XOs)(e,t):void 0,l=o?.isForum,u=o&&(0,d.If)(o,(0,c.K52)(e),(0,c.P5N)(e,o.id)),{threadId:m}=(0,c.Xf0)(e)||{},h=l&&m?Number(m):void 0,p=o&&(0,c.AWZ)(e,o.id),g=s&&(0,c.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=o&&!s&&(!(0,r.WX)(o)&&!(0,r.Sq)(o,"inviteUsers")||(0,r.ub)(o,"inviteUsers")),C=h?(0,c.sZk)(e,t,h):void 0,w=!n&&e.chats.listIds.saved?.includes(t),b=g?.personalChannelId?(0,c.hds)(e,g.personalChannelId):void 0,I=s?.hasMainMiniApp;return{phoneCodeList:i,chat:o,user:s,userFullInfo:g,canInviteUsers:y,botAppPermissions:a,isMuted:u,topicId:h,chatInviteLink:v,description:A,topicLink:C,hasSavedMessages:w,personalChannel:b,hasMainMiniApp:I,isBotCanManageEmojiStatus:g?.isBotCanManageEmojiStatus,botVerification:f}}))((({chatOrUserId:e,user:t,chat:n,userFullInfo:d,isInSettings:F,canInviteUsers:T,isMuted:D,phoneCodeList:x,topicId:E,description:L,chatInviteLink:B,topicLink:R,hasSavedMessages:O,personalChannel:U,hasMainMiniApp:K,isBotCanManageEmojiStatus:z,botAppPermissions:V,botVerification:j})=>{const{showNotification:J,updateChatMutedState:$,updateTopicMutedState:H,loadPeerStories:W,openSavedDialog:_,openMapModal:Q,requestCollectibleInfo:Z,requestMainWebView:X,toggleUserEmojiStatusPermission:te,toggleUserLocationPermission:oe}=(0,o.ko)(),{id:se,usernames:ae,phoneNumber:re,isSelf:de}=t||{},{id:ce,usernames:le}=n||{},ue=se||ce,{businessLocation:me,businessWorkHours:he,personalChannelMessageId:pe,birthday:ge}=d||{},fe=(0,w.A)(),ve=(0,A.A)();(0,v.A)((([e])=>{ue&&e!==ue&&(t||n&&(0,r.WX)(n))&&W({peerId:ue})}),[ue,n,t]);const{width:Ae,height:ye,zoom:Ce}=ie,we=(0,b.A)(),be=me?.geo&&(0,r.rt)(me.geo,Ae,ye,Ce,we),Ie=(0,C.A)(be),Se=(0,i.Kr)((()=>{if(me?.geo)return Ie?(0,q.Y)("img",{src:Ie,alt:"",className:ne}):(0,q.Y)(N.A,{className:ne})}),[me,Ie]),Me=Boolean(E&&E!==s.l3),Ne=n&&(0,r.WX)(n)||t?.isPremium,ke=(0,i.Kr)((()=>{const e=ae?.filter((e=>e.isActive));return e?.length?e:void 0}),[ae]),Ye=(0,i.Kr)((()=>{const e=t?void 0:le?.filter((e=>e.isActive));return e?.length?e:void 0}),[le,t]),Pe=(0,i.Kr)((()=>{if(n)return Me?R:(0,r.L7)(n)||B}),[n,Me,R,B]),Fe=(0,y.A)((()=>{const{address:e,geo:t}=me;if(!t)return(0,l.eM)(e),void J({message:fe("BusinessLocationCopied")});Q({geoPoint:t,zoom:Ce})})),Te=(0,y.A)((()=>{Me?H({chatId:ce,topicId:E,isMuted:!D}):$({chatId:ce,isMuted:!D})})),De=(0,y.A)((()=>{t&&te({botId:t.id,isEnabled:!z})})),xe=(0,y.A)((()=>{t&&oe({botId:t.id,isAccessGranted:!V?.geolocation})})),Ee=(0,y.A)((()=>{_({chatId:e})}));function Le(e,t){(0,l.eM)(e),J({message:`${t} was copied`})}const Be=re&&(0,u.Ox)(x,re),Re=(0,y.A)((()=>{re?.length===a.PGI&&re.startsWith(a._Bb)?Z({collectible:re,peerId:ue,type:"phone"}):Le(Be,fe("Phone"))})),Oe=(0,y.A)(((e,t)=>{e.isEditable?Le((0,g.A)(e.username,t),fe(t?"Link":"Username")):Z({collectible:e.username,peerId:ue,type:"username"})})),Ue=(0,y.A)((()=>{const e=t?.id;if(!e)return;const n=(0,h.A)();X({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})})),Ke=ve("ProfileOpenAppAbout",{terms:(0,q.Y)(P.A,{text:ve("ProfileOpenAppTerms"),url:ve("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if(!(ce&&(0,c._ls)((0,o.mS)(),ce)||de&&!F))return(0,q.FD)("div",{className:"ChatExtra",children:[U&&(0,q.FD)("div",{className:"HP5EJx7s",children:[(0,q.Y)("h3",{className:"cHyTGri2",children:fe("ProfileChannel")}),(0,q.Y)("span",{className:"kYd2GrmU",children:fe("Subscribers",U.membersCount,"i")}),(0,q.Y)(I.A,{chatId:U.id,orderDiff:0,animationType:p.I.None,isPreview:!0,previewMessageId:pe,className:"qOJwhXMC"})]}),Boolean(Be?.length)&&(0,q.FD)(M.A,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:Re,children:[(0,q.Y)("span",{className:"title",dir:ve.isRtl?"rtl":void 0,children:Be}),(0,q.Y)("span",{className:"subtitle",children:fe("Phone")})]}),ke&&ze(ke),L&&Boolean(L.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:ve.isRtl?"rtl":void 0,children:(0,f.A)(L,["br",Ne?"links":"tg_links","emoji"])}),(0,q.Y)("span",{className:"subtitle",children:fe(se?"UserBio":"Info")})]}),Ye&&!Me&&ze(Ye,!0),(!Ye&&T||Me)&&Pe&&(0,q.FD)(M.A,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>Le(Pe,fe("SetUrlPlaceholder")),children:[(0,q.Y)("div",{className:"title",children:Pe}),(0,q.Y)("span",{className:"subtitle",children:fe("SetUrlPlaceholder")})]}),ge&&(0,q.Y)(ee,{birthday:ge,user:t,isInSettings:F},ue),K&&(0,q.FD)(M.A,{multiline:!0,isStatic:!0,narrow:!0,children:[(0,q.Y)(S.A,{className:"x925YeS3",size:"smaller",onClick:Ue,children:fe("ProfileBotOpenApp")}),(0,q.Y)("div",{className:"IrqRJFxm",children:Ke})]}),!F&&(0,q.FD)(M.A,{icon:"unmute",narrow:!0,ripple:!0,onClick:Te,children:[(0,q.Y)("span",{children:fe("Notifications")}),(0,q.Y)(k.A,{id:"group-notifications",label:se?"Toggle User Notifications":"Toggle Chat Notifications",checked:!D,inactive:!0})]}),he&&(0,q.Y)(G,{businessHours:he}),me&&(0,q.FD)(M.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:Se,onClick:Fe,children:[(0,q.Y)("div",{className:"title",children:me.address}),(0,q.Y)("span",{className:"subtitle",children:fe("BusinessProfileLocation")})]}),O&&!F&&(0,q.Y)(M.A,{icon:"saved-messages",narrow:!0,ripple:!0,onClick:Ee,children:(0,q.Y)("span",{children:fe("SavedMessagesTab")})}),d&&"isBotAccessEmojiGranted"in d&&(0,q.FD)(M.A,{icon:"user",narrow:!0,ripple:!0,onClick:De,children:[(0,q.Y)("span",{children:fe("BotProfilePermissionEmojiStatus")}),(0,q.Y)(k.A,{label:fe("BotProfilePermissionEmojiStatus"),checked:z,inactive:!0})]}),void 0!==V?.geolocation&&(0,q.FD)(M.A,{icon:"location",narrow:!0,ripple:!0,onClick:xe,children:[(0,q.Y)("span",{children:fe("BotProfilePermissionLocation")}),(0,q.Y)(k.A,{label:fe("BotProfilePermissionLocation"),checked:V?.geolocation,inactive:!0})]}),j&&(0,q.FD)("div",{className:"RWFu5ENh",children:[(0,q.Y)(Y.A,{className:"b32hsSPS",documentId:j.iconId,size:16}),j.description]})]});function ze(e,t){const[n,...i]=e,o=i.length?fe("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:m.A,onClick:n=>{(0,m.A)(n),Oe(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:()=>{Oe(n,t)},children:[(0,q.Y)("span",{className:"title",dir:ve.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}),fe(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),d=n(17712),c=n(59030),l=n(64493),u=n(22699),m=n(24433),h=n(18276);var p=n(20021);const g=(0,i.ph)((({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,c.A)(),{showNotification:y,openChatWithDraft:C}=(0,o.ko)(),{isMobile:w}=(0,r.Ay)(),b=!v,I=(0,d.A)((()=>{(0,a.eM)(t),y({message:{key:"LinkCopied"}})})),S=(0,d.A)((()=>{n||I()})),M=(0,d.A)((()=>{C({text:{text:t}})})),N=(0,i.Kr)((()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(l.A,{round:!0,ripple:!w,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:A("AccDescrOpenMenu2"),children:(0,p.Y)(h.A,{name:"more"})})),[w,A]);return(0,p.FD)("div",{className:g,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:A(e||"InviteLink.InviteLink")}),(0,p.FD)("div",{className:"xNjJHI7j",children:[(0,p.Y)("input",{className:(0,s.A)("form-control","Ag6k_p7b"),value:t,readOnly:!0,onClick:S}),b?(0,p.Y)(l.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,disabled:n,onClick:S,children:(0,p.Y)(h.A,{name:"copy"})}):(0,p.FD)(u.A,{className:"p7t3macG",trigger:N,positionX:"right",children:[(0,p.Y)(m.A,{icon:"copy",onClick:S,disabled:n,children:A("Copy")}),v&&(0,p.Y)(m.A,{icon:"delete",onClick:v,destructive:!0,children:A("RevokeButton")})]})]}),f&&(0,p.Y)(l.A,{size:"smaller",disabled:n,onClick:M,className:"Sbagy_Tm",children:A("FolderLinkScreen.LinkActionShare")})]})}))},47067:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(31481),a=n(90709),r=n(96454),d=n(9716),c=n(87894),l=n(39351);const u=({chat:e,user:t,folderId:n,isPinned:u,isMuted:m,canChangeFolder:h,isSavedDialog:p,currentUserId:g,isPreview:f,topics:v,handleDelete:A,handleMute:y,handleChatFolderChange:C,handleReport:w},b=!1)=>{const I=(0,l.A)(),{isSelf:S}=t||{},M=t?.id===s.zv8,N=(0,i.Kr)((()=>{if(e)return p?I("Delete"):(0,d.L8)(e.id)||(0,a.IC)(e)?I("DeleteChat"):(0,a.WX)(e)?I("ChannelLeave"):I("GroupLeaveGroup")}),[e,p,I]);return(0,i.Kr)((()=>{if(!e||f)return;const{toggleChatPinned:i,toggleSavedDialogPinned:s,updateChatMutedState:d,toggleChatArchived:l,markChatMessagesRead:k,markChatUnread:Y,openChatInNewTab:P}=(0,o.ko)(),F=r.OS&&{title:r.cp?I("ChatListOpenInNewWindow"):I("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{P(p?{chatId:g,threadId:e.id}:{chatId:e.id})}},T=()=>{p?s({id:e.id}):i({id:e.id,folderId:n})},D=u?{title:I("ChatListUnpinFromTop"),icon:"unpin",handler:T}:{title:I("ChatListPinToTop"),icon:"pin",handler:T},x={title:N,icon:"delete",destructive:!0,handler:A};if(p)return(0,c.oE)([F,D,x]);const E=h?{title:I("ChatListContextAddToFolder"),icon:"folder",handler:C}:void 0,L=m?{title:I("ChatsUnmute"),icon:"unmute",handler:()=>d({chatId:e.id,isMuted:!1})}:{title:`${I("ChatsMute")}...`,icon:"mute",handler:y};if(b)return(0,c.oE)([F,D,E,L]);const B=e.unreadCount||e.hasUnreadMark||Object.values(v||{}).some((({unreadCount:e})=>e))?{title:I("ChatListContextMaskAsRead"),icon:"readchats",handler:()=>k({id:e.id})}:void 0,R=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:I("ChatListContextMaskAsUnread"),icon:"unread",handler:()=>Y({id:e.id})},O=(0,a.TJ)(e)?{title:I("Unarchive"),icon:"unarchive",handler:()=>l({id:e.id})}:{title:I("Archive"),icon:"archive",handler:()=>l({id:e.id})},U=w&&!t&&((0,a.WX)(e)||(0,a.YE)(e))?{title:I("ReportPeerReport"),icon:"flag",handler:w}:void 0,K=void 0!==n;return(0,c.oE)([F,E,B,R,D,!S&&L,!S&&!M&&!K&&O,U,x])}),[e,t,h,I,C,u,b,m,g,A,y,w,n,S,M,p,N,f,v])}},47526:(e,t,n)=>{n.d(t,{KE:()=>d,PP:()=>c,_u:()=>r,zS:()=>a});const i={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},o=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t,n=15){const{lat:o,long:s}=t,a=i[e];switch(e){case"google":return`${a}/place/${o}+${s}/@${o},${s},${n}z`;case"bing":return`${a}?cp=${o}~${s}&lvl=${n}&sp=point.${o}_${s}`;case"apple":return`${a}?q=${o},${s}`;default:return`${a}/?mlat=${o}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function d(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function c(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:()=>c});var i=n(84051),o=n(48775),s=n(39351),a=n(19806),r=n(94189);var d=n(20021);const c=(0,i.ph)((({isOpen:e,onClose:t,userName:n,messagePriceInStars:i,messagesCount:c,shouldAutoApprove:l,setAutoApprove:u,confirmHandler:m})=>{const h=(0,s.A)(),p=h("ConfirmationModalPaymentForMessage",{user:n,amount:(0,o.Kk)(h,i),totalAmount:(0,o.Kk)(h,i*c),count:c},{withMarkdown:!0,withNodes:!0,pluralValue:c}),g=h("PayForMessage",{count:c},{withNodes:!0,pluralValue:c});return(0,d.FD)(r.A,{title:h("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:m,children:[p,(0,d.Y)(a.A,{className:"eScpikxM",label:h("DoNotAskAgain"),checked:l,onCheck:u})]})}))},48553:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(66644),d=n(90709),c=n(60919),l=n(96454),u=n(9716),m=n(2178),h=n(17712),p=n(59030),g=n(18276),f=n(64493),v=n(22699),A=n(24433),y=n(60859),C=n(80089),w=n(80464),b=n(20021);const I=e=>{const{isOpen:t}=e,n=(0,w.A)(C.ar.Extra,"HeaderMenuContainer",!t);return n?(0,b.Y)(n,{...e}):void 0},S=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n,messageListType:i,isMobile:o})=>{const a=(0,c.hds)(e,t),r=Boolean(a&&(0,d.WX)(a)),m=Boolean(a&&(0,d.Vs)(a)),h=(0,c.wmb)(e),p=(0,c.Qq_)(e),g=(0,u.L8)(t),{doNotTranslate:f}=e.settings.byKey,v=(0,c._ls)(e,t);if(!a||v||(0,c.rTV)(e))return{noMenu:!0,language:h,translationLanguage:p,doNotTranslate:f};const A=(0,c.yps)(e,t),y=g?void 0:(0,c.AWZ)(e,t),C=g?(0,c.vGo)(e,t):void 0,w=y||C,b=(0,c.nZ4)(e,t),I="thread"===i&&n===s.l3,S="thread"===i&&n!==s.l3,M=(0,c.gjV)(e,o),N=(0,d.cG)(t,n,e.currentUserId),k=!!g&&(0,c.apd)(e,t),Y=Boolean(A&&k),P=!Y&&Boolean((0,c.I_m)(e,t)),F=k&&!A,T=Boolean((I||a.isForum)&&(r||m)&&a.isNotJoined&&!a.isMonoforum),D=I||S,x=l.OL&&(0,u.L8)(a.id)&&!b&&!A&&!a.isSupport&&!(0,d.Qe)(a.id),E=I&&!b&&!T,L=N||I&&!T,B=l.OL&&I&&a.isCallActive,R=l.OL&&I&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,d.yn)(a))&&!a.isMonoforum,O=I&&y?.canViewStatistics,U=I&&y?.canViewMonetization,K=I&&!a.isMonoforum&&(m||r)&&(O||(0,d.ub)(a,"postStories")),z=!K&&(m||r)&&!a.isMonoforum,V=I?y?.requestsPending:void 0,j=Boolean(a?.isNotJoined&&a.isJoinToSend),J=Boolean(a?.isNotJoined&&a.isJoinRequest),$=!(0,c.PKK)(e),q=Boolean((0,c.qZq)(e,t)),H=(0,c.jGY)(e,t)&&!w?.isTranslationDisabled,G=(0,c.trm)(e),W=(0,d.WX)(a)?a.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:r,isRightColumnShown:M,canStartBot:P,canRestartBot:Y,canSubscribe:T,canSearch:D,canCall:x,canMute:E,canViewStatistics:O,canViewMonetization:U,canViewBoosts:K,canShowBoostModal:z,canLeave:L,canEnterVoiceChat:B,canCreateVoiceChat:R,pendingJoinRequests:V,shouldJoinToSend:j,shouldSendJoinRequest:J,noAnimation:$,canTranslate:H,isTranslating:q,translationLanguage:p,language:h,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:F,isAccountFrozen:G,channelMonoforumId:W}}))((({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:d,canStartBot:c,canRestartBot:u,canUnblock:C,canSubscribe:w,canSearch:S,canCall:N,canMute:k,canViewStatistics:Y,canViewMonetization:P,canViewBoosts:F,canShowBoostModal:T,canLeave:D,canEnterVoiceChat:x,canCreateVoiceChat:E,channelMonoforumId:L,pendingJoinRequests:B,isRightColumnShown:R,isForForum:O,canExpandActions:U,shouldJoinToSend:K,shouldSendJoinRequest:z,noAnimation:V,canTranslate:j,isTranslating:J,translationLanguage:$,language:q,detectedChatLanguage:H,doNotTranslate:G,isAccountFrozen:W,onTopicSearch:_})=>{const{joinChannel:Q,sendBotCommand:Z,openMiddleSearch:X,restartBot:ee,requestMasterAndRequestCall:te,requestNextManagementScreen:ne,showNotification:ie,openChat:oe,requestChatTranslation:se,togglePeerTranslations:ae,openChatLanguageModal:re,setSettingOption:de,unblockUser:ce,setViewForumAsMessages:le,openFrozenAccountModal:ue}=(0,o.ko)(),me=(0,i.li)(),he=(0,p.A)(),[pe,ge]=(0,i.J0)(!1),[fe,ve]=(0,i.J0)(void 0),Ae=(0,h.A)((()=>{ge(!0);const e=me.current.getBoundingClientRect();ve({x:e.right,y:e.bottom})})),ye=(0,h.A)((()=>{ge(!1)})),Ce=(0,h.A)((()=>{ve(void 0)})),we=(0,h.A)((()=>{Q({chatId:e}),z&&ie({message:he(d?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),be=(0,h.A)((()=>{Z({command:"/start"})})),Ie=(0,h.A)((()=>{ee({chatId:e})})),Se=(0,h.A)((()=>{ce({userId:e})})),Me=(0,h.A)((()=>{se(J?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:$})})),Ne=(0,h.A)((()=>{ne({screen:a.je.JoinRequests})})),ke=(0,h.A)((()=>{O?_?.():(X(),s?M():V?(0,r.YS)((()=>{(0,r.Uz)(M)})):setTimeout(M,320))})),Ye=(0,h.A)((()=>{oe({id:e}),le({chatId:e,isEnabled:!0})})),Pe=(0,h.A)((()=>{W?ue():te({userId:e})})),Fe=(0,h.A)((e=>{S&&l.lE&&!e.shiftKey&&(e.preventDefault(),ke())})),Te=(0,i.hb)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,i=he(n);if(i!==n)return he(e,i);const o=new Intl.DisplayNames([q],{type:"language"}).of(t);return he(`${e}Other`,o)}),[q,he]),De=(0,i.Kr)((()=>J?he("ShowOriginalButton"):Te("TranslateToButton",$)),[$,Te,J,he]),xe=(0,i.Kr)((()=>{if(H)return Te("DoNotTranslateLanguage",H)}),[Te,H]),Ee=(0,h.A)((()=>{ae({chatId:e,isEnabled:!1}),se({chatId:e,toLanguageCode:void 0})})),Le=(0,h.A)((()=>{re({chatId:e})})),Be=(0,h.A)((()=>{H&&(de({doNotTranslate:[...G,H]}),se({chatId:e,toLanguageCode:void 0}),ie({message:Te("AddedToDoNotTranslate",H)}))}));(0,m.v)((0,i.Kr)((()=>({"Mod+F":Fe})),[]));const Re=(0,i.Kr)((()=>({onTrigger:e,isOpen:t})=>(0,b.Y)(f.A,{round:!0,ripple:R,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:he("TranslateMessage"),children:(0,b.Y)(g.A,{name:"language"})})),[R,he]);return(0,b.FD)("div",{className:"HeaderActions",children:[!O&&j&&(0,b.FD)(v.A,{className:"stickers-more-menu with-menu-transitions",trigger:Re,positionX:"right",children:[(0,b.Y)(A.A,{icon:"language",onClick:Me,children:De}),(0,b.Y)(A.A,{icon:"replace",onClick:Le,children:he("Chat.Translate.Menu.To")}),(0,b.Y)(y.A,{}),H&&(0,b.Y)(A.A,{icon:"hand-stop",onClick:Be,children:xe}),(0,b.Y)(A.A,{icon:"close-circle",onClick:Ee,children:he("Hide")})]}),!s&&(0,b.FD)(b.FK,{children:[U&&!z&&(w||K)&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:we,children:he(d?"ProfileJoinChannel":"ProfileJoinGroup")}),U&&z&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:we,children:he("ChannelJoinRequest")}),U&&c&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:be,children:he("BotStart")}),U&&u&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Ie,children:he("BotRestart")}),U&&C&&(0,b.Y)(f.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Se,children:he("Unblock")}),S&&(0,b.Y)(f.A,{round:!0,ripple:R,color:"translucent",size:"smaller",onClick:ke,ariaLabel:he("Conversation.SearchPlaceholder"),children:(0,b.Y)(g.A,{name:"search"})}),N&&(0,b.Y)(f.A,{round:!0,color:"translucent",size:"smaller",onClick:Pe,ariaLabel:"Call",children:(0,b.Y)(g.A,{name:"phone"})})]}),!O&&Boolean(B)&&(0,b.FD)(f.A,{round:!0,className:"badge-button",ripple:R,color:"translucent",size:"smaller",onClick:Ne,ariaLabel:he(d?"SubscribeRequests":"MemberRequests"),children:[(0,b.Y)(g.A,{name:"user"}),(0,b.Y)("div",{className:"badge",children:B})]}),(0,b.Y)(f.A,{ref:me,className:pe?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:Ae,children:(0,b.Y)(g.A,{name:"more"})}),fe&&(0,b.Y)(I,{chatId:e,threadId:t,isOpen:pe,anchor:fe,withExtraActions:s||!U,isChannel:d,canStartBot:c,canSubscribe:w,canSearch:S,canCall:N,canMute:k,canViewStatistics:Y,canViewBoosts:F,canViewMonetization:P,canShowBoostModal:T,canLeave:D,canEnterVoiceChat:x,canCreateVoiceChat:E,pendingJoinRequests:B,onJoinRequestsClick:Ne,withForumActions:O,channelMonoforumId:L,onSubscribeChannel:we,onSearchClick:ke,onAsMessagesClick:Ye,onClose:ye,onCloseAnimationEnd:Ce})]})})));function M(){const e=document.querySelector("#MiddleSearch input");e?.focus()}},48885:(e,t,n)=>{n.d(t,{A:()=>m,S:()=>h});var i=n(84051),o=n(61433),s=n(66644),a=n(14737),r=n(17712),d=n(93545),c=n(672);const l=450,u=100;function m({ref:e,isOpen:t,isDisabled:n,withResizeObserver:o,onStateChange:m}){const[h,p]=(0,i.J0)(t),g=(0,i.li)(),f=e||g,v=(0,i.li)(0),A=(0,r.A)((()=>{p(!0),m?.({element:void 0,height:0,isOpen:!1})}));(0,i.vJ)((()=>{n&&A()}),[n]),(0,i.vJ)((()=>{t&&p(!0)}),[t]),(0,i._W)(A),(0,a.A)((()=>{p(!1),m?.({height:0,isOpen:!1})}),t?void 0:l);const y=(0,i.hb)((()=>{const e=f.current;!n&&e&&h&&(t?(0,s.gm)((()=>{const n=e.offsetHeight;return v.current=n,()=>{m?.({element:e,height:n,isOpen:t})}})):m?.({element:e,height:0,isOpen:!1}))}),[t,h,n,f,m]),C=(0,c.A)((()=>{const e=f.current;e&&e.offsetHeight!==v.current&&y()}),[y,f],u,!0);return(0,i.Nf)(y,[y]),(0,d.A)(f,C,!o||!h),{shouldRender:h,ref:f}}function h(e,t=!1){let n=0;for(let i=0;i<e.length;i++){const a=e[i],r=a.element;if(!r)continue;const d=`${n}px`,c=()=>{(0,o.Tv)(r,{transform:`translateY(${a.isOpen?d:`calc(${d} - 100%)`})`,zIndex:String(-i),transition:t?"none":""})};r.dataset.isPanelOpen||!a.isOpen||t?c():((0,o.Tv)(r,{transform:`translateY(calc(${d} - 100%))`,zIndex:String(-i),transition:"none"}),r.dataset.isPanelOpen="true",(0,s.Uz)(c)),n+=a.height}}},48906:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(20021);const o=function({isOwn:e}){const t=e?"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,i.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,i.Y)("defs",{children:(0,i.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,i.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,i.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,i.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,i.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,i.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,i.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642:(e,t,n)=>{n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>d,MV:()=>o,hm:()=>c,wp:()=>l});const i={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function o(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...i,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(i),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function d(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function l({title:e,artist:t,album:n,artwork:i}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:i})}},51083:(e,t,n)=>{n.d(t,{A:()=>I});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(60919),d=n(87357),c=n(76023),l=n(4961),u=n(39351),m=n(17712),h=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*c.$,I=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n})=>{const i=(0,r.hds)(e,t),o=n?(0,r.Vw0)(e,t,n):void 0,s=i?(0,r.ToO)(e,i):void 0,a=Boolean((0,r.zeq)(e,t)),d=n?(0,r.S0q)(e,t,n):void 0;return{chat:i,threadInfo:o,onlineCount:s,topic:d,areMessagesLoaded:a,messagesCount:d&&(0,r.QbG)(e,t,n),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,t)}}))((({typingStatus:e,className:t,statusIcon:n,avatarSize:c="medium",noAvatar:I,status:S,withDots:M,withMediaViewer:N,withUsername:k,withFullInfo:Y,withUpdatingStatus:P,withChatType:F,threadInfo:T,noRtl:D,chat:x,onlineCount:E,areMessagesLoaded:L,topic:B,messagesCount:R,noStatusOrTyping:O,withStory:U,storyViewerOrigin:K,noEmojiStatus:z,emojiStatusSize:V,isSavedDialog:j,self:J,withMonoforumStatus:$,monoforumChannel:q,onClick:H,onEmojiStatusClick:G})=>{const{loadFullChat:W,openMediaViewer:_,loadMoreProfilePhotos:Q}=(0,o.ko)(),Z=!$&&q?q:x,X=(0,h.A)(),ee=(0,u.A)(),te=Z&&(0,a.Vs)(Z),ne=Boolean(Z?.isForum&&T&&B),{id:ie,isMin:oe}=Z||{},se=(0,r._ls)((0,o.mS)(),ie);(0,i.vJ)((()=>{ie&&!oe&&(Y&&W({chatId:ie}),N&&Q({peerId:ie,isPreload:!0}))}),[ie,oe,Y,te,N]);const ae=(0,m.A)(((e,t)=>{Z&&t&&(e.stopPropagation(),_({isAvatarView:!0,chatId:Z.id,mediaIndex:0,origin:"jumbo"===c?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))})),re=(0,i.Kr)((()=>Z&&k&&(0,a.Kl)(Z)),[Z,k]);if(Z)return(0,w.FD)("div",{className:(0,d.A)("ChatInfo",t),dir:!D&&X.isRtl?"rtl":void 0,onClick:H,children:[!I&&!ne&&(0,w.FD)(w.FK,{children:[j&&J&&(0,w.Y)(g.A,{size:c,peer:J,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,d.A)(j&&"overlay-avatar"),size:c,peer:Z,withStory:U,asMessageBubble:Boolean(q),storyViewerOrigin:K,storyViewerMode:"single-peer",isSavedDialog:j,onClick:N?ae:void 0},Z.id)]}),ne&&(0,w.Y)(y.A,{topic:B,className:"topic-header-icon",size:b}),(0,w.FD)("div",{className:"info",children:[B?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,l.A)(B.title)}):(0,w.Y)(v.A,{peer:Z,isMonoforum:!$&&Boolean(q),emojiStatusSize:V,withEmojiStatus:!z,isSavedDialog:j,onEmojiStatusClick:G}),!O&&function(){if(P&&!L&&!se)return(0,w.Y)(f.A,{className:"status",content:X("Updating")});if($)return(0,w.Y)("span",{className:"status",dir:"auto",children:ee("MonoforumStatus")});if(x?.isMonoforum)return;if(S)return M?(0,w.Y)(f.A,{className:"status",content:S}):(0,w.FD)("span",{className:"status",dir:"auto",children:[n&&(0,w.Y)(A.A,{className:"status-icon",name:n}),(0,l.A)(S)]});if(!Z)return;if(e)return(0,w.Y)(C.A,{typingStatus:e});if(ne)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==R?1:2,className:"message-count-transition",children:void 0!==R&&X("messages",R,"i")})});if(F)return(0,w.Y)("span",{className:"status",dir:"auto",children:X((0,a.Gg)(Z))});const t=(0,a.sT)(X,Z),i=E?`, ${X("OnlineCount",E,"i")}`:void 0;return(0,w.FD)("span",{className:"status",children:[re&&(0,w.Y)("span",{className:"handle withStatus",children:re}),(0,w.Y)("span",{className:"group-status",children:t}),i&&(0,w.Y)("span",{className:"online-status",children:i})]})}()]})]})})))},51644:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(90709),d=n(87357),c=n(40435),l=n(35127),u=n(43874),m=n(37661),h=n(5912),p=n(17712),g=n(37859),f=n(37960),v=n(69419),A=n(29886),y=n(73767),C=n(21511),w=n(61097),b=n(18276),I=n(27860),S=n(14413),M=n(35913),N=n(20021);const k=(0,i.ph)((0,o.EK)((e=>{const t=e.appConfig,n=t?.needAgeVideoVerification;return{needsAgeVerification:n}}))((({id:e,photo:t,messageText:n,isOwn:k,noAvatars:Y,canAutoLoad:P,isInSelectMode:F,isSelected:T,uploadProgress:D,forcedWidth:x,size:E="inline",dimensions:L,asForwarded:B,nonInteractive:R,shouldAffectAppendix:O,isDownloading:U,isProtected:K,theme:z,isInWebPage:V,clickArg:j,className:J,isMediaNsfw:$,observeIntersection:q,onClick:H,onCancelUpload:G,needsAgeVerification:W})=>{const _=(0,i.li)(),Q="extendedMediaPreview"===t.mediaType,Z=Q?void 0:t.blobUrl,X=(0,h.Vz)(_,q),{isMobile:ee}=(0,u.Ay)(),[te,ne]=(0,i.J0)(P),ie=te&&X&&!Q,{mediaData:oe,loadProgress:se}=(0,v.A)(Q?void 0:(0,r.rI)(t,E),!ie),ae=(0,A.A)(oe),re=Z||oe,{ref:de,shouldRender:ce}=(0,f.A)({hasMediaData:Boolean(re),withShouldRender:!0}),le=Boolean(x),[ue]=(0,i.J0)(!re),me=Boolean(re),he=(0,w.A)(t,me);(0,f.A)({ref:he,hasMediaData:!me});const pe=(0,w.A)(t,!le),ge=(0,r.VD)(t),{updateContentSettings:fe,openAgeVerificationModal:ve}=(0,o.ko)(),[Ae,ye,Ce]=(0,m.A)(),[we,be]=(0,i.J0)(!1),Ie=Q||t.isSpoiler||$,[Se,Me,Ne]=(0,m.A)(Ie);(0,i.vJ)((()=>{Ie?Me():Ne()}),[Ie]);const ke=(0,p.A)((()=>{Ce(),Ne(),we&&fe({isSensitiveEnabled:!0})})),{loadProgress:Ye}=(0,v.A)(Q?void 0:(0,r.rI)(t,"download"),!U,Q?void 0:(0,r.Cz)(t,"download")),{isUploading:Pe,isTransferring:Fe,transferProgress:Te}=(0,r.LK)(D||(U?Ye:se),ie&&!re,void 0!==D),De=!1===(0,y.A)(te),{ref:xe,shouldRender:Ee}=(0,C.A)({isOpen:Fe,noMountTransition:De,className:"slow",withShouldRender:!0}),{ref:Le,shouldRender:Be}=(0,C.A)({isOpen:!re&&!te,withShouldRender:!0}),Re=(0,p.A)((e=>{if(Pe)G?.(j);else{if(re)return Se?$?W?void ve():void ye():void Ne():void H?.(j,e);ne((e=>!e))}}));(0,g.A)((([e])=>{if(!O)return void(e&&_.current.closest(s.KFG).removeAttribute(s.D3G));const t=_.current.closest(s.KFG);if(re){const e=Number(t.closest(".Message").dataset.messageId);(0,c.A)(re,Boolean(k),e,T,z).then((e=>{(0,a.RK)((()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(s.D3G,"")}))}))}else t.classList.add("has-appendix-thumb")}),[O,re,k,F,T,z]);const{width:Oe,height:Ue,isSmall:Ke}=L||(0,l.yA)({media:t,isOwn:k,asForwarded:B,noAvatars:Y,isMobile:ee,messageText:n,isInWebPage:V}),ze=(0,d.A)("media-inner",!Pe&&!R&&"interactive",Ke&&"small-image",(Oe===Ue||"pictogram"===E)&&"square-image",Ue<l.ej&&"fix-min-height",J),Ve=L?` width: ${Oe}px; left: ${L.x}px; top: ${L.y}px;`:"",je="inline"===E?`height: ${Ue}px;${Ve}`:void 0;return(0,N.FD)("div",{id:e,ref:_,className:ze,style:je,onClick:Pe?void 0:Re,children:[le&&(0,N.Y)("canvas",{ref:pe,className:"thumbnail blurred-bg"}),ce&&(0,N.Y)("img",{ref:de,src:re||ae,className:(0,d.A)("full-media",le&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px`:void 0,draggable:!K}),ue&&(0,N.Y)("canvas",{ref:he,className:"thumbnail"}),K&&(0,N.Y)("span",{className:"protector"}),Ee&&!Be&&(0,N.Y)("div",{ref:xe,className:"media-loading",children:(0,N.Y)(M.A,{progress:Te,onClick:Pe?Re:void 0})}),Be&&(0,N.Y)(b.A,{ref:Le,name:"download"}),(0,N.Y)(I.A,{isVisible:Se,withAnimation:!0,thumbDataUri:ge,width:Oe,height:Ue,className:"media-spoiler",isNsfw:$}),Fe&&(0,N.FD)("span",{className:"message-transfer-progress",children:[Math.round(100*Te),"%"]}),(0,N.Y)(S.A,{isOpen:Ae,onClose:Ce,shouldAlwaysShow:we,onAlwaysShowChanged:be,confirmHandler:ke})]})})))},52844:(e,t,n)=>{let i;function o(e="*",t,n=!1){i||(i=document.createElement("input"),i.setAttribute("type","file")),i.setAttribute("accept",e),n?i.removeAttribute("multiple"):i.setAttribute("multiple","multiple"),i.onchange=null,i.value="",i.onchange=t,i.click()}n.d(t,{p:()=>o})},52988:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(96454),s=n(87357),a=n(17663),r=n(91525),d=n(76023),c=n(4961),l=n(43874),u=n(45470),m=n(83057),h=n(59030),p=n(50680),g=n(96530),f=n(35913),v=n(18276),A=n(20021);const y=(0,i.ph)((({ref:e,name:t,size:n,extension:y="",timestamp:C,sender:w,thumbnailDataUri:b,previewData:I,className:S,smaller:M,isTransferring:N,isUploading:k,isSelectable:Y,isSelected:P,transferProgress:F,actionIcon:T,onClick:D,onDateClick:x})=>{const E=(0,h.A)();let L=(0,i.li)();e&&(L=e);const{isMobile:B}=(0,l.Ay)(),[R]=(0,i.J0)(!I),O=Boolean(I),U=(0,u.A)(b,O,B&&!o.QH),K=(0,m.A)(!O),{shouldRender:z,transitionClassNames:V}=(0,p.A)(N,void 0,!0),j=(0,r.fE)(y),J=(0,r.zV)(n),$=(0,i.Kr)((()=>N&&F?`${(0,r.zV)(n*F)} / ${J}`:J),[N,n,J,F]),{width:q,height:H}=(0,d.tP)(M),G=(0,s.A)("File",S,M&&"smaller",D&&!k&&"interactive",P&&"file-is-selected");return(0,A.FD)("div",{ref:L,className:G,dir:E.isRtl?"rtl":void 0,children:[Y&&(0,A.Y)("div",{className:"message-select-control no-selection",children:P&&(0,A.Y)(v.A,{name:"select"})}),(0,A.FD)("div",{className:"file-icon-container",onClick:k?void 0:D,children:[b||I?(0,A.FD)("div",{className:"file-preview media-inner",children:[(0,A.Y)("img",{src:I,className:"full-media",width:q,height:H,draggable:!1,alt:""}),R&&(0,A.Y)("canvas",{ref:U,className:(0,s.A)("thumbnail",K)})]}):(0,A.Y)("div",{className:`file-icon ${j}`,children:y.length<=4&&(0,A.Y)("span",{className:"file-ext",dir:"auto",children:y})}),z&&(0,A.Y)("div",{className:(0,s.A)("file-progress",j,V),children:(0,A.Y)(f.A,{progress:F,size:M?"s":"m",onClick:k?D:void 0})}),D&&(0,A.Y)(v.A,{name:T||"download",className:(0,s.A)("action-icon",z&&"hidden")})]}),(0,A.FD)("div",{className:"file-info",children:[(0,A.Y)("div",{className:"file-title",dir:"auto",title:t,children:(0,c.A)(t)}),(0,A.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,A.Y)("span",{children:$}),w&&(0,A.Y)("span",{className:"file-sender",children:(0,c.A)(w)}),!w&&Boolean(C)&&(0,A.FD)(A.FK,{children:[(0,A.Y)("span",{className:"bullet"}),(0,A.Y)(g.A,{onClick:x,children:(0,a.fS)(E,1e3*C,!0)})]})]})]}),w&&Boolean(C)&&(0,A.Y)(g.A,{onClick:x,children:(0,a.be)(E,1e3*C)})]})}))},53188:(e,t,n)=>{n.d(t,{A:()=>x});var i=n(84051),o=n(31481),s=n(66644),a=n(90709),r=n(70636),d=n(87357),c=n(4961),l=n(18501),u=n(79882),m=n(35749),h=n(2338),p=n(21488),g=n(62587),f=n(59030),v=n(13439),A=n(76023),y=n(43874),C=n(11217),w=n(38102);const b="CBda1UmC",I="BhS75ocD",S="uWo2dhui",M="g3XnC73g";var N=n(20021);const k=Number(A.$),Y=(0,i.ph)((({chat:e,topics:t,renderLastMessage:n,observeIntersection:o})=>{const{openThread:s}=(0,v.ko)(),r=(0,i.li)(),l=(0,i.li)(),u=(0,f.A)(),[m,...h]=(0,i.Kr)((()=>t?(0,a.CO)(Object.values(t),void 0,!0).slice(0,3):[]),[t]),[p,g]=(0,i.J0)(!1),[A,Y]=(0,i.J0)(void 0),{handleClick:P,handleMouseDown:F}=(0,C.Q)((t=>{0===m.unreadCount||e.isForumAsMessages||(t.stopPropagation(),t.preventDefault(),s({chatId:e.id,threadId:m.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,y.Ny)()}))}));return(0,i.vJ)((()=>{const e=r.current,t=l.current;if(!e||!t)return;const n=e.offsetWidth,i=t.offsetWidth;Math.abs(n-i)<k?Y(Math.max(n,i)):Y(void 0),g(n>i)}),[m,n]),(0,N.FD)("div",{className:(0,d.A)("Ow6Ij9O5",p&&"U_yhhC0w",A&&"HV0wCR4O"),dir:u.isRtl?"rtl":void 0,style:A?`--overwritten-width: ${A}px`:void 0,children:[m&&(0,N.FD)("div",{className:b,children:[(0,N.FD)("div",{className:(0,d.A)("lEbV6HrI",m.unreadCount&&I),ref:l,onClick:P,onMouseDown:F,children:[(0,N.Y)(w.A,{topic:m,observeIntersection:o}),(0,N.Y)("div",{className:"k3Ch25ZQ",children:(0,c.A)(m.title)}),!A&&p&&(0,N.Y)("div",{className:S,children:(0,N.Y)("div",{className:M})})]}),(0,N.Y)("div",{className:"IkuCBmvA",children:h.map((e=>(0,N.FD)("div",{className:(0,d.A)("d0hTIVJn",e.unreadCount&&I),children:[(0,N.Y)(w.A,{topic:e,className:"oknhG11L",observeIntersection:o}),(0,N.Y)("span",{className:"ZUj3xAjs",children:(0,c.A)(e.title)})]},e.id)))}),(0,N.Y)("div",{className:"_m_2xcPW"})]}),!m&&(0,N.Y)("div",{className:(0,d.A)(b,"L4Zk0yMN"),children:u("Loading")}),(0,N.FD)("div",{className:(0,d.A)("KJ16dBus",m?.unreadCount&&I),ref:r,onClick:P,onMouseDown:F,children:[n(),!A&&!p&&(0,N.Y)("div",{className:S,children:(0,N.Y)("div",{className:M})})]})]})}));var P=n(18276),F=n(18653),T=n(80477);const D=200;function x({chat:e,topics:t,lastMessage:n,statefulMediaContent:d,chatId:v,typingStatus:A,draft:y,lastMessageTopic:C,lastMessageSender:w,observeIntersection:b,animationType:I,orderDiff:S,withInterfaceAnimations:M,isTopic:k,isSavedDialog:F,isPreview:x}){const L=(0,f.A)(),B=(0,i.li)(),R=n?.content.storyData,O=d&&!d.story;(0,p.A)(O?R?.peerId:void 0,R?.id,d?.story);const U=d?.story||n,K=U&&!(0,a.fP)(U),z=(0,h.A)(U),V=K?z:void 0,j=(0,m.A)(U,"micro"),J=(0,g.A)(K?j:void 0),$=Boolean(n&&(0,a.lk)(n)),q=(0,i.hb)((()=>{if(!F&&!x&&A&&n&&A.timestamp>1e3*n.date)return(0,N.Y)(T.A,{typingStatus:A});const t=y&&y.replyInfo?.replyToMsgId===C?.id,i=y?.replyInfo&&!y.text&&y.isLocal;if(!e?.isForum&&!F&&!x&&y&&!i&&(!k||!t))return(0,N.FD)("p",{className:"last-message",dir:L.isRtl?"auto":"ltr",children:[(0,N.Y)("span",{className:"draft",children:L("Draft")}),(0,l.fd)({text:y.text?.text||"",entities:y.text?.entities,asPreview:!0,withTranslucentThumbs:!0})]});if(!n)return;const o=w?(0,r.Q5)(L,v,w):void 0;return(0,N.FD)("p",{className:"last-message shared-canvas-container",dir:L.isRtl?"auto":"ltr",children:[o&&(0,N.FD)(N.FK,{children:[(0,N.Y)("span",{className:"sender-name",children:(0,c.A)(o)}),(0,N.Y)("span",{className:"colon",children:":"})]}),!F&&n.forwardInfo&&(0,N.Y)(P.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,N.Y)(P.A,{name:"story-reply",className:"chat-prefix-icon"}),E(n,b,J||V,$)]})}),[e,v,y,$,k,L,n,w,C,J,V,b,A,F,x]);return(0,i.Nf)((()=>{const e=B.current;if(M&&e){if(I===u.I.Opacity)e.style.opacity="0",(0,s.RK)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(I!==u.I.Move)return;e.style.transform=`translate3d(0, ${-S*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=""}))}),D+o.xB5)}}),[M,S,I]),{renderSubtitle:function(){return e?.isForum&&!k?(0,N.Y)(Y,{chat:e,renderLastMessage:q,observeIntersection:b,topics:t}):q()},ref:B}}function E(e,t,n,i){const o=(0,N.Y)(F.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return o;const s=(0,a.y2)(e);return(0,N.FD)("span",{className:"media-preview",children:[(0,N.Y)("img",{src:n,alt:"",className:(0,d.A)("media-preview--image",i&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,N.Y)(P.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(60919),r=n(96454),d=n(60343),c=n(80853),l=n(41733);const u=new Map;let m,h=[],p=[];function g(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const 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,d.ES)(C(s).messageKey));const r=u.get(s);r.onForcePlay&&r.onForcePlay(),m=s,r.audio.src&&(0,l.A)(r.audio)}function f(){const e=m&&u.get(m);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,c.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,c.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||h.includes(t)||(h.push(t),h.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=m&&u.get(m);s&&m!==e&&(s.audio.pause(),s.audio.currentTime=0,(0,c.f)(s.audio)&&(s.audio.dataset.preventPlayAfterPatch="true"),s.onTrackChange&&s.onTrackChange()),m=e,y.src||(y.src=n,y.preload="auto",n.includes("/progressive/")&&r.Yw&&(delete y.dataset.preventPlayAfterPatch,(0,c.C)(y))),(0,l.A)(y),function(e,t){if((0,a.nTw)((0,i.mS)()).globalSearch.currentContent===o.$C.Music)return;const{chatId:n}=(0,d.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&&(h=h.filter(r))}(t,e)},pause(){m===e&&y.pause()},stop(){if(m===e){const e=y.src;y.pause(),(0,s.Uz)((()=>{y.src="",y.src=e}))}},setCurrentTime(t){m===e&&(y.fastSeek?y.fastSeek(t):y.currentTime=t)},setVolume(t){m===e&&(y.volume=t,y.muted=!1)},setPlaybackRate(t){m===e&&(y.playbackRate=t)},toggleMuted(e){y.muted=void 0===e?!y.muted:e},proxy:b,requestNextTrack(){g(e)},isLast:()=>!A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin),isFirst:()=>!A(e,(0,a.nTw)((0,i.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(t=!1){const i=u.get(e);i&&(i.handlers=i.handlers.filter((e=>e!==n)),i.handlers.length||(i.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(h=h.filter(n))}(i,e),e===m&&(m=void 0)))}}}function A(e,t=o.d9.Inline,n){const i=function(e){switch(e.type){case"audio":return p;case"voice":return h;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,d.ES)(C(e).messageKey),a=i.filter((e=>e.startsWith(`msg${s}`))),r=a.indexOf(e);if(r<0)return;let c=t===o.d9.Inline?-1:1;return n&&(c*=-1),a[r+c]}function y(e){const t=(0,d.AD)(e);if(t)return`${t}-${e.date}`}function C(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function w(e,t){if(!e||!t)return 0;const{date:n,messageKey: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(60919),r=n(9716),d=n(4961),c=n(17712),l=n(59030),u=n(64493),m=n(22337),h=n(21849),p=n(20021);const g=(0,i.ph)((0,o.EK)(((e,{chat:t,isSavedDialog:n})=>{const i=(0,r.L8)(t.id),o=(0,a.nZ4)(e,t.id),d=i&&(0,a.mBe)(e,(0,s.e7)(t)),c=d&&(0,s.tv)(d)&&!t.isSupport,l=i&&!o&&!c&&!n,u=i?(0,s.u0)((0,a.mBe)(e,(0,s.e7)(t))):void 0;return{isPrivateChat:i,isChatWithSelf:o,isBot:c,isChannel:(0,s.WX)(t),isBasicGroup:(0,s.yn)(t),isSuperGroup:(0,s.Vs)(t),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:u}}))((({isOpen:e,chat:t,isSavedDialog:n,isChannel:i,isPrivateChat:a,isChatWithSelf:r,isBot:g,isBasicGroup:f,isSuperGroup:v,currentUserId:A,canDeleteForAll:y,contactName:C,onClose:w,onCloseAnimationEnd:b})=>{const{leaveChannel:I,deleteHistory:S,deleteSavedHistory:M,deleteChannel:N,deleteChatUser:k,blockUser:Y,deleteChat:P}=(0,o.ko)(),F=(0,l.A)(),T=(0,s.Js)(F,t),D=(0,c.A)((()=>{S({chatId:t.id,shouldDeleteForAll:!0}),w()})),x=(0,c.A)((()=>{S({chatId:t.id,shouldDeleteForAll:!0}),Y({userId:t.id}),w()})),E=(0,c.A)((()=>{n?M({chatId:t.id}):a?S({chatId:t.id,shouldDeleteForAll:!1}):f?t.isCreator?(S({chatId:t.id,shouldDeleteForAll:!0}),P({chatId:t.id})):(S({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:A})):!i&&!v||t.isCreator?(i||v)&&t.isCreator&&N({chatId:t.id}):I({chatId:t.id}),w()})),L=(0,c.A)((()=>{i||v?(I({chatId:t.id}),w()):f&&t.isCreator?(S({chatId:t.id,shouldDeleteForAll:!1}),k({chatId:t.id,userId:A})):E()}));return(0,p.FD)(m.A,{isOpen:e,className:"DeleteChatModal",header:(0,p.FD)("div",{className:"modal-header",dir:F.isRtl?"rtl":void 0,children:[(0,p.Y)(h.A,{size:"tiny",peer:t,isSavedMessages:r}),(0,p.Y)("h3",{className:"modal-title",children:F(n?r?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":i&&!t.isCreator?"LeaveChannel":i&&t.isCreator?"ChannelDelete":f||v?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:w,onCloseAnimationEnd:b,children:[n?(0,p.Y)("p",{children:(0,d.A)(r?F("ClearHistoryMyNotesMessage"):F("ClearHistoryMessageSingle",T),["simple_markdown","emoji"])}):i&&t.isCreator?(0,p.Y)("p",{children:(0,d.A)(F("ChatList.DeleteAndLeaveGroupConfirmation",T),["simple_markdown","emoji"])}):i&&!t.isCreator||f||v?(0,p.Y)("p",{children:(0,d.A)(F("ChannelLeaveAlertWithName",T),["simple_markdown","emoji"])}):(0,p.Y)("p",{children:(0,d.A)(F("ChatList.DeleteChatConfirmation",C),["simple_markdown","emoji"])}),(0,p.FD)("div",{className:"dialog-buttons-column",children:[g&&!n&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x,children:F("DeleteAndStop")}),y&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:D,children:C?(0,d.A)(F("ChatList.DeleteForEveryone",C)):F("DeleteForAll")}),!a&&t.isCreator&&!n&&(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:F("DeleteForAll")}),(0,p.Y)(u.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:a||n?E:L,children:F(n?"Delete":i&&!t.isCreator?"LeaveChannel":i&&t.isCreator?"Chat.Input.Delete":f||v?"Group.LeaveGroup":y?"ChatList.DeleteForCurrentUser":"Delete")}),(0,p.Y)(u.A,{className:"confirm-dialog-button",isText:!0,onClick:w,children:F("Cancel")})]})]})})))},54639:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(13439),s=n(37661),a=n(17712),r=n(59030),d=n(71429),c=n(24433),l=n(23174),u=n(90709),m=n(87357),h=n(43874),p=n(62587);const g="VGmPJoga";var f=n(20021);const v=/#fff/gi,A=(0,i.ph)((({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,h.Ay)(),o=(0,p.A)((0,u.mr)(e,"full"),!1,l.qZ.Text),s=(0,i.Kr)((()=>{if(!o)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=o.replace(v,e),i=(new DOMParser).parseFromString(n,"image/svg+xml");return i.querySelectorAll("path").forEach((t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"})),`data:image/svg+xml;utf8,${i.documentElement.outerHTML}`}),[o,t]);return(0,f.Y)("i",{className:(0,m.A)("mklnEg0s","icon",!n&&g),children:(0,f.Y)("img",{src:s,alt:"",className:(0,m.A)("tT8KQwg0",!n&&g),draggable:!1})})})),y=(0,i.ph)((({bot:e,theme:t,chatId:n,threadId:l,isInSideMenu:u,canShowNew:m,onMenuOpened:h,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,o.ko)(),y=(0,r.A)(),C=(0,i.Kr)((()=>e.icons.find((({name:e})=>"default_static"===e))?.document),[e.icons]),[w,b,I]=(0,s.A)(),[S,M]=(0,i.J0)(void 0),N=(0,a.A)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),h(),b()})),k=(0,a.A)((()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:l})})),Y=(0,a.A)((()=>{I(),p()})),P=(0,a.A)((()=>{M(void 0)})),F=(0,a.A)((()=>{v({botId:e.id,isEnabled:!1})}));return(0,f.FD)(c.A,{customIcon:C&&(0,f.Y)(A,{icon:C,theme:t}),icon:C?void 0:"bots",onClick:k,onContextMenu:N,children:[e.shortName,m&&e.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:y("New")}),S&&(0,f.Y)(d.A,{isOpen:w,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:Y,onCloseAnimationEnd:P,children:(0,f.Y)(c.A,{icon:"stop",destructive:!0,onClick:F,children:y("WebApp.RemoveBot")})})]},e.id)}))},54699:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(30857),o=n(32625);function s(e){const t=(0,i.A)();(0,o.A)(t,e,!0)}},55153:(e,t,n)=>{n.d(t,{A:()=>u,L:()=>m});var i=n(31481),o=n(87679),s=n(24909);const a=1280,r=2560,d=40,c=20,l=/\.[^/.]+$/;async function u(e,t,c){const m=URL.createObjectURL(t),{type:p,size:g}=t;let f,v,A,y;const C=c?.shouldSendInHighQuality;if(i.gex.has(p)){const n=await(0,o.NN)(m),{width:g,height:v}=n;y=!h(g,v);const w=C?r:a,b=Math.max(g,v)>w,I=p===i.Vz3;if(!y){if(!c?.compressedBlobUrl&&!I&&(b||"image/jpeg"!==p)){const n=await(0,s.s)(m,b?w/Math.max(g,v):1,"image/jpeg");return URL.revokeObjectURL(m),u(e,t,{...c,compressedBlobUrl:n})}"image/jpeg"===p&&(e=e.replace(l,".jpg")),f={width:g,height:v}}A=Math.max(g,v)>d?await(0,s.s)(m,d/Math.max(g,v),"image/jpeg"):m}else if(i.fNs.has(p)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,o.FW)(m);y=!h(e,t),y||(f={width:e,height:t,duration:n})}catch(e){y=!0}A=await(0,o.eT)(m)}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:d,picture:c},format:{duration:l}}=a,u=i(c),m=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:d,duration:l,coverUrl:m?URL.createObjectURL(m):void 0}}(m);v={duration:e||0,title:t,performer:i},A=s}return{blob:t,blobUrl:m,filename:e,mimeType:p,size:g,quick:f,audio:v,previewBlobUrl:A,shouldSendAsFile:y||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...c}}function m(e,t){return e.map((e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!(e.voice||e.audio)||void 0,shouldSendAsSpoiler:void 0}))}function h(e,t){return Math.max(e,t)/Math.min(e,t)<=c}},55317:(e,t,n)=>{function i(e,t){const{level:n,boosts:i,currentLevelBoosts:o,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,d=t&&i===o&&a;return{currentLevel:d?n-1:n,hasNextLevel:Boolean(s),boosts:i,levelProgress:!s||d?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 d=(0,s.L8)(r)?a[r]:n[r];let c=(0,o.F9)(e,d);const l=n[t.chatId];return l&&("isSelf"in d&&d.isSelf?c=`${e("FromYou")} → ${(0,i.Js)(e,l)}`:(0,i.YE)(l)&&(c+=` → ${(0,i.Js)(e,l)}`)),c}},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),d=n(95807),c=n(39751),l=n(90709),u=n(9716),m=n(76023),h=n(82117),p=n(17712),g=n(93545),f=n(11241);const v="pruw1nLm";var A=n(20021);const y=(0,i.ph)((({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:c})=>{const{sendStoryReaction:v}=(0,o.ko)(),y=(0,i.li)(),[C,w]=(0,i.J0)(1.5*m.$),{peerId:b,id:I,views:S}=e,{reactions:M}=S||{},{reaction:N,isDark:k,isFlipped:Y}=t,P=!(0,u.L8)(b),F=`${(0,l.$_)(b,I)}-${n}-${c?"preview":"viewer"}`,T=(0,i.Kr)((()=>M?.find((e=>(0,l.a0)(e.reaction,N)))?.count),[N,M]),D=!c&&Boolean(T)&&P,x=(0,p.A)((()=>{if(!y.current)return;const e=y.current.clientHeight;w(Math.round(.6*e))}));(0,h.A)((([e])=>{Boolean(T)!==Boolean(e)&&x()}),[T]),(0,g.A)(y,x);const E=(0,p.A)((()=>{v({peerId:b,storyId:I,containerId:F,reaction:N})}));return(0,A.FD)("div",{ref:y,className:(0,r.A)(k?"eic2vQ8c":"_7esBA3m",s),style:(0,d.A)(a,`--custom-emoji-size: ${C}px`),onClick:E,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",Y&&"furSXGdL")}),Boolean(C)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",D&&"mFTLUHm2"),reaction:N,containerId:F,size:C,effectSize:4*C,shouldPause:c,shouldLoop:!c}),D&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})}));var C=n(61433),w=n(60919),b=n(48894);const I=e=>Boolean("en-US"===navigator.language)?`${Math.round(9*e/5+32)}°F`:`${Math.round(e)}°C`;var S=n(87412);const M=(0,i.ph)((0,o.EK)(((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}}))((({mediaArea:e,className:t,style:n,restrictedEmoji:o,isPreview:s})=>{const c=(0,i.li)(),[l,u]=(0,i.J0)(0),{temperatureC:m,color:h}=e,f=(0,b.Bz)(h),v=(0,b.vG)(h),y=(0,p.A)((e=>{if(!c.current)return;const t=c.current,n=t.clientHeight,i=Math.round(.7*n);u(i);const o=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${i}px`,"font-size":n/32+"rem"})};if(e)return o;(0,a.RK)(o)}));return(0,i.Nf)((()=>{(0,a.gm)((()=>y(!0)))}),[]),(0,g.A)(c,(()=>y())),(0,A.Y)("div",{ref:c,className:(0,r.A)("KBjMtRUS",t),style:(0,d.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[o&&(0,A.Y)(S.A,{documentId:o.id,size:l,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},o.id),(0,A.Y)("p",{className:"_ke1UBIl",children:I(m)})]})})}))),N=9/16,k=new Set(["channelPost","uniqueGift"]);function Y(e,t){const{x:n,y:i,width:o,height:s,rotation:a,radius:r}=e.coordinates;let c="";if(t&&r&&t>0){const e=t*(o/100),n=t*(s/100);c=Math.min(e,n)*(r/100)+"px"}return(0,d.A)(`left: ${n}%`,`top: ${i}%`,`width: ${o}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,c&&`border-radius: ${c}`)}const P=(0,i.ph)((({story:e,isActive:t,className:n,isStoryPlaying:d})=>{const{openMapModal:l,openUniqueGiftBySlug:u,focusMessage:m,closeStoryViewer:h,openUrl:p}=(0,o.ko)(),g=(0,i.li)(),[f,C]=(0,i.J0)(0),w=(0,c.A)();(0,i.vJ)((()=>{if(!g.current)return;const e=g.current;if(C(e.clientWidth),w.width>s.c2m)return void(0,a.RK)((()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")}));const t=w.width/w.height,n=t<N?e.clientHeight*N:e.clientWidth,i=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)((()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${i}px`)}))}),[t,w]);const b=e.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!t&&"_5HkplWee",n),ref:g,children:b?.map(((n,i)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const e=t&&!k.has(n.type);return(0,A.Y)("div",{className:(0,r.A)(v,e&&"xFjJpeOA"),style:Y(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":l({geoPoint:e.geo});break;case"channelPost":m({chatId:e.channelId,messageId:e.messageId}),h();break;case"url":p({url:e.url});break;case"uniqueGift":u({slug:e.slug})}})(n)})}case"suggestedReaction":return(0,A.Y)(y,{story:e,mediaArea:n,index:i,isPreview:!t,className:v,style:Y(n)},`${n.type}-${i}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:Y(n,f),isPreview:!t||d},`${n.type}-${i}`);default:return}}))})}))},60138:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,i.vJ)((()=>(0,o.yu)(t)),[t])}},61097:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(90709),o=n(84051),s=n(66644),a=n(67054),r=n(87679),d=n(41074),c=n(17712);const l=.1;let u=-1;function m(e,t){return function(e,t=!1){const n=(0,o.li)(),i=(0,o.Kr)((()=>(0,a.A)(d.bP,++u)),[]),m=(0,o.li)(),h=(0,c.A)((async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)((()=>{e.width=n.width,e.height=n.height,m.current=e.transferControlToOffscreen();const o=Math.ceil(Math.min(n.width,n.height)*l);(0,d.M1)({name:"offscreen-canvas:blurThumb",args:[m.current,t,o],transferables:[m.current]},i)}))}));return(0,o.Nf)((()=>{if(!e||t||m.current)return;const i=n.current;i&&h(i,e)}),[h,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(60919),a=n(71331),r=n(87357),d=n(14),c=n(59030),l=n(48885),u=n(26875),m=n(64493),h=n(20021);const p=(0,i.ph)((0,o.EK)(((e,{chatId:t})=>{const n=(0,s.hds)(e,t),i=(0,a.mD)(e,t);return{groupCall:i,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==i?.id&&Boolean(i?i.participantsCount>0&&i.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}}))((({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,o.ko)(),g=(0,c.A)(),f=(0,i.hb)((()=>{p({chatId:e})}),[p,e]),v=s?.participants,A=(0,i.Kr)((()=>{if(!v)return[];const e=(0,o.mS)().users.byId,t=(0,o.mS)().chats.byId;return Object.values(v).slice(0,3).map((({id:n})=>e[n]||t[n])).filter(Boolean)}),[v]),y=(0,d.A)(s?.participantsCount,!0),C=(0,d.A)(A,!0),w=Boolean(s&&t),{ref:b,shouldRender:I}=(0,l.A)({isOpen:w,onStateChange:a});if(I)return(0,h.FD)("div",{ref:b,className:(0,r.A)("GroupCallTopPane",n),onClick:f,children:[(0,h.FD)("div",{className:"info",children:[(0,h.Y)("span",{className:"title",children:g("VoipGroupVoiceChat")}),(0,h.Y)("span",{className:"participants",children:g("Participants",y??0,"i")})]}),Boolean(C?.length)&&(0,h.Y)(u.A,{size:"small",peers:C,className:"avatars"}),(0,h.Y)(m.A,{round:!0,className:"join",children:g("VoipChatJoin")})]})})))},63988:(e,t,n)=>{n.d(t,{D7:()=>c,aG:()=>r,gs:()=>a,tF:()=>d});var i=n(16581),o=n(83414),s=n(672);function a(e,t,n,i=!1){return(0,s.A)((t=>{t(e())}),t,n,i)}function r(e,t,n=!1){const i=a((()=>e()),[e],t,n);return(0,o.A)(i,[i,e],!0)}function d(e,t,n,o=!1,s=!1){return(0,i.A)((t=>{t(e())}),t,n,o,s)}function c(e,t,n=!1,i=!1){const s=d((()=>e()),[e],t,n,i);return(0,o.A)(s,[s,e],!0)}},64154:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(37836);const a=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:c,text:l}=r||{};return(0,i.vJ)((()=>{t&&n&&!l&&void 0===c&&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})),d()}(t,n,s)}),[t,l,c,n,s]),t&&n?{isPending:c,translatedText:l}:{isPending:!1,translatedText:void 0}}const d=(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&&d()}),500)},64520:(e,t,n)=>{n.d(t,{B:()=>a,d:()=>s});var i=n(31481),o=n(19926);function s(e,t){const{appConfig:n}=e;if(!n)return i.dR$[t][0];const s=(0,o.g2)(e),{limits:a}=n,r=a[t]?.[s?1:0]??i.dR$[t][s?1:0];return"dialogFilters"===t?r+1:r}function a(e,t){const{appConfig:n}=e;if(!n)return i.dR$[t][1];const{limits:o}=n;return o[t][1]}},65240:(e,t,n)=>{n.d(t,{Ay:()=>B});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(60919),c=n(56494),l=n(53827),u=n(87357),m=n(50442),h=n(17663),p=n(58443),g=n(91525),f=n(4961),v=n(43874),A=n(88792),y=n(71533),C=n(17712),w=n(62587),b=n(69419),I=n(59030),S=n(50680),M=n(64493),N=n(96530),k=n(35913),Y=n(4438),P=n(18276),F=n(20021);const T=window.matchMedia("(max-width: 375px)"),D=window.matchMedia("(max-width: 410px)");function x(e,t,n,i,o,s,a,r,d,c,l){const{title:u,performer:m,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,h.QO)(n*o,n)}),L(o,s,a)]}),!v&&r&&(0,F.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[c?`${(0,g.zV)(t.size*c)} / `: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,h.QO)(n)}),m&&(0,F.FD)(F.FK,{children:[(0,F.Y)("span",{className:"bullet",children:"•"}),(0,F.Y)("span",{className:"performer",dir:"auto",title:m,children:(0,f.A)(m)})]}),Boolean(d)&&(0,F.FD)(F.FK,{children:[(0,F.Y)("span",{className:"bullet",children:"•"}),(0,F.Y)(N.A,{className:"date",onClick:l,children:(0,h.fS)(e,1e3*d,!0)})]})]})]})}function E(e,t,n,i,o,s,r,d,c,l,m,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})}),l&&(0,F.FD)(M.A,{onClick:()=>{(d||c)&&m?m(!r):s||l()},children:[(0,F.Y)(P.A,{name:d||c?"down":"transcribe",className:(0,u.A)("transcribe-icon",(d||c)&&!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,h.QO)(e.duration):(0,h.QO)(e.duration*i)})]})}function L(e,t,n){return(0,F.FD)("div",{className:"seekline",ref:n,children:[t.map((({start:e,end:t})=>(0,F.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`}))),(0,F.Y)("span",{className:"seekline-play-progress",children:(0,F.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,F.Y)("span",{className:"seekline-thumb",children:(0,F.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const B=(0,i.ph)((0,o.EK)(((e,{message:t})=>({webPage:(0,d.Pn$)(e,t),mediaDuration:(0,c.Y9)(e,t)})))((({theme:e,message:t,senderTitle:n,uploadProgress:d,origin:c,date:g,noAvatars:B,className:R,isSelectable:O,isSelected:U,isDownloading:K,isTranscribing:z,isTranscriptionHidden:V,isTranscribed:j,isTranscriptionError:J,canDownload:$,canTranscribe:q,autoPlay:H,webPage:G,mediaDuration:W,onHideTranscription:_,onPlay:Q,onPause:Z,onReadMedia:X,onCancelUpload:ee,onDateClick:te})=>{const{cancelMediaDownload:ne,downloadMedia:ie,transcribeAudio:oe,openOneTimeMediaModal:se}=(0,o.ko)(),{content:{audio:ae,voice:re,video:de},isMediaUnread:ce}=t,le=ae||(0,r.y3)(G),ue=re||de||le,me=re||de,he=Boolean(re||de),pe=(0,i.li)(!1),ge=(0,i.li)(),fe=(0,I.A)(),{isRtl:ve}=fe,{isMobile:Ae}=(0,v.Ay)(),[ye,Ce]=(0,i.J0)(!1),we=ye||!0,be=(0,r.VO)(ue,"pictogram"),Ie=(0,w.A)(be,!1,s.qZ.BlobUrl),Se=(0,r.G5)(t),Me=c===a.d9.OneTimeModal,Ne=he?Se?"oneTimeVoice":"voice":"audio",ke=(0,w.A)((0,r.VO)(ue,"inline"),!we,(0,r.Cz)(ue,"inline")),{loadProgress:Ye}=(0,b.A)((0,r.VO)(ue,"download"),!K,(0,r.Cz)(ue,"download")),Pe=(0,C.A)((()=>{Ce(!0),Q?.(t.id,t.chatId)})),Fe=(0,C.A)((()=>{Ce(!1)})),{isBuffered:Te,bufferedRanges:De,bufferingHandlers:xe,checkBuffering:Ee}=(0,y.A)(),Le=Me,{isPlaying:Be,playProgress:Re,playPause:Oe,setCurrentTime:Ue,duration:Ke}=(0,A.A)((0,l.dj)(t),W,Ne,ke,xe,void 0,Ee,Boolean(ye||H),Pe,Fe,(0,r.Nb)(t)||Se,void 0,Z,Le,Se&&!Me),ze=1-Re,Ve=(0,r.Ie)(t),je=Se&&Me,Je=function(e,t,n=0,o=!1,s=!1,a=!1,r=!1){const d=(0,i.li)(),{data:c,peak:l}=(0,i.Kr)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:i,MAX_SPIKES:o}=function(e,t){return{MIN_SPIKES:e?T.matches?16:20:25,MAX_SPIKES:e?T.matches?35:t&&D.matches?40:45:75}}(a,s),r=Math.min(n/10,1),d=Math.round(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),d=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;i[r]=d,n<d&&(n=d)}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)),d)}),[a,t,s])||{};return(0,i.Nf)((()=>{const t=d.current;t&&c&&void 0!==l&&function(e,t,n,{peak:i,fillStyle:o,progressFillStyle:s}){const a=4*t.length;e.width=2*a,e.height=46,e.style.width=`${a}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach(((e,a)=>{r.globalAlpha=a/t.length>=n?.5:1,r.fillStyle=n>a/t.length?s:o;const d=Math.max(2,e/Math.max(1,i)*23);!function(e,t,n,i,o,s){2<2*s&&(s=1),o<2*s&&(s=o/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-o,s),e.arcTo(t+2,n-o,t,n-o,s),e.arcTo(t,n-o,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+d)/2,0,d,1),r.fill()}))}(t,c,r?1-n:n,{peak:l,fillStyle:o?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:o?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[o,l,n,c,e,r]),d}(e,me,!ce||Ve||je?Re:1,Ve,!B,Ae,je),$e=Be||Re>0&&Re<1;(0,i.vJ)((()=>{Ce(Be)}),[Be]);const qe=ye&&!Te,{isUploading:He,isTransferring:Ge,transferProgress:We}=(0,r.LK)(d||Ye,qe||K,void 0!==d),{shouldRender:_e,transitionClassNames:Qe}=(0,S.A)(Ge),Ze=_e&&(qe||He),Xe=(0,C.A)((()=>{if(He)ee?.();else{if(Se)return se({message:t}),void X?.();Be||Q?.(t.id,t.chatId),(0,o.ko)().setAudioPlayerOrigin({origin:c}),Ce(!ye),Oe()}}));(0,i.vJ)((()=>{X&&ce&&Be&&X()}),[Be,ce,X]);const et=(0,C.A)((()=>{K?ne({media:ue}):ie({media:ue,originMessage:t})})),tt=(0,C.A)((e=>{if(pe.current&&ge.current){const{width:t,left:n}=ge.current.getBoundingClientRect(),i=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ue(Math.max(Math.min(Ke*((i-n)/t),Ke-.1),.001))}})),nt=(0,C.A)((e=>{e instanceof MouseEvent&&2===e.button||(pe.current=!0,tt(e))})),it=(0,C.A)((()=>{pe.current=!1})),ot=(0,C.A)((()=>{te(t)})),st=(0,C.A)((()=>{oe({chatId:t.chatId,messageId:t.id})}));function at(){if(he)return n||"Voice";const{title:e,fileName:t}=le;return e||t}function rt(){if(he)return(0,F.Y)("div",{className:"meta",dir:ve?"rtl":void 0,children:(0,h.QO)((re||de).duration)});const{performer:e}=le;return(0,F.FD)("div",{className:"meta",dir:ve?"rtl":void 0,children:[(0,h.QO)(Ke),(0,F.Y)("span",{className:"bullet",children:"•"}),e&&(0,F.Y)("span",{className:"performer",title:e,children:(0,f.A)(e)}),e&&n&&(0,F.Y)("span",{className:"bullet",children:"•"}),n&&(0,F.Y)("span",{title:n,children:(0,f.A)(n)})]})}(0,i.vJ)((()=>{if(ge.current&&$e&&!Me)return(0,m.wJ)(ge.current,{onCapture:nt,onRelease:it,onClick:it,onDrag:tt})}),[$e,nt,tt,it,Me]);const dt=(0,u.A)("Audio",R,Me&&"non-interactive",c===a.d9.Inline&&"inline",Ve&&c===a.d9.Inline&&"own",(c===a.d9.Search||c===a.d9.SharedMedia)&&"bigger",U&&"audio-is-selected"),ct=["toogle-play-wrapper"];Ze?ct.push("loading"):ct.push(Be?"pause":"play");const lt=(0,u.A)("content",$e&&"with-seekline");function ut(){return(0,F.FD)("div",{className:lt,children:[(0,F.FD)("div",{className:"content-row",children:[(0,F.Y)("p",{className:"title",dir:"auto",title:at(),children:(0,f.A)(at())}),(0,F.Y)("div",{className:"message-date",children:Boolean(g)&&(0,F.Y)(N.A,{className:"date",onClick:ot,children:(0,h.be)(fe,1e3*g)})})]}),$e&&(0,F.FD)("div",{className:"meta search-result",dir:ve?"rtl":void 0,children:[(0,F.Y)("span",{className:"duration with-seekline",dir:"auto",children:Re<1&&(0,h.QO)(Ke*Re,Ke)}),L(Re,De,ge)]}),!$e&&rt()]})}return(0,F.FD)("div",{className:dt,dir:fe.isRtl?"rtl":"ltr",children:[O&&(0,F.Y)("div",{className:"message-select-control no-selection",children:U&&(0,F.Y)(P.A,{name:"select"})}),(0,F.FD)("div",{className:(0,u.A)(...ct),children:[(0,F.FD)(M.A,{round:!0,ripple:!Ae,size:"smaller",className:"toggle-play",color:Ie?"translucent-white":"primary",ariaLabel:Be?"Pause audio":"Play audio",onClick:Xe,isRtl:fe.isRtl,backgroundImage:Ie,nonInteractive:Me,children:[!Me&&(0,F.Y)(P.A,{name:"play"}),!Me&&(0,F.Y)(P.A,{name:"pause"}),Me&&(0,F.Y)(Y.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Se&&!Me&&(0,F.Y)(P.A,{name:"view-once"})]}),_e&&(0,F.Y)("div",{className:(0,u.A)("media-loading",Qe,Ze&&"interactive"),children:(0,F.Y)(k.A,{progress:We,transparent:!0,withColor:!0,size:"m",onClick:Ze?Xe:void 0,noCross:!Ze})}),Me&&!_e&&(0,F.Y)("div",{className:(0,u.A)("media-loading"),children:(0,F.Y)(k.A,{progress:Re,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),le&&$&&!He&&(0,F.Y)(M.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:K?"Cancel download":"Download",onClick:et,children:(0,F.Y)(P.A,{name:K?"close":"arrow-down"})}),c===a.d9.Search&&ut(),c!==a.d9.Search&&le&&x(fe,le,Ke,Be,Re,De,ge,K||He,g,We,te?ot:void 0),c===a.d9.SharedMedia&&me&&ut(),(c===a.d9.Inline||Me||j)&&me&&E(me,ge,Je,Se?ze:Re,ce,z,V,j,J,q?st:void 0,_,c)]})})))},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991:(e,t,n)=>{n.d(t,{Y:()=>u,c:()=>m});var i=n(84051),o=n(31481),s=n(66644),a=n(19822),r=n(39761),d=n(96454),c=n(95704);const l=100;function u(e,t,n){return(0,i.vJ)((()=>{if(!t||!e.current)return;const i=g(),o=e.current;if(!d.Yw||!n||!i?.isTypeSupported(n))return;const u=new i;function m(){if(!t||!n)return;const e=u.addSourceBuffer(n),i=(0,c.h)(t);e.addEventListener("updateend",(function(){i.next().then((({value:t,done:n})=>{"open"===u.readyState&&(n?p(u):h(e,t))}))})),i.next().then((({value:t,done:n})=>{n||"open"!==u.readyState||((0,s.RK)((()=>{o.style.display="block",setTimeout((()=>{(0,s.RK)((()=>{(0,a.ZM)(o,{opacity:"1"})}))}),l)})),h(e,t))}))}return u.addEventListener("sourceopen",m,{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",m),"open"===u.readyState&&p(u),URL.revokeObjectURL(e)}))}}),[n,t,e]),m(n)}function m(e){return!(!d.Yw||!e)&&Boolean(g()?.isTypeSupported(e))}function h(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(60919),a=n(96454),r=n(58554),d=n(37836),c=n(63527),l=n(30857),u=n(14745);const m=.75,h=1500,p=500;function g(e,t=!1,n=o.qZ.BlobUrl,g,f=!1){const v=e?r.Ih(e):void 0,A=a.Uz&&n===o.qZ.Progressive,y=(0,l.A)(),C=(0,c.A)(s.nIz),w=(0,u.A)(),[b,I]=(0,i.J0)(v&&!A?1:0),S=(0,i.li)(),M=(0,i.Kr)((()=>(0,d.nF)((e=>{S.current&&(!g||Date.now()-S.current>g)&&I(e)}),p,!0)),[g]);return(0,i.vJ)((()=>{!t&&e&&(v?A&&setTimeout((()=>{I(m)}),h):(I(0),S.current&&r.ch(M),S.current=Date.now(),r.hd(e,n,f,M,w).then((()=>{const e=Date.now()-S.current;S.current=void 0,!g||e>=g?y():setTimeout(y,g-e)}))))}),[t,e,v,n,A,g,M,f,w,C]),(0,i.vJ)((()=>{t&&S.current&&(r.ch(M),I(0),S.current=void 0)}),[M,t]),(0,i.vJ)((()=>()=>{e&&r.Cn(e,w)}),[w,e]),{mediaData:v,loadProgress:b}}},70195:(e,t,n)=>{n.d(t,{A:()=>j});var i=n(84051),o=n(13439),s=n(89925),a=n(90709),r=n(60919),d=n(96454),c=n(87357),l=n(50442),u=n(79824),m=n(4961),h=n(54699),p=n(39351),g=n(17712),f=n(59030),v=n(73767),A=n(23174),y=n(58554),C=n(41036),w=n(21849),b=n(34431),I=n(9716),S=n(14242),M=n(35049),N=n(43874),k=n(45470),Y=n(37661),P=n(62587),F=n(83057),T=n(65843),D=n(57474),x=n(18276),E=n(20021);const L=(0,i.ph)((({chat:e,user:t,photo:n,isSavedMessages:o,isSavedDialog:s,canPlayVideo:r,onClick:l})=>{const u=(0,i.li)(),h=(0,f.A)(),{isMobile:p}=(0,N.Ay)(),g=t&&(0,a.PL)(t),v=e&&(0,a.kE)(e.id),A=e&&(0,a.Qe)(e.id),y=t||e,C=y&&!o&&!g&&!v&&!A,{isVideo:w}=n||{},b=(!n||n.id===y.avatarPhotoId)&&(0,a.cP)(y,"normal"),L=C&&n&&!b&&(0,a.rI)(n,"pictogram"),B=(0,P.A)(L||b),R=C&&n&&!w&&(0,a.mU)(n),O=(0,P.A)(R),U=C&&n&&w&&(0,a.Pg)(n),K=(0,P.A)(U)||O,[z,V]=(0,Y.A)(),j=Boolean(K&&(!w||z)),J=(0,F.A)(j),$=C&&!j&&!B&&n?.thumbnail?.dataUri,q=(0,k.A)(n?.thumbnail?.dataUri,!$,p&&!d.QH),H=n||B||$;(0,i.vJ)((()=>{u.current&&!r&&(u.current.currentTime=0)}),[r]);const G=(0,i.Kr)((()=>o?s?"my-notes":"avatar-saved-messages":g?"avatar-deleted-account":v?"reply-filled":A?"author-hidden":void 0),[A,g,s,v,o]);let W;if(G)W=(0,E.Y)(x.A,{name:G,role:"img"});else if(H)W=(0,E.FD)(E.FK,{children:[$?(0,E.Y)("canvas",{ref:q,className:"thumb"}):(0,E.Y)("img",{src:B,draggable:!1,className:"thumb",alt:""}),n&&(w?(0,E.Y)(T.A,{canPlay:r,ref:u,src:K,className:(0,c.A)("avatar-media",J),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:V}):(0,E.Y)("img",{src:K,className:(0,c.A)("avatar-media",J),alt:""}))]});else if(t){const e=(0,a.Yg)(t);W=e?(0,S.Qh)(e,2):void 0}else if(e){const t=(0,a.Js)(h,e);W=t&&(0,S.Qh)(t,(0,I.L8)(e.id)?2:1)}else W=(0,E.Y)("div",{className:"spinner-wrapper",children:(0,E.Y)(D.A,{color:"white"})});const _=(0,c.A)("ProfilePhoto",(0,M.y)(y),o&&"saved-messages",A&&"anonymous-forwards",g&&"deleted-account",v&&"replies-bot-account",!o&&!H&&"no-photo");return(0,E.Y)("div",{className:_,onClick:H?l:void 0,children:"string"==typeof W?(0,m.A)(W,["hq_emoji"]):W})}));var B=n(38102);const R="Wm9Ygb23",O="nflKKT3R",U="tFkRrvxe",K="GBGLnrA7",z="ZZRcBh8v",V="cpyXyZDl",j=(0,i.ph)((0,o.EK)(((e,{peerId:t})=>{const n=(0,r.mBe)(e,t),i=(0,r.K0y)(e,t),o=(0,r.hds)(e,t),s=(0,r.IVq)(e,t),{mediaIndex:a,chatId:d}=(0,r.nTw)(e).mediaViewer,c=o?.isForum,{threadId:l}=(0,r.Xf0)(e)||{},u=c&&l?(0,r.S0q)(e,t,l):void 0,m=(n||o)?.emojiStatus;return{user:n,userStatus:i,chat:o,mediaIndex:a,avatarOwnerId:d,emojiStatusSticker:m?e.customEmojis.byId[m.documentId]:void 0,emojiStatusSlug:"collectible"===m?.type?m.slug:void 0,profilePhotos:s,...u&&{topic:u,messagesCount:(0,r.QbG)(e,t,l)}}}))((({forceShowSelf:e,canPlayVideo:t,user:n,userStatus:r,chat:I,mediaIndex:S,avatarOwnerId:M,topic:N,messagesCount:k,emojiStatusSticker:Y,emojiStatusSlug:P,profilePhotos:F,peerId:T,isForMonoforum:D})=>{const{openMediaViewer:x,openPremiumModal:j,openStickerSet:J,openPrivacySettingsNoticeModal:$,loadMoreProfilePhotos:q,openUniqueGiftBySlug:H}=(0,o.ko)(),G=(0,f.A)(),W=(0,p.A)();(0,h.A)(n?6e4:void 0);const _=F?.photos||u.p,Q=(0,v.A)(S),Z=(0,v.A)(M),[X,ee]=(0,i.J0)(!0),te=X?G.isRtl?"slideRtl":"slide":"none",[ne,ie]=(0,i.J0)(0),oe=_.length<=1||0===ne,se=_.length<=1||ne===_.length-1;(0,i.vJ)((()=>{_.length-ne<=3&&q({peerId:T})}),[ne,T,_.length]),(0,i.vJ)((()=>{Z&&void 0!==Q&&void 0===S&&(ee(!1),ie(Q))}),[S,Q,Z]),(0,i.vJ)((()=>{ne>_.length&&(ee(!1),ie(Math.max(0,_.length-1)))}),[ne,_.length]),function(e,t){(0,i.vJ)((()=>{e.slice(t,t+4).forEach((e=>{const t=(0,a.mU)(e);y.Ih(t)||y.hd(t,A.qZ.BlobUrl)}))}),[t,e])}(_,ne);const ae=(0,g.A)((()=>{x({isAvatarView:!0,chatId:T,mediaIndex:ne,origin:e?s.TQ.SettingsAvatar:s.TQ.ProfileAvatar})})),re=(0,g.A)((()=>{P?H({slug:P}):T?j({fromUserId:T}):J({stickerSetInfo:Y.stickerSetInfo})})),de=(0,g.A)((()=>{oe||(ee(!0),ie(ne-1))})),ce=(0,g.A)((()=>{se||(ee(!0),ie(ne+1))})),le=(0,g.A)((()=>{$({chatId:I.id,isReadDate:!1})}));if((0,i.vJ)((()=>{const e=document.querySelector(`.${K}`);if(e)return(0,l.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:d.TF?(e,t)=>t===l.ez.Right?(de(),!0):t===l.ez.Left&&(ce(),!0):void 0})}),[ce,de]),n||I)return N?(0,E.FD)("div",{className:"yzg267rr",children:[(0,E.Y)(B.A,{topic:N,size:120,className:"ZCxp0_t4",letterClassName:"lkfZNWOm",noLoopLimit:!0}),(0,E.Y)("h3",{className:"umOuiu3K",dir:G.isRtl?"rtl":void 0,children:(0,m.A)(N.title)}),(0,E.Y)("p",{className:"tLTzQ2ks",children:k?G("Chat.Title.Topic",k,"i"):G("lng_forum_no_messages")})]}):(0,E.FD)("div",{className:(0,c.A)("ProfileInfo"),dir:G.isRtl?"rtl":void 0,children:[(0,E.FD)("div",{className:K,children:[function(){const e=Math.max(_.length,F?.count||0);if(!_||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=ne>=30?29:ne;return(0,E.Y)("div",{className:"uyvKpR3B",children:t.map(((e,t)=>(0,E.Y)("span",{className:(0,c.A)("wB4yjvei",t===n&&"aZmp9FLh")})))})}(),!e&&F?.personalPhoto&&(0,E.Y)("div",{className:(0,c.A)(R,oe&&U),children:(0,E.Y)("div",{className:O,children:G(F.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),e&&F?.fallbackPhoto&&(0,E.Y)("div",{className:(0,c.A)(R,(oe||se)&&U),children:(0,E.FD)("div",{className:O,onClick:function(){oe&&(ee(!0),ie(_.length-1))},children:[!se&&(0,E.Y)(w.A,{photo:F.fallbackPhoto,className:"R7w3H5eC",size:"mini"}),G(F.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,E.Y)(C.Ay,{activeKey:ne,name:te,children:function(e){const i=_.length>0?_[ne]:void 0;return(0,E.Y)(L,{user:n,chat:I,photo:i,canPlayVideo:Boolean(e&&t),onClick:ae},ne)}}),!oe&&(0,E.Y)("button",{type:"button",dir:G.isRtl?"rtl":void 0,className:(0,c.A)(z,"RQITz4WQ"),"aria-label":G("AccDescrPrevious"),onClick:de}),!se&&(0,E.Y)("button",{type:"button",dir:G.isRtl?"rtl":void 0,className:(0,c.A)(z,"_0F1Txru"),"aria-label":G("Next"),onClick:ce})]}),(0,E.FD)("div",{className:"UcyW7tVh",dir:G.isRtl?"rtl":"auto",children:[(n||I)&&(0,E.Y)(b.A,{peer:n||I,withEmojiStatus:!0,emojiStatusSize:24,onEmojiStatusClick:re,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,a.Qe)(T),t=(0,a.DX)(T);if(!e&&!t)return D?(0,E.Y)("span",{className:(0,c.A)(V,"status"),dir:"auto",children:W("MonoforumStatus")}):n?(0,E.FD)("div",{className:(0,c.A)(V,"status",(0,a.PF)(n,r)&&"online"),children:[(0,E.Y)("span",{className:"_HDVUj4P",dir:"auto",children:(0,a.CD)(G,n,r)}),r?.isReadDateRestrictedByMe&&(0,E.Y)("span",{className:"Qga38M20",onClick:le,children:(0,E.Y)("span",{children:G("StatusHiddenShow")})})]}):(0,E.Y)("span",{className:(0,c.A)(V,"status"),dir:"auto",children:(0,a.WX)(I)?G("Subscribers",I.membersCount??0,"i"):G("Members",I.membersCount??0,"i")})}()]})]})})))},71331:(e,t,n)=>{n.d(t,{Ip:()=>r,O7:()=>m,iT:()=>l,mD:()=>a,n5:()=>d,qI:()=>c,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 d(e,t,n){return r(e,t)?.participants[n]}function c(e){const t=l(e)?.chatId;if(!t)return!1;const n=(0,o.hd)(e,t);return!!n&&((0,i.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function l(e){const{groupCalls:{activeGroupCallId:t}}=e;if(t)return r(e,t)}function u(e){const{phoneCall:t,currentUserId:n}=e;if(!t||!t.participantId||!t.adminId)return;const i=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,i)}function m(e){const t=l(e);if(!t||!t.chatId)return!1;const n=(0,o.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,i.Kl)(n)))return!0;const s=(0,o.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(84051),o=n(87357),s=n(17663),a=n(14242),r=n(39351),d=n(59030),c=n(18276);const l="gvrp3KoR",u="IHb3ZATQ",m="zAPFdKbZ";var h=n(20021);const p=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],g=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],f=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],v=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],A=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],y=(0,i.ph)((({title:e,type:t,statistics:n,isToncoin:i,className:y,subtitle:C})=>{const w=(0,d.A)(),b=(0,r.A)(),I=({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return(0,h.FD)("span",{className:(0,o.A)("idLrmbhS",n&&"SLfwGHQC"),children:[n?`-${(0,a.Vw)(b,Math.abs(e))}`:`+${(0,a.Vw)(b,e)}`,t&&(0,h.FD)(h.FK,{children:[" ","(",t,"%)"]})]})},S=(e,t,n)=>{const[i,o]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,h.FD)("div",{children:[(0,h.Y)(c.A,{className:"it39BC_c",name:"toncoin"}),(0,h.FD)("b",{className:m,children:[i,(0,h.FD)("span",{className:"ZAfXkuWL",children:[".",o]})]})," ",(0,h.FD)("span",{className:u,children:["≈ $",s,(0,h.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,h.Y)("h3",{className:u,children:w(n)})]})},{period:M}=n,{balances:N,usdRate:k}=n,Y=function(e){switch(e){case"group":return g;case"message":return f;case"boost":return A;case"story":return v;default:return p}}(t);return(0,h.FD)("div",{className:(0,o.A)("Gi8Nokbl",y),children:[(0,h.FD)("div",{className:"H01lE7mv",children:[e&&(0,h.Y)("div",{className:"VQbs04hT",children:e}),M&&(0,h.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(w,1e3*M.minDate)," ","—",(0,s.Lu)(w,1e3*M.maxDate)]})]}),(0,h.Y)("table",{className:"s5beXqqL",children:i?(0,h.Y)("tr",{children:(0,h.FD)("td",{className:l,children:[S(N?.availableBalance||0,k||0,"lng_channel_earn_available"),S(N?.currentBalance||0,k||0,"lng_channel_earn_reward"),S(N?.overallRevenue||0,k||0,"lng_channel_earn_total")]})}):Y.map((e=>(0,h.Y)("tr",{children:e.map((e=>{const t=n[e.name];return e.isPlain?(0,h.FD)("td",{className:l,children:[(0,h.Y)("b",{className:m,children:`${e.isApproximate?"≈":""}${(0,a.Sm)(t)}`}),(0,h.Y)("h3",{className:u,children:w(e.title)})]}):e.isPercentage?(0,h.FD)("td",{className:l,children:[e.withAbsoluteValue&&(0,h.Y)("span",{className:m,children:`${e.isApproximate?"≈":""}${(0,a.Sm)(t.part)}`}),(0,h.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":m,children:[t.percentage,"%"]}),(0,h.Y)("h3",{className:u,children:w(e.title)})]}):(0,h.FD)("td",{className:l,children:[(0,h.Y)("b",{className:m,children:(0,a.Vw)(b,t.current)})," ",I(t),(0,h.Y)("h3",{className:u,children:w(e.title)})]})}))})))}),C]})}))},72078:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},73172:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(84051),o=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,i.Kr)((()=>(0,a.nF)((n=>{e&&t&&(0,o.ko)().sendMessageAction({chatId:e,threadId:t,action:n})}),s.cqp)),[e,t])},75343:(e,t,n)=>{n.d(t,{A:()=>b});var i=n(84051),o=n(13439),s=n(87357),a=n(43874),r=n(36838),d=n(59030),c=n(89925),l=n(70636),u=n(9716),m=n(54464),h=n(10722),p=n(17712),g=n(92111),f=n(21849),v=n(71429),A=n(24433),y=n(2429),C=n(20021);const w=(0,i.ph)((function({peer:e,isArchived:t}){const{openChat:n,openChatWithInfo:a,openStoryViewer:r,toggleStoriesHidden:w}=(0,o.ko)(),b=(0,d.A)(),I=(0,i.li)(),S="isSelf"in e&&e.isSelf,M=!(0,u.L8)(e.id);(0,g.A)(e.id);const{isContextMenuOpen:N,contextMenuAnchor:k,handleBeforeContextMenu:Y,handleContextMenu:P,handleContextMenuClose:F,handleContextMenuHide:T}=(0,h.A)(I),D=(0,p.A)((()=>I.current)),x=(0,p.A)((()=>document.body)),E=(0,p.A)((()=>I.current.querySelector(".story-peer-context-menu .bubble"))),L=(0,p.A)((()=>({withPortal:!0,isDense:!0}))),B=(0,p.A)((()=>{N||r({peerId:e.id,origin:c.G9.StoryRibbon})})),R=(0,p.A)((e=>{(0,m.u)(e),Y(e)})),O=(0,p.A)((()=>{a({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})})),U=(0,p.A)((()=>{a({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),K=(0,p.A)((()=>{n({id:e.id,shouldReplaceHistory:!0})})),z=(0,p.A)((()=>{a({id:e.id,shouldReplaceHistory:!0})})),V=(0,p.A)((()=>{w({peerId:e.id,isHidden:!t})}));return(0,C.FD)("div",{ref:I,role:"button","data-peer-id":e.id,tabIndex:0,className:y.A.peer,onMouseDown:R,onClick:B,onContextMenu:P,children:[(0,C.Y)(f.A,{peer:e,withStory:!0,storyViewerOrigin:c.G9.StoryRibbon,storyViewerMode:"full"}),(0,C.Y)("div",{className:(0,s.A)(y.A.name,e.hasUnreadStories&&y.A.name_hasUnreadStory),children:S?b("MyStory"):(0,l.F9)(b,e)}),void 0!==k&&(0,C.Y)(v.A,{isOpen:N,anchor:k,getTriggerElement:D,getRootElement:x,getMenuElement:E,getLayout:L,className:(0,s.A)("story-peer-context-menu",y.A.contextMenu),autoClose:!0,withPortal:!0,onClose:F,onCloseAnimationEnd:T,children:S?(0,C.FD)(C.FK,{children:[(0,C.Y)(A.A,{onClick:O,icon:"play-story",children:b("StoryList.Context.SavedStories")}),(0,C.Y)(A.A,{onClick:U,icon:"archive",children:b("StoryList.Context.ArchivedStories")})]}):(0,C.FD)(C.FK,{children:[!M&&(0,C.Y)(A.A,{onClick:K,icon:"message",children:b("SendMessageTitle")}),M?(0,C.Y)(A.A,{onClick:z,icon:"channel",children:b("ChatList.ContextOpenChannel")}):(0,C.Y)(A.A,{onClick:z,icon:"user",children:b("StoryList.Context.ViewProfile")}),(0,C.Y)(A.A,{onClick:V,icon:t?"unarchive":"archive",children:b(t?"StoryList.Context.Unarchive":"StoryList.Context.Archive")})]})})]})})),b=(0,i.ph)((0,o.EK)(((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:i}}=e.stories;return{orderedPeerIds:t?i:n,usersById:e.users.byId,chatsById:e.chats.byId}}))((function({isArchived:e,className:t,orderedPeerIds:n,usersById:o,chatsById:c,isClosing:l}){const u=(0,d.A)(),m=(0,s.A)(y.A.root,!n.length&&y.A.hidden,l&&y.A.closing,t,"no-scrollbar"),h=(0,i.li)();return(0,r.A)(h,(0,a.Ny)()),(0,C.Y)("div",{ref:h,id:"StoryRibbon",className:m,dir:u.isRtl?"rtl":void 0,children:n.map((t=>{const n=o[t]||c[t];if(n)return(0,C.Y)(w,{peer:n,isArchived:e},t)}))})})))},78407:(e,t,n)=>{n.d(t,{A:()=>G});var i=n(84051),o=n(13439),s=n(31481),a=n(66644),r=n(60919),d=n(30708),c=n(96454),l=n(87357),u=n(52674),m=n(14680),h=n(17237),p=n(36353),g=n(37836),f=n(4961),v=n(11359),A=n(43874),y=n(19129),C=n(37661),w=n(17712),b=n(59030),I=n(88458),S=n(41733);class M{isPlaying=!1;constructor(e,t,n){this.container=t,this.options=n,this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,a.RK)((()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()}))}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,S.A)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,a.YS)((()=>{if(!this.video)return;const i=this.video,{width:o,height:s}=this.container.getBoundingClientRect();(0,a.RK)((()=>{i.style.left=`${Math.round(t*o)}px`,i.style.top=`${Math.round(n*s)}px`,i.style.width=`${e}px`,i.style.height=`${e}px`}))}))}}var N=n(60261),k=n(43336),Y=n(71322),P=n(76023),F=n(37479),T=n(87094),D=n(82117),x=n(93545),E=n(672),L=n(61157),B=n(38691);const R=1.25*P.$;var O=n(18276),U=n(64493),K=n(61361),z=n(80089),V=n(80464),j=n(20021);const J=e=>{const{isOpen:t}=e,n=(0,V.A)(z.ar.Extra,"TextFormatter",!t);return n?(0,j.Y)(n,{...e}):void 0},$="input-scroller",q=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],G=(0,i.ph)((0,o.EK)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:i}=(0,d.l)(e);return{messageSendKeyCombo:i,replyInfo:t&&n?(0,r.GA4)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}}))((({ref:e,id:t,chatId:n,captionLimit:d,isAttachmentModalInput:S,isStoryInput:P,customEmojiPrefix:z,editableInputId:V,isReady:G,isActive:W,getHtml:_,placeholder:Q,timedPlaceholderLangKey:Z,timedPlaceholderDate:X,forcedPlaceholder:ee,canSendPlainText:te,canAutoFocus:ne,noFocusInterception:ie,shouldSuppressFocus:oe,shouldSuppressTextFormatter:se,replyInfo:ae,isSelectModeActive:re,canPlayAnimatedEmojis:de,messageSendKeyCombo:ce,onUpdate:le,onSuppressedFocus:ue,onSend:me,onScroll:he,onFocus:pe,onBlur:ge,isNeedPremium:fe,messageListType:ve})=>{const{editLastMessage:Ae,replyToNextMessage:ye,showAllowedMessageTypesNotification:Ce,openPremiumModal:we}=(0,o.ko)();let be=(0,i.li)();e&&(be=e);const Ie=(0,i.li)(),Se=(0,i.li)(),Me=(0,i.li)(),Ne=(0,i.li)(),ke=(0,i.li)(),Ye=(0,i.li)(),Pe=(0,b.A)(),Fe=(0,i.li)(!1),[Te,De,xe]=(0,C.A)(),[Ee,Le]=(0,i.J0)(),[Be,Re]=(0,i.J0)(),[Oe,Ue]=(0,i.J0)(!1),{isMobile:Ke}=(0,A.Ay)(),ze=Ke&&(c.pz||c.Ni),[Ve,je]=(0,i.J0)(!1);(0,i.vJ)((()=>{je(Boolean(Z&&X))}),[X,Z]);const Je=(0,w.A)((()=>{je(!1)}));!function(e,t,n,s,d,c,l,u,m){const h=(0,T.A)(t,void 0,!u),p=(0,F.A)(h,!0),g=(0,B.A)(),f=(0,i.li)(new Map),v=(0,w.A)((e=>{e.forEach((e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))}))})),A=(0,w.A)((()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,o.mS)(),i=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const o=`${c}${t.dataset.uniqueId}${h||""}`,a=t.dataset.documentId;i.delete(o);const u=(0,N.ZR)(a);if(!u)return;const m=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,k.LI)((v.left-m.left)/m.width,4),y=(0,k.LI)((v.top-m.top)/m.height,4);if(f.current.has(o))return void f.current.get(o).updatePosition(A,y);const C=e.customEmojis.byId[a];if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),b=[c,a,h,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:i,renderId:o,viewId:s,mediaUrl:a,position:r,isHq:d,textColor:c,colorFilter:l}){if(e.isLottie){const i=e.shouldUseTextColor&&c?(0,Y.E2)(c):void 0,l=(await(0,I.Y)()).init(a,d?n.current:t.current,o,{size:R,coords:r,isLowPriority:!d},s,i?[i.r,i.g,i.b]:void 0);return{play:()=>l.play(),pause:()=>l.pause(),destroy:()=>l.removeView(s),updatePosition:(e,t)=>l.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&l?`filter: ${l};`:void 0,n=new M(a,i.current,{size:R,position:r,style:t});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:d,renderId:b,viewId:o,mediaUrl:u,isHq:w,position:{x:A,y},textColor:h,colorFilter:p}).then((e=>{l&&e.play(),f.current.set(o,e)}))})),v(Array.from(i))}));(0,i.vJ)((()=>(0,N.K3)(A)),[A]),(0,i.vJ)((()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}}),[]),(0,i.vJ)((()=>{e()&&t.current&&n.current&&m&&u?(0,a.YS)((()=>{A()})):v(Array.from(f.current.keys()))}),[e,A,t,v,n,m,u]),(0,i.Nf)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")}),[p]),(0,D.A)((([e])=>{void 0!==e&&h!==e&&A()}),[h,A]);const y=(0,E.A)(A,[A],300,!1);(0,x.A)(n,y),(0,D.A)((([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())}),[g,A]);const C=(0,w.A)((()=>{f.current.forEach((e=>{e.pause()}))})),b=(0,w.A)((()=>{l&&f.current?.forEach((e=>{e.play()}))})),S=(0,w.A)((()=>{(0,a.YS)(b)}));(0,L.Ay)(C,S)}(_,be,Ne,ke,Ye,z,de,G,W);const $e=S?160:P?128:Ke?256:416,qe=(0,w.A)(((e=!1)=>{(0,g.IJ)((()=>{(0,a.gm)((()=>{const t=be.current.closest(`.${$}`),n=Number(t.style.height.replace("px","")),i=Me.current,{scrollHeight:o}=i,s=Math.min(o,$e);if(s===n)return;const r=o>$e;function d(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,a.RK)(d):d}))}))}));(0,i.Nf)((()=>{S&&qe(!1)}),[S,qe]);const He=(0,i.li)(_());(0,i.Nf)((()=>{const e=W?_():"";e!==be.current.innerHTML&&(be.current.innerHTML=e),e!==Se.current.innerHTML&&(Se.current.innerHTML=e),e!==He.current&&(He.current=e,qe(!e))}),[_,W,qe]),(0,i.li)(n).current=n;const Ge=(0,w.A)((()=>{be.current&&!fe&&((0,i.OV)()?setTimeout(Ge,350):(0,p.A)(be.current))})),We=(0,w.A)((()=>{xe(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function _e(){if(c.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Fe.current)return xe(),c.Ni&&Ue(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(se||!(0,v.L)(t,V||s.CfG)||!n||(0,h.A)(n)||!t.START_TO_END)||(xe(),!1)}function Qe(){if(!_e())return;if(Oe)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=be.current.closest(`.${$}`).getBoundingClientRect();let i=t.left+t.width/2-n.left;i<q?i=q:i>n.width-q&&(i=n.width-q),Le({x:i,y:t.top-n.top}),Re(e),De()}function Ze(){Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(Qe,260)}const Xe=(0,w.A)((()=>we()));(0,i.vJ)((()=>{c.TF||ne&&Ge()}),[n,Ge,ae,ne]),(0,i.vJ)((()=>{if(!n||V!==s.CfG||ie||ze||re)return;const e=e=>{if((0,m.ZJ)())return;const{key:t}=e,n=e.target;if(!n||H.includes(t))return;const i=be.current,o=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!o||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&i&&n!==i&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,p.A)(i,!0,!0);const t=new KeyboardEvent(e.type,e);i.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[n,V,ze,re,ie]),(0,i.vJ)((()=>{const e=(0,g.sg)((e=>{"Tab"!==e.key||(0,m.ZJ)()||(e.preventDefault(),(0,a.RK)(Ge))}),2e3,!0,!1);return(0,u.A)({onTab:e})}),[Ge]),(0,i.vJ)((()=>{const e=be.current;function t(){e.blur()}return oe&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[oe]);const et=(0,y.A)((()=>Boolean(W&&_())),[W,_]),tt=(0,l.A)("form-control allow-selection",et&&"touched",oe&&"focus-disabled"),nt=(0,l.A)("input-scroller-content",fe&&"is-need-premium"),it="string"==typeof Q?Q:void 0;return(0,j.FD)("div",{id:t,onClick:oe?ue:void 0,dir:Pe.isRtl?"rtl":void 0,children:[(0,j.Y)("div",{className:(0,l.A)("custom-scroll",$,fe&&"is-need-premium"),onScroll:he,onClick:S||te?void 0:function(){S||te||P&&fe||Ce({chatId:n,messageListType:ve})},children:(0,j.FD)("div",{className:nt,children:[(0,j.Y)("div",{ref:be,id:V||s.CfG,className:tt,contentEditable:S||te,role:"textbox",dir:"auto",tabIndex:0,onClick:Ge,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(le("<br>"===t?"":t),!c.TF&&(!n||!n.length)&&(c.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(be.current.blur(),e.removeAllRanges(),(0,p.A)(be.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=_();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void ye({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Ze,{once:!0}):(e.preventDefault(),Ae()):!ze&&("enter"===ce&&!e.shiftKey||"ctrl-enter"===ce&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),xe(),me())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{Fe.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Fe.current||(Fe.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",Ze,{once:!0})},onContextMenu:c.Ni?function(e){_e()&&(Ue(!Oe),Oe?xe():(e.preventDefault(),e.stopPropagation(),Qe()))}:void 0,onTouchCancel:c.Ni?Ze:void 0,"aria-label":it,onFocus:fe?void 0:pe,onBlur:fe?void 0:ge}),!ee&&(0,j.FD)("span",{className:(0,l.A)("placeholder-text",!S&&!te&&"with-icon",fe&&"is-need-premium"),dir:"auto",children:[!S&&!te&&(0,j.Y)(O.A,{name:"lock-badge",className:"placeholder-icon"}),Ve?(0,j.Y)(K.A,{langKey:Z,endsAt:X,onEnd:Je}):Q,P&&fe&&(0,j.Y)(U.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:Xe,children:Pe("StoryRepliesLockedButton")})]}),(0,j.Y)("canvas",{ref:Ne,className:"shared-canvas"}),(0,j.Y)("canvas",{ref:ke,className:"shared-canvas"}),(0,j.Y)("div",{ref:Ye,className:"absolute-video-container"})]})}),(0,j.Y)("div",{ref:Me,className:(0,l.A)("custom-scroll",$,"clone",fe&&"is-need-premium"),children:(0,j.Y)("div",{className:nt,children:(0,j.Y)("div",{ref:Se,className:(0,l.A)(tt,"clone"),dir:"auto"})})}),void 0!==d&&(0,j.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,j.Y)(J,{isOpen:Te,anchorPosition:Ee,selectedRange:Be,setSelectedRange:Re,onClose:We}),ee&&(0,j.Y)("span",{className:"forced-placeholder",children:(0,f.A)(ee)})]})})))},79307:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(84051),o=n(66644),s=n(37836);const a=({containerRef:e,selector:t},n)=>{(0,i.vJ)((()=>{const n=e?.current?.querySelectorAll(t);if(!n?.length)return;const i=(0,s.nF)((e=>{const t=e.target,n=t.scrollTop>0;(0,o.RK)((()=>{t.classList.toggle("scrolled",n)}))}),100);return n.forEach((e=>e.addEventListener("scroll",i,{passive:!0}))),n.forEach((e=>e.dispatchEvent(new Event("scroll",{bubbles:!1})))),()=>{n.forEach((e=>e.removeEventListener("scroll",i)))}}),[e,t,...n])}},79882:(e,t,n)=>{n.d(t,{I:()=>o,W:()=>s});var i=n(84051);let o=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function s(e){return(0,i.Kr)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,i=t.filter((e=>e>0)).length;return t=>{const s=e[t];return 0===s?o.None:s===1/0||s===-1/0||n<=i&&s<0||i<n&&s>0?o.Opacity:o.Move}}),[e])}},80477:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),o=n(13439),s=n(90709),a=n(60919),r=n(4961),d=n(59030),c=n(80999),l=n(20021);const u=(0,i.ph)((0,o.EK)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,a.mBe)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,d.A)(),i=t&&!t.isSelf&&(0,s.u0)(t),o=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return(0,l.FD)("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto",children:[i&&(0,l.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(i)}),(0,l.Y)(c.A,{content:o})]})})))},80999:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(87357),o=n(4961),s=n(59030),a=n(20021);const r=({content:e,className:t})=>{const n=(0,s.A)();return(0,a.FD)("span",{className:(0,i.A)("DotAnimation",t),dir:n.isRtl?"rtl":"auto",children:[(0,o.A)(e),(0,a.Y)("span",{className:"ellipsis"})]})}},81524:(e,t,n)=>{n.d(t,{A:()=>v});var i=n(84051),o=n(90709),s=n(87357),a=n(17663),r=n(83868),d=n(35749),c=n(2338),l=n(37661),u=n(5912),m=n(17712),h=n(62587),p=n(83057),g=n(27860),f=n(20021);const v=(0,i.ph)((({message:e,idPrefix:t="shared-media",isProtected:n,observeIntersection:v,onClick:A})=>{const y=(0,i.li)(),C=(0,u.Vz)(y,v),w=(0,c.A)(e),b=(0,d.A)(e,"pictogram"),I=(0,h.A)(b,!C),S=(0,p.A)(I),M=(0,o.zX)(e),N=(0,o.y2)(e),[k,,Y]=(0,l.A)(N),P=(0,m.A)((()=>{Y(),A(e.id,e.chatId)}));return(0,f.FD)("div",{ref:y,id:`${t}${(0,o.GZ)(e.id)}`,className:"Media scroll-item",onClick:A?P:void 0,children:[(0,f.Y)("img",{src:w,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.A:void 0}),(0,f.Y)("img",{src:I,className:(0,s.A)("full-media","media-miniature",S),alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.A:void 0}),N&&(0,f.Y)(g.A,{thumbDataUri:I||w,isVisible:k,className:"media-spoiler"}),M&&(0,f.Y)("span",{className:"video-duration",children:M.isGif?"GIF":(0,a.QO)(M.duration)}),n&&(0,f.Y)("span",{className:"protector"})]})}))},81642:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(84051),o=n(87357),s=n(17663),a=n(59030),r=n(45),d=n(20021);const c=(0,i.ph)((({className:e,message:t,outgoingStatus:n,draftDate:i})=>{const c=(0,a.A)(),l=i&&i>t.date;return(0,d.FD)("div",{className:(0,o.A)("LastMessageMeta",e),children:[n&&!l&&(0,d.Y)(r.A,{status:n}),(0,d.Y)("span",{className:"time",children:(0,s.be)(c,1e3*(l?i:t.date))})]})}))},84313:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(84051),o=n(13439),s=n(96454),a=n(17712),r=n(59030);const d=8e3;function c(e,t,n){const{showNotification:c}=(0,o.ko)(),l=(0,r.A)(),[u,m]=(0,i.J0)(!1),h=(0,a.A)((()=>{m(!0),t||c({message:s.yS?l("Video.Unsupported.Mobile"):l("Video.Unsupported.Desktop"),duration:d})})),p=(0,a.A)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||h())})),g=(0,a.A)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||h()}));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),d=n(87357),c=n(17663),l=n(41733),u=n(76023),m=n(2338),h=n(63988),p=n(37661),g=n(5912),f=n(17712),v=n(37960),A=n(69419),y=n(73767),C=n(21511),w=n(61097),b=n(18276),I=n(27860),S=n(64493),M=n(65843),N=n(35913),k=n(20021);const Y=u.Wd/2,P=2*(Y-6)*Math.PI;let F;const T=({message:e,className:t,canAutoLoad:n,isDownloading:T,origin:D,observeIntersection:x,onStop:E,onReadMedia:L,isTranscriptionError:B,isTranscribed:R,canTranscribe:O,onHideTranscription:U,isTranscriptionHidden:K,isTranscribing:z})=>{const V=(0,i.li)(),j=(0,i.li)(),J=(0,i.li)(),{cancelMediaDownload:$,openOneTimeMediaModal:q,transcribeAudio:H}=(0,o.ko)(),G=(0,g.Vz)(V,x),W=e.content.video,_=e.isMediaUnread,[Q,Z]=(0,i.J0)(n),X=Boolean(Q&&G),{mediaData:ee,loadProgress:te}=(0,A.A)((0,a.sC)(W,"inline"),!X,(0,a.Cz)(W,"inline")),{loadProgress:ne}=(0,A.A)((0,a.sC)(W,"download"),!T,s.qZ.BlobUrl),[ie,oe]=(0,p.A)(),se=(0,a.G5)(e),ae="oneTimeModal"===D,re=se&&!ae,de=(0,m.A)(e),ce=!Boolean(de)||ie||re,le=(0,w.A)(W,ce);(0,v.A)({hasMediaData:!ce,ref:le});const ue=Q&&!ie||T,me=!1===(0,y.A)(Q),{ref:he,shouldRender:pe}=(0,C.A)({isOpen:ue,noMountTransition:me,withShouldRender:!0}),[ge,fe]=(0,i.J0)(!1),[ve,Ae]=(0,i.J0)(0),[ye,Ce]=(0,i.Ul)(0),we=(0,h.aG)(ye,16);(0,i.vJ)((()=>{if(!ge)return;const e=j.current;Ce(e.currentTime/e.duration)}),[Ce,ge,we]),(0,i.Nf)((()=>{if(!ge||!J.current)return;const e=P-we()*P;J.current.setAttribute("stroke-dashoffset",e.toString())}),[ge,we]);const be=Boolean(ee&&G),Ie=(0,f.A)((()=>{j.current&&(fe(!1),Ce(0),(0,l.A)(j.current))})),Se=(0,f.A)((()=>{F?.(),F=Ie})),Me=(0,f.A)((()=>{const e=j.current;ge?e.paused?((0,l.A)(e),(0,r._K)()):e.pause():(Se(),e.pause(),e.currentTime=0,(0,l.A)(e),(0,r._K)(),fe(!0))}));(0,i.vJ)((()=>{ae&&Me()}),[ae]);const Ne=(0,f.A)((t=>{if(!t.target.closest(".transcribe-button"))if(ee){if(!T)return se&&!ae?(q({message:e}),void L?.()):void Me();$({media:W})}else Z((e=>!e))}));(0,i.vJ)((()=>{L&&_&&ge&&L()}),[ge,_,L]);const ke=(0,f.A)((e=>{const t=e.currentTarget;Ce(t.currentTime/t.duration),Ae(Math.floor(t.currentTime))})),Ye=(0,f.A)((()=>{H({chatId:e.chatId,messageId:e.id})})),Pe=(0,f.A)((()=>{(R||B)&&U?U(!K):z||Ye()}));return(0,k.FD)("div",{ref:V,className:(0,d.A)("RoundVideo","media-inner",ae&&"non-interactive",t),onClick:Ne,children:[ee&&(0,k.FD)("div",{className:"video-wrapper",children:[re&&(0,k.Y)(I.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,k.Y)(M.A,{canPlay:be,ref:j,src:ee,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!re,disablePictureInPicture:!0,muted:!ge,defaultMuted:!0,loop:!ge,playsInline:!0,isPriority:!0,onEnded:ge?E??Ie:void 0,onTimeUpdate:ge?ke:void 0,onReady:oe})]}),!re&&(0,k.Y)("canvas",{ref:le,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,k.Y)("div",{className:"progress",children:ge&&(0,k.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,k.Y)("circle",{ref:J,cx:Y,cy:Y,r:Y-6,className:"progress-circle",transform:`rotate(-90, ${Y}, ${Y})`,"stroke-dasharray":P,"stroke-dashoffset":P})})}),pe&&(0,k.Y)("div",{ref:he,className:"media-loading",children:(0,k.Y)(N.A,{progress:T?ne:te})}),re&&!pe&&(0,k.FD)("div",{className:"play-wrapper",children:[(0,k.Y)(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,children:(0,k.Y)(b.A,{name:"play"})}),(0,k.Y)(b.A,{name:"view-once"})]}),!ee&&!Q&&(0,k.Y)(b.A,{name:"download"}),!ae&&(0,k.FD)("div",{className:(0,d.A)("message-media-duration",_&&"unread"),children:[ge?(0,c.QO)(ve):(0,c.QO)(W.duration),(!ge||j.current.paused)&&(0,k.Y)(b.A,{name:"muted"})]}),O&&(0,k.FD)(S.A,{onClick:Pe,className:"transcribe-button",children:[R||B?(0,k.Y)(b.A,{name:"down"}):(0,k.Y)(b.A,{name:"transcribe"}),z&&(0,k.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,k.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]})}},85449:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(31481),o=n(98607),s=n(4961),a=n(18276),r=n(20021);function d(e,t){return"receipt"===t.type?e("PaymentReceipt"):"buy"===t.type?(0,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:()=>h});var i=n(84051),o=n(13439),s=n(31481),a=n(60919),r=n(53827),d=n(49642),c=n(80853),l=n(82117),u=n(17712),m=n(35297);const h=(e,t,n,h,p,g,f,v=!1,A,y,C=!1,w=!1,b,I=!1,S=!1)=>{const M=(0,i.li)(),[N,k]=(0,i.J0)(!1);let Y=N;const[P,F]=(0,i.J0)(0),T=(0,u.A)((()=>{k(!1),y&&y()}));(0,m.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:c}=M.current;k(!0),"oneTimeVoice"!==n&&(0,d.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:i,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:d,isFirst:c,isLast:l}=e.current;t={play:()=>{n(a.src)},pause:()=>{i()},stop:()=>{i(),s(0),(0,o.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(a.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(a.currentTime+t,a.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},l()||(t.nexttrack=()=>{r()}),c()||(t.previoustrack=()=>{d()})}return t}(M)),(0,d.HW)("playing");const{audioPlayer:l}=(0,a.nTw)((0,o.mS)());e(l.volume),r(Boolean(l.isMuted));const u=c.duration&&Number.isFinite(c.duration)?c.duration:t;("voice"===n||u>s.CVm)&&i(l.playbackRate),(0,d.hm)({duration:c.duration||0,playbackRate:c.playbackRate,position:c.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,d.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":k(!1),(0,d.HW)("paused"),b?.();break;case"onTimeUpdate":{const{proxy:e}=M.current;if(I&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;w||F(e.currentTime/n);break}case"onEnded":(0,d.HW)("paused")}p?.[e]?.(i)}}),A,T);const{proxy:i}=M.current;N||i.paused||(k(!0),Y=!0),f&&!S&&f(i)}),[e]),(0,i.vJ)((()=>{N&&g&&(0,d.D5)(g)}),[g,N]);const{play:D,pause:x,setCurrentTime:E,proxy:L,destroy:B,setVolume:R,stop:O,isFirst:U,isLast:K,requestNextTrack:z,requestPreviousTrack:V,setPlaybackRate:j,toggleMuted:J}=M.current??{},$=(0,i.Kr)((()=>L?.duration&&Number.isFinite(L.duration)?L.duration:t),[L?.duration,t]);(0,i.vJ)((()=>{L&&(I&&0===L.currentTime||!$||(0,c.f)(L)||w||F(L.currentTime/$))}),[$,P,L,w,I]),(0,i.vJ)((()=>()=>{B?.(C)}),[B,C]),(0,l.A)((([e,t])=>{e===v&&h===t||L?.src&&L?.paused||v&&h&&!N&&D?.(h)}),[v,h,N,D,L?.src,L?.paused,n]);const q=(0,u.A)((()=>{h&&D?.(h)})),H=(0,u.A)((()=>{N?x?.():q()})),G=(0,u.A)((e=>{E?.(e),$&&L&&F(L.currentTime/$)}));return{isPlaying:Y,playProgress:P,playPause:H,pause:x,play:q,stop:O,setCurrentTime:G,setVolume:R,audioProxy:L,duration:$,requestNextTrack:z,requestPreviousTrack:V,isFirst:U,isLast:K,setPlaybackRate:j,toggleMuted:J}}},89755:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.40a69ba9ec4d2c4cf3a7.js"},89873:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(84051),o=n(13439),s=n(17712),a=n(21511),r=n(59030),d=n(71429),c=n(24433),l=n(60859),u=n(20021);const m=(0,i.ph)((({isOpen:e,sponsorInfo:t,canReport:n,anchor:o,triggerRef:a,shouldSkipAbout:m,onClose:h,onCloseAnimationEnd:p,onAboutAdsClick:g,onSponsoredHide:f,onSponsorInfo:v,onSponsoredReport:A})=>{const y=(0,i.li)(),C=(0,r.A)(),w=(0,s.A)((()=>a.current)),b=(0,s.A)((()=>({withPortal:!0}))),I=(0,s.A)((()=>y.current)),S=(0,s.A)((()=>document.body)),M=t||!m||n;return(0,u.FD)(d.A,{ref:y,isOpen:e,anchor:o,withPortal:!0,className:"with-menu-transitions",getLayout:b,getTriggerElement:w,getMenuElement:I,getRootElement:S,onClose:h,onCloseAnimationEnd:p,children:[t&&v&&(0,u.Y)(c.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!m&&(0,u.Y)(c.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(c.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(l.A,{}),(0,u.Y)(c.A,{icon:"close-circle",onClick:f,children:C("HideAd")})]})})),h=(0,i.ph)((({isOpen:e,randomId:t,sponsorInfo:n,additionalInfo:i,canReport:r,anchor:d,triggerRef:c,shouldSkipAbout:l,onItemClick:h,onClose:p,onCloseAnimationEnd:g})=>{const{openAboutAdsModal:f,showDialog:v,reportSponsored:A,hideSponsored:y}=(0,o.ko)(),{ref:C}=(0,a.A)({isOpen:e,onCloseAnimationEnd:g}),w=(0,s.A)((()=>{h?.(),p()})),b=(0,s.A)((()=>{f({randomId:t,additionalInfo:i,canReport:r,sponsorInfo:n}),w()})),I=(0,s.A)((()=>{y(),w()})),S=(0,s.A)((()=>{v({data:{message:[n,i].filter(Boolean).join("\n")}}),w()})),M=(0,s.A)((()=>{A({randomId:t}),w()}));if(d)return(0,u.Y)("div",{ref:C,className:"ContextMenuContainer",children:(0,u.Y)(m,{isOpen:e,anchor:d,triggerRef:c,canReport:r,sponsorInfo:n,shouldSkipAbout:l,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:b,onSponsoredHide:I,onSponsorInfo:S,onSponsoredReport:M})})}))},90054:(e,t,n)=>{n.d(t,{A:()=>W});var i=n(84051),o=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),c=n(60919),l=n(96454),u=n(87357),m=n(11778),h=n(50442),p=n(25903),g=n(43874),f=n(26072),v=n(96374),A=n(5912),y=n(17712),C=n(59030),w=n(73767),b=n(9717),I=n(63744),S=n(51083),M=n(18276),N=n(48553),k=n(64493),Y=n(46222),P=n(52745),F=n(76023),T=n(79577);const D={root:"Ky16H_sV","button-text":"W01t9CIf",buttonText:"W01t9CIf",sticker:"c8lE3XW5",title:"wlwD1B1Q",description:"V8OCFHmp","is-ios":"IxW_z_r0",isIos:"IxW_z_r0","is-macos":"OFxKGCEJ",isMacos:"OFxKGCEJ"};var x=n(20021);const E=7*F.$,L=(0,i.ph)((0,o.EK)(((e,{chatId:t})=>{const n=(0,c.hds)(e,t),i=n&&(n.isCreator||(0,d.ub)(n,"manageTopics"));return{animatedEmoji:(0,c.oei)(e,"🐣"),canManageTopics:i}}))((({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:s}=(0,o.ko)(),a=(0,C.A)(),{isMobile:r}=(0,g.Ay)(),d=(0,i.hb)((()=>{s({chatId:e})}),[e,s]);return(0,x.FD)("div",{className:D.root,children:[(0,x.Y)("div",{className:D.sticker,children:t&&(0,x.Y)(T.A,{sticker:t,size:E})}),(0,x.Y)("h3",{className:D.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,x.Y)("p",{className:(0,u.A)(D.description,D.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,x.Y)(k.A,{ripple:!r,fluid:!0,onClick:d,size:"smaller",isRtl:a.isRtl,children:(0,x.Y)("div",{className:D.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})})));var B=n(27109),R=n(66414),O=n(4961),U=n(37661),K=n(53188),z=n(87894),V=n(81642),j=n(38102),J=n(94189),$=n(22720),q=n(97046),H=n(24807);const G=(0,i.ph)((0,o.EK)(((e,{chatId:t,topic:n,isSelected:i})=>{const o=(0,c.hds)(e,t),s=(0,c.O5q)(e,t,n.lastMessageId),{isOutgoing:a}=s||{},r=s&&(0,c.Y7C)(e,s),d=(0,c.C5H)(e,t,n.id,"typingStatus"),l=(0,c.GA4)(e,t,n.id),u=(0,c.Vw0)(e,t,n.id),m=Boolean(u?.lastReadInboxMessageId),h=(0,c.pSx)(e,t),{chatId:p,threadId:g}=(0,c.Xf0)(e)||{},f=s?.content.storyData,v=f&&(0,c.Msb)(e,f.peerId,f.id);return{chat:o,lastMessage:s,lastMessageSender:r,typingStatus:d,isChatMuted:o&&(0,B.If)(o,(0,c.K52)(e),(0,c.P5N)(e,o.id)),canDelete:(0,c.DBV)(e,t,n.id),withInterfaceAnimations:(0,c.PKK)(e),draft:l,...a&&s&&{lastMessageOutgoingStatus:(0,c.Tl2)(e,s)},canScrollDown:i&&o?.id===p&&g===n.id,wasTopicOpened:m,topics:h,lastMessageStory:v}}))((({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:a,style:r,lastMessage:c,lastMessageStory:m,canScrollDown:h,lastMessageOutgoingStatus:p,observeIntersection:g,canDelete:f,lastMessageSender:v,animationType:A,withInterfaceAnimations:w,orderDiff:b,typingStatus:I,draft:S,wasTopicOpened:N,topics:k})=>{const{openThread:Y,deleteTopic:P,focusLastMessage:F,setViewForumAsMessages:T}=(0,o.ko)(),D=(0,C.A)(),[E,L,B]=(0,U.A)(),[G,W,_]=(0,U.A)(),[Q,Z,X]=(0,U.A)(),[ee,te,ne]=(0,U.A)(),{isPinned:ie,isClosed:oe,notifySettings:se}=e,ae=Boolean(se.mutedUntil||void 0===se.mutedUntil&&a),re=(0,y.A)((()=>{Z(),L()})),de=(0,y.A)((()=>{P({chatId:s.id,topicId:e.id})})),ce=(0,y.A)((()=>{te(),W()})),{renderSubtitle:le,ref:ue}=(0,K.A)({chat:s,chatId:n,lastMessage:c,draft:S,lastMessageSender:v,lastMessageTopic:e,observeIntersection:g,isTopic:!0,typingStatus:I,topics:k,statefulMediaContent:(0,d.FE)({story:m}),animationType:A,withInterfaceAnimations:w,orderDiff:b}),me=(0,y.A)((()=>{Y({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),T({chatId:n,isEnabled:!1}),h&&F()})),he=function({topic:e,chat:t,isChatMuted:n,wasOpened:s,canDelete:a,handleDelete:r,handleMute:c}){const u=(0,C.A)();return(0,i.Kr)((()=>{const{isPinned:i,notifySettings:m,isClosed:h,id:p}=e,g=t.id,{editTopic:f,toggleTopicPinned:v,markTopicRead:A,updateTopicMutedState:y,openChatInNewTab:C}=(0,o.ko)(),w=(0,d.l1)(t,e),b=t.isCreator||(0,d.ub)(t,"manageTopics"),I=l.OS&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{C({chatId:t.id,threadId:p})}},S=e.unreadCount||!s?{title:u("MarkAsRead"),icon:"readchats",handler:()=>{A({chatId:g,topicId:p})}}:void 0,M=b?i?{title:u("UnpinFromTop"),icon:"unpin",handler:()=>v({chatId:g,topicId:p,isPinned:!1})}:{title:u("PinToTop"),icon:"pin",handler:()=>v({chatId:g,topicId:p,isPinned:!0})}:void 0,N=n&&void 0===m.mutedUntil||m.mutedUntil?{title:u("ChatList.Unmute"),icon:"unmute",handler:()=>y({chatId:g,topicId:p,isMuted:!1})}:{title:`${u("ChatList.Mute")}...`,icon:"mute",handler:c},k=w?h?{title:u("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>f({chatId:g,topicId:p,isClosed:!1})}:{title:u("lng_forum_topic_close"),icon:"close-topic",handler:()=>f({chatId:g,topicId:p,isClosed:!0})}:void 0,Y=a?{title:u("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:r}:void 0;return(0,z.oE)([I,M,S,N,k,Y])}),[e,t,n,s,u,a,r,c])}({topic:e,chat:s,isChatMuted:a,wasOpened:N,canDelete:f,handleDelete:re,handleMute:ce});return(0,x.FD)($.A,{className:(0,u.A)("Fn34Vu_9","Chat",t&&"selected","chat-item-clickable"),onClick:me,style:r,href:l.OS?`#${(0,R.az)(n,"thread",e.id)}`:void 0,contextActions:he,withPortalForMenu:!0,ref:ue,children:[(0,x.FD)("div",{className:"info",children:[(0,x.FD)("div",{className:"info-row",children:[(0,x.FD)("div",{className:(0,u.A)("title"),children:[(0,x.Y)(j.A,{topic:e,className:"oXJl4tra",observeIntersection:g}),(0,x.Y)("h3",{dir:"auto",className:"fullName",children:(0,O.A)(e.title)})]}),Boolean(se.mutedUntil)&&(0,x.Y)(M.A,{name:"muted"}),(0,x.Y)("div",{className:"separator"}),oe&&(0,x.Y)(M.A,{name:"lock-badge",className:"MB7Gomjn"}),c&&(0,x.Y)(V.A,{message:c,outgoingStatus:p})]}),(0,x.FD)("div",{className:"subtitle",children:[le(),(0,x.Y)(H.A,{chat:s,isPinned:ie,isMuted:ae,topic:e,wasTopicOpened:N,topics:k})]})]}),Q&&(0,x.Y)(J.A,{isOpen:E,onClose:B,onCloseAnimationEnd:X,confirmIsDestructive:!0,confirmHandler:de,text:D("lng_forum_topic_delete_sure"),confirmLabel:D("Delete")}),ee&&(0,x.Y)(q.A,{isOpen:G,onClose:_,onCloseAnimationEnd:ne,chatId:n,topicId:e.id})]})}))),W=(0,i.ph)((0,o.EK)((e=>{const t=(0,c.nTw)(e).forumPanelChatId,n=t?(0,c.hds)(e,t):void 0,{chatId:i,threadId:o}=(0,c.Xf0)(e)||{},s=t?(0,c.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===i?Number(o):void 0,withInterfaceAnimations:(0,c.PKK)(e),topicsInfo:s}}),(e=>(0,c.clw)(e)))((({chat:e,currentTopicId:t,isOpen:n,isHidden:c,topicsInfo:F,onTopicSearch:T,onCloseAnimationEnd:D,onOpenAnimationStart:E,withInterfaceAnimations:B})=>{const{closeForumPanel:R,openChatWithInfo:O,loadTopics:U}=(0,o.ko)(),K=(0,i.li)(),z=(0,i.li)(),V=(0,i.li)(),{isMobile:j}=(0,g.Ay)(),J=e?.id;(0,i.vJ)((()=>{J&&!F&&U({chatId:J})}),[F,J]);const[$,q]=(0,i.J0)(!1),H=(0,C.A)(),W=(0,y.A)((()=>{R()}));(0,i.vJ)((()=>{B||n||D?.()}),[B,n,D]);const _=(0,y.A)((()=>{e&&O({id:e.id,shouldReplaceHistory:!0})})),{observe:Q}=(0,A.BL)({rootRef:z,throttleMs:200});(0,A.mv)(V,Q,(({isIntersecting:e})=>{q(!e)}));const Z=(0,i.Kr)((()=>F?(0,d.CO)(Object.values(F.topicsById),F.orderedPinnedTopicIds).map((({id:e})=>e)):[]),[F]),{orderDiffById:X,getAnimationType:ee}=(0,b.A)(Z,e?.id),[te,ne]=(0,v.A)((()=>{e&&U({chatId:e.id})}),Z,!F?.totalCount||Z.length>=F.totalCount,a.iIc),ie=(0,i.li)(!1),oe=n&&!c,se=(0,w.A)(oe);se!==oe&&(ie.current=!1),(0,f.A)({isActive:oe,onBack:W}),(0,i.vJ)((()=>oe?(0,m.A)(W):void 0),[W,oe]),(0,i.vJ)((()=>{se!==oe&&(0,r.Uz)((()=>{if(!K.current)return;const e=(0,i.VK)();(0,p.j)(K.current,e),E?.(),oe?(ie.current=!0,K.current.style.transform="none"):(ie.current=!1,K.current.style.transform="")}))}),[oe,E,se]),(0,i.vJ)((()=>{if(l.TF)return(0,h.wJ)(K.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(H.isRtl?h.ez.Left:h.ez.Right)&&(R(),!0)})}),[R,H.isRtl]);const ae=void 0===F;return(0,x.FD)("div",{ref:K,className:(0,u.A)("MlF2n1nb",$&&"SZ24u3cn",H.isRtl&&"Xs2y1fCE",!B&&"kmDMv6D8"),onTransitionEnd:n?void 0:D,children:[(0,x.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,x.Y)(k.A,{round:!0,size:"smaller",color:"translucent",onClick:W,ariaLabel:H("Close"),children:(0,x.Y)(M.A,{name:"close"})}),e&&(0,x.Y)(S.A,{noAvatar:!0,className:"Sf633zAP",chatId:e.id,onClick:_}),e&&(0,x.Y)(N.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:j,onTopicSearch:T})]}),e&&(0,x.Y)(I.A,{chatId:e.id}),(0,x.Y)("div",{className:"hGeb3TQJ"}),(0,x.FD)(Y.A,{className:"chat-list custom-scroll",ref:z,items:te,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(Z?.length||0)*a.HGU,onLoadMore:ne,sensitiveArea:a.C$_,beforeChildren:(0,x.Y)("div",{ref:V,className:"ERz3fcar"}),children:[Boolean(te?.length)&&function(){const n=Z.indexOf(te[0]);return te?.map(((i,o)=>(0,x.Y)(G,{chatId:e.id,topic:F.topicsById[i],style:`top: ${(n+o)*a.HGU}px;`,isSelected:t===i,observeIntersection:Q,animationType:ee(i),orderDiff:X[i]},i)))}(),ae&&!te?.length&&(0,x.Y)(P.A,{},"loading")]}),!ae&&1===te?.length&&te[0]===a.HxB&&(0,x.Y)(L,{chatId:J})]})})))},90423:(e,t,n)=>{n.d(t,{Ay:()=>r,j9:()=>l,zk:()=>d});var i=n(84051),o=n(31791),s=n(96454);const a=c();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)},d=()=>{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",d,!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",d,!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 d=()=>{const[e,t]=(0,i.J0)(!1);return(0,i.vJ)((()=>{const e=()=>{t(l())},n=window.electron?.on(o.v.FULLSCREEN_CHANGE,t);return window.electron?.isFullscreen().then(t),document.addEventListener("fullscreenchange",e,!1),document.addEventListener("webkitfullscreenchange",e,!1),document.addEventListener("mozfullscreenchange",e,!1),()=>{n?.(),document.removeEventListener("fullscreenchange",e,!1),document.removeEventListener("webkitfullscreenchange",e,!1),document.removeEventListener("mozfullscreenchange",e,!1)}}),[]),e};function c(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function l(){const e=c();return Boolean(e&&document[e])}},90596:(e,t,n)=>{n.d(t,{A:()=>Vn});var i=n(84051),o=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),c=n(70636),l=n(26129),u=n(60919),m=n(56494),h=n(30708),p=n(96454),g=n(87357),f=n(9716),v=n(60343),A=n(80140),y=n(83868),C=n(41512),w=n(76023),b=n(35049),I=n(4961),S=n(58734);function M(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 N=n(43336),k=n(35127);function Y(e,t){return e.reduce(((e,t)=>e+t),t)}function P(e){const t={width:0,height:0};return e.forEach((({dimensions:e,sides:n})=>{2&n&&(t.width=e.width+e.x),4&n&&(t.height=e.height+e.y)})),t}function F(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,d.r_)(e).photo||(0,d.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,c=o.some((e=>e>2)),l=(0,w.w4)(e,!1,t,i);let u;const m={ratios:o,proportions:s,averageRatio:a,maxWidth:l,minWidth:100,maxHeight:l,spacing:2};return u=r>=5||c?function({ratios:e,averageRatio:t,maxWidth:n,minWidth:i,spacing:o,maxHeight:s=4*n/3}){const a=function(e,t){return e.map((e=>t>1.1?(0,N.qE)(e,1,2.75):(0,N.qE)(e,.6667,1)))}(e,t),r=e.length,d=new Array(r),c=[],l=e=>{const t=[];let i=0;e.forEach((e=>{t.push(((e,t)=>{const i=Y(a.slice(e,e+t),0);return(n-(t-1)*o)/i})(i,e)),i+=e})),c.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&l([e,t])}for(let e=1;e!==r-1;++e)for(let n=1;n!==r-e;++n){const i=r-e-n;e<=3&&n<=(t<.85?4:3)&&i<=3&&l([e,n,i])}for(let e=1;e!==r-1;++e)for(let t=1;t!==r-e;++t)for(let n=1;n!==r-e-t;++n){const i=r-e-t-n;e<=3&&t<=3&&n<=3&&i<=4&&l([e,t,n,i])}let u,m=0;for(let e=0;e<c.length;e++){const{heights:t,lineCounts:n}=c[e],a=n.length,r=Y(t,0)+o*(a-1),d=Math.min(...t)<i?1.5:1,l=(()=>{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),h=Math.abs(r-s)*d*l;(!u||h<m)&&(u=c[e],m=h)}const h=u.lineCounts,p=u.heights,g=h.length;let f=0,v=0;for(let e=0;e!==g;++e){const t=h[e],i=p[e],s=Math.round(i);let r=0;for(let c=0;c!==t;++c){const l=0|(0===e?1:0)|(e===g-1?4:0)|(0===c?8:0)|(c===t-1?2:0),u=a[f],m=c===t-1?n-r:Math.round(u*i);d[f]={dimensions:{x:r,y:v,width:m,height:s},sides:l},r+=m+o,++f}v+=s+o}return d}(m):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),d=i-r-o,c=Math.min(s,Math.round(Math.min(d/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:d,height:c},sides:13},{dimensions:{x:d+o,y:0,width:r,height:c},sides:7}]}(e)}(m):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]))),d=a-r-n,c=Math.max(s,Math.round(Math.min((o-n)/2,Math.min(r*i[2],d*i[1])))),l=Math.min(Math.round(a*i[0]),o-n-c);return[{dimensions:{x:0,y:0,width:l,height:a},sides:13},{dimensions:{x:l+n,y:0,width:c,height:d},sides:3},{dimensions:{x:l+n,y:d+n,width:c,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:i,spacing:o}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(i-o))),r=(t-o)/2,d=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:d},sides:12},{dimensions:{x:r+o,y:a+o,width:s-r-o,height:d},sides:6}]}(e)}(m):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:n,maxHeight:i,minWidth:o}){const s=e,a=Math.round(Math.min(s/t[0],.66*(i-n))),r=Math.round((e-2*n)/(t[1]+t[2]+t[3])),d=Math.max(o,Math.round(Math.min(.4*(e-2*n),r*t[1]))),c=Math.round(Math.max(Math.max(o,.33*(e-2*n)),r*t[3])),l=s-d-c-2*n,u=Math.min(i-a-n,r);return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+n,width:d,height:u},sides:12},{dimensions:{x:d+n,y:a+n,width:l,height:u},sides:4},{dimensions:{x:d+n+l+n,y:a+n,width:c,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:n,spacing:i,minWidth:o}){const s=e,a=Math.round(Math.min(s*t[0],.6*(n-i))),r=Math.round((e-2*i)/(1/t[1]+1/t[2]+1/t[3])),d=Math.round(r/t[1]),c=Math.round(r/t[2]),l=s-d-c-2*i,u=Math.max(o,Math.min(n-a-i,r));return[{dimensions:{x:0,y:0,width:a,height:s},sides:13},{dimensions:{x:a+i,y:0,width:u,height:d},sides:3},{dimensions:{x:a+i,y:d+i,width:u,height:c},sides:2},{dimensions:{x:a+i,y:d+c+2*i,width:u,height:l},sides:6}]}(e)}(m),{layout:u,containerStyle:P(u)}}var T=n(43874),D=n(10722),x=n(49746),E=n(21488),L=n(37661),B=n(5912),R=n(39351),O=n(17712),U=n(59030),K=n(73767),z=n(14622),V=n(21511),j=n(9705),J=n(5130);let $;const q=new j.A;p.CM&&setTimeout((function(){$||($=(0,J.U)(new Worker(new URL(n.p+n.u(520),n.b))),q.resolve())}),4e3);var H=n(84947),G=n(37836);const W=new Map;const _=(0,G.nF)((function(e){const{updateChatDetectedLanguage:t}=(0,o.ko)(),n=W.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])=>t-e))[0][0]})}),1e3);var Q=n(79519),Z=n(46275),X=n(64154),ee=n(66644),te=n(50442),ne=n(43503),ie=n(54464),oe=n(672);const se=3*w.$,ae=Number(w.$),re="data-is-document-group-hover";function de(e,t,n,s,a,r,d,c,l,u,m,h,g){const{updateDraftReplyInfo:f,sendDefaultReaction:v}=(0,o.ko)(),[A,C,w]=(0,L.A)(),[b,I,S]=(0,L.A)(),M=(0,i.li)(),N=(0,oe.A)((e=>{const t=m.current;if(!t)return;const{clientX:n,clientY:i}=e,{x:o,width:s,y:a,height:r}=t.getBoundingClientRect(),d=o+s/2,c=a+r/2,l=Math.abs(d-n)<se,u=Math.abs(c-i)<ae;l&&u?C():w()}),[m],ee.YS);return(0,i.vJ)((()=>{if(!p.TF||s||!a||u||!g?.())return;let e;return(0,te.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===te.ez.Left&&(e||(e=Date.now()),I(),!0),onRelease:()=>{e&&a&&(f({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})}),[t,s,n,I,S,a,u,g]),{handleMouseDown:s?void 0:function(e){(0,ie.l)(e),c(e)},handleClick:function(t){if(s)e(t);else if(p.TF)return M.current?(clearInterval(M.current),M.current=void 0,void v({chatId:l,messageId:n})):void(M.current=setTimeout((()=>{M.current=void 0,function(e){if(p.Ni){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;ne.A.getIsKeyboardVisible()?setTimeout((()=>{d(e)}),350):d(e)}}(t)}),200))},handleContextMenu:s?r?y.A:void 0:function(t){if(p.Ni){if(t.target.matches("a[href]")||u)return;t.preventDefault(),e()}else d(t)},handleDoubleClick:s?void 0:function(){!p.TF&&a&&f({replyToMsgId:n,replyToPeerId:void 0,quoteText:void 0,quoteOffset:void 0})},handleContentDoubleClick:p.TF?void 0:function(e){e.stopPropagation()},handleMouseMove:N,handleSendQuickReaction:function(e){e.stopPropagation(),v({chatId:l,messageId:n})},handleMouseLeave:function(e){(0,ee.YS)(w),h&&function(e){const t=le(e.currentTarget);t&&t.removeAttribute(re)}(e)},isSwiped:b,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:ce}}function ce(e){const t=le(e.currentTarget);t&&t.setAttribute(re,"")}function le(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var ue=n(65240),me=n(21849),he=n(87412),pe=n(44589),ge=n(80999),fe=n(91930),ve=n(11217),Ae=n(62587),ye=n(18276),Ce=n(86070),we=n(20021);function be(e,t){const{width:n,height:i}=(0,w.mr)();return(0,we.FD)("div",{className:"embedded-thumb",children:[(0,we.Y)("img",{src:e,width:n,height:i,alt:"",className:"pictogram",draggable:!1}),t&&(0,we.Y)("span",{className:"protector"})]})}const Ie=({story:e,sender:t,noUserColors:n,isProtected:s,observeIntersectionForLoading:a,onClick:r})=>{const{showNotification:l}=(0,o.ko)(),u=(0,U.A)(),m=(0,i.li)(),h=(0,B.Vz)(m,a),p=e&&"content"in e,f=e&&"isDeleted"in e,v=p&&Boolean(e.content.video),A=p?"Story":f?"ExpiredStory":"Loading",y=(0,Ae.A)(p&&(0,d.EN)(e,"pictogram"),!h),C=v?e.content.video.thumbnail?.dataUri:void 0,w=y||C,b=t?(0,c.F9)(u,t):void 0,S=(0,O.A)((()=>{e&&!f?r():l({message:u("StoryNotFound")})})),{handleClick:M,handleMouseDown:N}=(0,ve.Q)(S);return(0,we.FD)(Ce.A,{ref:m,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,g.A)("EmbeddedMessage",w&&"with-thumb"),onClick:M,onMouseDown:N,children:[w&&be(w,s),(0,we.FD)("div",{className:"message-text with-message-color",children:[(0,we.FD)("p",{className:"embedded-text-wrapper",children:[f&&(0,we.Y)(ye.A,{name:"story-expired",className:"embedded-origin-icon"}),p&&(0,we.Y)(ye.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,we.Y)("div",{className:"message-title",children:(0,I.A)(b||" ")})]})]})};var Se=n(2578),Me=n(9267),Ne=n(74936),ke=n(17794),Ye=n(90603),Pe=n(38102);var Fe=n(61911);const Te=1.125*w.$,De=(0,i.ph)((({topic:e,className:t,onClick:n})=>{const i=(0,U.A)();return(0,we.FD)("div",{className:(0,g.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Ye.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,we.Y)(Pe.A,{topic:e,size:Te}):(0,we.Y)("img",{src:Fe,alt:"",draggable:!1}),e?.title?(0,I.A)(e.title):i("Loading"),e?.isClosed&&(0,we.Y)(ye.A,{name:"lock"}),(0,we.Y)(ye.A,{name:"next"})]})}));var xe=n(15006),Ee=n(64493),Le=n(94189),Be=n(40664);function Re(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:d}=(0,o.ko)(),c=(0,O.A)((e=>{e.stopPropagation(),d({messageId:r,withShift:e?.shiftKey})})),l=(0,i.Kr)((()=>{const{dimensions:e,onClick:i}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:i}}),[t,n,s]);return(0,we.FD)("div",{className:(0,g.A)("album-item-select-wrapper",s&&"is-selected"),style:a?`left: ${a.x}px; top: ${a.y}px;`:"",onClick:n?c:void 0,children:[n&&(0,we.Y)("div",{className:"message-select-control",children:s&&(0,we.Y)(ye.A,{name:"select"})}),(0,we.Y)(e,{...l})]})})))}var Oe=n(51644),Ue=n(25477);const Ke=Re(Oe.A),ze=Re(Ue.A),Ve=(0,o.EK)((e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}}))((({album:e,observeIntersection:t,hasCustomAppendix:n,isOwn:s,isProtected:a,albumLayout:r,onMediaClick:c,uploadsByKey:l,activeDownloads:m,theme:h})=>{const{cancelUploadMedia:p}=(0,o.ko)(),{content:{paidMedia:g}}=e.mainMessage,f=e.isPaidMedia?g.extendedMedia.length:e.messages.length,A=(0,O.A)((t=>{c(e.mainMessage.id,t)})),y=(0,O.A)((e=>{c(e)})),C=(0,O.A)((t=>{p({chatId:e.mainMessage.chatId,messageId:t})})),w=(0,i.Kr)((()=>e.isPaidMedia?e.mainMessage.content.paidMedia.extendedMedia.map((()=>e.mainMessage)):e.messages),[e]),{width:b,height:I}=r.containerStyle;return(0,we.Y)("div",{className:"Album",style:`width: ${b}px; height: ${I}px;`,children:w.map((function(i,c){const p=e.isPaidMedia?i.content.paidMedia?.extendedMedia[c]:void 0,g=p&&"mediaType"in p?p:p?.photo,w=p&&"mediaType"in p?p:p?.video,b=g||(0,d.yl)(i),I=w||(0,d.r_)(i).video,S=l[(0,v.bj)(i)],M=S?.progress,{dimensions:N,sides:k}=r.layout[c],Y=(0,u.wwb)((0,o.mS)(),i),P=(0,u.OEt)((0,o.mS)(),i);if(b){const o=n&&(s?c===f-1:Boolean(8&k&&4&k));return(0,we.Y)(Ke,{id:`album-media-${(0,d.GZ)(i.id,e.isPaidMedia?c:void 0)}`,photo:b,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:Y,shouldAffectAppendix:o,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?c:i.id,onClick:e.isPaidMedia?A:y,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,d.$r)(m,b),theme:h,noSelectControls:e.isPaidMedia})}if(I)return(0,we.Y)(ze,{id:`album-media-${(0,d.GZ)(i.id)}`,video:I,observeIntersectionForLoading:t,canAutoLoad:Y,canAutoPlay:P,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?c:i.id,onClick:e.isPaidMedia?A:y,onCancelUpload:C,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,d.$r)(m,I),theme:h,noSelectControls:e.isPaidMedia})}))})}));var je=n(95807),Je=n(41733);const $e=7*w.$;function qe(e,t,n,s,a,r,d){const{interactWithAnimatedEmoji:c,sendEmojiInteraction:l,sendWatchingEmojiInteraction:u}=(0,o.ko)(),m=(0,i.li)(),h=(0,i.li)(),g=(0,Ae.A)(n?`document${n}`:void 0,!n),f=d||$e,v=(0,je.A)(`width: ${f}px`,`height: ${f}px`,r&&!p.cp&&"cursor: pointer"),A=(0,i.li)(void 0),y=(0,i.li)(void 0),C=(0,O.A)((()=>{m.current&&(l({chatId:e,messageId:t,emoji:r,interactions:A.current}),y.current=void 0,A.current=void 0)})),w=(0,O.A)((()=>{const e=h.current;g&&(e&&(e.pause(),e.remove()),h.current=new Audio,h.current.src=g,(0,Je.A)(h.current),h.current.addEventListener("ended",(()=>{h.current=void 0}),{once:!0}))})),b=(0,O.A)((()=>{w();const n=m.current;if(!(r&&n&&t&&e))return;const{x:i,y:o}=n.getBoundingClientRect();c({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=m.current;n&&s&&s.forEach((({id:i,startSize:o,messageId:s})=>{if(o||t!==s)return;const{x:d,y:c}=n.getBoundingClientRect();u({id:i,chatId:e,emoticon:r,startSize:f,x:d,y:c,isReversed:!a}),w()}))}),[s,e,r,a,t,w,u,f]),{ref:m,size:f,style:v,handleClick:b}}const He=(0,i.ph)((0,o.EK)(((e,{customEmojiId:t,withEffects:n})=>{const i=e.customEmojis.byId[t];return{sticker:i,effect:i?.emoji&&n?(0,u.Nr8)(e,i.emoji):void 0,soundId:i?.emoji&&(0,u.tKM)(e,i.emoji),noPlay:!(0,u.BWX)(e)}}))((({isOwn:e,customEmojiId:t,messageId:n,chatId:i,activeEmojiInteractions:o,sticker:s,effect:a,soundId:r,noPlay:d,observeIntersection:c})=>{const{ref:l,size:u,style:m,handleClick:h}=qe(i,n,r,o,e,a?.emoji,(0,S.Rr)(1));return(0,we.Y)(he.A,{ref:l,documentId:t,className:(0,g.A)("AnimatedEmoji media-inner",s?.id===w.AC&&"like-sticker-thumb"),style:m,size:u,isBig:!0,noPlay:d,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(a&&o?.length),observeIntersectionForLoading:c,onClick:h})})));var Ge=n(79577);const We=(0,i.ph)((0,o.EK)(((e,{emoji:t,withEffects:n})=>({sticker:(0,u.oei)(e,t),effect:n?(0,u.Nr8)(e,t):void 0,soundId:(0,u.tKM)(e,t)})))((({isOwn:e,observeIntersection:t,forceLoadPreview:n,messageId:i,chatId:o,activeEmojiInteractions:s,sticker:a,effect:r,soundId:d})=>{const{ref:c,size:l,style:u,handleClick:m}=qe(o,i,d,s,e,r?.emoji),h=(0,B.Vz)(c,t);return(0,we.Y)(Ge.A,{sticker:a,size:l,quality:1,noLoad:!h,forcePreview:n,play:h,forceAlways:!0,ref:c,className:(0,g.A)("AnimatedEmoji media-inner",a?.id===w.AC&&"like-sticker-thumb"),style:u,onClick:m})})));var _e=n(14242),Qe=n(93809),Ze=n(68292),Xe=n(57474);const et=(0,i.ph)((({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s,asActionButton:a})=>{const{openThread:r,openFrozenAccountModal:d}=(0,o.ko)(),c=(0,Qe.A)([s],450),l=(0,U.A)(),m=(0,R.A)(),{originMessageId:h,chatId:p,messagesCount:f,lastMessageId:v,lastReadInboxMessageId:A,recentReplierIds:y,originChannelId:C}=t,w=(0,O.A)((()=>{const e=(0,o.mS)();(0,u.trm)(e)?d():r({isComments:!0,chatId:p,originMessageId:h,originChannelId:C})})),b=(0,i.Kr)((()=>{if(!y?.length)return;const e=(0,o.mS)();return y.map((t=>(0,u.PVB)(e,t))).filter(Boolean)}),[y]);if(void 0===f)return;const I=Boolean(A&&v&&A<v),S=f?l("CommentsCount","%COMMENTS_COUNT%",void 0,f).split("%").map((e=>"COMMENTS_COUNT"===e?(0,we.Y)(Ze.A,{text:(0,_e.Vw)(m,f)}):e)):void 0;return(0,we.FD)("div",{"data-cnt":(0,_e.Vw)(m,f),className:(0,g.A)("CommentButton",I&&"has-unread",n&&"disabled",e&&"CommentButton-custom-shape",s&&"loading",a&&"as-action-button"),dir:l.isRtl?"rtl":"ltr",onClick:w,role:"button",tabIndex:0,children:[(0,we.Y)(ye.A,{name:"comments-sticker",className:(0,g.A)("CommentButton_icon-comments",s&&c&&"CommentButton_hidden")}),!b?.length&&(0,we.Y)(ye.A,{name:"comments"}),Boolean(b?.length)&&(0,we.Y)("div",{className:"recent-repliers",dir:l.isRtl?"rtl":"ltr",children:b.map((e=>(0,we.Y)(me.A,{size:"small",peer:e},e.id)))}),(0,we.Y)("div",{className:"label",dir:"auto",children:f?S:l("LeaveAComment")}),(0,we.FD)("div",{className:"CommentButton_right",children:[s&&(0,we.Y)(Xe.A,{className:(0,g.A)("CommentButton_loading",!c&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,we.Y)(ye.A,{name:"next",className:(0,g.A)("CommentButton_icon-open",s&&c&&"CommentButton_hidden")})]})]})}));var tt=n(85982),nt=n(64713);const it="ReDHhQHm";function ot(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const st=(0,o.EK)(((e,{contact:t})=>{const{countryList:{phoneCodes:n}}=e;return{user:(0,u.mBe)(e,t.userId),phoneCodeList:n}}))((({contact:e,user:t,phoneCodeList:n,noUserColors:i})=>{const s=(0,U.A)(),{openChat:a,openAddContactDialog:r,showNotification:c,openChatWithInfo:l}=(0,o.ko)(),{phoneNumber:u,userId:m}=e,h="0"!==m,p=h&&t&&(0,d.Gh)(t),g=(0,O.A)((()=>{a({id:m})})),f=(0,O.A)((()=>{r({userId:t?.id})})),v=(0,O.A)((()=>{t?l({id:m}):((0,tt.eM)(u),c({message:s("PhoneCopied")}))}));return(0,we.FD)(Ce.A,{noUserColors:i,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,we.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,we.Y)(me.A,{size:"medium",peer:t,text:ot(e)}),(0,we.FD)("div",{className:"fpYynE5s",children:[(0,we.Y)("div",{className:"_PNTJc_V",children:t?(0,d.Yg)(t):ot(e)}),(0,we.Y)("div",{className:"JP_3wes8",children:(0,nt.Ox)(n,u)})]})]}),h&&(0,we.FD)(we.FK,{children:[(0,we.Y)("div",{className:"_OSJcuqH"}),(0,we.FD)("div",{className:"Blui4M4G",children:[(0,we.Y)(Ee.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:it,children:s("SharedContactMessage")}),p&&(0,we.Y)(Ee.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:it,children:s("SharedContactAdd")})]})]})]})}));var at=n(80089),rt=n(80464);const dt=e=>{const{isOpen:t}=e,n=(0,rt.A)(at.ar.Extra,"ContextMenuContainer",!t);return n?(0,we.Y)(n,{...e}):void 0};var ct=n(18501),lt=n(57675),ut=n(32581);const mt={color:0},ht=(0,i.ph)((({factCheck:e,isToggleDisabled:t})=>{const n=(0,U.A)(),o=(0,i.li)(),s=(0,i.li)(),{isCollapsed:a,isCollapsible:r,setIsCollapsed:d}=(0,lt.A)(o,4,s),c=(0,i.Kr)((()=>{if(e.countryCode&&n.code)return new Intl.DisplayNames([n.code],{type:"region"}).of(e.countryCode)}),[e.countryCode,n.code]),l=!t&&a,u=(0,O.A)((()=>{d(!1)})),m=(0,O.A)((()=>{d((e=>!e))}));if(e.text)return(0,we.FD)(Ce.A,{peerColor:mt,className:"HMB5LgeX",onClick:l?u:void 0,children:[(0,we.FD)("div",{ref:s,className:(0,g.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,we.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,we.Y)("div",{ref:o,className:"k_dGolcu",children:(0,ct.fd)({text:e.text.text,entities:e.text.entities})}),(0,we.Y)(ut.A,{className:"qRaSs5iA"}),(0,we.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",c)})]}),r&&(0,we.Y)("div",{className:(0,g.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:m,"aria-hidden":!0,children:(0,we.Y)(ye.A,{name:a?"down":"up"})})]})}));var pt=n(55158);const gt=(0,i.ph)((({message:e,canAutoLoadMedia:t})=>{const{clickBotInlineButton:n}=(0,o.ko)(),i=e.content.game,{title:s,description:a}=i,r=(0,d.zb)(i),c=(0,d.ih)(i),l=(0,Ae.A)(r,!t),u=(0,Ae.A)(c,!t);return(0,we.FD)("div",{className:"Game",children:[(0,we.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{n({chatId:e.chatId,messageId:e.id,button:e.inlineButtons[0][0]})},children:[!l&&!u&&(0,we.Y)(pt.A,{className:"skeleton preview-content"}),l&&(0,we.Y)("img",{className:"preview-content",src:l,alt:s,draggable:!1}),u&&(0,we.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:u})]}),(0,we.Y)("div",{className:"title",children:s}),!(0,d.P5)(e)&&(0,we.Y)("div",{className:"description",children:a})]})}));var ft=n(17663),vt=n(52491),At=n(4875),yt=n(58443),Ct=n(64489),wt=n(10187);const bt="ogvcv3mr",It="MSFa9BPf",St="HfZ6SuLI",Mt="rPyyNYxK",Nt="FV70u896",kt=(0,i.ph)((0,o.EK)(((e,{message:t})=>{const{giveaway:n}=t.content,i=(0,u.hds)(e,t.chatId);return{chat:i,sender:(n?.channelIds[0]?(0,u.hds)(e,n.channelIds[0]):void 0)||(0,u.Szq)(e,t)||i,giftSticker:n&&(0,u.t0O)(e,n.months),canPlayAnimatedEmojis:(0,u.BWX)(e)}}))((({chat:e,sender:t,message:n,canPlayAnimatedEmojis:s,giftSticker:a})=>{const{openChat:r}=(0,o.ko)(),l=(0,i.li)(!1),[u,m]=(0,i.J0)(),h=(0,U.A)(),{giveaway:p,giveawayResults:f}=n.content,v=Boolean(f),{months:y,untilDate:C,prizeDescription:w,stars:b}=p||f,S=(0,d.Ie)(n),M=v?f.winnersCount:p.quantity,N=(0,A.Fm)()>C,k=(0,i.Kr)((()=>{if(v)return;const e=new Intl.DisplayNames([h.code,"en"].filter(Boolean),{type:"region"});return p?.countries?.map((t=>`${(0,vt.D0)(t)} ${e.of(t)}`)).join(", ")}),[p,v,h.code]),Y=(0,O.A)((e=>{r({id:e})})),P=(0,O.A)((async()=>{if(l.current)return;l.current=!0;const t=await(0,At.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});m(t),l.current=!1})),F=(0,O.A)((()=>{m(void 0)})),T=(0,i.Kr)((()=>{if(u)return h("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")}),[u,h]);return(0,we.FD)("div",{className:"CbpKtOey",children:[(0,we.FD)("div",{className:(0,g.A)("hjjKhvVv",v&&"JEiR48jJ"),children:[v?(0,we.Y)(Ct.A,{size:150,tgsUrl:yt.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,we.Y)(Ge.A,{sticker:a,play:s&&N,noLoop:!0,nonInteractive:!0,size:175}),(0,we.Y)("span",{className:"n_QCMv_A",children:`x${M}`})]}),v?function(e){const t=e.winnerIds;return(0,we.FD)(we.FK,{children:[(0,we.FD)("div",{className:It,children:[(0,we.Y)("strong",{className:bt,children:(0,I.A)(h("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,we.Y)("p",{className:St,children:(0,I.A)(h("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,we.Y)("strong",{className:bt,children:h("lng_prizes_results_winners")}),(0,we.Y)("div",{className:Mt,children:t.map((e=>(0,we.Y)(wt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!S,className:Nt,clickArg:e,onClick:Y})))})]}),(0,we.Y)("div",{className:It,children:(0,we.Y)("p",{className:St,children:h("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(f):function(e){const t=e.channelIds;return(0,we.FD)(we.FK,{children:[(0,we.FD)("div",{className:It,children:[(0,we.Y)("strong",{className:bt,children:(0,I.A)(h("BoostingGiveawayPrizes"),["simple_markdown"])}),w&&(0,we.FD)(we.FK,{children:[(0,we.Y)("p",{className:St,children:(0,I.A)(h("BoostingGiveawayMsgPrizes",[M,w],void 0,M),["simple_markdown"])}),(0,we.Y)(ut.A,{children:h("BoostingGiveawayMsgWithDivider")})]}),(0,we.Y)("p",{className:St,children:n?.content?.giveaway?.stars?(0,we.FD)(we.FK,{children:[(0,I.A)(h("Chat.Giveaway.Message.Stars.PrizeText",h("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,we.Y)("br",{}),(0,I.A)(h("AmongWinners",M),["simple_markdown"])]}):(0,we.FD)(we.FK,{children:[(0,I.A)(h("Chat.Giveaway.Info.Subscriptions",M),["simple_markdown"]),(0,we.Y)("br",{}),(0,I.A)(h("ActionGiftPremiumSubtitle",h("Chat.Giveaway.Info.Months",y)),["simple_markdown"])]})})]}),(0,we.FD)("div",{className:It,children:[(0,we.Y)("strong",{className:bt,children:(0,I.A)(h("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,we.Y)("p",{className:St,children:(0,I.A)(h("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,we.Y)("div",{className:Mt,children:t.map((e=>(0,we.Y)(wt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!S,className:Nt,clickArg:e,onClick:Y})))}),k&&(0,we.Y)("span",{children:(0,I.A)(h("Chat.Giveaway.Message.CountriesFrom",k))})]}),(0,we.FD)("div",{className:It,children:[(0,we.Y)("strong",{className:bt,children:(0,I.A)(h("BoostingWinnersDate"),["simple_markdown"])}),(0,we.Y)("p",{className:St,children:(0,ft.L2)(1e3*C,h.code,!0)})]})]})}(p),(0,we.Y)(Ee.A,{className:"jMBw7STU",color:"adaptive",size:"smaller",onClick:P,children:h("BoostingHowItWork")}),(0,we.Y)(Le.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:T,confirmHandler:F,onClose:F,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,c.vj)(t)?(0,d.Js)(h,t):(0,d.Yg)(t),i=(0,ft.U)(h,1e3*C),s=p?.channelIds?p.channelIds.length-1:0,a=h("Chat.Giveaway.Info.OtherChannels",s),r=s>0,l=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",m=e?h("Chat.Giveaway.Info.Months",y):h("Stars",b,"i"),g=h(l,[n,M,m],void 0,M),f=w?h("BoostingGiveawayHowItWorksIncludeText",[n,M,w],void 0,M):void 0;let v="";v=e?r?"BoostingGiveawayHowItWorksSubTextSeveralEnd":"BoostingGiveawayHowItWorksSubTextEnd":r?"BoostingGiveawayHowItWorksSubTextSeveral":"BoostingGiveawayHowItWorksSubText";let A=h(v,[i,M,n,s],void 0,M);e&&u.activatedCount&&(A+=` ${h("BoostingGiveawayUsedLinksPlural",u.activatedCount)}`);let S="";e&&(S=u.isRefunded?h("BoostingGiveawayCanceledByPayment"):h(u.isWinner?"BoostingGiveawayYouWon":"BoostingGiveawayYouNotWon"));let N="";if(e);else if(u.disallowedCountry)N=h("BoostingGiveawayNotEligibleCountry");else if(u.adminDisallowedChatId){const e=(0,o.mS)().chats.byId[u.adminDisallowedChatId],t=e&&(0,d.Js)(h,e);N=h("BoostingGiveawayNotEligibleAdmin",t)}else if(u.joinedTooEarlyDate){const e=(0,ft.U)(h,1e3*u.joinedTooEarlyDate);N=h("BoostingGiveawayNotEligible",e)}else N=u.isParticipating?r?h("Chat.Giveaway.Info.ParticipatingMany",[n,s]):h("Chat.Giveaway.Info.Participating",n):r?h("Chat.Giveaway.Info.NotQualifiedMany",[n,a,i]):h("Chat.Giveaway.Info.NotQualified",[n,i]);return(0,we.FD)(we.FK,{children:[S&&(0,we.Y)("p",{className:"ZQ4aVVkI",children:(0,I.A)(S,["simple_markdown"])}),(0,we.Y)("p",{children:(0,I.A)(g,["simple_markdown"])}),f&&(0,we.Y)("p",{children:(0,I.A)(f,["simple_markdown"])}),(0,we.Y)("p",{children:(0,I.A)(A,["simple_markdown"])}),N&&(0,we.Y)("p",{children:(0,I.A)(N,["simple_markdown"])})]})}()})]})})));var Yt=n(85449);const Pt=(0,i.ph)((({message:e,onClick:t})=>{const n=(0,U.A)(),o=e=>{const{type:t}=e;switch(t){case"url":if(!r.OFc.test(e.url))return(0,we.Y)(ye.A,{className:"corner-icon",name:"arrow-right"});break;case"urlAuth":return(0,we.Y)(ye.A,{className:"corner-icon",name:"arrow-right"});case"buy":case"receipt":return(0,we.Y)(ye.A,{className:"corner-icon",name:"card"});case"switchBotInline":return(0,we.Y)(ye.A,{className:"corner-icon",name:"share-filled"});case"webView":case"simpleWebView":return(0,we.Y)(ye.A,{className:"corner-icon",name:"webapp"});case"copy":return(0,we.Y)(ye.A,{className:"corner-icon",name:"copy"});case"suggestedMessage":if("suggestChanges"===e.buttonType)return(0,we.Y)(ye.A,{className:"left-icon",name:"edit"});if("approve"===e.buttonType)return(0,we.Y)(ye.A,{className:"left-icon",name:"check"});if("decline"===e.buttonType)return(0,we.Y)(ye.A,{className:"left-icon",name:"close"})}},s=(0,i.Kr)((()=>{const t=[];return e.inlineButtons.forEach((e=>{t.push(e.map((e=>(0,Yt.A)(n,e))))})),t}),[n,e.inlineButtons]);return(0,we.Y)("div",{className:"InlineButtons",children:e.inlineButtons.map(((n,i)=>(0,we.Y)("div",{className:"row",children:n.map(((n,a)=>(0,we.FD)(Ee.A,{size:"tiny",ripple:!0,disabled:"unsupported"===n.type||"suggestedMessage"===n.type&&n.disabled,onClick:()=>t({chatId:e.chatId,messageId:e.id,button:n}),children:[o(n),(0,we.Y)("span",{className:"inline-button-text",children:s[i][a]})]})))})))})}));var Ft=n(17142),Tt=n(40435),Dt=n(37859),xt=n(61097);const Et=(0,i.ph)((({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:o,theme:s,forcedWidth:a})=>{const c=(0,i.li)(),l=(0,U.A)(),u=(0,R.A)(),m=(0,d.NO)(e),{title:h,description:p,amount:g,currency:f,isTest:v,photo:A}=m,y=(0,Ae.A)((0,d.cy)(A)),C=Boolean(a),w=(0,xt.A)(y,!C),b=e.id;(0,Dt.A)((([e])=>{if(t){if(y){const e=c.current.closest(r.KFG);(0,Tt.A)(y,!1,b,o,s).then((t=>{(0,ee.RK)((()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")}))}))}}else e&&c.current.closest(r.KFG).removeAttribute(r.D3G)}),[t,y,n,o,s,b]);const S=a||A?.dimensions?.width,M=(0,je.A)(A?.dimensions&&`width: ${S}px`,A?.dimensions&&`aspect-ratio: ${A.dimensions.width} / ${A.dimensions.height}`,Boolean(!A?.dimensions&&a)&&`width: ${a}px`);return(0,we.FD)("div",{ref:c,className:"Invoice",children:[h&&(0,we.Y)("p",{className:"title",children:(0,I.A)(h)}),p&&(0,we.Y)("div",{className:"info",children:(0,I.A)(p,["emoji","br"])}),(0,we.FD)("div",{className:"description "+(A?"has-image":""),children:[Boolean(A)&&(0,we.FD)("div",{className:"invoice-image-container",children:[C&&(0,we.Y)("canvas",{ref:w,className:"thumbnail blurred-bg"}),y&&(0,we.Y)("img",{className:"invoice-image",src:y,alt:"",style:M,crossOrigin:"anonymous",draggable:!1}),!y&&A&&(0,we.Y)(pt.A,{width:S,height:A.dimensions?.height,forceAspectRatio:!0})]}),(0,we.FD)("p",{className:"description-text",children:[(0,Ft.vv)(u,g,f,{iconClassName:"invoice-currency-icon"}),v&&(0,we.Y)("span",{className:"test-invoice",children:l("PaymentTestInvoice")})]})]})]})}));var Lt=n(32625),Bt=n(27860);const Rt={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},Ot=(0,i.ph)((({message:e,isConnected:t})=>{const{openInvoice:n,loadExtendedMedia:i}=(0,o.ko)(),s=(0,U.A)(),a=(0,d.NO)(e),{chatId:r,id:c}=e,l=(0,O.A)((()=>{i({chatId:r,ids:[c]})}));(0,Lt.A)(l,t?3e4:void 0);const{amount:u,currency:m,extendedMedia:h}=a,{width:p,height:f,thumbnail:v,duration:A}=h,y=(0,O.A)((()=>{n({type:"message",chatId:r,messageId:c,isExtendedMedia:!0})}));return(0,we.FD)("div",{className:(0,g.A)(Rt.root,"media-inner"),onClick:y,children:[(0,we.Y)(Bt.A,{thumbDataUri:v?.dataUri,width:p,height:f,isVisible:!0,className:Rt.spoiler}),Boolean(A)&&(0,we.Y)("div",{className:Rt.duration,children:(0,ft.QO)(A)}),(0,we.FD)("div",{className:Rt.buy,children:[(0,we.Y)(ye.A,{name:"lock",className:Rt.lock}),s("Checkout.PayPrice",(0,Ft.Ad)(u,m))]})]})}));var Ut=n(47526),Kt=n(14737),zt=n(30857),Vt=n(38691);const jt=n.p+"map-pin.899635f6fe777c28998a.svg",Jt=24*Math.PI,$t=1e-4,qt={width:400,height:300,zoom:16};function Ht(){return(0,we.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,we.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,we.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,we.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,we.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 Gt=(0,i.ph)((({message:e,peer:t})=>{const{openMapModal:n}=(0,o.ko)(),s=(0,i.li)(),a=(0,i.li)(),r=(0,U.A)(),c=(0,zt.A)(),l=(0,d.fB)(e),{mediaType:u,geo:m}=l,h=(0,A.Fm)(),p=(0,d.vz)(e),f="geoLive"!==u||p?void 0:e.date+l.period-h,[v,y]=(0,i.J0)(m),C="venue"===u||"geoLive"===u&&!p,{width:w,height:b,zoom:I}=qt,S=(0,Vt.A)(),M=(0,d.rt)(v,w,b,I,S),N=(0,Ae.A)(M),k=(0,K.A)(N,!0),Y=N||k,P=(0,i.Kr)((()=>{if("geoLive"!==u||!v.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=v;return t/(0,Ut._u)(e,I)}),[u,v,I]),F=(0,O.A)((t=>{if("geoLive"!==u)return;const n=t.lastElementChild,i=t.firstElementChild,o=e.date+l.period-(0,A.Fm)(),s=(1-o/l.period)*Jt,a=(0,ft.dq)(r,1e3*o);i.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)}));function T(){const e=(0,g.A)("pin",u,p&&"expired");if("geoLive"===u)return(0,we.FD)("div",{className:e,children:[(0,we.Y)(Ht,{}),(0,we.Y)(me.A,{peer:t,className:"location-avatar"}),void 0!==l.heading&&(0,we.Y)("div",{className:"direction",style:`--direction: ${l.heading}deg`})]});if("venue"===u){const t=(0,Ut.PP)(l.venueType),n=(0,Ut.KE)(l.venueType);if(n)return(0,we.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,we.Y)(Ht,{}),(0,we.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,we.Y)("img",{className:e,draggable:!1,src:jt,alt:""})}return(0,i.Nf)((()=>{a.current&&F(a.current)}),[F]),(0,i.vJ)((()=>{Math.abs(m.lat-v.lat)<$t&&Math.abs(m.long-v.long)<$t?v.accuracyRadius!==m.accuracyRadius&&y({...v,accuracyRadius:m.accuracyRadius}):y(m)}),[m,v]),(0,Kt.A)((()=>{c()}),p?void 0:1e3*(f||0)),(0,Lt.A)((()=>{(0,ee.RK)((()=>{const e=a.current;e&&F(e)}))}),f?1e3:void 0),(0,we.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:v,zoom:I})},children:[(0,we.FD)("div",{className:"map-wrapper",children:[Y?(0,we.Y)("img",{className:"full-media map",src:Y,alt:"Location on a map",draggable:!1,style:`width: ${qt.width}px; height: ${qt.height}px;`}):(0,we.Y)(pt.A,{width:w,height:b}),function(){if(Y)return(0,we.FD)(we.FK,{children:[Boolean(P)&&!p&&(0,we.Y)("div",{className:"location-accuracy",style:`width: ${2*P}px; height: ${2*P}px`}),T()]})}()]}),function(){if(C)return"venue"===u?(0,we.FD)("div",{className:"location-info",children:[(0,we.Y)("div",{className:"location-info-title",children:l.title}),(0,we.Y)("div",{className:"location-info-subtitle",children:l.address})]}):"geoLive"===u?(0,we.FD)("div",{className:"location-info",children:[(0,we.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,we.Y)("div",{className:"location-info-subtitle",children:(0,ft.IF)(r,h,e.editDate)}),!p&&(0,we.FD)("div",{className:"geo-countdown",ref:a,children:[(0,we.Y)("span",{className:"geo-countdown-text"}),(0,we.Y)("svg",{width:"32px",height:"32px",children:(0,we.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":Jt,"stroke-dashoffset":"0"})})]})]}):void 0}()]})}));var Wt=n(48906),_t=n(97676),Qt=n(48775),Zt=n(45);const Xt=(0,i.ph)((({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:d,isTranslated:c,isPinned:l,withFullDate:u,effectEmoji:m,onClick:h,onTranslationClick:p,onEffectClick:f,onOpenThread:v,paidMessageStars:A})=>{const{showNotification:y}=(0,o.ko)(),[C,w]=(0,L.A)(),b=(0,U.A)(),S=(0,R.A)();function M(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const N=(0,i.Kr)((()=>{if(!C)return;const t=(0,ft.L2)(1e3*e.date,b.code,void 0,b.timeFormat),n=e.isEdited&&(0,ft.L2)(1e3*e.editDate,b.code,void 0,b.timeFormat),i=e.forwardInfo&&(0,ft.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),b.code,void 0,b.timeFormat);let o=t;return n&&(o+="\n",o+=S("MessageTooltipEditedDate",{date:n})),i&&(o+="\n",o+=S("MessageTooltipForwardedDate",{date:i})),o}),[C,b,e,b.timeFormat]),k=(0,i.Kr)((()=>{if(!e.viewsCount)return;let t=S("MessageTooltipViews",{count:S.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=S("MessageTooltipForwards",{count:S.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t}),[S,e.forwardsCount,e.viewsCount]),Y=(0,i.Kr)((()=>{const e=a?.messagesCount;if(e)return S("MessageTooltipReplies",{count:e},{pluralValue:e})}),[S,a]),P=(0,i.Kr)((()=>{const t=(0,ft.fU)(b,1e3*e.date);return u?(0,ft.be)(b,1e3*(e.forwardInfo?.date||e.date),!0):t}),[b,e.date,e.forwardInfo?.date,u]),F=(0,g.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,we.FD)("span",{className:F,dir:S.isRtl?"rtl":"ltr",onClick:h,"data-ignore-on-paste":!0,children:[m&&(0,we.Y)("span",{className:"message-effect-icon",onClick:f,children:(0,I.A)(m)}),c&&(0,we.Y)(ye.A,{name:"language",className:"message-translated",onClick:p}),Boolean(e.viewsCount)&&(0,we.FD)(we.FK,{children:[(0,we.Y)("span",{className:"message-views",title:k,children:(0,_e.Vw)(S,e.viewsCount)}),(0,we.Y)(ye.A,{name:"channelviews"})]}),!d&&Boolean(a?.messagesCount)&&(0,we.FD)("span",{onClick:function(e){e.stopPropagation(),v()},className:"message-replies-wrapper",title:Y,children:[(0,we.Y)("span",{className:"message-replies",children:(0,we.Y)(Ze.A,{text:(0,_e.Vw)(S,a.messagesCount)})}),(0,we.Y)(ye.A,{name:"reply-filled"})]}),l&&(0,we.Y)(ye.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,we.Y)("span",{className:"message-signature",children:(0,I.A)(n)}),Boolean(A)&&(0,we.Y)("span",{className:"message-price",children:(0,Qt.U2)(S,A,{asFont:!0,className:"message-price-star-icon",containerClassName:"message-price-stars-container"})}),(0,we.FD)("span",{className:"message-time",title:N,onMouseEnter:w,children:[e.forwardInfo?.isImported&&(0,we.FD)(we.FK,{children:[(0,we.Y)("span",{className:"message-imported",onClick:M,children:(0,ft.L2)(1e3*e.forwardInfo.date,S.code,!0)}),(0,we.Y)("span",{className:"message-imported",onClick:M,children:S("MessageMetaImported")})]}),e.isEdited&&`${S("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${S("MessageMetaApproximate")} `,P]}),t&&(0,we.Y)(Zt.A,{status:t}),r&&r()]})}));var en=n(4262);const tn=(0,i.ph)((({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,o.ko)(),a=(0,U.A)(),{isVideo:r,reason:d,duration:c}=e,l=t.isOutgoing,u="missed"===d,m="busy"===d||void 0===c,h=(0,O.A)((()=>{s({isVideo:r,userId:n})})),f=(0,i.Kr)((()=>e.duration?(0,ft.zA)(a,e.duration):void 0),[a,e.duration]),v=(0,ft.fU)(a,1e3*t.date);return(0,we.FD)("div",{className:"wqsZyy8u",children:[(0,we.Y)(Ee.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:h,className:"NGmo4ADz",disabled:!p.OL,ariaLabel:a(l?"CallAgain":"CallBack"),children:(0,we.Y)(ye.A,{name:r?"video-outlined":"phone"})}),(0,we.FD)("div",{className:"iFn6m6hd",children:[(0,we.Y)("div",{className:"l8QfocIQ",children:a((0,en.fB)(e,t.isOutgoing))}),(0,we.FD)("div",{className:"rF5tkx92",children:[(0,we.Y)(ye.A,{name:"arrow-right",className:(0,g.A)("ONmpzmUS",u&&"Alra_BWu",m&&"J7xsuCAm",!l&&"BfgDXljM")}),(0,we.Y)("span",{className:"kKPKwFzu",children:f?a("CallMessageWithDuration",[v,f]):v})]})]})]})}));var nn=n(98607);const on=(0,i.ph)((({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:d}=(0,o.ko)(),c=(0,U.A)(),l=(0,R.A)(),u=!e.isBought,m=(0,i.Kr)((()=>{const t=c("UnlockPaidContent",e.starsAmount);return(0,nn.i)(t,r.Cyx,(0,we.Y)(Me.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))}),[c,e]),h=(0,O.A)((e=>{d({type:"message",chatId:t,messageId:n}),(0,y.A)(e)}));return(0,we.FD)("div",{className:"mVaSjZRJ",onClick:u?h:void 0,children:[a,u&&(0,we.Y)(Ee.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,we.Y)("span",{className:"gLaaVQXr",children:m})}),e.isBought&&(0,we.Y)("div",{className:(0,g.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,Qt.U2)(l,e.starsAmount):c("Chat.PaidMedia.Purchased")})]})}));var sn=n(26875),an=n(77561),rn=n(1087);function dn(e,t){return t>0?(e/t*100).toFixed():0}const cn=({answer:e,voteResults:t,totalVoters:n,maxVotersCount:o,correctResults:s,shouldAnimate:a})=>{const r=(0,R.A)(),d=t&&t.find((t=>t.option===e.option)),c=0===s.length||-1!==s.indexOf(e.option),l=s.length>0&&c||d?.isChosen,u=d?dn(d.votersCount,n||0):0,[m,h]=(0,i.J0)(a?0:u),p=d?dn(d.votersCount,o||0):0,f=m!==u;if((0,i.vJ)((()=>{a&&h(u)}),[a,u]),!t||!d)return;const v=`width: ${p}%; transform:scaleX(${f?0:1})`;return(0,we.FD)("div",{className:"PollOption",dir:r.isRtl?"rtl":void 0,children:[(0,we.FD)("div",{className:"poll-option-share "+("100"===u?"limit-width":""),children:[u,"%",l&&(0,we.Y)("span",{className:(0,g.A)("poll-option-chosen",!c&&"wrong",a&&"animate"),children:(0,we.Y)(ye.A,{name:c?"check":"close",className:"poll-option-icon"})})]}),(0,we.FD)("div",{className:"poll-option-right",children:[(0,we.Y)("div",{className:"poll-option-text",dir:"auto",children:(0,ct.fd)({text:e.text.text,entities:e.text.entities})}),(0,we.FD)("div",{className:(0,g.A)("poll-option-answer",l&&!c&&"wrong"),children:[a&&(0,we.Y)("svg",{className:"poll-line",style:f?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44",children:(0,we.Y)("path",{d:"M4.47 5.33v13.6a9 9 0 009 9h13"})}),(0,we.Y)("div",{className:"poll-option-line",style:v})]})]})]})},ln=12*Math.PI;function un(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 hn(e){e.stopPropagation()}const pn=(0,i.ph)((({message:e,poll:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:s,onSendVote:a})=>{const{loadMessage:r,openPollResults:d,requestConfetti:c,showNotification:l}=(0,o.ko)(),{id:m,chatId:h}=e,{summary:p,results:g}=t,[f,y]=(0,i.J0)(!1),[C,w]=(0,i.J0)([]),[b,I]=(0,i.J0)(!1),[S,M]=(0,i.J0)(!p.closed&&p.closeDate&&p.closeDate>0?Math.min(p.closeDate-(0,A.Fm)(),p.closePeriod):0),N=(0,i.li)(),k=(0,i.li)(),{results:Y,totalVoters:P}=g,F=Y&&Y.some((e=>e.isChosen)),T=!p.closed&&!F,D=!T&&p.isPublic&&Number(g.totalVoters)>0,x=T&&p.multipleChoice,E=g.recentVoterIds,L=Y?Math.max(...Y.map((e=>e.votersCount))):P,B=(0,i.Kr)((()=>Y?.filter((e=>e.isCorrect)).map((e=>e.option))||[]),[Y]),R=(0,i.Kr)((()=>p.answers.map((e=>({label:(0,ct.fd)({text:e.text.text,entities:e.text.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s}),value:e.option,hidden:Boolean(p.quiz&&p.closePeriod&&S<=0)})))),[S,n,s,p.answers,p.closePeriod,p.quiz]);(0,i.vJ)((()=>{const e=t.results.results?.find((e=>e.isChosen));f&&e&&(e.isCorrect&&c({}),y(!1))}),[f,t.results.results,c]),(0,i.Nf)((()=>{if(S>0&&setTimeout((()=>M(S-1)),1e3),!k.current)return;S<=5&&N.current.classList.add("hurry-up");const e=(p.closePeriod-S)/p.closePeriod*ln;k.current.setAttribute("stroke-dashoffset",`-${e}`)}),[S,p.closePeriod]),(0,i.vJ)((()=>{p.quiz&&(S<=0||F&&!p.closed)&&r({chatId:h,messageId:m})}),[h,S,F,r,m,p.closed,p.quiz]),(0,i.vJ)((()=>{let e;return p.quiz&&!p.closed&&p.closePeriod&&p.closePeriod>0&&(e=window.setTimeout((()=>{r({chatId:h,messageId:m})}),1e3*p.closePeriod)),()=>{e&&window.clearTimeout(e)}}),[T,h,r,m,p.closePeriod,p.closed,p.quiz]);const K=(0,i.Kr)((()=>{const e=(0,o.mS)();return E?E.reduce(((t,n)=>{const i=(0,u.PVB)(e,n);return i&&t.push(i),t}),[]):[]}),[E]),z=(0,O.A)((e=>{w([e]),y(!0),I(!0),a([e])})),V=(0,O.A)((e=>{w(e)})),j=(0,O.A)((()=>{y(!0),I(!0),a(C)})),J=(0,O.A)((()=>{d({chatId:h,messageId:m})})),$=(0,O.A)((()=>{l({localId:(0,v.bj)(e),message:(0,ct.fd)({text:t.results.solution,entities:t.results.solutionEntities}),duration:5e3,containerSelector:"#middle-column-portals"})}));(0,i.vJ)((()=>{b&&F&&p.quiz&&g.results&&t.results.solution&&(g.results.find((e=>e.isChosen&&e.isCorrect))||$())}),[F,b,g.results,p.quiz,t.results.solution]);const q=(0,U.A)();return(0,we.FD)("div",{className:"Poll",dir:q.isRtl?"auto":"ltr",children:[(0,we.Y)("div",{className:"poll-question",children:(0,ct.fd)({text:p.question.text,entities:p.question.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s})}),(0,we.FD)("div",{className:"poll-type",children:[q(un(p)),K.length>0&&(0,we.Y)("div",{className:"poll-recent-voters",children:(0,we.Y)(sn.A,{size:"micro",peers:K})}),S>0&&T&&(0,we.FD)("div",{ref:N,className:"poll-countdown",children:[(0,we.Y)("span",{children:(0,ft.QO)(S)}),(0,we.Y)("svg",{width:"16px",height:"16px",children:(0,we.Y)("circle",{ref:k,cx:"8",cy:"8",r:6,className:"poll-countdown-progress",transform:"rotate(-90, 8, 8)","stroke-dasharray":ln,"stroke-dashoffset":"0"})})]}),p.quiz&&t.results.solution&&!T&&(0,we.Y)(Ee.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:$,ariaLabel:"Show Solution",children:(0,we.Y)(ye.A,{name:"lamp"})})]}),T&&(0,we.Y)("div",{className:"poll-answers",onClick:hn,children:x?(0,we.Y)(an.A,{options:R,selected:C,onChange:V,disabled:e.isScheduled||f,loadingOptions:f?C:void 0,isRound:!0}):(0,we.Y)(rn.A,{name:`poll-${m}`,options:R,onChange:z,disabled:e.isScheduled||f,loadingOption:f?C[0]:void 0})}),!T&&(0,we.Y)("div",{className:"poll-results",children:p.answers.map((function(e){return(0,we.Y)(cn,{shouldAnimate:b||!T,answer:e,voteResults:Y,totalVoters:P,maxVotersCount:L,correctResults:B},e.option)}))}),!D&&!x&&(0,we.Y)("div",{className:"poll-voters-count",children:mn(q,p.quiz,g.totalVoters)}),x&&(0,we.Y)(Ee.A,{isText:!0,disabled:0===C.length,size:"tiny",onClick:j,children:q("PollSubmitVotes")}),D&&(0,we.Y)(Ee.A,{isText:!0,size:"tiny",onClick:J,children:q("PollViewResults")})]})}));var gn=n(43581),fn=n(84555),vn=n(10221),An=n(18104),yn=n(14413),Cn=n(82855),wn=n(3325);const bn="GydRBA08",In=(0,i.ph)((0,o.EK)((e=>{const t=e.appConfig,n=t?.needAgeVideoVerification;return{needsAgeVerification:n}}))((({message:e,shouldLoop:t,shouldPlayEffect:n,withEffect:a,isMediaNsfw:r,onStopEffect:c,observeIntersection:l,observeIntersectionForPlaying:u,needsAgeVerification:m})=>{const{showNotification:h,openStickerSet:f,updateContentSettings:v,openAgeVerificationModal:A}=(0,o.ko)(),y=(0,U.A)(),{isMobile:C}=(0,T.Ay)(),b=(0,i.li)(),I=(0,i.li)(),S=e.content.sticker,{stickerSetInfo:M,isVideo:N,hasEffect:k}=S,Y=!e.isOutgoing,[P,F,D]=(0,L.A)(),[x,E]=(0,i.J0)(!1),R=r,[K,z,V]=(0,L.A)(R);(0,i.vJ)((()=>{R?z():V()}),[R]);const j=(0,O.A)((()=>{D(),V(),x&&v({isSensitiveEnabled:!0})})),J=S.isPreloadedGlobally?void 0:(0,d.Mw)(S,N&&!p.OF?"pictogram":"inline"),$=(0,B.Vz)(b,l),q=(0,B.Vz)(b,u),H=`sticker${S.id}?size=f`,G=(0,Ae.A)(H,!$||!k||!a,s.qZ.BlobUrl),[W,_,Q]=(0,L.A)(),Z=(0,d.VD)(S),X=(0,O.A)((()=>{Q(),c?.()}));(0,i.vJ)((()=>{k&&a&&q&&n&&_()}),[k,q,n,_,a]);const ee=k&&a&&G&&W;(0,vn.A)({anchorRef:b,overlayRef:I,isMirrored:Y,isDisabled:!ee});const te=(0,O.A)((()=>{f({stickerSetInfo:S.stickerSetInfo})})),ne=(0,O.A)((()=>{if(K)return r?m?void A():void F():void V();if(k){if(W||!a)return void h({message:y("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:S.stickerSetInfo}},actionText:y("ViewAction")});if(a)return void _()}te()})),ie="isMissing"in M,{width:oe,height:se}=(0,w.bu)(S,C),ae=(0,g.A)("media-inner","FPceNkgD",ie&&"hruUWBuj",k&&Y&&bn);return(0,we.FD)("div",{ref:b,className:ae,style:`width: ${oe}px; height: ${se}px;`,onClick:ie?void 0:ne,children:[(0,we.Y)(Cn.A,{containerRef:b,sticker:S,fullMediaHash:J,fullMediaClassName:"full-media",size:oe,shouldLoop:t,noLoad:!$,noPlay:!q,withSharedAnimation:!0}),(0,we.Y)(Bt.A,{isVisible:K,withAnimation:!0,thumbDataUri:Z,width:oe,height:se,className:"media-spoiler",isNsfw:r}),ee&&(0,we.Y)(wn.A,{children:(0,we.Y)(An.A,{ref:I,className:(0,g.A)("WMMaWlOL",Y&&bn),tgsUrl:G,size:1.49*oe,play:!0,isLowPriority:!0,noLoop:!0,onEnded:X},H)}),(0,we.Y)(yn.A,{isOpen:P,onClose:D,shouldAlwaysShow:x,onAlwaysShowChanged:E,confirmHandler:j})]})})));var Sn=n(45470),Mn=n(14),Nn=n(50680),kn=n(59816);const Yn=(0,i.ph)((function({story:e,isPreview:t,isProtected:n,isConnected:s}){const{openStoryViewer:a,loadPeerStoriesByIds:r,showNotification:c}=(0,o.ko)(),l=(0,U.A)(),{isMobile:u}=(0,T.Ay)(),m=e&&"isDeleted"in e,h=e&&"content"in e,f=h?e.content.video:void 0,v=h?(0,d.EN)(e):void 0,A=(0,Ae.A)(v),y=h?f?f.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,C=(0,Mn.A)(A,!0),{shouldRender:w,transitionClassNames:b}=(0,Nn.A)(Boolean(C)),I=(0,Sn.A)(y,m&&!t,u&&!p.QH),S=(0,g.A)("EVLTkrt1","media-inner",(!s||m)&&"AQWPv0bP",m&&"tprkr7qf",t&&"V3HabdKr");(0,i.vJ)((()=>{!e||h||m||r({peerId:e.peerId,storyIds:[e.id]})}),[e,m,h]);const M=(0,O.A)((()=>{m?c({message:l("StoryNotFound")}):a({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})}));return(0,we.FD)("div",{className:S,onClick:s?M:void 0,children:[!m&&t&&(0,we.Y)("canvas",{ref:I,className:"thumbnail blurred-bg"}),w&&(0,we.FD)(we.FK,{children:[(0,we.Y)("img",{src:C,alt:"",className:(0,g.A)("WAItYc5d",t&&"ClGe8yij",b),draggable:!1}),h&&(0,we.Y)(kn.A,{story:e,className:b})]}),m&&(0,we.FD)("span",{children:[(0,we.Y)(ye.A,{name:"story-expired",className:"nLA7VEhv"}),l("StoryExpiredSubtitle")]}),Boolean(f?.duration)&&(0,we.Y)("div",{className:"message-media-duration",children:(0,ft.QO)(f.duration)}),n&&(0,we.Y)("span",{className:"protector"})]})})),Pn=(0,i.ph)((0,o.EK)(((e,{message:t})=>{const{id:n,peerId:i}=t.content.storyData;return{story:(0,u.Msb)(e,i,n),isConnected:"connectionStateReady"===e.connectionState}}))((function({message:e,story:t,isProtected:n,isConnected:i}){const{storyData:o}=e.content;return(0,we.Y)(Yn,{story:t||o,isProtected:n,isConnected:i})}))),Fn=(0,i.ph)((0,o.EK)(((e,{message:t})=>{const{id:n,peerId:i}=t.content.storyData,o=(0,u._bp)(e,i)?.lastReadId;return{story:(0,u.Msb)(e,i,n),peer:(0,u.PVB)(e,i),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(o&&o<n)}}))((function({message:e,story:t,peer:n,isUnread:i,targetUser:s}){const{openStoryViewer:a}=(0,o.ko)(),r=(0,U.A)(),{storyData:l}=e.content,u=(0,O.A)((()=>{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})})),m=t&&"isDeleted"in t,h=t&&"content"in t,p=h?t.content.video:void 0,f=h?(0,d.EN)(t,"pictogram"):void 0,v=(0,Ae.A)(f)||p?.thumbnail?.dataUri;return(0,E.A)(l.peerId,l.id,t),(0,we.FD)("div",{className:(0,g.A)("action-message-story-mention",i&&"is-unread",h&&"with-preview"),tabIndex:0,role:"button",onClick:h?u:void 0,children:[h&&(0,we.Y)("span",{className:"story-media-wrapper",children:v&&(0,we.Y)("img",{src:v,alt:"",className:"story-media"})}),(0,we.Y)("span",{className:"story-title",children:(0,I.A)(n&&"isSelf"in n&&n.isSelf?r(m?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,d.u0)(s)):m?r("ExpiredStoryMention"):r("StoryMentionedTitle",(0,c.F9)(r,n)),["emoji","simple_markdown"])})]})}))),Tn=(0,i.ph)((0,o.EK)(((e,{message:t})=>({sender:(0,u.Y7C)(e,t),isCurrentUserPremium:(0,u.g29)(e),isSynced:e.isSynced})))((({message:e,todoList:t,sender:n,isCurrentUserPremium:s,isSynced:a})=>{const{toggleTodoCompleted:r,showNotification:d,requestConfetti:l}=(0,o.ko)(),{todo:m,completions:h}=t,{title:p,items:f,othersCanComplete:v}=m,[A,y]=(0,i.J0)([]),C=(0,i.Kr)((()=>new Set(A)),[A]),w=!e.isScheduled&&s&&a;(0,i.Nf)((()=>{const e=h?.map((e=>e.itemId.toString()))||[];y(e)}),[h]);const b=(0,R.A)(),I=(0,O.A)((e=>{e.preventDefault(),e.stopPropagation(),s||d({message:b("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:b("PremiumMore")})})),S=(0,O.A)((t=>{const n=t.find((e=>!C.has(e))),i=Array.from(C).find((e=>!t.includes(e)));r({chatId:e.chatId,messageId:e.id,completedIds:n?[Number(n)]:[],incompletedIds:i?[Number(i)]:[]}),t.length===f.length&&l({})})),M=Boolean(e.forwardInfo)||!v&&!e.isOutgoing,N=e.isOutgoing,k=(0,i.Kr)((()=>f.map((e=>{const t=v?(0,u.mBe)((0,o.mS)(),h?.find((t=>t.itemId===e.id))?.completedBy||""):void 0,n=t?(0,c.em)(b,t):void 0;return{label:(0,ct.fd)(e.title),value:e.id.toString(),user:t,subLabel:n}}))),[f,v,h,b]);return(0,we.FD)("div",{className:"todo-list",dir:b.isRtl?"auto":"ltr",children:[(0,we.FD)("div",{className:"todo-list-header",children:[(0,we.Y)("div",{className:"todo-list-title",children:(0,ct.fd)(p)}),(0,we.Y)("div",{className:"list-type",children:e.forwardInfo?b("TitleToDoList"):v?b("TitleGroupToDoList"):N?b("TitleYourToDoList"):n?b("TitleUserToDoList",{peer:(0,c.F9)(b,n)},{withNodes:!0}):b("TitleToDoList")})]}),(0,we.Y)("div",{className:"todo-list-items",children:M?(0,we.Y)("div",{className:"todo-list-items",children:k.map((e=>(0,we.FD)("div",{className:"todo-list-readonly-item",children:[(0,we.Y)("div",{className:"todo-readonly-item-checkbox",children:C.has(e.value)?(0,we.Y)(ye.A,{name:"check"}):(0,we.Y)("div",{className:"todo-item-bullet-point"})}),(0,we.Y)("div",{className:(0,g.A)("readonly-item-label",C.has(e.value)&&"completed-label"),children:e.label})]},e.value)))}):(0,we.Y)(an.A,{options:k,selected:A,onChange:S,onClickLabel:s?void 0:I,disabled:!w,isRound:!0})}),(0,we.Y)("div",{className:"completed-tasks-count",children:(0,we.Y)(Ze.A,{text:b("DescriptionCompletedToDoTasks",{number:A.length,count:k.length})})})]})})));var Dn=n(58849),xn=n(87094),En=n(39877),Ln=n(84685),Bn=n(66833),Rn=n(40558);const On=(0,i.ph)((({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:o})=>{const s=(0,i.li)(),{backdrop:a,model:r,pattern:d}=(0,Bn.uc)(e),[c,l,u]=(0,L.A)(),m=[a.centerColor,a.edgeColor];return(0,we.FD)("div",{className:(0,g.A)("interactive-gift","LaOdPURl"),onClick:o,onMouseEnter:p.TF?void 0:l,onMouseLeave:p.TF?void 0:u,children:[(0,we.Y)("div",{className:"zDnMa37m",children:(0,we.Y)(Rn.A,{className:"EdXfeKWY",backgroundColors:m,patternColor:a.patternColor,patternIcon:d.sticker})}),(0,we.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,we.Y)(Cn.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:c,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})})),Un=(0,i.ph)((0,o.EK)((e=>({canPlayAnimatedEmojis:(0,u.BWX)(e)})))((({messageWebPage:e,webPage:t,message:n,noAvatars:s,canAutoLoad:r,canAutoPlay:c,asForwarded:l,isDownloading:u=!1,isProtected:m,isConnected:h,story:p,theme:f,backgroundEmojiId:v,shouldWarnAboutSvg:A,autoLoadFileMaxSizeMb:y,lastPlaybackTimestamp:C,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onMediaClick:S,onDocumentClick:M,onContainerClick:N,onAudioPlay:k,onCancelMediaTransfer:Y})=>{const{openUrl:P,openTelegramLink:F}=(0,o.ko)(),T=(0,i.li)(),D=(0,U.A)(),x=(0,R.A)(),L=(0,O.A)((()=>{S()})),B=(0,O.A)((e=>{N?.(e)})),K="full"===t?.webpageType?t:void 0,{story:z,stickers:V}=K||{};(0,E.A)(z?.peerId,z?.id,p);const j=V?.isWithTextColor||V?.documents?.[0]?.shouldUseTextColor,J=(0,xn.A)(T,void 0,!j),$=(0,i.Kr)((()=>{const e=t?.url&&(0,Z.vG)(t?.url);if(e&&"timestamp"in e)return e.timestamp}),[t?.url]);if("full"!==t?.webpageType)return;const q=(0,O.A)((()=>{F({url:t.url})})),{siteName:H,url:G,displayUrl:W,title:_,description:Q,photo:X,video:ee,audio:te,type:ne,document:ie}=t,{mediaSize:oe}=e,se="telegram_story"===ne,ae="telegram_nft"===ne,re=p&&"isDeleted"in p?void 0:function(e){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"ViewButtonRequestJoin";case"telegram_message":return"ViewButtonMessage";case"telegram_bot":return"ViewButtonBot";case"telegram_voicechat":return"ViewButtonVoiceChat";case"telegram_livestream":return"ViewButtonVoiceChatChannel";case"telegram_megagroup":case"telegram_chat":return"ViewButtonGroup";case"telegram_channel":return"ViewButtonChannel";case"telegram_user":return"ViewButtonUser";case"telegram_botapp":return"ViewButtonBotApp";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"ViewButtonStory";case"telegram_channel_boost":case"telegram_group_boost":return"ViewButtonBoost";case"telegram_stickerset":return"ViewButtonStickerset";case"telegram_emojiset":return"ViewButtonEmojiset";case"telegram_nft":return"ViewButtonGiftUnique";default:return}}(V?.isEmoji?"telegram_emojiset":ne),de=re&&x(re),ce=(0,Dn.A)(Q,170),le=Boolean(ce||_||H);let me=Boolean(V);le&&t?.photo&&!t.video&&!t.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,d.Xn)(e.photo)||{};return!(!n||!i||n!==i||e.hasLargeMedia)}(t,oe));const he=(X||ee)&&S&&!me,ge=(0,g.A)("WebPage",me&&"with-square-photo",!X&&!ee&&"without-media",ee&&"with-video",!le&&"no-article",ie&&"with-document",de&&"with-quick-button",ae&&"with-gift");return(0,we.FD)(Ce.A,{className:ge,"data-initial":(H||W)[0],dir:D.isRtl?"rtl":"auto",onClick:B,children:[(0,we.FD)("div",{className:(0,g.A)("WebPage--content",se&&"is-story",ae&&"is-gift"),children:[v&&(0,we.Y)(En.A,{emojiDocumentId:v,className:"WebPage--background-icons"}),se&&(0,we.Y)(Yn,{story:p,isProtected:m,isConnected:h,isPreview:!0}),ae&&(0,we.Y)(On,{gift:t.gift,observeIntersectionForLoading:w,observeIntersectionForPlaying:b,onClick:q}),le&&(0,we.FD)("div",{className:(0,g.A)("WebPage-text","WebPage-text_interactive"),onClick:()=>P({url:G,shouldSkipModal:e.isSafe}),children:[(0,we.Y)(Ln.A,{className:"site-name",url:G,text:H||W}),_&&(0,we.Y)("p",{className:"site-title",children:(0,I.A)(_)}),ce&&!ae&&(0,we.Y)("p",{className:"site-description",children:(0,I.A)(ce,["emoji","br"])})]}),X&&!ae&&!ee&&!ie&&(0,we.Y)(Oe.A,{photo:X,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersection:w,noAvatars:s,canAutoLoad:r,size:me?"pictogram":"inline",asForwarded:l,nonInteractive:!he,isDownloading:u,isProtected:m,theme:f,onClick:he?L:void 0,onCancelUpload:Y}),ee&&(0,we.Y)(Ue.A,{video:ee,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:w,noAvatars:s,canAutoLoad:r,canAutoPlay:c,asForwarded:l,isDownloading:u,isProtected:m,lastPlaybackTimestamp:C||$,onClick:he?L:void 0,onCancelUpload:Y}),te&&(0,we.Y)(ue.Ay,{theme:f,message:n,origin:a.d9.Inline,noAvatars:s,isDownloading:u,onPlay:k,onCancelUpload:Y}),ie&&(0,we.Y)(pe.A,{document:ie,message:n,observeIntersection:w,autoLoadFileMaxSizeMb:y,onMediaClick:M,onCancelUpload:Y,isDownloading:u,shouldWarnAboutSvg:A}),V&&(0,we.Y)("div",{ref:T,className:(0,g.A)("media-inner","square-image",V.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:V.documents.map((e=>(0,we.Y)("div",{className:"WebPage--sticker",children:(0,we.Y)(Cn.A,{containerRef:T,sticker:e,shouldLoop:!0,size:V.isEmoji?38:80,customColor:J,observeIntersectionForPlaying:b,observeIntersectionForLoading:w})},e.id)))})]}),de&&(fe=de,(0,we.Y)(Ee.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!0,onClick:q,children:fe}))]});var fe}))),Kn=1.75*w.$,zn=2.25*w.$,Vn=(0,i.ph)((0,o.EK)(((e,t)=>{const{focusedMessage:n,forwardMessages:i,activeReactions:o,activeEmojiInteractions:a,loadingThread:c}=(0,u.nTw)(e),{message:g,album:A,withSenderName:y,withAvatar:C,threadId:w,messageListType:b,isLastInDocumentGroup:I,isFirstInGroup:S}=t,{id:M,chatId:N,viaBotId:k,isOutgoing:Y,forwardInfo:P,transcriptionId:F,isPinned:T,viaBusinessBotId:D,effectId:x,paidMessageStars:E}=g,L=(0,u.k9R)(e,g),{shouldWarnAboutSvg:B}=(0,h.l)(e),R=(0,f.L8)(N),O=(0,u.hds)(e,N),U=(0,u.nZ4)(e,N),K=(0,d.DX)(N),z=(0,d.Qe)(N),V=O&&(0,d.WX)(O),j=O&&(0,d.YE)(O),J=R?void 0:(0,u.AWZ)(e,N),$=L?.story,q=$?(0,u.Msb)(e,$.peerId,$.id):void 0,H=i.messageIds&&i.messageIds.includes(M),G=!U&&(0,d.zP)(g),W=y||C||G,_=(0,u.Y7C)(e,g),Q=(0,u.Szq)(e,g),Z=k?(0,u.mBe)(e,k):void 0,X=_?.id&&j?J?.adminMembersById?.[_?.id]:void 0,ee=g.id===w,{replyToMsgId:te,replyToPeerId:ne,replyFrom:ie}=(0,l.Q)(g)||{},{peerId:oe,storyId:se}=(0,l.W)(g)||{},ae=te&&te===w,re=(0,u.gMr)(e,g),de=P||ie,ce=re?(0,u.Y7C)(e,re):!de||K||z?void 0:(0,u.HdA)(e,de),le=re&&(0,u.Szq)(e,re),ue=ne?(0,u.hds)(e,ne):void 0,me=!K&&!z&&ue&&!(0,d.gA)(ue)&&(ue.isNotJoined||(0,u._ls)(e,ue.id)),he="topicCreate"===re?.content.action?.type,pe=se&&oe?(0,u.Msb)(e,oe,se):void 0,ge=oe?(0,u.PVB)(e,oe):void 0,fe=(0,u.ldX)(e,g),ve="thread"===b&&(A?A.messages.some((t=>(0,u.nJv)(e,t,w))):(0,u.nJv)(e,g,w)),{direction:Ae,noHighlight:ye,isResizingContainer:Ce,quote:we,quoteOffset:be,scrollTargetPosition:Ie}=ve&&n||{},Se=(0,u.TCk)(e),Me=Se?.results?.query&&`${Se.isHashtag?"#":""}${Se.results.query}`,Ne=(0,d.wb)(g),ke=Ne&&(0,u.oei)(e,Ne)?Ne:void 0,Ye=(0,d.Jw)(g);let Pe;Pe=A?.messages?A.messages.every((({id:t})=>(0,u.H1_)(e,t))):(0,u.H1_)(e,M);const Fe="thread"===b&&(0,u.tOf)(e,g,w),Te=(0,u.yuw)(e),De=(0,m.iS)(e,g),xe=De&&(0,d.$r)(Te,De),Ee=(0,u.Vw0)(e,N,A?.commentsMessage?.id||M),Le=Boolean(g.groupedId)&&!g.isInAlbum,Be=Le?(0,u.D_S)(e,N,g.groupedId)[0]:void 0,Re=Le?I?(0,u.O5q)(e,N,Be):void 0:g,Oe=O?.unreadReactions?.includes(g.id),Ue=w===s.l3&&O?.isForum&&S,Ke=Ue?(0,u.nkm)(e,g):void 0,ze=(0,u.RnX)(e,N),Ve=(0,u.Rny)(e,N,g.id),je=(0,u.qZq)(e,N),Je=p.CM&&e.settings.byKey.canTranslate&&!je,$e="connectionStateReady"===e.connectionState,qe=Boolean(Re&&o[(0,v.bj)(Re)]?.length),He=(0,u.g29)(e),Ge=_&&(0,u.nZ4)(e,_.id)?J?.boostsApplied??g.senderBoosts:g.senderBoosts,We=O?.boostLevel||0,_e=e.appConfig?.groupTranscribeLevelMin,Qe=He||Boolean(_e&&We>=_e),Ze=D?(0,u.mBe)(e,D):void 0,Xe=x?e.availableEffectById[x]:void 0,et=(0,u.zcZ)(e,g),tt=(0,m.me)(e,g),nt=(0,m.xd)(e,N,g.id),it=(0,u.trm)(e),ot=e.appConfig?.starsSuggestedPostFutureMin||r.WHU,st=(0,m.B9)(e,g),at=re&&(0,m.B9)(e,re);return{theme:(0,u.SJA)(e),forceSenderName:G,sender:_,canShowSender:W,originSender:Q,botSender:Z,shouldHideReply:ae||he,isThreadTop:ee,replyMessage:re,replyMessageSender:ce,replyMessageForwardSender:le,replyMessageChat:ue,replyStory:pe,isReplyPrivate:me,storySender:ge,isInDocumentGroup:Le,isProtected:(0,u.ynf)(e,g),isChatProtected:(0,u.ryq)(e,N),isFocused:ve,isForwarding:H,reactionMessage:Re,isChatWithSelf:U,isRepliesChat:K,isAnonymousForwards:z,isChannel:V,isGroup:j,canReply:Fe,highlight:Me,animatedEmoji:ke,animatedCustomEmoji:Ye,isInSelectMode:(0,u.rTV)(e),isSelected:Pe,isGroupSelected:Boolean(g.groupedId)&&!g.isInAlbum&&(0,u.SLS)(e,N,g.groupedId),threadId:w,isDownloading:xe,isPinnedList:"pinned"===b,isPinned:T,canAutoLoadMedia:(0,u.wwb)(e,g),canAutoPlayMedia:(0,u.OEt)(e,g),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:Ee,availableReactions:e.reactions.availableReactions,defaultReaction:(0,d.Nb)(g)||"scheduled"===b?void 0:(0,u.nTJ)(e,N),hasActiveReactions:qe,activeEmojiInteractions:a,hasUnreadReaction:Oe,isTranscribing:void 0!==F&&e.transcriptions[F]?.isPending,transcribedText:void 0!==F?e.transcriptions[F]?.text:void 0,isPremium:He,senderAdminMember:X,messageTopic:Ke,hasTopicChip:Ue,chatTranslations:ze,areTranslationsEnabled:Je,shouldDetectChatLanguage:(0,u.LRV)(e,N),requestedTranslationLanguage:Ve,requestedChatTranslationLanguage:je,hasLinkedChat:Boolean(J?.linkedChatId),withAnimatedEffects:(0,u.xYJ)(e,"stickerEffects"),webPageStory:q,isConnected:$e,isLoadingComments:Ee?.isCommentsInfo&&c?.loadingChatId===Ee?.originChannelId&&c?.loadingMessageId===Ee?.originMessageId,shouldWarnAboutSvg:B,...Y&&{outgoingStatus:(0,u.Tl2)(e,g,"scheduled"===b)},..."number"==typeof fe&&{uploadProgress:fe},...ve&&{focusDirection:Ae,noFocusHighlight:ye,isResizingContainer:Ce,focusedQuote:we,focusedQuoteOffset:be,scrollTargetPosition:Ie},senderBoosts:Ge,tags:e.savedReactionTags?.byKey,canTranscribeVoice:Qe,viaBusinessBot:Ze,minFutureTime:ot,effect:Xe,poll:et,maxTimestamp:tt,lastPlaybackTimestamp:nt,paidMessageStars:E,isChatWithUser:R,isAccountFrozen:it,isMediaNsfw:st,isReplyMediaNsfw:at,webPage:L}}))((({message:e,observeIntersectionForBottom:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,album:m,noAvatars:h,withAvatar:f,withSenderName:v,noComments:N,noReplies:Y,appearanceOrder:P,isJustAdded:j,isFirstInGroup:J,isPremium:G,isLastInGroup:ee,isFirstInDocumentGroup:te,isLastInDocumentGroup:ne,isTranscribing:ie,transcribedText:oe,isLastInList:se,theme:ae,forceSenderName:re,sender:ce,canShowSender:le,originSender:ve,botSender:Ae,isThreadTop:Ce,shouldHideReply:be,replyMessage:Ye,replyMessageSender:Pe,replyMessageForwardSender:Fe,replyMessageChat:Te,replyStory:Re,isReplyPrivate:Ke,storySender:ze,outgoingStatus:je,uploadProgress:Je,isInDocumentGroup:$e,isLoadingComments:qe,isProtected:Ge,isChatProtected:_e,isFocused:Qe,focusDirection:Ze,focusedQuote:Xe,focusedQuoteOffset:tt,noFocusHighlight:nt,scrollTargetPosition:it,isResizingContainer:ot,isForwarding:at,isChatWithSelf:rt,isRepliesChat:ct,isAnonymousForwards:lt,isChannel:ut,isGroup:mt,canReply:pt,highlight:ft,animatedEmoji:vt,animatedCustomEmoji:At,hasActiveReactions:yt,hasLinkedChat:Ct,isInSelectMode:wt,isSelected:bt,isGroupSelected:It,threadId:St,reactionMessage:Mt,availableReactions:Nt,defaultReaction:Yt,activeEmojiInteractions:Ft,messageListType:Tt,isPinnedList:Dt,isPinned:xt,isDownloading:Lt,canAutoLoadMedia:Bt,canAutoPlayMedia:Rt,shouldLoopStickers:Ut,autoLoadFileMaxSizeMb:Kt,repliesThreadInfo:zt,hasUnreadReaction:Vt,memoFirstUnreadIdRef:jt,senderAdminMember:Jt,messageTopic:$t,hasTopicChip:qt,chatTranslations:Ht,areTranslationsEnabled:Qt,shouldDetectChatLanguage:Zt,requestedTranslationLanguage:en,requestedChatTranslationLanguage:nn,withAnimatedEffects:sn,webPageStory:an,isConnected:rn,getIsMessageListReady:dn,shouldWarnAboutSvg:cn,senderBoosts:ln,tags:un,canTranscribeVoice:mn,viaBusinessBot:hn,effect:vn,poll:An,maxTimestamp:yn,lastPlaybackTimestamp:Cn,isMediaNsfw:wn,isReplyMediaNsfw:bn,paidMessageStars:Sn,isChatWithUser:Mn,isAccountFrozen:Nn,minFutureTime:kn,webPage:Yn,onIntersectPinnedMessage:Dn})=>{const{toggleMessageSelection:xn,clickBotInlineButton:En,clickSuggestedMessageButton:Ln,rejectSuggestedPost:Bn,openSuggestedPostApprovalModal:Rn,disableContextMenuHint:On,animateUnreadReaction:Vn,focusLastMessage:jn,markMentionsRead:Jn}=(0,o.ko)(),$n=(0,i.li)(),qn=(0,i.li)(),Hn=(0,i.li)(),Gn=(0,U.A)(),Wn=(0,R.A)(),[_n,Qn]=(0,i.J0)(!1),[Zn,Xn]=(0,i.J0)(!1),[ei,ti]=(0,i.J0)(!1),[ni,ii,oi]=(0,L.A)(),[si,ai,ri]=(0,L.A)(),[di,ci]=(0,i.J0)(""),{isMobile:li,isTouchScreen:ui}=(0,T.Ay)();(0,B.mv)(qn,t);const{isContextMenuOpen:mi,contextMenuAnchor:hi,contextMenuTarget:pi,handleBeforeContextMenu:gi,handleContextMenu:fi,handleContextMenuClose:vi,handleContextMenuHide:Ai}=(0,D.A)($n,ui&&wt||Nn,!p.cp,p.Ni,dn);(0,i.vJ)((()=>{mi&&On()}),[mi,On]);const yi=P<=0,[Ci,wi]=(0,L.A)(yi);(0,i.vJ)((()=>{yi||setTimeout(wi,P*r.zq7)}),[P,wi,yi]),(0,V.A)({ref:$n,isOpen:Ci||j,noMountTransition:yi&&!j,className:!1});const{id:bi,chatId:Ii,forwardInfo:Si,viaBotId:Mi,isTranscriptionError:Ni,factCheck:ki}=e;(0,i._W)((()=>{if(e.isPinned){const e=m?m.mainMessage.id:bi;Dn?.({viewportPinnedIdsToRemove:[e]})}}));const Yi=(0,d.Nb)(e),Pi=(0,d.Ie)(e),Fi="scheduled"===Tt||e.isScheduled,Ti=(0,d.Tv)(e)&&!be,{paidMedia:Di}=(0,d.r_)(e),{photo:xi,video:Ei}=M(Di),{photo:Li=xi,video:Bi=Ei,audio:Ri,voice:Oi,document:Ui,sticker:Ki,contact:zi,invoice:Vi,location:ji,action:Ji,game:$i,storyData:qi,giveaway:Hi,giveawayResults:Gi,todo:Wi}=(0,d.r_)(e),_i=(0,l.Q)(e),Qi=(0,l.W)(e),Zi=Boolean(!_n&&(Ni||oe)),Xi=Boolean(Qi),eo=Boolean(zt)&&"thread"===Tt,to=!Zi&&(0,d.aN)(e),no=to&&(vt||At),io=Mt?.reactions&&!(0,d.G)(Mt.reactions),oo=Si&&(!rt||Fi)&&!ct&&!Si.isLinkedChannelPost&&!lt&&!Ae||Boolean(qi&&!qi.isMention),so=Boolean(ln)&&!oo&&J,ao=qi?.isMention,ro="video"===Bi?.mediaType&&Bi.isRound,co=Boolean(m)&&(m.isPaidMedia&&Di.extendedMedia.length>1||m.messages.length>1)&&!m.messages.some((e=>0===Object.keys(e.content).length)),lo=$e&&!te,uo=$e&&!ne,mo=void 0!==hi,ho=!(mo||wt||at||uo||ao||(Ki||no)&&oo),po=ut&&!Fi&&e.isForwardingAllowed&&!_e,go=Boolean(Dt||Si&&(Si.isChannelPost||rt||ct||lt)&&Si.fromMessageId),fo=Boolean(ki?.text),vo=oo&&to,Ao=qt||Ti||Xi||vo,yo=(0,O.A)(((e,t)=>{Nn||xn({messageId:bi,groupedId:t,...e?.shiftKey&&{withShift:!0},...co&&{childMessageIds:m.messages.map((({id:e})=>e))}})})),Co=le?ce:void 0,wo=Si&&(rt||ct||lt||!Co)?ve:Co,bo=oo?ve:ce,Io=Pi&&!to,So=Si||qi?ve:Co,Mo=(0,d.G5)(e),{handleMouseDown:No,handleClick:ko,handleContextMenu:Yo,handleDoubleClick:Po,handleContentDoubleClick:Fo,handleMouseMove:To,handleSendQuickReaction:Do,handleMouseLeave:xo,isSwiped:Eo,isQuickReactionVisible:Lo,handleDocumentGroupMouseEnter:Bo}=de(yo,$n,bi,Boolean(wt),Boolean(pt),Boolean(Ge),fi,gi,Ii,mo,Hn,uo,dn),{handleSenderClick:Ro,handleViaBotClick:Oo,handleReplyClick:Uo,handleMediaClick:Ko,handleDocumentClick:zo,handleAudioPlay:Vo,handleAlbumMediaClick:jo,handlePhotoMediaClick:Jo,handleVideoMediaClick:$o,handleMetaClick:qo,handleTranslationClick:Ho,handleOpenThread:Go,handleReadMedia:Wo,handleCancelUpload:_o,handleVoteSend:Qo,handleGroupForward:Zo,handleForward:Xo,handleFocus:es,handleFocusForwarded:ts,handleDocumentGroupSelectAll:ns,handleTopicChipClick:is,handleStoryClick:os}=function({lang:e,selectMessage:t,message:n,webPage:i,chatId:r,threadId:c,isInDocumentGroup:u,asForwarded:m,isScheduled:h,album:p,senderPeer:g,botSender:f,messageTopic:v,isTranslatingChat:A,story:y,isReplyPrivate:C,isRepliesChat:w,isSavedMessages:b,lastPlaybackTimestamp:I}){const{openChat:S,showNotification:M,focusMessage:N,openMediaViewer:k,openAudioPlayer:Y,markMessagesRead:P,cancelUploadMedia:F,sendPollVote:T,openForwardMenu:D,openChatLanguageModal:x,openThread:E,openStoryViewer:L,searchChatMediaMessages:B}=(0,o.ko)(),{id:R,forwardInfo:U,groupedId:K,content:{paidMedia:z,video:V}}=n,{replyToMsgId:j,replyToPeerId:J,replyToTopId:$,isQuote:q,quoteText:H,quoteOffset:G}=(0,l.Q)(n)||{},W=(0,O.A)((()=>{g?m&&U?.channelPostId?N({chatId:g.id,messageId:U.channelPostId}):S({id:g.id}):M({message:e("HidAccount")})})),_=(0,O.A)((()=>{f&&S({id:f.id})})),Q=(0,O.A)((()=>{j&&!C?w&&J&&$?E({isComments:!0,originChannelId:J,originMessageId:$,focusMessageId:j}):N({chatId:J||r,threadId:w?$:c,messageId:j,replyMessageId:J?void 0:R,noForumTopicPanel:!J,...q&&{quote:H?.text,quoteOffset:G}}):M({message:e(q?"QuotePrivate":"ReplyPrivate")})})),X=(0,O.A)((()=>{k({chatId:r,threadId:c,messageId:R,origin:h?a.TQ.ScheduledInline:a.TQ.Inline})})),ee=(0,O.A)((e=>{if(z&&!z.isBought)return;e&&B({chatId:r,threadId:c,currentMediaMessageId:R});const t=i?.url&&(0,Z.vG)(i.url),n=V||(0,d.rU)(i),o=t&&"timestamp"in t?t.timestamp:void 0;k({chatId:r,threadId:c,messageId:R,origin:h?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:I||n?.timestamp||o,withDynamicLoading:e})})),te=(0,O.A)((()=>{ee(!h&&!z)})),ne=(0,O.A)((()=>{const e=n.content?.video?.isGif;ee(!e&&!h&&!z)})),ie=(0,O.A)((()=>{((0,d.yl)(n)||(0,d.eY)(i))&&te(),ne()})),oe=(0,O.A)((()=>{Y({chatId:r,messageId:R})})),se=(0,O.A)(((e,t)=>{z&&!z.isBought||(B({chatId:r,threadId:c,currentMediaMessageId:R}),k({chatId:r,threadId:c,messageId:e,mediaIndex:t,origin:h?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!z}))})),ae=(0,O.A)((()=>{P({messageIds:[R]})})),re=(0,O.A)((()=>{F({chatId:r,messageId:R})})),de=(0,O.A)((e=>{T({chatId:r,messageId:R,options:e})})),ce=(0,O.A)((()=>{D({fromChatId:r,groupedId:K})})),le=(0,O.A)((()=>{if(p&&p.messages){const e=p.messages.map((({id:e})=>e));D({fromChatId:r,messageIds:e})}else D({fromChatId:r,messageIds:[R]})})),ue=(0,O.A)((()=>{N({chatId:r,threadId:s.l3,messageId:R})})),me=(0,O.A)((()=>{const e=b&&U.savedFromPeerId||U.fromChatId;u?N({chatId:e,groupedId:K,groupedChatId:r,messageId:U.fromMessageId}):J&&$?w?E({isComments:!0,originChannelId:J,originMessageId:$,focusMessageId:U.fromMessageId}):N({chatId:J,threadId:$,messageId:U.fromMessageId}):N({chatId:e,messageId:U.fromMessageId})})),he=(0,O.A)((e=>{e.stopPropagation(),t(e,K)})),pe=(0,O.A)((e=>{e.stopPropagation(),x({chatId:r,messageId:A?void 0:R})})),ge=(0,O.A)((()=>{E({chatId:n.chatId,threadId:n.id})})),fe=(0,O.A)((()=>{v&&N({chatId:J||r,threadId:v.id,messageId:R})})),ve=(0,O.A)((()=>{y&&L({peerId:y.peerId,storyId:y.id,isSingleStory:!0})}));return{handleSenderClick:W,handleViaBotClick:_,handleReplyClick:Q,handleDocumentClick:X,handleMediaClick:ie,handleAudioPlay:oe,handleAlbumMediaClick:se,handlePhotoMediaClick:te,handleVideoMediaClick:ne,handleMetaClick:he,handleTranslationClick:pe,handleOpenThread:ge,handleReadMedia:ae,handleCancelUpload:re,handleVoteSend:de,handleGroupForward:ce,handleForward:le,handleFocus:ue,handleFocusForwarded:me,handleDocumentGroupSelectAll:he,handleTopicChipClick:fe,handleStoryClick:ve}}({lang:Gn,selectMessage:yo,message:e,webPage:Yn,chatId:Ii,threadId:St,isInDocumentGroup:$e,asForwarded:oo,isScheduled:Fi,album:m,avatarPeer:wo,senderPeer:So,botSender:Ae,messageTopic:$t,isTranslatingChat:Boolean(nn),story:Re&&"content"in Re?Re:void 0,isReplyPrivate:Ke,isRepliesChat:ct,isSavedMessages:rt,lastPlaybackTimestamp:Cn}),ss=(0,O.A)((e=>{e.stopPropagation(),ii()}));(0,i.vJ)((()=>{se&&Zi&&oe&&jn()}),[jn,se,oe,Zi]),(0,i.vJ)((()=>{const t=$n.current,n=e.isInAlbum&&m?.messages.some((e=>!e.isDeleting));e.isDeleting&&t&&!n&&((0,xe.U)(t)?Xn(!0):ti(!0))}),[e.isDeleting]);const as=m?.hasMultipleCaptions?void 0:m?.captionMessage||e,rs=as&&(0,d.XR)(as),ds=rs||fo,cs=(0,g.A)("Message message-list-item",J&&"first-in-group",Ge&&"hide-on-print",Ge&&!rs?"is-protected":"allow-selection",ee&&"last-in-group",te&&"first-in-document-group",ne&&"last-in-document-group",se&&"last-in-list",Pi&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",Ti&&"has-reply",mi&&"has-menu-open",Qe&&!nt&&"focused",at&&"is-forwarding",ei&&"is-deleting",Zn&&"is-dissolving",$e&&"is-in-document-group",co&&"is-album",e.hasUnreadMention&&"has-unread-mention",bt&&"is-selected",wt&&"is-in-selection-mode",Ce&&!f&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",Eo&&"is-swiped",j&&"is-just-added",(yt||ni)&&"has-active-effect",ao&&"is-story-mention",!ho&&"no-action-button"),ls=as&&(0,d.r_)(as).text,us=Boolean(e.isInvertedMedia),{replyToMsgId:ms,replyToPeerId:hs}=_i||{},{peerId:ps,storyId:gs}=Qi||{};(0,i.vJ)((()=>{(Ki?.hasEffect||vn)&&(jt?.current&&bi>=jt.current||Yi)&&ii()}),[vn,Yi,jt,bi,Ki?.hasEffect]);const fs=function(e,t,n){const[o,s]=(0,i.J0)();return(0,i.vJ)((()=>{t||n&&!n()||(e?async function(e,t=.2){return $||await q.promise,await $.request({name:"detectLanguage",args:[e,t]})}(e).then(s):s(void 0))}),[t,e,n]),o}(ls?.text,!(Qt&&Zt),dn);!function(e,t,n,o){(0,i.vJ)((()=>{if(n||o&&!o())return;const i=Boolean(e.content.text?.text.length);!function({chatId:e,id:t,isTranslatable:n,detectedLanguage:i}){const o=W.get(e)||new H.A(150),s=o.get(t);s&&s.detectedLanguage===i&&s.isTranslatable===n||(o.set(t,{id:t,isTranslatable:n,detectedLanguage:i}),W.set(e,o),_(e))}({chatId:e.chatId,id:e.id,isTranslatable:i,detectedLanguage:t})}),[e,t,n,o])}(e,fs,!Zt,dn);const vs=(0,d.ZR)(e,!nn),{isPending:As,translatedText:ys}=(0,X.A)(Ht,Ii,vs?bi:void 0,en),Cs=(0,K.A)(ys,Boolean(vs)),ws=ys||Cs,bs="phoneCall"===Ji?.type?Ji:void 0,Is=(zt||Ct&&ut&&Yi)&&!uo&&"thread"===Tt&&!N,Ss=zt?.isCommentsInfo&&!uo&&"thread"===Tt&&!N,Ms=!ui&&!bs&&!wt&&Yt&&!uo&&!ao&&!Mo&&!Nn,Ns=!Zi&&io&&(to||(Li||Bi||qi||"geo"===ji?.mediaType)&&!ds),ks=function(e,t,{poll:n,webPage:i,hasSubheader:o,isCustomShape:s,isLastInGroup:a,asForwarded:c,hasThread:l,forceSenderName:u,hasCommentCounter:m,hasCommentButton:h,hasActionButton:p,hasReactions:g,isGeoLiveActive:f,withVoiceTranscription:v,peerColorClass:A,hasOutsideReactions:y}={}){const{paidMedia:C}=(0,d.r_)(e),{photo:w,video:b}=M(C),I=(0,d.r_)(e),{photo:S=w,video:N=b,audio:k,voice:Y,document:P,contact:F,location:T,invoice:D,storyData:x,giveaway:E,giveawayResults:L}=I,B=t?.hasMultipleCaptions?void 0:(0,d.r_)(t?.captionMessage||e).text,R=Boolean(e.factCheck?.text),O="video"===N?.mediaType&&N.isRound,U=e.isInvertedMedia,K=S||N&&!O||t||i,z=[r.zPk],V=x||S||N||T||D?.extendedMedia||C,j=B||"venue"===T?.mediaType||f||R,J=V&&!j,$=Boolean(e.inlineButtons),q=Boolean(e.viaBotId),H=U&&K?!(!g||y)||!!R||!(!i||!j):j;return A&&z.push(A),!V&&e.emojiOnlyCount?(z.push("emoji-only"),e.emojiOnlyCount<=r.Apc&&z.push(`emoji-only-${e.emojiOnlyCount}`)):j?z.push("text"):z.push("no-text"),Object.keys(I).length||z.push("unsupported"),p&&z.push("has-action-button"),s&&(z.push("custom-shape"),O&&z.push("round"),m&&z.push("has-comment-counter")),V&&!v?z.push("media"):N?z.push("video"):k?z.push("audio"):Y?(z.push("voice"),v&&z.push("with-voice-transcription")):P?z.push("document"):F?z.push("contact"):n?z.push("poll"):E||L?z.push("giveaway"):"full"===i?.webpageType&&(z.push("web-page"),(i.photo||i.video)&&z.push("media"),i.document&&z.push("document"),i.gift&&z.push("gift")),D&&!D.extendedMedia&&z.push("invoice"),D&&D.photo&&z.push("has-photo"),x&&z.push("story"),c&&z.push("is-forwarded"),o&&z.push("has-subheader"),l&&z.push("has-replies"),g&&z.push("has-reactions"),y&&z.push("has-outside-reactions"),q&&z.push("is-via-bot"),u&&z.push("force-sender-name"),s||(z.push("has-shadow"),V&&l&&z.push("has-background"),(o||c||q||!J||u||R||v)&&z.push("has-solid-background"),R&&z.push("has-fact-check"),!a||$||!S&&J&&!h||z.push("has-appendix")),K&&U&&z.push("is-inverted-media"),H?z.push("has-footer"):z.push("no-footer"),z.join(" ")}(e,m,{poll:An,webPage:Yn,hasSubheader:Ao,isCustomShape:to,isLastInGroup:ee,asForwarded:oo,hasThread:eo&&!N,forceSenderName:re,hasCommentCounter:eo&&zt.messagesCount>0,hasCommentButton:Ss,hasActionButton:po||go,hasReactions:io,isGeoLiveActive:"geoLive"===ji?.mediaType&&!(0,d.vz)(e),withVoiceTranscription:Zi,peerColorClass:(0,b.y)(bo,Io,!0),hasOutsideReactions:Ns}),Ys=ks.includes("has-appendix"),Ps=(0,S.Rr)(e.emojiOnlyCount),Fs=Mn?void 0:co&&Sn?m.messages.length*Sn:Sn;let Ts,Ds;Ts=bs||uo?"none":!ds||Yn||Ps||us?us&&!Ps&&(fo||Yn)?"in-text":"standalone":"in-text",io?Ns?Ds="outside":oo?(Ts="standalone",Ds="inside"):Ds="inside":Ds="none";const xs=to?"in-meta":"in-content";(0,x.A)(hs||Ii,ms,Ye,e.id,be||Ke),(0,E.A)(ps||Ii,gs,Re),(0,Q.A)({elementRef:$n,chatId:Ii,isFocused:Qe,focusDirection:Ze,noFocusHighlight:nt,isResizingContainer:ot,isJustAdded:j,isQuote:Boolean(Xe),scrollTargetPosition:it});const Es=hn?(0,c.em)(Gn,hn):void 0,Ls=!e.senderId,Bs=Es||Ls&&e.postAuthorTitle||(oo||rt)&&Si?.postAuthorTitle||void 0;(0,z.A)($n,se),(0,i.vJ)((()=>{const t=qn.current;if(!t||!(0,C.Y)(t))return;Vt&&Vn({messageIds:[bi]});let n=[];e.hasUnreadMention&&(n=[bi]),m&&(n=m.messages.filter((e=>e.hasUnreadMention)).map((e=>e.id))),n.length&&Jn({chatId:Ii,messageIds:n})}),[Vt,m,Ii,bi,Vn,e.hasUnreadMention]);const Rs=(0,i.Kr)((()=>co?F(Pi,Boolean(h),m,li):void 0),[co,Pi,h,m,li]),Os=oo&&!to?28:0,Us=(0,i.Kr)((()=>{let e,t,n,i=!1,o="";if(!co&&(Li||Bi||Vi?.extendedMedia)){let n;if(Li||Bi){const e=Li||Bi;e&&!ro&&(n=(0,k.yA)({media:e,isOwn:Pi,asForwarded:oo,noAvatars:h,isMobile:li}).width)}else if(Vi?.extendedMedia&&Vi.extendedMedia.width&&Vi.extendedMedia.height){const{width:e,height:t}=Vi.extendedMedia;n=(0,w.kn)({width:e,height:t,fromOwnMessage:Pi,asForwarded:oo,noAvatars:h,isMobile:li}).width}n&&(n<k.MC&&(t=n),e=Math.max((0,k.nP)(ls?.text,Is),n),!oo&&Vi?.extendedMedia&&e-n>18&&(i=!0))}else Rs&&(e=Math.max((0,k.nP)(ls?.text,Is),Rs.containerStyle.width),e-Rs.containerStyle.width>18&&(i=!0));if(e)o=`width: ${e}px`,n=e+zn;else if(Ki&&!Ao){const{width:e}=(0,w.bu)(Ki,li);o=`width: ${e+Os}px`,n=e+zn}return{contentWidth:t,noMediaCorners:i,style:o,reactionsMaxWidth:n}}),[Rs,oo,Os,Ao,Vi?.extendedMedia,co,Is,li,Pi,h,Li,Ki,ls?.text,Bi,ro]),{contentWidth:Ks,noMediaCorners:zs,style:Vs,reactionsMaxWidth:js}=Us;function Js(e){if(as)return(0,we.Y)(Ne.A,{messageOrStory:as,translatedText:en?ws:void 0,isForAnimation:e,focusedQuote:Xe,focusedQuoteOffset:tt,emojiSize:Ps,highlight:ft,isProtected:Ge,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,withTranslucentThumbs:to,isInSelectMode:wt,canBeEmpty:fo,maxTimestamp:yn,threadId:St})}const $s=(0,i.hb)((()=>{if(Yt)return(0,we.Y)("div",{className:(0,g.A)("quick-reaction",Lo&&!yt&&"visible"),onClick:Do,ref:Hn,children:(0,we.Y)(ke.A,{reaction:Yt,size:Kn,availableReactions:Nt,observeIntersection:u})})}),[yt,Nt,Yt,Do,Lo,u]);function qs(){const t=(0,we.Y)(Xt,{message:e,isPinned:xt,withFullDate:rt&&!Pi,noReplies:Y,repliesThreadInfo:zt,outgoingStatus:je,signature:Bs,withReactionOffset:"inside"===Ds,renderQuickReactionButton:Ms&&"in-meta"===xs?$s:void 0,availableReactions:Nt,isTranslated:Boolean(en?ws:void 0),effectEmoji:vn?.emoticon,onClick:qo,onEffectClick:ss,onTranslationClick:Ho,onOpenThread:Go,paidMessageStars:Fs});return"inside"!==Ds?t:(0,we.Y)(gn.A,{message:Mt,threadId:St,metaChildren:t,observeIntersection:u,noRecentReactors:ut,tags:un,isCurrentUserPremium:G,isAccountFrozen:Nn})}function Hs(e){const t=(0,g.A)("text-content","clearfix"),n=(0,g.A)("text-content","clearfix","in-text"===Ts&&"with-meta",je&&"with-outgoing-icon"),i=co||!co&&Li||!co&&Bi&&!ro||!no&&fo,o="in-text"===Ts;return(0,we.FD)(we.FK,{children:[Gs(),ds&&!no&&(0,we.FD)("div",{className:t,dir:"auto",children:[Js(),As&&(0,we.Y)("div",{className:"translation-animation",children:(0,we.Y)("div",{className:"text-loading",children:Js(!0)})}),!i&&o&&qs()]}),i&&(0,we.FD)(we.FK,{children:[Ws(e),!no&&(0,we.FD)("div",{className:n,dir:"auto",children:[fo&&(0,we.Y)(ht,{factCheck:ki,isToggleDisabled:wt}),o&&qs()]})]})]})}function Gs(){const t=(0,d.T_)(e);if(t&&Yn)return(0,we.Y)(Un,{messageWebPage:t,webPage:Yn,message:e,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,noAvatars:h,canAutoLoad:Bt,canAutoPlay:Rt,asForwarded:oo,isDownloading:Lt,isProtected:Ge,theme:ae,story:an,isConnected:rn,lastPlaybackTimestamp:Cn,backgroundEmojiId:bo?.color?.backgroundEmojiId,shouldWarnAboutSvg:cn,autoLoadFileMaxSizeMb:Kt,onAudioPlay:Vo,onMediaClick:Ko,onDocumentClick:zo,onCancelMediaTransfer:_o})}function Ws(e){const t=(0,we.FD)(we.FK,{children:[co&&n&&(0,we.Y)(Ve,{album:m,albumLayout:Rs,observeIntersection:n,isOwn:Pi,isProtected:Ge,hasCustomAppendix:e,onMediaClick:jo}),!co&&Li&&(0,we.Y)(Oe.A,{messageText:ls?.text,photo:Li,isOwn:Pi,observeIntersection:n,noAvatars:h,canAutoLoad:Bt,uploadProgress:Je,shouldAffectAppendix:e,isDownloading:Lt,isProtected:Ge,asForwarded:oo,theme:ae,isMediaNsfw:wn,forcedWidth:Ks,onClick:Jo,onCancelUpload:_o}),!co&&Bi&&!ro&&(0,we.Y)(Ue.A,{video:Bi,isOwn:Pi,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,forcedWidth:Ks,noAvatars:h,canAutoLoad:Bt,canAutoPlay:Rt,uploadProgress:Je,isDownloading:Lt,isProtected:Ge,asForwarded:oo,isMediaNsfw:wn,lastPlaybackTimestamp:Cn,onClick:$o,onCancelUpload:_o})]});return Di?(0,we.Y)(on,{chatId:Ii,messageId:bi,paidMedia:Di,isOutgoing:Pi,children:t}):t}function _s(){return!(to&&!Mi)&&(v&&(!(Li||Bi||ji||Di)||qt)||oo||Mi||re)&&!lo&&!(Ti&&to)}function Qs(){return(0,we.FD)("span",{className:"forward-title-container",children:[oo&&(0,we.Y)(ye.A,{name:Si?.hiddenUserName?"forward":"share-filled"}),oo&&(0,we.Y)("span",{className:"forward-title",children:Gn("ForwardedFrom")})]})}const Zs=(0,O.A)((t=>{"suggestedMessage"===t.button.type&&("approve"!==t.button.buttonType?"decline"!==t.button.buttonType?Ln({...t,button:t.button}):ai():Rn({chatId:Ii,messageId:e.id}))})),Xs=(0,O.A)((e=>{ci(e.target.value)})),ea=(0,O.A)((()=>{Bn({chatId:Ii,messageId:e.id,rejectComment:di.trim()||void 0}),ri(),ci("")}));function ta(t=!1,i=!1){let o;!So||to&&Mi?Si?.hiddenUserName?o=Si.hiddenUserName:qi&&ve&&(o=(0,c.em)(Gn,ve)):o=(0,c.em)(Gn,So);const s=So&&"emojiStatus"in So&&So.emojiStatus,a=So&&"isPremium"in So&&So.isPremium,l=oo&&So,m=Ae?.hasUsername;return(0,we.FD)("div",{className:"message-title",dir:"ltr",children:[o||oo?(0,we.FD)("span",{className:(0,g.A)("message-title-name-container",Si?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!t&&Qs(),(0,we.FD)("span",{className:"message-title-name",children:[qi&&(0,we.Y)(ye.A,{name:"play-story"}),l&&(0,we.Y)(me.A,{className:"forward-avatar",peer:So,size:"micro"}),(0,we.Y)("span",{className:"sender-title",onClick:Ro,children:o?(0,I.A)(o):oo?" ":void 0}),!oo&&s&&(0,we.Y)(he.A,{documentId:s.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:n,observeIntersectionForPlaying:u}),!oo&&!s&&a&&(0,we.Y)(Me.A,{}),So?.fakeType&&(0,we.Y)(Se.A,{fakeType:So.fakeType})]})]}):Ae?void 0:" ",Ae?.hasUsername&&(0,we.FD)("span",{className:"interactive",children:[(0,we.Y)("span",{className:"via",children:Gn("ViaBot")}),(0,we.Y)("span",{className:"sender-title",onClick:Oo,children:(0,I.A)(`@${(0,d.Kl)(Ae)}`)})]}),(0,we.Y)("div",{className:"title-spacer"}),i||m?void 0:Si?.isLinkedChannelPost?(0,we.Y)("span",{className:"admin-title",dir:"auto",children:Gn("DiscussChannel")}):e.postAuthorTitle&&mt&&!oo?(0,we.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!Jt||oo||Mi?void 0:(0,we.Y)("span",{className:"admin-title",dir:"auto",children:Jt.customTitle||Gn(Jt.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),so&&(0,we.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,we.Y)(ye.A,{name:ln>1?"boosts":"boost"}),ln>1?ln:void 0]})]})}const na=mt&&oo?e.postAuthorTitle:void 0,ia=e.suggestedPostInfo&&!e.isOutgoing&&!e.suggestedPostInfo.isAccepted&&!e.suggestedPostInfo.isRejected,oa=(0,i.Kr)((()=>{if(!e.suggestedPostInfo?.scheduleDate||!kn)return!1;const t=(0,A.Fm)();return e.suggestedPostInfo.scheduleDate<=t+kn}),[e.suggestedPostInfo,kn]);return(0,we.FD)("div",{ref:$n,id:(0,d.GZ)(e.id),className:cs,"data-message-id":bi,onCopy:Ge?y.A:void 0,onMouseDown:No,onClick:ko,onContextMenu:Yo,onDoubleClick:Po,onMouseEnter:uo?Bo:void 0,onMouseMove:Ms?To:void 0,onMouseLeave:Ms||uo?xo:void 0,children:[(0,we.Y)("div",{ref:qn,className:"bottom-marker","data-message-id":bi,"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":e.hasUnreadMention||void 0,"data-has-unread-reaction":Vt||void 0,"data-is-pinned":xt||void 0,"data-should-update-views":void 0!==e.viewsCount}),!$e&&(0,we.Y)("div",{className:"message-select-control no-selection",children:bt&&(0,we.Y)(ye.A,{name:"select"})}),ne&&(0,we.Y)("div",{className:(0,g.A)("message-select-control group-select no-selection",It&&"is-selected"),onClick:ns,children:It&&(0,we.Y)(ye.A,{name:"select"})}),(0,we.FD)("div",{className:(0,g.A)("message-content-wrapper",ks.includes("text")&&"can-select-text",ks.includes("giveaway")&&"giveaway-result-content"),children:[(0,we.FD)("div",{className:ks,style:Vs,dir:"auto",children:[oo&&!lo&&(0,we.FD)(we.FK,{children:[_s()&&ta(),na&&(0,we.Y)("span",{className:"admin-title",dir:"auto",children:na})]}),function(){const t=(0,g.A)("content-inner",oo&&"forwarded-message",vo&&"forwarded-custom-shape",Ao&&"with-subheader",zs&&"no-media-corners"),i=ee&&(!ds||us&&!fo&&!io)&&!Ss,o=(0,g.A)("text-content","clearfix","in-text"===Ts&&"with-meta",je&&"with-outgoing-icon"),s=!Mo||!Pi||rt;return(0,we.FD)("div",{className:t,onDoubleClick:Fo,dir:"auto",children:[!oo&&_s()&&ta(),Ao&&(0,we.FD)("div",{className:"message-subheader",children:[qt&&(0,we.Y)(De,{topic:$t,onClick:is,className:"message-topic"}),vo&&(0,we.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,we.Y)("div",{className:"message-title",children:Qs()}),ta(!0,!0)]}),Ti&&(0,we.Y)(fe.A,{message:Ye,replyInfo:_i,noUserColors:Io,isProtected:Ge,sender:Pe,senderChat:Te,forwardSender:Fe,chatTranslations:Ht,isMediaNsfw:bn,requestedChatTranslationLanguage:nn,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onClick:Uo}),Xi&&(0,we.Y)(Ie,{story:Re,sender:ze,noUserColors:Io,isProtected:Ge,observeIntersectionForLoading:n,onClick:os})]}),Ki&&n&&u&&(0,we.Y)(In,{message:e,observeIntersection:n,observeIntersectionForPlaying:u,shouldLoop:Ut,shouldPlayEffect:ni,withEffect:sn,isMediaNsfw:wn,onStopEffect:oi}),no&&At&&(0,we.Y)(He,{customEmojiId:At,withEffects:sn&&Mn&&!vn,isOwn:Pi,observeIntersection:n,forceLoadPreview:Yi,messageId:bi,chatId:Ii,activeEmojiInteractions:Ft}),no&&vt&&(0,we.Y)(We,{emoji:vt,withEffects:sn&&Mn&&!vn,isOwn:Pi,observeIntersection:n,forceLoadPreview:Yi,messageId:bi,chatId:Ii,activeEmojiInteractions:Ft}),sn&&vn&&!Yi&&(0,we.Y)(_t.A,{shouldPlay:ni,messageId:e.id,isMirrored:!e.isOutgoing,effect:vn,observeIntersectionForLoading:n,observeIntersectionForPlaying:u,onStop:oi}),bs&&(0,we.Y)(tn,{message:e,phoneCall:bs,chatId:Ii}),!co&&ro&&!Zi&&(0,we.Y)(fn.A,{message:e,observeIntersection:n,canAutoLoad:Bt,isDownloading:Lt,onReadMedia:s?Wo:void 0,onHideTranscription:Qn,isTranscriptionError:Ni,isTranscribed:Boolean(oe),canTranscribe:mn&&!Mo,isTranscriptionHidden:_n,isTranscribing:ie}),(Ri||Oi||Zi)&&(0,we.Y)(ue.Ay,{theme:ae,message:e,origin:a.d9.Inline,uploadProgress:Je,isSelectable:$e,isSelected:bt,noAvatars:h,onPlay:Vo,onReadMedia:Oi&&s?Wo:void 0,onCancelUpload:_o,isDownloading:Lt,isTranscribing:ie,isTranscriptionHidden:_n,isTranscribed:Boolean(oe),isTranscriptionError:Ni,canDownload:!Ge,onHideTranscription:Qn,canTranscribe:mn&&!Mo}),Ui&&(0,we.Y)(pe.A,{document:Ui,message:e,observeIntersection:n,canAutoLoad:Bt,autoLoadFileMaxSizeMb:Kt,uploadProgress:Je,isSelectable:$e,isSelected:bt,onMediaClick:zo,onCancelUpload:_o,isDownloading:Lt,shouldWarnAboutSvg:cn}),qi&&!ao&&(0,we.Y)(Pn,{message:e,isProtected:Ge}),ao&&(0,we.Y)(Fn,{message:e}),zi&&(0,we.Y)(st,{contact:zi,noUserColors:Pi}),An&&(0,we.Y)(pn,{message:e,poll:An,onSendVote:Qo}),Wi&&(0,we.Y)(Tn,{message:e,todoList:Wi}),(Hi||Gi)&&(0,we.Y)(kt,{message:e}),$i&&(0,we.Y)(gt,{message:e,canAutoLoadMedia:Bt}),Vi?.extendedMedia&&(0,we.Y)(Ot,{message:e,isConnected:rn}),Zi&&(0,we.Y)("p",{className:(0,g.A)("transcription",!_n&&Ni&&"transcription-error"),dir:"auto",children:Ni?Gn("NoWordsRecognized"):ie&&oe?(0,we.Y)(ge.A,{content:oe}):oe}),us&&Hs(i),!us&&(0,we.FD)(we.FK,{children:[Ws(i),ds&&!no&&(0,we.FD)("div",{className:o,dir:"auto",children:[Js(),As&&(0,we.Y)("div",{className:"translation-animation",children:(0,we.Y)("div",{className:"text-loading",children:Js(!0)})}),fo&&(0,we.Y)(ht,{factCheck:ki,isToggleDisabled:wt}),"in-text"===Ts&&qs()]}),Gs()]}),Vi&&!Vi.extendedMedia&&(0,we.Y)(Et,{message:e,shouldAffectAppendix:i&&!io,isInSelectMode:wt,isSelected:bt,theme:ae,forcedWidth:Ks}),ji&&(0,we.Y)(Gt,{message:e,isInSelectMode:wt,isSelected:bt,theme:ae,peer:ce})]})}(),!uo&&"standalone"===Ts&&!ao&&qs(),ho&&(0,we.FD)("div",{className:(0,g.A)("message-action-buttons",qe&&"message-action-buttons-shown"),children:[Ss&&to&&(0,we.Y)(et,{threadInfo:zt,disabled:N,isLoading:qe,isCustomShape:!0,asActionButton:!0}),po&&(0,we.Y)(Ee.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:Gn("lng_context_forward_msg"),onClick:ne?Zo:Xo,children:(0,we.Y)(ye.A,{name:"share-filled"})}),go&&(0,we.Y)(Ee.A,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:Dt?es:ts,children:(0,we.Y)(ye.A,{name:"arrow-right"})})]}),Ss&&!(ho&&to)&&(0,we.Y)(et,{threadInfo:zt,disabled:N,isLoading:qe}),Ys&&(0,we.Y)(Wt.A,{isOwn:Pi}),Ms&&"in-content"===xs&&$s()]}),e.inlineButtons&&(0,we.Y)(Pt,{message:e,onClick:En}),ia&&(0,we.Y)(Pt,{message:{...e,inlineButtons:[[{type:"suggestedMessage",buttonType:"decline",text:Wn("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:Wn("SuggestedPostApprove"),disabled:oa}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:Wn("SuggestedPostSuggestChanges")}]]},onClick:Zs}),"outside"===Ds&&!ao&&(0,we.Y)(gn.A,{message:Mt,threadId:St,isOutside:!0,isCurrentUserPremium:G,maxWidth:js,observeIntersection:u,noRecentReactors:ut,tags:un,isAccountFrozen:Nn})]}),hi&&(0,we.Y)(dt,{isOpen:mi,anchor:hi,targetHref:pi?.matches("a[href]")?pi.href:void 0,message:e,album:m,messageListType:Tt,onClose:vi,onCloseAnimationEnd:Ai,repliesThreadInfo:zt,noReplies:Y,detectedLanguage:fs}),si&&(0,we.FD)(Le.A,{isOpen:si,onClose:ri,title:Wn("SuggestedPostDecline"),confirmLabel:Wn("SuggestedPostDecline"),confirmHandler:ea,confirmIsDestructive:!0,children:[(0,we.Y)("div",{className:"decline-dialog-question",children:(0,I.A)(Wn("DeclinePostDialogQuestion",{sender:ce?(0,c.em)(Gn,ce):""},{withNodes:!0,withMarkdown:!0}))}),(0,we.Y)(Be.A,{placeholder:Wn("DeclineReasonPlaceholder"),value:di,onChange:Xs,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),d=n(87357),c=n(17663),l=n(9716),u=n(91034),m=n(48775),h=n(76023),p=n(4961),g=n(18501),f=n(35749),v=n(2338),A=n(11217),y=n(5912),C=n(39351),w=n(62587),b=n(59030),I=n(64154),S=n(42452),M=n(18276),N=n(27860),k=n(18653),Y=n(86070),P=n(20021);const F=" ",T=({className:e,message:t,replyInfo:n,suggestedPostInfo:u,sender:h,senderChat:N,forwardSender:T,composerForwardSenders:x,title:E,customText:L,isProtected:B,isInComposer:R,noUserColors:O,chatTranslations:U,requestedChatTranslationLanguage:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:J})=>{const $=(0,i.li)(),q=(0,y.Vz)($,V),H=(0,i.Kr)((()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}}),[t,n]),G=H?.content?.video?.isGif?H.content.video:void 0,W=Boolean(G&&!G.previewPhotoSizes?.length),_=(0,f.A)(H,W?"full":"pictogram"),Q=(0,w.A)(_,!q),Z=(0,v.A)(H),X=Boolean(H&&(0,s.lk)(H)),ee=Boolean(H&&(0,s.y2)(H))||z,te=Boolean("message"===n?.type&&n.isQuote),ne="message"===n?.type?n.replyFrom:void 0,ie=t&&(0,s.ZR)(t),{translatedText:oe}=(0,I.A)(U,t?.chatId,ie?t?.id:void 0,K),se=(0,b.A)(),ae=(0,C.A)(),re=h?(0,r.F9)(se,h):ne?.hiddenUserName||t?.forwardInfo?.hiddenUserName,de=(0,i.Kr)((()=>{if(!x)return;const e=x.map((e=>(0,r.F9)(ae,e))).filter(Boolean);return ae.conjunction(e)}),[x,ae]),ce=N?(0,r.F9)(se,N):void 0,le=T?(0,r.F9)(se,T):t?.forwardInfo?.hiddenUserName,ue=h&&h.id===T?.id,{handleClick:me,handleMouseDown:he}=(0,A.Q)(J);return(0,P.FD)(Y.A,{peer:h,emojiIconClassName:"EmbeddedMessage--background-icons",ref:$,shouldReset:!0,noUserColors:O,className:(0,d.A)("EmbeddedMessage",e,te&&"is-quote",Z&&"with-thumb","no-selection",x&&"is-input-forward",u&&"is-suggested-post"),dir:ae.isRtl?"rtl":void 0,onClick:me,onMouseDown:he,children:[(0,P.Y)("div",{className:"hover-effect"}),(0,P.Y)(S.A,{}),Z&&D(Z,Q,W,X,B,ee),(0,P.FD)("div",{className:"message-text",children:[(0,P.Y)("p",{className:(0,d.A)("embedded-text-wrapper",te&&"multiline"),children:function(){if(u){if(!u?.price?.amount&&!u.scheduleDate)return ae("ComposerEmbeddedMessageSuggestedPostDescription");const e=u.price?u.price.currency===o.ykW?(0,m.Ms)(ae,u.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,m.U2)(ae,u.price.amount,{className:"suggested-price-star-icon"}):"",t=u.scheduleDate?(0,c.e0)(u.scheduleDate,ae,se):"";return e&&!t?(0,P.Y)("span",{className:"suggested-post-price-wrapper",children:ae("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,P.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` • ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,g.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?(0,P.Y)(k.A,{message:t,noEmoji:Boolean(Z),translatedText:oe,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,emojiSize:17}):L||function(e){if(!e||e.content.text)return F;const t=(0,a.GG)(se,e.content,{});return t&&t!==o.bVP?(0,P.Y)("span",{children:(0,p.A)(t)}):F}(H)||F}()}),(0,P.FD)("div",{className:"message-title",children:[function(){if(E)return(0,p.A)(E);if(u&&n)return ae("TitleSuggestedChanges");if(u)return ae("ComposerEmbeddedMessageSuggestedPostTitle");if(!re&&!de)return F;let e;N&&((0,s.WX)(N)&&(e="channel-filled"),(0,s.YE)(N)&&(e="group-filled"));const t=R&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,P.FD)("span",{className:"embedded-sender-wrapper",children:[(!N||!!(0,l.L8)(N?.id)||N.id!==h?.id)&&(0,P.FD)("span",{className:"embedded-sender",children:[!x&&re&&(0,p.A)(t?se("ReplyToQuote",re):re),de&&(0,p.A)(ae("ComposerTitleForwardFrom",{users:de},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,P.Y)(M.A,{name:e,className:"embedded-chat-icon"}),e&&ce&&(0,P.Y)("span",{className:"embedded-sender-chat",children:(0,p.A)(ce)})]})}(),le&&!ue&&(0,P.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,P.Y)(M.A,{name:T?"share-filled":"forward",className:"embedded-origin-icon"}),(0,P.Y)("span",{className:"forward-sender-title",children:(0,p.A)(le)})]})]})]})]})};function D(e,t,n,i,o,s){const{width:a,height:r}=(0,h.mr)(),c=t||e,l=n&&t;return(0,P.FD)("div",{className:(0,d.A)("embedded-thumb",i&&"round"),children:[!s&&!l&&(0,P.Y)("img",{src:c,width:a,height:r,alt:"",className:"pictogram",draggable:!1}),!s&&l&&(0,P.Y)("video",{src:t,width:a,height:r,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,P.Y)(N.A,{thumbDataUri:l?e:c,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(60919),d=n(39761),c=n(87679),l=n(58554),u=n(95704),m=n(37836),h=n(46051),p=n(66991);const g={},f=(0,m.v7)(1e3),v=function(e,t){(0,i.vJ)((()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,o.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await f,e.forEach((({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,u.h)((0,l.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):l.hd(e,t).then((e=>{e&&(t===s.qZ.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout((()=>{(0,d.A)(n),t.removeChild(n)}),1e3)}(e),t===s.qZ.BlobUrl&&(0,c.NN)(e))}))}))})(function(e,t){const n=(0,r._bp)((0,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),d=[];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);d.push({hash:(0,a.EN)(i,"full"),format:o?s.qZ.Progressive:s.qZ.BlobUrl,isStream:o&&(0,p.c)(h.G)}),d.push({hash:(0,a.EN)(i),format:s.qZ.BlobUrl}),i.content.altVideos&&d.push({hash:(0,a.EN)(i,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)})),d}(e,n))}))}),[t,e])}},93809:(e,t,n)=>{n.d(t,{A:()=>a});var 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)(),d=(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,d()};t>0?r.current=window.setTimeout(e,t):e()}),e),a.current}},95362:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(37836);const o=10,s=1e3;let a=[],r=!1;function d(e,t){a.push({url:e,filename:t}),r||(r=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of a)c(t),e++,e===o&&(await(0,i.v7)(s),e=0);a=[]}(),r=!1}),s))}function c({url:e,filename:t}){const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.download=t;try{n.click()}catch(e){console.error(e)}}},95704:(e,t,n)=>{n.d(t,{h:()=>l});var i=n(23174),o=n(4875);const s=262144,a=5242879,r=new Map,d=new Map,c=new Map;async function*l(e,t=0,n=s){const l=e.match(/fileSize=(\d+)/);let u;for(u=l?l&&Number(l[1]):d.get(e);;){if(u&&t>=u)return;let s=t+n-1;u&&s>u&&(s=u-1);const l=`${e}:${t}-${s}`;let m=r.get(l);if(!m){let n=c.get(l);n||(n=(0,o.px)("downloadMedia",{mediaFormat:i.qZ.Progressive,url:e,start:t,end:s}),c.set(l,n));const h=await n.finally((()=>{c.delete(l)}));if(!h?.arrayBuffer)return;h.fullSize&&!u&&(u=h.fullSize,d.set(e,h.fullSize)),m=h.arrayBuffer,s<=a&&r.set(l,h.arrayBuffer)}yield m,t=s+1}}},97046:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97676:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(84051),o=n(87357),s=n(37661),a=n(5912),r=n(17712),d=n(62587),c=n(10221),l=n(18104),u=n(3325);var m=n(20021);const h=(0,i.ph)((({messageId:e,isMirrored:t,effect:n,shouldPlay:h,observeIntersectionForLoading:p,observeIntersectionForPlaying:g,onStop:f})=>{const v=(0,i.li)(),A=(0,i.li)(),y=(0,a.Vz)(v,p),C=(0,a.Vz)(v,g),[w,b,I]=(0,s.A)(),[S,M,N]=(0,s.A)(),k=function(e){return e.effectAnimationId?`sticker${e.effectAnimationId}`:`sticker${e.effectStickerId}?size=f`}(n),Y=(0,d.A)(k,!y),P=(0,r.A)((()=>{I(),f?.()})),F=(0,c.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,i.vJ)((()=>{S&&F(),N()}),[F,N,S]),(0,i.vJ)((()=>{C&&h&&Y&&(b(),M())}),[C,Y,h,F]);const T=(0,o.A)("McmbiWZE",t&&"wNvU2uqi");return(0,m.Y)("div",{className:(0,o.A)("IYu2f7FM",t&&"GsTZawTE"),ref:v,children:w&&(0,m.Y)(u.A,{children:(0,m.Y)(l.A,{ref:A,className:T,tgsUrl:Y,size:256,play:!0,isLowPriority:!0,noLoop:!0,forceAlways:!0,onEnded:P},`effect-${e??n.id}`)})})}))},97967:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(80089),o=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,o.A)(i.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}}}]);
|
||
//# sourceMappingURL=3944.2d4573de7d58f3ef751d.js.map
|