TelegramPWA/dist/5378.21b180b9124b1f5ff3e9.js
Alexander Zinchuk 47f4e8ce1a [Build]
2026-03-05 12:44:31 +01:00

2 lines
420 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

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

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[5378],{45(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(41036),s=n(18276),a=n(20021),r=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(r||{});const d=(0,o.ph)(({status:e})=>(0,a.Y)("div",{className:"MessageOutgoingStatus",children:(0,a.Y)(i.Ay,{name:"reveal",activeKey:r[e],children:"failed"===e?(0,a.Y)("div",{className:"MessageOutgoingStatus--failed",children:(0,a.Y)(s.A,{name:"message-failed"})}):(0,a.Y)(s.A,{name:`message-${e}`})})}))},285(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(4961),d=n(59030),l=n(94189),c=n(20021);const u=(0,o.ph)((0,i.EK)((e,{userId:t})=>{const n=(0,a.meB)(e),o=t&&(0,a.mBe)(e,t);return{chat:n,contactName:o?(0,s.u0)(o):void 0}})(({isOpen:e,chat:t,userId:n,contactName:s,onClose:a})=>{const{deleteChatMember:u}=(0,i.ko)(),h=(0,d.A)(),m=(0,o.hb)(()=>{u({chatId:t.id,userId:n}),a()},[t,u,a,n]);if(t&&n)return(0,c.Y)(l.A,{isOpen:e,onClose:a,title:h("GroupRemoved.Remove"),textParts:(0,r.A)(h("PeerInfo.Confirm.RemovePeer",s)),confirmLabel:h("lng_box_remove"),confirmHandler:m,confirmIsDestructive:!0})}))},2178(e,t,n){n.d(t,{v:()=>r});var o=n(84051),i=n(46536);const s=new Set(["INPUT","TEXTAREA","SELECT"]),a=(0,i.h)();function r(e){(0,o.vJ)(()=>{if(!e)return;const t=Object.entries(e);return a.addCallback(function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach(([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:o,meta:i,mod:s,shift:a,key:r}=e,{altKey:d,ctrlKey:l,metaKey:c,shiftKey:u,key:h}=t;if(n!==d)return!1;if(s){if(!l&&!c)return!1}else{if(o!==l)return!1;if(i!==c)return!1}return a===u&&Boolean(r&&(h.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map(e=>e.trim()),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},o=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find(e=>!o.includes(e))}}(e),t)})(t)(e)&&n(e)})})},[e])}document.documentElement.addEventListener("keydown",a.runCallbacks)},2429(e,t,n){n.d(t,{A:()=>o});const o={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},3225(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(16120),d=n(96454),l=n(36353),c=n(39074),u=n(58734),h=n(63988),m=n(83414),p=n(19129),g=n(37661),f=n(17712);const v=new RegExp(`(${r.A.source})$`,"g"),A=new RegExp(`${s.bpX.source}$`,"g");function y(e,t,n,y,C,w){const{loadCustomEmojiForEmoji:I,clearCustomEmojiForEmoji:b}=(0,i.ko)(),[S,M,N]=(0,g.A)(!1),k=(0,h.gs)(()=>{const n=t();if(!e||!n||!y()?.collapsed)return;if(!n.match(d.TL?r.A:s.bpX))return;const o=(0,c.LV)(C.current);return o.match(d.TL?v:A)?.[0]},[t,y,C,e],300),Y=(0,m.A)(k,[k,t,y],!0),F=(0,p.A)(()=>Boolean(Y()),[Y]),P=Boolean(w?.length);(0,o.vJ)(()=>{if(!e||!F)return;const t=Y();if(t){if(!P){const e=d.TL?t:t.match(/.+alt="(.+)"/)?.[1];e&&I({emoji:e})}}else b()},[e,F,Y,P,b,I]);const T=(0,f.A)(t=>{const o=Y();if(!e||!o)return;const i=C.current,s=(0,c.LV)(i),r=d.TL?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),h=new RegExp(`(${r})\\1*$`,""),m=s.match(h)[0].length/o.length,p=Array.from({length:m},()=>(0,u.hB)(t)),g=s.replace(h,p.join("")),f=i.innerHTML.substring(s.length);n(`${g}${f}`),(0,a.Uz)(()=>{(0,l.A)(i,!0,!0)})});return(0,o.vJ)(N,[N,t]),{isCustomEmojiTooltipOpen:Boolean(F&&P&&!S),closeCustomEmojiTooltip:M,insertCustomEmoji:T}}},5130(e,t,n){n.d(t,{U:()=>a});var o=n(14235),i=n(37836);class s{requestStates=new Map;requestStatesByCallback=new Map;pendingPayloads=[];pendingTransferables=[];constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n}destroy(){}init(...e){this.postMessageOnTickEnd({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,{transferables:i,...s}=e,a=(0,o.A)(),r={type:"callMethod",messageId:a,...s},d={messageId:a},l=new Promise((e,t)=>{Object.assign(d,{resolve:e,reject:t})});if("function"==typeof r.args[r.args.length-1]){r.withCallback=!0;const e=r.args.pop();d.callback=e,n.set(e,d)}return t.set(a,d),l.catch(()=>{}).finally(()=>{t.delete(a),d.callback&&n.delete(d.callback)}),this.postMessageOnTickEnd(r,i),l}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessageOnTickEnd({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;e.channel===n&&e.payloads.forEach(e=>{if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)})}postMessageOnTickEnd(e,t){this.pendingPayloads.push(e),t&&this.pendingTransferables.push(...t),this.postMessagesOnTickEnd()}postMessagesOnTickEnd=(0,i.Fe)(()=>{const{channel:e}=this,t=this.pendingPayloads,n=this.pendingTransferables;this.pendingPayloads=[],this.pendingTransferables=[],this.target.postMessage({channel:e,payloads:t},n)})}function a(e,t,n){const o=new s(e,t,n);function i({data:e}){o.onMessage(e)}return e.addEventListener("message",i),o.destroy=()=>{e.removeEventListener("message",i)},o}},6070(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomSendMenu",!t);return n?(0,s.Y)(n,{...e}):void 0}},7985(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(66644),s=n(83868),a=n(82117),r=n(17712);const d="no-overscroll",l="no-touch",c={lastDeltas:new Array(7).fill(0),lastAverageDelta:0,isStartedAtTop:!1,resetStartTopAt:void 0,timeout:void 0};function u({containerRef:e,isOverscrolled:t,isDisabled:n,onOverscroll:u,onReset:h}){const[m,p]=(0,o.Ul)("normal"),g=(0,o.li)({...c}),f=(0,o.li)(),v=(0,o.li)(),A=(0,r.A)(()=>{clearTimeout(f.current),p("overscroll"),u?.()}),y=(0,r.A)(()=>{p("animating"),f.current=window.setTimeout(()=>{p("normal")},350),h?.()}),C=(0,r.A)(e=>{clearTimeout(g.current.timeout),g.current.timeout=window.setTimeout(()=>{g.current={...c}},e)}),w=(0,r.A)(t=>{const n=e.current;if(!n||t.defaultPrevented)return;const{deltaY:o}=t,{scrollTop:i}=n,a=m(),r=g.current,d=r.lastAverageDelta,l=0===r.lastDeltas.at(-1)||r.resetStartTopAt&&Date.now()>=r.resetStartTopAt;0===i&&l&&(r.isStartedAtTop=!0,r.resetStartTopAt=void 0);const c=g.current.lastDeltas.slice();c.push(o),c.length>7&&c.shift(),g.current.lastDeltas=c;const u=c.reduce((e,t)=>e+t,0)/c.length;g.current.lastAverageDelta=u;const h=Math.abs(u)-Math.abs(d)>7;return C(100),0===i&&o<0&&"overscroll"!==a?(r.resetStartTopAt||(r.resetStartTopAt=Date.now()+100),void(h&&r.isStartedAtTop&&A())):"animating"===a&&o>0?void(0,s.A)(t):"overscroll"===a&&o>0?(y(),void(0,s.A)(t)):void 0}),I=(0,r.A)(t=>{const n=e.current;if(!n||1!==t.touches.length)return;const{scrollTop:o}=n,i=m();0!==o&&"overscroll"!==i||(v.current=t.touches[0].clientY)}),b=(0,r.A)(t=>{const n=e.current,o=v.current;if(!n||void 0===o||1!==t.touches.length)return;const{scrollTop:i}=n,s=m(),a=t.touches[0].clientY-o;return"animating"!==s?0===i&&a>75&&"overscroll"!==s?(A(),void(v.current=void 0)):"overscroll"===s&&a<-75?(y(),void(v.current=void 0)):void 0:void 0}),S=(0,r.A)(()=>{v.current=void 0});(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.add(d)}),()=>{(0,i.RK)(()=>{t.classList.remove(d)})}},[e,n]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return(0,i.RK)(()=>{t.classList.toggle(l,"normal"!==m())}),()=>{(0,i.RK)(()=>{t.classList.remove(l)})}},[e,n,m]),(0,a.A)(([e])=>{e!==t&&(t||"animating"!==m())&&p(t?"overscroll":"normal")},[t,m,p]),(0,o.vJ)(()=>{const t=e.current;if(!n&&t)return t.addEventListener("wheel",w,{passive:"normal"===m()}),t.addEventListener("touchstart",I,{passive:!0}),t.addEventListener("touchmove",b,{passive:!0}),t.addEventListener("touchend",S,{passive:!0}),t.addEventListener("touchcancel",S,{passive:!0}),()=>{t.removeEventListener("wheel",w),t.removeEventListener("touchstart",I),t.removeEventListener("touchmove",b),t.removeEventListener("touchend",S),t.removeEventListener("touchcancel",S);const e=g.current;e?.timeout&&clearTimeout(e.timeout)}},[e,w,I,b,S,m,n])}},8247(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(11597),l=n(79824),c=n(18501),u=n(43874),h=n(74984),m=n(39351),p=n(17712);const g=e=>{const{sidebarMode:t,orderedFolderIds:n,chatFoldersById:g,maxFolders:f,isReadOnly:v}=e,{maxChatLists:A,folderInvitesById:y,maxFolderInvites:C}=v?{}:e,w=(0,m.A)(),{isMobile:I}=(0,u.Ay)(),{openShareChatFolderModal:b,openDeleteChatFolderModal:S,openEditChatFolder:M,openLimitReachedModal:N,markChatMessagesRead:k,openSettingsScreen:Y,setSharedSettingOption:F}=(0,i.ko)(),P=(0,o.Kr)(()=>({id:r.DSF,title:{text:n?.[0]===r.DSF?w("FilterAllChatsShort"):w("FilterAllChats")},includedChatIds:l.p,excludedChatIds:l.p,emoticon:"💬"}),[n,w]),T=(0,o.Kr)(()=>n?n.map(e=>e===r.DSF?P:g[e]||{}).filter(Boolean):void 0,[g,P,n]),D=(0,h.Jm)(),x=(0,p.A)(e=>{const t=D[e];t?.length&&t.forEach(e=>{k({id:e})})}),L=(0,h.ic)(),E=(0,o.Kr)(()=>{if(T&&T.length)return T.map((e,n)=>{const{id:o,title:l}=e,u=o!==r.DSF&&n>f-1,h=(0,d.w5O)((0,i.mS)(),o),m=[];v||(h&&m.push({title:w("FilterShare"),icon:"link",handler:()=>{Object.values(g).reduce((e,t)=>e+(t.isChatList?1:0),0)>=A&&!e.isChatList?N({limit:"chatlistJoined"}):y[o]?.length>=C?N({limit:"chatlistInvites"}):b({folderId:o})}}),o===r.DSF?(m.push({title:w("FilterEditFolders"),icon:"edit",handler:()=>{Y({screen:a.VS.Folders})}}),D[o]?.length&&m.push({title:w("ChatListMarkAllAsRead"),icon:"readchats",handler:()=>x(e.id)})):(m.push({title:w("EditFolder"),icon:"edit",handler:()=>{M({folderId:o})}}),D[o]?.length&&m.push({title:w("ChatListMarkAllAsRead"),icon:"readchats",handler:()=>x(e.id)}),m.push({title:w("FilterMenuDelete"),icon:"delete",destructive:!0,handler:()=>{S({folderId:o})}})),I||(m.push({isSeparator:!0}),m.push({title:w(t?"TabsPositionTop":"TabsPositionLeft"),icon:"forums",handler:()=>{F({foldersPosition:t?"top":"left"})}})));const p={text:l.text,entities:l.entities,noCustomEmojiPlayback:e.noTitleAnimations};let k=e.emoticon;if(t){p.emojiSize=10;const e=l.entities?.find(e=>e.type===s.C7.CustomEmoji&&0===e.offset);if(e){k=e;const{offset:t,length:n}=e;p.text=l.text.replace(l.text.substring(t,t+n),""),p.entities=l.entities?.filter(e=>e.offset!==t).map(e=>({...e,offset:e.offset-n}))}}const P=(0,c.fd)(p);return{id:o,title:P,badgeCount:L[o]?.chatsCount,isBadgeActive:Boolean(L[o]?.notificationsCount),isBlocked:u,contextActions:m.length?m:void 0,emoticon:k,noTitleAnimations:e.noTitleAnimations}})},[T,f,L,w,g,A,y,C,D,v,t,I]);return{displayedFolders:T,folderTabs:E}}},9442(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(23174),a=n(66644),r=n(90709),d=n(70636),l=n(36353),c=n(87894),u=n(39074),h=n(17778),m=n(63988),p=n(83414),g=n(37661),f=n(39351),v=n(17712);let A;try{A=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){A=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function y(e,t,n,y,w,I,b,S){const M=(0,f.A)(),[N,k]=(0,o.J0)(),[Y,F,P]=(0,g.A)(!1),T=(0,m.gs)(()=>{const n=t();if(!e||!y()?.collapsed||!n.includes("@"))return;const o=(0,u.LV)(w.current);return(0,h.S)(o).match(A)?.[0].trim()},[e,t,y,w],300),D=(0,p.A)(T,[T,t,y],!0),x=(0,p.A)(()=>e&&t().startsWith("@"),[t,e]);(0,o.vJ)(()=>{const e=D();if(!e||!I&&!b)return void k(void 0);const t=(0,i.mS)().users.byId;if(!t)return void k(void 0);const n=I?.reduce((e,t)=>(t.userId!==S&&e.push(t.userId),e),[]),o=e.substring(1),s=(0,d.PU)({ids:(0,c.Am)([...x()&&b||[],...n||[]]),query:o,type:"user"});k(Object.values((0,c._E)(t,s)))},[S,I,b,D,x]);const L=(0,v.A)((e,t=!1,o=!1)=>{if(!e.hasUsername&&!(0,d.F9)(M,e))return;const i=(0,r.Kl)(e),c=(0,d.F9)(M,e)||"",h=i?`@${i}`:`<a\n class="text-entity-link"\n data-entity-type="${s.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${c}</a>`,m=w.current,p=C((0,u.LV)(m)),g=o?p.length:p.lastIndexOf("@"),f=(i?i.length+1:c.length)-(p.length-g);if(-1!==g){const e=`${p.substr(0,g)}${h}&nbsp;`,o=C(m.innerHTML).substring(p.length),i=(0,u.JC)(m);n(`${e}${o}`),(0,a.Uz)(()=>{const e=i+f+1;(0,l.A)(m,t),e>=0&&(0,u.vZ)(m,e)})}k(void 0)});return(0,o.vJ)(P,[P,t]),{isMentionTooltipOpen:Boolean(N?.length&&!Y),closeMentionTooltip:F,insertMention:L,mentionFilteredUsers:N}}function C(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},9717(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(66644),s=n(87894),a=n(79882),r=n(30857),d=n(17712),l=n(73767),c=n(35297);const u={};function h(e,t,n){const h=(0,o.Kr)(()=>{if(e)return e.reduce((e,t,n)=>(e[t]=n,e),{})},[e]),m=(0,l.A)(h),p=(0,l.A)(n),g=(0,l.A)(t),f=(0,o.li)(!0);(0,o.vJ)(()=>{(0,i.Uz)(()=>{f.current=!1})},[]);const v=(0,o.li)(u),A=(0,r.A)(),y=(0,d.A)(()=>{v.current!==u&&(v.current=u,A())}),C=void 0!==g?t-g:0;(0,c.A)(()=>{if(!h||!m||n!==p||m===h)return void(v.current=u);const e=(0,s.LG)(h,(e,t)=>void 0!==m[t]?e-m[t]:-1/0),t=Object.values(e).some(e=>0!==e);v.current=t?e:u},[n,h,p,m,t]);const w=(0,a.We)(v.current,f.current,Boolean(C));return{orderDiffById:v.current,shiftDiff:C,getAnimationType:w,onReorderAnimationEnd:y}}},10221(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(66644),s=n(76023),a=n(17712);const r=s.$;function d({anchorRef:e,overlayRef:t,isMirrored:n,isForMessageEffect:s,isDisabled:d,id:l}){const c=(0,a.A)(()=>{const o=t.current,a=e.current;if(!o||!a)return;const d=a.getBoundingClientRect(),l=o.getBoundingClientRect(),c=window.innerWidth;(0,i.RK)(()=>{const e=d.top+d.height/2,t=d.bottom,i=s?t:e;o.style.top=i-l.height/2+"px",n?o.style.left=d.left-r+"px":o.style.right=c-d.right-r+"px"})});return(0,o.vJ)(()=>{d||c()},[d,l]),(0,o.vJ)(()=>{if(d)return;const t=e.current.closest(".MessageList");return t?(t.addEventListener("scroll",c,{passive:!0}),()=>{t.removeEventListener("scroll",c)}):void 0},[d,e]),c}},11359(e,t,n){n.d(t,{J:()=>s,L:()=>i});var o=n(31481);function i(e,t){const{commonAncestorContainer:n}=e;let o=n,i=1;for(;o&&o.id!==t&&i<5;)o=o.parentElement,i++;return Boolean(o&&o.id===t)}function s(){const e=document.activeElement;if(e?.id!==o.CfG&&e?.id!==o.e0F)return!1;const t=window.getSelection();return Boolean(t&&!t.isCollapsed)}},11462(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(17712),a=n(35297);function r(e=!1){const t=(0,o.li)(e),n=(0,o.li)(!1),r=(0,i.A)();(0,a.A)(()=>{e&&(t.current=!0)},[e]);const d=(0,s.A)(()=>{t.current=!1,n.current=!1,r()}),l=(0,s.A)(()=>{n.current=!0,r()});return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:d,handleForumPanelAnimationStart:l}}},14413(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(13439),s=n(31481),a=n(39351),r=n(19806),d=n(94189);var l=n(20021);const c=(0,o.ph)((0,i.EK)(e=>({verifyAgeMin:e.appConfig.verifyAgeMin||s.lYi}))(({isOpen:e,onClose:t,shouldAlwaysShow:n,onAlwaysShowChanged:o,confirmHandler:i,verifyAgeMin:s})=>{const c=(0,a.A)();return(0,l.FD)(d.A,{title:c("TitleSensitiveModal",{years:s}),confirmLabel:c("ButtonSensitiveView"),isOpen:e,onClose:t,confirmHandler:i,children:[c("TextSensitiveModal"),(0,l.Y)(r.A,{className:"mYXi2mIC",label:c("ButtonSensitiveAlways",{years:s}),checked:n,onCheck:o})]})}))},15006(e,t,n){n.d(t,{U:()=>u,A:()=>c});var o=n(84051),i=n(13439),s=n(31481),a=n(11597),r=n(6842),d=n(14235);var l=n(20021);const c=(0,o.ph)(()=>(0,l.Y)("div",{className:"AN8wkEiR",id:s.Lj4}));function u(e){const t=(0,i.mS)();if(!(0,a.Rwe)(t))return!1;const n=e.getBoundingClientRect(),o=n.left+window.scrollX,c=n.top+window.scrollY,u=n.width,m=n.height;if(o+u+50<0||o-50>window.innerWidth||c+m+50<0||c-50>window.innerHeight)return!1;const p=Math.floor(Date.now()/1e3),g=`${s.xcU}-${(0,d.A)()}`,f=(0,l.FD)("svg",{className:"ANWk2pWP",width:u,height:m,style:`left: ${o}px; top: ${c}px;`,viewBox:`0 0 ${u} ${m}`,children:[(0,l.Y)("defs",{children:h(g,Math.min(u,m),p)}),(0,l.Y)("g",{filter:`url(#${g})`,children:(0,l.Y)("foreignObject",{className:"UDCMfXxs",width:u,height:m})})]}),v=(0,r.A)(f)[0],A=v.querySelector("foreignObject"),y=window.getComputedStyle(e),C=e.cloneNode(!0);Array.from(y).forEach(e=>C.style.setProperty(e,y.getPropertyValue(e),"important")),A.appendChild(C);const w=document.getElementById(s.Lj4);return w.appendChild(v),v.addEventListener("animationend",()=>{w.removeChild(v)},{once:!0}),!0}function h(e,t,n=42){return(0,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:"1000ms",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:"1000ms",fill:"freeze"})})]})}},17169(e,t,n){n.d(t,{A:()=>o});const o={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},17751(e,t,n){n.d(t,{A:()=>N});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(11597),d=n(96115),l=n(87357),c=n(76023),u=n(4961),h=n(54699),m=n(39351),p=n(17712),g=n(59030),f=n(42452),v=n(41036),A=n(21849),y=n(80999),C=n(34431),w=n(18276),I=n(38102),b=n(80477),S=n(20021);const M=2.5*c.$,N=(0,o.ph)((0,i.EK)((e,{userId:t,threadId:n,forceShowSelf:o})=>{const{isSynced:i}=e,s=t?(0,r.mBe)(e,t):void 0,a=t?(0,r.K0y)(e,t):void 0,l=!o&&s&&s.isSelf,c=l?s:(0,r.mBe)(e,e.currentUserId),u=Boolean(t?(0,r.zeq)(e,t):void 0),h=n?(0,r.S0q)(e,t,n):void 0;return{user:s,userStatus:a,isSavedMessages:l,areMessagesLoaded:u,self:c,isSynced:i,topic:h,messagesCount:h&&t?(0,d.Qb)(e,t,n):void 0}})(({userId:e,customPeer:t,typingStatus:n,avatarSize:r="medium",status:d,statusIcon:c,withDots:N,withMediaViewer:k,withUsername:Y,withStory:F,withFullInfo:P,withUpdatingStatus:T,emojiStatusSize:D,noStatusOrTyping:x,noEmojiStatus:L,noFake:E,noVerified:B,noRtl:R,user:O,userStatus:U,self:K,topic:z,messagesCount:V,isSavedMessages:j,isSavedDialog:J,areMessagesLoaded:G,adminMember:q,ripple:$,className:H,storyViewerOrigin:W,noAvatar:_,isSynced:Q,iconElement:Z,rightElement:X,onClick:ee,onEmojiStatusClick:te})=>{const{loadFullUser:ne,openMediaViewer:oe,loadMoreProfilePhotos:ie}=(0,i.ko)(),se=(0,g.A)(),ae=(0,m.A)(),re=Boolean(O?.isBotForum&&z),de=k&&!j;(0,o.vJ)(()=>{e&&(P&&Q&&ne({userId:e}),k&&ie({peerId:e,isPreload:!0}))},[e,P,k,Q]),(0,h.A)(6e4);const le=(0,p.A)((t,n)=>{n&&(t.stopPropagation(),oe({isAvatarView:!0,chatId:e,mediaIndex:0,origin:"jumbo"===r?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ce=(0,o.Kr)(()=>O&&Y&&(0,a.Kl)(O),[O,Y]);if(!O&&!t)return;const ue=q?q.customTitle||se(q.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return(0,S.FD)("div",{className:(0,l.A)("ChatInfo",H),dir:!R&&ae.isRtl?"rtl":void 0,onClick:ee,children:[J&&K&&(0,S.Y)(A.A,{size:r,peer:K,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),!_&&!re&&(0,S.Y)(A.A,{size:r,peer:t||O,className:(0,l.A)(J&&"overlay-avatar"),isSavedMessages:j,isSavedDialog:J,withStory:F,storyViewerOrigin:W,storyViewerMode:"single-peer",onClick:de?le:void 0},O?.id),re&&(0,S.Y)(I.A,{topic:z,className:"topic-header-icon",size:M}),(0,S.FD)("div",{className:"info",children:[re?(0,S.Y)("h3",{dir:"auto",className:"fullName",children:(0,u.A)(z.title)}):ue?(0,S.FD)("div",{className:"info-name-title",children:[(0,S.Y)(C.A,{peer:O,withEmojiStatus:!L,emojiStatusSize:D,isSavedMessages:j,isSavedDialog:J,onEmojiStatusClick:te}),ue&&(0,S.Y)("span",{className:"custom-title",children:ue})]}):(0,S.Y)(C.A,{peer:t||O,noFake:E,noVerified:B,withEmojiStatus:!L,emojiStatusSize:D,isSavedMessages:j,isSavedDialog:J,onEmojiStatusClick:te,iconElement:Z}),(d||!j&&!x)&&function(){if(d)return N?(0,S.Y)(y.A,{className:"status",content:d}):(0,S.FD)("span",{className:"status",dir:"auto",children:[c&&(0,S.Y)(w.A,{className:"status-icon",name:c}),(0,u.A)(d)]});if(T&&!G)return(0,S.Y)(y.A,{className:"status",content:ae("Updating")});if(t?.subtitleKey)return(0,S.Y)("span",{className:"status",dir:"auto",children:(0,S.Y)("span",{className:"user-status",dir:"auto",children:se(t.subtitleKey)})});if(!O)return;if(n)return(0,S.Y)(b.A,{typingStatus:n});if(re)return(0,S.Y)("span",{className:"status",dir:"auto",children:(0,S.Y)(v.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==V?1:2,className:"message-count-transition",children:void 0!==V?V>0?ae("Messages",{count:V},{pluralValue:V}):ae("ChatInfoNoMessages"):ae("ChatInfoForumTopic")})});if((0,a.DX)(O.id))return;const e=(0,a.CD)(se,O,U),o=(0,l.A)("handle",e&&"withStatus");return(0,S.FD)("span",{className:(0,l.A)("status",(0,a.PF)(O,U,!0)&&"online"),children:[ce&&(0,S.Y)("span",{className:o,children:ce}),e&&(0,S.Y)("span",{className:"user-status",dir:"auto",children:e})]})}()]}),$&&(0,S.Y)(f.A,{}),X]})}))},17778(e,t,n){n.d(t,{S:()=>r});const o=/(<br>|<br\s?\/>)/g,i=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,a=/\n$/i;function r(e){return e.replace(i," ").replace(o,"\n").replace(s,"").replace(a,"")}},19210(e,t,n){n.d(t,{A:()=>G});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(27109),c=n(11597),u=n(96115),h=n(96454),m=n(87357),p=n(48899),g=n(49763),f=n(66414),v=n(63527),A=n(43874),y=n(47067),C=n(49746),w=n(37661),I=n(5912),b=n(17712),S=n(50680),M=n(73176),N=n(21849),k=n(54314),Y=n(34431),F=n(18276),P=n(9267),T=n(81642),D=n(22720),x=n(97967),L=n(97046),E=n(24384);const B="AA5s1Pu4";var R=n(20021);const O=(0,o.ph)(({isSelected:e,isActive:t,isMobile:n})=>(0,R.Y)("div",{className:(0,m.A)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM"),children:(0,R.FD)("div",{className:"nl36F75B",children:[(0,R.Y)("div",{className:B}),(0,R.Y)("div",{className:B}),(0,R.Y)("div",{className:B})]})}));var U=n(76023),K=n(18501),z=n(39996);const V="oIgI9O0L",j=.875*U.$,J=(0,o.ph)(({orderedFolderIds:e,chatFoldersById:t,isFoldersSidebarShown:n,itemClassName:i})=>{if(!e)return;const a=e.slice(0,3),r=e.length-a.length,d=(0,o.hb)(e=>{let t=e.title.text,o=e.title.entities;if(n){const n=e.title.entities?.find(e=>e.type===s.C7.CustomEmoji&&0===e.offset);if(n){const{offset:i,length:s}=n;t=e.title.text.replace(e.title.text.substring(i,i+s),""),o=e.title.entities?.filter(e=>e.offset!==i).map(e=>({...e,offset:e.offset-s}))}}return(0,K.fd)({text:t,entities:o,noCustomEmojiPlayback:e.noTitleAnimations,emojiSize:j})},[n]);return(0,R.FD)("div",{className:"cgAMX02q",children:[a.map(e=>{const n=t?.[e];return n&&(0,R.Y)("div",{className:(0,m.A)(V,void 0!==n.color&&-1!==n.color&&(0,z.yp)(n.color),i),children:d(n)},n.id)}),r>0&&(0,R.FD)("div",{className:(0,m.A)(V,"hZDqIz3W",i),children:["+",r]})]})}),G=(0,o.ph)((0,i.EK)((e,{chatId:t,isSavedDialog:n,isPreview:o,previewMessageId:i})=>{const a=(0,c.hds)(e,t),r=(0,c.mBe)(e,t);if(!a)return{currentUserId:e.currentUserId};const d=(0,g.N)(t),{areTagsEnabled:h}=e.chatFolders,m=(0,c.g29)(e),p=i||(0,c.ZZX)(e,t,n?"saved":"all"),f=i?(0,c.O5q)(e,t,i):(0,c.yHC)(e,t,n?"saved":"all"),{isOutgoing:v,forwardInfo:A}=f||{},y=n&&A?.fromId?(0,c.PVB)(e,A.fromId):void 0,C=f?(0,c.Y7C)(e,f):void 0,w=y||C,{chatId:I,threadId:b,type:S}=(0,c.Xf0)(e)||{},M=!o&&t===I&&(n?t===b:b===s.l3),N=a.isForum&&t===I||t===(0,c.nTw)(e).forumPanelChatId,k=(0,c.K0y)(e,t),Y=f&&(0,c.nkm)(e,f),F=(0,u._X)(e,t,s.l3,"typingStatus"),P=(0,c.xyP)(e,t),T=f?.content.storyData,D=T&&(0,c.Msb)(e,T.peerId,T.id),x=(0,c.trm)(e),L=(0,c.k2W)(e,t);return{chat:a,isMuted:(0,l.If)(a,(0,c.K52)(e),(0,c.P5N)(e,a.id)),lastMessageSender:w,draft:(0,u.GA)(e,t,s.l3),isSelected:M,isSelectedForum:N,isForumPanelOpen:(0,c.clw)(e),canScrollDown:M&&"thread"===S,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,lastMessageOutgoingStatus:v&&f&&!n?(0,c.Tl2)(e,t,s.l3,f.id,"thread"):void 0,user:r,userStatus:k,lastMessageTopic:Y,typingStatus:F,withInterfaceAnimations:(0,c.PKK)(e),lastMessage:f,lastMessageId:p,currentUserId:e.currentUserId,listedTopicIds:P?.listedTopicIds,isSynced:e.isSynced,lastMessageStory:D,isAccountFrozen:x,monoforumChannel:L,chatFolderIds:d,orderedFolderIds:e.chatFolders.orderedIds,chatFoldersById:e.chatFolders.byId,areTagsEnabled:h&&m}})(({chatId:e,folderId:t,orderDiff:n,shiftDiff:l,animationType:u,isPinned:g,listedTopicIds:B,observeIntersection:U,chat:K,monoforumChannel:z,lastMessageStory:V,isMuted:j,user:G,userStatus:q,lastMessageSender:$,lastMessageOutgoingStatus:H,offsetTop:W,draft:_,withInterfaceAnimations:Q,isSelected:Z,isSelectedForum:X,isForumPanelOpen:ee,canScrollDown:te,canChangeFolder:ne,lastMessageTopic:oe,typingStatus:ie,lastMessageId:se,lastMessage:ae,isSavedDialog:re,currentUserId:de,isPreview:le,previewMessageId:ce,className:ue,isSynced:he,isAccountFrozen:me,chatFolderIds:pe,orderedFolderIds:ge,chatFoldersById:fe,areTagsEnabled:ve,withTags:Ae,isFoldersSidebarShown:ye,onDragEnter:Ce,onDragLeave:we,onReorderAnimationEnd:Ie})=>{const{openChat:be,openSavedDialog:Se,toggleChatInfo:Me,focusMessage:Ne,loadTopics:ke,openForumPanel:Ye,closeForumPanel:Fe,setShouldCloseRightColumn:Pe,reportMessages:Te,openFrozenAccountModal:De,updateChatMutedState:xe,openQuickPreview:Le,scrollMessageListToBottom:Ee}=(0,i.ko)(),{isMobile:Be}=(0,A.Ay)(),[Re,Oe,Ue]=(0,w.A)(),[Ke,ze,Ve]=(0,w.A)(),[je,Je,Ge]=(0,w.A)(),[qe,$e,He]=(0,w.A)(),[We,_e,Qe]=(0,w.A)(),[Ze,Xe,et]=(0,w.A)(),{isForum:tt,isForumAsMessages:nt,isMonoforum:ot}=K||{},it=K?.isBotForum&&B&&!B.length;(0,C.A)(re?de:e,se,ae);const st=(0,o.Kr)(()=>{const e=new Set(pe);return ge?.filter(n=>{if(!e.has(n))return;const o=n===t,i=n===r.DSF,s=fe?.[n],a=void 0!==s?.color&&-1!==s.color;return!o&&!i&&a})},[ge,t,fe,pe]),at=ve&&Ae,rt=at&&Boolean(st?.length),{renderSubtitle:dt,ref:lt}=(0,M.A)({chat:K,chatId:e,lastMessage:ae,typingStatus:ie,draft:_,statefulMediaContent:(0,d.FE)({story:V}),lastMessageTopic:oe,lastMessageSender:$,observeIntersection:U,animationType:u,withInterfaceAnimations:Q,orderDiff:n,shiftDiff:l,isSavedDialog:re,isPreview:le,onReorderAnimationEnd:Ie,topicIds:B,hasTags:rt,shouldForceNonForumView:it}),ct=(0,v.BI)(c.sRo),ut=(0,b.A)(t=>{if(t.altKey&&!re&&!tt&&!le)return t.preventDefault(),void Le({id:e});const n=Be&&nt||it;if(Be&&Pe({value:!0}),le)Ne({chatId:e,messageId:ce});else{if(re)return Se({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(Be&&Me({force:!1}));if(tt){if(ee)return void Fe(void 0,{forceOnHeavyAnimation:!0});if(n||Ye({chatId:e},{forceOnHeavyAnimation:!0}),!nt&&!it)return}be({id:e,noForumTopicPanel:n,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),Z&&te&&Ee()}}),ht=(0,b.A)(t=>{t.preventDefault(),Ce?.(e)}),mt=(0,b.A)(()=>{me?De():($e(),Oe())}),pt=(0,b.A)(()=>{me?De():(_e(),ze())}),gt=(0,b.A)(()=>{me?De():xe({chatId:e,mutedUntil:r.Os5})}),ft=(0,b.A)(()=>{Xe(),Je()}),vt=(0,b.A)(()=>{me?De():K&&Te({chatId:K.id,messageIds:[]})}),At=(0,y.A)({chat:K,user:G,handleDelete:mt,handleMute:pt,handleUnmute:gt,handleChatFolderChange:ft,handleReport:vt,folderId:t,isPinned:g,isMuted:j,canChangeFolder:ne,isSavedDialog:re,currentUserId:de,isPreview:le,topicIds:B}),yt=(0,I.Vz)(lt,K?U:void 0);(0,o.vJ)(()=>{yt&&tt&&he&&void 0===B&&ke({chatId:e})},[e,B,he,tt,yt]);const Ct=G&&q&&(0,d.PF)(G,q),{hasShownClass:wt}=(0,S.A)(Ct),It=(0,o.Kr)(()=>{if(h.OS)return re?`#${(0,f.az)(de,"thread",e)}`:`#${(0,f.az)(e,"thread",s.l3)}`},[e,de,re]);if(!K)return;const bt=G||K,St=(0,m.A)("Chat chat-item-clickable",(0,p.L8)(e)?"private":"group",tt&&!it&&"forum",Z&&"selected",X&&"selected-forum",le&&"standalone",ve&&Ae&&"chat-item-with-tags",ue);return(0,R.FD)(D.A,{ref:lt,className:St,href:It,style:`top: ${W}px`,ripple:!tt&&!Be,contextActions:At,withPortalForMenu:!0,onClick:ut,onDragEnter:ht,onDragLeave:we,children:[(0,R.FD)("div",{className:(0,m.A)("status","status-clickable"),children:[(0,R.Y)(N.A,{peer:ot?z:bt,isSavedMessages:G?.isSelf,isSavedDialog:re,size:le?"medium":"large",asMessageBubble:ot,withStory:!G?.isSelf&&!ot,withStoryGap:wt||Boolean(K.subscriptionUntil),storyViewerOrigin:a.G9.ChatList,storyViewerMode:"single-peer"}),(0,R.FD)("div",{className:"avatar-badge-wrapper",children:[(0,R.Y)("div",{className:(0,m.A)("avatar-online","avatar-badge",wt&&"avatar-online-shown")}),!wt&&Boolean(K.subscriptionUntil)&&(0,R.Y)(P.A,{type:"gold",className:"avatar-badge avatar-subscription",size:"adaptive"}),(0,R.Y)(E.A,{chat:K,isMuted:j,shouldShowOnlyMostImportant:!0,forceHidden:ct,isSelected:Z,isOnAvatar:!0})]}),K.isCallActive&&K.isCallNotEmpty&&(0,R.Y)(O,{isMobile:Be,isSelected:Z,isActive:Q})]}),(0,R.FD)("div",{className:(0,m.A)("info",at&&"has-tags"),children:[(0,R.FD)("div",{className:"info-row",children:[(0,R.Y)(Y.A,{peer:ot?z:bt,isMonoforum:ot,monoforumBadgeClassName:"monoforum-badge",withEmojiStatus:!0,isSavedMessages:e===G?.id&&G?.isSelf,isSavedDialog:re,observeIntersection:U,withStatusTextColor:Z}),j&&!re&&(0,R.Y)(F.A,{name:"muted"}),(0,R.Y)("div",{className:"separator"}),ae&&(0,R.Y)(T.A,{message:ae,outgoingStatus:re?void 0:H,draftDate:_?.date})]}),(0,R.FD)("div",{className:"subtitle",children:[dt(),!le&&(0,R.Y)(E.A,{chat:K,isPinned:g,isMuted:j,isSavedDialog:re,hasMiniApp:G?.hasMainMiniApp,isSelected:Z,transitionClassName:"chat-badge-transition"})]}),rt&&(0,R.Y)(J,{itemClassName:"chat-tag",orderedFolderIds:st,chatFoldersById:fe,isFoldersSidebarShown:ye})]}),qe&&(0,R.Y)(k.A,{isOpen:Re,onClose:Ue,onCloseAnimationEnd:He,chat:K,isSavedDialog:re}),We&&(0,R.Y)(L.A,{isOpen:Ke,onClose:Ve,onCloseAnimationEnd:Qe,chatId:e}),Ze&&(0,R.Y)(x.A,{isOpen:je,onClose:Ge,onCloseAnimationEnd:et,chatId:e})]})}))},20247(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(17712);function r(e,t,n){const{shouldPaidMessageAutoApprove:r}=(0,i.mS)().settings.byKey,[d,l]=(0,o.J0)(Boolean(r)),[c,u]=(0,o.J0)(!1),h=(0,o.li)(void 0),m=(0,a.A)(()=>{(0,i.ko)().closePaymentMessageConfirmDialogOpen()});(0,o.vJ)(()=>{c&&!t&&(u(!1),n>e&&h?.current?.())},[c,t,n,e]);const p=(0,a.A)(()=>{(0,i.ko)().openStarsBalanceModal({topup:{balanceNeeded:e,purpose:s.D3m}}),u(!0)});return{closeConfirmDialog:m,handleWithConfirmation:(t,...o)=>{if(e){if(h.current=()=>t(...o),!r)return void(0,i.ko)().openPaymentMessageConfirmDialogOpen();if(e>n)return void p()}t(...o)},dialogHandler:(0,a.A)(()=>{e>n?p():h?.current?.(),(0,i.ko)().closePaymentMessageConfirmDialogOpen(),d&&(0,i.ko)().setPaidMessageAutoApprove()}),shouldAutoApprove:d,setAutoApprove:l}}},21488(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(13439),s=n(37836);const a=function(e,t,n){const{loadPeerStoriesByIds:a}=(0,i.ko)(),r=(0,o.Kr)(()=>{const n=(0,s.nF)(a,200,!0);return()=>{n({peerId:e,storyIds:[t]})}},[t,e]);(0,o.vJ)(()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()},[r,n,t,e])}},23459(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(48899),d=n(37836);const l=new Map;let c=new Set;const u=(0,d.nF)(()=>{const e=Array.from(c),t=e.slice(0,100),n=e.slice(100);(0,i.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach(e=>l.set(e,Date.now())),c=new Set(n),c.size&&u()},500);function h(e){const t=(0,o.Kr)(()=>{const t=(0,i.mS)();return e?.map(e=>(0,a.PVB)(t,e)).filter(Boolean)},[e]),n=(0,o.Kr)(()=>{const e=(0,i.mS)();return t?.filter(t=>{const n=l.get(t.id)||0;if(Date.now()-n<36e5)return!1;if((0,r.L8)(t.id)){const n=t,o=(0,a.K0y)(e,n.id),i=o&&"userStatusEmpty"!==o.type;return!n.isContact&&!n.isSelf&&!(0,s.tv)(n)&&!t.isSupport&&i}{const n=t,o=(0,a._ls)(e,n.id);return(0,s.WX)(n)&&!o}}).map(e=>e.id)},[t]);(0,o.vJ)(()=>{n?.length&&(n.forEach(e=>c.add(e)),u())},[n])}},23565(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(30857),s=n(73767),a=n(35297);function r(e,t){const n=(0,s.A)(e,!0),r=(0,o.li)(),d=(0,i.A)(),l=null!=e,c=null!=n;return l&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,a.A)(()=>{t&&!l&&c&&!r.current&&(r.current=window.setTimeout(()=>{r.current=void 0,d()},t))},[t,d,l,c]),r.current&&t&&!l?n:e}},24384(e,t,n){n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(23174),a=n(11597),r=n(96115),d=n(87357),l=n(87894),c=n(80140),u=n(22237),h=n(14242),m=n(59852),p=n(63527),g=n(19129),f=n(39351),v=n(17712),A=n(68292),y=n(18276),C=n(64493),w=n(26607);const I="PNHSXmwb";var b=n(20021);const S=(0,o.ph)(({topic:e,chat:t,isPinned:n,isMuted:S,shouldShowOnlyMostImportant:M,wasTopicOpened:N,forceHidden:k,isSavedDialog:Y,hasMiniApp:F,isSelected:P,isOnAvatar:T,transitionClassName:D,badgeClassName:x})=>{const{requestMainWebView:L}=(0,i.ko)(),E=(0,f.A)(),B=(0,o.hb)(n=>(0,r.a1)(n,t.id,e?.id||s.l3),[t.id,e?.id]),R=(0,p.Ay)(B),{unreadMentionsCount:O=0,unreadReactionsCount:U=0,unreadCount:K=0,hasUnreadMark:z}=R||{},V=(0,o.hb)(e=>(0,a.xyP)(e,t.id),[t.id]),j=(0,p.LV)(V),{listedTopicIds:J,topicsById:G}=j||{},q=(0,o.hb)(e=>(0,l.pA)(J||[],n=>[n,(0,r.a1)(e,t.id,n)]),[t.id,J]),$=(0,p.LV)(q),H=!n&&e&&!N,W=t.isForum&&!e,_=(0,o.Kr)(()=>W&&J?J.filter(e=>$[e]?.unreadCount):void 0,[J,W,$]),Q=(0,o.Kr)(()=>W&&J?J.filter(e=>$[e]?.unreadMentionsCount):void 0,[J,W,$]),Z=(0,o.Kr)(()=>W&&J?J.filter(e=>$[e]?.unreadReactionsCount):void 0,[J,W,$]),X=W?_?.length:K,ee=W?Q?.length:O,te=W?Z?.length:U,ne=(0,o.Kr)(()=>{if(!W)return!S||0===e?.notifySettings.mutedUntil;if(S)return _?.some(e=>0===G?.[e]?.notifySettings.mutedUntil);const t=_?.every(e=>{const t=G?.[e]?.notifySettings.mutedUntil;return t&&t>(0,c.Fm)()});return!t},[W,S,_,G,e?.notifySettings.mutedUntil]),oe=Boolean((X||z)&&!Y),ie=!(0,g.A)(()=>(0,u.Hp)(k)?k():k,[k])&&Boolean(X||ee||z||n||te||H||F),se=(0,v.A)(e=>{e.stopPropagation();const n=(0,m.A)();L({botId:t.id,peerId:t.id,theme:n})});return(0,b.Y)(w.A,{isCustom:!0,className:(0,d.A)("zGiYriqE",P&&"x5LnLky3",T&&"ZJcE67F7",D),isOpen:ie,children:function(){const e=(0,d.A)("vbb34kEa",x),t=(0,d.A)(e,!ne&&"H0NRx4u_"),o=te&&(0,b.Y)("div",{className:(0,d.A)(t,"R31SqbQj",I),children:(0,b.Y)(y.A,{name:"heart"})}),i=ee&&(0,b.Y)("div",{className:(0,d.A)(t,"IOO6C469",I),children:(0,b.Y)(y.A,{name:"mention"})}),s=H&&(0,b.Y)("div",{className:(0,d.A)(t,"qbAbFaK3")}),a=oe?(0,b.Y)("div",{className:(0,d.A)(t,"RqISI7Dg"),children:!z&&(0,b.Y)(A.A,{text:(0,h.Vw)(E,X)})}):void 0,r=n&&(0,b.Y)("div",{className:(0,d.A)(e,"lVbUgp6W"),children:(0,b.Y)(y.A,{name:"pinned-chat"})}),l=F&&(0,b.Y)(C.A,{color:P?"secondary":"primary",className:(0,d.A)(e,"x2AM544v"),pill:!0,size:"tiny",onClick:se,children:E("BotChatMiniAppOpen")}),c=!a&&!i&&!o&&r,u=[s,o,i,a,c].filter(Boolean);return Y?r:F&&(0===u.length||c)?l:0!==u.length?1===u.length?u[0]:M?[i,a,o,r].filter(Boolean)[0]:(0,b.Y)("div",{className:"R5lXhuMd",children:u}):void 0}()})})},24899(e,t,n){n.d(t,{A:()=>i});var o=n(31481);function i(e,t){return t?`${o.jsp}${e}`:`@${e}`}},24920(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(73767);function a(e){const t=(0,i.A)(),n=(0,o.li)(e),a=(0,s.A)(e);return!1===e&&a!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},25301(e,t,n){n.d(t,{A:()=>de});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(27109),c=n(11597),u=n(93005),h=n(87357),m=n(85982),p=n(64713),g=n(83868),f=n(59852),v=n(37959),A=n(24899),y=n(4961),C=n(18501),w=n(68323),I=n(41385),b=n(57675),S=n(82117),M=n(39351),N=n(17712),k=n(62587),Y=n(59030),F=n(38691),P=n(19210),T=n(64493),D=n(22720),x=n(55158),L=n(63152),E=n(87412),B=n(18276),R=n(84685),O=n(96454),U=n(17663);const K=1440,z=10080;function V(){const e=new Date;e.setHours(0,0,0,0);const t=e.getDay(),n=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(n)).getTime()}function j(e,t){if(0===t)return e;const n=[];for(const o of e){let e=(o.startMinute+t)%z,i=(o.endMinute+t)%z;e<0&&(e+=z),i<=0&&(i+=z),e>i?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:i})):n.push({startMinute:e,endMinute:i})}return n.sort((e,t)=>e.startMinute-t.startMinute),n.reduce((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e},[])}var J=n(63527),G=n(32625),q=n(19129),$=n(37661),H=n(30857);var W=n(20021);const _=Array.from({length:7},(e,t)=>t),Q=(0,o.ph)(({businessHours:e,className:t})=>{const[n,i,s]=(0,$.A)(!1),[a,r,d]=(0,$.A)(!1),l=(0,Y.A)(),m=(0,H.A)(),{startViewTransition:p}=(0,w.Y)(),{createVtnStyle:g}=(0,I.k)();(0,G.A)(m,6e4);const f=(0,J.BI)(c.z8w),v=(0,q.A)(f,[f]),A=(0,o.Kr)(()=>{if(!v)return 0;const t=v[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60},[e.timezoneId,v]),y=(0,o.Kr)(()=>{const t=V(),n=function(e){const t={};for(const n of e){const e=n.startMinute,o=n.endMinute,i=Math.floor(e/K),s=Math.floor((o-1)/K);for(let n=i;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*K),endMinute:Math.min(K,o-n*K)})}return t}(j(e.workHours,a?A:0)),o={};return _.forEach(e=>{const i=n[e];o[e]=i?i.map(({startMinute:e,endMinute:n})=>n-e===1440?l("BusinessHoursDayFullOpened"):`${(0,U.fU)(l,t+60*e*1e3)} ${(0,U.fU)(l,t+60*n*1e3)}`):[l("BusinessHoursDayClosed")]}),o},[e.workHours,a,l,A]),C=(0,o.Kr)(()=>{const t=j(e.workHours,A),n=V(),o=((new Date).getTime()-n)/1e3/60;return t.some(({startMinute:e,endMinute:t})=>e<=o&&o<=t)},[e.workHours,A]),b=(0,o.Kr)(()=>(new Date(Date.now()-(a?0:60*A*1e3)).getDay()+6)%7,[a,A]),S=(0,N.A)(()=>{n?p(u.w7,()=>{s()}):p(u.rG,()=>{i()})}),M=(0,N.A)(e=>{e.stopPropagation(),p(u.QG,()=>{a?d():r()})});return(0,W.FD)(D.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:(0,h.A)("Ef_0p5Qm",t),style:g("businessHours",!0),isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:S,children:[(0,W.FD)("div",{className:"nHSmCUNs",children:[(0,W.FD)("div",{className:"JTZ8UnnP",children:[(0,W.Y)("div",{children:l("BusinessHoursProfile")}),(0,W.Y)("div",{className:(0,h.A)("JVL7ZnnJ",C&&"segAfYXs"),children:l(C?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed")})]}),(0,W.Y)(B.A,{className:"dYxw2cFn",style:g("expandArrow",!0),name:n?"up":"down"})]}),n&&(0,W.FD)("div",{className:"lp9VIV1o",children:[Boolean(A)&&(0,W.Y)("div",{className:"gVwflFhz",style:g("offsetTrigger"),role:"button",tabIndex:0,onMouseDown:O.TF?void 0:M,onClick:O.TF?M:void 0,children:l(a?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")}),(0,W.Y)("dl",{className:"MPBKHdZL",children:_.map(e=>(0,W.FD)(W.FK,{children:[(0,W.Y)("dt",{className:(0,h.A)("cmxPqAof",e===b&&"YZVvP_56"),children:(0,U.wv)(l,6===e?0:e+1)}),(0,W.Y)("dd",{className:"Rs0VPgpq",children:y[e].map(e=>(0,W.Y)("div",{children:e}))})]}))})]})]})});var Z=n(66644),X=n(87894),ee=n(58554),te=n(14737),ne=n(82855);const oe=["🎉","🎆","🎈"],ie=(0,o.ph)((0,i.EK)(e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,c.n_C)(e)}})(({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:a,animatedEmojiEffects:r,isInSettings:l})=>{const{openGiftModal:c,requestConfetti:u}=(0,i.ko)(),m=(0,o.li)(),p=(0,o.li)(!1),[g,f,v]=(0,$.A)(),A=(0,M.A)(),{formattedDate:C,isToday:w,age:I}=(0,o.Kr)(()=>{const e=new Date,n=new Date(t.year||2024,t.month-1,t.day);return{formattedDate:(0,U.A)(n,A.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&se(n)}},[t,A]),b=(0,o.Kr)(()=>{if(!I||!w)return;const e=a?.stickers?.filter(({emoji:e})=>e?.endsWith("️⃣"));if(!e)return;const t=(0,X.dU)(e,"emoji");return I.toString().split("").map(e=>t[e+"️⃣"])},[I,a?.stickers,w]),S=(0,o.Kr)(()=>{if(!w)return;const e=oe[Math.floor(Math.random()*oe.length)];return r?.stickers?.find(({emoji:t})=>t===e)},[r?.stickers,w]);(0,o.vJ)(()=>{if(w&&b&&(b.forEach(e=>{const t=(0,d.Mw)(e,"preview");ee.hd(t,s.qZ.BlobUrl)}),S)){const e=(0,d.Mw)(S,"preview");ee.hd(e,s.qZ.BlobUrl)}},[S,w,b]),(0,te.A)(v,g?3e3:void 0),(0,o.vJ)(()=>{if(g){p.current=!0;const e=document.getElementById(l?"LeftColumn":"RightColumn");if(!e)return;(0,Z.YS)(()=>{const{top:t,left:n,width:o,height:i}=e.getBoundingClientRect();u({top:t,left:n,width:o,height:i,style:"top-down"})})}},[l,g]);const k=(0,o.Kr)(()=>I?A(`ProfileBirthday${w?"Today":""}ValueAge`,{date:C,age:I},{pluralValue:I}):A(`ProfileBirthday${w?"Today":""}Value`,{date:C}),[I,C,w,A]),Y=w&&!e.isPremium&&!e.isSelf&&!n,F=(0,N.A)(()=>{c({forUserId:e.id})}),P=(0,N.A)(()=>{w&&(Y&&p.current?F():f())}),T=!w&&!Y;return(0,W.FD)("div",{className:"wCp6TBYF",children:[(0,W.FD)(D.A,{icon:"calendar",secondaryIcon:Y?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:m,ripple:!T,onClick:P,isStatic:T,onSecondaryIconClick:F,children:[(0,W.Y)("div",{className:"title",dir:A.isRtl?"rtl":void 0,children:(0,y.A)(k)}),(0,W.Y)("span",{className:"subtitle",children:A(w?"ProfileBirthdayToday":"ProfileBirthday")})]}),g&&O.ol&&b?.map((e,t)=>(0,W.Y)("div",{className:(0,h.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`,children:(0,W.Y)(ne.A,{containerRef:m,sticker:e,size:128,forceAlways:!0})})),g&&S&&(0,W.Y)("div",{className:"cFEXGUih",children:(0,W.Y)(ne.A,{containerRef:m,sticker:S,size:288,shouldLoop:!0,forceAlways:!0})})]})}));function se(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const o=t.getMonth()-e.getMonth();return(o<0||0===o&&t.getDate()<e.getDate())&&n--,n}const ae="UZbkeFDB",re={width:64,height:64,zoom:15},de=(0,o.ph)((0,i.EK)((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:o}}=e,i=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,r=i?.isForum,u=i&&(0,l.If)(i,(0,c.K52)(e),(0,c.P5N)(e,i.id)),{threadId:h}=(0,c.Xf0)(e)||{},m=r&&h?Number(h):void 0,p=i&&(0,c.AWZ)(e,i.id),g=s&&(0,c.vGo)(e,s.id),f=g?.botVerification||p?.botVerification,v=p?.inviteLink,A=g?.bio||p?.about,y=i&&(0,d.WX)(i)&&(0,d.SJ)(i),C=i&&!s&&(!(0,d.WX)(i)&&!(0,d.Sq)(i,"inviteUsers")||(0,d.ub)(i,"inviteUsers")),w=m?(0,c.sZk)(e,t,m):void 0,I=!n&&e.chats.listIds.saved?.includes(t),b=g?.personalChannelId?(0,c.hds)(e,g.personalChannelId):void 0,S=s?.hasMainMiniApp;return{phoneCodeList:o,chat:i,user:s,userFullInfo:g,canInviteUsers:C,botAppPermissions:a,isMuted:u,topicId:m,chatInviteLink:v,description:A,topicLink:w,hasSavedMessages:I,personalChannel:b,hasMainMiniApp:S,isBotCanManageEmojiStatus:g?.isBotCanManageEmojiStatus,botVerification:f,canViewSubscribers:y}})(({chatOrUserId:e,user:t,chat:n,userFullInfo:l,isOwnProfile:O,canInviteUsers:U,isMuted:K,phoneCodeList:z,topicId:V,description:j,chatInviteLink:J,topicLink:G,hasSavedMessages:q,personalChannel:$,hasMainMiniApp:H,isBotCanManageEmojiStatus:_,botAppPermissions:Z,botVerification:X,className:ee,isInSettings:te,canViewSubscribers:ne})=>{const{showNotification:oe,updateChatMutedState:se,updateTopicMutedState:de,loadPeerStories:le,openSavedDialog:ce,openMapModal:ue,requestCollectibleInfo:he,requestMainWebView:me,toggleUserEmojiStatusPermission:pe,toggleUserLocationPermission:ge,requestNextManagementScreen:fe}=(0,i.ko)(),{id:ve,usernames:Ae,phoneNumber:ye,isSelf:Ce}=t||{},{id:we,usernames:Ie}=n||{},be=ve||we,{businessLocation:Se,businessWorkHours:Me,personalChannelMessageId:Ne,birthday:ke,note:Ye}=l||{},Fe=(0,Y.A)(),Pe=(0,M.A)(),{startViewTransition:Te}=(0,w.Y)(),{createVtnStyle:De}=(0,I.k)(),xe=(0,o.li)(),Le=Boolean(Ye),{isCollapsed:Ee,isCollapsible:Be,setIsCollapsed:Re}=(0,b.A)(xe,3,void 0,!Le);(0,S.A)(([e])=>{be&&e!==be&&(t||n&&(0,d.WX)(n))&&le({peerId:be})},[be,n,t]);const{width:Oe,height:Ue,zoom:Ke}=re,ze=(0,F.A)(),Ve=Se?.geo&&(0,d.rt)(Se.geo,Oe,Ue,Ke,ze),je=(0,k.A)(Ve),Je=(0,o.Kr)(()=>{if(Se?.geo)return je?(0,W.Y)("img",{src:je,alt:"",className:ae}):(0,W.Y)(x.A,{className:ae})},[Se,je]),Ge=Boolean(V&&V!==s.l3),qe=n&&(0,d.WX)(n)||t?.isPremium,$e=(0,o.Kr)(()=>{const e=Ae?.filter(e=>e.isActive);return e?.length?e:void 0},[Ae]),He=(0,o.Kr)(()=>{const e=t?void 0:Ie?.filter(e=>e.isActive);return e?.length?e:void 0},[Ie,t]),We=(0,o.Kr)(()=>{if(n)return Ge?G:(0,d.L7)(n)||J},[n,Ge,G,J]),_e=(0,N.A)(()=>{const{address:e,geo:t}=Se;if(!t)return(0,m.eM)(e),void oe({message:Fe("BusinessLocationCopied")});ue({geoPoint:t,zoom:Ke})}),Qe=(0,N.A)(()=>{const e=K?r.Os5:r.xEh;Ge?de({chatId:we,topicId:V,mutedUntil:e}):se({chatId:we,mutedUntil:e})}),Ze=(0,N.A)(()=>{t&&pe({botId:t.id,isEnabled:!_})}),Xe=(0,N.A)(()=>{t&&ge({botId:t.id,isAccessGranted:!Z?.geolocation})}),et=(0,N.A)(()=>{ce({chatId:e})}),tt=Be&&Ee,nt=(0,N.A)(()=>{Te(u.Xz,()=>{Re(!1)})}),ot=(0,N.A)(()=>{const e=Ee;Te(e?u.Xz:u.S$,()=>{Re(()=>!e)})});function it(e,t){(0,m.eM)(e),oe({message:`${t} was copied`})}const st=ye&&(0,p.Ox)(z,ye),at=(0,N.A)(()=>{ye?.length===r.PGI&&ye.startsWith(r._Bb)?he({collectible:ye,peerId:be,type:"phone"}):it(st,Fe("Phone"))}),rt=(0,N.A)((e,t)=>{e.isEditable?it((0,A.A)(e.username,t),Fe(t?"Link":"Username")):he({collectible:e.username,peerId:be,type:"username"})}),dt=(0,N.A)(()=>{fe({screen:a.je.ChannelSubscribers})}),lt=(0,N.A)(()=>{const e=t?.id;if(!e)return;const n=(0,f.A)();me({botId:e,peerId:e,theme:n,shouldMarkBotTrusted:!0})}),ct=Pe("ProfileOpenAppAbout",{terms:(0,W.Y)(R.A,{text:Pe("ProfileOpenAppTerms"),url:Pe("ProfileBotOpenAppInfoLink")})},{withNodes:!0});if((!we||!(0,c._ls)((0,i.mS)(),we))&&(!Ce||O||te))return(0,W.FD)("div",{className:(0,h.A)("ChatExtra",ee),style:De("chatExtra"),children:[$&&(0,W.FD)("div",{className:"HP5EJx7s",style:De("personalChannel"),children:[(0,W.Y)("h3",{className:"cHyTGri2",children:Fe("ProfileChannel")}),(0,W.Y)("span",{className:"kYd2GrmU",children:Fe("Subscribers",$.membersCount,"i")}),(0,W.Y)(P.A,{chatId:$.id,orderDiff:0,shiftDiff:0,animationType:v.IP.None,isPreview:!0,previewMessageId:Ne,className:"qOJwhXMC"})]}),Boolean(st?.length)&&(0,W.FD)(D.A,{icon:"phone",className:"Kz3Kt7V9",multiline:!0,narrow:!0,ripple:!0,onClick:at,style:De("phone"),children:[(0,W.Y)("span",{className:"title",dir:Pe.isRtl?"rtl":void 0,children:st}),(0,W.Y)("span",{className:"subtitle",children:Fe("Phone")})]}),$e&&ut($e),j&&Boolean(j.length)&&(0,W.FD)(D.A,{icon:"info",className:"sfYp5akl",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,style:De("description"),children:[(0,W.Y)("span",{className:"title word-break allow-selection",dir:Pe.isRtl?"rtl":void 0,children:(0,y.A)(j,["br",qe?"links":"tg_links","emoji"])}),(0,W.Y)("span",{className:"subtitle",children:Fe(ve?"UserBio":"Info")})]}),He&&!Ge&&ut(He,!0),(!He&&U||Ge)&&We&&(0,W.FD)(D.A,{icon:"link",multiline:!0,className:"I6wEM4Gg",narrow:!0,ripple:!0,onClick:()=>it(We,Fe("SetUrlPlaceholder")),style:De("link"),children:[(0,W.Y)("div",{className:"title",children:We}),(0,W.Y)("span",{className:"subtitle",children:Fe("SetUrlPlaceholder")})]}),ke&&(0,W.Y)(ie,{birthday:ke,user:t,isInSettings:te},be),H&&(0,W.FD)(D.A,{multiline:!0,className:"GQTzMGTi",isStatic:!0,narrow:!0,style:De("miniapp"),children:[(0,W.Y)(T.A,{className:"x925YeS3",onClick:lt,children:Fe("ProfileBotOpenApp")}),(0,W.Y)("div",{className:"IrqRJFxm",children:ct})]}),!O&&!te&&(0,W.FD)(D.A,{icon:K?"mute":"unmute",className:"RBvIJLG2",narrow:!0,ripple:!0,onClick:Qe,style:De("notifications"),children:[(0,W.Y)("span",{children:Pe("Notifications")}),(0,W.Y)(L.A,{id:"group-notifications",label:Pe(ve?"AriaToggleUserNotifications":"AriaToggleChatNotifications"),checked:!K,inactive:!0})]}),Me&&(0,W.Y)(Q,{businessHours:Me}),Se&&(0,W.FD)(D.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,className:"_xXKFqUd",style:De("location"),rightElement:Je,onClick:_e,children:[(0,W.Y)("div",{className:"title",children:Se.address}),(0,W.Y)("span",{className:"subtitle",children:Fe("BusinessProfileLocation")})]}),Le&&(0,W.FD)(D.A,{icon:"note",iconClassName:"tzdaXm4b",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0,className:"NTIM9Ilb",style:De("note"),children:[(0,W.Y)("div",{ref:xe,className:(0,h.A)("title","word-break","allow-selection","wfFIBsS9",Ee&&"XDGCHF3C"),style:De("noteText",!0),dir:Pe.isRtl?"rtl":void 0,onClick:tt?nt:void 0,children:(0,C.fd)({text:Ye.text,entities:Ye.entities})}),(0,W.FD)("div",{className:(0,h.A)("subtitle","PZmqBGnF"),style:De("noteSubtitle"),children:[(0,W.Y)("span",{children:Pe("UserNoteTitle")}),(0,W.Y)("span",{className:"ULBE6izv",children:Pe("UserNoteHint")}),Be&&(0,W.Y)(B.A,{className:(0,h.A)("sUNntQ81","emWTh6l1"),style:De("noteExpandIcon",!0),onClick:ot,name:Ee?"down":"up"})]})]}),q&&!O&&!te&&(0,W.Y)(D.A,{icon:"saved-messages",className:"zOAUgAZz",narrow:!0,ripple:!0,onClick:et,style:De("savedMessages"),children:(0,W.Y)("span",{children:Fe("SavedMessagesTab")})}),l&&"isBotAccessEmojiGranted"in l&&(0,W.FD)(D.A,{icon:"user",className:"wlATcqd6",narrow:!0,ripple:!0,onClick:Ze,style:De("botEmojiStatus"),children:[(0,W.Y)("span",{children:Fe("BotProfilePermissionEmojiStatus")}),(0,W.Y)(L.A,{label:Fe("BotProfilePermissionEmojiStatus"),checked:_,inactive:!0})]}),void 0!==Z?.geolocation&&(0,W.FD)(D.A,{icon:"location",className:"AM09D0iF",narrow:!0,ripple:!0,onClick:Xe,style:De("botLocation"),children:[(0,W.Y)("span",{children:Fe("BotProfilePermissionLocation")}),(0,W.Y)(L.A,{label:Fe("BotProfilePermissionLocation"),checked:Z?.geolocation,inactive:!0})]}),ne&&(0,W.FD)(D.A,{icon:"group",narrow:!0,multiline:!0,ripple:!0,className:"nKT9b7NU",onClick:dt,style:De("subscribers"),children:[(0,W.Y)("div",{className:"title",children:Pe("ProfileItemSubscribers")}),(0,W.Y)("span",{className:"subtitle",children:Pe.number(n?.membersCount||0)})]}),X&&(0,W.FD)("div",{className:"RWFu5ENh",style:De("botVerification"),children:[(0,W.Y)(E.A,{className:"b32hsSPS",documentId:X.iconId,size:16}),X.description]})]});function ut(e,t){const[n,...o]=e,i=o.length?Fe("UsernameAlso","%USERNAMES%").split("%").map(e=>"USERNAMES"===e?(0,W.Y)(W.FK,{children:o.map((e,n)=>(0,W.FD)(W.FK,{children:[n>0?", ":"",(0,W.Y)("a",{href:(0,A.A)(e.username,!0),onMouseDown:g.A,onClick:n=>{(0,g.A)(n),rt(e,t)},className:"text-entity-link username-link",children:(0,A.A)(e.username)},e.username)]}))}):e):void 0;return(0,W.FD)(D.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{rt(n,t)},children:[(0,W.Y)("span",{className:"title",dir:Pe.isRtl?"rtl":void 0,children:(0,A.A)(n.username,t)}),(0,W.FD)("span",{className:"subtitle",children:[i&&(0,W.Y)("span",{className:"other-usernames",children:i}),Fe(t?"Link":"Username")]})]})}}))},25477(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(17663),d=n(58554),l=n(76023),c=n(35127),u=n(84313),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(62587),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(14413),M=n(65843),N=n(35913),k=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,video:t,isOwn:n,isInWebPage:Y,noAvatars:F,canAutoLoad:P,canAutoPlay:T,uploadProgress:D,forcedWidth:x,dimensions:L,asForwarded:E,isDownloading:B,isProtected:R,className:O,lastPlaybackTimestamp:U,clickArg:K,isMediaNsfw:z,observeIntersectionForLoading:V,observeIntersectionForPlaying:j,onClick:J,onCancelUpload:G,needsAgeVerification:q})=>{const{cancelMediaDownload:$,updateContentSettings:H,openAgeVerificationModal:W}=(0,i.ko)(),_=(0,o.li)(),Q=(0,o.li)(),[Z,X,ee]=(0,m.A)(),[te,ne]=(0,o.J0)(!1),oe="extendedMediaPreview"===t.mediaType,ie=oe?void 0:t.blobUrl,se=oe||t.isSpoiler||z,[ae,re,de]=(0,m.A)(se);(0,o.vJ)(()=>{se?re():de()},[se]);const le=(0,g.A)(()=>{ee(),de(),te&&H({isSensitiveEnabled:!0})}),ce=(0,p.Vz)(_,V),ue=(0,p.Vz)(_,j)&&ce,he=(0,o.li)(ce);ue&&!he.current&&(he.current=!0);const{isMobile:me}=(0,h.Ay)(),[pe,ge]=(0,o.J0)(P),fe=Boolean(pe&&ce&&!oe),[ve,Ae]=(0,o.J0)(Boolean(T&&!ae)),ye=oe?void 0:(0,s.sC)(t,"inline"),[Ce]=(0,o.J0)(Boolean(ye&&d.Ih(ye))),{mediaData:we,loadProgress:Ie}=(0,A.A)(ye,!fe,oe?void 0:(0,s.Cz)(t,"inline")),be=ie||we,[Se,Me]=(0,m.A)(),Ne=(0,s.VD)(t),ke=Boolean(Ne),Ye=Boolean(x),Fe=be&&he.current,Pe=(0,u.A)(Q,!0,!Fe),Te=oe?void 0:(0,s.sC)(t,"preview"),[De]=(0,o.J0)(Boolean(Te&&d.Ih(Te))),xe=ce,Le=(0,f.A)(Te,!xe),Ee=Se&&!Pe,{ref:Be}=(0,v.A)({hasMediaData:Boolean((ke||Le)&&!Ee)}),Re=Boolean(!ke||Le||Se),Oe=(0,w.A)(t,Re);(0,v.A)({ref:Oe,hasMediaData:!Re});const Ue=(0,w.A)(t,!Ye),{loadProgress:Ke}=(0,A.A)(oe?void 0:(0,s.sC)(t,"download"),!B,oe?void 0:(0,s.Cz)(t,"download")),{isUploading:ze,isTransferring:Ve,transferProgress:je}=(0,s.LK)(D||(B?Ke:Ie),fe&&!Se&&!Ce||B,void 0!==D),Je=!1===(0,y.A)(pe),{ref:Ge,shouldRender:qe}=(0,C.A)({isOpen:Ve&&!Pe,noMountTransition:Je,withShouldRender:!0}),{ref:$e}=(0,C.A)({isOpen:Boolean((pe||be)&&!ve&&!qe)}),{ref:He,shouldRender:We}=(0,C.A)({isOpen:Ve&&(!Pe||B),noMountTransition:Je,withShouldRender:!0}),[_e,Qe]=(0,o.J0)(0),Ze=(0,g.A)(e=>{Qe(Math.max(0,e.currentTarget.currentTime-1))}),Xe=(Number.isFinite(Q.current?.duration)&&!Pe?Q.current?.duration:t.duration)||0,{width:et,height:tt}=L||(oe?(0,l.ri)(t,Boolean(n),E,Y,F,me):(0,l.rO)(t,Boolean(n),E,Y,F,me)),nt=(0,g.A)((e,n)=>{if(ze)G?.(K);else if(oe||!B){if(be)return be&&!ve&&Ae(!0),ae?z?q?void W():void X():void de():n&&fe&&!Se&&!Ce?(ge(!1),void e.stopPropagation()):void J?.(K,e);ge(e=>!e)}else $({media:t})}),ot=(0,g.A)(e=>{nt(e,!0)}),it=(0,a.A)("media-inner dark",!ze&&"interactive",tt<c.ej&&"fix-min-height",O),st=`height: ${tt}px;${L?` width: ${et}px; left: ${L.x}px; top: ${L.y}px;`:""}`;return(0,k.FD)("div",{ref:_,id:e,className:it,style:st,onClick:ze?void 0:e=>nt(e),children:[Ye&&(0,k.Y)("canvas",{ref:Ue,className:"thumbnail blurred-bg"}),Fe&&(0,k.Y)(M.A,{ref:Q,src:be,className:(0,a.A)("full-media",Ye&&"with-blurred-bg"),canPlay:ve&&ue&&!Pe,defaultMuted:!0,muted:!0,loop:!0,playsInline:!0,disablePictureInPicture:!0,draggable:!R,onTimeUpdate:Ze,onReady:Me,style:x?`width: ${x}px`:void 0}),(0,k.Y)("img",{ref:Be,src:Le,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)(I.A,{ref:$e,name:"large-play"}),(0,k.Y)(b.A,{isVisible:ae,withAnimation:!0,thumbDataUri:Ne,isNsfw:z,width:et,height:tt,className:"media-spoiler"}),qe&&(0,k.Y)("div",{ref:Ge,className:"media-loading",children:(0,k.Y)(N.A,{progress:je,onClick:ot})}),!pe&&!be&&(0,k.Y)(I.A,{name:"download"}),We?(0,k.Y)("span",{ref:He,className:"message-transfer-progress",children:ze||B?`${Math.round(100*je)}%`:"..."}):(0,k.FD)("div",{className:"message-media-duration",children:[!oe&&t.isGif?"GIF":(0,r.QO)(Math.max(Xe-_e,0)),Pe&&(0,k.Y)(I.A,{name:"message-failed",className:"playback-failed"})]}),Boolean(U)&&(0,k.Y)("div",{className:"message-media-last-progress",style:`--_progress: ${Math.floor(U/Xe*100)}%`}),(0,k.Y)(S.A,{isOpen:Z,onClose:ee,shouldAlwaysShow:te,onAlwaysShowChanged:ne,confirmHandler:le})]})}))},25498(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(11597),d=n(52491),l=n(36353),c=n(87894),u=n(79824),h=n(37830),m=n(4961),p=n(58734),g=n(17778),f=n(63988),v=n(83414),A=n(37661),y=n(17712);let C,w,I,b,S;const M=(0,h.A)(function(e,t,n){return e&&t.length?Object.values((0,c._E)(e,t)).slice(0,n):u.p}),N=(0,h.A)(function(e,t,n){const o=Object.values(e),i=(0,c.dU)(o,"native"),s=t?(0,c.LG)(t,e=>Object.values((0,c._E)(i,e))):{},a=n?(0,c.LG)(n,e=>Object.values((0,c._E)(i,e))):{},r={...s,...a},d=[].concat(Object.keys(s),Object.keys(a)),l=o.reduce((e,t)=>(t.names.forEach(n=>{e[n]||(e[n]=[]),e[n].push(t)}),e),{}),u=Object.keys(l),h=d.reduce((e,t)=>Math.max(e,t.length),0);return{byKeyword:r,keywords:d,byName:l,names:u,maxKeyLength:h}}),k=(0,h.A)(function(e,t,n){const{byKeyword:o,keywords:i,byName:s,names:a,maxKeyLength:r}=e;let d=[];if(t.length>r)return u.p;const l=i.filter(e=>e.startsWith(t)).sort();d=d.concat(Object.values((0,c._E)(o,l)).flat());const h=a.filter(e=>e.startsWith(t));return d=d.concat(Object.values((0,c._E)(s,h)).flat()),d=(0,c.Am)(d),d.length?d.slice(0,n):u.p});try{b=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){b=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function Y(e,t,h,Y=s.CfG,F,P,T){const[D,x,L]=(0,A.A)(!1),[E,B]=(0,o.J0)(),[R,O]=(0,o.J0)(u.p),[U,K]=(0,o.J0)(u.p);(0,o.vJ)(()=>{function t(){B(I.emojis)}e&&(I?t():async function(){return C||(C=n.e(996).then(n.t.bind(n,20996,19)),w=(await C).default,I=(0,d.cp)(w)),C}().then(t))},[e]);const z=(0,f.gs)(()=>{const n=t();return e&&n.includes(":")?(0,g.S)(n).match(b)?.[0].trim():void 0},[t,e],300),V=(0,v.A)(z,[z,t],!0),j=(0,y.A)(e=>{if(O(e),e===u.p)return void K(u.p);const t=e.map(e=>e.native),n=(0,c.Xd)((0,r.oZ0)((0,i.mS)(),t),"id");K(n)}),J=(0,y.A)((e,n=!1)=>{const o=t();if(!o)return;const i=o.lastIndexOf(":",n?o.lastIndexOf(":")-1:void 0);if(-1!==i){const t="string"==typeof e?(0,m.A)(e,["emoji_html"])[0]:(0,p.hB)(e);h(`${o.substring(0,i)}${t}`);const n=Y===s.CfG?document.querySelector(s.m$5):document.getElementById(Y);(0,a.Uz)(()=>{(0,l.A)(n,!0,!0)})}j(u.p)});return(0,o.vJ)(()=>{const e=V();if(!e||!E)return void j(u.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let o=u.p;if(n){if(1===n.length&&S.test(n)||n.length>=2){const e=N(E,P,T);o=k(e,n.toLowerCase(),36)}}else o=M(E,F,36);o.length?t?J(o[0].native,!0):j(o):j(u.p)},[P,E,V,T,J,F,j]),(0,o.vJ)(L,[L,t]),{isEmojiTooltipOpen:Boolean(R.length||U.length)&&!D,closeEmojiTooltip:x,filteredEmojis:R,filteredCustomEmojis:U,insertEmoji:J}}},25897(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomEmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},26087(e,t,n){n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(11597),a=n(99375),r=n(18501),d=n(37661),l=n(39351),c=n(64493),u=n(22337),h=n(20021);function m(e){return e.isSlowMode?"Slowmode enabled":e.hasErrorKey?"Something went wrong":"Telegram"}const p=(0,o.ph)((0,i.EK)(e=>({dialogs:(0,s.nTw)(e).dialogs,currentMessageList:(0,s.Xf0)(e)}))(({dialogs:e,currentMessageList:t})=>{const{dismissDialog:n,sendMessage:s}=(0,i.ko)(),[p,g,f]=(0,d.A)(),v=(0,l.A)();var A,y,C;if((0,o.vJ)(()=>{e.length>0&&g()},[e,g]),e.length)return Boolean(e.length)&&("phoneNumber"in(A=e[e.length-1])?(y=A,(0,h.FD)(u.A,{isOpen:p,onClose:f,className:"confirm",title:v("ShareYouPhoneNumberTitle"),onCloseAnimationEnd:n,children:[v("AreYouSureShareMyContactInfoBot",void 0,{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}),(0,h.FD)("div",{className:"dialog-buttons mt-2",children:[(0,h.Y)(c.A,{className:"confirm-dialog-button",isText:!0,onClick:()=>{t&&(s({contact:y,messageList:t}),f())},children:v("OK")}),(0,h.Y)(c.A,{className:"confirm-dialog-button",isText:!0,onClick:f,children:v("Cancel")})]})]})):(C=A,(0,h.FD)(u.A,{isOpen:p,onClose:f,onCloseAnimationEnd:n,className:"error",title:m(C),children:[C.hasErrorKey?(0,a.Ay)(C):(0,r.fd)({text:C.message,entities:C.entities}),(0,h.Y)("div",{className:"dialog-buttons mt-2",children:(0,h.Y)(c.A,{isText:!0,onClick:f,children:v("OK")})})]})))}))},26440(e,t,n){n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(31481),a=n(87357),r=n(37661),d=n(17712),l=n(18276),c=n(64493),u=n(66469),h=n(97422),m=n(80089),p=n(80464),g=n(20021);const f=e=>{const{isOpen:t}=e,n=(0,p.A)(m.ar.Extra,"SymbolMenu",!t);return n?(0,g.Y)(n,{...e}):void 0},v=(0,o.ph)(({chatId:e,threadId:t,isMobile:n,canSendGifs:m,canSendStickers:p,isMessageComposer:v,isReady:A,isSymbolMenuOpen:y,idPrefix:C,isAttachmentModal:w,canSendPlainText:I,isSymbolMenuForced:b,className:S,forceDarkTheme:M,inputCssSelector:N=s.m$5,openSymbolMenu:k,closeSymbolMenu:Y,onCustomEmojiSelect:F,onStickerSelect:P,onGifSelect:T,onRemoveSymbol:D,onEmojiSelect:x,closeBotCommandMenu:L,closeSendAsMenu:E})=>{const{setStickerSearchQuery:B,setGifSearchQuery:R,addRecentEmoji:O,addRecentCustomEmoji:U}=(0,i.ko)(),K=(0,o.li)(),[z,V]=(0,r.A)(),[j,J]=(0,o.J0)(void 0),G=(0,a.A)("composer-action-button mobile-symbol-menu-button",!A&&"not-ready",z?y&&"menu-opened":y&&"is-loading"),q=(0,d.A)(()=>{L?.(),E?.(),k();const e=K.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})}),$=(0,d.A)(e=>{"stickers"===e?(B({query:""}),R({query:void 0})):(R({query:""}),B({query:void 0}))}),H=(0,d.A)(()=>{const e=document.querySelector(w?s.wVm:N);n&&e===document.activeElement?(e?.blur(),setTimeout(()=>{L?.(),k()},100)):k()}),W=(0,d.A)(()=>K.current),_=(0,d.A)(()=>K.current?.closest(".custom-scroll, .no-scrollbar")),Q=(0,d.A)(()=>document.querySelector("#portals .SymbolMenu .bubble")),Z=(0,d.A)(()=>({withPortal:!0}));return(0,g.FD)(g.FK,{children:[n?(0,g.FD)(c.A,{className:G,round:!0,color:"translucent",onClick:y?Y:H,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)(l.A,{name:"smile"}),(0,g.Y)(l.A,{name:"keyboard"}),y&&!z&&(0,g.Y)(h.A,{color:"gray"})]}):(0,g.FD)(u.A,{className:(0,a.A)("composer-action-button symbol-menu-button",y&&"activated"),round:!0,color:"translucent",onActivate:q,ariaLabel:"Choose emoji, sticker or GIF",children:[(0,g.Y)("div",{ref:K,className:"symbol-menu-trigger"}),(0,g.Y)(l.A,{name:"smile"})]}),(0,g.Y)(f,{chatId:e,threadId:t,isOpen:y||Boolean(b),canSendGifs:m,canSendStickers:p,isMessageComposer:v,idPrefix:C,onLoad:V,onClose:Y,onEmojiSelect:x,onStickerSelect:P,onCustomEmojiSelect:F,onGifSelect:T,onRemoveSymbol:D,onSearchOpen:$,addRecentEmoji:O,addRecentCustomEmoji:U,isAttachmentModal:w,canSendPlainText:I,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})]})})},31403(e,t,n){n.d(t,{A:()=>tn});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),l=n(27109),c=n(70636),u=n(11597),h=n(64520),m=n(30708),p=n(96115),g=n(96454),f=n(87357),v=n(17663),A=n(55148),y=n(46275),C=n(60261),w=n(48899),I=n(87679),b=n(36353),S=n(48775),M=n(58554),N=n(79824),k=n(80539),Y=n(39074),F=n(80140),P=n(43503),T=n(13235);let D;function x(e){D.focus(),e.focus()}g.pz&&(D=document.createElement("input"),D.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(D));var L=n(55153),E=n(58734),B=n(11359),R=n(4961),O=n(18501),U=n(32625),K=n(14737),z=n(10722),V=n(19129),j=n(82117),J=n(37661),G=n(30857),q=n(41316),$=n(39351),H=n(17712),W=n(59030),_=n(39996),Q=n(29886),Z=n(73767),X=n(24531),ee=n(73172),te=n(50680),ne=n(41257),oe=n(35297),ie=n(17778),se=n(63988),ae=n(83414);const re=/^\/([\w@]{1,32})?$/i;var de=n(78396);const le=/id="docs-internal-guid/i,ce=["H1","H2","H3","H4","H5","H6"];function ue(e){return(new DOMParser).parseFromString(e,"text/html").body}function he(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function me(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function pe(e,t){let n=t.cloneNode(!0);return e?(e.style&&"700"===e.style.fontWeight&&(n=me(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=me(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=me(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=me(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=me(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=me(n,"sub")),n):n}function ge(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=he(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=pe(o,n),n}function fe(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const o=[];for(let t=0;t<e.childNodes.length;t++)o.push(...fe(e.childNodes[t]));o.map(e=>n.appendChild(e))}else-1!==ce.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=ge(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=he(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=pe(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=ge(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(...fe(e.childNodes[n]));return t}return[e]}function ve(e){return 8!==e.nodeType}const Ae=/<style>(.*?)<\/style>/gs;var ye=n(45761);const Ce=new Set([a.CfG,a.e0F,a.YVZ]),we=(e,t,n,r,l,c,u,h)=>{const{showNotification:m,updateShouldSaveAttachmentsCompression:p,applyDefaultAttachmentsCompression:g}=(0,i.ko)(),f=(0,$.A)();(0,o.vJ)(()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=e.target?.closest("div[contenteditable]");if(!o||!Ce.has(o.id))return;if(e.preventDefault(),document.activeElement!==o)return;const i=e.clipboardData.getData("text"),v=e.clipboardData.getData("text/html");let A=v?(0,k.Ay)(function(e){let t=document.createElement("div");try{e=(n=e).match(le)?function(e){const t=document.createElement("body"),n=e.childNodes,o=Array.from(n).filter(ve),i=[];for(const e of o)i.push(...fe(e));for(let e=0;e<i.length;e++)t.appendChild(i[e].cloneNode(!0));return t}(ue(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:ue(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){a.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(Ae,"");const o=t.querySelectorAll(".text-content");return o.length&&(t=o[o.length-1]),Array.from(t.getElementsByTagName("*")).forEach(e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),k.qh[e.tagName]&&e.setAttribute("data-entity-type",k.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()}(v),void 0,!0):void 0;A&&(0,de.T8)(A)&&c&&(A=(0,de.m4)(A),u?.());const{items:y}=e.clipboardData;let C=[];if(y.length>0&&(C=await(0,ye.A)(y),l&&(C=C?.slice(0,1))),!C?.length&&!i)return;const w=A?.entities?.length?A:{text:i};let I=!1;try{I="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(v,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const b=w&&w.text;let S=C?.length&&!I;const M=C?await Promise.all(C.map(e=>(0,L.A)(e.name,e))):[],N=l&&M?.length&&(0,d.eh)(l,M[0])||Boolean(b),Y=(0,d.NK)(M[0]),F=l&&l?.groupedId;l&&M?.length>1?m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:M.length})}):l&&Y?m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:1})}):!F||(S=N,S)?(S&&(h&&(p({shouldSave:!0}),g()),n(l?M:e=>e.concat(M))),b&&(S?r(w):t(w,o?.id))):m({message:f("MediaReplaceInvalidError",void 0,{pluralValue:M.length})})}},[t,l,n,e,c,u,r,f,h])};var Ie=n(3225),be=n(37859),Se=n(56133),Me=n(61157),Ne=n(60138);let ke=!1;const Ye=new Set([s.C7.TextUrl,s.C7.Url]);var Fe=n(25498),Pe=n(37830);const Te=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,De=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,xe={username:"",query:"",canShowHelp:!1,usernameLowered:""},Le=document.createElement("div");const Ee=(0,Pe.A)((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})),Be=new RegExp(a.kNZ,"i");var Re=n(9442),Oe=n(20247),Ue=n(16120),Ke=n(17237);const ze=new RegExp(`^${a.bpX.source}$`,"g");var Ve=n(11778);const je={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Je={type:"audio/ogg"};let Ge,qe,$e;async function He(){return Ge||(Ge=n.e(4550).then(n.t.bind(n,14550,23)),qe=(await Ge).default,$e=new qe(je)),Ge}async function We(e){await async function(){await He(),await $e.start()}();const t=Date.now();let n;const o=[],i=[];$e.ondataavailable=e=>{o.push(e)};const s=function(t){const n=t.sourceNode,o=n.context.createAnalyser();o.fftSize=64,n.connect(o);const s=o.frequencyBinCount,a=new Uint8Array(s);let d=!1;return function t(){if(d)return;o.getByteFrequencyData(a);const n=a.reduce((e,t)=>e+t,0)/s/255;(t=>{i.push(255*t),e(t)})(n<.1?0:n),(0,r.YS)(t)}(),()=>{d=!0}}($e);return{stop:()=>new Promise((e,a)=>{$e.onstop=()=>{e({blob:new Blob(o,Je),duration:Math.round(((n||Date.now())-t)/1e3),waveform:i})},$e.onerror=a;const r=Math.max(0,t+1e3-Date.now());setTimeout(()=>{$e.stop(),s()},r)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{$e.pause(),n=Date.now(),s()},e)}}}var _e=n(80089),Qe=n(80464),Ze=n(20021);const Xe=e=>{const{attachments:t}=e,n=(0,Qe.A)(_e.ar.Extra,"AttachmentModal",!t.length);return n?(0,Ze.Y)(n,{...e}):void 0};var et=n(61182),tt=n(52844),nt=n(36680),ot=n(18276),it=n(71429),st=n(24433),at=n(66469),rt=n(54639);const dt=(0,o.ph)(({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:s,canAttachPolls:r,canAttachToDoLists:l,canSendPhotos:c,canSendVideos:u,canSendDocuments:h,canSendAudios:m,attachBots:p,peerType:v,isScheduled:A,theme:y,shouldCollectDebugLogs:C,canEditMedia:w,editingMessage:b,messageListType:S,paidMessagesStars:M,onFileSelect:N,onMenuOpen:k,onMenuClose:Y,onPollCreate:F,onTodoListCreate:P})=>{const{updateAttachmentSettings:T}=(0,i.ko)(),[D,x,L]=(0,J.A)(),[E,B,R]=(0,nt.A)(D,L),O=c&&u,U=c||u,[K,z,V]=(0,J.A)(),j=D||K,G=b&&b?.groupedId&&Boolean((0,d.yl)(b)||Boolean((0,d.zX)(b))),q=b&&b?.groupedId&&Boolean((0,d.wp)(b)||(0,d.gB)(b)||(0,d.zC)(b));(0,o.vJ)(()=>{D&&R()},[D,R]),(0,o.vJ)(()=>{j?k():Y()},[j,Y,k]);const _=(0,H.A)(()=>{D?L():x()}),Q=(0,H.A)(e=>{const{files:t}=e.target,n=(0,I.kc)(t);n?.length&&N(n)}),Z=(0,H.A)(()=>{T({shouldCompress:!0}),(0,tt.p)(Array.from(O?a.mxD:c?a.gex:a.fNs).join(","),e=>Q(e))}),X=(0,H.A)(()=>{T({shouldCompress:!1}),(0,tt.p)(!h&&m?Array.from(a.IH3).join(","):"*",e=>Q(e))}),ee=(0,H.A)(()=>{const e=new File([(0,et.F8)()],a.lFE,{type:"text/plain"});N([e])}),te=(0,o.Kr)(()=>p?Object.values(p).filter(t=>!(!v||!t.isForAttachMenu)&&(!("bots"!==v||t.id!==e||!t.attachMenuPeerTypes||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(v))):void 0,[p,e,v]),ne=(0,W.A)(),oe=(0,$.A)();if(n)return(0,Ze.FD)("div",{className:"AttachMenu",children:[b&&w?(0,Ze.Y)(at.A,{id:"replace-menu-button",className:(0,f.A)("AttachMenu--button composer-action-button",D&&"activated"),round:!0,color:"translucent",onActivate:_,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0,children:(0,Ze.Y)(ot.A,{name:"replace"})}):(0,Ze.Y)(at.A,{id:"attach-menu-button",disabled:Boolean(b),className:(0,f.A)("AttachMenu--button composer-action-button",D&&"activated"),round:!0,color:"translucent",onActivate:_,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0,children:(0,Ze.Y)(ot.A,{name:"attach"})}),(0,Ze.FD)(it.A,{id:"attach-menu-controls",isOpen:j,autoClose:!0,positionX:"right",positionY:"bottom",onClose:L,className:"AttachMenu--menu fluid",onCloseAnimationEnd:L,onMouseEnter:g.TF?void 0:E,onMouseLeave:g.TF?void 0:B,noCloseOnBackdrop:!g.TF,ariaLabelledBy:"attach-menu-button",children:[!s&&(0,Ze.Y)(st.A,{className:"media-disabled",disabled:!0,children:oe("scheduled"===S&&M?"DescriptionScheduledPaidMediaNotAllowed":"DescriptionRestrictedMedia")}),s&&(0,Ze.FD)(Ze.FK,{children:[U&&!q&&(0,Ze.Y)(st.A,{icon:"photo",onClick:Z,children:ne(O?"AttachmentMenu.PhotoOrVideo":c?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")}),(h||m)&&!G&&(0,Ze.Y)(st.A,{icon:"document",onClick:X,children:ne(!h&&m?"InputAttach.Popover.Music":"AttachDocument")}),h&&C&&(0,Ze.Y)(st.A,{icon:"bug",onClick:ee,children:ne("DebugSendLogs")})]}),r&&!b&&(0,Ze.Y)(st.A,{icon:"poll",onClick:F,children:ne("Poll")}),l&&!b&&(0,Ze.Y)(st.A,{icon:"select",onClick:P,children:oe("TitleToDoList")}),!b&&!w&&!A&&te?.map(n=>(0,Ze.Y)(rt.A,{bot:n,chatId:e,threadId:t,theme:y,onMenuOpened:z,onMenuClosed:V}))]})]})}),lt=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"BotCommandMenu",!t);return n?(0,Ze.Y)(n,{...e}):void 0};var ct=n(85449),ut=n(87412),ht=n(64493);const mt={root:"QStkncE6",content:"wBwPdyzh",row:"DTjMAvA7",button:"w7g6mTl8",inlineButtonText:"TrvGJ8OO",customEmojiIcon:"X5A2gwL_",primaryTint:"atzyyrya",successTint:"tvyk0Qd_",destructiveTint:"VTGJKGRJ"},pt=(0,o.ph)((0,i.EK)((e,{messageId:t})=>{const{chatId:n}=(0,u.Xf0)(e)||{};return{message:n?(0,u.O5q)(e,n,t):void 0}})(({isOpen:e,threadId:t,message:n,onClose:s})=>{const{clickBotInlineButton:a}=(0,i.ko)(),r=(0,$.A)(),[d,l]=(0,nt.A)(e,s),{isKeyboardSingleUse:c}=n||{},u=(0,o.Kr)(()=>{const e=[];return n?.keyboardButtons.forEach(t=>{e.push(t.map(e=>(0,ct.A)(r,e)))}),e},[r,n?.keyboardButtons]);if(n&&n.keyboardButtons)return(0,Ze.Y)(it.A,{isOpen:e,autoClose:c,positionX:"right",positionY:"bottom",onClose:s,className:mt.root,onCloseAnimationEnd:s,onMouseEnter:g.TF?void 0:d,onMouseLeave:g.TF?void 0:l,noCompact:!0,children:(0,Ze.Y)("div",{className:(0,f.A)(mt.content,"custom-scroll"),children:n.keyboardButtons.map((e,o)=>(0,Ze.Y)("div",{className:mt.row,children:e.map((e,i)=>(0,Ze.Y)(ht.A,{className:(0,f.A)(mt.button,e.style?.type&&mt[`${e.style.type}Tint`]),ripple:!0,noForcedUpperCase:!0,disabled:"unsupported"===e.type,onClick:()=>a({chatId:n.chatId,messageId:n.id,threadId:t,button:e}),children:(0,Ze.FD)("span",{className:mt.inlineButtonText,children:[e.style?.iconId&&(0,Ze.Y)(ut.A,{className:mt.customEmojiIcon,documentId:e.style.iconId,size:16}),u?.[o][i]]})}))}))})})})),gt=(0,o.ph)(({isOpen:e,onClick:t,text:n,isDisabled:i})=>{const s=(0,o.li)();return(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)},[e,n]),(0,o.vJ)(()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}},[]),(0,Ze.FD)(ht.A,{className:(0,f.A)("composer-action-button bot-menu",e&&"open"),round:!0,color:"translucent",disabled:i,onClick:t,ariaLabel:"Open bot command keyboard",children:[(0,Ze.Y)(ot.A,{name:"webapp",className:(0,f.A)("bot-menu-icon",e&&"open")}),(0,Ze.Y)("span",{ref:s,className:"bot-menu-text",children:(0,R.A)(n)})]})}),ft=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"ChatCommandTooltip",!t);return n?(0,Ze.Y)(n,{...e}):void 0};var vt=n(56494),At=n(87894),yt=n(43874),Ct=n(14),wt=n(1455),It=n(91930),bt=n(60859);const St=(0,o.ph)((0,i.EK)((e,{shouldForceShowEditing:t,chatId:n,threadId:o,messageListType:i})=>{const{forwardMessages:{fromChatId:s,toChatId:a,messageIds:r,noAuthors:l,noCaptions:c},isShareMessageModalShown:h,shouldPreventComposerAnimation:m}=(0,u.nTw)(e),g="scheduled"===i?(0,p.Vl)(e,n):(0,p.Ys)(e,n,o),f=(0,u.PKK)(e)&&!m,v=a===n,A=r?.map(t=>(0,u.O5q)(e,s,t)),y=(0,p.GA)(e,n,o),C=y?.replyInfo,w=y?.suggestedPostInfo,I=C?.replyToPeerId,b=I?(0,u.hds)(e,I):void 0;let S,M;if(g?S=(0,u.KLw)(e,n,o,i):v&&1===r.length?S=A?.[0]:C&&!t&&(S=(0,u.O5q)(e,C.replyToPeerId||n,C.replyToMsgId)),g&&S)M=(0,u.Y7C)(e,S);else if(v){let t=A?.map(t=>{return n=t,M=(0,u.Szq)(e,n),M||(M=(0,u.Y7C)(e,n)),M;var n}).filter(Boolean);t=t?(0,At.Am)(t):void 0,M=1===t?.length?t?.[0]:void 0}else if(C&&S&&!t){const{forwardInfo:t}=S,o=(0,u.nZ4)(e,n);t&&(t.isChannelPost||o)&&(M=(0,u.Szq)(e,S)),M||t?.hiddenUserName&&!Boolean(C.quoteText)||(M=(0,u.Y7C)(e,S))}const N=M&&(0,u.hds)(e,M.id),k=N&&(0,d.WX)(N),Y=A?.some(e=>e?.content.text&&Object.keys(e.content).length>1),F=v&&1===r.length&&Boolean(S?.content.storyData),P=C?.replyToMsgId===o&&!C.replyToPeerId,T=S&&(0,vt.B9)(e,S);return{replyInfo:C,suggestedPostInfo:w,editingId:g,message:S,sender:M,shouldAnimate:f,forwardedMessagesCount:v?r.length:void 0,noAuthors:l,noCaptions:c,forwardsHaveCaptions:Y,isCurrentUserPremium:(0,u.g29)(e),isContextMenuDisabled:F,isReplyToDiscussion:P,isInChangingRecipientMode:h,shouldPreventComposerAnimation:m,senderChat:b,currentUserId:e.currentUserId,isSenderChannel:k,forwardMessageIds:r,fromChatId:s,isMediaNsfw:T,theme:(0,u.SJA)(e)}})(e=>{const{shouldAnimate:t,isReplyToDiscussion:n,isInChangingRecipientMode:s,forwardMessageIds:a,fromChatId:r,replyInfo:l,editingId:c,suggestedPostInfo:h,shouldForceShowEditing:m,message:p,forwardedMessagesCount:g}=e,{resetDraftReplyInfo:v,resetDraftSuggestedPostInfo:A,updateDraftReplyInfo:y,setEditingId:C,focusMessage:w,changeRecipient:I,openChatOrTopicWithReplyInDraft:b,setForwardNoAuthors:S,setForwardNoCaptions:M,exitForwardMode:N,setShouldPreventComposerAnimation:k,openSuggestMessageModal:Y,requestMessageMediaEditor:F}=(0,i.ko)(),P=(0,o.li)(),T=(0,W.A)(),D=(0,$.A)(),{isMobile:x}=(0,yt.Ay)(),L="topicCreate"===p?.content.action?.type,E=Boolean(h)&&!m,B=Boolean(g),R=(0,H.A)(e=>{const t=(0,i.mS)();let n=(0,u.Szq)(t,e);return n||(n=(0,u.Y7C)(t,e)),n}),O=(0,o.Kr)(()=>{if(!B)return;const e=a?.map(e=>(0,u.O5q)((0,i.mS)(),r,e)).filter(Boolean),t=e?.map(e=>R(e)).filter(Boolean);return t?(0,At.Am)(t):void 0},[B,a,r]),U=!(s||(!p||!l&&!c)&&(!O||!B)&&!E),{shouldRender:K,transitionClassNames:V,isClosing:j}=(0,te.A)(U&&!L&&!n,void 0,!t,void 0,!t,350,!t),{chatId:J,currentUserId:G,theme:q,onClear:Q,isCurrentUserPremium:Z,isContextMenuDisabled:X,shouldPreventComposerAnimation:ee,sender:ne,senderChat:oe,isMediaNsfw:ie,noAuthors:se,noCaptions:ae,forwardsHaveCaptions:re,forwardedMessagesCount:de,message:le,shouldForceShowEditing:ce,suggestedPostInfo:ue,replyInfo:he,editingId:me,isSenderChannel:pe}=(0,wt.A)(e,j),ge=Boolean(de),fe=Boolean(he)&&!ce,ve=Boolean(he?.quoteText),Ae=Boolean(ue)&&!ce,ye=le&&(0,d.tM)(le)&&!x;(0,o.vJ)(()=>{ee&&k({shouldPreventComposerAnimation:!1})});const Ce=(0,H.A)(()=>{me?C({messageId:void 0}):de?N():Ae?(A(),v()):he&&!ce&&v(),Q?.()});(0,o.vJ)(()=>U?(0,Ve.A)(Ce):void 0,[U,Ce]);const{isContextMenuOpen:we,contextMenuAnchor:Ie,handleContextMenu:be,handleContextMenuClose:Se,handleContextMenuHide:Me}=(0,z.A)(P),Ne=(0,H.A)(e=>{ue?Y({chatId:J}):be(e)}),ke=(0,H.A)(e=>{e.stopPropagation(),!me&&"message"!==he?.type||!ye||F()}),Ye=(0,H.A)(e=>{e.stopPropagation(),Ce(),Me()}),Fe=e=>()=>{Se(),e()},Pe=(0,H.A)(Fe(I)),Te=(0,H.A)(Fe(()=>{w({chatId:le.chatId,messageId:le.id,noForumTopicPanel:!0})})),De=(0,H.A)(Fe(()=>y({quoteText:void 0}))),xe=(0,H.A)(Fe(I)),Le=(0,H.A)(()=>{Se(),ne&&b({chatId:ne.id})}),Ee=(0,H.A)(Fe(Ce)),Be=(0,H.A)(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),be(e))}),Re=(0,H.A)(()=>P.current),Oe=(0,H.A)(()=>P.current),Ue=(0,H.A)(()=>P.current.querySelector(".forward-context-menu .bubble"));(0,o.vJ)(()=>{K||(Se(),Me())},[Se,Me,K]);const Ke=(0,f.A)("ComposerEmbeddedMessage",V),{className:ze,style:je}=(0,_.Ay)({peer:ne,theme:q}),Je=(0,f.A)("ComposerEmbeddedMessage_inner",ze),Ge=(0,o.Kr)(()=>me?"edit":Ae?"cash-circle":ge?"forward":fe?"reply":void 0,[me,ge,fe,Ae]),qe=de&&de>1?T("ForwardedMessageCount",de):void 0,$e=(0,o.Kr)(()=>{if(!le||!ge||!le.content.text||!se||Z)return le;const e=(0,d.m4)(le.content.text);return{...le,content:{...le.content,text:e}}},[Z,ge,le,se]),He=(0,Ct.A)(Ge,!0);if(!K)return;const We=ne&&!pe&&J!==ne.id&&ne.id!==G;return(0,Ze.Y)("div",{className:Ke,ref:P,onContextMenu:be,children:(0,Ze.FD)("div",{className:Je,style:je,children:[(0,Ze.FD)("div",{className:"embedded-left-icon",role:"button",tabIndex:0,onClick:be,onKeyDown:Be,children:[He&&(0,Ze.Y)(ot.A,{name:He}),Boolean(he?.quoteText)&&(0,Ze.Y)(ot.A,{name:"quote",className:"quote-reply"})]}),(0,Ze.Y)(It.A,{isOpen:U,className:"inside-input",replyInfo:he,suggestedPostInfo:ue,isMediaNsfw:ie,isInComposer:!0,message:$e,sender:se?void 0:ne,composerForwardSenders:O,customText:qe,noCaptions:ae,title:me&&!fe?T("EditMessage"):se?T("HiddenSendersNameDescription"):void 0,onClick:Ne,onPictogramClick:ye?ke:void 0,pictogramActionIcon:ye?"edit":void 0,senderChat:oe}),(0,Ze.Y)(ht.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:T("Cancel"),onClick:Ye,iconName:"close"}),(fe||ge)&&!X&&(0,Ze.FD)(it.A,{isOpen:we,anchor:Ie,getTriggerElement:Re,getRootElement:Oe,getMenuElement:Ue,className:"forward-context-menu",onClose:Se,onCloseAnimationEnd:Me,children:[ge&&(0,Ze.FD)(Ze.FK,{children:[(0,Ze.Y)(st.A,{icon:se?void 0:"message-succeeded",customIcon:se?(0,Ze.Y)(ot.A,{name:"placeholder"}):void 0,onClick:()=>S({noAuthors:!1}),children:T(de>1?"ShowSenderNames":"ShowSendersName")}),(0,Ze.Y)(st.A,{icon:se?"message-succeeded":void 0,customIcon:se?void 0:(0,Ze.Y)(ot.A,{name:"placeholder"}),onClick:()=>S({noAuthors:!0}),children:T(de>1?"HideSenderNames":"HideSendersName")}),re&&(0,Ze.FD)(Ze.FK,{children:[(0,Ze.Y)(bt.A,{}),(0,Ze.Y)(st.A,{icon:ae?void 0:"message-succeeded",customIcon:ae?(0,Ze.Y)(ot.A,{name:"placeholder"}):void 0,onClick:()=>M({noCaptions:!1}),children:T(de>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")}),(0,Ze.Y)(st.A,{icon:ae?"message-succeeded":void 0,customIcon:ae?void 0:(0,Ze.Y)(ot.A,{name:"placeholder"}),onClick:()=>M({noCaptions:!0}),children:T(de>1?"Conversation.ForwardOptions.HideCaption":"HideCaption")})]}),(0,Ze.Y)(bt.A,{}),(0,Ze.Y)(st.A,{icon:"replace",onClick:Pe,children:T("ForwardAnotherChat")})]}),fe&&(0,Ze.FD)(Ze.FK,{children:[(0,Ze.Y)(st.A,{icon:"show-message",onClick:Te,children:T("Message.Context.Goto")}),ve&&(0,Ze.Y)(st.A,{icon:"remove-quote",onClick:De,children:T("RemoveQuote")}),We&&(0,Ze.Y)(st.A,{icon:"user",onClick:Le,children:D("ReplyInPrivateMessage")}),(0,Ze.Y)(st.A,{icon:"replace",onClick:xe,children:T("ReplyToAnotherChat")}),(0,Ze.Y)(st.A,{icon:"delete",onClick:Ee,children:T("DoNotReply")})]})]})]})})}));var Mt=n(25897),Nt=n(6070),kt=n(41510);const Yt=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"DropArea",!t);return n?(0,Ze.Y)(n,{...e}):void 0};var Ft=n(49068);const Pt=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"InlineBotTooltip",!t);return n?(0,Ze.Y)(n,{...e}):void 0},Tt=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"MentionTooltip",!t);return n?(0,Ze.Y)(n,{...e}):void 0};var Dt=n(78407);const xt=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"PollModal",!t);return n?(0,Ze.Y)(n,{...e}):void 0},Lt=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"SendAsMenu",!t);return n?(0,Ze.Y)(n,{...e}):void 0},Et=e=>{const{isOpen:t}=e,n=(0,Qe.A)(_e.ar.Extra,"StickerTooltip",!t);return n?(0,Ze.Y)(n,{...e}):void 0};var Bt=n(26440);const Rt=e=>{const{modal:t}=e,n=(0,Qe.A)(_e.ar.Extra,"ToDoListModal",!t);return n?(0,Ze.Y)(n,{...e}):void 0};var Ot=n(2338),Ut=n(62587),Kt=n(34201),zt=n(86070);const Vt="zqTOc7LU",jt="b0A9Zfoa";const Jt=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,u.nTw)(e),i=(0,p.rQ)(e,t,n),{attachmentSettings:s}=e,a=o.webPagePreviewId?(0,u.kgA)(e,o.webPagePreviewId):void 0;return{webPagePreview:"empty"===a?.webpageType?void 0:a,noWebPage:i,attachmentSettings:s}})(({chatId:e,threadId:t,isDisabled:n,webPagePreview:s,noWebPage:a,attachmentSettings:r,isEditing:l})=>{const{toggleMessageWebPage:c,updateAttachmentSettings:u}=(0,i.ko)(),h=(0,$.A)(),m=(0,o.li)(),p=r.isInvertedMedia,g="small"===r.webPageMediaSize,v=(0,V.A)(()=>Boolean(s&&!a&&!n),[n,a,s]),{shouldRender:A}=(0,Kt.A)({isOpen:v,ref:m,withShouldRender:!0}),y="full"===s?.webpageType&&s.hasLargeMedia,C=(0,o.li)(s);s&&s!==C.current&&(C.current=s);const w=s||C.current,I="full"===w?.webpageType,b=(0,Ot.A)(I?{content:w}:void 0),S=(0,d.eY)(w)||(0,d.rU)(w)||(0,d.y3)(w)||(0,d.rj)(w),M=S&&(0,d.VO)(S,"pictogram"),N=(0,Ut.A)(M),{shouldRender:k,ref:Y}=(0,Kt.A)({isOpen:Boolean(N),withShouldRender:!0,noCloseTransition:!0}),F=Boolean(N||k),P=(0,H.A)(()=>{c({chatId:e,threadId:t,noWebPage:!0})}),{isContextMenuOpen:T,contextMenuAnchor:D,handleContextMenu:x,handleContextMenuClose:L,handleContextMenuHide:E,handleBeforeContextMenu:B}=(0,z.A)(m,l,!0),R=(0,H.A)(()=>m.current),O=(0,H.A)(()=>m.current),U=(0,H.A)(()=>m.current.querySelector(`.${Vt} .bubble`)),K=(0,H.A)(e=>{x(e)});function j(e){u({isInvertedMedia:e})}function J(e){u({webPageMediaSize:e})}if((0,o.vJ)(()=>{A&&w||(L(),E())},[L,E,A,w]),A&&w)return(0,Ze.Y)("div",{className:(0,f.A)("O3di3ULC",!l&&"G5_7x_Hn"),ref:m,children:(0,Ze.FD)("div",{className:"m3DBx9f5",children:[(0,Ze.Y)("div",{className:"vFWsMwfP",onClick:K,children:(0,Ze.Y)(ot.A,{name:"link"})}),w&&"empty"!==w.webpageType&&(0,Ze.FD)(zt.A,{noUserColors:!0,className:"otSxF62k",onContextMenu:x,onMouseDown:B,onClick:K,children:[F&&(0,Ze.FD)("div",{className:"VvwZOug9",children:[b&&(0,Ze.Y)("img",{src:b,alt:"",className:jt}),k&&(0,Ze.Y)("img",{ref:Y,src:N,alt:"",className:jt})]}),(0,Ze.FD)("div",{className:"itmZe2qi",children:[(0,Ze.Y)("span",{className:"ER149gdz",children:I?w.siteName||w.url:h("Loading")}),(0,Ze.Y)("span",{className:"FSYSqC60",children:I?w.description||h((G=w,G.photo?"AttachPhoto":G.video?"AttachVideo":G.audio?"AttachMusic":G.document?"AttachDocument":G.story?"AttachStory":"LinkPreview")):w.url})]})]}),(0,Ze.Y)(ht.A,{className:"yhxytYkd",round:!0,faded:!0,color:"translucent",ariaLabel:h("AccLinkRemovePreview"),onClick:P,iconName:"close"}),!l&&(0,Ze.Y)(it.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:O,getMenuElement:U,className:Vt,onClose:L,onCloseAnimationEnd:E,autoClose:!0,children:(0,Ze.FD)(Ze.FK,{children:[p?(0,Ze.Y)(st.A,{icon:"move-caption-up",onClick:()=>j(void 0),children:h("ContextMoveTextUp")}):(0,Ze.Y)(st.A,{icon:"move-caption-down",onClick:()=>j(!0),children:h("ContextMoveTextDown")}),y&&(g?(0,Ze.Y)(st.A,{icon:"expand",onClick:()=>J("large"),children:h("ContextLinkLargerMedia")}):(0,Ze.Y)(st.A,{icon:"collapse",onClick:()=>J("small"),children:h("ContextLinkSmallerMedia")})),(0,Ze.Y)(st.A,{icon:"delete",onClick:P,children:h("ContextLinkRemovePreview")})]})})]})});var G}));var Gt=n(97676),qt=n(76283),$t=n(97422),Ht=n(61361),Wt=n(41036),_t=n(68292),Qt=n(21849),Zt=n(48227),Xt=n(11241),en=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}(en||{});const tn=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,storyId:o,messageListType:i,isMobile:r,type:c})=>{const g=e.appConfig,f=(0,u.hds)(e,t),v=(0,d.DX)(t)?void 0:(0,u.yps)(e,t),A=Boolean(v),y=(0,u.nZ4)(e,t),C=(0,w.L8)(t),I=C?(0,u.vGo)(e,t):void 0,b=(0,u.WA9)(e,t),S=C?void 0:(0,u.AWZ)(e,t),M=(A||!C)&&(0,u.tVS)(e,t,n),{shouldSuggestStickers:N,shouldSuggestCustomEmoji:k,shouldUpdateStickerSetOrder:Y,shouldPaidMessageAutoApprove:F}=e.settings.byKey,{language:P,shouldCollectDebugLogs:D}=(0,m.lS)(e),{forwardMessages:{messageIds:x},shouldOpenMessageMediaEditor:L}=(0,u.nTw)(e),E=e.emojiKeywords[a.cUY],B=P!==a.cUY?e.emojiKeywords[P]:void 0,R=M?M.id:void 0,O=R?(0,u.O5q)(e,t,R):void 0,{currentUserId:U}=e,K=(0,u.mBe)(e,U),z=S?S?.sendAsId||U:void 0,V=z?(0,u.PVB)(e,z):void 0,j=(0,u.sam)(e,t),J=(0,u.p6T)(e,t),G=(0,u.nTw)(e),q=Boolean(G.storyViewer.storyId),$=(0,u.Xf0)(e),H=t===$?.chatId&&n===$?.threadId&&i===$?.type&&!q,W=(0,u.mBe)(e,t),_=(W&&!I?.noVoiceMessages)??!0,Q=S?.slowMode,Z=(0,u.g29)(e),X="scheduled"===i?(0,p.dk)(e,t):(0,p.U0)(e,t,n),ee=o&&(0,u.Msb)(e,t,o),te=ee&&"sentReaction"in ee?ee.sentReaction:void 0,ne=(0,p.GA)(e,t,n),oe=ne?.replyInfo?(0,u.O5q)(e,t,ne.replyInfo.replyToMsgId):void 0,ie=f?.isForum&&f.isForumAsMessages&&n===s.l3&&oe?(0,u.nkm)(e,oe):void 0,se="scheduled"===i,ae=C&&!A&&!se&&!y,re=(0,p.rQ)(e,t,n),de=f&&(0,l.RY)(f,(0,u.K52)(e),(0,u.P5N)(e,t))?.isSilentPosting,le=C&&!A&&!se&&!y&&"story"!==c&&t!==a.zv8,ce=(0,u.xYJ)(e,"stickerEffects"),ue=G.shouldPlayEffectInComposer,he=le&&ne?.effectId,me=he?e.availableEffectById[he]:void 0,pe=e.reactions.effectReactions,ge=e.config?.maxMessageLength||T.Yf,fe=t===G.forwardMessages.toChatId,ve=Boolean(ne?.replyInfo),Ae=Boolean(ne?.suggestedPostInfo),ye=e.stars?.balance.amount||0,Ce=Boolean(G.starsBalanceModal),we=(0,u.trm)(e),Ie=e.isAppConfigLoaded,be=G.insertingPeerIdMention,Se=G.webPagePreviewId?(0,u.kgA)(e,G.webPagePreviewId):void 0;return{availableReactions:e.reactions.availableReactions,topReactions:"story"===c?e.reactions.topReactions:void 0,isOnActiveTab:!G.isBlurred,editingMessage:(0,u.KLw)(e,t,n,i),draft:ne,chat:f,user:W,isChatWithBot:A,isChatWithSelf:y,isForCurrentMessageList:H,canScheduleUntilOnline:(0,u.RBq)(e,t),isChannel:f?(0,d.WX)(f):void 0,isRightColumnShown:(0,u.gjV)(e,r),isSelectModeActive:(0,u.rTV)(e),withScheduledButton:"thread"===i&&(I||S)?.hasScheduledMessages,isInScheduledList:se,botKeyboardMessageId:R,botKeyboardPlaceholder:O?.keyboardPlaceholder,isForwarding:fe,isReplying:ve,hasSuggestedPost:Ae,forwardedMessagesCount:fe?x.length:void 0,pollModal:G.pollModal,todoListModal:G.todoListModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:S,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:U,currentUser:K,contentToBeScheduled:G.contentToBeScheduled,shouldSuggestStickers:N,shouldSuggestCustomEmoji:k,shouldUpdateStickerSetOrder:Y,recentEmojis:e.recentEmojis,baseEmojiKeywords:E?.keywords,emojiKeywords:B?.keywords,inlineBots:G.inlineBots.byUsername,isInlineBotLoading:G.inlineBots.isLoading,botCommands:I?I.botInfo?.commands||!1:void 0,botMenuButton:I?.botInfo?.menuButton,sendAsPeer:V,sendAsId:z,editingDraft:X,requestedDraft:j,requestedDraftFiles:J,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,u.dfQ)(e,t),theme:(0,u.SJA)(e),fileSizeLimit:(0,h.d)(e,"uploadMaxFileparts")*a.dK5,captionLimit:(0,h.d)(e,"captionLength"),isCurrentUserPremium:Z,canSendVoiceByPrivacy:_,attachmentSettings:e.attachmentSettings,slowMode:Q,currentMessageList:$,isReactionPickerOpen:(0,u.Ani)(e),canBuyPremium:!Z&&!(0,u.n_C)(e),canPlayAnimatedEmojis:(0,u.BWX)(e),canSendOneTimeMedia:!y&&C&&!A&&!se,shouldCollectDebugLogs:D,sentStoryReaction:te,stealthMode:e.stories.stealthMode,replyToTopic:ie,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:ae,noWebPage:re,webPagePreview:Se,isContactRequirePremium:I?.isContactRequirePremium,effect:me,effectReactions:pe,areEffectsSupported:le,canPlayEffect:ce,shouldPlayEffect:ue,maxMessageLength:ge,paidMessagesStars:b,shouldPaidMessageAutoApprove:F,isSilentPosting:de,isPaymentMessageConfirmDialogOpen:G.isPaymentMessageConfirmDialogOpen,starsBalance:ye,isStarsBalanceModalOpen:Ce,shouldDisplayGiftsButton:I?.shouldDisplayGiftsButton,disallowedGifts:I?.disallowedGifts,isAccountFrozen:we,isAppConfigLoaded:Ie,insertingPeerIdMention:be,pollMaxAnswers:g.pollMaxAnswers,shouldOpenMessageMediaEditor:L,replyToMessage:oe}})(({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:l,canScheduleUntilOnline:h,isReady:m,isMobile:p,editingMessage:w,chatId:T,threadId:D,storyId:de,currentMessageList:le,messageListType:ce,draft:ue,chat:he,chatFullInfo:me,user:pe,replyToTopic:ge,isForCurrentMessageList:fe,isCurrentUserPremium:ve,canSendVoiceByPrivacy:Ae,isChatWithBot:ye,isChatWithSelf:Ce,isChannel:Pe,fileSizeLimit:je,isRightColumnShown:Je,isSelectModeActive:Ge,isReactionPickerOpen:qe,shouldDisplayGiftsButton:$e,isForwarding:_e,isReplying:Qe,hasSuggestedPost:et,forwardedMessagesCount:tt,pollModal:nt,todoListModal:it,botKeyboardMessageId:st,botKeyboardPlaceholder:rt,inputPlaceholder:ct,withScheduledButton:ut,stickersForEmoji:mt,customEmojiForEmoji:vt,topInlineBotIds:At,currentUserId:yt,currentUser:Ct,captionLimit:wt,contentToBeScheduled:It,shouldSuggestStickers:bt,shouldSuggestCustomEmoji:Ot,baseEmojiKeywords:Ut,emojiKeywords:Kt,recentEmojis:zt,inlineBots:Vt,isInlineBotLoading:jt,botCommands:tn,sendAsPeer:nn,sendAsId:on,editingDraft:sn,requestedDraft:an,requestedDraftFiles:rn,botMenuButton:dn,attachBots:ln,attachMenuPeerType:cn,attachmentSettings:un,theme:hn,slowMode:mn,shouldUpdateStickerSetOrder:pn,editableInputCssSelector:gn,editableInputId:fn,inputId:vn,className:An,availableReactions:yn,topReactions:Cn,canBuyPremium:wn,canPlayAnimatedEmojis:In,shouldCollectDebugLogs:bn,sentStoryReaction:Sn,stealthMode:Mn,canSendOneTimeMedia:Nn,quickReplyMessages:kn,quickReplies:Yn,canSendQuickReplies:Fn,webPagePreview:Pn,noWebPage:Tn,isContactRequirePremium:Dn,paidMessagesStars:xn,effect:Ln,effectReactions:En,areEffectsSupported:Bn,canPlayEffect:Rn,shouldPlayEffect:On,maxMessageLength:Un,isSilentPosting:Kn,isPaymentMessageConfirmDialogOpen:zn,starsBalance:Vn,isStarsBalanceModalOpen:jn,disallowedGifts:Jn,isAccountFrozen:Gn,isAppConfigLoaded:qn,insertingPeerIdMention:$n,pollMaxAnswers:Hn,replyToMessage:Wn,shouldOpenMessageMediaEditor:_n,onDropHide:Qn,onFocus:Zn,onBlur:Xn,onForward:eo})=>{const{sendMessage:to,clearDraft:no,showDialog:oo,openPollModal:io,closePollModal:so,openTodoListModal:ao,closeTodoListModal:ro,loadScheduledHistory:lo,openThread:co,addRecentEmoji:uo,sendInlineBotResult:ho,loadSendAs:mo,resetOpenChatWithDraft:po,callAttachBot:go,addRecentCustomEmoji:fo,showNotification:vo,showAllowedMessageTypesNotification:Ao,openStoryReactionPicker:yo,openGiftModal:Co,closeReactionPicker:wo,sendStoryReaction:Io,editMessage:bo,updateAttachmentSettings:So,saveEffectInDraft:Mo,setReactionEffect:No,hideEffectInComposer:ko,updateChatSilentPosting:Yo,updateInsertingPeerIdMention:Fo,updateDraftSuggestedPostInfo:Po,updateShouldSaveAttachmentsCompression:To,applyDefaultAttachmentsCompression:Do}=(0,i.ko)(),xo=(0,W.A)(),Lo=(0,$.A)(),Eo=(0,o.li)(),Bo=(0,o.li)(),Ro=(0,o.li)(),[Oo,Uo]=(0,o.Ul)(""),[Ko,zo]=(0,o.J0)(!1),Vo=(0,q.A)(gn),jo=(0,o.li)(),Jo=(0,Z.A)(n),{width:Go}=P.A.get(),qo=(0,G.A)(),$o="messageList"===e,Ho="story"===e,Wo=$o?he?.sendAsPeerIds:void 0,_o=Boolean(Wo?.length),[Qo,Zo,Xo]=(0,J.A)(),ei=(0,ee.A)(T,D),[ti,ni,oi]=(0,J.A)(),[ii,si,ai]=(0,J.A)(),ri=w&&(0,d.ZV)(w),di=he?.isMonoforum,{emojiSet:li,members:ci,botCommands:ui}=me||{},hi=li?.id,mi=!xn&&!di,pi=Sn&&(0,d.a0)(Sn,a.tNZ);(0,o.vJ)(C.VU,[Oo]);const gi=(0,o.li)(0),[fi,vi]=(0,X.A)($o&&h,Xo);(0,K.A)(()=>{zo(!0)},430),(0,o.vJ)(()=>{$o||wo()},[$o,de]),(0,o.vJ)(()=>{jo.current=void 0},[T]),(0,o.vJ)(()=>{qn&&T&&m&&!Ho&&!di&&lo({chatId:T})},[m,T,D,Ho,qn,di]),(0,o.vJ)(()=>{const e=Pe&&he?.areProfilesShown,t=he&&(0,d.Vs)(he)&&Boolean((0,d.gA)(he)||he.isLinkedInDiscussion||he.hasGeo);!Wo&&m&&(t||e)&&mo({chatId:T})},[he,T,Pe,m,mo,Wo]);const Ai=(0,o.li)(!1);(0,oe.A)(([e,t])=>{Ai.current=Boolean(T===e&&Wo&&!t)},[T,Wo]);const[yi,Ci]=(0,o.J0)([]),wi=Boolean(yi.length),[Ii,bi]=(0,o.J0)(void 0);(0,o.vJ)(()=>{yi.length&&yi||To({shouldSave:!1})},[yi]);const{canSendStickers:Si,canSendGifs:Mi,canAttachMedia:Ni,canAttachPolls:ki,canAttachEmbedLinks:Yi,canAttachToDoLists:Fi,canSendVoices:Pi,canSendPlainText:Ti,canSendAudios:Di,canSendVideos:xi,canSendPhotos:Li,canSendDocuments:Ei}=(0,o.Kr)(()=>(0,d.Q_)(he,me,ye,Ce,Ho,xn,l),[he,me,ye,Ce,Ho,xn,l]),Bi=Dn&&Ho,Ri=Bi||!Ti,Oi=(0,V.A)(()=>{if(wi)return yi.length;const e=Oo()||wi?1:0;return _e&&tt?tt+e:e||1},[Oo,wi,yi,_e,tt]),Ui=xn?Oi*xn:0,{closeConfirmDialog:Ki,dialogHandler:zi,shouldAutoApprove:Vi,setAutoApprove:ji,handleWithConfirmation:Ji}=(0,Oe.A)(Ui,jn,Vn),Gi=!wi&&Yi&&!Tn&&"full"===Pn?.webpageType,qi=Ri&&!w;(0,o.vJ)(()=>{Gi||So({isInvertedMedia:void 0})},[Gi]);const $i=(0,H.A)((e,t=fn,n=!1)=>{if(t===fn&&qi)return;const o=window.getSelection();let i;if(i=t===fn?document.querySelector(gn):document.getElementById(t),o.rangeCount&&!n){const n=o.getRangeAt(0);if((0,B.L)(n,t))return(0,Y.oR)(e),void i.dispatchEvent(new Event("input",{bubbles:!0}))}if(n){const t=e.split(" ")[0],n=Oo().startsWith(t);Uo(n?e:`${e}${Oo()}`)}else Uo(`${Oo()}${e}`);(0,r.Uz)(()=>{(0,b.A)(i)})}),Hi=(0,H.A)((e,t=fn)=>{const n=(0,R.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");$i(n,t)}),Wi=(0,H.A)((e,t=fn,n=!1)=>{const o=(0,O.QY)(e);$i(o,t,n)}),_i=(0,H.A)((e,t=fn)=>{$i((0,E.hB)(e),t)}),Qi=(0,H.A)(()=>{Ii&&(Wi(Ii,fn),bi(void 0))}),{shouldForceCompression:Zi,shouldForceAsFile:Xi,handleAppendFiles:es,handleFileSelect:ts,onCaptionUpdate:ns,handleClearAttachments:os,handleSetAttachments:is}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:a,canSendAudios:r,canSendVideos:l,canSendPhotos:c,canSendDocuments:u,insertNextText:h,editedMessage:m,shouldSendInHighQuality:p}){const g=(0,$.A)(),{openLimitReachedModal:f,showAllowedMessageTypesNotification:v,showNotification:A}=(0,i.ko)(),[y,C]=(0,o.J0)(!1),[w,I]=(0,o.J0)(!1),b=(0,H.A)(()=>{s(N.p),h()}),S=(0,H.A)(n=>{const o="function"==typeof n?n(e):n;if(o.length)if(o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r&&!u||"video"===t&&!l&&!u||"photo"===t&&!c&&!u||"file"===t&&!u}))v({chatId:a});else if(o.some(({size:e})=>e>t))f({limit:"uploadMaxFileparts"});else{s(o);const e=o.some(e=>{const t=(0,d.ES)(e);return"audio"===t&&!r||"video"===t&&!l||"photo"===t&&!c});C(Boolean(e&&u)),I(!u)}else b()}),M=(0,H.A)(async(t,n)=>{if(m){const e=await(0,L.A)(t[0].name,t[0]),n=m&&(0,d.eh)(m,e);m?.groupedId?n?S([e]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:t.length})}):S([e])}else{const o=await Promise.all(t.map(e=>(0,L.A)(e.name,e,{shouldSendAsSpoiler:n||void 0,shouldSendInHighQuality:p})));S([...e,...o])}}),k=(0,H.A)(async e=>{if(m){const t=await(0,L.A)(e[0].name,e[0]),n=m&&(0,d.eh)(m,t);m?.groupedId?n?S([t]):A({message:g("MediaReplaceInvalidError",void 0,{pluralValue:e.length})}):S([t])}else{const t=await Promise.all(e.map(e=>(0,L.A)(e.name,e,{shouldSendInHighQuality:p})));S(t)}}),Y=(0,H.A)(async()=>{const t=await Promise.all(e.map(e=>(0,L.A)(e.filename,e.blob,{shouldSendInHighQuality:p})));S(t)});return(0,o.vJ)(()=>{Y()},[p]),{handleAppendFiles:M,handleFileSelect:k,onCaptionUpdate:n,handleClearAttachments:b,handleSetAttachments:S,shouldForceCompression:w,shouldForceAsFile:y}}({attachments:yi,setHtml:Uo,setAttachments:Ci,fileSizeLimit:je,chatId:T,canSendAudios:Di,canSendVideos:xi,canSendPhotos:Li,canSendDocuments:Ei,insertNextText:Qi,editedMessage:w,shouldSendInHighQuality:un.shouldSendInHighQuality}),ss=(0,o.li)(Date.now());(0,o.vJ)(()=>{if(!_n)return;const e=w||Wn,t=e&&((0,d.yl)(e)||(0,d.nd)(e));if(!t)return;const n=(0,d.VO)(t,"full");if(!n)return;const o=Date.now();ss.current=o,(0,M.hd)(n,s.qZ.BlobUrl).then(async e=>{if(ss.current!==o)return;const n=await(0,I.sZ)(e),i=await(0,L.A)((0,d.sd)(t),n);is([i])})},[w,Wn,_n,is]);const[as,rs,ds]=(0,J.A)(),[ls,cs,us]=(0,J.A)(),[hs,ms,ps]=(0,J.A)(),[gs,fs,vs]=(0,J.A)(),[As,ys,Cs]=(0,J.A)(),{startRecordingVoice:ws,stopRecordingVoice:Is,pauseRecordingVoice:bs,activeVoiceRecording:Ss,currentRecordTime:Ms,recordButtonRef:Ns,startRecordTimeRef:ks,isViewOnceEnabled:Ys,setIsViewOnceEnabled:Fs,toogleViewOnceEnabled:Ps}=(()=>{const e=(0,o.li)(),[t,n]=(0,o.J0)(),i=(0,o.li)(),[s,a]=(0,o.J0)(),[d,l]=(0,o.J0)(!1);(0,o.vJ)(()=>{g.Yw&&g.pW&&He()},[]);const c=(0,H.A)(async()=>{try{const{stop:t,pause:o}=await We(t=>{e.current&&(i.current&&Date.now()%4==0&&(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)}),a(Date.now()))});i.current=Date.now(),a(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}}),u=(0,H.A)(()=>{if(t){(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.pause()}catch(e){return void console.error(e)}}}),h=(0,H.A)(()=>{if(t){n(void 0),i.current=void 0,a(void 0),(0,r.RK)(()=>{e.current&&(e.current.style.boxShadow="none")});try{return t.stop()}catch(e){return void console.error(e)}}});(0,o.vJ)(()=>t?(0,Ve.A)(h):void 0,[t,h]);const m=(0,H.A)(()=>{l(!d)});return{startRecordingVoice:c,pauseRecordingVoice:u,stopRecordingVoice:h,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:i,isViewOnceEnabled:d,setIsViewOnceEnabled:l,toogleViewOnceEnabled:m}})(),Ts=fe&&!Ho;(0,U.A)(()=>{ei({type:"recordAudio"})},Ts?Ss&&a.cqp:void 0),(0,o.vJ)(()=>{fe&&!Ho&&(Ss||ei({type:"cancel"}))},[Ss,fe,Ho,ei]);const Ds=(0,ne.i)(Boolean(w));(0,o.vJ)(()=>{fe&&!Ho&&Oo()&&!Ds.current&&ei({type:"typing"})},[Oo,Ds,fe,Ho,ei]);const xs=he&&(0,d.SJ)(he),{isEmojiTooltipOpen:Ls,closeEmojiTooltip:Es,filteredEmojis:Bs,filteredCustomEmojis:Rs,insertEmoji:Os}=(0,Fe.A)(Boolean(m&&t&&(Ho||fe)&&bt&&!wi),Oo,Uo,void 0,zt,Ut,Kt),{isCustomEmojiTooltipOpen:Us,closeCustomEmojiTooltip:Ks,insertCustomEmoji:zs}=(0,Ie.A)(Boolean(m&&t&&(Ho||fe)&&Ot&&!wi),Oo,Uo,Vo,Eo,vt),{isStickerTooltipOpen:Vs,closeStickerTooltip:js}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,i.ko)(),[d,l,c]=(0,J.A)(!1),u=(0,ae.A)(()=>{const n=t();if(!e||!n||g.TL&&n.length>8)return;if(!n.match(g.TL?Ue.A:a.bpX))return;const o=(0,ie.S)(n);return o&&(g.TL&&1===(0,Ke.A)(o)||!g.TL&&Boolean(n.match(ze)))?g.TL?o:o.match(/alt="(.+)"/)?.[1]:void 0},[t,e]),h=(0,V.A)(()=>Boolean(u()),[u]),m=Boolean(n?.length);return(0,o.vJ)(()=>{if(!e||!h)return;const t=u();t?m||s({emoji:t}):r()},[e,h,u,m,s,r]),(0,o.vJ)(c,[c,t]),{isStickerTooltipOpen:Boolean(h&&m&&!d),closeStickerTooltip:l}}(Boolean(m&&t&&(Ho||fe)&&bt&&Si&&!wi),Oo,mt),{isMentionTooltipOpen:Js,closeMentionTooltip:Gs,insertMention:qs,mentionFilteredUsers:$s}=(0,Re.A)(Boolean($o&&m&&fe&&!wi),Oo,Uo,Vo,Eo,ci,At,yt);(0,o.vJ)(()=>{if(!$n)return;const e=(0,u.PVB)((0,i.mS)(),$n);e&&qs(e,!0,!0),Fo({peerId:void 0})},[$n,qs]);const{isOpen:Hs,botId:Ws,isGallery:_s,switchPm:Qs,switchWebview:Zs,results:Xs,closeTooltip:ea,help:ta,loadMore:na}=function(e,t,n,s){const{queryInlineBot:a,resetInlineBot:r,resetAllInlineBots:d}=(0,i.ko)(),[l,c,u]=(0,J.A)(!1),h=(0,se.gs)(()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return xe;const t=function(e){return Le.innerHTML=e.replace(/<br>/g,"\n"),Le.querySelectorAll("[alt]").forEach(e=>{e.innerText||(e.innerText=e.getAttribute("alt"))}),Le.innerText}(e),n=t.match(Te);return n?Ee(n[1],n[2],""===n[2]&&!t.match(De)):xe}(t):xe},[n,e],300),{username:m,query:p,canShowHelp:g,usernameLowered:f}=(0,V.A)(h,[h,n],!0);(0,oe.A)(([e])=>{e&&r({username:e})},[m,r]),(0,o.vJ)(()=>{f&&a({chatId:t,username:f,query:p})},[t,p,a,f]),(0,o.vJ)(u,[u,n]);const{id:v,switchPm:A,switchWebview:y,offset:C,results:w,isGallery:I,help:b}=f&&s?.[f]||{},S=Boolean((w?.length||A||y)&&!l);(0,o.vJ)(()=>{S||m||d()},[S,d,m]);const M=(0,H.A)(()=>{f&&a({chatId:t,username:f,query:p,offset:C})});return{isOpen:S,botId:v,isGallery:I,switchPm:A,switchWebview:y,results:w,closeTooltip:c,help:g&&b?`@${m} ${b}`:void 0,loadMore:M}}(Boolean($o&&m&&fe&&!wi),T,Oo,Vt),oa=Boolean(Yn&&Object.keys(Yn).length),{isOpen:ia,close:sa,filteredBotCommands:aa,filteredQuickReplies:ra}=function(e,t,n,i,s){const[a,r]=(0,o.J0)(),[d,l]=(0,o.J0)(),[c,u,h]=(0,J.A)(!1),m=(0,se.gs)(()=>{const n=t();return e&&n.startsWith("/")?(0,ie.S)(n).match(re)?.[0].trim():void 0},[t,e],300),p=(0,ae.A)(m,[m,t],!0);return(0,o.vJ)(()=>{const e=p(),t=n||i;if(!e||!t&&!s)return r(void 0),void l(void 0);const o=e.substring(1),a=t?.filter(e=>!o||e.command.startsWith(o));r(a?.length?a:void 0);const d=Object.values(s||{}).filter(e=>!o||e.shortcut.startsWith(o));l(d?.length?d:void 0)},[p,n,i,s]),(0,o.vJ)(h,[h,t]),{isOpen:Boolean((a?.length||d?.length)&&!c),close:u,filteredBotCommands:a,filteredQuickReplies:d}}(Boolean($o&&m&&fe&&(tn&&tn?.length||ui?.length||oa&&Fn)),Oo,tn,ui,Fn?Yn:void 0);(({draft:e,chatId:t,threadId:n,getHtml:d,setHtml:l,editedMessage:c,isDisabled:u})=>{const{saveDraft:h,clearDraft:m,loadCustomEmojis:p}=(0,i.ko)(),g=(0,o.li)(!1);(0,o.vJ)(()=>{const t=d(),n=void 0!==e?.isLocal;(0,O.QY)(e?.text)!==t||n?g.current=!0:g.current=!1},[e,d]),(0,o.vJ)(()=>{g.current=!1},[t,n]);const f=Boolean(c),v=(0,H.A)((e={})=>{if(u||f||!g.current)return;const o=d();o?(0,r.YS)(()=>{h({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,k.Ay)(o)})}):m({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0,shouldKeepSuggestedPost:!0})}),A=(0,Se.A)(a.mPG,!0,void 0,[t,n]);(0,be.A)(([o,i,d])=>{if(u)return;const h=g.current,m=e?.suggestedPostInfo&&!d?.suggestedPostInfo;if(t===o&&n===i){if(h&&!e)return;if(!e&&d&&l(""),h&&!m)return}if(c||!e)return;l((0,O.QY)(e.text)),m&&(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,b.A)(e,!0)});const f=e.text?.entities?.map(e=>e.type===s.C7.CustomEmoji&&e.documentId).filter(Boolean)||[];f.length&&p({ids:f})},[t,n,e,d,l,c,u]),(0,o.Nf)(()=>{if(!u)return()=>{f||v({chatId:t,threadId:n}),ke=!0,(0,r.YS)(()=>{ke=!1})}},[t,n,f,v,u]);const y=(0,ne.i)(t),C=(0,ne.i)(n);(0,o.vJ)(()=>{if(u||ke)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,Me.Ay)(v),(0,Ne.A)(v)})({draft:ue,chatId:T,threadId:D,getHtml:Oo,setHtml:Uo,editedMessage:w,isDisabled:Ho||Boolean(an)||!et&&di}),function({getHtml:e,chatId:t,threadId:n}){const{loadWebPagePreview:a,clearWebPagePreview:r,toggleMessageWebPage:d}=(0,i.ko)(),l=(0,o.li)(),c=(0,se.tF)(()=>{const t=(0,k.Ay)(e()),n=t.entities?.find(e=>e.type===s.C7.TextUrl);return l.current=t,n?.url||t.text.match(Be)?.[0]},[e],300,!0),u=(0,ae.A)(c,[c,e],!0);(0,o.vJ)(()=>{const e=u(),o=l.current;e?a({text:o}):(r(),d({chatId:t,threadId:n}))},[u,t,n]),(0,oe.A)(()=>{r(),d({chatId:t,threadId:n})},[t,r,n,d])}({chatId:T,threadId:D,getHtml:Oo});const da=(0,H.A)((e=!1)=>{e||Uo(""),Ci(N.p),bi(void 0),Es(),Ks(),js(),Gs(),p?setTimeout(()=>ps(),350):ps()}),[la,ca,ua]=((e,t,n,s,l,c,u,h,m)=>{const{editMessage:p,setEditingDraft:g,toggleMessageWebPage:f,openDeleteMessageModal:v}=(0,i.ko)(),[A,y]=(0,o.J0)(!1),C=h?.replyInfo?.replyToMsgId;(0,j.A)(([e,o])=>{if(!n)return;if(C&&o!==C)return t(""),void y(!1);if(e?.id===n.id&&C===o)return;const i=!e&&m?.text.length?m:n.content.text,s=(0,O.QY)(i);t(s),y(!0),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,b.A)(e,!0)})},[n,C,m,t]),(0,o.vJ)(()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Ye.has(e.type));f({chatId:l,threadId:c,noWebPage:e})},[l,c,n]),(0,o.vJ)(()=>{if(n)return()=>{const t=(0,k.Ay)(e()),n=t.text.length?t:void 0;g({chatId:l,threadId:c,type:u,text:n})}},[l,n,e,g,c,u]);const w=(0,se.tF)(()=>{if(!n)return!1;const t=(0,k.Ay)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some(e=>Ye.has(e.type))&&!t.entities?.some(e=>Ye.has(e.type))},[n,e],300,!0),I=(0,ae.A)(w,[w,e],!0);(0,j.A)(([e])=>{n&&e?.id===n.id&&I()&&f({chatId:l,threadId:c,noWebPage:!1})},[n,l,e,c,I]);const S=(0,H.A)(()=>{h&&(0,r.YS)(()=>{t((0,O.QY)(h.text)),(0,r.Uz)(()=>{const e=document.querySelector(a.m$5);e&&(0,b.A)(e,!0)})})}),M=(0,H.A)(()=>{s(),S()}),N=(0,H.A)(()=>{const{text:t,entities:o}=(0,k.Ay)(e());n&&(t||(0,d.mR)(n)?(p({messageList:{chatId:l,threadId:c,type:u},text:t,entities:o}),s(),S()):v({chatId:l,messageIds:[n.id],isSchedule:"scheduled"===u}))}),Y=(0,H.A)(()=>{if(!n)return;const t=(0,k.Ay)(e()),o=t.text.length?t:void 0;g({chatId:l,threadId:c,type:u,text:o})});return(0,Me.Ay)(Y),(0,Ne.A)(Y),[N,M,A]})(Oo,Uo,w,da,T,D,ce,ue,sn),ha=(0,ne.i)(da),ma=(0,ne.i)(Is);(0,o.vJ)(()=>()=>{ma.current(),ha.current()},[T,D,ha,ma]);const pa=(0,o.Kr)(()=>{if(Jn)return Object.values(Jn).every(Boolean)},[Jn]),ga=Boolean(!Ce&&$e&&!pa),fa=di&&!w&&!_e&&!Qe&&!ue?.suggestedPostInfo,va=(0,H.A)(()=>{const e=gi.current;vo(e?{message:xo("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:yt,shouldReplaceHistory:!0}},actionText:xo("Open")}:{message:xo("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:xo("PremiumMore")}),gi.current=Number(!e)}),Aa=(0,V.A)(()=>ti||!eo||Oo()&&!wi?w&&ua?en.Edit:!g.pW||Ss||_e||Oo()&&!wi?l?en.Schedule:en.Send:en.Record:en.Forward,[Ss,w,Oo,wi,_e,ti,eo,ua,l]),ya=!l,{isContextMenuOpen:Ca,handleContextMenu:wa,handleContextMenuClose:Ia,handleContextMenuHide:ba}=(0,z.A)(Ns,!(Aa===en.Send&&ya)),{contextMenuAnchor:Sa,handleContextMenu:Ma,handleBeforeContextMenu:Na,handleContextMenuHide:ka}=(0,z.A)(Ro,!Ho);(0,o.vJ)(()=>{qe||Sa&&(yo({peerId:T,storyId:de,position:Sa}),ka())},[T,ka,qe,de,Sa]);const{className:Ya,style:Fa}=(0,_.Ay)({peer:nn||Ct,theme:hn});we(fe||Ho,Wi,is,bi,w,!ve&&!Ce,va,!yi.length);const Pa=(0,H.A)(()=>{w&&ca()}),Ta=(0,H.A)((e,t)=>{const n=t?wt:Un;if(e?.length>n){const t=e.length-n;return oo({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0}),Da=(0,H.A)(()=>{if(mn&&!xs){const e=document.querySelector(gn),t=(0,F.Fm)(),n=jo.current&&Math.floor(t-jo.current),o=mn.nextSendDate&&mn.nextSendDate>t;if(n&&n<mn.seconds||o){const i=o?mn.nextSendDate-t:mn.seconds-n;return oo({data:{message:xo("SlowModeHint",(0,v.QO)(i)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0}),xa=e=>{if(!le&&!de)return!1;const{text:t}=(0,k.Ay)(Oo());return!(!t&&!e.length||!Ta(t,!0)||!Da())},La=(0,H.A)(({attachments:e,sendCompressed:t=un.shouldCompress,sendGrouped:n=un.shouldSendGrouped,isSilent:o,scheduledAt:i,scheduleRepeatPeriod:s,isInvertedMedia:a})=>{if(!le&&!de)return;o=o||Kn;const{text:d,entities:l}=(0,k.Ay)(Oo());a=d&&t&&n?a:void 0,w?bo({messageList:le,text:d,entities:l,attachments:(0,L.L)(e,t)}):to({messageList:le,text:d,entities:l,scheduledAt:i,scheduleRepeatPeriod:s,isSilent:o,shouldUpdateStickerSetOrder:pn,attachments:(0,L.L)(e,t),shouldGroupMessages:n,isInvertedMedia:a}),jo.current=(0,F.Fm)(),no({chatId:T,threadId:D,isLocalOnly:!0}),(0,r.YS)(()=>{da()})}),Ea=(0,H.A)((e,t,n)=>{if(xa(yi)){if(w)return void La({attachments:yi,sendCompressed:e,sendGrouped:t,isInvertedMedia:n});Ji(La,{attachments:yi,sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}}),Ba=(0,H.A)((e,t,n,o,i,s)=>{xa(yi)&&La({attachments:yi,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o,scheduleRepeatPeriod:s,isInvertedMedia:i})}),Ra=(0,H.A)((e,t=!1,n,o)=>{const{text:i,entities:s}=(0,k.Ay)(Oo());if(e.length)return void(xa(e)&&La({attachments:e,scheduledAt:n,scheduleRepeatPeriod:o,isSilent:t}));if(!i&&!_e)return;if(!Ta(i))return;const a=document.querySelector(gn),d=Ln?.id;if(i||_e){if(!Da())return;const e=Gi?un.isInvertedMedia:void 0;Bn&&Mo({chatId:T,threadId:D,effectId:void 0}),to({messageList:le,text:i,entities:s,scheduledAt:n,scheduleRepeatPeriod:o,isSilent:t,shouldUpdateStickerSetOrder:pn,isInvertedMedia:e,effectId:d,webPageMediaSize:un.webPageMediaSize,webPageUrl:Gi?Pn.url:void 0,isForwarding:_e})}jo.current=(0,F.Fm)(),no({chatId:T,threadId:D,isLocalOnly:!0,shouldKeepReply:_e}),g.pz&&a&&a===document.activeElement&&x(a),(0,r.YS)(()=>{da()})}),Oa=(0,H.A)(async(e=!1,t,n)=>{if(!le&&!de)return;e=e||Kn;let o=yi;if(Ss){const e=await Is(),t=Ys?a.dxe:void 0;if(e){const{blob:n,duration:i,waveform:s}=e;o=[await(0,L.A)("wonderful-voice-message.ogg",n,{voice:{duration:i,waveform:s},ttlSeconds:t})]}}Ra(o,e,t,n)}),Ua=(0,H.A)((e=!1,t,n)=>{Ji(Oa,e,t,n)}),Ka=(0,H.A)(()=>{ve?ao({chatId:T}):vo({message:Lo("SubscribeToTelegramPremiumForCreateToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:Lo("PremiumMore")})}),za=(0,H.A)(()=>{if("webApp"!==dn?.type)return;const e=(0,y.vG)(dn.url);"publicUsernameOrBotLink"===e?.type&&e.appName?(0,A._)(dn.url):go({chatId:T,url:dn.url,threadId:D})}),Va=(0,H.A)(()=>{ps(),cs()}),ja=(0,H.A)((e,t,n,o,i)=>{if(e&&"queryId"in e){const{id:n,queryId:o,isSilent:i}=e;return void ho({id:n,chatId:T,threadId:D,queryId:o,scheduledAt:t,isSilent:i||Kn})}const{isSilent:s,...a}=e||{};if(e&&0!==Object.keys(a).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:o=!1,sendGrouped:i=!1,isInvertedMedia:a}=e;Ba(o,i,s,t,a,n)}else to({...e,messageList:o,scheduledAt:t,scheduleRepeatPeriod:n,effectId:i});else Oa(Boolean(s),t,n)});(0,j.A)(([e])=>{le&&It&&It!==e&&fi((e,t)=>{ja(It,e,t,le,void 0)})},[It,le,ja,fi]),(0,o.vJ)(()=>{an&&(Wi(an,void 0,!0),po(),(0,r.Uz)(()=>{const e=document.getElementById(fn);(0,b.A)(e,!0)}))},[fn,an,po,Uo]),(0,o.vJ)(()=>{rn?.length&&(ts(rn),po())},[ts,rn,po]),(0,o.vJ)(()=>{rn?.length?(To({shouldSave:!0}),Do()):To({shouldSave:!1})},[rn,To,Do]);const Ja=(0,H.A)((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||ve||Ce||n===hi?_i(e,t):va()}),Ga=(0,H.A)(e=>{Ja(e,a.e0F)}),qa=(0,H.A)((e,t,n)=>{(le||de)&&(t=t||Kn,l||n?(Zo(),fi((n,o)=>{Xo(),Ji(ja,{gif:e,isSilent:t},n,o,le),(0,r.YS)(()=>{da(!0)})})):(Ji(to,{messageList:le,gif:e,isSilent:t}),(0,r.YS)(()=>{da(!0)})),no({chatId:T,threadId:D,isLocalOnly:!0}))}),$a=(0,H.A)((e,t,n,o=!1,i)=>{(le||de)&&(t=t||Kn,e={...e,isPreloadedGlobally:!0},l||n?(Zo(),fi((n,i)=>{Xo(),Ji(ja,{sticker:e,isSilent:t},n,i,le),(0,r.YS)(()=>{da(o)})})):(Ji(to,{messageList:le,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:pn&&i}),no({chatId:T,threadId:D,isLocalOnly:!0}),(0,r.YS)(()=>{da(o)})))}),Ha=(0,H.A)((e,t,n)=>{if(!le&&!de)return;t=t||Kn,l||n?fi((n,o)=>{Ji(ja,{id:e.id,queryId:e.queryId,isSilent:t},n,o,le)}):Ji(ho,{id:e.id,queryId:e.queryId,threadId:D,chatId:T,isSilent:t});const o=document.querySelector(gn);g.pz&&o&&o===document.activeElement&&x(o),no({chatId:T,threadId:D,isLocalOnly:!0}),(0,r.YS)(()=>{da()})}),Wa=(0,H.A)(()=>{no({chatId:T,threadId:D,isLocalOnly:!0}),(0,r.YS)(()=>{da()})}),_a=(0,H.A)(e=>{le&&(l?(fi((t,n)=>{Ji(ja,{poll:e},t,n,le)}),so()):(Ji(to,{messageList:le,poll:e,isSilent:Kn}),so()))}),Qa=(0,H.A)(e=>{le&&(l?fi((t,n)=>{Ji(ja,{todo:e},t,n,le)}):Ji(to,{messageList:le,todo:e,isSilent:Kn}))}),Za=(0,H.A)(e=>{if(l)fi((t,n)=>{ja({...e,isSilent:!0},t,n,le)});else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1,isInvertedMedia:o}=e;Ba(t,n,!0,void 0,o)}else Oa(!0)}),Xa=(0,H.A)(()=>{const e=document.querySelector(gn);if(!p||e!==document.activeElement)return us(),ps(),void fs();e?.blur(),setTimeout(()=>{us(),ps(),fs()},100)});(0,o.vJ)(()=>{qi&&Uo("")},[qi,Uo,yi]);const er=(0,H.A)(e=>{Hi(e,a.e0F)}),tr=(0,H.A)((e=fn)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,B.L)(n,e))return void document.execCommand("delete",!1)}Uo(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const o=n.textContent.length,i=document.createRange(),s=window.getSelection();i.setStart(n,o),i.setEnd(n,o),s.removeAllRanges(),s.addRange(i),document.execCommand("delete",!1);const a=t.innerHTML;return document.body.removeChild(t),a}(Oo()))}),nr=(0,H.A)(()=>{tr(a.e0F)}),or=(0,H.A)(()=>{co({chatId:T,threadId:D,type:"scheduled",noForumTopicPanel:!0})}),ir=(0,H.A)(()=>{Co({forUserId:T})}),sr=(0,H.A)(()=>{Po({price:{currency:a.OUy,amount:0,nanos:0}})}),ar=(0,H.A)(()=>{const e=!Kn;Yo({chatId:T,isEnabled:e}),vo({localId:"silentPosting",icon:e?"mute":"unmute",message:Lo(`ComposerSilentPosting${e?"Enabled":"Disabled"}Tootlip`)})});(0,o.vJ)(()=>{Je&&p&&ps()},[Je,ps,p]),(0,o.vJ)(()=>{m&&(Ge?ys():setTimeout(()=>{Cs()},200))},[Ge,Cs,ys,m]);const rr=(0,V.A)(()=>Boolean(Oo()),[Oo]),dr=ye&&"webApp"===dn?.type&&!w&&"thread"===ce,lr=dr&&!rr&&!Ss,cr=as||hs||Ls||gs||Js||Hs||ls||ii||Vs||ia||Us||lr||Ca||Boolean(Ss)||yi.length>0||ti,ur=cr&&!qe&&Ho&&!ii&&!hs,hr=(()=>{if(mn?.nextSendDate&&!(mn.nextSendDate<(0,F.Fm)()))return Lo("SlowModePlaceholder",{timer:(0,Ze.Y)(Ht.A,{endsAt:mn.nextSendDate,onEnd:qo})},{withNodes:!0})})(),mr=(0,o.Kr)(()=>Ss&&Go<=600?"":qi?Lo(Ho?"ComposerStoryPlaceholderLocked":"ComposerPlaceholderNoText"):hr||rt||ct||(xn?Lo("ComposerPlaceholderPaidMessage",{amount:(0,S.U2)(Lo,xn,{asFont:!0,className:"placeholder-star-icon"})},{withNodes:!0}):Qe&&et?Lo("ComposerPlaceholderCaption"):Mn?.activeUntil&&Ho&&Mn.activeUntil>(0,F.Fm)()?Lo("StealthModeComposerPlaceholder",{timer:(0,Ze.Y)(Ht.A,{endsAt:Mn.activeUntil,onEnd:qo})},{withNodes:!0}):he?.adminRights?.anonymous?Lo("ComposerPlaceholderAnonymous"):he?.isBotForum&&!pe?.canManageBotForumTopics&&D===s.l3?Lo("ComposerPlaceholderBotTopicGeneral"):he?.isForum&&!he.isBotForum&&he.isForumAsMessages&&D===s.l3?ge?Lo("ComposerPlaceholderTopic",{topic:ge.title}):Lo("ComposerPlaceholderTopicGeneral"):Lo(Pe?Kn?"ComposerPlaceholderBroadcastSilent":"ComposerPlaceholderBroadcast":"ComposerPlaceholder")),[Ss,rt,he,ct,Pe,qi,Ho,Kn,Lo,ge,Qe,D,Go,xn,et,hr,Mn?.activeUntil,pe?.canManageBotForumTopics]);(0,o.vJ)(()=>{cr?Zn?.():Xn?.()},[cr,Xn,Zn]);const{shouldRender:pr,transitionClassNames:gr}=(0,te.A)(ur),fr=!(Aa!==en.Record||Ni&&Ae&&Pi),vr=(0,H.A)(()=>{switch(Aa){case en.Forward:eo?.();break;case en.Send:Ua();break;case en.Record:fr?Ae?Pi||Ao({chatId:T,messageListType:ce}):vo({message:xo("VoiceMessagesRestrictedByPrivacy",he?.title)}):(Fs(!1),ws());break;case en.Edit:la();break;case en.Schedule:if(Ss&&bs(),!le)return;fi((e,t)=>{ja({},e,t,le,Ln?.id)})}}),Ar=new Date;Ar.setSeconds(0),Ar.setMilliseconds(0);const yr=new Date;yr.setFullYear(yr.getFullYear()+1);let Cr="SendMessage";switch(Aa){case en.Forward:Cr="Forward";break;case en.Edit:Cr="Save edited message";break;case en.Record:Cr=Ni?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const wr=(0,f.A)("Composer",!Ge&&"shown",As&&"hover-disabled",Ko&&"mounted",An),Ir=(0,H.A)(e=>{let t,n;if("emoji"===e.type&&(t=e.emoticon),"custom"===e.type){const o=(0,u.O8F)((0,i.mS)(),e.documentId);if(!o)return;if(!o.isFree&&!ve&&!Ce)return void va();const s=(0,k.Ay)((0,E.hB)(o));t=s.text,n=s.entities}Ji(to,{text:t,entities:n,isReaction:!0}),wo()}),br=(0,H.A)(e=>{No({chatId:T,threadId:D,reaction:e}),wo()}),Sr=(0,H.A)(e=>{yo({peerId:T,storyId:de,position:e,sendAsMessage:!0})}),Mr=(0,H.A)(()=>{const e=Sn?void 0:a.tNZ;Io({peerId:T,storyId:de,containerId:(0,d.$_)(T,de),reaction:e})}),Nr=(0,H.A)(()=>{fi((e,t)=>{ja({},e,t,le,void 0)})}),kr=(0,H.A)(()=>{Ji(Za)}),Yr=(0,H.A)(()=>{Ji(ja,{},a.NkL,void 0,le,Ln?.id)}),Fr=(0,H.A)((e,t,n)=>{fi((o,i)=>{Ji(ja,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n},o,i,le,void 0)})}),Pr=(0,H.A)((e,t,n)=>{Ji(Za,{sendCompressed:e,sendGrouped:t,isInvertedMedia:n})}),Tr=(0,H.A)(()=>{Mo({chatId:T,threadId:D,effectId:void 0})}),Dr=(0,H.A)(()=>{ko({})}),xr=(0,o.Kr)(()=>{switch(Aa){case en.Edit:return la;case en.Schedule:return Nr;default:return Ua}},[Aa,la,Ua]),Lr=ye&&"commands"===dn?.type&&!w&&!1!==tn&&!Ss,Er=Bn&&Ln?.emoticon,Br=Boolean(xn&&Aa===en.Send),Rr=(0,Q.A)(Br);return(0,Ze.FD)("div",{className:wr,children:[$o&&Ni&&m&&(0,Ze.Y)(Yt,{isOpen:n!==kt.I.None,withQuick:n===kt.I.QuickFile||Jo===kt.I.QuickFile,onHide:Qn,onFileSelect:ts,editingMessage:w}),pr&&!Bi&&(0,Ze.Y)(qt.A,{topReactions:Cn,allAvailableReactions:yn,onToggleReaction:Ir,isPrivate:!0,isReady:m,canBuyPremium:wn,isCurrentUserPremium:ve,isInSavedMessages:Ce,isInStoryViewer:Ho,canPlayAnimatedEmojis:In,onShowMore:Sr,className:gr}),(0,Ze.Y)(Xe,{chatId:T,threadId:D,canShowCustomSendMenu:ya,attachments:yi,getHtml:Oo,isReady:m,shouldForceCompression:Zi,shouldForceAsFile:Xi,isForCurrentMessageList:fe,isForMessage:$o,shouldSchedule:mi&&l,canSchedule:mi,forceDarkTheme:Ho,onCaptionUpdate:ns,onSendSilent:Pr,onSend:Ea,onSendScheduled:Fr,onFileAppend:es,onClear:os,onAttachmentsUpdate:is,onCustomEmojiSelect:Ga,onRemoveSymbol:nr,onEmojiSelect:er,editingMessage:w,onSendWhenOnline:Yr,canScheduleUntilOnline:h&&!Ys,paidMessagesStars:xn}),(0,Ze.Y)(xt,{isOpen:nt.isOpen,isQuiz:nt.isQuiz,shouldBeAnonymous:Pe,maxOptionsCount:Hn,onClear:so,onSend:_a}),(0,Ze.Y)(Rt,{modal:it,onClear:ro,onSend:Qa}),(0,Ze.Y)(Lt,{isOpen:gs,onClose:vs,chatId:T,selectedSendAsId:on,sendAsPeerIds:Wo,isCurrentUserPremium:ve}),(0,Ze.Y)(Tt,{isOpen:Js,filteredUsers:$s,onInsertUserName:qs,onClose:Gs}),(0,Ze.Y)(ft,{isOpen:ia,chatId:T,withUsername:Boolean(ui),botCommands:aa,quickReplies:ra,getHtml:Oo,self:Ct,quickReplyMessages:kn,onClick:Wa,onClose:sa}),(0,Ze.FD)("div",{className:(0,f.A)("composer-wrapper",Ho&&"with-story-tweaks",Bi&&"is-need-premium"),children:[!Bi&&(0,Ze.FD)("svg",{className:"svg-appendix",width:"9",height:"20",children:[(0,Ze.Y)("defs",{children:(0,Ze.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix",children:[(0,Ze.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Ze.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,Ze.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,Ze.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,Ze.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,Ze.Y)("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"})]})]}),$o&&(0,Ze.FD)(Ze.FK,{children:[(0,Ze.Y)(Pt,{isOpen:Hs,botId:Ws,isGallery:_s,inlineBotResults:Xs,switchPm:Qs,switchWebview:Zs,loadMore:na,isSavedMessages:Ce,canSendGifs:Mi,isCurrentUserPremium:ve,onSelectResult:Ha,onClose:ea}),(0,Ze.Y)(St,{onClear:Pa,shouldForceShowEditing:Boolean(ua&&w),chatId:T,threadId:D,messageListType:ce}),(0,Ze.Y)(Jt,{chatId:T,threadId:D,isDisabled:!Yi||wi||!rr,isEditing:Boolean(w)})]}),(0,Ze.FD)("div",{className:(0,f.A)("message-input-wrapper",Ya),style:Fa,children:[$o&&(0,Ze.FD)(Ze.FK,{children:[dr&&(0,Ze.Y)(gt,{isOpen:lr,text:dn.text,isDisabled:Boolean(Ss),onClick:za}),Lr&&(0,Ze.Y)(at.A,{className:(0,f.A)("bot-commands","composer-action-button"),round:!0,disabled:void 0===tn,color:"translucent",onActivate:Va,ariaLabel:"Open bot command keyboard",children:(0,Ze.Y)(ot.A,{name:"bot-commands-filled"})}),_o&&nn&&(0,Ze.Y)(ht.A,{round:!0,color:"translucent",onClick:gs?vs:Xa,ariaLabel:xo("SendMessageAsTitle"),className:(0,f.A)("send-as-button","composer-action-button",Ai.current&&"appear-animation"),children:(0,Ze.Y)(Qt.A,{peer:nn,size:"tiny"})})]}),(!qi||Mi||Si)&&!Bi&&!Gn&&(0,Ze.Y)(Bt.A,{chatId:T,threadId:D,isMobile:p,isReady:m,isSymbolMenuOpen:hs,openSymbolMenu:ms,closeSymbolMenu:ps,canSendStickers:Si,canSendGifs:Mi,isMessageComposer:$o,onGifSelect:qa,onStickerSelect:$a,onCustomEmojiSelect:Ja,onRemoveSymbol:tr,onEmojiSelect:Hi,closeBotCommandMenu:us,closeSendAsMenu:vs,isSymbolMenuForced:Qo,canSendPlainText:!qi,inputCssSelector:gn,idPrefix:e,forceDarkTheme:Ho}),(0,Ze.Y)(Dt.A,{ref:Eo,id:vn,editableInputId:fn,customEmojiPrefix:e,isStoryInput:Ho,chatId:T,canSendPlainText:!qi,threadId:D,isReady:m,isActive:!wi,getHtml:Oo,placeholder:mr,forcedPlaceholder:ta,canAutoFocus:m&&fe&&!wi&&$o,noFocusInterception:wi,shouldSuppressFocus:p&&hs,shouldSuppressTextFormatter:Ls||Js||Hs,onUpdate:Uo,onSend:xr,onSuppressedFocus:ps,onFocus:ni,onBlur:oi,isNeedPremium:Bi,messageListType:ce}),$o&&(0,Ze.FD)(Ze.FK,{children:[jt&&Boolean(Ws)&&(0,Ze.Y)($t.A,{color:"gray"}),(0,Ze.Y)(Wt.Ay,{className:"composer-action-buttons-container",slideClassName:"composer-action-buttons",activeKey:Number(rr),direction:"inverse",name:"slideFadeAndroid",children:!rr&&(0,Ze.FD)(Ze.FK,{children:[Pe&&(0,Ze.Y)(Wt.Ay,{className:"composer-action-button",name:"reveal",activeKey:Number(Kn),children:(0,Ze.Y)(ht.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:ar,ariaLabel:Lo(Kn?"AriaComposerSilentPostingDisable":"AriaComposerSilentPostingEnable"),iconName:Kn?"mute":"unmute"})}),ut&&(0,Ze.Y)(ht.A,{round:!0,faded:!0,className:"composer-action-button scheduled-button",color:"translucent",onClick:or,ariaLabel:Lo("AriaComposerOpenScheduled"),iconName:"scheduled"}),ga&&(0,Ze.Y)(ht.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:ir,iconName:"gift"}),fa&&(0,Ze.Y)(ht.A,{round:!0,faded:!0,className:"composer-action-button",color:"translucent",onClick:sr,iconName:"cash-circle"}),Boolean(st)&&!Ss&&!w&&(0,Ze.Y)(at.A,{className:(0,f.A)("composer-action-button",as&&"activated"),round:!0,color:"translucent",onActivate:rs,ariaLabel:Lo("AriaComposerBotKeyboard"),children:(0,Ze.Y)(ot.A,{name:"bot-command"})})]})})]}),Ss&&Boolean(Ms)&&(0,Ze.Y)("span",{className:"recording-state",children:(0,v.JW)(Ms-ks.current)}),!Bi&&(0,Ze.Y)(dt,{chatId:T,threadId:D,editingMessage:w,canEditMedia:ri,isButtonVisible:!Ss,canAttachMedia:Ni,canAttachPolls:ki,canAttachToDoLists:Fi,canSendPhotos:Li,canSendVideos:xi,canSendDocuments:Ei,canSendAudios:Di,onFileSelect:ts,onPollCreate:io,onTodoListCreate:Ka,isScheduled:l,attachBots:$o?ln:void 0,peerType:cn,shouldCollectDebugLogs:bn,theme:hn,onMenuOpen:si,onMenuClose:ai,messageListType:ce,paidMessagesStars:xn}),$o&&Boolean(st)&&(0,Ze.Y)(pt,{messageId:st,threadId:D,isOpen:as,onClose:ds}),$o&&tn&&(0,Ze.Y)(lt,{isOpen:ls,botCommands:tn,onClose:us}),(0,Ze.Y)(Mt.A,{chatId:T,isOpen:Us,onCustomEmojiSelect:zs,addRecentCustomEmoji:fo,onClose:Ks},`custom-emoji-tooltip-${fn}`),(0,Ze.Y)(Et,{chatId:T,threadId:D,isOpen:Vs,onStickerSelect:$a,onClose:js},`sticker-tooltip-${fn}`),(0,Ze.Y)(Ft.A,{isOpen:Ls,emojis:Bs,customEmojis:Rs,addRecentEmoji:uo,addRecentCustomEmoji:fo,onEmojiSelect:Os,onCustomEmojiSelect:Os,onClose:Es},`emoji-tooltip-${fn}`)]})]}),Nn&&Ss&&(0,Ze.FD)(ht.A,{className:(0,f.A)("view-once",Ys&&"active"),round:!0,color:"secondary",ariaLabel:xo("Chat.PlayOnceVoiceMessageTooltip"),onClick:Ps,children:[(0,Ze.Y)(ot.A,{name:"view-once"}),(0,Ze.Y)(ot.A,{name:"one-filled"})]}),Ss&&(0,Ze.Y)(ht.A,{round:!0,color:"danger",className:"cancel",onClick:Is,ariaLabel:"Cancel voice recording",iconName:"delete"}),Ho&&!Ss&&(0,Ze.FD)(ht.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:Mr,onContextMenu:Ma,onMouseDown:Na,ariaLabel:xo("AccDescrLike"),ref:Ro,children:[Sn&&(0,Ze.Y)(Xt.A,{containerId:(0,d.$_)(T,de),reaction:Sn,withEffectOnly:pi},(0,d.Jj)(Sn)),(!Sn||pi)&&(0,Ze.Y)(ot.A,{name:"heart",className:(0,f.A)(pi&&"story-reaction-heart")})]}),(0,Ze.FD)(ht.A,{ref:Ns,round:!0,color:"secondary",className:(0,f.A)(Aa,"main-button",!m&&"not-ready",Ss&&"recording"),disabled:fr,allowDisabledClick:!0,noFastClick:!0,ariaLabel:xo(Cr),onClick:vr,onContextMenu:Aa===en.Send&&ya?wa:void 0,children:[(0,Ze.Y)(ot.A,{name:"send"}),(0,Ze.Y)(ot.A,{name:"microphone-alt"}),eo&&(0,Ze.Y)(ot.A,{name:"forward"}),$o&&(0,Ze.Y)(ot.A,{name:"schedule"}),$o&&(0,Ze.Y)(ot.A,{name:"check"}),(0,Ze.Y)(ht.A,{className:(0,f.A)("paidStarsBadge",Br&&"visible",Rr&&!Br&&"hiding",!Rr&&!Br&&"hidden"),nonInteractive:!0,size:"tiny",color:"stars",pill:!0,fluid:!0,children:(0,Ze.FD)("div",{className:"paidStarsBadgeText",children:[(0,Ze.Y)(ot.A,{name:"star"}),(0,Ze.Y)(_t.A,{ref:Bo,text:Lo.number(Ui)})]})})]}),Er&&(0,Ze.Y)("span",{className:"effect-icon",onClick:Tr,children:(0,R.A)(Er)}),Ln&&Rn&&(0,Ze.Y)(Gt.A,{shouldPlay:On,effect:Ln,onStop:Dr}),ya&&(0,Ze.Y)(Nt.A,{isOpen:Ca,canSchedule:mi&&$o&&!Ys,canScheduleUntilOnline:h&&!Ys,onSendSilent:Ce?void 0:kr,onSendSchedule:l?void 0:Nr,onSendWhenOnline:Yr,onRemoveEffect:Tr,onClose:Ia,onCloseAnimationEnd:ba,isSavedMessages:Ce,chatId:T,withEffects:Bn,hasCurrentEffect:Boolean(Ln),effectReactions:En,allAvailableReactions:yn,onToggleReaction:br,isCurrentUserPremium:ve,isInSavedMessages:Ce,isInStoryViewer:Ho,canPlayAnimatedEmojis:In}),vi,(0,Ze.Y)(Zt.A,{isOpen:zn,onClose:Ki,userName:he?(0,c.F9)(Lo,he):void 0,messagePriceInStars:xn||0,messagesCount:Oi,shouldAutoApprove:Vi,setAutoApprove:ji,confirmHandler:zi})]})}))},31880(e,t,n){n.d(t,{A:()=>m,a:()=>l});var o=n(13439),i=n(11597),s=n(87894),a=n(42215);const r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],d=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],l=[];if("included"===t){const{includedChatIds:t,...o}=n?e.includeFilters||{}:(0,s.Up)(e.folder,r);a=t||[],l=Object.keys(o).filter(e=>Boolean(o[e]))}else{const{excludedChatIds:t,...o}=n?e.excludeFilters||{}:(0,s.Up)(e.folder,d);a=t||[],l=Object.keys(o).filter(e=>Boolean(o[e]))}const c=(0,o.mS)();return{selectedChatIds:a.filter(e=>(0,i.hds)(c,e)),selectedChatTypes:l}}function c(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||t?.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:{text:""},includedChatIds:[],excludedChatIds:[]}},h=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:"string"==typeof t.payload?{...e.folder.title,text:t.payload}:{...e.folder.title,...t.payload}},isTouched:!0};case"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,s.Up)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,s.Up)(e.folder,d)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,s.cJ)(e.folder,r),title:e.folder.title?e.folder.title:{text:c(e.includeFilters)},...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,s.cJ)(e.folder,d),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"setColor":return{...e,folder:{...e.folder,color:t.payload},isTouched:!0};case"setEmoticon":return{...e,folder:{...e.folder,emoticon:t.payload},isTouched:!0};case"reset":return u;default:return e}},m=()=>(0,a.A)(h,u)},34458(e,t,n){n.d(t,{$:()=>v,UG:()=>c,wV:()=>f});var o=n(31481),i=n(66644),s=n(19822),a=n(83868),r=n(76023),d=n(2429),l=n(17169);const c=250,u=.25*r.$,h=11,m=.1875*r.$,p=.125*r.$,g=new Set;function f(e){b();const{container:t,toggler:n,leftMainHeader:a,ribbonPeers:r,toggleAvatars:d,sidebar:p}=A(e);if(!(n&&d&&r&&t&&a))return;const{bottom:f,right:v}=a.getBoundingClientRect(),S=f+u,M=p?p.getBoundingClientRect().width:0,N=d[0],k=d[d.length-1],Y=C(N);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===Y;let p=w(n,d),f=h+a+1;if(p||(p=a===r-1?k:N,f=h),!p)return;let{top:A,left:b,width:F}=p.getBoundingClientRect();b-=M;const P=e.getBoundingClientRect(),T=P.left-M,D=P.width;if(T>v)return;b-=m,F+=2*m;const x=b-T,L=A-S,E=F/D;A-=m;const B=T-b+2*m,R=S-A+m,O=D/(F+2*m);(0,i.RK)(()=>{if(!p)return;const n=y(e);let a;f>h?(a=y(p),u&&a.classList.add(l.A.ghostLast)):n.classList.add(l.A.ghostAnimateName),(0,s.ZM)(n,{top:`${S}px`,left:`${T}px`,zIndex:String(f),opacity:a?"0":"",transform:`translate3d(${x}px, ${L}px, 0) scale(${E})`}),a&&(0,s.ZM)(a,{top:`${A}px`,left:`${b}px`,zIndex:String(f)}),t.appendChild(n),a&&t.appendChild(a),p.classList.add("animating"),e.classList.add("animating"),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:"",transform:""}),a?(0,s.ZM)(a,{opacity:"0",transform:`translate3d(${B}px, ${R}px, 0) scale(${O})`}):n.classList.add(l.A.ghostRevealName);const r=I(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),p?.classList.remove("animating"),e.classList.remove("animating"),g.delete(r)})},c+o.xB5);g.add(r)})})})}function v(e){b();const{container:t,toggler:n,toggleAvatars:a,ribbonPeers:r,leftMainHeader:d,sidebar:u}=A(e);if(!(n&&a&&r&&t&&d))return;const{right:f}=d.getBoundingClientRect(),v=u?u.getBoundingClientRect().width:0,S=a[0],M=a[a.length-1],N=C(S);Array.from(r).reverse().forEach((e,a,{length:r})=>{const d=C(e);if(!d)return;const u=d===N;let A=w(n,d),b=h+a+1;if(A||(A=a===r-1?M:S,b=h),!A)return;const k=e.getBoundingClientRect(),Y=k.top,F=k.left-v,P=k.width;let{left:T,width:D,top:x}=A.getBoundingClientRect();if(T-=v,F>f)return;T-=m,D+=2*m;const L=T-F,E=x-Y-p,B=D/P;x-=m;const R=F-T+2*m,O=Y-x+m,U=P/(D+2*m);(0,i.RK)(()=>{const n=y(e);let a;b>h?(a=y(A),u&&a.classList.add(l.A.ghostLast)):n.classList.add(l.A.ghostAnimateName,l.A.ghostRevealName),(0,s.ZM)(n,{top:`${Y}px`,left:`${F}px`,width:`${P}px`,zIndex:String(b)}),a&&(0,s.ZM)(a,{top:`${x}px`,left:`${T}px`,zIndex:String(b),opacity:"0",transform:`translate3d(${R}px, ${O}px, 0) scale(${U})`}),e.classList.add("animating"),A.classList.add("animating"),t.appendChild(n),a&&t.appendChild(a),(0,i.RK)(()=>{(0,s.ZM)(n,{opacity:a?"0":"",transform:`translate3d(${L}px, ${E}px, 0) scale(${B})`}),a?(0,s.ZM)(a,{opacity:"",transform:""}):n.classList.remove(l.A.ghostRevealName);const r=I(()=>{(0,i.RK)(()=>{t.contains(n)&&t.removeChild(n),a&&t.contains(a)&&t.removeChild(a),e.classList.remove("animating"),A.classList.remove("animating")}),g.delete(r)},c+o.xB5);g.add(r)})})})}function A(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),o=t.querySelector("#StoryRibbon"),i=t.querySelector(".left-header"),s=o?.querySelectorAll(`.${d.A.peer}`),a=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:i,ribbonPeers:s,toggleAvatars:a,sidebar:document.getElementById("FoldersSidebar")}}function y(e){const t=e.cloneNode(!0);t.classList.add(l.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=a.A;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function C(e){return e?.getAttribute("data-peer-id")}function w(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function I(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function b(){g.forEach(e=>e()),g.clear()}},35127(e,t,n){n.d(t,{Ay:()=>a,ej:()=>s,nP:()=>r,yA:()=>d});var o=n(76023);const i=12*o.$,s=5*o.$;function a(e){return(e?14:20)*o.$}function r(e="",t,n){return e.length>40||n?a(t):i}function d({media:e,messageText:t,isOwn:n,isInWebPage:i,asForwarded:a,noAvatars:d,isMobile:l}){const c="photo"===e.mediaType,u="video"===e.mediaType,h=c&&i,m=u&&i,{width:p,height:g}=c?(0,o.ck)(e,n,a,h,d,l):u?(0,o.rO)(e,n,a,m,d,l):(0,o.ri)(e,n,a,i,d,l),f=r(t,l);let v=1;p<f&&f-p<12&&(v=f/p),g*v<s&&s-g*v<12&&(v=s/g);const A=Math.round(p*v),y=Math.round(g*v);return{width:A,height:y,isSmall:A<f||y<s}}},35749(e,t,n){n.d(t,{A:()=>a});var o=n(77312),i=n(63527);function s(e){return e.messages.webPageById}function a(e,t){const n=(0,i.Ay)(s);if(!e)return;const a=e.content.webPage?.id,r=a?n[a]:void 0;return(0,o.EO)(e,{webPage:r},t)}},36353(e,t,n){n.d(t,{A:()=>i});var o=n(96454);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),s=document.createRange(),a=e.lastChild||e;o.TF||n||a&&a.nodeValue?(s.selectNodeContents(n?e:a),s.collapse(!1),i.removeAllRanges(),i.addRange(s)):e.focus()}},36680(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(96454),s=n(17712);let a;function r(e,t,n=250,r=!1){const d=(0,o.li)(!1),l=(0,s.A)(()=>{d.current=!0});return(0,o.vJ)(()=>{a&&(clearTimeout(a),a=void 0),!e||i.TF||r||(a=window.setTimeout(()=>{d.current||t()},2*n))},[r,e,n,t]),[(0,s.A)(()=>{d.current=!0}),(0,s.A)(()=>{d.current=!1,a&&(clearTimeout(a),a=void 0),a=window.setTimeout(()=>{d.current||t()},n)}),l]}},37378(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(87357),d=n(17663),l=n(58849),c=n(49086),u=n(4961),h=n(39351),m=n(17712),p=n(59030),g=n(96530),f=n(81524),v=n(84685),A=n(20021);const y=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,a.Pn$)(e,t)}))(({message:e,webPage:t,senderTitle:n,isProtected:i,observeIntersection:a,onMessageClick:y})=>{const C=(0,h.A)(),w=(0,p.A)(),I=(0,m.A)(()=>{y(e)});let b=t;if(!b){const t=(0,s.ZD)(e);if(t){const{url:n,domain:o}=t;b={mediaType:"webpage",webpageType:"full",id:"",displayUrl:n,siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,s.BN)(C,e)?.text!==n?(0,c.C)(C,e,void 0,void 0,170):void 0}}}const S="full"===b?.webpageType?b:void 0,{url:M}=b||{},N=(0,o.Kr)(()=>(0,s.BN)(C,e)?.text!==M?(0,c.C)(C,e,void 0,void 0,170):void 0,[C,e,M]),{siteName:k,displayUrl:Y,title:F,description:P,formattedDescription:T=N,photo:D,video:x}=S||{},L=(0,o.Kr)(()=>{const e=F||k||Y;if(e)return e;if(!M)return"";try{return new URL(M).hostname}catch(e){return""}},[F,k,Y,M]);if(!M)return;const E=!n&&P&&(0,l.A)(P,170),B=(0,r.A)("WebLink scroll-item",!D&&!x&&"without-media"),R=Y||M.replace("mailto:","");return(0,A.FD)("div",{className:B,"data-initial":L[0],dir:C.isRtl?"rtl":void 0,children:[D&&(0,A.Y)(f.A,{message:e,isProtected:i,observeIntersection:a}),(0,A.FD)("div",{className:"content",children:[(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-title",onClick:I,children:(0,u.A)(L)}),(E||T)&&(0,A.Y)(g.A,{isRtl:C.isRtl,className:"site-description",onClick:I,children:T||E&&(0,u.A)(E)}),(0,A.Y)(v.A,{url:M,className:"site-name",text:R,isRtl:C.isRtl}),n&&(0,A.Y)("div",{className:"sender-name",children:(0,u.A)(n)})]}),n&&(0,A.Y)("div",{className:"message-date",children:(0,A.Y)(g.A,{className:"date",onClick:I,isRtl:C.isRtl,children:(0,d.be)(w,1e3*e.date)})})]})}))},37830(e,t,n){n.d(t,{A:()=>s});var o=n(87894);const i=new WeakMap;function s(e){return(...t)=>{const n=i.get(e);if(n&&(0,o.k)(n.lastArgs,t))return n.lastResult;const s=e(...t);return i.set(e,{lastArgs:t,lastResult:s}),s}}},37959(e,t,n){n.d(t,{E5:()=>o.E5,IP:()=>o.IP});var o=n(79882)},38102(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(87412),s=n(76471),a=n(20021);const r=(0,o.ph)(({topic:e,className:t,letterClassName:n,size:o,noLoopLimit:r,observeIntersection:d,onClick:l})=>e.iconEmojiId&&"0"!==e.iconEmojiId?(0,a.Y)(i.A,{documentId:e.iconEmojiId,className:t,size:o,observeIntersectionForPlaying:d,loopLimit:r?void 0:2,onClick:l}):(0,a.Y)(s.A,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:l}))},38218(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(17712);const s=function({onClick:e,onStart:t,onEnd:n,threshold:s=250}){const a=(0,o.li)(!1),r=(0,o.li)(!1),d=(0,o.li)(void 0),l=(0,i.A)(e=>{const n="button"in e&&0===e.button||"touches"in e&&e.touches.length>0;!r.current&&n&&(r.current=!0,d.current=window.setTimeout(()=>{t?.(),a.current=!0},s))}),c=(0,i.A)(t=>{r.current&&(a.current?n?.():e?.(t),u())}),u=(0,i.A)(()=>{a.current=!1,r.current=!1,window.clearTimeout(d.current)});return(0,o._W)(()=>{window.clearTimeout(d.current)}),{onMouseDown:l,onMouseUp:c,onMouseLeave:c,onTouchStart:l,onTouchEnd:c}}},38353(e,t,n){n.d(t,{A:()=>o});const o={background:"LzylDSXD",customBgImage:"iBGWkDsW",customBgColor:"HnpqkkHj",withTransition:"V96TOnoY",blurred:"K_W7XNrk",withRightColumn:"EiMC9Ymb"}},39074(e,t,n){n.d(t,{DY:()=>d,JC:()=>a,LV:()=>s,oR:()=>i,vZ:()=>r});const o=document.createElement("div");function i(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),i=o.lastChild;n.insertNode(o),i?(n.setStartAfter(i),n.setEndAfter(i)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const i=n.getRangeAt(0).cloneRange();return i.intersectsNode(e)?t||e.contains(i.commonAncestorContainer)?(i.collapse(!0),i.setStart(e,0),o.innerHTML="",o.appendChild(i.cloneContents()),o.innerHTML):"":e.innerHTML}function a(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),i=o.cloneRange();return i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),t=i.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),o=window.getSelection();return e.setStart(n,t),e.collapse(!0),o.removeAllRanges(),o.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function d(){const e=window.getSelection();e?.removeAllRanges()}},40175(e,t,n){n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(31481),a=n(11597),r=n(34458),d=n(39351),l=n(34201),c=n(92111),u=n(21849),h=n(17169),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:o},byPeerId:i}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,a.nTw)(e),d=(0,a.clw)(e),l=(0,a.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:o,isShown:t?!r:!s,isForumPanelOpen:d,withAnimation:l,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:i}})(function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:a,canShow:p,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:A,peerStories:y}){const{toggleStoryRibbon:C}=(0,i.ko)(),w=(0,d.A)(),I=(0,o.Kr)(()=>1===t.length?[n[t[0]]||a[t[0]]]:t.map(e=>n[e]||a[e]).filter(t=>t&&t.id!==e).slice(0,s.dqH).reverse(),[e,t,n,a]),b=(0,o.Kr)(()=>I?.length?I.reduce((e,t)=>{const n=y[t.id];if(!n)return e;const o=n.orderedIds.some(e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const o=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!o});return e[t.id]=o,e},{}):{},[y,I]),S=(0,o.Kr)(()=>t.slice(0,5),[t]);(0,c.A)(S);const M=p&&g,{ref:N,shouldRender:k}=(0,l.A)({isOpen:M,className:"slow",withShouldRender:!0});if((0,o.vJ)(()=>{A&&!f&&(M?((0,o.VK)(r.UG+s.xB5),(0,r.$)(v)):((0,o.VK)(r.UG+s.xB5),(0,r.wV)(v)))},[v,M,A,f]),k)return(0,m.Y)("button",{ref:N,type:"button",id:"StoryToggler",className:h.A.root,"aria-label":w("AriaStoryTogglerOpen"),onClick:()=>C({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0,children:I.map(e=>(0,m.Y)(u.A,{peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:b[e.id]},e.id))})}))},40435(e,t,n){n.d(t,{A:()=>s});var o=n(41074);const i={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function s(e,t,n,s,a){return s?Promise.resolve(i[a||"light"][t?"outgoing":"incoming"]):(0,o.M1)({name:"offscreen-canvas:getAppendixColorFromImage",args:[e,t]},Math.round(n)%o.bP)}},41074(e,t,n){n.d(t,{Ay:()=>r,M1:()=>d,bP:()=>s});var o=n(31481),i=n(5130);const s=Math.min(navigator.hardwareConcurrency||4,4);let a;function r(){return o.W75?[]:(a||(a=new Array(s).fill(void 0).map(()=>{const e=new Worker(new URL(n.p+n.u(6805),n.b));return{worker:e,connector:(0,i.U)(e,void 0,"media")}})),a)}function d(e,t){return r()[t].connector.request(e)}},41316(e,t,n){n.d(t,{A:()=>i});var o=n(84051);function i(e){const[t,n]=(0,o.Ul)();return(0,o.vJ)(()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const o=t.getRangeAt(0);if(!o)return;if(!document.querySelector(e))return;const{commonAncestorContainer:i}=o;(i instanceof Element?i:i.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,n]),t}},41510(e,t,n){n.d(t,{I:()=>y,A:()=>C});var o=n(84051),i=n(13439),s=n(90709),a=n(87357),r=n(11778),d=n(55153),l=n(45761),c=n(39351),u=n(17712),h=n(73767),m=n(50680),p=n(3325),g=n(37661),f=n(18276),v=n(20021);const A=(0,o.ph)(({isQuick:e,isGeneric:t,onFileSelect:n})=>{const i=(0,o.li)(),s=(0,c.A)(),[r,d,l]=(0,g.A)(),h=(0,u.A)(e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),l()}),m=(0,a.A)("DropTarget",r&&"hovered");return(0,v.FD)("div",{className:m,ref:i,onDrop:n,onDragEnter:d,onDragLeave:h,"data-dropzone":!0,children:[(0,v.Y)("svg",{className:"target-outline-container",children:(0,v.Y)("rect",{className:"target-outline",x:"0",y:"0",width:"100%",height:"100%",rx:"8"})}),(0,v.FD)("div",{className:"target-content",children:[(0,v.Y)(f.A,{name:e?"photo":"document"}),(0,v.Y)("div",{className:"title",children:s("FileDropZoneTitle")}),!t&&(0,v.Y)("div",{className:"description",children:s(e?"FileDropZoneQuick":"FileDropZoneNoCompression")})]})]})});let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const C=(0,o.ph)(({isOpen:e,withQuick:t,editingMessage:n,onHide:g,onFileSelect:f})=>{const y=(0,c.A)(),{showNotification:C,updateAttachmentSettings:w}=(0,i.ko)(),I=(0,o.li)(),b=(0,h.A)(t),{shouldRender:S,transitionClassNames:M}=(0,m.A)(e);(0,o.vJ)(()=>e?(0,r.A)(g):void 0,[e,g]);const N=(0,u.A)(async e=>{const{dataTransfer:o}=e;let i=[];if(!(o.files&&o.files.length>0)||o.items&&o.items.length){if(o.items&&o.items.length>0){const e=await(0,l.A)(o.items);e?.length&&(i=i.concat(e))}}else i=i.concat(Array.from(o.files));if(n){if(i.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})});if(1===i.length){const e=await(0,d.A)(i[0].name,i[0]);if(!(n&&e&&(0,s.eh)(n,e)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:i.length})})}}g(),w({shouldCompress:!t&&void 0}),f(i)}),k=(0,u.A)(async e=>{const{dataTransfer:t}=e;if(t.files&&t.files.length>0){const e=Array.from(t.files);if(n){if(e.length>1)return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})});if(1===e.length){const t=await(0,d.A)(e[0].name,e[0]);if(!(n&&t&&(0,s.eh)(n,t)))return void C({message:y("MediaReplaceInvalidError",void 0,{pluralValue:e.length})})}}g(),w({shouldCompress:!0}),f(e)}}),Y=(0,u.A)(e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(I.current=window.setTimeout(()=>{g()},150))});if(!S)return;const F=t||b,P=(0,a.A)("DropArea",M);return(0,v.Y)(p.A,{containerSelector:"#middle-column-portals",children:(0,v.FD)("div",{className:P,onDragLeave:Y,onDragOver:()=>{I.current&&window.clearTimeout(I.current)},onDrop:g,onClick:g,children:[(0,v.Y)(A,{onFileSelect:N,isGeneric:!F}),F&&(0,v.Y)(A,{onFileSelect:k,isQuick:!0})]})})})},42215(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(30857);function s(e,t){const n=(0,i.A)(),s=(0,o.li)(e),a=(0,o.li)(t),r=(0,o.hb)(e=>(a.current=s.current(a.current,e),n(),a.current),[]);return[a.current,r]}},42827(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(87357),s=n(14957),a=n(4961),r=n(59030),d=n(50680),l=n(64489),c=n(20021);const u=(0,o.ph)(({text:e="Nothing found.",description:t,withSticker:n})=>{const o=(0,r.A)(),{transitionClassNames:u}=(0,d.A)(!0);return(0,c.FD)("div",{className:(0,i.A)("NothingFound",u,t&&"with-description",n&&"with-sticker"),children:[n&&(0,c.Y)(l.A,{className:"sticker",size:120,tgsUrl:s.w.DuckNothingFound,previewUrl:s.d.DuckNothingFound,nonInteractive:!0,noLoop:!1}),e,t&&(0,c.Y)("p",{className:"description",children:(0,a.A)(o(t),["br"])})]})})},45318(e,t,n){e.exports=n.p+"GiftStar.59a3e3598fdbab13b181.svg"},45761(e,t,n){n.d(t,{A:()=>i});var o=n(87679);async function i(e){const t=[];function n(e,o){return new Promise(i=>{if(e instanceof File)t.push(e),i(e);else if(e.isFile){const n=o.getAsFile();e.file(e=>{t.push(e),i(e)},()=>{n&&t.push(n),i(n)})}else e.isDirectory&&e.createReader().readEntries(e=>{const t=[];for(let i=0;i<e.length;i++)t.push(n(e[i],o));i(Promise.all(t))})})}const i=[];for(let t=0;t<e.length;t++){const o=e[t];if("file"===o.kind){const e=o.webkitGetAsEntry()||o.getAsFile();e&&i.push(n(e,o))}}return await Promise.all(i),(0,o.kc)(t)}},46051(e,t,n){n.d(t,{G:()=>o,w:()=>i});const o="video/mp4; codecs=hvc1.1.6.L63.00",i="video/mp4; codecs=avc1.64001E"},46442(e,t,n){n.d(t,{A:()=>dt});var o=n(84051),i=n(61433),s=n(13439),a=n(23174),r=n(89925),d=n(31481),l=n(66644),c=n(90709),u=n(11597),h=n(21133),m=n(19408),p=n(96115),g=n(81954),f=n(96454),v=n(87357),A=n(48899),y=n(87894),C=n(60343),w=n(9718),I=n(37836),b=n(16460),S=n(76023),M=n(17663);function N(e){return"albumId"in e}function k(e,t,n,o,i){let s;const a=[{originalDate:e[0].date,datetime:(0,M.CS)(1e3*e[0].date),senderGroups:[[]]}];return e.forEach((r,d)=>{const l=a[a.length-1],u=l.senderGroups[l.senderGroups.length-1];r.isInAlbum?s?(s.messages.push(r),r.hasComments&&(s.commentsMessage=r),r.content.text&&!s.hasMultipleCaptions&&(s.captionMessage?(s.hasMultipleCaptions=!0,s.captionMessage=void 0):s.captionMessage=r)):s={albumId:r.groupedId,messages:[r],mainMessage:r,hasMultipleCaptions:!1}:(r.content.paidMedia?.extendedMedia.length||0)>1?u.push({albumId:`paid-${r.id}`,messages:[r],mainMessage:r,hasMultipleCaptions:!1,isPaidMedia:!0}):u.push(r);const h=e[d+1];!s||h&&h.groupedId&&h.groupedId===s.albumId||(u.push(s),s=void 0);const m=u[u.length-1];if(h&&!s){const e=(0,M.CS)(1e3*h.date);if(l.datetime!==e){const t={originalDate:h.date,datetime:e,senderGroups:[[]]};a.push(t)}else(h.id===t||r.senderId!==h.senderId||!i&&r.paidMessageStars||h.suggestedPostInfo||r.isOutgoing!==h.isOutgoing||r.postAuthorTitle!==h.postAuthorTitle||(0,c._P)(r)&&"phoneCall"!==r.content.action?.type||(0,c._P)(h)&&"phoneCall"!==h.content.action?.type||r.inlineButtons||h.inlineButtons||h.date-r.date>600||n&&(r.id===n||m&&"mainMessage"in m&&m.mainMessage?.id===n)&&h.id!==n||o&&r.forwardInfo?.fromId!==h.forwardInfo?.fromId)&&l.senderGroups.push([])}}),a}var Y=n(32332),F=n(54464),P=n(32625),T=n(82117),D=n(17712),x=n(37859),L=n(81686),E=n(2178);var B=n(41257),R=n(35297),O=n(61157),U=n(93545),K=n(37661),z=n(56133);var V=n(52745),j=n(41036),J=n(59030),G=n(82855);var q=n(20021);const $=(0,o.ph)((0,s.EK)((e,{userId:t})=>{const{stickers:n}=e.stickers.greeting,o=(0,u.hds)(e,t);if(!o)return{};const i=(0,u.mBe)(e,t),s=(0,u.vGo)(e,t),{unreadCount:r}=(0,p.a1)(e,o.id,a.l3)||{},d=(0,u.ZZX)(e,o.id);return{defaultStickers:n,lastMessageId:r?d:void 0,connectionState:e.connectionState,currentMessageList:(0,u.Xf0)(e),businessIntro:s?.businessIntro,user:i}})(({defaultStickers:e,connectionState:t,lastMessageId:n,currentMessageList:i,businessIntro:a,user:r})=>{const{loadGreetingStickers:d,sendMessage:l,markMessageListRead:u}=(0,s.ko)(),h=(0,J.A)(),m=(0,o.li)(),p=(0,o.Kr)(()=>{if(a?.sticker)return a.sticker;if(!e?.length)return;const t=Math.floor(Math.random()*e.length);return e[t]},[a?.sticker,e]);(0,o.vJ)(()=>{e?.length||"connectionStateReady"!==t||d()},[t,d,e]),(0,o.vJ)(()=>{"connectionStateReady"===t&&n&&u({maxId:n})},[t,n]);const g=(0,D.A)(()=>{i&&l({sticker:{...p,isPreloadedGlobally:!0},messageList:i})}),f=a?.title||h("Conversation.EmptyPlaceholder"),v=a?.description||h("Conversation.GreetingText");return(0,q.FD)("div",{className:"osdROIcA",children:[(0,q.FD)("div",{className:"c3NtU3JZ",children:[(0,q.Y)("p",{className:"n2KO1cAv",dir:"auto",children:f}),(0,q.Y)("p",{className:"MVSedxKc",dir:"auto",children:v}),(0,q.Y)("div",{ref:m,className:"qsfxNv7L",onClick:g,children:p&&(0,q.Y)(G.A,{containerRef:m,sticker:p,size:160,shouldLoop:!0})})]}),a&&(0,q.Y)("div",{className:"WIbO6rja",children:h("Chat.EmptyStateIntroFooter",(0,c.Yg)(r))})]})}));var H=n(95807),W=n(52491),_=n(64713),Q=n(83868),Z=n(4961),X=n(39351),ee=n(62587),te=n(26875),ne=n(18276),oe=n(92108),ie=n(96530),se=n(65843),ae=n(55158);const re="ubFGDy3d",de="kpMdEhns",le="mtKNWJmZ",ce="BH_g_jqY",ue=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const{countryList:{phoneCodes:n}}=e,o=(0,u.hds)(e,t),i=(0,u.vGo)(e,t),s=(0,u.Ua4)(e,t);let a,r=!1;return(0,u.yps)(e,t)&&(i?a=i.botInfo:r=!0),{chat:o,userFullInfo:i,botInfo:a,isLoadingFullUser:r,phoneCodeList:n,commonChats:s}})(({chat:e,chatId:t,botInfo:n,isLoadingFullUser:i,phoneCodeList:a,commonChats:r,userFullInfo:d,hasMessages:l})=>{const{loadCommonChats:h,openChatWithInfo:m}=(0,s.ko)(),p=(0,J.A)(),g=(0,X.A)(),{phoneCountry:f,registrationMonth:A,nameChangeDate:y,photoChangeDate:C}=d?.settings||{};(0,o.vJ)(()=>{h({userId:t})},[t]);const w=(0,o.Kr)(()=>{if(a&&f)return(0,_.gH)(a,f)},[a,f]),I=(0,ee.A)(n?.photo?(0,c.Fi)(n.photo):void 0),b=(0,ee.A)(n?.gif?(0,c.sC)(n.gif,"full"):void 0),S=n?.photo?(0,c.Xn)(n.photo):n?.gif?(0,c.NZ)(n.gif):void 0,N=n&&!n.description&&!n.gif&&!n.photo,k=!w||!A,Y=(0,c.Rl)(t),{width:F,height:P}=S||{},T=(0,D.A)(e=>{(0,Q.A)(e),m({id:t,shouldReplaceHistory:!0,profileTab:"commonChats",forceScrollProfileTab:!0})}),x=y&&e?(0,q.Y)("div",{className:"local-action-message",children:(0,q.Y)("span",{children:g("UserUpdatedName",{user:e.title,time:(0,M.vm)(g,y)},{withNodes:!0,withMarkdown:!0})})},"security-name-message"):void 0,L=C&&e?(0,q.Y)("div",{className:"local-action-message",children:(0,q.Y)("span",{children:g("UserUpdatedPhoto",{user:e.title,time:(0,M.vm)(g,C)},{withNodes:!0,withMarkdown:!0})})},"security-photo-message"):void 0,E=(0,o.Kr)(()=>{const e=[];if(w&&e.push([p("PrivacyPhone"),(0,q.FD)("span",{className:"TYJGFKqJ",children:[(0,q.Y)("span",{className:"WuX68A65",children:(0,Z.A)((0,W.D0)(w?.iso2))}),w?.defaultName]})]),A&&e.push([g("ContactInfoRegistration"),(0,M.BR)(g.code,A)]),d?.commonChatsCount){const t=(0,s.mS)(),n=r?.ids.slice(0,3).map(e=>(0,u.PVB)(t,e)).filter(Boolean);e.push([g("ChatNonContactUserGroups"),(0,q.FD)(ie.A,{className:"yIJ4jRxH",onClick:T,children:[(0,q.Y)("span",{className:"_MPDNfhr",children:g("ChatGroups",{count:d.commonChatsCount},{pluralValue:d.commonChatsCount})}),Boolean(n?.length)&&(0,q.Y)(te.A,{size:"micro",peers:n}),(0,q.Y)(ne.A,{name:"next",className:"KYcoeDmo"})]})])}return e},[g,p,w,A,r,d]);return(0,q.FD)("div",{className:(0,v.A)("tFPZHCMt","empty"),children:[i&&k&&(0,q.Y)("span",{children:p("Loading")}),N&&k&&!i&&!l&&(0,q.Y)("span",{children:p("NoMessages")}),n&&(0,q.FD)("div",{className:(0,v.A)(re,"kXKBpNnb"),style:(0,H.A)(F?`width: ${F}px`:void 0),children:[I&&(0,q.Y)("img",{className:le,src:I,width:F,height:P,alt:"Bot info"}),b&&(0,q.Y)(se.A,{canPlay:!0,className:le,src:b,loop:!0,disablePictureInPicture:!0,muted:!0,playsInline:!0,style:(0,H.A)(Boolean(F)&&`width: ${F}px`,Boolean(P)&&`height: ${P}px`)}),S&&!I&&!b&&(0,q.Y)(ae.A,{className:le,width:F,height:P,forceAspectRatio:!0}),Y&&(0,q.Y)("div",{className:de,children:p("VerifyChatInfo")}),!Y&&n.description&&(0,q.FD)("div",{className:de,children:[(0,q.Y)("p",{className:"H__cBlx8",children:p("BotInfoTitle")}),(0,Z.A)(n.description,["br","emoji","links"])]})]}),!k&&e&&(0,q.FD)("div",{className:(0,v.A)(re,"niS9Gfcl"),children:[(0,q.Y)("h3",{className:"RyB2zw9K",children:(0,Z.A)((0,c.Js)(g,e))}),(0,q.Y)("p",{className:(0,v.A)("n9OcHdnh",ce),children:g("ChatNonContactUserSubtitle")}),(0,q.Y)(oe.A,{keyClassName:ce,data:E}),!e?.isVerified&&(0,q.FD)("div",{className:(0,v.A)("sCB3zhO3",ce),children:[(0,q.Y)(ne.A,{name:"info-filled"}),(0,q.Y)("p",{className:"dlaTjW_s",children:g("ContactInfoNotVerified")})]})]}),x,L]})}));var he=n(70636),me=n(17142),pe=n(48775),ge=n(4262),fe=n(83414),ve=n(73767),Ae=n(43874),ye=n(5912);const Ce=f.Ni?1e3:350;var we=n(63988),Ie=n(16581),be=n(5718),Se=n(59118),Me=n(89966),Ne=n(10722),ke=n(34201),Ye=n(21849),Fe=n(71429),Pe=n(24433);const Te="FHxnbOg6",De=(0,o.ph)((0,s.EK)((e,t)=>{const{message:n,withAvatar:o}=t,{chatId:i}=n,s=(0,u.hds)(e,i),a=(0,u.nZ4)(e,i),r=(0,c.DX)(i),d=(0,c.Qe)(i),l=!a&&(0,c.zP)(n),h=o||l;return{sender:(0,u.Y7C)(e,n),canShowSender:h,originSender:(0,u.Szq)(e,n),isChatWithSelf:a,isRepliesChat:r,isAnonymousForwards:d,isChannel:s&&(0,c.WX)(s)}})(({message:e,withAvatar:t,children:n,id:i,appearanceOrder:a,sender:r,canShowSender:l,originSender:u,isChatWithSelf:h,isRepliesChat:m,isAnonymousForwards:p,isChannel:g,canPost:f})=>{const{openChat:A,updateInsertingPeerIdMention:y,openMiddleSearch:C}=(0,s.ko)(),{forwardInfo:w}=e,I=l?r:void 0,b=(0,X.A)(),S=a<=0,[M,N]=(0,K.A)(S);(0,o.vJ)(()=>{S||setTimeout(N,a*d.zq7)},[a,N,S]);const k=w&&(h||m||p||!I)?u:I,Y=k&&(0,he.mO)(k),F=(0,D.A)(()=>{k&&A({id:k.id})}),P=(0,D.A)(()=>{k&&document.querySelector(d.m$5)&&y({peerId:k.id})}),T=(0,D.A)(()=>{k&&C({fromPeerId:k.id})}),x=(0,D.A)(()=>{F()}),{ref:L,shouldRender:E}=(0,ke.A)({isOpen:t&&M,noMountTransition:M,withShouldRender:!0}),{isContextMenuOpen:B,contextMenuAnchor:R,handleContextMenu:O,handleContextMenuClose:U,handleContextMenuHide:z}=(0,Ne.A)(L),V=(0,D.A)(()=>L.current),j=(0,D.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),J=(0,D.A)(()=>L?.current?.querySelector(`.${Te} .bubble`)),G=(0,D.A)(()=>({withPortal:!0})),$=f&&k&&(Y||Boolean((0,c.Kl)(k))),H=!g,W=Boolean(R)&&(Y||$||H),_=(0,v.A)("sender-group-container","Tk8btfOT");return(0,q.FD)("div",{id:i,className:_,children:[E&&(0,q.FD)("div",{ref:L,className:"UPrRM3Ks",children:[function(){const e=!k&&w?w.hiddenUserName:void 0;return(0,q.Y)(Ye.A,{size:"small",className:"jdvqXfYh",peer:k,text:e,onClick:k?x:void 0,onContextMenu:O})}(),W&&(0,q.Y)(Fe.A,{isOpen:B,anchor:R,getTriggerElement:V,getRootElement:j,getLayout:G,getMenuElement:J,className:Te,onClose:U,onCloseAnimationEnd:z,withPortal:!0,autoClose:!0,children:(0,q.FD)(q.FK,{children:[Y&&(0,q.Y)(Pe.A,{icon:"comments",onClick:F,children:b("SendMessage")}),$&&(0,q.Y)(Pe.A,{icon:"mention",onClick:P,children:b("ContextMenuItemMention")}),H&&(0,q.Y)(Pe.A,{icon:"search",onClick:T,children:b("Search")})]})})]}),n]})}));var xe=n(56494),Le=n(18501),Ee=n(35127),Be=n(81949),Re=n(86070),Oe=n(64493),Ue=n(48906),Ke=n(51644),ze=n(80089),Ve=n(80464);const je=e=>{const{isOpen:t}=e,n=(0,Ve.A)(ze.ar.Extra,"SponsoredContextMenuContainer",!t);return n?(0,q.Y)(n,{...e}):void 0};var Je=n(25477);const Ge=(0,o.ph)((0,s.EK)((e,{chatId:t})=>{const n=(0,u.v8U)(e,t),o=(0,u.yuw)(e),i=n?(0,xe.iS)(e,n):void 0,s=i&&(0,c.$r)(o,i);return{message:n,theme:(0,u.SJA)(e),isDownloading:s,canAutoLoadMedia:n?(0,u.wwb)(e,n):void 0,canAutoPlayMedia:n?(0,u.OEt)(e,n):void 0}})(({chatId:e,message:t,containerRef:n,theme:i,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,isDownloading:l,canAutoLoadMedia:u,canAutoPlayMedia:h})=>{const{viewSponsored:m,openUrl:p,hideSponsored:g,clickSponsored:A,openMediaViewer:y,openAboutAdsModal:C}=(0,s.ko)(),w=(0,J.A)(),I=(0,o.li)(),b=(0,o.li)(),S=Boolean(t),{isMobile:M}=(0,Ae.Ay)(),{observe:N}=(0,ye.BL)({rootRef:n,debounceMs:200,threshold:1}),{isContextMenuOpen:k,contextMenuAnchor:Y,handleBeforeContextMenu:P,handleContextMenu:T,handleContextMenuClose:x,handleContextMenuHide:L}=(0,Ne.A)(b,void 0,!0,f.Ni);(0,o.vJ)(()=>S?N(I.current,e=>{e.isIntersecting&&t?.randomId&&m({randomId:t.randomId})}):void 0,[t?.randomId,S,N,m]);const E=(0,D.A)(()=>{g()}),B=t&&(0,c.r_)(t),{photo:R,video:O,text:U}=B||{},K=O?.isGif,z=Boolean(R||O),V=(0,D.A)(()=>{t&&(A({randomId:t.randomId,isMedia:!(!R&&!K)||void 0}),p({url:t.url,shouldSkipModal:!0}))}),j=(0,D.A)(()=>{t&&(A({randomId:t.randomId,isMedia:!0}),y({origin:r.TQ.SponsoredMessage,chatId:e,isSponsoredMessage:!0}))}),G=(0,D.A)(()=>{t&&C({randomId:t.randomId,canReport:t.canReport,additionalInfo:t.additionalInfo,sponsorInfo:t.sponsorInfo})}),$=(0,o.Kr)(()=>{let e,t,n="";if(R||O){let n;R?n=(0,Ee.yA)({media:R,isMobile:M}).width:O&&(n=(0,Ee.yA)({media:O,isMobile:M}).width),n&&(n<(0,Ee.Ay)(M)&&(t=n),e=Math.max((0,Ee.nP)(U?.text,M),n))}return e&&(n=`width: ${e+0}px`),{contentWidth:t,noMediaCorners:!1,style:n}},[R,O,M,U?.text]),{contentWidth:H,style:W}=$;if(t&&t.content)return(0,q.FD)("div",{ref:b,className:"SponsoredMessage Message open sponsored-media-preview",children:[(0,q.FD)("div",{className:"message-content media has-shadow has-solid-background has-appendix",dir:"auto",style:W,onMouseDown:e=>{(0,F.l)(e),P(e)},onContextMenu:T,children:[(0,q.FD)(Re.A,{peerColor:t.peerColor,className:"content-inner",dir:"auto",children:[function(){if(t)return R?(0,q.Y)(Ke.A,{photo:R,theme:i,canAutoLoad:u,isDownloading:l,observeIntersection:a,noAvatars:!0,onClick:V,forcedWidth:H}):O?(0,q.Y)(Je.A,{video:O,observeIntersectionForLoading:a,observeIntersectionForPlaying:d,noAvatars:!0,canAutoLoad:u,canAutoPlay:h,isDownloading:l,onClick:K?V:j,forcedWidth:H}):void 0}(),t.photo&&(0,q.Y)(Ye.A,{size:"large",photo:t.photo,className:(0,v.A)("channel-avatar",w.isRtl&&"is-rtl")}),(0,q.FD)("span",{className:(0,v.A)("message-title message-type",z&&"has-media"),children:[t.isRecommended?w("Message.RecommendedLabel"):w("SponsoredMessage"),(0,q.Y)(Be.A,{onClick:G,className:"ad-about",children:w("SponsoredMessageAdWhatIsThis")})]}),function(){if(t)return(0,q.FD)(q.FK,{children:[(0,q.Y)("div",{className:"message-title message-peer",dir:"auto",children:t.title}),Boolean(t.content?.text)&&(0,q.Y)("div",{className:"text-content with-meta",dir:"auto",ref:I,children:(0,q.Y)("span",{className:"text-content-inner",dir:"auto",children:(0,Le.fd)({text:t.content.text.text,entities:t.content.text.entities})})}),(0,q.Y)(Oe.A,{className:"SponsoredMessage__button",size:"tiny",color:"translucent",isRectangular:!0,onClick:V,children:t.buttonText})]})}()]}),(0,q.Y)(Ue.A,{}),(0,q.Y)("div",{className:"message-action-buttons-container",children:(0,q.Y)("div",{className:"message-action-buttons-sticky-zone",children:(0,q.FD)("div",{className:"message-action-buttons message-action-button-sticky",children:[(0,q.Y)(Oe.A,{className:"message-action-button",color:"translucent-white",round:!0,iconName:"close",iconClassName:"sponsored-action-icon",ariaLabel:w("Close"),onClick:E}),t.canReport&&(0,q.Y)(Oe.A,{className:"message-action-button",color:"translucent-white",round:!0,iconName:"more",iconClassName:"sponsored-action-icon",ariaLabel:w("More"),onClick:T,onContextMenu:T})]})})})]}),Y&&(0,q.Y)(je,{isOpen:k,anchor:Y,triggerRef:b,randomId:t.randomId,canReport:t.canReport,sponsorInfo:t.sponsorInfo,additionalInfo:t.additionalInfo,onClose:x,onCloseAnimationEnd:L})]},"sponsored-message")}));var qe=n(42211);const $e=(0,o.ph)(({isFocused:e,className:t})=>{const n=(0,o.li)();return(0,qe.A)({elementRef:n,isJustAdded:!0,isFocused:e,noFocusHighlight:!0}),(0,q.Y)("div",{ref:n,className:(0,v.A)("list-bottom-marker",t)})});var He=n(50805);const We=(0,o.ph)(({canShowAds:e,chatId:t,threadId:n,messageIds:i,messageGroups:h,getContainerHeight:m,isViewportNewest:p,isUnread:g,isComments:A,isEmptyThread:C,withUsers:w,isChannelChat:b,isChatMonoforum:S,canManageBotForumTopics:k,noAvatars:Y,containerRef:P,anchorIdRef:T,memoUnreadDividerBeforeIdRef:x,memoFirstUnreadIdRef:L,type:E,isReady:B,hasLinkedChat:U,isSchedule:K,shouldRenderAccountInfo:z,nameChangeDate:V,photoChangeDate:j,noAppearanceAnimation:G,isSavedDialog:$,isQuickPreview:H,shouldScrollToBottom:W,canPost:_,onScrollDownToggle:Q,onNotchToggle:Z,onIntersectPinnedMessage:ee})=>{const{openHistoryCalendar:te}=(0,s.ko)(),ie=o.OV,se=(0,fe.A)(()=>B&&!ie(),[B,ie]),ae=!$&&!K,re=e&&p,{observeIntersectionForReading:de,observeIntersectionForLoading:le,observeIntersectionForPlaying:ce,onMessageUnmount:Ne}=function({type:e,containerRef:t,memoFirstUnreadIdRef:n,chatId:i,threadId:a,isQuickPreview:r,onIntersectPinnedMessage:d}){const{markMessageListRead:l,markMentionsRead:c,animateUnreadReaction:u,scheduleForViewsIncrement:h}=(0,s.ko)(),{isMobile:m}=(0,Ae.Ay)(),p=m?300:500,g=(0,o.li)([]);(0,o.vJ)(()=>{g.current=[]},[a,i,e]);const{observe:f,freeze:v,unfreeze:A}=(0,ye.BL)({rootRef:t,throttleMs:150,threshold:0,shouldSkipFirst:!0},t=>{if("thread"!==e||(0,O.g1)())return;let o=0;const s=[],a=[],m=[],p=g.current,f=new Set,v=[];t.forEach(e=>{const{isIntersecting:t,target:n}=e,{dataset:i}=n,r=Number(i.lastMessageId||i.messageId),d="true"===i.shouldUpdateViews,l=i.albumMainId?Number(i.albumMainId):void 0;t?(v.push(r),r>o&&(o=r),i.hasUnreadMention&&s.push(r),i.hasUnreadReaction&&a.push(r),d&&m.push(l||r)):f.add(r)}),g.current=(0,y.Am)(p.concat(v)).filter(e=>!f.has(e)).sort((e,t)=>e-t),r||(n.current&&o&&o>=n.current&&l({maxId:o}),s.length&&c({chatId:i,messageIds:s}),m.length&&h({chatId:i,ids:m})),a.length&&u({chatId:i,messageIds:a}),g.current.length&&d?.({firstViewportId:g.current[0]})});(0,O.Ay)(v,A);const{observe:C}=(0,ye.BL)({rootRef:t,throttleMs:Ce,margin:p}),{observe:w}=(0,ye.BL)({rootRef:t,throttleMs:Ce});return{observeIntersectionForReading:f,observeIntersectionForLoading:C,observeIntersectionForPlaying:w,onMessageUnmount:(0,D.A)(e=>{g.current=g.current.filter(t=>t!==e)})}}({type:E,containerRef:P,memoFirstUnreadIdRef:L,chatId:t,threadId:n,isQuickPreview:H,onIntersectPinnedMessage:ee}),{withHistoryTriggers:ke,backwardsTriggerRef:Ye,forwardsTriggerRef:Fe,fabTriggerRef:Pe}=function({type:e,containerRef:t,messageIds:n,getContainerHeight:i,isViewportNewest:a,isUnread:d,isReady:c,onScrollDownToggle:u,onNotchToggle:h}){const{loadViewportMessages:m}=(0,s.ko)(),[p,g]=(0,o.Kr)(()=>"thread"===e?[(0,I.sg)(()=>m({direction:r.TN.Backwards}),1e3,!0,!1),(0,I.sg)(()=>m({direction:r.TN.Forwards}),1e3,!0,!1)]:[],[m,n]),v=(0,o.li)(),A=(0,o.li)(),y=(0,o.li)(),C=(0,D.A)((e,t)=>{u?.(e),h?.(t)}),w=(0,Ie.A)(C,[C],100,!0,!1),b=(0,D.A)(()=>{if(!c)return;if(!n?.length)return void C(!1,!1);if(!a)return void w(!0,!0);const e=t.current,o=y.current;if(!e||!o)return;const{offsetHeight:i,scrollHeight:s,scrollTop:r}=e,l=o.offsetTop,u=Math.round(l-r-i),h=u<=1;0!==s&&w(d?!h:!(u<=50),!h)}),{observe:S}=(0,ye.BL)({rootRef:t,margin:f.et},e=>{g&&p&&e.forEach(({isIntersecting:e,target:t})=>{e&&("backwards-trigger"===t.className&&p(),"forwards-trigger"===t.className&&g())})}),M=n&&n.length>1;(0,ye.mv)(v,M?S:void 0),(0,ye.mv)(A,M?S:void 0);const{observe:N,freeze:k,unfreeze:Y}=(0,ye.BL)({rootRef:t,margin:100,throttleScheduler:l.YS},b);(0,ye.mv)(y,N);const{observe:F,freeze:P,unfreeze:T}=(0,ye.BL)({rootRef:t,margin:1,throttleScheduler:l.YS},b);(0,ye.mv)(y,F),(0,o.vJ)(()=>{c&&b()},[c]),(0,o.vJ)(()=>{const e=t.current;if(e)return e.addEventListener("scrollend",b),()=>{e.removeEventListener("scrollend",b)}},[t]);const x=(0,D.A)(()=>{k(),P(),setTimeout(()=>{T(),Y()},350)});(0,R.A)(x,[x,n]);const L=(0,we.D7)(i,200);return(0,be.R)(x,[x,L]),{withHistoryTriggers:M,backwardsTriggerRef:v,forwardsTriggerRef:A,fabTriggerRef:y}}({type:E,containerRef:P,messageIds:i,getContainerHeight:m,isViewportNewest:p,isUnread:g,isReady:B,onScrollDownToggle:Q,onNotchToggle:Z}),Te=(0,J.A)(),xe=(0,X.A)(),Le=(0,q.Y)("div",{className:(0,v.A)("unread-divider","local-action-message"),children:(0,q.Y)("span",{children:Te("UnreadMessages")})},"unread-messages"),Ee=(e,t)=>{if(e.paidMessageStars){const n=t?.messages?.length||1,o=e.paidMessageStars*n;return(0,q.Y)("div",{className:(0,v.A)("local-action-message"),children:(0,q.Y)("span",{children:e.isOutgoing?xe("ActionPaidOneMessageOutgoing",{amount:(0,pe.Kk)(xe,o)}):(()=>{const t=(0,u.Y7C)((0,s.mS)(),e),n=t?(0,he.F9)(xe,t):"";return xe("ActionPaidOneMessageIncoming",{user:n,amount:(0,pe.Kk)(xe,o)})})()})},`paid-messages-action-${e.id}`)}},Be=e=>{if(e.suggestedPostInfo){const{price:t,scheduleDate:n}=e.suggestedPostInfo,o=(0,u.Y7C)((0,s.mS)(),e),i=o?(0,he.F9)(xe,o):"",a=(0,ge.Nm)(o?.id,i||xe("ActionFallbackUser")),r="message"===e.replyInfo?.type&&e.replyInfo.replyToMsgId?(0,u.O5q)((0,s.mS)(),e.chatId,e.replyInfo.replyToMsgId):void 0,d=(0,c.Do)(e,r)?(0,c.EQ)(xe,e,r,e.isOutgoing,a):e.isOutgoing?xe("ActionSuggestedPostOutgoing",void 0,{withNodes:!0,withMarkdown:!0}):xe("ActionSuggestedPostIncoming",{user:a},{withNodes:!0,withMarkdown:!0}),l=(0,y.oE)([[xe("TitlePrice"),t?"TON"===t.currency?(0,pe.QH)(xe,(0,me.wD)(t.amount)):(0,pe.Kk)(xe,t.amount):xe("SuggestMessageNoPrice")],[xe("TitleTime"),n?(0,M.e0)(n,xe,Te):xe("SuggestMessageAnytime")]]);return(0,q.Y)("div",{className:(0,v.A)("local-action-message"),children:(0,q.FD)("span",{className:He.A.suggestedPostContainer,children:[(0,q.Y)("div",{className:He.A.suggestedPostTitle,children:d}),Boolean(l.length)&&(0,q.Y)(oe.A,{className:He.A.suggestedPostInfo,data:l})]})},`suggested-post-action-${e.id}`)}},Re=G?0:h.reduce((e,t)=>e+t.senderGroups.flat().length,0);let Oe=0;const Ue=(0,ve.A)(i),Ke=Boolean(i&&Ue&&i[i.length-2]===Ue[Ue.length-1]),ze=h.map((e,t,o)=>{const i=function(e,t,o){return e.senderGroups.map((e,i,s)=>{if(1===e.length&&!N(e[0])&&(0,c._P)(e[0])&&"phoneCall"!==e[0].content.action?.type){const a=e[0],r=i===s.length-1&&t===o.length-1;return(0,y.oE)([a.id===x.current&&Le,(0,q.Y)(Se.A,{message:a,threadId:n,observeIntersectionForBottom:de,observeIntersectionForLoading:le,observeIntersectionForPlaying:ce,memoFirstUnreadIdRef:L,appearanceOrder:Re-++Oe,isJustAdded:r&&Ke,isLastInList:r,getIsMessageListReady:se,onMessageUnmount:Ne},a.id)])}let r;const d=e.map((d,l)=>{const u=N(d)?d.mainMessage:d,h=N(d)?d:void 0,m=(0,c.Ie)(u),p=N(d),g=e[l+1];u.previousLocalId&&T.current===(0,c.GZ)(u.previousLocalId)&&(T.current=(0,c.GZ)(u.id));const f=!p&&u.groupedId?u.groupedId:void 0,v=g&&!N(g)?g.groupedId:void 0,C=u.id===n,I={isFirstInGroup:0===l,isLastInGroup:l===e.length-1,isFirstInDocumentGroup:Boolean(f&&f!==r),isLastInDocumentGroup:Boolean(f&&f!==v),isLastInList:l===e.length-1&&i===s.length-1&&t===o.length-1};r=f;const M=(0,c.sj)(u),k=(0,c.u7)(u)?`${u.date}_${M}`:M,F=!1===U||!b||Boolean(S);return(0,y.oE)([u.id===x.current&&Le,u.paidMessageStars&&!w&&Ee(u,h),u.suggestedPostInfo&&Be(u),(0,q.Y)(Me.A,{message:u,observeIntersectionForBottom:de,observeIntersectionForLoading:le,observeIntersectionForPlaying:ce,album:h,noAvatars:Y,withAvatar:I.isLastInGroup&&w&&!m&&(!C||!A),withSenderName:I.isFirstInGroup&&w&&!m,threadId:n,messageListType:E,noComments:F,noReplies:!F||n!==a.l3||"scheduled"===E,appearanceOrder:Re-++Oe,isJustAdded:I.isLastInList&&Ke,isFirstInGroup:I.isFirstInGroup,isLastInGroup:I.isLastInGroup,isFirstInDocumentGroup:I.isFirstInDocumentGroup,isLastInDocumentGroup:I.isLastInDocumentGroup,isLastInList:I.isLastInList,memoFirstUnreadIdRef:L,getIsMessageListReady:se,onMessageUnmount:Ne},k)])}).flat();if(!w)return d;const l=e[e.length-1],u=N(l)?l.mainMessage:l,h=(0,c.sj)(u),m=Re-Oe,p=u.id===n,g=(0,c.Ie)(u),f=e[0],v=N(f)?f.mainMessage:f,I=(0,c.sj)(v),M=`${I}-${h}`,k=I===h?`message-group-${I}`:`message-group-${I}-${h}`,F=w&&!g&&(!p||!A);return(0,y.oE)([(0,q.Y)(De,{id:k,message:u,withAvatar:F,appearanceOrder:m,canPost:_,children:d},M),p&&(0,q.Y)("div",{className:"local-action-message",children:(0,q.Y)("span",{children:Te(C?A?"NoComments":"NoReplies":"DiscussionStarted")})},`discussion-started-${h}`)])}).flat()}(e,t,o);return(0,q.FD)("div",{className:(0,v.A)("message-date-group",!(V||j)&&0===t&&"first-message-date-group"),onMouseDown:F.l,teactFastList:!0,children:[(0,q.Y)("div",{className:(0,v.A)("sticky-date",ae&&"interactive"),onMouseDown:F.l,onClick:ae?()=>te({selectedAt:e.datetime}):void 0,children:(0,q.FD)("span",{dir:"auto",children:[K&&e.originalDate===d.NkL&&Te("MessageScheduledUntilOnline"),K&&e.originalDate!==d.NkL&&Te("MessageScheduledOn",(0,M.F5)(Te,e.datetime,void 0,!0)),!K&&(0,M.F5)(Te,e.datetime)]})},"date-header"),i.flat()]},e.datetime)});return(0,q.FD)("div",{className:"messages-container",teactFastList:!0,children:[ke&&(0,q.Y)("div",{ref:Ye,className:"backwards-trigger"},"backwards-trigger"),z&&(0,q.Y)(ue,{chatId:t,hasMessages:!0},`account_info_${t}`),ze.flat(),p&&(()=>{if(k&&n===a.l3)return(0,q.Y)("div",{className:(0,v.A)("local-action-message",He.A.root),children:(0,q.FD)("div",{className:He.A.contentBox,children:[(0,q.Y)(ne.A,{className:He.A.botForumTopicIcon,name:"topic-new"}),(0,q.Y)("h3",{className:He.A.botForumTopicTitle,children:xe("BotForumActionNew")}),(0,q.Y)("span",{className:He.A.botForumTopicDescription,children:xe("BotForumActionNewDescription")}),(0,q.Y)(ne.A,{className:He.A.botForumTopicArrow,name:"down"})]})},"botforum-new-topic")})(),ke&&(0,q.Y)("div",{ref:Fe,className:"forwards-trigger"},"forwards-trigger"),(0,q.Y)("div",{ref:Pe,className:"fab-trigger"},"fab-trigger"),p&&(0,q.Y)($e,{isFocused:W,className:re?"with-sponsored":void 0},"bottom-marker"),re&&(0,q.Y)(Ge,{chatId:t,containerRef:P,observeIntersectionForLoading:le,observeIntersectionForPlaying:ce},t)]})});var _e=n(38102);const Qe=3*S.$,Ze=(0,o.ph)(({isChatWithSelf:e,type:t,isGroupChatJustCreated:n,topic:o})=>{const i=(0,J.A)();return"scheduled"===t?function(e){return(0,q.Y)("div",{className:"empty",children:(0,q.Y)("span",{children:e("ScheduledMessages.EmptyPlaceholder")})})}(i):e?function(e){return(0,q.Y)("div",{className:"NoMessages",children:(0,q.FD)("div",{className:"wrapper",children:[(0,q.Y)(ne.A,{name:"cloud-download",className:"no-messages-icon"}),(0,q.Y)("h3",{className:"title",children:e("Conversation.CloudStorageInfo.Title")}),(0,q.FD)("ul",{className:"description",children:[(0,q.Y)("li",{children:e("Conversation.ClousStorageInfo.Description1")}),(0,q.Y)("li",{children:e("Conversation.ClousStorageInfo.Description2")}),(0,q.Y)("li",{children:e("Conversation.ClousStorageInfo.Description3")}),(0,q.Y)("li",{children:e("Conversation.ClousStorageInfo.Description4")})]})]})})}(i):n?function(e){return(0,q.Y)("div",{className:"NoMessages",children:(0,q.FD)("div",{className:"wrapper",dir:e.isRtl?"rtl":void 0,children:[(0,q.Y)("h3",{className:"title",children:e("EmptyGroupInfo.Title")}),(0,q.Y)("p",{className:"description",children:e("EmptyGroupInfo.Subtitle")}),(0,q.FD)("ul",{className:"list-checkmarks",children:[(0,q.Y)("li",{children:e("EmptyGroupInfo.Line1")}),(0,q.Y)("li",{children:e("EmptyGroupInfo.Line2")}),(0,q.Y)("li",{children:e("EmptyGroupInfo.Line3")}),(0,q.Y)("li",{children:e("EmptyGroupInfo.Line4")})]})]})})}(i):o?function(e,t){return(0,q.Y)("div",{className:"NoMessages",children:(0,q.FD)("div",{className:"wrapper",children:[(0,q.Y)(_e.A,{topic:t,size:Qe,className:"no-messages-icon topic-icon"}),(0,q.Y)("h3",{className:"title",children:e("Chat.EmptyTopicPlaceholder.Title")}),(0,q.Y)("p",{className:"description topic-description",children:(0,Z.A)(e("Chat.EmptyTopicPlaceholder.Text"),["br"])})]})})}(i,o):(0,q.Y)("div",{className:"empty",children:(0,q.Y)("span",{children:i("NoMessages")})})});var Xe=n(14957),et=n(64489),tt=n(85118);const nt=(0,o.ph)((0,s.EK)((e,{peerId:t})=>{const n=(0,u.SJA)(e),{patternColor:o}=(0,u.Gyz)(e,n)||{};return{patternColor:o,peer:(0,u.PVB)(e,t)}})(function({patternColor:e,peer:t,paidMessagesStars:n}){const o=(0,J.A)(),i=(0,X.A)(),{openPremiumModal:a,openStarsBalanceModal:r}=(0,s.ko)(),d=(0,D.A)(()=>a()),l=(0,D.A)(()=>{r({})});if(t)return(0,q.Y)("div",{className:"J2RfusJI",children:(0,q.FD)("div",{className:"C90W_KKX",children:[(0,q.FD)("div",{className:"Qi7tZATP",children:[(0,q.Y)(et.A,{tgsUrl:Xe.w.Unlock,size:54,color:e,className:"lfcZJyxp"}),(0,q.Y)(ne.A,{name:"comments-sticker",className:"zd5EAc5e"})]}),(0,q.Y)("span",{className:"E_YZ3IQs",children:n?i((0,he.mO)(t)?"MessagesPlaceholderPaidUser":"MessagesPlaceholderPaidChannel",{peer:(0,he.F9)(i,t),amount:(0,pe.U2)(i,n,{asFont:!0,containerClassName:"IL_EHscS"})},{withNodes:!0,withMarkdown:!0}):(0,Z.A)(o("MessageLockedPremium",(0,he.F9)(i,t)),["simple_markdown"])}),(0,q.Y)(Oe.A,{color:"translucent-black",size:"default",pill:!0,onClick:n?l:d,className:"Nz8BOo0i",children:n?(0,q.FD)(q.FK,{children:[i("ButtonBuyStars"),(0,q.Y)(tt.A,{preset:"button"})]}):o("MessagePremiumUnlock")})]})})}));var ot=function(e){return e[e.Loading=0]="Loading",e[e.Restricted=1]="Restricted",e[e.StarsRequired=2]="StarsRequired",e[e.PremiumRequired=3]="PremiumRequired",e[e.AccountInfo=4]="AccountInfo",e[e.ContactGreeting=5]="ContactGreeting",e[e.NoMessages=6]="NoMessages",e[e.MessageList=7]="MessageList",e}(ot||{});const it=.5*S.$,st="force-messages-scroll",at="with-bottom-snap",rt=(0,I.sg)(e=>e(),200,!1),dt=(0,o.ph)((0,s.EK)((e,{chatId:t,threadId:n,type:o})=>{const i=(0,u.nTw)(e),s=e.currentUserId,r=(0,u.hds)(e,t),l=(0,u.mBe)(e,t),g=(0,u.vGo)(e,t),f=(0,p.a1)(e,t,n);if(!r)return{currentUserId:s};const v=(0,u.vRX)(e,t,n,o),y="scheduled"===o?(0,u.yFI)(e,t):(0,u.zeq)(e,t),C=(0,c.cG)(t,n,s);if(!(n===a.l3||C||r?.isForum||y&&n&&y[Number(n)]))return{currentUserId:s};const w=(0,h._l)(e,t),I=(0,m.G6)(e,r?.restrictionReasons),b=(0,u.yHC)(e,t,C?"saved":"all"),S=(0,u.kdX)(e,t),M=n===a.l3&&!v&&f&&!f.unreadCount&&!S&&b&&!b.groupedId,N=(0,u.yps)(e,t),k=Boolean(g?.settings?.canAddContact),Y=g?.settings?.nameChangeDate,F=g?.settings?.photoChangeDate,P=(0,u.S0q)(e,t,n),T=(0,A.L8)(t)?void 0:(0,u.AWZ)(e,t),D=!(0,p.Vw)(e,t,n)?.messagesCount,x=!(0,u.g29)(e)||(0,u.vGo)(e,s)?.areAdsEnabled,L=(0,u.trm)(e),E=Boolean(g?.businessIntro),B=e.isAppConfigLoaded,R=(0,u.k2W)(e,t)?.id,O=(0,u.jGY)(e,t)&&!T?.isTranslationDisabled,U=r?.hasAutoTranslation,K=(0,u.Qq_)(e),z=(0,m.Xf)(e),V=z&&z.chatId===t&&z.threadId===n&&z.type===o,{chatId:j,threadId:J,messageId:G}=i.focusedMessage||{},q=j===t&&J===n&&!G;return{isActive:V,areAdsEnabled:x,isChatLoaded:!0,isRestricted:w,restrictionReasons:I,isChannelChat:(0,c.WX)(r),isChatMonoforum:(0,c.Ve)(r),isGroupChat:(0,c.YE)(r),isChannelWithAvatars:r.areProfilesShown,isCreator:r.isCreator,isChatWithSelf:(0,u.nZ4)(e,t),isSystemBotChat:(0,c.DX)(t),isAnonymousForwards:(0,c.Qe)(t),isBot:Boolean(N),isNonContact:k,nameChangeDate:Y,photoChangeDate:F,isSynced:e.isSynced,messageIds:v,messagesById:y,firstUnreadId:(0,u.RjD)(e,t,n),isViewportNewest:"thread"!==o||(0,u.haw)(e,t,n),focusingId:S,isSelectModeActive:(0,u.rTV)(e),hasLinkedChat:T?Boolean(T.linkedChatId):void 0,channelJoinInfo:T?.joinInfo,topic:P,noMessageSendingAnimation:!(0,u.xYJ)(e,"messageSendingAnimations"),isServiceNotificationsChat:t===d.zv8,isForum:r.isForum,isEmptyThread:D,currentUserId:s,isChatProtected:(0,u.ryq)(e,t),lastMessage:M?b:void 0,isAccountFrozen:L,hasCustomGreeting:E,isAppConfigLoaded:B,monoforumChannelId:R,canTranslate:O,translationLanguage:K,shouldAutoTranslate:U,canManageBotForumTopics:r.isBotForum&&l?.canManageBotForumTopics,shouldScrollToBottom:q}})(({chatId:e,threadId:t,type:n,isChatLoaded:h,isForum:m,isChannelChat:S,isGroupChat:M,isChannelWithAvatars:N,canPost:J,isSynced:G,isActive:H,canManageBotForumTopics:W,shouldScrollToBottom:_,isChatMonoforum:Q,isReady:Z,isChatWithSelf:X,isSystemBotChat:ee,isAnonymousForwards:te,isCreator:ne,isBot:oe,isNonContact:ie,nameChangeDate:se,photoChangeDate:ae,messageIds:re,messagesById:de,firstUnreadId:le,isComments:ce,isViewportNewest:he,isRestricted:me,restrictionReasons:pe,isEmptyThread:ge,focusingId:fe,isSelectModeActive:ve,lastMessage:Ae,hasLinkedChat:ye,withBottomShift:Ce,withDefaultBg:we,topic:Ie,noMessageSendingAnimation:be,isServiceNotificationsChat:Se,currentUserId:Me,isContactRequirePremium:Ne,paidMessagesStars:ke,areAdsEnabled:Ye,channelJoinInfo:Fe,isChatProtected:Pe,isAccountFrozen:Te,hasCustomGreeting:De,monoforumChannelId:xe,isAppConfigLoaded:Le,canTranslate:Ee,translationLanguage:Be,shouldAutoTranslate:Re,isQuickPreview:Oe,onIntersectPinnedMessage:Ue,onScrollDownToggle:Ke,onNotchToggle:ze})=>{const{loadViewportMessages:Ve,setScrollOffset:je,loadSponsoredMessages:Je,loadMessageReactions:Ge,copyMessagesByIds:qe,loadMessageViews:$e,loadPeerStoriesByIds:He,loadFactChecks:_e,requestChatTranslation:Qe}=(0,s.ko)(),Xe=(0,o.li)(),et=(0,o.li)("thread"===n&&(0,p.j_)((0,s.mS)(),e,t)||(0,p.rK)((0,s.mS)(),e,t)||0),tt=(0,o.li)(),dt=(0,o.li)(),ct=(0,o.li)(),ut=(0,o.li)(),ht=(0,o.li)(),mt=(0,o.li)(),pt=(0,o.li)(!1),gt=(0,o.li)(Boolean(Ae)),ft=(0,o.li)(),vt=(0,c.cG)(e,t,Me),At=vt&&t!==d.Ckz,yt=Boolean(re),Ct=(0,A.L8)(e),wt=Boolean(!Ct&&!S||X||ee||te||N);(0,R.A)(()=>{yt&&(0,I.aj)(()=>{gt.current=!1})},[yt]),(0,R.A)(()=>{ut.current=le},[le]),(0,o.vJ)(()=>{Ye&&(S||oe)&&G&&Z&&Le&&Je({peerId:e})},[e,G,Z,S,oe,Ye,Le]),(0,R.A)(()=>{yt&&(ht.current=ut.current)},[yt]),(0,R.A)(()=>{mt.current=fe},[fe]),(0,o.vJ)(()=>{Re&&Ee&&Qe({chatId:e,toLanguageCode:Be})},[Re,Ee,Be,e]),(e=>{const t=(0,D.A)(t=>{const n=(0,L.A)();n&&n.length>1&&(t.preventDefault(),e({messageIds:n}))});(0,E.v)((0,o.Kr)(()=>({"Mod+C":t}),[]))})(qe);const It=(0,o.Kr)(()=>{if(!re?.length||!de)return;const e=[];re.forEach((t,o,i)=>{const s=e[e.length-1],a=de[t];if(!a)return;const{shouldAppendJoinMessage:r,shouldAppendJoinMessageAfterCurrent:d}=(()=>{if(Fe&&"thread"===n)return s&&s.date<Fe.joinedDate&&Fe.joinedDate<=a.date?{shouldAppendJoinMessage:!0,shouldAppendJoinMessageAfterCurrent:!1}:o===i.length-1&&a.date<Fe.joinedDate?{shouldAppendJoinMessage:!0,shouldAppendJoinMessageAfterCurrent:!0}:void 0})()||{};if(d&&e.push(a),r){const t=d?a.id:s?.id||a.id-1;e.push({id:lt(t),chatId:a.chatId,date:Fe.joinedDate,isOutgoing:!1,content:{action:{mediaType:"action",type:"channelJoined",inviterId:Fe?.inviterId,isViaRequest:Fe?.isViaRequest||void 0}}})}d||e.push(a)});const o="scheduled"===n||Se?["date","id"]:["id"];return e.length?k((0,y.My)(e,o),ht.current,m?void 0:Number(t),X,wt):void 0},[wt,re,de,n,Se,m,t,X,Fe]);(0,P.A)(()=>{if(!re||!de||"scheduled"===n||Te||!H)return;if(!S&&!M)return;const t=re.filter(e=>{const t=de[e];return t&&t.reactions&&!t.content.action});t.length&&Ge({chatId:e,ids:t})},2e4),(0,P.A)(()=>{if(!re||!de||"scheduled"===n||!H)return;const e=re.map(e=>de[e]?.content.storyData).filter(Boolean);if(!e.length)return;const t=e.reduce((e,t)=>{const{peerId:n,id:o}=t;return e[n]||(e[n]=[]),e[n].push(o),e},{});Object.entries(t).forEach(([e,t])=>{He({peerId:e,storyIds:t})})},3e5),(0,P.A)(()=>{if(!re||!de||t!==a.l3||"scheduled"===n||!H)return;const o=(0,s.mS)(),i=re.filter(t=>(0,p.Vw)(o,e,t)?.isCommentsInfo||void 0!==de[t]?.viewsCount);i.length&&$e({chatId:e,ids:i})},2e4,!0),(0,P.A)(()=>{if(!re||!de||t!==a.l3||"scheduled"===n||!H)return;const o=re.filter(e=>de[e]?.factCheck?.shouldFetch);o.length&&_e({chatId:e,ids:o})},5e3);const bt=(0,o.Kr)(()=>{if("thread"===n)return(0,I.sg)(()=>Ve({direction:r.TN.Around,chatId:e,threadId:t}),1e3,!0,!1)},[Ve,re]),{isScrolled:St,updateStickyDates:Mt}=function(){const[e,t]=(0,K.A)(!1),n=(0,z.A)(1e3,!0);return{isScrolled:e,updateStickyDates:(0,D.A)(e=>{t(),document.body.classList.contains("is-scrolling-messages")||(0,l.RK)(()=>{document.body.classList.add("is-scrolling-messages")}),n(()=>{const t=function(e){const t=e.querySelectorAll(".sticky-date"),n=e.scrollTop,o=getComputedStyle(e),i=parseInt(o.getPropertyValue("--middle-header-panes-height"),10);return Array.from(t).find(e=>{const{offsetTop:t,offsetHeight:o}=e,s=t-n;return-o<=s&&s<=i+10})}(e);(0,l.RK)(()=>{const e=document.querySelector(".stuck");e&&e.classList.remove("stuck"),t&&t.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})})}}(),Nt=(0,D.A)(()=>{const e=Xe.current,t=e?.querySelector(".fab-trigger");if(!e||!t)return;const n=e.scrollTop+e.offsetHeight,o=t.offsetTop,s=o-7<=n&&n<=o+14;e.classList.contains(at)!==s&&(s?(0,l.RK)(()=>{(0,i.YM)(e,at)}):(clearTimeout(ft.current),ft.current=void 0,(0,l.RK)(()=>{(0,i.HW)(e,at)})))}),kt=(0,D.A)(()=>{if(pt.current)return void(pt.current=!1);const o=Xe.current;o&&(mt.current||Mt(o),void 0===ft.current&&Nt(),rt(()=>{const i=(0,s.mS)();Boolean((0,u.nTw)(i).focusedMessage?.chatId)||Ue?.({shouldCancelWaiting:!0}),o.parentElement&&(et.current=o.scrollHeight-o.scrollTop,"thread"!==n||Oe||je({chatId:e,threadId:t,scrollOffset:et.current}))}))}),[Yt,Ft]=function(e,t){const[n,i]=(0,o.Ul)(),s=(0,D.A)(e=>{i(e.contentRect.height)});(0,U.A)(e,s),(0,o.vJ)(()=>{const o=Number(e.current.dataset.normalHeight)||0,i=n();i&&i>o&&t&&(e.current.dataset.normalHeight=String(i))},[t,e,n]);const a=(0,o.li)();return[n,a]}(Xe,J&&!ve),Pt=(0,D.A)(e=>{if(f.$M&&e.deltaY<0){const e=Xe.current;if(!e)return;(0,l.RK)(()=>{(0,i.HW)(e,at)})}});(0,o.vJ)(()=>{if(!bt||!h||me||fe)return;if(re&&(0,C.iL)(re[re.length-1]))return;const e=Xe.current;(!re||1===re.length||re.length<d.yo2/2&&e.firstElementChild.clientHeight<=e.offsetHeight)&&bt()},[h,re,bt,fe,me]);const Tt=(0,B.i)(()=>{if(!re||!ct.current)return;const e=ct.current.filter(e=>re.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(tt.current=t.id,dt.current=t.getBoundingClientRect().top)});(0,R.A)(()=>(0,l.Uj)(()=>Tt.current()),[re,he,Tt]),(0,o.vJ)(()=>Tt.current(),[Yt,Tt]),(0,x.A)(([e,t])=>{const n=Yt(),o=Ft.current;if(Ft.current=n,re===e&&he===t&&n!==o&&void 0===o)return;const s=Xe.current;ct.current=Array.from(s.querySelectorAll(".message-list-item"));const a=ct.current[ct.current.length-1],r=ut.current?s.querySelector(`#${(0,c.GZ)(ut.current)}`):void 0,u=re&&e&&re[re.length-1]!==e[e.length-1],h=re?.[0]!==e?.[0]&&re?.length===d.yo2/2+1,m=u&&!h;he&&m&&re&&re.length<d.yo2/2&&!s.parentElement.classList.contains(st)&&(0,l.Uj)(()=>s.firstElementChild.clientHeight<=2*s.offsetHeight)&&((0,i.YM)(s.parentElement,st),setTimeout(()=>{s.parentElement&&(0,i.HW)(s.parentElement,st)},500)),m&&(clearTimeout(ft.current),ft.current=void 0,(0,i.HW)(s,at),ft.current=window.setTimeout(()=>{(0,l.RK)(()=>{(0,i.YM)(s,at),ft.current=void 0})},500)),(0,Y.U)(()=>{const{scrollTop:e,scrollHeight:i,offsetHeight:d}=s,c=et.current;let u=c-(o||d);m&&(u-=a?a.offsetHeight:0);const h=he&&t&&u<=50,p=re&&mt.current===re[re.length-1];m&&h&&!p&&(0,l.YS)(()=>{const e=!(0,O.g1)()||!r;(0,g.Ay)({container:s,element:e?a:r,position:e?"end":"start",margin:it,forceDuration:be?0:void 0})});const f=void 0!==o&&o!==n;if(f&&(0,g.o8)())return;const v=tt.current&&s.querySelector(`#${tt.current}`),A=!v&&ht.current&&s.querySelector(".unread-divider");let y;if(h&&f)y=i-d;else if(v){const t=v.getBoundingClientRect().top;y=e+(t-(dt.current||0))}else y=A?Math.min((0,b.A)(A,s).top-10,i-c):i-c;return()=>{(0,w.A)(s,Math.ceil(y)),(0,g._v)(),et.current=Math.max(Math.ceil(i-y),d),mt.current||(pt.current=!0,(0,l.YS)(()=>{pt.current=!1,Nt()}))}})},[re,he,Yt,Ft,be]),(0,T.A)(([e])=>{void 0!==e&&(0,o.VK)(200+d.xB5)},[ve]);const Dt=Boolean(!wt||S&&!N),xt=(0,A.L8)(e)&&!X&&!oe&&!te&&"thread"===n&&(!It&&!Ae&&re&&(!ct.current||0===ct.current.length)||1===re?.length&&"contactSignUp"===de?.[re[0]]?.content.action?.type||"contactSignUp"===Ae?.content?.action?.type),Lt=M&&ne&&1===re?.length&&"chatCreate"===de?.[re[0]]?.content.action?.type,Et=1===re?.length&&"topicCreate"===de?.[re[0]]?.content.action?.type,Bt=(0,v.A)("MessageList custom-scroll",Dt&&"no-avatars",!J&&"no-composer","pinned"===n&&"type-pinned",Ce&&"with-bottom-shift",we&&"with-default-bg",ve&&"select-mode-active",St&&"scrolled",!Z&&"is-animating",At&&"saved-dialog",Pe&&"hide-on-print"),Rt=Boolean(re&&It||Ae);(0,o.vJ)(()=>{Rt||Ke?.(!1)},[Rt,Ke]);const Ot=me?ot.Restricted:!ke||Rt||De?Ne&&!Rt?ot.PremiumRequired:!oe&&!ie||Rt||t!==a.l3?xt?ot.ContactGreeting:re&&(!It||Lt||Et)?ot.NoMessages:Rt?ot.MessageList:ot.Loading:ot.AccountInfo:ot.StarsRequired;return(0,q.Y)(j.Ay,{ref:Xe,className:Bt,name:"fade",activeKey:Ot,shouldCleanup:!0,onScroll:kt,onWheel:Pt,onMouseDown:F.l,children:Ot===ot.Restricted?(0,q.Y)("div",{className:"empty",children:(0,q.Y)("span",{children:pe?.[0]?.text||"This is a private "+(S?"channel":"chat")})}):Ot===ot.StarsRequired?(0,q.Y)(nt,{paidMessagesStars:ke,peerId:xe||e}):Ot===ot.PremiumRequired?(0,q.Y)(nt,{peerId:e}):Ot===ot.AccountInfo?(0,q.Y)(ue,{chatId:e,hasMessages:Rt}):Ot===ot.ContactGreeting?(0,q.Y)($,{userId:e},e):Ot===ot.NoMessages?(0,q.Y)(Ze,{chatId:e,topic:Ie,type:n,isChatWithSelf:X,isGroupChatJustCreated:Lt}):Ot===ot.MessageList?(0,q.Y)(We,{canShowAds:Ye&&S,chatId:e,isComments:ce,isChannelChat:S,isChatMonoforum:Q,isSavedDialog:vt,messageIds:re||[Ae.id],messageGroups:It||k([Ae]),getContainerHeight:Yt,isViewportNewest:Boolean(he),isUnread:Boolean(le),isEmptyThread:ge,withUsers:wt,noAvatars:Dt,containerRef:Xe,anchorIdRef:tt,memoUnreadDividerBeforeIdRef:ht,memoFirstUnreadIdRef:ut,threadId:t,type:n,isReady:Z,hasLinkedChat:ye,isSchedule:!!It&&"scheduled"===n,shouldRenderAccountInfo:oe||ie,nameChangeDate:se,photoChangeDate:ae,noAppearanceAnimation:!It||!gt.current,isQuickPreview:Oe,canPost:J,canManageBotForumTopics:W,shouldScrollToBottom:_,onScrollDownToggle:Ke,onNotchToggle:ze,onIntersectPinnedMessage:Ue}):(0,q.Y)(V.A,{color:"white",backgroundColor:"dark"})})}));function lt(e){return e+1e-6}},47058(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(87357),a=n(85982),r=n(43874),d=n(39351),l=n(17712),c=n(59030),u=n(64493),h=n(22699),m=n(24433);var p=n(20021);const g=(0,o.ph)(({title:e,link:t,isDisabled:n,className:g,withShare:f,onRevoke:v})=>{const A=(0,d.A)(),y=(0,c.A)(),{showNotification:C,openChatWithDraft:w}=(0,i.ko)(),{isMobile:I}=(0,r.Ay)(),b=!v,S=(0,l.A)(()=>{(0,a.eM)(t),C({message:{key:"LinkCopied"}})}),M=(0,l.A)(()=>{n||S()}),N=(0,l.A)(()=>{w({text:{text:t}})}),k=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,p.Y)(u.A,{round:!0,ripple:!I,size:"smaller",color:"translucent",className:t?"active":"",iconName:"more",onClick:e,ariaLabel:A("AriaLabelOpenMenu")}),[I,A]);return(0,p.FD)("div",{className:g,children:[(0,p.Y)("p",{className:"vCMpiQTJ",children:y(e||"InviteLink.InviteLink")}),(0,p.FD)("div",{className:"xNjJHI7j",children:[(0,p.Y)("input",{className:(0,s.A)("form-control","Ag6k_p7b"),value:t,readOnly:!0,onClick:M}),b?(0,p.Y)(u.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,iconName:"copy",disabled:n,onClick:M}):(0,p.FD)(h.A,{className:"p7t3macG",trigger:k,positionX:"right",children:[(0,p.Y)(m.A,{icon:"copy",onClick:M,disabled:n,children:y("Copy")}),v&&(0,p.Y)(m.A,{icon:"delete",onClick:v,destructive:!0,children:y("RevokeButton")})]})]}),f&&(0,p.Y)(u.A,{disabled:n,onClick:N,className:"Sbagy_Tm",children:y("FolderLinkScreen.LinkActionShare")})]})})},47067(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(90709),d=n(96115),l=n(63495),c=n(96454),u=n(48899),h=n(87894),m=n(63527),p=n(39351);const g=({chat:e,user:t,folderId:n,isPinned:g,isMuted:f,canChangeFolder:v,isSavedDialog:A,currentUserId:y,isPreview:C,topicIds:w,handleDelete:I,handleMute:b,handleUnmute:S,handleChatFolderChange:M,handleReport:N},k=!1)=>{const{toggleChatPinned:Y,toggleSavedDialogPinned:F,toggleChatArchived:P,markChatMessagesRead:T,markChatUnread:D,openChatInNewTab:x,openQuickPreview:L}=(0,i.ko)(),E=(0,p.A)(),{isSelf:B}=t||{},R=t?.id===a.zv8,O=(0,o.hb)(t=>{if(e?.id)return(0,h.pA)(w||[],n=>[n,(0,d.a1)(t,e?.id,n)])},[e?.id,w]),U=(0,m.LV)(O),K=(0,o.hb)(t=>{if(e?.id)return(0,d.a1)(t,e.id,s.l3)},[e?.id]),z=(0,m.Ay)(K),V=(0,o.Kr)(()=>{if(e)return A?E("Delete"):(0,u.L8)(e.id)||(0,r.IC)(e)?E("DeleteChat"):(0,r.WX)(e)?E("ChannelLeave"):E("GroupLeaveGroup")},[e,A,E]);return(0,o.Kr)(()=>{if(!e||C)return;const o=c.OS&&{title:l.Vq?E("ChatListOpenInNewWindow"):E("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{x(A?{chatId:y,threadId:e.id}:{chatId:e.id})}},i=!A&&!e.isForum&&{title:E("QuickPreview"),icon:"eye-outline",handler:()=>{L({id:e.id})}},s=()=>{A?F({id:e.id}):Y({id:e.id,folderId:n})},a=g?{title:E("ChatListUnpinFromTop"),icon:"unpin",handler:s}:{title:E("ChatListPinToTop"),icon:"pin",handler:s},d=V?{title:V,icon:"delete",destructive:!0,handler:I}:void 0;if(A)return(0,h.oE)([o,i,a,d]);const u=v?{title:E("ChatListContextAddToFolder"),icon:"folder",handler:M}:void 0,m=f?{title:E("ChatsUnmute"),icon:"unmute",handler:S}:{title:`${E("ChatsMute")}...`,icon:"mute",handler:b};if(k)return(0,h.oE)([o,i,a,u,m]);const p=z?.unreadCount||z?.hasUnreadMark||Object.values(U||{}).some(e=>e?.unreadCount)?{title:E("ChatListContextMarkAsRead"),icon:"readchats",handler:()=>T({id:e.id})}:void 0,w=z?.unreadCount||z?.hasUnreadMark||e.isForum?void 0:{title:E("ChatListContextMarkAsUnread"),icon:"unread",handler:()=>D({id:e.id})},O=(0,r.TJ)(e)?{title:E("Unarchive"),icon:"unarchive",handler:()=>P({id:e.id})}:{title:E("Archive"),icon:"archive",handler:()=>P({id:e.id})},K=N&&!t&&((0,r.WX)(e)||(0,r.YE)(e))?{title:E("ReportPeerReport"),icon:"flag",handler:N}:void 0,j=void 0!==n;return(0,h.oE)([o,i,u,p,w,a,!B&&m,!B&&!R&&!j&&O,K,d])},[e,C,E,A,g,V,I,v,M,f,S,b,k,z,U,N,t,n,B,R,y])}},47366(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(17712);function s(e=5){const[t,n]=(0,o.J0)(!0),[s,a]=(0,o.J0)(!0);return{isAtBeginning:t,isAtEnd:s,handleScroll:(0,i.A)(t=>{const{scrollHeight:o,scrollTop:i,clientHeight:s}=t.target;n(i<e),a(o-i-s<e)}),updateScrollState:(0,i.A)(t=>{if(!t)return n(!0),void a(!0);const{scrollHeight:o,scrollTop:i,clientHeight:s}=t;n(i<e),a(o-i-s<e)})}}},47526(e,t,n){n.d(t,{KE:()=>d,PP:()=>l,_u:()=>r,zS:()=>a});const o={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},i=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function a(e,t,n=15){const{lat:i,long:s}=t,a=o[e];switch(e){case"google":return`${a}/place/${i}+${s}/@${i},${s},${n}z`;case"bing":return`${a}?cp=${i}~${s}&lvl=${n}&sp=point.${i}_${s}`;case"apple":return`${a}?q=${i},${s}`;default:return`${a}/?mlat=${i}&mlon=${s}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function d(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function l(e){return e?i.get(e)||i.get(e.split("/")[0])||s[(t=e,t.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0)%s.length)]:"#008df2";var t}},48227(e,t,n){n.d(t,{A:()=>l});var o=n(84051),i=n(48775),s=n(39351),a=n(19806),r=n(94189);var d=n(20021);const l=(0,o.ph)(({isOpen:e,onClose:t,userName:n,messagePriceInStars:o,messagesCount:l,shouldAutoApprove:c,setAutoApprove:u,confirmHandler:h})=>{const m=(0,s.A)(),p=m("ConfirmationModalPaymentForMessage",{user:n,amount:(0,i.Kk)(m,o),totalAmount:(0,i.Kk)(m,o*l),count:l},{withMarkdown:!0,withNodes:!0,pluralValue:l}),g=m("PayForMessage",{count:l},{withNodes:!0,pluralValue:l});return(0,d.FD)(r.A,{title:m("TitleConfirmPayment"),confirmLabel:g,isOpen:e,onClose:t,confirmHandler:h,children:[p,(0,d.Y)(a.A,{className:"eScpikxM",label:m("DoNotAskAgain"),checked:c,onCheck:u})]})})},48553(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(66644),l=n(90709),c=n(11597),u=n(96454),h=n(48899),m=n(97822),p=n(2178),g=n(39351),f=n(17712),v=n(59030),A=n(87412),y=n(64493),C=n(22699),w=n(96530),I=n(24433),b=n(60859),S=n(80089),M=n(80464),N=n(20021);const k=e=>{const{isOpen:t}=e,n=(0,M.A)(S.ar.Extra,"HeaderMenuContainer",!t);return n?(0,N.Y)(n,{...e}):void 0},Y=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n,messageListType:o,isMobile:i})=>{const a=(0,c.hds)(e,t),r=Boolean(a&&(0,l.WX)(a)),d=Boolean(a&&(0,l.Vs)(a)),m=(0,c.wmb)(e),p=(0,c.Qq_)(e),g=(0,h.L8)(t),{doNotTranslate:f}=e.settings.byKey,v=(0,c._ls)(e,t);if(!a||v||(0,c.rTV)(e))return{noMenu:!0,language:m,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,I=(0,c.nZ4)(e,t),b="thread"===o&&n===s.l3,S="thread"===o&&n!==s.l3,M=(0,c.gjV)(e,i),N=(0,l.cG)(t,n,e.currentUserId),k=!!g&&(0,c.apd)(e,t),Y=Boolean(A&&k),F=!Y&&Boolean((0,c.I_m)(e,t)),P=k&&!A,T=Boolean((b||a.isForum)&&(r||d)&&a.isNotJoined&&!a.isMonoforum),D=b||S,x=u.OL&&(0,h.L8)(a.id)&&!I&&!A&&!a.isSupport&&!(0,l.Qe)(a.id),L=b&&!I&&!T,E=N||b&&!T,B=u.OL&&b&&a.isCallActive,R=u.OL&&b&&!a.isCallActive&&(a.adminRights?.manageCall||a.isCreator&&(0,l.yn)(a))&&!a.isMonoforum,O=b&&y?.canViewStatistics,U=b&&y?.canViewMonetization,K=b&&!a.isMonoforum&&(d||r)&&(O||(0,l.ub)(a,"postStories")),z=!K&&(d||r)&&!a.isMonoforum,V=b?y?.requestsPending:void 0,j=Boolean(a?.isNotJoined&&a.isJoinToSend),J=Boolean(a?.isNotJoined&&a.isJoinRequest),G=!(0,c.PKK)(e),q=Boolean((0,c.qZq)(e,t)),$=(0,c.jGY)(e,t)&&!w?.isTranslationDisabled,H=(0,c.trm)(e),W=(0,l.WX)(a)?a.linkedMonoforumId:void 0;return{noMenu:!1,isChannel:r,isRightColumnShown:M,canStartBot:F,canRestartBot:Y,canSubscribe:T,canSearch:D,canCall:x,canMute:L,canViewStatistics:O,canViewMonetization:U,canViewBoosts:K,canShowBoostModal:z,canLeave:E,canEnterVoiceChat:B,canCreateVoiceChat:R,pendingJoinRequests:V,shouldJoinToSend:j,shouldSendJoinRequest:J,noAnimation:G,canTranslate:$,isTranslating:q,translationLanguage:p,language:m,doNotTranslate:f,detectedChatLanguage:a.detectedLanguage,canUnblock:P,isAccountFrozen:H,channelMonoforumId:W}})(({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:l,canStartBot:c,canRestartBot:h,canUnblock:m,canSubscribe:S,canSearch:M,canCall:Y,canMute:P,canViewStatistics:T,canViewMonetization:D,canViewBoosts:x,canShowBoostModal:L,canLeave:E,canEnterVoiceChat:B,canCreateVoiceChat:R,channelMonoforumId:O,pendingJoinRequests:U,isRightColumnShown:K,isForForum:z,canExpandActions:V,shouldJoinToSend:j,shouldSendJoinRequest:J,noAnimation:G,canTranslate:q,isTranslating:$,translationLanguage:H,language:W,detectedChatLanguage:_,doNotTranslate:Q,isAccountFrozen:Z,onTopicSearch:X})=>{const{joinChannel:ee,sendBotCommand:te,openMiddleSearch:ne,restartBot:oe,requestMasterAndRequestCall:ie,requestNextManagementScreen:se,showNotification:ae,openChat:re,requestChatTranslation:de,togglePeerTranslations:le,openChatLanguageModal:ce,setSettingOption:ue,unblockUser:he,setViewForumAsMessages:me,openFrozenAccountModal:pe,openCocoonModal:ge}=(0,i.ko)(),fe=(0,o.li)(),ve=(0,v.A)(),Ae=(0,g.A)(),[ye,Ce]=(0,o.J0)(!1),[we,Ie]=(0,o.J0)(void 0),be=(0,f.A)(()=>{Ce(!0);const e=fe.current.getBoundingClientRect();Ie({x:e.right,y:e.bottom})}),Se=(0,f.A)(()=>{Ce(!1)}),Me=(0,f.A)(()=>{Ie(void 0)}),Ne=(0,f.A)(()=>{ee({chatId:e}),J&&ae({message:ve(l?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})}),ke=(0,f.A)(()=>{te({command:"/start"})}),Ye=(0,f.A)(()=>{oe({chatId:e})}),Fe=(0,f.A)(()=>{he({userId:e})}),Pe=(0,f.A)(()=>{de($?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:H})}),Te=(0,f.A)(()=>{se({screen:a.je.JoinRequests})}),De=(0,f.A)(()=>{z?X?.():(ne(),G?(0,d.YS)(()=>{(0,d.Uz)(F)}):F())}),xe=(0,f.A)(()=>{re({id:e}),me({chatId:e,isEnabled:!0})}),Le=(0,f.A)(()=>{Z?pe():ie({userId:e})}),Ee=(0,f.A)(e=>{M&&u.lE&&!e.shiftKey&&(e.preventDefault(),De())}),Be=(0,o.hb)((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=ve(n);if(o!==n)return ve(e,o);const i=new Intl.DisplayNames([W],{type:"language"}).of(t);return ve(`${e}Other`,i)},[W,ve]),Re=(0,o.Kr)(()=>$?ve("ShowOriginalButton"):Be("TranslateToButton",H),[H,Be,$,ve]),Oe=(0,o.Kr)(()=>{if(_)return Be("DoNotTranslateLanguage",_)},[Be,_]),Ue=(0,f.A)(()=>{le({chatId:e,isEnabled:!1}),de({chatId:e,toLanguageCode:void 0})}),Ke=(0,f.A)(()=>{ce({chatId:e})}),ze=(0,f.A)(()=>{ge()}),Ve=(0,f.A)(()=>{_&&(ue({doNotTranslate:[...Q,_]}),de({chatId:e,toLanguageCode:void 0}),ae({message:Be("AddedToDoNotTranslate",_)}))});(0,p.v)((0,o.Kr)(()=>({"Mod+F":Ee}),[]));const je=(0,o.Kr)(()=>({onTrigger:e,isOpen:t})=>(0,N.Y)(y.A,{round:!0,ripple:K,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:ve("TranslateMessage"),iconName:"language"}),[K,ve]);return(0,N.FD)("div",{className:"HeaderActions",children:[!z&&q&&(0,N.FD)(C.A,{className:"stickers-more-menu with-menu-transitions",trigger:je,positionX:"right",children:[(0,N.Y)(I.A,{icon:"language",onClick:Pe,children:Re}),(0,N.Y)(I.A,{icon:"replace",onClick:Ke,children:ve("Chat.Translate.Menu.To")}),(0,N.Y)(b.A,{}),_&&(0,N.Y)(I.A,{icon:"hand-stop",onClick:Ve,children:Oe}),(0,N.Y)(I.A,{icon:"close-circle",onClick:Ue,children:ve("Hide")}),(0,N.Y)(b.A,{}),(0,N.Y)(I.A,{withWrap:!0,onClick:ze,children:Ae("TranslateMenuCocoon",{link:(0,N.Y)(w.A,{isPrimary:!0,onClick:e=>e.preventDefault(),children:Ae("TranslateMenuCocoonLinkText")})},{withNodes:!0,withMarkdown:!0,specialReplacement:{"🥚":(0,N.Y)(A.A,{documentId:r.f8_})}})})]}),!s&&(0,N.FD)(N.FK,{children:[V&&!J&&(S||j)&&(0,N.Y)(y.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ne,children:ve(l?"ProfileJoinChannel":"ProfileJoinGroup")}),V&&J&&(0,N.Y)(y.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Ne,children:ve("ChannelJoinRequest")}),V&&c&&(0,N.Y)(y.A,{size:"smaller",ripple:!0,fluid:!0,onClick:ke,children:ve("BotStart")}),V&&h&&(0,N.Y)(y.A,{size:"tiny",ripple:!0,fluid:!0,onClick:Ye,children:ve("BotRestart")}),V&&m&&(0,N.Y)(y.A,{size:"smaller",ripple:!0,fluid:!0,onClick:Fe,children:ve("Unblock")}),M&&(0,N.Y)(y.A,{round:!0,ripple:K,color:"translucent",size:"smaller",onClick:De,ariaLabel:ve("Conversation.SearchPlaceholder"),iconName:"search"}),Y&&(0,N.Y)(y.A,{round:!0,color:"translucent",size:"smaller",onClick:Le,ariaLabel:"Call",iconName:"phone"})]}),!z&&Boolean(U)&&(0,N.Y)(y.A,{round:!0,className:"badge-button",ripple:K,color:"translucent",size:"smaller",iconName:"user",onClick:Te,ariaLabel:ve(l?"SubscribeRequests":"MemberRequests"),children:(0,N.Y)("div",{className:"badge",children:U})}),(0,N.Y)(y.A,{ref:fe,className:ye?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:be,iconName:"more"}),we&&(0,N.Y)(k,{chatId:e,threadId:t,isOpen:ye,anchor:we,withExtraActions:s||!V,isChannel:l,canStartBot:c,canSubscribe:S,canSearch:M,canCall:Y,canMute:P,canViewStatistics:T,canViewBoosts:x,canViewMonetization:D,canShowBoostModal:L,canLeave:E,canEnterVoiceChat:B,canCreateVoiceChat:R,pendingJoinRequests:U,onJoinRequestsClick:Te,withForumActions:z,channelMonoforumId:O,onSubscribeChannel:Ne,onSearchClick:De,onAsMessagesClick:xe,onClose:Se,onCloseAnimationEnd:Me})]})}));function F(){const e=document.querySelector("#MiddleSearch input");e&&(0,m.A)(e)}},48885(e,t,n){n.d(t,{A:()=>c,S:()=>u});var o=n(84051),i=n(61433),s=n(66644),a=n(14737),r=n(17712),d=n(93545),l=n(672);function c({ref:e,isOpen:t,isDisabled:n,withResizeObserver:i,onStateChange:c}){const[u,h]=(0,o.J0)(t),m=(0,o.li)(),p=e||m,g=(0,o.li)(0),f=(0,r.A)(()=>{h(!0),c?.({element:void 0,height:0,isOpen:!1})});(0,o.vJ)(()=>{n&&f()},[n]),(0,o.vJ)(()=>{t&&h(!0)},[t]),(0,o._W)(f),(0,a.A)(()=>{h(!1),c?.({height:0,isOpen:!1})},t?void 0:450);const v=(0,o.hb)(()=>{const e=p.current;!n&&e&&u&&(t?(0,s.gm)(()=>{const n=e.offsetHeight;return g.current=n,()=>{c?.({element:e,height:n,isOpen:t})}}):c?.({element:e,height:0,isOpen:!1}))},[t,u,n,p,c]),A=(0,l.A)(()=>{const e=p.current;e&&e.offsetHeight!==g.current&&v()},[v,p],100,!0);return(0,o.Nf)(v,[v]),(0,d.A)(p,A,!i||!u),{shouldRender:u,ref:p}}function u({list:e,noTransition:t=!1,zIndexIncrease:n}){let o=0;for(let a=0;a<e.length;a++){const r=e[a],d=r.element;if(!d){r.isSpacer&&(o+=r.height);continue}const l=`${o}px`,c=()=>{(0,i.Tv)(d,{transform:`translateY(${r.isOpen?l:`calc(${l} - 100% - 0.5rem)`})`,zIndex:String(-a),transition:t?"none":""})};d.dataset.isPanelOpen||!r.isOpen||t?c():((0,i.Tv)(d,{transform:`translateY(calc(${l} - 100%))`,zIndex:String(n?a:-a),transition:"none"}),d.dataset.isPanelOpen="true",(0,s.Uz)(c)),o+=r.height}}},48906(e,t,n){n.d(t,{A:()=>i});var o=n(20021);const i=function({isOwn:e}){const t=e?"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z":"M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z";return(0,o.FD)("svg",{width:"9",height:"20",className:"svg-appendix",children:[(0,o.Y)("defs",{children:(0,o.FD)("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"messageAppendix",children:[(0,o.Y)("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,o.Y)("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,o.Y)("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"})]})}),(0,o.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,o.Y)("path",{d:t,fill:"#000",filter:"url(#messageAppendix)"}),(0,o.Y)("path",{d:t,fill:e?"#EEFFDE":"FFF",className:"corner"})]})]})}},49068(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"EmojiTooltip",!t);return n?(0,s.Y)(n,{...e}):void 0}},49642(e,t,n){n.d(t,{D5:()=>s,Eg:()=>r,HW:()=>d,MV:()=>i,hm:()=>l,wp:()=>c});const o={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function i(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&a(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function a(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach(([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}})}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,a(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function d(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function c({title:e,artist:t,album:n,artwork:o}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:o})}},51083(e,t,n){n.d(t,{A:()=>b});var o=n(84051),i=n(13439),s=n(89925),a=n(90709),r=n(11597),d=n(96115),l=n(87357),c=n(76023),u=n(4961),h=n(39351),m=n(17712),p=n(41036),g=n(21849),f=n(80999),v=n(34431),A=n(18276),y=n(38102),C=n(80477),w=n(20021);const I=2.5*c.$,b=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const o=(0,r.hds)(e,t),i=o?(0,r.ToO)(e,o):void 0,s=Boolean((0,r.zeq)(e,t)),a=n?(0,r.S0q)(e,t,n):void 0;return{chat:o,onlineCount:i,topic:a,areMessagesLoaded:s,messagesCount:a&&(0,d.Qb)(e,t,n),self:(0,r.mBe)(e,e.currentUserId),monoforumChannel:(0,r.k2W)(e,t)}})(({typingStatus:e,className:t,statusIcon:n,avatarSize:d="medium",noAvatar:c,status:b,withDots:S,withMediaViewer:M,withUsername:N,withFullInfo:k,withUpdatingStatus:Y,withChatType:F,noRtl:P,chat:T,onlineCount:D,areMessagesLoaded:x,topic:L,messagesCount:E,noStatusOrTyping:B,withStory:R,storyViewerOrigin:O,noEmojiStatus:U,emojiStatusSize:K,isSavedDialog:z,self:V,withMonoforumStatus:j,monoforumChannel:J,onClick:G,onEmojiStatusClick:q})=>{const{loadFullChat:$,openMediaViewer:H,loadMoreProfilePhotos:W}=(0,i.ko)(),_=!j&&J?J:T,Q=(0,h.A)(),Z=_&&(0,a.Vs)(_),X=Boolean(_?.isForum&&L),{id:ee,isMin:te}=_||{},ne=(0,r._ls)((0,i.mS)(),ee);(0,o.vJ)(()=>{ee&&!te&&(k&&$({chatId:ee}),M&&W({peerId:ee,isPreload:!0}))},[ee,te,k,Z,M]);const oe=(0,m.A)((e,t)=>{_&&t&&(e.stopPropagation(),H({isAvatarView:!0,chatId:_.id,mediaIndex:0,origin:"jumbo"===d?s.TQ.ProfileAvatar:s.TQ.MiddleHeaderAvatar}))}),ie=(0,o.Kr)(()=>_&&N&&(0,a.Kl)(_),[_,N]);if(_)return(0,w.FD)("div",{className:(0,l.A)("ChatInfo",t),dir:!P&&Q.isRtl?"rtl":void 0,onClick:G,children:[!c&&!X&&(0,w.FD)(w.FK,{children:[z&&V&&(0,w.Y)(g.A,{size:d,peer:V,isSavedMessages:!0,className:"saved-dialog-avatar"},"saved-messages"),(0,w.Y)(g.A,{className:(0,l.A)(z&&"overlay-avatar"),size:d,peer:_,withStory:R,asMessageBubble:Boolean(J),storyViewerOrigin:O,storyViewerMode:"single-peer",isSavedDialog:z,onClick:M?oe:void 0},_.id)]}),X&&(0,w.Y)(y.A,{topic:L,className:"topic-header-icon",size:I}),(0,w.FD)("div",{className:"info",children:[L?(0,w.Y)("h3",{dir:"auto",className:"fullName",children:(0,u.A)(L.title)}):(0,w.Y)(v.A,{peer:_,isMonoforum:!j&&Boolean(J),emojiStatusSize:K,withEmojiStatus:!U,isSavedDialog:z,onEmojiStatusClick:q}),!B&&function(){if(Y&&!x&&!ne)return(0,w.Y)(f.A,{className:"status",content:Q("Updating")});if(j)return(0,w.Y)("span",{className:"status",dir:"auto",children:Q("MonoforumStatus")});if(T?.isMonoforum)return;if(b)return S?(0,w.Y)(f.A,{className:"status",content:b}):(0,w.FD)("span",{className:"status",dir:"auto",children:[n&&(0,w.Y)(A.A,{className:"status-icon",name:n}),(0,u.A)(b)]});if(!_)return;if(e)return(0,w.Y)(C.A,{typingStatus:e});if(X)return(0,w.Y)("span",{className:"status",dir:"auto",children:(0,w.Y)(p.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==E?1:2,className:"message-count-transition",children:void 0!==E?Q("Messages",{count:E},{pluralValue:E}):Q("ChatInfoNoMessages")})});if(F)return(0,w.Y)("span",{className:"status",dir:"auto",children:Q((0,a.yS)(_))});const t=(0,w.Y)("span",{className:"group-status",children:(0,a.sT)(Q,_)}),o=D?Q("OnlineCount",{count:D},{pluralValue:D}):void 0,i=o?(0,w.Y)("span",{className:"online-status",children:o}):void 0;return(0,w.FD)("span",{className:"status",children:[ie&&(0,w.Y)("span",{className:"handle withStatus",children:ie}),i?Q("GroupStatusWithOnline",{status:t,onlineCount:i},{withNodes:!0}):t]})}()]})]})}))},51644(e,t,n){n.d(t,{A:()=>Y});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(90709),d=n(87357),l=n(95807),c=n(40435),u=n(35127),h=n(43874),m=n(37661),p=n(5912),g=n(17712),f=n(37859),v=n(37960),A=n(69419),y=n(29886),C=n(73767),w=n(34201),I=n(61097),b=n(18276),S=n(27860),M=n(14413),N=n(35913),k=n(20021);const Y=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({id:e,photo:t,messageText:n,isOwn:Y,noAvatars:F,canAutoLoad:P,isInSelectMode:T,isSelected:D,uploadProgress:x,forcedWidth:L,size:E="inline",dimensions:B,asForwarded:R,nonInteractive:O,shouldAffectAppendix:U,isDownloading:K,isProtected:z,theme:V,isInWebPage:j,clickArg:J,className:G,isMediaNsfw:q,observeIntersection:$,onClick:H,onCancelUpload:W,needsAgeVerification:_})=>{const Q=(0,o.li)(),Z="extendedMediaPreview"===t.mediaType,X=Z?void 0:t.blobUrl,ee=(0,p.Vz)(Q,$),{isMobile:te}=(0,h.Ay)(),[ne,oe]=(0,o.J0)(P),ie=ne&&ee&&!Z,{mediaData:se,loadProgress:ae}=(0,A.A)(Z?void 0:(0,r.rI)(t,E),!ie),re=(0,y.A)(se),de=X||se,{ref:le,shouldRender:ce}=(0,v.A)({hasMediaData:Boolean(de),withShouldRender:!0}),ue=Boolean(L),[he]=(0,o.J0)(!de),me=Boolean(de),pe=(0,I.A)(t,me);(0,v.A)({ref:pe,hasMediaData:!me});const ge=(0,I.A)(t,!ue),fe=(0,r.VD)(t),{updateContentSettings:ve,openAgeVerificationModal:Ae}=(0,i.ko)(),[ye,Ce,we]=(0,m.A)(),[Ie,be]=(0,o.J0)(!1),Se=Z||t.isSpoiler||q,[Me,Ne,ke]=(0,m.A)(Se);(0,o.vJ)(()=>{Se?Ne():ke()},[Se]);const Ye=(0,g.A)(()=>{we(),ke(),Ie&&ve({isSensitiveEnabled:!0})}),{loadProgress:Fe}=(0,A.A)(Z?void 0:(0,r.rI)(t,"download"),!K,Z?void 0:(0,r.Cz)(t,"download")),{isUploading:Pe,isTransferring:Te,transferProgress:De}=(0,r.LK)(x||(K?Fe:ae),ie&&!de,void 0!==x),xe=!1===(0,C.A)(ne),{ref:Le,shouldRender:Ee}=(0,w.A)({isOpen:Te,noMountTransition:xe,className:"slow",withShouldRender:!0}),{ref:Be,shouldRender:Re}=(0,w.A)({isOpen:!de&&!ne,withShouldRender:!0}),{ref:Oe,shouldRender:Ue}=(0,w.A)({isOpen:Te,noMountTransition:xe,withShouldRender:!0}),Ke=(0,g.A)(e=>{if(Pe)W?.(J);else{if(de)return Me?q?_?void Ae():void Ce():void ke():void H?.(J,e);oe(e=>!e)}});(0,f.A)(([e])=>{if(!U)return void(e&&Q.current.closest(s.KFG).removeAttribute(s.D3G));const t=Q.current.closest(s.KFG);if(de){const e=Number(t.closest(".Message").dataset.messageId);(0,c.A)(de,Boolean(Y),e,D,V).then(e=>{(0,a.RK)(()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(s.D3G,"")})})}else t.classList.add("has-appendix-thumb")},[U,de,Y,T,D,V]);const{width:ze,height:Ve,isSmall:je}=B||(0,u.yA)({media:t,isOwn:Y,asForwarded:R,noAvatars:F,isMobile:te,messageText:n,isInWebPage:j}),Je=(0,d.A)("media-inner",!Pe&&!O&&"interactive",je&&"small-image",(ze===Ve||"pictogram"===E)&&"square-image",Ve<u.ej&&"fix-min-height",G),Ge=B&&(0,l.A)(`left: ${B.x}px`,`top: ${B.y}px`),qe="inline"===E?(0,l.A)(`height: ${Ve}px`,`min-width: ${ze}px`,Ge):void 0;return(0,k.FD)("div",{id:e,ref:Q,className:Je,style:qe,onClick:Pe?void 0:Ke,children:[ue&&(0,k.Y)("canvas",{ref:ge,className:"thumbnail blurred-bg"}),ce&&(0,k.Y)("img",{ref:le,src:de||re,className:(0,d.A)("full-media",ue&&"with-blurred-bg"),alt:"",style:L?`width: ${L}px`:void 0,draggable:!z}),he&&(0,k.Y)("canvas",{ref:pe,className:"thumbnail"}),z&&(0,k.Y)("span",{className:"protector"}),Ee&&!Re&&(0,k.Y)("div",{ref:Le,className:"media-loading",children:(0,k.Y)(N.A,{progress:De,onClick:Pe?Ke:void 0})}),Re&&(0,k.Y)(b.A,{ref:Be,name:"download"}),(0,k.Y)(S.A,{isVisible:Me,withAnimation:!0,thumbDataUri:fe,width:ze,height:Ve,className:"media-spoiler",isNsfw:q}),Ue&&(0,k.Y)("span",{ref:Oe,className:"message-transfer-progress",children:`${Math.round(100*De)}%`}),(0,k.Y)(M.A,{isOpen:ye,onClose:we,shouldAlwaysShow:Ie,onAlwaysShowChanged:be,confirmHandler:Ye})]})}))},52844(e,t,n){let o;function i(e="*",t,n=!1){o||(o=document.createElement("input"),o.setAttribute("type","file")),o.setAttribute("accept",e),n?o.removeAttribute("multiple"):o.setAttribute("multiple","multiple"),o.onchange=null,o.value="",o.onchange=t,o.click()}n.d(t,{p:()=>i})},52988(e,t,n){n.d(t,{A:()=>w});var o=n(84051),i=n(96454),s=n(87357),a=n(17663),r=n(91525),d=n(76023),l=n(4961),c=n(43874),u=n(45470),h=n(39351),m=n(83057),p=n(59030),g=n(50680),f=n(96530),v=n(35913),A=n(70832),y=n(18276),C=n(20021);const w=(0,o.ph)(({ref:e,id:t,name:n,size:w,extension:I="",timestamp:b,sender:S,thumbnailDataUri:M,previewData:N,className:k,smaller:Y,isTransferring:F,isUploading:P,isSelectable:T,isSelected:D,transferProgress:x,actionIcon:L,onClick:E,onDateClick:B})=>{const R=(0,p.A)(),O=(0,h.A)();let U=(0,o.li)();e&&(U=e);const{isMobile:K}=(0,c.Ay)(),[z]=(0,o.J0)(!N),V=Boolean(N),j=(0,u.A)(M,V,K&&!i.QH),J=(0,m.A)(!V),{shouldRender:G,transitionClassNames:q}=(0,g.A)(F,void 0,!0),$=(0,r.fE)(I),{width:H,height:W}=(0,d.tP)(Y),_=(0,s.A)("File",k,Y&&"smaller",E&&!P&&"interactive",D&&"file-is-selected");return(0,C.FD)("div",{id:t,ref:U,className:_,dir:O.isRtl?"rtl":void 0,children:[T&&(0,C.Y)("div",{className:"message-select-control no-selection",children:D&&(0,C.Y)(y.A,{name:"check",className:"message-select-control-icon"})}),(0,C.FD)("div",{className:"file-icon-container",onClick:P?void 0:E,children:[M||N?(0,C.FD)("div",{className:"file-preview media-inner",children:[(0,C.Y)("img",{src:N,className:"full-media",width:H,height:W,draggable:!1,alt:""}),z&&(0,C.Y)("canvas",{ref:j,className:(0,s.A)("thumbnail",J)})]}):(0,C.Y)("div",{className:`file-icon ${$}`,children:I.length<=4&&(0,C.Y)("span",{className:"file-ext",dir:"auto",children:I})}),G&&(0,C.Y)("div",{className:(0,s.A)("file-progress",$,q),children:(0,C.Y)(v.A,{progress:x,size:Y?"s":"m",onClick:P?E:void 0})}),E&&(0,C.Y)(y.A,{name:L||"download",className:(0,s.A)("action-icon",G&&"hidden")})]}),(0,C.FD)("div",{className:"file-info",children:[(0,C.Y)("div",{className:"file-title",dir:"auto",title:n,children:(0,l.A)(n)}),(0,C.FD)("div",{className:"file-subtitle",dir:"auto",children:[(0,C.Y)(A.A,{size:w,progress:F?x:void 0}),S&&(0,C.FD)(C.FK,{children:[(0,C.Y)("span",{className:"bullet",children:""}),(0,C.Y)("span",{className:"file-sender",children:(0,l.A)(S)})]}),!S&&Boolean(b)&&(0,C.FD)(C.FK,{children:[(0,C.Y)("span",{className:"bullet",children:""}),(0,C.Y)(f.A,{onClick:B,children:(0,a.fS)(R,1e3*b,!0)})]})]})]}),S&&Boolean(b)&&(0,C.Y)(f.A,{onClick:B,children:(0,a.be)(R,1e3*b)})]})})},53827(e,t,n){n.d(t,{_K:()=>g,dj:()=>A,kz:()=>f});var o=n(13439),i=n(89925),s=n(11597),a=n(96454),r=n(60343),d=n(80853),l=n(41733);const c=new Map;let u,h=[],m=[];function p(e,t){const n=u&&c.get(u);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const a=v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin||i.d9.Inline,t);if(!a)return;if(!c.has(a))return void(0,o.ko)().openAudioPlayer((0,r.ES)(y(a).messageKey));const d=c.get(a);d.onForcePlay&&d.onForcePlay(),u=a,d.audio.src&&(0,l.A)(d.audio)}function g(){const e=u&&c.get(u);e&&e.audio.pause()}function f(e,t,n,g,f){if(!c.has(e)){const n=function(e,t,n,o){const i=new Audio;function s(t){return n=>{c.has(e)&&((0,d.f)(i)||c.get(e).handlers.forEach(e=>{e(t,n)}))}}return i.addEventListener("timeupdate",s("onTimeUpdate")),i.addEventListener("play",s("onPlay")),i.addEventListener("pause",s("onPause")),i.addEventListener("loadstart",s("onLoadStart")),i.addEventListener("loadeddata",s("onLoadedData")),i.addEventListener("playing",s("onPlaying")),i.addEventListener("ended",()=>{c.has(e)&&((0,d.f)(i)||p(e))}),{audio:i,type:t,proxy:new Proxy(i,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(e,t,g,f);c.set(e,n),function(e,t){"audio"!==e.type||m.includes(t)||(m.push(t),m.sort(C)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(C))}(n,e)}const{audio:A,proxy:w,handlers:I}=c.get(e);return I.push(n),{play(n){if(!A.paused)return;const p=u&&c.get(u);p&&u!==e&&(p.audio.pause(),p.audio.currentTime=0,(0,d.f)(p.audio)&&(p.audio.dataset.preventPlayAfterPatch="true"),p.onTrackChange&&p.onTrackChange()),u=e,A.src||(A.src=n,A.preload="auto",n.includes("/progressive/")&&a.Yw&&(delete A.dataset.preventPlayAfterPatch,(0,d.C)(A))),(0,l.A)(A),function(e,t){if((0,s.nTw)((0,o.mS)()).globalSearch.currentContent===i.$C.Music)return;const{chatId:n}=(0,r.ES)(y(t).messageKey),a=(0,s.Xf0)((0,o.mS)())?.chatId,d=e=>e.startsWith(`msg${n}`)||a&&e.startsWith(`msg${a}`);"audio"===e&&(m=m.filter(d)),"voice"===e&&(h=h.filter(d))}(t,e)},pause(){u===e&&A.pause()},stop(){if(u===e){const e=A.src;A.pause(),A.addEventListener("pause",()=>{A.src="",A.src=e},{once:!0})}},setCurrentTime(t){u===e&&(A.fastSeek?A.fastSeek(t):A.currentTime=t)},setVolume(t){u===e&&(A.volume=t,A.muted=!1)},setPlaybackRate(t){u===e&&(A.playbackRate=t)},toggleMuted(e){A.muted=void 0===e?!A.muted:e},proxy:w,requestNextTrack(){p(e)},isLast:()=>!v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin),isFirst:()=>!v(e,(0,s.nTw)((0,o.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){p(e,!0)},destroy(t=!1){const o=c.get(e);o&&(o.handlers=o.handlers.filter(e=>e!==n),o.handlers.length||(o.audio.pause(),c.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(m=m.filter(n)),"voice"===e.type&&(h=h.filter(n))}(o,e),e===u&&(u=void 0)))}}}function v(e,t=i.d9.Inline,n){const o=function(e){switch(e.type){case"audio":return m;case"voice":return h;default:return}}(c.get(e));if(!o)return;if(t===i.d9.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:s}=(0,r.ES)(y(e).messageKey),a=o.filter(e=>e.startsWith(`msg${s}`)),d=a.indexOf(e);if(d<0)return;let l=t===i.d9.Inline?-1:1;return n&&(l*=-1),a[d+l]}function A(e){const t=(0,r.AD)(e);if(t)return`${t}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=y(e),{date:i,messageKey:s}=y(t),a=i-n;return 0===a?s.localeCompare(o):a}},54314(e,t,n){n.d(t,{A:()=>f});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(48899),d=n(4961),l=n(39351),c=n(17712),u=n(59030),h=n(64493),m=n(22337),p=n(21849),g=n(20021);const f=(0,o.ph)((0,i.EK)((e,{chat:t,isSavedDialog:n})=>{const o=(0,r.L8)(t.id),i=(0,a.nZ4)(e,t.id),d=(0,a.mBe)(e,t.id),l=d&&(0,s.tv)(d)&&!t.isSupport,c=o&&!i&&!l&&!n,u=o?(0,s.u0)(d):void 0;return{isPrivateChat:o,isChatWithSelf:i,isBot:l,isChannel:(0,s.WX)(t),isBasicGroup:(0,s.yn)(t),isSuperGroup:(0,s.Vs)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:u}})(({isOpen:e,chat:t,isSavedDialog:n,isChannel:o,isPrivateChat:a,isChatWithSelf:r,isBot:f,isBasicGroup:v,isSuperGroup:A,currentUserId:y,canDeleteForAll:C,contactName:w,onClose:I,onCloseAnimationEnd:b})=>{const{leaveChannel:S,deleteHistory:M,deleteSavedHistory:N,deleteChannel:k,deleteChatUser:Y,blockUser:F,deleteChat:P}=(0,i.ko)(),T=(0,u.A)(),D=(0,l.A)(),x=(0,s.Js)(D,t),L=(0,c.A)(()=>{M({chatId:t.id,shouldDeleteForAll:!0}),I()}),E=(0,c.A)(()=>{M({chatId:t.id,shouldDeleteForAll:!0}),F({userId:t.id}),I()}),B=(0,c.A)(()=>{n?N({chatId:t.id}):a?M({chatId:t.id,shouldDeleteForAll:!1}):v?t.isCreator?(M({chatId:t.id,shouldDeleteForAll:!0}),P({chatId:t.id})):(M({chatId:t.id,shouldDeleteForAll:!1}),Y({chatId:t.id,userId:y})):!o&&!A||t.isCreator?(o||A)&&t.isCreator&&k({chatId:t.id}):S({chatId:t.id}),I()}),R=(0,c.A)(()=>{o||A?(S({chatId:t.id}),I()):v&&t.isCreator?(M({chatId:t.id,shouldDeleteForAll:!1}),Y({chatId:t.id,userId:y})):B()});return(0,g.FD)(m.A,{isOpen:e,className:"DeleteChatModal",header:(0,g.FD)("div",{className:"modal-header",dir:D.isRtl?"rtl":void 0,children:[(0,g.Y)(p.A,{size:"tiny",peer:t,isSavedMessages:r}),(0,g.Y)("h3",{className:"modal-title",children:T(n?r?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"ChannelDelete":v||A?"Group.LeaveGroup":"DeleteChatUser")})]}),onClose:I,onCloseAnimationEnd:b,children:[n?(0,g.Y)("p",{children:(0,d.A)(r?T("ClearHistoryMyNotesMessage"):T("ClearHistoryMessageSingle",x),["simple_markdown","emoji"])}):o&&t.isCreator?(0,g.Y)("p",{children:(0,d.A)(T("ChatList.DeleteAndLeaveGroupConfirmation",x),["simple_markdown","emoji"])}):o&&!t.isCreator||v||A?(0,g.Y)("p",{children:(0,d.A)(T("ChannelLeaveAlertWithName",x),["simple_markdown","emoji"])}):(0,g.Y)("p",{children:(0,d.A)(T("ChatList.DeleteChatConfirmation",w),["simple_markdown","emoji"])}),(0,g.FD)("div",{className:"dialog-buttons-column",children:[f&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:E,children:T("DeleteAndStop")}),C&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:L,children:w?(0,d.A)(T("ChatList.DeleteForEveryone",w)):T("DeleteForAll")}),!a&&t.isCreator&&!n&&(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:B,children:T("DeleteForAll")}),(0,g.Y)(h.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:a||n?B:R,children:T(n?"Delete":o&&!t.isCreator?"LeaveChannel":o&&t.isCreator?"Chat.Input.Delete":v||A?"Group.LeaveGroup":C?"ChatList.DeleteForCurrentUser":"Delete")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:I,children:T("Cancel")})]})]})}))},54639(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(13439),s=n(37661),a=n(17712),r=n(59030),d=n(71429),l=n(24433),c=n(23174),u=n(90709),h=n(87357),m=n(43874),p=n(62587);const g="VGmPJoga";var f=n(20021);const v=/#fff/gi,A=(0,o.ph)(({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,m.Ay)(),i=(0,p.A)((0,u.mr)(e,"full"),!1,c.qZ.Text),s=(0,o.Kr)(()=>{if(!i)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=i.replace(v,e),o=(new DOMParser).parseFromString(n,"image/svg+xml");return o.querySelectorAll("path").forEach(t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"}),`data:image/svg+xml;utf8,${o.documentElement.outerHTML}`},[i,t]);return(0,f.Y)("i",{className:(0,h.A)("mklnEg0s","icon",!n&&g),children:(0,f.Y)("img",{src:s,alt:"",className:(0,h.A)("tT8KQwg0",!n&&g),draggable:!1})})}),y=(0,o.ph)(({bot:e,theme:t,chatId:n,threadId:c,isInSideMenu:u,canShowNew:h,onMenuOpened:m,onMenuClosed:p})=>{const{callAttachBot:g,toggleAttachBot:v}=(0,i.ko)(),y=(0,r.A)(),C=(0,o.Kr)(()=>e.icons.find(({name:e})=>"default_static"===e)?.document,[e.icons]),[w,I,b]=(0,s.A)(),[S,M]=(0,o.J0)(void 0),N=(0,a.A)(e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();M({x:t.right,y:t.bottom}),m(),I()}),k=(0,a.A)(()=>{g(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:c})}),Y=(0,a.A)(()=>{b(),p()}),F=(0,a.A)(()=>{M(void 0)}),P=(0,a.A)(()=>{v({botId:e.id,isEnabled:!1})});return(0,f.FD)(l.A,{customIcon:C&&(0,f.Y)(A,{icon:C,theme:t}),icon:C?void 0:"bots",onClick:k,onContextMenu:N,children:[e.shortName,h&&e.isDisclaimerNeeded&&(0,f.Y)("span",{className:"menu-item-badge",children:y("New")}),S&&(0,f.Y)(d.A,{isOpen:w,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:Y,onCloseAnimationEnd:F,children:(0,f.Y)(l.A,{icon:"stop",destructive:!0,onClick:P,children:y("WebApp.RemoveBot")})})]},e.id)})},55153(e,t,n){n.d(t,{A:()=>r,L:()=>d});var o=n(31481),i=n(87679),s=n(24909);const a=/\.[^/.]+$/;async function r(e,t,d){const c=URL.createObjectURL(t),{type:u,size:h}=t;let m,p,g,f;const v=d?.shouldSendInHighQuality;if(o.gex.has(u)){const n=await(0,i.NN)(c),{width:h,height:p}=n;f=!l(h,p);const A=v?2560:1280,y=Math.max(h,p)>A,C=u===o.Vz3;if(!f){if(!d?.compressedBlobUrl&&!C&&(y||"image/jpeg"!==u)){const n=await(0,s.s)(c,y?A/Math.max(h,p):1,"image/jpeg");return URL.revokeObjectURL(c),r(e,t,{...d,compressedBlobUrl:n})}"image/jpeg"===u&&(e=e.replace(a,".jpg")),m={width:h,height:p}}g=Math.max(h,p)>40?await(0,s.s)(c,40/Math.max(h,p),"image/jpeg"):c}else if(o.fNs.has(u)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,i.FW)(c);f=!l(e,t),f||(m={width:e,height:t,duration:n})}catch(e){f=!0}g=await(0,i.eT)(c)}else if(o.IH3.has(u)){const{duration:e,title:t,performer:o,coverUrl:s}=await async function(e){const{parseBlob:t,selectCover:o}=await n.e(3186).then(n.bind(n,53186)),s=await(0,i.sZ)(e),a=await t(s),{common:{title:r,artist:d,picture:l},format:{duration:c}}=a,u=o(l),h=u?new Blob([u.data],{type:u.format}):void 0;return{title:r,performer:d,duration:c,coverUrl:h?URL.createObjectURL(h):void 0}}(c);p={duration:e||0,title:t,performer:o},g=s}return{blob:t,blobUrl:c,filename:e,mimeType:u,size:h,quick:m,audio:p,previewBlobUrl:g,shouldSendAsFile:f||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...d}}function d(e,t){return e.map(e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!(e.voice||e.audio)||void 0,shouldSendAsSpoiler:void 0})}function l(e,t){return Math.max(e,t)/Math.min(e,t)<=20}},55317(e,t,n){function o(e,t){const{level:n,boosts:o,currentLevelBoosts:i,nextLevelBoosts:s,hasMyBoost:a,prepaidGiveaways:r}=e,d=t&&o===i&&a;return{currentLevel:d?n-1:n,hasNextLevel:Boolean(s),boosts:o,levelProgress:!s||d?1:(o-i)/(s-i),remainingBoosts:s?s-o:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{z:()=>o})},55429(e,t,n){n.d(t,{N:()=>a});var o=n(90709),i=n(70636),s=n(48899);function a(e,t,n,a){const{senderId:r}=t;if(!r)return;const d=(0,s.L8)(r)?a[r]:n[r];let l=(0,i.F9)(e,d);const c=n[t.chatId];return c&&("isSelf"in d&&d.isSelf?l=`${e("FromYou")} ${(0,o.Js)(e,c)}`:(0,o.YE)(c)&&(l+=` ${(0,o.Js)(e,c)}`)),l}},55723(e,t,n){n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(90709),a=n(10315),r=n(91525),d=n(17872),l=n(11597),c=n(96454),u=n(87679),h=n(58554);const m=new(n(84947).A)(100);var p=n(37661),g=n(5912),f=n(17712),v=n(62587),A=n(69419),y=n(59030),C=n(19806),w=n(94189),I=n(52988),b=n(20021);const S=(0,o.ph)(({document:e,observeIntersection:t,smaller:n,canAutoLoad:S,autoLoadFileMaxSizeMb:M,uploadProgress:N,datetime:k,className:Y,sender:F,isSelected:P,isSelectable:T,shouldWarnAboutFiles:D,isDownloading:x,message:L,id:E,onCancelUpload:B,onMediaClick:R,onDateClick:O})=>{const{cancelMediaDownload:U,downloadMedia:K,setSharedSettingOption:z}=(0,i.ko)(),V=(0,o.li)(),j=(0,y.A)(),[J,G,q]=(0,p.A)(),[$,H]=(0,o.J0)(!1),{fileName:W,size:_,mimeType:Q}=e,Z=(0,r.rK)(e)||"",X=(0,g.Vz)(V,t),[ee,te]=(0,p.A)();(0,o.vJ)(()=>{X&&te()},[X,te]);const[ne,oe]=(0,o.J0)(S&&(!M||_<=1048576*M)),ie=Boolean(x||ne&&ee),se=(0,s.mr)(e,"download"),{loadProgress:ae,mediaData:re}=(0,A.A)(se,!ie,(0,s.Cz)(e,"download"),void 0,!0),de=Boolean(re),{isUploading:le,isTransferring:ce,transferProgress:ue}=(0,s.LK)(N||ae,ie&&!de,void 0!==N),he=(0,r.ON)(e),me=he?(0,s.VD)(e):void 0,pe=he?e.previewBlobUrl:void 0,ge=(0,v.A)((0,s.mr)(e,"pictogram"),!X),fe="photo"===e.innerMediaType&&e.mediaSize&&!e.mediaSize.fromDocumentAttribute&&!e.mediaSize.fromPreload,ve=R&&e.innerMediaType&&!fe;(0,o.vJ)(()=>{const e=V.current;if(!ve||!e||!L)return;const t=()=>{!async function(e){const t=(0,s.Op)(e),n=(0,s.nd)(e),o=t||n,a=n&&n.mediaSize&&!n.mediaSize.fromDocumentAttribute;if(!o||o.previewBlobUrl||a)return;const r=(0,s.mr)(o,"full");if(!r||m.has(r))return;m.set(r,void 0);const p=await(0,h.hd)(r,(0,s.Cz)(o,"full"));if(!p)return;let g;if(t&&c.Uz){const e=await(0,u.FW)(p);g={width:e.videoWidth,height:e.videoHeight,fromPreload:!0}}if(n){const e=await(0,u.NN)(p);g={width:e.naturalWidth,height:e.naturalHeight,fromPreload:!0}}if(!g||g.width<=0||g.height<=0)return;let f=(0,i.mS)();const v=(0,l.O5q)(f,e.chatId,e.id);v&&v.content.document&&(f=(0,d.r3y)(f,e.chatId,e.id,{content:{...v.content,document:{...v.content.document,mediaSize:g}}}),(0,i.UF)(f))}(L)};return e.addEventListener("mouseenter",t),()=>{e.removeEventListener("mouseenter",t)}},[ve,L]);const Ae=(0,f.A)(()=>{K({media:e,originMessage:L})}),ye=(0,f.A)(()=>{le?B&&B():x?U({media:e}):ce?oe(!1):ve?L?R?.(L.id):R&&R():(0,a.N)({mimeType:Q,extension:Z})&&D?G():Ae()}),Ce=(0,f.A)(()=>{z({shouldWarnAboutFiles:!$}),q(),Ae()}),we=(0,f.A)(()=>{O?.(L)});return(0,b.FD)(b.FK,{children:[(0,b.Y)(I.A,{ref:V,id:E,name:W,extension:Z,size:_,timestamp:k,thumbnailDataUri:me,previewData:pe||ge,smaller:n,isTransferring:ce,isUploading:le,transferProgress:ue,className:Y,sender:F,isSelectable:T,isSelected:P,actionIcon:ve?(0,s.hr)(e)?"play":"eye":"download",onClick:ye,onDateClick:O?we:void 0}),(0,b.FD)(w.A,{isOpen:J,onClose:q,confirmHandler:Ce,children:[j("lng_launch_svg_warning"),(0,b.Y)(C.A,{className:"dialog-checkbox",checked:$,label:j("lng_launch_exe_dont_ask"),onCheck:H})]})]})})},59324(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(97422),s=n(41036),a=n(18276);var r=n(20021);const d=(0,o.ph)(({iconName:e,isLoading:t})=>(0,r.Y)(s.Ay,{className:"LLqNvbR9",activeKey:t?0:1,name:"fade",children:t?(0,r.Y)(i.A,{className:"PbV71feg",color:"white"}):(0,r.Y)(a.A,{className:"sohV68PB",name:e})}))},59816(e,t,n){n.d(t,{A:()=>F});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(87357),d=n(95807),l=n(39751),c=n(90709),u=n(48899),h=n(76023),m=n(82117),p=n(17712),g=n(93545),f=n(11241);const v="pruw1nLm";var A=n(20021);const y=(0,o.ph)(({story:e,mediaArea:t,index:n,className:s,style:a,isPreview:l})=>{const{sendStoryReaction:v}=(0,i.ko)(),y=(0,o.li)(),[C,w]=(0,o.J0)(1.5*h.$),{peerId:I,id:b,views:S}=e,{reactions:M}=S||{},{reaction:N,isDark:k,isFlipped:Y}=t,F=!(0,u.L8)(I),P=`${(0,c.$_)(I,b)}-${n}-${l?"preview":"viewer"}`,T=(0,o.Kr)(()=>M?.find(e=>(0,c.a0)(e.reaction,N))?.count,[N,M]),D=!l&&Boolean(T)&&F,x=(0,p.A)(()=>{if(!y.current)return;const e=y.current.clientHeight;w(Math.round(.6*e))});(0,m.A)(([e])=>{Boolean(T)!==Boolean(e)&&x()},[T]),(0,g.A)(y,x);const L=(0,p.A)(()=>{v({peerId:I,storyId:b,containerId:P,reaction:N})});return(0,A.FD)("div",{ref:y,className:(0,r.A)(k?"eic2vQ8c":"_7esBA3m",s),style:(0,d.A)(a,`--custom-emoji-size: ${C}px`),onClick:L,children:[(0,A.Y)("div",{className:(0,r.A)("c3ajA3hg",Y&&"furSXGdL")}),Boolean(C)&&(0,A.Y)(f.A,{className:(0,r.A)("Et3MvYmN",D&&"mFTLUHm2"),reaction:N,containerId:P,size:C,effectSize:4*C,shouldPause:l,shouldLoop:!l}),D&&(0,A.Y)("span",{className:"Tr8mYyDk",children:T})]})});var C=n(61433),w=n(11597),I=n(48894);const b=e=>Boolean("en-US"===navigator.language)?`${Math.round(9*e/5+32)}°F`:`${Math.round(e)}°C`;var S=n(87412);const M=(0,o.ph)((0,i.EK)((e,t)=>{const{mediaArea:n}=t;return{restrictedEmoji:(0,w.GHK)(e,n.emoji)}})(({mediaArea:e,className:t,style:n,restrictedEmoji:i,isPreview:s})=>{const l=(0,o.li)(),[c,u]=(0,o.J0)(0),{temperatureC:h,color:m}=e,f=(0,I.t)(m),v=(0,I.vG)(m),y=(0,p.A)(e=>{if(!l.current)return;const t=l.current,n=t.clientHeight,o=Math.round(.7*n);u(o);const i=()=>{(0,C.Tv)(t,{"--custom-emoji-size":`${o}px`,"font-size":n/32+"rem"})};if(e)return i;(0,a.RK)(i)});return(0,o.Nf)(()=>{(0,a.gm)(()=>y(!0))},[]),(0,g.A)(l,()=>y()),(0,A.Y)("div",{ref:l,className:(0,r.A)("KBjMtRUS",t),style:(0,d.A)(n,`--custom-background-color: ${f}`,`color: ${v}`),children:(0,A.FD)("div",{className:"IFChB3tD",children:[i&&(0,A.Y)(S.A,{documentId:i.id,size:c,noPlay:s,withTranslucentThumb:!0,forceAlways:!0},i.id),(0,A.Y)("p",{className:"_ke1UBIl",children:b(h)})]})})})),N=9/16,k=new Set(["channelPost","uniqueGift"]);function Y(e,t){const{x:n,y:o,width:i,height:s,rotation:a,radius:r}=e.coordinates;let l="";if(t&&r&&t>0){const e=t*(i/100),n=t*(s/100);l=Math.min(e,n)*(r/100)+"px"}return(0,d.A)(`left: ${n}%`,`top: ${o}%`,`width: ${i}%`,`height: ${s}%`,`transform: rotate(${a}deg) translate(-50%, -50%)`,l&&`border-radius: ${l}`)}const F=(0,o.ph)(({story:e,isActive:t,className:n,isStoryPlaying:d})=>{const{openMapModal:c,openUniqueGiftBySlug:u,focusMessage:h,closeStoryViewer:m,openUrl:p}=(0,i.ko)(),g=(0,o.li)(),[f,C]=(0,o.J0)(0),w=(0,l.A)();(0,o.vJ)(()=>{if(!g.current)return;const e=g.current;if(C(e.clientWidth),w.width>s.c2m)return void(0,a.RK)(()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")});const t=w.width/w.height,n=t<N?e.clientHeight*N:e.clientWidth,o=t<N?e.clientHeight:e.clientWidth/N;(0,a.RK)(()=>{e.style.setProperty("--media-width",`${n}px`),e.style.setProperty("--media-height",`${o}px`)})},[t,w]);const I=e.mediaAreas;return(0,A.Y)("div",{className:(0,r.A)("RXAMu4VD",!t&&"_5HkplWee",n),ref:g,children:I?.map((n,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":case"url":case"uniqueGift":{const e=t&&!k.has(n.type);return(0,A.Y)("div",{className:(0,r.A)(v,e&&"xFjJpeOA"),style:Y(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":c({geoPoint:e.geo});break;case"channelPost":h({chatId:e.channelId,messageId:e.messageId}),m();break;case"url":p({url:e.url});break;case"uniqueGift":u({slug:e.slug})}})(n)})}case"suggestedReaction":return(0,A.Y)(y,{story:e,mediaArea:n,index:o,isPreview:!t,className:v,style:Y(n)},`${n.type}-${o}`);case"weather":return(0,A.Y)(M,{mediaArea:n,className:v,style:Y(n,f),isPreview:!t||d},`${n.type}-${o}`);default:return}})})})},60138(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(37836),s=n(17712);function a(e){const t=(0,s.A)(e);(0,o.vJ)(()=>(0,i.yu)(t),[t])}},61097(e,t,n){n.d(t,{A:()=>u});var o=n(90709),i=n(84051),s=n(66644),a=n(67054),r=n(87679),d=n(41074),l=n(17712);let c=-1;function u(e,t){return function(e,t=!1){const n=(0,i.li)(),o=(0,i.Kr)(()=>(0,a.A)(d.bP,++c),[]),u=(0,i.li)(),h=(0,l.A)(async(e,t)=>{const n=await(0,r.NN)(t);n&&(0,s.RK)(()=>{e.width=n.width,e.height=n.height,u.current=e.transferControlToOffscreen();const i=Math.ceil(.1*Math.min(n.width,n.height));(0,d.M1)({name:"offscreen-canvas:blurThumb",args:[u.current,t,i],transferables:[u.current]},o)})});return(0,i.Nf)(()=>{if(!e||t||u.current)return;const o=n.current;o&&h(o,e)},[h,t,e]),n}(e?"string"==typeof e?e:(0,o.VD)(e):void 0,t)}},63744(e,t,n){n.d(t,{A:()=>p});var o=n(84051),i=n(13439),s=n(11597),a=n(71331),r=n(87357),d=n(14),l=n(59030),c=n(48885),u=n(26875),h=n(64493),m=n(20021);const p=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,s.hds)(e,t),o=(0,a.mD)(e,t);return{groupCall:o,isActive:((0,s.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}})(({chatId:e,isActive:t,className:n,groupCall:s,onPaneStateChange:a})=>{const{requestMasterAndJoinGroupCall:p}=(0,i.ko)(),g=(0,l.A)(),f=(0,o.hb)(()=>{p({chatId:e})},[p,e]),v=s?.participants,A=(0,o.Kr)(()=>{if(!v)return[];const e=(0,i.mS)().users.byId,t=(0,i.mS)().chats.byId;return Object.values(v).slice(0,3).map(({id:n})=>e[n]||t[n]).filter(Boolean)},[v]),y=(0,d.A)(s?.participantsCount,!0),C=(0,d.A)(A,!0),w=Boolean(s&&t),{ref:I,shouldRender:b}=(0,c.A)({isOpen:w,onStateChange:a});if(b)return(0,m.FD)("div",{ref:I,className:(0,r.A)("GroupCallTopPane",n),onClick:f,children:[(0,m.FD)("div",{className:"info",children:[(0,m.Y)("span",{className:"title",children:g("VoipGroupVoiceChat")}),(0,m.Y)("span",{className:"participants",children:g("Participants",y??0,"i")})]}),Boolean(C?.length)&&(0,m.Y)(u.A,{size:"small",peers:C,className:"avatars"}),(0,m.Y)(h.A,{round:!0,className:"join",children:g("VoipChatJoin")})]})}))},63988(e,t,n){n.d(t,{D7:()=>l,aG:()=>r,gs:()=>a,tF:()=>d});var o=n(16581),i=n(83414),s=n(672);function a(e,t,n,o=!1){return(0,s.A)(t=>{t(e())},t,n,o)}function r(e,t,n=!1){const o=a(()=>e(),[e],t,n);return(0,i.A)(o,[o,e],!0)}function d(e,t,n,i=!1,s=!1){return(0,o.A)(t=>{t(e())},t,n,i,s)}function l(e,t,n=!1,o=!1){const s=d(()=>e(),[e],t,n,o);return(0,i.A)(s,[s,e],!0)}},64154(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(37836);const a=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:l,text:c}=r||{};return(0,o.vJ)(()=>{t&&n&&!c&&void 0===l&&s&&function(e,t,n){const o=a.get(n)||new Map,s=o.get(e)||[];s.includes(t)||(s.push(t),o.set(e,s),a.set(n,o),(0,i.ko)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),d()}(t,n,s)},[t,c,l,n,s]),t&&n?{isPending:l,translatedText:c}:{isPending:!1,translatedText:void 0}}const d=(0,s.nF)(function(){const{translateMessages:e}=(0,i.ko)();let t=!1;a.forEach((n,o)=>{n.forEach((n,i)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:i,messageIds:s,toLanguageCode:o}),function(e,t,n){const o=a.get(n);if(!o?.size)return void a.delete(n);const i=o.get(e);if(!i?.length)return void o.delete(e);const s=i.filter(e=>!t.includes(e));if(!s?.length)return o.delete(e),void(o.size||a.delete(n));o.set(e,s)}(i,s,o)})}),t&&d()},500)},65240(e,t,n){n.d(t,{Ay:()=>R});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(90709),d=n(11597),l=n(56494),c=n(53827),u=n(87357),h=n(50442),m=n(17663),p=n(14957),g=n(4961),f=n(43874),v=n(88792),A=n(71533),y=n(39351),C=n(17712),w=n(62587),I=n(69419),b=n(59030),S=n(50680),M=n(64493),N=n(96530),k=n(35913),Y=n(70832),F=n(4438),P=n(18276),T=n(20021);const D=window.matchMedia("(max-width: 375px)"),x=window.matchMedia("(max-width: 410px)");function L(e,t,n,o,i,s,a,r,d,l,c,u){const{title:h,performer:p,fileName:f}=n,v=i||s>0&&s<1,{isRtl:A}=e;return(0,T.FD)("div",{className:"content",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:h,children:(0,g.A)(h||f)}),v&&(0,T.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:(0,m.QO)(o*s,o)}),B(s,a,r)]}),!v&&d&&(0,T.Y)(Y.A,{className:"meta",size:n.size,progress:c}),!v&&!d&&(0,T.FD)("div",{className:"meta",dir:A?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration",dir:"auto",children:(0,m.QO)(o)}),p&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:""}),(0,T.Y)("span",{className:"performer",dir:"auto",title:p,children:(0,g.A)(p)})]}),Boolean(l)&&(0,T.FD)(T.FK,{children:[(0,T.Y)("span",{className:"bullet",children:""}),(0,T.Y)(N.A,{className:"date",onClick:u,children:(0,m.fS)(t,1e3*l,!0)})]})]})]})}function E(e,t,n,o,i,s,r,d,l,c,h,p){return(0,T.FD)("div",{className:"content",children:[(0,T.FD)("div",{className:"waveform-wrapper",children:[(0,T.Y)("div",{className:"waveform",draggable:!1,ref:t,children:(0,T.Y)("canvas",{ref:n})}),c&&(0,T.FD)(M.A,{onClick:()=>{(d||l)&&h?h(!r):s||c()},children:[(0,T.Y)(P.A,{name:d||l?"down":"transcribe",className:(0,u.A)("transcribe-icon",(d||l)&&!r&&"transcribe-shown")}),s&&(0,T.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,T.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]}),(0,T.Y)("p",{className:(0,u.A)("voice-duration",p!==a.d9.OneTimeModal&&i&&"unread"),dir:"auto",children:0===o||1===o?(0,m.QO)(e.duration):(0,m.QO)(e.duration*o)})]})}function B(e,t,n){return(0,T.FD)("div",{className:"seekline",ref:n,children:[t.map(({start:e,end:t})=>(0,T.Y)("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`})),(0,T.Y)("span",{className:"seekline-play-progress",children:(0,T.Y)("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})}),(0,T.Y)("span",{className:"seekline-thumb",children:(0,T.Y)("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})})]})}const R=(0,o.ph)((0,i.EK)((e,{message:t})=>({webPage:(0,d.Pn$)(e,t),mediaDuration:(0,l.Y9)(e,t)}))(({theme:e,message:t,senderTitle:n,uploadProgress:d,origin:l,date:Y,noAvatars:R,className:O,isSelectable:U,isSelected:K,isDownloading:z,isTranscribing:V,isTranscriptionHidden:j,isTranscribed:J,isTranscriptionError:G,canDownload:q,canTranscribe:$,autoPlay:H,webPage:W,mediaDuration:_,onHideTranscription:Q,onPlay:Z,onPause:X,onReadMedia:ee,onCancelUpload:te,onDateClick:ne})=>{const{cancelMediaDownload:oe,downloadMedia:ie,transcribeAudio:se,openOneTimeMediaModal:ae}=(0,i.ko)(),{content:{audio:re,voice:de,video:le},isMediaUnread:ce}=t,ue=re||(0,r.y3)(W),he=de||le||ue,me=de||le,pe=Boolean(de||le),ge=(0,o.li)(!1),fe=(0,o.li)(),ve=(0,b.A)(),Ae=(0,y.A)(),{isMobile:ye}=(0,f.Ay)(),[Ce,we]=(0,o.J0)(!1),Ie=Ce||!0,be=(0,r.VO)(he,"pictogram"),Se=(0,w.A)(be,!1,s.qZ.BlobUrl),Me=(0,r.G5)(t),Ne=l===a.d9.OneTimeModal,ke=pe?Me?"oneTimeVoice":"voice":"audio",Ye=(0,w.A)((0,r.VO)(he,"inline"),!Ie,(0,r.Cz)(he,"inline")),{loadProgress:Fe}=(0,I.A)((0,r.VO)(he,"download"),!z,(0,r.Cz)(he,"download")),Pe=(0,C.A)(()=>{we(!0),Z?.(t.id,t.chatId)}),Te=(0,C.A)(()=>{we(!1)}),{isBuffered:De,bufferedRanges:xe,bufferingHandlers:Le,checkBuffering:Ee}=(0,A.A)(),Be=Ne,{isPlaying:Re,playProgress:Oe,playPause:Ue,setCurrentTime:Ke,duration:ze}=(0,v.A)((0,c.dj)(t),_,ke,Ye,Le,void 0,Ee,Boolean(Ce||H),Pe,Te,(0,r.Nb)(t)||Me,void 0,X,Be,Me&&!Ne),Ve=1-Oe,je=(0,r.Ie)(t),Je=Me&&Ne,Ge=function(e,t,n=0,i=!1,s=!1,a=!1,r=!1){const d=(0,o.li)(),{data:l,peak:c}=(0,o.Kr)(()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:o,MAX_SPIKES:i}=function(e,t){return{MIN_SPIKES:e?D.matches?16:20:25,MAX_SPIKES:e?D.matches?35:t&&x.matches?40:45:75}}(a,s),r=Math.min(n/10,1),d=Math.round(o+(i-o)*r);return function(e,t){let n=0;const o=new Array(t),i=e.length/t,s=e[0],a=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*i),d=((e[t-1]??s)+(e[t]??s)+(e[t+1]??a))/3;o[r]=d,n<d&&(n=d)}return{data:o,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const o=Array(n),i=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=i[t]+(i[t+1]<<8);o[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),a=Math.floor(5*(n-1)%8),r=i[s]+(i[s+1]<<8);return o[n-1]=r>>a&31,o}(new Uint8Array(e)),d)},[a,t,s])||{};return(0,o.Nf)(()=>{const t=d.current;t&&l&&void 0!==c&&function(e,t,n,{peak:o,fillStyle:i,progressFillStyle:s}){const a=4*t.length;e.width=2*a,e.height=46,e.style.width=`${a}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach((e,a)=>{r.globalAlpha=a/t.length>=n?.5:1,r.fillStyle=n>a/t.length?s:i;const d=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,o,i,s){2<2*s&&(s=1),i<2*s&&(s=i/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-i,s),e.arcTo(t+2,n-i,t,n-i,s),e.arcTo(t,n-i,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*a,(23+d)/2,0,d,1),r.fill()})}(t,l,r?1-n:n,{peak:c,fillStyle:i?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:i?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})},[i,c,n,l,e,r]),d}(e,me,!ce||je||Je?Oe:1,je,!R,ye,Je),qe=Re||Oe>0&&Oe<1;(0,o.vJ)(()=>{we(Re)},[Re]);const $e=Ce&&!De,{isUploading:He,isTransferring:We,transferProgress:_e}=(0,r.LK)(d||Fe,$e||z,void 0!==d),{shouldRender:Qe,transitionClassNames:Ze}=(0,S.A)(We),Xe=Qe&&($e||He),et=(0,C.A)(()=>{if(He)te?.();else{if(Me)return ae({message:t}),void ee?.();Re||Z?.(t.id,t.chatId),(0,i.ko)().setAudioPlayerOrigin({origin:l}),we(!Ce),Ue()}});(0,o.vJ)(()=>{ee&&ce&&Re&&ee()},[Re,ce,ee]);const tt=(0,C.A)(()=>{z?oe({media:he}):ie({media:he,originMessage:t})}),nt=(0,C.A)(e=>{if(ge.current&&fe.current){const{width:t,left:n}=fe.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ke(Math.max(Math.min(ze*((o-n)/t),ze-.1),.001))}}),ot=(0,C.A)(e=>{e instanceof MouseEvent&&2===e.button||(ge.current=!0,nt(e))}),it=(0,C.A)(()=>{ge.current=!1}),st=(0,C.A)(()=>{ne(t)}),at=(0,C.A)(()=>{se({chatId:t.chatId,messageId:t.id})});function rt(){if(pe)return n||"Voice";const{title:e,fileName:t}=ue;return e||t}function dt(){if(pe)return(0,T.Y)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:(0,m.QO)((de||le).duration)});const{performer:e}=ue;return(0,T.FD)("div",{className:"meta",dir:Ae.isRtl?"rtl":void 0,children:[(0,m.QO)(ze),(0,T.Y)("span",{className:"bullet",children:""}),e&&(0,T.Y)("span",{className:"performer",title:e,children:(0,g.A)(e)}),e&&n&&(0,T.Y)("span",{className:"bullet",children:""}),n&&(0,T.Y)("span",{title:n,children:(0,g.A)(n)})]})}(0,o.vJ)(()=>{if(fe.current&&qe&&!Ne)return(0,h.wJ)(fe.current,{onCapture:ot,onRelease:it,onClick:it,onDrag:nt})},[qe,ot,nt,it,Ne]);const lt=(0,u.A)("Audio",O,Ne&&"non-interactive",l===a.d9.Inline&&"inline",je&&l===a.d9.Inline&&"own",(l===a.d9.Search||l===a.d9.SharedMedia)&&"bigger",K&&"audio-is-selected"),ct=["toogle-play-wrapper"];Xe?ct.push("loading"):ct.push(Re?"pause":"play");const ut=(0,u.A)("content",qe&&"with-seekline");function ht(){return(0,T.FD)("div",{className:ut,children:[(0,T.FD)("div",{className:"content-row",children:[(0,T.Y)("p",{className:"title",dir:"auto",title:rt(),children:(0,g.A)(rt())}),(0,T.Y)("div",{className:"message-date",children:Boolean(Y)&&(0,T.Y)(N.A,{className:"date",onClick:st,children:(0,m.be)(ve,1e3*Y)})})]}),qe&&(0,T.FD)("div",{className:"meta search-result",dir:Ae.isRtl?"rtl":void 0,children:[(0,T.Y)("span",{className:"duration with-seekline",dir:"auto",children:Oe<1&&(0,m.QO)(ze*Oe,ze)}),B(Oe,xe,fe)]}),!qe&&dt()]})}return(0,T.FD)("div",{className:lt,dir:Ae.isRtl?"rtl":"ltr",children:[U&&(0,T.Y)("div",{className:"message-select-control no-selection",children:K&&(0,T.Y)(P.A,{name:"check",className:"message-select-control-icon"})}),(0,T.FD)("div",{className:(0,u.A)(...ct),children:[(0,T.FD)(M.A,{round:!0,ripple:!ye,size:"smaller",className:"toggle-play",color:Se?"translucent-white":"primary",ariaLabel:Re?"Pause audio":"Play audio",onClick:et,isRtl:Ae.isRtl,backgroundImage:Se,nonInteractive:Ne,children:[!Ne&&(0,T.Y)(P.A,{name:"play"}),!Ne&&(0,T.Y)(P.A,{name:"pause"}),Ne&&(0,T.Y)(F.A,{className:"flame",tgsUrl:p.w.Flame,nonInteractive:!0,noLoop:!1,size:40})]}),Me&&!Ne&&(0,T.Y)(P.A,{name:"view-once"})]}),Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading",Ze,Xe&&"interactive"),children:(0,T.Y)(k.A,{progress:_e,transparent:!0,withColor:!0,size:"m",onClick:Xe?et:void 0,noCross:!Xe})}),Ne&&!Qe&&(0,T.Y)("div",{className:(0,u.A)("media-loading"),children:(0,T.Y)(k.A,{progress:Oe,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})}),ue&&q&&!He&&(0,T.Y)(M.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:z?"Cancel download":"Download",onClick:tt,iconName:z?"close":"arrow-down"}),l===a.d9.Search&&ht(),l!==a.d9.Search&&ue&&L(Ae,ve,ue,ze,Re,Oe,xe,fe,z||He,Y,_e,ne?st:void 0),l===a.d9.SharedMedia&&me&&ht(),(l===a.d9.Inline||Ne||J)&&me&&E(me,fe,Ge,Me?Ve:Oe,ce,V,j,J,G,$?at:void 0,Q,l)]})}))},65741(e,t,n){e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"},66991(e,t,n){n.d(t,{Y:()=>c,c:()=>u});var o=n(84051),i=n(31481),s=n(66644),a=n(19822),r=n(39761),d=n(96454),l=n(95704);function c(e,t,n){return(0,o.vJ)(()=>{if(!t||!e.current)return;const o=p(),i=e.current;if(!d.Yw||!n||!o?.isTypeSupported(n))return;const c=new o;function u(){if(!t||!n)return;const e=c.addSourceBuffer(n),o=(0,l.h)(t);e.addEventListener("updateend",function(){o.next().then(({value:t,done:n})=>{"open"===c.readyState&&(n?m(c):h(e,t))})}),o.next().then(({value:t,done:n})=>{n||"open"!==c.readyState||((0,s.RK)(()=>{i.style.display="block",setTimeout(()=>{(0,s.RK)(()=>{(0,a.ZM)(i,{opacity:"1"})})},100)}),h(e,t))})}return c.addEventListener("sourceopen",u,{once:!0}),(0,s.RK)(()=>{(0,a.ZM)(i,{display:"none",opacity:"0"}),i.src=URL.createObjectURL(c)}),()=>{(0,s.RK)(()=>{const e=i.src;(0,r.A)(i),c.removeEventListener("sourceopen",u),"open"===c.readyState&&m(c),URL.revokeObjectURL(e)})}},[n,t,e]),u(n)}function u(e){return!(!d.Yw||!e)&&Boolean(p()?.isTypeSupported(e))}function h(e,t){try{e.appendBuffer(t)}catch(e){i.Oig&&console.warn("[Stream] failed to append buffer",e)}}function m(e){try{e.endOfStream()}catch(e){i.Oig&&console.warn("[Stream] failed to end stream",e)}}function p(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},67054(e,t,n){function o(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>o})},68153(e,t,n){e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},69419(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(23174),s=n(11597),a=n(96454),r=n(58554),d=n(63527),l=n(30857),c=n(672),u=n(14745);function h(e,t=!1,n=i.qZ.BlobUrl,h,m=!1){const p=a.Uz&&n===i.qZ.Progressive,g=e?p&&!t?r.RB(e):r.Ih(e):void 0,f=(0,l.A)(),v=(0,d.Ay)(s.nIz),A=(0,u.A)(),[y,C]=(0,o.J0)(g&&!p?1:0),w=(0,o.li)(),I=(0,c.A)(e=>{w.current&&A&&(!h||Date.now()-w.current>h)&&C(e)},[h,A],500,!0);return(0,o.vJ)(()=>{!t&&e&&(g?p&&setTimeout(()=>{C(.75)},1500):(C(0),w.current&&r.ch(I),w.current=Date.now(),r.hd(e,n,m,I,A).then(()=>{const e=Date.now()-w.current;w.current=void 0,!h||e>=h?f():setTimeout(f,h-e)})))},[t,e,g,n,p,h,I,m,A,v]),(0,o.vJ)(()=>{t&&w.current&&(r.ch(I),C(0),w.current=void 0)},[I,t]),(0,o.vJ)(()=>()=>{e&&r.Cn(e,A)},[A,e]),{mediaData:g,loadProgress:y}}},70463(e,t,n){n.d(t,{A:()=>Me});var o=n(84051),i=n(13439),s=n(89925),a=n(31481),r=n(96454),d=n(87357),l=n(75956),c=n(49763),u=n(37959),h=n(23459),m=n(7985),p=n(74984),g=n(2178),f=n(96374),v=n(5912),A=n(17712),y=n(9717),C=n(46222),w=n(52745),I=n(23174),b=n(90709),S=n(11597),M=n(30708),N=n(96115),k=n(95807),Y=n(25903),F=n(87894),P=n(14242),T=n(4961),D=n(63527),x=n(39351),L=n(35297),E=n(21849),B=n(18276),R=n(24713),O=n(22720);const U={root:"sG8AAzvK",noAnimation:"z7YCLnQC",minimized:"lTOui0dp",noMarginTop:"CODezO4o",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"};var K=n(20021);const z={isCustomPeer:!0,title:"Archived Chats",avatarIcon:"archive-filled",customPeerAvatarColor:"#9EAAB5"},V=(0,o.ph)(({archiveSettings:e,isFoldersSidebarShown:t,offsetTop:n,animationType:s,onDragEnter:r,onClick:l})=>{const{updateArchiveSettings:c}=(0,i.ko)(),h=(0,o.li)(),m=(0,D.Ay)(M.Vu),g=(0,o.li)(m!==a.dnp),f=(0,x.A)();(0,L.A)(()=>{if(m===a.dnp)return void(g.current=!1);if(s!==u.IP.None)return void(g.current=!0);const e=setTimeout(()=>{g.current=!1},200),t=h.current;return t&&(0,Y.j)(t,()=>{g.current=!1},"transform"),()=>clearTimeout(e)},[s,m]);const v=(0,p.Rh)(a._E9),A=(0,p.ic)(),y=A[a._E9]?.chatsCount,C=(0,o.Kr)(()=>{if(!v?.length)return f("Loading");const e=(0,i.mS)();return v.slice(0,5).map((t,n,o)=>{const i=n===o.length-1,s=(0,S.hds)(e,t),a=(0,N.a1)(e,t,I.l3);if(!s)return;const r=(0,b.Js)(f,s);return(0,K.FD)(K.FK,{children:[(0,K.Y)("span",{className:(0,d.A)(U.chat,y&&a?.unreadCount&&U.unread),children:(0,T.A)(r)}),i?"":", "]})})},[v,f,y]),w=(0,o.Kr)(()=>{const t=!e.isMinimized&&{title:f("ContextArchiveCollapse"),icon:"collapse",handler:()=>{c({isMinimized:!0})}},n=e.isMinimized&&{title:f("ContextArchiveExpand"),icon:"expand",handler:()=>{c({isMinimized:!1})}},o={title:f("ContextArchiveToMenu"),icon:"archive-to-main",handler:()=>{c({isHidden:!0})}};return(0,F.oE)([t,n,o])},[e.isMinimized,f,c]),V=(0,o.hb)(e=>{e.preventDefault(),r?.()},[r]);return(0,K.Y)(O.A,{ref:h,onClick:l,onDragEnter:V,className:(0,d.A)(U.root,e.isMinimized&&U.minimized,t&&e.isMinimized&&U.noMarginTop,!g.current&&U.noAnimation,n&&U.noMarginTop,"chat-item-clickable","chat-item-archive"),style:(0,k.A)(Boolean(n)&&`transform: translateY(${n}px)`),buttonClassName:U.button,contextActions:w,withPortalForMenu:!0,children:e.isMinimized?(0,K.Y)("div",{className:(0,d.A)(U.info,"info"),children:(0,K.FD)("div",{className:"info-row",children:[(0,K.Y)("div",{className:(0,d.A)("title",U.title),children:(0,K.FD)("h3",{dir:"auto",className:(0,d.A)(U.name,"fullName"),children:[(0,K.Y)(B.A,{name:"archive-filled",className:U.icon}),f("ArchivedChats")]})}),(0,K.Y)(R.A,{className:U.unreadCount,text:y?(0,P.Vw)(f,y):void 0})]})}):(0,K.FD)(K.FK,{children:[(0,K.Y)("div",{className:(0,d.A)("status",U.avatarWrapper),children:(0,K.Y)(E.A,{peer:z})}),(0,K.FD)("div",{className:(0,d.A)(U.info,"info"),children:[(0,K.Y)("div",{className:"info-row",children:(0,K.Y)("div",{className:(0,d.A)("title",U.title),children:(0,K.Y)("h3",{dir:"auto",className:(0,d.A)(U.name,"fullName"),children:f("ArchivedChats")})})}),(0,K.FD)("div",{className:"subtitle",children:[(0,K.Y)("div",{className:(0,d.A)("status",U.chatsPreview),children:C}),(0,K.Y)(R.A,{className:U.unreadCount,text:y?(0,P.Vw)(f,y):void 0})]})]})]})})});var j=n(19210),J=n(43874),G=n(59030),q=n(79577),$=n(64493);const H=(0,o.ph)((0,i.EK)((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,S.$aQ)(e,t):void 0,animatedEmoji:(0,S.oei)(e,"📂")}))(({chatFolder:e,animatedEmoji:t,foldersDispatch:n})=>{const{openSettingsScreen:a}=(0,i.ko)(),r=(0,G.A)(),{isMobile:d}=(0,J.Ay)(),l=(0,o.hb)(()=>{n({type:"editFolder",payload:e}),a({screen:s.VS.FoldersEditFolderFromChatList})},[e,n]);return(0,K.FD)("div",{className:"yftKUVDQ",children:[(0,K.Y)("div",{className:"UCBfMOiz",children:t&&(0,K.Y)(q.A,{sticker:t,size:96})}),(0,K.Y)("h3",{className:"dB9cHelg",dir:"auto",children:r("FilterNoChatsToDisplay")}),(0,K.Y)("p",{className:"TJ_liZcJ",dir:"auto",children:r(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")}),e&&(0,K.Y)($.A,{ripple:!d,fluid:!0,pill:!0,iconName:"settings",onClick:l,isRtl:r.isRtl,children:(0,K.Y)("div",{className:"aL7e0w4t",children:r("ChatList.EmptyChatListEditFilter")})})]})}));var W=n(61433),_=n(66644),Q=n(80140),Z=n(76023),X=n(15283),ee=n(34201),te=n(5718),ne=n(48885);const oe=(0,o.ph)(({isAccountFrozen:e,onPaneStateChange:t})=>{const{openFrozenAccountModal:n}=(0,i.ko)(),o=(0,x.A)(),{ref:s,shouldRender:a}=(0,ne.A)({isOpen:e,onStateChange:t,withResizeObserver:!0}),r=(0,A.A)(()=>{n()});if(a)return(0,K.FD)("div",{ref:s,className:"lx6b4nbs",role:"button",tabIndex:0,onClick:r,children:[(0,K.Y)("div",{className:"JjWxp6pv",children:o("TitleFrozenAccount")}),(0,K.Y)("div",{className:"sGa3VcFf",children:o("SubtitleFrozenAccount")})]})});var ie=n(66833),se=n(87412),ae=n(61361);const re="shhqZMEh",de="KFchKnrq",le="t5Jgtdxv",ce=(0,o.ph)((0,i.EK)(e=>({activeGiftAuctionIds:e.activeGiftAuctionIds,giftAuctionByGiftId:e.giftAuctionByGiftId}))(({canShow:e,activeGiftAuctionIds:t,giftAuctionByGiftId:n,onPaneStateChange:s})=>{const{openGiftAuctionBidModal:a,openActiveGiftAuctionsModal:r}=(0,i.ko)(),l=e&&Boolean(t?.length),c=(0,x.A)(),{ref:u,shouldRender:h}=(0,ne.A)({isOpen:l,onStateChange:s,withResizeObserver:!0}),[m,p,g]=(0,o.Kr)(()=>{const e=t?.map(e=>n?.[e]).filter(e=>"active"===e?.state.type&&Boolean(e.userState.bidAmount));if(!e)return[void 0,0,0];const[o,i]=(0,F.jB)(e,e=>{const t=e.state;return(0,ie.e0)(e.userState.bidAmount,e.userState.bidDate,t.bidLevels)<=e.gift.giftsPerRound});return[e,o.length,i.length]},[t,n]),f=m?.length||0,v=1===m?.length?m[0]:void 0,y=(0,A.A)(()=>{m?.length&&(v?a({auctionGiftId:v.gift.id}):r())});if(h)return(0,K.FD)("div",{ref:u,className:(0,d.A)(re,"VaA_6uap"),role:"button",tabIndex:0,onClick:y,children:[(0,K.FD)("div",{className:(0,d.A)(de,"matSj1dD"),children:[(0,K.Y)("span",{className:"VHzRR9AT",children:m?.map(e=>(0,K.Y)(se.A,{sticker:e.gift.sticker,loopLimit:1},e.gift.id))}),c("ChatListAuctionTitle",{count:f},{pluralValue:f})]}),(0,K.Y)("div",{className:(0,d.A)(le,"is8ed6Lp",!p&&g&&"Mevh41Gd"),children:function(){if(p||g)return p&&!g?c("ChatListAuctionWinning"):!p&&g?c("ChatListAuctionOutbid"):c("ChatListAuctionMixed",{winCount:p,outbidCount:g})}()}),(0,K.Y)($.A,{className:"o5FU73x3",iconName:v?"auction-filled":void 0,iconClassName:"DyW9v3dj",size:"tiny",pill:!0,onClick:y,children:v?(0,K.Y)(ae.A,{endsAt:v.state.nextRoundAt,shouldShowZeroOnEnd:!0}):c("ChatListAuctionView")})]})}));var ue=n(18501),he=n(14);const me="BIRTHDAY_SETUP",pe=new Set([me]),ge=new Set([me]),fe={BIRTHDAY_SETUP:["SuggestionBirthdaySetupTitle","SuggestionBirthdaySetupMessage"]},ve=(0,o.ph)(({promoData:e,onPaneStateChange:t})=>{const{openBirthdaySetupModal:n,dismissSuggestion:s,openUrl:a}=(0,i.ko)(),r=(0,x.A)(),l=(0,o.Kr)(()=>e?.customPendingSuggestion?e.customPendingSuggestion:e?.pendingSuggestions.find(e=>pe.has(e)),[e]),c=(0,he.A)(l),u="object"==typeof c,{ref:h,shouldRender:m}=(0,ne.A)({isOpen:Boolean(l),onStateChange:t,withResizeObserver:!0}),p=(0,A.A)(()=>{if(!c)return;const e=u?c.suggestion:c;ge.has(e)&&s({suggestion:e}),u?a({url:c.url}):c===me&&n({})}),g=(0,A.A)(e=>{if(e.stopPropagation(),!c)return;const t=u?c.suggestion:c;s({suggestion:t})});if(!m||!c)return;const f=u?(0,ue.fd)(c.title):r(fe[c][0],void 0,{withNodes:!0}),v=u?(0,ue.fd)(c.description):r(fe[c][1],void 0,{withNodes:!0});return(0,K.FD)("div",{ref:h,className:(0,d.A)(re,"SDkananZ"),role:"button",tabIndex:0,onClick:p,children:[(0,K.Y)("div",{className:(0,d.A)(de,"A0XudHG_"),children:f}),(0,K.Y)("div",{className:(0,d.A)(le,"jjwC84Vs"),children:v}),(0,K.Y)(B.A,{name:"close",className:"iY6Fyv9_",onClick:g})]})}),Ae="EPR4baV0",ye=(0,o.ph)(({unconfirmedSession:e,onPaneStateChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:a}=(0,i.ko)(),r=(0,x.A)(),d=Boolean(e),l=(0,he.A)(e),{ref:c,shouldRender:u}=(0,ne.A)({isOpen:d,withResizeObserver:!0,onStateChange:t}),h=(0,o.Kr)(()=>l?l.region?r("UnconfirmedAuthLocationRegion",{deviceModel:l.deviceModel,region:l.region,country:l.country}):r("UnconfirmedAuthLocationCountry",{deviceModel:l.deviceModel,country:l.country}):"",[l,r]),m=(0,A.A)(()=>{l&&n({hash:l.hash,isConfirmed:!0})}),p=(0,A.A)(()=>{l&&(s({hash:l.hash}),a({title:r("UnconfirmedAuthDeniedTitle"),message:r("UnconfirmedAuthDeniedMessage",{location:h})}))});if(u&&l)return(0,K.FD)("div",{className:"sjWwxV5d",ref:c,children:[(0,K.Y)("h2",{className:"XXUAbrjx",children:r("UnconfirmedAuthTitle")}),(0,K.Y)("p",{className:"XQfnrzqW",children:r("UnconfirmedAuthSingle",{location:h})}),(0,K.FD)("div",{className:"ASbVib3E",children:[(0,K.Y)($.A,{fluid:!0,isText:!0,className:Ae,onClick:m,children:r("UnconfirmedAuthConfirm")}),(0,K.Y)($.A,{fluid:!0,isText:!0,color:"danger",onClick:p,className:Ae,children:r("UnconfirmedAuthDeny")})]})]})}),Ce=.25*Z.$,we=.5*Z.$,Ie={height:0},be=(0,o.ph)((0,i.EK)(e=>({isForumPanelOpen:(0,S.clw)(e),sessions:e.activeSessions.byHash,promoData:e.promoData,isAccountFrozen:(0,S.trm)(e)}))(({className:e,sessions:t,promoData:n,isAccountFrozen:i,isForumPanelOpen:s,onHeightChange:r})=>{const[l,c]=(0,o.Ul)(Ie),[u,h]=(0,o.Ul)(Ie),[m,p]=(0,o.Ul)(Ie),[g,f]=(0,o.Ul)(Ie),v=(0,o.li)(!0),{shouldRender:A,ref:y}=(0,ee.A)({isOpen:!0,withShouldRender:!0,noMountTransition:!0});(0,X.A)(()=>{v.current=!1});const C=(0,o.Kr)(()=>{const e=Object.values(t||{}),n=e.find(e=>e.isCurrent);if(n&&!((0,Q.Fm)()-n.dateCreated<a.C7Y))return e.find(e=>e.isUnconfirmed)},[t]),w=!i&&!s&&C,I=!i&&!s&&!C&&n,b=!i&&!s;if((0,te.R)(()=>{const e=l(),t=u(),n=m(),o=g(),i=[e,t,n,{height:n.height?Ce:0,isSpacer:!0},o,{height:we,isSpacer:!0}],s=v.current,a=i.reduce((e,t)=>e+t.height,0);r(0!==a-we?a:0);const d=document.getElementById("LeftColumn");d&&((0,ne.S)({list:i,noTransition:s,zIndexIncrease:!0}),(0,_.RK)(()=>{(0,W.Tv)(d,{"--chat-list-panes-height":`${a}px`})}))},[l,u,g,m]),A)return(0,K.FD)("div",{ref:y,className:(0,d.A)("l4B81S5u",e),children:[(0,K.Y)(oe,{isAccountFrozen:i,onPaneStateChange:h}),(0,K.Y)(ye,{unconfirmedSession:w?C:void 0,onPaneStateChange:c}),(0,K.Y)(ce,{canShow:b,onPaneStateChange:p}),(0,K.Y)(ve,{promoData:I?n:void 0,onPaneStateChange:f})]})})),Se=new Set(["9","0"]),Me=(0,o.ph)(({className:e,folderType:t,folderId:n,isActive:I,isForumPanelOpen:b,canDisplayArchive:S,archiveSettings:M,isMainList:N,withTags:k,isFoldersSidebarShown:Y,isStoryRibbonShown:F,foldersDispatch:P,onScroll:T})=>{const{openChat:D,openNextChat:x,closeForumPanel:L,toggleStoryRibbon:E,openLeftColumnContent:B}=(0,i.ko)(),R=(0,o.li)(),[O,U]=(0,o.J0)(0),z="archived"===t,J="all"===t,G="saved"===t,q=J?a.DSF:z?a._E9:G?a.pX9:n,$=J&&S&&M,W=(0,p.Rh)(q);(0,h.A)(W);const _=(W?.length||0)*a.yq1,Q=$?M?.isMinimized?a.eqO:a.yq1:0,{orderDiffById:Z,shiftDiff:X,getAnimationType:ee,onReorderAnimationEnd:te}=(0,y.A)(W,O),[ne,oe]=(0,f.A)(void 0,W,void 0,a.T7t);(0,g.v)((0,o.Kr)(()=>I&&W?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),x({targetIndexDelta:-1,orderedIds:W})},"Alt+ArrowDown":e=>{e.preventDefault(),x({targetIndexDelta:1,orderedIds:W})}}:void 0,[I,W])),(0,o.vJ)(()=>{if(I&&!G&&W&&r.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((r.MP&&e.metaKey||!r.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||Se.has(t))return;const n=$&&M&&!M.isMinimized,o=n?-1:0,i=Number(t)+o-1;if(n&&-1===i)return void(N&&B({contentKey:s.Bn.Archived}));if(i>W.length-1)return;D({id:W[i],shouldReplaceHistory:!0})}}},[M,G,I,D,x,W,$,N]);const{observe:ie}=(0,v.BL)({rootRef:R,throttleMs:200}),se=(0,A.A)(()=>{B({contentKey:s.Bn.Archived}),L()}),ae=(0,A.A)(()=>{E({isShown:!0,isArchived:z})}),re=(0,A.A)(()=>{E({isShown:!1,isArchived:z})}),de=(0,A.A)(()=>{(0,l.W)(()=>{se()})}),le=(0,A.A)(e=>{(0,l.W)(()=>{D({id:e,shouldReplaceHistory:!0})})});return(0,m.A)({containerRef:R,onOverscroll:ae,onReset:re,isDisabled:G,isOverscrolled:F}),(0,K.FD)(C.A,{className:(0,d.A)("chat-list custom-scroll",b&&"forum-panel-open",e),ref:R,items:ne,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:a.T7t,withAbsolutePositioning:!0,maxHeight:_+Q+O,onLoadMore:oe,onScroll:T,children:[J&&(0,K.Y)(be,{onHeightChange:U},"panes"),$&&(0,K.Y)(V,{archiveSettings:M,onClick:se,onDragEnter:de,animationType:ee(u.E5),offsetTop:O,isFoldersSidebarShown:Y},"archive"),ne?.length?function(){const e=W.indexOf(ne[0]),t=(0,c.zm)(q)||0;return ne.map((o,i)=>{const s=e+i<t,r=O+Q+(e+i)*a.yq1;return(0,K.Y)(j.A,{teactOrderKey:s?i:(0,c.uk)(o,G),chatId:o,isPinned:s,folderId:n,isSavedDialog:G,animationType:ee(o),orderDiff:Z[o],shiftDiff:X,onReorderAnimationEnd:te,offsetTop:r,observeIntersection:ie,onDragEnter:le,onDragLeave:l.d,withTags:k,isFoldersSidebarShown:Y},o)})}():!ne||ne.length||G?(0,K.Y)(w.A,{},"loading"):(0,K.Y)(H,{folderId:n,folderType:t,foldersDispatch:P})]})})},70832(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(14242),s=n(39351),a=n(17712),r=n(20021);const d=(0,o.ph)(({className:e,size:t,progress:n})=>{const d=(0,s.A)(),[l,c]=(0,o.J0)(0),u=(0,o.li)(),h=(0,a.A)(()=>{clearTimeout(u.current),u.current=void 0}),m=(0,a.A)(()=>{if(void 0===n)return;const e=t*n,o=e-l;if(0!==o){const t=Math.max(262144,o/10),n=Math.min(e,l+t);c(n)}u.current=window.setTimeout(()=>{m()},100)});(0,o.vJ)(()=>{if(void 0===n)return h(),void c(0);const e=t*n;if(e>1073741824||1===n)return h(),void c(e);u.current||m()},[n,t]),(0,o._W)(h);const p=(0,i.v7)(d,l,2),g=(0,i.v7)(d,t);return void 0===n||1===n?g:(0,r.Y)("span",{className:e,dir:d.isRtl?"rtl":void 0,children:d("FileTransferProgress",{currentSize:p,totalSize:g},{withNodes:!0})})})},71331(e,t,n){n.d(t,{Ip:()=>r,O7:()=>h,iT:()=>c,mD:()=>a,n5:()=>d,qI:()=>l,uu:()=>u});var o=n(90709),i=n(21133),s=n(19926);function a(e,t){const n=(0,i.AW)(e,t);if(n&&n.groupCallId)return r(e,n.groupCallId)}function r(e,t){return e.groupCalls.byId[t]}function d(e,t,n){return r(e,t)?.participants[n]}function l(e){const t=c(e)?.chatId;if(!t)return!1;const n=(0,i.hd)(e,t);return!!n&&((0,o.yn)(n)&&n.isCreator||Boolean(n.adminRights?.manageCall))}function c(e){const{groupCalls:{activeGroupCallId:t}}=e;if(t)return r(e,t)}function u(e){const{phoneCall:t,currentUserId:n}=e;if(!t||!t.participantId||!t.adminId)return;const o=t.adminId===n?t.participantId:t.adminId;return(0,s.mB)(e,o)}function h(e){const t=c(e);if(!t||!t.chatId)return!1;const n=(0,i.hd)(e,t.chatId);if(!n)return!1;if(Boolean((0,o.Kl)(n)))return!0;const s=(0,i.AW)(e,n.id)?.inviteLink;return Boolean(s)}},71950(e,t,n){n.d(t,{A:()=>C});var o=n(84051),i=n(87357),s=n(17663),a=n(17142),r=n(14242),d=n(39351),l=n(59030),c=n(18276);const u="gvrp3KoR",h="IHb3ZATQ",m="zAPFdKbZ";var p=n(20021);const g=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],f=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],v=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],A=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],y=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],C=(0,o.ph)(({title:e,type:t,statistics:n,isToncoin:o,className:C,subtitle:w})=>{const I=(0,l.A)(),b=(0,d.A)(),S=({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return(0,p.FD)("span",{className:(0,i.A)("idLrmbhS",n&&"SLfwGHQC"),children:[n?`-${(0,r.Vw)(b,Math.abs(e))}`:`+${(0,r.Vw)(b,e)}`,t&&(0,p.FD)(p.FK,{children:[" ","(",t,"%)"]})]})},M=(e,t,n)=>{const[o,i]=e.toFixed(4).split("."),[s,a]=(e*t).toFixed(2).split(".");return(0,p.FD)("div",{children:[(0,p.Y)(c.A,{className:"it39BC_c",name:"toncoin"}),(0,p.FD)("b",{className:m,children:[o,(0,p.FD)("span",{className:"ZAfXkuWL",children:[".",i]})]})," ",(0,p.FD)("span",{className:h,children:[" $",s,(0,p.FD)("span",{className:"HRXb_S2M",children:[".",a]})]}),(0,p.Y)("h3",{className:h,children:I(n)})]})},{period:N}=n,{balances:k,usdRate:Y}=n,F=function(e){switch(e){case"group":return f;case"message":return v;case"boost":return y;case"story":return A;default:return g}}(t);return(0,p.FD)("div",{className:(0,i.A)("Gi8Nokbl",C),children:[(0,p.FD)("div",{className:"H01lE7mv",children:[e&&(0,p.Y)("div",{className:"VQbs04hT",children:e}),N&&(0,p.FD)("div",{className:"X7bBlGdi",children:[(0,s.Lu)(I,1e3*N.minDate)," ","",(0,s.Lu)(I,1e3*N.maxDate)]})]}),(0,p.Y)("table",{className:"s5beXqqL",children:o?(0,p.Y)("tr",{children:(0,p.FD)("td",{className:u,children:[M(k?.availableBalance?(0,a.wD)(k.availableBalance.amount):0,Y||0,"lng_channel_earn_available"),M(k?.currentBalance?(0,a.wD)(k.currentBalance.amount):0,Y||0,"lng_channel_earn_reward"),M(k?.overallRevenue?(0,a.wD)(k.overallRevenue.amount):0,Y||0,"lng_channel_earn_total")]})}):F.map(e=>(0,p.Y)("tr",{children:e.map(e=>{const t=n?.[e.name];if(e.isPlain)return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:`${e.isApproximate?" ":""}${(0,r.Sm)(t??0)}`}),(0,p.Y)("h3",{className:h,children:I(e.title)})]});if(e.isPercentage){const n=t?.part??0,o=t?.percentage??0;return(0,p.FD)("td",{className:u,children:[e.withAbsoluteValue&&(0,p.Y)("span",{className:m,children:`${e.isApproximate?" ":""}${(0,r.Sm)(n)}`}),(0,p.FD)("span",{className:e.withAbsoluteValue?"_mYEmh_u":m,children:[o,"%"]}),(0,p.Y)("h3",{className:h,children:I(e.title)})]})}return(0,p.FD)("td",{className:u,children:[(0,p.Y)("b",{className:m,children:(0,r.Vw)(b,t?.current??0)})," ",S(t),(0,p.Y)("h3",{className:h,children:I(e.title)})]})})}))}),w]})})},72078(e,t,n){e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},72167(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(98021),s=n(76023),a=n(4961),r=n(87412),d=n(18276);var l=n(20021);const c=2.25*s.$,u=(0,o.ph)(({emoji:e,customEmojiId:t,shouldAnimate:n})=>{if(t)return(0,l.Y)(r.A,{documentId:t,size:c,shouldNotLoop:!n});if(!e)return(0,l.Y)(d.A,{name:"folder-tabs-folder"});const o=(0,i.FQ)(e);return o?(0,l.Y)(d.A,{name:o}):(0,l.Y)("div",{className:"pAEvaw7s",children:(0,a.A)(e)})})},73172(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(13439),s=n(31481),a=n(37836);const r=(e,t)=>(0,o.Kr)(()=>(0,a.nF)(n=>{e&&t&&(0,i.ko)().sendMessageAction({chatId:e,threadId:t,action:n})},s.cqp),[e,t])},73176(e,t,n){n.d(t,{A:()=>O});var o=n(84051),i=n(31481),s=n(66644),a=n(90709),r=n(70636),d=n(37836);function l(e,t=d.IJ){return new Promise(n=>{t(()=>{(function(e){return Promise.allSettled(e.getAnimations({subtree:!0}).filter(e=>e instanceof CSSTransition).map(e=>e.finished))})(e).then(()=>n())})})}var c=n(87357),u=n(4961),h=n(18501),m=n(79882),p=n(35749),g=n(2338),f=n(21488),v=n(39351),A=n(62587),y=n(13439),C=n(11597),w=n(96115),I=n(87894),b=n(76023),S=n(63527),M=n(43874),N=n(11217),k=n(38102);const Y="CBda1UmC",F="BhS75ocD",P="uWo2dhui",T="g3XnC73g";var D=n(20021);const x=Number(b.$),L=(0,o.ph)(({chat:e,topicIds:t,hasTags:n,renderLastMessage:i,observeIntersection:s})=>{const{openThread:r}=(0,y.ko)(),d=(0,o.li)(),l=(0,o.li)(),h=(0,v.A)(),m=(0,o.hb)(n=>(0,I.pA)(t||[],t=>[t,(0,w.$j)(n,e.id,t)]),[e.id,t]),p=(0,S.LV)(m),g=(0,o.hb)(n=>t?.map(t=>(0,C.S0q)(n,e.id,t)).filter(Boolean),[e.id,t]),f=(0,S.LV)(g),[A,...b]=(0,o.Kr)(()=>{if(!f)return[];const e=(0,I.Tq)(p,e=>e?.threadInfo);return(0,a.CO)(f,e,void 0,!0).slice(0,3)},[f,p]),L=A?p[A.id]?.readState:void 0,[E,B]=(0,o.J0)(!1),[R,O]=(0,o.J0)(void 0),{handleClick:U,handleMouseDown:K}=(0,N.Q)(t=>{A&&(0===L?.unreadCount||e.isForumAsMessages&&!e.isBotForum||(t.stopPropagation(),t.preventDefault(),r({chatId:e.id,threadId:A.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,M.Ny)()})))});return(0,o.vJ)(()=>{const e=d.current,t=l.current;if(!e||!t||n)return;const o=e.offsetWidth,i=t.offsetWidth;Math.abs(o-i)<x?O(Math.max(o,i)):O(void 0),B(o>i)},[A,i,n]),(0,D.FD)("div",{className:(0,c.A)("Ow6Ij9O5",E&&"U_yhhC0w",R&&"HV0wCR4O"),dir:h.isRtl?"rtl":void 0,style:R?`--overwritten-width: ${R}px`:void 0,children:[!n&&(0,D.FD)(D.FK,{children:[A&&(0,D.FD)("div",{className:Y,children:[(0,D.FD)("div",{className:(0,c.A)("lEbV6HrI",L?.unreadCount&&F),ref:l,onClick:U,onMouseDown:K,children:[(0,D.Y)(k.A,{topic:A,observeIntersection:s}),(0,D.Y)("div",{className:"k3Ch25ZQ",children:(0,u.A)(A.title)}),!R&&E&&(0,D.Y)("div",{className:P,children:(0,D.Y)("div",{className:T})})]}),(0,D.Y)("div",{className:"IkuCBmvA",children:b.map(e=>(0,D.FD)("div",{className:(0,c.A)("d0hTIVJn",p[e.id]?.readState?.unreadCount&&F),children:[(0,D.Y)(k.A,{topic:e,className:"oknhG11L",observeIntersection:s}),(0,D.Y)("span",{className:"ZUj3xAjs",children:(0,u.A)(e.title)})]},e.id))}),(0,D.Y)("div",{className:"_m_2xcPW"})]}),!A&&(0,D.Y)("div",{className:(0,c.A)(Y,"L4Zk0yMN"),children:h("Loading")})]}),(0,D.FD)("div",{className:(0,c.A)("KJ16dBus",L?.unreadCount&&!n&&F),ref:d,onClick:U,onMouseDown:K,children:[i(),!R&&!E&&(0,D.Y)("div",{className:P,children:(0,D.Y)("div",{className:T})})]})]})});var E=n(18276),B=n(18653),R=n(80477);function O({chat:e,topicIds:t,lastMessage:n,statefulMediaContent:d,chatId:c,typingStatus:y,draft:C,lastMessageTopic:w,lastMessageSender:I,observeIntersection:b,animationType:S,orderDiff:M,shiftDiff:N,withInterfaceAnimations:k,isTopic:Y,isSavedDialog:F,isPreview:P,hasTags:T,shouldForceNonForumView:x,onReorderAnimationEnd:B}){const O=(0,v.A)(),K=(0,o.li)(),z=n?.content.storyData,V=d&&!d.story;(0,f.A)(V?z?.peerId:void 0,z?.id,d?.story);const j=d?.story||n,J=j&&!(0,a.fP)(j),G=(0,g.A)(j),q=J?G:void 0,$=(0,p.A)(j,"micro"),H=(0,A.A)(J?$:void 0),W=Boolean(n&&(0,a.lk)(n)),_=(0,o.hb)(()=>{if(!F&&!P&&y&&n&&y.timestamp>1e3*n.date)return(0,D.Y)(R.A,{typingStatus:y});const t=C&&C.replyInfo?.replyToMsgId===w?.id,o=C?.replyInfo&&!C.text&&C.isLocal;if(!e?.isForum&&!F&&!P&&C&&!o&&(!Y||!t))return(0,D.FD)("p",{className:"last-message",dir:O.isRtl?"auto":"ltr",children:[(0,D.Y)("span",{className:"draft",children:O("ChatDraftPrefix")}),(0,D.Y)("span",{className:"last-message-summary",dir:"auto",children:(0,h.fd)({text:C.text?.text||"",entities:C.text?.entities,asPreview:!0,withTranslucentThumbs:!0})})]});if(!n)return;const i=I?(0,r.Q5)(O,c,I):void 0;return(0,D.FD)("p",{className:"last-message shared-canvas-container",dir:O.isRtl?"auto":"ltr",children:[i&&(0,D.FD)(D.FK,{children:[(0,D.Y)("span",{className:"sender-name",children:(0,u.A)(i)}),(0,D.Y)("span",{className:"colon",children:":"})]}),!F&&n.forwardInfo&&(0,D.Y)(E.A,{name:"share-filled",className:"chat-prefix-icon"}),"story"===n.replyInfo?.type&&(0,D.Y)(E.A,{name:"story-reply",className:"chat-prefix-icon"}),(0,D.Y)("span",{className:"last-message-summary",dir:"auto",children:U(n,b,H||q,W)})]})},[e,c,C,W,Y,O,n,I,w,H,q,b,y,F,P]);return(0,o.Nf)(()=>{const e=K.current;if(!k||!e)return;let t=!1;const n=()=>{t||((0,s.RK)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}),B?.())};return S===m.IP.Opacity&&(e.style.opacity="0",(0,s.RK)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1",l(e).then(n)})),S===m.IP.Move&&(e.style.transform=`translate3d(0, ${-M*i.yq1-N}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",l(e).then(n)})),S===m.IP.Shift&&(e.style.transform=`translate3d(0, ${-N}px, 0)`,(0,s.RK)(()=>{e.classList.add("animate-transform"),e.style.transform="",l(e).then(n)})),S!==m.IP.None?()=>{t=!0}:void 0},[k,M,N,S,B]),{renderSubtitle:function(){return!e?.isForum||Y||x?_():(0,D.Y)(L,{chat:e,renderLastMessage:_,observeIntersection:b,topicIds:t,hasTags:T})},ref:K}}function U(e,t,n,o){const i=(0,D.Y)(B.A,{message:e,noEmoji:Boolean(n),observeIntersectionForLoading:t,inChatList:!0});if(!n)return i;const s=(0,a.y2)(e);return(0,D.FD)("span",{className:"media-preview",children:[(0,D.Y)("img",{src:n,alt:"",className:(0,c.A)("media-preview--image",o&&"round",s&&"media-preview-spoiler"),draggable:!1}),(0,a.zX)(e)&&(0,D.Y)(E.A,{name:"play"}),i]})}},75319(e,t,n){function o(e){return"object"==typeof e&&null!==e&&"graphType"in e}n.d(t,{R:()=>o})},75343(e,t,n){n.d(t,{A:()=>S});var o=n(84051),i=n(13439),s=n(87357),a=n(43874),r=n(36838),d=n(39351),l=n(89925),c=n(70636),u=n(17663),h=n(48899),m=n(80140),p=n(54464),g=n(10722),f=n(17712),v=n(92111),A=n(21849),y=n(71429),C=n(24433),w=n(2429),I=n(20021);const b=(0,o.ph)(function({peer:e,isArchived:t,stealthModeActiveUntil:n}){const{openChat:a,openChatWithInfo:r,openStoryViewer:b,toggleStoriesHidden:S,openStealthModal:M,showNotification:N}=(0,i.ko)(),k=(0,d.A)(),Y=(0,o.li)(),F="isSelf"in e&&e.isSelf,P=!(0,h.L8)(e.id);(0,v.A)(e.id);const{isContextMenuOpen:T,contextMenuAnchor:D,handleBeforeContextMenu:x,handleContextMenu:L,handleContextMenuClose:E,handleContextMenuHide:B}=(0,g.A)(Y),R=(0,f.A)(()=>Y.current),O=(0,f.A)(()=>document.body),U=(0,f.A)(()=>Y.current.querySelector(".story-peer-context-menu .bubble")),K=(0,f.A)(()=>({withPortal:!0,isDense:!0})),z=(0,f.A)(()=>{T||b({peerId:e.id,origin:l.G9.StoryRibbon})}),V=(0,f.A)(e=>{(0,p.u)(e),x(e)}),j=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})}),J=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})}),G=(0,f.A)(()=>{a({id:e.id,shouldReplaceHistory:!0})}),q=(0,f.A)(()=>{r({id:e.id,shouldReplaceHistory:!0})}),$=(0,f.A)(()=>{S({peerId:e.id,isHidden:!t})}),H=(0,f.A)(()=>{const t=n?n-(0,m.Fm)():0;if(t>0)return N({title:k("StealthModeOnTitle"),message:k("StealthModeOnHint",{time:(0,u.QO)(t)}),duration:1e3}),void b({peerId:e.id,origin:l.G9.StoryRibbon});M({targetPeerId:e.id})});return(0,I.FD)("div",{ref:Y,role:"button","data-peer-id":e.id,tabIndex:0,className:w.A.peer,onMouseDown:V,onClick:z,onContextMenu:L,children:[(0,I.Y)(A.A,{peer:e,withStory:!0,storyViewerOrigin:l.G9.StoryRibbon,storyViewerMode:"full"}),(0,I.Y)("div",{className:(0,s.A)(w.A.name,e.hasUnreadStories&&w.A.name_hasUnreadStory),children:F?k("StoryRibbonMyStory"):(0,c.F9)(k,e)}),void 0!==D&&(0,I.Y)(y.A,{isOpen:T,anchor:D,getTriggerElement:R,getRootElement:O,getMenuElement:U,getLayout:K,className:(0,s.A)("story-peer-context-menu",w.A.contextMenu),autoClose:!0,withPortal:!0,onClose:E,onCloseAnimationEnd:B,children:F?(0,I.FD)(I.FK,{children:[(0,I.Y)(C.A,{onClick:j,icon:"play-story",children:k("StoryMenuSavedStories")}),(0,I.Y)(C.A,{onClick:J,icon:"archive",children:k("StoryMenuArchivedStories")})]}):(0,I.FD)(I.FK,{children:[!P&&(0,I.Y)(C.A,{onClick:G,icon:"message",children:k("StoryMenuSendMessage")}),P?(0,I.Y)(C.A,{onClick:q,icon:"channel",children:k("StoryMenuViewChannel")}):(0,I.Y)(C.A,{onClick:q,icon:"user",children:k("StoryMenuViewProfile")}),!P&&(0,I.Y)(C.A,{onClick:H,icon:"eye-crossed-outline",children:k("StoryMenuOpenStealth")}),(0,I.Y)(C.A,{onClick:$,icon:t?"unarchive":"archive",children:k(t?"StoryMenuUnarchivePeer":"StoryMenuArchivePeer")})]})})]})}),S=(0,o.ph)((0,i.EK)((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:o}}=e.stories,i=e.users.byId,s=e.chats.byId;return{orderedPeerIds:t?o:n,stealthModeActiveUntil:e.stories.stealthMode.activeUntil,usersById:i,chatsById:s}})(function({isArchived:e,className:t,orderedPeerIds:n,stealthModeActiveUntil:i,usersById:l,chatsById:c,isClosing:u}){const h=(0,d.A)(),m=(0,s.A)(w.A.root,!n.length&&w.A.hidden,u&&w.A.closing,t,"no-scrollbar"),p=(0,o.li)();return(0,r.A)(p,(0,a.Ny)()),(0,I.Y)("div",{ref:p,id:"StoryRibbon",className:m,dir:h.isRtl?"rtl":void 0,children:n.map(t=>{const n=l[t]||c[t];if(n)return(0,I.Y)(b,{peer:n,isArchived:e,stealthModeActiveUntil:i},t)})})}))},75956(e,t,n){n.d(t,{W:()=>a,d:()=>r});var o=n(37836);let i,s=!1;const a=(0,o.sg)((e,t=!1)=>{i&&(clearTimeout(i),i=void 0),s?s=!1:i=window.setTimeout(()=>{t&&(s=!0),e()},500)},50,!1);function r(){i&&(clearTimeout(i),i=void 0)}},76786(e,t,n){n.d(t,{A:()=>s});var o=n(84051);let i=function(e){return e[e.waitingForNetwork=0]="waitingForNetwork",e[e.syncing=1]="syncing",e[e.online=2]="online",e}({});function s(e,t,n,s,a,r){let d,l,c;return d=function(){const[e,t]=(0,o.J0)(window.navigator.onLine);return(0,o.vJ)(()=>{function e(){t(window.navigator.onLine)}return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",e)}},[]),e}()&&"connectionStateConnecting"!==t?n?i.syncing:i.online:i.waitingForNetwork,l=d===i.online||r?"none":s?"middleHeader":a?"minimized":"overlay",d===i.waitingForNetwork?c=e("WaitingForNetwork"):d===i.syncing&&(c=e("Updating")),"middleHeader"===l&&(c=c.toLowerCase().replace(/\.+$/,"")),{connectionStatus:d,connectionStatusPosition:l,connectionStatusText:c}}},77018(e,t,n){n.d(t,{A:()=>ie});var o=n(84051),i=n(13439),s=n(23174),a=n(31481),r=n(66644),d=n(90709),l=n(11597),c=n(96115),u=n(96454),h=n(87357),m=n(11778),p=n(50442),g=n(25903),f=n(48899),v=n(87894),A=n(63527),y=n(43874),C=n(26072),w=n(96374),I=n(5912),b=n(39351),S=n(17712),M=n(73767),N=n(9717),k=n(63744),Y=n(51083),F=n(17751),P=n(48553),T=n(64493),D=n(46222),x=n(52745),L=n(66414),E=n(81642),B=n(22720);const R="lqZyVmVG";var O=n(20021);const U=(0,o.ph)((0,i.EK)((e,{chatId:t})=>({lastMessage:(0,l.yHC)(e,t,"all")}))(({chatId:e,isSelected:t,style:n,lastMessage:o})=>{const{openThread:a,openQuickPreview:r}=(0,i.ko)(),d=(0,b.A)(),l=(0,S.A)(t=>{if(t.altKey)return t.preventDefault(),void r({id:e});a({chatId:e,threadId:s.l3,shouldReplaceHistory:!0})});return(0,O.Y)(B.A,{className:(0,h.A)(R,"Chat",t&&"selected","chat-item-clickable"),onClick:l,style:n,href:u.OS?`#${(0,L.az)(e,"thread",s.l3)}`:void 0,children:(0,O.FD)("div",{className:"info",children:[(0,O.FD)("div",{className:"info-row",children:[(0,O.Y)("div",{className:(0,h.A)("title"),children:(0,O.Y)("h3",{dir:"auto",className:"fullName",children:d("BotForumAllTopicTitle")})}),(0,O.Y)("div",{className:"separator"}),o&&(0,O.Y)(E.A,{message:o})]}),(0,O.Y)("div",{className:"subtitle",children:(0,O.Y)("span",{className:"last-message",children:d("BotForumAllTopicDescription")})})]})})}));var K=n(76023),z=n(59030),V=n(79577);const j={root:"WPgq_7q8","button-text":"X68lc0hu",buttonText:"X68lc0hu",sticker:"jyXw4GPj",title:"_bhNYUNF",description:"zlgqVt7f","is-ios":"iUlEHnLc",isIos:"iUlEHnLc","is-macos":"mOsbMLNN",isMacos:"mOsbMLNN"},J=7*K.$,G=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const n=(0,l.hds)(e,t),o=n&&(n.isCreator||(0,d.ub)(n,"manageTopics"));return{animatedEmoji:(0,l.oei)(e,"🐣"),canManageTopics:o}})(({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:o}=(0,i.ko)(),s=(0,b.A)(),a=(0,z.A)(),{isMobile:r}=(0,y.Ay)(),d=(0,S.A)(()=>{o({chatId:e})});return(0,O.FD)("div",{className:j.root,children:[(0,O.Y)("div",{className:j.sticker,children:t&&(0,O.Y)(V.A,{sticker:t,size:J})}),(0,O.Y)("h3",{className:j.title,dir:"auto",children:a("ChatList.EmptyTopicsTitle")}),(0,O.Y)("p",{className:(0,h.A)(j.description,j.centered),dir:"auto",children:a("ChatList.EmptyTopicsDescription")}),n&&(0,O.Y)(T.A,{ripple:!r,fluid:!0,onClick:d,isRtl:s.isRtl,children:(0,O.Y)("div",{className:j.buttonText,children:a("ChatList.EmptyTopicsCreate")})})]})}));var q=n(27109),$=n(4961),H=n(37661),W=n(73176),_=n(63495),Q=n(18276),Z=n(38102),X=n(94189),ee=n(97046),te=n(24384);const ne=(0,o.ph)((0,i.EK)((e,{chatId:t,topic:n,isSelected:o})=>{const i=(0,l.hds)(e,t),s=(0,c.Vw)(e,t,n.id),a=s?.lastMessageId?(0,l.O5q)(e,t,s.lastMessageId):void 0,{isOutgoing:r}=a||{},d=a&&(0,l.Y7C)(e,a),u=(0,c._X)(e,t,n.id,"typingStatus"),h=(0,c.GA)(e,t,n.id),m=(0,c.a1)(e,t,n.id),p=i?.isBotForum||Boolean(m?.lastReadInboxMessageId),g=(0,l.xyP)(e,t)?.listedTopicIds,{chatId:f,threadId:v}=(0,l.Xf0)(e)||{},A=a?.content.storyData,y=A&&(0,l.Msb)(e,A.peerId,A.id);return{chat:i,lastMessage:a,lastMessageSender:d,typingStatus:u,isChatMuted:i&&(0,q.If)(i,(0,l.K52)(e),(0,l.P5N)(e,i.id)),canDelete:(0,l.DBV)(e,t,n.id),withInterfaceAnimations:(0,l.PKK)(e),draft:h,...r&&a&&{lastMessageOutgoingStatus:(0,l.Tl2)(e,t,n.id,a.id,"thread")},canScrollDown:o&&i?.id===f&&v===n.id,wasTopicOpened:p,topicIds:g,lastMessageStory:y,unreadCount:m?.unreadCount}})(({topic:e,isSelected:t,chatId:n,chat:s,isChatMuted:r,style:l,lastMessage:c,lastMessageStory:m,canScrollDown:p,lastMessageOutgoingStatus:g,observeIntersection:f,canDelete:A,lastMessageSender:y,animationType:C,withInterfaceAnimations:w,orderDiff:I,shiftDiff:M,typingStatus:N,draft:k,wasTopicOpened:Y,topicIds:F,unreadCount:P,onReorderAnimationEnd:T})=>{const{openThread:D,deleteTopic:x,scrollMessageListToBottom:U,setViewForumAsMessages:K,updateTopicMutedState:V,openQuickPreview:j}=(0,i.ko)(),J=(0,z.A)(),[G,q,ne]=(0,H.A)(),[oe,ie,se]=(0,H.A)(),[ae,re,de]=(0,H.A)(),[le,ce,ue]=(0,H.A)(),{isPinned:he,isClosed:me,notifySettings:pe}=e,ge=Boolean(pe.mutedUntil||void 0===pe.mutedUntil&&r),fe=(0,S.A)(()=>{re(),q()}),ve=(0,S.A)(()=>{x({chatId:s.id,topicId:e.id})}),Ae=(0,S.A)(()=>{ce(),ie()}),ye=(0,S.A)(()=>{V({chatId:n,topicId:e.id,mutedUntil:a.Os5})}),{renderSubtitle:Ce,ref:we}=(0,W.A)({chat:s,chatId:n,lastMessage:c,draft:k,lastMessageSender:y,lastMessageTopic:e,observeIntersection:f,isTopic:!0,typingStatus:N,topicIds:F,statefulMediaContent:(0,d.FE)({story:m}),animationType:C,withInterfaceAnimations:w,orderDiff:I,shiftDiff:M,onReorderAnimationEnd:T}),Ie=(0,S.A)(t=>{if(t.altKey)return t.preventDefault(),void j({id:n,threadId:e.id});D({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),s.isBotForum||s.isMonoforum||K({chatId:n,isEnabled:!1}),p&&U()}),be=function({topic:e,unreadCount:t,chat:n,isChatMuted:s,wasOpened:a,canDelete:r,handleDelete:l,handleMute:c,handleUnmute:h}){const m=(0,b.A)(),p=(0,z.A)();return(0,o.Kr)(()=>{const{isPinned:o,notifySettings:g,isClosed:f,id:A}=e,y=n.id,{editTopic:C,toggleTopicPinned:w,markTopicRead:I,openChatInNewTab:b,openQuickPreview:S}=(0,i.ko)(),M=(0,d.l1)(n,e)&&!n.isBotForum,N=n.isCreator||(0,d.ub)(n,"manageTopics"),k=u.OS&&{title:_.Vq?m("ChatListOpenInNewWindow"):m("ChatListOpenInNewTab"),icon:"open-in-new-tab",handler:()=>{b({chatId:n.id,threadId:A})}},Y={title:m("QuickPreview"),icon:"eye-outline",handler:()=>{S({id:y,threadId:A})}},F=t||!a?{title:p("MarkAsRead"),icon:"readchats",handler:()=>{I({chatId:y,topicId:A})}}:void 0,P=N?o?{title:p("UnpinFromTop"),icon:"unpin",handler:()=>w({chatId:y,topicId:A,isPinned:!1})}:{title:p("PinToTop"),icon:"pin",handler:()=>w({chatId:y,topicId:A,isPinned:!0})}:void 0,T=s&&void 0===g.mutedUntil||g.mutedUntil?{title:p("ChatList.Unmute"),icon:"unmute",handler:h}:{title:`${p("ChatList.Mute")}...`,icon:"mute",handler:c},D=M?f?{title:p("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>C({chatId:y,topicId:A,isClosed:!1})}:{title:p("lng_forum_topic_close"),icon:"close-topic",handler:()=>C({chatId:y,topicId:A,isClosed:!0})}:void 0,x=r?{title:p("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:l}:void 0;return(0,v.oE)([k,Y,P,F,T,D,x])},[n,e,t,a,s,r,l,c,h,m,p])}({topic:e,chat:s,isChatMuted:r,wasOpened:Y,canDelete:A,unreadCount:P,handleDelete:fe,handleMute:Ae,handleUnmute:ye});return(0,O.FD)(B.A,{className:(0,h.A)(R,"Chat",t&&"selected","chat-item-clickable"),onClick:Ie,style:l,href:u.OS?`#${(0,L.az)(n,"thread",e.id)}`:void 0,contextActions:be,withPortalForMenu:!0,ref:we,children:[(0,O.FD)("div",{className:"info",children:[(0,O.FD)("div",{className:"info-row",children:[(0,O.FD)("div",{className:(0,h.A)("title"),children:[(0,O.Y)(Z.A,{topic:e,className:"tEQjGvh6",observeIntersection:f}),(0,O.Y)("h3",{dir:"auto",className:"fullName",children:(0,$.A)(e.title)})]}),Boolean(pe.mutedUntil)&&(0,O.Y)(Q.A,{name:"muted"}),(0,O.Y)("div",{className:"separator"}),me&&(0,O.Y)(Q.A,{name:"lock-badge",className:"kIae39BG"}),c&&(0,O.Y)(E.A,{message:c,outgoingStatus:g})]}),(0,O.FD)("div",{className:"subtitle",children:[Ce(),(0,O.Y)(te.A,{chat:s,isPinned:he,isMuted:ge,topic:e,wasTopicOpened:Y,isSelected:t})]})]}),ae&&(0,O.Y)(X.A,{isOpen:G,onClose:ne,onCloseAnimationEnd:de,confirmIsDestructive:!0,confirmHandler:ve,text:J("lng_forum_topic_delete_sure"),confirmLabel:J("Delete")}),le&&(0,O.Y)(ee.A,{isOpen:oe,onClose:se,onCloseAnimationEnd:ue,chatId:n,topicId:e.id})]})})),oe="XjZQCsMW",ie=(0,o.ph)((0,i.EK)(e=>{const t=(0,l.nTw)(e).forumPanelChatId,n=t?(0,l.hds)(e,t):void 0,{chatId:o,threadId:i}=(0,l.Xf0)(e)||{},s=t?(0,l.xyP)(e,t):void 0;return{chat:n,currentTopicId:t===o?Number(i):void 0,withInterfaceAnimations:(0,l.PKK)(e),topicsInfo:s}},e=>(0,l.clw)(e))(({chat:e,currentTopicId:t,isOpen:n,isHidden:l,topicsInfo:L,withInterfaceAnimations:E,onTopicSearch:B,onCloseAnimationEnd:R,onOpenAnimationStart:K})=>{const{closeForumPanel:z,openChatWithInfo:V,loadTopics:j}=(0,i.ko)(),J=(0,o.li)(),q=(0,o.li)(),$=(0,o.li)(),{isMobile:H}=(0,y.Ay)(),W=e?.id;(0,o.vJ)(()=>{W&&!L&&j({chatId:W})},[L,W]);const[_,Q]=(0,o.J0)(!1),Z=(0,b.A)(),X=(0,S.A)(()=>{z()});(0,o.vJ)(()=>{E||n||R?.()},[E,n,R]);const ee=(0,S.A)(()=>{e&&V({id:e.id,shouldReplaceHistory:!0})}),{observe:te}=(0,I.BL)({rootRef:q,throttleMs:200});(0,I.mv)($,te,({isIntersecting:e})=>{Q(!e)});const ie=(0,o.hb)(t=>{if(e?.id)return(0,v.Tq)(L?.topicsById||{},n=>(0,c.$j)(t,e.id,n.id))},[e?.id,L?.topicsById]),se=(0,A.Ay)(ie),ae=(0,o.Kr)(()=>{const t=se&&(0,v.LG)(se,e=>e.threadInfo),n=L&&se?(0,d.CO)(Object.values(L.topicsById),t,L.orderedPinnedTopicIds).map(({id:e})=>e):[];return e?.isBotForum?[s.l3,...n]:n},[e?.isBotForum,L,se]),{orderDiffById:re,shiftDiff:de,getAnimationType:le,onReorderAnimationEnd:ce}=(0,N.A)(ae,0,e?.id),[ue,he]=(0,w.A)(()=>{e&&j({chatId:e.id})},ae,!L?.totalCount||ae.length>=L.totalCount,a.iIc),me=(0,o.li)(!1),pe=n&&!l,ge=(0,M.A)(pe);ge!==pe&&(me.current=!1),(0,C.A)({isActive:pe,onBack:X}),(0,o.vJ)(()=>pe?(0,m.A)(X):void 0,[X,pe]),(0,o.vJ)(()=>{ge!==pe&&(0,r.Uz)(()=>{if(!J.current)return;const e=(0,o.VK)();(0,g.j)(J.current,e),K?.(),pe?(me.current=!0,J.current.style.transform="none"):(me.current=!1,J.current.style.transform="")})},[pe,K,ge]),(0,o.vJ)(()=>{if(u.TF)return(0,p.wJ)(J.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(Z.isRtl?p.ez.Left:p.ez.Right)&&(z(),!0)})},[z,Z.isRtl]);const fe=void 0===L;if(e)return(0,O.FD)("div",{ref:J,className:(0,h.A)("lrlHKC_D",_&&"H5tiS5xY",Z.isRtl&&"Lt4eKHrj",!E&&"c1q2bVwa"),onTransitionEnd:n?void 0:R,children:[(0,O.FD)("div",{id:"TopicListHeader",className:"left-header",children:[(0,O.Y)(T.A,{round:!0,size:"smaller",color:"translucent",onClick:X,ariaLabel:Z("Close"),iconName:"close"}),(0,f.L8)(e.id)?(0,O.Y)(F.A,{noAvatar:!0,className:oe,userId:e.id,onClick:ee}):(0,O.Y)(Y.A,{noAvatar:!0,className:oe,chatId:e.id,onClick:ee}),(0,O.Y)(P.A,{chatId:e.id,threadId:s.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:H,onTopicSearch:B})]}),!(0,f.L8)(e.id)&&(0,O.Y)(k.A,{chatId:e.id}),(0,O.Y)("div",{className:"JTeUtfo5"}),(0,O.FD)(D.A,{className:"chat-list custom-scroll",ref:q,items:ue,preloadBackwards:a.iIc,withAbsolutePositioning:!0,maxHeight:(ae?.length||0)*a.HGU,onLoadMore:he,sensitiveArea:a.C$_,beforeChildren:(0,O.Y)("div",{ref:$,className:"RtZDYhKR"}),children:[Boolean(ue?.length)&&function(){const n=ae.indexOf(ue[0]);return ue?.map((o,i)=>o===s.l3?(0,O.Y)(U,{chatId:e.id,isSelected:t===o},o):(0,O.Y)(ne,{chatId:e.id,topic:L.topicsById[o],style:`top: ${(n+i)*a.HGU}px;`,isSelected:t===o,observeIntersection:te,animationType:le(o),orderDiff:re[o],shiftDiff:de,onReorderAnimationEnd:ce},o))}(),fe&&!ue?.length&&(0,O.Y)(x.A,{},"loading")]}),!fe&&1===ue?.length&&ue[0]===a.HxB&&(0,O.Y)(G,{chatId:W})]})}))},78407(e,t,n){n.d(t,{A:()=>_});var o=n(84051),i=n(13439),s=n(31481),a=n(66644),r=n(11597),d=n(30708),l=n(96115),c=n(63495),u=n(96454),h=n(87357),m=n(52674),p=n(14680),g=n(17237),f=n(36353),v=n(37836),A=n(4961),y=n(11359),C=n(43874),w=n(19129),I=n(37661),b=n(39351),S=n(17712),M=n(59030),N=n(88458),k=n(41733);class Y{isPlaying=!1;constructor(e,t,n){this.container=t,this.options=n,this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,a.RK)(()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()})}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,k.A)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,a.YS)(()=>{if(!this.video)return;const o=this.video,{width:i,height:s}=this.container.getBoundingClientRect();(0,a.RK)(()=>{o.style.left=`${Math.round(t*i)}px`,o.style.top=`${Math.round(n*s)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`})})}}var F=n(48894),P=n(60261),T=n(43336),D=n(76023),x=n(37479),L=n(87094),E=n(82117),B=n(93545),R=n(672),O=n(61157),U=n(38691);const K=1.25*D.$;var z=n(18276),V=n(64493),j=n(80089),J=n(80464),G=n(20021);const q=e=>{const{isOpen:t}=e,n=(0,J.A)(j.ar.Extra,"TextFormatter",!t);return n?(0,G.Y)(n,{...e}):void 0},$="input-scroller",H=140,W=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],_=(0,o.ph)((0,i.EK)((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:o}=(0,d.lS)(e);return{messageSendKeyCombo:o,replyInfo:t&&n?(0,l.GA)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.rTV)(e),canPlayAnimatedEmojis:(0,r.BWX)(e)}})(({ref:e,id:t,chatId:n,captionLimit:d,isAttachmentModalInput:l,isStoryInput:k,customEmojiPrefix:D,editableInputId:j,isReady:J,isActive:_,getHtml:Q,placeholder:Z,forcedPlaceholder:X,canSendPlainText:ee,canAutoFocus:te,noFocusInterception:ne,shouldSuppressFocus:oe,shouldSuppressTextFormatter:ie,replyInfo:se,isSelectModeActive:ae,canPlayAnimatedEmojis:re,messageSendKeyCombo:de,isNeedPremium:le,messageListType:ce,onUpdate:ue,onSuppressedFocus:he,onSend:me,onScroll:pe,onFocus:ge,onBlur:fe})=>{const{editLastMessage:ve,replyToNextMessage:Ae,showAllowedMessageTypesNotification:ye,openPremiumModal:Ce}=(0,i.ko)();let we=(0,o.li)();e&&(we=e);const Ie=(0,o.li)(),be=(0,o.li)(),Se=(0,o.li)(),Me=(0,o.li)(),Ne=(0,o.li)(),ke=(0,o.li)(),Ye=(0,M.A)(),Fe=(0,b.A)(),Pe=(0,o.li)(!1),[Te,De,xe]=(0,I.A)(),[Le,Ee]=(0,o.J0)(),[Be,Re]=(0,o.J0)(),[Oe,Ue]=(0,o.J0)(!1),{isMobile:Ke}=(0,C.Ay)(),ze=Ke&&(u.pz||u.Ni);!function(e,t,n,s,d,l,c,u,h){const m=(0,L.A)(t,void 0,!u),p=(0,x.A)(m,!0),g=(0,U.A)(),f=(0,o.li)(new Map),v=(0,S.A)(e=>{e.forEach(e=>{const t=f.current.get(e);t&&(t.destroy(),f.current.delete(e))})}),A=(0,S.A)(()=>{if(!(u&&t.current&&n.current&&s.current))return;const e=(0,i.mS)(),o=new Set(f.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach(t=>{if(!t.dataset.uniqueId)return;const i=`${l}${t.dataset.uniqueId}${m||""}`,a=t.dataset.documentId;o.delete(i);const u=(0,P.ZR)(a);if(!u)return;const h=n.current.getBoundingClientRect(),v=t.getBoundingClientRect(),A=(0,T.LI)((v.left-h.left)/h.width,4),y=(0,T.LI)((v.top-h.top)/h.height,4);if(f.current.has(i))return void f.current.get(i).updatePosition(A,y);const C=(0,r.O8F)(e,a);if(!C)return;const w=C?.stickerSetInfo&&(0,r.CzR)(e,C.stickerSetInfo),I=[l,a,m,g].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:o,renderId:i,viewId:s,mediaUrl:a,position:r,isHq:d,textColor:l,colorFilter:c}){if(e.isLottie){const o=e.shouldUseTextColor&&l?(0,F.hF)(l):void 0,c=(await(0,N.Y)()).init(a,d?n.current:t.current,i,{size:K,coords:r,isLowPriority:!d},s,o?[o.r,o.g,o.b]:void 0);return{play:()=>c.play(),pause:()=>c.pause(),destroy:()=>c.removeView(s),updatePosition:(e,t)=>c.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&c?`filter: ${c};`:void 0,n=new Y(a,o.current,{size:K,position:r,style:t});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:C,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:d,renderId:I,viewId:i,mediaUrl:u,isHq:w,position:{x:A,y},textColor:m,colorFilter:p}).then(e=>{c&&e.play(),f.current.set(i,e)})}),v(Array.from(o))});(0,o.vJ)(()=>(0,P.K3)(A),[A]),(0,o.vJ)(()=>{const e=f.current;return()=>{v(Array.from(e.keys()))}},[]),(0,o.vJ)(()=>{e()&&t.current&&n.current&&h&&u?(0,a.YS)(()=>{A()}):v(Array.from(f.current.keys()))},[e,A,t,v,n,h,u]),(0,o.Nf)(()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")},[p]),(0,E.A)(([e])=>{void 0!==e&&m!==e&&A()},[m,A]);const y=(0,R.A)(A,[A],300,!1);(0,B.A)(n,y),(0,E.A)(([e])=>{g!==e&&(v(Array.from(f.current.keys())),A())},[g,A]);const C=(0,S.A)(()=>{f.current.forEach(e=>{e.pause()})}),w=(0,S.A)(()=>{c&&f.current?.forEach(e=>{e.play()})}),I=(0,S.A)(()=>{(0,a.YS)(w)});(0,O.Ay)(C,I)}(Q,we,Me,Ne,ke,D,re,J,_);const Ve=l?160:k?128:Ke?256:416,je=(0,S.A)((e=!1)=>{(0,v.IJ)(()=>{(0,a.gm)(()=>{const t=we.current.closest(`.${$}`),n=Number(t.style.height.replace("px","")),o=Se.current,{scrollHeight:i}=o,s=Math.min(i,Ve);if(s===n)return;const r=i>Ve;function d(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,a.RK)(d):d})})});(0,o.Nf)(()=>{l&&je(!1)},[l,je]);const Je=(0,o.li)(Q());(0,o.Nf)(()=>{const e=_?Q():"";!_&&we.current&&we.current.blur(),e!==we.current.innerHTML&&(we.current.innerHTML=e),e!==be.current.innerHTML&&(be.current.innerHTML=e),e!==Je.current&&(Je.current=e,je(!e))},[Q,_,je]),(0,o.li)(n).current=n;const Ge=(0,S.A)(()=>{we.current&&!le&&(0,f.A)(we.current)}),qe=(0,S.A)(()=>{xe(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()});function $e(){if(u.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Pe.current)return xe(),u.Ni&&Ue(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(ie||!(0,y.L)(t,j||s.CfG)||!n||(0,g.A)(n)||!t.START_TO_END)||(xe(),!1)}function He(){if(!$e())return;if(Oe)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=we.current.closest(`.${$}`).getBoundingClientRect();let o=t.left+t.width/2-n.left;o<H?o=H:o>n.width-H&&(o=n.width-H),Ee({x:o,y:t.top-n.top}),Re(e),De()}function We(){Ie.current&&window.clearTimeout(Ie.current),Ie.current=window.setTimeout(He,260)}const _e=(0,S.A)(e=>"Enter"===e.key&&!e.shiftKey&&!ze&&("enter"===de&&!e.shiftKey||"ctrl-enter"===de&&(e.ctrlKey||e.metaKey))),Qe=(0,S.A)(e=>{e.preventDefault(),xe(),me()}),Ze=(0,S.A)(()=>Ce());(0,o.vJ)(()=>{u.TF||te&&Ge()},[n,Ge,se,te]),(0,o.vJ)(()=>{if(!n||j!==s.CfG&&j!==s.e0F||ze||ae)return;const e=e=>{const t=e.target,n=we.current;if(!(_&&n&&t&&t!==n&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName)||t.isContentEditable||(0,m.N)("Enter"))return;if(_e(e))return void Qe(e);const{key:o}=e;if(ne||(0,p.ZJ)()||W.includes(o))return;const i=document.getSelection()?.isCollapsed;if((o.startsWith("Arrow")||e.shiftKey&&"Shift"===o)&&!i||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==t.tagName)return;(0,f.A)(n,!0,!0);const s=new KeyboardEvent(e.type,e);n.dispatchEvent(s)};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[n,j,ze,_,ae,ne]),(0,o.vJ)(()=>{const e=(0,v.sg)(e=>{"Tab"!==e.key||(0,p.ZJ)()||(e.preventDefault(),(0,a.RK)(Ge))},2e3,!0,!1);return(0,m.A)({onTab:e})},[Ge]),(0,o.vJ)(()=>{const e=we.current;function t(){e.blur()}return oe&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[oe]);const Xe=(0,w.A)(()=>Boolean(_&&Q()),[_,Q]),et=(0,h.A)("form-control allow-selection",Xe&&"touched",oe&&"focus-disabled"),tt=(0,h.A)("input-scroller-content",le&&"is-need-premium"),nt="string"==typeof Z?Z:void 0;return(0,G.FD)("div",{id:t,onClick:oe?he:void 0,dir:Fe.isRtl?"rtl":void 0,children:[(0,G.Y)("div",{className:(0,h.A)("custom-scroll",$,le&&"is-need-premium"),onScroll:pe,onClick:l||ee?void 0:function(){l||ee||k&&le||ye({chatId:n,messageListType:ce})},children:(0,G.FD)("div",{className:tt,children:[(0,G.Y)("div",{ref:we,id:j||s.CfG,className:et,contentEditable:l||ee,role:"textbox",dir:"auto",spellCheck:!c.Vq&&void 0,tabIndex:0,onClick:Ge,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ue("<br>"===t?"":t),!u.TF&&(!n||!n.length)&&(u.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(we.current.blur(),e.removeAllRanges(),(0,f.A)(we.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=Q();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void Ae({targetIndexDelta:t})}!t&&_e(e)?Qe(e):t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",We,{once:!0}):(e.preventDefault(),ve())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout(()=>{Pe.current=!1},100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Pe.current||(Pe.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",We,{once:!0})},onContextMenu:u.Ni?function(e){$e()&&(Ue(!Oe),Oe?xe():(e.preventDefault(),e.stopPropagation(),He()))}:void 0,onTouchCancel:u.Ni?We:void 0,"aria-label":nt,onFocus:le?void 0:ge,onBlur:le?void 0:fe}),!X&&(0,G.FD)("span",{className:(0,h.A)("placeholder-text",!l&&!ee&&"with-icon",le&&"is-need-premium"),dir:"auto",children:[!l&&!ee&&(0,G.Y)(z.A,{name:"lock-badge",className:"placeholder-icon"}),Z,k&&le&&(0,G.Y)(V.A,{className:"unlock-button",size:"tiny",color:"adaptive",onClick:Ze,children:Ye("StoryRepliesLockedButton")})]}),(0,G.Y)("canvas",{ref:Me,className:"shared-canvas"}),(0,G.Y)("canvas",{ref:Ne,className:"shared-canvas"}),(0,G.Y)("div",{ref:ke,className:"absolute-video-container"})]})}),(0,G.Y)("div",{ref:Se,className:(0,h.A)("custom-scroll",$,"clone",le&&"is-need-premium"),children:(0,G.Y)("div",{className:tt,children:(0,G.Y)("div",{ref:be,className:(0,h.A)(et,"clone"),dir:"auto"})})}),void 0!==d&&(0,G.Y)("div",{className:"max-length-indicator",dir:"auto",children:d}),(0,G.Y)(q,{isOpen:Te,anchorPosition:Le,selectedRange:Be,setSelectedRange:Re,onClose:qe}),X&&(0,G.Y)("span",{className:"forced-placeholder",children:(0,A.A)(X)})]})}))},79882(e,t,n){n.d(t,{E5:()=>s,IP:()=>i,We:()=>a});var o=n(84051);let i=function(e){return e[e.Shift=0]="Shift",e[e.Move=1]="Move",e[e.Opacity=2]="Opacity",e[e.None=3]="None",e}({});const s="archive";function a(e,t,n){return(0,o.Kr)(()=>{if(t)return()=>i.None;const o=Object.values(e),s=o.filter(e=>e<0).length,a=o.filter(e=>e>0).length;return t=>{const o=e[t];return o?o===1/0||o===-1/0||s<=a&&o<0||a<s&&o>0?i.Opacity:i.Move:n?i.Shift:i.None}},[e,n,t])}},80477(e,t,n){n.d(t,{A:()=>u});var o=n(84051),i=n(13439),s=n(90709),a=n(11597),r=n(4961),d=n(59030),l=n(80999),c=n(20021);const u=(0,o.ph)((0,i.EK)((e,{typingStatus:t})=>t.userId?{typingUser:(0,a.mBe)(e,t.userId)}:{typingUser:void 0})(({typingStatus:e,typingUser:t})=>{const n=(0,d.A)(),o=t&&!t.isSelf&&(0,s.u0)(t),i=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return(0,c.FD)("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto",children:[o&&(0,c.Y)("span",{className:"sender-name",dir:"auto",children:(0,r.A)(o)}),(0,c.Y)(l.A,{content:i})]})}))},80999(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(87357),s=n(4961),a=n(39351),r=n(20021);const d=(0,o.ph)(({content:e,className:t})=>{const n=(0,a.A)();return(0,r.FD)("span",{className:(0,i.A)("DotAnimation",t),dir:n.isRtl?"rtl":"auto",children:[(0,s.A)(e),(0,r.Y)("span",{className:"ellipsis"})]})})},81524(e,t,n){n.d(t,{A:()=>y});var o=n(84051),i=n(90709),s=n(96454),a=n(87357),r=n(17663),d=n(83868),l=n(35749),c=n(2338),u=n(37661),h=n(5912),m=n(17712),p=n(62587),g=n(83057),f=n(65843),v=n(27860),A=n(20021);const y=(0,o.ph)(({message:e,idPrefix:t="shared-media",isProtected:n,canAutoPlay:y,observeIntersection:C,onClick:w})=>{const I=(0,o.li)(),b=(0,h.Vz)(I,C),[S,M,N]=(0,u.A)(),k=(0,c.A)(e),Y=(0,l.A)(e,"pictogram"),F=(0,p.A)(Y,!b),P=(0,g.A)(F),T=(0,i.zX)(e),D=T?.isGif?(0,i.sC)(T,"full"):void 0,x=(0,p.A)(D,!b),L=(0,i.y2)(e),[E,,B]=(0,u.A)(L),R=(0,m.A)(()=>{B(),w(e.id,e.chatId)});return(0,A.FD)("div",{ref:I,id:`${t}${(0,i.GZ)(e.id)}`,className:"Media scroll-item",onClick:w?R:void 0,onMouseOver:s.TF?void 0:M,onMouseOut:s.TF?void 0:N,children:[(0,A.Y)("img",{src:k,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?d.A:void 0}),x?(0,A.Y)(f.A,{canPlay:b&&!L&&S&&Boolean(y),src:x,className:(0,a.A)("full-media","media-miniature",P),muted:!0,loop:!0,playsInline:!0,draggable:!1,disablePictureInPicture:!0,onContextMenu:n?d.A:void 0}):(0,A.Y)("img",{src:F,className:(0,a.A)("full-media","media-miniature",P),alt:"",draggable:!1,decoding:"async",onContextMenu:n?d.A:void 0}),L&&(0,A.Y)(v.A,{thumbDataUri:F||k,isVisible:E,className:"media-spoiler"}),T&&(0,A.Y)("span",{className:"video-duration",children:T.isGif?"GIF":(0,r.QO)(T.duration)}),n&&(0,A.Y)("span",{className:"protector"})]})})},81642(e,t,n){n.d(t,{A:()=>l});var o=n(84051),i=n(87357),s=n(17663),a=n(59030),r=n(45),d=n(20021);const l=(0,o.ph)(({className:e,message:t,outgoingStatus:n,draftDate:o})=>{const l=(0,a.A)(),c=o&&o>t.date;return(0,d.FD)("div",{className:(0,i.A)("LastMessageMeta",e),children:[n&&!c&&(0,d.Y)(r.A,{status:n}),(0,d.Y)("span",{className:"time",children:(0,s.be)(l,1e3*(c?o:t.date))})]})})},84313(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(13439),s=n(96454),a=n(17712),r=n(59030);function d(e,t,n){const{showNotification:d}=(0,i.ko)(),l=(0,r.A)(),[c,u]=(0,o.J0)(!1),h=(0,a.A)(()=>{u(!0),t||d({message:s.yS?l("Video.Unsupported.Mobile"):l("Video.Unsupported.Desktop"),duration:8e3})}),m=(0,a.A)(e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||h())}),p=(0,a.A)(e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||h()});return(0,o.vJ)(()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",m),t.addEventListener("canplay",p),()=>{t.removeEventListener("error",m),t.removeEventListener("canplay",p)}):void 0},[n,e]),c}},84555(e,t,n){n.d(t,{A:()=>T});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(53827),d=n(87357),l=n(17663),c=n(41733),u=n(76023),h=n(2338),m=n(63988),p=n(37661),g=n(5912),f=n(17712),v=n(37960),A=n(69419),y=n(73767),C=n(34201),w=n(61097),I=n(18276),b=n(27860),S=n(64493),M=n(65843),N=n(35913),k=n(20021);const Y=u.Wd/2,F=2*(Y-6)*Math.PI;let P;const T=({message:e,className:t,canAutoLoad:n,isDownloading:T,origin:D,observeIntersection:x,onStop:L,onReadMedia:E,isTranscriptionError:B,isTranscribed:R,canTranscribe:O,onHideTranscription:U,isTranscriptionHidden:K,isTranscribing:z})=>{const V=(0,o.li)(),j=(0,o.li)(),J=(0,o.li)(),{cancelMediaDownload:G,openOneTimeMediaModal:q,transcribeAudio:$}=(0,i.ko)(),H=(0,g.Vz)(V,x),W=e.content.video,_=e.isMediaUnread,[Q,Z]=(0,o.J0)(n),X=Boolean(Q&&H),{mediaData:ee,loadProgress:te}=(0,A.A)((0,a.sC)(W,"inline"),!X,(0,a.Cz)(W,"inline")),{loadProgress:ne}=(0,A.A)((0,a.sC)(W,"download"),!T,s.qZ.BlobUrl),[oe,ie]=(0,p.A)(),se=(0,a.G5)(e),ae="oneTimeModal"===D,re=se&&!ae,de=(0,h.A)(e),le=!Boolean(de)||oe||re,ce=(0,w.A)(W,le);(0,v.A)({hasMediaData:!le,ref:ce});const ue=Q&&!oe||T,he=!1===(0,y.A)(Q),{ref:me,shouldRender:pe}=(0,C.A)({isOpen:ue,noMountTransition:he,withShouldRender:!0}),[ge,fe]=(0,o.J0)(!1),[ve,Ae]=(0,o.J0)(0),[ye,Ce]=(0,o.Ul)(0),we=(0,m.aG)(ye,16);(0,o.vJ)(()=>{if(!ge)return;const e=j.current;Ce(e.currentTime/e.duration)},[Ce,ge,we]),(0,o.Nf)(()=>{if(!ge||!J.current)return;const e=F-we()*F;J.current.setAttribute("stroke-dashoffset",e.toString())},[ge,we]);const Ie=Boolean(ee&&H),be=(0,f.A)(()=>{j.current&&(fe(!1),Ce(0),(0,c.A)(j.current))}),Se=(0,f.A)(()=>{P?.(),P=be}),Me=(0,f.A)(()=>{const e=j.current;ge?e.paused?((0,c.A)(e),(0,r._K)()):e.pause():(Se(),e.pause(),e.currentTime=0,(0,c.A)(e),(0,r._K)(),fe(!0))});(0,o.vJ)(()=>{ae&&Me()},[ae]);const Ne=(0,f.A)(t=>{if(!t.target.closest(".transcribe-button"))if(ee){if(!T)return se&&!ae?(q({message:e}),void E?.()):void Me();G({media:W})}else Z(e=>!e)});(0,o.vJ)(()=>{E&&_&&ge&&E()},[ge,_,E]);const ke=(0,f.A)(e=>{const t=e.currentTarget;Ce(t.currentTime/t.duration),Ae(Math.floor(t.currentTime))}),Ye=(0,f.A)(()=>{$({chatId:e.chatId,messageId:e.id})}),Fe=(0,f.A)(()=>{(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)(b.A,{isVisible:!0,thumbDataUri:de,width:u.Wd,height:u.Wd,className:"media-spoiler"}),(0,k.Y)(M.A,{canPlay:Ie,ref:j,src:ee,className:"full-media",width:u.Wd,height:u.Wd,autoPlay:!re,disablePictureInPicture:!0,muted:!ge,defaultMuted:!0,loop:!ge,playsInline:!0,isPriority:!0,onEnded:ge?L??be:void 0,onTimeUpdate:ge?ke:void 0,onReady:ie})]}),!re&&(0,k.Y)("canvas",{ref:ce,className:"thumbnail",style:`width: ${u.Wd}px; height: ${u.Wd}px`}),(0,k.Y)("div",{className:"progress",children:ge&&(0,k.Y)("svg",{width:u.Wd,height:u.Wd,children:(0,k.Y)("circle",{ref:J,cx:Y,cy:Y,r:Y-6,className:"progress-circle",transform:`rotate(-90, ${Y}, ${Y})`,"stroke-dasharray":F,"stroke-dashoffset":F})})}),pe&&(0,k.Y)("div",{ref:me,className:"media-loading",children:(0,k.Y)(N.A,{progress:T?ne:te})}),re&&!pe&&(0,k.FD)("div",{className:"play-wrapper",children:[(0,k.Y)(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0,iconName:"play"}),(0,k.Y)(I.A,{name:"view-once"})]}),!ee&&!Q&&(0,k.Y)(I.A,{name:"download"}),!ae&&(0,k.FD)("div",{className:(0,d.A)("message-media-duration",_&&"unread"),children:[ge?(0,l.QO)(ve):(0,l.QO)(W.duration),(!ge||j.current.paused)&&(0,k.Y)(I.A,{name:"muted"})]}),O&&(0,k.FD)(S.A,{onClick:Fe,className:"transcribe-button",children:[R||B?(0,k.Y)(I.A,{name:"down"}):(0,k.Y)(I.A,{name:"transcribe"}),z&&(0,k.Y)("svg",{viewBox:"0 0 32 24",className:"loading-svg",children:(0,k.Y)("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"white","stroke-dashoffset":"1","stroke-dasharray":"32,68"})})]})]})}},87970(e,t,n){n.d(t,{A:()=>le});var o=n(84051),i=n(89925),s=n(31481),a=n(90709),r=n(13439),d=n(11597),l=n(30708),c=n(96115),u=n(96454),h=n(87357),m=n(95807),p=n(50442),g=n(79824),f=n(31460),v=n(76023),A=n(4961),y=n(41385),C=n(54699),w=n(39351),I=n(17712),b=n(59030),S=n(73767),M=n(45294),N=n(23174),k=n(58554),Y=n(41036),F=n(21849),P=n(34431),T=n(18276),D=n(38102),x=n(48899),L=n(14242),E=n(43874),B=n(45470),R=n(37661),O=n(62587),U=n(83057),K=n(39996),z=n(65843),V=n(97422),j=n(20021);const J=(0,o.ph)(({chat:e,user:t,photo:n,isSavedMessages:i,isSavedDialog:s,canPlayVideo:r,className:d,style:l,theme:c,onClick:p})=>{const g=(0,o.li)(),f=(0,w.A)(),{isMobile:v}=(0,E.Ay)(),y=t&&(0,a.PL)(t),C=e&&(0,a.kE)(e.id),I=e&&(0,a.Qe)(e.id),b=t||e,S=b&&!i&&!y&&!C&&!I,{isVideo:M}=n||{},N=(!n||n.id===b.avatarPhotoId)&&(0,a.cP)(b,"normal"),k=S&&n&&!N&&(0,a.rI)(n,"pictogram"),Y=(0,O.A)(k||N),F=S&&n&&!M&&(0,a.mU)(n),P=(0,O.A)(F),D=S&&n&&M&&(0,a.Pg)(n),J=(0,O.A)(D)||P,[G,q]=(0,R.A)(),$=Boolean(J&&(!M||G)),H=(0,U.A)($),W=S&&!$&&!Y&&n?.thumbnail?.dataUri,_=(0,B.A)(n?.thumbnail?.dataUri,!W,v&&!u.QH),Q=n||Y||W,{className:Z,style:X}=(0,K.Ay)({peer:b,theme:c});(0,o.vJ)(()=>{g.current&&!r&&(g.current.currentTime=0)},[r]);const ee=(0,o.Kr)(()=>i?s?"my-notes":"avatar-saved-messages":y?"avatar-deleted-account":C?"reply-filled":I?"author-hidden":void 0,[I,y,s,C,i]);let te;if(ee)te=(0,j.Y)(T.A,{name:ee,role:"img"});else if(Q)te=(0,j.FD)(j.FK,{children:[W?(0,j.Y)("canvas",{ref:_,className:"thumb"}):(0,j.Y)("img",{src:Y,draggable:!1,className:"thumb",alt:""}),n&&(M?(0,j.Y)(z.A,{canPlay:r,ref:g,src:J,className:(0,h.A)("avatar-media",H),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:q}):(0,j.Y)("img",{src:J,draggable:!1,className:(0,h.A)("avatar-media",H),alt:""}))]});else if(t){const e=(0,a.Yg)(t);te=e?(0,L.Qh)(e,2):void 0}else if(e){const t=(0,a.Js)(f,e);te=t&&(0,L.Qh)(t,(0,x.L8)(e.id)?2:1)}else te=(0,j.Y)("div",{className:"spinner-wrapper",children:(0,j.Y)(V.A,{color:"white"})});const ne=(0,h.A)("ProfilePhoto",Z,i&&"saved-messages",I&&"anonymous-forwards",y&&"deleted-account",C&&"replies-bot-account",!i&&!Q&&"no-photo",d);return(0,j.Y)("div",{className:ne,style:(0,m.A)(l,X),onClick:Q?p:void 0,children:"string"==typeof te?(0,A.A)(te,["hq_emoji"]):te})});var G=n(43336),q=n(66833),$=n(95773),H=n(82855);const W=2*v.$,_=[{x:-.2,y:-.3},{x:.3,y:.1},{x:-.4,y:-.1},{x:.4,y:-.1},{x:-.25,y:.1},{x:.25,y:-.25}],Q=({gift:e,style:t,className:n,withGlow:i,peerId:s})=>{const{openGiftInfoModal:a}=(0,r.ko)(),d=(0,o.li)(),l=(0,o.Kr)(()=>(0,q.uc)(e.gift),[e]),c=(0,I.A)(()=>{a({peerId:s,gift:e})});if(l?.model&&l.backdrop)return(0,j.Y)($.A,{withSparkles:!0,sparklesColor:l.backdrop.textColor,glowColor:i?l.backdrop.edgeColor:void 0,ref:d,className:n,style:t,onClick:c,children:(0,j.Y)(H.A,{containerRef:d,sticker:l.model.sticker,size:W,withTranslucentThumb:!0,noPlay:!0})})},Z=(0,o.ph)(({peerId:e,gifts:t,isExpanded:n,className:o,withGlow:i})=>{const{createVtnStyle:s}=(0,y.k)();if(t)return(0,j.Y)("div",{className:(0,h.A)("dspICZx5",o),children:t.slice(0,_.length).map((t,o)=>{const a=n?function(e){return{x:(0,G.qE)(1.5*e.x,-.45,.45),y:(0,G.qE)(1.5*e.y,-.45,.45)}}(_[o]):_[o],r=(0,m.A)(`top: ${100*(.5+a.y)}%`,`left: ${100*(.5+a.x)}%`);return(0,j.Y)(Q,{peerId:e,className:"GtRefNqT",gift:t,style:(0,m.A)(r,s(`profilePinnedGift${o}`,"profilePinnedGift")),withGlow:i},t.gift.id)})})});var X=n(40558);const ee="XxRtPe_4",te="eZ2DGNou",ne="ldzIKEUp",oe="uNvH08Qp",ie="UZ7NDj8N",se="Yr9FHqbF",ae="eFsZljMG",re=8*v.$,de=5.25*v.$,le=(0,o.ph)((0,r.EK)((e,{peerId:t})=>{const n=(0,d.PVB)(e,t),o=(0,d.mBe)(e,t),i=o?(0,d.vGo)(e,t):void 0,r=(0,d.K0y)(e,t),u=(0,d.hds)(e,t),h=(0,d.IVq)(e,t),{mediaIndex:m,chatId:p}=(0,d.nTw)(e).mediaViewer,g=u?.isForum,{threadId:f}=(0,d.Xf0)(e)||{},v=g&&f?(0,d.S0q)(e,t,f):void 0,{animationLevel:A}=(0,l.lS)(e),y=n?.emojiStatus,C=y?(0,d.O8F)(e,y.documentId):void 0,w="collectible"===y?.type?y.slug:void 0,I=n&&(0,d.Vi6)(e,n),b=(0,d.SJA)(e),S=(0,d.c7s)(e,t),M=(0,d.FDg)(e,t),N=Boolean(n?.avatarPhotoId),k=(0,a.Qe)(t),Y=(0,a.DX)(t)||k||n?.id===s.zv8;return{user:o,userFullInfo:i,userStatus:r,chat:u,mediaIndex:m,avatarOwnerId:p,animationLevel:A,emojiStatusSticker:C,emojiStatusSlug:w,emojiStatus:y,profilePhotos:h,topic:v,messagesCount:v?(0,c.Qb)(e,t,v.id):void 0,profileColorOption:I,theme:b,isPlain:!S,savedGifts:M,hasAvatar:N,isSystemAccount:Y}})(({isExpanded:e,isForSettings:t,canPlayVideo:n,user:s,userFullInfo:d,userStatus:l,chat:c,mediaIndex:v,avatarOwnerId:x,topic:L,messagesCount:E,animationLevel:B,emojiStatus:R,emojiStatusSticker:O,emojiStatusSlug:U,profilePhotos:K,peerId:z,isForMonoforum:V,profileColorOption:G,theme:q,isPlain:$,savedGifts:H,hasAvatar:W,isSystemAccount:_,onExpand:Q})=>{const{openMediaViewer:le,openPremiumModal:ce,openStickerSet:ue,openPrivacySettingsNoticeModal:he,loadMoreProfilePhotos:me,openUniqueGiftBySlug:pe,openProfileRatingModal:ge,loadPeerSavedGifts:fe}=(0,r.ko)(),ve=(0,b.A)(),Ae=(0,w.A)();(0,C.A)(s?6e4:void 0);const{createVtnStyle:ye}=(0,y.k)(),Ce=K?.photos||g.p,we=(0,S.A)(v),Ie=(0,S.A)(x),[be,Se]=(0,o.J0)(!0),[Me,Ne]=(0,o.J0)(0),ke=Ce.length<=1||0===Me,Ye=Ce.length<=1||Me===Ce.length-1,Fe="collectible"===R?.type?R:void 0,Pe=s||c,{customEmoji:Te}=(0,M.A)(Fe?.patternDocumentId||Pe?.profileColor?.backgroundEmojiId),De=(0,o.Kr)(()=>{if(Fe)return{bgColors:[Fe.centerColor,Fe.edgeColor],storyColors:[Fe.textColor,Fe.textColor]};const e=G&&("dark"===q?G.darkColors:G.colors);return e?{bgColors:[...e.bgColors].reverse(),storyColors:[...e.storyColors].reverse()}:void 0},[G,q,Fe]),xe=De?.bgColors||Te,Le=(0,o.Kr)(()=>H?.gifts.filter(e=>"starGiftUnique"===e.gift.type?e.isPinned&&e.gift.slug!==Fe?.slug:e.isPinned),[H,Fe?.slug]);(0,o.vJ)(()=>{Ce.length-Me<=3&&me({peerId:z})},[Me,z,Ce.length]),(0,o.vJ)(()=>{fe({peerId:z})},[z]),(0,o.vJ)(()=>{Ie&&void 0!==we&&void 0===v&&(Se(!1),Ne(we))},[v,we,Ie]),(0,o.vJ)(()=>{Me>Ce.length&&(Se(!1),Ne(Math.max(0,Ce.length-1)))},[Me,Ce.length]),(0,o.vJ)(()=>{e||Ne(0)},[e]),function(e,t){(0,o.vJ)(()=>{e.slice(t,t+4).forEach(e=>{const t=(0,a.mU)(e);k.Ih(t)||k.hd(t,N.qZ.BlobUrl)})},[t,e])}(Ce,Me);const Ee=(0,I.A)(()=>{le({isAvatarView:!0,chatId:z,mediaIndex:Me,origin:t?i.TQ.SettingsAvatar:i.TQ.ProfileAvatar})}),Be=(0,I.A)(()=>{U?pe({slug:U}):z?ce({fromUserId:z}):ue({stickerSetInfo:O.stickerSetInfo})}),Re=(0,I.A)(()=>{ke||(Se(!0),Ne(Me-1))}),Oe=(0,I.A)(()=>{Ye||(Se(!0),Ne(Me+1))}),Ue=(0,I.A)(()=>{he({chatId:c.id,isReadDate:!1})}),Ke=(0,I.A)(e=>{s&&ge({userId:s.id,level:e})}),ze=(0,I.A)(()=>{t?Ee():W&&Q?.()});if((0,o.vJ)(()=>{const e=document.querySelector(`.${ie}`);if(e)return(0,p.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:u.TF?(e,t)=>t===p.ez.Right?(Re(),!0):t===p.ez.Left&&(Oe(),!0):void 0})},[Oe,Re]),s||c)return L?(0,j.FD)("div",{className:"dNcezQH8",children:[(0,j.Y)(D.A,{topic:L,size:120,className:"YwVcTLvK",letterClassName:"_sQEevF7",noLoopLimit:!0}),(0,j.Y)("h3",{className:"hjk4U031",dir:Ae.isRtl?"rtl":void 0,children:(0,A.A)(L.title)}),(0,j.Y)("p",{className:"GXxwbzqF",children:E?ve("Chat.Title.Topic",E,"i"):ve("lng_forum_no_messages")})]}):(0,j.FD)("div",{className:(0,h.A)("ProfileInfo","Z_HM0Jqg",!e&&"blI_IH7j",$&&"YIhgPXW6"),style:(0,m.A)(De&&`--rating-outline-color: ${e?"transparent":De?.bgColors[0]}`,De&&!e&&`--rating-text-color: ${De?.bgColors[0]}`,ye("profileInfo",!0)),dir:Ae.isRtl?"rtl":void 0,children:[xe&&(0,j.Y)(X.A,{backgroundColors:De?.bgColors,patternIcon:Te,patternSize:16,withLinearGradient:!Fe,className:"BvunKb6r",yPosition:$?de:re}),Boolean(Le?.length)&&(0,j.Y)(Z,{peerId:z,gifts:Le,isExpanded:e,className:"JX3wjADD",withGlow:!$}),e&&(0,j.FD)("div",{className:ie,style:ye("photoWrapper",!0),children:[function(){const e=Math.max(Ce.length,K?.count||0);if(!Ce||e<=1)return;const t=Array.from({length:Math.min(e,30)}),n=Me>=30?29:Me;return(0,j.Y)("div",{className:"e7iOf_3T",style:ye("photoDashes",!0),children:t.map((e,t)=>(0,j.Y)("span",{className:(0,h.A)("eD0Is6TL",t===n&&"MSdiAM06")}))})}(),!t&&K?.personalPhoto&&(0,j.Y)("div",{className:(0,h.A)(te,ke&&oe),children:(0,j.Y)("div",{className:ne,children:ve(K.personalPhoto.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto")})}),t&&K?.fallbackPhoto&&(0,j.Y)("div",{className:(0,h.A)(te,(ke||Ye)&&oe),children:(0,j.FD)("div",{className:ne,onClick:function(){ke&&(Se(!0),Ne(Ce.length-1))},children:[!Ye&&(0,j.Y)(F.A,{photo:K.fallbackPhoto,className:"a9OwsvOP",size:"mini"}),ve(K.fallbackPhoto.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto")]})}),(0,j.Y)(Y.Ay,{activeKey:Me,name:(0,f.P)("slide",B,!be,Ae.isRtl),children:function(e){const t=Ce.length>0?Ce[Me]:void 0;return(0,j.Y)(J,{user:s,chat:c,photo:t,theme:q,canPlayVideo:Boolean(e&&n),className:(0,h.A)(e&&"yltXKQri"),style:e?ye("avatar",!0):void 0,onClick:Ee},Me)}}),!ke&&(0,j.Y)("button",{type:"button",dir:Ae.isRtl?"rtl":void 0,className:(0,h.A)(se,"Z1ZX2xot"),"aria-label":ve("AccDescrPrevious"),onClick:Re}),!Ye&&(0,j.Y)("button",{type:"button",dir:Ae.isRtl?"rtl":void 0,className:(0,h.A)(se,"X0stLWTl"),"aria-label":ve("Next"),onClick:Oe})]}),!e&&(0,j.Y)(F.A,{withStory:!0,storyColors:De?.storyColors,className:"rLHO_VQT",size:"jumbo",peer:Pe,style:ye("avatar",!0),storyCircleStyle:ye("avatarStoryCircle",!0),onClick:W?ze:void 0},Pe?.id),(0,j.FD)("div",{className:"ZFBuRDGK",dir:Ae.isRtl?"rtl":"auto",style:ye("info",!0),children:[(s||c)&&(0,j.Y)(P.A,{className:"atYgxkWV",style:ye("title",!0),peer:s||c,withEmojiStatus:!0,withStatusTextColor:!0,emojiStatusSize:24,onEmojiStatusClick:Be,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=(0,a.Qe)(z),t=(0,a.DX)(z);if(!e&&!t)return V?(0,j.Y)("span",{className:(0,h.A)(ee,"status"),dir:"auto",style:ye("status",!0),children:Ae("MonoforumStatus")}):s?(0,j.FD)("div",{className:(0,h.A)(ee,"status",(0,a.PF)(s,l)&&"online"),style:ye("status",!0),children:[Ve(),(0,j.Y)("span",{className:"F4JyLH2c",dir:"auto",children:(0,a.CD)(ve,s,l)}),l?.isReadDateRestrictedByMe&&!_&&(0,j.Y)("span",{className:"wCXGPPTY",onClick:Ue,children:(0,j.Y)("span",{children:ve("StatusHiddenShow")})})]}):(0,j.Y)("span",{className:(0,h.A)(ee,"status"),dir:"auto",style:ye("status",!0),children:(0,a.WX)(c)?ve("Subscribers",c.membersCount??0,"i"):ve("Members",c.membersCount??0,"i")})}()]})]});function Ve(){if(!d?.starsRating)return;const e=d.starsRating.level,t=()=>Ke(e);if(e<0)return(0,j.FD)("span",{role:"button",tabIndex:0,className:"vuUzgWI1",onClick:t,children:[(0,j.Y)(T.A,{name:"rating-icons-negative",className:"JZBCjHv0"}),(0,j.Y)("span",{className:ae,children:"!"})]});const n=Math.max(e,1),o=Math.min(n,90),i=o<10?`rating-icons-level${o}`:"rating-icons-level"+10*Math.floor(o/10);return(0,j.FD)("span",{role:"button",tabIndex:0,className:"P6tsZMON",onClick:t,children:[(0,j.Y)(T.A,{name:i,className:"Yvu9iM5n"}),(0,j.Y)("span",{className:ae,children:e})]})}}))},88792(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(31481),a=n(11597),r=n(53827),d=n(49642),l=n(80853),c=n(82117),u=n(17712),h=n(35297);const m=(e,t,n,m,p,g,f,v=!1,A,y,C=!1,w=!1,I,b=!1,S=!1)=>{const M=(0,o.li)(),[N,k]=(0,o.J0)(!1);let Y=N;const[F,P]=(0,o.J0)(0),T=(0,u.A)(()=>{k(!1),y&&y()});(0,h.A)(()=>{if(!e)return;M.current=(0,r.kz)(e,n,(e,o)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:r,proxy:l}=M.current,c=(0,i.mS)();k(!0),"oneTimeVoice"!==n&&(0,d.MV)(g,function(e){let t={};if(e&&e.current){const{play:n,pause:o,setCurrentTime:s,proxy:a,requestNextTrack:r,requestPreviousTrack:d,isFirst:l,isLast:c}=e.current;t={play:()=>{n(a.src)},pause:()=>{o()},stop:()=>{o(),s(0),(0,i.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(a.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(a.currentTime+t,a.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},c()||(t.nexttrack=()=>{r()}),l()||(t.previoustrack=()=>{d()})}return t}(M)),(0,d.HW)("playing");const{audioPlayer:u}=(0,a.nTw)(c),{audioPlayer:h}=c;e(h.volume),r(Boolean(u.isMuted));const m=l.duration&&Number.isFinite(l.duration)?l.duration:t;("voice"===n||m>s.CVm)&&o(u.playbackRate),(0,d.hm)({duration:l.duration||0,playbackRate:l.playbackRate,position:l.currentTime});break}case"onRateChange":{const{proxy:e}=M.current;(0,d.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":k(!1),(0,d.HW)("paused"),I?.();break;case"onTimeUpdate":{const{proxy:e}=M.current;if(b&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;w||P(e.currentTime/n);break}case"onEnded":(0,d.HW)("paused")}p?.[e]?.(o)}},A,T);const{proxy:o}=M.current;N||o.paused||(k(!0),Y=!0),f&&!S&&f(o)},[e]),(0,o.vJ)(()=>{N&&g&&(0,d.D5)(g)},[g,N]);const{play:D,pause:x,setCurrentTime:L,proxy:E,destroy:B,setVolume:R,stop:O,isFirst:U,isLast:K,requestNextTrack:z,requestPreviousTrack:V,setPlaybackRate:j,toggleMuted:J}=M.current??{},G=(0,o.Kr)(()=>E?.duration&&Number.isFinite(E.duration)?E.duration:t,[E?.duration,t]);(0,o.vJ)(()=>{E&&(b&&0===E.currentTime||!G||(0,l.f)(E)||w||P(E.currentTime/G))},[G,F,E,w,b]),(0,o.vJ)(()=>()=>{B?.(C)},[B,C]),(0,c.A)(([e,t])=>{e===v&&m===t||E?.src&&E?.paused||v&&m&&!N&&D?.(m)},[v,m,N,D,E?.src,E?.paused,n]);const q=(0,u.A)(()=>{m&&D?.(m)}),$=(0,u.A)(()=>{N?x?.():q()}),H=(0,u.A)(e=>{L?.(e),G&&E&&P(E.currentTime/G)});return{isPlaying:Y,playProgress:F,playPause:$,pause:x,play:q,stop:O,setCurrentTime:H,setVolume:R,audioProxy:E,duration:G,requestNextTrack:z,requestPreviousTrack:V,isFirst:U,isLast:K,setPlaybackRate:j,toggleMuted:J}}},89755(e,t,n){e.exports=n.p+"encoderWorker.min.41c911dd9e2bbe20c518.js"},89873(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(13439),s=n(17712),a=n(34201),r=n(59030),d=n(71429),l=n(24433),c=n(60859),u=n(20021);const h=(0,o.ph)(({isOpen:e,sponsorInfo:t,canReport:n,anchor:i,triggerRef:a,shouldSkipAbout:h,onClose:m,onCloseAnimationEnd:p,onAboutAdsClick:g,onSponsoredHide:f,onSponsorInfo:v,onSponsoredReport:A})=>{const y=(0,o.li)(),C=(0,r.A)(),w=(0,s.A)(()=>a.current),I=(0,s.A)(()=>({withPortal:!0})),b=(0,s.A)(()=>y.current),S=(0,s.A)(()=>document.body),M=t||!h||n;return(0,u.FD)(d.A,{ref:y,isOpen:e,anchor:i,withPortal:!0,className:"with-menu-transitions",getLayout:I,getTriggerElement:w,getMenuElement:b,getRootElement:S,onClose:m,onCloseAnimationEnd:p,children:[t&&v&&(0,u.Y)(l.A,{icon:"channel",onClick:v,children:C("SponsoredMessageSponsor")}),!h&&(0,u.Y)(l.A,{icon:"info",onClick:g,children:C(n?"AboutRevenueSharingAds":"SponsoredMessageInfo")}),n&&A&&(0,u.Y)(l.A,{icon:"hand-stop",onClick:A,children:C("ReportAd")}),M&&(0,u.Y)(c.A,{}),(0,u.Y)(l.A,{icon:"close-circle",onClick:f,children:C("HideAd")})]})}),m=(0,o.ph)(({isOpen:e,randomId:t,sponsorInfo:n,additionalInfo:o,canReport:r,anchor:d,triggerRef:l,shouldSkipAbout:c,onItemClick:m,onClose:p,onCloseAnimationEnd:g})=>{const{openAboutAdsModal:f,showDialog:v,reportSponsored:A,hideSponsored:y}=(0,i.ko)(),{ref:C}=(0,a.A)({isOpen:e,onCloseAnimationEnd:g}),w=(0,s.A)(()=>{m?.(),p()}),I=(0,s.A)(()=>{f({randomId:t,additionalInfo:o,canReport:r,sponsorInfo:n}),w()}),b=(0,s.A)(()=>{y(),w()}),S=(0,s.A)(()=>{v({data:{message:[n,o].filter(Boolean).join("\n")}}),w()}),M=(0,s.A)(()=>{A({randomId:t}),w()});if(d)return(0,u.Y)("div",{ref:C,className:"ContextMenuContainer",children:(0,u.Y)(h,{isOpen:e,anchor:d,triggerRef:l,canReport:r,sponsorInfo:n,shouldSkipAbout:c,onClose:p,onCloseAnimationEnd:p,onAboutAdsClick:I,onSponsoredHide:b,onSponsorInfo:S,onSponsoredReport:M})})})},89966(e,t,n){n.d(t,{A:()=>lo});var o=n(84051),i=n(13439),s=n(23174),a=n(89925),r=n(31481),d=n(90709),l=n(70636),c=n(26129),u=n(11597),h=n(56494),m=n(30708),p=n(96115),g=n(63495),f=n(96454),v=n(87357),A=n(95807),y=n(48899),C=n(60343),w=n(80140),I=n(83868),b=n(41512),S=n(76023),M=n(4961),N=n(58734);function k(e){if(!e||1!==e.extendedMedia.length)return{photo:void 0,video:void 0};const t=e.extendedMedia[0],n="mediaType"in t;return{photo:n?t.duration?void 0:t:t.photo,video:n?t.duration?t:void 0:t.video}}var Y=n(43336),F=n(35127);function P(e,t){return e.reduce((e,t)=>e+t,t)}function T(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 D(e,t,n,o){const i=function(e,t,n){const o=e[0].isOutgoing,i=(t?e[0].content.paidMedia.extendedMedia.map(e=>"mediaType"in e?e:e.photo||e.video):e.map(e=>(0,d.r_)(e).photo||(0,d.r_)(e).video)).filter(Boolean);return i.map(e=>{const t=(0,F.yA)({media:e,isOwn:o,isMobile:n});return t.width/t.height})}(n.messages,Boolean(n.isPaidMedia),o),s=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(i),a=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(i),r=i.length,l=i.some(e=>e>2),c=(0,S.w4)(e,!1,t,o);let u;const h={ratios:i,proportions:s,averageRatio:a,maxWidth:c,minWidth:100,maxHeight:c,spacing:2};return u=r>=5||l?function({ratios:e,averageRatio:t,maxWidth:n,minWidth:o,spacing:i,maxHeight:s=4*n/3}){const a=function(e,t){return e.map(e=>t>1.1?(0,Y.qE)(e,1,2.75):(0,Y.qE)(e,.6667,1))}(e,t),r=e.length,d=new Array(r),l=[],c=e=>{const t=[];let o=0;e.forEach(e=>{t.push(((e,t)=>{const o=P(a.slice(e,e+t),0);return(n-(t-1)*i)/o})(o,e)),o+=e}),l.push({lineCounts:e,heights:t})};for(let e=1;e!==r;++e){const t=r-e;e<=3&&t<=3&&c([e,t])}for(let e=1;e!==r-1;++e)for(let n=1;n!==r-e;++n){const o=r-e-n;e<=3&&n<=(t<.85?4:3)&&o<=3&&c([e,n,o])}for(let e=1;e!==r-1;++e)for(let t=1;t!==r-e;++t)for(let n=1;n!==r-e-t;++n){const o=r-e-t-n;e<=3&&t<=3&&n<=3&&o<=4&&c([e,t,n,o])}let u,h=0;for(let e=0;e<l.length;e++){const{heights:t,lineCounts:n}=l[e],a=n.length,r=P(t,0)+i*(a-1),d=Math.min(...t)<o?1.5:1,c=(()=>{for(let e=1;e!==a;++e)if(n[e-1]>n[e])return 1.5;return 1})(),m=Math.abs(r-s)*d*c;(!u||m<h)&&(u=l[e],h=m)}const m=u.lineCounts,p=u.heights,g=m.length;let f=0,v=0;for(let e=0;e!==g;++e){const t=m[e],o=p[e],s=Math.round(o);let r=0;for(let l=0;l!==t;++l){const c=0|(0===e?1:0)|(e===g-1?4:0)|(0===l?8:0)|(l===t-1?2:0),u=a[f],h=l===t-1?n-r:Math.round(u*o);d[f]={dimensions:{x:r,y:v,width:h,height:s},sides:c},r+=h+i,++f}v+=s+i}return d}(h):2===r?function(e){const{ratios:t,proportions:n,averageRatio:o}=e;return"ww"===n&&o>1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=Math.round(Math.min(n/t[0],Math.min(n/t[1],(i-o)/2)));return[{dimensions:{x:0,y:0,width:n,height:s},sides:11},{dimensions:{x:0,y:s+o,width:n,height:s},sides:14}]}(e):"ww"===n||"qq"===n?function(e){const{ratios:t,maxWidth:n,spacing:o,maxHeight:i}=e,s=(n-o)/2,a=Math.round(Math.min(s/t[0],Math.min(s/t[1],i)));return[{dimensions:{x:0,y:0,width:s,height:a},sides:13},{dimensions:{x:s+o,y:0,width:s,height:a},sides:7}]}(e):function(e){const{ratios:t,minWidth:n,maxWidth:o,spacing:i,maxHeight:s}=e,a=Math.round(1.5*n),r=Math.min(Math.round(Math.max(.4*(o-i),(o-i)/t[0]/(1/t[0]+1/t[1]))),o-i-a),d=o-r-i,l=Math.min(s,Math.round(Math.min(d/t[0],r/t[1])));return[{dimensions:{x:0,y:0,width:d,height:l},sides:13},{dimensions:{x:d+i,y:0,width:r,height:l},sides:7}]}(e)}(h):3===r?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:n,ratios:o,maxWidth:i,minWidth:s}=e,a=t,r=Math.round(Math.min((t-n)/2,o[1]*(i-n)/(o[2]+o[1]))),d=a-r-n,l=Math.max(s,Math.round(Math.min((i-n)/2,Math.min(r*o[2],d*o[1])))),c=Math.min(Math.round(a*o[0]),i-n-l);return[{dimensions:{x:0,y:0,width:c,height:a},sides:13},{dimensions:{x:c+n,y:0,width:l,height:d},sides:3},{dimensions:{x:c+n,y:d+n,width:l,height:r},sides:6}]}(e):function(e){const{maxWidth:t,ratios:n,maxHeight:o,spacing:i}=e,s=t,a=Math.round(Math.min(s/n[0],.66*(o-i))),r=(t-i)/2,d=Math.min(o-a-i,Math.round(Math.min(r/n[1],r/n[2])));return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+i,width:r,height:d},sides:12},{dimensions:{x:r+i,y:a+i,width:s-r-i,height:d},sides:6}]}(e)}(h):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:n,maxHeight:o,minWidth:i}){const s=e,a=Math.round(Math.min(s/t[0],.66*(o-n))),r=Math.round((e-2*n)/(t[1]+t[2]+t[3])),d=Math.max(i,Math.round(Math.min(.4*(e-2*n),r*t[1]))),l=Math.round(Math.max(Math.max(i,.33*(e-2*n)),r*t[3])),c=s-d-l-2*n,u=Math.min(o-a-n,r);return[{dimensions:{x:0,y:0,width:s,height:a},sides:11},{dimensions:{x:0,y:a+n,width:d,height:u},sides:12},{dimensions:{x:d+n,y:a+n,width:c,height:u},sides:4},{dimensions:{x:d+n+c+n,y:a+n,width:l,height:u},sides:6}]}(e):function({maxHeight:e,ratios:t,maxWidth:n,spacing:o,minWidth:i}){const s=e,a=Math.round(Math.min(s*t[0],.6*(n-o))),r=Math.round((e-2*o)/(1/t[1]+1/t[2]+1/t[3])),d=Math.round(r/t[1]),l=Math.round(r/t[2]),c=s-d-l-2*o,u=Math.max(i,Math.min(n-a-o,r));return[{dimensions:{x:0,y:0,width:a,height:s},sides:13},{dimensions:{x:a+o,y:0,width:u,height:d},sides:3},{dimensions:{x:a+o,y:d+o,width:u,height:l},sides:2},{dimensions:{x:a+o,y:d+l+2*o,width:u,height:c},sides:6}]}(e)}(h),{layout:u,containerStyle:T(u)}}var x=n(43874),L=n(10722),E=n(82117),B=n(49746),R=n(21488),O=n(37661),U=n(5912),K=n(39351),z=n(17712),V=n(59030),j=n(39996),J=n(73767),G=n(34201),q=n(9705),$=n(5130);let H,W;const _=new q.A;function Q(){return Boolean(W||H)}f.CM&&setTimeout(async function(){if(!Q()){if(f.zf)try{return W=await LanguageDetector.create(),void _.resolve()}catch(e){r.Oig&&console.error("Failed to initialize language detector: ",e)}H||(H=(0,$.U)(new Worker(new URL(n.p+n.u(6197),n.b))),_.resolve())}},4e3);var Z=n(84947),X=n(37836);const ee=new Map;const te=(0,X.nF)(function(e){const{updateChatDetectedLanguage:t}=(0,i.ko)(),n=ee.get(e);if(!n)return;const o=n.size;if(o<8)return;let s=0,a=0;const r=new Map;for(const e of n.values()){e.isTranslatable&&s++,e.detectedLanguage&&a++;const t=e.detectedLanguage;if(t){const e=r.get(t)||0;r.set(t,e+1)}}if(s/o<.3||a/s<.6)return;t({chatId:e,detectedLanguage:Array.from(r.entries()).sort(([,e],[,t])=>t-e)[0][0]})},1e3);var ne=n(42211),oe=n(46275),ie=n(64154),se=n(66644),ae=n(50442),re=n(43503),de=n(54464),le=n(672);const ce=3*S.$,ue=Number(S.$),he="data-is-document-group-hover";function me(e,t,n,s,a,r,d,l,c,u,h,m,p){const{updateDraftReplyInfo:g,sendDefaultReaction:v}=(0,i.ko)(),[A,y,C]=(0,O.A)(),[w,b,S]=(0,O.A)(),M=(0,o.li)(),N=(0,le.A)(e=>{const t=h.current;if(!t)return;const{clientX:n,clientY:o}=e,{x:i,width:s,y:a,height:r}=t.getBoundingClientRect(),d=i+s/2,l=a+r/2,c=Math.abs(d-n)<ce,u=Math.abs(l-o)<ue;c&&u?y():C()},[h],se.YS);return(0,o.vJ)(()=>{if(!f.TF||s||!a||u||!p?.())return;let e;return(0,ae.wJ)(t.current,{selectorToPreventScroll:".MessageList",excludedClosestSelector:".no-word-wrap",onSwipe:(t,n)=>n===ae.ez.Left&&(e||(e=Date.now()),b(),!0),onRelease:()=>{e&&a&&(g({replyToMsgId:n}),setTimeout(S,Math.max(0,150-(Date.now()-e))),e=void 0)}})},[t,s,n,b,S,a,u,p]),{handleMouseDown:s?void 0:function(e){(0,de.l)(e),l(e)},handleClick:function(t){if(s)e(t);else if(f.TF)return M.current?(clearInterval(M.current),M.current=void 0,void v({chatId:c,messageId:n})):void(M.current=setTimeout(()=>{M.current=void 0,function(e){if(f.Ni){const t=e.target;if(!t.classList.contains("text-content")&&!t.classList.contains("Message"))return;re.A.getIsKeyboardVisible()?setTimeout(()=>{d(e)},350):d(e)}}(t)},200))},handleContextMenu:s?r?I.A:void 0:function(t){if(f.Ni){if(t.target.matches("a[href]")||u)return;t.preventDefault(),e()}else d(t)},handleDoubleClick:s?void 0:function(){!f.TF&&a&&g({replyToMsgId:n,replyToPeerId:void 0,quoteText:void 0,quoteOffset:void 0})},handleContentDoubleClick:f.TF?void 0:function(e){e.stopPropagation()},handleMouseMove:N,handleSendQuickReaction:function(e){e.stopPropagation(),v({chatId:c,messageId:n})},handleMouseLeave:function(e){(0,se.YS)(C),m&&function(e){const t=ge(e.currentTarget);t&&t.removeAttribute(he)}(e)},isSwiped:w,isQuickReactionVisible:A,handleDocumentGroupMouseEnter:pe}}function pe(e){const t=ge(e.currentTarget);t&&t.setAttribute(he,"")}function ge(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var fe=n(65240),ve=n(21849),Ae=n(87412),ye=n(55723),Ce=n(80999),we=n(91930),Ie=n(11217),be=n(62587),Se=n(18276),Me=n(86070),Ne=n(20021);function ke(e,t){const{width:n,height:o}=(0,S.mr)();return(0,Ne.FD)("div",{className:"embedded-thumb",children:[(0,Ne.Y)("img",{src:e,width:n,height:o,alt:"",className:"pictogram",draggable:!1}),t&&(0,Ne.Y)("span",{className:"protector"})]})}const Ye=({story:e,sender:t,noUserColors:n,isProtected:s,observeIntersectionForLoading:a,onClick:r})=>{const{showNotification:c}=(0,i.ko)(),u=(0,V.A)(),h=(0,o.li)(),m=(0,U.Vz)(h,a),p=e&&"content"in e,g=e&&"isDeleted"in e,f=p&&Boolean(e.content.video),A=p?"Story":g?"ExpiredStory":"Loading",y=(0,be.A)(p&&(0,d.EN)(e,"pictogram"),!m),C=f?e.content.video.thumbnail?.dataUri:void 0,w=y||C,I=t?(0,l.F9)(u,t):void 0,b=(0,z.A)(()=>{e&&!g?r():c({message:u("StoryNotFound")})}),{handleClick:S,handleMouseDown:N}=(0,Ie.Q)(b);return(0,Ne.FD)(Me.A,{ref:h,peerColor:t?.color,noUserColors:n,shouldReset:!0,className:(0,v.A)("EmbeddedMessage",w&&"with-thumb"),onClick:S,onMouseDown:N,children:[w&&ke(w,s),(0,Ne.FD)("div",{className:"message-text with-message-color",children:[(0,Ne.FD)("p",{className:"embedded-text-wrapper",children:[g&&(0,Ne.Y)(Se.A,{name:"story-expired",className:"embedded-origin-icon"}),p&&(0,Ne.Y)(Se.A,{name:"story-reply",className:"embedded-origin-icon"}),u(A)]}),(0,Ne.Y)("div",{className:"message-title",children:(0,M.A)(I||" ")})]})]})};var Fe=n(2578),Pe=n(9267),Te=n(57076),De=n(17794),xe=n(85118),Le=n(90603),Ee=n(38102);var Be=n(61911);const Re=1.125*S.$,Oe=(0,o.ph)(({topic:e,className:t,onClick:n})=>{const o=(0,V.A)();return(0,Ne.FD)("div",{className:(0,v.A)("JldIqqof",t),style:`--topic-button-accent-color: var(${(0,Le.Mt)(e?.iconColor)})`,onClick:n,children:[e?(0,Ne.Y)(Ee.A,{topic:e,size:Re}):(0,Ne.Y)("img",{src:Be,alt:"",draggable:!1}),e?.title?(0,M.A)(e.title):o("Loading"),e?.isClosed&&(0,Ne.Y)(Se.A,{name:"lock"}),(0,Ne.Y)(Se.A,{name:"next"})]})});var Ue=n(15006),Ke=n(64493),ze=n(94189),Ve=n(40664);function je(e){return(0,o.ph)((0,i.EK)((e,t)=>{const{clickArg:n,noSelectControls:o}=t;return{isInSelectMode:!o&&(0,u.rTV)(e),isSelected:!o&&(0,u.H1_)(e,n)}})(t=>{const{isInSelectMode:n,isSelected:s,dimensions:a,clickArg:r}=t,{toggleMessageSelection:d}=(0,i.ko)(),l=(0,z.A)(e=>{e.stopPropagation(),d({messageId:r,withShift:e?.shiftKey})}),c=(0,o.Kr)(()=>{const{dimensions:e,onClick:o}=t;return{...t,isInSelectMode:n,isSelected:s,dimensions:{...e,x:0,y:0},onClick:n?void 0:o}},[t,n,s]);return(0,Ne.FD)("div",{className:(0,v.A)("album-item-select-wrapper",s&&"is-selected"),style:a?`left: ${a.x}px; top: ${a.y}px;`:"",onClick:n?l:void 0,children:[n&&(0,Ne.Y)("div",{className:"message-select-control",children:s&&(0,Ne.Y)(Se.A,{name:"check",className:"message-select-control-icon"})}),(0,Ne.Y)(e,{...c})]})}))}var Je=n(51644),Ge=n(25477);const qe=je(Je.A),$e=je(Ge.A),He=(0,i.EK)(e=>{const t=(0,u.SJA)(e),n=(0,u.yuw)(e);return{theme:t,uploadsByKey:e.fileUploads.byMessageKey,activeDownloads:n}})(({album:e,observeIntersection:t,hasCustomAppendix:n,isOwn:s,isProtected:a,albumLayout:r,onMediaClick:l,uploadsByKey:c,activeDownloads:h,theme:m})=>{const{cancelUploadMedia:p}=(0,i.ko)(),{content:{paidMedia:g}}=e.mainMessage,f=e.isPaidMedia?g.extendedMedia.length:e.messages.length,v=(0,z.A)(t=>{l(e.mainMessage.id,t)}),A=(0,z.A)(e=>{l(e)}),y=(0,z.A)(t=>{p({chatId:e.mainMessage.chatId,messageId:t})}),w=(0,o.Kr)(()=>e.isPaidMedia?e.mainMessage.content.paidMedia.extendedMedia.map(()=>e.mainMessage):e.messages,[e]),{width:I,height:b}=r.containerStyle;return(0,Ne.Y)("div",{className:"Album",style:`width: ${I}px; height: ${b}px;`,children:w.map(function(o,l){const p=e.isPaidMedia?o.content.paidMedia?.extendedMedia[l]:void 0,g=p&&"mediaType"in p?p:p?.photo,w=p&&"mediaType"in p?p:p?.video,I=g||(0,d.yl)(o),b=w||(0,d.r_)(o).video,S=c[(0,C.bj)(o)],M=S?.progress,{dimensions:N,sides:k}=r.layout[l],Y=(0,u.wwb)((0,i.mS)(),o),F=(0,u.OEt)((0,i.mS)(),o);if(I){const i=n&&(s?l===f-1:Boolean(8&k&&4&k));return(0,Ne.Y)(qe,{id:`album-media-${(0,d.GZ)(o.id,e.isPaidMedia?l:void 0)}`,photo:I,isOwn:s,observeIntersectionForLoading:t,canAutoLoad:Y,shouldAffectAppendix:i,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?l:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:y,isDownloading:"extendedMediaPreview"!==I.mediaType&&(0,d.$r)(h,I),theme:m,noSelectControls:e.isPaidMedia})}if(b)return(0,Ne.Y)($e,{id:`album-media-${(0,d.GZ)(o.id)}`,video:b,observeIntersectionForLoading:t,canAutoLoad:Y,canAutoPlay:F,uploadProgress:M,dimensions:N,isProtected:a,clickArg:e.isPaidMedia?l:o.id,onClick:e.isPaidMedia?v:A,onCancelUpload:y,isDownloading:"extendedMediaPreview"!==b.mediaType&&(0,d.$r)(h,b),theme:m,noSelectControls:e.isPaidMedia})})})});var We=n(41733);const _e=7*S.$;function Qe(e,t,n,s,a,r,d){const{interactWithAnimatedEmoji:l,sendEmojiInteraction:c,sendWatchingEmojiInteraction:u}=(0,i.ko)(),h=(0,o.li)(),m=(0,o.li)(),p=(0,be.A)(n?`document${n}`:void 0,!n),f=d||_e,v=(0,A.A)(`width: ${f}px`,`height: ${f}px`,r&&!g.Vq&&"cursor: pointer"),y=(0,o.li)(void 0),C=(0,o.li)(void 0),w=(0,z.A)(()=>{h.current&&(c({chatId:e,messageId:t,emoji:r,interactions:y.current}),C.current=void 0,y.current=void 0)}),I=(0,z.A)(()=>{const e=m.current;p&&(e&&(e.pause(),e.remove()),m.current=new Audio,m.current.src=p,(0,We.A)(m.current),m.current.addEventListener("ended",()=>{m.current=void 0},{once:!0}))}),b=(0,z.A)(()=>{I();const n=h.current;if(!(r&&n&&t&&e))return;const{x:o,y:i}=n.getBoundingClientRect();l({emoji:r,x:o,y:i,startSize:f,isReversed:!a}),y.current||(y.current=[],C.current=performance.now(),setTimeout(w,1e3)),y.current.push(C.current?(performance.now()-C.current)/1e3:0)});return(0,o.vJ)(()=>{const n=h.current;n&&s&&s.forEach(({id:o,startSize:i,messageId:s})=>{if(i||t!==s)return;const{x:d,y:l}=n.getBoundingClientRect();u({id:o,chatId:e,emoticon:r,startSize:f,x:d,y:l,isReversed:!a}),I()})},[s,e,r,a,t,I,u,f]),{ref:h,size:f,style:v,handleClick:b}}const Ze=(0,o.ph)((0,i.EK)((e,{customEmojiId:t,withEffects:n})=>{const o=(0,u.O8F)(e,t);return{sticker:o,effect:o?.emoji&&n?(0,u.Nr8)(e,o.emoji):void 0,soundId:o?.emoji&&(0,u.tKM)(e,o.emoji),noPlay:!(0,u.BWX)(e)}})(({isOwn:e,customEmojiId:t,messageId:n,chatId:o,activeEmojiInteractions:i,sticker:s,effect:a,soundId:r,noPlay:d,observeIntersection:l})=>{const{ref:c,size:u,style:h,handleClick:m}=Qe(o,n,r,i,e,a?.emoji,(0,N.Rr)(1));return(0,Ne.Y)(Ae.A,{ref:c,documentId:t,className:(0,v.A)("AnimatedEmoji media-inner",s?.id===S.AC&&"like-sticker-thumb"),style:h,size:u,isBig:!0,noPlay:d,withSharedAnimation:!0,forceOnHeavyAnimation:Boolean(a&&i?.length),observeIntersectionForLoading:l,onClick:m})}));var Xe=n(79577);const et=(0,o.ph)((0,i.EK)((e,{emoji:t,withEffects:n})=>({sticker:(0,u.oei)(e,t),effect:n?(0,u.Nr8)(e,t):void 0,soundId:(0,u.tKM)(e,t)}))(({isOwn:e,observeIntersection:t,forceLoadPreview:n,messageId:o,chatId:i,activeEmojiInteractions:s,sticker:a,effect:r,soundId:d})=>{const{ref:l,size:c,style:u,handleClick:h}=Qe(i,o,d,s,e,r?.emoji),m=(0,U.Vz)(l,t);return(0,Ne.Y)(Xe.A,{sticker:a,size:c,quality:1,noLoad:!m,forcePreview:n,play:m,forceAlways:!0,ref:l,className:(0,v.A)("AnimatedEmoji media-inner",a?.id===S.AC&&"like-sticker-thumb"),style:u,onClick:h})}));var tt=n(14242),nt=n(93809),ot=n(68292),it=n(97422);const st=(0,o.ph)(({isCustomShape:e,threadInfo:t,disabled:n,isLoading:s})=>{const{openThread:a,openFrozenAccountModal:r}=(0,i.ko)(),d=(0,nt.A)([s],450),l=(0,V.A)(),c=(0,K.A)(),{originMessageId:h,chatId:m,messagesCount:p,recentReplierIds:g,originChannelId:f,hasUnread:A}=t||{},y=(0,z.A)(()=>{const e=(0,i.mS)();h&&f&&((0,u.trm)(e)?r():a({isComments:!0,chatId:m,originMessageId:h,originChannelId:f}))}),C=(0,o.Kr)(()=>{if(!g?.length)return;const e=(0,i.mS)();return g.map(t=>(0,u.PVB)(e,t)).filter(Boolean)},[g]),w=p?l("CommentsCount","%COMMENTS_COUNT%",void 0,p).split("%").map(e=>"COMMENTS_COUNT"===e?(0,Ne.Y)(ot.A,{text:(0,tt.Vw)(c,p)}):e):void 0;return(0,Ne.FD)("div",{"data-cnt":(0,tt.Vw)(c,p||0),className:(0,v.A)("CommentButton",A&&"has-unread",n&&"disabled",e&&"CommentButton-custom-shape",s&&"loading"),dir:c.isRtl?"rtl":"ltr",onClick:y,role:"button",tabIndex:0,children:[(0,Ne.Y)(Se.A,{name:"comments-sticker",className:(0,v.A)("CommentButton_icon-comments",s&&d&&"CommentButton_hidden")}),!C?.length&&(0,Ne.Y)(Se.A,{name:"comments"}),Boolean(C?.length)&&(0,Ne.Y)("div",{className:"recent-repliers",dir:c.isRtl?"rtl":"ltr",children:C.map(e=>(0,Ne.Y)(ve.A,{size:"small",peer:e},e.id))}),(0,Ne.Y)("div",{className:"label",dir:"auto",children:p?w:l("LeaveAComment")}),(0,Ne.FD)("div",{className:"CommentButton_right",children:[s&&(0,Ne.Y)(it.A,{className:(0,v.A)("CommentButton_loading",!d&&"CommentButton_hidden"),color:e?"white":"blue"}),(0,Ne.Y)(Se.A,{name:"next",className:(0,v.A)("CommentButton_icon-open",s&&d&&"CommentButton_hidden")})]})]})});var at=n(85982),rt=n(64713);const dt="ReDHhQHm";function lt(e){return e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:""}const ct=(0,i.EK)((e,{contact:t})=>{const{countryList:{phoneCodes:n}}=e;return{user:(0,u.mBe)(e,t.userId),phoneCodeList:n}})(({contact:e,user:t,phoneCodeList:n,noUserColors:o})=>{const s=(0,V.A)(),{openChat:a,openAddContactDialog:r,showNotification:l,openChatWithInfo:c}=(0,i.ko)(),{phoneNumber:u,userId:h}=e,m="0"!==h,p=m&&t&&(0,d.Gh)(t),g=(0,z.A)(()=>{a({id:h})}),f=(0,z.A)(()=>{r({userId:t?.id})}),v=(0,z.A)(()=>{t?c({id:h}):((0,at.eM)(u),l({message:s("PhoneCopied")}))});return(0,Ne.FD)(Me.A,{noUserColors:o,peer:t,emojiIconClassName:"SjZYi3sJ",className:"AAHWWWvU",children:[(0,Ne.FD)("div",{className:"tpDpg82n",onClick:v,children:[(0,Ne.Y)(ve.A,{size:"medium",peer:t,text:lt(e)}),(0,Ne.FD)("div",{className:"fpYynE5s",children:[(0,Ne.Y)("div",{className:"_PNTJc_V",children:t?(0,d.Yg)(t):lt(e)}),(0,Ne.Y)("div",{className:"JP_3wes8",children:(0,rt.Ox)(n,u)})]})]}),m&&(0,Ne.FD)(Ne.FK,{children:[(0,Ne.Y)("div",{className:"_OSJcuqH"}),(0,Ne.FD)("div",{className:"Blui4M4G",children:[(0,Ne.Y)(Ke.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:g,className:dt,children:s("SharedContactMessage")}),p&&(0,Ne.Y)(Ke.A,{isText:!0,color:"translucent",ripple:!0,size:"tiny",onClick:f,className:dt,children:s("SharedContactAdd")})]})]})]})});var ut=n(80089),ht=n(80464);const mt=e=>{const{isOpen:t}=e,n=(0,ht.A)(ut.ar.Extra,"ContextMenuContainer",!t);return n?(0,Ne.Y)(n,{...e}):void 0};var pt=n(30163),gt=n(82855);const ft="CjuMj2Ml",vt="o_0F4yn3",At="D0ZI66VZ",yt="a7edyhq7",Ct=13*S.$,wt=(0,o.ph)((0,i.EK)((e,{dice:t})=>({idleSticker:(0,pt.zE)(e,t.emoticon),valueSticker:(0,pt.NQ)(e,t.emoticon,t.value),winEffect:e.appConfig.diceEmojiesSuccess[t.emoticon]}))(({dice:e,canSendDice:t,idleSticker:n,valueSticker:s,winEffect:a,canPlayWinEffect:r,isLocal:d,isOutgoing:l,onEffectPlayed:c,observeIntersectionForLoading:u,observeIntersectionForPlaying:h})=>{const{requestConfetti:m,showNotification:p}=(0,i.ko)(),{isMobile:g}=(0,x.Ay)(),{width:f}=n?(0,S.bu)(n,g):{width:Ct},A=!r&&!d,[y,C]=(0,o.J0)(A),[w,I]=(0,O.A)(),b=(0,o.li)(),M=(0,o.li)(),N=(0,z.A)(()=>{C(w)}),k=(0,z.A)(t=>{r&&l&&e.value===a?.value&&t===a?.frameStart&&(m({}),c?.())}),Y=(0,z.A)(()=>{t&&p({message:{key:"DiceToast",variables:{emoji:e.emoticon},options:{withNodes:!0}},action:{action:"sendDiceInCurrentChat",payload:{emoji:e.emoticon}},actionText:{key:"DiceToastSend"}})});return(0,Ne.FD)("div",{className:(0,v.A)(ft,t&&vt),style:`--_size: ${f}px`,onClick:Y,children:[n&&(0,Ne.Y)("div",{ref:b,className:(0,v.A)(At,y&&yt),children:(0,Ne.Y)(gt.A,{containerRef:b,sticker:n,size:f,noPlay:y,shouldLoop:!0,forceAlways:!0,skipPreview:y,onAnimatedStickerLoop:N,observeIntersectionForLoading:u,observeIntersectionForPlaying:h})}),s&&(0,Ne.Y)("div",{ref:M,className:(0,v.A)(At,!y&&yt),children:(0,Ne.Y)(gt.A,{containerRef:M,sticker:s,size:f,noPlay:!y,skipPreview:!0,forceAlways:!0,forceAnimatedStickerOnEnd:A,observeIntersectionForLoading:u,observeIntersectionForPlaying:h,onAnimatedStickerLoad:I,onAnimatedStickerFrame:k})})]})})),It=[1,2,3,0];var bt=n(37960),St=n(18104);const Mt=13*S.$,Nt=(0,o.ph)((0,i.EK)(e=>{const t=e.stickers.diceSetIdByEmoji?.[r.IgS];return{slotsStickerSet:t?(0,u.ycM)(e,t):void 0,winEffect:e.appConfig.diceEmojiesSuccess[r.IgS]}})(({dice:e,canSendDice:t,canPlayWinEffect:n,isLocal:s,isOutgoing:a,slotsStickerSet:r,winEffect:l,onEffectPlayed:c,observeIntersectionForLoading:u})=>{const{requestConfetti:h,showNotification:m}=(0,i.ko)(),{isMobile:p}=(0,x.Ay)(),g=e.value===l?.value,f=!n&&!s,A=(0,o.li)(0),[y,C]=(0,O.A)(!f),[w,I]=(0,o.J0)(f&&g?"win":"base"),[b,M]=(0,o.J0)(f?"result":"base"),{ref:N}=(0,bt.A)({hasMediaData:y}),k=(0,U.Vz)(N,u),Y=r?.stickers&&function(e,t){const n=-1===t,o=t-1&3,i=t-1>>2&3,s=t-1>>4&3;return{background:e[0],frameWin:e[1],frameStart:e[2],leftWin:e[3],leftResult:n?void 0:e[4+It[o]],leftSpin:e[8],middleWin:e[9],middleResult:n?void 0:e[10+It[i]],middleSpin:e[14],rightWin:e[15],rightResult:n?void 0:e[16+It[s]],rightSpin:e[20]}}(r?.stickers,e.value),F=Y?.background?(0,d.Mw)(Y.background,"full"):void 0,P=(0,be.A)(F,!k),T=Y?.frameWin&&g?(0,d.Mw)(Y.frameWin,"full"):void 0,D=(0,be.A)(T,!k),L=Y?.frameStart?(0,d.Mw)(Y.frameStart,"full"):void 0,E=(0,be.A)(L,!k),B=Y?.leftSpin?(0,d.Mw)(Y.leftSpin,"full"):void 0,R=(0,be.A)(B,!k),K=Y?.middleSpin?(0,d.Mw)(Y.middleSpin,"full"):void 0,V=(0,be.A)(K,!k),j=Y?.rightSpin?(0,d.Mw)(Y.rightSpin,"full"):void 0,J=(0,be.A)(j,!k),G=Y?.leftResult?(0,d.Mw)(Y.leftResult,"full"):void 0,q=(0,be.A)(G,!k),$=Y?.middleResult?(0,d.Mw)(Y.middleResult,"full"):void 0,H=(0,be.A)($,!k),W=Y?.rightResult?(0,d.Mw)(Y.rightResult,"full"):void 0,_=(0,be.A)(W,!k),{width:Q}=Y?(0,S.bu)(Y.background,p):{width:Mt},Z=!q||!H||!_,X=(0,z.A)(()=>{A.current+=1,A.current>=3&&setTimeout(()=>{C()},100)}),ee=(0,z.A)(()=>{Z||(M("result"),g&&setTimeout(()=>I("win"),700))}),te=(0,z.A)(e=>{n&&a&&g&&e===l?.frameStart&&(h({}),c?.())}),ne=(0,z.A)(()=>{t&&m({message:{key:"DiceToast",variables:{emoji:e.emoticon},options:{withNodes:!0}},action:{action:"sendDiceInCurrentChat",payload:{emoji:e.emoticon}},actionText:{key:"DiceToastSend"}})});function oe(e,t,n,o,i,s){if(!o||!t)return(0,Ne.Y)("div",{className:(0,v.A)(At,t&&yt),children:(0,Ne.Y)(St.A,{tgsUrl:e,size:Q,play:!t,noLoop:!n,forceAlways:!0,onEnded:i,onFrame:s,onLoad:t?void 0:X,seekToEnd:f})})}return(0,Ne.FD)("div",{ref:N,className:(0,v.A)(ft,t&&vt),style:`--_size: ${Q}px`,onClick:ne,children:[oe(P,"base"!==w,!1,!0),oe(D,"win"!==w,!1,!1,void 0,te),oe(R,"base"!==b,Z,!0),oe(V,"base"!==b,Z,!0),oe(J,"base"!==b,Z,!0,ee),oe(q,"result"!==b),oe(H,"result"!==b),oe(_,"result"!==b),oe(E,!1)]})})),kt=(0,o.ph)(e=>e.dice.emoticon===r.IgS?(0,Ne.Y)(Nt,{...e}):(0,Ne.Y)(wt,{...e}));var Yt=n(18501),Ft=n(57675),Pt=n(32581);const Tt={type:"regular",color:0},Dt=(0,o.ph)(({factCheck:e,isToggleDisabled:t})=>{const n=(0,V.A)(),i=(0,o.li)(),s=(0,o.li)(),{isCollapsed:a,isCollapsible:r,setIsCollapsed:d}=(0,Ft.A)(i,4,s),l=(0,o.Kr)(()=>{if(e.countryCode&&n.code)return new Intl.DisplayNames([n.code],{type:"region"}).of(e.countryCode)},[e.countryCode,n.code]),c=!t&&a,u=(0,z.A)(()=>{d(!1)}),h=(0,z.A)(()=>{d(e=>!e)});if(e.text)return(0,Ne.FD)(Me.A,{peerColor:Tt,className:"HMB5LgeX",onClick:c?u:void 0,children:[(0,Ne.FD)("div",{ref:s,className:(0,v.A)("nfCzKu78",a&&"hYzpXwTM"),children:[(0,Ne.Y)("div",{className:"vZnCPl3t",children:n("FactCheck")}),(0,Ne.Y)("div",{ref:i,className:"k_dGolcu",children:(0,Yt.fd)({text:e.text.text,entities:e.text.entities})}),(0,Ne.Y)(Pt.A,{className:"qRaSs5iA"}),(0,Ne.Y)("div",{className:"EDmr0wJG",children:n("FactCheckFooter",l)})]}),r&&(0,Ne.Y)("div",{className:(0,v.A)("mxPizZpR",!t&&"Cj2cLczd"),onClick:t?void 0:h,"aria-hidden":!0,children:(0,Ne.Y)(Se.A,{name:a?"down":"up"})})]})});var xt=n(55158);const Lt=(0,o.ph)(({message:e,threadId:t,canAutoLoadMedia:n})=>{const{clickBotInlineButton:o}=(0,i.ko)(),s=e.content.game,{title:a,description:r}=s,l=(0,d.zb)(s),c=(0,d.ih)(s),u=(0,be.A)(l,!n),h=(0,be.A)(c,!n);return(0,Ne.FD)("div",{className:"Game",children:[(0,Ne.FD)("div",{className:"preview",style:"width: 480px; height: 270px",onClick:()=>{o({chatId:e.chatId,messageId:e.id,threadId:t,button:e.inlineButtons[0][0]})},children:[!u&&!h&&(0,Ne.Y)(xt.A,{className:"skeleton preview-content"}),u&&(0,Ne.Y)("img",{className:"preview-content",src:u,alt:a,draggable:!1}),h&&(0,Ne.Y)("video",{className:"preview-content",playsInline:!0,muted:!0,disablePictureInPicture:!0,autoPlay:!0,loop:!0,src:h})]}),(0,Ne.Y)("div",{className:"title",children:a}),!(0,d.P5)(e)&&(0,Ne.Y)("div",{className:"description",children:r})]})});var Et=n(17663),Bt=n(52491),Rt=n(4875),Ot=n(14957),Ut=n(64489),Kt=n(10187);const zt="ogvcv3mr",Vt="MSFa9BPf",jt="HfZ6SuLI",Jt="rPyyNYxK",Gt="FV70u896",qt=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{giveaway:n}=t.content,o=(0,u.hds)(e,t.chatId);return{chat:o,sender:(n?.channelIds[0]?(0,u.hds)(e,n.channelIds[0]):void 0)||(0,u.Szq)(e,t)||o,giftSticker:n&&(0,u.t0O)(e,n.months),canPlayAnimatedEmojis:(0,u.BWX)(e)}})(({chat:e,sender:t,message:n,canPlayAnimatedEmojis:s,giftSticker:a})=>{const{openChat:r}=(0,i.ko)(),c=(0,o.li)(!1),[u,h]=(0,o.J0)(),m=(0,V.A)(),{giveaway:p,giveawayResults:g}=n.content,f=Boolean(g),{months:A,untilDate:y,prizeDescription:C,stars:I}=p||g,b=(0,d.Ie)(n),S=f?g.winnersCount:p.quantity,N=(0,w.Fm)()>y,k=(0,o.Kr)(()=>{if(f)return;const e=new Intl.DisplayNames([m.code,"en"].filter(Boolean),{type:"region"});return p?.countries?.map(t=>`${(0,Bt.D0)(t)} ${e.of(t)}`).join(", ")},[p,f,m.code]),Y=(0,z.A)(e=>{r({id:e})}),F=(0,z.A)(async()=>{if(c.current)return;c.current=!0;const t=await(0,Rt.px)("fetchGiveawayInfo",{peer:e,messageId:n.id});h(t),c.current=!1}),P=(0,z.A)(()=>{h(void 0)}),T=(0,o.Kr)(()=>{if(u)return m("results"===u.type?"BoostingGiveawayEnd":"BoostingGiveAwayAbout")},[u,m]);return(0,Ne.FD)("div",{className:"CbpKtOey",children:[(0,Ne.FD)("div",{className:(0,v.A)("hjjKhvVv",f&&"JEiR48jJ"),children:[f?(0,Ne.Y)(Ut.A,{size:150,tgsUrl:Ot.w.PartyPopper,nonInteractive:!0,noLoop:!0}):(0,Ne.Y)(Xe.A,{sticker:a,play:s&&N,noLoop:!0,nonInteractive:!0,size:175}),(0,Ne.Y)("span",{className:"n_QCMv_A",children:`x${S}`})]}),f?function(e){const t=e.winnerIds;return(0,Ne.FD)(Ne.FK,{children:[(0,Ne.FD)("div",{className:Vt,children:[(0,Ne.Y)("strong",{className:zt,children:(0,M.A)(m("BoostingGiveawayResultsMsgWinnersSelected"),["simple_markdown"])}),(0,Ne.Y)("p",{className:jt,children:(0,M.A)(m("BoostingGiveawayResultsMsgWinnersTitle",t.length),["simple_markdown"])}),(0,Ne.Y)("strong",{className:zt,children:m("lng_prizes_results_winners")}),(0,Ne.Y)("div",{className:Jt,children:t.map(e=>(0,Ne.Y)(Kt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:Gt,clickArg:e,onClick:Y}))})]}),(0,Ne.Y)("div",{className:Vt,children:(0,Ne.Y)("p",{className:jt,children:m("BoostingGiveawayResultsMsgAllWinnersReceivedLinks")})})]})}(g):function(e){const t=e.channelIds;return(0,Ne.FD)(Ne.FK,{children:[(0,Ne.FD)("div",{className:Vt,children:[(0,Ne.Y)("strong",{className:zt,children:(0,M.A)(m("BoostingGiveawayPrizes"),["simple_markdown"])}),C&&(0,Ne.FD)(Ne.FK,{children:[(0,Ne.Y)("p",{className:jt,children:(0,M.A)(m("BoostingGiveawayMsgPrizes",[S,C],void 0,S),["simple_markdown"])}),(0,Ne.Y)(Pt.A,{children:m("BoostingGiveawayMsgWithDivider")})]}),(0,Ne.Y)("p",{className:jt,children:n?.content?.giveaway?.stars?(0,Ne.FD)(Ne.FK,{children:[(0,M.A)(m("Chat.Giveaway.Message.Stars.PrizeText",m("Stars",n?.content?.giveaway?.stars)),["simple_markdown"]),(0,Ne.Y)("br",{}),(0,M.A)(m("AmongWinners",S),["simple_markdown"])]}):(0,Ne.FD)(Ne.FK,{children:[(0,M.A)(m("Chat.Giveaway.Info.Subscriptions",S),["simple_markdown"]),(0,Ne.Y)("br",{}),(0,M.A)(m("ActionGiftPremiumSubtitle",m("Chat.Giveaway.Info.Months",A)),["simple_markdown"])]})})]}),(0,Ne.FD)("div",{className:Vt,children:[(0,Ne.Y)("strong",{className:zt,children:(0,M.A)(m("BoostingGiveawayMsgParticipants"),["simple_markdown"])}),(0,Ne.Y)("p",{className:jt,children:(0,M.A)(m("BoostingGiveawayMsgAllSubsPlural",t.length),["simple_markdown"])}),(0,Ne.Y)("div",{className:Jt,children:t.map(e=>(0,Ne.Y)(Kt.A,{peerId:e,forceShowSelf:!0,withPeerColors:!b,className:Gt,clickArg:e,onClick:Y}))}),k&&(0,Ne.Y)("span",{children:(0,M.A)(m("Chat.Giveaway.Message.CountriesFrom",k))})]}),(0,Ne.FD)("div",{className:Vt,children:[(0,Ne.Y)("strong",{className:zt,children:(0,M.A)(m("BoostingWinnersDate"),["simple_markdown"])}),(0,Ne.Y)("p",{className:jt,children:(0,Et.L2)(1e3*y,m.code,!0)})]})]})}(p),(0,Ne.Y)(Ke.A,{className:"jMBw7STU",color:"adaptive",onClick:F,children:m("BoostingHowItWork")}),(0,Ne.Y)(ze.A,{isOpen:Boolean(u),isOnlyConfirm:!0,title:T,confirmHandler:P,onClose:P,children:function(){if(!t||!u)return;const e="results"===u.type,n=(0,l.vj)(t)?(0,d.Js)(m,t):(0,d.Yg)(t),o=(0,Et.U)(m,1e3*y),s=p?.channelIds?p.channelIds.length-1:0,a=m("Chat.Giveaway.Info.OtherChannels",s),r=s>0,c=e?"BoostingGiveawayHowItWorksTextEnd":"BoostingGiveawayHowItWorksText",h=e?m("Chat.Giveaway.Info.Months",A):m("Stars",I,"i"),g=m(c,[n,S,h],void 0,S),f=C?m("BoostingGiveawayHowItWorksIncludeText",[n,S,C],void 0,S):void 0;let v="";v=e?r?"BoostingGiveawayHowItWorksSubTextSeveralEnd":"BoostingGiveawayHowItWorksSubTextEnd":r?"BoostingGiveawayHowItWorksSubTextSeveral":"BoostingGiveawayHowItWorksSubText";let w=m(v,[o,S,n,s],void 0,S);e&&u.activatedCount&&(w+=` ${m("BoostingGiveawayUsedLinksPlural",u.activatedCount)}`);let b="";e&&(b=u.isRefunded?m("BoostingGiveawayCanceledByPayment"):m(u.isWinner?"BoostingGiveawayYouWon":"BoostingGiveawayYouNotWon"));let N="";if(e);else if(u.disallowedCountry)N=m("BoostingGiveawayNotEligibleCountry");else if(u.adminDisallowedChatId){const e=(0,i.mS)().chats.byId[u.adminDisallowedChatId],t=e&&(0,d.Js)(m,e);N=m("BoostingGiveawayNotEligibleAdmin",t)}else if(u.joinedTooEarlyDate){const e=(0,Et.U)(m,1e3*u.joinedTooEarlyDate);N=m("BoostingGiveawayNotEligible",e)}else N=u.isParticipating?r?m("Chat.Giveaway.Info.ParticipatingMany",[n,s]):m("Chat.Giveaway.Info.Participating",n):r?m("Chat.Giveaway.Info.NotQualifiedMany",[n,a,o]):m("Chat.Giveaway.Info.NotQualified",[n,o]);return(0,Ne.FD)(Ne.FK,{children:[b&&(0,Ne.Y)("p",{className:"ZQ4aVVkI",children:(0,M.A)(b,["simple_markdown"])}),(0,Ne.Y)("p",{children:(0,M.A)(g,["simple_markdown"])}),f&&(0,Ne.Y)("p",{children:(0,M.A)(f,["simple_markdown"])}),(0,Ne.Y)("p",{children:(0,M.A)(w,["simple_markdown"])}),N&&(0,Ne.Y)("p",{children:(0,M.A)(N,["simple_markdown"])})]})}()})]})}));var $t=n(7065),Ht=n(17142),Wt=n(40435),_t=n(37859),Qt=n(61097);const Zt=(0,o.ph)(({message:e,shouldAffectAppendix:t,isInSelectMode:n,isSelected:i,theme:s,forcedWidth:a})=>{const l=(0,o.li)(),c=(0,V.A)(),u=(0,K.A)(),h=(0,d.NO)(e),{title:m,description:p,amount:g,currency:f,isTest:v,photo:y}=h,C=(0,be.A)((0,d.cy)(y)),w=Boolean(a),I=(0,Qt.A)(C,!w),b=e.id;(0,_t.A)(([e])=>{if(t){if(C){const e=l.current.closest(r.KFG);(0,Wt.A)(C,!1,b,i,s).then(t=>{(0,se.RK)(()=>{e.style.setProperty("--appendix-bg",t),e.setAttribute(r.D3G,"")})})}}else e&&l.current.closest(r.KFG).removeAttribute(r.D3G)},[t,C,n,i,s,b]);const S=a||y?.dimensions?.width,N=(0,A.A)(y?.dimensions&&`width: ${S}px`,y?.dimensions&&`aspect-ratio: ${y.dimensions.width} / ${y.dimensions.height}`,Boolean(!y?.dimensions&&a)&&`width: ${a}px`);return(0,Ne.FD)("div",{ref:l,className:"Invoice",children:[m&&(0,Ne.Y)("p",{className:"title",children:(0,M.A)(m)}),p&&(0,Ne.Y)("div",{className:"info",children:(0,M.A)(p,["emoji","br"])}),(0,Ne.FD)("div",{className:"description "+(y?"has-image":""),children:[Boolean(y)&&(0,Ne.FD)("div",{className:"invoice-image-container",children:[w&&(0,Ne.Y)("canvas",{ref:I,className:"thumbnail blurred-bg"}),C&&(0,Ne.Y)("img",{className:"invoice-image",src:C,alt:"",style:N,crossOrigin:"anonymous",draggable:!1}),!C&&y&&(0,Ne.Y)(xt.A,{width:S,height:y.dimensions?.height,forceAspectRatio:!0})]}),(0,Ne.FD)("p",{className:"description-text",children:[(0,Ht.vv)(u,g,f,{iconClassName:"invoice-currency-icon"}),v&&(0,Ne.Y)("span",{className:"test-invoice",children:c("PaymentTestInvoice")})]})]})]})});var Xt=n(32625),en=n(27860);const tn={root:"dCK8GQ_8",duration:"CWT8ZMwV",buy:"C38zhCDM",spoiler:"CG55VZP1"},nn=(0,o.ph)(({message:e,isConnected:t})=>{const{openInvoice:n,loadExtendedMedia:o}=(0,i.ko)(),s=(0,V.A)(),a=(0,d.NO)(e),{chatId:r,id:l}=e,c=(0,z.A)(()=>{o({chatId:r,ids:[l]})});(0,Xt.A)(c,t?3e4:void 0);const{amount:u,currency:h,extendedMedia:m}=a,{width:p,height:g,thumbnail:f,duration:A}=m,y=(0,z.A)(()=>{n({type:"message",chatId:r,messageId:l,isExtendedMedia:!0})});return(0,Ne.FD)("div",{className:(0,v.A)(tn.root,"media-inner"),onClick:y,children:[(0,Ne.Y)(en.A,{thumbDataUri:f?.dataUri,width:p,height:g,isVisible:!0,className:tn.spoiler}),Boolean(A)&&(0,Ne.Y)("div",{className:tn.duration,children:(0,Et.QO)(A)}),(0,Ne.FD)("div",{className:tn.buy,children:[(0,Ne.Y)(Se.A,{name:"lock",className:tn.lock}),s("Checkout.PayPrice",(0,Ht.Ad)(u,h))]})]})});var on=n(47526),sn=n(14737),an=n(30857),rn=n(38691);const dn=n.p+"map-pin.899635f6fe777c28998a.svg",ln=24*Math.PI,cn=1e-4,un={width:400,height:300,zoom:16};function hn(){return(0,Ne.FD)("svg",{className:"round-pin",style:"enable-background:new 0 0 64 64",viewBox:"0 0 64 64",children:[(0,Ne.Y)("circle",{cx:"32",cy:"32",r:"24.5"}),(0,Ne.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,Ne.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,Ne.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 mn=(0,o.ph)(({message:e,peer:t})=>{const{openMapModal:n}=(0,i.ko)(),s=(0,o.li)(),a=(0,o.li)(),r=(0,V.A)(),l=(0,an.A)(),c=(0,d.fB)(e),{mediaType:u,geo:h}=c,m=(0,w.Fm)(),p=(0,d.vz)(e),g="geoLive"!==u||p?void 0:e.date+c.period-m,[f,A]=(0,o.J0)(h),y="venue"===u||"geoLive"===u&&!p,{width:C,height:I,zoom:b}=un,S=(0,rn.A)(),M=(0,d.rt)(f,C,I,b,S),N=(0,be.A)(M),k=(0,J.A)(N,!0),Y=N||k,F=(0,o.Kr)(()=>{if("geoLive"!==u||!f.accuracyRadius)return 0;const{lat:e,accuracyRadius:t}=f;return t/(0,on._u)(e,b)},[u,f,b]),P=(0,z.A)(t=>{if("geoLive"!==u)return;const n=t.lastElementChild,o=t.firstElementChild,i=e.date+c.period-(0,w.Fm)(),s=(1-i/c.period)*ln,a=(0,Et.dq)(r,1e3*i);o.textContent=a,n.firstElementChild.setAttribute("stroke-dashoffset",`-${s}`)});function T(){const e=(0,v.A)("pin",u,p&&"expired");if("geoLive"===u)return(0,Ne.FD)("div",{className:e,children:[(0,Ne.Y)(hn,{}),(0,Ne.Y)(ve.A,{peer:t,className:"location-avatar"}),void 0!==c.heading&&(0,Ne.Y)("div",{className:"direction",style:`--direction: ${c.heading}deg`})]});if("venue"===u){const t=(0,on.PP)(c.venueType),n=(0,on.KE)(c.venueType);if(n)return(0,Ne.FD)("div",{className:e,style:`--pin-color: ${t}`,children:[(0,Ne.Y)(hn,{}),(0,Ne.Y)("img",{src:n,draggable:!1,className:"venue-icon",alt:""})]})}return(0,Ne.Y)("img",{className:e,draggable:!1,src:dn,alt:""})}return(0,o.Nf)(()=>{a.current&&P(a.current)},[P]),(0,o.vJ)(()=>{Math.abs(h.lat-f.lat)<cn&&Math.abs(h.long-f.long)<cn?f.accuracyRadius!==h.accuracyRadius&&A({...f,accuracyRadius:h.accuracyRadius}):A(h)},[h,f]),(0,sn.A)(()=>{l()},p?void 0:1e3*(g||0)),(0,Xt.A)(()=>{(0,se.RK)(()=>{const e=a.current;e&&P(e)})},g?1e3:void 0),(0,Ne.FD)("div",{ref:s,className:"Location media-inner interactive",onClick:()=>{n({geoPoint:f,zoom:b})},children:[(0,Ne.FD)("div",{className:"map-wrapper",children:[Y?(0,Ne.Y)("img",{className:"full-media map",src:Y,alt:"Location on a map",draggable:!1,style:`width: ${un.width}px; height: ${un.height}px;`}):(0,Ne.Y)(xt.A,{width:C,height:I}),function(){if(Y)return(0,Ne.FD)(Ne.FK,{children:[Boolean(F)&&!p&&(0,Ne.Y)("div",{className:"location-accuracy",style:`width: ${2*F}px; height: ${2*F}px`}),T()]})}()]}),function(){if(y)return"venue"===u?(0,Ne.FD)("div",{className:"location-info",children:[(0,Ne.Y)("div",{className:"location-info-title",children:c.title}),(0,Ne.Y)("div",{className:"location-info-subtitle",children:c.address})]}):"geoLive"===u?(0,Ne.FD)("div",{className:"location-info",children:[(0,Ne.Y)("div",{className:"location-info-title",children:r("AttachLiveLocation")}),(0,Ne.Y)("div",{className:"location-info-subtitle",children:(0,Et.IF)(r,m,e.editDate)}),!p&&(0,Ne.FD)("div",{className:"geo-countdown",ref:a,children:[(0,Ne.Y)("span",{className:"geo-countdown-text"}),(0,Ne.Y)("svg",{width:"32px",height:"32px",children:(0,Ne.Y)("circle",{cx:"16",cy:"16",r:12,className:"geo-countdown-progress",transform:"rotate(-90, 16, 16)","stroke-dasharray":ln,"stroke-dashoffset":"0"})})]})]}):void 0}()]})});var pn=n(48906),gn=n(97676),fn=n(48775),vn=n(15379),An=n(45);const yn=(0,o.ph)(({message:e,outgoingStatus:t,signature:n,withReactionOffset:s,repliesThreadInfo:a,renderQuickReactionButton:r,noReplies:d,isTranslated:l,isPinned:c,withFullDate:u,effectEmoji:h,onClick:m,onTranslationClick:p,onEffectClick:g,onOpenThread:f,paidMessageStars:A})=>{const{showNotification:y}=(0,i.ko)(),[C,w]=(0,O.A)(),I=(0,V.A)(),b=(0,K.A)();function S(e){e.stopPropagation(),y({message:{key:"ImportedInfo"}})}const N=(0,o.Kr)(()=>(0,vn.Ee)(e.scheduleRepeatPeriod,b),[e.scheduleRepeatPeriod,b]),k=(0,o.Kr)(()=>{if(!C)return;const t=(0,Et.L2)(1e3*e.date,I.code,void 0,I.timeFormat),n=e.isEdited&&(0,Et.L2)(1e3*e.editDate,I.code,void 0,I.timeFormat),o=e.forwardInfo&&(0,Et.L2)(1e3*(e.forwardInfo.savedDate||e.forwardInfo.date),I.code,void 0,I.timeFormat);let i=t;return n&&(i+="\n",i+=b("MessageTooltipEditedDate",{date:n})),o&&(i+="\n",i+=b("MessageTooltipForwardedDate",{date:o})),i},[C,I,e,I.timeFormat]),Y=(0,o.Kr)(()=>{if(!e.viewsCount)return;let t=b("MessageTooltipViews",{count:b.number(e.viewsCount)},{pluralValue:e.viewsCount});return e.forwardsCount&&(t+="\n",t+=b("MessageTooltipForwards",{count:b.number(e.forwardsCount)},{pluralValue:e.forwardsCount})),t},[b,e.forwardsCount,e.viewsCount]),F=(0,o.Kr)(()=>{const e=a?.messagesCount;if(e)return b("MessageTooltipReplies",{count:e},{pluralValue:e})},[b,a]),P=(0,o.Kr)(()=>{const t=(0,Et.fU)(I,1e3*e.date),n=u?(0,Et.be)(I,1e3*(e.forwardInfo?.date||e.date),!0):t;return N?b("FormatDateAtTime",{date:N,time:n}):n},[I,e.date,e.forwardInfo?.date,u,N,b]),T=(0,v.A)("MessageMeta",s&&"reactions-offset",e.forwardInfo?.isImported&&"is-imported");return(0,Ne.FD)("span",{className:T,dir:b.isRtl?"rtl":"ltr",onClick:m,"data-ignore-on-paste":!0,children:[h&&(0,Ne.Y)("span",{className:"message-effect-icon",onClick:g,children:(0,M.A)(h)}),l&&(0,Ne.Y)(Se.A,{name:"language",className:"message-translated",onClick:p}),Boolean(e.viewsCount)&&(0,Ne.FD)(Ne.FK,{children:[(0,Ne.Y)("span",{className:"message-views",title:Y,children:(0,tt.Vw)(b,e.viewsCount)}),(0,Ne.Y)(Se.A,{name:"channelviews"})]}),!d&&Boolean(a?.messagesCount)&&(0,Ne.FD)("span",{onClick:function(e){e.stopPropagation(),f()},className:"message-replies-wrapper",title:F,children:[(0,Ne.Y)("span",{className:"message-replies",children:(0,Ne.Y)(ot.A,{text:(0,tt.Vw)(b,a.messagesCount)})}),(0,Ne.Y)(Se.A,{name:"reply-filled"})]}),c&&(0,Ne.Y)(Se.A,{name:"pinned-message",className:"message-pinned"}),n&&(0,Ne.Y)("span",{className:"message-signature",children:(0,M.A)(n)}),Boolean(A)&&(0,Ne.Y)("span",{className:"message-price",children:(0,fn.U2)(b,A,{asFont:!0})}),(0,Ne.FD)("span",{className:"message-time",title:k,onMouseEnter:w,children:[e.forwardInfo?.isImported&&(0,Ne.FD)(Ne.FK,{children:[(0,Ne.Y)("span",{className:"message-imported",onClick:S,children:(0,Et.L2)(1e3*e.forwardInfo.date,b.code,!0)}),(0,Ne.Y)("span",{className:"message-imported",onClick:S,children:b("MessageMetaImported")})]}),e.isEdited&&`${b("MessageMetaEdited")} `,e.isVideoProcessingPending&&`${b("MessageMetaApproximate")} `,P]}),t&&(0,Ne.Y)(An.A,{status:t}),r&&r()]})});var Cn=n(4262);const wn=(0,o.ph)(({phoneCall:e,message:t,chatId:n})=>{const{requestMasterAndRequestCall:s}=(0,i.ko)(),a=(0,V.A)(),{isVideo:r,reason:d,duration:l}=e,c=t.isOutgoing,u="missed"===d,h="busy"===d||void 0===l,m=(0,z.A)(()=>{s({isVideo:r,userId:n})}),p=(0,o.Kr)(()=>e.duration?(0,Et.zA)(a,e.duration):void 0,[a,e.duration]),g=(0,Et.fU)(a,1e3*t.date);return(0,Ne.FD)("div",{className:"wqsZyy8u",children:[(0,Ne.Y)(Ke.A,{size:"smaller",color:"translucent",round:!0,ripple:!0,onClick:m,className:"NGmo4ADz",disabled:!f.OL,ariaLabel:a(c?"CallAgain":"CallBack"),iconName:r?"video-outlined":"phone"}),(0,Ne.FD)("div",{className:"iFn6m6hd",children:[(0,Ne.Y)("div",{className:"l8QfocIQ",children:a((0,Cn.fB)(e,t.isOutgoing))}),(0,Ne.FD)("div",{className:"rF5tkx92",children:[(0,Ne.Y)(Se.A,{name:"arrow-right",className:(0,v.A)("ONmpzmUS",u&&"Alra_BWu",h&&"J7xsuCAm",!c&&"BfgDXljM")}),(0,Ne.Y)("span",{className:"kKPKwFzu",children:p?a("CallMessageWithDuration",[g,p]):g})]})]})]})});var In=n(98607);const bn=(0,o.ph)(({paidMedia:e,chatId:t,messageId:n,isOutgoing:s,children:a})=>{const{openInvoice:d}=(0,i.ko)(),l=(0,V.A)(),c=(0,K.A)(),u=!e.isBought,h=(0,o.Kr)(()=>{const t=l("UnlockPaidContent",e.starsAmount);return(0,In.i)(t,r.Cyx,(0,Ne.Y)(Pe.A,{className:"ywiOugiH",type:"gold",size:"adaptive"}))},[l,e]),m=(0,z.A)(e=>{d({type:"message",chatId:t,messageId:n}),(0,I.A)(e)});return(0,Ne.FD)("div",{className:"mVaSjZRJ",onClick:u?m:void 0,children:[a,u&&(0,Ne.Y)(Ke.A,{className:"GnKGu6D9",color:"dark",size:"tiny",fluid:!0,pill:!0,children:(0,Ne.Y)("span",{className:"gLaaVQXr",children:h})}),e.isBought&&(0,Ne.Y)("div",{className:(0,v.A)("message-paid-media-status","IGXW5hWr"),children:s?(0,fn.U2)(c,e.starsAmount):l("Chat.PaidMedia.Purchased")})]})});var Sn=n(26875),Mn=n(77561),Nn=n(1087);function kn(e,t){return t>0?(e/t*100).toFixed():0}const Yn=({answer:e,voteResults:t,totalVoters:n,maxVotersCount:i,correctResults:s,shouldAnimate:a})=>{const r=(0,K.A)(),d=t&&t.find(t=>t.option===e.option),l=0===s.length||-1!==s.indexOf(e.option),c=s.length>0&&l||d?.isChosen,u=d?kn(d.votersCount,n||0):0,[h,m]=(0,o.J0)(a?0:u),p=d?kn(d.votersCount,i||0):0,g=h!==u;if((0,o.vJ)(()=>{a&&m(u)},[a,u]),!t||!d)return;const f=`width: ${p}%; transform:scaleX(${g?0:1})`;return(0,Ne.FD)("div",{className:"PollOption",dir:r.isRtl?"rtl":void 0,children:[(0,Ne.FD)("div",{className:"poll-option-share "+("100"===u?"limit-width":""),children:[u,"%",c&&(0,Ne.Y)("span",{className:(0,v.A)("poll-option-chosen",!l&&"wrong",a&&"animate"),children:(0,Ne.Y)(Se.A,{name:l?"check":"close",className:"poll-option-icon"})})]}),(0,Ne.FD)("div",{className:"poll-option-right",children:[(0,Ne.Y)("div",{className:"poll-option-text",dir:"auto",children:(0,Yt.fd)({text:e.text.text,entities:e.text.entities})}),(0,Ne.FD)("div",{className:(0,v.A)("poll-option-answer",c&&!l&&"wrong"),children:[a&&(0,Ne.Y)("svg",{className:"poll-line",style:g?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44",children:(0,Ne.Y)("path",{d:"M4.47 5.33v13.6a9 9 0 009 9h13"})}),(0,Ne.Y)("div",{className:"poll-option-line",style:f})]})]})]})},Fn=12*Math.PI;function Pn(e){return void 0===e.isPublic?" ":e.closed?"FinalResults":e.quiz?e.isPublic?"QuizPoll":"AnonymousQuizPoll":e.isPublic?"PublicPoll":"AnonymousPoll"}function Tn(e,t,n){return n?e(t?"Answer":"Vote",n,"i"):e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty")}function Dn(e){e.stopPropagation()}const xn=(0,o.ph)(({message:e,poll:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:s,onSendVote:a})=>{const{loadMessage:r,openPollResults:d,requestConfetti:l,showNotification:c}=(0,i.ko)(),{id:h,chatId:m}=e,{summary:p,results:g}=t,[f,v]=(0,o.J0)(!1),[A,y]=(0,o.J0)([]),[I,b]=(0,o.J0)(!1),[S,M]=(0,o.J0)(()=>!p.closed&&p.closeDate&&p.closeDate>0?Math.min(p.closeDate-(0,w.Fm)(),p.closePeriod):0),N=(0,o.li)(),k=(0,o.li)(),{results:Y,totalVoters:F}=g,P=Y&&Y.some(e=>e.isChosen),T=!p.closed&&!P,D=!T&&p.isPublic&&Number(g.totalVoters)>0,x=T&&p.multipleChoice,L=g.recentVoterIds,E=Y?Math.max(...Y.map(e=>e.votersCount)):F,B=(0,o.Kr)(()=>Y?.filter(e=>e.isCorrect).map(e=>e.option)||[],[Y]),R=(0,o.Kr)(()=>p.answers.map(e=>({label:(0,Yt.fd)({text:e.text.text,entities:e.text.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s}),value:e.option,hidden:Boolean(p.quiz&&p.closePeriod&&S<=0)})),[S,n,s,p.answers,p.closePeriod,p.quiz]);(0,o.vJ)(()=>{const e=t.results.results?.find(e=>e.isChosen);f&&e&&(e.isCorrect&&l({}),v(!1))},[f,t.results.results,l]),(0,o.Nf)(()=>{if(S>0&&setTimeout(()=>M(S-1),1e3),!k.current)return;S<=5&&N.current.classList.add("hurry-up");const e=(p.closePeriod-S)/p.closePeriod*Fn;k.current.setAttribute("stroke-dashoffset",`-${e}`)},[S,p.closePeriod]),(0,o.vJ)(()=>{p.quiz&&(S<=0||P&&!p.closed)&&r({chatId:m,messageId:h})},[m,S,P,r,h,p.closed,p.quiz]),(0,o.vJ)(()=>{let e;return p.quiz&&!p.closed&&p.closePeriod&&p.closePeriod>0&&(e=window.setTimeout(()=>{r({chatId:m,messageId:h})},1e3*p.closePeriod)),()=>{e&&window.clearTimeout(e)}},[T,m,r,h,p.closePeriod,p.closed,p.quiz]);const O=(0,o.Kr)(()=>{const e=(0,i.mS)();return L?L.reduce((t,n)=>{const o=(0,u.PVB)(e,n);return o&&t.push(o),t},[]):[]},[L]),U=(0,z.A)(e=>{y([e]),v(!0),b(!0),a([e])}),K=(0,z.A)(e=>{y(e)}),j=(0,z.A)(()=>{v(!0),b(!0),a(A)}),J=(0,z.A)(()=>{d({chatId:m,messageId:h})}),G=(0,z.A)(()=>{c({localId:(0,C.bj)(e),message:t.results.solution,messageEntities:t.results.solutionEntities,duration:5e3,containerSelector:"#middle-column-portals"})});(0,o.vJ)(()=>{I&&P&&p.quiz&&g.results&&t.results.solution&&(g.results.find(e=>e.isChosen&&e.isCorrect)||G())},[P,I,g.results,p.quiz,t.results.solution]);const q=(0,V.A)();return(0,Ne.FD)("div",{className:"Poll",dir:q.isRtl?"auto":"ltr",children:[(0,Ne.Y)("div",{className:"poll-question",children:(0,Yt.fd)({text:p.question.text,entities:p.question.entities,observeIntersectionForLoading:n,observeIntersectionForPlaying:s})}),(0,Ne.FD)("div",{className:"poll-type",children:[q(Pn(p)),O.length>0&&(0,Ne.Y)("div",{className:"poll-recent-voters",children:(0,Ne.Y)(Sn.A,{size:"micro",peers:O})}),S>0&&T&&(0,Ne.FD)("div",{ref:N,className:"poll-countdown",children:[(0,Ne.Y)("span",{children:(0,Et.QO)(S)}),(0,Ne.Y)("svg",{width:"16px",height:"16px",children:(0,Ne.Y)("circle",{ref:k,cx:"8",cy:"8",r:6,className:"poll-countdown-progress",transform:"rotate(-90, 8, 8)","stroke-dasharray":Fn,"stroke-dashoffset":"0"})})]}),p.quiz&&t.results.solution&&!T&&(0,Ne.Y)(Ke.A,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",onClick:G,ariaLabel:"Show Solution",iconName:"lamp"})]}),T&&(0,Ne.Y)("div",{className:"poll-answers",onClick:Dn,children:x?(0,Ne.Y)(Mn.A,{options:R,selected:A,onChange:K,disabled:e.isScheduled||f,loadingOptions:f?A:void 0,isRound:!0}):(0,Ne.Y)(Nn.A,{name:`poll-${h}`,options:R,onChange:U,disabled:e.isScheduled||f,loadingOption:f?A[0]:void 0})}),!T&&(0,Ne.Y)("div",{className:"poll-results",children:p.answers.map(function(e){return(0,Ne.Y)(Yn,{shouldAnimate:I||!T,answer:e,voteResults:Y,totalVoters:F,maxVotersCount:E,correctResults:B},e.option)})}),!D&&!x&&(0,Ne.Y)("div",{className:"poll-voters-count",children:Tn(q,p.quiz,g.totalVoters)}),x&&(0,Ne.Y)(Ke.A,{isText:!0,disabled:0===A.length,size:"tiny",onClick:j,children:q("PollSubmitVotes")}),D&&(0,Ne.Y)(Ke.A,{isText:!0,size:"tiny",onClick:J,children:q("PollViewResults")})]})});var Ln=n(43581),En=n(84555),Bn=n(10221),Rn=n(14413),On=n(3325);const Un="GydRBA08",Kn=(0,o.ph)((0,i.EK)(e=>({needsAgeVerification:e.appConfig.needAgeVideoVerification}))(({message:e,shouldLoop:t,shouldPlayEffect:n,withEffect:a,isMediaNsfw:r,onStopEffect:l,observeIntersection:c,observeIntersectionForPlaying:u,needsAgeVerification:h})=>{const{showNotification:m,openStickerSet:p,updateContentSettings:g,openAgeVerificationModal:A}=(0,i.ko)(),y=(0,V.A)(),{isMobile:C}=(0,x.Ay)(),w=(0,o.li)(),I=(0,o.li)(),b=e.content.sticker,{stickerSetInfo:M,isVideo:N,hasEffect:k}=b,Y=!e.isOutgoing,[F,P,T]=(0,O.A)(),[D,L]=(0,o.J0)(!1),E=r,[B,R,K]=(0,O.A)(E);(0,o.vJ)(()=>{E?R():K()},[E]);const j=(0,z.A)(()=>{T(),K(),D&&g({isSensitiveEnabled:!0})}),J=b.isPreloadedGlobally?void 0:(0,d.Mw)(b,N&&!f.OF?"pictogram":"inline"),G=(0,U.Vz)(w,c),q=(0,U.Vz)(w,u),$=`sticker${b.id}?size=f`,H=(0,be.A)($,!G||!k||!a,s.qZ.BlobUrl),[W,_,Q]=(0,O.A)(),Z=(0,d.VD)(b),X=(0,z.A)(()=>{Q(),l?.()});(0,o.vJ)(()=>{k&&a&&q&&n&&_()},[k,q,n,_,a]);const ee=k&&a&&H&&W;(0,Bn.A)({anchorRef:w,overlayRef:I,isMirrored:Y,isDisabled:!ee});const te=(0,z.A)(()=>{p({stickerSetInfo:b.stickerSetInfo})}),ne=(0,z.A)(()=>{if(B)return r?h?void A():void P():void K();if(k){if(W||!a)return void m({message:y("PremiumStickerTooltip"),action:{action:"openStickerSet",payload:{stickerSetInfo:b.stickerSetInfo}},actionText:y("ViewAction")});if(a)return void _()}te()}),oe="isMissing"in M,{width:ie,height:se}=(0,S.bu)(b,C),ae=(0,v.A)("media-inner","FPceNkgD",oe&&"hruUWBuj",k&&Y&&Un);return(0,Ne.FD)("div",{ref:w,className:ae,style:`width: ${ie}px; height: ${se}px;`,onClick:oe?void 0:ne,children:[(0,Ne.Y)(gt.A,{containerRef:w,sticker:b,fullMediaHash:J,fullMediaClassName:"full-media",size:ie,shouldLoop:t,noLoad:!G,noPlay:!q,withSharedAnimation:!0}),(0,Ne.Y)(en.A,{isVisible:B,withAnimation:!0,thumbDataUri:Z,width:ie,height:se,className:"media-spoiler",isNsfw:r}),ee&&(0,Ne.Y)(On.A,{children:(0,Ne.Y)(St.A,{ref:I,className:(0,v.A)("WMMaWlOL",Y&&Un),tgsUrl:H,size:1.49*ie,play:!0,isLowPriority:!0,noLoop:!0,onEnded:X},$)}),(0,Ne.Y)(Rn.A,{isOpen:F,onClose:T,shouldAlwaysShow:D,onAlwaysShowChanged:L,confirmHandler:j})]})}));var zn=n(45470),Vn=n(14),jn=n(50680),Jn=n(59816);const Gn=(0,o.ph)(function({story:e,isPreview:t,isProtected:n,isConnected:s}){const{openStoryViewer:a,loadPeerStoriesByIds:r,showNotification:l}=(0,i.ko)(),c=(0,V.A)(),{isMobile:u}=(0,x.Ay)(),h=e&&"isDeleted"in e,m=e&&"content"in e,p=m?e.content.video:void 0,g=m?(0,d.EN)(e):void 0,A=(0,be.A)(g),y=m?p?p.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,C=(0,Vn.A)(A,!0),{shouldRender:w,transitionClassNames:I}=(0,jn.A)(Boolean(C)),b=(0,zn.A)(y,h&&!t,u&&!f.QH),S=(0,v.A)("EVLTkrt1","media-inner",(!s||h)&&"AQWPv0bP",h&&"tprkr7qf",t&&"V3HabdKr");(0,o.vJ)(()=>{!e||m||h||r({peerId:e.peerId,storyIds:[e.id]})},[e,h,m]);const M=(0,z.A)(()=>{h?l({message:c("StoryNotFound")}):a({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})});return(0,Ne.FD)("div",{className:S,onClick:s?M:void 0,children:[!h&&t&&(0,Ne.Y)("canvas",{ref:b,className:"thumbnail blurred-bg"}),w&&(0,Ne.FD)(Ne.FK,{children:[(0,Ne.Y)("img",{src:C,alt:"",className:(0,v.A)("WAItYc5d",t&&"ClGe8yij",I),draggable:!1}),m&&(0,Ne.Y)(Jn.A,{story:e,className:I})]}),h&&(0,Ne.FD)("span",{children:[(0,Ne.Y)(Se.A,{name:"story-expired",className:"nLA7VEhv"}),c("StoryExpiredSubtitle")]}),Boolean(p?.duration)&&(0,Ne.Y)("div",{className:"message-media-duration",children:(0,Et.QO)(p.duration)}),n&&(0,Ne.Y)("span",{className:"protector"})]})}),qn=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData;return{story:(0,u.Msb)(e,o,n),isConnected:"connectionStateReady"===e.connectionState}})(function({message:e,story:t,isProtected:n,isConnected:o}){const{storyData:i}=e.content;return(0,Ne.Y)(Gn,{story:t||i,isProtected:n,isConnected:o})})),$n=(0,o.ph)((0,i.EK)((e,{message:t})=>{const{id:n,peerId:o}=t.content.storyData,i=(0,u._bp)(e,o)?.lastReadId;return{story:(0,u.Msb)(e,o,n),peer:(0,u.PVB)(e,o),targetUser:(0,u.mBe)(e,t.chatId),isUnread:Boolean(i&&i<n)}})(function({message:e,story:t,peer:n,isUnread:o,targetUser:s}){const{openStoryViewer:a}=(0,i.ko)(),r=(0,V.A)(),{storyData:c}=e.content,u=(0,z.A)(()=>{a({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}),h=t&&"isDeleted"in t,m=t&&"content"in t,p=m?t.content.video:void 0,g=m?(0,d.EN)(t,"pictogram"):void 0,f=(0,be.A)(g)||p?.thumbnail?.dataUri;return(0,R.A)(c.peerId,c.id,t),(0,Ne.FD)("div",{className:(0,v.A)("action-message-story-mention",o&&"is-unread",m&&"with-preview"),tabIndex:0,role:"button",onClick:m?u:void 0,children:[m&&(0,Ne.Y)("span",{className:"story-media-wrapper",children:f&&(0,Ne.Y)("img",{src:f,alt:"",className:"story-media"})}),(0,Ne.Y)("span",{className:"story-title",children:(0,M.A)(n&&"isSelf"in n&&n.isSelf?r(h?"ExpiredStoryMentioned":"StoryYouMentionedTitle",(0,d.u0)(s)):h?r("ExpiredStoryMention"):r("StoryMentionedTitle",(0,l.F9)(r,n)),["emoji","simple_markdown"])})]})})),Hn=(0,o.ph)((0,i.EK)((e,{message:t})=>({sender:(0,u.Y7C)(e,t),isCurrentUserPremium:(0,u.g29)(e),isSynced:e.isSynced}))(({message:e,todoList:t,sender:n,isCurrentUserPremium:s,isSynced:a})=>{const{toggleTodoCompleted:r,showNotification:d,requestConfetti:c}=(0,i.ko)(),{todo:h,completions:m}=t,{title:p,items:g,othersCanComplete:f}=h,[A,y]=(0,o.J0)([]),C=(0,o.Kr)(()=>new Set(A),[A]),w=!e.isScheduled&&s&&a;(0,o.Nf)(()=>{const e=m?.map(e=>e.itemId.toString())||[];y(e)},[m]);const I=(0,K.A)(),b=(0,z.A)(e=>{e.preventDefault(),e.stopPropagation(),s||d({message:I("SubscribeToTelegramPremiumForToggleTask"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:I("PremiumMore")})}),S=(0,z.A)(t=>{const n=t.find(e=>!C.has(e)),o=Array.from(C).find(e=>!t.includes(e));r({chatId:e.chatId,messageId:e.id,completedIds:n?[Number(n)]:[],incompletedIds:o?[Number(o)]:[]}),t.length===g.length&&c({})}),M=Boolean(e.forwardInfo)||!f&&!e.isOutgoing,N=e.isOutgoing,k=(0,o.Kr)(()=>g.map(e=>{const t=m?.find(t=>t.itemId===e.id)?.completedBy,n=f&&t?(0,u.PVB)((0,i.mS)(),t):void 0,o=n?(0,l.em)(I,n):void 0;return{label:(0,Yt.fd)(e.title),value:e.id.toString(),peer:n,subLabel:o}}),[g,f,m,I]);return(0,Ne.FD)("div",{className:"todo-list",dir:I.isRtl?"auto":"ltr",children:[(0,Ne.FD)("div",{className:"todo-list-header",children:[(0,Ne.Y)("div",{className:"todo-list-title",children:(0,Yt.fd)(p)}),(0,Ne.Y)("div",{className:"list-type",children:e.forwardInfo?I("TitleToDoList"):f?I("TitleGroupToDoList"):N?I("TitleYourToDoList"):n?I("TitleUserToDoList",{peer:(0,l.F9)(I,n)},{withNodes:!0}):I("TitleToDoList")})]}),(0,Ne.Y)("div",{className:"todo-list-items",children:M?(0,Ne.Y)("div",{className:"todo-list-items",children:k.map(e=>(0,Ne.FD)("div",{className:"todo-list-readonly-item",children:[(0,Ne.Y)("div",{className:"todo-readonly-item-checkbox",children:C.has(e.value)?(0,Ne.Y)(Se.A,{name:"check"}):(0,Ne.Y)("div",{className:"todo-item-bullet-point"})}),(0,Ne.Y)("div",{className:(0,v.A)("readonly-item-label",C.has(e.value)&&"completed-label"),children:e.label})]},e.value))}):(0,Ne.Y)(Mn.A,{options:k,selected:A,onChange:S,onClickLabel:s?void 0:b,disabled:!w,isRound:!0})}),(0,Ne.Y)("div",{className:"completed-tasks-count",children:(0,Ne.Y)(ot.A,{text:I("DescriptionCompletedToDoTasks",{number:A.length,count:k.length})})})]})}));var Wn=n(58849),_n=n(87094),Qn=n(39877),Zn=n(84685),Xn=n(95773),eo=n(40558),to=n(61361);const no=(0,o.ph)(({auction:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,K.A)(),a=(0,o.li)(),[r,d,l]=(0,O.A)(),{gift:c,endDate:u}=e,{background:h,title:m,availabilityTotal:p,isSoldOut:g}=c,A=h?.textColor||"#ffffff",[y,C]=(0,o.J0)(()=>u<(0,w.Fm)()),I=(0,z.A)(()=>{C(!0)}),b=(0,o.Kr)(()=>[h?.centerColor||"#254e7a",h?.edgeColor||"#0f2a49"],[h]),S=(0,o.Kr)(()=>y||g?s("GiftAuctionSoldOut"):s("GiftAuctionGifts",{count:p||0},{pluralValue:p||0}),[p,y,g,s]);return(0,Ne.FD)("div",{className:(0,v.A)("interactive-gift","rK3ug8nc"),style:`color: ${A}`,onClick:i,onMouseEnter:f.TF?void 0:d,onMouseLeave:f.TF?void 0:l,children:[(0,Ne.Y)(eo.A,{className:"PsJFZPEc",backgroundColors:b,withAdaptiveHeight:!0}),(0,Ne.Y)("div",{className:"rV1S0P1o",style:`background-color: ${b[0]}`,children:y?s("GiftAuctionFinished"):(0,Ne.Y)(to.A,{endsAt:u,onEnd:I})}),(0,Ne.Y)(Xn.A,{ref:a,className:"g5kNvwaj",withSparkles:!0,sparklesColor:A,children:(0,Ne.Y)(gt.A,{containerRef:a,sticker:c.sticker,size:120,shouldLoop:r,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})}),(0,Ne.Y)("div",{className:"WHFbvlSl",children:m}),(0,Ne.Y)("div",{className:"GWFm_Jl4",children:S})]})});var oo=n(66833);const io=(0,o.ph)(({gift:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,onClick:i})=>{const s=(0,o.li)(),{backdrop:a,model:r,pattern:d}=(0,oo.uc)(e),[l,c,u]=(0,O.A)(),h=[a.centerColor,a.edgeColor];return(0,Ne.FD)("div",{className:(0,v.A)("interactive-gift","LaOdPURl"),onClick:i,onMouseEnter:f.TF?void 0:c,onMouseLeave:f.TF?void 0:u,children:[(0,Ne.Y)(eo.A,{className:"EdXfeKWY",backgroundColors:h,patternIcon:d.sticker,centerEmptiness:.15,ringsCount:2,ovalFactor:1.2,withAdaptiveHeight:!0}),(0,Ne.Y)("div",{ref:s,className:"o_DYZEMV",children:(0,Ne.Y)(gt.A,{containerRef:s,sticker:r.sticker,size:120,shouldLoop:l,observeIntersectionForPlaying:n,observeIntersectionForLoading:t})})]})}),so=(0,o.ph)(({messageWebPage:e,webPage:t,message:n,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u=!1,isProtected:h,isConnected:m,story:p,theme:g,backgroundEmojiId:f,shouldWarnAboutFiles:A,autoLoadFileMaxSizeMb:y,lastPlaybackTimestamp:C,observeIntersectionForLoading:I,observeIntersectionForPlaying:b,onMediaClick:S,onDocumentClick:N,onContainerClick:k,onAudioPlay:Y,onCancelMediaTransfer:F})=>{const{openUrl:P,openTelegramLink:T}=(0,i.ko)(),D=(0,o.li)(),x=(0,K.A)(),L=(0,z.A)(()=>{S()}),E=(0,z.A)(e=>{k?.(e)}),B="full"===t?.webpageType?t:void 0,{story:O,stickers:U}=B||{};(0,R.A)(O?.peerId,O?.id,p);const V=U?.isWithTextColor||U?.documents?.[0]?.shouldUseTextColor,j=(0,_n.A)(D,void 0,!V),J=(0,o.Kr)(()=>{const e=t?.url&&(0,oe.vG)(t?.url);if(e&&"timestamp"in e)return e.timestamp},[t?.url]),G=(0,z.A)(n=>{n.stopPropagation(),P({url:t.url,shouldSkipModal:e.isSafe})}),q=(0,z.A)(()=>{T({url:t.url})});if("full"!==t?.webpageType)return;const{siteName:$,url:H,displayUrl:W,title:_,description:Q,photo:Z,video:X,audio:ee,type:te,document:ne}=t,{mediaSize:ie}=e,se="telegram_story"===te,ae="telegram_nft"===te,re="telegram_auction"===te,de=p&&"isDeleted"in p,le=U?.isEmoji?"telegram_emojiset":te,ce=re&&t.auction?t.auction.endDate:void 0,ue=de?void 0:function(e,t){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"ViewButtonRequestJoin";case"telegram_message":return"ViewButtonMessage";case"telegram_bot":return"ViewButtonBot";case"telegram_voicechat":return"ViewButtonVoiceChat";case"telegram_livestream":return"ViewButtonVoiceChatChannel";case"telegram_megagroup":case"telegram_chat":return"ViewButtonGroup";case"telegram_channel":return"ViewButtonChannel";case"telegram_user":return"ViewButtonUser";case"telegram_botapp":return"ViewButtonBotApp";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"ViewButtonStory";case"telegram_channel_boost":case"telegram_group_boost":return"ViewButtonBoost";case"telegram_stickerset":return"ViewButtonStickerset";case"telegram_emojiset":return"ViewButtonEmojiset";case"telegram_nft":return"ViewButtonGiftUnique";case"telegram_auction":return void 0!==t&&t<(0,w.Fm)()?"PollViewResults":"GiftAuctionJoin";default:return}}(le,ce),he=ue&&x(ue),me=function(e){if("telegram_auction"===e)return"auction-filled"}(le),pe=(0,Wn.A)(Q,170),ge=Boolean(pe||_||$);let ve=Boolean(U);ge&&t?.photo&&!t.video&&!t.document&&(ve=function(e,t){if(!e?.photo)return!1;if("small"===t)return!0;if("large"===t)return!1;const{width:n,height:o}=(0,d.Xn)(e.photo)||{};return!(!n||!o||n!==o||e.hasLargeMedia)}(t,ie));const Ae=(Z||X)&&S&&!ve,Ce=(0,v.A)("WebPage",ve&&"with-square-photo",!Z&&!X&&"without-media",X&&"with-video",!ge&&"no-article",ne&&"with-document",he&&"with-quick-button",(ae||re)&&"with-gift");return(0,Ne.FD)(Me.A,{className:Ce,"data-initial":($||W)[0],dir:x.isRtl?"rtl":"auto",onClick:E,children:[(0,Ne.FD)("div",{className:(0,v.A)("WebPage--content",se&&"is-story",(ae||re)&&"is-gift"),children:[f&&(0,Ne.Y)(Qn.A,{emojiDocumentId:f,className:"WebPage--background-icons"}),se&&(0,Ne.Y)(Gn,{story:p,isProtected:h,isConnected:m,isPreview:!0}),ae&&(0,Ne.Y)(io,{gift:t.gift,observeIntersectionForLoading:I,observeIntersectionForPlaying:b,onClick:q}),re&&t.auction&&(0,Ne.Y)(no,{auction:t.auction,observeIntersectionForLoading:I,observeIntersectionForPlaying:b,onClick:q}),ge&&(0,Ne.FD)("div",{className:(0,v.A)("WebPage-text","WebPage-text_interactive"),onClick:G,children:[(0,Ne.Y)(Zn.A,{className:"site-name",url:H,text:$||W}),_&&(0,Ne.Y)("p",{className:"site-title",children:(0,M.A)(_)}),pe&&!ae&&!re&&(0,Ne.Y)("p",{className:"site-description",children:(0,M.A)(pe,["emoji","br"])})]}),Z&&!ae&&!re&&!X&&(0,Ne.Y)(Je.A,{photo:Z,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersection:I,noAvatars:s,canAutoLoad:r,size:ve?"pictogram":"inline",asForwarded:c,nonInteractive:!Ae,isDownloading:u,isProtected:h,theme:g,onClick:Ae?L:void 0,onCancelUpload:F}),X&&(0,Ne.Y)(Ge.A,{video:X,isOwn:n?.isOutgoing,isInWebPage:!0,observeIntersectionForLoading:I,noAvatars:s,canAutoLoad:r,canAutoPlay:l,asForwarded:c,isDownloading:u,isProtected:h,lastPlaybackTimestamp:C||J,onClick:Ae?L:void 0,onCancelUpload:F}),ee&&(0,Ne.Y)(fe.Ay,{theme:g,message:n,origin:a.d9.Inline,noAvatars:s,isDownloading:u,onPlay:Y,onCancelUpload:F}),ne&&!Z&&(0,Ne.Y)(ye.A,{document:ne,message:n,observeIntersection:I,autoLoadFileMaxSizeMb:y,onMediaClick:N,onCancelUpload:F,isDownloading:u,shouldWarnAboutFiles:A}),U&&(0,Ne.Y)("div",{ref:D,className:(0,v.A)("media-inner","square-image",U.isEmoji&&"WebPage--emoji-grid","WebPage--stickers"),children:U.documents.map(e=>(0,Ne.Y)("div",{className:"WebPage--sticker",children:(0,Ne.Y)(gt.A,{containerRef:D,sticker:e,shouldLoop:!0,size:U.isEmoji?38:80,customColor:j,observeIntersectionForPlaying:b,observeIntersectionForLoading:I})},e.id))})]}),he&&(0,Ne.FD)(Ke.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,noForcedUpperCase:!re,onClick:q,children:[me&&(0,Ne.Y)(Se.A,{name:me}),he]})]})}),ao=1.75*S.$,ro=2.25*S.$,lo=(0,o.ph)((0,i.EK)((e,t)=>{const{focusedMessage:n,forwardMessages:o,activeReactions:i,activeEmojiInteractions:a,loadingThread:r}=(0,u.nTw)(e),{message:l,album:g,withSenderName:v,withAvatar:A,threadId:w,messageListType:I,isLastInDocumentGroup:b,isFirstInGroup:S}=t,{id:M,chatId:N,viaBotId:k,isOutgoing:Y,forwardInfo:F,transcriptionId:P,isPinned:T,viaBusinessBotId:D,effectId:x,paidMessageStars:L}=l,E=(0,u.k9R)(e,l),{shouldWarnAboutFiles:B}=(0,m.lS)(e),R=(0,y.L8)(N),O=(0,u.hds)(e,N),U=(0,u.nZ4)(e,N),K=(0,u.ALW)(e,N),z=(0,d.DX)(N),V=(0,d.Qe)(N),j=O&&(0,d.WX)(O),J=O&&(0,d.YE)(O),G=R?void 0:(0,u.AWZ)(e,N),q=E?.story,$=q?(0,u.Msb)(e,q.peerId,q.id):void 0,H=o.messageIds&&o.messageIds.includes(M),W=!U&&(0,d.zP)(l),_=v||A||W,Q=(0,u.Y7C)(e,l),Z=(0,u.Szq)(e,l),X=k?(0,u.mBe)(e,k):void 0,ee=Q?.id&&J?G?.adminMembersById?.[Q?.id]:void 0,te=l.id===w,{replyToMsgId:ne,replyToPeerId:oe,replyFrom:ie}=(0,c.Q)(l)||{},{peerId:se,storyId:ae}=(0,c.W)(l)||{},re=ne&&ne===w,de=(0,u.gMr)(e,l),le=F||ie,ce=de?(0,u.Y7C)(e,de):!le||z||V?void 0:(0,u.HdA)(e,le),ue=de&&(0,u.Szq)(e,de),he=oe?(0,u.hds)(e,oe):void 0,me=!z&&!V&&he&&!(0,d.gA)(he)&&(he.isNotJoined||(0,u._ls)(e,he.id)),pe="topicCreate"===de?.content.action?.type,ge=ae&&se?(0,u.Msb)(e,se,ae):void 0,fe=se?(0,u.PVB)(e,se):void 0,ve=(0,u.ldX)(e,l),Ae="thread"===I&&(g?g.messages.some(t=>(0,u.nJv)(e,t,w)):(0,u.nJv)(e,l,w)),{direction:ye,noHighlight:Ce,isResizingContainer:we,quote:Ie,quoteOffset:be,scrollTargetPosition:Se}=Ae&&n||{},Me=(0,u.TCk)(e),Ne=Me?.results?.query&&`${Me.isHashtag?"#":""}${Me.results.query}`,ke=(0,d.wb)(l),Ye=ke&&(0,u.oei)(e,ke)?ke:void 0,Fe=(0,d.Jw)(l);let Pe;Pe=g?.messages?g.messages.every(({id:t})=>(0,u.H1_)(e,t)):(0,u.H1_)(e,M);const Te="thread"===I&&(0,u.tOf)(e,l,w),De=(0,u.yuw)(e),xe=(0,h.iS)(e,l),Le=xe&&(0,d.$r)(De,xe),Ee=(0,p.Vw)(e,N,g?.commentsMessage?.id||M),Be=Boolean(l.groupedId)&&!l.isInAlbum,Re=Be?(0,u.D_S)(e,N,l.groupedId)[0]:void 0,Oe=Be?b?(0,u.O5q)(e,N,Re):void 0:l,Ue=(0,p.a1)(e,N,w),Ke=Ue?.unreadReactions?.includes(l.id),ze=w===s.l3&&O?.isForum&&!O.isBotForum&&S,Ve=(0,u.nkm)(e,l),je=(0,u.RnX)(e,N),Je=(0,u.Rny)(e,N,l.id),Ge=(0,u.qZq)(e,N),qe=f.CM&&e.settings.byKey.canTranslate&&!Ge,$e="connectionStateReady"===e.connectionState,He=Boolean(Oe&&i[(0,C.bj)(Oe)]?.length),We=(0,u.g29)(e),_e=Q&&(0,u.nZ4)(e,Q.id)?G?.boostsApplied??l.senderBoosts:l.senderBoosts,Qe=O?.boostLevel||0,Ze=e.appConfig.groupTranscribeLevelMin,Xe=We||Boolean(Ze&&Qe>=Ze),et=D?(0,u.mBe)(e,D):void 0,tt=x?e.availableEffectById[x]:void 0,nt=(0,u.zcZ)(e,l),ot=(0,h.me)(e,l),it=(0,h.xd)(e,N,l.id),st=(0,u.trm)(e),at=e.appConfig.starsSuggestedPostFutureMin,rt=(0,h.B9)(e,l),dt=de&&(0,h.B9)(e,de),lt=(0,u.g5w)(e,N,l.id,Je),ct=(0,d.Q_)(O,G,K);return{theme:(0,u.SJA)(e),forceSenderName:W,sender:Q,canShowSender:_,originSender:Z,botSender:X,shouldHideReply:re||pe,isThreadTop:te,replyMessage:de,replyMessageSender:ce,replyMessageForwardSender:ue,replyMessageChat:he,replyStory:ge,isReplyPrivate:me,storySender:fe,isInDocumentGroup:Be,isProtected:(0,u.ynf)(e,l),isChatProtected:(0,u.ryq)(e,N),isFocused:Ae,isForwarding:H,reactionMessage:Oe,isChatWithSelf:U,isBotForum:O?.isBotForum,isRepliesChat:z,isAnonymousForwards:V,isChannel:j,isGroup:J,canReply:Te,highlight:Ne,animatedEmoji:Ye,animatedCustomEmoji:Fe,isInSelectMode:(0,u.rTV)(e),isSelected:Pe,isGroupSelected:Boolean(l.groupedId)&&!l.isInAlbum&&(0,u.SLS)(e,N,l.groupedId),threadId:w,isDownloading:Le,isPinnedList:"pinned"===I,isPinned:T,canAutoLoadMedia:(0,u.wwb)(e,l),canAutoPlayMedia:(0,u.OEt)(e,l),autoLoadFileMaxSizeMb:e.settings.byKey.autoLoadFileMaxSizeMb,shouldLoopStickers:(0,u.ML4)(e),repliesThreadInfo:Ee,availableReactions:e.reactions.availableReactions,defaultReaction:(0,d.Nb)(l)||"scheduled"===I?void 0:(0,u.nTJ)(e,N),hasActiveReactions:He,activeEmojiInteractions:a,hasUnreadReaction:Ke,isTranscribing:void 0!==P&&e.transcriptions[P]?.isPending,transcribedText:void 0!==P?e.transcriptions[P]?.text:void 0,isPremium:We,senderAdminMember:ee,messageTopic:Ve,hasTopicChip:ze,chatTranslations:je,areTranslationsEnabled:qe,shouldDetectChatLanguage:(0,u.LRV)(e,N),requestedTranslationLanguage:Je,requestedChatTranslationLanguage:Ge,hasLinkedChat:Boolean(G?.linkedChatId),withAnimatedEffects:(0,u.xYJ)(e,"stickerEffects"),webPageStory:$,isConnected:$e,isLoadingComments:Ee?.isCommentsInfo&&r?.loadingChatId===Ee?.originChannelId&&r?.loadingMessageId===Ee?.originMessageId,shouldWarnAboutFiles:B,outgoingStatus:Y?(0,u.Tl2)(e,N,w,l.id,I):void 0,uploadProgress:"number"==typeof ve?ve:void 0,focusDirection:Ae?ye:void 0,noFocusHighlight:Ae?Ce:void 0,isResizingContainer:Ae?we:void 0,focusedQuote:Ae?Ie:void 0,focusedQuoteOffset:Ae?be:void 0,scrollTargetPosition:Ae?Se:void 0,senderBoosts:_e,tags:e.savedReactionTags?.byKey,canTranscribeVoice:Xe,viaBusinessBot:et,minFutureTime:at,effect:tt,poll:nt,maxTimestamp:ot,lastPlaybackTimestamp:it,paidMessageStars:L,isChatWithUser:R,isAccountFrozen:st,isMediaNsfw:rt,isReplyMediaNsfw:dt,webPage:E,summary:lt,canSendStickers:ct.canSendStickers}})(({message:e,album:t,noAvatars:n,withAvatar:u,withSenderName:h,noComments:m,noReplies:p,appearanceOrder:y,isJustAdded:C,isFirstInGroup:Y,isPremium:P,isLastInGroup:T,isFirstInDocumentGroup:q,isLastInDocumentGroup:$,isTranscribing:X,transcribedText:se,isLastInList:ae,theme:re,forceSenderName:de,sender:le,canShowSender:ce,originSender:ue,botSender:he,isThreadTop:pe,shouldHideReply:ge,replyMessage:Ie,replyMessageSender:be,replyMessageForwardSender:ke,replyMessageChat:Le,replyStory:Ee,isReplyPrivate:Be,storySender:Re,outgoingStatus:je,uploadProgress:qe,isInDocumentGroup:$e,isLoadingComments:We,isProtected:_e,isChatProtected:Qe,isFocused:Xe,focusDirection:tt,focusedQuote:nt,focusedQuoteOffset:ot,noFocusHighlight:it,scrollTargetPosition:at,isResizingContainer:rt,isForwarding:dt,isChatWithSelf:lt,isBotForum:ut,isRepliesChat:ht,isAnonymousForwards:pt,isChannel:gt,isGroup:ft,canReply:vt,highlight:At,animatedEmoji:yt,animatedCustomEmoji:Ct,hasActiveReactions:wt,hasLinkedChat:It,isInSelectMode:bt,isSelected:St,isGroupSelected:Mt,threadId:Nt,reactionMessage:Yt,availableReactions:Ft,defaultReaction:Pt,activeEmojiInteractions:Tt,messageListType:xt,isPinnedList:Et,isPinned:Bt,isDownloading:Rt,canAutoLoadMedia:Ot,canAutoPlayMedia:Ut,shouldLoopStickers:Kt,autoLoadFileMaxSizeMb:zt,repliesThreadInfo:Vt,hasUnreadReaction:jt,memoFirstUnreadIdRef:Jt,senderAdminMember:Gt,messageTopic:Ht,hasTopicChip:Wt,chatTranslations:_t,areTranslationsEnabled:Qt,shouldDetectChatLanguage:Xt,requestedTranslationLanguage:en,requestedChatTranslationLanguage:tn,withAnimatedEffects:on,webPageStory:sn,isConnected:an,getIsMessageListReady:rn,shouldWarnAboutFiles:dn,senderBoosts:ln,tags:cn,canTranscribeVoice:un,viaBusinessBot:hn,effect:fn,poll:vn,maxTimestamp:An,lastPlaybackTimestamp:Cn,isMediaNsfw:In,isReplyMediaNsfw:Sn,paidMessageStars:Mn,isChatWithUser:Nn,isAccountFrozen:kn,minFutureTime:Yn,webPage:Fn,summary:Pn,canSendStickers:Tn,observeIntersectionForBottom:Dn,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,onMessageUnmount:On})=>{const{toggleMessageSelection:Un,clickBotInlineButton:zn,clickSuggestedMessageButton:Vn,rejectSuggestedPost:jn,openSuggestedPostApprovalModal:Jn,disableContextMenuHint:Gn,animateUnreadReaction:Wn,focusMessage:_n,markMentionsRead:Qn,openThread:Zn,summarizeMessage:Xn}=(0,i.ko)(),eo=(0,o.li)(),to=(0,o.li)(),no=(0,o.li)(),oo=(0,V.A)(),io=(0,K.A)(),[lo,co]=(0,o.J0)(!1),[uo,ho]=(0,o.J0)(!1),[mo,po]=(0,o.J0)(!1),[go,fo,vo]=(0,O.A)(),[Ao,yo,Co]=(0,O.A)(),[wo,Io,bo]=(0,O.A)(),[So,Mo,No]=(0,O.A)(),[ko,Yo]=(0,o.J0)(""),{isMobile:Fo,isTouchScreen:Po}=(0,x.Ay)();(0,U.mv)(to,Dn);const{isContextMenuOpen:To,contextMenuAnchor:Do,contextMenuTarget:xo,handleBeforeContextMenu:Lo,handleContextMenu:Eo,handleContextMenuClose:Bo,handleContextMenuHide:Ro}=(0,L.A)(eo,Po&&bt||kn,!g.Vq,f.Ni,rn);(0,o.vJ)(()=>{To&&Gn()},[To,Gn]);const Oo=y<=0,[Uo,Ko]=(0,O.A)(Oo);(0,o.vJ)(()=>{Oo||setTimeout(Ko,y*r.zq7)},[y,Ko,Oo]),(0,G.A)({ref:eo,isOpen:Uo||C,noMountTransition:Oo&&!C,className:!1}),(0,o._W)(()=>{On?.(zo)});const{id:zo,chatId:Vo,forwardInfo:jo,viaBotId:Jo,isTranscriptionError:Go,factCheck:qo,isTypingDraft:$o}=e,Ho=Boolean(e.summaryLanguageCode),Wo=(0,d.Nb)(e),_o=(0,d.Ie)(e),Qo="scheduled"===xt||e.isScheduled,Zo=(0,d.Tv)(e)&&!ge,{paidMedia:Xo}=(0,d.r_)(e),{photo:ei,video:ti}=k(Xo),{photo:ni=ei,video:oi=ti,audio:ii,voice:si,document:ai,sticker:ri,contact:di,invoice:li,location:ci,action:ui,game:hi,storyData:mi,giveaway:pi,giveawayResults:gi,todo:fi,dice:vi}=(0,d.r_)(e),Ai=(0,c.Q)(e),yi=(0,c.W)(e),Ci=Boolean(!lo&&(Go||se)),wi=Boolean(yi),Ii=Boolean(Vt)&&"thread"===xt,bi=!Ci&&(0,d.aN)(e),Si=bi&&(yt||Ct),Mi=Yt?.reactions&&!(0,d.G)(Yt.reactions),Ni=jo&&(!lt||Qo)&&!ht&&!jo.isLinkedChannelPost&&!pt&&!he||Boolean(mi&&!mi.isMention),ki=Boolean(ln)&&!Ni&&Y,Yi=mi?.isMention,Fi="video"===oi?.mediaType&&oi.isRound,Pi=Boolean(t)&&(t.isPaidMedia&&Xo.extendedMedia.length>1||t.messages.length>1)&&!t.messages.some(e=>0===Object.keys(e.content).length),Ti=$e&&!q,Di=$e&&!$,xi=void 0!==Do,Li=!(xi||bt||dt||Di||Yi),Ei=gt&&!Qo&&e.isForwardingAllowed&&!Qe,Bi=Boolean(Et||jo&&(jo.isChannelPost||lt||ht||pt)&&jo.fromMessageId),Ri=Boolean(qo?.text),Oi=Ni&&bi,Ui=Wt||Zo||wi||Oi||Boolean(So&&Pn?.text),Ki=(0,z.A)((e,n)=>{kn||Un({messageId:zo,groupedId:n,...e?.shiftKey&&{withShift:!0},...Pi&&{childMessageIds:t.messages.map(({id:e})=>e)}})}),zi=ce?le:void 0,Vi=jo&&(lt||ht||pt||!zi)?ue:zi,ji=Ni?ue:le,Ji=_o&&!bi,Gi=jo||mi?ue:zi,qi=(0,d.G5)(e),{handleMouseDown:$i,handleClick:Hi,handleContextMenu:Wi,handleDoubleClick:_i,handleContentDoubleClick:Qi,handleMouseMove:Zi,handleSendQuickReaction:Xi,handleMouseLeave:es,isSwiped:ts,isQuickReactionVisible:ns,handleDocumentGroupMouseEnter:os}=me(Ki,eo,zo,Boolean(bt),Boolean(vt),Boolean(_e),Eo,Lo,Vo,xi,no,Di,rn),{handleSenderClick:is,handleViaBotClick:ss,handleReplyClick:as,handleMediaClick:rs,handleDocumentClick:ds,handleAudioPlay:ls,handleAlbumMediaClick:cs,handlePhotoMediaClick:us,handleVideoMediaClick:hs,handleMetaClick:ms,handleTranslationClick:ps,handleOpenThread:gs,handleReadMedia:fs,handleCancelUpload:vs,handleVoteSend:As,handleGroupForward:ys,handleForward:Cs,handleFocus:ws,handleFocusForwarded:Is,handleDocumentGroupSelectAll:bs,handleTopicChipClick:Ss,handleStoryClick:Ms}=function({lang:e,selectMessage:t,message:n,webPage:o,chatId:r,threadId:l,isInDocumentGroup:u,asForwarded:h,isScheduled:m,album:p,senderPeer:g,botSender:f,messageTopic:v,isTranslatingChat:A,story:y,isReplyPrivate:C,isRepliesChat:w,isSavedMessages:I,lastPlaybackTimestamp:b}){const{openChat:S,openChatWithDraft:M,showNotification:N,focusMessage:k,openMediaViewer:Y,openAudioPlayer:F,markMessagesRead:P,cancelUploadMedia:T,sendPollVote:D,openForwardMenu:x,openChatLanguageModal:L,openThread:E,openStoryViewer:B,searchChatMediaMessages:R}=(0,i.ko)(),{id:O,forwardInfo:U,groupedId:K,content:{paidMedia:V,video:j}}=n,{replyToMsgId:J,replyToPeerId:G,replyToTopId:q,isQuote:$,quoteText:H,quoteOffset:W}=(0,c.Q)(n)||{},_=(0,z.A)(()=>{g?h&&U?.channelPostId?k({chatId:g.id,messageId:U.channelPostId}):S({id:g.id}):N({message:e("HidAccount")})}),Q=(0,z.A)(()=>{f&&M({chatId:r,threadId:l,text:{text:`@${(0,d.Kl)(f)} `}})}),Z=(0,z.A)(()=>{J&&!C?w&&G&&q?E({isComments:!0,originChannelId:G,originMessageId:q,focusMessageId:J}):k({chatId:G||r,threadId:w?q:l,messageId:J,replyMessageId:G?void 0:O,noForumTopicPanel:!G,...$&&{quote:H?.text,quoteOffset:W}}):N({message:e($?"QuotePrivate":"ReplyPrivate")})}),X=(0,z.A)(()=>{Y({chatId:r,threadId:l,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline})}),ee=(0,z.A)(e=>{if(V&&!V.isBought)return;e&&R({chatId:r,threadId:l,currentMediaMessageId:O});const t=o?.url&&(0,oe.vG)(o.url),n=j||(0,d.rU)(o),i=t&&"timestamp"in t?t.timestamp:void 0;Y({chatId:r,threadId:l,messageId:O,origin:m?a.TQ.ScheduledInline:a.TQ.Inline,timestamp:b||n?.timestamp||i,withDynamicLoading:e})}),te=(0,z.A)(()=>{ee(!m&&!V)}),ne=(0,z.A)(()=>{const e=n.content?.video?.isGif;ee(!e&&!m&&!V)}),ie=(0,z.A)(()=>{((0,d.yl)(n)||(0,d.eY)(o))&&te(),ne()}),se=(0,z.A)(()=>{F({chatId:r,messageId:O})}),ae=(0,z.A)((e,t)=>{V&&!V.isBought||(R({chatId:r,threadId:l,currentMediaMessageId:O}),Y({chatId:r,threadId:l,messageId:e,mediaIndex:t,origin:m?a.TQ.ScheduledAlbum:a.TQ.Album,withDynamicLoading:!V}))}),re=(0,z.A)(()=>{P({chatId:r,messageIds:[O]})}),de=(0,z.A)(()=>{T({chatId:r,messageId:O})}),le=(0,z.A)(e=>{D({chatId:r,messageId:O,options:e})}),ce=(0,z.A)(()=>{x({fromChatId:r,groupedId:K})}),ue=(0,z.A)(()=>{if(p&&p.messages){const e=p.messages.map(({id:e})=>e);x({fromChatId:r,messageIds:e})}else x({fromChatId:r,messageIds:[O]})}),he=(0,z.A)(()=>{k({chatId:r,threadId:s.l3,messageId:O})}),me=(0,z.A)(()=>{const e=I&&U.savedFromPeerId||U.fromChatId;u?k({chatId:e,groupedId:K,groupedChatId:r,messageId:U.fromMessageId}):G&&q?w?E({isComments:!0,originChannelId:G,originMessageId:q,focusMessageId:U.fromMessageId}):k({chatId:G,threadId:q,messageId:U.fromMessageId}):k({chatId:e,messageId:U.fromMessageId})}),pe=(0,z.A)(e=>{e.stopPropagation(),t(e,K)}),ge=(0,z.A)(e=>{e.stopPropagation(),L({chatId:r,messageId:A?void 0:O})}),fe=(0,z.A)(()=>{E({chatId:n.chatId,threadId:n.id})}),ve=(0,z.A)(()=>{v&&k({chatId:G||r,threadId:v.id,messageId:O})}),Ae=(0,z.A)(()=>{y&&B({peerId:y.peerId,storyId:y.id,isSingleStory:!0})});return{handleSenderClick:_,handleViaBotClick:Q,handleReplyClick:Z,handleDocumentClick:X,handleMediaClick:ie,handleAudioPlay:se,handleAlbumMediaClick:ae,handlePhotoMediaClick:te,handleVideoMediaClick:ne,handleMetaClick:pe,handleTranslationClick:ge,handleOpenThread:fe,handleReadMedia:re,handleCancelUpload:de,handleVoteSend:le,handleGroupForward:ce,handleForward:ue,handleFocus:he,handleFocusForwarded:me,handleDocumentGroupSelectAll:pe,handleTopicChipClick:ve,handleStoryClick:Ae}}({lang:oo,selectMessage:Ki,message:e,webPage:Fn,chatId:Vo,threadId:Nt,isInDocumentGroup:$e,asForwarded:Ni,isScheduled:Qo,album:t,avatarPeer:Vi,senderPeer:Gi,botSender:he,messageTopic:Ht,isTranslatingChat:Boolean(tn),story:Ee&&"content"in Ee?Ee:void 0,isReplyPrivate:Be,isRepliesChat:ht,isSavedMessages:lt,lastPlaybackTimestamp:Cn});(0,o.vJ)(()=>{Ho&&So&&!Pn&&Xn({chatId:Vo,id:e.id,toLanguageCode:en})},[Ho,Vo,e.id,en,So,Pn]);const Ns=(0,z.A)(e=>{e.stopPropagation(),fo()}),ks=(0,z.A)(()=>{_n({chatId:Vo,threadId:Nt,messageId:zo,scrollTargetPosition:"start",noHighlight:!0})});(0,o.vJ)(()=>{ae&&Ci&&se&&ks()},[ae,se,Ci]),(0,o.vJ)(()=>{const n=eo.current,o=e.isInAlbum&&t?.messages.some(e=>!e.isDeleting);e.isDeleting&&n&&!o&&((0,Ue.U)(n)?ho(!0):po(!0))},[e.isDeleting]);const Ys=t?.hasMultipleCaptions?void 0:t?.captionMessage||e,Fs=Ys&&(0,d.XR)(Ys),Ps=Fs||Ri,Ts=(0,v.A)("Message message-list-item",Y&&"first-in-group",_e&&"hide-on-print",_e&&!Fs?"is-protected":"allow-selection",T&&"last-in-group",q&&"first-in-document-group",$&&"last-in-document-group",ae&&"last-in-list",_o&&"own",Boolean(e.viewsCount)&&"has-views",e.isEdited&&"was-edited",Zo&&"has-reply",To&&"has-menu-open",Xe&&!it&&"focused",dt&&"is-forwarding",mo&&"is-deleting",uo&&"is-dissolving",$e&&"is-in-document-group",Pi&&"is-album",e.hasUnreadMention&&"has-unread-mention",St&&"is-selected",bt&&"is-in-selection-mode",pe&&!u&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",ts&&"is-swiped",C&&"is-just-added",(wt||go)&&"has-active-effect",Yi&&"is-story-mention"),Ds=Ys&&(0,d.r_)(Ys).text,xs=Boolean(e.isInvertedMedia),{replyToMsgId:Ls,replyToPeerId:Es}=Ai||{},{peerId:Bs,storyId:Rs}=yi||{};(0,o.vJ)(()=>{(ri?.hasEffect||fn)&&(Jt?.current&&zo>=Jt.current||Wo)&&fo()},[fn,Wo,Jt,zo,ri?.hasEffect]),(0,o.vJ)(()=>{vi&&(Jt?.current&&zo>=Jt.current||Wo)&&yo()},[vi,Jt,zo,Wo]);const Os=function(e,t,n){const[i,s]=(0,o.J0)(),a=(0,o.li)();return(0,o.vJ)(()=>{if(t||n&&!n()||a.current===e)return;let o=!1;return e?(async function(e,t=.2){if(Q()||await _.promise,W)try{const n=(await W.detect(e))[0];if(!n||"und"===n.detectedLanguage||!n.confidence||n.confidence<t)return;return n.detectedLanguage}catch(e){return void(r.Oig&&console.error("Failed to detect language: ",e))}return await H.request({name:"detectLanguage",args:[e,t]})}(e).then(e=>{o||s(e)}).finally(()=>{o||(a.current=e)}),()=>{o=!0}):(s(void 0),void(a.current=void 0))},[t,e,n]),i}(Ds?.text,!(Qt&&Xt)||$o,rn);!function(e,t,n,i){(0,o.vJ)(()=>{if(n||i&&!i())return;const o=Boolean(e.content.text?.text.length);!function({chatId:e,id:t,isTranslatable:n,detectedLanguage:o}){const i=ee.get(e)||new Z.A(150),s=i.get(t);s&&s.detectedLanguage===o&&s.isTranslatable===n||(i.set(t,{id:t,isTranslatable:n,detectedLanguage:o}),ee.set(e,i),te(e))}({chatId:e.chatId,id:e.id,isTranslatable:o,detectedLanguage:t})},[e,t,n,i])}(e,Os,!Xt,rn);const Us=(0,d.ZR)(e,!tn),{isPending:Ks,translatedText:zs}=(0,ie.A)(_t,Vo,Us?zo:void 0,en),Vs=Boolean(Pn?.isPending),js=Ks||Vs,Js=(0,J.A)(zs,Boolean(Us));(0,E.A)(([e])=>{(Pn?.text||e&&!So)&&ks()},[So,Pn?.text]);const Gs=zs||Js,qs="phoneCall"===ui?.type?ui:void 0,$s=Vt?.isCommentsInfo?Vt:void 0,Hs=It&&gt&&Wo,Ws=($s||Hs)&&!Di&&"thread"===xt&&!m,_s=($s||Hs)&&!Di&&"thread"===xt&&!m,Qs=!Po&&!qs&&!bt&&Pt&&!Di&&!Yi&&!qi&&!kn,Zs=!Ci&&Mi&&(bi||(ni||oi||mi||"geo"===ci?.mediaType)&&(!Ps||xs)),{className:Xs,style:ea}=(0,j.Ay)({peer:ji,noUserColors:Ji,shouldReset:!0,theme:re}),ta=function(e,t,{poll:n,webPage:o,hasSubheader:i,isCustomShape:s,isLastInGroup:a,asForwarded:l,hasThread:c,forceSenderName:u,hasCommentCounter:h,hasBottomCommentButton:m,hasActionButton:p,hasReactions:g,isGeoLiveActive:f,withVoiceTranscription:v,peerColorClass:A,hasOutsideReactions:y}={}){const{paidMedia:C}=(0,d.r_)(e),{photo:w,video:I}=k(C),b=(0,d.r_)(e),{photo:S=w,video:M=I,audio:N,voice:Y,document:F,contact:P,location:T,invoice:D,storyData:x,giveaway:L,giveawayResults:E}=b,B=t?.hasMultipleCaptions?void 0:(0,d.r_)(t?.captionMessage||e).text,R=Boolean(e.factCheck?.text),O="video"===M?.mediaType&&M.isRound,U=e.isInvertedMedia,K=S||M&&!O||t||o,z=[r.zPk],V=x||S||M||T||D?.extendedMedia||C,j=B||"venue"===T?.mediaType||f||R,J=V&&!j,G=Boolean(e.inlineButtons),q=Boolean(e.viaBotId),$=U&&K?!(!g||y)||!!R||!(!o||!j):j;return A&&z.push(A),!V&&B?.emojiOnlyCount?(z.push("emoji-only"),B.emojiOnlyCount<=r.Apc&&z.push(`emoji-only-${B.emojiOnlyCount}`)):j?z.push("text"):z.push("no-text"),Object.keys(b).length||z.push("unsupported"),p&&z.push("has-action-button"),s&&(z.push("custom-shape"),O&&z.push("round"),h&&z.push("has-comment-counter")),V&&!v?z.push("media"):M?z.push("video"):N?z.push("audio"):Y?(z.push("voice"),v&&z.push("with-voice-transcription")):F?z.push("document"):P?z.push("contact"):n?z.push("poll"):L||E?z.push("giveaway"):"full"===o?.webpageType&&(z.push("web-page"),(o.photo||o.video)&&z.push("media"),o.document&&z.push("document"),o.gift&&z.push("gift"),o.auction&&z.push("auction")),D&&!D.extendedMedia&&z.push("invoice"),D&&D.photo&&z.push("has-photo"),x&&z.push("story"),l&&z.push("is-forwarded"),i&&z.push("has-subheader"),c&&z.push("has-replies"),g&&z.push("has-reactions"),y&&z.push("has-outside-reactions"),q&&z.push("is-via-bot"),u&&z.push("force-sender-name"),s||(z.push("has-shadow"),V&&c&&z.push("has-background"),(i||l||q||!J||u||R||v)&&z.push("has-solid-background"),R&&z.push("has-fact-check"),!a||G||!S&&J&&!m||z.push("has-appendix")),K&&U&&z.push("is-inverted-media"),$?z.push("has-footer"):z.push("no-footer"),z.join(" ")}(e,t,{poll:vn,webPage:Fn,hasSubheader:Ui,isCustomShape:bi,isLastInGroup:T,asForwarded:Ni,hasThread:Ii&&!m,forceSenderName:de,hasCommentCounter:Ii&&void 0!==Vt.messagesCount&&Vt.messagesCount>0,hasBottomCommentButton:_s&&!bi,hasActionButton:Ei||Bi||_s&&bi,hasReactions:Mi,isGeoLiveActive:"geoLive"===ci?.mediaType&&!(0,d.vz)(e),withVoiceTranscription:Ci,peerColorClass:Xs,hasOutsideReactions:Zs}),na=ta.includes("has-appendix"),oa=(0,N.Rr)(Ds?.emojiOnlyCount),ia=Nn?void 0:Pi&&Mn?t.messages.length*Mn:Mn;let sa,aa;sa=qs||Di?"none":!Ps||Fn||oa||xs?xs&&!oa&&(Ri||Fn)?"in-text":"standalone":"in-text",Mi?Zs?aa="outside":Ni?(sa="standalone",aa="inside"):aa="inside":aa="none";const ra=bi?"in-meta":"in-content";(0,B.A)(Es||Vo,Ls,Ie,e.id,ge||Be),(0,R.A)(Bs||Vo,Rs,Ee),(0,ne.A)({elementRef:eo,isFocused:Xe,focusDirection:tt,noFocusHighlight:it,isResizingContainer:rt,isJustAdded:C,isQuote:Boolean(nt),scrollTargetPosition:at});const da=hn?(0,l.em)(oo,hn):void 0,la=!e.senderId,ca=da||la&&e.postAuthorTitle||(Ni||lt)&&jo?.postAuthorTitle||void 0;(0,o.vJ)(()=>{const n=to.current;if(!n||!(0,b.Y)(n))return;jt&&Wn({chatId:Vo,messageIds:[zo]});let o=[];e.hasUnreadMention&&(o=[zo]),t&&(o=t.messages.filter(e=>e.hasUnreadMention).map(e=>e.id)),o.length&&Qn({chatId:Vo,messageIds:o})},[jt,t,Vo,zo,Wn,e.hasUnreadMention]);const ua=(0,o.Kr)(()=>Pi?D(_o,Boolean(n),t,Fo):void 0,[Pi,_o,n,t,Fo]),ha=Ni&&!bi?28:0,ma=(0,o.Kr)(()=>{let e,t,o,i="";if(!Pi&&(ni||oi||li?.extendedMedia)){let o;if(ni||oi){const e=ni||oi;e&&!Fi&&(o=(0,F.yA)({media:e,isOwn:_o,asForwarded:Ni,noAvatars:n,isMobile:Fo}).width)}else if(li?.extendedMedia&&li.extendedMedia.width&&li.extendedMedia.height){const{width:e,height:t}=li.extendedMedia;o=(0,S.kn)({width:e,height:t,fromOwnMessage:_o,asForwarded:Ni,noAvatars:n,isMobile:Fo}).width}o&&(o<(0,F.Ay)(Fo)&&(t=o),e=Math.max((0,F.nP)(Ds?.text,Fo,Ws),o))}else if(ua){const t=(0,F.nP)(Ds?.text,Fo,Ws);e=Math.max(t,ua.containerStyle.width)}if(e)i=`width: ${e}px`,o=e+ro;else if(ri&&!Ui){const{width:e}=(0,S.bu)(ri,Fo);i=`width: ${e+ha}px`,o=e+ro}return{contentWidth:t,style:i,reactionsMaxWidth:o}},[ua,Ni,ha,Ui,li?.extendedMedia,Pi,Ws,Fo,_o,n,ni,ri,Ds?.text,oi,Fi]),{contentWidth:pa,style:ga,reactionsMaxWidth:fa}=ma,va=(0,A.A)(ea,ga);function Aa(e){if(!Ys)return;const t=So&&Pn?.text||(en?Gs:void 0);return(0,Ne.Y)(Te.A,{messageOrStory:Ys,forcedText:t,isForAnimation:e,focusedQuote:nt,focusedQuoteOffset:ot,emojiSize:oa,highlight:At,isProtected:_e,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,withTranslucentThumbs:bi,isInSelectMode:bt,canBeEmpty:Ri,maxTimestamp:An,threadId:Nt,shouldAnimateTyping:$o})}function ya(){return(0,Ne.Y)("div",{className:"translation-animation",children:(0,Ne.Y)("div",{className:"text-loading",children:Aa(!0)})})}const Ca=(0,o.hb)(()=>{if(Pt)return(0,Ne.Y)("div",{className:(0,v.A)("quick-reaction","no-selection",ns&&!wt&&"visible"),onClick:Xi,ref:no,children:(0,Ne.Y)(De.A,{reaction:Pt,size:ao,availableReactions:Ft,observeIntersection:Rn})})},[wt,Ft,Pt,Xi,ns,Rn]);function wa(){const t=(0,Ne.Y)(yn,{message:e,isPinned:Bt,withFullDate:lt&&!_o,noReplies:p,repliesThreadInfo:Vt,outgoingStatus:je,signature:ca,withReactionOffset:"inside"===aa,renderQuickReactionButton:Qs&&"in-meta"===ra?Ca:void 0,availableReactions:Ft,isTranslated:Boolean(en?Gs:void 0),effectEmoji:fn?.emoticon,onClick:ms,onEffectClick:Ns,onTranslationClick:ps,onOpenThread:gs,paidMessageStars:ia});return"inside"!==aa?t:(0,Ne.Y)(Ln.A,{message:Yt,threadId:Nt,metaChildren:t,observeIntersection:Rn,noRecentReactors:gt,tags:cn,isCurrentUserPremium:P,isAccountFrozen:kn})}function Ia(e){const t=(0,v.A)("text-content","clearfix"),n=(0,v.A)("text-content","clearfix","in-text"===sa&&"with-meta",je&&"with-outgoing-icon"),o=Pi||!Pi&&ni||!Pi&&oi&&!Fi||!Si&&Ri,i="in-text"===sa;return(0,Ne.FD)(Ne.FK,{children:[ba(),Ps&&!Si&&(0,Ne.FD)("div",{className:t,dir:"auto",children:[Aa(),js&&ya(),!o&&i&&wa()]}),o&&(0,Ne.FD)(Ne.FK,{children:[Sa(e),!Si&&(0,Ne.FD)("div",{className:n,dir:"auto",children:[Ri&&(0,Ne.Y)(Dt,{factCheck:qo,isToggleDisabled:bt}),i&&wa()]})]})]})}function ba(){const t=(0,d.T_)(e);if(t&&Fn)return(0,Ne.Y)(so,{messageWebPage:t,webPage:Fn,message:e,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,noAvatars:n,canAutoLoad:Ot,canAutoPlay:Ut,asForwarded:Ni,isDownloading:Rt,isProtected:_e,theme:re,story:sn,isConnected:an,lastPlaybackTimestamp:Cn,backgroundEmojiId:ji?.color?.backgroundEmojiId,shouldWarnAboutFiles:dn,autoLoadFileMaxSizeMb:zt,onAudioPlay:ls,onMediaClick:rs,onDocumentClick:ds,onCancelMediaTransfer:vs})}function Sa(e){const o=(0,Ne.FD)(Ne.FK,{children:[Pi&&Bn&&(0,Ne.Y)(He,{album:t,albumLayout:ua,observeIntersection:Bn,isOwn:_o,isProtected:_e,hasCustomAppendix:e,onMediaClick:cs}),!Pi&&ni&&(0,Ne.Y)(Je.A,{messageText:Ds?.text,photo:ni,isOwn:_o,observeIntersection:Bn,noAvatars:n,canAutoLoad:Ot,uploadProgress:qe,shouldAffectAppendix:e,isDownloading:Rt,isProtected:_e,asForwarded:Ni,theme:re,isMediaNsfw:In,forcedWidth:pa,onClick:us,onCancelUpload:vs}),!Pi&&oi&&!Fi&&(0,Ne.Y)(Ge.A,{video:oi,isOwn:_o,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,forcedWidth:pa,noAvatars:n,canAutoLoad:Ot,canAutoPlay:Ut,uploadProgress:qe,isDownloading:Rt,isProtected:_e,asForwarded:Ni,isMediaNsfw:In,lastPlaybackTimestamp:Cn,onClick:hs,onCancelUpload:vs})]});return Xo?(0,Ne.Y)(bn,{chatId:Vo,messageId:zo,paidMedia:Xo,isOutgoing:_o,children:o}):o}function Ma(){return!(bi&&!Jo)&&(h&&(!(ni||oi||ci||Xo)||Wt)||Ni||Jo||de)&&!Ti&&!(Zo&&bi)}function Na(){return(0,Ne.FD)("span",{className:"forward-title-container",children:[Ni&&(0,Ne.Y)(Se.A,{name:jo?.hiddenUserName?"forward":"share-filled"}),Ni&&(0,Ne.Y)("span",{className:"forward-title",children:oo("ForwardedFrom")})]})}const ka=(0,z.A)(t=>{zn({chatId:Vo,messageId:e.id,threadId:Nt,button:t})}),Ya=(0,z.A)(t=>{if("openThread"!==t.type)return"suggestedMessage"===t.type?"approve"===t.buttonType?void Jn({chatId:Vo,messageId:e.id}):"decline"===t.buttonType?void Io():void Vn({chatId:Vo,messageId:e.id,button:t}):void 0;Zn({chatId:Vo,threadId:Ht.id})}),Fa=(0,z.A)(e=>{Yo(e.target.value)}),Pa=(0,z.A)(()=>{jn({chatId:Vo,messageId:e.id,rejectComment:ko.trim()||void 0}),bo(),Yo("")});function Ta(t=!1,n=!1){let o;!Gi||bi&&Jo?jo?.hiddenUserName?o=jo.hiddenUserName:mi&&ue&&(o=(0,l.em)(oo,ue)):o=(0,l.em)(oo,Gi);const i=Gi&&"emojiStatus"in Gi&&Gi.emojiStatus,s=Gi&&"isPremium"in Gi&&Gi.isPremium,a=Ni&&Gi,c=he?.hasUsername;return(0,Ne.FD)("div",{className:"message-title",dir:"ltr",children:[o||Ni?(0,Ne.FD)("span",{className:(0,v.A)("message-title-name-container",jo?.hiddenUserName?"sender-hidden":"interactive",void 0),dir:"ltr",children:[!t&&Na(),(0,Ne.FD)("span",{className:"message-title-name",children:[mi&&(0,Ne.Y)(Se.A,{name:"play-story"}),a&&(0,Ne.Y)(ve.A,{className:"forward-avatar",peer:Gi,size:"micro"}),(0,Ne.Y)("span",{className:"sender-title",onClick:is,children:o?(0,M.A)(o):Ni?" ":void 0}),!Ni&&i&&(0,Ne.Y)(Ae.A,{documentId:i.documentId,className:"no-selection",loopLimit:r.J$1,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn}),!Ni&&!i&&s&&(0,Ne.Y)(Pe.A,{}),Gi?.fakeType&&(0,Ne.Y)(Fe.A,{fakeType:Gi.fakeType})]})]}):he?void 0:" ",he?.hasUsername&&(0,Ne.FD)("span",{className:"interactive",children:[(0,Ne.Y)("span",{className:"via",children:oo("ViaBot")}),(0,Ne.Y)("span",{className:"sender-title",onClick:ss,children:(0,M.A)(`@${(0,d.Kl)(he)}`)})]}),(0,Ne.Y)("div",{className:"title-spacer"}),n||c?void 0:jo?.isLinkedChannelPost?(0,Ne.Y)("span",{className:"admin-title",dir:"auto",children:oo("DiscussChannel")}):e.postAuthorTitle&&ft&&!Ni?(0,Ne.Y)("span",{className:"admin-title",dir:"auto",children:e.postAuthorTitle}):!Gt||Ni||Jo?void 0:(0,Ne.Y)("span",{className:"admin-title",dir:"auto",children:Gt.customTitle||oo(Gt.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin")}),ki&&(0,Ne.FD)("span",{className:"sender-boosts","aria-hidden":!0,children:[(0,Ne.Y)(Se.A,{name:ln>1?"boosts":"boost"}),ln>1?ln:void 0]})]})}const Da=ft&&Ni?e.postAuthorTitle:void 0,xa=e.suggestedPostInfo&&!e.isOutgoing&&!e.suggestedPostInfo.isAccepted&&!e.suggestedPostInfo.isRejected,La=(()=>{if(!e.suggestedPostInfo?.scheduleDate||!Yn)return!1;const t=(0,w.Fm)();return e.suggestedPostInfo.scheduleDate<=t+Yn})(),Ea=(0,o.Kr)(()=>{if(xa)return[[{type:"suggestedMessage",buttonType:"decline",text:io("SuggestedPostDecline")},{type:"suggestedMessage",buttonType:"approve",text:io("SuggestedPostApprove"),disabled:La}],[{type:"suggestedMessage",buttonType:"suggestChanges",text:io("SuggestedPostSuggestChanges")}]]},[La,io,xa]),Ba=(0,o.Kr)(()=>{if(ut&&!e.inlineButtons&&Ht&&ae&&Nt===s.l3)return[[{type:"openThread",text:io("BotForumContinueThreadButton")}]]},[ut,io,e.inlineButtons,Ht,ae,Nt]),Ra=Ea||Ba;return(0,Ne.FD)("div",{ref:eo,id:(0,d.GZ)(e.id),className:Ts,"data-message-id":zo,onCopy:_e?I.A:void 0,onMouseDown:$i,onClick:Hi,onContextMenu:Wi,onDoubleClick:_i,onMouseEnter:Di?os:void 0,onMouseMove:Qs?Zi:void 0,onMouseLeave:Qs||Di?es:void 0,children:[(0,Ne.Y)("div",{ref:to,className:"bottom-marker","data-message-id":zo,"data-last-message-id":t?t.messages[t.messages.length-1].id:void 0,"data-album-main-id":t?t.mainMessage.id:void 0,"data-has-unread-mention":e.hasUnreadMention||void 0,"data-has-unread-reaction":jt||void 0,"data-is-pinned":Bt||void 0,"data-should-update-views":void 0!==e.viewsCount}),!$e&&(0,Ne.Y)("div",{className:"message-select-control no-selection",children:St&&(0,Ne.Y)(Se.A,{name:"check",className:"message-select-control-icon"})}),$&&(0,Ne.Y)("div",{className:(0,v.A)("message-select-control group-select no-selection",Mt&&"is-selected"),onClick:bs,children:Mt&&(0,Ne.Y)(Se.A,{name:"check",className:"message-select-control-icon"})}),(0,Ne.FD)("div",{className:(0,v.A)("message-content-wrapper",ta.includes("text")&&"can-select-text",ta.includes("giveaway")&&"giveaway-result-content"),children:[(0,Ne.FD)("div",{className:ta,style:va,dir:"auto",children:[Ni&&!Ti&&(0,Ne.FD)(Ne.FK,{children:[Ma()&&Ta(),Da&&(0,Ne.Y)("span",{className:"admin-title",dir:"auto",children:Da})]}),function(){const t=(0,v.A)("content-inner",Ni&&"forwarded-message",Oi&&"forwarded-custom-shape",Ui&&"with-subheader"),o=T&&(!Ps||xs&&!Ri&&"inside"!==aa)&&!_s,i=(0,v.A)("text-content","clearfix","in-text"===sa&&"with-meta",je&&"with-outgoing-icon"),s=!qi||!_o||lt;return(0,Ne.FD)("div",{className:t,onDoubleClick:Qi,dir:"auto",children:[!Ni&&Ma()&&Ta(),Ui&&(0,Ne.FD)("div",{className:"message-subheader",children:[Wt&&(0,Ne.Y)(Oe,{topic:Ht,onClick:Ss,className:"message-topic"}),Oi&&(0,Ne.FD)("div",{className:"forward-custom-shape-subheader",children:[(0,Ne.Y)("div",{className:"message-title",children:Na()}),Ta(!0,!0)]}),Zo&&(0,Ne.Y)(we.A,{message:Ie,replyInfo:Ai,noUserColors:Ji,isProtected:_e,sender:be,senderChat:Le,forwardSender:ke,chatTranslations:_t,isMediaNsfw:Sn,requestedChatTranslationLanguage:tn,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,onClick:as}),wi&&(0,Ne.Y)(Ye,{story:Ee,sender:Re,noUserColors:Ji,isProtected:_e,observeIntersectionForLoading:Bn,onClick:Ms}),Ho&&So&&!Pn?.isPending&&(0,Ne.FD)(Me.A,{className:"message-summary",onClick:No,children:[(0,Ne.Y)(xe.A,{preset:"button",className:"message-summary-sparkles"}),(0,Ne.Y)("span",{className:"message-summary-title",children:io("MessageSummaryTitle")}),(0,Ne.Y)("span",{className:"message-summary-description",children:io("MessageSummaryDescription")})]})]}),ri&&Bn&&Rn&&(0,Ne.Y)(Kn,{message:e,observeIntersection:Bn,observeIntersectionForPlaying:Rn,shouldLoop:Kt,shouldPlayEffect:go,withEffect:on,isMediaNsfw:In,onStopEffect:vo}),Si&&Ct&&(0,Ne.Y)(Ze,{customEmojiId:Ct,withEffects:on&&Nn&&!fn,isOwn:_o,observeIntersection:Bn,forceLoadPreview:Wo,messageId:zo,chatId:Vo,activeEmojiInteractions:Tt}),Si&&yt&&(0,Ne.Y)(et,{emoji:yt,withEffects:on&&Nn&&!fn,isOwn:_o,observeIntersection:Bn,forceLoadPreview:Wo,messageId:zo,chatId:Vo,activeEmojiInteractions:Tt}),on&&fn&&!Wo&&(0,Ne.Y)(gn.A,{shouldPlay:go,messageId:e.id,isMirrored:!e.isOutgoing,effect:fn,observeIntersectionForLoading:Bn,observeIntersectionForPlaying:Rn,onStop:vo}),qs&&(0,Ne.Y)(wn,{message:e,phoneCall:qs,chatId:Vo}),!Pi&&Fi&&!Ci&&(0,Ne.Y)(En.A,{message:e,observeIntersection:Bn,canAutoLoad:Ot,isDownloading:Rt,onReadMedia:s?fs:void 0,onHideTranscription:co,isTranscriptionError:Go,isTranscribed:Boolean(se),canTranscribe:un&&!qi,isTranscriptionHidden:lo,isTranscribing:X}),(ii||si||Ci)&&(0,Ne.Y)(fe.Ay,{theme:re,message:e,origin:a.d9.Inline,uploadProgress:qe,isSelectable:$e,isSelected:St,noAvatars:n,onPlay:ls,onReadMedia:si&&s?fs:void 0,onCancelUpload:vs,isDownloading:Rt,isTranscribing:X,isTranscriptionHidden:lo,isTranscribed:Boolean(se),isTranscriptionError:Go,canDownload:!_e,onHideTranscription:co,canTranscribe:un&&!qi}),ai&&(0,Ne.Y)(ye.A,{document:ai,message:e,observeIntersection:Bn,canAutoLoad:Ot,autoLoadFileMaxSizeMb:zt,uploadProgress:qe,isSelectable:$e,isSelected:St,onMediaClick:ds,onCancelUpload:vs,isDownloading:Rt,shouldWarnAboutFiles:dn}),mi&&!Yi&&(0,Ne.Y)(qn,{message:e,isProtected:_e}),Yi&&(0,Ne.Y)($n,{message:e}),di&&(0,Ne.Y)(ct,{contact:di,noUserColors:_o}),vn&&(0,Ne.Y)(xn,{message:e,poll:vn,onSendVote:As}),fi&&(0,Ne.Y)(Hn,{message:e,todoList:fi}),(pi||gi)&&(0,Ne.Y)(qt,{message:e}),hi&&(0,Ne.Y)(Lt,{message:e,threadId:Nt,canAutoLoadMedia:Ot}),vi&&(0,Ne.Y)(kt,{canSendDice:Tn,isLocal:Wo,dice:vi,isOutgoing:_o,canPlayWinEffect:Ao,onEffectPlayed:Co}),li?.extendedMedia&&(0,Ne.Y)(nn,{message:e,isConnected:an}),Ci&&(0,Ne.Y)("p",{className:(0,v.A)("transcription",!lo&&Go&&"transcription-error"),dir:"auto",children:Go?oo("NoWordsRecognized"):X&&se?(0,Ne.Y)(Ce.A,{content:se}):se}),xs&&Ia(o),!xs&&(0,Ne.FD)(Ne.FK,{children:[Sa(o),Ps&&!Si&&(0,Ne.FD)("div",{className:i,dir:"auto",children:[Aa(),js&&ya(),Ri&&(0,Ne.Y)(Dt,{factCheck:qo,isToggleDisabled:bt}),"in-text"===sa&&wa()]}),ba()]}),li&&!li.extendedMedia&&(0,Ne.Y)(Zt,{message:e,shouldAffectAppendix:o&&!Mi,isInSelectMode:bt,isSelected:St,theme:re,forcedWidth:pa}),ci&&(0,Ne.Y)(mn,{message:e,isInSelectMode:bt,isSelected:St,theme:re,peer:le})]})}(),!Di&&"standalone"===sa&&!Yi&&wa(),Li&&(0,Ne.FD)("div",{className:"message-action-buttons-container",children:[(0,Ne.Y)("div",{className:"message-action-buttons-sticky-zone",children:(0,Ne.Y)("div",{className:"message-action-buttons message-action-button-sticky",children:Ho&&(0,Ne.Y)(Ke.A,{className:"message-action-button action-summary",color:"translucent-white",round:!0,withSparkleEffect:!0,ariaLabel:io(So?"AriaHideSummary":"AriaShowSummary"),onClick:So?No:Mo,iconName:So?"expand":"collapse"})})}),(0,Ne.FD)("div",{className:(0,v.A)("message-action-buttons",We&&"message-action-buttons-shown"),children:[_s&&bi&&(0,Ne.Y)(st,{threadInfo:$s,disabled:m||!$s,isLoading:We,isCustomShape:!0}),Ei&&(0,Ne.Y)(Ke.A,{className:"message-action-button",color:"translucent-white",round:!0,ariaLabel:oo("lng_context_forward_msg"),onClick:$?ys:Cs,iconName:"share-filled"}),Bi&&(0,Ne.Y)(Ke.A,{className:"message-action-button",color:"translucent-white",round:!0,ariaLabel:io("FocusMessage"),onClick:Et?ws:Is,iconName:"arrow-right"})]})]}),_s&&!bi&&(0,Ne.Y)(st,{threadInfo:$s,disabled:m||!$s,isLoading:We}),na&&(0,Ne.Y)(pn.A,{isOwn:_o}),Qs&&"in-content"===ra&&Ca()]}),e.inlineButtons&&(0,Ne.Y)($t.A,{inlineButtons:e.inlineButtons,onClick:ka}),Ra&&(0,Ne.Y)($t.A,{inlineButtons:Ra,onClick:Ya}),"outside"===aa&&!Yi&&(0,Ne.Y)(Ln.A,{message:Yt,threadId:Nt,isOutside:!0,isCurrentUserPremium:P,maxWidth:fa,observeIntersection:Rn,noRecentReactors:gt,tags:cn,isAccountFrozen:kn})]}),Do&&(0,Ne.Y)(mt,{isOpen:To,anchor:Do,targetHref:xo?.matches("a[href]")?xo.href:void 0,message:e,album:t,messageListType:xt,onClose:Bo,onCloseAnimationEnd:Ro,repliesThreadInfo:Vt,noReplies:p,detectedLanguage:Os}),wo&&(0,Ne.FD)(ze.A,{isOpen:wo,onClose:bo,title:io("SuggestedPostDecline"),confirmLabel:io("SuggestedPostDecline"),confirmHandler:Pa,confirmIsDestructive:!0,children:[(0,Ne.Y)("div",{className:"decline-dialog-question",children:(0,M.A)(io("DeclinePostDialogQuestion",{sender:le?(0,l.em)(oo,le):""},{withNodes:!0,withMarkdown:!0}))}),(0,Ne.Y)(Ve.A,{placeholder:io("DeclineReasonPlaceholder"),value:ko,onChange:Fa,maxLength:200})]})]})}))},90423(e,t,n){n.d(t,{Ay:()=>r,j9:()=>c,zk:()=>d});var o=n(84051),i=n(63495),s=n(96454);const a=l();function r(e,t,n){const[i,r]=(0,o.J0)(Boolean(a&&document[a]));return(0,o.Nf)(()=>{const o=e.current,i=()=>{const e=Boolean(a&&document[a]);r(e),e?n?.(!1):t?.(!1),o instanceof HTMLVideoElement&&(o.controls=e)},s=()=>{r(!0),n&&n(!0)},d=()=>{r(!1),t&&t(!1)};return document.addEventListener("fullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),o&&(o.addEventListener("webkitbeginfullscreen",s,!1),o.addEventListener("webkitendfullscreen",d,!1)),()=>{document.removeEventListener("fullscreenchange",i,!1),document.removeEventListener("webkitfullscreenchange",i,!1),document.removeEventListener("mozfullscreenchange",i,!1),o&&(o.removeEventListener("webkitbeginfullscreen",s,!1),o.removeEventListener("webkitendfullscreen",d,!1))}},[]),a||s.pz?[i,()=>{var t;e.current&&(a||s.pz)&&!i&&((t=e.current).requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.mozRequestFullScreen&&t.mozRequestFullScreen(),r(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),r(!1))}]:[!1]}const d=()=>{const[e,t]=(0,o.J0)(!1);return(0,o.vJ)(()=>{const e=()=>{t(c())};let n;return i.Vq&&(window.tauri?.getCurrentWindow().then(e=>{e.isFullscreen().then(t)}),(async()=>{const e=await(window.tauri?.getCurrentWindow());n=await e.onResized(()=>{e.isFullscreen().then(t)})})()),document.addEventListener("fullscreenchange",e,!1),document.addEventListener("webkitfullscreenchange",e,!1),document.addEventListener("mozfullscreenchange",e,!1),()=>{n?.(),document.removeEventListener("fullscreenchange",e,!1),document.removeEventListener("webkitfullscreenchange",e,!1),document.removeEventListener("mozfullscreenchange",e,!1)}},[]),e};function l(){return void 0!==document.fullscreenElement?"fullscreenElement":void 0!==document.mozFullScreenElement?"mozFullScreenElement":void 0!==document.webkitFullscreenElement?"webkitFullscreenElement":""}function c(){const e=l();return Boolean(e&&document[e])}},91930(e,t,n){n.d(t,{A:()=>P});var o=n(84051),i=n(31481),s=n(90709),a=n(3544),r=n(70636),d=n(87357),l=n(17663),c=n(48899),u=n(48775),h=n(76023),m=n(4961),p=n(18501),g=n(35749),f=n(2338),v=n(5912),A=n(39351),y=n(62587),C=n(59030),w=n(64154),I=n(42452),b=n(18276),S=n(27860),M=n(18653),N=n(86070),k=n(20021);const Y=" ";function F({thumbDataUri:e,blobUrl:t,isFullVideo:n,isRoundVideo:o,isProtected:i,isSpoiler:s,pictogramActionIcon:a,onPictogramClick:r}){const{width:l,height:c}=(0,h.mr)(),u=t||e,m=n&&t;return(0,k.FD)("div",{className:(0,d.A)("embedded-thumb",o&&"round",a&&"with-action-icon"),onClick:r,children:[!s&&!m&&(0,k.Y)("img",{src:u,width:l,height:c,alt:"",className:"pictogram",draggable:!1}),!s&&m&&(0,k.Y)("video",{src:t,width:l,height:c,playsInline:!0,disablePictureInPicture:!0,className:"pictogram"}),(0,k.Y)(S.A,{thumbDataUri:m?e:u,isVisible:Boolean(s),width:l,height:c}),i&&(0,k.Y)("span",{className:"protector"}),a&&(0,k.Y)(b.A,{name:a,className:"pictogram-action-icon"})]})}const P=({className:e,message:t,replyInfo:n,suggestedPostInfo:h,sender:S,senderChat:P,forwardSender:T,composerForwardSenders:D,title:x,customText:L,isProtected:E,isInComposer:B,noUserColors:R,chatTranslations:O,requestedChatTranslationLanguage:U,isMediaNsfw:K,noCaptions:z,pictogramActionIcon:V,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,onClick:G,onPictogramClick:q})=>{const $=(0,o.li)(),H=(0,v.Vz)($,j),W=(0,o.Kr)(()=>{const e="message"===n?.type&&n.replyMedia||t?.content;if(e)return{content:e}},[t,n]),_=W?.content?.video?.isGif?W.content.video:void 0,Q=Boolean(_&&!_.previewPhotoSizes?.length),Z=(0,g.A)(W,Q?"full":"pictogram"),X=(0,y.A)(Z,!H),ee=(0,f.A)(W),te=Boolean(W&&(0,s.lk)(W)),ne=Boolean(W&&(0,s.y2)(W))||K,oe=Boolean("message"===n?.type&&n.isQuote),ie="message"===n?.type?n.replyFrom:void 0,se=t&&(0,s.ZR)(t),{translatedText:ae}=(0,w.A)(O,t?.chatId,se?t?.id:void 0,U),re=(0,C.A)(),de=(0,A.A)(),le=S?(0,r.F9)(re,S):ie?.hiddenUserName||t?.forwardInfo?.hiddenUserName,ce=(0,o.Kr)(()=>{if(!D)return;const e=D.map(e=>(0,r.F9)(de,e)).filter(Boolean);return de.conjunction(e)},[D,de]),ue=P?(0,r.F9)(re,P):void 0,he=T?(0,r.F9)(re,T):t?.forwardInfo?.hiddenUserName,me=S&&S.id===T?.id;return(0,k.FD)(N.A,{peer:S,emojiIconClassName:"EmbeddedMessage--background-icons",ref:$,shouldReset:!0,isReply:Boolean(n),noUserColors:R,className:(0,d.A)("EmbeddedMessage",e,oe&&"is-quote",ee&&"with-thumb","no-selection",D&&"is-input-forward",h&&"is-suggested-post"),dir:de.isRtl?"rtl":void 0,onClick:G,children:[(0,k.Y)("div",{className:"hover-effect"}),(0,k.Y)(I.A,{}),ee&&F({thumbDataUri:ee,blobUrl:X,isFullVideo:Q,isRoundVideo:te,isProtected:E,isSpoiler:ne,pictogramActionIcon:V,onPictogramClick:q}),(0,k.FD)("div",{className:"message-text",children:[(0,k.Y)("p",{className:(0,d.A)("embedded-text-wrapper",oe&&"multiline"),children:function(){if(h){if(!h?.price?.amount&&!h.scheduleDate)return de("ComposerEmbeddedMessageSuggestedPostDescription");const e=h.price?h.price.currency===i.ykW?(0,u.Ms)(de,h.price.amount,{className:"suggested-price-ton-icon",shouldConvertFromNanos:!0}):(0,u.U2)(de,h.price.amount,{className:"suggested-price-star-icon"}):"",t=h.scheduleDate?(0,l.e0)(h.scheduleDate,de,re):"";return e&&!t?(0,k.Y)("span",{className:"suggested-post-price-wrapper",children:de("TitleSuggestedPostAmountForAnyTime",{amount:e},{withNodes:!0,withMarkdown:!0})}):(0,k.FD)("span",{className:"suggested-post-price-wrapper",children:[e,t?` ${t}`:""]})}return"message"===n?.type&&n.quoteText?(0,p.fd)({text:n.quoteText.text,entities:n.quoteText.entities,asPreview:!0,emojiSize:17}):t?z?de("EmbeddedMessageNoCaption"):(0,k.Y)(M.A,{message:t,noEmoji:Boolean(ee),forcedText:ae,observeIntersectionForLoading:j,observeIntersectionForPlaying:J,emojiSize:17}):L||function(e){if(!e||e.content.text)return Y;const t=(0,a.GG)(de,e.content,{});return t?(0,k.Y)("span",{children:(0,m.A)(t)}):Y}(W)||Y}()}),(0,k.FD)("div",{className:"message-title",children:[function(){if(x)return(0,m.A)(x);if(h&&n)return de("TitleSuggestedChanges");if(h)return de("ComposerEmbeddedMessageSuggestedPostTitle");if(!le&&!ce)return Y;let e;P&&((0,s.WX)(P)&&(e="channel-filled"),(0,s.YE)(P)&&(e="group-filled"));const t=B&&Boolean(n&&"quoteText"in n&&n?.quoteText);return(0,k.FD)("span",{className:"embedded-sender-wrapper",children:[(!P||!!(0,c.L8)(P?.id)||P.id!==S?.id)&&(0,k.FD)("span",{className:"embedded-sender",children:[!D&&le&&(0,m.A)(t?re("ReplyToQuote",le):le),ce&&(0,m.A)(de("ComposerTitleForwardFrom",{users:ce},{withNodes:!0,withMarkdown:!0}))]}),e&&(0,k.Y)(b.A,{name:e,className:"embedded-chat-icon"}),e&&ue&&(0,k.Y)("span",{className:"embedded-sender-chat",children:(0,m.A)(ue)})]})}(),he&&!me&&(0,k.FD)("span",{className:"embedded-forward-sender-wrapper",children:[(0,k.Y)(b.A,{name:T?"share-filled":"forward",className:"embedded-origin-icon"}),(0,k.Y)("span",{className:"forward-sender-title",children:(0,m.A)(he)})]})]})]})]})}},92111(e,t,n){n.d(t,{A:()=>v});var o=n(84051),i=n(13439),s=n(23174),a=n(90709),r=n(11597),d=n(39761),l=n(87679),c=n(58554),u=n(95704),h=n(37836),m=n(46051),p=n(66991);const g={},f=(0,h.v7)(1e3),v=function(e,t){(0,o.vJ)(()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach(e=>{const n=t||(0,i.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await f,e.forEach(({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,u.h)((0,c.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):c.hd(e,t).then(e=>{e&&(t===s.qZ.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout(()=>{(0,d.A)(n),t.removeChild(n)},1e3)}(e),t===s.qZ.BlobUrl&&(0,l.NN)(e))})})})(function(e,t){const n=(0,r._bp)((0,i.mS)(),e);if(!n||!n.orderedIds?.length)return[];const o=function(e,t){const n=e.indexOf(t),o=Math.max(n-5,0),i=Math.min(n+5,e.length);return e.slice(o,i)}(n.orderedIds,t),d=[];return o.forEach(t=>{if(g[e]?.has(t))return;const o=n.byId[t];if(!o||!("content"in o))return;const i=Boolean(o.content.video);d.push({hash:(0,a.EN)(o,"full"),format:i?s.qZ.Progressive:s.qZ.BlobUrl,isStream:i&&(0,p.c)(m.G)}),d.push({hash:(0,a.EN)(o),format:s.qZ.BlobUrl}),o.content.video?.altVideos&&d.push({hash:(0,a.EN)(o,"full",!0),format:s.qZ.Progressive}),g[e]=(g[e]||new Set).add(t)}),d}(e,n))})},[t,e])}},93809(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(30857),s=n(35297);function a(e,t){const n=void 0===t,a=(0,o.li)(n),r=(0,o.li)(),d=(0,i.A)();return(0,s.A)(()=>{n||(a.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))},e),(0,o.vJ)(()=>{if(n||a.current)return;const e=()=>{a.current=!0,d()};t>0?r.current=window.setTimeout(e,t):e()},e),a.current}},95362(e,t,n){n.d(t,{A:()=>a});var o=n(37836);let i=[],s=!1;function a(e,t){i.push({url:e,filename:t}),s||(s=!0,setTimeout(async()=>{await async function(){let e=0;for(const t of i)r(t),e++,10===e&&(await(0,o.v7)(1e3),e=0);i=[]}(),s=!1},1e3))}function r({url:e,filename:t}){const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.download=t;try{n.click()}catch(e){console.error(e)}}},95704(e,t,n){n.d(t,{h:()=>d});var o=n(23174),i=n(4875);const s=new Map,a=new Map,r=new Map;async function*d(e,t=0,n=262144){const d=e.match(/fileSize=(\d+)/);let l;for(l=d?d&&Number(d[1]):a.get(e);;){if(l&&t>=l)return;let d=t+n-1;l&&d>l&&(d=l-1);const c=`${e}:${t}-${d}`;let u=s.get(c);if(!u){let n=r.get(c);n||(n=(0,i.px)("downloadMedia",{mediaFormat:o.qZ.Progressive,url:e,start:t,end:d}),r.set(c,n));const h=await n.finally(()=>{r.delete(c)});if(!h?.arrayBuffer)return;h.fullSize&&!l&&(l=h.fullSize,a.set(e,h.fullSize)),u=h.arrayBuffer,d<=5242879&&s.set(c,h.arrayBuffer)}yield u,t=d+1}}},97046(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"MuteChatModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},97676(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(87357),s=n(37661),a=n(5912),r=n(17712),d=n(62587),l=n(10221),c=n(18104),u=n(3325);var h=n(20021);const m=(0,o.ph)(({messageId:e,isMirrored:t,effect:n,shouldPlay:m,observeIntersectionForLoading:p,observeIntersectionForPlaying:g,onStop:f})=>{const v=(0,o.li)(),A=(0,o.li)(),y=(0,a.Vz)(v,p),C=(0,a.Vz)(v,g),[w,I,b]=(0,s.A)(),[S,M,N]=(0,s.A)(),k=function(e){return e.effectAnimationId?`sticker${e.effectAnimationId}`:`sticker${e.effectStickerId}?size=f`}(n),Y=(0,d.A)(k,!y),F=(0,r.A)(()=>{b(),f?.()}),P=(0,l.A)({anchorRef:v,overlayRef:A,isMirrored:t,isDisabled:!w,isForMessageEffect:!0,id:n.id});(0,o.vJ)(()=>{S&&P(),N()},[P,N,S]),(0,o.vJ)(()=>{C&&m&&Y&&(I(),M())},[C,Y,m,P]);const T=(0,i.A)("McmbiWZE",t&&"wNvU2uqi");return(0,h.Y)("div",{className:(0,i.A)("IYu2f7FM",t&&"GsTZawTE"),ref:v,children:w&&(0,h.Y)(u.A,{children:(0,h.Y)(c.A,{ref:A,className:T,tgsUrl:Y,size:256,play:!0,isLowPriority:!0,noLoop:!0,forceAlways:!0,onEnded:F},`effect-${e??n.id}`)})})})},97967(e,t,n){n.d(t,{A:()=>a});var o=n(80089),i=n(80464),s=n(20021);const a=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"ChatFolderModal",!t);return n?(0,s.Y)(n,{...e}):void 0}},98021(e,t,n){n.d(t,{E6:()=>o,FQ:()=>i});const o={"🗂":"folder-tabs-folder","":"folder-tabs-star","🤖":"folder-tabs-bot","👥":"folder-tabs-group","👤":"folder-tabs-user","":"folder-tabs-chat","📢":"folder-tabs-channel","💬":"folder-tabs-chats"},i=e=>o[e]}}]);
//# sourceMappingURL=5378.21b180b9124b1f5ff3e9.js.map