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

2 lines
71 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[4995],{10187:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),a=n(13439),i=n(70636),s=n(29807),c=n(87357),r=n(35049),l=n(59030),d=n(21849),u=n(34431),h=n(18276);var m=n(20021);const p=(0,o.ph)((0,a.EK)(((e,{peerId:t,forceShowSelf:n})=>{if(!t)return{};const o=(0,s.PVB)(e,t),a=(0,s.mBe)(e,t);return{peer:o,isSavedMessages:!n&&a&&a.isSelf}}))((({icon:e,title:t,isMinimized:n,canClose:o,isCloseNonDestructive:a,clickArg:s,peer:p,mockPeer:g,customPeer:f,className:A,isSavedMessages:v,withPeerColors:C,withEmojiStatus:y,onClick:S,itemClassName:I})=>{const R=(0,l.A)(),w=g||p,N=f||w,b=w&&(0,i.vj)(w)?w:void 0;let M,x,k;e&&t?(M=(0,m.Y)("div",{className:"NtoGLT22",children:(0,m.Y)(h.A,{name:e,style:"f91Ad80i"})}),x=t):N&&(M=(0,m.Y)(d.A,{className:"La8BQ9yr",peer:N,size:"small",isSavedMessages:v}),k=(0,i.F9)(R,N)||t,x=t||(0,m.Y)(u.A,{peer:N,isSavedMessages:v,withEmojiStatus:y}));const Y=(0,c.A)("_Lq6_4e5",(b?.isForum||f?.isAvatarSquare)&&"JIHfTUVn",n&&"UhOZvxvs",o&&"uvvgSFUJ",a&&"fAk5yEeV",!S&&"P8r3OoaX",C&&(0,r.y)(f||p),A);return(0,m.FD)("div",{className:Y,onClick:()=>S?.(s),title:n?k:void 0,dir:R.isRtl?"rtl":void 0,children:[M,!n&&(0,m.Y)("div",{className:(0,c.A)("XPVuH29G",I),dir:"auto",children:x}),o&&(0,m.Y)("div",{className:"xVPG2UTy",children:(0,m.Y)(h.A,{name:"close"})})]})})))},11241:(e,t,n)=>{n.d(t,{A:()=>N});var o=n(84051),a=n(13439),i=n(90709),s=n(29807),c=n(87357),r=n(43336),l=n(76023),d=n(37661),u=n(5912),h=n(17712),m=n(62587),p=n(50680),g=n(47483),f=n(18104),A=n(87412),v=n(83594),C=n(17794),y=n(93879),S=n(20021);const I=1.5*l.$,R=6.5*l.$,w=l.$,N=(0,o.ph)((0,a.EK)(((e,{containerId:t})=>{const{genericEmojiEffects:n,reactions:o}=e,{activeReactions:a}=(0,s.nTw)(e),i=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:a?.[t],availableReactions:o.availableReactions,genericEffects:n,withEffects:i}}))((({containerId:e,reaction:t,className:n,size:s=I,effectSize:l=R,activeReactions:N,availableReactions:b,genericEffects:M,withEffects:x,withEffectOnly:k,shouldPause:Y,shouldLoop:P,loopLimit:T,observeIntersection:D})=>{const{stopActiveReaction:F}=(0,a.ko)(),E=(0,o.li)(),L="custom"===t.type,B=(0,o.Kr)((()=>b?.find((e=>(0,i.a0)(e.reaction,t)))),[b,t]),O=B?.centerIcon?.id,{customEmoji:K}=(0,g.A)(L?t.documentId:void 0),_=(0,o.Kr)((()=>{if(!L)return B?.aroundAnimation?.id;if(!K)return;const e=b?.find((e=>e.reaction.emoticon===K.emoji))?.aroundAnimation?.id;return e}),[B,b,K,L]),U=(0,o.Kr)((()=>{if(_)return _;if(!M?.stickers)return;const{stickers:e}=M;return e[Math.floor(Math.random()*e.length)].id}),[_,M]),$=(0,u.Vz)(E,D),j=O&&(0,i.aL)(O),z=U&&(0,i.aL)(U),J=(0,m.A)(j),H=(0,m.A)(z),q=(0,o.Kr)((()=>N?.find((e=>(0,i.a0)(e,t)))),[N,t]),G=Boolean(x&&q&&(L||J)&&H),V=$&&(G&&!k||P),{shouldRender:W,transitionClassNames:Z}=(0,p.A)(G,void 0,!0,"slow"),{shouldRender:X,transitionClassNames:Q}=(0,p.A)(V,void 0,!0,"slow"),ee=(0,h.A)((()=>{F({containerId:e,reaction:t})})),[te,ne,oe]=(0,d.A)(),ae=!(L||V&&te),{shouldRender:ie,transitionClassNames:se}=(0,p.A)(ae,void 0,!0),ce=(0,c.A)(y.A.root,W&&y.A.animating,k&&y.A.withEffectOnly,n);return(0,S.FD)("div",{className:ce,ref:E,children:[!k&&ie&&(0,S.Y)(C.A,{className:se,reaction:t,availableReactions:b,size:s,observeIntersection:D}),!k&&L&&(0,S.Y)(A.A,{documentId:t.documentId,className:y.A.customEmoji,size:s,noPlay:Y,noVideoOnMobile:!0,loopLimit:T,observeIntersectionForPlaying:D,forceAlways:!0}),X&&!L&&(0,S.Y)(f.A,{className:(0,c.A)(y.A.animatedIcon,Q),size:(0,r.Ki)(1.9*s),tgsUrl:J,play:$&&!Y,noLoop:!P,onLoad:ne,onEnded:oe,forceAlways:!0},`${O}-${s}`),W&&(0,S.FD)(S.FK,{children:[(0,S.Y)(f.A,{className:(0,c.A)(y.A.effect,Z),size:l,tgsUrl:H,play:$,noLoop:!0,onEnded:ee,forceAlways:!0},`${U}-${l}`),L&&!_&&$&&(0,S.Y)(v.A,{reaction:t,className:Z,particleSize:Math.max(.5*s,w),onEnded:ee})]})]})})))},14622:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),a=n(13439),i=n(81954),s=n(17712),c=n(93545),r=n(672);const l=function(e,t=!1){const{focusLastMessage:n}=(0,a.ko)(),l=(0,o.li)(0),d=(0,s.A)((e=>{const t=l.current,a=e.contentRect.height;if(l.current=a,(0,i.o8)()||!t||a<=t)return;const s=e.target.closest(".MessageList");if(!s)return;(0,o.VK)(400);const c=a-t,{offsetHeight:r,scrollHeight:d,scrollTop:u}=s;Math.round(d-u-r)-c<=5&&n()})),u=(0,r.A)(d,[d],300,!1);(0,c.A)(e,u,!t)}},14737:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051),a=n(17712);const i=function(e,t){const n=(0,a.A)(e);(0,o.vJ)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n()),t);return()=>clearTimeout(e)}),[t])}},15535:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(84051),a=n(31481),i=n(66644),s=n(96454),c=n(87357),r=n(83868),l=n(14737),d=n(43874),u=n(59030),h=n(64493),m=n(18276),p=n(20021);const g=(0,o.ph)((({isLoading:e=!1,isPasswordVisible:t,error:n,hint:g,placeholder:f="Password",submitLabel:A="Next",description:v,shouldShowSubmit:C,shouldResetValue:y,shouldDisablePasswordManager:S=!1,noRipple:I=!1,clearError:R,onChangePasswordVisibility:w,onInputChange:N,onSubmit:b})=>{const M=(0,o.li)(),x=(0,u.A)(),{isMobile:k}=(0,d.Ay)(),[Y,P]=(0,o.J0)(""),[T,D]=(0,o.J0)(!1),F=k?550:400;return(0,o.vJ)((()=>{y&&P("")}),[y]),(0,l.A)((()=>{s.TF||M.current.focus()}),F),(0,o.vJ)((()=>{n&&(0,i.RK)((()=>{M.current.focus(),M.current.select()}))}),[n]),(0,p.FD)("form",{action:"",onSubmit:b?function(t){t.preventDefault(),e||T&&b(Y)}:r.A,autoComplete:"off",children:[(0,p.FD)("div",{className:(0,c.A)("input-group password-input",Y&&"touched",n&&"error"),dir:x.isRtl?"rtl":void 0,children:[S&&(0,p.Y)("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),(0,p.Y)("input",{ref:M,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:Y||"",autoComplete:S?"one-time-code":"current-password",onChange:function(e){n&&R();const{target:t}=e;P(t.value),D(t.value.length>=a.AGC),N&&N(t.value)},maxLength:256,dir:"auto"}),(0,p.Y)("label",{children:n||g||f}),(0,p.Y)("div",{className:"div-button toggle-password",onClick:function(){w(!t)},role:"button",tabIndex:0,title:"Toggle password visibility","aria-label":"Toggle password visibility",children:(0,p.Y)(m.A,{name:t?"eye":"eye-crossed"})})]}),v&&(0,p.Y)("p",{className:"description",children:v}),b&&(T||C)&&(0,p.Y)(h.A,{size:"smaller",type:"submit",ripple:!I,isLoading:e,disabled:!T,children:A})]})}))},16460:(e,t,n)=>{function o(e,t){let n=0,o=0,a=e;for(;a&&a!==t&&!a.contains(t);)n+=a.offsetTop,o+=a.offsetLeft,a=a.offsetParent;return{top:n,left:o}}n.d(t,{A:()=>o})},17794:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),a=n(90709),i=n(87357),s=n(62587),c=n(83057),r=n(87412),l=n(18276),d=n(61911),u=n(20021);const h=(0,o.ph)((({reaction:e,availableReactions:t,className:n,size:h,withIconHeart:m,observeIntersection:p})=>{const g=(0,o.Kr)((()=>t?.find((t=>(0,a.a0)(t.reaction,e)))),[t,e]),f=g?.staticIcon?.id,A=f?`document${f}`:void 0,v=(0,s.A)(A),C=(0,c.A)(v),y="emoji"===e.type&&"🦄"===e.emoticon,S=m&&"emoji"===e.type&&"❤"===e.emoticon;return"custom"===e.type?(0,u.Y)(r.A,{documentId:e.documentId,className:(0,i.A)("ReactionStaticEmoji",n),size:h,observeIntersectionForPlaying:p}):S?(0,u.Y)(l.A,{name:"heart",className:"ReactionStaticEmoji",style:`font-size: ${h}px; width: ${h}px`}):(0,u.Y)("img",{className:(0,i.A)("ReactionStaticEmoji",y&&"with-unicorn-fix",C,n),style:h?`width: ${h}px; height: ${h}px`:void 0,src:v||d,alt:g?.title,draggable:!1})}))},20333:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),a=n(87357),i=n(95807),s=n(59030),c=n(93545),r=n(18276);const l="_b5HgBXr",d="P6mch4bB";var u=n(20021);const h=(0,o.ph)((({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:h,progress:m,isPrimary:p,className:g})=>{const f=(0,s.A)(),A=(0,o.li)(),v=(0,o.li)(),[C,y]=(0,o.J0)(0),[S,I]=(0,o.J0)(0),R=()=>{if(A.current&&v.current&&void 0!==m){const e=A.current.offsetWidth,t=v.current.offsetWidth,n=e/2,o=t-e/2,a=m*t,i=Math.max(n,Math.min(a,o));let s;y(i/t),s=a<n?m*t/(2*n):a>o?.5+(m-o/t)/(1-o/t)*.4:.5,I(s)}};(0,o.vJ)(R,[m]),(0,c.A)(v,R);const w=Boolean(h||n),N=Boolean(m)&&m>.99;return(0,u.FD)("div",{ref:v,className:(0,a.A)("nY2ggBsF",w&&"RYtVQAjM",p&&"Zi0w7QJ3",g),style:(0,i.A)(void 0!==m&&`--progress: ${m}`,void 0!==S&&`--tail-position: ${S}`,`--shift-x: ${C}`),children:[w&&(0,u.Y)("div",{className:"dhigNjAq",children:(0,u.FD)("div",{className:"cOpfCGPh",children:[(0,u.FD)("div",{className:"uNwBLNOy",ref:A,children:[h&&(0,u.Y)(r.A,{name:h,className:"MJ7MTmxi"}),n&&(0,u.Y)("div",{className:"MwzZt3Qo",dir:f.isRtl?"rtl":void 0,children:n})]}),(0,u.Y)("div",{className:"qRwO7SZm",children:(0,u.Y)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:(0,u.Y)("path",{d:"m 28,4 v 9 c 0.0089,7.283278 -3.302215,5.319646 -6.750951,8.589815 l -5.8284,5.82843 c -0.781,0.78105 -2.0474,0.78104 -2.8284,0 L 6.7638083,21.589815 C 2.8288652,17.959047 0.04527024,20.332086 0,13 V 4 C 0,4 0.00150581,0.97697493 3,1 5.3786658,1.018266 22.594519,0.9142007 25,1 c 2.992326,0.1067311 3,3 3,3 z",fill:"#7E85FF"})})})]})}),(0,u.Y)("div",{className:l,children:(0,u.Y)("span",{children:e})}),(0,u.Y)("div",{className:d,children:(0,u.Y)("span",{children:t})}),(0,u.FD)("div",{className:(0,a.A)("sZZV0yoe",N&&"m8ie8IxL"),children:[(0,u.Y)("div",{className:l,children:(0,u.Y)("span",{children:e})}),(0,u.Y)("div",{className:d,children:(0,u.Y)("span",{children:t})})]})]})}))},24531:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),a=n(31481),i=n(17663),s=n(80140),c=n(17712),r=n(59030),l=n(80089),d=n(80464),u=n(20021);const h=e=>{const{isOpen:t}=e,n=(0,d.A)(l.ar.Extra,"CalendarModal",!t);return n?(0,u.Y)(n,{...e}):void 0},m=(e,t,n)=>{const l=(0,r.A)(),[d,m]=(0,o.J0)(),p=(0,c.A)(((e,t=!1)=>{const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,s.SF)());d?.(n),m(void 0)})),g=(0,c.A)((()=>{p(new Date(1e3*a.NkL),!0)})),f=(0,c.A)((()=>{m(void 0),t?.()})),A=(0,c.A)((e=>{m((()=>e))})),v=n?new Date(1e3*n):new Date;v.setSeconds(0),v.setMilliseconds(0);const C=new Date;return C.setFullYear(C.getFullYear()+1),[A,(0,u.Y)(h,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:v.getTime(),maxAt:(0,i.CS)(C),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:f,onSubmit:p,onSecondButtonClick:e?g:void 0})]}},26875:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),a=n(87357),i=n(59030),s=n(21849);var c=n(20021);const r=(0,o.ph)((({peers:e,size:t,className:n,limit:r=3,badgeText:l})=>{const d=(0,i.A)(),u="number"==typeof t?t:s.R[t],h=(0,o.Kr)((()=>l||(!e?.length||e.length<=r?void 0:"+"+(e.length-r))),[l,e,r]);return(0,c.FD)("div",{className:(0,a.A)(n,"kXs18Nmi"),style:`--_size: ${u}px;`,dir:d.isRtl?"rtl":"ltr",children:[e?.slice(0,r).map((e=>(0,c.Y)(s.A,{size:t,peer:e,className:"XND8fhC1"}))),h&&(0,c.Y)("div",{className:"SHyAyGFO",children:h})]})}))},27860:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),a=n(66644),i=n(87357),s=n(45470),c=n(17712),r=n(50680);var l=n(20021);const d=(0,o.ph)((({isVisible:e,withAnimation:t,thumbDataUri:n,className:d,width:u,height:h})=>{const m=(0,o.li)(),{shouldRender:p,transitionClassNames:g}=(0,r.A)(e,void 0,!0,!t&&void 0,void 0,500),f=(0,s.A)(n,!p,void 0,25,u,h),A=(0,c.A)((e=>{if(!m.current)return;const t=m.current,n=e.currentTarget.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,s=o-n.width/2,c=i-n.height/2;(0,a.RK)((()=>{t.setAttribute("style",`--click-shift-x: ${s}px; --click-shift-y: ${c}px`)}))}));if(p)return(0,l.FD)("div",{className:(0,i.A)("qF2WgYVg",g,d,t&&"pNM3cgkY"),ref:m,onClick:t?A:void 0,children:[(0,l.Y)("canvas",{ref:f,className:"eULqS2yR",width:u,height:h}),(0,l.Y)("div",{className:"XBor45hE"})]})}))},29886:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051);function a(e){const t=(0,o.li)(),n=(0,o.li)();return n.current!==e&&(t.current=n.current),n.current=e,t.current}},31722:(e,t,n)=>{n.d(t,{A:()=>o});const o={container:"YmM5biTv",header:"S7WFT2bv",pickerCategoryTitle:"YK1300x2",peerChip:"gsKPBPoK",pickerList:"yLCbiItq",padded:"bXzIGw8s",noResults:"dXWKD0ve",onlineStatus:"d5GDOYh9"}},36838:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051);const a=(e,t,n=!1)=>{(0,o.vJ)((()=>{if(t)return;const o=e.current;function a(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",a,{passive:!n}),()=>{o.removeEventListener("wheel",a)}}),[e,t,n])}},40558:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),a=n(66644),i=n(90709),s=n(87357),c=n(95807),r=n(87679),l=n(17712),d=n(62587),u=n(93545),h=n(38691);var m=n(20021);const p=(0,o.ph)((({backgroundColors:e,patternColor:t,patternIcon:n,clearBottomSector:p,className:g})=>{const f=(0,o.li)(),A=(0,o.li)(),[v,C]=(0,o.Ul)({width:0,height:0}),y=(0,h.A)(),[S,I]=(0,o.J0)(),R=n&&(0,i.Mw)(n,"preview"),w=(0,d.A)(R);(0,o.vJ)((()=>{w&&(0,r.NN)(w).then(I)}),[w]);const N=(0,o.Kr)((()=>{const e=[];for(let t=1;t<=3;t++){const n=Math.floor(8*(1+.5*(t-1))),o=t/3,a=.05+(.4-.05)*o,i=t%2==0?Math.PI/n:0;for(let t=0;t<n;t++){const s=t/n*Math.PI*2+i;if(p&&s>.45*Math.PI&&s<.55*Math.PI)continue;const c=.5+1.71*a*Math.cos(s),r=.5+a*Math.sin(s),l=1.4-o*Math.random();e.push({x:c,y:r,sizeFactor:l})}}return e}),[p]);(0,u.A)(f,(e=>{C({width:e.contentRect.width,height:e.contentRect.height})})),(0,o.vJ)((()=>{const e=f.current;e&&C({width:e.clientWidth,height:e.clientHeight})}),[C]);const b=(0,l.A)((()=>{const e=A.current;if(!e||!S)return;const n=e.getContext("2d"),{width:o,height:a}=e;if(!o||!a)return;n.save(),N.forEach((({x:e,y:t,sizeFactor:i})=>{const s=(o-Math.max(o,250*y))/2,c=e*Math.max(o,250*y)+s,r=t*Math.max(a,250*y)+s,l=20*y*i*(s?.8:1);n.drawImage(S,c-l/2,r-l/2,l,l)})),n.restore(),t&&(n.save(),n.fillStyle=t,n.globalCompositeOperation="source-atop",n.fillRect(0,0,o,a),n.restore());const i=n.createRadialGradient(o/2,a/2,0,o/2,a/2,o/2);i.addColorStop(0,"#FFFFFF77"),i.addColorStop(1,"#FFFFFF"),n.save(),n.globalCompositeOperation="destination-out",n.fillStyle=i,n.fillRect(0,0,o,a),n.restore()}));return(0,o.vJ)((()=>{b()}),[S]),(0,o.vJ)((()=>{const{width:e,height:t}=v(),n=A.current;if(!e||!t)return;const o=Math.max(e,t);(0,a.RK)((()=>{n.width=o*y,n.height=o*y,b()}))}),[v,y]),(0,m.Y)("div",{ref:f,className:(0,s.A)("Af3tYFMg",g),style:(0,c.A)(`--_bg-1: ${e[0]}`,`--_bg-2: ${e[1]||e[0]}`),children:(0,m.Y)("canvas",{className:"GbpiDSS_",ref:A})})}))},41512:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(43503);function a(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=o.A.get();return t.top<=n&&t.top+t.height>=0}},43581:(e,t,n)=>{n.d(t,{A:()=>$});var o=n(84051),a=n(13439),i=n(90709),s=n(29807),c=n(87357),r=n(60343),l=n(15283),d=n(17712),u=n(59030),h=n(14242),m=n(76023),p=n(63527),g=n(10722),f=n(82117),A=n(39351),v=n(29886),C=n(21511),y=n(68292),S=n(26875),I=n(96454),R=n(78376),w=n(5912),N=n(4438),b=n(9267),M=n(93879),x=n(20021);const k=1.5*m.$,Y=6.5*m.$,P=I.pz||I.Ni?2:5,T=I.pz||I.Ni?2:3,D=(0,o.ph)((0,a.EK)(((e,{containerId:t})=>{const{activeReactions:n}=(0,s.nTw)(e),o=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:n?.[t],withEffects:o}}))((({containerId:e,reaction:t,className:n,size:s=k,effectSize:r=Y,activeReactions:l,localAmount:u,withEffects:h,observeIntersection:m})=>{const{stopActiveReaction:p}=(0,a.ko)(),g=(0,o.li)(),A=(0,o.li)(),[v,y]=(0,o.J0)([]),S=(0,w.Vz)(g,m),I=(0,o.Kr)((()=>l?.find((e=>(0,i.a0)(e,t)))),[l,t]),D=Boolean(h&&I),F=v.length<P;(0,f.A)((([e])=>{D?!u||u<=(e||0)||F&&y((e=>[...e,Date.now()])):y([])}),[u,F,D]);const{shouldRender:E}=(0,C.A)({ref:A,noMountTransition:!0,isOpen:D,className:"slow",withShouldRender:!0}),L=(0,d.A)((()=>{const n=v.slice(1);y(n),n.length||p({containerId:e,reaction:t})})),B=(0,c.A)(M.A.root,E&&M.A.animating,n);return(0,x.FD)("div",{className:B,ref:g,teactFastList:!0,children:[(0,x.Y)(b.A,{type:"gold",size:"adaptive",style:`width: ${s}px; height: ${s}px`},"icon"),E&&v.map((e=>(0,x.Y)(N.A,{ref:A,className:M.A.effect,size:r,tgsUrl:R.w.StarReactionEffect,play:S,noLoop:!0,forceAlways:!0,nonInteractive:!0,quality:T,onEnded:L},e)))]})})));var F=n(11241),E=n(85118),L=n(64493),B=n(69988);const O=1.25*m.$;function K(e){return e.stars}const _=(0,o.ph)((({reaction:e,containerId:t,isOwnMessage:n,recentReactors:s,className:r,chosenClassName:l,chatId:u,messageId:m,isOutside:I,observeIntersection:R,onClick:w,onPaidClick:N})=>{const{openStarsBalanceModal:b,resetLocalPaidReactions:M,openPaidReactionModal:k,requestWave:Y}=(0,a.ko)(),P=(0,o.li)(),T=(0,o.li)(),_=(0,o.li)(),U=(0,A.A)(),$="paid"===e.reaction.type,j=(0,p.A)(K),z=Boolean(j),J=(0,d.A)(((e=1)=>{N?.(e)})),H=(0,d.A)((t=>{if("paid"===e.reaction.type)return t.stopPropagation(),void J();w?.(e.reaction)})),{isContextMenuOpen:q,handleBeforeContextMenu:G,handleContextMenu:V,handleContextMenuClose:W,handleContextMenuHide:Z}=(0,g.A)(P,"paid"!==e.reaction.type,void 0,void 0,void 0,!0);(0,o.vJ)((()=>{q&&(k({chatId:u,messageId:m}),W(),Z())}),[W,Z,q,u,m]),(0,f.A)((([t])=>{const n=e.localAmount,o=P.current;if(!n||!o||n===t?.localAmount)return;if(z&&n>j.balance.amount)return b({originReaction:{chatId:u,messageId:m,amount:n}}),void M({chatId:u,messageId:m});if(e.localAmount){const{left:e,top:t}=o.getBoundingClientRect(),n=e+o.offsetWidth/2,a=t+o.offsetHeight/2;Y({startX:n,startY:a})}const a=Number(getComputedStyle(o).scale)||1;_.current?.cancel(),_.current=o.animate([{scale:a},{scale:Math.min(1.2*a,3),offset:.2},{scale:1}],{duration:500*a,easing:"ease-out"})}),[e,j?.balance,z,u,m]);const X=(0,v.A)(e.localAmount),{shouldRender:Q}=(0,C.A)({isOpen:Boolean(e.localAmount),ref:T,className:"slow",withShouldRender:!0});return(0,x.FD)(L.A,{className:(0,c.A)(B.A.root,n&&B.A.own,$&&B.A.paid,I&&B.A.outside,(0,i.eu)(e)&&B.A.chosen,(0,i.eu)(e)&&l,r),size:"tiny",ref:P,onMouseDown:G,onContextMenu:V,onClick:H,children:["paid"===e.reaction.type?(0,x.FD)(x.FK,{children:[(0,x.Y)(E.A,{preset:"button"}),(0,x.Y)(D,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:O,localAmount:e.localAmount,observeIntersection:R}),Q&&(0,x.Y)(y.A,{ref:T,text:`+${(0,h.Vw)(U,e.localAmount||X)}`,className:B.A.paidCounter})]}):(0,x.Y)(F.A,{className:B.A.animatedEmoji,containerId:t,reaction:e.reaction,size:O,observeIntersection:R}),s?.length?(0,x.Y)(S.A,{size:"mini",peers:s}):(0,x.Y)(y.A,{text:(0,h.Vw)(U,e.count+(e.localAmount||0)),className:B.A.counter})]})}));var U=n(92915);const $=(0,o.ph)((({message:e,threadId:t,isOutside:n,maxWidth:h,metaChildren:m,observeIntersection:p,noRecentReactors:g,isCurrentUserPremium:f,tags:A,isAccountFrozen:v})=>{const{toggleReaction:C,addLocalPaidReaction:y,updateMiddleSearch:S,performMiddleSearch:I,openPremiumModal:R,resetLocalPaidReactions:w,showNotification:N,openFrozenAccountModal:b}=(0,a.ko)(),M=(0,u.A)(),{results:k,areTags:Y,recentReactions:P}=e.reactions,T=Boolean(e.areReactionsPossible&&e.reactions),D=(0,o.Kr)((()=>k.reduce(((e,t)=>e+t.count),0)),[k]),F=(0,o.Kr)((()=>{const e=(0,a.mS)();return P?.reduce(((t,n)=>{const{reaction:o,peerId:a}=n,c=(0,i.Jj)(o),r=(0,s.PVB)(e,a);if(!r)return t;const l=t[c]||[];return l.push(r),t[c]=l,t}),{})}),[P]),E=(0,o.Kr)((()=>{const t=(0,r.bj)(e);return k.map((e=>{const n=(0,i.Jj)(e.reaction),o=F?.[n],a=D>3||g,s=Y?A?.[n]:void 0;return{reaction:e,reactionKey:n,messageKey:t,recentReactors:a?void 0:o,isChosen:(0,i.eu)(e),tag:s}}))}),[e,g,F,k,Y,A,D]),L=(0,d.A)((n=>{if(!v)return Y?f?(S({chatId:e.chatId,threadId:t,update:{savedTag:n}}),void I({chatId:e.chatId,threadId:t})):void R({initialSection:"saved_tags"}):void C({chatId:e.chatId,messageId:e.id,reaction:n});b()})),B=(0,o.Kr)((()=>k.find((e=>"paid"===e.reaction.type))?.localAmount||0),[k]),O=(0,d.A)((t=>{v?b():y({chatId:e.chatId,messageId:e.id,count:t})}));(0,o.vJ)((()=>{B&&N({localId:(0,r.bj)(e),title:M("StarsSentTitle"),message:M("StarsSentText",B),actionText:M("StarsSentUndo"),cacheBreaker:B.toString(),action:{action:"resetLocalPaidReactions",payload:{chatId:e.chatId,messageId:e.id}},dismissAction:{action:"sendPaidReaction",payload:{chatId:e.chatId,messageId:e.id}},duration:5e3,shouldShowTimer:!0,disableClickDismiss:!0,icon:"star"})}),[M,e,B]);const K=(0,d.A)((t=>{v?b():C({chatId:e.chatId,messageId:e.id,reaction:t})}));return(0,l.A)((()=>()=>{w({chatId:e.chatId,messageId:e.id})})),(0,x.FD)("div",{className:(0,c.A)("Reactions",n&&"is-outside",T&&"is-service"),style:h?`max-width: ${h}px`:void 0,dir:M.isRtl?"rtl":"ltr",children:[E.map((({reaction:t,recentReactors:o,messageKey:a,reactionKey:i,isChosen:s,tag:c})=>Y?(0,x.Y)(U.A,{className:"message-reaction",chosenClassName:"chosen",containerId:a,isOwnMessage:e.isOutgoing,isChosen:s,reaction:t.reaction,tag:c,withContextMenu:f,onClick:L,onRemove:K,observeIntersection:p},i):(0,x.Y)(_,{chatId:e.chatId,messageId:e.id,className:"message-reaction",chosenClassName:"chosen",containerId:a,isOwnMessage:e.isOutgoing,recentReactors:o,isOutside:n,reaction:t,onClick:L,onPaidClick:O,observeIntersection:p},i))),m]})}))},45470:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),a=n(32587),i=n(66644),s=n(96454),c=n(35297);const r=2,l=2;function d(e,t=!1,n,d=r,u,h){const m=(0,o.li)(),p=(0,o.li)();return(0,c.A)((()=>{t||(p.current=!1)}),[e,t]),(0,o.vJ)((()=>{const o=m.current;if(!e||!o||t||p.current)return;p.current=!0;const c=new Image,r=()=>{const e=u||c.width,t=h||c.height,n=o.getContext("2d",{alpha:!1});(0,i.RK)((()=>{o.width=e,o.height=t,s.QH&&(n.filter=`blur(${d}px)`),n.drawImage(c,2*-d,2*-d,e+4*d,t+4*d),s.QH||(0,a.A)(n,0,0,e,t,d,l)}))};c.onload=()=>{n?(0,i.YS)(r):r()},c.src=e}),[e,t,h,u,d,n]),m}},45780:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(96454),a=n(87357),i=n(17712),s=n(59030),c=n(42452);var r=n(20021);const l=({title:e,subtitle:t,avatarElement:n,inputElement:l,inputPosition:d="start",disabled:u,inactive:h,ripple:m,className:p,titleClassName:g,subtitleClassName:f,style:A,onClick:v,onDisabledClick:C})=>{const y=(0,s.A)(),S=!h&&!u,I=(0,i.A)((()=>{h||(u?C?.():v?.())}));return(0,r.FD)("div",{className:(0,a.A)("OHkx_W75",t&&"neXqB2_A",u&&"tvZeVJPh",S&&"VUSwo4t5",n&&"dMT9byM6",p),onClick:I,style:A,dir:y.isRtl?"rtl":void 0,role:S?"button":void 0,tabIndex:S?0:void 0,children:[!u&&!h&&m&&(0,r.Y)(c.A,{}),Boolean(l)&&(0,r.Y)("div",{className:(0,a.A)("kmjqObdP","end"===d?"iqGhSQGm":"F0Hv3EQm"),children:l}),Boolean(n)&&(0,r.Y)("div",{className:"dnAaRPCo",children:n}),(0,r.Y)("div",{className:(0,a.A)("JSSC0N8V",g),children:e}),Boolean(t)&&(0,r.Y)("div",{className:(0,a.A)("OYmzCSp2",f),children:t}),!l&&o.pz&&(0,r.Y)("div",{className:"P53DrbWA"})]})}},49086:(e,t,n)=>{n.d(t,{C:()=>h,V:()=>u});var o=n(13439),a=n(23174),i=n(90709),s=n(3544),c=n(60343),r=n(58849),l=n(4961),d=n(18501);function u({message:e,highlight:t,emojiSize:n,asPreview:o,truncateLength:a,isProtected:s,forcePlayback:l,shouldRenderAsHtml:u,isForMediaViewer:h,threadId:m,maxTimestamp:p}){const{text:g,entities:f}=e.content.text||{};if(!g){const t=(0,i.P5)(e)?.text;return t?[(0,r.A)(t,a)]:void 0}const A=(0,c.bj)(e);return(0,d.fd)({text:(0,r.A)(g,a),entities:f,highlight:t,emojiSize:n,shouldRenderAsHtml:u,containerId:`${h?"mv-":""}${A}`,asPreview:o,isProtected:s,forcePlayback:l,messageId:"id"in e?e.id:void 0,chatId:e.chatId,threadId:m,maxTimestamp:p})}function h(e,t,n=!1,c,d=s.vs){const{entities:h}=t.content.text||{},m=(0,o.mS)(),p=(0,i.ni)(m,t),g=h?.some((e=>e.type===a.C7.Spoiler)),f=h?.some((e=>e.type===a.C7.CustomEmoji));if(!g&&!f){const o=(0,r.A)((0,s.dS)(e,t,p,n),d);return c?(0,l.A)(o,["emoji","highlight"],{highlight:c}):(0,l.A)(o)}const A=!n&&(0,s.Su)(t),v=A?`${A} `:"",C=u({message:t,highlight:c,asPreview:!0,truncateLength:d}),y=(0,s.oL)(e,t,p,C);return[...(0,l.A)(v),...Array.isArray(y)?y:[y]].filter(Boolean)}},49746:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051),a=n(13439);function i(e,t,n,i,s){const{loadMessage:c}=(0,a.ko)();(0,o.vJ)((()=>{s||t&&!n&&c({chatId:e,messageId:t,replyOriginForId:i})}),[s,e,n,t,i])}},54960:(e,t,n)=>{n.d(t,{A:()=>k});var o=n(84051),a=n(13439),i=n(31481),s=n(66644),c=n(90709),r=n(70636),l=n(29807),d=n(87357),u=n(87894),h=n(79824),m=n(96374),p=n(17712),g=n(59030),f=n(19806),A=n(46222),v=n(40664),C=n(52745),y=n(24956),S=n(21849),I=n(34431),R=n(18276),w=n(10187),N=n(45780),b=n(31722),M=n(20021);const x="PeerPickerItem",k=(0,o.ph)((({className:e,categories:t,itemIds:n,categoryPlaceholderKey:k,filterValue:Y,filterPlaceholder:P,notFoundText:T,searchInputId:D,itemClassName:F,isLoading:E,noScrollRestore:L,isSearchable:B,lockedUnselectedSubtitle:O,forceShowSelf:K,isViewOnly:_,itemInputType:U,withStatus:$,withPeerTypes:j,withPeerUsernames:z,withDefaultPadding:J,onFilterChange:H,onDisabledClick:q,onLoadMore:G,...V})=>{const W=(0,g.A)(),Z=V.allowMultiple,X=Z?V.lockedSelectedIds:void 0,Q=Z?V.lockedUnselectedIds:void 0,ee=(0,o.Kr)((()=>Z?V.selectedCategories:V.selectedCategory?[V.selectedCategory]:h.p),[Z,V.selectedCategory,V.selectedCategories]),te=(0,o.Kr)((()=>Z?V.selectedIds:V.selectedId?[V.selectedId]:h.p),[Z,V.selectedId,V.selectedIds]),ne=(0,o.li)(),oe=te.length>10;(0,o.vJ)((()=>{if(!B)return;const e=window.setTimeout((()=>{(0,s.YS)((()=>{ne.current?.focus()}))}),500);return()=>{window.clearTimeout(e)}}),[B]);const ae=(0,o.Kr)((()=>new Set(X)),[X]),ie=(0,o.Kr)((()=>new Set(Q)),[Q]),se=(0,o.Kr)((()=>te.filter((e=>!ae.has(e)))),[ae,te]),ce=(0,o.Kr)((()=>t?(0,u.dU)(t,"type"):{}),[t]),re=(0,o.Kr)((()=>{if(Y)return n;const e=[],t=[],o=[];return n.forEach((n=>{ae.has(n)?e.push(n):ie.has(n)?o.push(n):t.push(n)})),e.concat(t,o)}),[Y,n,ae,ie]),le=(0,p.A)((e=>{if(ae.has(e))q?.(e,!0);else if(ie.has(e))q?.(e,!1);else{if(Z&&ce[e]){const t=ce[e].type,n=ee?.slice()||[];return n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),void V.onSelectedCategoriesChange?.(n)}if(Z){const t=te.slice();return t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),void V.onSelectedIdsChange?.(t)}ce[e]?V.onSelectedCategoryChange?.(ce[e].type):V.onSelectedIdChange?.(e)}})),de=(0,p.A)((e=>{const{value:t}=e.currentTarget;H?.(t)})),[ue,he]=(0,m.A)(G,re,Boolean(Y)),me=(0,o.hb)(((e,t)=>{const n=(0,a.mS)(),o=t?ce[e]:void 0,s=t?void 0:(0,l.PVB)(n,e),u=s||o;if(!u)return i.Oig?(0,M.FD)("div",{children:["No peer or category with ID",e]},e):void 0;const h=s&&!(0,r.vj)(s)?s.isSelf&&!K:void 0,m=ie.has(e),p=ae.has(e),g=m||p,A=o?ee?.includes(o.type):te.includes(e),[v,C]=function(){if(m)return[O];if(s){if(z){const e=(0,c.Kl)(s);if(e)return[`@${e}`]}if($){if((0,r.vj)(s))return[(0,c.sT)(W,s)];const e=(0,l.K0y)(n,s.id);return[(0,c.CD)(W,s,e),(0,d.A)((0,c.PF)(s,e,!0)&&b.A.onlineStatus)]}if(j){const e=(0,r.cy)(s);return e&&[W(e)]}}}()||[];return(0,M.Y)(N.A,{className:(0,d.A)(x,F),title:(0,M.Y)(I.A,{peer:u}),avatarElement:(0,M.Y)(S.A,{peer:s||o,isSavedMessages:h,size:"medium"}),subtitle:v,subtitleClassName:C,disabled:g,inactive:_,ripple:!0,inputElement:g?(0,M.Y)(R.A,{name:"lock-badge"}):"radio"===U?(0,M.Y)(y.A,{checked:A,disabled:g,onlyInput:!0}):"checkbox"===U?(0,M.Y)(f.A,{checked:A,disabled:g,onlyInput:!0}):void 0,inputPosition:"end",onClick:()=>le(e),onDisabledClick:q&&(()=>q(e,p))},e)}),[ce,K,_,F,U,W,ae,ie,O,q,ee,te,j,$,z]),pe=(0,o.Kr)((()=>{if(t?.length)return(0,M.FD)("div",{children:[k&&(0,M.Y)("div",{className:b.A.pickerCategoryTitle,children:W(k)}),t?.map((e=>me(e.type,!0))),(0,M.Y)("div",{className:b.A.pickerCategoryTitle,children:W("FilterChats")})]},"categories")}),[t,k,W,me]);return(0,M.FD)("div",{className:(0,d.A)(b.A.container,e),children:[B&&(0,M.FD)("div",{className:(0,d.A)(b.A.header,"custom-scroll"),dir:W.isRtl?"rtl":void 0,children:[ee?.map((e=>(0,M.Y)(w.A,{className:b.A.peerChip,customPeer:ce[e],onClick:le,clickArg:e,canClose:!0}))),X?.map(((e,t)=>(0,M.Y)(w.A,{className:b.A.peerChip,peerId:e,isMinimized:oe&&t<te.length-5,forceShowSelf:K,onClick:le,clickArg:e}))),se.map(((e,t)=>(0,M.Y)(w.A,{className:b.A.peerChip,peerId:e,isMinimized:oe&&t+(X?.length||0)<te.length-5,canClose:!0,onClick:le,clickArg:e}))),(0,M.Y)(v.A,{id:D,ref:ne,value:Y,onChange:de,placeholder:P||W("SelectChat")})]}),ue?.length?(0,M.Y)(A.A,{className:(0,d.A)(b.A.pickerList,J&&b.A.padded,"custom-scroll"),items:ue,itemSelector:`.${x}`,beforeChildren:pe,onLoadMore:he,noScrollRestore:L,children:ue.map((e=>me(e)))}):E||!ue||ue.length?(0,M.Y)(C.A,{}):(0,M.Y)("p",{className:b.A.noResults,children:T||"Sorry, nothing found."})]})}))},56133:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(16581);function a(e,t,n,a=[]){return(0,o.A)((e=>{e()}),a,e,t,n)}},57446:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(13439),a=n(66644),i=n(29807),s=n(19822);const c=300,r=new Map;function l(e,t,n=c){(0,i.PKK)((0,o.mS)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:h,dataset:{scrollId:m}}=e;let p=t-d;if(p<0){const e=-d*(l?-1:1);p=Math.max(p,e)}else if(p>0){const e=h-(d+u);p=Math.min(p,e)}if(0===p)return Promise.resolve();m&&r.has(m)&&r.get(m)();const g=d+p;return new Promise((t=>{(0,a.RK)((()=>{if(0===n)return e.scrollLeft=g,void t();let o=!1;const i=Math.random().toString();e.dataset.scrollId=i,r.set(i,(()=>{o=!0})),e.style.scrollSnapType="none";const c=Date.now();function l(){e.style.scrollSnapType="",delete e.dataset.scrollId,r.delete(i)}(0,s.i0)((()=>{if(o)return l(),!1;const a=Math.min((Date.now()-c)/n,1),i=p*(1-function(e){return 1-(1-e)**3.5}(a));return e.scrollLeft=Math.round(g-i),a>=1&&(l(),t()),a<1}),a.RK)}))}))}},58968:(e,t,n)=>{n.d(t,{I5:()=>s,LS:()=>i,V2:()=>a,lw:()=>o});const o={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"star",isAvatarSquare:!0,withPremiumGradient:!0},a=[{isCustomPeer:!0,type:"contacts",titleKey:"FilterContacts",avatarIcon:"user",isAvatarSquare:!0,peerColorId:5},{isCustomPeer:!0,type:"nonContacts",titleKey:"FilterNonContacts",avatarIcon:"non-contacts",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"groups",titleKey:"FilterGroups",avatarIcon:"group",isAvatarSquare:!0,peerColorId:3},{isCustomPeer:!0,type:"channels",titleKey:"FilterChannels",avatarIcon:"channel",isAvatarSquare:!0,peerColorId:1},{isCustomPeer:!0,type:"bots",titleKey:"FilterBots",avatarIcon:"bots",isAvatarSquare:!0,peerColorId:6}],i=[{isCustomPeer:!0,type:"excludeMuted",titleKey:"FilterMuted",avatarIcon:"mute",isAvatarSquare:!0,peerColorId:6},{isCustomPeer:!0,type:"excludeRead",titleKey:"FilterRead",avatarIcon:"readchats",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"excludeArchived",titleKey:"FilterArchived",avatarIcon:"archive",isAvatarSquare:!0,peerColorId:5}],s={isCustomPeer:!0,type:"hidden",titleKey:"StarsTransactionHidden",avatarIcon:"author-hidden",peerColorId:4}},64489:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),a=n(87357),i=n(95807),s=n(37661),c=n(17712),r=n(83057),l=n(4438);const d="lM2usrZU";var u=n(20021);const h=new Set,m=(0,o.ph)((function(e){const{previewUrl:t,thumbDataUri:n,className:o,...m}=e,[p,,g]=(0,s.A)(Boolean(n)),f=(0,r.A)(p),[A,v,C]=(0,s.A)(h.has(t)),y=(0,r.A)(A),[S,I]=(0,s.A)(!1),R=(0,c.A)((()=>{v(),h.add(t)})),w=(0,c.A)((()=>{g(),C(),setTimeout(I,300)})),{size:N}=e;return(0,u.FD)("div",{className:(0,a.A)(o,"xCi2f0YH"),style:(0,i.A)(void 0!==N&&`width: ${N}px; height: ${N}px;`),children:[n&&!S&&(0,u.Y)("img",{src:n,className:(0,a.A)(d,f),draggable:!1}),t&&!S&&(0,u.Y)("img",{src:t,className:(0,a.A)(d,y),draggable:!1,onLoad:R}),(0,u.Y)(l.A,{...m,onLoad:w})]})}))},65632:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),a=n(13439),i=n(31481),s=n(74824),c=n(87679);const r=(e,t)=>{const{setThemeSettings:n}=(0,a.ko)(),[r,l]=(0,o.J0)(t);return(0,o.vJ)((()=>{t&&(t.startsWith("#")?l(t):s.fetch(i.nfi,e,s.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,c.NN)(t).then((()=>{l(`url(${t})`)}))})).catch((()=>{n({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?i.MkD:i.be8})})))}),[t,e]),t?r:void 0}},66833:(e,t,n)=>{function o(e){return"starGift"===e.type?e.sticker:e.attributes.find((e=>"model"===e.type))?.sticker}function a(e){return"starGift"===e.type?e.availabilityTotal:e.totalCount}function i(e){if("starGiftUnique"===e.type)return function(e){const t=e.find((e=>"model"===e.type)),n=e.find((e=>"backdrop"===e.type)),o=e.find((e=>"pattern"===e.type));return{model:t,originalDetails:e.find((e=>"originalDetails"===e.type)),pattern:o,backdrop:n}}(e.attributes)}n.d(t,{UC:()=>a,uc:()=>i,yQ:()=>o})},68292:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),a=n(13439),i=n(29807),s=n(87357),c=n(37836),r=n(30857),l=n(39351),d=n(73767);var u=n(20021);let h=0;const m=(0,c.Fe)((()=>{h=0})),p=(0,o.ph)((({text:e,className:t,isDisabled:n,ref:c})=>{const{isRtl:p}=(0,l.A)(),g=(0,d.A)(e),f=(0,r.A)(),A=!(!(!n&&(0,i.PKK)((0,a.mS)())&&void 0!==g&&g!==e)||h>=10||(0===h&&m(),h++,0)),v=(0,o.Kr)((()=>A?function(e,t){const n=[],o=e.length,a=t?.length??0;for(let i=0;i<=o;i++){const s=o-i,c=a-i;t&&c>=0&&e[s]!==t[c]?n.unshift((0,u.FD)("div",{className:"IYTzbS8o",children:[(0,u.Y)("div",{className:"Jw1oQFdk",children:e[s]??""}),(0,u.Y)("div",{className:"TZfEz3sc",children:t[c]}),(0,u.Y)("div",{className:"Y9ied8_t",children:e[s]??""})]})):n.unshift((0,u.Y)("span",{children:e[s]??""}))}return n}(e,g):e),[A,g,e]);return(0,o.vJ)((()=>{if(!A)return;const e=window.setTimeout((()=>{f()}),200);return()=>{window.clearTimeout(e)}}),[A,e]),(0,u.Y)("span",{ref:c,className:(0,s.A)(t,!n&&"tgKbsVmz"),dir:p?"rtl":void 0,children:v})}))},69988:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"gXO57D98",chosen:"VXSJn0Sm",paid:"N3lcrsh8",outside:"Hqw10FGl","animated-emoji":"lFjoRm_p",animatedEmoji:"lFjoRm_p",tag:"Dr889Kzc",tail:"cUfY1b26","is-safari":"rxxUijuG",isSafari:"rxxUijuG","tail-fill":"y591o4fN",tailFill:"y591o4fN","tag-text":"ly7cruxF",tagText:"ly7cruxF",counter:"P2FqNJAi",disabled:"NRtGofbf",paidCounter:"CW4UO1n3"}},73104:(e,t,n)=>{let o,a;n.d(t,{M6:()=>r,v5:()=>l});const i={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},s=e=>{const t="deltaY"in e?e.deltaY:(e=>"changedTouches"in e?e.changedTouches[0].clientY:0)(e);if(!o||!o.contains(e.target)||o.scrollTop<=0&&t<=0||o.scrollTop>=o.scrollHeight-o.offsetHeight&&t>=0){if(a&&e.target.closest(a))return;e.preventDefault()}};function c(e){i[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,n=t.tagName.toLowerCase();if("textarea"===n)return!0;if("input"!==n)return!1;const o=t.getAttribute("type");return!!o&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(o.toLowerCase())>-1}(e.target)&&e.preventDefault()}function r(e,t){return o=e,a=t,document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),document.onkeydown=c,l}function l(){o=void 0,a=void 0,document.removeEventListener("wheel",s),document.removeEventListener("touchmove",s),document.onkeydown=null}},74984:(e,t,n)=>{n.d(t,{Jm:()=>l,Rh:()=>s,g5:()=>r,ic:()=>c});var o=n(84051),a=n(49763),i=n(30857);function s(e){const t=(0,i.A)();return(0,o.vJ)((()=>(0,a.Yw)(e,t)),[e,t]),(0,a.YA)(e)}function c(){const e=(0,i.A)();return(0,o.vJ)((()=>(0,a.P1)(e)),[e]),(0,a.PZ)()}function r(){const e=(0,i.A)();return(0,o.vJ)((()=>(0,a.BU)(e)),[e]),(0,a.jn)()}function l(){const e=(0,i.A)();return(0,o.vJ)((()=>(0,a.dk)(e)),[e]),(0,a.Xq)()}},76283:(e,t,n)=>{n.d(t,{A:()=>k});var o=n(84051),a=n(13439),i=n(90709),s=n(87357),c=n(17712),r=n(59030),l=n(18276),d=n(64493),u=n(96530),h=n(78376),m=n(76023),p=n(10722),g=n(4438),f=n(87412);const A="uGUjDZKl",v="M62HGuIV",C="WMpEr5XQ";var y=n(20021);const S=2*m.$,I=(0,o.ph)((({reaction:e,chosen:t,isReady:n,noAppearAnimation:a,style:i,isLocked:r,onToggleReaction:d,onSendPaidReaction:u,onShowPaidReactionModal:m})=>{const I=(0,o.li)(),R=(0,c.A)((()=>{"paid"!==e.type?d(e):u?.()})),{isContextMenuOpen:w,handleBeforeContextMenu:N,handleContextMenu:b,handleContextMenuClose:M,handleContextMenuHide:x}=(0,p.A)(I,"paid"!==e.type,void 0,void 0,void 0,!0);return(0,o.vJ)((()=>{w&&(m?.(),M(),x())}),[M,m,x,w]),(0,y.FD)("div",{className:(0,s.A)(A,"oc1hpMwv",t&&"paid"!==e.type&&v,!a&&n&&"sx6RTuAU",a&&"kqcWe4tf"),ref:I,style:i,onClick:R,onMouseDown:N,onContextMenu:b,children:["paid"===e.type?(0,y.Y)(g.A,{tgsUrl:h.w.StarReaction,size:S,noLoop:!1}):(0,y.Y)(f.A,{documentId:e.documentId,size:S}),r&&(0,y.Y)(l.A,{className:C,name:"lock-badge"})]})}));var R=n(37661),w=n(62587),N=n(18104);const b=2*m.$,M=(0,o.ph)((({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,isLocked:a,onToggleReaction:i})=>{const c=(0,w.A)(`sticker${e.appearAnimation?.id}`,!t||n),r=(0,w.A)(`document${e.selectAnimation?.id}`,!t||n),d=(0,w.A)(`document${e.staticIcon?.id}`,!n),[u,h]=(0,R.A)(),[m,,p]=(0,R.A)(!0),[g,f,S]=(0,R.A)();return(0,y.FD)("div",{className:(0,s.A)(A,o&&v),onClick:function(){i(e.reaction)},onMouseEnter:t&&!m?f:void 0,children:[n&&(0,y.Y)("img",{className:"MZ2tH980",src:d,alt:e.reaction.emoticon,draggable:!1}),!u&&!n&&(0,y.Y)(N.A,{tgsUrl:c,play:m,noLoop:!0,size:b,onEnded:p,forceAlways:!0},e.appearAnimation?.id),!m&&!n&&(0,y.Y)(N.A,{tgsUrl:r,play:g,noLoop:!0,size:b,onLoad:h,onEnded:S,forceAlways:!0},e.selectAnimation?.id),a&&(0,y.Y)(l.A,{className:C,name:"lock-badge"})]})})),x=(0,s.x)("ReactionSelector"),k=(0,o.ph)((({allAvailableReactions:e,topReactions:t,defaultTagReactions:n,enabledReactions:h,currentReactions:m,reactionsLimit:p,isPrivate:g,isReady:f,canPlayAnimatedEmojis:A,className:v,isCurrentUserPremium:C,isInSavedMessages:S,isInStoryViewer:R,isForEffects:w,effectReactions:N,isWithPaidReaction:b,onClose:k,onToggleReaction:Y,onSendPaidReaction:P,onShowPaidReactionModal:T,onShowMore:D})=>{const{openPremiumModal:F}=(0,a.ko)(),E=(0,o.li)(),L=(0,r.A)(),B=S&&!C&&!R,O=Boolean(p&&m&&m.length>=p),K=(0,o.Kr)((()=>{const o=O?m?.map((e=>e.reaction)):w?N:S?n:"some"===h?.type?h.allowed:e?.map((e=>e.reaction)),a=o?.map((t=>{const n="custom"===t.type,o=e?.find((e=>(0,i.a0)(e.reaction,t)));return w?o:(n||o)&&!o?.isInactive&&(g||O||h&&(0,i.A3)(t,h))?n?t:o:void 0})).filter(Boolean)||[],s=(0,i.fu)(a,t);return b&&s.unshift({type:"paid"}),s}),[e,m,n,h,S,g,t,w,N,O,b]),_=(0,o.Kr)((()=>8===K.length?K:K.slice(0,7)),[K]),U=_.length<K.length,$=(0,o.Kr)((()=>{const e=m?.filter((({chosenOrder:e})=>void 0!==e))||[];return new Set(e.map((({reaction:e})=>_.findIndex((t=>t&&(0,i.a0)("reaction"in t?t.reaction:t,e))))))}),[m,_]),j=(0,c.A)((()=>{const e=E.current?.getBoundingClientRect()||{x:0,y:0};D({x:e.x,y:e.y})})),z=(0,c.A)((()=>{k?.(),F({initialSection:"saved_tags"})})),J=(0,o.Kr)((()=>{if(S){if(!C){const e=L("lng_subscribe_tag_about").split("{link}");return(0,y.FD)("span",{children:[e[0],(0,y.Y)(u.A,{isPrimary:!0,onClick:z,children:L("lng_subscribe_tag_link")}),e[1]]})}return L("SavedTagReactionsHint2")}return R?L("StoryReactionsHint"):w?L("AddEffectMessageHint"):void 0}),[C,S,R,L,w]);if(_.length)return(0,y.FD)("div",{className:(0,s.A)(x("&"),v),ref:E,children:[(0,y.Y)("div",{className:x("bubble-small",L.isRtl&&"isRtl")}),(0,y.FD)("div",{className:x("items-wrapper"),children:[(0,y.Y)("div",{className:x("bubble-big",L.isRtl&&"isRtl")}),(0,y.FD)("div",{className:x("items"),children:[J&&(0,y.Y)("div",{className:x("hint"),children:J}),(0,y.FD)("div",{className:x("reactions"),dir:L.isRtl?"rtl":void 0,children:[_.map(((e,t)=>"reaction"in e?(0,y.Y)(M,{isReady:f,onToggleReaction:Y,reaction:e,noAppearAnimation:!A,chosen:$.has(t),isLocked:B},(0,i.Jj)(e.reaction)):(0,y.Y)(I,{isReady:f,onToggleReaction:Y,onSendPaidReaction:P,onShowPaidReactionModal:T,reaction:e,noAppearAnimation:!A,chosen:$.has(t),isLocked:B,style:`--_animation-delay: ${20*(7-t)}ms`},(0,i.Jj)(e)))),U&&(0,y.Y)(d.A,{color:"translucent",className:x("show-more"),onClick:j,children:(0,y.Y)(l.A,{name:"down"})})]})]})]})]})}))},79174:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),a=n(66644),i=n(43874);const s=500,c=300;function r(e,t,n){const{isMobile:r}=(0,i.Ay)();(0,o.vJ)((()=>{t?r||setTimeout((()=>{(0,a.RK)((()=>{e.current?.isConnected&&e.current.focus()}))}),s):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,c))}),[e,r,t,n])}},79519:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),a=n(61433),i=n(31481),s=n(66644),c=n(81954);const r=500,l=i.nxZ,d=20;function u({elementRef:e,chatId:t,isFocused:n,focusDirection:i,noFocusHighlight:u,isResizingContainer:h,isJustAdded:m,isQuote:p,scrollTargetPosition:g}){const f=(0,o.li)(!m);(0,o.Nf)((()=>{const t=f.current;if(f.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),o=u,m=g||o?"end":"centerOrTop",f=()=>{const t=void 0!==i?o?r:l:void 0,u=(0,c.Ay)({container:n,element:e.current,position:m,margin:d,maxDistance:t,forceDirection:i,forceNormalContainerHeight:h,shouldReturnMutationFn:!0});if(p){const t=e.current.querySelector(".is-quote");t&&(0,s.RK)((()=>{(0,a.YM)(t,"animate")}))}return u};t?(0,s.gm)(f):(0,s.YS)((()=>{(0,s.RK)(f())}))}}),[e,t,n,i,u,h,p,g])}},79577:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),a=n(23174),i=n(90709),s=n(62587),c=n(64489),r=n(20021);const l=(0,o.ph)((function(e){const{sticker:t,noLoad:n,forcePreview:o,...l}=e,d=t?.thumbnail?.dataUri,u=t&&(0,i.Mw)(t,"full"),h=(0,s.A)(t?(0,i.Mw)(t,"preview"):void 0,n&&!o,a.qZ.BlobUrl),m=(0,s.A)(u,n);return(0,r.Y)(c.A,{tgsUrl:m,previewUrl:h,thumbDataUri:d,...l})}))},79582:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(13439),a=n(29807),i=n(87894);const s=3e9,c=3e8;function r(e,t=!1,n,r){const l=(0,o.mS)();return(0,i.My)(e,(e=>{if(e===r)return 1/0;const o=(0,a.hds)(l,e);if(!o)return 0;let i=0;const d=(0,a.yHC)(l,e);return d&&(i+=d.date),t&&o.isVerified&&(i+=s),n&&n.includes(e)&&(i=Date.now()+c+(n.length-n.indexOf(e))),i}),"desc")}},80539:(e,t,n)=>{n.d(t,{Ay:()=>r,g4:()=>l,qh:()=>s});var o=n(23174),a=n(31481),i=n(96454);const s={B:o.C7.Bold,STRONG:o.C7.Bold,I:o.C7.Italic,EM:o.C7.Italic,INS:o.C7.Underline,U:o.C7.Underline,S:o.C7.Strike,STRIKE:o.C7.Strike,DEL:o.C7.Strike,CODE:o.C7.Code,PRE:o.C7.Pre,BLOCKQUOTE:o.C7.Blockquote},c=3;function r(e,t=!1,n=!1){const r=document.createElement("div");r.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),i.TL||(t=t.replace(/\[<img[^>]+alt="([^"]+)"[^>]*>]/gm,"[$1]")),t=t.replace(/(?!<(?:code|pre)[^<]*|<\/)\[([^\]\n]+)\]\(customEmoji:(\d+)\)(?![^<]*<\/(?:code|pre)>)/g,'<img alt="$1" data-document-id="$2">'),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)/g,"<b>$2</b>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)/g,"<i>$2</i>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)/g,"<s>$2</s>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)/g,`<span data-entity-type="${o.C7.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${a.kNZ}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`))}(e):e),l(r);const d=r.innerText.trim().replace(/\u200b+/g,"");let u=-r.innerText.indexOf(d[0]),h=0;const m=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const a=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===o.C7.MentionName?o.C7.MentionName:t.dataset.entityType===o.C7.Url?o.C7.Url:t.href.startsWith("mailto:")?o.C7.Email:t.href.startsWith("tel:")?o.C7.Phone:t.href!==t.textContent?o.C7.TextUrl:o.C7.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?o.C7.CustomEmoji:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),c=i>=0?i:n,r=t.substring(0,c).length,{length:l}=t.substring(c,c+e.textContent.length);if(a===o.C7.TextUrl)return{index:c,entity:{type:a,offset:r,length:l,url:e.href}};if(a===o.C7.MentionName)return{index:c,entity:{type:a,offset:r,length:l,userId:e.dataset.userId}};if(a===o.C7.Pre)return{index:c,entity:{type:a,offset:r,length:l,language:e.dataset.language}};if(a===o.C7.CustomEmoji)return{index:c,entity:{type:a,offset:r,length:l,documentId:e.dataset.documentId}};if(a===o.C7.Timestamp){const t=Number(e.dataset.timestamp);return Number.isNaN(t)?{index:c,entity:void 0}:{index:c,entity:{type:a,offset:r,length:l,timestamp:t}}}return{index:c,entity:{type:a,offset:r,length:l}}}(e,d,u);if(n)u=t,m.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;u+=e.textContent.length}e.hasChildNodes()&&h<=c&&(h+=1,Array.from(e.childNodes).forEach(p))}return Array.from(r.childNodes).forEach((e=>{h=1,p(e)})),{text:d,entities:m.length?m:void 0}}function l(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}},81686:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(31481);const a=1;function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&s(e.focusNode,o.zPk);if(!t||0===t.childElementCount)return;const i=Array.from(t.children).reduce(((e,t)=>t.nodeType===a&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):t.nodeType===a&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||i.pop(),i}function s(e,t){return!(e.nodeType!==a||!e.classList.contains(t))||!!e.parentNode&&s(e.parentNode,t)}},81949:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(87357);var a=n(20021);const i=({children:e,className:t,onClick:n,onMouseDown:i})=>(0,a.Y)("div",{className:(0,o.A)("hJUqHi4B",n&&"hjDEmFaT",t),onClick:n,onMouseDown:i,children:e})},81954:(e,t,n)=>{n.d(t,{Ay:()=>g,H$:()=>C,_v:()=>f,o8:()=>v});var o=n(84051),a=n(13439),i=n(89925),s=n(31481),c=n(66644),r=n(29807),l=n(96454),d=n(16460),u=n(19822);let h,m,p=!1;function g(e){h=e;const t=A(e);if(e.shouldReturnMutationFn)return t;(0,c.RK)(t)}function f(){p&&((0,u.vk)(),(0,c.YS)((()=>{(0,c.RK)(A(h))})))}function A(e){const{container:t,element:n,position:g,margin:f=0,maxDistance:A=s.nxZ,forceDirection:v,forceNormalContainerHeight:C}=e;let I=e.forceDuration;v!==i.CC.Static&&(0,r.PKK)((0,a.mS)())||(I=0);const{offsetHeight:R}=n,{scrollTop:w,offsetHeight:N,scrollHeight:b}=t,M=(0,d.A)(n,t).top,x=C&&t.dataset.normalHeight?Number(t.dataset.normalHeight):N;let k;switch(g){case"start":k=M-f+(l.Ni?1:0);break;case"end":k=M+R+f-x;break;case"nearest":case"center":case"centerOrTop":k=R<x?M+R/2-x/2:M-f}const Y=function(e,t,n=s.nxZ,o){const{scrollTop:a}=e;if(void 0===o){const e=t-a;if(e<-n)return a+(e+n);if(e>n)return a+(e-n)}else{if(o===i.CC.Up)return t+n;if(o===i.CC.Down)return Math.max(0,t-n)}return a}(t,k,A,v);let P=k-Y;if(P<0){const e=-Y;P=Math.max(P,e)}else if(P>0){const e=b-(Y+x);P=Math.min(P,e)}const T=Math.abs(P);return()=>{if(T<1)return void(w!==Y&&(t.scrollTop=Y));const e=Y+P;if(0===I)return void(t.scrollTop=e);const n=T<=s.s8T?y:S,a=I||s.SKD+T/s.nxZ*(s.OzO-s.SKD),i=Date.now();p=!0;const r=m;m=(0,o.VK)(void 0,!0),r?.(),(0,u.S0)((()=>{const o=Math.min((Date.now()-i)/a,1),s=P*(1-n(o)),c=Math.round(e-s);return t.scrollTop=c,p=o<1&&c!==e,p||(h=void 0,m?.(),m=void 0),p}),c.RK)}}function v(){return p}function C(){m(),m=void 0}function y(e){return 1-(1-e)**3.5}function S(e){return 1-(1-e)**6}},83594:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),a=n(90709),i=n(96454),s=n(87357),c=n(95807),r=n(62587),l=n(87412);const d="PZAuNVZH";var u=n(20021);const h=(0,o.ph)((({reaction:e,isLottie:t,className:n,particleSize:h,onEnded:m})=>{const p=(0,a.aL)(e.documentId,!0),g=(0,r.A)(t?void 0:p),f=(0,o.Kr)((()=>i.ol?Array.from({length:7}).map((()=>function(e=20){const t=(e/2+Math.random()*e*3)*(Math.random()>.5?1:-1),n=e+Math.random()*e*4;return`M 0 0 C 0 0 ${t} ${-n-e} ${t} ${n}`}(h))):[]),[h]);if(g||t)return(0,u.Y)("div",{className:(0,s.A)("aInga6VW",n),style:(0,c.A)(Boolean(h)&&`--particle-size: ${h}px`),children:f.map(((n,o)=>{const a=`--offset-path: path('${n}');`;return t?(0,u.Y)(l.A,{documentId:e.documentId,className:d,style:a,withSharedAnimation:!0,size:h,onAnimationEnd:0===o?m:void 0}):(0,u.Y)("img",{src:g,alt:"",className:d,style:a,draggable:!1,onAnimationEnd:0===o?m:void 0})}))})}))},92915:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),a=n(13439),i=n(87357),s=n(76023),c=n(10722),r=n(37661),l=n(17712),d=n(59030),u=n(11241),h=n(64493),m=n(40664),p=n(22337);var g=n(20021);const f=(0,o.ph)((({isOpen:e,title:t,subtitle:n,placeholder:a,submitText:i,maxLength:s,initialValue:c="",onClose:r,onSubmit:u})=>{const f=(0,d.A)(),[A,v]=(0,o.J0)(c),C=(0,l.A)((e=>{v(e.target.value)})),y=(0,l.A)((()=>{u(A)}));return(0,g.FD)(p.A,{className:"narrow",title:t,isOpen:e,onClose:r,isSlim:!0,children:[Boolean(n)&&(0,g.Y)("div",{className:"cGrbcqD_",children:n}),(0,g.Y)(m.A,{placeholder:a,value:A,onChange:C,maxLength:s,teactExperimentControlled:!0}),(0,g.FD)("div",{className:"dialog-buttons mt-2",children:[(0,g.Y)(h.A,{className:"confirm-dialog-button",onClick:y,children:i||f("Save")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:r,children:f("Cancel")})]})]})}));var A=n(71429),v=n(24433),C=n(69988);const y=1.25*s.$,S=(0,o.ph)((({reaction:e,tag:t,containerId:n,isChosen:s,isOwnMessage:m,className:p,chosenClassName:S,withCount:I,isDisabled:R,withContextMenu:w,observeIntersection:N,onClick:b,onRemove:M})=>{const{editSavedReactionTag:x}=(0,a.ko)(),k=(0,o.li)(),Y=(0,o.li)(),P=(0,d.A)(),[T,D,F]=(0,r.A)(),{title:E,count:L}=t||{},B=Boolean(E||I&&L),O=(0,l.A)((()=>{b?.(e)})),K=(0,l.A)((()=>{M?.(e)})),_=(0,l.A)((t=>{x({reaction:e,title:t}),F()})),{isContextMenuOpen:U,contextMenuAnchor:$,handleBeforeContextMenu:j,handleContextMenu:z,handleContextMenuClose:J,handleContextMenuHide:H}=(0,c.A)(k,!w,void 0,void 0,void 0,!0),q=(0,l.A)((()=>k.current)),G=(0,l.A)((()=>document.body)),V=(0,l.A)((()=>Y.current)),W=(0,l.A)((()=>({withPortal:!0,shouldAvoidNegativePosition:!0})));if(!I||0!==L)return(0,g.FD)(h.A,{className:(0,i.A)(C.A.root,C.A.tag,m&&C.A.own,s&&C.A.chosen,s&&S,R&&C.A.disabled,p),size:"tiny",onClick:O,onMouseDown:j,onContextMenu:z,ref:k,children:[(0,g.Y)(u.A,{className:C.A.animatedEmoji,containerId:n,reaction:e,loopLimit:1,size:y,observeIntersection:N}),B&&(0,g.FD)("span",{className:C.A.tagText,children:[E&&(0,g.Y)("span",{children:E}),I&&(0,g.Y)("span",{children:L})]}),(0,g.Y)("svg",{className:C.A.tail,width:"15",height:"30",viewBox:"0 0 15 30",children:(0,g.Y)("path",{className:C.A.tailFill,d:"m 0,30 c 3.1855,0 6.1803,-1.5176 8.0641,-4.0864 l 5.835,-7.9568 c 1.2906,-1.7599 1.2906,-4.1537 0,-5.9136 L 8.0641,4.08636 C 6.1803,1.51761 3.1855,0 0,0"})}),w&&(0,g.Y)(f,{isOpen:T,maxLength:15,title:P(t?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:P("SavedTagLabelTagText"),placeholder:P("SavedTagLabelPlaceholder"),initialValue:t?.title,onClose:F,onSubmit:_}),w&&$&&(0,g.FD)(A.A,{ref:Y,isOpen:U,anchor:$,getTriggerElement:q,getRootElement:G,getMenuElement:V,getLayout:W,autoClose:!0,withPortal:!0,onClose:J,onCloseAnimationEnd:H,children:[(0,g.Y)(v.A,{icon:"tag-filter",onClick:O,children:P("SavedTagFilterByTag")}),(0,g.Y)(v.A,{icon:"tag-name",onClick:D,children:P(t?.title?"SavedTagRenameTag":"SavedTagLabelTag")}),(0,g.Y)(v.A,{icon:"tag-crossed",destructive:!0,onClick:K,children:P("SavedTagRemoveTag")})]})]})}))},93879:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"}},99515:(e,t,n)=>{n.d(t,{A:()=>Z});var o=n(84051),a=n(13439),i=n(23174),s=n(31481),c=n(90709),r=n(29807),l=n(87357),d=n(85982),u=n(9716),h=n(80539);const m=document.createElement("div"),p=new Set([i.C7.Bold,i.C7.Italic,i.C7.Underline,i.C7.Strike,i.C7.Spoiler,i.C7.CustomEmoji]);function g(e){const t=function(e){const t=e.cloneContents();m.appendChild(t);const n=function(e,t){const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE&&n.classList.contains("text-content"))return t;let o=e.commonAncestorContainer.parentElement;for(;o&&!o.classList.contains("text-content");){const e=o.tagName.toLowerCase(),n=o.dataset.entityType;t=`<${e} ${n?`data-entity-type="${n}"`:""}>${t}</${e}>`,o=o.parentElement}return t}(e,m.innerHTML);return m.innerHTML="",n.replace(/<br\s*\/?>/gi,"\n").replace(/&nbsp;/gi," ").replace(/\u00a0/gi," ")}(e);return function(e){if(!e.entities)return e;const t=e.entities.filter((e=>p.has(e.type)));return{...e,entities:t.length?t:void 0}}((0,h.Ay)(t,!1,!0))}var f=n(37661),A=n(17712),v=n(59030),C=n(24531),y=n(21511),S=n(80089),I=n(80464),R=n(20021);const w=e=>{const{isOpen:t}=e,n=(0,I.A)(S.ar.Extra,"PinMessageModal",!t);return n?(0,R.Y)(n,{...e}):void 0};var N=n(94189),b=n(73104),M=n(76023),x=n(4961),k=n(3544),Y=n(96454),P=n(81686),T=n(58554),D=n(49086);function F(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var E=n(43874),L=n(26875),B=n(71429),O=n(24433),K=n(60859),_=n(55158),U=n(17663);const $="C3LVl_JT",j="cd1ZZeSy",z=(0,o.ph)((function({message:e}){const t=(0,v.A)(),{editDate:n}=e,o=!n;return(0,R.Y)(O.A,{icon:"clock-edit",className:$,children:o?(0,R.Y)(_.A,{className:j}):Boolean(n)&&t("Chat.PrivateMessageEditTimestamp.Date",(0,U.U)(t,1e3*n))})}));var J=n(76283),H=n(41036);const q=(0,o.ph)((function({message:e,shouldRenderShowWhen:t,canLoadReadDate:n,closeContextMenu:o}){const{openPrivacySettingsNoticeModal:i}=(0,a.ko)(),s=(0,v.A)(),{readDate:c}=e,r=n&&!c&&!t;return(0,R.Y)(O.A,{icon:"message-read",className:$,children:(0,R.Y)(H.Ay,{name:"fade",activeKey:r?1:2,className:"mg4sBQ9n",children:r?(0,R.Y)(_.A,{className:j}):(0,R.FD)(R.FK,{children:[Boolean(c)&&s("PmReadAt",(0,U.U)(s,1e3*c)),!c&&t&&(0,R.FD)("div",{children:[s("PmRead"),(0,R.Y)("span",{className:"bmxij_dk",onClick:()=>{o(),i({chatId:e.chatId,isReadDate:!0})},children:s("PmReadShowWhen")})]})]})})})})),G=(0,o.ph)((({isReactionPickerOpen:e,availableReactions:t,topReactions:n,defaultTagReactions:s,isOpen:r,message:h,poll:m,story:p,isPrivate:g,isCurrentUserPremium:C,enabledReactions:y,isWithPaidReaction:S,reactionsLimit:I,anchor:w,targetHref:N,canSendNow:U,canReschedule:$,canBuyPremium:j,canReply:H,canQuote:G,canEdit:V,noReplies:W,canPin:Z,canUnpin:X,canDelete:Q,canForward:ee,canReport:te,canFaveSticker:ne,canUnfaveSticker:oe,canCopy:ae,canCopyLink:ie,canSelect:se,canDownload:ce,canSaveGif:re,canRevote:le,canClosePoll:de,canTranslate:ue,canShowOriginal:he,canSelectLanguage:me,isDownloading:pe,repliesThreadInfo:ge,canShowSeenBy:fe,canShowReactionsCount:Ae,canShowReactionList:ve,seenByRecentPeers:Ce,hasCustomEmoji:ye,customEmojiSets:Se,canPlayAnimatedEmojis:Ie,isInSavedMessages:Re,shouldRenderShowWhen:we,canLoadReadDate:Ne,onReply:be,onOpenThread:Me,onEdit:xe,onPin:ke,onUnpin:Ye,onForward:Pe,onDelete:Te,onFaveSticker:De,onReport:Fe,onUnfaveSticker:Ee,onSelect:Le,onSend:Be,onReschedule:Oe,onClose:Ke,onCloseAnimationEnd:_e,onCopyLink:Ue,onCopyNumber:$e,onDownload:je,onSaveGif:ze,onCancelVote:Je,onClosePoll:He,onShowSeenBy:qe,onShowReactors:Ge,onToggleReaction:Ve,onSendPaidReaction:We,onShowPaidReactionModal:Ze,onCopyMessages:Xe,onReactionPickerOpen:Qe,onTranslate:et,onShowOriginal:tt,onSelectLanguage:nt,userFullName:ot,canGift:at})=>{const{showNotification:it,openStickerSet:st,openCustomEmojiSets:ct,loadStickers:rt,openGiftModal:lt}=(0,a.ko)(),dt=(0,o.li)(),ut=(0,o.li)(),ht=(0,v.A)(),mt=!g&&!y,pt=h.areReactionsPossible,gt=ve&&!mt||pt,ft="isEdited"in h&&h.isEdited,At=h.seenByDates,vt="giftPremium"===h.content.action?.type,Ct="giftCode"===h.content.action?.type,yt="starGift"===h.content.action?.type,St="starGiftUnique"===h.content.action?.type,It=(0,u.L8)(h.chatId)&&at&&(vt||Ct||yt||St),[Rt,wt]=(0,f.A)(),[Nt,bt,Mt]=(0,f.A)(),{isMobile:xt,isDesktop:kt}=(0,E.Ay)(),Yt=(0,o.Kr)((()=>At?Object.keys(At).length:0),[At]),Pt=(0,A.A)((()=>{it({message:ht("Share.Link.Copied")}),Ke()})),Tt=(0,A.A)((()=>{lt({forUserId:h.chatId}),Ke()}));(0,o.vJ)((()=>{r&&Rt&&!e&&Ke()}),[Ke,r,e,Rt]),(0,o.vJ)((()=>{Se?.length&&Se.map((e=>rt({stickerSetInfo:{id:e.id,accessHash:e.accessHash}})))}),[Se,ct]);const Dt=(0,A.A)((()=>{Se&&(1===Se.length?st({stickerSetInfo:{shortName:Se[0].shortName}}):ct({setIds:Se.map((e=>e.id))}),Ke())})),Ft=function(e,t,n,o,a,s,r,l){const u=[],h=(0,c.P5)(e),m=(0,c.yl)(e)||((0,c.QC)(e)?void 0:(0,c.dc)(e)),p=(0,c.Qm)(e),g=m?(0,c.rI)(m,"full"):void 0,f=o&&m&&(g||(0,c.KG)(m))&&d.WO&&!Y.Yw,A=window.getSelection();if(f&&u.push({label:"lng_context_copy_image",icon:"copy-media",handler:()=>{Promise.resolve(g?T.hd(g,i.qZ.BlobUrl):m.blobUrl).then(d.qp),a?.()}}),o&&n)u.push({label:"lng_context_copy_link",icon:"copy",handler:()=>{(0,d.eM)(n),a?.()}});else if(o&&h){const n=Boolean(A?.anchorNode?.parentNode&&A.anchorNode.parentNode.closest(".Message .content-inner")&&""!==A.toString().replace(/(?:\r\n|\r|\n)/g,"")&&function(e){const t=window.getSelection(),n=t?.anchorNode?.parentNode,o=n?.closest(".Message.message-list-item");return(0,c.GZ)(e.id)===o?.id}(e));u.push({label:F(n),icon:"copy",handler:()=>{const o=(0,P.A)();if(o?.length&&r)r(o);else if(n)document.execCommand("copy");else{const n=(0,D.V)({message:e,shouldRenderAsHtml:!0});n&&(0,d.A)(n.join(""),(0,k.Gn)(e,t))}a?.()}})}return s&&u.push({label:"lng_context_copy_message_link",icon:"link",handler:s}),p&&l&&u.push({label:"lng_profile_copy_phone",icon:"copy",handler:()=>{l(),a?.()}}),u}(h,(0,c.FE)({poll:m,story:p}),N,ae,Pt,ie?Ue:void 0,Xe,$e),Et=(0,A.A)((()=>document.querySelector(`.Transition_slide-active > .MessageList div[data-message-id="${h.id}"]`))),Lt=(0,A.A)((()=>document.querySelector(".Transition_slide-active > .MessageList"))),Bt=(0,A.A)((()=>document.querySelector(".MessageContextMenu .bubble"))),Ot=(0,A.A)((()=>{const e=xt&&document.querySelector(".AudioPlayer-content")?.offsetHeight||0,t=document.getElementById("MiddleColumn"),n=getComputedStyle(t),o=parseFloat(n.getPropertyValue("--middle-header-panes-height"))||0;return{extraPaddingX:10,extraTopPadding:document.querySelector(".MiddleHeader").offsetHeight,extraMarginTop:o+e,shouldAvoidNegativePosition:!kt,menuElMinWidth:gt&&xt?19.25*M.$:void 0}}));(0,o.vJ)((()=>{r?setTimeout((()=>{bt()}),200):Mt()}),[r,bt,Mt]),(0,o.vJ)((()=>(0,b.M6)(ut.current,".ReactionPicker")),[r]);const Kt=(0,A.A)((e=>{Qe(e),wt()}));return(0,R.FD)(B.A,{ref:dt,isOpen:r,anchor:w,getTriggerElement:Et,getRootElement:Lt,getMenuElement:Bt,getLayout:Ot,withMaxHeight:!0,className:(0,l.A)("MessageContextMenu","fluid",gt&&"with-reactions"),onClose:Ke,onCloseAnimationEnd:_e,children:[gt&&(0,R.Y)(J.A,{enabledReactions:y,topReactions:n,allAvailableReactions:t,defaultTagReactions:s,currentReactions:h.reactions?.results,reactionsLimit:I,onToggleReaction:Ve,onSendPaidReaction:We,onShowPaidReactionModal:Ze,isWithPaidReaction:S,isPrivate:g,isReady:Nt,canBuyPremium:j,isCurrentUserPremium:C,isInSavedMessages:Re,canPlayAnimatedEmojis:Ie,onShowMore:Kt,onClose:Ke,className:(0,l.A)(Rt&&"ReactionSelector-hidden")}),(0,R.FD)("div",{ref:ut,className:(0,l.A)("MessageContextMenu_items scrollable-content custom-scroll",Rt&&"MessageContextMenu_items-hidden"),dir:ht.isRtl?"rtl":void 0,children:[It&&(0,R.Y)(O.A,{icon:"gift",onClick:Tt,children:h?.isOutgoing?ht("SendAnotherGift"):ht("Conversation.ContextMenuSendGiftTo",ot)}),U&&(0,R.Y)(O.A,{icon:"send-outline",onClick:Be,children:ht("MessageScheduleSend")}),$&&(0,R.Y)(O.A,{icon:"schedule",onClick:Oe,children:ht("MessageScheduleEditTime")}),H&&(0,R.Y)(O.A,{icon:"reply",onClick:be,children:ht(G?"lng_context_quote_and_reply":"Reply")}),!W&&Boolean(ge?.messagesCount)&&(0,R.Y)(O.A,{icon:"replies",onClick:Me,children:ht("Conversation.ContextViewReplies",ge.messagesCount,"i")}),V&&(0,R.Y)(O.A,{icon:"edit",onClick:xe,children:ht("Edit")}),ne&&(0,R.Y)(O.A,{icon:"favorite",onClick:De,children:ht("AddToFavorites")}),oe&&(0,R.Y)(O.A,{icon:"favorite",onClick:Ee,children:ht("Stickers.RemoveFromFavorites")}),ue&&(0,R.Y)(O.A,{icon:"language",onClick:et,children:ht("TranslateMessage")}),he&&(0,R.Y)(O.A,{icon:"language",onClick:tt,children:ht("ShowOriginalButton")}),me&&(0,R.Y)(O.A,{icon:"web",onClick:nt,children:ht("lng_settings_change_lang")}),Ft.map((e=>(0,R.Y)(O.A,{icon:e.icon,onClick:e.handler,withPreventDefaultOnMouseDown:!0,children:ht(e.label)},e.label))),Z&&(0,R.Y)(O.A,{icon:"pin",onClick:ke,children:ht("DialogPin")}),X&&(0,R.Y)(O.A,{icon:"unpin",onClick:Ye,children:ht("DialogUnpin")}),re&&(0,R.Y)(O.A,{icon:"gifs",onClick:ze,children:ht("lng_context_save_gif")}),le&&(0,R.Y)(O.A,{icon:"revote",onClick:Je,children:ht("lng_polls_retract")}),de&&(0,R.Y)(O.A,{icon:"stop",onClick:He,children:ht("lng_polls_stop")}),ce&&(0,R.Y)(O.A,{icon:"download",onClick:je,children:ht(pe?"lng_context_cancel_download":"lng_media_download")}),ee&&(0,R.Y)(O.A,{icon:"forward",onClick:Pe,children:ht("Forward")}),se&&(0,R.Y)(O.A,{icon:"select",onClick:Le,children:ht("Common.Select")}),te&&(0,R.Y)(O.A,{icon:"flag",onClick:Fe,children:ht("lng_context_report_msg")}),Q&&(0,R.Y)(O.A,{destructive:!0,icon:"delete",onClick:Te,children:ht("Delete")}),ye&&(0,R.FD)(R.FK,{children:[(0,R.Y)(K.A,{size:"thick"}),!Se&&(0,R.FD)(R.FK,{children:[(0,R.Y)(_.A,{inline:!0,className:"menu-loading-row"}),(0,R.Y)(_.A,{inline:!0,className:"menu-loading-row"})]}),Se&&1===Se.length&&(0,R.Y)(O.A,{withWrap:!0,onClick:Dt,className:"menu-custom-emoji-sets",children:(0,x.A)(ht("MessageContainsEmojiPack",Se[0].title),["simple_markdown","emoji"])}),Se&&Se.length>1&&(0,R.Y)(O.A,{withWrap:!0,onClick:Dt,className:"menu-custom-emoji-sets",children:(0,x.A)(ht("MessageContainsEmojiPacks",Se.length),["simple_markdown"])})]}),(fe||Ae)&&(0,R.FD)(R.FK,{children:[(0,R.Y)(K.A,{size:ye?"thin":"thick"}),(0,R.FD)(O.A,{icon:Ae?"heart-outline":"group",onClick:Ae?Ge:qe,disabled:!Ae&&!Yt,children:[(0,R.Y)("span",{className:"MessageContextMenu--seen-by-label-wrapper",children:(0,R.Y)("span",{className:"MessageContextMenu--seen-by-label",dir:ht.isRtl?"rtl":void 0,children:Ae&&h.reactors?.count?fe&&Yt?ht("Chat.OutgoingContextMixedReactionCount",[h.reactors.count,Yt]):ht("Chat.ContextReactionCount",h.reactors.count,"i"):1===Yt&&Ce?(0,x.A)((0,u.L8)(Ce[0].id)?(0,c.Yg)(Ce[0]):Ce[0].title):Yt?ht("Conversation.ContextMenuSeen",Yt,"i"):ht("Conversation.ContextMenuNoViews")})}),(0,R.Y)(L.A,{className:"avatars",size:"micro",peers:Ce})]})]}),(Ne||we||ft)&&(0,R.Y)(K.A,{size:ye?"thin":"thick"}),(Ne||we)&&(0,R.Y)(q,{canLoadReadDate:Ne,shouldRenderShowWhen:we,message:h,closeContextMenu:Ke}),ft&&(0,R.Y)(z,{message:h})]})]})})),V=window.getSelection(),W=-1,Z=(0,o.ph)((0,a.EK)(((e,{message:t,messageListType:n,detectedLanguage:o})=>{const{threadId:a}=(0,r.Xf0)(e)||{},{defaultTags:i,topReactions:l,availableReactions:d}=e.reactions,h=(0,r.yuw)(e),m=(0,r.hds)(e,t.chatId),p=m&&(0,u.L8)(m.id),g=p?void 0:(0,r.AWZ)(e,t.chatId),f=(0,r.mBe)(e,t.chatId),A=f&&(0,c.Yg)(f),{seenByExpiresAt:v,seenByMaxChatMembers:C,maxUniqueReactions:y,readDateExpiresAt:S}=e.appConfig||{},I=g?.reactionsLimit||y,{noOptions:R,canReplyGlobally:w,canPin:N,canUnpin:b,canDelete:M,canReport:x,canEdit:k,canFaveSticker:Y,canUnfaveSticker:P,canCopy:T,canCopyLink:D,canSelect:F,canDownload:E,canSaveGif:L,canRevote:B,canClosePoll:O}=a&&(0,r.WAX)(e,t,a)||{},K=(0,r.R4s)(e,t),_=p?(0,r.K0y)(e,m.id):void 0,U=(0,c.Ie)(t),$=m&&(0,r.yps)(e,m.id),j=Boolean($),z=(0,r.Jbz)(e,t),J=Boolean(p&&U&&!j&&!z&&S&&t.date>Date.now()/1e3-S&&!_?.isReadDateRestricted&&"scheduled"!==n),H=Boolean(J&&p&&(0,r.K0y)(e,m.id)?.isReadDateRestrictedByMe),q="pinned"===n,G="scheduled"===n,V=m&&(0,c.WX)(m),W=a&&(0,r.Vw0)(e,t.chatId,a),Z=Boolean(W&&!W?.isCommentsInfo&&W?.fromChannelId),X=a?(0,r.S0q)(e,t.chatId,a):void 0,Q=m&&!(0,c.Sq)(m,"sendPlain",g),ee=!(!m||!a)&&(0,c.__)(m,X,Z,g)&&Q,te=(0,c.Nb)(t),ne=(0,c.G5)(t),oe=Boolean(!te&&m&&!z&&C&&v&&(0,c.YE)(m)&&U&&!G&&m.membersCount&&m.membersCount<=C&&t.date>Date.now()/1e3-v),ae=(0,c._P)(t),ie=!te&&!V&&!G&&!ae&&!p&&t.reactions&&!(0,c.G)(t.reactions)&&t.reactions.canSeeList,se=(0,r.ynf)(e,t),ce=Boolean(t.content.contact),re=(0,r.g29)(e),le=(0,r.S1W)(e,t),de=le?.map((t=>(0,r.ycM)(e,t))),ue=de?.every(Boolean)?de:void 0,he=(0,r.Rny)(e,t.chatId,t.id),me=he?Boolean((0,r.a_$)(e,t.chatId,he)[t.id]?.text):void 0,pe=!me&&(0,r.S86)(e,t,o),ge=(0,r.qZq)(e,t.chatId),fe=(0,r.nZ4)(e,t.chatId),Ae=(0,r.zcZ)(e,t),ve=t.content.storyData,Ce=ve?(0,r.Msb)(e,ve.peerId,ve.id):void 0,ye=(0,r.X2D)(e,t.chatId);return{threadId:a,chat:m,availableReactions:d,topReactions:l,defaultTagReactions:i,noOptions:R,canReport:x,canSendNow:G,canReschedule:G,canReply:!q&&!G&&w,canPin:!G&&N,canUnpin:!G&&b,canDelete:M,canEdit:!q&&k,canForward:!G&&K,canFaveSticker:!G&&Y,canUnfaveSticker:!G&&P,canCopy:ce||!se&&T,canCopyLink:!G&&D,canSelect:F,canDownload:!se&&E,canSaveGif:!se&&L,canRevote:B,canClosePoll:!G&&O,activeDownloads:h,canShowSeenBy:oe,canLoadReadDate:J,shouldRenderShowWhen:H,enabledReactions:m?.isForbidden?void 0:g?.enabledReactions,reactionsLimit:I,isPrivate:p,isCurrentUserPremium:re,hasFullInfo:Boolean(g),canShowReactionsCount:ie,canShowReactionList:!(te||ae||G||m?.id===s.zv8||ne),canBuyPremium:!re&&!(0,r.n_C)(e),customEmojiSetsInfo:le,customEmojiSets:ue,canScheduleUntilOnline:(0,r.RBq)(e,t.chatId),canTranslate:pe,canShowOriginal:me&&!ge,canSelectLanguage:me&&!ge,isMessageTranslated:me,canPlayAnimatedEmojis:(0,r.BWX)(e),isReactionPickerOpen:(0,r.Ani)(e),isInSavedMessages:fe,isChannel:V,canReplyInChat:ee,isWithPaidReaction:g?.isPaidReactionAvailable,poll:Ae,story:Ce,userFullName:A,canGift:ye}}))((({threadId:e,availableReactions:t,topReactions:n,defaultTagReactions:r,isOpen:u,messageListType:h,message:m,customEmojiSetsInfo:p,customEmojiSets:S,album:I,poll:b,story:M,anchor:x,targetHref:k,noOptions:Y,canSendNow:P,hasFullInfo:T,canReschedule:D,canReply:F,canPin:E,repliesThreadInfo:L,canUnpin:B,canDelete:O,canShowReactionsCount:K,chat:_,canReport:U,canShowReactionList:$,canEdit:j,enabledReactions:z,reactionsLimit:J,isPrivate:H,isCurrentUserPremium:q,canForward:Z,canBuyPremium:X,canFaveSticker:Q,canUnfaveSticker:ee,canCopy:te,canCopyLink:ne,canSelect:oe,canDownload:ae,canSaveGif:ie,canRevote:se,canClosePoll:ce,canPlayAnimatedEmojis:re,canLoadReadDate:le,shouldRenderShowWhen:de,activeDownloads:ue,noReplies:he,canShowSeenBy:me,canScheduleUntilOnline:pe,canTranslate:ge,isMessageTranslated:fe,canShowOriginal:Ae,canSelectLanguage:ve,isReactionPickerOpen:Ce,isInSavedMessages:ye,canReplyInChat:Se,isWithPaidReaction:Ie,userFullName:Re,canGift:we,className:Ne,onClose:be,onCloseAnimationEnd:Me})=>{const{openThread:xe,updateDraftReplyInfo:ke,setEditingId:Ye,pinMessage:Pe,openForwardMenu:Te,openReplyMenu:De,faveSticker:Fe,unfaveSticker:Ee,toggleMessageSelection:Le,sendScheduledMessages:Be,rescheduleMessage:Oe,downloadMedia:Ke,cancelMediaDownload:_e,loadSeenBy:Ue,openSeenByModal:$e,openReactorListModal:je,loadFullChat:ze,loadReactors:Je,copyMessagesByIds:He,saveGif:qe,loadStickers:Ge,cancelPollVote:Ve,closePoll:We,toggleReaction:Ze,requestMessageTranslation:Xe,showOriginalMessage:Qe,openChatLanguageModal:et,openMessageReactionPicker:tt,openPremiumModal:nt,loadOutboxReadDate:ot,copyMessageLink:at,openDeleteMessageModal:it,addLocalPaidReaction:st,openPaidReactionModal:ct,reportMessages:rt}=(0,a.ko)(),lt=(0,v.A)(),{ref:dt}=(0,y.A)({isOpen:u,onCloseAnimationEnd:Me,className:!1}),[ut,ht]=(0,o.J0)(!0),[mt,pt]=(0,o.J0)(!1),[gt,ft,At]=(0,f.A)(),[vt,Ct]=(0,o.J0)(W),[yt,St]=(0,C.A)(pe,be,m.date),It=void 0===p||Boolean(p.length);(0,o.vJ)((()=>{me&&u&&Ue({chatId:m.chatId,messageId:m.id})}),[Ue,u,m.chatId,m.id,me]),(0,o.vJ)((()=>{le&&u&&ot({chatId:m.chatId,messageId:m.id})}),[le,u,m.chatId,m.id,m.readDate]),(0,o.vJ)((()=>{K&&u&&Je({chatId:m.chatId,messageId:m.id})}),[K,u,Je,m.chatId,m.id]),(0,o.vJ)((()=>{p?.length&&S?.length!==p.length&&p.forEach((e=>{Ge({stickerSetInfo:e})}))}),[p,S,Ge]),(0,o.vJ)((()=>{T||H||!u||ze({chatId:m.chatId})}),[T,u,H,ze,m.chatId]);const Rt=(0,o.Kr)((()=>{const e=(0,a.mS)().chats.byId,t=(0,a.mS)().users.byId;if(m.reactions?.recentReactions?.length){const n=new Set(m.reactions?.recentReactions?.map((({peerId:n})=>t[n]||e[n])));return Array.from(n).filter(Boolean).slice(0,s.dqH)}if(m.seenByDates)return Object.keys(m.seenByDates).slice(0,s.dqH).map((n=>t[n]||e[n])).filter(Boolean)}),[m.reactions?.recentReactions,m.seenByDates]),wt=(0,o.Kr)((()=>{if(I)return I.messages.some((e=>{const t=(0,c.ed)(e);return!!t&&(0,c.$r)(ue,t)}));const e=(0,c.ed)(m);return!!e&&(0,c.$r)(ue,e)}),[ue,I,m]),Nt=F&&V?.rangeCount?V.getRangeAt(0):void 0;(0,o.vJ)((()=>{if(fe)return void Ct(W);if(!Nt||Nt.collapsed||!Boolean(m.content.text?.text)||!function(e){const t=e.commonAncestorContainer,n=t.nodeType===Node.TEXT_NODE?t.parentNode:t;return Boolean(n.closest(".message-content-wrapper .text-content"))&&!(Boolean(n.closest(".EmbeddedMessage"))||Boolean(n.closest(".WebPage")))}(Nt))return void Ct(W);const e=g(Nt),t=m.content.text.text.replace(/\u00A0/g," ");e.text.trim().length>0&&t.includes(e.text)?Ct(Nt.startOffset):Ct(W)}),[Nt,Nt?.collapsed,Nt?.startOffset,Nt?.endOffset,fe,m.content.text]);const bt=(0,A.A)((()=>{ht(!1),be()})),Mt=(0,A.A)((()=>{ht(!1),bt();const e=I?.messages?I.messages.map((({id:e})=>e)):[m.id];it({chatId:m.chatId,messageIds:e,isSchedule:"scheduled"===h})})),xt=(0,A.A)((()=>{pt(!1),be()})),kt=(0,A.A)((()=>{const e=vt!==W&&Nt?g(Nt):void 0;Se?ke({replyToMsgId:m.id,quoteText:e,quoteOffset:vt,replyToPeerId:void 0}):De({fromChatId:m.chatId,messageId:m.id,quoteText:e,quoteOffset:vt}),bt()})),Yt=(0,A.A)((()=>{xe({chatId:m.chatId,threadId:m.id}),bt()})),Pt=(0,A.A)((()=>{Ye({messageId:m.id}),bt()})),Tt=(0,A.A)((()=>{ht(!1),pt(!0)})),Dt=(0,A.A)((()=>{Pe({chatId:m.chatId,messageId:m.id,isUnpin:!0}),bt()})),Ft=(0,A.A)((()=>{if(bt(),I?.messages){const e=I.messages.map((({id:e})=>e));Te({fromChatId:m.chatId,messageIds:e})}else Te({fromChatId:m.chatId,messageIds:[m.id]})})),Et=(0,A.A)((()=>{bt(),Fe({sticker:m.content.sticker})})),Lt=(0,A.A)((()=>{bt(),Ee({sticker:m.content.sticker})})),Bt=(0,A.A)((()=>{bt(),Ve({chatId:m.chatId,messageId:m.id})})),Ot=(0,A.A)((()=>{bt(),We({chatId:m.chatId,messageId:m.id})})),Kt=(0,A.A)((()=>{const e=I?.messages?{messageId:m.id,childMessageIds:I.messages.map((({id:e})=>e)),withShift:!1}:{messageId:m.id,withShift:!1};Le(e),bt()})),_t=(0,A.A)((()=>{Be({chatId:m.chatId,id:m.id}),bt()})),Ut=(0,A.A)((e=>{Oe({chatId:m.chatId,messageId:m.id,scheduledAt:e}),be()})),$t=(0,A.A)((()=>{ht(!1),yt(Ut)})),jt=(0,A.A)((()=>{bt(),$e({chatId:m.chatId,messageId:m.id})})),zt=(0,A.A)((()=>{bt(),je({chatId:m.chatId,messageId:m.id})})),Jt=(0,A.A)((e=>{He({messageIds:e}),bt()})),Ht=(0,A.A)((()=>{at({chatId:m.chatId,messageId:m.id,shouldIncludeThread:e!==i.l3,shouldIncludeGrouped:!0}),bt()})),qt=(0,A.A)((()=>{(0,d.eM)(m.content.contact.phoneNumber),bt()})),Gt=(0,A.A)((()=>{(I?.messages||[m]).forEach((e=>{const t=(0,c.ed)(e);t&&(wt?_e({media:t}):Ke({media:t,originMessage:e}))})),bt()})),Vt=(0,A.A)((()=>{const e=(0,c.zX)(m);qe({gif:e}),bt()})),Wt=(0,A.A)((e=>{ye&&!q?nt({initialSection:"saved_tags"}):Ze({chatId:m.chatId,messageId:m.id,reaction:e,shouldAddToRecent:!0}),bt()})),Zt=(0,A.A)((()=>{st({chatId:m.chatId,messageId:m.id,count:1}),bt()})),Xt=(0,A.A)((()=>{ct({chatId:m.chatId,messageId:m.id}),bt()})),Qt=(0,A.A)((e=>{tt({chatId:m.chatId,messageId:m.id,position:e})})),en=(0,A.A)((()=>{Xe({chatId:m.chatId,id:m.id}),bt()})),tn=(0,A.A)((()=>{Qe({chatId:m.chatId,id:m.id}),bt()})),nn=(0,A.A)((()=>{et({chatId:m.chatId,messageId:m.id}),bt()})),on=(0,o.Kr)((()=>(I?I.messages:[m]).map((({id:e})=>e))),[I,m]),an=(0,A.A)((()=>{_&&(ht(!1),be(),rt({chatId:_.id,messageIds:on}))}));if(Y)return void bt();const sn=new Date;return sn.setFullYear(sn.getFullYear()+1),(0,R.FD)("div",{ref:dt,className:(0,l.A)("ContextMenuContainer",Ne),children:[(0,R.Y)(G,{isReactionPickerOpen:Ce,availableReactions:t,topReactions:n,defaultTagReactions:r,isWithPaidReaction:Ie,message:m,isPrivate:H,isCurrentUserPremium:q,canBuyPremium:X,isOpen:ut,enabledReactions:z,reactionsLimit:J,anchor:x,targetHref:k,canShowReactionsCount:K,canShowReactionList:$,canSendNow:P,canReschedule:D,canReply:F,canQuote:vt!==W,canDelete:O,canPin:E,canReport:U,repliesThreadInfo:L,canUnpin:B,canEdit:j,canForward:Z,canFaveSticker:Q,canUnfaveSticker:ee,canCopy:te,canCopyLink:ne,canSelect:oe,canDownload:ae,canSaveGif:ie,canRevote:se,canClosePoll:ce,canShowSeenBy:me,canTranslate:ge,canShowOriginal:Ae,canSelectLanguage:ve,canPlayAnimatedEmojis:re,shouldRenderShowWhen:de,canLoadReadDate:le,hasCustomEmoji:It,customEmojiSets:S,isDownloading:wt,seenByRecentPeers:Rt,isInSavedMessages:ye,noReplies:he,poll:b,story:M,onOpenThread:Yt,onReply:kt,onEdit:Pt,onPin:Tt,onUnpin:Dt,onForward:Ft,onDelete:Mt,onReport:an,onFaveSticker:Et,onUnfaveSticker:Lt,onSelect:Kt,onSend:_t,onReschedule:$t,onClose:bt,onCopyLink:Ht,onCopyMessages:Jt,onCopyNumber:qt,onDownload:Gt,onSaveGif:Vt,onCancelVote:Bt,onClosePoll:ft,onShowSeenBy:jt,onToggleReaction:Wt,onSendPaidReaction:Zt,onShowPaidReactionModal:Xt,onShowReactors:zt,onReactionPickerOpen:Qt,onTranslate:en,onShowOriginal:tn,onSelectLanguage:nn,userFullName:Re,canGift:we}),(0,R.Y)(w,{isOpen:mt,messageId:m.id,chatId:m.chatId,onClose:xt}),(0,R.Y)(N.A,{isOpen:gt,onClose:At,text:lt("lng_polls_stop_warning"),confirmLabel:lt("lng_polls_stop_sure"),confirmHandler:Ot}),D&&St]})})))}}]);
//# sourceMappingURL=4995.7360224f9c005fcf57b9.js.map