TelegramPWA/dist/6930.b0fcb64a288f01a978f9.js
Alexander Zinchuk d0f2dca3cc [Build]
2024-12-20 17:06:57 +01:00

2 lines
50 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{29851:(e,t,a)=>{a.r(t),a.d(t,{GiftInfoModal:()=>et,GiftModal:()=>je,GiftRecipientPicker:()=>We,PaidReactionModal:()=>xe,StarPaymentModal:()=>le,StarsBalanceModal:()=>ae,StarsGiftModal:()=>E,StarsGiftingPickerModal:()=>T,StarsSubscriptionModal:()=>ge,StarsTransactionInfoModal:()=>pe});var n=a(84051),s=a(13439),r=a(90709),i=a(29807),o=a(87357),l=a(17142),c=a(4961),m=a(14),d=a(17712),u=a(59030),A=a(21849),p=a(56440),y=a(64493),f=a(8410),g=a(1526);const h={root:"j9SVp5No",main:"bTN9Jeph",headerInfo:"c6MiyJgW",logo:"StGLWvzb",logoBackground:"SyTXSfml",description:"kFe3mIZo",section:"BgfHkWd2",header:"zMtAGfXs",starHeaderText:"q3v8orGj",hiddenHeader:"bq3FnXT0",closeButton:"bDsDTkbe",avatar:"jK36xUj4",center:"v1PckUQn",secondaryInfo:"TDWSRfP9",modalDialog:"MFXAwnxJ"},S=a.p+"StarLogo.600328787c79d99dfd66.svg",v=a.p+"stars-bg.dee4c4b73c7d21c2ec73.png",E=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;return{user:a?.forUserId?(0,i.mBe)((0,s.mS)(),a.forUserId):void 0}}))((e=>{let{modal:t,user:a}=e;const{closeStarsGiftModal:i,openInvoice:E,requestConfetti:N}=(0,s.ko)(),b=(0,n.li)(null),I=Boolean(t?.isOpen),C=(0,m.A)(t),k=(0,u.A)(),[T,B]=(0,n.J0)(),[G,P]=(0,n.J0)(!0);(0,n.vJ)((()=>{I||P(!0)}),[I]);const x=(0,d.A)((()=>{const e=b.current;if(e&&I){const{top:t,left:a,width:n,height:s}=e.querySelector(".modal-content").getBoundingClientRect();N({top:t,left:a,width:n,height:s,withStars:!0})}}));(0,n.vJ)((()=>{C?.isCompleted&&x()}),[C,x]);const w=(0,d.A)((e=>{C&&(B(e),E(a?{type:"starsgift",userId:a.id,stars:e.stars,currency:e.currency,amount:e.amount}:{type:"stars",stars:e.stars,currency:e.currency,amount:e.amount}))})),M=(0,d.A)((()=>{i()})),R=(0,n.Kr)((()=>{const e=k("lng_credits_summary_options_about").split("{link}");return[e[0],n.Ay.createElement(p.A,{url:k("StarsTOSLink"),text:k("lng_credits_summary_options_about_link")}),e[1]]}),[k]);return n.Ay.createElement(f.A,{className:(0,o.A)(h.modalDialog,h.root),dialogRef:b,isSlim:!0,onClose:M,isOpen:I},n.Ay.createElement("div",{className:h.main,onScroll:function(e){const{scrollTop:t}=e.currentTarget;P(t<=150)}},n.Ay.createElement(y.A,{round:!0,size:"smaller",className:h.closeButton,color:"translucent",onClick:()=>i(),ariaLabel:k("Close")},n.Ay.createElement("i",{className:"icon icon-close"})),n.Ay.createElement("div",{className:(0,o.A)(h.header,G&&h.hiddenHeader)},n.Ay.createElement("h2",{className:h.starHeaderText},k(a?"GiftStarsTitle":"Star.List.GetStars"))),n.Ay.createElement("div",{className:h.headerInfo},a?n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{size:"huge",peer:a,className:h.avatar}),n.Ay.createElement("img",{className:h.logoBackground,src:v,alt:"",draggable:!1})):n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("img",{className:h.logo,src:S,alt:"",draggable:!1}),n.Ay.createElement("img",{className:h.logoBackground,src:v,alt:"",draggable:!1}))),n.Ay.createElement("h2",{className:(0,o.A)(h.headerText,h.center)},C?.isCompleted?a?(0,c.A)(k("Notification.StarsGift.SentYou",(0,l.A)(T.amount,T.currency,k.code)),["simple_markdown"]):(0,c.A)(k("StarsAcquiredInfo",T?.stars),["simple_markdown"]):k(a?"GiftStarsTitle":"Star.List.GetStars")),n.Ay.createElement("p",{className:h.description},a?(0,c.A)(k("ActionGiftStarsSubtitle",(0,r.qg$)(k,a)),["simple_markdown"]):k("Stars.Purchase.GetStarsInfo")),n.Ay.createElement("div",{className:h.section},n.Ay.createElement(g.A,{options:C?.starsGiftOptions,onClick:w}),n.Ay.createElement("div",{className:h.secondaryInfo},R))))})));var N=a(31481),b=a(87894),I=a(79582),C=a(54960),k=a(34642);const T=(0,n.ph)((0,s.EK)((e=>{const{chats:{listIds:t},currentUserId:a}=e;return{userIds:e.contactList?.userIds,activeListIds:t.active,archivedListIds:t.archived,currentUserId:a}}))((e=>{let{isOpen:t,currentUserId:a,activeListIds:i,archivedListIds:o,userIds:l}=e;const{closeStarsGiftingPickerModal:c,openStarsGiftModal:m}=(0,s.ko)(),A=(0,u.A)(),[p,y]=(0,n.J0)(""),f=(0,n.Kr)((()=>{const e=(0,s.mS)().users.byId,t=[...l||[],...i||[],...o||[]],n=(0,r.Z$K)(t,e,p);return(0,I.A)((0,b.Am)(n).filter((t=>{const n=e[t];return!(!n||n.isSupport||(0,r.tvf)(n)||(0,r.PL2)(n)||t===a||t===N.zv8)})))}),[a,p,l,i,o]),g=(0,d.A)((e=>{e?.length&&(m({forUserId:e}),c())}));return n.Ay.createElement(k.A,{className:"s3k01dTm",isOpen:t,onClose:c,title:A("GiftStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,confirmButtonText:A("Continue"),onEnter:c},n.Ay.createElement(C.A,{className:"cuI2eDIY",itemIds:f,filterValue:p,filterPlaceholder:A("Search"),onFilterChange:y,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:g}))})));var B=a(37661),G=a(39351),P=a(18276),x=a(9267),w=a(46222),M=a(24680),R=a(41036),L=a(86046);const K={root:"TtE8LQNJ",transition:"nXQS4E59",main:"JuWZY1ds",container:"mnhBs1uK",section:"lYkNd_gb",sectionTitle:"FF8gm7MP",tos:"Vu6blJk9",logo:"sjhpNB8l",logoBackground:"jjESKN3H",headerHext:"xbpAOr37",description:"teXilLxe",header:"fnhXotO2",starHeaderText:"iUwego5s",botItem:"AhxcrKWn",hiddenHeader:"DZk6d6hF",closeButton:"piD1PXHW",balance:"LitvQduT",smallerText:"rUnPcfmE",balanceBottom:"F5BTkZ9G",modalBalance:"t8tMrx3y",starButton:"oOt4VBD2",paymentContent:"OReEUNTV",paymentImages:"oKorQYTC",paymentPhoto:"HGTrEtUF",avatarStar:"Wu10dXoa",paymentImageBackground:"os8jb_qv",paymentButton:"VzR5cibf",paymentButtonStar:"Uhg7yWxK",transactions:"Qvc0fTTH",subscriptions:"IX5BhCUF",tabs:"KZVEyKOX",disclaimer:"bpVifdwH",amountBadge:"BPM7LKwo",loadMore:"TKmZjMyd",loadMoreIcon:"buepwtN1"},O=(0,n.ph)((e=>{let{balance:t,className:a}=e;const s=(0,G.A)();return n.Ay.createElement("div",{className:(0,o.A)(K.balance,a)},n.Ay.createElement("span",{className:K.smallerText},s("StarsBalance")),n.Ay.createElement("div",{className:K.balanceBottom},n.Ay.createElement(x.A,{type:"gold",size:"middle"}),void 0!==t?(0,L.ZF)(s,t):"…"))}));var z=a(17663),D=a(14242),J=a(63527);const U={root:"ZXnbeQxP",info:"zLaaDX3c",subtitle:"YN2J8dw6",status:"HbF2qTB2",statusPricing:"AveGvpdV",amount:"_CBiOQcv",title:"k9ZIv5Pd",description:"FlRlxMx2",statusPeriod:"MRrP7Oew",statusEnded:"pRHwfr8m",preview:"t6Syyhzd",subscriptionStar:"ftlbevPm"},_=(0,n.ph)((e=>{let{subscription:t}=e;const{openStarsSubscriptionModal:a}=(0,s.ko)(),{peerId:o,pricing:l,until:c,isCancelled:m,title:p,photo:y}=t,f=(0,u.A)(),g=(0,J.A)(function(e){return t=>(0,i.PVB)(t,e)}(o)),h=(0,d.A)((()=>{a({subscription:t})}));if(!g)return;const S=c<Date.now()/1e3,v=(0,z.A)(1e3*c,f.code,!0,"long");return n.Ay.createElement("div",{className:U.root,onClick:h},n.Ay.createElement("div",{className:U.preview},n.Ay.createElement(A.A,{size:"medium",peer:g}),n.Ay.createElement(x.A,{className:U.subscriptionStar,type:"gold",size:"small"})),n.Ay.createElement("div",{className:U.info},n.Ay.createElement("h3",{className:U.title},(0,r.qg$)(f,g)),p&&n.Ay.createElement("p",{className:U.subtitle},y&&n.Ay.createElement(A.A,{webPhoto:y,size:"micro"}),p),n.Ay.createElement("p",{className:U.description},f(S?"StarsSubscriptionExpired":m?"StarsSubscriptionExpires":"StarsSubscriptionRenews",v))),n.Ay.createElement("div",{className:U.status},m||S?n.Ay.createElement("div",{className:U.statusEnded},f(S?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("div",{className:U.statusPricing},n.Ay.createElement(x.A,{className:U.star,type:"gold",size:"adaptive"}),n.Ay.createElement("span",{className:U.amount},(0,D.Sm)(l.amount))),n.Ay.createElement("div",{className:U.statusPeriod},f("StarsParticipantSubscriptionPerMonth")))))}));var F=a(58968);function H(e,t){if(t.starRefCommision)return e("StarTransactionCommission",(0,D.l9)(t.starRefCommision));if(t.extendedMedia)return e("StarMediaPurchase");if(t.subscriptionPeriod)return t.title||e("StarSubscriptionPurchase");if(t.isReaction)return e("StarsReactionsSent");if(t.giveawayPostId)return e("StarsGiveawayPrizeReceived");if(t.isMyGift)return e("StarsGiftSent");if(t.isGift)return e("StarsGiftReceived");if(t.starGift)return V(t.stars)?e("Gift2TransactionSent"):e("Gift2ConvertedTitle");const a=t.peer&&"peer"!==t.peer.type&&(0,L.Pc)(t.peer)||void 0;return a?a.title||e(a.titleKey):t.title}function V(e){return e.amount?e.amount<0:e.nanos<0}var j=a(62587),W=a(27860);const q={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function Y(e){let{boughtMedia:t,index:a,className:s}=e;const i=t.video||t.photo,l=(0,r.VOI)(i,"pictogram"),c=(0,r.VDY)(i),m=(0,j.A)(l);return n.Ay.createElement("div",{className:(0,o.A)(q.thumb,void 0!==a&&`stars-transaction-media-${a}`,s)},c&&n.Ay.createElement("img",{className:q.blurry,src:c,alt:""}),m&&n.Ay.createElement("img",{className:q.full,src:m,alt:""}))}const X=(0,n.ph)((e=>{let{media:t,className:a,isTransactionPreview:s,onClick:r}=e;const i=Math.min(t.length,s?2:3),l="mediaType"in t[0];return n.Ay.createElement("div",{className:(0,o.A)(q.root,q[`itemCount${i}`],s&&q.preview,a),dir:"rtl",onClick:r},t.slice(0,i).reverse().map(((e,t,a)=>{const r=a.length-t-1;return"mediaType"in e?n.Ay.createElement(W.A,{className:q.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):n.Ay.createElement(Y,{className:(0,o.A)(s&&r>0&&q.noOutline),boughtMedia:e,index:r})})),l&&n.Ay.createElement("div",{className:q.count},n.Ay.createElement(P.A,{name:"stars-lock"}),t.length>1?t.length:""))})),Q={root:"aHAxv_Jg",info:"oyYrn3II",stars:"K5lc75ku",amount:"QLQPuLAr",title:"e0pK8CJ_",description:"xbERdDMQ",date:"l6CwQ0Ev",positive:"P_42_ZWR",negative:"TGjnLJfH",preview:"cnjGihOT",subscriptionStar:"z43YvnDX"},Z=(0,n.ph)((e=>{let{transaction:t,className:a}=e;const{openStarsTransactionModal:l}=(0,s.ko)(),{date:m,stars:p,photo:y,peer:f,extendedMedia:g,subscriptionPeriod:h}=t,S=(0,G.A)(),v=(0,u.A)(),E="peer"===f.type?f.id:void 0,N=(0,J.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(E)),b=(0,n.Kr)((()=>{let e,a,n,s=H(v,t);if("peer"===t.peer.type)e=N&&(0,r.qg$)(v,N),n=N||F.lw;else{const a=(0,L.Pc)(t.peer);s=a.title||v(a.titleKey),e=v(a.subtitleKey),n=a}return t.photo&&(n=void 0),t.isRefund&&(a=v("StarsRefunded")),t.hasFailed&&(a=v("StarsFailed")),t.isPending&&(a=v("StarsPending")),{title:s,description:e,avatarPeer:n,status:a}}),[v,N,t]),I=(0,d.A)((()=>{l({transaction:t})}));return n.Ay.createElement("div",{className:(0,o.A)(Q.root,a),onClick:I},n.Ay.createElement("div",{className:Q.preview},g?n.Ay.createElement(X,{media:g,isTransactionPreview:!0}):n.Ay.createElement(A.A,{size:"medium",webPhoto:y,peer:b.avatarPeer}),Boolean(h)&&n.Ay.createElement(x.A,{className:Q.subscriptionStar,type:"gold",size:"small"})),n.Ay.createElement("div",{className:Q.info},n.Ay.createElement("h3",{className:Q.title},b.title),b.description&&n.Ay.createElement("p",{className:Q.description},(0,c.A)(b.description)),n.Ay.createElement("p",{className:Q.date},(0,z.L2)(1e3*m,v.code,!0),b.status&&` — (${b.status})`)),n.Ay.createElement("div",{className:Q.stars},n.Ay.createElement("span",{className:(0,o.A)(Q.amount,V(p)?Q.negative:Q.positive)},(0,L.hk)(S,p)),n.Ay.createElement(x.A,{className:Q.star,type:"gold",size:"adaptive"})))})),$=["all","inbound","outbound"],ee=[{title:"StarsTransactionsAll"},{title:"StarsTransactionsIncoming"},{title:"StarsTransactionsOutgoing"}],te="StarsTransactionItem",ae=(0,n.ph)((0,s.EK)((e=>({starsBalanceState:e.stars,canBuyPremium:!(0,i.n_C)(e)})))((e=>{let{modal:t,starsBalanceState:a,canBuyPremium:l}=e;const{closeStarsBalanceModal:m,loadStarsTransactions:A,loadStarsSubscriptions:h,openStarsGiftingPickerModal:E,openInvoice:N}=(0,s.ko)(),{balance:b,history:I,subscriptions:C}=a||{},k=(0,u.A)(),T=(0,G.A)(),[L,z]=(0,n.J0)(!0),[D,J]=(0,n.J0)(0),[U,F,H]=(0,B.A)(),V=Boolean(t&&a),{originStarsPayment:j,originReaction:W,originGift:q,topup:Y}=t||{},X=j||W||q||Y,Q=j?.form?.invoice?.totalAmount||j?.subscriptionInfo?.subscriptionPricing?.amount||W?.amount||q?.gift.stars||Y?.balanceNeeded,ae=Q?Q-(b?.amount||0):void 0,ne=(0,n.Kr)((()=>{const e=(0,s.mS)();if(W){const t=(0,i.hds)(e,W.chatId);if(!t)return;return k("StarsNeededTextReactions",(0,r.JsG)(k,t))}if(j){const t=j.form?.botId?(0,i.mBe)(e,j.form.botId):void 0;if(!t)return;return k("StarsNeededText",(0,r.YgS)(t))}if(q){const t=(0,i.mBe)(e,q.userId);if(!t)return;return k("StarsNeededTextGift",(0,r.YgS)(t))}if("subs"===Y?.purpose)return k("StarsNeededTextLink")}),[W,j,q,Y?.purpose,k]),se=Boolean(I?.all?.transactions.length&&!X),re=!X;(0,n.vJ)((()=>{V||(z(!0),J(0),H())}),[V]),(0,n.vJ)((()=>{X?F():H()}),[X]);const ie=(0,n.Kr)((()=>{if(!V)return;const e=k("lng_credits_summary_options_about").split("{link}");return[e[0],n.Ay.createElement(p.A,{url:k("StarsTOSLink"),text:k("lng_credits_summary_options_about_link")}),e[1]]}),[V,k]),oe=(0,d.A)((()=>{A({type:$[D]})})),le=(0,d.A)((()=>{h()})),ce=(0,d.A)((()=>{E({})})),me=(0,d.A)((e=>{N({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return n.Ay.createElement(f.A,{className:K.root,isOpen:V,onClose:m},n.Ay.createElement("div",{className:(0,o.A)(K.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;z(t<=150)}},n.Ay.createElement(y.A,{round:!0,size:"smaller",className:K.closeButton,color:"translucent",onClick:()=>m(),ariaLabel:T("Close")},n.Ay.createElement(P.A,{name:"close"})),n.Ay.createElement(O,{balance:b,className:K.modalBalance}),n.Ay.createElement("div",{className:(0,o.A)(K.header,L&&K.hiddenHeader)},n.Ay.createElement("h2",{className:K.starHeaderText},k("TelegramStars"))),n.Ay.createElement("div",{className:K.section},n.Ay.createElement("img",{className:K.logo,src:S,alt:"",draggable:!1}),n.Ay.createElement("img",{className:K.logoBackground,src:v,alt:"",draggable:!1}),n.Ay.createElement("h2",{className:K.headerText},ae?k("StarsNeededTitle",Q):k("TelegramStars")),n.Ay.createElement("div",{className:K.description},(0,c.A)(ne||k("TelegramStarsInfo"),["simple_markdown","emoji"])),l&&!U&&n.Ay.createElement(y.A,{className:K.starButton,onClick:F},k("Star.List.BuyMoreStars")),l&&!U&&re&&n.Ay.createElement(y.A,{className:(0,o.A)(K.starButton,"settings-main-menu-star"),color:"translucent",onClick:ce},n.Ay.createElement(x.A,{className:"icon",type:"gold",size:"big"}),k("TelegramStarsGift")),U&&a?.topupOptions&&n.Ay.createElement(g.A,{starsNeeded:ae,options:a.topupOptions,onClick:me})),U&&n.Ay.createElement("div",{className:K.tos},ie),se&&Boolean(C?.list.length)&&n.Ay.createElement("div",{className:K.section},n.Ay.createElement("h3",{className:K.sectionTitle},k("StarMySubscriptions")),n.Ay.createElement("div",{className:K.subscriptions},C?.list.map((e=>n.Ay.createElement(_,{key:e.id,subscription:e}))),C?.nextOffset&&n.Ay.createElement(y.A,{isText:!0,disabled:C.isLoading,size:"smaller",noForcedUpperCase:!0,className:K.loadMore,onClick:le},n.Ay.createElement(P.A,{name:"down",className:K.loadMoreIcon}),k("StarMySubscriptionsExpand")))),se&&n.Ay.createElement("div",{className:K.container},n.Ay.createElement("div",{className:K.section},n.Ay.createElement(R.Ay,{name:T.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:D,renderCount:ee.length,shouldRestoreHeight:!0,className:K.transition},n.Ay.createElement(w.A,{onLoadMore:oe,items:I?.[$[D]]?.transactions,scrollContainerClosest:`.${K.main}`,itemSelector:`.${te}`,className:K.transactions,noFastList:!0},I?.[$[D]]?.transactions.map((e=>n.Ay.createElement(Z,{key:`${e.id}-${e.isRefund}`,transaction:e,className:te})))))),n.Ay.createElement(M.A,{className:K.tabs,tabClassName:K.tab,activeTab:D,tabs:ee,onSwitchTab:J}))))})));function ne(e,t){return e("StarsAmountText",{amount:t},{pluralValue:t})}function se(e,t,a){const s=a?n.Ay.createElement(P.A,{name:"star",className:"star-amount-icon"}):n.Ay.createElement(x.A,{type:"gold",className:"star-amount-icon",size:"adaptive"});return e("StarsAmount",{amount:t},{withNodes:!0,specialReplacement:{[N.Cyx]:s}})}var re=a(29886),ie=a(84991),oe=a(71690);const le=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;const n=a?.form?.botId?(0,i.mBe)(e,a.form.botId):void 0,s="message"===a?.inputInvoice?.type?a.inputInvoice:void 0,r=s?(0,i.O5q)(e,s.chatId,s.messageId):void 0,o=s?(0,i.hds)(e,s.chatId):void 0,l=r?.content.paidMedia;return{bot:n,starsBalanceState:e.stars,paidMediaMessage:l?r:void 0,paidMediaChat:l?o:void 0}}))((e=>{let{modal:t,bot:a,starsBalanceState:i,paidMediaMessage:l,paidMediaChat:m}=e;const{closeStarsPaymentModal:g,openStarsBalanceModal:h,sendStarPaymentForm:S}=(0,s.ko)(),[E,N,b]=(0,B.A)(),I=Boolean(t?.inputInvoice&&i),C=(0,re.A)(t),k=t||C,{form:T,subscriptionInfo:P}=k||{},w=T?.invoice?.totalAmount||P?.subscriptionPricing?.amount,M=Boolean(T?.invoice.subscriptionPeriod),R=!P?.subscriptionPricing,L=T?.photo,z=(0,u.A)(),J=(0,G.A)();(0,n.vJ)((()=>{I||b()}),[I]);const U=(0,n.Kr)((()=>{if(!k?.inputInvoice)return"";const e=(0,r.YgS)(a),t=z("Stars.Intro.PurchasedText.Stars",w);if(l){const e=l.content.paidMedia.extendedMedia,a=e.every((e=>!e.duration)),n=e.every((e=>!!e.duration)),s=z(a?"Stars.Transfer.Photos":n?"Stars.Transfer.Videos":"Media",e.length),i=(0,r.JsG)(z,m);return z("Stars.Transfer.UnlockInfo",[s,i,t])}return P?J("StarsSubscribeText",{chat:P.title,amount:w},{withNodes:!0,withMarkdown:!0,pluralValue:w}):M?J("StarsSubscribeBotText",{name:T.title,amount:w,bot:e},{pluralValue:w}):z("Stars.Transfer.Info",[T.title,e,t])}),[k?.inputInvoice,a,z,w,l,P,M,T,m,J]),_=(0,n.Kr)((()=>{if(P)return J("StarsSubscribeInfo",{link:n.Ay.createElement(p.A,{url:J("StarsSubscribeInfoLink"),text:J("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[P,J]),F=(0,n.Kr)((()=>{if(P)return(0,r.nrT)(P)}),[P]),H=(0,d.A)((()=>{const e=i?.balance;void 0!==w&&void 0!==e&&(w>e.amount?h({originStarsPayment:t}):(S({}),N()))}));return n.Ay.createElement(f.A,{contentClassName:K.paymentContent,isOpen:I,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:g},n.Ay.createElement(O,{balance:i?.balance,className:K.modalBalance}),n.Ay.createElement("div",{className:K.paymentImages,dir:z.isRtl?"ltr":"rtl"},l?n.Ay.createElement(X,{media:l.content.paidMedia.extendedMedia}):F?n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{className:K.paymentPhoto,peer:F,size:"giant"}),n.Ay.createElement(x.A,{type:"gold",size:"adaptive",className:K.avatarStar})):n.Ay.createElement(ie.A,{peer:L?void 0:a,avatarWebPhoto:L,avatarSize:"giant",badgeIcon:"star",badgeText:(0,D.Sm)(w),badgeClassName:K.amountBadge,className:K.paymentPhoto}),n.Ay.createElement("img",{className:K.paymentImageBackground,src:v,alt:"",draggable:!1})),n.Ay.createElement("h2",{className:K.headerText},z(F?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),R&&n.Ay.createElement(oe.A,{className:K.botItem,peerId:T?.botId}),n.Ay.createElement("div",{className:K.description},(0,c.A)(U,["simple_markdown","emoji"])),n.Ay.createElement(y.A,{className:K.paymentButton,size:"smaller",onClick:H,isLoading:E},J(M?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:se(J,w,!0)},{withNodes:!0})),_&&n.Ay.createElement("div",{className:(0,o.A)(K.disclaimer,K.smallerText)},_))})));var ce=a(89925),me=a(85982),de=a(79577),ue=a(70046);const Ae="sso9uZM6",pe=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;const n="peer"===a?.transaction?.peer?.type&&a.transaction.peer.id,s=n?(0,i.PVB)(e,n):void 0,r=a?.transaction.stars,o=a?.transaction.isGift&&(0,i.WLj)(e,r?.amount),l=a?.transaction.starGift?.stickerId,c=l&&(0,i._ni)(e,l);return{peer:s,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:c||o}}))((e=>{let{modal:t,peer:a,canPlayAnimatedEmojis:i,topSticker:l}=e;const{showNotification:c,openMediaViewer:m,closeStarsTransactionModal:y}=(0,s.ko)(),f=(0,G.A)(),g=(0,u.A)(),{transaction:h}=t||{},S=(0,d.A)((()=>{const e=h?.extendedMedia;e&&m({origin:ce.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),E=(0,n.Kr)((()=>{if(!h)return;const{giveawayPostId:e,photo:t,stars:s}=h,m=h.peer&&"peer"!==h.peer.type&&(0,L.Pc)(h.peer)||void 0,d="peer"===h.peer?.type?h.peer.id:void 0,u=h.peer&&g(function(e){switch(e.type){case"appStore":return"AppStore";case"playMarket":return"PlayMarket";case"fragment":return"Fragment";case"premiumBot":return"StarsTransactionBot";case"ads":return"StarsTransactionAds";case"api":return"Stars.Intro.Transaction.TelegramBotApi.Subtitle";default:return"Stars.Transaction.Unsupported.Title"}}(h.peer)),y=H(g,h),E=a&&h.messageId?(0,r.ytg)(a,void 0,h.messageId):void 0,N=a&&e&&(0,r.ytg)(a,void 0,e),b=h.extendedMedia,I=b?.length||0,C=b?.every((e=>!e.video)),k=b?.every((e=>!e.photo)),T=g(C?"Stars.Transfer.Photos":k?"Stars.Transfer.Videos":"Media",I),B=h.description||(b?T:void 0),G=!b&&!l,w=t?void 0:a||m,M=n.Ay.createElement("div",{className:(0,o.A)("qBOIq6Jn","VqKkGnpy")},b&&n.Ay.createElement(X,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:b,onClick:S}),!b&&l&&n.Ay.createElement(de.A,{key:h.id,sticker:l,play:i,noLoop:!0,nonInteractive:!0}),G&&n.Ay.createElement(A.A,{peer:w,webPhoto:t,size:"giant"}),n.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:v,alt:"",draggable:!1}),y&&n.Ay.createElement("h1",{className:"ZZAj3hj7"},y),n.Ay.createElement("p",{className:"NuWOY7ED"},B),n.Ay.createElement("p",{className:Ae},n.Ay.createElement("span",{className:(0,o.A)(Ae,V(s)?"xDyq9cc0":"jvBZSrpd")},(0,L.hk)(f,s)),n.Ay.createElement(x.A,{type:"gold",size:"middle"}))),R=[];let K;h.starRefCommision&&R.push([g("StarsTransaction.StarRefReason.Title"),g("StarsTransaction.StarRefReason.Program")]),K=V(s)||h.isMyGift?g("Stars.Transaction.To"):h.starRefCommision?g("StarsTransaction.StarRefReason.Miniapp"):g(d?"Star.Transaction.From":"Stars.Transaction.Via"),R.push([K,d?{chatId:d}:u||""]),E&&R.push([g("Stars.Transaction.Reaction.Post"),n.Ay.createElement(p.A,{url:E,text:E})]),N&&(R.push([g("BoostReason"),n.Ay.createElement(p.A,{url:N,text:g("Giveaway")})]),R.push([g("Gift"),g("Stars",h.stars,"i")])),h.id&&R.push([g("Stars.Transaction.Id"),n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,me.eM)(h.id),c({message:g("StarsTransactionIDCopied")})}},h.id),n.Ay.createElement(P.A,{className:"voCttFzS",name:"copy"}))]),R.push([g("Stars.Transaction.Date"),(0,z.L2)(1e3*h.date,g.code,!0)]);const O=g("lng_credits_box_out_about").split("{link}");return{header:M,tableData:R,footer:n.Ay.createElement("span",{className:"KgzPpgS6"},O[0],n.Ay.createElement(p.A,{url:g("StarsTOSLink"),text:g("lng_credits_summary_options_about_link")}),O[1])}}),[h,g,f,a,l,i]),N=(0,re.A)(E)||E;return n.Ay.createElement(ue.A,{isOpen:Boolean(h),className:"IzhfRIWu",header:N?.header,tableData:N?.tableData,footer:N?.footer,buttonText:g("OK"),onClose:y})})));var ye=a(70636);const fe="oBLHWBtJ",ge=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;const n=a?.subscription.peerId;return{peer:n?(0,i.PVB)(e,n):void 0}}))((e=>{let{modal:t,peer:a}=e;const{closeStarsSubscriptionModal:r,fulfillStarsSubscription:i,changeStarsSubscription:l,checkChatInvite:c,loadStarStatus:m,openInvoice:f}=(0,s.ko)(),g=(0,u.A)(),h=(0,G.A)(),{subscription:S}=t||{},E=(0,n.Kr)((()=>{if(!S)return"hidden";if(S.canRefulfill)return"refulfill";const e=S.until>Date.now()/1e3;if(e&&!S.isCancelled)return"cancel";if(e&&S.isCancelled)return"renew";const t=S.chatInviteHash||S.invoiceSlug;return!e&&t?"restart":"ok"}),[S]),b=(0,d.A)((()=>{if(S){switch(E){case"refulfill":i({id:S.id});break;case"restart":S.chatInviteHash?c({hash:S.chatInviteHash}):S.invoiceSlug&&f({type:"slug",slug:S.invoiceSlug}),m();break;case"renew":l({id:S.id,isCancelled:!1});break;case"cancel":l({id:S.id,isCancelled:!0})}r()}})),I=(0,n.Kr)((()=>{if(!S||!a)return;const{pricing:e,until:t,isCancelled:s,canRefulfill:r,photo:i,title:l,hasBotCancelled:c}=S,m=(0,ye.mO)(a),d=n.Ay.createElement("div",{className:(0,o.A)("E3R22yAI","gLkKCjkD")},n.Ay.createElement("div",{className:"wuTMXDP9"},n.Ay.createElement(A.A,{peer:i?void 0:a,webPhoto:i,size:"jumbo"}),n.Ay.createElement(x.A,{className:"enRetSny",type:"gold",size:"adaptive"})),n.Ay.createElement("img",{className:(0,o.A)("zGCayu45"),src:v,alt:"",draggable:!1}),n.Ay.createElement("h1",{className:"qdydQHgc"},l||g("StarsSubscriptionTitle")),n.Ay.createElement("p",{className:"FI6rEJlK"},h("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[N.Cyx]:n.Ay.createElement(x.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),u=[];u.push([g(m?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:a.id}]),l&&u.push([g("StarsSubscriptionBotProduct"),l]);const f=t<Date.now()/1e3;u.push([g(f?"StarsSubscriptionUntilExpired":s?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,z.L2)(1e3*t,g.code,!0)]);const I=h("StarsTransactionTOS",{link:n.Ay.createElement(p.A,{url:h("StarsTransactionTOSLink"),text:h("StarsTransactionTOSLinkText")})},{withNodes:!0});return{header:d,tableData:u,footer:n.Ay.createElement("span",{className:"GMWMuWCr"},n.Ay.createElement("p",{className:fe},I),s&&n.Ay.createElement("p",{className:"nkwiG25Q"},g(c?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),r&&n.Ay.createElement("p",{className:fe},g("StarsSubscriptionRefulfillInfo",(0,z.L2)(1e3*t,g.code,!0))),!s&&!r&&f&&n.Ay.createElement("p",{className:fe},g("StarsSubscriptionExpiredInfo",(0,z.L2)(1e3*t,g.code,!0))),!s&&!r&&!f&&n.Ay.createElement("p",{className:fe},g("StarsSubscriptionCancelInfo",(0,z.L2)(1e3*t,g.code,!0))),"hidden"!==E&&n.Ay.createElement(y.A,{size:"smaller",color:"cancel"===E?"danger":"primary",isText:"cancel"===E,onClick:b},g("cancel"===E?"StarsSubscriptionCancel":"refulfill"===E?"StarsSubscriptionRefulfill":"restart"===E?"StarsSubscriptionAgain":"renew"===E?"StarsSubscriptionRenew":"OK")))}}),[E,h,g,a,S]),C=(0,re.A)(I)||I;return n.Ay.createElement(ue.A,{isOpen:Boolean(S),className:"eR_RZfGB",header:C?.header,tableData:C?.tableData,footer:C?.footer,onClose:r})})));var he=a(19806),Se=a(32581),ve=a(66644),Ee=a(15283),Ne=a(93545),be=a(68292),Ie=a(85118);const Ce={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},ke=[50,100,500,1e3,2e3,5e3,1e4];function Te(e,t){const a=e.findIndex((e=>t<=e)),n=e[a-1]||1,s=e[a]||e[e.length-1];return a+(t-n)/(s-n)}function Be(e,t){const a=Math.floor(t),n=e[a-1]||1,s=n+((e[a]||e[e.length-1])-n)*(t-a);return Math.round(s)}const Ge=(0,n.ph)((e=>{let{maxValue:t,defaultValue:a,className:s,onChange:r}=e;const i=(0,n.li)(null),l=(0,n.Kr)((()=>{const e=[];for(let a=0;a<ke.length;a++)if(ke[a]<t&&e.push(ke[a]),ke[a]>=t){e.push(t);break}return e}),[t]),[c,m]=(0,n.J0)(0);(0,Ee.A)((()=>{m(Te(l,a))}));const u=(0,d.A)((()=>{const e=i.current;if(!e)return;const t=e.parentElement;(0,ve.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,n=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,ve.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${n}px`)}))}))}));(0,Ne.A)(i,u);const A=(0,d.A)((e=>{const t=Number(e.currentTarget.value);m(t),r(Be(l,t))}));return n.Ay.createElement("div",{className:(0,o.A)(Ce.root,s),style:"--progress: "+c/l.length},n.Ay.createElement("div",{className:Ce.floatingBadgeWrapper},n.Ay.createElement("div",{className:Ce.floatingBadge,ref:i},n.Ay.createElement("div",{className:Ce.floatingBadgeText},n.Ay.createElement(P.A,{name:"star",className:Ce.floatingBadgeIcon}),n.Ay.createElement(be.A,{text:(0,D.Sm)(Be(l,c))})),n.Ay.createElement("svg",{className:Ce.floatingBadgeTriangle,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},n.Ay.createElement("defs",null,n.Ay.createElement("linearGradient",{id:"StarBadgeTriangle",x1:"0",x2:"1",y1:"0",y2:"0"},n.Ay.createElement("stop",{offset:"-50%","stop-color":"#FFAA00"}),n.Ay.createElement("stop",{offset:"150%","stop-color":"#FFCD3A"}))),n.Ay.createElement("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:"url(#StarBadgeTriangle)"})))),n.Ay.createElement("div",{className:Ce.progress}),n.Ay.createElement(Ie.A,{preset:"progress",className:Ce.sparkles}),n.Ay.createElement("input",{className:Ce.slider,type:"range",min:0,max:l.length,defaultValue:Te(l,a),step:"any",onChange:A}))})),Pe={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},xe=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;const n=a&&(0,i.hds)(e,a.chatId),s=a&&(0,i.O5q)(e,a.chatId,a.messageId),r=e.stars?.balance;return{chat:n,message:s,starBalance:r,maxAmount:e.appConfig?.paidReactionMaxAmount||2500,defaultPrivacy:e.settings.paidReactionPrivacy}}))((e=>{let{modal:t,chat:a,message:o,maxAmount:l,starBalance:m,defaultPrivacy:A}=e;const{closePaidReactionModal:g,addLocalPaidReaction:h}=(0,s.ko)(),[S,v]=(0,n.J0)(50),[E,b,I]=(0,B.A)(),[C,k]=(0,n.J0)(!0),T=(0,u.A)(),x=(0,G.A)(),w=(0,d.A)((e=>{k(e.target.checked)})),M=(0,d.A)((e=>{v(e),b()}));(0,n.vJ)((()=>{t||I()}),[t]),(0,n.vJ)((()=>{const e=o?.reactions?.topReactors?.find((e=>e.isMe));k(e?!e.isAnonymous:A||!0)}),[A,o?.reactions?.topReactors]);const R=(0,d.A)((()=>{t&&(h({chatId:t.chatId,messageId:t.messageId,count:S,isPrivate:!C}),g())})),L=(0,n.Kr)((()=>{const e=(0,s.mS)(),t=o?.reactions?.topReactors;if(!t)return;const a=[];let n=!1;if(t.forEach((t=>{const s=t.peerId?(0,i.mBe)(e,t.peerId):void 0;(s||t.isAnonymous||t.isMe)&&(t.isMe&&(n=!0),a.push({amount:t.count,localAmount:t.isMe&&E?S:0,isMe:t.isMe,isAnonymous:t.isAnonymous,user:s}))})),!n&&E){const t=(0,i.mBe)(e,e.currentUserId);a.push({amount:0,localAmount:S,isMe:!0,user:t})}return a.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),a.slice(0,3)}),[E,o?.reactions?.topReactors,S]),K=a&&(0,r.JsG)(T,a);return n.Ay.createElement(f.A,{isOpen:Boolean(t),onClose:g,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:"RdhRpsCn"},n.Ay.createElement(O,{balance:m,className:"Q3560fzx"}),n.Ay.createElement(Ge,{className:"xePPMXOI",defaultValue:50,maxValue:l,onChange:M}),n.Ay.createElement("h3",{className:"yzbjj73U"},T("StarsReactionTitle")),n.Ay.createElement("div",{className:"BlpfdOtK"},(0,c.A)(T("StarsReactionText",K),["simple_markdown","emoji"])),n.Ay.createElement(Se.A,null,L&&n.Ay.createElement("div",{className:"bnou4CpV"},T("StarsReactionTopSenders"))),L&&n.Ay.createElement("div",{className:"QludQDKR"},L.map((e=>{const t=(0,D.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMe&&!C?Pe:e.user,s="isCustomPeer"in a?T(a.titleKey):(0,r.YgS)(a);return n.Ay.createElement(ie.A,{className:"Ty4Ud_Rd",key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:"JBF9pTUK",text:s})}))),n.Ay.createElement(he.A,{className:"oQ5Ar48z",checked:C,onChange:w,label:T("StarsReactionShowMeInTopSenders")}),n.Ay.createElement(y.A,{size:"smaller",onClick:R},x("SendPaidReaction",{amount:S},{withNodes:!0,specialReplacement:{[N.Cyx]:n.Ay.createElement(P.A,{className:"NJJFuym9",name:"star"})}})),n.Ay.createElement("p",{className:"KRvkHeo1"},x("StarsReactionTerms",{link:n.Ay.createElement(p.A,{text:x("StarsReactionLinkText"),url:x("StarsReactionLink")})},{withNodes:!0})))})));var we=a(20333),Me=a(95685),Re=a(22720),Le=a(63152),Ke=a(94079);const Oe=(0,n.ph)((0,s.EK)(((e,t)=>{let{userId:a}=t;const n=(0,i.SJA)(e),{patternColor:s}=e.settings.themes[n]||{},r=(0,i.mBe)(e,a),o=(0,i.nTw)(e);return{user:r,patternColor:s,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:o.isPaymentFormLoading}}))((function(e){let{gift:t,userId:a,user:i,captionLimit:c,patternColor:m,currentUserId:u,isPaymentFormLoading:A}=e;const{sendStarGift:p,openInvoice:f}=(0,s.ko)(),g=(0,G.A)(),[h,S]=(0,n.J0)(""),[v,E]=(0,n.J0)(!1),b="id"in t,I=(0,n.Kr)((()=>b?{id:-1,chatId:u,isOutgoing:!1,senderId:u,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[a],mediaType:"action",text:"ActionGiftInbound",type:"starGift",currency:N.OUy,amount:t.stars,starGift:{message:h?.length?{text:h}:void 0,isNameHidden:v,starsToConvert:t.starsToConvert,isSaved:!1,isConverted:!1,gift:t},translationValues:["%action_origin%","%gift_payment_amount%"]}}}:{id:-1,chatId:"0",isOutgoing:!0,senderId:u,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[a],mediaType:"action",text:"ActionGiftInbound",type:"giftPremium",amount:t.amount,currency:t.currency,months:t.months,message:{text:h},translationValues:["%action_origin%","%gift_payment_amount%"]}}}),[u,t,h,b,v,a]),C=(0,d.A)((e=>{S(e.target.value)})),k=(0,d.A)((()=>{E(!v)})),T=(0,d.A)((()=>{b?p({userId:a,shouldHideName:v,gift:t,message:h?{text:h}:void 0}):f({type:"giftcode",userIds:[a],currency:t.currency,amount:t.amount,option:t,message:h?{text:h}:void 0})}));return n.Ay.createElement("div",{className:(0,o.A)("jKOG0It6","no-scroll")},n.Ay.createElement("div",{className:(0,o.A)("CB1mxsgp","MessageList"),inert:!0,style:`--pattern-color: ${m}`},n.Ay.createElement(Me.A,{key:b?t.id:t.months,message:I})),function(){const e=c?c-h.length:void 0;return n.Ay.createElement("div",{className:"Y68CEIKn"},n.Ay.createElement(Ke.A,{className:"o5r2IPoA",onChange:C,value:h,label:g("GiftMessagePlaceholder"),maxLength:c,maxLengthIndicator:e&&e<50?e.toString():void 0}),b&&n.Ay.createElement(Re.A,{className:"zZUpGRSI",narrow:!0,ripple:!0,onClick:k},n.Ay.createElement("span",null,g("GiftHideMyName")),n.Ay.createElement(Le.A,{checked:v,onChange:k,label:g("GiftHideMyName")})))}(),function(){const e=(0,r.YgS)(i),a=b?se(g,t.stars,!0):(0,l.v)(t.amount,t.currency);return n.Ay.createElement("div",{className:"jxWZSvet"},b&&n.Ay.createElement("div",{className:"nTPAv1ci"},g("GiftHideNameDescription",{profile:e,receiver:e})),n.Ay.createElement("div",{className:"ATowWJ60"}),b&&t.availabilityRemains&&n.Ay.createElement(we.A,{isPrimary:!0,progress:t.availabilityRemains/t.availabilityTotal,rightText:g("GiftSoldCount",{count:t.availabilityTotal-t.availabilityRemains}),leftText:g("GiftLeftCount",{count:t.availabilityRemains}),className:"mWzLu0c0"}),n.Ay.createElement(y.A,{className:"IDuhjrne",onClick:T,isLoading:A},g("GiftSend",{amount:a},{withNodes:!0})))}())})));var ze=a(87049);const De="G1mBmzxs",Je="a8no5WH0",Ue=(0,n.ph)((0,s.EK)(((e,t)=>{let{option:a}=t;return{sticker:(0,i.t0O)(e,a.months),canPlayAnimatedEmojis:(0,i.BWX)(e)}}))((function(e){let{sticker:t,canPlayAnimatedEmojis:a,baseMonthAmount:s,option:r,onClick:i}=e;const{months:o,amount:c,currency:m}=r,u=(0,G.A)(),A=(0,d.A)((()=>{i(r)})),p=Math.floor(c/o),f=s&&s>p?Math.ceil(100-p/(s/100)):void 0;return n.Ay.createElement("div",{className:De,tabIndex:0,role:"button",onClick:A},n.Ay.createElement(de.A,{sticker:t,play:a,noLoop:!0,nonInteractive:!0,size:86}),function(){const e=12===o?u("Years",{count:1},{pluralValue:1}):u("Months",{count:o},{pluralValue:o});return n.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),n.Ay.createElement("div",{className:"q4_ydkAx"},u("PremiumGiftDescription")),n.Ay.createElement(y.A,{className:Je,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(c,m)),Boolean(f)&&n.Ay.createElement(ze.A,{color:"red",text:u("GiftDiscount",{percent:f})}))}))),_e=(0,n.ph)((0,s.EK)(((e,t)=>{let{gift:a}=t;return{sticker:e.stickers.starGifts.stickers[a.stickerId]}}))((function(e){let{sticker:t,gift:a,onClick:r}=e;const{openGiftInfoModal:i}=(0,s.ko)(),l=(0,G.A)(),{stars:c,isLimited:m,isSoldOut:u}=a,A=(0,d.A)((()=>{u?i({gift:a}):r(a)}));if(t)return n.Ay.createElement("div",{className:(0,o.A)(De,"f5ArEO1S"),tabIndex:0,role:"button",onClick:A},n.Ay.createElement(de.A,{sticker:t,noLoop:!0,nonInteractive:!0,size:90}),n.Ay.createElement(y.A,{className:Je,nonInteractive:!0,size:"tiny",color:"stars",withSparkleEffect:!0,pill:!0,fluid:!0},n.Ay.createElement(P.A,{name:"star",className:"DvJLTVFU"}),n.Ay.createElement("div",{className:"sbo2dMcH"},c)),m&&!u&&n.Ay.createElement(ze.A,{color:"blue",text:l("GiftLimited")}),u&&n.Ay.createElement(ze.A,{color:"red",text:l("GiftSoldOut")}))})));var Fe=a(36838);const He=(0,n.ph)((0,s.EK)((e=>{const{starGiftCategoriesByName:t}=e;return{starGiftCategoriesByName:t}}))((e=>{let{starGiftCategoriesByName:t,onCategoryChanged:a}=e;const s=(0,n.li)(null),r=(0,G.A)(),i=(0,n.Kr)((()=>Object.keys(t).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[t]),[l,c]=(0,n.J0)("all");function m(e){return n.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",l===e&&"B2lEJk1v"),onClick:()=>function(e){c(e),a(e)}(e)},"all"!==e&&"limited"!==e&&n.Ay.createElement(x.A,{className:"Pb7AU805",type:"gold",size:"middle"}),function(e){return"all"===e?r("AllGiftsCategory"):"limited"===e?r("LimitedGiftsCategory"):e}(e))}return(0,Fe.A)(s,void 0,!0),n.Ay.createElement("div",{ref:s,className:(0,o.A)("cUjwvN00","no-scrollbar")},m("all"),m("limited"),i.map(m))}))),Ve={root:"tJK1W0pJ",transition:"pP8TxefR",content:"o3V1HqbL",main:"cVXqeu9P",giftSection:"v4eKefwN",section:"EqfarEYb",starGiftsContainer:"OQX3GZl5",premiumGiftsGallery:"n40m3BK2",header:"iqqoyRgW",headerSlide:"BTWhJUQB",headerText:"lLRmbpIu",hiddenHeader:"XgGzn1cQ",commonHeaderText:"ybZo03if",closeButton:"r_Y5uG1T",balance:"soqAknia",avatars:"N_7tYJKr",logoBackground:"ieK4TzSb",center:"Ey5gX40t",description:"ZioU5h_k",starGiftsDescription:"gFgzS8pV",boostIcon:"Qi2YR6Dz",optionBottom:"RTbClMKE",secondaryInfo:"g0R9GSNq",footer:"J3Gju3bv",starGiftsTransition:"kB6IyXqS"},je=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;const{starGiftsById:n,starGiftCategoriesByName:s,stars:r}=e,o=a?.forUserId?(0,i.mBe)(e,a.forUserId):void 0;return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:n,starGiftCategoriesByName:s,starBalance:r?.balance,user:o}}))((e=>{let{modal:t,starGiftsById:a,starGiftCategoriesByName:i,starBalance:l,user:c}=e;const{closeGiftModal:g,requestConfetti:h}=(0,s.ko)(),S=(0,n.li)(null),E=(0,n.li)(null),N=(0,n.li)(null),b=Boolean(t),I=(0,m.A)(t),[C,k]=(0,n.J0)(),[T,B]=(0,n.J0)(!0),[P,x]=(0,n.J0)(!1),[w,M]=(0,n.J0)("all"),L=(0,u.A)(),K=(0,G.A)(),z=(0,n.Kr)((()=>I?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[I]),D=(0,n.Kr)((()=>z?.reduce(((e,t)=>e.amount<t.amount?e:t))),[z]),J=(0,d.A)((()=>{const e=S.current;if(e&&b){const{top:t,left:a,width:n,height:s}=e.querySelector(".modal-content").getBoundingClientRect();h({top:t,left:a,width:n,height:s,withStars:!0})}}));(0,n.vJ)((()=>{I?.isCompleted&&J()}),[I]),(0,n.vJ)((()=>{b||(B(!0),k(void 0))}),[b]);const U=(0,d.A)((e=>{if(C)return;const{scrollTop:t}=e.currentTarget;if(B(t<=150),E.current&&N.current){const{top:e}=N.current.getBoundingClientRect(),{top:t}=E.current.getBoundingClientRect();x(e-t<=0)}})),_=K("GiftPremiumDescription",{user:(0,r.YgS)(c),link:n.Ay.createElement(p.A,{text:K("GiftPremiumDescriptionLinkCaption"),url:K("GiftPremiumDescriptionLink")})},{withNodes:!0}),F=K("StarGiftDescription",{user:(0,r.YgS)(c)},{withNodes:!0}),H=(0,d.A)((e=>{k(e),x("id"in e),B(!1)})),V=(0,d.A)((e=>{M(e)})),j=(0,d.A)((()=>{C?k(void 0):g()})),W=Boolean(C),q=(0,o.A)("animated-close-icon",W&&"state-back");return n.Ay.createElement(f.A,{dialogRef:S,onClose:g,isOpen:b,isSlim:!0,contentClassName:Ve.content,className:(0,o.A)(Ve.modalDialog,Ve.root)},n.Ay.createElement(y.A,{className:Ve.closeButton,round:!0,color:"translucent",size:"smaller",onClick:j,ariaLabel:L(W?"Common.Back":"Common.Close")},n.Ay.createElement("div",{className:q})),n.Ay.createElement(O,{className:Ve.balance,balance:l}),n.Ay.createElement("div",{className:(0,o.A)(Ve.header,T&&Ve.hiddenHeader)},n.Ay.createElement(R.Ay,{name:"slideVerticalFade",activeKey:Number(P),slideClassName:Ve.headerSlide},n.Ay.createElement("h2",{className:Ve.commonHeaderText},K(P?"StarsGiftHeader":"GiftPremiumHeader")))),n.Ay.createElement(R.Ay,{ref:E,className:Ve.transition,name:"pushSlide",activeKey:C?1:0},!C&&n.Ay.createElement("div",{className:(0,o.A)(Ve.main,"custom-scroll"),onScroll:U},n.Ay.createElement("div",{className:Ve.avatars},n.Ay.createElement(A.A,{size:"huge",peer:c}),n.Ay.createElement("img",{className:Ve.logoBackground,src:v,alt:"",draggable:!1})),n.Ay.createElement("h2",{className:(0,o.A)(Ve.headerText,Ve.center)},K("GiftPremiumHeader")),n.Ay.createElement("p",{className:(0,o.A)(Ve.description,Ve.center)},_),n.Ay.createElement("div",{className:Ve.premiumGiftsGallery},z?.map((e=>n.Ay.createElement(Ue,{option:e,baseMonthAmount:D?Math.floor(D.amount/D.months):void 0,onClick:H})))),n.Ay.createElement("h2",{ref:N,className:(0,o.A)(Ve.headerText,Ve.center)},K("StarsGiftHeader")),n.Ay.createElement("p",{className:(0,o.A)(Ve.description,Ve.starGiftsDescription,Ve.center)},F),n.Ay.createElement(He,{onCategoryChanged:V}),n.Ay.createElement(R.Ay,{name:"zoomFade",activeKey:(Y=w,"all"===Y?-1:"limited"===Y?0:Y),className:Ve.starGiftsTransition},n.Ay.createElement("div",{className:Ve.starGiftsContainer},a&&i[w].map((e=>{const t=a[e];return n.Ay.createElement(_e,{gift:t,onClick:H})}))))),C&&I?.forUserId&&n.Ay.createElement(Oe,{gift:C,userId:I.forUserId})));var Y})));const We=(0,n.ph)((0,s.EK)((e=>{const{currentUserId:t}=e;return{currentUserId:t,userIds:e.contactList?.userIds,userSelectionLimit:e.appConfig?.giveawayAddPeersMax}}))((e=>{let{modal:t,currentUserId:a,userIds:i}=e;const{closeGiftRecipientPicker:o,openGiftModal:l}=(0,s.ko)(),c=(0,u.A)(),m=t,[A,p]=(0,n.J0)(""),y=(0,n.Kr)((()=>{const e=(0,s.mS)().users.byId,t=i?(0,r.Z$K)(i,e,A):[];return(0,I.A)((0,b.Am)(t).filter((t=>{const n=e[t];return!n||!(0,r.tvf)(n)&&t!==a})))}),[a,A,i]),f=(0,d.A)((e=>{l({forUserId:e}),o()}));return n.Ay.createElement(k.A,{className:"W3JMs1YE",isOpen:m,onClose:o,title:c("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},n.Ay.createElement(C.A,{className:"wOipz1Y_",itemIds:y,filterValue:A,filterPlaceholder:c("Search"),onSelectedIdChange:f,onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0}))})));var qe=a(80140),Ye=a(18501),Xe=a(81949),Qe=a(94189),Ze=a(96530);const $e={header:"p7FTs7_p",amount:"zJS3I8BT",title:"pIbzzTir",description:"CCPfr26t",soldOut:"kjWcRp4W",footerDescription:"VUylTszM",unknown:"zDauXmpS",giftValue:"w_E4LkUj"},et=(0,n.ph)((0,s.EK)(((e,t)=>{let{modal:a}=t;const n=a?.gift,s=n&&"gift"in n,r=s?n.gift:n,o=r?.stickerId,l=o?(0,i._ni)(e,o):void 0,c=s&&n.fromId;return{sticker:l,userFrom:c?(0,i.mBe)(e,c):void 0,targetUser:a?.userId?(0,i.mBe)(e,a.userId):void 0,currentUserId:e.currentUserId,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod}}))((e=>{let{modal:t,sticker:a,userFrom:i,targetUser:l,currentUserId:c,starGiftMaxConvertPeriod:p}=e;const{closeGiftInfoModal:f,changeGiftVisilibity:g,convertGiftToStars:h,openChatWithInfo:S}=(0,s.ko)(),[v,E,N]=(0,B.A)(),b=(0,G.A)(),I=(0,u.A)(),C=Boolean(t),k=(0,m.A)(t),{gift:T}=k||{},P=T&&"gift"in T,w=P?T:void 0,M=Boolean(w?.fromId&&w.messageId),R=w?.fromId===c,L=w&&p&&w.date+p-(0,qe.Fm)()||0,K=Math.ceil(L/60/60/24),O=(0,d.A)((()=>{f()})),J=(0,d.A)((()=>{const{fromId:e,messageId:t,isUnsaved:a}=w;g({userId:e,messageId:t,shouldUnsave:!a}),O()})),U=(0,d.A)((()=>{const{fromId:e,messageId:t}=w;h({userId:e,messageId:t}),N(),O()})),_=(0,d.A)((()=>{S({id:c,profileTab:"gifts"}),O()})),H=(0,n.Kr)((()=>{if(!T)return;const{fromId:e,isNameHidden:t,message:s,starsToConvert:i,isUnsaved:c,isConverted:m}=w||{},d=P?T.gift:T,u=t&&l,p=w?!M&&!R||!i||L<0?void 0:m?M?b("GiftInfoDescriptionConverted",{amount:(0,D.Sm)(i)},{pluralValue:i,withNodes:!0,withMarkdown:!0}):b("GiftInfoDescriptionOutConverted",{amount:(0,D.Sm)(i),user:(0,r.YgS)(l)},{pluralValue:i,withNodes:!0,withMarkdown:!0}):M?b("GiftInfoDescription",{amount:i},{withNodes:!0,withMarkdown:!0,pluralValue:i}):b("GiftInfoDescriptionOut",{amount:i,user:(0,r.YgS)(l)},{withNodes:!0,withMarkdown:!0,pluralValue:i}):b("GiftInfoSoldOutDescription"),f=n.Ay.createElement("div",{className:$e.header},n.Ay.createElement(de.A,{sticker:a,noLoop:!0,nonInteractive:!0,size:120}),n.Ay.createElement("h1",{className:$e.title},!w&&b("GiftInfoSoldOutTitle"),w&&b(M?"GiftInfoReceived":"GiftInfoTitle")),w&&n.Ay.createElement("p",{className:$e.amount},n.Ay.createElement("span",{className:$e.amount},(0,D.Sm)(d.stars)),n.Ay.createElement(x.A,{type:"gold",size:"middle"})),p&&n.Ay.createElement("p",{className:(0,o.A)($e.description,!w&&$e.soldOut)},p)),g=[];return(e||t)&&g.push([b("GiftInfoFrom"),e?{chatId:e}:n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{size:"small",peer:F.I5}),n.Ay.createElement("span",{className:$e.unknown},I(F.I5.titleKey)))]),w?.date&&g.push([b("GiftInfoDate"),(0,z.L2)(1e3*w.date,b.code,!0)]),d.firstSaleDate&&g.push([b("GiftInfoFirstSale"),(0,z.L2)(1e3*d.firstSaleDate,b.code,!0)]),d.lastSaleDate&&g.push([b("GiftInfoLastSale"),(0,z.L2)(1e3*d.lastSaleDate,b.code,!0)]),g.push([b("GiftInfoValue"),n.Ay.createElement("div",{className:$e.giftValue},se(b,d.stars),M&&L>0&&Boolean(i)&&n.Ay.createElement(Xe.A,{onClick:E},b("GiftInfoConvert",{amount:i},{pluralValue:i})))]),d.availabilityTotal&&g.push([b("GiftInfoAvailability"),b("GiftInfoAvailabilityValue",{count:d.availabilityRemains||0,total:d.availabilityTotal},{pluralValue:d.availabilityRemains||0})]),s&&g.push([void 0,(0,Ye.f)(s)]),{header:f,tableData:g,footer:n.Ay.createElement("div",{className:$e.footer},M&&n.Ay.createElement("div",{className:$e.footerDescription},n.Ay.createElement("div",null,c?b("GiftInfoHidden"):b("GiftInfoSaved",{link:n.Ay.createElement(Ze.A,{isPrimary:!0,onClick:_},b("GiftInfoSavedView"))},{withNodes:!0})),u&&n.Ay.createElement("div",null,b("GiftInfoSenderHidden"))),!M&&n.Ay.createElement(y.A,{size:"smaller",onClick:O},b("OK")),M&&n.Ay.createElement(y.A,{size:"smaller",onClick:J},b(c?"GiftInfoMakeVisible":"GiftInfoMakeInvisible")))}}),[T,w,P,l,a,b,M,L,R,I]);return n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(ue.A,{isOpen:C,header:H?.header,tableData:H?.tableData,footer:H?.footer,onClose:O}),w&&n.Ay.createElement(Qe.A,{isOpen:v,onClose:N,confirmHandler:U,title:b("GiftInfoConvertTitle")},n.Ay.createElement("div",null,b("GiftInfoConvertDescription1",{amount:ne(b,w.starsToConvert),user:(0,r.YgS)(i)},{withNodes:!0,withMarkdown:!0})),L>0&&n.Ay.createElement("div",null,b("GiftInfoConvertDescriptionPeriod",{count:K},{withNodes:!0,withMarkdown:!0,pluralValue:K})),n.Ay.createElement("div",null,b("GiftInfoConvertDescription2"))))})))},81949:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(84051),s=a(87357);const r=e=>{let{children:t,className:a,onClick:r}=e;return n.Ay.createElement("div",{className:(0,s.A)("hJUqHi4B",a),onClick:r},t)}},84991:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(84051),s=a(87357),r=a(21849),i=a(18276);const o={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"},l=(0,n.ph)((e=>{let{peer:t,avatarWebPhoto:a,avatarSize:l,text:c,badgeText:m,badgeIcon:d,className:u,badgeClassName:A,badgeIconClassName:p,textClassName:y,onClick:f}=e;return n.Ay.createElement("div",{className:(0,s.A)(o.root,f&&o.clickable,u),onClick:f},n.Ay.createElement("div",{className:o.top},n.Ay.createElement(r.A,{size:l,peer:t,webPhoto:a}),m&&n.Ay.createElement("div",{className:(0,s.A)(o.badge,A)},d&&n.Ay.createElement(i.A,{name:d,className:p}),m)),c&&n.Ay.createElement("p",{className:(0,s.A)(o.text,y)},c))}))},34642:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(84051),s=a(87357),r=a(59030),i=a(64493),o=a(8410);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},l.apply(this,arguments)}const c=(0,n.ph)((e=>{let{confirmButtonText:t,isConfirmDisabled:a,shouldAdaptToSearch:c,withFixedHeight:m,onConfirm:d,withPremiumGradient:u,...A}=e;const p=(0,r.A)(),y=Boolean(t||d);return n.Ay.createElement(o.A,l({},A,{isSlim:!0,className:(0,s.A)(c&&"WGSZ8u75",m&&"CrEsDylb",A.className),contentClassName:(0,s.A)("FuFYE0AA",A.contentClassName),headerClassName:(0,s.A)("iEptOmIp",A.headerClassName)}),A.children,y&&n.Ay.createElement("div",{className:"HqeDTaSr"},n.Ay.createElement(i.A,{withPremiumGradient:u,onClick:d||A.onClose,color:"primary",size:"smaller",disabled:a},t||p("Confirm"))))}))},70046:(e,t,a)=>{a.d(t,{A:()=>u});var n=a(84051),s=a(13439),r=a(87357),i=a(17712),o=a(21849),l=a(71690),c=a(64493),m=a(8410);const d="Cnh5ENvm",u=(0,n.ph)((e=>{let{isOpen:t,title:a,tableData:u,headerAvatarPeer:A,header:p,footer:y,buttonText:f,className:g,onClose:h,onButtonClick:S}=e;const{openChat:v}=(0,s.ko)(),E=(0,i.A)((e=>{v({id:e}),h()}));return n.Ay.createElement(m.A,{isOpen:t,hasCloseButton:Boolean(a),hasAbsoluteCloseButton:!a,isSlim:!0,title:a,className:g,contentClassName:"KYHkJ9Qf",onClose:h},A&&n.Ay.createElement(o.A,{peer:A,size:"jumbo",className:"SHQbPR5Y"}),p,n.Ay.createElement("div",{className:"DFRB0Ad4"},u?.map((e=>{let[t,a]=e;return n.Ay.createElement(n.Ay.Fragment,null,t&&n.Ay.createElement("div",{className:(0,r.A)(d,"AwnUe4Qk")},t),n.Ay.createElement("div",{className:(0,r.A)(d,"JGH6P9Az",!t&&"UssCZwgy")},"object"==typeof a&&"chatId"in a?n.Ay.createElement(l.A,{peerId:a.chatId,className:"aS9U4hiQ",forceShowSelf:!0,fluid:!0,clickArg:a.chatId,onClick:E}):a))}))),y,f&&n.Ay.createElement(c.A,{className:y?void 0:"cSamlkt9",size:"smaller",onClick:S||h},f))}))},1526:(e,t,a)=>{a.d(t,{A:()=>y});var n=a(84051),s=a(87357),r=a(17142),i=a(14242),o=a(4961),l=a(37661),c=a(39351),m=a(59030),d=a(18276),u=a(9267),A=a(64493);const p={options:"OnCj9kef",option:"tpTHQAUF",active:"U_9MXPG5",wideOption:"dJcJl33b",optionTop:"x9G4lqMf",stackedStars:"etXLebjM",stackedStar:"swttXv9P",optionBottom:"tK7La7L2",moreOptions:"AWXBaWLW",iconDown:"zWYHZJmd"},y=(0,n.ph)((e=>{let{isActive:t,className:a,options:y,selectedStarOption:f,selectedStarCount:g,starsNeeded:h,onClick:S}=e;const v=(0,m.A)(),E=(0,c.A)(),[N,b,I]=(0,l.A)();(0,n.vJ)((()=>{t||I()}),[t]);const[C,k]=(0,n.Kr)((()=>{if(!y)return[void 0,!1];const e=y.reduce(((e,t)=>e.stars>t.stars?e:t)),t=h&&e.stars<h,a=[];let n=0,s=!1;return y.forEach(((e,r)=>{e.isExtended||n++,h&&!t&&e.stars<h||(N||!e.isExtended?a.push({option:e,starsCount:Math.min(n,6),isWide:r===y.length-1}):s=!0)})),[a,s]}),[N,y,h]);return n.Ay.createElement("div",{className:(0,s.A)(p.options,a)},C?.map((e=>{let{option:t,starsCount:a,isWide:l}=e;const c=C?.length,m=c%2==0,d=t===f;let A;if(t&&"winners"in t){const e=t.winners.find((e=>e.users===g))||t.winners.reduce(((e,t)=>t.users>e.users?t:e),t.winners[0]);A=e?.perUserStars}return n.Ay.createElement("div",{className:(0,s.A)(p.option,!m&&l&&p.wideOption,d&&p.active),key:t.stars,onClick:()=>S?.(t)},n.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(t.stars),n.Ay.createElement("div",{className:p.stackedStars,dir:E.isRtl?"ltr":"rtl"},Array.from({length:a}).map((()=>n.Ay.createElement(u.A,{className:p.stackedStar,type:"gold",size:"big"}))))),n.Ay.createElement("div",{className:p.optionBottom},(0,r.v)(t.amount,t.currency,v.code)),(d||f&&"winners"in f)&&A&&n.Ay.createElement("div",{className:p.optionBottom},n.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(v("BoostGift.Stars.PerUser",(0,i.Sm)(A))))))})),!N&&k&&n.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:b},v("Stars.Purchase.ShowMore"),n.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))}}]);
//# sourceMappingURL=6930.b0fcb64a288f01a978f9.js.map