2 lines
120 KiB
JavaScript
2 lines
120 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[390],{101(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(87679),a=n(56863);function s(e){const t=(0,o.li)(),{result:n}=(0,a.A)(()=>{if(!e)return Promise.resolve(void 0);t.current&&URL.revokeObjectURL(t.current);const n=URL.createObjectURL(e);return t.current=n,(0,i.NN)(n)},[e]);return(0,o.vJ)(()=>()=>{t.current&&(URL.revokeObjectURL(t.current),t.current=void 0)},[]),{image:n}}},537(e,t,n){n.d(t,{A:()=>i});var o=n(84051);function i(e,t){const n=(0,o.li)(0);return(0,o.Kr)(()=>{t||(n.current+=1)},[...e]),n.current}},2578(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(39351),a=n(20021);const s=(0,o.ph)(({fakeType:e})=>{const t=(0,i.A)();return(0,a.Y)("span",{className:"FakeIcon",children:t("fake"===e?"FakeMessage":"ScamMessage")})})},7065(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(31481),a=n(87357),s=n(85449),r=n(39351),c=n(87412),l=n(18276),d=n(64493);const u={root:"XeRnHctE",button:"TwpITaqZ",cornerIcon:"GeJoOL5b",leftIcon:"o6PKoyTG",inlineButtonText:"H0WzDNYw",row:"tjRjLPPY",primaryTint:"xEZgdShr",successTint:"w0FLwaSo",destructiveTint:"_qPaYzWp",customEmojiIcon:"uu_z24Z9"};var h=n(20021);const m=(0,o.ph)(({className:e,inlineButtons:t,onClick:n})=>{const m=(0,r.A)(),p=e=>{const{type:t}=e;switch(t){case"url":{const{url:t}=e;return t.startsWith(i.jsp)&&t.includes("?startapp")?(0,h.Y)(l.A,{className:u.cornerIcon,name:"webapp"}):i.OFc.test(t)?void 0:(0,h.Y)(l.A,{className:u.cornerIcon,name:"arrow-right"})}case"urlAuth":return(0,h.Y)(l.A,{className:u.cornerIcon,name:"arrow-right"});case"buy":case"receipt":return(0,h.Y)(l.A,{className:u.cornerIcon,name:"card"});case"switchBotInline":return(0,h.Y)(l.A,{className:u.cornerIcon,name:"share-filled"});case"webView":case"simpleWebView":return(0,h.Y)(l.A,{className:u.cornerIcon,name:"webapp"});case"copy":return(0,h.Y)(l.A,{className:u.cornerIcon,name:"copy"});case"suggestedMessage":if("suggestChanges"===e.buttonType)return(0,h.Y)(l.A,{className:u.leftIcon,name:"edit"});if("approve"===e.buttonType)return(0,h.Y)(l.A,{className:u.leftIcon,name:"check"});if("decline"===e.buttonType)return(0,h.Y)(l.A,{className:u.leftIcon,name:"close"});break;case"giftOffer":if("accept"===e.buttonType)return(0,h.Y)(l.A,{className:u.leftIcon,name:"check"});if("reject"===e.buttonType)return(0,h.Y)(l.A,{className:u.leftIcon,name:"close"})}},g=(0,o.Kr)(()=>{const e=[];return t.forEach(t=>{e.push(t.map(e=>(0,s.A)(m,e)))}),e},[m,t]);return(0,h.Y)("div",{className:(0,a.A)(u.root,e),children:t.map((e,t)=>(0,h.Y)("div",{className:u.row,children:e.map((e,o)=>(0,h.FD)(d.A,{className:(0,a.A)(u.button,e.style?.type&&u[`${e.style.type}Tint`]),size:"tiny",ripple:!0,noForcedUpperCase:!0,disabled:"unsupported"===e.type||"suggestedMessage"===e.type&&e.disabled,onClick:()=>n(e),children:[p(e),(0,h.FD)("span",{className:u.inlineButtonText,children:[e.style?.iconId&&(0,h.Y)(c.A,{className:u.customEmojiIcon,documentId:e.style.iconId,size:16}),g[t][o]]})]}))}))})})},9718(e,t,n){n.d(t,{A:()=>i});var o=n(96454);const i=(e,t)=>{o.pz&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),o.pz&&(e.style.overflow="")}},10187(e,t,n){n.d(t,{A:()=>g});var o=n(84051),i=n(13439),a=n(70636),s=n(11597),r=n(87357),c=n(95807),l=n(39351),d=n(39996),u=n(21849),h=n(34431),m=n(18276);var p=n(20021);const g=(0,o.ph)((0,i.EK)((e,{peerId:t,forceShowSelf:n})=>{const o=(0,s.SJA)(e);if(!t)return{peer:void 0,isSavedMessages:void 0,theme:o};const i=(0,s.PVB)(e,t),a=(0,s.mBe)(e,t);return{peer:i,isSavedMessages:!n&&a&&a.isSelf,theme:o}})(({icon:e,title:t,isMinimized:n,canClose:o,isCloseNonDestructive:i,clickArg:s,peer:g,mockPeer:f,customPeer:A,className:v,isSavedMessages:y,withPeerColors:C,withEmojiStatus:I,itemClassName:S,theme:w,onClick:N})=>{const b=(0,l.A)(),k=f||g,R=A||k,{className:M,style:P}=(0,d.Ay)({peer:R,theme:w}),Y=k&&(0,a.vj)(k)?k:void 0;let T,x,F;e&&t?(T=(0,p.Y)("div",{className:"NtoGLT22",children:(0,p.Y)(m.A,{name:e,style:"f91Ad80i"})}),x=t):R&&(T=(0,p.Y)(u.A,{className:"La8BQ9yr",peer:R,size:"small",isSavedMessages:y}),F=(0,a.F9)(b,R)||t,x=t||(0,p.Y)(h.A,{peer:R,isSavedMessages:y,withEmojiStatus:I}));const D=(0,r.A)("_Lq6_4e5",(Y?.isForum||A?.isAvatarSquare)&&"JIHfTUVn",n&&"UhOZvxvs",o&&"uvvgSFUJ",i&&"fAk5yEeV",!N&&"P8r3OoaX",C&&M,v),E=(0,c.A)(C&&P);return(0,p.FD)("div",{className:D,style:E,onClick:()=>N?.(s),title:n?F:void 0,dir:b.isRtl?"rtl":void 0,children:[T,!n&&(0,p.Y)("div",{className:(0,r.A)("XPVuH29G",S),dir:"auto",children:x}),o&&(0,p.Y)("div",{className:"xVPG2UTy",children:(0,p.Y)(m.A,{name:"close"})})]})}))},11241(e,t,n){n.d(t,{A:()=>b});var o=n(84051),i=n(13439),a=n(90709),s=n(11597),r=n(87357),c=n(43336),l=n(76023),d=n(37661),u=n(5912),h=n(17712),m=n(62587),p=n(50680),g=n(45294),f=n(18104),A=n(87412),v=n(83594),y=n(17794),C=n(93879),I=n(20021);const S=1.5*l.$,w=6.5*l.$,N=l.$,b=(0,o.ph)((0,i.EK)((e,{containerId:t})=>{const{genericEmojiEffects:n,reactions:o}=e,{activeReactions:i}=(0,s.nTw)(e),a=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:i?.[t],availableReactions:o.availableReactions,genericEffects:n,withEffects:a}})(({containerId:e,reaction:t,className:n,size:s=S,effectSize:l=w,activeReactions:b,availableReactions:k,genericEffects:R,withEffects:M,withEffectOnly:P,shouldPause:Y,shouldLoop:T,loopLimit:x,observeIntersection:F})=>{const{stopActiveReaction:D}=(0,i.ko)(),E=(0,o.li)(),B="custom"===t.type,L=(0,o.Kr)(()=>k?.find(e=>(0,a.a0)(e.reaction,t)),[k,t]),O=L?.centerIcon?.id,{customEmoji:U}=(0,g.A)(B?t.documentId:void 0),G=(0,o.Kr)(()=>{if(!B)return L?.aroundAnimation?.id;if(!U)return;const e=k?.find(e=>e.reaction.emoticon===U.emoji)?.aroundAnimation?.id;return e},[L,k,U,B]),K=(0,o.Kr)(()=>{if(G)return G;if(!R?.stickers)return;const{stickers:e}=R;return e[Math.floor(Math.random()*e.length)].id},[G,R]),j=(0,u.Vz)(E,F),z=O&&(0,a.aL)(O),$=K&&(0,a.aL)(K),V=(0,m.A)(z),_=(0,m.A)($),J=(0,o.Kr)(()=>b?.find(e=>(0,a.a0)(e,t)),[b,t]),H=Boolean(M&&J&&(B||V)&&_),W=j&&(H&&!P||T),{shouldRender:q,transitionClassNames:X}=(0,p.A)(H,void 0,!0,"slow"),{shouldRender:Q,transitionClassNames:Z}=(0,p.A)(W,void 0,!0,"slow"),ee=(0,h.A)(()=>{D({containerId:e,reaction:t})}),[te,ne,oe]=(0,d.A)(),ie=!(B||W&&te),{shouldRender:ae,transitionClassNames:se}=(0,p.A)(ie,void 0,!0),re=(0,r.A)(C.A.root,q&&C.A.animating,P&&C.A.withEffectOnly,n);return(0,I.FD)("div",{className:re,ref:E,children:[!P&&ae&&(0,I.Y)(y.A,{className:se,reaction:t,availableReactions:k,size:s,observeIntersection:F}),!P&&B&&(0,I.Y)(A.A,{documentId:t.documentId,className:C.A.customEmoji,size:s,noPlay:Y,noVideoOnMobile:!0,loopLimit:x,observeIntersectionForPlaying:F,forceAlways:!0}),Q&&!B&&(0,I.Y)(f.A,{className:(0,r.A)(C.A.animatedIcon,Z),size:(0,c.Ki)(1.9*s),tgsUrl:V,play:j&&!Y,noLoop:!T,onLoad:ne,onEnded:oe,forceAlways:!0},`${O}-${s}`),q&&(0,I.FD)(I.FK,{children:[(0,I.Y)(f.A,{className:(0,r.A)(C.A.effect,X),size:l,tgsUrl:_,play:j,noLoop:!0,onEnded:ee,forceAlways:!0},`${K}-${l}`),B&&!G&&j&&(0,I.Y)(v.A,{reaction:t,className:X,particleSize:Math.max(.5*s,N),onEnded:ee})]})]})}))},14737(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(17712);const a=function(e,t){const n=(0,i.A)(e);(0,o.vJ)(()=>{if("number"!=typeof t)return;const e=setTimeout(()=>n(),t);return()=>clearTimeout(e)},[t])}},15379(e,t,n){n.d(t,{Ay:()=>r,Ee:()=>l,Vb:()=>s,j5:()=>d,to:()=>a,w1:()=>c});var o=n(21309);const i={everyminute:o.pY,every5minutes:5*o.pY,daily:o.d_,weekly:o.V8,biweekly:2*o.V8,monthly:o.Lp,every3months:91*o.d_,every6months:182*o.d_,yearly:365*o.d_},a=["never",...Object.keys(i)],s=new Set(["everyminute","every5minutes"]);function r(e){if(e&&"never"!==e)return i[e]}function c(e){if(e)return Object.keys(i).find(t=>i[t]===e)}function l(e,t){if(!e)return;const n=c(e);if(n)switch(n){case"everyminute":return t("MessageRepeatPeriodEveryMinutes",{count:1},{pluralValue:1});case"every5minutes":return t("MessageRepeatPeriodEveryMinutes",{count:5},{pluralValue:5});case"daily":return t("MessageRepeatPeriodDaily");case"weekly":return t("MessageRepeatPeriodWeekly");case"biweekly":return t("MessageRepeatPeriodBiweekly");case"monthly":return t("MessageRepeatPeriodMonthly");case"every3months":return t("MessageRepeatPeriodEveryMonths",{count:3},{pluralValue:3});case"every6months":return t("MessageRepeatPeriodEveryMonths",{count:6},{pluralValue:6});case"yearly":return t("MessageRepeatPeriodYearly");default:return}}function d(e,t){switch(e){case"never":default:return t("ScheduleRepeatNever");case"everyminute":return t("ScheduleRepeatEveryMinutes",{count:1},{pluralValue:1});case"every5minutes":return t("ScheduleRepeatEveryMinutes",{count:5},{pluralValue:5});case"daily":return t("ScheduleRepeatDaily");case"weekly":return t("ScheduleRepeatWeekly");case"biweekly":return t("ScheduleRepeatBiweekly");case"monthly":return t("ScheduleRepeatMonthly");case"every3months":return t("ScheduleRepeatEveryMonths",{count:3},{pluralValue:3});case"every6months":return t("ScheduleRepeatEveryMonths",{count:6},{pluralValue:6});case"yearly":return t("ScheduleRepeatYearly")}}},15535(e,t,n){n.d(t,{A:()=>f});var o=n(84051),i=n(31481),a=n(66644),s=n(63495),r=n(96454),c=n(87357),l=n(83868),d=n(14737),u=n(43874),h=n(39351),m=n(64493),p=n(18276),g=n(20021);const f=(0,o.ph)(({isLoading:e=!1,isPasswordVisible:t,error:n,hint:f,placeholder:A,submitLabel:v,description:y,shouldShowSubmit:C,shouldResetValue:I,shouldDisablePasswordManager:S=!1,noRipple:w=!1,onClearError:N,onChangePasswordVisibility:b,onInputChange:k,onSubmit:R})=>{const M=(0,o.li)(),P=(0,h.A)(),{isMobile:Y}=(0,u.Ay)(),[T,x]=(0,o.J0)(""),[F,D]=(0,o.J0)(!1),E=Y?550:400;return(0,o.vJ)(()=>{I&&x("")},[I]),(0,d.A)(()=>{r.TF||M.current.focus()},E),(0,o.vJ)(()=>{n&&(0,a.RK)(()=>{M.current.focus(),M.current.select()})},[n]),(0,g.FD)("form",{action:"",onSubmit:R?function(t){t.preventDefault(),e||F&&R(T)}:l.A,autoComplete:"off",children:[(0,g.FD)("div",{className:(0,c.A)("input-group password-input",T&&"touched",n&&"error"),dir:P.isRtl?"rtl":void 0,children:[S&&(0,g.Y)("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),(0,g.Y)("input",{ref:M,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:T||"",autoComplete:S?"one-time-code":"current-password",spellCheck:!s.Vq&&void 0,onChange:function(e){n&&N();const{target:t}=e;x(t.value),D(t.value.length>=i.AGC),k&&k(t.value)},maxLength:256,dir:"auto"}),(0,g.Y)("label",{children:n||f||A||P("PasswordFormPlaceholder")}),(0,g.Y)("div",{className:"div-button toggle-password",onClick:function(){b(!t)},role:"button",tabIndex:0,title:P("AriaPasswordToggle"),"aria-label":P("AriaPasswordToggle"),children:(0,g.Y)(p.A,{name:t?"eye":"eye-crossed"})})]}),y&&(0,g.Y)("p",{className:"description",children:y}),R&&(F||C)&&(0,g.Y)(m.A,{type:"submit",ripple:!w,isLoading:e,disabled:!F,children:v||P("PasswordFormSubmit")})]})})},15640(e,t,n){function o(e){return"touches"in e?{x:e.touches[0].clientX,y:e.touches[0].clientY}:{x:e.clientX,y:e.clientY}}n.d(t,{A:()=>o})},17794(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(90709),a=n(87357),s=n(2338),r=n(62587),c=n(37960),l=n(87412),d=n(18276),u=n(61911),h=n(20021);const m=(0,o.ph)(({reaction:e,availableReactions:t,className:n,size:m,withIconHeart:p,observeIntersection:g})=>{const f=(0,o.Kr)(()=>t?.find(t=>(0,i.a0)(t.reaction,e)),[t,e]),A=f?.staticIcon,v=A?.id,y=v?`document${v}`:void 0,C=f?.isLocalCache?0:1,I=(0,r.A)(y,!1,void 0,void 0,C),S=(0,s.A)(A?.thumbnail),{ref:w}=(0,c.A)({hasMediaData:Boolean(S&&!I)}),{ref:N}=(0,c.A)({hasMediaData:Boolean(I)}),b="emoji"===e.type&&"🦄"===e.emoticon,k=p&&"emoji"===e.type&&"❤"===e.emoticon;return"custom"===e.type?(0,h.Y)(l.A,{documentId:e.documentId,className:(0,a.A)("ReactionStaticEmoji",n),size:m,observeIntersectionForPlaying:g}):k?(0,h.Y)(d.A,{name:"heart",className:"ReactionStaticEmoji",style:`font-size: ${m}px; width: ${m}px`}):(0,h.FD)("div",{className:(0,a.A)("ReactionStaticEmoji",n),style:m?`width: ${m}px; height: ${m}px`:void 0,children:[(0,h.Y)("img",{ref:w,className:"thumb",src:S,alt:"",draggable:!1}),(0,h.Y)("img",{ref:N,className:(0,a.A)("media",b&&"with-unicorn-fix"),src:I||u,alt:f?.title,draggable:!1})]})})},20333(e,t,n){n.d(t,{A:()=>C});var o=n(84051),i=n(87357),a=n(95807),s=n(76023),r=n(537),c=n(30857),l=n(39351),d=n(29886),u=n(93545),h=n(35297),m=n(41036),p=n(18276);const g="HS9PzRKt",f="_b5HgBXr",A="P6mch4bB",v="xdKGgbKQ";var y=n(20021);const C=(0,o.ph)(({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:C,progress:I=0,isPrimary:S,isNegative:w,isInverted:N,shouldSkipGradient:b,animationDirection:k="none",className:R})=>{const M=(0,o.li)(),P=(0,o.li)(),[Y,T]=(0,o.J0)(0),[x,F]=(0,o.J0)(0),[D,E]=(0,o.J0)(0),B=(0,d.A)(D),[L,O]=(0,o.J0)(w?0:I),[U,G]=(0,o.J0)(w?I:0),[K,j]=(0,o.J0)(I),[z,$]=(0,o.J0)(0),[V,_]=(0,o.J0)(!1),[J,H]=(0,o.J0)(!1),[W,q]=(0,o.J0)(!1),[X,Q]=(0,o.J0)(!1),[Z,ee]=(0,o.J0)(!1),te=(0,r.A)([n,C]),ne=(0,o.li)(!1),oe=(0,d.A)(e),ie=(0,d.A)(t),ae=(0,d.A)(w),se=(0,l.A)(),re=14+s.$,ce=1.5*s.$,le=()=>{if(M.current&&P.current){const e=P.current.offsetWidth,t=D/2,n=t,o=e-t,i=14,a=(N||w?1-K:K)*e;let s=Math.max(n,Math.min(a,o));a<re&&(s=a+t),a>e-re&&(s=a-t);const r=t+(a-s)-i;T(s/e),F(r)}};(0,o.vJ)(le,[K,D,w,N,re]),(0,u.A)(P,le),(0,o.vJ)(()=>{E((M?.current?.clientWidth||0)+ce)},[n,C,ce]);const de=(0,c.A)();(0,h.A)(()=>{let e;if((oe||ie)&&(void 0!==ae&&ae!==w||Z)&&!ne.current){ne.current=!0;const t=Z?800:400;e=window.setTimeout(()=>{ne.current=!1,de()},t)}return()=>{e&&(clearTimeout(e),ne.current=!1)}},[e,oe,t,ie,ae,w,k,Z]);const ue=ne.current;(0,o.vJ)(()=>{w?(O(0),G(I)):(G(0),O(I)),j(I)},[I,w]);const he=Boolean(C||n),me=ue?oe:e,pe=ue?ie:t,ge=(0,d.A)(I);(0,o.vJ)(()=>{const e=[];if("none"===k||void 0===ge)return;const t=I,n=e=>{w?G(e):O(e)};if("forward"===k||"backward"===k){const o="forward"===k;ee(!0),n(o?1:0),q(!0),$(o?0:1),e.push(window.setTimeout(()=>{q(!1),_(!0),$(t),o&&(H(!0),n(0))},400)),e.push(window.setTimeout(()=>{H(!0),q(!0),Q(!1),n(t),_(!1),e.push(window.setTimeout(()=>{H(!1),q(!1),ee(!1)},50))},800))}return()=>{e.forEach(clearTimeout)}},[I,k,w,ge,800]);const fe=(e,t,n,o)=>{const a=e?"MzFvyMb5":"S6H6hBpP";return(0,y.FD)("div",{className:(0,i.A)(a,n,o&&g),style:`--layer-progress: ${t}`,children:[(0,y.Y)("div",{className:f,children:(0,y.Y)("span",{children:me})}),(0,y.Y)("div",{className:A,children:(0,y.Y)("span",{children:pe})})]})};return(0,y.FD)("div",{ref:P,className:(0,i.A)("nY2ggBsF",he&&"RYtVQAjM",S&&"Zi0w7QJ3",w&&"dXs41qvC",N&&"Ef0g9liZ",b&&"dazw12V7",ue&&"I7toQztx",Z&&"SxTCkiyg",R),style:(0,a.A)(`--positive-progress: ${L}`,`--negative-progress: ${U}`,`--layer-progress: ${z}`,`--shift-x: ${Y}`,"--cycling-animation-badge-position: 800ms","--cycling-animation-progress: 400ms"),children:[he&&(0,y.Y)("div",{className:"dhigNjAq",children:(0,y.FD)("div",{className:"cOpfCGPh",children:[(0,y.Y)("div",{className:(0,i.A)("uNwBLNOy",(!B||0===B)&&g),style:`width: ${D}px;`,children:(0,y.Y)(m.Ay,{activeKey:te,name:"fade",shouldCleanup:!0,children:(0,y.FD)("div",{ref:M,className:"W4rqGyJl",children:[C&&(0,y.Y)(p.A,{name:C,className:"MJ7MTmxi"}),n&&(0,y.Y)("div",{className:"MwzZt3Qo",dir:se.isRtl?"rtl":void 0,children:n})]})})}),(0,y.Y)("div",{className:"qRwO7SZm",style:`left: ${x}px`,children:(0,y.Y)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:(0,y.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:"currentColor"})})})]})}),(0,y.Y)("div",{className:f,children:(0,y.Y)("span",{children:me})}),(0,y.Y)("div",{className:A,children:(0,y.Y)("span",{children:pe})}),(0,y.FD)("div",{className:"_B4r3D5W",children:[fe(!0,L,(0,i.A)(X&&v),J),fe(!1,U,(0,i.A)(X&&v),J),fe(!w,z,(0,i.A)(w?"QZwWHVdB":"VmyTBAzN",V&&"tkyw4hXo"),W)]})]})})},24531(e,t,n){n.d(t,{A:()=>p});var o=n(84051),i=n(31481),a=n(17663),s=n(15379),r=n(80140),c=n(17712),l=n(59030),d=n(80089),u=n(80464),h=n(20021);const m=e=>{const{isOpen:t}=e,n=(0,u.A)(d.ar.Extra,"CalendarModal",!t);return n?(0,h.Y)(n,{...e}):void 0},p=(e,t,n,d)=>{const u=(0,l.A)(),[p,g]=(0,o.J0)(),f=(0,c.A)((e,t)=>{const n=e.getTime()===1e3*i.NkL,o=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(n?0:(0,r.SF)()),a=(0,s.Ay)(t);p?.(o,a),g(void 0)}),A=(0,c.A)(()=>{f(new Date(1e3*i.NkL))}),v=(0,c.A)(()=>{g(void 0),t?.()}),y=(0,c.A)(e=>{g(()=>e)}),C=n?new Date(1e3*n):new Date;C.setSeconds(0),C.setMilliseconds(0);const I=new Date;I.setFullYear(I.getFullYear()+1);const S=(0,s.w1)(d);return[y,(0,h.Y)(m,{isOpen:Boolean(p),withTimePicker:!0,withRepeatMode:!0,initialRepeatMode:S,selectedAt:C.getTime(),maxAt:(0,a.CS)(I),isFutureMode:!0,secondButtonLabel:e?u("Schedule.SendWhenOnline"):void 0,onClose:v,onSubmit:f,onSecondButtonClick:e?A:void 0})]}},26875(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(87357),a=n(39351),s=n(21849);var r=n(20021);const c=(0,o.ph)(({peers:e,size:t,className:n,limit:c=3,badgeText:l})=>{const d=(0,a.A)(),u="number"==typeof t?t:s.R[t],h=(0,o.Kr)(()=>l||(!e?.length||e.length<=c?void 0:"+"+(e.length-c)),[l,e,c]);return(0,r.FD)("div",{className:(0,i.A)(n,"kXs18Nmi"),style:`--_size: ${u}px;`,dir:d.isRtl?"rtl":"ltr",children:[e?.slice(0,c).map(e=>(0,r.Y)(s.A,{size:t,peer:e,className:"XND8fhC1"})),h&&(0,r.Y)("div",{className:"SHyAyGFO",children:h})]})})},27860(e,t,n){n.d(t,{A:()=>h});var o=n(84051),i=n(66644),a=n(87357),s=n(45470),r=n(39351),c=n(17712),l=n(50680),d=n(18276);var u=n(20021);const h=(0,o.ph)(({isVisible:e,withAnimation:t,thumbDataUri:n,isNsfw:h,className:m,width:p,height:g})=>{const f=(0,o.li)(),A=(0,r.A)(),{shouldRender:v,transitionClassNames:y}=(0,l.A)(e,void 0,!0,!t&&void 0,void 0,500),C=(0,s.A)(n,!v,void 0,25,p,g),I=(0,c.A)(e=>{if(!f.current)return;const t=f.current,n=e.currentTarget.getBoundingClientRect(),o=e.clientX-n.left,a=e.clientY-n.top,s=o-n.width/2,r=a-n.height/2;(0,i.RK)(()=>{t.setAttribute("style",`--click-shift-x: ${s}px; --click-shift-y: ${r}px`)})});if(v)return(0,u.FD)("div",{className:(0,a.A)("qF2WgYVg",y,m,t&&"pNM3cgkY"),ref:f,onClick:t?I:void 0,children:[(0,u.Y)("canvas",{ref:C,className:"eULqS2yR",width:p,height:g}),(0,u.Y)("div",{className:"XBor45hE"}),h&&(0,u.FD)("span",{className:"FJGQoa6s",children:[(0,u.Y)(d.A,{name:"eye-crossed-outline",className:"Y7JVRkxJ"}),A("MediaSpoilerSensitive")]})]})})},31460(e,t,n){n.d(t,{P:()=>a});var o=n(31481),i=n(96454);function a(e,t,n=!1,a=!1){return n||t===o.dnp?"none":t===o.zHL?"slideFade":"slideOptimized"===e?a?"slideOptimizedRtl":"slideOptimized":"slide"===e?a?"slideRtl":"slide":i.Ni?"slideFade":i.pz?"slideLayers":"pushSlide"}},31722(e,t,n){n.d(t,{A:()=>o});const o={container:"YmM5biTv",header:"S7WFT2bv",pickerCategoryTitle:"YK1300x2",sectionHeader:"_9MIoEHj_",peerChip:"gsKPBPoK",pickerList:"yLCbiItq",padded:"bXzIGw8s",noResults:"dXWKD0ve",onlineStatus:"d5GDOYh9"}},32332(e,t,n){n.d(t,{E:()=>a,U:()=>s});var o=n(66644);let i=[];function a(e){i.push(e)}function s(e){(0,o.gm)(()=>{const t=e(),n=i;i=[];for(const e of n)(0,o.gm)(e);return t})}},32587(e,t,n){n.d(t,{A:()=>a});const o=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],i=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function a(e,t,n,a,s,r,c){if(Number.isNaN(r)||r<1)return;r|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const l=e.getImageData(t,n,a,s),d=l.data;let u,h,m,p,g,f,A,v,y,C,I,S,w=a-1,N=s-1,b=r+1,k=[],R=[],M=[],P=o[r],Y=i[r],T=[],x=[];for(;c-- >0;){for(S=I=0,g=0;g<s;g++){for(u=d[S]*b,h=d[S+1]*b,m=d[S+2]*b,f=1;f<=r;f++)A=S+((f>w?w:f)<<2),u+=d[A++],h+=d[A++],m+=d[A++];for(p=0;p<a;p++)k[I]=u,R[I]=h,M[I]=m,0==g&&(T[p]=((A=p+b)<w?A:w)<<2,x[p]=(A=p-r)>0?A<<2:0),v=S+T[p],y=S+x[p],u+=d[v++]-d[y++],h+=d[v++]-d[y++],m+=d[v++]-d[y++],I++;S+=a<<2}for(p=0;p<a;p++){for(C=p,u=k[C]*b,h=R[C]*b,m=M[C]*b,f=1;f<=r;f++)C+=f>N?0:a,u+=k[C],h+=R[C],m+=M[C];for(I=p<<2,g=0;g<s;g++)d[I]=u*P>>>Y,d[I+1]=h*P>>>Y,d[I+2]=m*P>>>Y,0==p&&(T[g]=((A=g+b)<N?A:N)*a,x[g]=(A=g-r)>0?A*a:0),v=p+T[g],y=p+x[g],u+=k[v]-k[y],h+=R[v]-R[y],m+=M[v]-M[y],I+=a<<2}}e.putImageData(l,t,n)}},34431(e,t,n){n.d(t,{A:()=>w});var o=n(84051),i=n(13439),a=n(31481),s=n(90709),r=n(70636),c=n(87357),l=n(95807),d=n(85982),u=n(83868),h=n(4961),m=n(39351),p=n(17712),g=n(59030),f=n(41036),A=n(87412),v=n(2578),y=n(95773),C=n(9267),I=n(20021);const S=()=>(0,I.FD)("svg",{className:"VerifiedIcon",viewBox:"0 0 24 24",children:[(0,I.Y)("path",{d:"M12.3 2.9c.1.1.2.1.3.2.7.6 1.3 1.1 2 1.7.3.2.6.4.9.4.9.1 1.7.2 2.6.2.5 0 .6.1.7.7.1.9.1 1.8.2 2.6 0 .4.2.7.4 1 .6.7 1.1 1.3 1.7 2 .3.4.3.5 0 .8-.5.6-1.1 1.3-1.6 1.9-.3.3-.5.7-.5 1.2-.1.8-.2 1.7-.2 2.5 0 .4-.2.5-.6.6-.8 0-1.6.1-2.5.2-.5 0-1 .2-1.4.5-.6.5-1.3 1.1-1.9 1.6-.3.3-.5.3-.8 0-.7-.6-1.4-1.2-2-1.8-.3-.2-.6-.4-.9-.4-.9-.1-1.8-.2-2.7-.2-.4 0-.5-.2-.6-.5 0-.9-.1-1.7-.2-2.6 0-.4-.2-.8-.4-1.1-.6-.6-1.1-1.3-1.6-2-.4-.4-.3-.5 0-1 .6-.6 1.1-1.3 1.7-1.9.3-.3.4-.6.4-1 0-.8.1-1.6.2-2.5 0-.5.1-.6.6-.6.9-.1 1.7-.1 2.6-.2.4 0 .7-.2 1-.4.7-.6 1.4-1.2 2.1-1.7.1-.2.3-.3.5-.2z",style:"fill: var(--color-fill)"}),(0,I.Y)("path",{d:"M16.4 10.1l-.2.2-5.4 5.4c-.1.1-.2.2-.4 0l-2.6-2.6c-.2-.2-.1-.3 0-.4.2-.2.5-.6.7-.6.3 0 .5.4.7.6l1.1 1.1c.2.2.3.2.5 0l4.3-4.3c.2-.2.4-.3.6 0 .1.2.3.3.4.5.2 0 .3.1.3.1z",style:"fill: var(--color-checkmark)"})]}),w=(0,o.ph)(({className:e,style:t,peer:n,noVerified:w,noFake:N,withEmojiStatus:b,emojiStatusSize:k,isSavedMessages:R,isSavedDialog:M,noLoopLimit:P,canCopyTitle:Y,iconElement:T,isMonoforum:x,monoforumBadgeClassName:F,withStatusTextColor:D,onEmojiStatusClick:E,observeIntersection:B})=>{const{showNotification:L}=(0,i.ko)(),O=(0,g.A)(),U=(0,m.A)(),G="id"in n?n:void 0,K="isCustomPeer"in n?n:void 0,j=G&&(0,r.mO)(G),z=G&&(j?(0,s.Yg)(G):(0,s.Js)(O,G)),$=j&&G.isPremium||K?.isPremium,V=b&&!R,_=G?.emojiStatus||(K?.emojiStatusId?{type:"regular",documentId:K.emojiStatusId}:void 0),J=(0,p.A)(e=>{z&&Y&&((0,u.A)(e),(0,d.eM)(z),L({message:(j?"User":"Chat")+" name was copied"}))}),H=(0,o.Kr)(()=>K?(0,h.A)(K.title||O(K.titleKey)):R?O(M?"MyNotes":"SavedMessages"):(0,s.Qe)(G.id)?O("AnonymousForward"):(0,s.kE)(G.id)?O("RepliesTitle"):(0,s.Rl)(G.id)?O("VerifyCodesNotifications"):void 0,[K,M,R,O,G]),W=G?.botVerificationIconId;return(0,I.FD)("div",{className:(0,c.A)("title","QljEeKI5",e),style:(0,l.A)(k?`--_status-size: ${k}px`:void 0,t),children:[W&&(0,I.Y)(A.A,{documentId:W,size:k,loopLimit:P?void 0:a.J$1,observeIntersectionForLoading:B}),(0,I.Y)("h3",{dir:"auto",role:"button",className:(0,c.A)("fullName","AS54Cntu",Y&&"vr53L_9p"),onClick:J,children:H||(0,h.A)(z||"")}),!T&&n&&(0,I.FD)(I.FK,{children:[!w&&n?.isVerified&&(0,I.Y)(S,{}),!N&&n?.fakeType&&(0,I.Y)(v.A,{fakeType:n.fakeType}),V&&_&&(0,I.Y)(f.Ay,{className:"KBZgFSv7",slideClassName:"xmVxyvNy",activeKey:Number(_.documentId),name:"slideFade",direction:-1,shouldCleanup:!0,children:(0,I.Y)(y.A,{withSparkles:"collectible"===_.type,sparklesClassName:"statusSparkles",sparklesColor:"collectible"!==_.type||D?void 0:_.textColor,children:(0,I.Y)(A.A,{className:(0,c.A)("no-selection",!D&&"z1sLOAjr"),documentId:_.documentId,size:k,loopLimit:P?void 0:a.J$1,observeIntersectionForLoading:B,onClick:E})})}),V&&!_&&$&&(0,I.Y)(C.A,{}),x&&(0,I.Y)("div",{className:(0,c.A)("Sdwfc851",F),children:U("MonoforumBadge")})]}),T]})})},36838(e,t,n){n.d(t,{A:()=>i});var o=n(84051);const i=(e,t,n=!1)=>{(0,o.vJ)(()=>{if(t)return;const o=e.current;function i(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",i,{passive:!n}),()=>{o.removeEventListener("wheel",i)}},[e,t,n])}},40558(e,t,n){n.d(t,{A:()=>v});var o=n(84051),i=n(66644),a=n(90709),s=n(87357),r=n(95807),c=n(48894),l=n(87679),d=n(76023),u=n(56863),h=n(17712),m=n(62587),p=n(93545),g=n(38691);var f=n(20021);const A=4*d.$,v=(0,o.ph)(({backgroundColors:e,patternIcon:t,patternUrl:n,patternColor:d,patternSize:v=20,centerEmptiness:y=.1,ringsCount:C=3,ovalFactor:I=1.4,maxRadius:S=.42,withLinearGradient:w,clearBottomSector:N,className:b,canvasClassName:k,yPosition:R,withAdaptiveHeight:M})=>{const P=(0,o.li)(),Y=(0,o.li)(),[T,x]=(0,o.Ul)({width:0,height:0}),F=(0,g.A)(),D=t&&(0,a.Mw)(t,"preview"),E=(0,m.A)(D)||n,{result:B}=(0,u.A)(()=>E?(0,l.NN)(E):Promise.resolve(void 0),[E]),L=(0,o.Kr)(()=>{const e=[];for(let t=1;t<=C;t++){const n=Math.floor(8*(1+.5*(t-1))),o=t/C,i=y+(S-y)*o,a=t%2==0?Math.PI/n:0;for(let t=0;t<n;t++){const s=t/n*Math.PI*2+a;if(N&&s>.45*Math.PI&&s<.55*Math.PI)continue;const r=i*Math.cos(s)*I,c=i*Math.sin(s),l=1.65-o+Math.random()/C;e.push({x:r,y:c,sizeFactor:l})}}return e},[y,N,S,I,C]);(0,p.A)(P,e=>{x({width:e.contentRect.width,height:e.contentRect.height})}),(0,o.vJ)(()=>{const e=P.current;e&&x({width:e.clientWidth,height:e.clientHeight})},[x]);const O=(0,h.A)(()=>{const t=Y.current;if(!t||!B)return;const n=t.getContext("2d"),{width:o,height:i}=t;if(!o||!i)return;const a=o/2,s=M?i/2:void 0!==R?R*F:o/2;if(n.clearRect(0,0,o,i),L.forEach(({x:e,y:t,sizeFactor:r})=>{const c=e*Math.max(o,A*F)+a,l=t*Math.max(M?i:o,A*F)+s,d=v*F*r;n.drawImage(B,c-d/2,l-d/2,d,d)}),d)n.fillStyle=d;else{const t=e?.[1]??e?.[0]??"#000000",o=(0,c.LS)((0,c.xp)(t))<51;n.fillStyle=(0,c.VT)(t,.5,o?.28:-.28)}n.globalCompositeOperation="source-in",n.fillRect(0,0,o,i);const r=n.createRadialGradient(a,s,0,a,s,o*S);r.addColorStop(0,"rgb(255 255 255 / 0.4)"),r.addColorStop(1,"rgb(255 255 255 / 0.9)"),n.translate(a,s),n.scale(1,1/I),n.translate(-a,-s),n.globalCompositeOperation="destination-out",n.fillStyle=r;const l=i*I;n.fillRect(0,-l,o,2*l)});return(0,o.vJ)(()=>{O()},[B,L,R,I,d]),(0,o.Nf)(()=>{const{width:e,height:t}=T(),n=Y.current;e&&t&&n&&(0,i.RK)(()=>{n.width=e*F,n.height=t*F,O()})},[T,F]),(0,f.Y)("div",{ref:P,className:(0,s.A)("Af3tYFMg",w&&Boolean(e?.length)&&"NorYkjxC",b),style:(0,r.A)(e&&`--_bg-light: ${e[0]}`,e&&`--_bg-dark: ${e[1]??e[0]}`,void 0!==R&&`--_y-shift: ${R}px`),children:(0,f.Y)("canvas",{ref:Y,className:(0,s.A)("GbpiDSS_",B&&"Y5FyX1oo",k),"aria-hidden":"true"})})})},41385(e,t,n){n.d(t,{k:()=>r});var o=n(95807),i=n(17712),a=n(14745);const s="--_vtn";function r(e){const t=(0,a.A)();return{createVtnStyle:(0,i.A)((n,i)=>{const a=!0===i?n:i||void 0;return(0,o.A)(`${s}: vtn-${n}-${e||t}`,a&&`view-transition-class: ${a}`)})}}CSS.registerProperty?.({name:s,syntax:"*",inherits:!1})},41512(e,t,n){n.d(t,{Y:()=>i});var o=n(43503);function i(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}},42211(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(61433),a=n(31481),s=n(66644),r=n(81954),c=n(76023),l=n(32332);const d=a.nxZ,u=1.25*c.$,h=.5*c.$;function m({elementRef:e,isFocused:t,focusDirection:n,noFocusHighlight:a,isResizingContainer:c,isJustAdded:m,isQuote:p,scrollTargetPosition:g}){const f=(0,o.li)(!m);(0,o.Nf)(()=>{const o=f.current;if(f.current=!1,t&&e.current){const t=e.current.closest(".MessageList");if(!t)return;const m=a,f=g||(m?"end":"centerOrTop"),A=()=>{const o=void 0!==n?m?500:d:void 0,a=(0,r.Ay)({container:t,element:e.current,position:f,margin:m?h:u,maxDistance:o,forceDirection:n,forceNormalContainerHeight:c,shouldReturnMutationFn:!0});if(p){const t=e.current.querySelector(".is-quote");t&&(0,s.RK)(()=>{(0,i.YM)(t,"animate")})}return a};o?(0,l.E)(A):(0,s.YS)(()=>{(0,s.RK)(A())})}},[e,t,n,a,c,p,g])}},43581(e,t,n){n.d(t,{A:()=>j});var o=n(84051),i=n(13439),a=n(90709),s=n(11597),r=n(87357),c=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),y=n(34201),C=n(68292),I=n(26875),S=n(96454),w=n(14957),N=n(5912),b=n(4438),k=n(9267),R=n(93879),M=n(20021);const P=1.5*m.$,Y=6.5*m.$,T=S.pz||S.Ni?2:5,x=S.pz||S.Ni?2:3,F=(0,o.ph)((0,i.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=P,effectSize:c=Y,activeReactions:l,localAmount:u,withEffects:h,observeIntersection:m})=>{const{stopActiveReaction:p}=(0,i.ko)(),g=(0,o.li)(),A=(0,o.li)(),[v,C]=(0,o.J0)([]),I=(0,N.Vz)(g,m),S=(0,o.Kr)(()=>l?.find(e=>(0,a.a0)(e,t)),[l,t]),F=Boolean(h&&S),D=v.length<T;(0,f.A)(([e])=>{F?!u||u<=(e||0)||D&&C(e=>[...e,Date.now()]):C([])},[u,D,F]);const{shouldRender:E}=(0,y.A)({ref:A,noMountTransition:!0,isOpen:F,className:"slow",withShouldRender:!0}),B=(0,d.A)(()=>{const n=v.slice(1);C(n),n.length||p({containerId:e,reaction:t})}),L=(0,r.A)(R.A.root,E&&R.A.animating,n);return(0,M.FD)("div",{className:L,ref:g,teactFastList:!0,children:[(0,M.Y)(k.A,{type:"gold",size:"adaptive",style:`width: ${s}px; height: ${s}px`},"icon"),E&&v.map(e=>(0,M.Y)(b.A,{ref:A,className:R.A.effect,size:c,tgsUrl:w.w.StarReactionEffect,play:I,noLoop:!0,forceAlways:!0,nonInteractive:!0,quality:x,onEnded:B},e))]})}));var D=n(11241),E=n(85118),B=n(64493),L=n(69988);const O=1.25*m.$;function U(e){return e.stars}const G=(0,o.ph)(({reaction:e,containerId:t,isOwnMessage:n,recentReactors:s,className:c,chosenClassName:l,chatId:u,messageId:m,isOutside:S,observeIntersection:w,onClick:N,onPaidClick:b})=>{const{openStarsBalanceModal:k,resetLocalPaidReactions:R,openPaidReactionModal:P,requestWave:Y}=(0,i.ko)(),T=(0,o.li)(),x=(0,o.li)(),G=(0,o.li)(),K=(0,A.A)(),j="paid"===e.reaction.type,z=(0,p.Ay)(U),$=Boolean(z),V=(0,d.A)((e=1)=>{b?.(e)}),_=(0,d.A)(t=>{if("paid"===e.reaction.type)return t.stopPropagation(),void V();N?.(e.reaction)}),{isContextMenuOpen:J,handleBeforeContextMenu:H,handleContextMenu:W,handleContextMenuClose:q,handleContextMenuHide:X}=(0,g.A)(T,"paid"!==e.reaction.type,void 0,void 0,void 0,!0);(0,o.vJ)(()=>{J&&(P({chatId:u,messageId:m}),q(),X())},[q,X,J,u,m]),(0,f.A)(([t])=>{const n=e.localAmount,o=T.current;if(!n||!o||n===t?.localAmount)return;if($&&n>z.balance.amount)return k({originReaction:{chatId:u,messageId:m,amount:n}}),void R({chatId:u,messageId:m});if(e.localAmount){const{left:e,top:t}=o.getBoundingClientRect(),n=e+o.offsetWidth/2,i=t+o.offsetHeight/2;Y({startX:n,startY:i})}const i=Number(getComputedStyle(o).scale)||1;G.current?.cancel(),G.current=o.animate([{scale:i},{scale:Math.min(1.2*i,3),offset:.2},{scale:1}],{duration:500*i,easing:"ease-out"})},[e,z?.balance,$,u,m]);const Q=(0,v.A)(e.localAmount),{shouldRender:Z}=(0,y.A)({isOpen:Boolean(e.localAmount),ref:x,className:"slow",withShouldRender:!0});return(0,M.FD)(B.A,{className:(0,r.A)(L.A.root,n&&L.A.own,j&&L.A.paid,S&&L.A.outside,(0,a.eu)(e)&&L.A.chosen,(0,a.eu)(e)&&l,c),size:"tiny",ref:T,onMouseDown:H,onContextMenu:W,onClick:_,children:["paid"===e.reaction.type?(0,M.FD)(M.FK,{children:[(0,M.Y)(E.A,{preset:"button"}),(0,M.Y)(F,{className:L.A.animatedEmoji,containerId:t,reaction:e.reaction,size:O,localAmount:e.localAmount,observeIntersection:w}),Z&&(0,M.Y)(C.A,{ref:x,text:`+${(0,h.Vw)(K,e.localAmount||Q)}`,className:L.A.paidCounter})]}):(0,M.Y)(D.A,{className:L.A.animatedEmoji,containerId:t,reaction:e.reaction,size:O,observeIntersection:w}),s?.length?(0,M.Y)(I.A,{size:"mini",peers:s}):(0,M.Y)(C.A,{text:(0,h.Vw)(K,e.count+(e.localAmount||0)),className:L.A.counter})]})});var K=n(92915);const j=(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:y,addLocalPaidReaction:C,updateMiddleSearch:I,performMiddleSearch:S,openPremiumModal:w,resetLocalPaidReactions:N,showNotification:b,openFrozenAccountModal:k}=(0,i.ko)(),R=(0,u.A)(),{results:P,areTags:Y,recentReactions:T}=e.reactions,x=Boolean(e.areReactionsPossible&&e.reactions),F=(0,o.Kr)(()=>P.reduce((e,t)=>e+t.count,0),[P]),D=(0,o.Kr)(()=>{const e=(0,i.mS)();return T?.reduce((t,n)=>{const{reaction:o,peerId:i}=n,r=(0,a.Jj)(o),c=(0,s.PVB)(e,i);if(!c)return t;const l=t[r]||[];return l.push(c),t[r]=l,t},{})},[T]),E=(0,o.Kr)(()=>{const t=(0,c.bj)(e);return P.map(e=>{const n=(0,a.Jj)(e.reaction),o=D?.[n],i=F>3||g,s=Y?A?.[n]:void 0;return{reaction:e,reactionKey:n,messageKey:t,recentReactors:i?void 0:o,isChosen:(0,a.eu)(e),tag:s}})},[e,g,D,P,Y,A,F]),B=(0,d.A)(n=>{if(!v)return Y?f?(I({chatId:e.chatId,threadId:t,update:{savedTag:n}}),void S({chatId:e.chatId,threadId:t})):void w({initialSection:"saved_tags"}):void y({chatId:e.chatId,messageId:e.id,reaction:n});k()}),L=(0,o.Kr)(()=>P.find(e=>"paid"===e.reaction.type)?.localAmount||0,[P]),O=(0,d.A)(t=>{v?k():C({chatId:e.chatId,messageId:e.id,count:t})});(0,o.vJ)(()=>{L&&b({localId:(0,c.bj)(e),title:R("StarsSentTitle"),message:R("StarsSentText",L),actionText:R("StarsSentUndo"),cacheBreaker:L.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"})},[R,e,L]);const U=(0,d.A)(t=>{v?k():y({chatId:e.chatId,messageId:e.id,reaction:t})});return(0,l.A)(()=>()=>{N({chatId:e.chatId,messageId:e.id})}),(0,M.FD)("div",{className:(0,r.A)("Reactions",n&&"is-outside",x&&"is-service"),style:h?`max-width: ${h}px`:void 0,dir:R.isRtl?"rtl":"ltr",children:[E.map(({reaction:t,recentReactors:o,messageKey:i,reactionKey:a,isChosen:s,tag:r})=>Y?(0,M.Y)(K.A,{className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:e.isOutgoing,isChosen:s,reaction:t.reaction,tag:r,withContextMenu:f,onClick:B,onRemove:U,observeIntersection:p},a):(0,M.Y)(G,{chatId:e.chatId,messageId:e.id,className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:e.isOutgoing,recentReactors:o,isOutside:n,reaction:t,onClick:B,onPaidClick:O,observeIntersection:p},a)),m]})})},45470(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(32587),a=n(66644),s=n(96454),r=n(35297);function c(e,t=!1,n,c=2,l,d){const u=(0,o.li)(),h=(0,o.li)();return(0,r.A)(()=>{t||(h.current=!1)},[e,t]),(0,o.vJ)(()=>{const o=u.current;if(!e||!o||t||h.current)return;h.current=!0;const r=new Image,m=()=>{const e=l||r.width,t=d||r.height,n=o.getContext("2d",{alpha:!1});(0,a.RK)(()=>{o.width=e,o.height=t,s.QH&&(n.filter=`blur(${c}px)`),n.drawImage(r,2*-c,2*-c,e+4*c,t+4*c),s.QH||(0,i.A)(n,0,0,e,t,c,2)})};r.onload=()=>{n?(0,a.YS)(m):m()},r.src=e},[e,t,d,l,c,n]),u}},45780(e,t,n){n.d(t,{A:()=>l});var o=n(96454),i=n(87357),a=n(39351),s=n(17712),r=n(42452);var c=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:y})=>{const C=(0,a.A)(),I=!h&&!u,S=(0,s.A)(()=>{h||(u?y?.():v?.())});return(0,c.FD)("div",{className:(0,i.A)("OHkx_W75",t&&"neXqB2_A",u&&"tvZeVJPh",I&&"VUSwo4t5",n&&"dMT9byM6",p),onClick:S,style:A,dir:C.isRtl?"rtl":void 0,role:I?"button":void 0,tabIndex:I?0:void 0,children:[!u&&!h&&m&&(0,c.Y)(r.A,{}),Boolean(l)&&(0,c.Y)("div",{className:(0,i.A)("kmjqObdP","end"===d?"iqGhSQGm":"F0Hv3EQm"),children:l}),Boolean(n)&&(0,c.Y)("div",{className:"dnAaRPCo",children:n}),(0,c.Y)("div",{className:(0,i.A)("JSSC0N8V",g),children:e}),Boolean(t)&&(0,c.Y)("div",{className:(0,i.A)("OYmzCSp2",f),children:t}),!l&&o.pz&&(0,c.Y)("div",{className:"P53DrbWA"})]})}},48196(e,t,n){n.d(t,{A:()=>l});var o=n(84051),i=n(31481),a=n(28470),s=n(20021);const r=new Map;class c{referenceCount=0;constructor(e){this.color=e,this.filterId=`fluid-background-filter-${e.slice(1)}`,(0,a.z)((0,s.FD)("filter",{"color-interpolation-filters":"sRGB",xmlns:i.jNX,children:[(0,s.Y)("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"4",result:"blur"}),(0,s.Y)("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 30 -15",result:"goo"}),(0,s.Y)("feComposite",{in:"SourceAlpha",in2:"goo",operator:"over",result:"outline"}),(0,s.Y)("feFlood",{"flood-color":e,result:"color"}),(0,s.Y)("feComposite",{in:"color",in2:"outline",operator:"in"})]}),this.filterId)}getFilterId(){return this.referenceCount+=1,this.filterId}removeReference(){this.referenceCount-=1,0===this.referenceCount&&(0,a.e)(this.filterId)}isUsed(){return this.referenceCount>0}}function l(e,t){if((0,o.vJ)(()=>{if(e)return()=>{const t=r.get(e);t&&(t.removeReference(),t.isUsed()||r.delete(t.color))}},[e]),!e)return;if(r.has(e))return d(r.get(e).getFilterId(),t);const n=new c(e);return r.set(e,n),d(n.getFilterId(),t)}function d(e,t){return t?`url(#${e})`:`filter: url(#${e});`}},49086(e,t,n){n.d(t,{C:()=>m,V:()=>h});var o=n(13439),i=n(23174),a=n(90709),s=n(3544),r=n(60343),c=n(43044),l=n(58849),d=n(4961),u=n(18501);function h({message:e,highlight:t,emojiSize:n,asPreview:o,truncateLength:i,isProtected:s,forcePlayback:d,shouldRenderAsHtml:h,isForMediaViewer:m,threadId:p,maxTimestamp:g}){const{text:f,entities:A}=e.content.text||{};if(!f){const t=(0,a.BN)((0,c.Yw)(),e)?.text;return t?[(0,l.A)(t,i)]:void 0}const v=(0,r.bj)(e);return(0,u.fd)({text:(0,l.A)(f,i),entities:A,highlight:t,emojiSize:n,shouldRenderAsHtml:h,containerId:`${m?"mv-":""}${v}`,asPreview:o,isProtected:s,forcePlayback:d,messageId:"id"in e?e.id:void 0,chatId:e.chatId,threadId:p,maxTimestamp:g})}function m(e,t,n=!1,r,c=s.vs){const{entities:u}=t.content.text||{},m=(0,o.mS)(),p=(0,a.ni)(m,t),g=u?.some(e=>e.type===i.C7.Spoiler),f=u?.some(e=>e.type===i.C7.CustomEmoji);if(!g&&!f){const o=(0,l.A)((0,s.dS)(e,t,p,n),c);return r?(0,d.A)(o,["emoji","highlight"],{highlight:r}):(0,d.A)(o)}const A=!n&&(0,s.Su)(t),v=A?`${A} `:"",y=h({message:t,highlight:r,asPreview:!0,truncateLength:c}),C=(0,s.oL)(e,t,p,y);return[...(0,d.A)(v),...Array.isArray(C)?C:[C]].filter(Boolean)}},49746(e,t,n){n.d(t,{A:()=>a});var o=n(84051),i=n(13439);function a(e,t,n,a,s){const{loadMessage:r}=(0,i.ko)();(0,o.vJ)(()=>{s||t&&!n&&r({chatId:e,messageId:t,replyOriginForId:a})},[s,e,n,t,a])}},54699(e,t,n){n.d(t,{A:()=>a});var o=n(30857),i=n(32625);function a(e){const t=(0,o.A)();(0,i.A)(t,e,!0)}},54960(e,t,n){n.d(t,{A:()=>T});var o=n(84051),i=n(13439),a=n(31481),s=n(66644),r=n(90709),c=n(70636),l=n(11597),d=n(87357),u=n(97822),h=n(87894),m=n(79824),p=n(96374),g=n(39351),f=n(17712),A=n(59030),v=n(19806),y=n(46222),C=n(40664),I=n(52745),S=n(24956),w=n(21849),N=n(34431),b=n(18276),k=n(10187),R=n(45780),M=n(31722),P=n(20021);const Y="PeerPickerItem",T=(0,o.ph)(({className:e,categories:t,itemIds:n,sections:T,categoryPlaceholderKey:x,filterValue:F,filterPlaceholder:D,notFoundText:E,searchInputId:B,itemClassName:L,isLoading:O,noScrollRestore:U,isSearchable:G,lockedUnselectedSubtitle:K,forceShowSelf:j,isViewOnly:z,itemInputType:$,withStatus:V,withPeerTypes:_,withPeerUsernames:J,withDefaultPadding:H,onFilterChange:W,onDisabledClick:q,onLoadMore:X,...Q})=>{const Z=(0,A.A)(),ee=(0,g.A)(),te=(0,o.Kr)(()=>n||T.flatMap(e=>e.ids),[n,T]),ne=Q.allowMultiple,oe=ne?Q.lockedSelectedIds:void 0,ie=ne?Q.lockedUnselectedIds:void 0,ae=(0,o.Kr)(()=>ne?Q.selectedCategories:Q.selectedCategory?[Q.selectedCategory]:m.p,[ne,Q.selectedCategory,Q.selectedCategories]),se=(0,o.Kr)(()=>ne?Q.selectedIds:Q.selectedId?[Q.selectedId]:m.p,[ne,Q.selectedId,Q.selectedIds]),re=(0,o.li)(),ce=se.length>10;(0,o.vJ)(()=>{G&&(0,s.YS)(()=>{(0,u.A)(re.current)})},[G]);const le=(0,o.Kr)(()=>new Set(oe),[oe]),de=(0,o.Kr)(()=>new Set(ie),[ie]),ue=(0,o.Kr)(()=>se.filter(e=>!le.has(e)),[le,se]),he=(0,o.Kr)(()=>t?(0,h.dU)(t,"type"):{},[t]),me=(0,o.Kr)(()=>{if(F)return te;const e=[],t=[],n=[];return te.forEach(o=>{le.has(o)?e.push(o):de.has(o)?n.push(o):t.push(o)}),e.concat(t,n)},[F,te,le,de]),pe=(0,f.A)(e=>{if(le.has(e))q?.(e,!0);else if(de.has(e))q?.(e,!1);else{if(ne&&he[e]){const t=he[e].type,n=ae?.slice()||[];return n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),void Q.onSelectedCategoriesChange?.(n)}if(ne){const t=se.slice();return t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),void Q.onSelectedIdsChange?.(t)}he[e]?Q.onSelectedCategoryChange?.(he[e].type):Q.onSelectedIdChange?.(e)}}),ge=(0,f.A)(e=>{const{value:t}=e.currentTarget;W?.(t)}),[fe,Ae]=(0,p.A)(X,me,Boolean(F)),ve=(0,o.hb)((e,t)=>{const n=(0,i.mS)(),o=t?he[e]:void 0,s=t?void 0:(0,l.PVB)(n,e),u=s||o;if(!u)return a.Oig?(0,P.FD)("div",{children:["No peer or category with ID",e]},e):void 0;const h=s&&!(0,c.vj)(s)?s.isSelf&&!j:void 0,m=de.has(e),p=le.has(e),g=m||p,f=o?ae?.includes(o.type):se.includes(e),[A,y]=function(){if(m)return[K];if(s){if(J){const e=(0,r.Kl)(s);if(e)return[`@${e}`]}if(V){if((0,c.vj)(s))return[(0,r.sT)(ee,s)];const e=(0,l.K0y)(n,s.id);return[(0,r.CD)(Z,s,e),(0,d.A)((0,r.PF)(s,e,!0)&&M.A.onlineStatus)]}if(_){const e=(0,c.cy)(s);return e&&[Z(e)]}}}()||[];return(0,P.Y)(R.A,{className:(0,d.A)(Y,L),title:(0,P.Y)(N.A,{peer:u}),avatarElement:(0,P.Y)(w.A,{peer:s||o,isSavedMessages:h,size:"medium"}),subtitle:A,subtitleClassName:y,disabled:g,inactive:z,ripple:!0,inputElement:g?(0,P.Y)(b.A,{name:"lock-badge"}):"radio"===$?(0,P.Y)(S.A,{checked:f,disabled:g,onlyInput:!0}):"checkbox"===$?(0,P.Y)(v.A,{checked:f,disabled:g,onlyInput:!0}):void 0,inputPosition:"end",onClick:()=>pe(e),onDisabledClick:q&&(()=>q(e,p))},e)},[he,j,z,L,$,Z,le,de,K,q,ae,se,_,V,J,ee]),ye=(0,o.Kr)(()=>{if(t?.length)return(0,P.FD)("div",{children:[x&&(0,P.Y)("div",{className:M.A.pickerCategoryTitle,children:Z(x)}),t?.map(e=>ve(e.type,!0)),(0,P.Y)("div",{className:M.A.pickerCategoryTitle,children:Z("FilterChats")})]},"categories")},[t,x,Z,ve]),Ce=(0,o.hb)(()=>{if(!T)return fe?.map(e=>ve(e));const e=[];return T.forEach(t=>{0!==t.ids.length&&(e.push((0,P.Y)("div",{className:M.A.sectionHeader,children:t.title},t.key)),t.ids.forEach(t=>{e.push(ve(t))}))}),e},[T,fe,ve]),Ie=T?T.some(e=>e.ids.length>0):Boolean(fe?.length);return(0,P.FD)("div",{className:(0,d.A)(M.A.container,e),children:[G&&(0,P.FD)("div",{className:(0,d.A)(M.A.header,"custom-scroll"),dir:Z.isRtl?"rtl":void 0,children:[ae?.map(e=>(0,P.Y)(k.A,{className:M.A.peerChip,customPeer:he[e],onClick:pe,clickArg:e,canClose:!0})),oe?.map((e,t)=>(0,P.Y)(k.A,{className:M.A.peerChip,peerId:e,isMinimized:ce&&t<se.length-5,forceShowSelf:j,onClick:pe,clickArg:e})),ue.map((e,t)=>(0,P.Y)(k.A,{className:M.A.peerChip,peerId:e,isMinimized:ce&&t+(oe?.length||0)<se.length-5,canClose:!0,onClick:pe,clickArg:e})),(0,P.Y)(C.A,{id:B,ref:re,value:F,onChange:ge,placeholder:D||Z("SelectChat")})]}),Ie?(0,P.Y)(y.A,{className:(0,d.A)(M.A.pickerList,H&&M.A.padded,"custom-scroll"),items:fe,itemSelector:`.${Y}`,beforeChildren:ye,onLoadMore:Ae,noScrollRestore:U,children:Ce()}):O||!fe||fe.length?(0,P.Y)(I.A,{}):(0,P.Y)("p",{className:M.A.noResults,children:E||"Sorry, nothing found."})]})})},56133(e,t,n){n.d(t,{A:()=>i});var o=n(16581);function i(e,t,n,i=[]){return(0,o.A)(e=>{e()},i,e,t,n)}},57446(e,t,n){n.d(t,{A:()=>c});var o=n(13439),i=n(66644),a=n(11597),s=n(19822);const r=new Map;function c(e,t,n=300){(0,a.PKK)((0,o.mS)())||(n=0);const c="rtl"===e.getAttribute("dir"),{scrollLeft:l,offsetWidth:d,scrollWidth:u,dataset:{scrollId:h}}=e;let m=t-l;if(m<0){const e=-l*(c?-1:1);m=Math.max(m,e)}else if(m>0){const e=u-(l+d);m=Math.min(m,e)}if(0===m)return Promise.resolve();h&&r.has(h)&&r.get(h)();const p=l+m;return new Promise(t=>{(0,i.RK)(()=>{if(0===n)return e.scrollLeft=p,void t();let o=!1;const a=Math.random().toString();e.dataset.scrollId=a,r.set(a,()=>{o=!0}),e.style.scrollSnapType="none";const c=Date.now();function l(){e.style.scrollSnapType="",delete e.dataset.scrollId,r.delete(a)}(0,s.i0)(()=>{if(o)return l(),!1;const i=Math.min((Date.now()-c)/n,1),a=m*(1-function(e){return 1-(1-e)**3.5}(i));return e.scrollLeft=Math.round(p-a),i>=1&&(l(),t()),i<1},i.RK)})})}},58968(e,t,n){n.d(t,{I5:()=>s,LS:()=>a,V2:()=>i,lw:()=>o});const o={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"star",isAvatarSquare:!0,withPremiumGradient:!0},i=[{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}],a=[{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}},59118(e,t,n){n.d(t,{A:()=>Ee});var o=n(84051),i=n(13439),a=n(23174),s=n(89925),r=n(31481),c=n(90709),l=n(70636),d=n(26129),u=n(11597),h=n(96115),m=n(63495),p=n(96454),g=n(87357),f=n(60343),A=n(80140),v=n(41512),y=n(54464),C=n(43874),I=n(10722),S=n(49746),w=n(37661),N=n(5912),b=n(39351),k=n(17712),R=n(34201),M=n(48196),P=n(42211),Y=n(94189),T=n(96773),x=n(76023),F=n(21849),D=n(50805),E=n(20021);const B=15*x.$,L=(0,o.ph)(({action:e,onClick:t,observeIntersection:n})=>(0,E.Y)(F.A,{className:D.A.channelPhoto,photo:e.photo,loopIndefinitely:!0,withVideo:!0,observeIntersection:n,onClick:t,size:B}));var O=n(17663),U=n(17142),G=n(18501),K=n(85118),j=n(82855);const z=(0,o.ph)((0,i.EK)((e,{action:t})=>({sticker:"giftPremium"===t.type?(0,u.t0O)(e,t.days):"giftStars"===t.type?(0,u.WLj)(e,t.stars):(0,u.OD9)(e,t.cryptoAmount),canPlayAnimatedEmojis:(0,u.BWX)(e)}))(({action:e,sticker:t,canPlayAnimatedEmojis:n,onClick:i,observeIntersectionForLoading:a,observeIntersectionForPlaying:s})=>{const r=(0,o.li)(),c=(0,b.A)(),l="giftPremium"===e.type?e.message:void 0;return(0,E.FD)("div",{className:D.A.contentBox,tabIndex:0,role:"button",onClick:i,children:[(0,E.Y)("div",{ref:r,className:D.A.stickerWrapper,style:"width: 150px; height: 150px",children:t&&(0,E.Y)(j.A,{containerRef:r,sticker:t,size:150,observeIntersectionForLoading:a,observeIntersectionForPlaying:s,noLoad:!n})}),(0,E.FD)("div",{className:D.A.info,children:[(0,E.Y)("h3",{className:D.A.title,children:"giftPremium"===e.type?c("ActionGiftPremiumDuration",{duration:(0,O.w6)(c,e.days)}):"giftStars"===e.type?c("ActionGiftStarsTitle",{amount:e.stars},{pluralValue:e.stars}):(()=>{const{cryptoAmount:t,cryptoCurrency:n}=e;return t?(0,U.vv)(c,t,n,{asFontIcon:!0}):void 0})()}),(0,E.FD)("div",{children:[l&&(0,G.fd)(l),!l&&c("giftTon"===e.type?"DescriptionAboutTon":"giftPremium"===e.type?"ActionGiftPremiumText":"ActionGiftStarsText")]})]}),(0,E.FD)("div",{className:D.A.actionButton,children:[(0,E.Y)(K.A,{preset:"button"}),c("ActionViewButton")]})]})}));var $=n(4262);const V=(0,o.ph)((0,i.EK)((e,{action:t})=>({currentUserId:e.currentUserId,sticker:"giftCode"===t.type?(0,u.t0O)(e,t.days):(0,u.WLj)(e,t.stars),canPlayAnimatedEmojis:(0,u.BWX)(e),channel:t.boostPeerId?(0,u.hds)(e,t.boostPeerId):void 0}))(({currentUserId:e,action:t,sender:n,sticker:i,canPlayAnimatedEmojis:a,channel:s,onClick:r,observeIntersectionForLoading:c,observeIntersectionForPlaying:d})=>{const u=(0,o.li)(),h=(0,b.A)(),m=(0,o.Kr)(()=>{const e=s&&(0,l.F9)(h,s),t=h("ActionFallbackChannel");return(0,$.Nm)(s?.id,e||t)},[s,h]),p=(0,o.Kr)(()=>{const e=s||n,t=e&&(0,l.F9)(h,e),o=h("ActionFallbackChat");return(0,$.Nm)(e?.id,t||o)},[s,n,h]);return(0,E.FD)("div",{className:D.A.contentBox,tabIndex:0,role:"button",onClick:r,children:[(0,E.Y)("div",{ref:u,className:D.A.stickerWrapper,style:"width: 150px; height: 150px",children:i&&(0,E.Y)(j.A,{containerRef:u,sticker:i,size:150,observeIntersectionForLoading:c,observeIntersectionForPlaying:d,noLoad:!a})}),(0,E.FD)("div",{children:[(0,E.Y)("h3",{className:D.A.title,children:h("giftCode"!==t.type||t.isViaGiveaway?"ActionGiveawayResultTitle":"GiftInfoTitle")}),(0,E.FD)("div",{children:["giftCode"===t.type&&(t.isViaGiveaway?h("ActionGiveawayResultPremiumDuration",{channel:m,duration:(0,O.w6)(h,t.days)},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}):h(n?.id===e?"ActionGiftCodeSubscriptionDurationYou":"ActionGiftCodeSubscriptionDuration",{peer:p,duration:(0,O.w6)(h,t.days)},{withNodes:!0,renderTextFilters:["br"]})),"prizeStars"===t.type&&h("ActionGiveawayResultStarsText",{amount:t.stars,channel:m},{withNodes:!0,withMarkdown:!0,pluralValue:t.stars,renderTextFilters:["br"]})]})]}),(0,E.FD)("div",{className:D.A.actionButton,children:[(0,E.Y)(K.A,{preset:"button"}),h("giftCode"===t.type?"ActionOpenGiftButton":"ActionViewButton")]})]})}));var _=n(48775),J=n(14242),H=n(66833),W=n(87094),q=n(87049);const X=(0,o.ph)((0,i.EK)((e,{message:t,action:n})=>{const o=(0,u.mBe)(e,e.currentUserId),i=(0,u.BWX)(e),a=(0,u.Y7C)(e,t),s=n.fromId?(0,u.PVB)(e,n.fromId):void 0,r=t.isOutgoing?(0,u.PVB)(e,t.chatId):o,c=n.toId||n.peerId;return{canPlayAnimatedEmojis:i,sender:s||a,recipient:(c?(0,u.PVB)(e,c):void 0)||r,starGiftMaxConvertPeriod:e.appConfig.starGiftMaxConvertPeriod}})(({action:e,message:t,canPlayAnimatedEmojis:n,sender:i,recipient:a,starGiftMaxConvertPeriod:s,onClick:r,observeIntersectionForLoading:d,observeIntersectionForPlaying:u})=>{const h=(0,o.li)(),m=(0,o.li)(),f=(0,b.A)(),[v,y,C]=(0,w.A)(),{isOutgoing:I}=t,S=(0,H.yQ)(e.gift),N=I?a:i,k=N&&(0,l.vj)(N)&&(0,c.WX)(N),R=e.isAuctionAcquired,M=(0,W.A)(h,"background-color",!e.gift.availabilityTotal),P=f("ActionFallbackSomeone"),Y=N&&(0,l.F9)(f,N),T=a&&(0,l.F9)(f,a),x=i?.id===a?.id,F=R?e.gift.stars:void 0,B=(0,o.Kr)(()=>{const n=(0,$.Nm)(N?.id,Y||P),o=void 0!==e.starsToConvert?(0,_.Kk)(f,e.starsToConvert):void 0;return R&&void 0!==F?f("ActionStarGiftAuctionBought",{cost:(0,_.Kk)(f,F)}):e.isUpgraded?f("ActionStarGiftUpgraded"):e.alreadyPaidUpgradeStars&&!R?(0,$.AD)(f,"ActionStarGiftUpgradeText",!I||x,{peer:n}):e.isConverted?(0,$.AD)(f,"ActionStarGiftConvertedText",!I||x,{peer:n,amount:o}):s&&(0,A.Fm)()<t.date+s&&o?(0,$.AD)(f,"ActionStarGiftConvertText",!I||x,{peer:n,amount:o}):k?f("ActionStarGiftChannelText",{amount:o},{withNodes:!0}):(0,$.AD)(f,"ActionStarGiftNoConvertText",!I||x,{peer:n})},[e,F,P,R,k,I,f,t.date,N?.id,Y,s,x]);return(0,E.FD)("div",{ref:h,className:(0,g.A)("interactive-gift",D.A.contentBox,D.A.starGift),tabIndex:0,role:"button",onClick:r,onMouseEnter:p.TF?void 0:y,onMouseLeave:p.TF?void 0:C,children:[(0,E.Y)("div",{ref:m,className:D.A.stickerWrapper,style:"width: 120px; height: 120px",children:S&&(0,E.Y)(j.A,{containerRef:m,sticker:S,size:120,shouldLoop:v,observeIntersectionForLoading:d,observeIntersectionForPlaying:u,noLoad:!n})}),Boolean(e.gift.availabilityTotal)&&(0,E.Y)(q.A,{color:M||"blue",text:f("ActionStarGiftLimitedRibbon",{total:(0,J.Vw)(f,e.gift.availabilityTotal)})}),(0,E.FD)("div",{className:D.A.info,children:[(0,E.Y)("h3",{className:D.A.title,children:R&&a?f("ActionStarGiftAuctionFor",{peer:(0,$.Nm)(a.id,T||P)},{withNodes:!0}):x?f("ActionStarGiftSelf"):f(I?"ActionStarGiftTo":"ActionStarGiftFrom",{peer:(0,$.Nm)(N?.id,Y||P)},{withNodes:!0})}),(0,E.FD)("div",{className:D.A.subtitle,children:[e.message&&(0,G.fd)(e.message),!e.message&&B]})]}),(0,E.FD)("div",{className:D.A.actionButton,children:[(0,E.Y)(K.A,{preset:"button"}),!e.alreadyPaidUpgradeStars||e.isUpgraded||I?f("ActionViewButton"):f("ActionStarGiftUnpack")]})]})}));var Q=n(54699),Z=n(59030),ee=n(40558);const te=(0,o.ph)((0,i.EK)((e,{message:t})=>{const n=(0,u.mBe)(e,e.currentUserId);return{canPlayAnimatedEmojis:(0,u.BWX)(e),sender:(0,u.Y7C)(e,t),recipient:t.isOutgoing?(0,u.PVB)(e,t.chatId):n}})(({action:e,message:t,hasButtons:n,canPlayAnimatedEmojis:i,sender:a,recipient:s,observeIntersectionForLoading:r,observeIntersectionForPlaying:c,onClick:d})=>{const u=(0,o.li)(),h=(0,b.A)(),m=(0,Z.A)(),[f,v,y]=(0,w.A)(),{isOutgoing:C}=t,I=(0,H.yQ)(e.gift),S=(0,H.uc)(e.gift),N=S?.pattern,k=S?.backdrop,R=!e.isAccepted&&!e.isDeclined;(0,Q.A)(R?6e4:void 0);const M=(0,A.Fm)(),P=Math.max(0,e.expiresAt-M),Y=(0,O.yC)(m,P),T=P<=0,x=(0,o.Kr)(()=>e.isAccepted?h("ActionStarGiftOfferAccepted"):e.isDeclined?h("ActionStarGiftOfferRejected"):T?h("ActionStarGiftOfferHasExpired"):h("ActionStarGiftOfferExpires",{time:Y}),[e.isAccepted,e.isDeclined,Y,h,T]);if(!I||!N||!k)return;const F=[k.centerColor,k.edgeColor],B=C?s:a,L=h("ActionFallbackSomeone"),U=B&&(0,l.F9)(h,B),G=h("GiftUnique",{title:e.gift.title,number:e.gift.number}),K=(0,_.Qi)(h,e.price);return(0,E.FD)("div",{className:(0,g.A)(D.A.contentBox,"gGU_fR0o",n&&"O968zq9f",d&&"_OxdCNdP"),tabIndex:d?0:void 0,role:d?"button":void 0,onMouseEnter:p.TF?void 0:v,onMouseLeave:p.TF?void 0:y,onClick:d,children:[(0,E.FD)("div",{className:"sL_usxX1",children:[(0,E.Y)("div",{className:"BKdiahua",children:(0,E.Y)(ee.A,{className:"xMKL7_4P",backgroundColors:F,patternIcon:N.sticker,patternSize:9,ringsCount:1,ovalFactor:1})}),(0,E.Y)("div",{ref:u,className:"rJwgLZaq",style:"width: 48px; height: 48px",children:I&&(0,E.Y)(j.A,{containerRef:u,sticker:I,size:48,shouldLoop:f,observeIntersectionForLoading:r,observeIntersectionForPlaying:c,noLoad:!i})})]}),(0,E.FD)("div",{className:"OI1EtWw7",children:[(0,E.Y)("p",{className:"FPQhHJLz",children:h(C?"ActionStarGiftOfferOutgoing":"ActionStarGiftOfferIncoming",{peer:(0,$.Nm)(B?.id,U||L),cost:K,gift:G},{withNodes:!0,withMarkdown:!0})}),(0,E.Y)("p",{className:"SpzRt25a",children:x})]})]})}));var ne=n(95807),oe=n(92108);const ie=(0,o.ph)((0,i.EK)((e,{message:t,action:n})=>{const o=(0,u.mBe)(e,e.currentUserId),i=(0,u.BWX)(e),a=(0,u.Y7C)(e,t),s=n.fromId?(0,u.PVB)(e,n.fromId):void 0,r=t.isOutgoing?(0,u.PVB)(e,t.chatId):o;return{canPlayAnimatedEmojis:i,sender:s||a,recipient:(n.peerId?(0,u.PVB)(e,n.peerId):void 0)||r}})(({action:e,message:t,canPlayAnimatedEmojis:n,sender:i,recipient:a,onClick:s,observeIntersectionForLoading:r,observeIntersectionForPlaying:c})=>{const d=(0,o.li)(),u=(0,b.A)(),[h,m,f]=(0,w.A)(),{isOutgoing:A}=t,v=(0,H.yQ)(e.gift),y=(0,H.uc)(e.gift),C=y.model,I=y.pattern,S=y.backdrop,N=[S.centerColor,S.edgeColor],k=`${S.patternColor.slice(0,7)}55`,R=(0,o.Kr)(()=>[[u("ActionStarGiftUniqueModel"),C.name],[u("ActionStarGiftUniqueBackdrop"),S.name],[u("ActionStarGiftUniqueSymbol"),I.name]],[u,C,I,S]),M=!A||e.isUpgrade,P=M&&!e.isUpgrade?i:a,Y=u("ActionFallbackSomeone"),T=P&&(0,l.F9)(u,P),F=i?.id===a?.id;return(0,E.FD)("div",{className:(0,g.A)("interactive-gift",D.A.contentBox,D.A.starGift,D.A.uniqueGift),tabIndex:0,role:"button",onClick:s,onMouseEnter:p.TF?void 0:m,onMouseLeave:p.TF?void 0:f,children:[(0,E.Y)("div",{className:D.A.uniqueBackgroundWrapper,children:(0,E.Y)(ee.A,{className:D.A.uniqueBackground,backgroundColors:N,patternIcon:I.sticker,patternSize:14,yPosition:5*x.$,clearBottomSector:!0})}),(0,E.Y)("div",{ref:d,className:D.A.stickerWrapper,style:"width: 120px; height: 120px",children:v&&(0,E.Y)(j.A,{containerRef:d,sticker:v,size:120,shouldLoop:h,observeIntersectionForLoading:r,observeIntersectionForPlaying:c,noLoad:!n})}),(0,E.Y)(q.A,{color:e.gift.isBurned?"red":k,text:e.gift.isBurned?u("ActionStarGiftUniqueBurnedRibbon"):u("ActionStarGiftUniqueRibbon")}),(0,E.FD)("div",{className:D.A.info,children:[(0,E.Y)("h3",{className:D.A.title,children:F?e.gift.isCrafted?u("ActionStarGiftCrafted"):u("ActionStarGiftSelf"):u(M?"ActionStarGiftFrom":"ActionStarGiftTo",{peer:(0,$.Nm)(P?.id,T||Y)},{withNodes:!0})}),(0,E.Y)("div",{className:D.A.subtitle,style:`color: ${S.textColor}`,children:u("GiftUnique",{title:e.gift.title,number:e.gift.number})}),(0,E.Y)(oe.A,{data:R,style:`color: ${S.textColor}`,valueClassName:D.A.uniqueValue})]}),(0,E.FD)("div",{className:D.A.actionButton,style:(0,ne.A)(k&&`background-color: ${k}`),children:[(0,E.Y)(K.A,{preset:"button"}),u("ActionViewButton")]})]})}));var ae=n(87679),se=n(62587),re=n(90751);const ce=(0,o.ph)((0,i.EK)((e,{message:t})=>({peer:(0,u.PVB)(e,t.chatId)}))(({message:e,action:t,peer:n,observeIntersection:r})=>{const{openMediaViewer:d,uploadProfilePhoto:u,showNotification:h}=(0,i.ko)(),{isOutgoing:m}=e,p=t.photo,g=(0,b.A)(),[f,A]=(0,o.J0)(),[v,y,C]=(0,w.A)(!1),I=(0,se.A)((0,c.rI)(p,"full")),S=(0,se.A)((0,c.Pg)(p)),N=p.isVideo,R=(0,o.Kr)(()=>{const e=n&&(0,l.F9)(g,n)||g("ActionFallbackUser"),t=(0,$.Nm)(n?.id,e);return g(m?"ActionSuggestedPhotoYou":"ActionSuggestedPhoto",{user:t},{withNodes:!0})},[g,m,n]),M=(0,k.A)(()=>{h({title:g("ActionSuggestedPhotoUpdatedTitle"),message:g("ActionSuggestedPhotoUpdatedDescription"),action:{action:"openSettingsScreen",payload:{screen:s.VS.Main}},actionText:g("Open")})}),P=(0,k.A)(e=>{A(void 0),u({file:e}),M()}),T=(0,k.A)(()=>{A(void 0)}),x=(0,k.A)(async()=>{if(!S)return;C(),M();const e=await(0,ae.sZ)(S);u({file:new File([e],"avatar.mp4"),isVideo:!0,videoTs:p.videoSizes?.find(e=>void 0!==e.videoStartTs)?.videoStartTs})});return(0,E.FD)("div",{className:D.A.contentBox,tabIndex:0,role:"button",onClick:async()=>{!m&&I?N?y():A(await(0,ae.sZ)(I)):d({chatId:e.chatId,messageId:e.id,threadId:a.l3,origin:s.TQ.SuggestedAvatar})},children:[(0,E.Y)(F.A,{className:D.A.suggestedAvatar,photo:t.photo,loopIndefinitely:!0,withVideo:!0,observeIntersection:r,size:"jumbo"}),(0,E.Y)("div",{className:D.A.suggestedText,children:R}),(0,E.Y)("div",{className:D.A.actionButton,children:g("ActionSuggestedPhotoButton")}),(0,E.Y)(re.A,{file:f,onClose:T,onChange:P}),(0,E.Y)(Y.A,{isOpen:v,title:g("ActionSuggestedVideoTitle"),confirmHandler:x,onClose:C,text:g("ActionSuggestedVideoText")})]})}));var le=n(4961);const de=(0,o.ph)((0,i.EK)((e,{message:t})=>{const n=(0,u.Y7C)(e,t),o=(0,u.k2W)(e,t.chatId),i=(0,d.Q)(t);let a;if("message"===i?.type&&i.replyToMsgId){const n=(0,u.gMr)(e,t);n&&(a=(0,u.Y7C)(e,n))}const{appConfig:s}=e;return{sender:n,chat:o,originalSender:a,ageMinSeconds:s.starsSuggestedPostAgeMin,isAdmin:!!o&&Boolean((0,u.ODG)(e,t.chatId))}})(({message:e,action:t,sender:n,chat:o,originalSender:i,ageMinSeconds:a,isAdmin:s,onClick:c})=>{const d=(0,b.A)(),u=(0,Z.A)(),{scheduleDate:h,amount:m}=t,p=o&&(0,l.em)(d,o),f=()=>(0,$.Nm)(o?.id,p||d("ActionFallbackChat")),v=i&&(0,l.em)(d,i),y=(0,$.Nm)(i?.id,v||d("ActionFallbackUser")),C=h?(0,O.e0)(h,d,u):d("SuggestMessageAnytime"),I=!!h&&h<=(0,A.Fm)(),S=m?.currency,w=m?.amount||0,N=w>0?S===r.ykW?(0,_.QH)(d,(0,U.wD)(w)):(0,_.Kk)(d,w):void 0,k=(0,O.A$)(d,a,!0);return(0,E.FD)("div",{className:(0,g.A)(D.A.contentBox,D.A.suggestedPostContentBox),onClick:c,children:[(0,E.Y)("div",{className:D.A.suggestedPostApprovalTitle,children:(0,le.A)(d("SuggestedPostAgreementReached"))}),(0,E.Y)("div",{className:D.A.suggestedPostApprovalSection,children:(0,$.AD)(d,I?"SuggestedPostPublished":"SuggestedPostPublishSchedule",!s,{peer:f(),date:C},{withMarkdown:!0})}),N&&(0,E.Y)("div",{className:D.A.suggestedPostApprovalSection,children:(0,$.AD)(d,"SuggestedPostCharged",!s,{user:y,amount:N},{withMarkdown:!0})}),I&&N&&(0,E.FD)(E.FK,{children:[(0,E.Y)("div",{className:D.A.suggestedPostApprovalSection,children:(0,$.AD)(d,"SuggestedPostReceiveAmount",!s,{peer:f(),duration:k},{withMarkdown:!0})}),(0,E.Y)("div",{className:D.A.suggestedPostApprovalSection,children:(0,$.AD)(d,"SuggestedPostRefund",!s,{peer:f(),duration:k},{withMarkdown:!0})})]})]})})),ue=(0,o.ph)((0,i.EK)((e,{message:t})=>{const n=(0,u.Y7C)(e,t),o="message"===t.replyInfo?.type&&t.replyInfo.replyToMsgId?(0,u.O5q)(e,t.chatId,t.replyInfo.replyToMsgId):void 0;return{sender:n,replyMessageSender:o?(0,u.Y7C)(e,o):void 0,replyMessage:o}})(({onClick:e,message:t,sender:n,replyMessageSender:o,replyMessage:a})=>{const{openStarsBalanceModal:s}=(0,i.ko)(),c=(0,b.A)(),d=(0,k.A)(e=>{e.preventDefault(),e.stopPropagation(),s({})}),u=o||n,h=u&&(0,l.em)(c,u),m=(0,$.Nm)(u?.id,h||c("ActionFallbackUser")),p=a?.suggestedPostInfo?.price?.currency||r.OUy,f=p===r.ykW?c("CurrencyTon"):c("CurrencyStars"),A=p===r.ykW?c("ButtonTopUpViaFragment"):c("ButtonBuyStars");return(0,E.FD)("div",{className:(0,g.A)(D.A.contentBox,D.A.suggestedPostBalanceTooLowBox),onClick:e,children:[(0,E.Y)("div",{className:D.A.suggestedPostBalanceTooLowTitle,children:c("SuggestedPostBalanceTooLow",{peer:m,currency:f},{withNodes:!0,withMarkdown:!0})}),!t.isOutgoing&&(0,E.FD)("div",{className:D.A.actionButton,onClick:d,children:[(0,E.Y)(K.A,{preset:"button"}),A]})]})}));var he=n(18276);const me=(0,o.ph)((0,i.EK)((e,{message:t})=>({sender:(0,u.Y7C)(e,t)}))(({message:e,action:t,sender:n,onClick:o})=>{const i=(0,b.A)(),{isOutgoing:a}=e,{rejectComment:s}=t,r=n&&(0,l.F9)(i,n),c=(0,$.Nm)(n?.id,r||i("ActionFallbackUser"));return(0,E.FD)("div",{className:(0,g.A)(D.A.contentBox,D.A.suggestedPostRejectedContentBox),onClick:o,children:[(0,E.FD)("div",{className:D.A.suggestedPostRejectedTitle,children:[(0,E.Y)(he.A,{className:D.A.rejectedIcon,name:"close"}),(0,$.AD)(i,s?"SuggestedPostRejectedWithReason":"SuggestedPostRejected",a,{peer:c},{withMarkdown:!0})]}),s&&(0,E.Y)("div",{className:D.A.suggestedPostRejectedComment,children:i("SuggestedPostRejectedComment",{comment:s})})]})}));var pe=n(99515),ge=n(7065),fe=n(43581),Ae=n(14737),ve=n(48894);var ye=n(36838),Ce=n(64493),Ie=n(55158);const Se="d8axZxyN",we="glDpC2av",Ne="gqCs9fSo",be="gnYhwnvf",ke="HWgwnKui",Re="BTNQ4KBH",Me="Xl9MVMTn",Pe="Qizai7yv";function Ye({channel:e}){const{openChat:t}=(0,i.ko)(),n=function(e,t="#00000000"){const[n,i]=(0,o.J0)(t),s=(0,se.A)((0,c.cP)(e),!1,a.qZ.BlobUrl);return(0,o.vJ)(()=>{(async()=>{if(!s)return;const e=await(0,ve.rX)(s);i((0,ve.v2)(e))})()},[s]),n}(e,"#3C3C4399"),s=(0,b.A)();return(0,E.FD)("div",{className:we,onClick:()=>t({id:e.id}),children:[(0,E.Y)(F.A,{className:Ne,size:"large",peer:e},e.id),(0,E.FD)("div",{style:`background: ${n}`,className:be,children:[(0,E.Y)(he.A,{name:"user-filled",className:Se}),(0,E.Y)("span",{className:ke,children:(0,J.Vw)(s,e?.membersCount||0)})]}),(0,E.Y)("span",{className:Re,children:e.title})]})}function Te({channel:e,chatId:t,channelsCount:n,isCurrentUserPremium:o}){const{openPremiumModal:a,openChatWithInfo:s}=(0,i.ko)(),r=(0,Z.A)();return(0,E.FD)("div",{className:(0,g.A)(we,"MBChXyXk"),onClick:()=>{o?s({id:t,shouldReplaceHistory:!0,profileTab:"similarChannels",forceScrollProfileTab:!0}):a()},children:[(0,E.Y)(F.A,{className:Ne,size:"large",peer:e},e.id),(0,E.Y)("div",{className:Me,children:(0,E.Y)("div",{className:Pe})}),(0,E.Y)("div",{className:(0,g.A)(Me,"JxSmtOFi"),children:(0,E.Y)("div",{className:Pe})}),(0,E.FD)("div",{className:be,children:[(0,E.Y)("span",{className:ke,children:`+${n}`}),!o&&(0,E.Y)(he.A,{name:"lock-badge",className:Se})]}),(0,E.Y)("span",{className:Re,children:r("MoreSimilar")})]})}const xe=(0,o.ph)((0,i.EK)((e,{chatId:t})=>{const{similarChannelIds:n,isExpanded:o,count:i}=(0,u.dg4)(e,t)||{},a=(0,u.g29)(e),s=(0,u.AWZ)(e,t);return{similarChannelIds:n,isExpanded:o,count:i,isCurrentUserPremium:a,channelJoinInfo:s?.joinInfo}})(({chatId:e,similarChannelIds:t,isExpanded:n,count:a,isCurrentUserPremium:s,channelJoinInfo:r})=>{const{toggleChannelRecommendations:c,loadChannelRecommendations:l}=(0,i.ko)(),d=(0,Z.A)(),[h,m,p]=(0,w.A)(!1),[f,v,y]=(0,w.A)(!1),C=(0,o.li)(),I=(0,o.li)(!1),S=(0,o.Kr)(()=>{if(!t)return;const e=(0,i.mS)();return t.map(t=>(0,u.hds)(e,t)).filter(Boolean)},[t]),[N,b]=(0,o.J0)(!1),R=(0,o.Kr)(()=>S?.slice(0,10),[S]),M=Boolean(R?.length),P=Boolean(!N&&(n||f||h)&&M);(0,ye.A)(C,!P,!0),(0,o.vJ)(()=>{t||l({chatId:e})},[e,t]),(0,Ae.A)(()=>b(!1),2e3),(0,o.vJ)(()=>{if(N&&S&&n){const e=setTimeout(()=>{b(!1)},300);return()=>clearTimeout(e)}},[S,n,N]),(0,o.vJ)(()=>{n?(m(),y(),b(!t),I.current||setTimeout(()=>{C.current?.scrollIntoView({behavior:"smooth"})},150)):(p(),v())},[n,t]);const Y=(0,k.A)(()=>{c({chatId:e})});if((0,o.vJ)(()=>{r?.joinedDate&&!n&&(0,A.Fm)()-r.joinedDate<=10&&(Y(),I.current=!0)},[r,n]),P||N)return(0,E.FD)("div",{className:(0,g.A)("V3RHiOJR"),children:[N&&(0,E.Y)(Ie.A,{className:"xKVZv7KE"}),P&&(0,E.FD)("div",{className:(0,g.A)(h&&"eb8rX09E",f&&"XR6_qLCc"),children:[(0,E.Y)("div",{className:"tfG_BSDt",children:(0,E.Y)("svg",{width:"19",height:"7",viewBox:"0 0 19 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,E.Y)("path",{className:"HVbeGv4t","fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 7C16.8992 7 13.59 3.88897 11.5003 1.67424C10.7648 0.894688 10.397 0.50491 10.0434 0.385149C9.70568 0.270811 9.4225 0.270474 9.08456 0.38401C8.73059 0.50293 8.36133 0.892443 7.62279 1.67147C5.52303 3.88637 2.18302 7 0 7L19 7Z",fill:"white"})})}),(0,E.FD)("div",{className:"njAC8dR9",children:[(0,E.FD)("div",{className:"s7QOi22Q",children:[(0,E.Y)("span",{className:"JstcOhAN",children:d("SimilarChannels")}),(0,E.Y)(Ce.A,{className:"meewH7t_",color:"translucent",onClick:Y,iconName:"close"})]}),(0,E.Y)("div",{ref:C,className:(0,g.A)("h4gWlNen","no-scrollbar"),children:R?.map((t,n)=>9===n?(0,E.Y)(Te,{channel:t,chatId:e,channelsCount:a-10+1,isCurrentUserPremium:s}):(0,E.Y)(Ye,{channel:t}))})]})]})]})})),Fe=new Set(["pinMessage","chatEditPhoto","chatDeletePhoto","todoCompletions","todoAppendTasks","unsupported"]),De=new Set(["giftCode","prizeStars","suggestProfilePhoto","suggestedPostApproval","starGiftPurchaseOffer"]),Ee=(0,o.ph)((0,i.EK)((e,{message:t,threadId:n})=>{const o=(0,u.nTw)(e),i=(0,u.hds)(e,t.chatId),s=(0,u.Y7C)(e,t),r=i?.isForum&&n!==a.l3,{replyToMsgId:c,replyToPeerId:l}=(0,d.Q)(t)||{},m=c?(0,u.O5q)(e,l||t.chatId,c):void 0,p=!!n&&(0,u.nJv)(e,t,n),{direction:g,noHighlight:f,isResizingContainer:A,scrollTargetPosition:v}=p&&o.focusedMessage||{},y=(0,u.g29)(e),C=(0,h.a1)(e,t.chatId,n),I=C?.unreadReactions?.includes(t.id),S=(0,u.trm)(e);return{sender:s,currentUserId:e.currentUserId,isCurrentUserPremium:y,isFocused:p,focusDirection:g,noFocusHighlight:f,isInsideTopic:r,replyMessage:m,isInSelectMode:(0,u.rTV)(e),actionMessageBg:(0,u.bdt)(e),hasUnreadReaction:I,isResizingContainer:A,scrollTargetPosition:v,isAccountFrozen:S}})(({message:e,threadId:t,sender:n,currentUserId:a,appearanceOrder:u,isJustAdded:h,isLastInList:x,memoFirstUnreadIdRef:F,getIsMessageListReady:B,isInsideTopic:O,isFocused:U,focusDirection:G,noFocusHighlight:K,replyMessage:j,actionMessageBg:$,isCurrentUserPremium:_,isInSelectMode:J,hasUnreadReaction:H,isResizingContainer:W,scrollTargetPosition:q,isAccountFrozen:Q,observeIntersectionForBottom:Z,observeIntersectionForLoading:ee,observeIntersectionForPlaying:ne,onMessageUnmount:oe})=>{const{requestConfetti:ae,openMediaViewer:se,getReceipt:re,checkGiftCode:le,openPrizeStarsTransactionFromGiveaway:he,openPremiumModal:Ae,openStarsTransactionFromGift:ve,openGiftInfoModalFromMessage:ye,toggleChannelRecommendations:Ce,animateUnreadReaction:Ie,markMentionsRead:Se,focusMessage:we,openGiftOfferAcceptModal:Ne,declineStarGiftOffer:be,showNotification:ke}=(0,i.ko)(),Re=(0,o.li)(),{id:Me,chatId:Pe}=e,Ye=e.content.action,Te=(0,f.iL)(Me),Ee=De.has(Ye.type),Be=Fe.has(Ye.type),Le=p.uH&&!Be,Oe="suggestedPostSuccess"===Ye.type,Ue="starGiftPurchaseOfferDeclined"===Ye.type,Ge=(0,d.Q)(e),{replyToMsgId:Ke,replyToPeerId:je}=Ge||{},ze=Boolean(e.areReactionsPossible&&e?.reactions?.results?.length),$e="starGiftPurchaseOffer"===Ye.type&&Ye.expiresAt<=(0,A.Fm)(),Ve=!("starGiftPurchaseOffer"!==Ye.type||e.isOutgoing||Ye.isAccepted||Ye.isDeclined||$e),_e=Ve,Je=O&&"topicCreate"===Ye.type,He=(0,b.A)(),{isTouchScreen:We}=(0,C.Ay)(),qe=(0,o.Kr)(()=>[[{type:"giftOffer",buttonType:"reject",text:He("GiftOfferReject")},{type:"giftOffer",buttonType:"accept",text:He("GiftOfferAccept")}]],[He]),[Xe,Qe,Ze]=(0,w.A)(!1),et=(0,k.A)(e=>{"giftOffer"===e.type&&("accept"===e.buttonType?"starGiftPurchaseOffer"===Ye.type&&Ne({peerId:Pe,messageId:Me,gift:Ye.gift,price:Ye.price}):"reject"===e.buttonType&&Qe())}),tt=(0,k.A)(()=>{Ze(),be({messageId:Me})}),nt=(0,k.A)(()=>{Ze()});(0,N.mv)(Re,Je?void 0:Z),(0,S.A)(je||Pe,Ke,j,Me),(0,P.A)({elementRef:Re,isFocused:U,focusDirection:G,noFocusHighlight:K,isResizingContainer:W,isJustAdded:h,scrollTargetPosition:q});const{isContextMenuOpen:ot,contextMenuAnchor:it,handleBeforeContextMenu:at,handleContextMenu:st,handleContextMenuClose:rt,handleContextMenuHide:ct}=(0,I.A)(Re,We&&J||Q,!m.Vq,p.Ni,B),lt=void 0!==it,dt=u<=0,[ut,ht]=(0,w.A)(dt);(0,o.vJ)(()=>{dt||setTimeout(ht,u*r.zq7)},[u,ht,dt]);const{ref:mt}=(0,R.A)({isOpen:ut,noOpenTransition:dt,noCloseTransition:!0,className:!1,ref:Re});(0,o._W)(()=>{oe?.(Me)}),(0,o.vJ)(()=>{const t=Re.current;t&&(0,v.Y)(t)&&(H&&Ie({chatId:Pe,messageIds:[Me]}),e.hasUnreadMention&&Se({chatId:Pe,messageIds:[Me]}))},[H,Pe,Me,Ie,e.hasUnreadMention]),(0,o.vJ)(()=>{"giftPremium"===Ye.type&&(F?.current&&Me>=F.current||Te)&&ae({})},[Ye.type,Me,Te,F]);const pt=(0,M.A)(Le?$:void 0),gt=(0,k.A)(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ft())}),ft=(0,k.A)(()=>{switch(Ye.type){case"paymentSent":case"paymentRefunded":re({chatId:e.chatId,messageId:e.id});break;case"chatEditPhoto":se({chatId:e.chatId,messageId:e.id,threadId:t,origin:s.TQ.ChannelAvatar});break;case"giftCode":le({slug:Ye.slug,message:{chatId:e.chatId,messageId:e.id}});break;case"prizeStars":he({chatId:e.chatId,messageId:e.id});break;case"giftPremium":Ae({isGift:!0,fromUserId:n?.id,toUserId:n&&n.id===a?Pe:a,daysAmount:Ye.days});break;case"giftTon":case"giftStars":ve({chatId:e.chatId,messageId:e.id});break;case"starGift":ye({chatId:e.chatId,messageId:e.id});break;case"starGiftUnique":if(Ye.gift.isBurned){ke({message:He("ActionStarGiftUniqueBurnedError")});break}ye({chatId:e.chatId,messageId:e.id});break;case"starGiftPurchaseOffer":Ve&&Ne({peerId:Pe,messageId:Me,gift:Ye.gift,price:Ye.price});break;case"channelJoined":Ce({chatId:Pe});break;case"suggestedPostApproval":{const n=(0,d.Q)(e);"message"===n?.type&&n.replyToMsgId&&we({chatId:e.chatId,threadId:t,messageId:n.replyToMsgId});break}case"suggestedPostSuccess":{const n=(0,d.Q)(e);"message"===n?.type&&n.replyToMsgId&&we({chatId:e.chatId,threadId:t,messageId:n.replyToMsgId});break}}}),At=(0,o.Kr)(()=>{switch(Ye.type){case"chatEditPhoto":if(!Ye.photo)return;return(0,E.Y)(L,{action:Ye,observeIntersection:ee,onClick:ft});case"suggestProfilePhoto":return(0,E.Y)(ce,{message:e,action:Ye,observeIntersection:ee});case"prizeStars":case"giftCode":return(0,E.Y)(V,{action:Ye,sender:n,observeIntersectionForLoading:ee,observeIntersectionForPlaying:ne,onClick:ft});case"giftPremium":case"giftTon":case"giftStars":return(0,E.Y)(z,{action:Ye,observeIntersectionForLoading:ee,observeIntersectionForPlaying:ne,onClick:ft});case"starGift":return(0,E.Y)(X,{action:Ye,message:e,observeIntersectionForLoading:ee,observeIntersectionForPlaying:ne,onClick:ft});case"starGiftUnique":return(0,E.Y)(ie,{action:Ye,message:e,observeIntersectionForLoading:ee,observeIntersectionForPlaying:ne,onClick:ft});case"starGiftPurchaseOffer":return(0,E.Y)(te,{action:Ye,message:e,hasButtons:Ve,observeIntersectionForLoading:ee,observeIntersectionForPlaying:ne,onClick:Ve?ft:void 0});case"channelJoined":return(0,E.Y)(xe,{chatId:e.chatId});case"suggestedPostApproval":return Ye.isBalanceTooLow?(0,E.Y)(ue,{message:e,action:Ye,onClick:ft}):Ye.isRejected?(0,E.Y)(me,{message:e,action:Ye,onClick:ft}):(0,E.Y)(de,{message:e,action:Ye,onClick:ft});default:return}},[Ye,e,ee,n,ne,Ve]);if(!(O&&"topicCreate"===Ye.type||"phoneCall"===Ye.type))return(0,E.FD)("div",{ref:mt,id:(0,c.GZ)(Me),className:(0,g.A)("ActionMessage","message-list-item",D.A.root,Be&&D.A.singleLine,Le&&D.A.fluidMultiline,At&&D.A.hasFullContent,U&&!K&&"focused",lt&&"has-menu-open",x&&"last-in-list"),"data-message-id":e.id,"data-is-pinned":e.isPinned||void 0,"data-has-unread-mention":e.hasUnreadMention||void 0,"data-has-unread-reaction":H||void 0,onMouseDown:e=>{(0,y.l)(e),at(e)},onContextMenu:st,children:[!Ee&&(0,E.FD)(E.FK,{children:[Le&&(0,E.Y)("div",{className:(0,g.A)(D.A.inlineWrapper,Oe&&D.A.hoverable,Ue&&D.A.narrowWrapper),children:(0,E.Y)("span",{className:D.A.fluidBackground,style:pt,children:(0,E.Y)(T.A,{message:e,isInsideTopic:O})})}),(0,E.Y)("div",{className:(0,g.A)(D.A.inlineWrapper,Oe&&D.A.hoverable,Ue&&D.A.narrowWrapper),children:(0,E.Y)("span",{className:D.A.textContent,role:"button",tabIndex:0,onClick:ft,onKeyDown:gt,children:(0,E.Y)(T.A,{message:e,isInsideTopic:O})})})]}),(At||_e)&&(0,E.FD)("div",{className:D.A.contentWrapper,children:[At,_e&&(0,E.Y)(ge.A,{className:D.A.inlineButtons,inlineButtons:qe,onClick:et})]}),it&&(0,E.Y)(pe.A,{isOpen:ot,anchor:it,message:e,messageListType:"thread",className:D.A.contextContainer,onClose:rt,onCloseAnimationEnd:ct}),ze&&(0,E.Y)(fe.A,{isOutside:!0,message:e,threadId:t,observeIntersection:ne,isCurrentUserPremium:_,isAccountFrozen:Q}),(0,E.Y)(Y.A,{isOpen:Xe,title:He("GiftOfferRejectTitle"),textParts:He("GiftOfferRejectText",{user:n?(0,l.F9)(He,n):He("ActionFallbackSomeone")},{withNodes:!0,withMarkdown:!0}),confirmLabel:He("GiftOfferReject"),confirmIsDestructive:!0,confirmHandler:tt,onClose:nt})]})}))},60406(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(61433),a=n(66644),s=n(37836);const r=({containerRef:e,selector:t,isBottomNotch:n,shouldHideTopNotch:r},c)=>{(0,o.Nf)(()=>{const o=e.current?.querySelectorAll(t);if(!o?.length)return;const c=(0,s.nF)(e=>{const t=e.target,o=t.scrollTop>0,{scrollHeight:s,scrollTop:c,clientHeight:l}=t,d=s-c-l<5;(0,a.RK)(()=>{r||(0,i.dH)(t,"scrolled",o),n&&(0,i.dH)(t,"scrolled-to-end",d)})},100);return o.forEach(e=>{r||(0,i.YM)(e,"with-notch"),n&&(0,i.YM)(e,"with-bottom-notch"),e.addEventListener("scroll",c,{passive:!0})}),()=>{o.forEach(e=>{e.removeEventListener("scroll",c),(0,i.HW)(e,"with-notch"),(0,i.HW)(e,"with-bottom-notch"),(0,i.HW)(e,"scrolled"),(0,i.HW)(e,"scrolled-to-end")})}},[e,t,n,r,...c]),(0,o.vJ)(()=>{const o=e.current?.querySelectorAll(t);o?.length&&o.forEach(e=>{const t=e.scrollTop>0,{scrollHeight:o,scrollTop:s,clientHeight:c}=e,l=o-s-c<5;(0,a.RK)(()=>{r||(0,i.dH)(e,"scrolled",t),n&&(0,i.dH)(e,"scrolled-to-end",l)})})},[e,t,n,r,...c])}},64489(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(87357),a=n(95807),s=n(37661),r=n(17712),c=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,c.A)(p),[A,v,y]=(0,s.A)(h.has(t)),C=(0,c.A)(A),[I,S]=(0,s.A)(!1),w=(0,r.A)(()=>{v(),h.add(t)}),N=(0,r.A)(()=>{g(),y(),setTimeout(S,300)}),{size:b}=e;return(0,u.FD)("div",{className:(0,i.A)(o,"xCi2f0YH"),style:(0,a.A)(void 0!==b&&`width: ${b}px; height: ${b}px;`),children:[n&&!I&&(0,u.Y)("img",{src:n,className:(0,i.A)(d,f),draggable:!1}),t&&!I&&(0,u.Y)("img",{src:t,className:(0,i.A)(d,C),draggable:!1,onLoad:w}),(0,u.Y)(l.A,{...m,onLoad:N})]})})},65632(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(13439),a=n(31481),s=n(74824),r=n(87679);const c=(e,t)=>{const{setThemeSettings:n}=(0,i.ko)(),[c,l]=(0,o.J0)(t);return(0,o.vJ)(()=>{t&&(t.startsWith("#")?l(t):s.fetch(a.nfi,e,s.Type.Blob).then(e=>{const t=URL.createObjectURL(e);(0,r.NN)(t).then(()=>{l(`url(${t})`)})}).catch(()=>{n({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?a.MkD:a.be8})}))},[t,e]),t?c:void 0}},66833(e,t,n){n.d(t,{HM:()=>d,IT:()=>m,UC:()=>c,e0:()=>h,uc:()=>l,y8:()=>u,yQ:()=>r});var o=n(23174),i=n(90709),a=n(58554),s=n(14242);function r(e){return"starGift"===e.type?e.sticker:e.attributes.find(e=>"model"===e.type)?.sticker}function c(e){return"starGift"===e.type?e.availabilityTotal:e.totalCount}function l(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)}function d(e,t){const n=e.filter(e=>"model"===e.type&&e.name!==t?.model.name),o=e.filter(e=>"pattern"===e.type&&e.name!==t?.pattern.name),i=e.filter(e=>"backdrop"===e.type&&e.name!==t?.backdrop.name);if(!n.length||!o.length||!i.length){const t=n.length?n:e.filter(e=>"model"===e.type),a=o.length?o:e.filter(e=>"pattern"===e.type),s=i.length?i:e.filter(e=>"backdrop"===e.type);return{model:t[Math.floor(Math.random()*t.length)],pattern:a[Math.floor(Math.random()*a.length)],backdrop:s[Math.floor(Math.random()*s.length)]}}return{model:n[Math.floor(Math.random()*n.length)],pattern:o[Math.floor(Math.random()*o.length)],backdrop:i[Math.floor(Math.random()*i.length)]}}function u(e){[...e.filter(e=>"pattern"===e.type).map(e=>e.sticker),...e.filter(e=>"model"===e.type).map(e=>e.sticker)].map(e=>(0,i.Mw)(e,"full")).forEach(e=>{(0,a.hd)(e,o.qZ.BlobUrl)})}function h(e,t,n){if(!n.length)return 1;for(const o of n)if(o.amount<e||o.amount===e&&o.date>=t)return o.pos;return n[n.length-1].pos+1}function m(e,t){switch(t.type){case"uncommon":return e("GiftRarityUncommon");case"rare":return e("GiftRarityRare");case"epic":return e("GiftRarityEpic");case"legendary":return e("GiftRarityLegendary");case"regular":return(0,s.l9)(t.rarityPercent);default:return}}},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,i;n.d(t,{M6:()=>c,v5:()=>l});const a={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(i&&e.target.closest(i))return;e.preventDefault()}};function r(e){a[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 c(e,t){return o=e,i=t,document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),document.onkeydown=r,l}function l(){o=void 0,i=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:()=>c,ic:()=>r});var o=n(84051),i=n(49763),a=n(30857);function s(e){const t=(0,a.A)();return(0,o.vJ)(()=>(0,i.Yw)(e,t),[e,t]),(0,i.YA)(e)}function r(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.P1)(e),[e]),(0,i.PZ)()}function c(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.BU)(e),[e]),(0,i.jn)()}function l(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.dk)(e),[e]),(0,i.Xq)()}},76283(e,t,n){n.d(t,{A:()=>P});var o=n(84051),i=n(13439),a=n(90709),s=n(87357),r=n(17712),c=n(59030),l=n(64493),d=n(96530),u=n(14957),h=n(76023),m=n(10722),p=n(4438),g=n(87412),f=n(18276);const A="uGUjDZKl",v="M62HGuIV",y="WMpEr5XQ";var C=n(20021);const I=2*h.$,S=(0,o.ph)(({reaction:e,chosen:t,isReady:n,noAppearAnimation:i,style:a,isLocked:c,onToggleReaction:l,onSendPaidReaction:d,onShowPaidReactionModal:h})=>{const S=(0,o.li)(),w=(0,r.A)(()=>{"paid"!==e.type?l(e):d?.()}),{isContextMenuOpen:N,handleBeforeContextMenu:b,handleContextMenu:k,handleContextMenuClose:R,handleContextMenuHide:M}=(0,m.A)(S,"paid"!==e.type,void 0,void 0,void 0,!0);return(0,o.vJ)(()=>{N&&(h?.(),R(),M())},[R,h,M,N]),(0,C.FD)("div",{className:(0,s.A)(A,"oc1hpMwv",t&&"paid"!==e.type&&v,!i&&n&&"sx6RTuAU",i&&"kqcWe4tf"),ref:S,style:a,onClick:w,onMouseDown:b,onContextMenu:k,children:["paid"===e.type?(0,C.Y)(p.A,{tgsUrl:u.w.StarReaction,size:I,noLoop:!1}):(0,C.Y)(g.A,{documentId:e.documentId,size:I}),c&&(0,C.Y)(f.A,{className:y,name:"lock-badge"})]})});var w=n(37661),N=n(62587),b=n(18104);const k=2*h.$,R=(0,o.ph)(({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,isLocked:i,onToggleReaction:a})=>{const r=(0,N.A)(`sticker${e.appearAnimation?.id}`,!t||n),c=(0,N.A)(`document${e.selectAnimation?.id}`,!t||n),l=(0,N.A)(`document${e.staticIcon?.id}`,!n),[d,u]=(0,w.A)(),[h,,m]=(0,w.A)(!0),[p,g,I]=(0,w.A)();return(0,C.FD)("div",{className:(0,s.A)(A,o&&v),onClick:function(){a(e.reaction)},onMouseEnter:t&&!h?g:void 0,children:[n&&(0,C.Y)("img",{className:"MZ2tH980",src:l,alt:e.reaction.emoticon,draggable:!1}),!d&&!n&&(0,C.Y)(b.A,{tgsUrl:r,play:h,noLoop:!0,size:k,onEnded:m,forceAlways:!0},e.appearAnimation?.id),!h&&!n&&(0,C.Y)(b.A,{tgsUrl:c,play:p,noLoop:!0,size:k,onLoad:u,onEnded:I,forceAlways:!0},e.selectAnimation?.id),i&&(0,C.Y)(f.A,{className:y,name:"lock-badge"})]})}),M=(0,s.x)("ReactionSelector"),P=(0,o.ph)(({allAvailableReactions:e,topReactions:t,defaultTagReactions:n,enabledReactions:u,currentReactions:h,reactionsLimit:m,isPrivate:p,isReady:g,canPlayAnimatedEmojis:f,className:A,isCurrentUserPremium:v,isInSavedMessages:y,isInStoryViewer:I,isForEffects:w,effectReactions:N,isWithPaidReaction:b,onClose:k,onToggleReaction:P,onSendPaidReaction:Y,onShowPaidReactionModal:T,onShowMore:x})=>{const{openPremiumModal:F}=(0,i.ko)(),D=(0,o.li)(),E=(0,c.A)(),B=y&&!v&&!I,L=Boolean(m&&h&&h.length>=m),O=(0,o.Kr)(()=>{const o=L?h?.map(e=>e.reaction):w?N:y?n:"some"===u?.type?u.allowed:e?.map(e=>e.reaction),i=o?.map(t=>{const n="custom"===t.type,o=e?.find(e=>(0,a.a0)(e.reaction,t));return w?o:(n||o)&&!o?.isInactive&&(p||L||u&&(0,a.A3)(t,u))?n?t:o:void 0}).filter(Boolean)||[],s=(0,a.fu)(i,t);return b&&s.unshift({type:"paid"}),s},[e,h,n,u,y,p,t,w,N,L,b]),U=(0,o.Kr)(()=>8===O.length?O:O.slice(0,7),[O]),G=U.length<O.length,K=(0,o.Kr)(()=>{const e=h?.filter(({chosenOrder:e})=>void 0!==e)||[];return new Set(e.map(({reaction:e})=>U.findIndex(t=>t&&(0,a.a0)("reaction"in t?t.reaction:t,e))))},[h,U]),j=(0,r.A)(()=>{const e=D.current?.getBoundingClientRect()||{x:0,y:0};x({x:e.x,y:e.y})}),z=(0,r.A)(()=>{k?.(),F({initialSection:"saved_tags"})}),$=(0,o.Kr)(()=>{if(y){if(!v){const e=E("lng_subscribe_tag_about").split("{link}");return(0,C.FD)("span",{children:[e[0],(0,C.Y)(d.A,{isPrimary:!0,onClick:z,children:E("lng_subscribe_tag_link")}),e[1]]})}return E("SavedTagReactionsHint2")}return I?E("StoryReactionsHint"):w?E("AddEffectMessageHint"):void 0},[v,y,I,E,w]);if(U.length)return(0,C.FD)("div",{className:(0,s.A)(M("&"),A),ref:D,children:[(0,C.Y)("div",{className:M("bubble-small",E.isRtl&&"isRtl")}),(0,C.FD)("div",{className:M("items-wrapper"),children:[(0,C.Y)("div",{className:M("bubble-big",E.isRtl&&"isRtl")}),(0,C.FD)("div",{className:M("items"),children:[$&&(0,C.Y)("div",{className:M("hint"),children:$}),(0,C.FD)("div",{className:M("reactions"),dir:E.isRtl?"rtl":void 0,children:[U.map((e,t)=>"reaction"in e?(0,C.Y)(R,{isReady:g,onToggleReaction:P,reaction:e,noAppearAnimation:!f,chosen:K.has(t),isLocked:B},(0,a.Jj)(e.reaction)):(0,C.Y)(S,{isReady:g,onToggleReaction:P,onSendPaidReaction:Y,onShowPaidReactionModal:T,reaction:e,noAppearAnimation:!f,chosen:K.has(t),isLocked:B,style:`--_animation-delay: ${20*(7-t)}ms`},(0,a.Jj)(e))),G&&(0,C.Y)(l.A,{color:"translucent",className:M("show-more"),onClick:j,iconName:"down"})]})]})]})]})})},79174(e,t,n){n.d(t,{A:()=>r});var o=n(84051),i=n(66644),a=n(96454),s=n(97822);function r(e,t,n){(0,o.vJ)(()=>{t?!a.TF&&e.current?.isConnected&&(0,i.YS)(()=>{(0,s.A)(e.current)}):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,300))},[e,t,n])}},79577(e,t,n){n.d(t,{A:()=>l});var o=n(84051),i=n(23174),a=n(90709),s=n(62587),r=n(64489),c=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,a.Mw)(t,"full"),h=(0,s.A)(t?(0,a.Mw)(t,"preview"):void 0,n&&!o,i.qZ.BlobUrl),m=(0,s.A)(u,n);return(0,c.Y)(r.A,{tgsUrl:m,previewUrl:h,thumbDataUri:d,...l})})},79582(e,t,n){n.d(t,{A:()=>s});var o=n(13439),i=n(11597),a=n(87894);function s(e,t=!1,n,s){const r=(0,o.mS)();return(0,a.My)(e,e=>{if(e===s)return 1/0;const o=(0,i.hds)(r,e);if(!o)return 0;let a=0;const c=(0,i.yHC)(r,e);return c&&(a+=c.date),t&&o.isVerified&&(a+=3e9),n&&n.includes(e)&&(a=Date.now()+3e8+(n.length-n.indexOf(e))),a},"desc")}},80539(e,t,n){n.d(t,{Ay:()=>r,g4:()=>c,qh:()=>s});var o=n(23174),i=n(31481),a=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};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(/ /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>"),a.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(`\\[([^\\]]+?)]\\((${i.kNZ}+?)\\)`,"g"),(e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`)}(e):e),c(r);const l=r.innerText.trim().replace(/\u200b+/g,"");let d=-r.innerText.indexOf(l[0]),u=0;const h=[];function m(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const i=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(!i||!e.textContent)return{index:n,entity:void 0};const a=t.indexOf(e.textContent,n),r=a>=0?a:n,c=t.substring(0,r).length,{length:l}=t.substring(r,r+e.textContent.length);if(i===o.C7.TextUrl)return{index:r,entity:{type:i,offset:c,length:l,url:e.href}};if(i===o.C7.MentionName)return{index:r,entity:{type:i,offset:c,length:l,userId:e.dataset.userId}};if(i===o.C7.Pre)return{index:r,entity:{type:i,offset:c,length:l,language:e.dataset.language}};if(i===o.C7.CustomEmoji)return{index:r,entity:{type:i,offset:c,length:l,documentId:e.dataset.documentId}};if(i===o.C7.Timestamp){const t=Number(e.dataset.timestamp);return Number.isNaN(t)?{index:r,entity:void 0}:{index:r,entity:{type:i,offset:c,length:l,timestamp:t}}}return{index:r,entity:{type:i,offset:c,length:l}}}(e,l,d);if(n)d=t,h.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;d+=e.textContent.length}e.hasChildNodes()&&u<=3&&(u+=1,Array.from(e.childNodes).forEach(m))}return Array.from(r.childNodes).forEach(e=>{u=1,m(e)}),{text:l,entities:h.length?h:void 0}}function c(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);function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&a(e.focusNode,o.zPk);if(!t||0===t.childElementCount)return;const i=Array.from(t.children).reduce((e,t)=>1===t.nodeType&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce((e,t)=>e.concat(Number(t.dataset.messageId)),e):1===t.nodeType&&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 a(e,t){return!(1!==e.nodeType||!e.classList.contains(t))||!!e.parentNode&&a(e.parentNode,t)}},81949(e,t,n){n.d(t,{A:()=>a});var o=n(87357);var i=n(20021);const a=({children:e,className:t,onClick:n,onMouseDown:a})=>(0,i.Y)("div",{className:(0,o.A)("hJUqHi4B",n&&"hjDEmFaT",t),onClick:n,onMouseDown:a,children:e})},81954(e,t,n){n.d(t,{Ay:()=>f,H$:()=>C,_v:()=>A,o8:()=>y});var o=n(61433),i=n(84051),a=n(13439),s=n(89925),r=n(31481),c=n(66644),l=n(11597),d=n(96454),u=n(16460),h=n(19822);let m,p,g=!1;function f(e){m=e;const t=v(e);if(e.shouldReturnMutationFn)return t;(0,c.RK)(t)}function A(){g&&((0,h.vk)(),(0,c.YS)(()=>{(0,c.RK)(v(m))}))}function v(e){const{container:t,element:n,position:f,margin:A=0,maxDistance:v=r.nxZ,forceDirection:y,forceNormalContainerHeight:C}=e;let w=e.forceDuration;y!==s.CC.Static&&(0,l.PKK)((0,a.mS)())||(w=0);const{offsetHeight:N}=n,{scrollTop:b,clientHeight:k,scrollHeight:R}=t,M=(0,u.A)(n,t).top,P=C&&t.dataset.normalHeight?Number(t.dataset.normalHeight):k;let Y;switch(f){case"start":Y=M-A+(d.Ni?1:0);break;case"end":Y=M+N+A-P;break;case"nearest":case"center":case"centerOrTop":Y=N<P?M+N/2-P/2:M-A}const T=function(e,t,n=r.nxZ,o){const{scrollTop:i}=e;if(void 0===o){const e=t-i;if(e<-n)return i+(e+n);if(e>n)return i+(e-n)}else{if(o===s.CC.Up)return t+n;if(o===s.CC.Down)return Math.max(0,t-n)}return i}(t,Y,v,y);let x=Y-T;if(x<0){const e=-T;x=Math.max(x,e)}else if(x>0){const e=R-(T+P);x=Math.min(x,e)}const F=Math.abs(x);return()=>{if(F<1)return void(b!==T&&(t.scrollTop=T));const e=T+x;if(0===w)return void(t.scrollTop=e);const n=F<=r.s8T?I:S,a=w||r.SKD+F/r.nxZ*(r.OzO-r.SKD),s=Date.now();g=!0,(0,o.Tv)(t,{scrollSnapType:"none"});const l=p;p=(0,i.VK)(void 0,!0),l?.(),(0,h.S0)(()=>{const i=Math.min((Date.now()-s)/a,1),r=x*(1-n(i)),c=Math.round(e-r);return t.scrollTop=c,g=i<1&&c!==e,g||(m=void 0,(0,o.Tv)(t,{scrollSnapType:""}),p?.(),p=void 0),g},c.RK)}}function y(){return g}function C(){m?.container&&(0,o.Tv)(m.container,{scrollSnapType:""}),p?.(),p=void 0}function I(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),i=n(90709),a=n(96454),s=n(87357),r=n(95807),c=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,i.aL)(e.documentId,!0),g=(0,c.A)(t?void 0:p),f=(0,o.Kr)(()=>a.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,r.A)(Boolean(h)&&`--particle-size: ${h}px`),children:f.map((n,o)=>{const i=`--offset-path: path('${n}');`;return t?(0,u.Y)(l.A,{documentId:e.documentId,className:d,style:i,withSharedAnimation:!0,size:h,onAnimationEnd:0===o?m:void 0}):(0,u.Y)("img",{src:g,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===o?m:void 0})})})})},85449(e,t,n){n.d(t,{A:()=>c});var o=n(31481),i=n(98607),a=n(4961),s=n(18276),r=n(20021);function c(e,t){return"receipt"===t.type?e("PaymentReceipt"):"buy"===t.type?(0,i.i)(t.text,o.Cyx,(0,r.Y)(s.A,{name:"star"})):(0,a.A)(t.text)}},87049(e,t,n){n.d(t,{A:()=>m});var o=n(84051),i=n(13439),a=n(11597),s=n(87357),r=n(14745);const c={root:"AmQSvxpZ",text:"pQW7dcwr"};var l=n(20021);const d={red:[["#FF5B54","#ED1C26"],["#653633","#532224"]],blue:[["#6ED2FF","#34A4FC"],["#344F5A","#152E42"]],purple:[["#E367D7","#757BF6"],["#E367D7","#757BF6"]],green:[["#52D553","#4BB121"],["#52D553","#4BB121"]],orange:[["#D48F23","#BE7E15"],["#D48F23","#BE7E15"]]},u=new Set(Object.keys(d)),h=6/56,m=(0,o.ph)((0,i.EK)(e=>({theme:(0,a.SJA)(e)}))(({text:e,color:t,size:n=56,className:o,textClassName:i,theme:a})=>{const m=`svg-${(0,r.A)()}`,p=u.has(t)?t:void 0,g="dark"===a,f=Array.isArray(t)?t:p?d[p][g?1:0]:void 0,A=f?f[0]:t,v=f?f[1]:t,y=Math.round(n*h);return(0,l.FD)("div",{className:(0,s.A)(c.root,o),style:`width: ${n}px; height: ${n}px`,children:[(0,l.FD)("svg",{className:c.ribbon,width:n,height:n,viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[(0,l.Y)("path",{d:"M52.4851 26.4853L29.5145 3.51472C27.2641 1.26428 24.2119 0 21.0293 0H2.82824C1.04643 0 0.154103 2.15429 1.41403 3.41422L52.5856 54.5858C53.8455 55.8457 55.9998 54.9534 55.9998 53.1716V34.9706C55.9998 31.788 54.7355 28.7357 52.4851 26.4853Z",fill:`url(#${m})`}),(0,l.Y)("defs",{children:(0,l.FD)("linearGradient",{id:m,x1:"27.9998",y1:"1",x2:"27.9998",y2:"55",gradientUnits:"userSpaceOnUse",children:[(0,l.Y)("stop",{"stop-color":A}),(0,l.Y)("stop",{offset:"1","stop-color":v})]})})]}),(0,l.Y)("div",{className:(0,s.A)(c.text,i),style:`transform: translate(-50%, -50%) translate(${y}px, ${-y}px) rotate(45deg)`,children:e})]})}))},92108(e,t,n){n.d(t,{A:()=>s});var o=n(84051),i=n(87357);var a=n(20021);const s=(0,o.ph)(({data:e,style:t,className:n,valueClassName:o,keyClassName:s})=>(0,a.Y)("div",{className:(0,i.A)("cKr8J5k_",n),style:t,children:e.map(([e,t])=>(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:(0,i.A)("c9RLLvfs",s),children:e}),(0,a.Y)("div",{className:(0,i.A)("QEuGpzIc",o),children:t})]}))}))},92915(e,t,n){n.d(t,{A:()=>I});var o=n(84051),i=n(13439),a=n(87357),s=n(76023),r=n(10722),c=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:i,submitText:a,maxLength:s,initialValue:r="",onClose:c,onSubmit:u})=>{const f=(0,d.A)(),[A,v]=(0,o.J0)(r),y=(0,l.A)(e=>{v(e.target.value)}),C=(0,l.A)(()=>{u(A)});return(0,g.FD)(p.A,{className:"narrow",title:t,isOpen:e,onClose:c,isSlim:!0,children:[Boolean(n)&&(0,g.Y)("div",{className:"cGrbcqD_",children:n}),(0,g.Y)(m.A,{placeholder:i,value:A,onChange:y,maxLength:s,teactExperimentControlled:!0}),(0,g.FD)("div",{className:"dialog-buttons mt-2",children:[(0,g.Y)(h.A,{className:"confirm-dialog-button",onClick:C,children:a||f("Save")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:c,children:f("Cancel")})]})]})});var A=n(71429),v=n(24433),y=n(69988);const C=1.25*s.$,I=(0,o.ph)(({reaction:e,tag:t,containerId:n,isChosen:s,isOwnMessage:m,className:p,chosenClassName:I,withCount:S,isDisabled:w,withContextMenu:N,observeIntersection:b,onClick:k,onRemove:R})=>{const{editSavedReactionTag:M}=(0,i.ko)(),P=(0,o.li)(),Y=(0,o.li)(),T=(0,d.A)(),[x,F,D]=(0,c.A)(),{title:E,count:B}=t||{},L=Boolean(E||S&&B),O=(0,l.A)(()=>{k?.(e)}),U=(0,l.A)(()=>{R?.(e)}),G=(0,l.A)(t=>{M({reaction:e,title:t}),D()}),{isContextMenuOpen:K,contextMenuAnchor:j,handleBeforeContextMenu:z,handleContextMenu:$,handleContextMenuClose:V,handleContextMenuHide:_}=(0,r.A)(P,!N,void 0,void 0,void 0,!0),J=(0,l.A)(()=>P.current),H=(0,l.A)(()=>document.body),W=(0,l.A)(()=>Y.current),q=(0,l.A)(()=>({withPortal:!0,shouldAvoidNegativePosition:!0}));if(!S||0!==B)return(0,g.FD)(h.A,{className:(0,a.A)(y.A.root,y.A.tag,m&&y.A.own,s&&y.A.chosen,s&&I,w&&y.A.disabled,p),size:"tiny",onClick:O,onMouseDown:z,onContextMenu:$,ref:P,children:[(0,g.Y)(u.A,{className:y.A.animatedEmoji,containerId:n,reaction:e,loopLimit:1,size:C,observeIntersection:b}),L&&(0,g.FD)("span",{className:y.A.tagText,children:[E&&(0,g.Y)("span",{children:E}),S&&(0,g.Y)("span",{children:B})]}),(0,g.Y)("svg",{className:y.A.tail,width:"15",height:"30",viewBox:"0 0 15 30",children:(0,g.Y)("path",{className:y.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"})}),N&&(0,g.Y)(f,{isOpen:x,maxLength:15,title:T(t?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:T("SavedTagLabelTagText"),placeholder:T("SavedTagLabelPlaceholder"),initialValue:t?.title,onClose:D,onSubmit:G}),N&&j&&(0,g.FD)(A.A,{ref:Y,isOpen:K,anchor:j,getTriggerElement:J,getRootElement:H,getMenuElement:W,getLayout:q,autoClose:!0,withPortal:!0,onClose:V,onCloseAnimationEnd:_,children:[(0,g.Y)(v.A,{icon:"tag-filter",onClick:O,children:T("SavedTagFilterByTag")}),(0,g.Y)(v.A,{icon:"tag-name",onClick:F,children:T(t?.title?"SavedTagRenameTag":"SavedTagLabelTag")}),(0,g.Y)(v.A,{icon:"tag-crossed",destructive:!0,onClick:U,children:T("SavedTagRemoveTag")})]})]})})},93005(e,t,n){n.d(t,{NH:()=>c,QG:()=>d,S$:()=>g,Xz:()=>p,gh:()=>r,kX:()=>f,pV:()=>s,rG:()=>u,w7:()=>h});class o{hierarchy=[];constructor(e){this.hierarchy=[...e||[]]}with(e){return new o([...this.hierarchy,e])}getTypes(){return this.hierarchy}}const i=new o(["rightColumn"]),a=i.with("profileAvatar"),s=a.with("profileExpand"),r=a.with("profileCollapse"),c=i.with("profileGifts"),l=i.with("chatExtra"),d=l.with("profileBusinessHours"),u=d.with("profileBusinessHoursExpand"),h=d.with("profileBusinessHoursCollapse"),m=l.with("profileNote"),p=m.with("profileNoteExpand"),g=m.with("profileNoteCollapse"),f=new o(["craftAttributes"])},93879(e,t,n){n.d(t,{A:()=>o});const o={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"}},95773(e,t,n){n.d(t,{A:()=>c});var o=n(84051),i=n(87357),a=n(95807),s=n(85118);var r=n(20021);const c=(0,o.ph)(({children:e,ref:t,className:n,style:c,withSparkles:l,sparklesClassName:d,sparklesColor:u,glowColor:h,onClick:m})=>{let p=(0,o.li)();return t&&(p=t),(0,r.FD)("div",{ref:p,className:(0,i.A)("Z9JWyzAs",n),style:(0,a.A)(h&&`--glow-color: ${h}`,c),onClick:m,children:[l&&(0,r.Y)(s.A,{preset:"button",className:(0,i.A)("fQBp2vKr",d),style:(0,a.A)(u&&`color: ${u}`)}),e]})})},96374(e,t,n){n.d(t,{A:()=>d});var o=n(84051),i=n(89925),a=n(87894),s=n(30857),r=n(17712),c=n(73767);function l(e,t,n,o){const{length:a}=e,s=o?e.indexOf(o):0,r=t===i.TN.Forwards?s:s+1||a,c=Math.max(0,r-n),l=r+n-1,d=e.slice(Math.max(0,c),l+1);let u,h;switch(t){case i.TN.Forwards:u=r>=0,h=c>=0;break;case i.TN.Backwards:u=r<a,h=l<=a-1}return{newViewportIds:d,areSomeLocal:u,areAllLocal:h,newIsOnTop:d[0]===e[0],fromOffset:c}}const d=(e,t,n=!1,d=30)=>{const u=(0,o.li)(),h=(0,o.li)();if(!h.current&&t&&!n){const{newViewportIds:e,newIsOnTop:n,fromOffset:o}=l(t,i.TN.Forwards,d,t[0]);h.current={viewportIds:e,isOnTop:n,offset:o}}const m=(0,s.A)();n&&(u.current={});const p=(0,c.A)(t),g=(0,c.A)(n);if(!t||n||t===p&&n===g)t||(h.current=void 0);else{const{viewportIds:e,isOnTop:n}=h.current||{},o=e&&!n?e[Math.round(e.length/2)]:void 0,s=o&&t.includes(o)?o:t[0],{offsetId:r=s,direction:c=i.TN.Forwards}=u.current||{},{newViewportIds:m,newIsOnTop:p,fromOffset:g}=l(t,c,d,r);u.current={},e&&(0,a.k)(e,m)||(h.current={viewportIds:m,isOnTop:p,offset:g})}const f=(0,r.A)(({direction:n,noScroll:o})=>{const{viewportIds:s}=h.current||{},r=s?n===i.TN.Backwards?s[s.length-1]:s[0]:void 0;if(!t)return void(e&&e({offsetId:r}));const{newViewportIds:c,areSomeLocal:p,areAllLocal:g,newIsOnTop:f,fromOffset:A}=l(t,n,d,r);!p||s&&(0,a.k)(s,c)||(h.current={viewportIds:c,isOnTop:f,offset:A},m()),!g&&e&&(o||(u.current={...u.current,direction:n,offsetId:r}),e({offsetId:r}))});return n?[t]:[h.current?.viewportIds,f,h.current?.offset]}},97822(e,t,n){function o(e){e&&e.focus({preventScroll:!0})}n.d(t,{A:()=>o})},99515(e,t,n){n.d(t,{A:()=>te});var o=n(84051),i=n(13439),a=n(23174),s=n(31481),r=n(90709),c=n(11597),l=n(56494),d=n(96115),u=n(87357),h=n(85982),m=n(48899),p=n(80539);const g=document.createElement("div"),f=new Set([a.C7.Bold,a.C7.Italic,a.C7.Underline,a.C7.Strike,a.C7.Spoiler,a.C7.CustomEmoji]);function A(e){const t=function(e){const t=e.cloneContents();g.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,g.innerHTML);return g.innerHTML="",n.replace(/<br\s*\/?>/gi,"\n").replace(/ /gi," ").replace(/\u00a0/gi," ")}(e);return function(e){if(!e.entities)return e;const t=e.entities.filter(e=>f.has(e.type));return{...e,entities:t.length?t:void 0}}((0,p.Ay)(t,!1,!0))}var v=n(37661),y=n(39351),C=n(17712),I=n(59030),S=n(24531),w=n(34201),N=n(80089),b=n(80464),k=n(20021);const R=e=>{const{isOpen:t}=e,n=(0,b.A)(N.ar.Extra,"PinMessageModal",!t);return n?(0,k.Y)(n,{...e}):void 0};var M=n(94189),P=n(73104),Y=n(76023),T=n(4961),x=n(3544),F=n(96454),D=n(81686),E=n(43044),B=n(58554),L=n(49086);function O(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var U=n(43874),G=n(26875),K=n(71429),j=n(24433),z=n(60859),$=n(55158),V=n(17663);const _="C3LVl_JT",J="cd1ZZeSy",H=(0,o.ph)(function({message:e}){const t=(0,I.A)(),{editDate:n}=e,o=!n;return(0,k.Y)(j.A,{icon:"clock-edit",className:_,children:o?(0,k.Y)($.A,{className:J}):Boolean(n)&&t("Chat.PrivateMessageEditTimestamp.Date",(0,V.U)(t,1e3*n))})});var W=n(76283),q=n(41036);const X=(0,o.ph)(function({message:e,shouldRenderShowWhen:t,canLoadReadDate:n,closeContextMenu:o}){const{openPrivacySettingsNoticeModal:a}=(0,i.ko)(),s=(0,I.A)(),{readDate:r}=e,c=n&&!r&&!t;return(0,k.Y)(j.A,{icon:"message-read",className:_,children:(0,k.Y)(q.Ay,{name:"fade",activeKey:c?1:2,className:"mg4sBQ9n",children:c?(0,k.Y)($.A,{className:J}):(0,k.FD)(k.FK,{children:[Boolean(r)&&s("PmReadAt",(0,V.U)(s,1e3*r)),!r&&t&&(0,k.FD)("div",{children:[s("PmRead"),(0,k.Y)("span",{className:"bmxij_dk",onClick:()=>{o(),a({chatId:e.chatId,isReadDate:!0})},children:s("PmReadShowWhen")})]})]})})})}),Q=(0,o.ph)(({isReactionPickerOpen:e,availableReactions:t,topReactions:n,defaultTagReactions:s,isOpen:c,message:l,poll:d,webPage:p,story:g,isPrivate:f,isCurrentUserPremium:A,enabledReactions:S,isWithPaidReaction:w,reactionsLimit:N,anchor:b,targetHref:R,canSendNow:M,canReschedule:V,canBuyPremium:_,canReply:J,canQuote:q,canEdit:Q,canAppendTodoList:Z,noReplies:ee,canPin:te,canUnpin:ne,canDelete:oe,canForward:ie,canReport:ae,canFaveSticker:se,canUnfaveSticker:re,canCopy:ce,canCopyLink:le,canSelect:de,canDownload:ue,canSaveGif:he,canRevote:me,canClosePoll:pe,canTranslate:ge,canShowOriginal:fe,canSelectLanguage:Ae,isDownloading:ve,repliesThreadInfo:ye,canShowSeenBy:Ce,canShowReactionsCount:Ie,canShowReactionList:Se,seenByRecentPeers:we,hasCustomEmoji:Ne,customEmojiSets:be,canPlayAnimatedEmojis:ke,isInSavedMessages:Re,shouldRenderShowWhen:Me,canLoadReadDate:Pe,onReply:Ye,onOpenThread:Te,onEdit:xe,onAppendTodoList:Fe,onPin:De,onUnpin:Ee,onForward:Be,onDelete:Le,onFaveSticker:Oe,onReport:Ue,onUnfaveSticker:Ge,onSelect:Ke,onSend:je,onReschedule:ze,onClose:$e,onCloseAnimationEnd:Ve,onCopyLink:_e,onCopyNumber:Je,onDownload:He,onSaveGif:We,onCancelVote:qe,onClosePoll:Xe,onShowSeenBy:Qe,onShowReactors:Ze,onToggleReaction:et,onSendPaidReaction:tt,onShowPaidReactionModal:nt,onCopyMessages:ot,onReactionPickerOpen:it,onTranslate:at,onShowOriginal:st,onSelectLanguage:rt,userFullName:ct,canGift:lt})=>{const{showNotification:dt,openStickerSet:ut,openCustomEmojiSets:ht,loadStickers:mt,openGiftModal:pt}=(0,i.ko)(),gt=(0,o.li)(),ft=(0,o.li)(),At=(0,I.A)(),vt=(0,y.A)(),yt=!f&&!S,Ct=l.areReactionsPossible,It=Se&&!yt||Ct,St="isEdited"in l&&l.isEdited,wt=l.seenByDates,Nt="giftPremium"===l.content.action?.type,bt="giftCode"===l.content.action?.type,kt="starGift"===l.content.action?.type,Rt="starGiftUnique"===l.content.action?.type,Mt=(0,m.L8)(l.chatId)&<&&(Nt||bt||kt||Rt),[Pt,Yt,Tt]=(0,v.A)(),{isMobile:xt}=(0,U.Ay)(),Ft=(0,o.Kr)(()=>wt?Object.keys(wt).length:0,[wt]),Dt=(0,C.A)(()=>{dt({message:At("Share.Link.Copied")}),$e()}),Et=(0,C.A)(()=>{pt({forUserId:l.chatId}),$e()});(0,o.vJ)(()=>{be?.length&&be.map(e=>mt({stickerSetInfo:{id:e.id,accessHash:e.accessHash}}))},[be,ht]);const Bt=(0,C.A)(()=>{be&&(1===be.length?ut({stickerSetInfo:{shortName:be[0].shortName}}):ht({setIds:be.map(e=>e.id)}),$e())}),Lt=function(e,t,n,o,i,s,c,l){const{webPage:d}=t||{},u=[],m=(0,r.P5)(e),p=(0,r.yl)(e)||((0,r.rU)(d)?void 0:(0,r.eY)(d)),g=(0,r.Qm)(e),f=p?(0,r.rI)(p,"full"):void 0,A=o&&p&&(f||(0,r.KG)(p))&&h.WO&&!F.Yw,v=window.getSelection();if(A&&u.push({label:"lng_context_copy_image",icon:"copy-media",handler:()=>{Promise.resolve(f?B.hd(f,a.qZ.BlobUrl):p.blobUrl).then(h.qp),i?.()}}),o&&n)u.push({label:"lng_context_copy_link",icon:"copy",handler:()=>{(0,h.eM)(n),i?.()}});else if(o&&m){const n=Boolean(v?.anchorNode?.parentNode&&v.anchorNode.parentNode.closest(".Message .content-inner")&&""!==v.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,r.GZ)(e.id)===o?.id}(e));u.push({label:O(n),icon:"copy",handler:()=>{const o=(0,D.A)();if(o?.length&&c)c(o);else if(n)document.execCommand("copy");else{const n=(0,L.V)({message:e,shouldRenderAsHtml:!0});n&&(0,h.A)(n.join(""),(0,x.Gn)((0,E.Yw)(),e,t))}i?.()}})}return s&&u.push({label:"lng_context_copy_message_link",icon:"link",handler:s}),g&&l&&u.push({label:"lng_profile_copy_phone",icon:"copy",handler:()=>{l(),i?.()}}),u}(l,(0,r.FE)({poll:d,webPage:p,story:g}),R,ce,Dt,le?_e:void 0,ot,Je),Ot=(0,C.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),Ut=(0,C.A)(()=>document.body),Gt=(0,C.A)(()=>document.querySelector(".MessageContextMenu .bubble")),Kt=(0,C.A)(()=>({extraPaddingX:10,extraTopPadding:document.querySelector(".MiddleHeader").offsetHeight,shouldAvoidNegativePosition:!0,menuElMinWidth:It&&xt?19.25*Y.$:void 0,withPortal:!0}));(0,o.vJ)(()=>{c?setTimeout(()=>{Yt()},200):Tt()},[c,Yt,Tt]),(0,o.vJ)(()=>(0,P.M6)(ft.current,".ReactionPicker"),[c]);const jt=(0,C.A)(e=>{it(e),$e()});return(0,k.FD)(K.A,{ref:gt,isOpen:c,anchor:b,getTriggerElement:Ot,getRootElement:Ut,getMenuElement:Gt,getLayout:Kt,withMaxHeight:!0,className:(0,u.A)("MessageContextMenu","fluid",It&&"with-reactions"),withPortal:!0,onClose:$e,onCloseAnimationEnd:Ve,children:[It&&(0,k.Y)(W.A,{enabledReactions:S,topReactions:n,allAvailableReactions:t,defaultTagReactions:s,currentReactions:l.reactions?.results,reactionsLimit:N,onToggleReaction:et,onSendPaidReaction:tt,onShowPaidReactionModal:nt,isWithPaidReaction:w,isPrivate:f,isReady:Pt,canBuyPremium:_,isCurrentUserPremium:A,isInSavedMessages:Re,canPlayAnimatedEmojis:ke,onShowMore:jt,onClose:$e}),(0,k.FD)("div",{ref:ft,className:(0,u.A)("MessageContextMenu_items scrollable-content custom-scroll"),dir:vt.isRtl?"rtl":void 0,children:[Mt&&(0,k.Y)(j.A,{icon:"gift",onClick:Et,children:l?.isOutgoing?At("SendAnotherGift"):At("Conversation.ContextMenuSendGiftTo",ct)}),M&&(0,k.Y)(j.A,{icon:"send-outline",onClick:je,children:At("MessageScheduleSend")}),V&&(0,k.Y)(j.A,{icon:"schedule",onClick:ze,children:At("MessageScheduleEditTime")}),J&&(0,k.Y)(j.A,{icon:"reply",onClick:Ye,children:At(q?"lng_context_quote_and_reply":"Reply")}),!ee&&Boolean(ye?.messagesCount)&&(0,k.Y)(j.A,{icon:"replies",onClick:Te,children:At("Conversation.ContextViewReplies",ye.messagesCount,"i")}),Q&&(0,k.Y)(j.A,{icon:"edit",onClick:xe,children:At("Edit")}),Z&&(0,k.Y)(j.A,{icon:"add",onClick:Fe,children:vt("MenuButtonAppendTodoList")}),se&&(0,k.Y)(j.A,{icon:"favorite",onClick:Oe,children:At("AddToFavorites")}),re&&(0,k.Y)(j.A,{icon:"favorite",onClick:Ge,children:At("Stickers.RemoveFromFavorites")}),ge&&(0,k.Y)(j.A,{icon:"language",onClick:at,children:At("TranslateMessage")}),fe&&(0,k.Y)(j.A,{icon:"language",onClick:st,children:At("ShowOriginalButton")}),Ae&&(0,k.Y)(j.A,{icon:"web",onClick:rt,children:At("lng_settings_change_lang")}),Lt.map(e=>(0,k.Y)(j.A,{icon:e.icon,onClick:e.handler,withPreventDefaultOnMouseDown:!0,children:At(e.label)},e.label)),te&&(0,k.Y)(j.A,{icon:"pin",onClick:De,children:At("DialogPin")}),ne&&(0,k.Y)(j.A,{icon:"unpin",onClick:Ee,children:At("DialogUnpin")}),he&&(0,k.Y)(j.A,{icon:"gifs",onClick:We,children:At("lng_context_save_gif")}),me&&(0,k.Y)(j.A,{icon:"revote",onClick:qe,children:At("lng_polls_retract")}),pe&&(0,k.Y)(j.A,{icon:"stop",onClick:Xe,children:At("lng_polls_stop")}),ue&&(0,k.Y)(j.A,{icon:"download",onClick:He,children:At(ve?"lng_context_cancel_download":"lng_media_download")}),ie&&(0,k.Y)(j.A,{icon:"forward",onClick:Be,children:At("Forward")}),de&&(0,k.Y)(j.A,{icon:"select",onClick:Ke,children:At("Common.Select")}),ae&&(0,k.Y)(j.A,{icon:"flag",onClick:Ue,children:At("lng_context_report_msg")}),oe&&(0,k.Y)(j.A,{destructive:!0,icon:"delete",onClick:Le,children:At("Delete")}),Ne&&(0,k.FD)(k.FK,{children:[(0,k.Y)(z.A,{size:"thick"}),!be&&(0,k.FD)(k.FK,{children:[(0,k.Y)($.A,{inline:!0,className:"menu-loading-row"}),(0,k.Y)($.A,{inline:!0,className:"menu-loading-row"})]}),be&&1===be.length&&(0,k.Y)(j.A,{withWrap:!0,onClick:Bt,className:"menu-custom-emoji-sets",children:(0,T.A)(At("MessageContainsEmojiPack",be[0].title),["simple_markdown","emoji"])}),be&&be.length>1&&(0,k.Y)(j.A,{withWrap:!0,onClick:Bt,className:"menu-custom-emoji-sets",children:(0,T.A)(At("MessageContainsEmojiPacks",be.length),["simple_markdown"])})]}),(Ce||Ie)&&(0,k.FD)(k.FK,{children:[(0,k.Y)(z.A,{size:Ne?"thin":"thick"}),(0,k.FD)(j.A,{icon:Ie?"heart-outline":"group",onClick:Ie?Ze:Qe,disabled:!Ie&&!Ft,children:[(0,k.Y)("span",{className:"MessageContextMenu--seen-by-label-wrapper",children:(0,k.Y)("span",{className:"MessageContextMenu--seen-by-label",dir:vt.isRtl?"rtl":void 0,children:Ie&&l.reactors?.count?Ce&&Ft?At("Chat.OutgoingContextMixedReactionCount",[l.reactors.count,Ft]):At("Chat.ContextReactionCount",l.reactors.count,"i"):1===Ft&&we?(0,T.A)((0,m.L8)(we[0].id)?(0,r.Yg)(we[0]):we[0].title):Ft?At("Conversation.ContextMenuSeen",Ft,"i"):At("Conversation.ContextMenuNoViews")})}),(0,k.Y)(G.A,{className:"avatars",size:"micro",peers:we})]})]}),(Pe||Me||St)&&(0,k.Y)(z.A,{size:Ne?"thin":"thick"}),(Pe||Me)&&(0,k.Y)(X,{canLoadReadDate:Pe,shouldRenderShowWhen:Me,message:l,closeContextMenu:$e}),St&&(0,k.Y)(H,{message:l})]})]})}),Z=window.getSelection(),ee=-1,te=(0,o.ph)((0,i.EK)((e,{message:t,messageListType:n,detectedLanguage:o})=>{const{threadId:i}=(0,c.Xf0)(e)||{},{defaultTags:l,topReactions:u,availableReactions:h}=e.reactions,p=(0,c.yuw)(e),g=(0,c.hds)(e,t.chatId),f=g&&(0,m.L8)(g.id),A=f?void 0:(0,c.AWZ)(e,t.chatId),v=(0,c.mBe)(e,t.chatId),y=v&&(0,r.Yg)(v),{seenByExpiresAt:C,seenByMaxChatMembers:I,maxUniqueReactions:S,readDateExpiresAt:w}=e.appConfig,N=A?.reactionsLimit||S,{noOptions:b,canReplyGlobally:k,canPin:R,canUnpin:M,canDelete:P,canReport:Y,canEdit:T,canFaveSticker:x,canUnfaveSticker:F,canCopy:D,canCopyLink:E,canSelect:B,canDownload:L,canSaveGif:O,canRevote:U,canClosePoll:G}=i&&(0,c.WAX)(e,t,i)||{},K=(0,c.R4s)(e,t),j=f?(0,c.K0y)(e,g.id):void 0,z=(0,r.Ie)(t),$=g&&(0,c.yps)(e,g.id),V=Boolean($),_=(0,c.Jbz)(e,t.chatId,i||a.l3,t.id,n),J=Boolean(f&&z&&!V&&!_&&w&&t.date>Date.now()/1e3-w&&!j?.isReadDateRestricted&&"scheduled"!==n),H=Boolean(J&&f&&(0,c.K0y)(e,g.id)?.isReadDateRestrictedByMe),W="pinned"===n,q="scheduled"===n,X=g&&(0,r.WX)(g),Q=i&&(0,d.Vw)(e,t.chatId,i),Z=Boolean(Q&&!Q?.isCommentsInfo&&Q?.fromChannelId),ee=i?(0,c.S0q)(e,t.chatId,i):void 0,te=g&&!(0,r.Sq)(g,"sendPlain",A),ne=!(!g||!i)&&(0,r.__)(g,ee,Z,A)&&te,oe=(0,r.Nb)(t),ie=(0,r.G5)(t),ae=Boolean(!oe&&g&&!g.isMonoforum&&!_&&I&&C&&(0,r.YE)(g)&&z&&!q&&g.membersCount&&g.membersCount<=I&&t.date>Date.now()/1e3-C),se=(0,r._P)(t),re=!oe&&!X&&!q&&!se&&!f&&t.reactions&&!(0,r.G)(t.reactions)&&t.reactions.canSeeList,ce=(0,c.ynf)(e,t),le=Boolean(t.content.contact),de=(0,c.g29)(e),ue=(0,c.S1W)(e,t),he=ue?.map(t=>(0,c.ycM)(e,t)),me=he?.every(Boolean)?he:void 0,pe=(0,c.Rny)(e,t.chatId,t.id),ge=pe?Boolean((0,c.a_$)(e,t.chatId,pe)[t.id]?.text):void 0,fe=!ge&&(0,c.S86)(e,t,o),Ae=(0,c.qZq)(e,t.chatId),ve=(0,c.nZ4)(e,t.chatId),ye=(0,c.zcZ)(e,t),Ce=(0,c.Pn$)(e,t),Ie=t.content.storyData,Se=Ie?(0,c.Msb)(e,Ie.peerId,Ie.id):void 0,we=(0,c.X2D)(e,t.chatId),Ne=(0,d.QP)(e,t),be=e.appConfig.todoItemsMax;return{threadId:i,chat:g,availableReactions:h,topReactions:u,defaultTagReactions:l,noOptions:b,canReport:Y,canSendNow:q,canReschedule:q,canReply:!W&&!q&&k,canPin:!q&&R,canUnpin:!q&&M,canDelete:P,canEdit:!W&&T,canAppendTodoList:t.content.todo?.todo.othersCanAppend&&t.content.todo?.todo.items?.length<be,canForward:!q&&K,canFaveSticker:!q&&x,canUnfaveSticker:!q&&F,canCopy:le||!ce&&D,canCopyLink:!q&&E,canSelect:B,canDownload:!ce&&L,canSaveGif:!ce&&O,canRevote:U,canClosePoll:!q&&G,activeDownloads:p,canShowSeenBy:ae,canLoadReadDate:J,shouldRenderShowWhen:H,enabledReactions:g?.isForbidden?void 0:A?.enabledReactions,reactionsLimit:N,isPrivate:f,isCurrentUserPremium:de,hasFullInfo:Boolean(A),canShowReactionsCount:re,canShowReactionList:!(oe||se||q||g?.id===s.zv8||ie),canBuyPremium:!de&&!(0,c.n_C)(e),customEmojiSetsInfo:ue,customEmojiSets:me,canScheduleUntilOnline:(0,c.RBq)(e,t.chatId),canTranslate:fe,canShowOriginal:ge&&!Ae,canSelectLanguage:ge&&!Ae,isMessageTranslated:ge,canPlayAnimatedEmojis:(0,c.BWX)(e),isReactionPickerOpen:(0,c.Ani)(e),isInSavedMessages:ve,isChannel:X,canReplyInChat:ne,isWithPaidReaction:A?.isPaidReactionAvailable,poll:ye,story:Se,userFullName:y,canGift:we,savedDialogId:Ne,webPage:Ce}})(({threadId:e,availableReactions:t,topReactions:n,defaultTagReactions:c,isOpen:d,messageListType:m,message:p,customEmojiSetsInfo:g,customEmojiSets:f,album:N,poll:b,webPage:P,story:Y,anchor:T,targetHref:x,noOptions:F,canSendNow:D,hasFullInfo:E,canReschedule:B,canReply:L,canPin:O,repliesThreadInfo:U,canUnpin:G,canDelete:K,canShowReactionsCount:j,chat:z,canReport:$,canShowReactionList:V,canEdit:_,canAppendTodoList:J,enabledReactions:H,reactionsLimit:W,isPrivate:q,isCurrentUserPremium:X,canForward:te,canBuyPremium:ne,canFaveSticker:oe,canUnfaveSticker:ie,canCopy:ae,canCopyLink:se,canSelect:re,canDownload:ce,canSaveGif:le,canRevote:de,canClosePoll:ue,canPlayAnimatedEmojis:he,canLoadReadDate:me,shouldRenderShowWhen:pe,activeDownloads:ge,noReplies:fe,canShowSeenBy:Ae,canScheduleUntilOnline:ve,canTranslate:ye,isMessageTranslated:Ce,canShowOriginal:Ie,canSelectLanguage:Se,isReactionPickerOpen:we,isInSavedMessages:Ne,canReplyInChat:be,isWithPaidReaction:ke,userFullName:Re,canGift:Me,className:Pe,savedDialogId:Ye,onClose:Te,onCloseAnimationEnd:xe})=>{const{openThread:Fe,updateDraftReplyInfo:De,setEditingId:Ee,pinMessage:Be,openForwardMenu:Le,openReplyMenu:Oe,faveSticker:Ue,unfaveSticker:Ge,toggleMessageSelection:Ke,sendScheduledMessages:je,rescheduleMessage:ze,downloadMedia:$e,cancelMediaDownload:Ve,loadSeenBy:_e,openSeenByModal:Je,openReactorListModal:He,loadFullChat:We,loadReactors:qe,copyMessagesByIds:Xe,saveGif:Qe,loadStickers:Ze,cancelPollVote:et,closePoll:tt,toggleReaction:nt,requestMessageTranslation:ot,showOriginalMessage:it,openChatLanguageModal:at,openMessageReactionPicker:st,openPremiumModal:rt,loadOutboxReadDate:ct,copyMessageLink:lt,openDeleteMessageModal:dt,addLocalPaidReaction:ut,openPaidReactionModal:ht,reportMessages:mt,openTodoListModal:pt,showNotification:gt}=(0,i.ko)(),ft=(0,I.A)(),At=(0,y.A)(),{ref:vt}=(0,w.A)({isOpen:d,onCloseAnimationEnd:xe,className:!1}),[yt,Ct]=(0,o.J0)(!0),[It,St]=(0,o.J0)(!1),[wt,Nt,bt]=(0,v.A)(),[kt,Rt]=(0,o.J0)(ee),[Mt,Pt]=(0,S.A)(ve,Te,p.date,p.scheduleRepeatPeriod),Yt=void 0===g||Boolean(g.length);(0,o.vJ)(()=>{Ae&&d&&_e({chatId:p.chatId,messageId:p.id})},[_e,d,p.chatId,p.id,Ae]),(0,o.vJ)(()=>{me&&d&&ct({chatId:p.chatId,messageId:p.id})},[me,d,p.chatId,p.id,p.readDate]),(0,o.vJ)(()=>{j&&d&&qe({chatId:p.chatId,messageId:p.id})},[j,d,qe,p.chatId,p.id]),(0,o.vJ)(()=>{g?.length&&f?.length!==g.length&&g.forEach(e=>{Ze({stickerSetInfo:e})})},[g,f,Ze]),(0,o.vJ)(()=>{E||q||!d||We({chatId:p.chatId})},[E,d,q,We,p.chatId]);const Tt=(0,o.Kr)(()=>{const e=(0,i.mS)().chats.byId,t=(0,i.mS)().users.byId;if(p.reactions?.recentReactions?.length){const n=new Set(p.reactions?.recentReactions?.map(({peerId:n})=>t[n]||e[n]));return Array.from(n).filter(Boolean).slice(0,s.dqH)}if(p.seenByDates)return Object.keys(p.seenByDates).slice(0,s.dqH).map(n=>t[n]||e[n]).filter(Boolean)},[p.reactions?.recentReactions,p.seenByDates]),xt=(0,o.Kr)(()=>{const e=(0,i.mS)();if(N)return N.messages.some(t=>{const n=(0,l.iS)(e,t);return!!n&&(0,r.$r)(ge,n)});const t=(0,l.iS)(e,p);return!!t&&(0,r.$r)(ge,t)},[ge,N,p]),Ft=L&&Z?.rangeCount?Z.getRangeAt(0):void 0;(0,o.vJ)(()=>{if(Ce)return void Rt(ee);if(!Ft||Ft.collapsed||!Boolean(p.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")))}(Ft))return void Rt(ee);const e=A(Ft),t=p.content.text.text.replace(/\u00A0/g," ");e.text.trim().length>0&&t.includes(e.text)?Rt(Ft.startOffset):Rt(ee)},[Ft,Ft?.collapsed,Ft?.startOffset,Ft?.endOffset,Ce,p.content.text]);const Dt=(0,C.A)(()=>{Ct(!1),Te()}),Et=(0,C.A)(()=>{Ct(!1),Dt();const e=N?.messages?N.messages.map(({id:e})=>e):[p.id];dt({chatId:p.chatId,messageIds:e,isSchedule:"scheduled"===m})}),Bt=(0,C.A)(()=>{St(!1),Te()}),Lt=(0,C.A)(()=>{const e=kt!==ee&&Ft?A(Ft):void 0;be?De({replyToMsgId:p.id,quoteText:e,quoteOffset:kt,monoforumPeerId:Ye,replyToPeerId:void 0}):Oe({fromChatId:p.chatId,messageId:p.id,quoteText:e,quoteOffset:kt}),Dt()}),Ot=(0,C.A)(()=>{Fe({chatId:p.chatId,threadId:p.id}),Dt()}),Ut=(0,C.A)(()=>{p.content.todo?pt({chatId:p.chatId,messageId:p.id}):Ee({messageId:p.id}),Dt()}),Gt=(0,C.A)(()=>{X?pt({chatId:p.chatId,messageId:p.id,forNewTask:!0}):gt({message:At("SubscribeToTelegramPremiumForAppendToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:ft("PremiumMore")}),Dt()}),Kt=(0,C.A)(()=>{Ct(!1),St(!0)}),jt=(0,C.A)(()=>{Be({chatId:p.chatId,messageId:p.id,isUnpin:!0}),Dt()}),zt=(0,C.A)(()=>{if(Dt(),N?.messages){const e=N.messages.map(({id:e})=>e);Le({fromChatId:p.chatId,messageIds:e})}else Le({fromChatId:p.chatId,messageIds:[p.id]})}),$t=(0,C.A)(()=>{Dt(),Ue({sticker:p.content.sticker})}),Vt=(0,C.A)(()=>{Dt(),Ge({sticker:p.content.sticker})}),_t=(0,C.A)(()=>{Dt(),et({chatId:p.chatId,messageId:p.id})}),Jt=(0,C.A)(()=>{Dt(),tt({chatId:p.chatId,messageId:p.id})}),Ht=(0,C.A)(()=>{const e=N?.messages?{messageId:p.id,childMessageIds:N.messages.map(({id:e})=>e),withShift:!1}:{messageId:p.id,withShift:!1};Ke(e),Dt()}),Wt=(0,C.A)(()=>{je({chatId:p.chatId,id:p.id}),Dt()}),qt=(0,C.A)((e,t)=>{ze({chatId:p.chatId,messageId:p.id,scheduledAt:e,scheduleRepeatPeriod:t}),Te()}),Xt=(0,C.A)(()=>{Ct(!1),Mt(qt)}),Qt=(0,C.A)(()=>{Dt(),Je({chatId:p.chatId,messageId:p.id})}),Zt=(0,C.A)(()=>{Dt(),He({chatId:p.chatId,messageId:p.id})}),en=(0,C.A)(e=>{Xe({messageIds:e}),Dt()}),tn=(0,C.A)(()=>{lt({chatId:p.chatId,messageId:p.id,shouldIncludeThread:e!==a.l3,shouldIncludeGrouped:!0}),Dt()}),nn=(0,C.A)(()=>{(0,h.eM)(p.content.contact.phoneNumber),Dt()}),on=(0,C.A)(()=>{const e=(0,i.mS)();(N?.messages||[p]).forEach(t=>{const n=(0,l.iS)(e,t);n&&(xt?Ve({media:n}):$e({media:n,originMessage:t}))}),Dt()}),an=(0,C.A)(()=>{const e=(0,r.zX)(p);Qe({gif:e}),Dt()}),sn=(0,C.A)(e=>{Ne&&!X?rt({initialSection:"saved_tags"}):nt({chatId:p.chatId,messageId:p.id,reaction:e,shouldAddToRecent:!0}),Dt()}),rn=(0,C.A)(()=>{ut({chatId:p.chatId,messageId:p.id,count:1}),Dt()}),cn=(0,C.A)(()=>{ht({chatId:p.chatId,messageId:p.id}),Dt()}),ln=(0,C.A)(e=>{st({chatId:p.chatId,messageId:p.id,position:e})}),dn=(0,C.A)(()=>{ot({chatId:p.chatId,id:p.id}),Dt()}),un=(0,C.A)(()=>{it({chatId:p.chatId,id:p.id}),Dt()}),hn=(0,C.A)(()=>{at({chatId:p.chatId,messageId:p.id}),Dt()}),mn=(0,o.Kr)(()=>(N?N.messages:[p]).map(({id:e})=>e),[N,p]),pn=(0,C.A)(()=>{z&&(Ct(!1),Te(),mt({chatId:z.id,messageIds:mn}))});if(F)return void Dt();const gn=new Date;return gn.setFullYear(gn.getFullYear()+1),(0,k.FD)("div",{ref:vt,className:(0,u.A)("ContextMenuContainer",Pe),children:[(0,k.Y)(Q,{isReactionPickerOpen:we,availableReactions:t,topReactions:n,defaultTagReactions:c,isWithPaidReaction:ke,message:p,isPrivate:q,isCurrentUserPremium:X,canBuyPremium:ne,isOpen:yt,enabledReactions:H,reactionsLimit:W,anchor:T,targetHref:x,canShowReactionsCount:j,canShowReactionList:V,canSendNow:D,canReschedule:B,canReply:L,canQuote:kt!==ee,canDelete:K,canPin:O,canReport:$,repliesThreadInfo:U,canUnpin:G,canEdit:_,canAppendTodoList:J,canForward:te,canFaveSticker:oe,canUnfaveSticker:ie,canCopy:ae,canCopyLink:se,canSelect:re,canDownload:ce,canSaveGif:le,canRevote:de,canClosePoll:ue,canShowSeenBy:Ae,canTranslate:ye,canShowOriginal:Ie,canSelectLanguage:Se,canPlayAnimatedEmojis:he,shouldRenderShowWhen:pe,canLoadReadDate:me,hasCustomEmoji:Yt,customEmojiSets:f,isDownloading:xt,seenByRecentPeers:Tt,isInSavedMessages:Ne,noReplies:fe,poll:b,webPage:P,story:Y,onOpenThread:Ot,onReply:Lt,onEdit:Ut,onAppendTodoList:Gt,onPin:Kt,onUnpin:jt,onForward:zt,onDelete:Et,onReport:pn,onFaveSticker:$t,onUnfaveSticker:Vt,onSelect:Ht,onSend:Wt,onReschedule:Xt,onClose:Dt,onCopyLink:tn,onCopyMessages:en,onCopyNumber:nn,onDownload:on,onSaveGif:an,onCancelVote:_t,onClosePoll:Nt,onShowSeenBy:Qt,onToggleReaction:sn,onSendPaidReaction:rn,onShowPaidReactionModal:cn,onShowReactors:Zt,onReactionPickerOpen:ln,onTranslate:dn,onShowOriginal:un,onSelectLanguage:hn,userFullName:Re,canGift:Me}),(0,k.Y)(R,{isOpen:It,messageId:p.id,chatId:p.chatId,onClose:Bt}),(0,k.Y)(M.A,{isOpen:wt,onClose:bt,text:ft("lng_polls_stop_warning"),confirmLabel:ft("lng_polls_stop_sure"),confirmHandler:Jt}),B&&Pt]})}))}}]);
|
|
//# sourceMappingURL=390.c0409517bd23008933aa.js.map
|