TelegramPWA/dist/7661.35dd22385d66ff3af48a.js
Alexander Zinchuk 7dad073282 [Build]
2025-06-18 17:45:26 +02:00

2 lines
21 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7661],{2578:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(84051),o=r(59030),s=r(20021);const a=(0,n.ph)((({fakeType:e})=>{const t=(0,o.A)();return(0,s.Y)("span",{className:"FakeIcon",children:t("fake"===e?"FakeMessage":"ScamMessage")})}))},9718:(e,t,r)=>{r.d(t,{A:()=>a,E:()=>s});var n=r(96454),o=r(41402);function s(e){e.style.display="none",(0,o.A)(e),e.style.display=""}const a=(e,t)=>{n.pz&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),n.pz&&(e.style.overflow="")}},10722:(e,t,r)=>{r.d(t,{A:()=>d});var n=r(84051),o=r(61433),s=r(66644),a=r(96454),i=r(17712);function c(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const d=(e,t,r,d,l,u)=>{const[p,m]=(0,n.J0)(!1),[f,h]=(0,n.J0)(void 0),[y,v]=(0,n.J0)(void 0),g=(0,i.A)((e=>{t||2!==e.button||(0,s.RK)((()=>{(0,o.YM)(e.target,"no-selection")}))})),I=(0,i.A)((e=>{(0,s.RK)((()=>{(0,o.HW)(e.target,"no-selection")})),t||r&&e.target.matches("a[href]")||(e.preventDefault(),e.stopPropagation(),f||(m(!0),h({x:e.clientX,y:e.clientY}),v(e.target)))})),S=(0,i.A)((()=>{m(!1)})),w=(0,i.A)((()=>{h(void 0)}));return(0,n.vJ)((()=>{if(t||!a.TF||d||l&&!l())return;const n=e.current;if(!n)return;let o;const s=()=>{o&&(clearTimeout(o),o=void 0)},i=e=>{t||(u&&e.stopPropagation(),s(),o=window.setTimeout((()=>(e=>{s();const{clientX:t,clientY:n,target:o}=e.touches[0];f||r&&o.matches("a[href]")||(document.addEventListener("touchend",(e=>{a.pz&&a._7&&setTimeout((()=>{document.removeEventListener("mousedown",c,{capture:!0}),document.removeEventListener("click",c,{capture:!0})}),100),c(e)}),{once:!0,capture:!0}),a._7&&a.pz&&(document.addEventListener("mousedown",c,{once:!0,capture:!0}),document.addEventListener("click",c,{once:!0,capture:!0})),m(!0),h({x:t,y:n}))})(e)),200))};return n.addEventListener("touchstart",i,{passive:!0}),n.addEventListener("touchcancel",s,!0),n.addEventListener("touchend",s,!0),n.addEventListener("touchmove",s,{passive:!0}),()=>{s(),n.removeEventListener("touchstart",i),n.removeEventListener("touchcancel",s,!0),n.removeEventListener("touchend",s,!0),n.removeEventListener("touchmove",s)}}),[f,t,d,e,r,l,u]),{isContextMenuOpen:p,contextMenuAnchor:f,contextMenuTarget:y,handleBeforeContextMenu:g,handleContextMenu:I,handleContextMenuClose:S,handleContextMenuHide:w}}},11217:(e,t,r)=>{r.d(t,{Q:()=>s});var n=r(96454),o=r(17712);function s(e){const t=(0,o.A)((t=>{"mousedown"===t.type&&t.button!==n.w3.Main||e(t)}));return n.TF?{handleClick:e?t:void 0}:{handleMouseDown:e?t:void 0}}},14680:(e,t,r)=>{r.d(t,{FD:()=>o,ZJ:()=>a,wb:()=>s});let n=0;function o(){n+=1}function s(){n-=1}function a(){return n>0}},21849:(e,t,r)=>{r.d(t,{A:()=>M,R:()=>T});var n=r(84051),o=r(13439),s=r(23174),a=r(31481),i=r(90709),c=r(70636),d=r(87357),l=r(95807),u=r(9716),p=r(14242),m=r(76023),f=r(35049),h=r(4961),y=r(11217),v=r(17712),g=r(62587),I=r(83057),S=r(59030),w=r(65843),b=r(88554),A=r(18276),C=r(20021);const T={micro:m.$,mini:1.5*m.$,tiny:2*m.$,small:2.125*m.$,medium:2.75*m.$,large:3.375*m.$,giant:5.625*m.$,jumbo:7.5*m.$},P=(0,d.x)("Avatar");P.media=P("media"),P.icon=P("icon");const M=(0,n.ph)((({className:e,size:t="large",peer:r,photo:m,webPhoto:M,previewUrl:k,text:N,isSavedMessages:F,isSavedDialog:x,withVideo:E,withStory:K,forPremiumPromo:L,withStoryGap:B,withStorySolid:D,forceFriendStorySolid:O,forceUnreadStorySolid:V,storyViewerOrigin:Y,storyViewerMode:$="single-peer",loopIndefinitely:z,noPersonalPhoto:U,asMessageBubble:G,onClick:j,onContextMenu:R})=>{const{openStoryViewer:J}=(0,o.ko)(),Q=(0,n.li)(),_=(0,n.li)(0),W=r&&"isCustomPeer"in r,q=r&&!W?r:void 0,H=q&&(0,c.mO)(q)?q:void 0,Z=q&&(0,c.vj)(q)?q:void 0,X=H&&(0,i.PL)(H),ee=q&&(0,i.kE)(q.id),te=q&&(0,i.Qe)(q.id),re=Z?.isForum;let ne,oe;const se="number"==typeof t?t:T[t],ae=E&&m?.isVideo,ie=se>=T.jumbo;F||X||(H&&!U||Z?ne=(0,i.cP)(r,ie?"big":void 0):m?(ne=`photo${m.id}?size=m`,m.isVideo&&E&&(oe=(0,i.Pg)(m))):M&&(ne=(0,i.cy)(M)));const ce=(0,n.Kr)((()=>W?r.avatarIcon:F?x?"my-notes":"avatar-saved-messages":X?"avatar-deleted-account":ee?"reply-filled":te?"author-hidden":void 0),[W,F,X,ee,te,r,x]),de=(0,g.A)(ne,!1,s.qZ.BlobUrl),le=(0,g.A)(oe,!ae,s.qZ.BlobUrl),ue=de||k,pe=Boolean(ue||le),me=Boolean(le&&ae),fe=(0,I.A)(pe),he=(0,v.A)((e=>{const t=e.currentTarget;le&&(z||(_.current+=1,_.current>=3&&(t.style.display="none")))})),ye=(0,S.A)();let ve;const ge=H?(0,i.Yg)(H):Z?(0,i.Js)(ye,Z):N;if(ce)ve=(0,C.Y)(A.A,{name:ce,className:P.icon,role:"img",ariaLabel:ge});else if(pe)ve=(0,C.FD)(C.FK,{children:[(0,C.Y)("img",{src:ue,className:(0,d.A)(P.media,"avatar-media",fe,le&&"poster"),alt:ge,decoding:"async",draggable:!1}),me&&(0,C.Y)(w.A,{canPlay:!0,src:le,className:(0,d.A)(P.media,"avatar-media","poster"),muted:!0,loop:z,autoPlay:!0,disablePictureInPicture:!0,playsInline:!0,draggable:!1,onEnded:he})]});else if(H){const e=(0,i.Yg)(H);ve=e?(0,p.Qh)(e,2):void 0}else if(Z){const e=(0,i.Js)(ye,Z);ve=e&&(0,p.Qh)(e,(0,u.L8)(Z.id)?2:1)}else if(W){const e=r.title||ye(r.titleKey);ve=e&&(0,p.Qh)(e,1)}else N&&(ve=(0,p.Qh)(N,2));const Ie=W&&r.isAvatarSquare||re&&!((K||D)&&q?.hasStories),Se=W&&r.withPremiumGradient,we=W&&r.customPeerAvatarColor,be=(0,d.A)("Avatar",e,(0,f.y)(r),!r&&N&&"hidden-user",F&&"saved-messages",te&&"anonymous-forwards",X&&"deleted-account",ee&&"replies-bot-account",Se&&"premium-gradient-bg",Ie&&"forum",G&&"message-bubble",(m||M)&&"force-fit",(K&&q?.hasStories||L)&&"with-story-circle",D&&q?.hasStories&&"with-story-solid",D&&O&&"close-friend",D&&(q?.hasUnreadStories||V)&&"has-unread-story",j&&"interactive",!F&&!ue&&"no-photo"),Ae=Boolean(F||ue),{handleClick:Ce,handleMouseDown:Te}=(0,y.Q)((e=>{if(K&&"disabled"!==$&&q?.hasStories)return e.stopPropagation(),void J({peerId:q.id,isSinglePeer:"single-peer"===$,origin:Y});j&&j(e,Ae)}));return(0,C.FD)("div",{ref:Q,className:be,id:q?.id&&K?(0,i.kR)(q.id):void 0,"data-peer-id":q?.id,"data-test-sender-id":a.W75?q?.id:void 0,"aria-label":"string"==typeof ve?ge:void 0,style:(0,l.A)(`--_size: ${se}px;`,we&&`--color-user: ${we}`),onClick:Ce,onContextMenu:R,onMouseDown:Te,children:[(0,C.Y)("div",{className:"inner",children:"string"==typeof ve?(0,h.A)(ve,[ie?"hq_emoji":"emoji"]):ve}),K&&q?.hasStories&&(0,C.Y)(b.A,{peerId:q.id,size:se,withExtraGap:B})]})}))},29441:(e,t,r)=>{function n(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const r=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!r.length)return;const n=r.findIndex((e=>e.isSameNode(document.activeElement)));let o=0;n>=0&&(o=t.shiftKey?n>0?n-1:r.length-1:n<r.length-1?n+1:0),r[o].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}r.d(t,{A:()=>n})},32587:(e,t,r)=>{r.d(t,{A:()=>s});const n=[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],o=[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 s(e,t,r,s,a,i,c){if(Number.isNaN(i)||i<1)return;i|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const d=e.getImageData(t,r,s,a),l=d.data;let u,p,m,f,h,y,v,g,I,S,w,b,A=s-1,C=a-1,T=i+1,P=[],M=[],k=[],N=n[i],F=o[i],x=[],E=[];for(;c-- >0;){for(b=w=0,h=0;h<a;h++){for(u=l[b]*T,p=l[b+1]*T,m=l[b+2]*T,y=1;y<=i;y++)v=b+((y>A?A:y)<<2),u+=l[v++],p+=l[v++],m+=l[v++];for(f=0;f<s;f++)P[w]=u,M[w]=p,k[w]=m,0==h&&(x[f]=((v=f+T)<A?v:A)<<2,E[f]=(v=f-i)>0?v<<2:0),g=b+x[f],I=b+E[f],u+=l[g++]-l[I++],p+=l[g++]-l[I++],m+=l[g++]-l[I++],w++;b+=s<<2}for(f=0;f<s;f++){for(S=f,u=P[S]*T,p=M[S]*T,m=k[S]*T,y=1;y<=i;y++)S+=y>C?0:s,u+=P[S],p+=M[S],m+=k[S];for(w=f<<2,h=0;h<a;h++)l[w]=u*N>>>F,l[w+1]=p*N>>>F,l[w+2]=m*N>>>F,0==f&&(x[h]=((v=h+T)<C?v:C)*s,E[h]=(v=h-i)>0?v*s:0),g=f+x[h],I=f+E[h],u+=P[g]-P[I],p+=M[g]-M[I],m+=k[g]-k[I],w+=s<<2}}e.putImageData(d,t,r)}},34431:(e,t,r)=>{r.d(t,{A:()=>b});var n=r(84051),o=r(13439),s=r(31481),a=r(90709),i=r(70636),c=r(87357),d=r(95807),l=r(85982),u=r(83868),p=r(4961),m=r(39351),f=r(17712),h=r(59030),y=r(41036),v=r(87412),g=r(2578),I=r(9267),S=r(20021);const w=()=>(0,S.FD)("svg",{className:"VerifiedIcon",viewBox:"0 0 24 24",children:[(0,S.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,S.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)"})]}),b=(0,n.ph)((({className:e,peer:t,noVerified:r,noFake:b,withEmojiStatus:A,emojiStatusSize:C,isSavedMessages:T,isSavedDialog:P,noLoopLimit:M,canCopyTitle:k,iconElement:N,statusSparklesColor:F,isMonoforum:x,monoforumBadgeClassName:E,onEmojiStatusClick:K,observeIntersection:L})=>{const{showNotification:B}=(0,o.ko)(),D=(0,h.A)(),O=(0,m.A)(),V="id"in t?t:void 0,Y="isCustomPeer"in t?t:void 0,$=V&&(0,i.mO)(V),z=V&&($?(0,a.Yg)(V):(0,a.Js)(D,V)),U=$&&V.isPremium||Y?.isPremium,G=A&&!T,j=V?.emojiStatus||(Y?.emojiStatusId?{type:"regular",documentId:Y.emojiStatusId}:void 0),R=(0,f.A)((e=>{z&&k&&((0,u.A)(e),(0,l.eM)(z),B({message:($?"User":"Chat")+" name was copied"}))})),J=(0,n.Kr)((()=>Y?(0,p.A)(Y.title||D(Y.titleKey)):T?D(P?"MyNotes":"SavedMessages"):(0,a.Qe)(V.id)?D("AnonymousForward"):(0,a.kE)(V.id)?D("RepliesTitle"):(0,a.Rl)(V.id)?D("VerifyCodesNotifications"):void 0),[Y,P,T,D,V]),Q=V?.botVerificationIconId;return(0,S.FD)("div",{className:(0,c.A)("title","QljEeKI5",e),children:[Q&&(0,S.Y)(v.A,{documentId:Q,size:C,loopLimit:M?void 0:s.J$1,observeIntersectionForLoading:L}),(0,S.Y)("h3",{dir:"auto",role:"button",className:(0,c.A)("fullName","AS54Cntu",k&&"vr53L_9p"),onClick:R,children:J||(0,p.A)(z||"")}),!N&&t&&(0,S.FD)(S.FK,{children:[!r&&t?.isVerified&&(0,S.Y)(w,{}),!b&&t?.fakeType&&(0,S.Y)(g.A,{fakeType:t.fakeType}),G&&j&&(0,S.Y)(y.Ay,{className:"KBZgFSv7",slideClassName:"xmVxyvNy",activeKey:Number(j.documentId),name:"slideFade",direction:-1,shouldCleanup:!0,children:(0,S.Y)(v.A,{forceAlways:!0,className:"no-selection",withSparkles:"collectible"===j.type,sparklesClassName:"statusSparkles",sparklesStyle:(0,d.A)(F&&`color: ${F}`),documentId:j.documentId,size:C,loopLimit:M?void 0:s.J$1,observeIntersectionForLoading:L,onClick:K})}),G&&!j&&U&&(0,S.Y)(I.A,{}),x&&(0,S.Y)("div",{className:(0,c.A)("Sdwfc851",E),children:O("MonoforumBadge")})]}),N]})}))},37859:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(84051);const o=(e,t,r)=>{const o=(0,n.li)();return(0,n.Nf)((()=>{const r=o.current;return o.current=t,e(r||[])}),t,r)}},86046:(e,t,r)=>{r.d(t,{D5:()=>u,HT:()=>a,M6:()=>l,Pc:()=>i,ZF:()=>d,hk:()=>c,j6:()=>p,jA:()=>s});var n=r(5930),o=r(29807);function s(e,t){if("slug"===t.type)return t;if("stargiftResale"===t.type){const{slug:r,peerId:n}=t,s=(0,o.PVB)(e,n);if(!s)return;return{type:"stargiftResale",slug:r,peer:s}}if("stargift"===t.type){const{peerId:r,shouldHideName:n,giftId:s,message:a,shouldUpgrade:i}=t,c=(0,o.PVB)(e,r);if(!c)return;return{type:"stargift",peer:c,shouldHideName:n,giftId:s,message:a,shouldUpgrade:i}}if("starsgift"===t.type){const{userId:r,stars:n,amount:s,currency:a}=t,i=(0,o.mBe)(e,r);if(!i)return;return{type:"stars",purpose:{type:"starsgift",user:i,stars:n,amount:s,currency:a}}}if("stars"===t.type){const{stars:e,amount:r,currency:n}=t;return{type:"stars",purpose:{type:"stars",stars:e,amount:r,currency:n}}}if("chatInviteSubscription"===t.type){const{hash:e}=t;return{type:"chatInviteSubscription",hash:e}}if("message"===t.type){const r=(0,o.hds)(e,t.chatId);if(!r)return;return{type:"message",chat:r,messageId:t.messageId}}if("premiumGiftStars"===t.type){const{months:r,userId:n,message:s}=t,a=(0,o.mBe)(e,n);if(!a)return;return{type:"premiumGiftStars",months:r,message:s,user:a}}if("giftcode"===t.type){const{userIds:r,boostChannelId:n,amount:s,currency:a,option:i,message:c}=t;return{type:"giveaway",option:i,purpose:{type:"giftcode",amount:s,currency:a,users:r.map((t=>(0,o.mBe)(e,t))).filter(Boolean),boostChannel:n?(0,o.hds)(e,n):void 0,message:c}}}if("starsgiveaway"===t.type){const{chatId:r,additionalChannelIds:n,amount:s,currency:a,untilDate:i,areWinnersVisible:c,countries:d,isOnlyForNewSubscribers:l,prizeDescription:u,stars:p,users:m}=t,f=(0,o.hds)(e,r);if(!f)return;const h=n?.map((t=>(0,o.hds)(e,t))).filter(Boolean);return{type:"starsgiveaway",purpose:{type:"starsgiveaway",amount:s,currency:a,chat:f,additionalChannels:h,untilDate:i,areWinnersVisible:c,countries:d,isOnlyForNewSubscribers:l,prizeDescription:u,stars:p,users:m}}}if("giveaway"===t.type){const{chatId:r,additionalChannelIds:n,amount:s,currency:a,option:i,untilDate:c,areWinnersVisible:d,countries:l,isOnlyForNewSubscribers:u,prizeDescription:p}=t,m=(0,o.hds)(e,r);if(!m)return;const f=n?.map((t=>(0,o.hds)(e,t))).filter(Boolean);return{type:"giveaway",option:i,purpose:{type:"giveaway",amount:s,currency:a,chat:m,additionalChannels:f,untilDate:c,areWinnersVisible:d,countries:l,isOnlyForNewSubscribers:u,prizeDescription:p}}}if("stargiftUpgrade"===t.type){const{inputSavedGift:r,shouldKeepOriginalDetails:n}=t,o=a(e,r);if(!o)return;return{type:"stargiftUpgrade",inputSavedGift:o,shouldKeepOriginalDetails:n}}if("stargiftTransfer"===t.type){const{inputSavedGift:r,recipientId:n}=t,s=a(e,r),i=(0,o.PVB)(e,n);if(!s||!i)return;return{type:"stargiftTransfer",inputSavedGift:s,recipient:i}}}function a(e,t){if("user"===t.type)return t;if("chat"===t.type){const r=(0,o.hds)(e,t.chatId);if(!r)return;return{type:"chat",chat:r,savedId:t.savedId}}}function i(e){return"appStore"===e.type?{avatarIcon:"star",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.AppleTopUp.Title",subtitleKey:"Stars.Intro.Transaction.AppleTopUp.Subtitle",peerColorId:5}:"playMarket"===e.type?{avatarIcon:"star",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.GoogleTopUp.Title",subtitleKey:"Stars.Intro.Transaction.GoogleTopUp.Subtitle",peerColorId:3}:"fragment"===e.type?{avatarIcon:"star",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.FragmentTopUp.Title",subtitleKey:"Stars.Intro.Transaction.FragmentTopUp.Subtitle",customPeerAvatarColor:"#000000"}:"premiumBot"===e.type?{avatarIcon:"star",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.PremiumBotTopUp.Title",subtitleKey:"Stars.Intro.Transaction.PremiumBotTopUp.Subtitle",peerColorId:1,withPremiumGradient:!0}:"ads"===e.type?{avatarIcon:"star",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.TelegramAds.Title",subtitleKey:"Stars.Intro.Transaction.TelegramAds.Subtitle",peerColorId:2}:"api"===e.type?{avatarIcon:"bots",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.TelegramBotApi.Title",subtitleKey:"Stars.Intro.Transaction.TelegramBotApi.Subtitle",peerColorId:4}:{avatarIcon:"star",isCustomPeer:!0,titleKey:"Stars.Intro.Transaction.Unsupported.Title",subtitleKey:"Stars.Intro.Transaction.Unsupported.Title",peerColorId:0}}function c(e,t){const r=t.amount+t.nanos/1e9;return r<0?`- ${e.number(Math.abs(r))}`:`+ ${e.number(r)}`}function d(e,t){return e.number(t.amount+t.nanos/1e9)}function l(e){const{action:t}=e.content;if("giftStars"!==t?.type)return;const{transactionId:r,stars:n}=t;return{id:r,stars:{amount:n,nanos:0},peer:{type:"peer",id:e.isOutgoing?e.chatId:e.senderId||e.chatId},date:e.date,isGift:!0,isMyGift:e.isOutgoing||void 0}}function u(e){const{action:t}=e.content;if("prizeStars"!==t?.type)return;const{transactionId:r,stars:n,boostPeerId:o}=t;return{id:r,stars:{amount:n,nanos:0},peer:{type:"peer",id:o},date:e.date,giveawayPostId:e.id}}function p(e,t){return(0,n.A)(e,t)}},88554:(e,t,r)=>{r.d(t,{$:()=>A,A:()=>b});var n=r(84051),o=r(13439),s=r(29807),a=r(87357),i=r(76023),c=r(38691),d=r(20021);const l=["#34C578","#3CA3F3"],u=["#C9EB38","#09C167"],p=["#A667FF","#55A5FF"],m=.125*i.$,f=.0625*i.$,h=2,y=45,v=3.5*i.$,g=Math.PI/4,I=2*Math.PI*.1,S=g-I/2,w=g+I/2,b=(0,n.ph)((0,o.EK)(((e,{peerId:t})=>{const r=(0,s._bp)(e,t),n=(0,s.SJA)(e);return{peerStories:r?.byId,storyIds:r?.orderedIds,lastReadId:r?.lastReadId,appTheme:n}}))((function({size:e,className:t,peerStories:r,storyIds:o,lastReadId:s,withExtraGap:i,appTheme:l}){const u=(0,n.li)(),p=(0,c.A)(),f=e+m,h=(0,n.Kr)((()=>(o||[]).reduce(((e,t)=>(e.total+=1,s&&t<=s&&(e.read+=1),e)),{total:0,read:0})),[s,o]),y=(0,n.Kr)((()=>!(!r||!o?.length)&&o.some((e=>{const t=r[e];if(!t||!("isForCloseFriends"in t))return!1;const n=s&&t.id<=s;return t.isForCloseFriends&&!n}))),[s,r,o]);if((0,n.Nf)((()=>{u.current&&A({canvas:u.current,size:f*p,segmentsCount:h.total,color:y?"green":"blue",readSegmentsCount:h.read,withExtraGap:i,readSegmentColor:"dark"===l?"#737373":"#C4C9CC",dpr:p})}),[l,y,f,h.read,h.total,i,p]),h.total)return(0,d.Y)("canvas",{ref:u,className:(0,a.A)("story-circle",t),style:`max-width: ${f}px; max-height: ${f}px;`})})));function A({canvas:e,size:t,color:r,segmentsCount:n,readSegmentsCount:o=0,withExtraGap:s=!1,readSegmentColor:a,dpr:c}){n>y&&(o=Math.round(o*(y/n)),n=y);const d=Math.max(Math.max(t-v*c,0)/c/i.$/1.5,1)*c,g=e.getContext("2d");if(!g)return;e.width=t,e.height=t;const I=t/2,b=(t-m*d)/2,A=2*Math.PI/n,C=h/100*(2*Math.PI),T=g.createLinearGradient(0,0,Math.ceil(t*Math.cos(Math.PI/2)),Math.ceil(t*Math.sin(Math.PI/2))),P="purple"===r?p:"green"===r?u:l;P.forEach(((e,t)=>{T.addColorStop(t/(P.length-1),e)})),g.lineCap="round",g.clearRect(0,0,t,t),Array.from({length:n}).forEach(((e,t)=>{const r=t<o;let i=t*A-Math.PI/2+C/2,c=i+A-(n>1?C:0);if(g.strokeStyle=r?a:T,g.lineWidth=(r?f:m)*d,s){if(i>=S&&c<=w)return;i<S&&c>w?(g.beginPath(),g.arc(I,I,b,w,c),g.stroke(),c=S):i<S&&c>S?c=S:i<w&&c>w&&(i=w)}g.beginPath(),g.arc(I,I,b,i,c),g.stroke()}))}},91034:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(84051);function o(e){return function(t){const r=(0,n.li)(t);return t.ignoreFreeze?e(t):(t.isOpen?r.current=t:r.current={...r.current,isOpen:!1},e(r.current))}}},96374:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(84051),o=r(89925),s=r(87894),a=r(30857),i=r(17712),c=r(73767);function d(e,t,r,n){const{length:s}=e,a=n?e.indexOf(n):0,i=t===o.TN.Forwards?a:a+1||s,c=Math.max(0,i-r),d=i+r-1,l=e.slice(Math.max(0,c),d+1);let u,p;switch(t){case o.TN.Forwards:u=i>=0,p=c>=0;break;case o.TN.Backwards:u=i<s,p=d<=s-1}return{newViewportIds:l,areSomeLocal:u,areAllLocal:p,newIsOnTop:l[0]===e[0],fromOffset:c}}const l=(e,t,r=!1,l=30)=>{const u=(0,n.li)(),p=(0,n.li)();if(!p.current&&t&&!r){const{newViewportIds:e,newIsOnTop:r,fromOffset:n}=d(t,o.TN.Forwards,l,t[0]);p.current={viewportIds:e,isOnTop:r,offset:n}}const m=(0,a.A)();r&&(u.current={});const f=(0,c.A)(t),h=(0,c.A)(r);if(!t||r||t===f&&r===h)t||(p.current=void 0);else{const{viewportIds:e,isOnTop:r}=p.current||{},n=e&&!r?e[Math.round(e.length/2)]:void 0,a=n&&t.includes(n)?n:t[0],{offsetId:i=a,direction:c=o.TN.Forwards}=u.current||{},{newViewportIds:m,newIsOnTop:f,fromOffset:h}=d(t,c,l,i);u.current={},e&&(0,s.k)(e,m)||(p.current={viewportIds:m,isOnTop:f,offset:h})}const y=(0,i.A)((({direction:r,noScroll:n})=>{const{viewportIds:a}=p.current||{},i=a?r===o.TN.Backwards?a[a.length-1]:a[0]:void 0;if(!t)return void(e&&e({offsetId:i}));const{newViewportIds:c,areSomeLocal:f,areAllLocal:h,newIsOnTop:y,fromOffset:v}=d(t,r,l,i);!f||a&&(0,s.k)(a,c)||(p.current={viewportIds:c,isOnTop:y,offset:v},m()),!h&&e&&(n||(u.current={...u.current,direction:r,offsetId:i}),e({offsetId:i}))}));return r?[t]:[p.current?.viewportIds,y,p.current?.offset]}}}]);
//# sourceMappingURL=7661.35dd22385d66ff3af48a.js.map