TelegramPWA/dist/7661.d13278e040a2c79801b6.js
Alexander Zinchuk fb411a3125 [Build]
2025-06-04 20:43:36 +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:()=>i});var n=r(84051),o=r(59030),s=r(20021);const i=(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:()=>i,E:()=>s});var n=r(96454),o=r(41402);function s(e){e.style.display="none",(0,o.A)(e),e.style.display=""}const i=(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),i=r(96454),a=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,a.A)((e=>{t||2!==e.button||(0,s.RK)((()=>{(0,o.YM)(e.target,"no-selection")}))})),I=(0,a.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,a.A)((()=>{m(!1)})),w=(0,a.A)((()=>{h(void 0)}));return(0,n.vJ)((()=>{if(t||!i.TF||d||l&&!l())return;const n=e.current;if(!n)return;let o;const s=()=>{o&&(clearTimeout(o),o=void 0)},a=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=>{i.pz&&i._7&&setTimeout((()=>{document.removeEventListener("mousedown",c,{capture:!0}),document.removeEventListener("click",c,{capture:!0})}),100),c(e)}),{once:!0,capture:!0}),i._7&&i.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",a,{passive:!0}),n.addEventListener("touchcancel",s,!0),n.addEventListener("touchend",s,!0),n.addEventListener("touchmove",s,{passive:!0}),()=>{s(),n.removeEventListener("touchstart",a),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:()=>i,wb:()=>s});let n=0;function o(){n+=1}function s(){n-=1}function i(){return n>0}},21849:(e,t,r)=>{r.d(t,{A:()=>k,R:()=>C});var n=r(84051),o=r(13439),s=r(23174),i=r(31481),a=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),A=r(88554),b=r(18276),T=r(20021);const C={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 k=(0,n.ph)((({className:e,size:t="large",peer:r,photo:m,webPhoto:k,previewUrl:M,text:N,isSavedMessages:F,isSavedDialog:x,withVideo:E,withStory:K,forPremiumPromo:L,withStoryGap:D,withStorySolid:O,forceFriendStorySolid:B,forceUnreadStorySolid:V,storyViewerOrigin:$,storyViewerMode:z="single-peer",loopIndefinitely:Y,noPersonalPhoto:U,onClick:G,onContextMenu:j})=>{const{openStoryViewer:R}=(0,o.ko)(),J=(0,n.li)(),Q=(0,n.li)(0),_=r&&"isCustomPeer"in r,W=r&&!_?r:void 0,q=W&&(0,c.mO)(W)?W:void 0,H=W&&(0,c.vj)(W)?W:void 0,Z=q&&(0,a.PL)(q),X=W&&(0,a.kE)(W.id),ee=W&&(0,a.Qe)(W.id),te=H?.isForum;let re,ne;const oe="number"==typeof t?t:C[t],se=E&&m?.isVideo,ie=oe>=C.jumbo;F||Z||(q&&!U||H?re=(0,a.cP)(r,ie?"big":void 0):m?(re=`photo${m.id}?size=m`,m.isVideo&&E&&(ne=(0,a.Pg)(m))):k&&(re=(0,a.cy)(k)));const ae=(0,n.Kr)((()=>_?r.avatarIcon:F?x?"my-notes":"avatar-saved-messages":Z?"avatar-deleted-account":X?"reply-filled":ee?"author-hidden":void 0),[_,F,Z,X,ee,r,x]),ce=(0,g.A)(re,!1,s.qZ.BlobUrl),de=(0,g.A)(ne,!se,s.qZ.BlobUrl),le=ce||M,ue=Boolean(le||de),pe=Boolean(de&&se),me=(0,I.A)(ue),fe=(0,v.A)((e=>{const t=e.currentTarget;de&&(Y||(Q.current+=1,Q.current>=3&&(t.style.display="none")))})),he=(0,S.A)();let ye;const ve=q?(0,a.Yg)(q):H?(0,a.Js)(he,H):N;if(ae)ye=(0,T.Y)(b.A,{name:ae,className:P.icon,role:"img",ariaLabel:ve});else if(ue)ye=(0,T.FD)(T.FK,{children:[(0,T.Y)("img",{src:le,className:(0,d.A)(P.media,"avatar-media",me,de&&"poster"),alt:ve,decoding:"async",draggable:!1}),pe&&(0,T.Y)(w.A,{canPlay:!0,src:de,className:(0,d.A)(P.media,"avatar-media","poster"),muted:!0,loop:Y,autoPlay:!0,disablePictureInPicture:!0,playsInline:!0,draggable:!1,onEnded:fe})]});else if(q){const e=(0,a.Yg)(q);ye=e?(0,p.Qh)(e,2):void 0}else if(H){const e=(0,a.Js)(he,H);ye=e&&(0,p.Qh)(e,(0,u.L8)(H.id)?2:1)}else if(_){const e=r.title||he(r.titleKey);ye=e&&(0,p.Qh)(e,1)}else N&&(ye=(0,p.Qh)(N,2));const ge=_&&r.isAvatarSquare||te&&!((K||O)&&W?.hasStories),Ie=_&&r.withPremiumGradient,Se=_&&r.customPeerAvatarColor,we=(0,d.A)("Avatar",e,(0,f.y)(r),!r&&N&&"hidden-user",F&&"saved-messages",ee&&"anonymous-forwards",Z&&"deleted-account",X&&"replies-bot-account",Ie&&"premium-gradient-bg",ge&&"forum",(m||k)&&"force-fit",(K&&W?.hasStories||L)&&"with-story-circle",O&&W?.hasStories&&"with-story-solid",O&&B&&"close-friend",O&&(W?.hasUnreadStories||V)&&"has-unread-story",G&&"interactive",!F&&!le&&"no-photo"),Ae=Boolean(F||le),{handleClick:be,handleMouseDown:Te}=(0,y.Q)((e=>{if(K&&"disabled"!==z&&W?.hasStories)return e.stopPropagation(),void R({peerId:W.id,isSinglePeer:"single-peer"===z,origin:$});G&&G(e,Ae)}));return(0,T.FD)("div",{ref:J,className:we,id:W?.id&&K?(0,a.kR)(W.id):void 0,"data-peer-id":W?.id,"data-test-sender-id":i.W75?W?.id:void 0,"aria-label":"string"==typeof ye?ve:void 0,style:(0,l.A)(`--_size: ${oe}px;`,Se&&`--color-user: ${Se}`),onClick:be,onContextMenu:j,onMouseDown:Te,children:[(0,T.Y)("div",{className:"inner",children:"string"==typeof ye?(0,h.A)(ye,[ie?"hq_emoji":"emoji"]):ye}),K&&W?.hasStories&&(0,T.Y)(A.A,{peerId:W.id,size:oe,withExtraGap:D})]})}))},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,i,a,c){if(Number.isNaN(a)||a<1)return;a|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const d=e.getImageData(t,r,s,i),l=d.data;let u,p,m,f,h,y,v,g,I,S,w,A,b=s-1,T=i-1,C=a+1,P=[],k=[],M=[],N=n[a],F=o[a],x=[],E=[];for(;c-- >0;){for(A=w=0,h=0;h<i;h++){for(u=l[A]*C,p=l[A+1]*C,m=l[A+2]*C,y=1;y<=a;y++)v=A+((y>b?b:y)<<2),u+=l[v++],p+=l[v++],m+=l[v++];for(f=0;f<s;f++)P[w]=u,k[w]=p,M[w]=m,0==h&&(x[f]=((v=f+C)<b?v:b)<<2,E[f]=(v=f-a)>0?v<<2:0),g=A+x[f],I=A+E[f],u+=l[g++]-l[I++],p+=l[g++]-l[I++],m+=l[g++]-l[I++],w++;A+=s<<2}for(f=0;f<s;f++){for(S=f,u=P[S]*C,p=k[S]*C,m=M[S]*C,y=1;y<=a;y++)S+=y>T?0:s,u+=P[S],p+=k[S],m+=M[S];for(w=f<<2,h=0;h<i;h++)l[w]=u*N>>>F,l[w+1]=p*N>>>F,l[w+2]=m*N>>>F,0==f&&(x[h]=((v=h+C)<T?v:T)*s,E[h]=(v=h-a)>0?v*s:0),g=f+x[h],I=f+E[h],u+=P[g]-P[I],p+=k[g]-k[I],m+=M[g]-M[I],w+=s<<2}}e.putImageData(d,t,r)}},34431:(e,t,r)=>{r.d(t,{A:()=>w});var n=r(84051),o=r(13439),s=r(31481),i=r(90709),a=r(70636),c=r(87357),d=r(95807),l=r(85982),u=r(83868),p=r(4961),m=r(17712),f=r(59030),h=r(41036),y=r(87412),v=r(2578),g=r(9267),I=r(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,n.ph)((({className:e,peer:t,noVerified:r,noFake:w,withEmojiStatus:A,emojiStatusSize:b,isSavedMessages:T,isSavedDialog:C,noLoopLimit:P,canCopyTitle:k,iconElement:M,statusSparklesColor:N,onEmojiStatusClick:F,observeIntersection:x})=>{const E=(0,f.A)(),{showNotification:K}=(0,o.ko)(),L="id"in t?t:void 0,D="isCustomPeer"in t?t:void 0,O=L&&(0,a.mO)(L),B=L&&(O?(0,i.Yg)(L):(0,i.Js)(E,L)),V=O&&L.isPremium||D?.isPremium,$=A&&!T,z=L?.emojiStatus||(D?.emojiStatusId?{type:"regular",documentId:D.emojiStatusId}:void 0),Y=(0,m.A)((e=>{B&&k&&((0,u.A)(e),(0,l.eM)(B),K({message:(O?"User":"Chat")+" name was copied"}))})),U=(0,n.Kr)((()=>D?(0,p.A)(D.title||E(D.titleKey)):T?E(C?"MyNotes":"SavedMessages"):(0,i.Qe)(L.id)?E("AnonymousForward"):(0,i.kE)(L.id)?E("RepliesTitle"):(0,i.Rl)(L.id)?E("VerifyCodesNotifications"):void 0),[D,C,T,E,L]),G=L?.botVerificationIconId;return(0,I.FD)("div",{className:(0,c.A)("title","QljEeKI5",e),children:[G&&(0,I.Y)(y.A,{documentId:G,size:b,loopLimit:P?void 0:s.J$1,observeIntersectionForLoading:x}),(0,I.Y)("h3",{dir:"auto",role:"button",className:(0,c.A)("fullName","AS54Cntu",k&&"vr53L_9p"),onClick:Y,children:U||(0,p.A)(B||"")}),!M&&t&&(0,I.FD)(I.FK,{children:[!r&&t?.isVerified&&(0,I.Y)(S,{}),!w&&t?.fakeType&&(0,I.Y)(v.A,{fakeType:t.fakeType}),$&&z&&(0,I.Y)(h.Ay,{className:"KBZgFSv7",slideClassName:"xmVxyvNy",activeKey:Number(z.documentId),name:"slideFade",direction:-1,shouldCleanup:!0,children:(0,I.Y)(y.A,{forceAlways:!0,className:"no-selection",withSparkles:"collectible"===z.type,sparklesClassName:"statusSparkles",sparklesStyle:(0,d.A)(N&&`color: ${N}`),documentId:z.documentId,size:b,loopLimit:P?void 0:s.J$1,observeIntersectionForLoading:x,onClick:F})}),$&&!z&&V&&(0,I.Y)(g.A,{})]}),M]})}))},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:()=>i,M6:()=>l,Pc:()=>a,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:i,shouldUpgrade:a}=t,c=(0,o.PVB)(e,r);if(!c)return;return{type:"stargift",peer:c,shouldHideName:n,giftId:s,message:i,shouldUpgrade:a}}if("starsgift"===t.type){const{userId:r,stars:n,amount:s,currency:i}=t,a=(0,o.mBe)(e,r);if(!a)return;return{type:"stars",purpose:{type:"starsgift",user:a,stars:n,amount:s,currency:i}}}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,i=(0,o.mBe)(e,n);if(!i)return;return{type:"premiumGiftStars",months:r,message:s,user:i}}if("giftcode"===t.type){const{userIds:r,boostChannelId:n,amount:s,currency:i,option:a,message:c}=t;return{type:"giveaway",option:a,purpose:{type:"giftcode",amount:s,currency:i,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:i,untilDate:a,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:i,chat:f,additionalChannels:h,untilDate:a,areWinnersVisible:c,countries:d,isOnlyForNewSubscribers:l,prizeDescription:u,stars:p,users:m}}}if("giveaway"===t.type){const{chatId:r,additionalChannelIds:n,amount:s,currency:i,option:a,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:a,purpose:{type:"giveaway",amount:s,currency:i,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=i(e,r);if(!o)return;return{type:"stargiftUpgrade",inputSavedGift:o,shouldKeepOriginalDetails:n}}if("stargiftTransfer"===t.type){const{inputSavedGift:r,recipientId:n}=t,s=i(e,r),a=(0,o.PVB)(e,n);if(!s||!a)return;return{type:"stargiftTransfer",inputSavedGift:s,recipient:a}}}function i(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 a(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,{$:()=>b,A:()=>A});var n=r(84051),o=r(13439),s=r(29807),i=r(87357),a=r(76023),c=r(38691),d=r(20021);const l=["#34C578","#3CA3F3"],u=["#C9EB38","#09C167"],p=["#A667FF","#55A5FF"],m=.125*a.$,f=.0625*a.$,h=2,y=45,v=3.5*a.$,g=Math.PI/4,I=2*Math.PI*.1,S=g-I/2,w=g+I/2,A=(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:a,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&&b({canvas:u.current,size:f*p,segmentsCount:h.total,color:y?"green":"blue",readSegmentsCount:h.read,withExtraGap:a,readSegmentColor:"dark"===l?"#737373":"#C4C9CC",dpr:p})}),[l,y,f,h.read,h.total,a,p]),h.total)return(0,d.Y)("canvas",{ref:u,className:(0,i.A)("story-circle",t),style:`max-width: ${f}px; max-height: ${f}px;`})})));function b({canvas:e,size:t,color:r,segmentsCount:n,readSegmentsCount:o=0,withExtraGap:s=!1,readSegmentColor:i,dpr:c}){n>y&&(o=Math.round(o*(y/n)),n=y);const d=Math.max(Math.max(t-v*c,0)/c/a.$/1.5,1)*c,g=e.getContext("2d");if(!g)return;e.width=t,e.height=t;const I=t/2,A=(t-m*d)/2,b=2*Math.PI/n,T=h/100*(2*Math.PI),C=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)=>{C.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 a=t*b-Math.PI/2+T/2,c=a+b-(n>1?T:0);if(g.strokeStyle=r?i:C,g.lineWidth=(r?f:m)*d,s){if(a>=S&&c<=w)return;a<S&&c>w?(g.beginPath(),g.arc(I,I,A,w,c),g.stroke(),c=S):a<S&&c>S?c=S:a<w&&c>w&&(a=w)}g.beginPath(),g.arc(I,I,A,a,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),i=r(30857),a=r(17712),c=r(73767);function d(e,t,r,n){const{length:s}=e,i=n?e.indexOf(n):0,a=t===o.TN.Forwards?i:i+1||s,c=Math.max(0,a-r),d=a+r-1,l=e.slice(Math.max(0,c),d+1);let u,p;switch(t){case o.TN.Forwards:u=a>=0,p=c>=0;break;case o.TN.Backwards:u=a<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,i.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,i=n&&t.includes(n)?n:t[0],{offsetId:a=i,direction:c=o.TN.Forwards}=u.current||{},{newViewportIds:m,newIsOnTop:f,fromOffset:h}=d(t,c,l,a);u.current={},e&&(0,s.k)(e,m)||(p.current={viewportIds:m,isOnTop:f,offset:h})}const y=(0,a.A)((({direction:r,noScroll:n})=>{const{viewportIds:i}=p.current||{},a=i?r===o.TN.Backwards?i[i.length-1]:i[0]:void 0;if(!t)return void(e&&e({offsetId:a}));const{newViewportIds:c,areSomeLocal:f,areAllLocal:h,newIsOnTop:y,fromOffset:v}=d(t,r,l,a);!f||i&&(0,s.k)(i,c)||(p.current={viewportIds:c,isOnTop:y,offset:v},m()),!h&&e&&(n||(u.current={...u.current,direction:r,offsetId:a}),e({offsetId:a}))}));return r?[t]:[p.current?.viewportIds,y,p.current?.offset]}}}]);
//# sourceMappingURL=7661.d13278e040a2c79801b6.js.map