"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1006],{92108:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(84051),a=n(87357);const o=(0,i.ph)((({data:e,style:t,className:n,valueClassName:o,keyClassName:r})=>i.Ay.createElement("div",{className:(0,a.A)("cKr8J5k_",n),style:t},e.map((([e,t])=>i.Ay.createElement(i.Ay.Fragment,null,i.Ay.createElement("div",{className:(0,a.A)("c9RLLvfs",r)},e),i.Ay.createElement("div",{className:(0,a.A)("QEuGpzIc",o)},t)))))))},25404:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(84051),a=n(13439),o=n(31481),r=n(85982),s=n(17663),c=n(80140),l=n(39351),d=n(17712),m=n(59030),A=n(24433);const u=(0,i.ph)((({peerId:e,canManage:t,gift:n,currentUserEmojiStatus:u,collectibleEmojiStatuses:f})=>{const{showNotification:g,openChatWithDraft:p,openGiftTransferModal:y,openGiftResalePriceComposerModal:h,openGiftStatusInfoModal:v,setEmojiStatus:E,toggleSavedGiftPinned:I,changeGiftVisibility:C,updateStarGiftPrice:b,closeGiftInfoModal:N}=(0,a.ko)(),P=(0,l.A)(),k=(0,m.A)(),S=n&&"gift"in n,F=S?n:void 0,G=S?n.gift:n,T="starGiftUnique"===G?.type?G.slug:void 0,x=(0,i.Kr)((()=>{if(T)return`${o.jsp}nft/${T}`}),[T]),w=(0,i.Kr)((()=>{if(T)return f?.find((e=>"collectible"===e.type&&e.slug===T))}),[T,f]),U="collectible"===u?.type?u.slug:void 0,B=G&&"starGiftUnique"===G.type,M=B&&U===G.slug,R=w&&!M,L=B?G.resellPriceInStars:void 0,V=t&&F&&!F.isUnsaved&&B,j=(0,d.A)((()=>{const{inputGift:e,isUnsaved:t}=F;C({gift:e,shouldUnsave:!t})})),z=(0,d.A)((()=>{x&&((0,r.eM)(x),g({message:P("LinkCopied")}))})),J=(0,d.A)((()=>{x&&p({text:{text:x}})})),O=(0,d.A)((()=>{F&&"starGiftUnique"===F?.gift.type&&(F.canTransferAt&&F.canTransferAt>(0,c.Fm)()?g({message:{key:"NotificationGiftCanTransferAt",variables:{date:(0,s.U)(k,1e3*F.canTransferAt)}}}):y({gift:F}))})),q=(0,d.A)((()=>{F&&(F.canResellAt&&F.canResellAt>(0,c.Fm)()?g({message:{key:"NotificationGiftCanResellAt",variables:{date:(0,s.U)(k,1e3*F.canResellAt)}}}):h({peerId:e,gift:F}))})),K=(0,d.A)((()=>{F&&"starGiftUnique"===F.gift.type&&F.inputGift&&(N(),b({gift:F.inputGift,price:0}),g({icon:"unlist-outline",message:{key:"NotificationGiftIsUnlist",variables:{gift:P("GiftUnique",{title:F.gift.title,number:F.gift.number})}}}))})),D=(0,d.A)((()=>{"starGiftUnique"===G?.type&&w&&v({emojiStatus:w})})),W=(0,d.A)((()=>{M&&E({emojiStatus:{type:"regular",documentId:o.zNY}})})),H=(0,d.A)((()=>{I({peerId:e,gift:F})}));return i.Ay.createElement(i.Ay.Fragment,null,V&&i.Ay.createElement(A.A,{icon:F.isPinned?"unpin":"pin",onClick:H},P(F.isPinned?"ChatListUnpinFromTop":"ChatListPinToTop")),i.Ay.createElement(A.A,{icon:"link-badge",onClick:z},P("CopyLink")),i.Ay.createElement(A.A,{icon:"forward",onClick:J},P("Share")),t&&B&&i.Ay.createElement(A.A,{icon:"diamond",onClick:O},P("GiftInfoTransfer")),t&&B&&!L&&i.Ay.createElement(A.A,{icon:"sell-outline",onClick:q},P("Sell")),t&&B&&L&&i.Ay.createElement(A.A,{icon:"unlist-outline",onClick:K},P("GiftInfoUnlist")),t&&F&&i.Ay.createElement(A.A,{icon:F.isUnsaved?"eye-outline":"eye-crossed-outline",onClick:j},P(F.isUnsaved?"GiftActionShow":"GiftActionHide")),R&&i.Ay.createElement(A.A,{icon:"crown-wear-outline",onClick:D},P("GiftInfoWear")),M&&i.Ay.createElement(A.A,{icon:"crown-take-off-outline",onClick:W},P("GiftInfoTakeOff")))}))},87049:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(84051),a=n(13439),o=n(29807),r=n(87357),s=n(14745);const c={root:"AmQSvxpZ",text:"pQW7dcwr"},l={red:[["#FF5B54","#ED1C26"],["#653633","#532224"]],blue:[["#6ED2FF","#34A4FC"],["#344F5A","#152E42"]],purple:[["#E367D7","#757BF6"],["#E367D7","#757BF6"]],green:[["#52D553","#4BB121"],["#52D553","#4BB121"]]},d=new Set(Object.keys(l)),m=(0,i.ph)((0,a.EK)((e=>({theme:(0,o.SJA)(e)})))((({text:e,color:t,className:n,theme:a})=>{const o=`svg-${(0,s.A)()}`,m=d.has(t)?t:void 0,A=m?l[m]["dark"===a?1:0]:void 0,u=A?A[0]:t,f=A?A[1]:t;return i.Ay.createElement("div",{className:(0,r.A)(c.root,n)},i.Ay.createElement("svg",{className:c.ribbon,width:"56",height:"56",viewBox:"0 0 56 56",fill:"none"},i.Ay.createElement("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(#${o})`}),i.Ay.createElement("defs",null,i.Ay.createElement("linearGradient",{id:o,x1:"27.9998",y1:"1",x2:"27.9998",y2:"55",gradientUnits:"userSpaceOnUse"},i.Ay.createElement("stop",{"stop-color":u}),i.Ay.createElement("stop",{offset:"1","stop-color":f})))),i.Ay.createElement("div",{className:c.text},e))})))},4523:(e,t,n)=>{n.d(t,{A:()=>Ne});var i=n(84051),a=n(13439),o=n(23174),r=n(89925),s=n(31481),c=n(90709),l=n(26129),d=n(29807),m=n(96454),A=n(87357),u=n(60343),f=n(41512),g=n(54464),p=n(43874),y=n(10722),h=n(49746),v=n(37661),E=n(5912),I=n(17712),C=n(14622),b=n(21511),N=n(48196),P=n(79519),k=n(96773),S=n(76023),F=n(21849),G=n(50805);const T=15*S.$,x=(0,i.ph)((({action:e,onClick:t,observeIntersection:n})=>i.Ay.createElement(F.A,{className:G.A.channelPhoto,photo:e.photo,loopIndefinitely:!0,withVideo:!0,observeIntersection:n,onClick:t,size:T})));var w=n(18501),U=n(39351),B=n(85118),M=n(82855);const R=(0,i.ph)((0,a.EK)(((e,{action:t})=>({sticker:"giftPremium"===t.type?(0,d.t0O)(e,t.months):(0,d.WLj)(e,t.stars),canPlayAnimatedEmojis:(0,d.BWX)(e)})))((({action:e,sticker:t,canPlayAnimatedEmojis:n,onClick:a,observeIntersectionForLoading:o,observeIntersectionForPlaying:r})=>{const s=(0,i.li)(null),c=(0,U.A)(),l="giftPremium"===e.type?e.message:void 0;return i.Ay.createElement("div",{className:G.A.contentBox,tabIndex:0,role:"button",onClick:a},i.Ay.createElement("div",{ref:s,className:G.A.stickerWrapper,style:"width: 150px; height: 150px"},t&&i.Ay.createElement(M.A,{containerRef:s,sticker:t,size:150,observeIntersectionForLoading:o,observeIntersectionForPlaying:r,noLoad:!n})),i.Ay.createElement("div",{className:G.A.info},i.Ay.createElement("h3",{className:G.A.title},"giftPremium"===e.type?c("ActionGiftPremiumTitle",{months:e.months},{pluralValue:e.months}):c("ActionGiftStarsTitle",{amount:e.stars},{pluralValue:e.stars})),i.Ay.createElement("div",null,l&&(0,w.fd)(l),!l&&c("giftPremium"===e.type?"ActionGiftPremiumText":"ActionGiftStarsText"))),i.Ay.createElement("div",{className:G.A.actionButton},i.Ay.createElement(B.A,{preset:"button"}),c("ActionViewButton")))})));var L=n(70636),V=n(4262);const j=(0,i.ph)((0,a.EK)(((e,{action:t})=>({sticker:"giftCode"===t.type?(0,d.t0O)(e,t.months):(0,d.WLj)(e,t.stars),canPlayAnimatedEmojis:(0,d.BWX)(e),channel:(0,d.hds)(e,t.boostPeerId)})))((({action:e,sticker:t,canPlayAnimatedEmojis:n,channel:a,onClick:o,observeIntersectionForLoading:r,observeIntersectionForPlaying:s})=>{const c=(0,i.li)(null),l=(0,U.A)(),d=(0,i.Kr)((()=>{const e=a&&(0,L.F9)(l,a),t=l("ActionFallbackChannel");return(0,V.Nm)(a?.id,e||t)}),[a,l]);return i.Ay.createElement("div",{className:G.A.contentBox,tabIndex:0,role:"button",onClick:o},i.Ay.createElement("div",{ref:c,className:G.A.stickerWrapper,style:"width: 150px; height: 150px"},t&&i.Ay.createElement(M.A,{containerRef:c,sticker:t,size:150,observeIntersectionForLoading:r,observeIntersectionForPlaying:s,noLoad:!n})),i.Ay.createElement("div",null,i.Ay.createElement("h3",{className:G.A.title},l("ActionGiveawayResultTitle")),i.Ay.createElement("div",null,"giftCode"===e.type&&l(e.isViaGiveaway?"ActionGiveawayResultPremiumText":"ActionGiftCodePremiumText",{months:e.months,channel:d},{withNodes:!0,withMarkdown:!0,pluralValue:e.months,renderTextFilters:["br"]}),"prizeStars"===e.type&&l("ActionGiveawayResultStarsText",{amount:e.stars,channel:d},{withNodes:!0,withMarkdown:!0,pluralValue:e.stars,renderTextFilters:["br"]}))),i.Ay.createElement("div",{className:G.A.actionButton},i.Ay.createElement(B.A,{preset:"button"}),l("giftCode"===e.type?"ActionOpenGiftButton":"ActionViewButton")))})));var z=n(48775),J=n(80140),O=n(14242),q=n(66833),K=n(87094),D=n(87049);const W=(0,i.ph)((0,a.EK)(((e,{message:t,action:n})=>{const i=(0,d.mBe)(e,e.currentUserId),a=(0,d.BWX)(e),o=(0,d.Y7C)(e,t),r=n.fromId?(0,d.PVB)(e,n.fromId):void 0,s=t.isOutgoing?(0,d.PVB)(e,t.chatId):i;return{canPlayAnimatedEmojis:a,sender:r||o,recipient:(n.peerId?(0,d.PVB)(e,n.peerId):void 0)||s,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod}}))((({action:e,message:t,canPlayAnimatedEmojis:n,sender:a,recipient:o,starGiftMaxConvertPeriod:r,onClick:s,observeIntersectionForLoading:l,observeIntersectionForPlaying:d})=>{const m=(0,i.li)(null),u=(0,i.li)(null),f=(0,U.A)(),{isOutgoing:g}=t,p=(0,q.yQ)(e.gift),y=g?o:a,h=y&&(0,L.vj)(y)&&(0,c.WX)(y),v=(0,K.A)(m,"background-color",!e.gift.availabilityTotal),E=f("ActionFallbackSomeone"),I=y&&(0,L.F9)(f,y),C=a?.id===o?.id,b=(0,i.Kr)((()=>{const n=(0,V.Nm)(y?.id,I||E),i=void 0!==e.starsToConvert?(0,z.K)(f,e.starsToConvert):void 0;return e.isUpgraded?f("ActionStarGiftUpgraded"):e.alreadyPaidUpgradeStars?(0,V.AD)(f,"ActionStarGiftUpgradeText",!g||C,{peer:n}):e.isConverted?(0,V.AD)(f,"ActionStarGiftConvertedText",!g||C,{peer:n,amount:i}):r&&(0,J.Fm)(){const i=(0,d.mBe)(e,e.currentUserId),a=(0,d.BWX)(e),o=(0,d.Y7C)(e,t),r=n.fromId?(0,d.PVB)(e,n.fromId):void 0,s=t.isOutgoing?(0,d.PVB)(e,t.chatId):i;return{canPlayAnimatedEmojis:a,sender:r||o,recipient:(n.peerId?(0,d.PVB)(e,n.peerId):void 0)||s}}))((({action:e,message:t,canPlayAnimatedEmojis:n,sender:a,recipient:o,onClick:r,observeIntersectionForLoading:s,observeIntersectionForPlaying:c})=>{const l=(0,i.li)(null),d=(0,U.A)(),{isOutgoing:m}=t,u=(0,q.yQ)(e.gift),f=(0,q.uc)(e.gift),g=f.model,p=f.pattern,y=f.backdrop,h=[y.centerColor,y.edgeColor],v=`${y.patternColor.slice(0,7)}55`,E=(0,i.Kr)((()=>[[d("ActionStarGiftUniqueModel"),g.name],[d("ActionStarGiftUniqueBackdrop"),y.name],[d("ActionStarGiftUniqueSymbol"),p.name]]),[d,g,p,y]),I=!m||e.isUpgrade,C=I&&!e.isUpgrade?a:o,b=d("ActionFallbackSomeone"),N=C&&(0,L.F9)(d,C),P=a?.id===o?.id;return i.Ay.createElement("div",{className:(0,A.A)(G.A.contentBox,G.A.starGift,G.A.uniqueGift),tabIndex:0,role:"button",onClick:r},i.Ay.createElement("div",{className:G.A.uniqueBackgroundWrapper},i.Ay.createElement(Q.A,{className:G.A.uniqueBackground,backgroundColors:h,patternColor:y.patternColor,patternIcon:p.sticker,clearBottomSector:!0})),i.Ay.createElement("div",{ref:l,className:G.A.stickerWrapper,style:"width: 120px; height: 120px"},u&&i.Ay.createElement(M.A,{containerRef:l,sticker:u,size:120,observeIntersectionForLoading:s,observeIntersectionForPlaying:c,noLoad:!n})),i.Ay.createElement(D.A,{color:v,text:d("ActionStarGiftUniqueRibbon")}),i.Ay.createElement("div",{className:G.A.info},i.Ay.createElement("h3",{className:G.A.title},P?d("ActionStarGiftSelf"):d(I?"ActionStarGiftFrom":"ActionStarGiftTo",{peer:(0,V.Nm)(C?.id,N||b)},{withNodes:!0})),i.Ay.createElement("div",{className:G.A.subtitle,style:`color: ${y.textColor}`},d("GiftUnique",{title:e.gift.title,number:e.gift.number})),i.Ay.createElement($.A,{data:E,style:`color: ${y.textColor}`,valueClassName:G.A.uniqueValue})),i.Ay.createElement("div",{className:G.A.actionButton,style:(0,H.A)(v&&`background-color: ${v}`)},i.Ay.createElement(B.A,{preset:"button"}),d("ActionViewButton")))})));var Z=n(87679),Y=n(62587),_=n(94189),ee=n(68584);const te=(0,i.ph)((0,a.EK)(((e,{message:t})=>({peer:(0,d.PVB)(e,t.chatId)})))((({message:e,action:t,peer:n,observeIntersection:s})=>{const{openMediaViewer:l,uploadProfilePhoto:d,showNotification:m}=(0,a.ko)(),{isOutgoing:A}=e,u=t.photo,f=(0,U.A)(),[g,p]=(0,i.J0)(),[y,h,E]=(0,v.A)(!1),C=(0,Y.A)((0,c.rI)(u,"full")),b=(0,Y.A)((0,c.Pg)(u)),N=u.isVideo,P=(0,i.Kr)((()=>{const e=n&&(0,L.F9)(f,n)||f("ActionFallbackUser"),t=(0,V.Nm)(n?.id,e);return f(A?"ActionSuggestedPhotoYou":"ActionSuggestedPhoto",{user:t},{withNodes:!0})}),[f,A,n]),k=(0,I.A)((()=>{m({title:f("ActionSuggestedPhotoUpdatedTitle"),message:f("ActionSuggestedPhotoUpdatedDescription"),action:{action:"openSettingsScreen",payload:{screen:r.VS.Main}},actionText:f("Open")})})),S=(0,I.A)((e=>{p(void 0),d({file:e}),k()})),T=(0,I.A)((()=>{p(void 0)})),x=(0,I.A)((async()=>{if(!b)return;E(),k();const e=await(0,Z.sZ)(b);d({file:new File([e],"avatar.mp4"),isVideo:!0,videoTs:u.videoSizes?.find((e=>void 0!==e.videoStartTs))?.videoStartTs})}));return i.Ay.createElement("div",{className:G.A.contentBox,tabIndex:0,role:"button",onClick:async()=>{!A&&C?N?h():p(await(0,Z.sZ)(C)):l({chatId:e.chatId,messageId:e.id,threadId:o.l3,origin:r.TQ.SuggestedAvatar})}},i.Ay.createElement(F.A,{className:G.A.suggestedAvatar,photo:t.photo,loopIndefinitely:!0,withVideo:!0,observeIntersection:s,size:"jumbo"}),i.Ay.createElement("div",{className:G.A.suggestedText},P),i.Ay.createElement("div",{className:G.A.actionButton},f("ActionSuggestedPhotoButton")),i.Ay.createElement(ee.A,{file:g,onClose:T,onChange:S}),i.Ay.createElement(_.A,{isOpen:y,title:f("ActionSuggestedVideoTitle"),confirmHandler:x,onClose:E,text:f("ActionSuggestedVideoText")}))})));var ne=n(99515),ie=n(43581),ae=n(14737),oe=n(48894);var re=n(36838),se=n(59030),ce=n(18276),le=n(64493),de=n(55158);const me="d8axZxyN",Ae="glDpC2av",ue="gqCs9fSo",fe="gnYhwnvf",ge="HWgwnKui",pe="BTNQ4KBH",ye="Xl9MVMTn",he="Qizai7yv";function ve({channel:e}){const{openChat:t}=(0,a.ko)(),n=function(e,t="#00000000"){const[n,a]=(0,i.J0)(t),r=(0,Y.A)((0,c.cP)(e),!1,o.qZ.BlobUrl);return(0,i.vJ)((()=>{(async()=>{if(!r)return;const e=await(0,oe.rX)(r);a(`#${(0,oe.v2)(e)}`)})()}),[r]),n}(e,"#3C3C4399"),r=(0,U.A)();return i.Ay.createElement("div",{className:Ae,onClick:()=>t({id:e.id})},i.Ay.createElement(F.A,{className:ue,key:e.id,size:"large",peer:e}),i.Ay.createElement("div",{style:`background: ${n}`,className:fe},i.Ay.createElement(ce.A,{name:"user-filled",className:me}),i.Ay.createElement("span",{className:ge},(0,O.Vw)(r,e?.membersCount||0))),i.Ay.createElement("span",{className:pe},e.title))}function Ee({channel:e,chatId:t,channelsCount:n,isCurrentUserPremium:o}){const{openPremiumModal:r,openChatWithInfo:s}=(0,a.ko)(),c=(0,se.A)();return i.Ay.createElement("div",{className:(0,A.A)(Ae,"MBChXyXk"),onClick:()=>{o?s({id:t,shouldReplaceHistory:!0,profileTab:"similarChannels",forceScrollProfileTab:!0}):r()}},i.Ay.createElement(F.A,{className:ue,key:e.id,size:"large",peer:e}),i.Ay.createElement("div",{className:ye},i.Ay.createElement("div",{className:he})),i.Ay.createElement("div",{className:(0,A.A)(ye,"JxSmtOFi")},i.Ay.createElement("div",{className:he})),i.Ay.createElement("div",{className:fe},i.Ay.createElement("span",{className:ge},`+${n}`),!o&&i.Ay.createElement(ce.A,{name:"lock-badge",className:me})),i.Ay.createElement("span",{className:pe},c("MoreSimilar")))}const Ie=(0,i.ph)((0,a.EK)(((e,{chatId:t})=>{const{similarChannelIds:n,isExpanded:i,count:a}=(0,d.dg4)(e,t)||{},o=(0,d.g29)(e),r=(0,d.AWZ)(e,t);return{similarChannelIds:n,isExpanded:i,count:a,isCurrentUserPremium:o,channelJoinInfo:r?.joinInfo}}))((({chatId:e,similarChannelIds:t,isExpanded:n,count:o,isCurrentUserPremium:r,channelJoinInfo:s})=>{const{toggleChannelRecommendations:c,loadChannelRecommendations:l}=(0,a.ko)(),m=(0,se.A)(),[u,f,g]=(0,v.A)(!1),[p,y,h]=(0,v.A)(!1),E=(0,i.li)(null),C=(0,i.li)(!1),b=(0,i.Kr)((()=>{if(!t)return;const e=(0,a.mS)();return t.map((t=>(0,d.hds)(e,t))).filter(Boolean)}),[t]),[N,P]=(0,i.J0)(!1),k=(0,i.Kr)((()=>b?.slice(0,10)),[b]),S=Boolean(k?.length),F=Boolean(!N&&(n||p||u)&&S);(0,re.A)(E,!F,!0),(0,i.vJ)((()=>{t||l({chatId:e})}),[e,t]),(0,ae.A)((()=>P(!1)),2e3),(0,i.vJ)((()=>{if(N&&b&&n){const e=setTimeout((()=>{P(!1)}),300);return()=>clearTimeout(e)}}),[b,n,N]),(0,i.vJ)((()=>{n?(f(),h(),P(!t),C.current||setTimeout((()=>{E.current?.scrollIntoView({behavior:"smooth"})}),150)):(g(),y())}),[n,t]);const G=(0,I.A)((()=>{c({chatId:e})}));if((0,i.vJ)((()=>{s?.joinedDate&&!n&&(0,J.Fm)()-s.joinedDate<=10&&(G(),C.current=!0)}),[s,n]),F||N)return i.Ay.createElement("div",{className:(0,A.A)("V3RHiOJR")},N&&i.Ay.createElement(de.A,{className:"xKVZv7KE"}),F&&i.Ay.createElement("div",{className:(0,A.A)(u&&"eb8rX09E",p&&"XR6_qLCc")},i.Ay.createElement("div",{className:"tfG_BSDt"},i.Ay.createElement("svg",{width:"19",height:"7",viewBox:"0 0 19 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.Ay.createElement("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"}))),i.Ay.createElement("div",{className:"njAC8dR9"},i.Ay.createElement("div",{className:"s7QOi22Q"},i.Ay.createElement("span",{className:"JstcOhAN"},m("SimilarChannels")),i.Ay.createElement(le.A,{className:"meewH7t_",color:"translucent",onClick:G},i.Ay.createElement(ce.A,{name:"close"}))),i.Ay.createElement("div",{ref:E,className:(0,A.A)("h4gWlNen","no-scrollbar")},k?.map(((t,n)=>9===n?i.Ay.createElement(Ee,{channel:t,chatId:e,channelsCount:o-10+1,isCurrentUserPremium:r}):i.Ay.createElement(ve,{channel:t})))))))}))),Ce=new Set(["pinMessage","chatEditPhoto","chatDeletePhoto","unsupported"]),be=new Set(["giftCode","prizeStars","suggestProfilePhoto"]),Ne=(0,i.ph)((0,a.EK)(((e,{message:t,threadId:n})=>{const i=(0,d.nTw)(e),{themes:a}=e.settings,r=(0,d.hds)(e,t.chatId),s=(0,d.Y7C)(e,t),c=r?.isForum&&n!==o.l3,{replyToMsgId:m,replyToPeerId:A}=(0,l.Q)(t)||{},u=m?(0,d.O5q)(e,A||t.chatId,m):void 0,f=!!n&&(0,d.nJv)(e,t,n),{direction:g,noHighlight:p,isResizingContainer:y,scrollTargetPosition:h}=f&&i.focusedMessage||{},v=(0,d.g29)(e),E=r?.unreadReactions?.includes(t.id),I=(0,d.trm)(e);return{sender:s,currentUserId:e.currentUserId,isCurrentUserPremium:v,isFocused:f,focusDirection:g,noFocusHighlight:p,isInsideTopic:c,replyMessage:u,isInSelectMode:(0,d.rTV)(e),patternColor:a[(0,d.SJA)(e)]?.patternColor,hasUnreadReaction:E,isResizingContainer:y,scrollTargetPosition:h,isAccountFrozen:I}}))((({message:e,threadId:t,sender:n,currentUserId:o,appearanceOrder:d,isJustAdded:S,isLastInList:F,memoFirstUnreadIdRef:T,getIsMessageListReady:w,isInsideTopic:U,isFocused:B,focusDirection:M,noFocusHighlight:L,replyMessage:V,patternColor:z,isCurrentUserPremium:J,isInSelectMode:O,hasUnreadReaction:q,isResizingContainer:K,scrollTargetPosition:D,onIntersectPinnedMessage:H,observeIntersectionForBottom:$,observeIntersectionForLoading:Q,observeIntersectionForPlaying:Z,isAccountFrozen:Y})=>{const{requestConfetti:_,openMediaViewer:ee,getReceipt:ae,checkGiftCode:oe,openPrizeStarsTransactionFromGiveaway:re,openPremiumModal:se,openStarsTransactionFromGift:ce,openGiftInfoModalFromMessage:le,toggleChannelRecommendations:de,animateUnreadReaction:me,markMentionsRead:Ae}=(0,a.ko)(),ue=(0,i.li)(null),{id:fe,chatId:ge}=e,pe=e.content.action,ye=(0,u.iL)(fe),he=be.has(pe.type),ve=Ce.has(pe.type),Ee=m.uH&&!ve,Ne=(0,l.Q)(e),{replyToMsgId:Pe,replyToPeerId:ke}=Ne||{},Se=Boolean(e.areReactionsPossible&&e?.reactions?.results?.length),Fe=U&&"topicCreate"===pe.type,{isTouchScreen:Ge}=(0,p.Ay)();(0,E.mv)(ue,Fe?void 0:$),(0,C.A)(ue,!Fe&&F&&"channelJoined"!==pe.type),(0,h.A)(ke||ge,Pe,V,fe),(0,P.A)({elementRef:ue,chatId:ge,isFocused:B,focusDirection:M,noFocusHighlight:L,isResizingContainer:K,isJustAdded:S,scrollTargetPosition:D}),(0,i._W)((()=>{e.isPinned&&H?.({viewportPinnedIdsToRemove:[e.id]})}));const{isContextMenuOpen:Te,contextMenuAnchor:xe,handleBeforeContextMenu:we,handleContextMenu:Ue,handleContextMenuClose:Be,handleContextMenuHide:Me}=(0,y.A)(ue,Ge&&O||Y,!m.cp,m.Ni,w),Re=void 0!==xe,Le=d<=0,[Ve,je]=(0,v.A)(Le);(0,i.vJ)((()=>{Le||setTimeout(je,d*s.zq7)}),[d,je,Le]);const{ref:ze}=(0,b.A)({isOpen:Ve,noOpenTransition:Le,noCloseTransition:!0,className:!1,ref:ue});(0,i.vJ)((()=>{const t=ue.current;t&&(0,f.Y)(t)&&(q&&me({messageIds:[fe]}),e.hasUnreadMention&&Ae({chatId:ge,messageIds:[fe]}))}),[q,ge,fe,me,e.hasUnreadMention]),(0,i.vJ)((()=>{"giftPremium"===pe.type&&(T?.current&&fe>=T.current||ye)&&_({})}),[pe.type,fe,ye,T]);const Je=(0,N.A)(Ee?z:void 0),Oe=(0,I.A)((()=>{switch(pe.type){case"paymentSent":case"paymentRefunded":ae({chatId:e.chatId,messageId:e.id});break;case"chatEditPhoto":ee({chatId:e.chatId,messageId:e.id,threadId:t,origin:r.TQ.ChannelAvatar});break;case"giftCode":oe({slug:pe.slug,message:{chatId:e.chatId,messageId:e.id}});break;case"prizeStars":re({chatId:e.chatId,messageId:e.id});break;case"giftPremium":se({isGift:!0,fromUserId:n?.id,toUserId:n&&n.id===o?ge:o,monthsAmount:pe.months});break;case"giftStars":ce({chatId:e.chatId,messageId:e.id});break;case"starGift":case"starGiftUnique":le({chatId:e.chatId,messageId:e.id});break;case"channelJoined":de({chatId:ge})}})),qe=(0,i.Kr)((()=>{switch(pe.type){case"chatEditPhoto":if(!pe.photo)return;return i.Ay.createElement(x,{action:pe,observeIntersection:Q,onClick:Oe});case"suggestProfilePhoto":return i.Ay.createElement(te,{message:e,action:pe,observeIntersection:Q});case"prizeStars":case"giftCode":return i.Ay.createElement(j,{action:pe,observeIntersectionForLoading:Q,observeIntersectionForPlaying:Z,onClick:Oe});case"giftPremium":case"giftStars":return i.Ay.createElement(R,{action:pe,observeIntersectionForLoading:Q,observeIntersectionForPlaying:Z,onClick:Oe});case"starGift":return i.Ay.createElement(W,{action:pe,message:e,observeIntersectionForLoading:Q,observeIntersectionForPlaying:Z,onClick:Oe});case"starGiftUnique":return i.Ay.createElement(X,{action:pe,message:e,observeIntersectionForLoading:Q,observeIntersectionForPlaying:Z,onClick:Oe});case"channelJoined":return i.Ay.createElement(Ie,{chatId:e.chatId});default:return}}),[pe,Q,e,Z]);if(!(U&&"topicCreate"===pe.type||"phoneCall"===pe.type))return i.Ay.createElement("div",{ref:ze,id:(0,c.GZ)(fe),className:(0,A.A)("ActionMessage","message-list-item",G.A.root,ve&&G.A.singleLine,Ee&&G.A.fluidMultiline,qe&&G.A.hasFullContent,B&&!L&&"focused",Re&&"has-menu-open",F&&"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":q||void 0,onMouseDown:e=>{(0,g.l)(e),we(e)},onContextMenu:Ue},!he&&i.Ay.createElement(i.Ay.Fragment,null,Ee&&i.Ay.createElement("div",{className:G.A.inlineWrapper},i.Ay.createElement("span",{className:G.A.fluidBackground,style:Je},i.Ay.createElement(k.A,{message:e,isInsideTopic:U}))),i.Ay.createElement("div",{className:G.A.inlineWrapper},i.Ay.createElement("span",{className:G.A.textContent,onClick:Oe},i.Ay.createElement(k.A,{message:e,isInsideTopic:U})))),qe,xe&&i.Ay.createElement(ne.A,{isOpen:Te,anchor:xe,message:e,messageListType:"thread",className:G.A.contextContainer,onClose:Be,onCloseAnimationEnd:Me}),Se&&i.Ay.createElement(ie.A,{isOutside:!0,message:e,threadId:t,observeIntersection:Z,isCurrentUserPremium:J,isAccountFrozen:Y}))})))},48196:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(84051),a=n(31481),o=n(28470);function r(e,t,n){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?i:i+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const s=new Map;class c{constructor(e){this.color=e,r(this,"filterId",void 0),r(this,"referenceCount",0),this.filterId=`fluid-background-filter-${e.slice(1)}`,(0,o.z)(i.Ay.createElement("filter",{"color-interpolation-filters":"sRGB",xmlns:a.jNX},i.Ay.createElement("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"4",result:"blur"}),i.Ay.createElement("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"}),i.Ay.createElement("feComposite",{in:"SourceAlpha",in2:"goo",operator:"over",result:"outline"}),i.Ay.createElement("feFlood",{"flood-color":e,result:"color"}),i.Ay.createElement("feComposite",{in:"color",in2:"outline",operator:"in"})),this.filterId)}getFilterId(){return this.referenceCount+=1,this.filterId}removeReference(){this.referenceCount-=1,0===this.referenceCount&&(0,o.e)(this.filterId)}isUsed(){return this.referenceCount>0}}function l(e,t){if((0,i.vJ)((()=>{if(e)return()=>{const t=s.get(e);t&&(t.removeReference(),t.isUsed()||s.delete(t.color))}}),[e]),!e)return;if(s.has(e))return d(s.get(e).getFilterId(),t);const n=new c(e);return s.set(e,n),d(n.getFilterId(),t)}function d(e,t){return t?`url(#${e})`:`filter: url(#${e});`}}}]); //# sourceMappingURL=1006.74cbc6ed4e0ab7bd67c3.js.map