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