2 lines
70 KiB
JavaScript
2 lines
70 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{28014:(e,t,a)=>{a.r(t),a.d(t,{GiftInfoModal:()=>At,GiftModal:()=>nt,GiftRecipientPicker:()=>st,GiftStatusInfoModal:()=>Nt,GiftTransferModal:()=>qt,GiftUpgradeModal:()=>Et,GiftWithdrawModal:()=>Tt,PaidReactionModal:()=>Oe,StarPaymentModal:()=>ue,StarsBalanceModal:()=>ie,StarsGiftModal:()=>N,StarsGiftingPickerModal:()=>T,StarsSubscriptionModal:()=>Ne,StarsTransactionInfoModal:()=>Se});var r=a(84051),n=a(13439),s=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(18276),f=a(56440),y=a(64493),g=a(8410),h=a(1526);const E={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",N=(0,r.ph)((0,n.EK)(((e,{modal:t})=>({user:t?.forUserId?(0,i.mBe)((0,n.mS)(),t.forUserId):void 0})))((({modal:e,user:t})=>{const{closeStarsGiftModal:a,openInvoice:i,requestConfetti:N}=(0,n.ko)(),b=(0,r.li)(null),C=Boolean(e?.isOpen),k=(0,m.A)(e),I=(0,u.A)(),[G,w]=(0,r.J0)(),[T,P]=(0,r.J0)(!0);(0,r.vJ)((()=>{C||P(!0)}),[C]);const B=(0,d.A)((()=>{const e=b.current;if(e&&C){const{top:t,left:a,width:r,height:n}=e.querySelector(".modal-content").getBoundingClientRect();N({top:t,left:a,width:r,height:n,withStars:!0})}}));(0,r.vJ)((()=>{k?.isCompleted&&B()}),[k,B]);const M=(0,d.A)((e=>{k&&(w(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}))})),x=(0,d.A)((()=>{a()})),U=(0,r.Kr)((()=>{const e=I("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:I("StarsTOSLink"),text:I("lng_credits_summary_options_about_link")}),e[1]]}),[I]);return r.Ay.createElement(g.A,{className:(0,o.A)(E.modalDialog),contentClassName:E.content,dialogRef:b,isSlim:!0,onClose:x,isOpen:C},r.Ay.createElement("div",{className:(0,o.A)(E.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;P(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:E.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:I("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement("div",{className:(0,o.A)(E.header,T&&E.hiddenHeader)},r.Ay.createElement("h2",{className:E.starHeaderText},I(t?"GiftStarsTitle":"Star.List.GetStars"))),r.Ay.createElement("div",{className:E.headerInfo},t?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:100,peer:t,className:E.avatar}),r.Ay.createElement("img",{className:E.logoBackground,src:v,alt:"",draggable:!1})):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("img",{className:E.logo,src:S,alt:"",draggable:!1}),r.Ay.createElement("img",{className:E.logoBackground,src:v,alt:"",draggable:!1}))),r.Ay.createElement("h2",{className:(0,o.A)(E.headerText,E.center)},k?.isCompleted?t?(0,c.A)(I("Notification.StarsGift.SentYou",(0,l.A)(G.amount,G.currency,I.code)),["simple_markdown"]):(0,c.A)(I("StarsAcquiredInfo",G?.stars),["simple_markdown"]):I(t?"GiftStarsTitle":"Star.List.GetStars")),r.Ay.createElement("p",{className:E.description},t?(0,c.A)(I("ActionGiftStarsSubtitle",(0,s.F9N)(I,t)),["simple_markdown"]):I("Stars.Purchase.GetStarsInfo")),r.Ay.createElement("div",{className:E.section},r.Ay.createElement(h.A,{options:k?.starsGiftOptions,onClick:M}),r.Ay.createElement("div",{className:E.secondaryInfo},U))))})));var b=a(31481),C=a(70636),k=a(87894),I=a(79582),G=a(54960),w=a(34642);const T=(0,r.ph)((0,n.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,n.ko)(),m=(0,u.A)(),[A,p]=(0,r.J0)(""),f=(0,r.Kr)((()=>{const e=(0,n.mS)().users.byId,r=(0,k.Am)([...o||[],...a||[],...i||[]]),l=(0,C.PU)({ids:r,query:A,type:"user"});return(0,I.A)(l.filter((a=>{const r=e[a];return!(!r||r.isSupport||(0,s.tvf)(r)||(0,s.PL2)(r)||a===t||a===b.zv8)})))}),[t,A,o,a,i]),y=(0,d.A)((e=>{e?.length&&(c({forUserId:e}),l())}));return r.Ay.createElement(w.A,{className:"s3k01dTm",isOpen:e,onClose:l,title:m("GiftStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,confirmButtonText:m("Continue"),onEnter:l},r.Ay.createElement(G.A,{className:"cuI2eDIY",itemIds:f,filterValue:A,filterPlaceholder:m("Search"),onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:y}))})));var P=a(37661),B=a(39351),M=a(46222),x=a(24680),U=a(41036),D=a(86046),O=a(9267);const R={root:"TtE8LQNJ",minimal:"nkV4JXHc",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,r.ph)((({balance:e,className:t})=>{const a=(0,B.A)();return r.Ay.createElement("div",{className:(0,o.A)(R.balance,t)},r.Ay.createElement("span",{className:R.smallerText},a("StarsBalance")),r.Ay.createElement("div",{className:R.balanceBottom},r.Ay.createElement(O.A,{type:"gold",size:"middle"}),void 0!==e?(0,D.ZF)(a,e):"…"))}));var F=a(17663),L=a(14242),z=a(63527);const J={root:"ZXnbeQxP",info:"zLaaDX3c",status:"HbF2qTB2",statusPricing:"AveGvpdV",amount:"_CBiOQcv",title:"k9ZIv5Pd",description:"FlRlxMx2",subtitle:"YN2J8dw6",statusPeriod:"MRrP7Oew",statusEnded:"pRHwfr8m",preview:"t6Syyhzd",subscriptionStar:"ftlbevPm"},q=(0,r.ph)((({subscription:e})=>{const{openStarsSubscriptionModal:t}=(0,n.ko)(),{peerId:a,pricing:o,until:l,isCancelled:m,title:p,photo:f}=e,y=(0,u.A)(),g=(0,z.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),h=(0,d.A)((()=>{t({subscription:e})}));if(!g)return;const E=l<Date.now()/1e3,S=(0,F.A)(1e3*l,y.code,!0,"long");return r.Ay.createElement("div",{className:J.root,onClick:h},r.Ay.createElement("div",{className:J.preview},r.Ay.createElement(A.A,{size:"medium",peer:g}),r.Ay.createElement(O.A,{className:J.subscriptionStar,type:"gold",size:"small"})),r.Ay.createElement("div",{className:J.info},r.Ay.createElement("h3",{className:J.title},(0,c.A)((0,s.F9N)(y,g)||"")),p&&r.Ay.createElement("p",{className:J.subtitle},f&&r.Ay.createElement(A.A,{webPhoto:f,size:"micro"}),(0,c.A)(p)),r.Ay.createElement("p",{className:J.description},y(E?"StarsSubscriptionExpired":m?"StarsSubscriptionExpires":"StarsSubscriptionRenews",S))),r.Ay.createElement("div",{className:J.status},m||E?r.Ay.createElement("div",{className:J.statusEnded},y(E?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:J.statusPricing},r.Ay.createElement(O.A,{className:J.star,type:"gold",size:"adaptive"}),r.Ay.createElement("span",{className:J.amount},(0,L.Sm)(o.amount))),r.Ay.createElement("div",{className:J.statusPeriod},y("StarsParticipantSubscriptionPerMonth")))))}));var H=a(58968),V=a(66833);function _(e,t){if(t.starRefCommision)return e("StarTransactionCommission",(0,L.l9)(t.starRefCommision));if(t.isGiftUpgrade)return e("Gift2TransactionUpgraded");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 j(t.stars)?e("Gift2TransactionSent"):e("Gift2ConvertedTitle");const a=t.peer&&"peer"!==t.peer.type&&(0,D.Pc)(t.peer)||void 0;return a?a.title||e(a.titleKey):t.title}function j(e){return e.amount?e.amount<0:e.nanos<0}var W=a(79577),Q=a(40558),X=a(62587),Y=a(27860);const Z={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function $({boughtMedia:e,index:t,className:a}){const n=e.video||e.photo,i=(0,s.VOI)(n,"pictogram"),l=(0,s.VDY)(n),c=(0,X.A)(i);return r.Ay.createElement("div",{className:(0,o.A)(Z.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},l&&r.Ay.createElement("img",{className:Z.blurry,src:l,alt:""}),c&&r.Ay.createElement("img",{className:Z.full,src:c,alt:""}))}const ee=(0,r.ph)((({media:e,className:t,isTransactionPreview:a,onClick:n})=>{const s=Math.min(e.length,a?2:3),i="mediaType"in e[0];return r.Ay.createElement("div",{className:(0,o.A)(Z.root,Z[`itemCount${s}`],a&&Z.preview,t),dir:"rtl",onClick:n},e.slice(0,s).reverse().map(((e,t,n)=>{const s=n.length-t-1;return"mediaType"in e?r.Ay.createElement(Y.A,{className:Z.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):r.Ay.createElement($,{className:(0,o.A)(a&&s>0&&Z.noOutline),boughtMedia:e,index:s})})),i&&r.Ay.createElement("div",{className:Z.count},r.Ay.createElement(p.A,{name:"stars-lock"}),e.length>1?e.length:""))})),te={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",uniqueGiftBackground:"eNvzMw2p",uniqueGift:"QsvgfDmw"},ae=(0,r.ph)((({transaction:e,className:t})=>{const{openStarsTransactionModal:a}=(0,n.ko)(),{date:l,stars:m,photo:p,peer:f,extendedMedia:y,subscriptionPeriod:g}=e,h=(0,B.A)(),E=(0,u.A)(),S="peer"===f.type?f.id:void 0,v=(0,z.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(S)),N="starGiftUnique"===e.starGift?.type?e.starGift:void 0,b=N&&(0,V.yQ)(N),C=(0,r.Kr)((()=>{let t,a,r,n=_(E,e);if("peer"===e.peer.type)t=v&&(0,s.F9N)(E,v),r=v||H.lw;else{const a=(0,D.Pc)(e.peer);n=a.title||E(a.titleKey),t=E(a.subtitleKey),r=a}return e.isGiftUpgrade&&"starGiftUnique"===e.starGift?.type&&(t=e.starGift.title),e.photo&&(r=void 0),e.isRefund&&(a=E("StarsRefunded")),e.hasFailed&&(a=E("StarsFailed")),e.isPending&&(a=E("StarsPending")),{title:n,description:t,avatarPeer:r,status:a}}),[E,v,e]),k=(0,r.Kr)((()=>{if(b){const{backdrop:e}=(0,V.uc)(N),t=[e.centerColor,e.edgeColor];return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(Q.A,{className:te.uniqueGiftBackground,backgroundColors:t}),r.Ay.createElement(W.A,{className:te.uniqueGift,sticker:b,size:36,play:!1}))}return y?r.Ay.createElement(ee,{media:y,isTransactionPreview:!0}):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"medium",webPhoto:p,peer:C.avatarPeer}),Boolean(g)&&r.Ay.createElement(O.A,{className:te.subscriptionStar,type:"gold",size:"small"}))}),[y,p,b,g,C.avatarPeer,N]),I=(0,d.A)((()=>{a({transaction:e})}));return r.Ay.createElement("div",{className:(0,o.A)(te.root,t),onClick:I},r.Ay.createElement("div",{className:te.preview},k),r.Ay.createElement("div",{className:te.info},r.Ay.createElement("h3",{className:te.title},C.title),C.description&&r.Ay.createElement("p",{className:te.description},(0,c.A)(C.description)),r.Ay.createElement("p",{className:te.date},(0,F.L2)(1e3*l,E.code,!0),C.status&&` — (${C.status})`)),r.Ay.createElement("div",{className:te.stars},r.Ay.createElement("span",{className:(0,o.A)(te.amount,j(m)?te.negative:te.positive)},(0,D.hk)(h,m)),r.Ay.createElement(O.A,{className:te.star,type:"gold",size:"adaptive"})))})),re=["all","inbound","outbound"],ne=["StarsTransactionsAll","StarsTransactionsIncoming","StarsTransactionsOutgoing"],se="StarsTransactionItem",ie=(0,r.ph)((0,n.EK)((e=>({shouldForceHeight:Boolean(e.stars?.history?.all?.transactions.length),starsBalanceState:e.stars,canBuyPremium:!(0,i.n_C)(e)})))((({modal:e,starsBalanceState:t,canBuyPremium:a,shouldForceHeight:l})=>{const{closeStarsBalanceModal:m,loadStarsTransactions:A,loadStarsSubscriptions:E,openStarsGiftingPickerModal:N,openInvoice:b}=(0,n.ko)(),{balance:C,history:k,subscriptions:I}=t||{},G=(0,u.A)(),w=(0,B.A)(),[T,D]=(0,r.J0)(!0),[O,F]=(0,r.J0)(0),[L,z,J]=(0,P.A)(),H=Boolean(e&&t),{originStarsPayment:V,originReaction:_,originGift:j,topup:W}=e||{},Q=V||_||j||W,X=V?.form?.invoice?.totalAmount||V?.subscriptionInfo?.subscriptionPricing?.amount||_?.amount||j?.gift.stars||W?.balanceNeeded,Y=X?X-(C?.amount||0):void 0,Z=(0,r.Kr)((()=>{const e=(0,n.mS)();if(_){const t=(0,i.hds)(e,_.chatId);if(!t)return;return G("StarsNeededTextReactions",(0,s.JsG)(G,t))}if(V){const t=V.form?.botId?(0,i.mBe)(e,V.form.botId):void 0;if(!t)return;return G("StarsNeededText",(0,s.YgS)(t))}if(j){const t=(0,i.mBe)(e,j.peerId);if(!t)return;return G("StarsNeededTextGift",(0,s.F9N)(w,t))}if("subs"===W?.purpose)return G("StarsNeededTextLink")}),[_,V,j,W?.purpose,w,G]),$=Boolean(k?.all?.transactions.length&&!Q),ee=!Q,te=(0,r.Kr)((()=>ne.map((e=>({title:w(e)})))),[w]);(0,r.vJ)((()=>{H||(D(!0),F(0),J())}),[H]),(0,r.vJ)((()=>{Q?z():J()}),[Q]);const ie=(0,r.Kr)((()=>{if(!H)return;const e=G("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:G("StarsTOSLink"),text:G("lng_credits_summary_options_about_link")}),e[1]]}),[H,G]),oe=(0,d.A)((()=>{A({type:re[O]})})),le=(0,d.A)((()=>{E()})),ce=(0,d.A)((()=>{N({})})),me=(0,d.A)((e=>{b({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return r.Ay.createElement(g.A,{className:(0,o.A)(R.root,!l&&R.minimal),isOpen:H,onClose:m},r.Ay.createElement("div",{className:(0,o.A)(R.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;D(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:R.closeButton,color:"translucent",onClick:()=>m(),ariaLabel:w("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement(K,{balance:C,className:R.modalBalance}),r.Ay.createElement("div",{className:(0,o.A)(R.header,T&&R.hiddenHeader)},r.Ay.createElement("h2",{className:R.starHeaderText},G("TelegramStars"))),r.Ay.createElement("div",{className:R.section},r.Ay.createElement("img",{className:R.logo,src:S,alt:"",draggable:!1}),r.Ay.createElement("img",{className:R.logoBackground,src:v,alt:"",draggable:!1}),r.Ay.createElement("h2",{className:R.headerText},Y?G("StarsNeededTitle",X):G("TelegramStars")),r.Ay.createElement("div",{className:R.description},(0,c.A)(Z||G("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!L&&r.Ay.createElement(y.A,{className:R.starButton,onClick:z},G("Star.List.BuyMoreStars")),a&&!L&&ee&&r.Ay.createElement(y.A,{isText:!0,noForcedUpperCase:!0,className:R.starButton,onClick:ce},G("TelegramStarsGift")),L&&t?.topupOptions&&r.Ay.createElement(h.A,{starsNeeded:Y,options:t.topupOptions,onClick:me})),L&&r.Ay.createElement("div",{className:R.tos},ie),$&&Boolean(I?.list.length)&&r.Ay.createElement("div",{className:R.section},r.Ay.createElement("h3",{className:R.sectionTitle},G("StarMySubscriptions")),r.Ay.createElement("div",{className:R.subscriptions},I?.list.map((e=>r.Ay.createElement(q,{key:e.id,subscription:e}))),I?.nextOffset&&r.Ay.createElement(y.A,{isText:!0,disabled:I.isLoading,size:"smaller",noForcedUpperCase:!0,className:R.loadMore,onClick:le},r.Ay.createElement(p.A,{name:"down",className:R.loadMoreIcon}),G("StarMySubscriptionsExpand")))),$&&r.Ay.createElement("div",{className:R.container},r.Ay.createElement("div",{className:R.section},r.Ay.createElement(U.Ay,{name:w.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:O,renderCount:ne.length,shouldRestoreHeight:!0,className:R.transition},r.Ay.createElement(M.A,{onLoadMore:oe,items:k?.[re[O]]?.transactions,scrollContainerClosest:`.${R.main}`,itemSelector:`.${se}`,className:R.transactions,noFastList:!0},k?.[re[O]]?.transactions.map((e=>r.Ay.createElement(ae,{key:`${e.id}-${e.isRefund}`,transaction:e,className:se})))))),r.Ay.createElement(x.A,{className:R.tabs,tabClassName:R.tab,activeTab:O,tabs:te,onSwitchTab:F}))))})));function oe(e,t){return e("StarsAmountText",{amount:t},{pluralValue:t})}function le(e,t,a){const{asFont:n,className:s}=a||{},i=n?r.Ay.createElement(p.A,{name:"star",className:(0,o.A)("star-amount-icon",s)}):r.Ay.createElement(O.A,{type:"gold",className:(0,o.A)("star-amount-icon",s),size:"adaptive"});return e("StarsAmount",{amount:t},{withNodes:!0,specialReplacement:{[b.Cyx]:i}})}var ce=a(29886),me=a(84991),de=a(10187);const ue=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.form?.botId?(0,i.mBe)(e,t.form.botId):void 0,r="message"===t?.inputInvoice?.type?t.inputInvoice:void 0,n=r?(0,i.O5q)(e,r.chatId,r.messageId):void 0,s=r?(0,i.hds)(e,r.chatId):void 0,o=n?.content.paidMedia;return{bot:a,starsBalanceState:e.stars,paidMediaMessage:o?n:void 0,paidMediaChat:o?s:void 0}}))((({modal:e,bot:t,starsBalanceState:a,paidMediaMessage:i,paidMediaChat:l})=>{const{closeStarsPaymentModal:m,openStarsBalanceModal:p,sendStarPaymentForm:h}=(0,n.ko)(),[E,S,N]=(0,P.A)(),b=Boolean(e?.inputInvoice&&a),C=(0,ce.A)(e),k=e||C,{form:I,subscriptionInfo:G}=k||{},w=I?.invoice?.totalAmount||G?.subscriptionPricing?.amount,T=Boolean(I?.invoice.subscriptionPeriod),M=!G?.subscriptionPricing,x=I?.photo,U=(0,u.A)(),D=(0,B.A)();(0,r.vJ)((()=>{b||N()}),[b]);const F=(0,r.Kr)((()=>{if(!k?.inputInvoice)return"";const e=(0,s.YgS)(t),a=U("Stars.Intro.PurchasedText.Stars",w);if(i){const e=i.content.paidMedia.extendedMedia,t=e.every((e=>!e.duration)),r=e.every((e=>!!e.duration)),n=U(t?"Stars.Transfer.Photos":r?"Stars.Transfer.Videos":"Media",e.length),o=(0,s.JsG)(U,l);return U("Stars.Transfer.UnlockInfo",[n,o,a])}return G?D("StarsSubscribeText",{chat:G.title,amount:w},{withNodes:!0,withMarkdown:!0,pluralValue:w}):T?D("StarsSubscribeBotText",{name:I.title,amount:w,bot:e},{pluralValue:w}):U("Stars.Transfer.Info",[I.title,e,a])}),[k?.inputInvoice,t,U,w,i,G,T,I,l,D]),z=(0,r.Kr)((()=>{if(G)return D("StarsSubscribeInfo",{link:r.Ay.createElement(f.A,{url:D("StarsSubscribeInfoLink"),text:D("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[G,D]),J=(0,r.Kr)((()=>{if(G)return(0,s.nrT)(G)}),[G]),q=(0,d.A)((()=>{const t=a?.balance;void 0!==w&&void 0!==t&&(w>t.amount?p({originStarsPayment:e}):(h({}),S()))}));return r.Ay.createElement(g.A,{contentClassName:R.paymentContent,isOpen:b,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:m},r.Ay.createElement(K,{balance:a?.balance,className:R.modalBalance}),r.Ay.createElement("div",{className:R.paymentImages,dir:U.isRtl?"ltr":"rtl"},i?r.Ay.createElement(ee,{media:i.content.paidMedia.extendedMedia}):J?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{className:R.paymentPhoto,peer:J,size:"giant"}),r.Ay.createElement(O.A,{type:"gold",size:"adaptive",className:R.avatarStar})):r.Ay.createElement(me.A,{peer:x?void 0:t,avatarWebPhoto:x,avatarSize:"giant",badgeIcon:"star",badgeText:(0,L.Sm)(w),badgeClassName:R.amountBadge,className:R.paymentPhoto}),r.Ay.createElement("img",{className:R.paymentImageBackground,src:v,alt:"",draggable:!1})),r.Ay.createElement("h2",{className:R.headerText},U(J?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),M&&r.Ay.createElement(de.A,{className:R.botItem,peerId:I?.botId}),r.Ay.createElement("div",{className:R.description},(0,c.A)(F,["simple_markdown","emoji"])),r.Ay.createElement(y.A,{className:R.paymentButton,size:"smaller",onClick:q,isLoading:E},D(T?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:le(D,w,{asFont:!0})},{withNodes:!0})),z&&r.Ay.createElement("div",{className:(0,o.A)(R.disclaimer,R.smallerText)},z))})));var Ae=a(89925),pe=a(85982),fe=a(70046),ye=a(95807);const ge=(0,r.ph)((({modelAttribute:e,backdropAttribute:t,patternAttribute:a,title:n,subtitle:s,className:i})=>{const l=function(e,t){const a=(0,r.li)(0);let n=!1;return(0,r.Kr)((()=>{a.current+=1,n=!0}),e),a.current}([e,t,a]),c=t?.textColor,m=(0,r.Kr)((()=>{const e=[t.centerColor,t.edgeColor],n=t.patternColor;return r.Ay.createElement(Q.A,{className:"UvhsGZLf",backgroundColors:e,patternColor:n,patternIcon:a.sticker})}),[t,a]);return r.Ay.createElement("div",{className:(0,o.A)("irv1C8bo",i)},r.Ay.createElement(U.Ay,{className:"Tu6_OHoq",slideClassName:"iUTKLzTN",activeKey:l,direction:1,name:"zoomBounceSemiFade"},m,r.Ay.createElement(W.A,{className:"a1ASgPwu",sticker:e.sticker,size:120})),n&&r.Ay.createElement("h1",{className:"ECTvfOda"},n),s&&r.Ay.createElement("p",{className:"S6JwvHWD",style:(0,ye.A)(c&&`color: ${c}`)},s))})),he="qBOIq6Jn",Ee="sso9uZM6",Se=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a="peer"===t?.transaction?.peer?.type&&t.transaction.peer.id,r=a?(0,i.PVB)(e,a):void 0,n=t?.transaction.stars,s=t?.transaction.isGift&&(0,i.WLj)(e,n?.amount);return{peer:r,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:s}}))((({modal:e,peer:t,canPlayAnimatedEmojis:a,topSticker:i})=>{const{showNotification:l,openMediaViewer:c,closeStarsTransactionModal:m}=(0,n.ko)(),y=(0,B.A)(),g=(0,u.A)(),{transaction:h}=e||{},E=(0,d.A)((()=>{const e=h?.extendedMedia;e&&c({origin:Ae.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),S=(0,r.Kr)((()=>{if(!h)return;const{giveawayPostId:e,photo:n,stars:c,isGiftUpgrade:m,starGift:d}=h,u=h?.starGift,S="starGiftUnique"===u?.type,N=h?.starGift?(0,V.yQ)(h.starGift):i,b=S?(0,V.uc)(u):void 0,C=h.peer&&"peer"!==h.peer.type&&(0,D.Pc)(h.peer)||void 0,k="peer"===h.peer?.type?h.peer.id:void 0,I=h.peer&&g(function(e){switch(e.type){case"appStore":return"AppStore";case"playMarket":return"PlayMarket";case"fragment":return"Fragment";case"premiumBot":return"StarsTransactionBot";case"ads":return"StarsTransactionAds";case"api":return"Stars.Intro.Transaction.TelegramBotApi.Subtitle";default:return"Stars.Transaction.Unsupported.Title"}}(h.peer)),G=_(g,h),w=t&&h.messageId&&!m?(0,s.ytg)(t,void 0,h.messageId):void 0,T=t&&e&&(0,s.ytg)(t,void 0,e),P=h.extendedMedia,B=P?.length||0,M=P?.every((e=>!e.video)),x=P?.every((e=>!e.photo)),U=g(M?"Stars.Transfer.Photos":x?"Stars.Transfer.Videos":"Media",B),R=h.description||(m&&"starGiftUnique"===d?.type?d.title:void 0)||(P?U:void 0),K=!P&&!N,L=n?void 0:t||C,z=S&&r.Ay.createElement("div",{className:(0,o.A)(he,"ApoQz22o")},r.Ay.createElement(ge,{backdropAttribute:b.backdrop,patternAttribute:b.pattern,modelAttribute:b.model,title:u.title,subtitle:y("GiftInfoCollectible",{number:u.number})})),J=r.Ay.createElement("div",{className:he},P&&r.Ay.createElement(ee,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:P,onClick:E}),!P&&N&&r.Ay.createElement(W.A,{key:h.id,sticker:N,play:a,noLoop:!0}),K&&r.Ay.createElement(A.A,{peer:L,webPhoto:n,size:"giant"}),!N&&r.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:v,alt:"",draggable:!1}),G&&r.Ay.createElement("h1",{className:"ZZAj3hj7"},G),r.Ay.createElement("p",{className:"NuWOY7ED"},R),r.Ay.createElement("p",{className:Ee},r.Ay.createElement("span",{className:(0,o.A)(Ee,j(c)?"xDyq9cc0":"jvBZSrpd")},(0,D.hk)(y,c)),r.Ay.createElement(O.A,{type:"gold",size:"middle"}))),q=[];let H;h.starRefCommision&&q.push([g("StarsTransaction.StarRefReason.Title"),g("StarsTransaction.StarRefReason.Program")]),m&&q.push([g("StarGiftReason"),g("StarGiftReasonUpgrade")]),H=m?g("Stars.Transaction.GiftFrom"):j(c)||h.isMyGift?g("Stars.Transaction.To"):h.starRefCommision?g("StarsTransaction.StarRefReason.Miniapp"):g(k?"Star.Transaction.From":"Stars.Transaction.Via"),q.push([H,k?{chatId:k}:I||""]),w&&q.push([g("Stars.Transaction.Reaction.Post"),r.Ay.createElement(f.A,{url:w,text:w})]),T&&(q.push([g("BoostReason"),r.Ay.createElement(f.A,{url:T,text:g("Giveaway")})]),q.push([g("Gift"),g("Stars",h.stars,"i")])),h.id&&q.push([g("Stars.Transaction.Id"),r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,pe.eM)(h.id),l({message:g("StarsTransactionIDCopied")})}},h.id),r.Ay.createElement(p.A,{className:"voCttFzS",name:"copy"}))]),q.push([g("Stars.Transaction.Date"),(0,F.L2)(1e3*h.date,g.code,!0)]);const Q=g("lng_credits_box_out_about").split("{link}");return{header:S?z:J,tableData:q,footer:r.Ay.createElement("span",{className:"KgzPpgS6"},Q[0],r.Ay.createElement(f.A,{url:g("StarsTOSLink"),text:g("lng_credits_summary_options_about_link")}),Q[1])}}),[h,g,y,t,a,i]),N=(0,ce.A)(S)||S;return r.Ay.createElement(fe.A,{isOpen:Boolean(h),className:"IzhfRIWu",hasBackdrop:"starGiftUnique"===h?.starGift?.type,header:N?.header,tableData:N?.tableData,footer:N?.footer,buttonText:g("OK"),onClose:m})}))),ve="oBLHWBtJ",Ne=(0,r.ph)((0,n.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:s,changeStarsSubscription:i,checkChatInvite:l,loadStarStatus:c,openInvoice:m}=(0,n.ko)(),p=(0,u.A)(),g=(0,B.A)(),{subscription:h}=e||{},E=(0,r.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]),S=(0,d.A)((()=>{if(h){switch(E){case"refulfill":s({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()}})),N=(0,r.Kr)((()=>{if(!h||!t)return;const{pricing:e,until:a,isCancelled:n,canRefulfill:s,photo:i,title:l,hasBotCancelled:c}=h,m=(0,C.mO)(t),d=r.Ay.createElement("div",{className:"E3R22yAI"},r.Ay.createElement("div",{className:"wuTMXDP9"},r.Ay.createElement(A.A,{peer:i?void 0:t,webPhoto:i,size:"giant"}),r.Ay.createElement(O.A,{className:"enRetSny",type:"gold",size:"adaptive"})),r.Ay.createElement("img",{className:(0,o.A)("zGCayu45"),src:v,alt:"",draggable:!1}),r.Ay.createElement("h1",{className:"qdydQHgc"},l||p("StarsSubscriptionTitle")),r.Ay.createElement("p",{className:"FI6rEJlK"},g("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[b.Cyx]:r.Ay.createElement(O.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),u=[];u.push([p(m?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),l&&u.push([p("StarsSubscriptionBotProduct"),l]);const N=a<Date.now()/1e3;u.push([p(N?"StarsSubscriptionUntilExpired":n?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,F.L2)(1e3*a,p.code,!0)]);const k=g("StarsTransactionTOS",{link:r.Ay.createElement(f.A,{url:g("StarsTransactionTOSLink"),text:g("StarsTransactionTOSLinkText")})},{withNodes:!0});return{header:d,tableData:u,footer:r.Ay.createElement("span",{className:"GMWMuWCr"},r.Ay.createElement("p",{className:ve},k),n&&r.Ay.createElement("p",{className:"nkwiG25Q"},p(c?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),s&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionRefulfillInfo",(0,F.L2)(1e3*a,p.code,!0))),!n&&!s&&N&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionExpiredInfo",(0,F.L2)(1e3*a,p.code,!0))),!n&&!s&&!N&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionCancelInfo",(0,F.L2)(1e3*a,p.code,!0))),"hidden"!==E&&r.Ay.createElement(y.A,{size:"smaller",color:"cancel"===E?"danger":"primary",isText:"cancel"===E,onClick:S},p("cancel"===E?"StarsSubscriptionCancel":"refulfill"===E?"StarsSubscriptionRefulfill":"restart"===E?"StarsSubscriptionAgain":"renew"===E?"StarsSubscriptionRenew":"OK")))}}),[E,g,p,t,h]),k=(0,ce.A)(N)||N;return r.Ay.createElement(fe.A,{isOpen:Boolean(h),className:"eR_RZfGB",header:k?.header,tableData:k?.tableData,footer:k?.footer,onClose:a})})));var be=a(19806),Ce=a(32581),ke=a(66644),Ie=a(15283),Ge=a(93545),we=a(68292),Te=a(85118);const Pe={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},Be=[50,100,500,1e3,2e3,5e3,1e4];function Me(e,t){const a=e.findIndex((e=>t<=e)),r=e[a-1]||1,n=e[a]||e[e.length-1];return a+(t-r)/(n-r)}function xe(e,t){const a=Math.floor(t),r=e[a-1]||1,n=r+((e[a]||e[e.length-1])-r)*(t-a);return Math.round(n)}const Ue=(0,r.ph)((({maxValue:e,defaultValue:t,className:a,onChange:n})=>{const s=(0,r.li)(null),i=(0,r.Kr)((()=>{const t=[];for(let a=0;a<Be.length;a++)if(Be[a]<e&&t.push(Be[a]),Be[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,r.J0)(0);(0,Ie.A)((()=>{c(Me(i,t))}));const m=(0,d.A)((()=>{const e=s.current;if(!e)return;const t=e.parentElement;(0,ke.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,r=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,ke.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${r}px`)}))}))}));(0,Ge.A)(s,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),n(xe(i,t))}));return r.Ay.createElement("div",{className:(0,o.A)(Pe.root,a),style:"--progress: "+l/i.length},r.Ay.createElement("div",{className:Pe.floatingBadgeWrapper},r.Ay.createElement("div",{className:Pe.floatingBadge,ref:s},r.Ay.createElement("div",{className:Pe.floatingBadgeText},r.Ay.createElement(p.A,{name:"star",className:Pe.floatingBadgeIcon}),r.Ay.createElement(we.A,{text:(0,L.Sm)(xe(i,l))})),r.Ay.createElement("svg",{className:Pe.floatingBadgeTriangle,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},r.Ay.createElement("defs",null,r.Ay.createElement("linearGradient",{id:"StarBadgeTriangle",x1:"0",x2:"1",y1:"0",y2:"0"},r.Ay.createElement("stop",{offset:"-50%","stop-color":"#FFAA00"}),r.Ay.createElement("stop",{offset:"150%","stop-color":"#FFCD3A"}))),r.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)"})))),r.Ay.createElement("div",{className:Pe.progress}),r.Ay.createElement(Te.A,{preset:"progress",className:Pe.sparkles}),r.Ay.createElement("input",{className:Pe.slider,type:"range",min:0,max:i.length,defaultValue:Me(i,t),step:"any",onChange:u}))})),De={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},Oe=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t&&(0,i.hds)(e,t.chatId),r=t&&(0,i.O5q)(e,t.chatId,t.messageId),n=e.stars?.balance;return{chat:a,message:r,starBalance:n,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:h}=(0,n.ko)(),[E,S]=(0,r.J0)(50),[v,N,C]=(0,P.A)(),[k,I]=(0,r.J0)(!0),G=(0,u.A)(),w=(0,B.A)(),T=(0,d.A)((e=>{I(e.target.checked)})),M=(0,d.A)((e=>{S(e),N()}));(0,r.vJ)((()=>{e||C()}),[e]),(0,r.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMe));I(e?!e.isAnonymous:m||!0)}),[m,a?.reactions?.topReactors]);const x=(0,d.A)((()=>{e&&(h({chatId:e.chatId,messageId:e.messageId,count:E,isPrivate:!k}),A())})),U=(0,r.Kr)((()=>{const e=(0,n.mS)(),t=a?.reactions?.topReactors;if(!t)return;const r=[];let s=!1;if(t.forEach((t=>{const a=t.peerId?(0,i.mBe)(e,t.peerId):void 0;(a||t.isAnonymous||t.isMe)&&(t.isMe&&(s=!0),r.push({amount:t.count,localAmount:t.isMe&&v?E:0,isMe:t.isMe,isAnonymous:t.isAnonymous,user:a}))})),!s&&v){const t=(0,i.mBe)(e,e.currentUserId);r.push({amount:0,localAmount:E,isMe:!0,user:t})}return r.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),r.slice(0,3)}),[v,a?.reactions?.topReactors,E]),D=t&&(0,s.JsG)(G,t);return r.Ay.createElement(g.A,{isOpen:Boolean(e),onClose:A,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:"RdhRpsCn"},r.Ay.createElement(K,{balance:l,className:"Q3560fzx"}),r.Ay.createElement(Ue,{className:"xePPMXOI",defaultValue:50,maxValue:o,onChange:M}),r.Ay.createElement("h3",{className:"yzbjj73U"},G("StarsReactionTitle")),r.Ay.createElement("div",{className:"BlpfdOtK"},(0,c.A)(G("StarsReactionText",D),["simple_markdown","emoji"])),r.Ay.createElement(Ce.A,null,U&&r.Ay.createElement("div",{className:"bnou4CpV"},G("StarsReactionTopSenders"))),U&&r.Ay.createElement("div",{className:"QludQDKR"},U.map((e=>{const t=(0,L.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMe&&!k?De:e.user,n="isCustomPeer"in a?G(a.titleKey):(0,s.YgS)(a);return r.Ay.createElement(me.A,{className:"Ty4Ud_Rd",key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:"JBF9pTUK",text:n})}))),r.Ay.createElement(be.A,{className:"dialog-checkbox",checked:k,onChange:T,label:G("StarsReactionShowMeInTopSenders")}),r.Ay.createElement(y.A,{size:"smaller",onClick:x},w("SendPaidReaction",{amount:E},{withNodes:!0,specialReplacement:{[b.Cyx]:r.Ay.createElement(p.A,{className:"NJJFuym9",name:"star"})}})),r.Ay.createElement("p",{className:"KRvkHeo1"},w("StarsReactionTerms",{link:r.Ay.createElement(f.A,{text:w("StarsReactionLinkText"),url:w("StarsReactionLink")})},{withNodes:!0})))})));var Re=a(37836),Ke=a(5912),Fe=a(65632),Le=a(20333),ze=a(75373),Je=a(96530),qe=a(22720),He=a(63152),Ve=a(94079);const _e="zZUpGRSI",je="nTPAv1ci",We=(0,r.ph)((0,n.EK)(((e,{peerId:t})=>{const a=(0,i.SJA)(e),{isBlurred:r,patternColor:n,background:s,backgroundColor:o}=e.settings.themes[a]||{},l=(0,i.PVB)(e,t),c=(0,i.nTw)(e);return{peer:l,theme:a,isBackgroundBlurred:r,patternColor:n,customBackground:s,backgroundColor:o,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:c.isPaymentFormLoading}}))((function({gift:e,peerId:t,peer:a,captionLimit:i,theme:c,isBackgroundBlurred:m,patternColor:u,backgroundColor:A,customBackground:p,currentUserId:f,isPaymentFormLoading:g}){const{sendStarGift:h,openInvoice:E,openGiftUpgradeModal:S}=(0,n.ko)(),v=(0,B.A)(),[N,k]=(0,r.J0)(""),[I,G]=(0,r.J0)(!1),[w,T]=(0,r.J0)(!1),P=(0,Fe.A)(c,p),M="id"in e,x=a&&(0,C.mO)(a),U=(0,r.Kr)((()=>M?{id:-1,chatId:f,isOutgoing:!1,senderId:f,date:Math.floor(Date.now()/1e3),content:{action:{targetChatId:t,mediaType:"action",text:"ActionGiftInbound",type:"starGift",currency:b.OUy,amount:e.stars,starGift:{type:"starGift",message:N?.length?{text:N}:void 0,isNameHidden:I,starsToConvert:e.starsToConvert,canUpgrade:w||void 0,alreadyPaidUpgradeStars:w?e.upgradeStars:void 0,isSaved:!1,gift:e,peerId:t,fromId:f},translationValues:["%action_origin%","%gift_payment_amount%"]}}}:{id:-1,chatId:"0",isOutgoing:!0,senderId:f,date:Math.floor(Date.now()/1e3),content:{action:{targetChatId:t,mediaType:"action",text:"ActionGiftInbound",type:"giftPremium",amount:e.amount,currency:e.currency,months:e.months,message:{text:N},translationValues:["%action_origin%","%gift_payment_amount%"]}}}),[f,e,N,M,I,w,t]),D=(0,d.A)((e=>{k(e.target.value)})),O=(0,d.A)((()=>{G(!I)})),R=(0,d.A)((()=>{T(!w)})),K=(0,d.A)((()=>{M&&S({giftId:e.id,peerId:t})})),F=(0,d.A)((()=>{M?h({peerId:t,shouldHideName:I,gift:e,message:N?{text:N}:void 0,shouldUpgrade:w}):E({type:"giftcode",userIds:[t],currency:e.currency,amount:e.amount,option:e,message:N?{text:N}:void 0})})),L=(0,o.A)("ZORVRSG3","soDpW2YR",p&&"Eny_G3JI",A&&"TkJZPU2u",p&&m&&"M6k91TdM");return r.Ay.createElement("div",{className:(0,o.A)("jKOG0It6","custom-scroll")},r.Ay.createElement("div",{className:(0,o.A)("CB1mxsgp","MessageList"),inert:!0,style:(0,ye.A)(`--pattern-color: ${u}`,A&&`--theme-background-color: ${A}`)},r.Ay.createElement("div",{className:L,style:P?`--custom-background: ${P}`:void 0}),r.Ay.createElement(ze.A,{key:M?e.id:e.months,message:U})),function(){const t=i?i-N.length:void 0,n=(0,s.F9N)(v,a);return r.Ay.createElement("div",{className:"Y68CEIKn"},r.Ay.createElement(Ve.A,{className:"o5r2IPoA",onChange:D,value:N,label:v("GiftMessagePlaceholder"),maxLength:i,maxLengthIndicator:t&&t<50?t.toString():void 0}),M&&e.upgradeStars&&r.Ay.createElement(qe.A,{className:_e,narrow:!0,ripple:!0,onClick:R},r.Ay.createElement("span",null,v("GiftMakeUnique",{stars:le(v,e.upgradeStars,{className:"zAee80Dv"})},{withNodes:!0})),r.Ay.createElement(He.A,{checked:w,onChange:R,label:v("GiftMakeUniqueAcc")})),M&&r.Ay.createElement("div",{className:je},x?v("GiftMakeUniqueDescription",{user:n,link:r.Ay.createElement(Je.A,{isPrimary:!0,onClick:K},v("GiftMakeUniqueLink"))},{withNodes:!0}):v("GiftMakeUniqueDescriptionChannel",{peer:n,link:r.Ay.createElement(Je.A,{isPrimary:!0,onClick:K},v("GiftMakeUniqueLink"))},{withNodes:!0})),M&&r.Ay.createElement(qe.A,{className:_e,narrow:!0,ripple:!0,onClick:O},r.Ay.createElement("span",null,v("GiftHideMyName")),r.Ay.createElement(He.A,{checked:I,onChange:O,label:v("GiftHideMyName")})),M&&r.Ay.createElement("div",{className:je},x?v("GiftHideNameDescription",{receiver:n}):v("GiftHideNameDescriptionChannel")))}(),r.Ay.createElement("div",{className:"ATowWJ60"}),function(){const t=M?le(v,e.stars+(w?e.upgradeStars:0),{asFont:!0}):(0,l.v)(e.amount,e.currency);return r.Ay.createElement("div",{className:"jxWZSvet"},M&&e.availabilityRemains&&r.Ay.createElement(Le.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:v("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:v("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),r.Ay.createElement(y.A,{className:"IDuhjrne",onClick:F,isLoading:g},v("GiftSend",{amount:t},{withNodes:!0})))}())})));var Qe=a(87049);const Xe="G1mBmzxs",Ye="a8no5WH0",Ze=(0,r.ph)((0,n.EK)(((e,{option:t})=>({sticker:(0,i.t0O)(e,t.months),canPlayAnimatedEmojis:(0,i.BWX)(e)})))((function({sticker:e,canPlayAnimatedEmojis:t,baseMonthAmount:a,option:n,onClick:s}){const{months:i,amount:o,currency:c}=n,m=(0,B.A)(),u=(0,d.A)((()=>{s(n)})),A=Math.floor(o/i),p=a&&a>A?Math.ceil(100-A/(a/100)):void 0;return r.Ay.createElement("div",{className:Xe,tabIndex:0,role:"button",onClick:u},r.Ay.createElement(W.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 r.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),r.Ay.createElement("div",{className:"q4_ydkAx"},m("PremiumGiftDescription")),r.Ay.createElement(y.A,{className:Ye,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(o,c)),Boolean(p)&&r.Ay.createElement(Qe.A,{color:"red",text:m("GiftDiscount",{percent:p})}))}))),$e=(0,r.ph)((function({gift:e,observeIntersection:t,onClick:a}){const{openGiftInfoModal:s}=(0,n.ko)(),i=(0,r.li)(null),l=(0,B.A)(),[c,m]=(0,P.A)(),{stars:u,isLimited:A,isSoldOut:f,sticker:g}=e,h=(0,d.A)((()=>{f?s({gift:e}):a(e)}));return(0,Ke.mv)(i,t,(e=>{e.isIntersecting&&m()})),r.Ay.createElement("div",{ref:i,className:(0,o.A)(Xe,"f5ArEO1S"),tabIndex:0,role:"button",onClick:h},r.Ay.createElement(W.A,{sticker:g,noLoop:!0,play:c,nonInteractive:!0,size:90}),r.Ay.createElement(y.A,{className:Ye,nonInteractive:!0,size:"tiny",color:"stars",withSparkleEffect:!0,pill:!0,fluid:!0},r.Ay.createElement(p.A,{name:"star",className:"DvJLTVFU"}),r.Ay.createElement("div",{className:"sbo2dMcH"},u)),A&&!f&&r.Ay.createElement(Qe.A,{color:"blue",text:l("GiftLimited")}),f&&r.Ay.createElement(Qe.A,{color:"red",text:l("GiftSoldOut")}))}));var et=a(36838);const tt=(0,r.ph)((0,n.EK)((e=>{const{starGifts:t}=e;return{idsByCategory:t?.idsByCategory}}))((({idsByCategory:e,onCategoryChanged:t})=>{const a=(0,r.li)(null),n=(0,B.A)(),s=(0,r.Kr)((()=>e&&Object.keys(e).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[e]),[i,l]=(0,r.J0)("all");function c(e){return r.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",i===e&&"B2lEJk1v"),onClick:()=>function(e){l(e),t(e)}(e)},Number.isInteger(e)&&r.Ay.createElement(O.A,{className:"Pb7AU805",type:"gold",size:"middle"}),function(e){return"all"===e?n("AllGiftsCategory"):"stock"===e?n("StockGiftsCategory"):"limited"===e?n("LimitedGiftsCategory"):e}(e))}return(0,et.A)(a,void 0,!0),r.Ay.createElement("div",{ref:a,className:(0,o.A)("cUjwvN00","no-scrollbar")},c("all"),c("limited"),c("stock"),s?.map(c))}))),at={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"},rt=(0,Re.nF)((e=>e()),200,!0),nt=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const{starGifts:a,stars:r,currentUserId:n}=e,s=t?.forPeerId?(0,i.PVB)(e,t.forPeerId):void 0,o=Boolean(n&&t?.forPeerId===n);return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a?.byId,starGiftIdsByCategory:a?.idsByCategory,starBalance:r?.balance,peer:s,isSelf:o}}))((({modal:e,starGiftsById:t,starGiftIdsByCategory:a,starBalance:i,peer:l,isSelf:c})=>{const{closeGiftModal:p}=(0,n.ko)(),h=(0,r.li)(null),E=(0,r.li)(null),S=(0,r.li)(null),N=(0,r.li)(null),b=Boolean(e),k=(0,m.A)(e),I=l&&(0,C.mO)(l)?l:void 0,G=l&&(0,C.vj)(l)?l:void 0,[w,T]=(0,r.J0)(),[P,M]=(0,r.J0)(!0),[x,D]=(0,r.J0)(!1),[O,R]=(0,r.J0)("all"),F=(0,u.A)(),L=(0,B.A)(),z=(0,r.Kr)((()=>k?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[k]),J=(0,r.Kr)((()=>z?.reduce(((e,t)=>e.amount<t.amount?e:t))),[z]),{observe:q}=(0,Ke.BL)({rootRef:N,throttleMs:200,isDisabled:!b});(0,r.vJ)((()=>{b||(M(!0),T(void 0),R("all"))}),[b]);const H=(0,d.A)((e=>{if(w)return;const t=e.currentTarget;rt((()=>{const{scrollTop:e}=t;if(M(e<=150),E.current&&S.current){const{top:e}=S.current.getBoundingClientRect(),{top:t}=E.current.getBoundingClientRect();D(e-t<=0)}}))})),V=L("GiftPremiumDescription",{user:(0,s.YgS)(I),link:r.Ay.createElement(f.A,{text:L("GiftPremiumDescriptionLinkCaption"),url:L("GiftPremiumDescriptionLink")})},{withNodes:!0}),_=G?L("StarGiftDescriptionChannel",{peer:(0,s.F9N)(L,G)},{withNodes:!0,withMarkdown:!0}):c?L("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):L("StarGiftDescription",{user:(0,s.YgS)(I)},{withNodes:!0,withMarkdown:!0}),j=(0,d.A)((e=>{T(e),D("id"in e),M(!1)})),W=(0,d.A)((e=>{R(e)})),Q=(0,d.A)((()=>{w?T(void 0):p()})),X=Boolean(w),Y=(0,o.A)("animated-close-icon",X&&"state-back");return r.Ay.createElement(g.A,{dialogRef:h,onClose:p,isOpen:b,isSlim:!0,contentClassName:at.content,className:(0,o.A)(at.modalDialog,at.root)},r.Ay.createElement(y.A,{className:at.closeButton,round:!0,color:"translucent",size:"smaller",onClick:Q,ariaLabel:F(X?"Common.Back":"Common.Close")},r.Ay.createElement("div",{className:Y})),r.Ay.createElement(K,{className:at.balance,balance:i}),r.Ay.createElement("div",{className:(0,o.A)(at.header,P&&at.hiddenHeader)},r.Ay.createElement(U.Ay,{name:"slideVerticalFade",activeKey:Number(x),slideClassName:at.headerSlide},r.Ay.createElement("h2",{className:at.commonHeaderText},L(x?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),r.Ay.createElement(U.Ay,{ref:E,className:at.transition,name:"pushSlide",activeKey:w?1:0},!w&&r.Ay.createElement("div",{ref:N,className:(0,o.A)(at.main,"custom-scroll"),onScroll:H},r.Ay.createElement("div",{className:at.avatars},r.Ay.createElement(A.A,{size:100,peer:l}),r.Ay.createElement("img",{className:at.logoBackground,src:v,alt:"",draggable:!1})),!c&&!G&&r.Ay.createElement("h2",{className:(0,o.A)(at.headerText,at.center)},L("GiftPremiumHeader")),!c&&!G&&r.Ay.createElement("p",{className:(0,o.A)(at.description,at.center)},V),!c&&!G&&r.Ay.createElement("div",{className:at.premiumGiftsGallery},z?.map((e=>r.Ay.createElement(Ze,{option:e,baseMonthAmount:J?Math.floor(J.amount/J.months):void 0,onClick:j})))),r.Ay.createElement("h2",{ref:S,className:(0,o.A)(at.headerText,at.center)},L(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),r.Ay.createElement("p",{className:(0,o.A)(at.description,at.starGiftsDescription,at.center)},_),r.Ay.createElement(tt,{onCategoryChanged:W}),r.Ay.createElement(U.Ay,{name:"zoomFade",activeKey:(Z=O,"all"===Z?-2:"limited"===Z?-1:"stock"===Z?0:Z),className:at.starGiftsTransition},r.Ay.createElement("div",{className:at.starGiftsContainer},t&&a?.[O].map((e=>{const a=t[e];return r.Ay.createElement($e,{gift:a,observeIntersection:q,onClick:j})}))))),w&&k?.forPeerId&&r.Ay.createElement(We,{gift:w,peerId:k.forPeerId})));var Z})));const st=(0,r.ph)((0,n.EK)((e=>{const{currentUserId:t}=e;return{currentUserId:t,userIds:e.contactList?.userIds}}))((({modal:e,currentUserId:t,userIds:a})=>{const{closeGiftRecipientPicker:s,openGiftModal:o}=(0,n.ko)(),l=(0,u.A)(),c=e,[m,A]=(0,r.J0)(""),p=(0,r.Kr)((()=>{const e=(0,n.mS)(),r=a?a.concat(t):void 0,s=r?(0,C.PU)({ids:r,query:m}):[];return(0,I.A)((0,k.Am)(s).filter((t=>(0,i.X2D)(e,t))),void 0,[t])}),[t,m,a]),f=(0,d.A)((e=>{o({forUserId:e}),s()}));return r.Ay.createElement(w.A,{className:"W3JMs1YE",isOpen:c,onClose:s,title:l("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},r.Ay.createElement(G.A,{className:"wOipz1Y_",itemIds:p,filterValue:m,filterPlaceholder:l("Search"),onSelectedIdChange:f,onFilterChange:A,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var it=a(80140),ot=a(18501),lt=a(81949),ct=a(94189),mt=a(22699),dt=a(24433);const ut={modal:"nnublcCk",header:"p7FTs7_p",title:"pIbzzTir",description:"CCPfr26t",soldOut:"kjWcRp4W",footer:"bho0GTYt",footerDescription:"VUylTszM",unknown:"zDauXmpS",giftValue:"w_E4LkUj",uniqueAttribute:"OJQnkf17",uniqueGift:"I6o_pGAm",starAmountIcon:"_5guecUe",modalHeader:"ie9tImaj",modalCloseButton:"p38RBGdC",ownerAddress:"DavMRg4Q",copyIcon:"SLX5tX8C"},At=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.gift,r=a&&"gift"in a&&a.fromId,n=r?(0,i.PVB)(e,r):void 0,o=t?.peerId?(0,i.PVB)(e,t.peerId):void 0,l=o&&(0,C.vj)(o)?o:void 0,c=l&&(0,s.ubU)(l,"postMessages"),m=e.currentUserId?(0,i.mBe)(e,e.currentUserId):void 0,d=m?.emojiStatus,u=e.collectibleEmojiStatuses?.statuses;return{fromPeer:n,targetPeer:o,currentUserId:e.currentUserId,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod,hasAdminRights:c,currentUserEmojiStatus:d,collectibleEmojiStatuses:u}}))((({modal:e,fromPeer:t,targetPeer:a,currentUserId:l,starGiftMaxConvertPeriod:c,hasAdminRights:f,currentUserEmojiStatus:g,collectibleEmojiStatuses:h})=>{const{closeGiftInfoModal:E,changeGiftVisibility:S,convertGiftToStars:v,openChatWithInfo:N,focusMessage:k,openGiftUpgradeModal:I,showNotification:G,openChatWithDraft:w,openGiftStatusInfoModal:T,setEmojiStatus:M,openGiftTransferModal:x}=(0,n.ko)(),[U,D,O]=(0,P.A)(),R=(0,B.A)(),K=(0,u.A)(),z=Boolean(e),J=(0,m.A)(e),q=(0,m.A)(t),_=(0,m.A)(a),j=_&&(0,C.vj)(_),{gift:Q}=J||{},X=Q&&"gift"in Q,Y=X?Q:void 0,Z=Y?.fromId===l,$=Y&&c&&Y.date+c-(0,it.Fm)()||0,ee=Math.ceil($/60/60/24),te=X?Q.gift:Q,ae=te&&(0,V.yQ)(te),re="collectible"===g?.type?g.slug:void 0,ne="starGiftUnique"===te?.type?te.slug:void 0,se=(0,r.Kr)((()=>{if(ne)return`${b.jsp}nft/${ne}`}),[ne]),ie=(0,r.Kr)((()=>{if(ne)return h?.find((e=>"collectible"===e.type&&e.slug===ne))}),[ne,h]),ce=te&&"starGiftUnique"===te.type,me=ce&&re===te.slug,de=ie&&!me,ue=Boolean(Y?.upgradeMsgId),Ae=!ue&&Y?.inputGift&&(j?f:_?.id===l),ye=(0,d.A)((()=>{E()})),he=(0,d.A)((()=>{se&&((0,pe.eM)(se),G({message:R("LinkCopied")}))})),Ee=(0,d.A)((()=>{se&&(w({text:{text:se}}),ye())})),Se=(0,d.A)((()=>{"starGiftUnique"===Y?.gift.type&&x({gift:Y})})),ve=(0,d.A)((()=>{"starGiftUnique"===te?.type&&ie&&T({emojiStatus:ie})})),Ne=(0,d.A)((()=>{me&&M({emojiStatus:{type:"regular",documentId:b.zNY}})})),be=(0,d.A)((()=>{if(!Y?.upgradeMsgId||!_)return;const{upgradeMsgId:e}=Y;k({chatId:_.id,messageId:e}),ye()})),Ce=(0,d.A)((()=>{const{inputGift:e,isUnsaved:t}=Y;S({gift:e,shouldUnsave:!t}),ye()})),ke=(0,d.A)((()=>{const{inputGift:e}=Y;v({gift:e}),O(),ye()})),Ie=(0,d.A)((()=>{Y&&I({giftId:Y.gift.id,gift:Y})})),Ge=(0,r.Kr)((()=>te&&(0,V.uc)(te)),[te]),we=(0,r.Kr)((()=>({onTrigger:e,isMenuOpen:t})=>r.Ay.createElement(y.A,{round:!0,size:"smaller",color:"translucent-white",className:t?"active":"",onClick:e,ariaLabel:R("AriaMoreButton")},r.Ay.createElement(p.A,{name:"more"}))),[R]),Te=(0,d.A)((()=>ue?r.Ay.createElement(y.A,{size:"smaller",onClick:be},R("GiftInfoViewUpgraded")):Ae&&Y?.alreadyPaidUpgradeStars&&!Y.upgradeMsgId?r.Ay.createElement(y.A,{size:"smaller",isShiny:!0,onClick:Ie},R("GiftInfoUpgradeForFree")):r.Ay.createElement(y.A,{size:"smaller",onClick:ye},R("OK")))),Pe=(0,r.Kr)((()=>{if(!Q||!te)return;const{fromId:e,isNameHidden:t,starsToConvert:a,isUnsaved:l,isConverted:c}=Y||{},m=t&&_,d=(()=>{if(!Y)return R("GiftInfoSoldOutDescription");if(!j){if(Y.upgradeMsgId)return R("GiftInfoDescriptionUpgraded");if(Y.canUpgrade&&Y.alreadyPaidUpgradeStars)return Ae?R("GiftInfoDescriptionFreeUpgrade"):R("GiftInfoPeerDescriptionFreeUpgradeOut",{peer:(0,s.F9N)(R,_)});if(Ae||Z)return c&&a?Ae?R("GiftInfoDescriptionConverted",{amount:(0,L.Sm)(a)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):R("GiftInfoPeerDescriptionOutConverted",{amount:(0,L.Sm)(a),peer:(0,s.F9N)(R,_)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):Y.canUpgrade&&Ae?R("GiftInfoDescriptionUpgrade",{amount:(0,L.Sm)(a)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):Ae?R("GiftInfoDescription",{amount:a},{withNodes:!0,withMarkdown:!0,pluralValue:a||0}):R("GiftInfoPeerDescriptionOut",{amount:a,peer:(0,s.F9N)(R,_)},{withNodes:!0,withMarkdown:!0,pluralValue:a||0})}})(),u=r.Ay.createElement(mt.A,{className:"with-menu-transitions",trigger:we,positionX:"right"},r.Ay.createElement(dt.A,{icon:"link-badge",onClick:he},R("CopyLink")),r.Ay.createElement(dt.A,{icon:"forward",onClick:Ee},R("Share")),Ae&&ce&&r.Ay.createElement(dt.A,{icon:"diamond",onClick:Se},R("GiftInfoTransfer")),de&&r.Ay.createElement(dt.A,{icon:"crown-wear",onClick:ve},R("GiftInfoWear")),me&&r.Ay.createElement(dt.A,{icon:"crown-take-off",onClick:Ne},R("GiftInfoTakeOff"))),f=r.Ay.createElement("div",{className:ut.modalHeader},r.Ay.createElement(y.A,{className:ut.modalCloseButton,round:!0,color:"translucent-white",size:"smaller",ariaLabel:R("Close"),onClick:ye},r.Ay.createElement(p.A,{name:"close"})),z&&u),g=ce&&r.Ay.createElement("div",{className:(0,o.A)(ut.header,ut.uniqueGift)},r.Ay.createElement(ge,{backdropAttribute:Ge.backdrop,patternAttribute:Ge.pattern,modelAttribute:Ge.model,title:te.title,subtitle:R("GiftInfoCollectible",{number:te.number})})),h=r.Ay.createElement("div",{className:ut.header},r.Ay.createElement(W.A,{className:ut.giftSticker,sticker:ae,size:120}),r.Ay.createElement("h1",{className:ut.title},ce?te.title:R(Y?Ae?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),d&&r.Ay.createElement("p",{className:(0,o.A)(ut.description,!Y&&"starGift"===te?.type&&ut.soldOut)},d)),S=[];if("starGift"===te.type){(e||t)&&S.push([R("GiftInfoFrom"),e?{chatId:e}:r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"small",peer:H.I5}),r.Ay.createElement("span",{className:ut.unknown},K(H.I5.titleKey)))]),Y?.date&&S.push([R("GiftInfoDate"),(0,F.L2)(1e3*Y.date,R.code,!0)]),te.firstSaleDate&&S.push([R("GiftInfoFirstSale"),(0,F.L2)(1e3*te.firstSaleDate,R.code,!0)]),te.lastSaleDate&&S.push([R("GiftInfoLastSale"),(0,F.L2)(1e3*te.lastSaleDate,R.code,!0)]);const n=te.stars+(Y?.alreadyPaidUpgradeStars||0);S.push([R("GiftInfoValue"),r.Ay.createElement("div",{className:ut.giftValue},le(R,n,{className:ut.starAmountIcon}),Ae&&$>0&&Boolean(a)&&r.Ay.createElement(lt.A,{onClick:D},R("GiftInfoConvert",{amount:a},{pluralValue:a})))]),te.availabilityTotal&&S.push([R("GiftInfoAvailability"),R("GiftInfoAvailabilityValue",{count:te.availabilityRemains||0,total:te.availabilityTotal},{pluralValue:te.availabilityRemains||0})]),te.upgradeStars&&!Y?.upgradeMsgId&&S.push([R("GiftInfoStatus"),r.Ay.createElement("div",{className:ut.giftValue},R("GiftInfoStatusNonUnique"),Ae&&r.Ay.createElement(lt.A,{onClick:Ie},R("GiftInfoUpgradeBadge")))]),Y?.message&&S.push([void 0,(0,ot.f)(Y.message)])}if(ce){const{ownerName:e,ownerAddress:t,ownerId:a}=te,{model:o,backdrop:l,pattern:c,originalDetails:m}=Ge||{};if(t?S.push([R("GiftInfoOwner"),r.Ay.createElement("span",{className:ut.ownerAddress,onClick:()=>{(0,pe.eM)(t),G({message:{key:"WalletAddressCopied"},icon:"copy"})}},t,r.Ay.createElement(p.A,{className:ut.copyIcon,name:"copy"}))]):S.push([R("GiftInfoOwner"),a?{chatId:a,withEmojiStatus:!0}:e||""]),o&&S.push([R("GiftAttributeModel"),r.Ay.createElement("span",{className:ut.uniqueAttribute},o.name,r.Ay.createElement(lt.A,null,(0,L.l9)(o.rarityPercent)))]),l&&S.push([R("GiftAttributeBackdrop"),r.Ay.createElement("span",{className:ut.uniqueAttribute},l.name,r.Ay.createElement(lt.A,null,(0,L.l9)(l.rarityPercent)))]),c&&S.push([R("GiftAttributeSymbol"),r.Ay.createElement("span",{className:ut.uniqueAttribute},c.name,r.Ay.createElement(lt.A,null,(0,L.l9)(c.rarityPercent)))]),S.push([R("GiftInfoAvailability"),R("GiftInfoIssued",{issued:te.issuedCount,total:te.totalCount})]),m){const{date:e,recipientId:t,message:a,senderId:o}=m,l=(0,n.mS)(),c=e=>{N({id:e}),E()},d=(0,i.PVB)(l,t),u=o?(0,i.PVB)(l,o):void 0,A=(0,F.L2)(1e3*e,R.code,!0),p=r.Ay.createElement(Je.A,{onClick:()=>c(t),isPrimary:!0},(0,s.F9N)(R,d));let f;if(u&&o!==t){const e=r.Ay.createElement(Je.A,{onClick:()=>c(u.id),isPrimary:!0},(0,s.F9N)(R,u));f=a?R("GiftInfoPeerOriginalInfoTextSender",{peer:p,sender:e,text:(0,ot.f)(a),date:A},{withNodes:!0}):R("GiftInfoPeerOriginalInfoSender",{peer:p,date:A,sender:e},{withNodes:!0})}else f=a?R("GiftInfoPeerOriginalInfoText",{peer:p,text:(0,ot.f)(a),date:A},{withNodes:!0}):R("GiftInfoPeerOriginalInfo",{peer:p,date:A},{withNodes:!0});S.push([void 0,r.Ay.createElement("span",null,f)])}}const v=r.Ay.createElement("div",{className:ut.footer},Ae&&r.Ay.createElement("div",{className:ut.footerDescription},r.Ay.createElement("div",null,R(`GiftInfo${j?"Channel":""}${l?"Hidden":"Saved"}`,{link:r.Ay.createElement(Je.A,{isPrimary:!0,onClick:Ce},R("GiftInfoSaved"+(l?"Show":"Hide")))},{withNodes:!0})),m&&r.Ay.createElement("div",null,R("GiftInfoSenderHidden"))),Te());return{modalHeader:ce?f:void 0,header:ce?g:h,tableData:S,footer:v}}),[Q,Y,_,ae,R,Ae,$,Z,K,te,Ge,Te,j,we,z,ce,de,me]);return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(fe.A,{isOpen:z,modalHeader:Pe?.modalHeader,header:Pe?.header,hasBackdrop:ce,tableData:Pe?.tableData,footer:Pe?.footer,className:ut.modal,onClose:ye}),Y&&r.Ay.createElement(ct.A,{isOpen:U,onClose:O,confirmHandler:ke,title:R("GiftInfoConvertTitle")},r.Ay.createElement("div",null,R("GiftInfoPeerConvertDescription",{amount:oe(R,Y.starsToConvert),peer:(0,s.F9N)(R,q)},{withNodes:!0,withMarkdown:!0})),$>0&&r.Ay.createElement("div",null,R("GiftInfoConvertDescriptionPeriod",{count:ee},{withNodes:!0,withMarkdown:!0,pluralValue:ee})),r.Ay.createElement("div",null,R("GiftInfoConvertDescription2"))))})));var pt=a(23174),ft=a(58554),yt=a(32625),gt=a(5463);const ht="_Dt6RSQV",Et=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.recipientId;return{recipient:a?(0,i.PVB)(e,a):void 0}}))((({modal:e,recipient:t})=>{const{closeGiftUpgradeModal:a,upgradeGift:i}=(0,n.ko)(),o=Boolean(e),l=(0,m.A)(e),c=(0,m.A)(t),[u,A]=(0,r.J0)(!1),[p,f]=(0,r.J0)(),g=(0,B.A)(),h=(0,d.A)((()=>a())),E=(0,d.A)((()=>{const e=l?.gift;e?.inputGift&&(i({gift:e.inputGift,shouldKeepOriginalDetails:u,upgradeStars:e.alreadyPaidUpgradeStars?void 0:e.gift.upgradeStars}),h())})),S=(0,d.A)((()=>{l?.sampleAttributes&&f(function(e,t){const a=e.filter((e=>"model"===e.type&&e.name!==t?.model.name)),r=e.filter((e=>"pattern"===e.type&&e.name!==t?.pattern.name)),n=e.filter((e=>"backdrop"===e.type&&e.name!==t?.backdrop.name));return{model:a[Math.floor(Math.random()*a.length)],pattern:r[Math.floor(Math.random()*r.length)],backdrop:n[Math.floor(Math.random()*n.length)]}}(l.sampleAttributes,p))}));(0,yt.A)(S,o?3e3:void 0,!0),(0,r.vJ)((()=>{o&&l?.sampleAttributes&&S()}),[o,l?.sampleAttributes]),(0,r.vJ)((()=>{const e=l?.sampleAttributes;e&&[...e.filter((e=>"pattern"===e.type)).map((e=>e.sticker)),...e.filter((e=>"model"===e.type)).map((e=>e.sticker))].map((e=>(0,s.Mwy)(e,"full"))).forEach((e=>{(0,ft.hd)(e,pt.qZ.BlobUrl)}))}),[l?.sampleAttributes]);const v=(0,r.Kr)((()=>{if(!p)return;const e=l?.gift,t=[["diamond",g("GiftUpgradeUniqueTitle"),g("GiftUpgradeUniqueDescription")],["trade",g("GiftUpgradeTransferableTitle"),g("GiftUpgradeTransferableDescription")],["auction",g("GiftUpgradeTradeableTitle"),g("GiftUpgradeTradeableDescription")]],a=c?g("GiftPeerUpgradeText",{peer:(0,s.F9N)(g,c)}):g("GiftUpgradeTextOwn");return{listItemData:t,header:r.Ay.createElement(ge,{modelAttribute:p.model,backdropAttribute:p.backdrop,patternAttribute:p.pattern,title:g("GiftUpgradeTitle"),subtitle:a}),footer:r.Ay.createElement("div",{className:"EWaVCxY4"},!e&&r.Ay.createElement(y.A,{className:ht,size:"smaller",onClick:h},g("OK")),e&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(be.A,{label:g("GiftUpgradeKeepDetails"),onCheck:A,checked:u}),r.Ay.createElement(y.A,{className:ht,size:"smaller",isShiny:!0,onClick:E},e.alreadyPaidUpgradeStars?g("GeneralConfirm"):g("GiftUpgradeButton",{amount:le(g,e.gift.upgradeStars,{asFont:!0})},{withNodes:!0}))))}}),[p,g,c,l?.gift,u]);return r.Ay.createElement(gt.A,{isOpen:o,header:v?.header,footer:v?.footer,listItemData:v?.listItemData,hasBackdrop:!0,onClose:h})})));var St=a(47483),vt=a(34431);const Nt=(0,r.ph)((0,n.EK)((e=>({currentUser:(0,i.mBe)(e,e.currentUserId),isCurrentUserPremium:(0,i.g29)(e)})))((({modal:e,currentUser:t,isCurrentUserPremium:a})=>{const{closeGiftStatusInfoModal:s,setEmojiStatus:i}=(0,n.ko)(),l=(0,B.A)(),c=Boolean(e),u=(0,m.A)(e),{emojiStatus:f}=u||{},g=f?.textColor,h=(0,St.A)(f?.patternDocumentId),E=(0,d.A)((()=>{s()})),S=(0,d.A)((()=>{f&&i({emojiStatus:f}),s()})),v=(0,r.Kr)((()=>{if(!f||!c)return;const e=[f.centerColor,f.edgeColor],t=f.patternColor;return r.Ay.createElement(Q.A,{className:"_1RfhkfB",backgroundColors:e,patternColor:t,patternIcon:h.customEmoji})}),[f,c,h]),N=(0,r.Kr)((()=>({...t,emojiStatus:f})),[t,f]),b=(0,r.Kr)((()=>r.Ay.createElement("div",{className:"qL0cHbwS"},r.Ay.createElement("div",{className:(0,o.A)("t18QCmAb"),style:(0,ye.A)(g&&`color: ${g}`)},v,r.Ay.createElement(A.A,{peer:N,size:"jumbo",className:"JK2zOWA7"}),r.Ay.createElement(vt.A,{peer:N,className:"lxxbgNCl",withEmojiStatus:!0,noFake:!0,noVerified:!0,statusSparklesColor:g}),r.Ay.createElement("p",{className:"MLMdxkUg",style:(0,ye.A)(g&&`color: ${g}`)},l("Online"))),r.Ay.createElement("div",{className:"q8w7tnmR"},r.Ay.createElement("div",{className:"wxg_5ou_"},l("UniqueStatusWearTitle",{gift:N?.emojiStatus?.title})),r.Ay.createElement("div",{className:"KSCLIMZm"},l("UniqueStatusBenefitsDescription"))))),[g,v,N,l]),C=[["radial-badge",l("UniqueStatusBadgeBenefitTitle"),l("UniqueStatusBadgeDescription")],["unique-profile",l("UniqueStatusProfileDesignBenefitTitle"),l("UniqueStatusProfileDesignDescription")],["proof-of-ownership",l("UniqueStatusProofOfOwnershipBenefitTitle"),l("UniqueStatusProofOfOwnershipDescription")]],k=(0,r.Kr)((()=>{if(c)return r.Ay.createElement("div",{className:"VDrvalBo"},r.Ay.createElement(y.A,{size:"smaller",onClick:S},l("UniqueStatusWearButton"),!a&&r.Ay.createElement(p.A,{name:"lock-badge",className:"jiPObOWv"})))}),[l,a,c]);return r.Ay.createElement(gt.A,{isOpen:c,header:b,listItemData:C,footer:k,hasBackdrop:!0,onClose:E})})));var bt=a(21309),Ct=a(76023),kt=a(15535);const It={header:"LQgz8Nlx",giftPreview:"hgs0ts_O",backdrop:"OnBhMaBw",description:"HBxB4QPY",arrow:"kXTOUpfb",noPassword:"BnqLhoKr"},Gt={isCustomPeer:!0,avatarIcon:"fragment",title:"",customPeerAvatarColor:"#000000"},wt=4.5*Ct.$,Tt=(0,r.ph)((0,n.EK)((e=>{const{settings:{byKey:{hasPassword:t}},twoFaSettings:{hint:a}}=e;return{hasPassword:t,passwordHint:a}}))((({modal:e,hasPassword:t,passwordHint:a})=>{const{closeGiftWithdrawModal:s,clearGiftWithdrawError:i,processStarGiftWithdrawal:o}=(0,n.ko)(),l=Boolean(e),[c,u]=(0,r.J0)(!1),f=(0,B.A)(),y=(0,m.A)(e),h=y?.gift?.gift,E=h&&(0,V.uc)(h),S=y?.gift?.canExportAt?Math.max(y.gift.canExportAt-(0,it.Fm)(),0):void 0,v=(0,d.A)((()=>{s()})),N=(0,d.A)((e=>{o({gift:y.gift.inputGift,password:e})}));return r.Ay.createElement(g.A,{isOpen:l,title:f("GiftWithdrawTitle"),hasCloseButton:!0,isSlim:!0,onClose:v},E&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:It.header},r.Ay.createElement("div",{className:It.giftPreview},r.Ay.createElement(Q.A,{className:It.backdrop,backgroundColors:[E.backdrop.centerColor,E.backdrop.edgeColor],patternColor:E.backdrop?.patternColor,patternIcon:E.pattern?.sticker}),r.Ay.createElement(W.A,{className:It.sticker,size:wt,sticker:E.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:It.arrow}),r.Ay.createElement(A.A,{peer:Gt,size:"giant",className:It.avatar})),r.Ay.createElement("p",{className:It.description},f("GiftWithdrawDescription",{gift:`${h.title} #${h.number}`},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}))),Boolean(S)&&r.Ay.createElement("p",{className:It.exportHint},f("GiftWithdrawWait",{days:(0,bt._k)(S)},{pluralValue:(0,bt._k)(S)})),!t&&r.Ay.createElement("span",{className:It.noPassword},f("ErrorPasswordMissing")),t&&!S&&r.Ay.createElement(kt.A,{shouldShowSubmit:!0,placeholder:f("CheckPasswordPlaceholder"),error:y?.errorKey&&f.withRegular(y?.errorKey),description:f("CheckPasswordDescription"),clearError:i,isLoading:y?.isLoading,hint:a,isPasswordVisible:c,shouldResetValue:l,onChangePasswordVisibility:u,submitLabel:f("GiftWithdrawSubmit"),onSubmit:N}))})));var Pt=a(79824),Bt=a(74984),Mt=a(4875),xt=a(56863),Ut=a(30857),Dt=a(84080),Ot=a(56133),Rt=a(35297);function Kt(){}async function Ft(e){const t=await(0,Mt.px)("searchChats",{query:e});if(t)return[...t.accountResultIds,...t.globalResultIds]}const Lt={header:"PvaNNycU",giftPreview:"nCQxWKdu",backdrop:"JCP9JNuS",arrow:"p_1cyCau"},zt=4*Ct.$,Jt=3*Ct.$,qt=(0,r.ph)((0,n.EK)((e=>{const{contactList:t,currentUserId:a}=e;return{contactIds:t?.userIds,currentUserId:a}}))((({modal:e,contactIds:t,currentUserId:a})=>{const{closeGiftTransferModal:o,openGiftWithdrawModal:l,transferGift:c}=(0,n.ko)(),u=Boolean(e),f=(0,B.A)(),[y,g]=(0,r.J0)(""),h=(0,m.A)(e),E=h?.gift?.gift,S=E&&(0,V.uc)(E),[v,N]=(0,r.J0)(),C=(0,m.A)(v),T=(0,r.Kr)((()=>{const e=(0,n.mS)();return C?(0,i.PVB)(e,C):void 0}),[C]),P=(0,Bt.Rh)(b.DSF),M=(0,r.Kr)((()=>(0,k.Am)([...t||[],...P||[]])),[t,P]),{result:x,currentResultsQuery:U}=function({query:e,queryFn:t=Ft,defaultValue:a,debounceTimeout:n=300,isDisabled:s}){const i=function(e,t,a){const[n,s]=(0,r.J0)(),{isFrozen:i,updateWhenUnfrozen:o}=function(){const e=(0,r.li)(!1),t=(0,r.hb)((()=>{e.current=!0}),[]),a=(0,Ut.A)(),n=(0,r.hb)((()=>{e.current&&(e.current=!1,a())}),[a]);return(0,Dt.Ay)(Kt,n),{isFrozen:(0,r.OV)(),updateWhenUnfrozen:t}}(),l=(0,Ot.A)(t,!0);return(0,Rt.A)((()=>{i?o():l((()=>{s(e())}))}),[...a,i]),n}((()=>e),n,[e]),[o,l]=(0,r.J0)(""),c=e?i:e,m=(0,d.A)(t);return{...(0,xt.A)((async()=>{if(!c||s)return l(""),Promise.resolve(a);const e=await m(c);return l(c),e}),[c,a,m,s],a),currentResultsQuery:o}}({query:y,defaultValue:M}),D=U!==y,O=(0,r.Kr)((()=>U?Pt.p:[{type:"withdraw",isCustomPeer:!0,avatarIcon:"toncoin",peerColorId:5,title:f("GiftTransferTON")}]),[f,U]),R=(0,d.A)((e=>{"withdraw"===e&&(l({gift:h.gift}),o())})),K=(0,r.Kr)((()=>{if(D)return Pt.p;const e=(0,n.mS)();return(0,I.A)((x||[]).filter((t=>t!==a&&(0,i.X2D)(e,t))),!1)}),[D,x,a]),F=(0,d.A)((()=>{N(void 0)}));(0,r.vJ)((()=>{u||N(void 0)}),[u]);const L=(0,d.A)((()=>{h?.gift.inputGift&&(c({gift:h.gift.inputGift,recipientId:C,transferStars:h.gift.transferStars}),F(),o())}));return r.Ay.createElement(w.A,{isOpen:u,onClose:o,title:f("GiftTransferTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,ignoreFreeze:!0},r.Ay.createElement(G.A,{itemIds:K,categories:O,onSelectedCategoryChange:R,withDefaultPadding:!0,withPeerUsernames:!0,isSearchable:!0,noScrollRestore:!0,isLoading:D,filterValue:y,filterPlaceholder:f("Search"),onFilterChange:g,onSelectedIdChange:N}),S&&r.Ay.createElement(ct.A,{isOpen:Boolean(v),noDefaultTitle:!0,onClose:F,confirmLabel:h?.gift.transferStars?f("GiftTransferConfirmButton",{amount:le(f,h.gift.transferStars,{asFont:!0})},{withNodes:!0}):f("GiftTransferConfirmButtonFree"),confirmHandler:L},r.Ay.createElement("div",{className:Lt.header},r.Ay.createElement("div",{className:Lt.giftPreview},r.Ay.createElement(Q.A,{className:Lt.backdrop,backgroundColors:[S.backdrop.centerColor,S.backdrop.edgeColor],patternColor:S.backdrop?.patternColor,patternIcon:S.pattern?.sticker}),r.Ay.createElement(W.A,{className:Lt.sticker,size:Jt,sticker:S.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:Lt.arrow}),r.Ay.createElement(A.A,{peer:T,size:zt,className:Lt.avatar})),r.Ay.createElement("p",null,h?.gift.transferStars?f("GiftTransferConfirmDescription",{gift:f("GiftUnique",{title:E.title,number:E.number}),amount:oe(f,h.gift.transferStars),peer:(0,s.F9N)(f,T)},{withNodes:!0,withMarkdown:!0}):f("GiftTransferConfirmDescriptionFree",{gift:f("GiftUnique",{title:E.title,number:E.number}),peer:(0,s.F9N)(f,T)},{withNodes:!0,withMarkdown:!0}))))})))},81949:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(84051),n=a(87357);const s=({children:e,className:t,onClick:a})=>r.Ay.createElement("div",{className:(0,n.A)("hJUqHi4B",a&&"hjDEmFaT",t),onClick:a},e)},84991:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(84051),n=a(87357),s=a(21849),i=a(18276);const o={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"},l=(0,r.ph)((({peer:e,avatarWebPhoto:t,avatarSize:a,text:l,badgeText:c,badgeIcon:m,className:d,badgeClassName:u,badgeIconClassName:A,textClassName:p,onClick:f})=>r.Ay.createElement("div",{className:(0,n.A)(o.root,f&&o.clickable,d),onClick:f},r.Ay.createElement("div",{className:o.top},r.Ay.createElement(s.A,{size:a,peer:e,webPhoto:t}),c&&r.Ay.createElement("div",{className:(0,n.A)(o.badge,u)},m&&r.Ay.createElement(i.A,{name:m,className:A}),c)),l&&r.Ay.createElement("p",{className:(0,n.A)(o.text,p)},l))))},34642:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(84051),n=a(87357),s=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 r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},l.apply(this,arguments)}const c=(0,r.ph)((({confirmButtonText:e,isConfirmDisabled:t,shouldAdaptToSearch:a,withFixedHeight:c,onConfirm:m,withPremiumGradient:d,...u})=>{const A=(0,s.A)(),p=Boolean(e||m);return r.Ay.createElement(o.A,l({},u,{isSlim:!0,className:(0,n.A)(a&&"WGSZ8u75",c&&"CrEsDylb",u.className),contentClassName:(0,n.A)("FuFYE0AA",u.contentClassName),headerClassName:(0,n.A)("iEptOmIp",u.headerClassName)}),u.children,p&&r.Ay.createElement("div",{className:"HqeDTaSr"},r.Ay.createElement(i.A,{withPremiumGradient:d,onClick:m||u.onClose,color:"primary",size:"smaller",disabled:t},e||A("Confirm"))))}))},5463:(e,t,a)=>{a.d(t,{A:()=>m});var r=a(84051),n=a(87357),s=a(18276),i=a(64493),o=a(22720),l=a(8410),c=a(32581);const m=(0,r.ph)((({isOpen:e,listItemData:t,headerIconName:a,header:m,footer:d,buttonText:u,hasBackdrop:A,withSeparator:p,onClose:f,onButtonClick:y,contentClassName:g})=>r.Ay.createElement(l.A,{isOpen:e,className:(0,n.A)("LAh8evux",g),contentClassName:"hrizpMDe",hasAbsoluteCloseButton:!0,absoluteCloseButtonColor:A?"translucent-white":void 0,onClose:f},a&&r.Ay.createElement("div",{className:"jySLtQNG"},r.Ay.createElement(s.A,{name:a})),m,r.Ay.createElement("div",null,t?.map((([e,t,a])=>r.Ay.createElement(o.A,{isStatic:!0,multiline:!0,icon:e,iconClassName:"hQbEPsTU"},r.Ay.createElement("span",{className:"title"},t),r.Ay.createElement("span",{className:"subtitle"},a))))),p&&r.Ay.createElement(c.A,{className:"En1zD2cT"}),d,u&&r.Ay.createElement(i.A,{size:"smaller",onClick:y||f},u))))},70046:(e,t,a)=>{a.d(t,{A:()=>u});var r=a(84051),n=a(13439),s=a(87357),i=a(17712),o=a(21849),l=a(10187),c=a(64493),m=a(8410);const d="Cnh5ENvm",u=(0,r.ph)((({isOpen:e,title:t,tableData:a,headerAvatarPeer:u,header:A,modalHeader:p,footer:f,buttonText:y,className:g,hasBackdrop:h,onClose:E,onButtonClick:S})=>{const{openChat:v}=(0,n.ko)(),N=(0,i.A)((e=>{v({id:e}),E()}));return r.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:h?"translucent-white":void 0,isSlim:!0,header:p,title:t,className:g,contentClassName:"KYHkJ9Qf",onClose:E},u&&r.Ay.createElement(o.A,{peer:u,size:"jumbo",className:"SHQbPR5Y"}),A,r.Ay.createElement("div",{className:"DFRB0Ad4"},a?.map((([e,t])=>r.Ay.createElement(r.Ay.Fragment,null,e&&r.Ay.createElement("div",{className:(0,s.A)(d,"AwnUe4Qk")},e),r.Ay.createElement("div",{className:(0,s.A)(d,"JGH6P9Az",!e&&"UssCZwgy")},"object"==typeof t&&"chatId"in t?r.Ay.createElement(l.A,{peerId:t.chatId,className:"aS9U4hiQ",forceShowSelf:!0,withEmojiStatus:t.withEmojiStatus,clickArg:t.chatId,onClick:N}):t))))),f,y&&r.Ay.createElement(c.A,{className:f?void 0:"cSamlkt9",size:"smaller",onClick:S||E},y))}))},1526:(e,t,a)=>{a.d(t,{A:()=>f});var r=a(84051),n=a(87357),s=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"},f=(0,r.ph)((({isActive:e,className:t,options:a,selectedStarOption:f,selectedStarCount:y,starsNeeded:g,onClick:h})=>{const E=(0,m.A)(),S=(0,c.A)(),[v,N,b]=(0,l.A)();(0,r.vJ)((()=>{e||b()}),[e]);const[C,k]=(0,r.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=g&&e.stars<g,r=[];let n=0,s=!1;return a.forEach(((e,i)=>{e.isExtended||n++,g&&!t&&e.stars<g||(v||!e.isExtended?r.push({option:e,starsCount:Math.min(n,6),isWide:i===a.length-1}):s=!0)})),[r,s]}),[v,a,g]);return r.Ay.createElement("div",{className:(0,n.A)(p.options,t)},C?.map((({option:e,starsCount:t,isWide:a})=>{const l=C?.length,c=l%2==0,m=e===f;let d;if(e&&"winners"in e){const t=e.winners.find((e=>e.users===y))||e.winners.reduce(((e,t)=>t.users>e.users?t:e),e.winners[0]);d=t?.perUserStars}return r.Ay.createElement("div",{className:(0,n.A)(p.option,!c&&a&&p.wideOption,m&&p.active),key:e.stars,onClick:()=>h?.(e)},r.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(e.stars),r.Ay.createElement("div",{className:p.stackedStars,dir:S.isRtl?"ltr":"rtl"},Array.from({length:t}).map((()=>r.Ay.createElement(u.A,{className:p.stackedStar,type:"gold",size:"big"}))))),r.Ay.createElement("div",{className:p.optionBottom},(0,s.v)(e.amount,e.currency,E.code)),(m||f&&"winners"in f)&&d&&r.Ay.createElement("div",{className:p.optionBottom},r.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(E("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!v&&k&&r.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:N},E("Stars.Purchase.ShowMore"),r.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))},65632:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(84051),n=a(13439),s=a(31481),i=a(74824),o=a(87679);const l=(e,t)=>{const{setThemeSettings:a}=(0,n.ko)(),[l,c]=(0,r.J0)(t);return(0,r.vJ)((()=>{t&&(t.startsWith("#")?c(t):i.fetch(s.nfi,e,i.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,o.NN)(t).then((()=>{c(`url(${t})`)}))})).catch((()=>{a({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?s.MkD:s.be8})})))}),[t,e]),t?l:void 0}}}]);
|
|
//# sourceMappingURL=6930.8bffe8d477c708ed4dc8.js.map
|