2 lines
50 KiB
JavaScript
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:()=>We,GiftRecipientPicker:()=>je,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={modalDialog:"MFXAwnxJ",content:"Sl6xVf1R",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"},S=a.p+"StarLogo.600328787c79d99dfd66.svg",v=a.p+"stars-bg.dee4c4b73c7d21c2ec73.png",E=(0,n.ph)((0,s.EK)(((e,{modal:t})=>({user:t?.forUserId?(0,i.mBe)((0,s.mS)(),t.forUserId):void 0})))((({modal:e,user:t})=>{const{closeStarsGiftModal:a,openInvoice:i,requestConfetti:E}=(0,s.ko)(),N=(0,n.li)(null),b=Boolean(e?.isOpen),I=(0,m.A)(e),C=(0,u.A)(),[k,T]=(0,n.J0)(),[B,G]=(0,n.J0)(!0);(0,n.vJ)((()=>{b||G(!0)}),[b]);const P=(0,d.A)((()=>{const e=N.current;if(e&&b){const{top:t,left:a,width:n,height:s}=e.querySelector(".modal-content").getBoundingClientRect();E({top:t,left:a,width:n,height:s,withStars:!0})}}));(0,n.vJ)((()=>{I?.isCompleted&&P()}),[I,P]);const x=(0,d.A)((e=>{I&&(T(e),i(t?{type:"starsgift",userId:t.id,stars:e.stars,currency:e.currency,amount:e.amount}:{type:"stars",stars:e.stars,currency:e.currency,amount:e.amount}))})),w=(0,d.A)((()=>{a()})),M=(0,n.Kr)((()=>{const e=C("lng_credits_summary_options_about").split("{link}");return[e[0],n.Ay.createElement(p.A,{url:C("StarsTOSLink"),text:C("lng_credits_summary_options_about_link")}),e[1]]}),[C]);return n.Ay.createElement(f.A,{className:(0,o.A)(h.modalDialog),contentClassName:h.content,dialogRef:N,isSlim:!0,onClose:w,isOpen:b},n.Ay.createElement("div",{className:(0,o.A)(h.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;G(t<=150)}},n.Ay.createElement(y.A,{round:!0,size:"smaller",className:h.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:C("Close")},n.Ay.createElement("i",{className:"icon icon-close"})),n.Ay.createElement("div",{className:(0,o.A)(h.header,B&&h.hiddenHeader)},n.Ay.createElement("h2",{className:h.starHeaderText},C(t?"GiftStarsTitle":"Star.List.GetStars"))),n.Ay.createElement("div",{className:h.headerInfo},t?n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{size:100,peer:t,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)},I?.isCompleted?t?(0,c.A)(C("Notification.StarsGift.SentYou",(0,l.A)(k.amount,k.currency,C.code)),["simple_markdown"]):(0,c.A)(C("StarsAcquiredInfo",k?.stars),["simple_markdown"]):C(t?"GiftStarsTitle":"Star.List.GetStars")),n.Ay.createElement("p",{className:h.description},t?(0,c.A)(C("ActionGiftStarsSubtitle",(0,r.F9N)(C,t)),["simple_markdown"]):C("Stars.Purchase.GetStarsInfo")),n.Ay.createElement("div",{className:h.section},n.Ay.createElement(g.A,{options:I?.starsGiftOptions,onClick:x}),n.Ay.createElement("div",{className:h.secondaryInfo},M))))})));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}}))((({isOpen:e,currentUserId:t,activeListIds:a,archivedListIds:i,userIds:o})=>{const{closeStarsGiftingPickerModal:l,openStarsGiftModal:c}=(0,s.ko)(),m=(0,u.A)(),[A,p]=(0,n.J0)(""),y=(0,n.Kr)((()=>{const e=(0,s.mS)().users.byId,n=[...o||[],...a||[],...i||[]],l=(0,r.Z$K)(n,e,A);return(0,I.A)((0,b.Am)(l).filter((a=>{const n=e[a];return!(!n||n.isSupport||(0,r.tvf)(n)||(0,r.PL2)(n)||a===t||a===N.zv8)})))}),[t,A,o,a,i]),f=(0,d.A)((e=>{e?.length&&(c({forUserId:e}),l())}));return n.Ay.createElement(k.A,{className:"s3k01dTm",isOpen:e,onClose:l,title:m("GiftStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,confirmButtonText:m("Continue"),onEnter:l},n.Ay.createElement(C.A,{className:"cuI2eDIY",itemIds:y,filterValue:A,filterPlaceholder:m("Search"),onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:f}))})));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 O={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"},K=(0,n.ph)((({balance:e,className:t})=>{const a=(0,G.A)();return n.Ay.createElement("div",{className:(0,o.A)(O.balance,t)},n.Ay.createElement("span",{className:O.smallerText},a("StarsBalance")),n.Ay.createElement("div",{className:O.balanceBottom},n.Ay.createElement(x.A,{type:"gold",size:"middle"}),void 0!==e?(0,L.ZF)(a,e):"…"))}));var z=a(17663),D=a(14242),F=a(63527);const J={root:"ZXnbeQxP",info:"zLaaDX3c",subtitle:"YN2J8dw6",status:"HbF2qTB2",statusPricing:"AveGvpdV",amount:"_CBiOQcv",title:"k9ZIv5Pd",description:"FlRlxMx2",statusPeriod:"MRrP7Oew",statusEnded:"pRHwfr8m",preview:"t6Syyhzd",subscriptionStar:"ftlbevPm"},U=(0,n.ph)((({subscription:e})=>{const{openStarsSubscriptionModal:t}=(0,s.ko)(),{peerId:a,pricing:o,until:l,isCancelled:c,title:m,photo:p}=e,y=(0,u.A)(),f=(0,F.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),g=(0,d.A)((()=>{t({subscription:e})}));if(!f)return;const h=l<Date.now()/1e3,S=(0,z.A)(1e3*l,y.code,!0,"long");return n.Ay.createElement("div",{className:J.root,onClick:g},n.Ay.createElement("div",{className:J.preview},n.Ay.createElement(A.A,{size:"medium",peer:f}),n.Ay.createElement(x.A,{className:J.subscriptionStar,type:"gold",size:"small"})),n.Ay.createElement("div",{className:J.info},n.Ay.createElement("h3",{className:J.title},(0,r.F9N)(y,f)),m&&n.Ay.createElement("p",{className:J.subtitle},p&&n.Ay.createElement(A.A,{webPhoto:p,size:"micro"}),m),n.Ay.createElement("p",{className:J.description},y(h?"StarsSubscriptionExpired":c?"StarsSubscriptionExpires":"StarsSubscriptionRenews",S))),n.Ay.createElement("div",{className:J.status},c||h?n.Ay.createElement("div",{className:J.statusEnded},y(h?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("div",{className:J.statusPricing},n.Ay.createElement(x.A,{className:J.star,type:"gold",size:"adaptive"}),n.Ay.createElement("span",{className:J.amount},(0,D.Sm)(o.amount))),n.Ay.createElement("div",{className:J.statusPeriod},y("StarsParticipantSubscriptionPerMonth")))))}));var _=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 W=a(62587),j=a(27860);const Y={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function X({boughtMedia:e,index:t,className:a}){const s=e.video||e.photo,i=(0,r.VOI)(s,"pictogram"),l=(0,r.VDY)(s),c=(0,W.A)(i);return n.Ay.createElement("div",{className:(0,o.A)(Y.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},l&&n.Ay.createElement("img",{className:Y.blurry,src:l,alt:""}),c&&n.Ay.createElement("img",{className:Y.full,src:c,alt:""}))}const q=(0,n.ph)((({media:e,className:t,isTransactionPreview:a,onClick:s})=>{const r=Math.min(e.length,a?2:3),i="mediaType"in e[0];return n.Ay.createElement("div",{className:(0,o.A)(Y.root,Y[`itemCount${r}`],a&&Y.preview,t),dir:"rtl",onClick:s},e.slice(0,r).reverse().map(((e,t,s)=>{const r=s.length-t-1;return"mediaType"in e?n.Ay.createElement(j.A,{className:Y.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):n.Ay.createElement(X,{className:(0,o.A)(a&&r>0&&Y.noOutline),boughtMedia:e,index:r})})),i&&n.Ay.createElement("div",{className:Y.count},n.Ay.createElement(P.A,{name:"stars-lock"}),e.length>1?e.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)((({transaction:e,className:t})=>{const{openStarsTransactionModal:a}=(0,s.ko)(),{date:l,stars:m,photo:p,peer:y,extendedMedia:f,subscriptionPeriod:g}=e,h=(0,G.A)(),S=(0,u.A)(),v="peer"===y.type?y.id:void 0,E=(0,F.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(v)),N=(0,n.Kr)((()=>{let t,a,n,s=H(S,e);if("peer"===e.peer.type)t=E&&(0,r.F9N)(S,E),n=E||_.lw;else{const a=(0,L.Pc)(e.peer);s=a.title||S(a.titleKey),t=S(a.subtitleKey),n=a}return e.photo&&(n=void 0),e.isRefund&&(a=S("StarsRefunded")),e.hasFailed&&(a=S("StarsFailed")),e.isPending&&(a=S("StarsPending")),{title:s,description:t,avatarPeer:n,status:a}}),[S,E,e]),b=(0,d.A)((()=>{a({transaction:e})}));return n.Ay.createElement("div",{className:(0,o.A)(Q.root,t),onClick:b},n.Ay.createElement("div",{className:Q.preview},f?n.Ay.createElement(q,{media:f,isTransactionPreview:!0}):n.Ay.createElement(A.A,{size:"medium",webPhoto:p,peer:N.avatarPeer}),Boolean(g)&&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},N.title),N.description&&n.Ay.createElement("p",{className:Q.description},(0,c.A)(N.description)),n.Ay.createElement("p",{className:Q.date},(0,z.L2)(1e3*l,S.code,!0),N.status&&` — (${N.status})`)),n.Ay.createElement("div",{className:Q.stars},n.Ay.createElement("span",{className:(0,o.A)(Q.amount,V(m)?Q.negative:Q.positive)},(0,L.hk)(h,m)),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)})))((({modal:e,starsBalanceState:t,canBuyPremium:a})=>{const{closeStarsBalanceModal:l,loadStarsTransactions:m,loadStarsSubscriptions:A,openStarsGiftingPickerModal:h,openInvoice:E}=(0,s.ko)(),{balance:N,history:b,subscriptions:I}=t||{},C=(0,u.A)(),k=(0,G.A)(),[T,L]=(0,n.J0)(!0),[z,D]=(0,n.J0)(0),[F,J,_]=(0,B.A)(),H=Boolean(e&&t),{originStarsPayment:V,originReaction:W,originGift:j,topup:Y}=e||{},X=V||W||j||Y,q=V?.form?.invoice?.totalAmount||V?.subscriptionInfo?.subscriptionPricing?.amount||W?.amount||j?.gift.stars||Y?.balanceNeeded,Q=q?q-(N?.amount||0):void 0,ae=(0,n.Kr)((()=>{const e=(0,s.mS)();if(W){const t=(0,i.hds)(e,W.chatId);if(!t)return;return C("StarsNeededTextReactions",(0,r.JsG)(C,t))}if(V){const t=V.form?.botId?(0,i.mBe)(e,V.form.botId):void 0;if(!t)return;return C("StarsNeededText",(0,r.YgS)(t))}if(j){const t=(0,i.mBe)(e,j.userId);if(!t)return;return C("StarsNeededTextGift",(0,r.YgS)(t))}if("subs"===Y?.purpose)return C("StarsNeededTextLink")}),[W,V,j,Y?.purpose,C]),ne=Boolean(b?.all?.transactions.length&&!X),se=!X;(0,n.vJ)((()=>{H||(L(!0),D(0),_())}),[H]),(0,n.vJ)((()=>{X?J():_()}),[X]);const re=(0,n.Kr)((()=>{if(!H)return;const e=C("lng_credits_summary_options_about").split("{link}");return[e[0],n.Ay.createElement(p.A,{url:C("StarsTOSLink"),text:C("lng_credits_summary_options_about_link")}),e[1]]}),[H,C]),ie=(0,d.A)((()=>{m({type:$[z]})})),oe=(0,d.A)((()=>{A()})),le=(0,d.A)((()=>{h({})})),ce=(0,d.A)((e=>{E({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return n.Ay.createElement(f.A,{className:O.root,isOpen:H,onClose:l},n.Ay.createElement("div",{className:(0,o.A)(O.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;L(t<=150)}},n.Ay.createElement(y.A,{round:!0,size:"smaller",className:O.closeButton,color:"translucent",onClick:()=>l(),ariaLabel:k("Close")},n.Ay.createElement(P.A,{name:"close"})),n.Ay.createElement(K,{balance:N,className:O.modalBalance}),n.Ay.createElement("div",{className:(0,o.A)(O.header,T&&O.hiddenHeader)},n.Ay.createElement("h2",{className:O.starHeaderText},C("TelegramStars"))),n.Ay.createElement("div",{className:O.section},n.Ay.createElement("img",{className:O.logo,src:S,alt:"",draggable:!1}),n.Ay.createElement("img",{className:O.logoBackground,src:v,alt:"",draggable:!1}),n.Ay.createElement("h2",{className:O.headerText},Q?C("StarsNeededTitle",q):C("TelegramStars")),n.Ay.createElement("div",{className:O.description},(0,c.A)(ae||C("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!F&&n.Ay.createElement(y.A,{className:O.starButton,onClick:J},C("Star.List.BuyMoreStars")),a&&!F&&se&&n.Ay.createElement(y.A,{className:(0,o.A)(O.starButton,"settings-main-menu-star"),color:"translucent",onClick:le},n.Ay.createElement(x.A,{className:"icon",type:"gold",size:"big"}),C("TelegramStarsGift")),F&&t?.topupOptions&&n.Ay.createElement(g.A,{starsNeeded:Q,options:t.topupOptions,onClick:ce})),F&&n.Ay.createElement("div",{className:O.tos},re),ne&&Boolean(I?.list.length)&&n.Ay.createElement("div",{className:O.section},n.Ay.createElement("h3",{className:O.sectionTitle},C("StarMySubscriptions")),n.Ay.createElement("div",{className:O.subscriptions},I?.list.map((e=>n.Ay.createElement(U,{key:e.id,subscription:e}))),I?.nextOffset&&n.Ay.createElement(y.A,{isText:!0,disabled:I.isLoading,size:"smaller",noForcedUpperCase:!0,className:O.loadMore,onClick:oe},n.Ay.createElement(P.A,{name:"down",className:O.loadMoreIcon}),C("StarMySubscriptionsExpand")))),ne&&n.Ay.createElement("div",{className:O.container},n.Ay.createElement("div",{className:O.section},n.Ay.createElement(R.Ay,{name:k.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:z,renderCount:ee.length,shouldRestoreHeight:!0,className:O.transition},n.Ay.createElement(w.A,{onLoadMore:ie,items:b?.[$[z]]?.transactions,scrollContainerClosest:`.${O.main}`,itemSelector:`.${te}`,className:O.transactions,noFastList:!0},b?.[$[z]]?.transactions.map((e=>n.Ay.createElement(Z,{key:`${e.id}-${e.isRefund}`,transaction:e,className:te})))))),n.Ay.createElement(M.A,{className:O.tabs,tabClassName:O.tab,activeTab:z,tabs:ee,onSwitchTab:D}))))})));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(10187);const le=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a=t?.form?.botId?(0,i.mBe)(e,t.form.botId):void 0,n="message"===t?.inputInvoice?.type?t.inputInvoice:void 0,s=n?(0,i.O5q)(e,n.chatId,n.messageId):void 0,r=n?(0,i.hds)(e,n.chatId):void 0,o=s?.content.paidMedia;return{bot:a,starsBalanceState:e.stars,paidMediaMessage:o?s:void 0,paidMediaChat:o?r:void 0}}))((({modal:e,bot:t,starsBalanceState:a,paidMediaMessage:i,paidMediaChat:l})=>{const{closeStarsPaymentModal:m,openStarsBalanceModal:g,sendStarPaymentForm:h}=(0,s.ko)(),[S,E,N]=(0,B.A)(),b=Boolean(e?.inputInvoice&&a),I=(0,re.A)(e),C=e||I,{form:k,subscriptionInfo:T}=C||{},P=k?.invoice?.totalAmount||T?.subscriptionPricing?.amount,w=Boolean(k?.invoice.subscriptionPeriod),M=!T?.subscriptionPricing,R=k?.photo,L=(0,u.A)(),z=(0,G.A)();(0,n.vJ)((()=>{b||N()}),[b]);const F=(0,n.Kr)((()=>{if(!C?.inputInvoice)return"";const e=(0,r.YgS)(t),a=L("Stars.Intro.PurchasedText.Stars",P);if(i){const e=i.content.paidMedia.extendedMedia,t=e.every((e=>!e.duration)),n=e.every((e=>!!e.duration)),s=L(t?"Stars.Transfer.Photos":n?"Stars.Transfer.Videos":"Media",e.length),o=(0,r.JsG)(L,l);return L("Stars.Transfer.UnlockInfo",[s,o,a])}return T?z("StarsSubscribeText",{chat:T.title,amount:P},{withNodes:!0,withMarkdown:!0,pluralValue:P}):w?z("StarsSubscribeBotText",{name:k.title,amount:P,bot:e},{pluralValue:P}):L("Stars.Transfer.Info",[k.title,e,a])}),[C?.inputInvoice,t,L,P,i,T,w,k,l,z]),J=(0,n.Kr)((()=>{if(T)return z("StarsSubscribeInfo",{link:n.Ay.createElement(p.A,{url:z("StarsSubscribeInfoLink"),text:z("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[T,z]),U=(0,n.Kr)((()=>{if(T)return(0,r.nrT)(T)}),[T]),_=(0,d.A)((()=>{const t=a?.balance;void 0!==P&&void 0!==t&&(P>t.amount?g({originStarsPayment:e}):(h({}),E()))}));return n.Ay.createElement(f.A,{contentClassName:O.paymentContent,isOpen:b,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:m},n.Ay.createElement(K,{balance:a?.balance,className:O.modalBalance}),n.Ay.createElement("div",{className:O.paymentImages,dir:L.isRtl?"ltr":"rtl"},i?n.Ay.createElement(q,{media:i.content.paidMedia.extendedMedia}):U?n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{className:O.paymentPhoto,peer:U,size:"giant"}),n.Ay.createElement(x.A,{type:"gold",size:"adaptive",className:O.avatarStar})):n.Ay.createElement(ie.A,{peer:R?void 0:t,avatarWebPhoto:R,avatarSize:"giant",badgeIcon:"star",badgeText:(0,D.Sm)(P),badgeClassName:O.amountBadge,className:O.paymentPhoto}),n.Ay.createElement("img",{className:O.paymentImageBackground,src:v,alt:"",draggable:!1})),n.Ay.createElement("h2",{className:O.headerText},L(U?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),M&&n.Ay.createElement(oe.A,{className:O.botItem,peerId:k?.botId}),n.Ay.createElement("div",{className:O.description},(0,c.A)(F,["simple_markdown","emoji"])),n.Ay.createElement(y.A,{className:O.paymentButton,size:"smaller",onClick:_,isLoading:S},z(w?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:se(z,P,!0)},{withNodes:!0})),J&&n.Ay.createElement("div",{className:(0,o.A)(O.disclaimer,O.smallerText)},J))})));var ce=a(89925),me=a(85982),de=a(79577),ue=a(70046);const Ae="sso9uZM6",pe=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a="peer"===t?.transaction?.peer?.type&&t.transaction.peer.id,n=a?(0,i.PVB)(e,a):void 0,s=t?.transaction.stars,r=t?.transaction.isGift&&(0,i.WLj)(e,s?.amount),o=t?.transaction.starGift?.stickerId,l=o&&(0,i._ni)(e,o);return{peer:n,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:l||r}}))((({modal:e,peer:t,canPlayAnimatedEmojis:a,topSticker:i})=>{const{showNotification:l,openMediaViewer:c,closeStarsTransactionModal:m}=(0,s.ko)(),y=(0,G.A)(),f=(0,u.A)(),{transaction:g}=e||{},h=(0,d.A)((()=>{const e=g?.extendedMedia;e&&c({origin:ce.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),S=(0,n.Kr)((()=>{if(!g)return;const{giveawayPostId:e,photo:s,stars:c}=g,m=g.peer&&"peer"!==g.peer.type&&(0,L.Pc)(g.peer)||void 0,d="peer"===g.peer?.type?g.peer.id:void 0,u=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)),S=H(f,g),E=t&&g.messageId?(0,r.ytg)(t,void 0,g.messageId):void 0,N=t&&e&&(0,r.ytg)(t,void 0,e),b=g.extendedMedia,I=b?.length||0,C=b?.every((e=>!e.video)),k=b?.every((e=>!e.photo)),T=f(C?"Stars.Transfer.Photos":k?"Stars.Transfer.Videos":"Media",I),B=g.description||(b?T:void 0),G=!b&&!i,w=s?void 0:t||m,M=n.Ay.createElement("div",{className:"qBOIq6Jn"},b&&n.Ay.createElement(q,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:b,onClick:h}),!b&&i&&n.Ay.createElement(de.A,{key:g.id,sticker:i,play:a,noLoop:!0,nonInteractive:!0}),G&&n.Ay.createElement(A.A,{peer:w,webPhoto:s,size:"giant"}),!i&&n.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:v,alt:"",draggable:!1}),S&&n.Ay.createElement("h1",{className:"ZZAj3hj7"},S),n.Ay.createElement("p",{className:"NuWOY7ED"},B),n.Ay.createElement("p",{className:Ae},n.Ay.createElement("span",{className:(0,o.A)(Ae,V(c)?"xDyq9cc0":"jvBZSrpd")},(0,L.hk)(y,c)),n.Ay.createElement(x.A,{type:"gold",size:"middle"}))),R=[];let O;g.starRefCommision&&R.push([f("StarsTransaction.StarRefReason.Title"),f("StarsTransaction.StarRefReason.Program")]),O=V(c)||g.isMyGift?f("Stars.Transaction.To"):g.starRefCommision?f("StarsTransaction.StarRefReason.Miniapp"):f(d?"Star.Transaction.From":"Stars.Transaction.Via"),R.push([O,d?{chatId:d}:u||""]),E&&R.push([f("Stars.Transaction.Reaction.Post"),n.Ay.createElement(p.A,{url:E,text:E})]),N&&(R.push([f("BoostReason"),n.Ay.createElement(p.A,{url:N,text:f("Giveaway")})]),R.push([f("Gift"),f("Stars",g.stars,"i")])),g.id&&R.push([f("Stars.Transaction.Id"),n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,me.eM)(g.id),l({message:f("StarsTransactionIDCopied")})}},g.id),n.Ay.createElement(P.A,{className:"voCttFzS",name:"copy"}))]),R.push([f("Stars.Transaction.Date"),(0,z.L2)(1e3*g.date,f.code,!0)]);const K=f("lng_credits_box_out_about").split("{link}");return{header:M,tableData:R,footer:n.Ay.createElement("span",{className:"KgzPpgS6"},K[0],n.Ay.createElement(p.A,{url:f("StarsTOSLink"),text:f("lng_credits_summary_options_about_link")}),K[1])}}),[g,f,y,t,i,a]),E=(0,re.A)(S)||S;return n.Ay.createElement(ue.A,{isOpen:Boolean(g),className:"IzhfRIWu",header:E?.header,tableData:E?.tableData,footer:E?.footer,buttonText:f("OK"),onClose:m})})));var ye=a(70636);const fe="oBLHWBtJ",ge=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a=t?.subscription.peerId;return{peer:a?(0,i.PVB)(e,a):void 0}}))((({modal:e,peer:t})=>{const{closeStarsSubscriptionModal:a,fulfillStarsSubscription:r,changeStarsSubscription:i,checkChatInvite:l,loadStarStatus:c,openInvoice:m}=(0,s.ko)(),f=(0,u.A)(),g=(0,G.A)(),{subscription:h}=e||{},S=(0,n.Kr)((()=>{if(!h)return"hidden";if(h.canRefulfill)return"refulfill";const e=h.until>Date.now()/1e3;if(e&&!h.isCancelled)return"cancel";if(e&&h.isCancelled)return"renew";const t=h.chatInviteHash||h.invoiceSlug;return!e&&t?"restart":"ok"}),[h]),E=(0,d.A)((()=>{if(h){switch(S){case"refulfill":r({id:h.id});break;case"restart":h.chatInviteHash?l({hash:h.chatInviteHash}):h.invoiceSlug&&m({type:"slug",slug:h.invoiceSlug}),c();break;case"renew":i({id:h.id,isCancelled:!1});break;case"cancel":i({id:h.id,isCancelled:!0})}a()}})),b=(0,n.Kr)((()=>{if(!h||!t)return;const{pricing:e,until:a,isCancelled:s,canRefulfill:r,photo:i,title:l,hasBotCancelled:c}=h,m=(0,ye.mO)(t),d=n.Ay.createElement("div",{className:"E3R22yAI"},n.Ay.createElement("div",{className:"wuTMXDP9"},n.Ay.createElement(A.A,{peer:i?void 0:t,webPhoto:i,size:"giant"}),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||f("StarsSubscriptionTitle")),n.Ay.createElement("p",{className:"FI6rEJlK"},g("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[N.Cyx]:n.Ay.createElement(x.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),u=[];u.push([f(m?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),l&&u.push([f("StarsSubscriptionBotProduct"),l]);const b=a<Date.now()/1e3;u.push([f(b?"StarsSubscriptionUntilExpired":s?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,z.L2)(1e3*a,f.code,!0)]);const I=g("StarsTransactionTOS",{link:n.Ay.createElement(p.A,{url:g("StarsTransactionTOSLink"),text:g("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"},f(c?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),r&&n.Ay.createElement("p",{className:fe},f("StarsSubscriptionRefulfillInfo",(0,z.L2)(1e3*a,f.code,!0))),!s&&!r&&b&&n.Ay.createElement("p",{className:fe},f("StarsSubscriptionExpiredInfo",(0,z.L2)(1e3*a,f.code,!0))),!s&&!r&&!b&&n.Ay.createElement("p",{className:fe},f("StarsSubscriptionCancelInfo",(0,z.L2)(1e3*a,f.code,!0))),"hidden"!==S&&n.Ay.createElement(y.A,{size:"smaller",color:"cancel"===S?"danger":"primary",isText:"cancel"===S,onClick:E},f("cancel"===S?"StarsSubscriptionCancel":"refulfill"===S?"StarsSubscriptionRefulfill":"restart"===S?"StarsSubscriptionAgain":"renew"===S?"StarsSubscriptionRenew":"OK")))}}),[S,g,f,t,h]),I=(0,re.A)(b)||b;return n.Ay.createElement(ue.A,{isOpen:Boolean(h),className:"eR_RZfGB",header:I?.header,tableData:I?.tableData,footer:I?.footer,onClose:a})})));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)((({maxValue:e,defaultValue:t,className:a,onChange:s})=>{const r=(0,n.li)(null),i=(0,n.Kr)((()=>{const t=[];for(let a=0;a<ke.length;a++)if(ke[a]<e&&t.push(ke[a]),ke[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,n.J0)(0);(0,Ee.A)((()=>{c(Te(i,t))}));const m=(0,d.A)((()=>{const e=r.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)(r,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),s(Be(i,t))}));return n.Ay.createElement("div",{className:(0,o.A)(Ce.root,a),style:"--progress: "+l/i.length},n.Ay.createElement("div",{className:Ce.floatingBadgeWrapper},n.Ay.createElement("div",{className:Ce.floatingBadge,ref:r},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(i,l))})),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:i.length,defaultValue:Te(i,t),step:"any",onChange:u}))})),Pe={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},xe=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a=t&&(0,i.hds)(e,t.chatId),n=t&&(0,i.O5q)(e,t.chatId,t.messageId),s=e.stars?.balance;return{chat:a,message:n,starBalance:s,maxAmount:e.appConfig?.paidReactionMaxAmount||2500,defaultPrivacy:e.settings.paidReactionPrivacy}}))((({modal:e,chat:t,message:a,maxAmount:o,starBalance:l,defaultPrivacy:m})=>{const{closePaidReactionModal:A,addLocalPaidReaction:g}=(0,s.ko)(),[h,S]=(0,n.J0)(50),[v,E,b]=(0,B.A)(),[I,C]=(0,n.J0)(!0),k=(0,u.A)(),T=(0,G.A)(),x=(0,d.A)((e=>{C(e.target.checked)})),w=(0,d.A)((e=>{S(e),E()}));(0,n.vJ)((()=>{e||b()}),[e]),(0,n.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMe));C(e?!e.isAnonymous:m||!0)}),[m,a?.reactions?.topReactors]);const M=(0,d.A)((()=>{e&&(g({chatId:e.chatId,messageId:e.messageId,count:h,isPrivate:!I}),A())})),R=(0,n.Kr)((()=>{const e=(0,s.mS)(),t=a?.reactions?.topReactors;if(!t)return;const n=[];let r=!1;if(t.forEach((t=>{const a=t.peerId?(0,i.mBe)(e,t.peerId):void 0;(a||t.isAnonymous||t.isMe)&&(t.isMe&&(r=!0),n.push({amount:t.count,localAmount:t.isMe&&v?h:0,isMe:t.isMe,isAnonymous:t.isAnonymous,user:a}))})),!r&&v){const t=(0,i.mBe)(e,e.currentUserId);n.push({amount:0,localAmount:h,isMe:!0,user:t})}return n.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),n.slice(0,3)}),[v,a?.reactions?.topReactors,h]),L=t&&(0,r.JsG)(k,t);return n.Ay.createElement(f.A,{isOpen:Boolean(e),onClose:A,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:"RdhRpsCn"},n.Ay.createElement(K,{balance:l,className:"Q3560fzx"}),n.Ay.createElement(Ge,{className:"xePPMXOI",defaultValue:50,maxValue:o,onChange:w}),n.Ay.createElement("h3",{className:"yzbjj73U"},k("StarsReactionTitle")),n.Ay.createElement("div",{className:"BlpfdOtK"},(0,c.A)(k("StarsReactionText",L),["simple_markdown","emoji"])),n.Ay.createElement(Se.A,null,R&&n.Ay.createElement("div",{className:"bnou4CpV"},k("StarsReactionTopSenders"))),R&&n.Ay.createElement("div",{className:"QludQDKR"},R.map((e=>{const t=(0,D.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMe&&!I?Pe:e.user,s="isCustomPeer"in a?k(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:I,onChange:x,label:k("StarsReactionShowMeInTopSenders")}),n.Ay.createElement(y.A,{size:"smaller",onClick:M},T("SendPaidReaction",{amount:h},{withNodes:!0,specialReplacement:{[N.Cyx]:n.Ay.createElement(P.A,{className:"NJJFuym9",name:"star"})}})),n.Ay.createElement("p",{className:"KRvkHeo1"},T("StarsReactionTerms",{link:n.Ay.createElement(p.A,{text:T("StarsReactionLinkText"),url:T("StarsReactionLink")})},{withNodes:!0})))})));var we=a(20333),Me=a(75373),Re=a(22720),Le=a(63152),Oe=a(94079);const Ke=(0,n.ph)((0,s.EK)(((e,{userId:t})=>{const a=(0,i.SJA)(e),{patternColor:n}=e.settings.themes[a]||{},s=(0,i.mBe)(e,t),r=(0,i.nTw)(e);return{user:s,patternColor:n,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:r.isPaymentFormLoading}}))((function({gift:e,userId:t,user:a,captionLimit:i,patternColor:c,currentUserId:m,isPaymentFormLoading:u}){const{sendStarGift:A,openInvoice:p}=(0,s.ko)(),f=(0,G.A)(),[g,h]=(0,n.J0)(""),[S,v]=(0,n.J0)(!1),E="id"in e,b=(0,n.Kr)((()=>E?{id:-1,chatId:m,isOutgoing:!1,senderId:m,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[t],mediaType:"action",text:"ActionGiftInbound",type:"starGift",currency:N.OUy,amount:e.stars,starGift:{message:g?.length?{text:g}:void 0,isNameHidden:S,starsToConvert:e.starsToConvert,isSaved:!1,isConverted:!1,gift:e},translationValues:["%action_origin%","%gift_payment_amount%"]}}}:{id:-1,chatId:"0",isOutgoing:!0,senderId:m,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[t],mediaType:"action",text:"ActionGiftInbound",type:"giftPremium",amount:e.amount,currency:e.currency,months:e.months,message:{text:g},translationValues:["%action_origin%","%gift_payment_amount%"]}}}),[m,e,g,E,S,t]),I=(0,d.A)((e=>{h(e.target.value)})),C=(0,d.A)((()=>{v(!S)})),k=(0,d.A)((()=>{E?A({userId:t,shouldHideName:S,gift:e,message:g?{text:g}:void 0}):p({type:"giftcode",userIds:[t],currency:e.currency,amount:e.amount,option:e,message:g?{text:g}: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: ${c}`},n.Ay.createElement(Me.A,{key:E?e.id:e.months,message:b})),function(){const e=i?i-g.length:void 0;return n.Ay.createElement("div",{className:"Y68CEIKn"},n.Ay.createElement(Oe.A,{className:"o5r2IPoA",onChange:I,value:g,label:f("GiftMessagePlaceholder"),maxLength:i,maxLengthIndicator:e&&e<50?e.toString():void 0}),E&&n.Ay.createElement(Re.A,{className:"zZUpGRSI",narrow:!0,ripple:!0,onClick:C},n.Ay.createElement("span",null,f("GiftHideMyName")),n.Ay.createElement(Le.A,{checked:S,onChange:C,label:f("GiftHideMyName")})))}(),function(){const t=(0,r.YgS)(a),s=E?se(f,e.stars,!0):(0,l.v)(e.amount,e.currency);return n.Ay.createElement("div",{className:"jxWZSvet"},E&&n.Ay.createElement("div",{className:"nTPAv1ci"},f("GiftHideNameDescription",{profile:t,receiver:t})),n.Ay.createElement("div",{className:"ATowWJ60"}),E&&e.availabilityRemains&&n.Ay.createElement(we.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:f("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:f("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),n.Ay.createElement(y.A,{className:"IDuhjrne",onClick:k,isLoading:u},f("GiftSend",{amount:s},{withNodes:!0})))}())})));var ze=a(87049);const De="G1mBmzxs",Fe="a8no5WH0",Je=(0,n.ph)((0,s.EK)(((e,{option:t})=>({sticker:(0,i.t0O)(e,t.months),canPlayAnimatedEmojis:(0,i.BWX)(e)})))((function({sticker:e,canPlayAnimatedEmojis:t,baseMonthAmount:a,option:s,onClick:r}){const{months:i,amount:o,currency:c}=s,m=(0,G.A)(),u=(0,d.A)((()=>{r(s)})),A=Math.floor(o/i),p=a&&a>A?Math.ceil(100-A/(a/100)):void 0;return n.Ay.createElement("div",{className:De,tabIndex:0,role:"button",onClick:u},n.Ay.createElement(de.A,{sticker:e,play:t,noLoop:!0,nonInteractive:!0,size:86}),function(){const e=12===i?m("Years",{count:1},{pluralValue:1}):m("Months",{count:i},{pluralValue:i});return n.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),n.Ay.createElement("div",{className:"q4_ydkAx"},m("PremiumGiftDescription")),n.Ay.createElement(y.A,{className:Fe,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(o,c)),Boolean(p)&&n.Ay.createElement(ze.A,{color:"red",text:m("GiftDiscount",{percent:p})}))}))),Ue=(0,n.ph)((0,s.EK)(((e,{gift:t})=>({sticker:e.stickers.starGifts.stickers[t.stickerId]})))((function({sticker:e,gift:t,onClick:a}){const{openGiftInfoModal:r}=(0,s.ko)(),i=(0,G.A)(),{stars:l,isLimited:c,isSoldOut:m}=t,u=(0,d.A)((()=>{m?r({gift:t}):a(t)}));if(e)return n.Ay.createElement("div",{className:(0,o.A)(De,"f5ArEO1S"),tabIndex:0,role:"button",onClick:u},n.Ay.createElement(de.A,{sticker:e,noLoop:!0,nonInteractive:!0,size:90}),n.Ay.createElement(y.A,{className:Fe,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"},l)),c&&!m&&n.Ay.createElement(ze.A,{color:"blue",text:i("GiftLimited")}),m&&n.Ay.createElement(ze.A,{color:"red",text:i("GiftSoldOut")}))})));var _e=a(36838);const He=(0,n.ph)((0,s.EK)((e=>{const{starGiftCategoriesByName:t}=e;return{starGiftCategoriesByName:t}}))((({starGiftCategoriesByName:e,onCategoryChanged:t})=>{const a=(0,n.li)(null),s=(0,G.A)(),r=(0,n.Kr)((()=>Object.keys(e).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[e]),[i,l]=(0,n.J0)("all");function c(e){return n.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",i===e&&"B2lEJk1v"),onClick:()=>function(e){l(e),t(e)}(e)},"all"!==e&&"limited"!==e&&n.Ay.createElement(x.A,{className:"Pb7AU805",type:"gold",size:"middle"}),function(e){return"all"===e?s("AllGiftsCategory"):"limited"===e?s("LimitedGiftsCategory"):e}(e))}return(0,_e.A)(a,void 0,!0),n.Ay.createElement("div",{ref:a,className:(0,o.A)("cUjwvN00","no-scrollbar")},c("all"),c("limited"),r.map(c))}))),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"},We=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const{starGiftsById:a,starGiftCategoriesByName:n,stars:s}=e,r=t?.forUserId?(0,i.mBe)(e,t.forUserId):void 0;return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a,starGiftCategoriesByName:n,starBalance:s?.balance,user:r}}))((({modal:e,starGiftsById:t,starGiftCategoriesByName:a,starBalance:i,user:l})=>{const{closeGiftModal:c,requestConfetti:g}=(0,s.ko)(),h=(0,n.li)(null),S=(0,n.li)(null),E=(0,n.li)(null),N=Boolean(e),b=(0,m.A)(e),[I,C]=(0,n.J0)(),[k,T]=(0,n.J0)(!0),[B,P]=(0,n.J0)(!1),[x,w]=(0,n.J0)("all"),M=(0,u.A)(),L=(0,G.A)(),O=(0,n.Kr)((()=>b?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[b]),z=(0,n.Kr)((()=>O?.reduce(((e,t)=>e.amount<t.amount?e:t))),[O]),D=(0,d.A)((()=>{const e=h.current;if(e&&N){const{top:t,left:a,width:n,height:s}=e.querySelector(".modal-content").getBoundingClientRect();g({top:t,left:a,width:n,height:s,withStars:!0})}}));(0,n.vJ)((()=>{b?.isCompleted&&D()}),[b]),(0,n.vJ)((()=>{N||(T(!0),C(void 0))}),[N]);const F=(0,d.A)((e=>{if(I)return;const{scrollTop:t}=e.currentTarget;if(T(t<=150),S.current&&E.current){const{top:e}=E.current.getBoundingClientRect(),{top:t}=S.current.getBoundingClientRect();P(e-t<=0)}})),J=L("GiftPremiumDescription",{user:(0,r.YgS)(l),link:n.Ay.createElement(p.A,{text:L("GiftPremiumDescriptionLinkCaption"),url:L("GiftPremiumDescriptionLink")})},{withNodes:!0}),U=L("StarGiftDescription",{user:(0,r.YgS)(l)},{withNodes:!0}),_=(0,d.A)((e=>{C(e),P("id"in e),T(!1)})),H=(0,d.A)((e=>{w(e)})),V=(0,d.A)((()=>{I?C(void 0):c()})),W=Boolean(I),j=(0,o.A)("animated-close-icon",W&&"state-back");return n.Ay.createElement(f.A,{dialogRef:h,onClose:c,isOpen:N,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:V,ariaLabel:M(W?"Common.Back":"Common.Close")},n.Ay.createElement("div",{className:j})),n.Ay.createElement(K,{className:Ve.balance,balance:i}),n.Ay.createElement("div",{className:(0,o.A)(Ve.header,k&&Ve.hiddenHeader)},n.Ay.createElement(R.Ay,{name:"slideVerticalFade",activeKey:Number(B),slideClassName:Ve.headerSlide},n.Ay.createElement("h2",{className:Ve.commonHeaderText},L(B?"StarsGiftHeader":"GiftPremiumHeader")))),n.Ay.createElement(R.Ay,{ref:S,className:Ve.transition,name:"pushSlide",activeKey:I?1:0},!I&&n.Ay.createElement("div",{className:(0,o.A)(Ve.main,"custom-scroll"),onScroll:F},n.Ay.createElement("div",{className:Ve.avatars},n.Ay.createElement(A.A,{size:100,peer:l}),n.Ay.createElement("img",{className:Ve.logoBackground,src:v,alt:"",draggable:!1})),n.Ay.createElement("h2",{className:(0,o.A)(Ve.headerText,Ve.center)},L("GiftPremiumHeader")),n.Ay.createElement("p",{className:(0,o.A)(Ve.description,Ve.center)},J),n.Ay.createElement("div",{className:Ve.premiumGiftsGallery},O?.map((e=>n.Ay.createElement(Je,{option:e,baseMonthAmount:z?Math.floor(z.amount/z.months):void 0,onClick:_})))),n.Ay.createElement("h2",{ref:E,className:(0,o.A)(Ve.headerText,Ve.center)},L("StarsGiftHeader")),n.Ay.createElement("p",{className:(0,o.A)(Ve.description,Ve.starGiftsDescription,Ve.center)},U),n.Ay.createElement(He,{onCategoryChanged:H}),n.Ay.createElement(R.Ay,{name:"zoomFade",activeKey:(Y=x,"all"===Y?-1:"limited"===Y?0:Y),className:Ve.starGiftsTransition},n.Ay.createElement("div",{className:Ve.starGiftsContainer},t&&a[x].map((e=>{const a=t[e];return n.Ay.createElement(Ue,{gift:a,onClick:_})}))))),I&&b?.forUserId&&n.Ay.createElement(Ke,{gift:I,userId:b.forUserId})));var Y})));const je=(0,n.ph)((0,s.EK)((e=>{const{currentUserId:t}=e;return{currentUserId:t,userIds:e.contactList?.userIds,userSelectionLimit:e.appConfig?.giveawayAddPeersMax}}))((({modal:e,currentUserId:t,userIds:a})=>{const{closeGiftRecipientPicker:i,openGiftModal:o}=(0,s.ko)(),l=(0,u.A)(),c=e,[m,A]=(0,n.J0)(""),p=(0,n.Kr)((()=>{const e=(0,s.mS)().users.byId,n=a?(0,r.Z$K)(a,e,m):[];return(0,I.A)((0,b.Am)(n).filter((a=>{const n=e[a];return!n||!(0,r.tvf)(n)&&a!==t})))}),[t,m,a]),y=(0,d.A)((e=>{o({forUserId:e}),i()}));return n.Ay.createElement(k.A,{className:"W3JMs1YE",isOpen:c,onClose:i,title:l("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},n.Ay.createElement(C.A,{className:"wOipz1Y_",itemIds:p,filterValue:m,filterPlaceholder:l("Search"),onSelectedIdChange:y,onFilterChange:A,isSearchable:!0,withDefaultPadding:!0,withStatus:!0}))})));var Ye=a(80140),Xe=a(18501),qe=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,{modal:t})=>{const a=t?.gift,n=a&&"gift"in a,s=n?a.gift:a,r=s?.stickerId,o=r?(0,i._ni)(e,r):void 0,l=n&&a.fromId;return{sticker:o,userFrom:l?(0,i.mBe)(e,l):void 0,targetUser:t?.userId?(0,i.mBe)(e,t.userId):void 0,currentUserId:e.currentUserId,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod}}))((({modal:e,sticker:t,userFrom:a,targetUser:i,currentUserId:l,starGiftMaxConvertPeriod:c})=>{const{closeGiftInfoModal:p,changeGiftVisilibity:f,convertGiftToStars:g,openChatWithInfo:h}=(0,s.ko)(),[S,v,E]=(0,B.A)(),N=(0,G.A)(),b=(0,u.A)(),I=Boolean(e),C=(0,m.A)(e),{gift:k}=C||{},T=k&&"gift"in k,P=T?k:void 0,w=Boolean(P?.fromId&&P.messageId),M=P?.fromId===l,R=P&&c&&P.date+c-(0,Ye.Fm)()||0,L=Math.ceil(R/60/60/24),O=(0,d.A)((()=>{p()})),K=(0,d.A)((()=>{const{fromId:e,messageId:t,isUnsaved:a}=P;f({userId:e,messageId:t,shouldUnsave:!a}),O()})),F=(0,d.A)((()=>{const{fromId:e,messageId:t}=P;g({userId:e,messageId:t}),E(),O()})),J=(0,d.A)((()=>{h({id:l,profileTab:"gifts"}),O()})),U=(0,n.Kr)((()=>{if(!k)return;const{fromId:e,isNameHidden:a,message:s,starsToConvert:l,isUnsaved:c,isConverted:m}=P||{},d=T?k.gift:k,u=a&&i,p=P?!w&&!M||!l||R<0?void 0:m?w?N("GiftInfoDescriptionConverted",{amount:(0,D.Sm)(l)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):N("GiftInfoDescriptionOutConverted",{amount:(0,D.Sm)(l),user:(0,r.YgS)(i)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):w?N("GiftInfoDescription",{amount:l},{withNodes:!0,withMarkdown:!0,pluralValue:l}):N("GiftInfoDescriptionOut",{amount:l,user:(0,r.YgS)(i)},{withNodes:!0,withMarkdown:!0,pluralValue:l}):N("GiftInfoSoldOutDescription"),f=n.Ay.createElement("div",{className:$e.header},n.Ay.createElement(de.A,{sticker:t,noLoop:!0,nonInteractive:!0,size:120}),n.Ay.createElement("h1",{className:$e.title},!P&&N("GiftInfoSoldOutTitle"),P&&N(w?"GiftInfoReceived":"GiftInfoTitle")),P&&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,!P&&$e.soldOut)},p)),g=[];return(e||a)&&g.push([N("GiftInfoFrom"),e?{chatId:e}:n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{size:"small",peer:_.I5}),n.Ay.createElement("span",{className:$e.unknown},b(_.I5.titleKey)))]),P?.date&&g.push([N("GiftInfoDate"),(0,z.L2)(1e3*P.date,N.code,!0)]),d.firstSaleDate&&g.push([N("GiftInfoFirstSale"),(0,z.L2)(1e3*d.firstSaleDate,N.code,!0)]),d.lastSaleDate&&g.push([N("GiftInfoLastSale"),(0,z.L2)(1e3*d.lastSaleDate,N.code,!0)]),g.push([N("GiftInfoValue"),n.Ay.createElement("div",{className:$e.giftValue},se(N,d.stars),w&&R>0&&Boolean(l)&&n.Ay.createElement(qe.A,{onClick:v},N("GiftInfoConvert",{amount:l},{pluralValue:l})))]),d.availabilityTotal&&g.push([N("GiftInfoAvailability"),N("GiftInfoAvailabilityValue",{count:d.availabilityRemains||0,total:d.availabilityTotal},{pluralValue:d.availabilityRemains||0})]),s&&g.push([void 0,(0,Xe.f)(s)]),{header:f,tableData:g,footer:n.Ay.createElement("div",{className:$e.footer},w&&n.Ay.createElement("div",{className:$e.footerDescription},n.Ay.createElement("div",null,c?N("GiftInfoHidden"):N("GiftInfoSaved",{link:n.Ay.createElement(Ze.A,{isPrimary:!0,onClick:J},N("GiftInfoSavedView"))},{withNodes:!0})),u&&n.Ay.createElement("div",null,N("GiftInfoSenderHidden"))),!w&&n.Ay.createElement(y.A,{size:"smaller",onClick:O},N("OK")),w&&n.Ay.createElement(y.A,{size:"smaller",onClick:K},N(c?"GiftInfoMakeVisible":"GiftInfoMakeInvisible")))}}),[k,P,T,i,t,N,w,R,M,b]);return n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(ue.A,{isOpen:I,header:U?.header,tableData:U?.tableData,footer:U?.footer,onClose:O}),P&&n.Ay.createElement(Qe.A,{isOpen:S,onClose:E,confirmHandler:F,title:N("GiftInfoConvertTitle")},n.Ay.createElement("div",null,N("GiftInfoConvertDescription1",{amount:ne(N,P.starsToConvert),user:(0,r.YgS)(a)},{withNodes:!0,withMarkdown:!0})),R>0&&n.Ay.createElement("div",null,N("GiftInfoConvertDescriptionPeriod",{count:L},{withNodes:!0,withMarkdown:!0,pluralValue:L})),n.Ay.createElement("div",null,N("GiftInfoConvertDescription2"))))})))},81949:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(84051),s=a(87357);const r=({children:e,className:t,onClick:a})=>n.Ay.createElement("div",{className:(0,s.A)("hJUqHi4B",t),onClick:a},e)},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)((({peer:e,avatarWebPhoto:t,avatarSize:a,text:l,badgeText:c,badgeIcon:m,className:d,badgeClassName:u,badgeIconClassName:A,textClassName:p,onClick:y})=>n.Ay.createElement("div",{className:(0,s.A)(o.root,y&&o.clickable,d),onClick:y},n.Ay.createElement("div",{className:o.top},n.Ay.createElement(r.A,{size:a,peer:e,webPhoto:t}),c&&n.Ay.createElement("div",{className:(0,s.A)(o.badge,u)},m&&n.Ay.createElement(i.A,{name:m,className:A}),c)),l&&n.Ay.createElement("p",{className:(0,s.A)(o.text,p)},l))))},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)((({confirmButtonText:e,isConfirmDisabled:t,shouldAdaptToSearch:a,withFixedHeight:c,onConfirm:m,withPremiumGradient:d,...u})=>{const A=(0,r.A)(),p=Boolean(e||m);return n.Ay.createElement(o.A,l({},u,{isSlim:!0,className:(0,s.A)(a&&"WGSZ8u75",c&&"CrEsDylb",u.className),contentClassName:(0,s.A)("FuFYE0AA",u.contentClassName),headerClassName:(0,s.A)("iEptOmIp",u.headerClassName)}),u.children,p&&n.Ay.createElement("div",{className:"HqeDTaSr"},n.Ay.createElement(i.A,{withPremiumGradient:d,onClick:m||u.onClose,color:"primary",size:"smaller",disabled:t},e||A("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(10187),c=a(64493),m=a(8410);const d="Cnh5ENvm",u=(0,n.ph)((({isOpen:e,title:t,tableData:a,headerAvatarPeer:u,header:A,footer:p,buttonText:y,className:f,onClose:g,onButtonClick:h})=>{const{openChat:S}=(0,s.ko)(),v=(0,i.A)((e=>{S({id:e}),g()}));return n.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,isSlim:!0,title:t,className:f,contentClassName:"KYHkJ9Qf",onClose:g},u&&n.Ay.createElement(o.A,{peer:u,size:"jumbo",className:"SHQbPR5Y"}),A,n.Ay.createElement("div",{className:"DFRB0Ad4"},a?.map((([e,t])=>n.Ay.createElement(n.Ay.Fragment,null,e&&n.Ay.createElement("div",{className:(0,r.A)(d,"AwnUe4Qk")},e),n.Ay.createElement("div",{className:(0,r.A)(d,"JGH6P9Az",!e&&"UssCZwgy")},"object"==typeof t&&"chatId"in t?n.Ay.createElement(l.A,{peerId:t.chatId,className:"aS9U4hiQ",forceShowSelf:!0,fluid:!0,clickArg:t.chatId,onClick:v}):t))))),p,y&&n.Ay.createElement(c.A,{className:p?void 0:"cSamlkt9",size:"smaller",onClick:h||g},y))}))},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)((({isActive:e,className:t,options:a,selectedStarOption:y,selectedStarCount:f,starsNeeded:g,onClick:h})=>{const S=(0,m.A)(),v=(0,c.A)(),[E,N,b]=(0,l.A)();(0,n.vJ)((()=>{e||b()}),[e]);const[I,C]=(0,n.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=g&&e.stars<g,n=[];let s=0,r=!1;return a.forEach(((e,i)=>{e.isExtended||s++,g&&!t&&e.stars<g||(E||!e.isExtended?n.push({option:e,starsCount:Math.min(s,6),isWide:i===a.length-1}):r=!0)})),[n,r]}),[E,a,g]);return n.Ay.createElement("div",{className:(0,s.A)(p.options,t)},I?.map((({option:e,starsCount:t,isWide:a})=>{const l=I?.length,c=l%2==0,m=e===y;let d;if(e&&"winners"in e){const t=e.winners.find((e=>e.users===f))||e.winners.reduce(((e,t)=>t.users>e.users?t:e),e.winners[0]);d=t?.perUserStars}return n.Ay.createElement("div",{className:(0,s.A)(p.option,!c&&a&&p.wideOption,m&&p.active),key:e.stars,onClick:()=>h?.(e)},n.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(e.stars),n.Ay.createElement("div",{className:p.stackedStars,dir:v.isRtl?"ltr":"rtl"},Array.from({length:t}).map((()=>n.Ay.createElement(u.A,{className:p.stackedStar,type:"gold",size:"big"}))))),n.Ay.createElement("div",{className:p.optionBottom},(0,r.v)(e.amount,e.currency,S.code)),(m||y&&"winners"in y)&&d&&n.Ay.createElement("div",{className:p.optionBottom},n.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(S("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!E&&C&&n.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:N},S("Stars.Purchase.ShowMore"),n.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))}}]);
|
|
//# sourceMappingURL=6930.f28cf9a04acfd3afcc63.js.map
|