2 lines
80 KiB
JavaScript
2 lines
80 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{50789:(e,t,a)=>{a.r(t),a.d(t,{ChatRefundModal:()=>Yt,GiftInfoModal:()=>Ct,GiftModal:()=>ut,GiftRecipientPicker:()=>At,GiftResalePriceComposerModal:()=>kt,GiftStatusInfoModal:()=>Ut,GiftTransferModal:()=>Xt,GiftUpgradeModal:()=>Tt,GiftWithdrawModal:()=>Lt,PaidReactionModal:()=>qe,StarPaymentModal:()=>ue,StarsBalanceModal:()=>oe,StarsGiftModal:()=>N,StarsGiftingPickerModal:()=>P,StarsSubscriptionModal:()=>be,StarsTransactionInfoModal:()=>ve});var r=a(84051),s=a(13439),n=a(70636),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(84685),y=a(64493),h=a(22337),g=a(1526);const S={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"},E=a.p+"StarLogo.600328787c79d99dfd66.svg",v=a.p+"stars-bg.dee4c4b73c7d21c2ec73.png",N=(0,r.ph)((0,s.EK)(((e,{modal:t})=>({user:t?.forUserId?(0,i.mBe)(e,t.forUserId):void 0})))((({modal:e,user:t})=>{const{closeStarsGiftModal:a,openInvoice:i,requestConfetti:N}=(0,s.ko)(),b=(0,r.li)(null),C=Boolean(e?.isOpen),I=(0,m.A)(e),k=(0,u.A)(),[G,w]=(0,r.J0)(),[P,B]=(0,r.J0)(!0);(0,r.vJ)((()=>{C||B(!0)}),[C]);const T=(0,d.A)((()=>{const e=b.current;if(e&&C){const{top:t,left:a,width:r,height:s}=e.querySelector(".modal-content").getBoundingClientRect();N({top:t,left:a,width:r,height:s,withStars:!0})}}));(0,r.vJ)((()=>{I?.isCompleted&&T()}),[I,T]);const M=(0,d.A)((e=>{I&&(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}))})),U=(0,d.A)((()=>{a()})),x=(0,r.Kr)((()=>{const e=k("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:k("StarsTOSLink"),text:k("lng_credits_summary_options_about_link")}),e[1]]}),[k]);return r.Ay.createElement(h.A,{className:(0,o.A)(S.modalDialog),contentClassName:S.content,dialogRef:b,isSlim:!0,onClose:U,isOpen:C},r.Ay.createElement("div",{className:(0,o.A)(S.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;B(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:S.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:k("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement("div",{className:(0,o.A)(S.header,P&&S.hiddenHeader)},r.Ay.createElement("h2",{className:S.starHeaderText},k(t?"GiftStarsTitle":"Star.List.GetStars"))),r.Ay.createElement("div",{className:S.headerInfo},t?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:100,peer:t,className:S.avatar}),r.Ay.createElement("img",{className:S.logoBackground,src:v,alt:"",draggable:!1})):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("img",{className:S.logo,src:E,alt:"",draggable:!1}),r.Ay.createElement("img",{className:S.logoBackground,src:v,alt:"",draggable:!1}))),r.Ay.createElement("h2",{className:(0,o.A)(S.headerText,S.center)},I?.isCompleted?t?(0,c.A)(k("Notification.StarsGift.SentYou",(0,l.A)(G.amount,G.currency,k.code)),["simple_markdown"]):(0,c.A)(k("StarsAcquiredInfo",G?.stars),["simple_markdown"]):k(t?"GiftStarsTitle":"Star.List.GetStars")),r.Ay.createElement("p",{className:S.description},t?(0,c.A)(k("ActionGiftStarsSubtitle",(0,n.F9)(k,t)),["simple_markdown"]):k("Stars.Purchase.GetStarsInfo")),r.Ay.createElement("div",{className:S.section},r.Ay.createElement(g.A,{options:I?.starsGiftOptions,onClick:M}),r.Ay.createElement("div",{className:S.secondaryInfo},x))))})));var b=a(31481),C=a(90709),I=a(87894),k=a(79582),G=a(54960),w=a(34642);const P=(0,r.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,r.J0)(""),f=(0,r.Kr)((()=>{const e=(0,s.mS)().users.byId,r=(0,I.Am)([...o||[],...a||[],...i||[]]),l=(0,n.PU)({ids:r,query:A,type:"user"});return(0,k.A)(l.filter((a=>{const r=e[a];return!(!r||r.isSupport||(0,C.tv)(r)||(0,C.PL)(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 B=a(37661),T=a(39351),M=a(46222),U=a(24680),x=a(41036),R=a(86046),D=a(81949),O=a(9267);const F={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",addStarsButton:"dqnGL2uh",addStarsIcon:"w9Db2eiK",balanceBlock:"Yk0OQBKC",balanceInfo:"p2dW9NOV",smallerText:"rUnPcfmE",balanceBottom:"F5BTkZ9G",modalBalance:"t8tMrx3y",starButton:"oOt4VBD2",paymentContent:"OReEUNTV",paymentImages:"oKorQYTC",paymentPhoto:"HGTrEtUF",avatarStar:"Wu10dXoa",paymentImageBackground:"os8jb_qv",paymentButton:"VzR5cibf",paymentButtonStar:"Uhg7yWxK",transactions:"Qvc0fTTH",subscriptions:"IX5BhCUF",tabs:"KZVEyKOX",disclaimer:"bpVifdwH",amountBadge:"BPM7LKwo",loadMore:"TKmZjMyd",loadMoreIcon:"buepwtN1"},L=(0,r.ph)((({balance:e,className:t,withAddButton:a})=>{const n=(0,T.A)(),{openStarsBalanceModal:i}=(0,s.ko)();return r.Ay.createElement("div",{className:(0,o.A)(F.balanceBlock,t)},r.Ay.createElement("div",{className:F.balanceInfo},r.Ay.createElement("span",{className:F.smallerText},n("StarsBalance")),r.Ay.createElement("div",{className:F.balanceBottom},r.Ay.createElement(O.A,{type:"gold",size:"middle"}),void 0!==e?(0,R.ZF)(n,e):"…",a&&r.Ay.createElement(D.A,{className:F.addStarsButton,onClick:()=>i({})},r.Ay.createElement(p.A,{className:F.addStarsIcon,name:"add"})))))}));var K=a(17663),z=a(14242),q=a(63527);const V={root:"ZXnbeQxP",info:"zLaaDX3c",status:"HbF2qTB2",statusPricing:"AveGvpdV",amount:"_CBiOQcv",title:"k9ZIv5Pd",description:"FlRlxMx2",subtitle:"YN2J8dw6",statusPeriod:"MRrP7Oew",statusEnded:"pRHwfr8m",preview:"t6Syyhzd",subscriptionStar:"ftlbevPm"},J=(0,r.ph)((({subscription:e})=>{const{openStarsSubscriptionModal:t}=(0,s.ko)(),{peerId:a,pricing:o,until:l,isCancelled:m,title:p,photo:f}=e,y=(0,u.A)(),h=(0,q.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),g=(0,d.A)((()=>{t({subscription:e})}));if(!h)return;const S=l<Date.now()/1e3,E=(0,K.A)(1e3*l,y.code,!0,"long");return r.Ay.createElement("div",{className:V.root,onClick:g},r.Ay.createElement("div",{className:V.preview},r.Ay.createElement(A.A,{size:"medium",peer:h}),r.Ay.createElement(O.A,{className:V.subscriptionStar,type:"gold",size:"small"})),r.Ay.createElement("div",{className:V.info},r.Ay.createElement("h3",{className:V.title},(0,c.A)((0,n.F9)(y,h)||"")),p&&r.Ay.createElement("p",{className:V.subtitle},f&&r.Ay.createElement(A.A,{webPhoto:f,size:"micro"}),(0,c.A)(p)),r.Ay.createElement("p",{className:V.description},y(S?"StarsSubscriptionExpired":m?"StarsSubscriptionExpires":"StarsSubscriptionRenews",E))),r.Ay.createElement("div",{className:V.status},m||S?r.Ay.createElement("div",{className:V.statusEnded},y(S?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:V.statusPricing},r.Ay.createElement(O.A,{className:V.star,type:"gold",size:"adaptive"}),r.Ay.createElement("span",{className:V.amount},(0,z.Sm)(o.amount))),r.Ay.createElement("div",{className:V.statusPeriod},y("StarsParticipantSubscriptionPerMonth")))))}));var H=a(58968),W=a(66833);function j(e,t,a){if(a.paidMessages)return t("PaidMessageTransaction",{count:a.paidMessages},{withNodes:!0,pluralValue:a.paidMessages});if(a.isGiftResale)return _(a.stars)?t("StarGiftSaleTransaction"):t("StarGiftPurchaseTransaction");if(a.starRefCommision)return e("StarTransactionCommission",(0,z.l9)(a.starRefCommision));if(a.isGiftUpgrade)return e("Gift2TransactionUpgraded");if(a.extendedMedia)return e("StarMediaPurchase");if(a.subscriptionPeriod)return a.title||e("StarSubscriptionPurchase");if(a.isReaction)return e("StarsReactionsSent");if(a.giveawayPostId)return e("StarsGiveawayPrizeReceived");if(a.isMyGift)return e("StarsGiftSent");if(a.isGift)return e("StarsGiftReceived");if(a.starGift)return _(a.stars)?e("Gift2TransactionSent"):e("Gift2ConvertedTitle");const r=a.peer&&"peer"!==a.peer.type&&(0,R.Pc)(a.peer)||void 0;return r?r.title||e(r.titleKey):a.title}function _(e){return e.amount?e.amount<0:e.nanos<0}var Q=a(79577),X=a(40558),Y=a(62587),Z=a(27860);const $={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function ee({boughtMedia:e,index:t,className:a}){const s=e.video||e.photo,n=(0,C.VO)(s,"pictogram"),i=(0,C.VD)(s),l=(0,Y.A)(n);return r.Ay.createElement("div",{className:(0,o.A)($.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},i&&r.Ay.createElement("img",{className:$.blurry,src:i,alt:""}),l&&r.Ay.createElement("img",{className:$.full,src:l,alt:""}))}const te=(0,r.ph)((({media:e,className:t,isTransactionPreview:a,onClick:s})=>{const n=Math.min(e.length,a?2:3),i="mediaType"in e[0];return r.Ay.createElement("div",{className:(0,o.A)($.root,$[`itemCount${n}`],a&&$.preview,t),dir:"rtl",onClick:s},e.slice(0,n).reverse().map(((e,t,s)=>{const n=s.length-t-1;return"mediaType"in e?r.Ay.createElement(Z.A,{className:$.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):r.Ay.createElement(ee,{className:(0,o.A)(a&&n>0&&$.noOutline),boughtMedia:e,index:n})})),i&&r.Ay.createElement("div",{className:$.count},r.Ay.createElement(p.A,{name:"stars-lock"}),e.length>1?e.length:""))})),ae={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",giftSticker:"U3dqmnM4"},re=(0,r.ph)((({transaction:e,className:t})=>{const{openStarsTransactionModal:a}=(0,s.ko)(),{date:l,stars:m,photo:p,peer:f,extendedMedia:y,subscriptionPeriod:h}=e,g=(0,T.A)(),S=(0,u.A)(),E="peer"===f.type?f.id:void 0,v=(0,q.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(E)),N=e.starGift,b="starGiftUnique"===N?.type,C=N&&(0,W.yQ)(N),I=(0,r.Kr)((()=>{let t,a,r,s=j(S,g,e);if("peer"===e.peer.type)t=v&&(0,n.F9)(S,v),r=v||H.lw;else{const a=(0,R.Pc)(e.peer);s=a.title||S(a.titleKey),t=S(a.subtitleKey),r=a}return e.isGiftUpgrade&&"starGiftUnique"===e.starGift?.type&&(t=g("GiftUnique",{title:e.starGift.title,number:e.starGift.number})),e.isGiftResale&&"starGiftUnique"===e.starGift?.type&&(t=g("GiftUnique",{title:e.starGift.title,number:e.starGift.number})),e.photo&&(r=void 0),e.isRefund&&(a=S("StarsRefunded")),e.hasFailed&&(a=S("StarsFailed")),e.isPending&&(a=S("StarsPending")),{title:s,description:t,avatarPeer:r,status:a}}),[S,g,v,e]),k=(0,r.Kr)((()=>{if(b){const{backdrop:e}=(0,W.uc)(N),t=[e.centerColor,e.edgeColor];return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(X.A,{className:ae.uniqueGiftBackground,backgroundColors:t}),r.Ay.createElement(Q.A,{className:ae.giftSticker,sticker:C,size:36,play:!1}))}return C?r.Ay.createElement(Q.A,{className:ae.giftSticker,sticker:C,size:36,play:!1}):y?r.Ay.createElement(te,{media:y,isTransactionPreview:!0}):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"medium",webPhoto:p,peer:I.avatarPeer}),Boolean(h)&&r.Ay.createElement(O.A,{className:ae.subscriptionStar,type:"gold",size:"small"}))}),[b,y,p,I.avatarPeer,h,N,C]),G=(0,d.A)((()=>{a({transaction:e})}));return r.Ay.createElement("div",{className:(0,o.A)(ae.root,t),onClick:G},r.Ay.createElement("div",{className:ae.preview},k),r.Ay.createElement("div",{className:ae.info},r.Ay.createElement("h3",{className:ae.title},I.title),I.description&&r.Ay.createElement("p",{className:ae.description},(0,c.A)(I.description)),r.Ay.createElement("p",{className:ae.date},(0,K.L2)(1e3*l,S.code,!0),I.status&&` — (${I.status})`)),r.Ay.createElement("div",{className:ae.stars},r.Ay.createElement("span",{className:(0,o.A)(ae.amount,_(m)?ae.negative:ae.positive)},(0,R.hk)(g,m)),r.Ay.createElement(O.A,{className:ae.star,type:"gold",size:"adaptive"})))})),se=["all","inbound","outbound"],ne=["StarsTransactionsAll","StarsTransactionsIncoming","StarsTransactionsOutgoing"],ie="StarsTransactionItem",oe=(0,r.ph)((0,s.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:S,openStarsGiftingPickerModal:N,openInvoice:I}=(0,s.ko)(),{balance:k,history:G,subscriptions:w}=t||{},P=(0,u.A)(),R=(0,T.A)(),[D,O]=(0,r.J0)(!0),[K,z]=(0,r.J0)(0),[q,V,H]=(0,B.A)(),W=Boolean(e&&t),{originStarsPayment:j,originReaction:_,originGift:Q,topup:X}=e||{},Y=j||_||Q||X,Z=j?.form?.invoice?.totalAmount||j?.subscriptionInfo?.subscriptionPricing?.amount||_?.amount||Q?.gift.stars||X?.balanceNeeded,$=Z?Z-(k?.amount||0):void 0,ee=(0,r.Kr)((()=>{const e=(0,s.mS)();if(_){const t=(0,i.hds)(e,_.chatId);if(!t)return;return P("StarsNeededTextReactions",(0,C.Js)(P,t))}if(j){const t=j.form?.botId?(0,i.mBe)(e,j.form.botId):void 0;if(!t)return;return P("StarsNeededText",(0,C.Yg)(t))}if(Q){const t=(0,i.mBe)(e,Q.peerId);if(!t)return;return P("StarsNeededTextGift",(0,n.F9)(R,t))}return"subs"===X?.purpose?P("StarsNeededTextLink"):X?.purpose===b.D3m?R("StarsNeededTextSendPaidMessages",void 0,{withMarkdown:!0,withNodes:!0}):void 0}),[_,j,Q,X?.purpose,R,P]),te=Boolean(G?.all?.transactions.length&&!Y),ae=!Y,oe=(0,r.Kr)((()=>ne.map((e=>({title:R(e)})))),[R]);(0,r.vJ)((()=>{W||(O(!0),z(0),H())}),[W]),(0,r.vJ)((()=>{Y?V():H()}),[Y]);const le=(0,r.Kr)((()=>{if(!W)return;const e=P("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:P("StarsTOSLink"),text:P("lng_credits_summary_options_about_link")}),e[1]]}),[W,P]),ce=(0,d.A)((()=>{A({type:se[K]})})),me=(0,d.A)((()=>{S()})),de=(0,d.A)((()=>{N({})})),ue=(0,d.A)((e=>{I({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return r.Ay.createElement(h.A,{className:(0,o.A)(F.root,!l&&!q&&F.minimal),isOpen:W,onClose:m},r.Ay.createElement("div",{className:(0,o.A)(F.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;O(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:F.closeButton,color:"translucent",onClick:()=>m(),ariaLabel:R("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement(L,{balance:k,className:F.modalBalance}),r.Ay.createElement("div",{className:(0,o.A)(F.header,D&&F.hiddenHeader)},r.Ay.createElement("h2",{className:F.starHeaderText},P("TelegramStars"))),r.Ay.createElement("div",{className:F.section},r.Ay.createElement("img",{className:F.logo,src:E,alt:"",draggable:!1}),r.Ay.createElement("img",{className:F.logoBackground,src:v,alt:"",draggable:!1}),r.Ay.createElement("h2",{className:F.headerText},$?P("StarsNeededTitle",Z):P("TelegramStars")),r.Ay.createElement("div",{className:F.description},(0,c.A)(ee||P("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!q&&r.Ay.createElement(y.A,{className:F.starButton,onClick:V},P("Star.List.BuyMoreStars")),a&&!q&&ae&&r.Ay.createElement(y.A,{isText:!0,noForcedUpperCase:!0,className:F.starButton,onClick:de},P("TelegramStarsGift")),q&&t?.topupOptions&&r.Ay.createElement(g.A,{starsNeeded:$,options:t.topupOptions,onClick:ue})),q&&r.Ay.createElement("div",{className:F.tos},le),te&&Boolean(w?.list.length)&&r.Ay.createElement("div",{className:F.section},r.Ay.createElement("h3",{className:F.sectionTitle},P("StarMySubscriptions")),r.Ay.createElement("div",{className:F.subscriptions},w?.list.map((e=>r.Ay.createElement(J,{key:e.id,subscription:e}))),w?.nextOffset&&r.Ay.createElement(y.A,{isText:!0,disabled:w.isLoading,size:"smaller",noForcedUpperCase:!0,className:F.loadMore,onClick:me},r.Ay.createElement(p.A,{name:"down",className:F.loadMoreIcon}),P("StarMySubscriptionsExpand")))),te&&r.Ay.createElement("div",{className:F.container},r.Ay.createElement("div",{className:F.section},r.Ay.createElement(x.Ay,{name:R.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:K,renderCount:ne.length,shouldRestoreHeight:!0,className:F.transition},r.Ay.createElement(M.A,{onLoadMore:ce,items:G?.[se[K]]?.transactions,scrollContainerClosest:`.${F.main}`,itemSelector:`.${ie}`,className:F.transactions,noFastList:!0,noScrollRestoreOnTop:!0},G?.[se[K]]?.transactions.map((e=>r.Ay.createElement(re,{key:`${e.id}-${e.isRefund}`,transaction:e,className:ie})))))),r.Ay.createElement(U.A,{className:F.tabs,tabClassName:F.tab,activeTab:K,tabs:oe,onSwitchTab:z}))))})));var le=a(48775),ce=a(29886),me=a(84991),de=a(10187);const ue=(0,r.ph)((0,s.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,s=r?(0,i.O5q)(e,r.chatId,r.messageId):void 0,n=r?(0,i.hds)(e,r.chatId):void 0,o=s?.content.paidMedia;return{bot:a,starsBalanceState:e.stars,paidMediaMessage:o?s:void 0,paidMediaChat:o?n:void 0}}))((({modal:e,bot:t,starsBalanceState:a,paidMediaMessage:n,paidMediaChat:i})=>{const{closeStarsPaymentModal:l,openStarsBalanceModal:m,sendStarPaymentForm:p}=(0,s.ko)(),[g,S,E]=(0,B.A)(),N=Boolean(e?.inputInvoice&&a),b=(0,ce.A)(e),I=e||b,{form:k,subscriptionInfo:G}=I||{},w=k?.invoice?.totalAmount||G?.subscriptionPricing?.amount,P=Boolean(k?.invoice.subscriptionPeriod),M=!G?.subscriptionPricing,U=k?.photo,x=(0,u.A)(),R=(0,T.A)();(0,r.vJ)((()=>{N||E()}),[N]);const D=(0,r.Kr)((()=>{if(!I?.inputInvoice)return"";const e=(0,C.Yg)(t),a=x("Stars.Intro.PurchasedText.Stars",w);if(n){const e=n.content.paidMedia.extendedMedia,t=e.every((e=>!e.duration)),r=e.every((e=>!!e.duration)),s=x(t?"Stars.Transfer.Photos":r?"Stars.Transfer.Videos":"Media",e.length),o=(0,C.Js)(x,i);return x("Stars.Transfer.UnlockInfo",[s,o,a])}return G?R("StarsSubscribeText",{chat:G.title,amount:w},{withNodes:!0,withMarkdown:!0,pluralValue:w}):P?R("StarsSubscribeBotText",{name:k.title,amount:w,bot:e},{pluralValue:w}):x("Stars.Transfer.Info",[k.title,e,a])}),[I?.inputInvoice,t,x,w,n,G,P,k,i,R]),K=(0,r.Kr)((()=>{if(G)return R("StarsSubscribeInfo",{link:r.Ay.createElement(f.A,{url:R("StarsSubscribeInfoLink"),text:R("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[G,R]),q=(0,r.Kr)((()=>{if(G)return(0,C.nr)(G)}),[G]),V=(0,d.A)((()=>{const t=a?.balance;void 0!==w&&void 0!==t&&(w>t.amount?m({originStarsPayment:e}):(p({}),S()))}));return r.Ay.createElement(h.A,{contentClassName:F.paymentContent,isOpen:N,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:l},r.Ay.createElement(L,{balance:a?.balance,className:F.modalBalance}),r.Ay.createElement("div",{className:F.paymentImages,dir:x.isRtl?"ltr":"rtl"},n?r.Ay.createElement(te,{media:n.content.paidMedia.extendedMedia}):q?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{className:F.paymentPhoto,peer:q,size:"giant"}),r.Ay.createElement(O.A,{type:"gold",size:"adaptive",className:F.avatarStar})):r.Ay.createElement(me.A,{peer:U?void 0:t,avatarWebPhoto:U,avatarSize:"giant",badgeIcon:"star",badgeText:(0,z.Sm)(w),badgeClassName:F.amountBadge,className:F.paymentPhoto}),r.Ay.createElement("img",{className:F.paymentImageBackground,src:v,alt:"",draggable:!1})),r.Ay.createElement("h2",{className:F.headerText},x(q?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),M&&r.Ay.createElement(de.A,{className:F.botItem,peerId:k?.botId}),r.Ay.createElement("div",{className:F.description},(0,c.A)(D,["simple_markdown","emoji"])),r.Ay.createElement(y.A,{className:F.paymentButton,size:"smaller",onClick:V,isLoading:g},R(P?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:(0,le.U)(R,w,{asFont:!0})},{withNodes:!0})),K&&r.Ay.createElement("div",{className:(0,o.A)(F.disclaimer,F.smallerText)},K))})));var Ae=a(89925),pe=a(85982),fe=a(70046),ye=a(95807);const he=(0,r.ph)((({modelAttribute:e,backdropAttribute:t,patternAttribute:a,title:s,subtitle:n,className:i,resellPrice:l})=>{const c=(0,T.A)(),m=function(e,t){const a=(0,r.li)(0);let s=!1;return(0,r.Kr)((()=>{a.current+=1,s=!0}),e),a.current}([e,t,a]),d=t?.textColor,u=(0,r.Kr)((()=>{const e=[t.centerColor,t.edgeColor],s=t.patternColor;return r.Ay.createElement(X.A,{className:"UvhsGZLf",backgroundColors:e,patternColor:s,patternIcon:a.sticker})}),[t,a]);return r.Ay.createElement("div",{className:(0,o.A)("irv1C8bo",i)},r.Ay.createElement(x.Ay,{className:"Tu6_OHoq",slideClassName:"iUTKLzTN",activeKey:m,direction:1,name:"zoomBounceSemiFade"},u,r.Ay.createElement(Q.A,{className:"a1ASgPwu",sticker:e.sticker,size:120})),s&&r.Ay.createElement("h1",{className:"ECTvfOda"},s),n&&r.Ay.createElement("p",{className:"S6JwvHWD",style:(0,ye.A)(d&&`color: ${d}`)},n),l&&r.Ay.createElement("p",{className:"zTVWZg63"},r.Ay.createElement("span",null,(0,R.hk)(c,l)),r.Ay.createElement(O.A,{type:"gold",size:"middle"})))})),ge="qBOIq6Jn",Se="sso9uZM6",Ee="NuWOY7ED",ve=(0,r.ph)((0,s.EK)(((e,{modal:t})=>{const a="peer"===t?.transaction?.peer?.type&&t.transaction.peer.id,r=a?(0,i.PVB)(e,a):void 0,s=e.appConfig?.starsPaidMessageCommissionPermille,n=t?.transaction.stars,o=t?.transaction.isGift&&(0,i.WLj)(e,n?.amount);return{peer:r,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:o,paidMessageCommission:s}}))((({modal:e,peer:t,canPlayAnimatedEmojis:a,topSticker:n,paidMessageCommission:i})=>{const{showNotification:l,openMediaViewer:c,closeStarsTransactionModal:m}=(0,s.ko)(),y=(0,T.A)(),h=(0,u.A)(),{transaction:g}=e||{},S=(0,d.A)((()=>{const e=g?.extendedMedia;e&&c({origin:Ae.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),E=(0,r.Kr)((()=>{if(!g)return;const{giveawayPostId:e,photo:s,stars:c,isGiftUpgrade:m,starGift:d,isGiftResale:u}=g,E=g?.starGift,N="starGiftUnique"===E?.type,b=g?.starGift?(0,W.yQ)(g.starGift):n,I=N?(0,W.uc)(E):void 0,k=g.peer&&"peer"!==g.peer.type&&(0,R.Pc)(g.peer)||void 0,G="peer"===g.peer?.type?g.peer.id:void 0,w=g.peer&&h(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)),P=j(h,y,g),B=t&&g.messageId&&!m?(0,C.yt)(t,void 0,g.messageId):void 0,T=t&&e&&(0,C.yt)(t,void 0,e),M=g.extendedMedia,U=M?.length||0,x=M?.every((e=>!e.video)),D=M?.every((e=>!e.photo)),F=h(x?"Stars.Transfer.Photos":D?"Stars.Transfer.Videos":"Media",U),L=g.description||(m&&"starGiftUnique"===d?.type?d.title:void 0)||(M?F:void 0),q=!M&&!b,V=s?void 0:t||k,J=N&&r.Ay.createElement("div",{className:(0,o.A)(ge,"ApoQz22o")},r.Ay.createElement(he,{backdropAttribute:I.backdrop,patternAttribute:I.pattern,modelAttribute:I.model,title:E.title,subtitle:y("GiftInfoCollectible",{number:E.number}),resellPrice:g.stars})),H=r.Ay.createElement("div",{className:ge},M&&r.Ay.createElement(te,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:M,onClick:S}),!M&&b&&r.Ay.createElement(Q.A,{key:g.id,sticker:b,play:a,noLoop:!0}),q&&r.Ay.createElement(A.A,{peer:V,webPhoto:s,size:"giant"}),!b&&r.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:v,alt:"",draggable:!1}),P&&r.Ay.createElement("h1",{className:"ZZAj3hj7"},P),r.Ay.createElement("p",{className:Ee},L),r.Ay.createElement("p",{className:Se},r.Ay.createElement("span",{className:(0,o.A)(Se,_(c)?"xDyq9cc0":"jvBZSrpd")},(0,R.hk)(y,c)),r.Ay.createElement(O.A,{type:"gold",size:"middle"}),g.isRefund&&r.Ay.createElement("p",{className:"sxWAwxTd"},y("Refunded"))),g.paidMessages&&g.starRefCommision&&i&&r.Ay.createElement("p",{className:Ee},y("PaidMessageTransactionDescription",{percent:(0,z.l9)(i/10)},{withNodes:!0,withMarkdown:!0}))),X=[];let Y;!g||g.paidMessages||u||X.push([h("StarsTransaction.StarRefReason.Title"),h("StarsTransaction.StarRefReason.Program")]),m&&X.push([h("StarGiftReason"),h("StarGiftReasonUpgrade")]),u&&X.push([h("StarGiftReason"),_(g.stars)?y("StarGiftSaleTransaction"):y("StarGiftPurchaseTransaction")]),Y=m?h("Stars.Transaction.GiftFrom"):_(c)||g.isMyGift?h("Stars.Transaction.To"):!g.starRefCommision||g.paidMessages||u?h(G?"Star.Transaction.From":"Stars.Transaction.Via"):h("StarsTransaction.StarRefReason.Miniapp"),X.push([Y,G?{chatId:G}:w||""]),g.starRefCommision&&g.paidMessages&&X.push([y("PaidMessageTransactionTotal"),(0,le.U)(y,g.stars.amount/((100-g.starRefCommision)/100),{asFont:!1,className:"cU5QlvwL",containerClassName:"Z2YALGgl"})]),B&&X.push([h("Stars.Transaction.Reaction.Post"),r.Ay.createElement(f.A,{url:B,text:B})]),T&&(X.push([h("BoostReason"),r.Ay.createElement(f.A,{url:T,text:h("Giveaway")})]),X.push([h("Gift"),h("Stars",g.stars,"i")])),g.id&&X.push([h("Stars.Transaction.Id"),r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,pe.eM)(g.id),l({message:h("StarsTransactionIDCopied")})}},g.id),r.Ay.createElement(p.A,{className:"voCttFzS",name:"copy"}))]),X.push([h("Stars.Transaction.Date"),(0,K.L2)(1e3*g.date,h.code,!0)]);const Z=h("lng_credits_box_out_about").split("{link}");return{header:N?J:H,tableData:X,footer:r.Ay.createElement("span",{className:"KgzPpgS6"},Z[0],r.Ay.createElement(f.A,{url:h("StarsTOSLink"),text:h("lng_credits_summary_options_about_link")}),Z[1])}}),[g,h,y,t,a,n,i]),N=(0,ce.A)(E)||E;return r.Ay.createElement(fe.A,{isOpen:Boolean(g),className:"IzhfRIWu",hasBackdrop:"starGiftUnique"===g?.starGift?.type,header:N?.header,tableData:N?.tableData,footer:N?.footer,buttonText:h("OK"),onClose:m})}))),Ne="oBLHWBtJ",be=(0,r.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:i,changeStarsSubscription:l,checkChatInvite:c,loadStarStatus:m,openInvoice:p}=(0,s.ko)(),h=(0,u.A)(),g=(0,T.A)(),{subscription:S}=e||{},E=(0,r.Kr)((()=>{if(!S)return"hidden";if(S.canRefulfill)return"refulfill";const e=S.until>Date.now()/1e3;if(e&&!S.isCancelled)return"cancel";if(e&&S.isCancelled)return"renew";const t=S.chatInviteHash||S.invoiceSlug;return!e&&t?"restart":"ok"}),[S]),N=(0,d.A)((()=>{if(S){switch(E){case"refulfill":i({id:S.id});break;case"restart":S.chatInviteHash?c({hash:S.chatInviteHash}):S.invoiceSlug&&p({type:"slug",slug:S.invoiceSlug}),m();break;case"renew":l({id:S.id,isCancelled:!1});break;case"cancel":l({id:S.id,isCancelled:!0})}a()}})),C=(0,r.Kr)((()=>{if(!S||!t)return;const{pricing:e,until:a,isCancelled:s,canRefulfill:i,photo:l,title:c,hasBotCancelled:m}=S,d=(0,n.mO)(t),u=r.Ay.createElement("div",{className:"E3R22yAI"},r.Ay.createElement("div",{className:"wuTMXDP9"},r.Ay.createElement(A.A,{peer:l?void 0:t,webPhoto:l,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"},c||h("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"})}}))),p=[];p.push([h(d?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),c&&p.push([h("StarsSubscriptionBotProduct"),c]);const C=a<Date.now()/1e3;p.push([h(C?"StarsSubscriptionUntilExpired":s?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,K.L2)(1e3*a,h.code,!0)]);const I=g("StarsTransactionTOS",{link:r.Ay.createElement(f.A,{url:g("StarsTransactionTOSLink"),text:g("StarsTransactionTOSLinkText")})},{withNodes:!0});return{header:u,tableData:p,footer:r.Ay.createElement("span",{className:"GMWMuWCr"},r.Ay.createElement("p",{className:Ne},I),s&&r.Ay.createElement("p",{className:"nkwiG25Q"},h(m?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),i&&r.Ay.createElement("p",{className:Ne},h("StarsSubscriptionRefulfillInfo",(0,K.L2)(1e3*a,h.code,!0))),!s&&!i&&C&&r.Ay.createElement("p",{className:Ne},h("StarsSubscriptionExpiredInfo",(0,K.L2)(1e3*a,h.code,!0))),!s&&!i&&!C&&r.Ay.createElement("p",{className:Ne},h("StarsSubscriptionCancelInfo",(0,K.L2)(1e3*a,h.code,!0))),"hidden"!==E&&r.Ay.createElement(y.A,{size:"smaller",color:"cancel"===E?"danger":"primary",isText:"cancel"===E,onClick:N},h("cancel"===E?"StarsSubscriptionCancel":"refulfill"===E?"StarsSubscriptionRefulfill":"restart"===E?"StarsSubscriptionAgain":"renew"===E?"StarsSubscriptionRenew":"OK")))}}),[E,g,h,t,S]),I=(0,ce.A)(C)||C;return r.Ay.createElement(fe.A,{isOpen:Boolean(S),className:"eR_RZfGB",header:I?.header,tableData:I?.tableData,footer:I?.footer,onClose:a})})));var Ce=a(43874),Ie=a(34431),ke=a(19806),Ge=a(22699),we=a(24433),Pe=a(32581),Be=a(66644),Te=a(15283),Me=a(93545),Ue=a(68292),xe=a(85118);const Re={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},De=[50,100,500,1e3,2e3,5e3,1e4];function Oe(e,t){const a=e.findIndex((e=>t<=e)),r=e[a-1]||1,s=e[a]||e[e.length-1];return a+(t-r)/(s-r)}function Fe(e,t){const a=Math.floor(t),r=e[a-1]||1,s=r+((e[a]||e[e.length-1])-r)*(t-a);return Math.round(s)}const Le=(0,r.ph)((({maxValue:e,defaultValue:t,className:a,onChange:s})=>{const n=(0,r.li)(null),i=(0,r.Kr)((()=>{const t=[];for(let a=0;a<De.length;a++)if(De[a]<e&&t.push(De[a]),De[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,r.J0)(0);(0,Te.A)((()=>{c(Oe(i,t))}));const m=(0,d.A)((()=>{const e=n.current;if(!e)return;const t=e.parentElement;(0,Be.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,r=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,Be.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${r}px`)}))}))}));(0,Me.A)(n,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),s(Fe(i,t))}));return r.Ay.createElement("div",{className:(0,o.A)(Re.root,a),style:"--progress: "+l/i.length},r.Ay.createElement("div",{className:Re.floatingBadgeWrapper},r.Ay.createElement("div",{className:Re.floatingBadge,ref:n},r.Ay.createElement("div",{className:Re.floatingBadgeText},r.Ay.createElement(p.A,{name:"star",className:Re.floatingBadgeIcon}),r.Ay.createElement(Ue.A,{text:(0,z.Sm)(Fe(i,l))})),r.Ay.createElement("svg",{className:Re.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:Re.progress},r.Ay.createElement(xe.A,{preset:"progress",className:Re.sparkles})),r.Ay.createElement("input",{className:Re.slider,type:"range",min:0,max:i.length,defaultValue:Oe(i,t),step:"any",onChange:u}))})),Ke={content:"RdhRpsCn",title:"yzbjj73U",slider:"xePPMXOI",description:"BlpfdOtK",itemInfo:"nS9V516D",itemTitle:"sH5Nukjy",itemSubtitle:"dHlNODTI",itemIcon:"H_iHihXU",sendAsPeerButtonAvatar:"_mjvLELm",sendAsPeerMenuButton:"zxsRaWYV",buttonDownIcon:"zrwUUELS",sendAsPeerMenuBubble:"X1PB6mhQ",sendAsPeerMenu:"Px1MDij9",sendAsPeersMenuContainer:"Al1nfhHJ",headerControlPanel:"vu90kSL_",separator:"uhQLUjmo",checkBox:"Mc3bVeF0",topLabel:"bnou4CpV",top:"QludQDKR",topBadge:"JBF9pTUK",buttonStar:"NJJFuym9",topPeer:"Ty4Ud_Rd",disclaimer:"KRvkHeo1"},ze={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},qe=(0,r.ph)((0,s.EK)(((e,{modal:t})=>{const a=t&&(0,i.hds)(e,t.chatId),r=t&&(0,i.O5q)(e,t.chatId,t.messageId),s=e.stars?.balance,n=e.appConfig?.paidReactionMaxAmount||2500,o=e.settings.paidReactionPrivacy,l=a?.sendPaidReactionsAsPeerIds,c=e.currentUserId;return{chat:a,message:r,starBalance:s,maxAmount:n,defaultPrivacy:o,sendPaidReactionsAsPeerIds:l,currentUserId:c,currentUser:(0,i.mBe)(e,c)}}))((({modal:e,chat:t,message:a,maxAmount:l,starBalance:m,defaultPrivacy:g,sendPaidReactionsAsPeerIds:S,currentUserId:E,currentUser:v})=>{const{closePaidReactionModal:N,addLocalPaidReaction:C,loadSendPaidReactionsAs:I}=(0,s.ko)(),[k,G]=(0,r.J0)(50),[w,P,M]=(0,B.A)(),[U,x]=(0,r.J0)(!0),[R,D]=(0,r.J0)(E),O=t?.id,F=R?(0,i.PVB)((0,s.mS)(),R):v,K=(0,u.A)(),{isMobile:q}=(0,Ce.Ay)(),V=(0,T.A)(),J=(0,d.A)((e=>{x(!e.target.checked)})),H=(0,d.A)((e=>{G(e),P()}));(0,r.vJ)((()=>{O&&!S&&I({chatId:O})}),[O,S]);const W=(0,r.Kr)((()=>{const e=S?.map((e=>e.id)).filter((e=>e!==O));return e?.unshift(E),e}),[S,O,E]),j=W&&W.length>1;(0,r.vJ)((()=>{e||M()}),[e]),(0,r.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMy));if(e)return x(Boolean(e.isAnonymous)),void(e.peerId&&D(e.peerId));x("anonymous"===g?.type||!1),"peer"===g?.type&&W?.includes(g.peerId)?D(g.peerId):D(E)}),[g,a?.reactions?.topReactors,W,E]);const _=(0,d.A)((()=>{e&&(C({chatId:e.chatId,messageId:e.messageId,count:k,isPrivate:U,peerId:U||R===E?void 0:R,shouldIgnoreDefaultPrivacy:!0}),N())})),Q=(0,d.A)((e=>{x(!1),D(e)})),X=(0,d.A)((e=>{const t=(0,i.PVB)((0,s.mS)(),e),a=R===e&&!U;if(t)return r.Ay.createElement(we.A,{onClick:()=>Q(e)},r.Ay.createElement(A.A,{size:"small",peer:t}),r.Ay.createElement("div",{className:(0,o.A)(Ke.itemInfo)},r.Ay.createElement(Ie.A,{className:Ke.itemTitle,peer:t,noFake:!0,noVerified:!0}),r.Ay.createElement("span",{className:Ke.itemSubtitle},(0,n.mO)(t)?V("PeerPersonalAccount"):V("PeerChannel"))),r.Ay.createElement(p.A,{className:Ke.itemIcon,name:a?"check":"placeholder"}))})),Y=(0,r.Kr)((()=>({onTrigger:e,isOpen:t})=>r.Ay.createElement(y.A,{ripple:!q,size:"smaller",color:"translucent",className:(0,o.A)(Ke.sendAsPeerMenuButton,t?"active":""),onClick:e,ariaLabel:V("AccDescrOpenMenu2")},r.Ay.createElement(A.A,{className:Ke.sendAsPeerButtonAvatar,size:"mini",peer:U?ze:F}),r.Ay.createElement(p.A,{name:"down",className:Ke.buttonDownIcon}))),[q,V,F,U]),Z=(0,r.Kr)((()=>{if(j)return r.Ay.createElement(Ge.A,{className:(0,o.A)(Ke.sendAsPeerMenu,"with-menu-transitions"),bubbleClassName:Ke.sendAsPeerMenuBubble,trigger:Y,positionX:"right",autoClose:!0},W.map((e=>X(e))))}),[Y,W,j]),$=(0,r.Kr)((()=>{const e=(0,s.mS)(),t=a?.reactions?.topReactors;if(!t)return;const r=[];let n=!1,o=0;if(t.forEach((t=>{const a=t.peerId?(0,i.PVB)(e,t.peerId):void 0;if(!a&&!t.isAnonymous&&!t.isMy)return;if(t.isMy&&(o=t.count),t.isMy&&(t.peerId!==R||t.isAnonymous&&!U))return;const s=R===t.peerId||U&&t.isAnonymous;s&&(n=!0),r.push({amount:t.count,localAmount:s&&w?k:0,isMy:t.isMy,isAnonymous:t.isAnonymous,user:a})})),!n){const t=(0,i.PVB)(e,R);r.push({amount:o,localAmount:w?k:0,isMy:!0,user:t})}return r.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),r.slice(0,3)}),[w,a?.reactions?.topReactors,k,R,U]),ee=t&&(0,n.F9)(K,t);return r.Ay.createElement(h.A,{isOpen:Boolean(e),onClose:N,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:Ke.content,isLowStackPriority:!0},r.Ay.createElement("div",{className:Ke.sendAsPeersMenuContainer},Z),r.Ay.createElement("div",{className:Ke.headerControlPanel},r.Ay.createElement(L,{balance:m,className:Ke.modalBalance,withAddButton:!0})),r.Ay.createElement(Le,{className:Ke.slider,defaultValue:50,maxValue:l,onChange:H}),r.Ay.createElement("h3",{className:Ke.title},K("StarsReactionTitle")),r.Ay.createElement("div",{className:Ke.description},(0,c.A)(K("StarsReactionText",ee),["simple_markdown","emoji"])),r.Ay.createElement(Pe.A,null,$&&r.Ay.createElement("div",{className:Ke.topLabel},K("StarsReactionTopSenders"))),$&&r.Ay.createElement("div",{className:Ke.top},$.map((e=>{const t=(0,z.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMy&&U?ze:e.user,s="isCustomPeer"in a?K(a.titleKey):a&&(0,n.F9)(K,a);return r.Ay.createElement(me.A,{className:Ke.topPeer,key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:Ke.topBadge,text:s})}))),$&&r.Ay.createElement(Pe.A,{className:Ke.separator}),r.Ay.createElement(ke.A,{className:(0,o.A)(Ke.checkBox,"dialog-checkbox"),checked:!U,onChange:J,label:K("StarsReactionShowMeInTopSenders")}),r.Ay.createElement(y.A,{size:"smaller",onClick:_},V("SendPaidReaction",{amount:k},{withNodes:!0,specialReplacement:{[b.Cyx]:r.Ay.createElement(p.A,{className:Ke.buttonStar,name:"star"})}})),r.Ay.createElement("p",{className:Ke.disclaimer},V("StarsReactionTerms",{link:r.Ay.createElement(f.A,{text:V("StarsReactionLinkText"),url:V("StarsReactionLink")})},{withNodes:!0})))})));var Ve=a(37836),Je=a(5912),He=a(23174),We=a(65632),je=a(20333),_e=a(4523),Qe=a(96530),Xe=a(22720),Ye=a(63152),Ze=a(94079);const $e="zZUpGRSI",et="zAee80Dv",tt="nTPAv1ci",at=(0,r.ph)((0,s.EK)(((e,{peerId:t})=>{const a=(0,i.SJA)(e),{stars:r}=e,{isBlurred:s,patternColor:n,background:o,backgroundColor:l}=(0,i.Gyz)(e,a)||{},c=(0,i.PVB)(e,t),m=(0,i.WA9)(e,t),d=(0,i.vGo)(e,t),u=e.currentUserId===t,A=!u&&d?.disallowedGifts?.shouldDisallowUniqueStarGifts,p=!u&&d?.disallowedGifts?.shouldDisallowLimitedStarGifts,f=(0,i.nTw)(e);return{starBalance:r?.balance,peer:c,theme:a,isBackgroundBlurred:s,patternColor:n,customBackground:o,backgroundColor:l,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:f.isPaymentFormLoading,paidMessagesStars:m,areUniqueStarGiftsDisallowed:A,shouldDisallowLimitedStarGifts:p}}))((function({gift:e,giftByStars:t,peerId:a,peer:i,captionLimit:c,theme:m,isBackgroundBlurred:u,patternColor:A,backgroundColor:p,customBackground:f,currentUserId:h,isPaymentFormLoading:g,starBalance:S,paidMessagesStars:E,areUniqueStarGiftsDisallowed:v,shouldDisallowLimitedStarGifts:N}){const{sendStarGift:b,sendPremiumGiftByStars:C,openInvoice:I,openGiftUpgradeModal:k,openStarsBalanceModal:G}=(0,s.ko)(),w=(0,T.A)(),[P,B]=(0,r.J0)(""),[M,U]=(0,r.J0)(!1),[x,R]=(0,r.J0)(!1),[D,O]=(0,r.J0)(!1),F=(0,We.A)(m,f);(0,r.vJ)((()=>{N&&R(!0)}),[N,x]);const L="id"in e,K=t&&"amount"in t,z=i&&(0,n.mO)(i),q=a===h,V=(0,r.Kr)((()=>{if(!L){const a=D&&K?t:e;return{id:-1,chatId:"0",isOutgoing:!1,senderId:h,date:Math.floor(Date.now()/1e3),content:{action:{mediaType:"action",type:"giftPremium",amount:a.amount,currency:a.currency,months:e.months,message:P?{text:P}:void 0}}}}return{id:-1,chatId:"0",isOutgoing:!1,senderId:h,date:Math.floor(Date.now()/1e3),content:{action:{mediaType:"action",type:"starGift",message:P?.length?{text:P}:void 0,isNameHidden:M||void 0,starsToConvert:e.starsToConvert,canUpgrade:x||void 0,alreadyPaidUpgradeStars:x?e.upgradeStars:void 0,gift:e,peerId:a,fromId:h}}}}),[h,e,P,L,M,x,a,D,K,t]),J=(0,d.A)((e=>{B(e.target.value)})),H=(0,d.A)((()=>{U(!M)})),W=(0,d.A)((()=>{R(!x)})),j=(0,d.A)((()=>{K&&O(!D)})),_=(0,d.A)((()=>{L&&k({giftId:e.id,peerId:a})})),Q=(0,d.A)((()=>{G({})})),X=(0,d.A)((()=>{L?b({peerId:a,shouldHideName:M,gift:e,message:P?{text:P}:void 0,shouldUpgrade:x}):D&&K?C({userId:a,months:t.months,amount:t.amount,message:P?{text:P}:void 0}):I({type:"giftcode",userIds:[a],currency:e.currency,amount:e.amount,option:e,message:P?{text:P}:void 0})})),Y=K&&S&&S.amount>t.amount,Z=(0,o.A)("ZORVRSG3","soDpW2YR",f&&"Eny_G3JI",p&&"TkJZPU2u",f&&u&&"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: ${A}`,p&&`--theme-background-color: ${p}`)},r.Ay.createElement("div",{className:Z,style:F?`--custom-background: ${F}`:void 0}),r.Ay.createElement(_e.A,{key:L?e.id:e.months,message:V,threadId:He.l3,appearanceOrder:0})),function(){const a=c?c-P.length:void 0,s=(0,n.F9)(w,i);return r.Ay.createElement("div",{className:"Y68CEIKn"},!E&&r.Ay.createElement(Ze.A,{className:"o5r2IPoA",onChange:J,value:P,label:w("GiftMessagePlaceholder"),maxLength:c,maxLengthIndicator:a&&a<50?a.toString():void 0}),Y&&r.Ay.createElement(Xe.A,{className:$e,narrow:!0,ripple:!0,onClick:j},r.Ay.createElement("span",null,w("GiftPremiumPayWithStars",{stars:(0,le.U)(w,t.amount,{className:et})},{withNodes:!0})),r.Ay.createElement(Ye.A,{checked:D,onChange:j,label:w("GiftPremiumPayWithStarsAcc")})),K&&S&&r.Ay.createElement("div",{className:tt},w("GiftPremiumDescriptionYourBalance",{stars:(0,le.U)(w,S.amount,{className:et}),link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:Q},w("GetMoreStarsLinkText"))},{withNodes:!0,withMarkdown:!0})),L&&e.upgradeStars&&!v&&r.Ay.createElement(Xe.A,{className:$e,narrow:!0,ripple:!0,onClick:W,disabled:N},r.Ay.createElement("span",null,w("GiftMakeUnique",{stars:(0,le.U)(w,e.upgradeStars,{className:et})},{withNodes:!0})),r.Ay.createElement(Ye.A,{checked:x,onChange:W,label:w("GiftMakeUniqueAcc")})),L&&e.upgradeStars&&!v&&r.Ay.createElement("div",{className:tt},z?w("GiftMakeUniqueDescription",{user:s,link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:_},w("GiftMakeUniqueLink"))},{withNodes:!0}):w("GiftMakeUniqueDescriptionChannel",{peer:s,link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:_},w("GiftMakeUniqueLink"))},{withNodes:!0})),L&&r.Ay.createElement(Xe.A,{className:$e,narrow:!0,ripple:!0,onClick:H},r.Ay.createElement("span",null,w("GiftHideMyName")),r.Ay.createElement(Ye.A,{checked:M,onChange:H,label:w("GiftHideMyName")})),L&&r.Ay.createElement("div",{className:tt},q?w("GiftHideNameDescriptionSelf"):z?w("GiftHideNameDescription",{receiver:s}):w("GiftHideNameDescriptionChannel")))}(),r.Ay.createElement("div",{className:"ATowWJ60"}),function(){const a=D&&K?(0,le.U)(w,t.amount,{asFont:!0}):L?(0,le.U)(w,e.stars+(x?e.upgradeStars:0),{asFont:!0}):(0,l.v)(w,e.amount,e.currency);return r.Ay.createElement("div",{className:"jxWZSvet"},L&&e.availabilityRemains&&r.Ay.createElement(je.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:w("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:w("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),r.Ay.createElement(y.A,{className:"IDuhjrne",size:"smaller",onClick:X,isLoading:g},w("GiftSend",{amount:a},{withNodes:!0})))}())})));var rt=a(87049);const st="G1mBmzxs",nt="a8no5WH0",it=(0,r.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,optionByStars:n,onClick:i}){const{months:o,amount:c,currency:m}=s,u=(0,T.A)(),A=(0,d.A)((()=>{i(s)})),p=Math.floor(c/o),f=a&&a>p?Math.ceil(100-p/(a/100)):void 0;return r.Ay.createElement("div",{className:st,tabIndex:0,role:"button",onClick:A},r.Ay.createElement(Q.A,{sticker:e,play:t,noLoop:!0,nonInteractive:!0,size:86}),function(){const e=12===o?u("Years",{count:1},{pluralValue:1}):u("Months",{count:o},{pluralValue:o});return r.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),r.Ay.createElement("div",{className:"q4_ydkAx"},u("PremiumGiftDescription")),r.Ay.createElement(y.A,{className:nt,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(c,m)),n&&r.Ay.createElement("div",{className:"QB5SI7ta"},u("GiftPremiumStarsPrice",{stars:(0,le.U)(u,n.amount,{className:"jgnEfoeM"})},{withNodes:!0,withMarkdown:!0})),Boolean(f)&&r.Ay.createElement(rt.A,{color:"purple",text:u("GiftDiscount",{percent:f})}))}))),ot=(0,r.ph)((function({gift:e,observeIntersection:t,onClick:a}){const{openGiftInfoModal:n}=(0,s.ko)(),i=(0,r.li)(null),l=(0,T.A)(),[c,m]=(0,B.A)(),{stars:u,isLimited:A,isSoldOut:f,sticker:h}=e,g=(0,d.A)((()=>{f?n({gift:e}):a(e)}));return(0,Je.mv)(i,t,(e=>{e.isIntersecting&&m()})),r.Ay.createElement("div",{ref:i,className:(0,o.A)(st,"f5ArEO1S"),tabIndex:0,role:"button",onClick:g},r.Ay.createElement(Q.A,{sticker:h,noLoop:!0,play:c,nonInteractive:!0,size:90}),r.Ay.createElement(y.A,{className:nt,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(rt.A,{color:"blue",text:l("GiftLimited")}),f&&r.Ay.createElement(rt.A,{color:"red",text:l("GiftSoldOut")}))}));var lt=a(36838);const ct=(0,r.ph)((0,s.EK)((e=>{const{starGifts:t}=e;return{idsByCategory:t?.idsByCategory}}))((({idsByCategory:e,onCategoryChanged:t,areLimitedStarGiftsDisallowed:a})=>{const s=(0,r.li)(null),n=(0,T.A)(),i=(0,r.Kr)((()=>e&&Object.keys(e).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[e]),[l,c]=(0,r.J0)("all");function m(e){return r.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",l===e&&"B2lEJk1v"),onClick:()=>function(e){c(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,lt.A)(s,void 0,!0),r.Ay.createElement("div",{ref:s,className:(0,o.A)("cUjwvN00","no-scrollbar")},m("all"),!a&&m("limited"),m("stock"),i?.map(m))}))),mt={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"},dt=(0,Ve.nF)((e=>e()),200,!0),ut=(0,r.ph)((0,s.EK)(((e,{modal:t})=>{const{starGifts:a,stars:r,currentUserId:s}=e,n=t?.forPeerId?(0,i.PVB)(e,t.forPeerId):void 0,o=Boolean(s&&t?.forPeerId===s),l=n?(0,i.vGo)(e,n?.id):void 0;return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a?.byId,starGiftIdsByCategory:a?.idsByCategory,starBalance:r?.balance,peer:n,isSelf:o,disallowedGifts:l?.disallowedGifts}}))((({modal:e,starGiftsById:t,starGiftIdsByCategory:a,starBalance:i,peer:l,isSelf:c,disallowedGifts:p})=>{const{closeGiftModal:g}=(0,s.ko)(),S=(0,r.li)(null),E=(0,r.li)(null),N=(0,r.li)(null),I=(0,r.li)(null),k=Boolean(e),G=(0,m.A)(e),w=l&&(0,n.mO)(l)?l:void 0,P=l&&(0,n.vj)(l)?l:void 0,[B,M]=(0,r.J0)(),[U,R]=(0,r.J0)(!1),[D,O]=(0,r.J0)(!1),[F,K]=(0,r.J0)(!1),[z,q]=(0,r.J0)("all"),V=(0,r.Kr)((()=>{if(!p)return;const{shouldDisallowPremiumGifts:e,...t}=p;return!c&&Object.values(t).every(Boolean)}),[c,p]),J=!c&&p?.shouldDisallowUnlimitedStarGifts,H=!c&&p?.shouldDisallowLimitedStarGifts,W=(0,u.A)(),j=(0,T.A)(),_=G?.gifts,Q=(0,r.Kr)((()=>_?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users&&"XTR"!==e.currency))),[_]),X=(0,r.Kr)((()=>{const e=new Map;return Q?(Q.forEach((t=>{const a=_?.find((e=>e.currency===b.OUy&&e.months===t.months));a&&e.set(t,a)})),e):e}),[_,Q]),Y=(0,r.Kr)((()=>Q?.reduce(((e,t)=>e.amount<t.amount?e:t))),[Q]),{observe:Z}=(0,Je.BL)({rootRef:I,throttleMs:200,isDisabled:!k}),$=Boolean(B),ee=$||U,te=$?F:D;(0,r.vJ)((()=>{k||(R(!1),M(void 0),q("all"))}),[k]);const ae=(0,d.A)((e=>{if($)return;const t=e.currentTarget;dt((()=>{const{scrollTop:e}=t;if(R(e>150),E.current&&N.current){const{top:e}=N.current.getBoundingClientRect(),{top:t}=E.current.getBoundingClientRect();O(e-t<=0)}}))})),re=j("GiftPremiumDescription",{user:(0,C.Yg)(w),link:r.Ay.createElement(f.A,{text:j("GiftPremiumDescriptionLinkCaption"),url:j("GiftPremiumDescriptionLink")})},{withNodes:!0}),se=P?j("StarGiftDescriptionChannel",{peer:(0,n.F9)(j,P)},{withNodes:!0,withMarkdown:!0}):c?j("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):j("StarGiftDescription",{user:(0,C.Yg)(w)},{withNodes:!0,withMarkdown:!0}),ne=(0,d.A)((e=>{M(e),K("id"in e)})),ie=(0,d.A)((e=>{q(e)})),oe=(0,d.A)((()=>{$?M(void 0):g()})),le=$,ce=(0,o.A)("animated-close-icon",le&&"state-back");return r.Ay.createElement(h.A,{dialogRef:S,onClose:g,isOpen:k,isSlim:!0,contentClassName:mt.content,className:(0,o.A)(mt.modalDialog,mt.root),isLowStackPriority:!0},r.Ay.createElement(y.A,{className:mt.closeButton,round:!0,color:"translucent",size:"smaller",onClick:oe,ariaLabel:W(le?"Common.Back":"Common.Close")},r.Ay.createElement("div",{className:ce})),r.Ay.createElement(L,{className:mt.balance,balance:i,withAddButton:!0}),r.Ay.createElement("div",{className:(0,o.A)(mt.header,!ee&&mt.hiddenHeader)},r.Ay.createElement(x.Ay,{name:"slideVerticalFade",activeKey:Number(te),slideClassName:mt.headerSlide},r.Ay.createElement("h2",{className:mt.commonHeaderText},j(te?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),r.Ay.createElement(x.Ay,{ref:E,className:mt.transition,name:"pushSlide",activeKey:$?1:0},!$&&r.Ay.createElement("div",{ref:I,className:(0,o.A)(mt.main,"custom-scroll"),onScroll:ae},r.Ay.createElement("div",{className:mt.avatars},r.Ay.createElement(A.A,{size:100,peer:l}),r.Ay.createElement("img",{className:mt.logoBackground,src:v,alt:"",draggable:!1})),!c&&!P&&!p?.shouldDisallowPremiumGifts&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("h2",{className:(0,o.A)(mt.headerText,mt.center)},j("GiftPremiumHeader")),r.Ay.createElement("p",{className:(0,o.A)(mt.description,mt.center)},re),r.Ay.createElement("div",{className:mt.premiumGiftsGallery},Q?.map((e=>r.Ay.createElement(it,{option:e,optionByStars:X.get(e),baseMonthAmount:Y?Math.floor(Y.amount/Y.months):void 0,onClick:ne}))))),!V&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("h2",{ref:N,className:(0,o.A)(mt.headerText,mt.center)},j(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),r.Ay.createElement("p",{className:(0,o.A)(mt.description,mt.starGiftsDescription,mt.center)},se),r.Ay.createElement(ct,{areLimitedStarGiftsDisallowed:H,onCategoryChanged:ie}),r.Ay.createElement(x.Ay,{name:"zoomFade",activeKey:(me=z,"all"===me?-2:"limited"===me?-1:"stock"===me?0:me),className:mt.starGiftsTransition},function(){const e=a?.[z]?.filter((e=>{const a=t?.[e];if(!a)return!1;const{isLimited:r,isSoldOut:s,upgradeStars:n}=a;return J&&!H?r:H&&!J?!r&&!s:!J||!H||Boolean(r&&!!n)}));return r.Ay.createElement("div",{className:mt.starGiftsContainer},t&&e?.map((e=>{const a=t[e];return r.Ay.createElement(ot,{key:e,gift:a,observeIntersection:Z,onClick:ne})})))}()))),$&&G?.forPeerId&&r.Ay.createElement(at,{gift:B,giftByStars:X.get(B),peerId:G.forPeerId})));var me})));const At=(0,r.ph)((0,s.EK)((e=>{const{currentUserId:t}=e;return{currentUserId:t,userIds:e.contactList?.userIds}}))((({modal:e,currentUserId:t,userIds:a})=>{const{closeGiftRecipientPicker:o,openGiftModal:l}=(0,s.ko)(),c=(0,u.A)(),m=e,[A,p]=(0,r.J0)(""),f=(0,r.Kr)((()=>{const e=(0,s.mS)(),r=a?a.concat(t):void 0,o=r?(0,n.PU)({ids:r,query:A}):[];return(0,k.A)((0,I.Am)(o).filter((t=>(0,i.X2D)(e,t))),void 0,[t])}),[t,A,a]),y=(0,d.A)((e=>{l({forUserId:e}),o()}));return r.Ay.createElement(w.A,{className:"W3JMs1YE",isOpen:m,onClose:o,title:c("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},r.Ay.createElement(G.A,{className:"wOipz1Y_",itemIds:f,filterValue:A,filterPlaceholder:c("Search"),onSelectedIdChange:y,onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var pt=a(80140),ft=a(18501),yt=a(25404),ht=a(76023);const gt={root:"Ef0cKSqQ",giftPreview:"IvuNzslN",backdrop:"dNukis4X",arrow:"oufsMLLF"},St=4*ht.$,Et=3*ht.$,vt=(0,r.ph)((({peer:e,gift:t})=>{const a=(0,r.Kr)((()=>(0,W.uc)(t)),[t]);if(a)return r.Ay.createElement("div",{className:gt.root},r.Ay.createElement("div",{className:gt.giftPreview},r.Ay.createElement(X.A,{className:gt.backdrop,backgroundColors:[a.backdrop.centerColor,a.backdrop.edgeColor],patternColor:a.backdrop?.patternColor,patternIcon:a.pattern?.sticker}),r.Ay.createElement(Q.A,{className:gt.sticker,size:Et,sticker:a.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:gt.arrow}),r.Ay.createElement(A.A,{peer:e,size:St,className:gt.avatar}))}));var Nt=a(94189);const bt={modal:"nnublcCk",header:"p7FTs7_p",title:"pIbzzTir",description:"CCPfr26t",soldOut:"kjWcRp4W",headerSplitButton:"XOMI_4PO",headerButton:"WA0INleU",giftResalePriceContainer:"BN8gf5y6",giftResalePriceStar:"H_q8o2vY",left:"aOhTHZlf",right:"rJOB1u5Q",footer:"bho0GTYt",footerDescription:"VUylTszM",unknown:"zDauXmpS",giftValue:"w_E4LkUj",uniqueAttribute:"OJQnkf17",uniqueGift:"I6o_pGAm",starAmountIcon:"_5guecUe",modalHeader:"ie9tImaj",modalCloseButton:"p38RBGdC",ownerAddress:"DavMRg4Q",copyIcon:"SLX5tX8C"},Ct=(0,r.ph)((0,s.EK)(((e,{modal:t})=>{const a=t?.gift,r=a&&"gift"in a,s=e.currentUserId,o=r&&a.fromId,l=o?(0,i.PVB)(e,o):void 0,c=t?.peerId?(0,i.PVB)(e,t.peerId):void 0,m=c&&(0,n.vj)(c)?c:void 0,d=m&&(0,C.ub)(m,"postMessages"),u=(0,i.mBe)(e,s),A=u?.emojiStatus,p=e.collectibleEmojiStatuses?.statuses;return{fromPeer:l,targetPeer:c,currentUserId:s,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod,tonExplorerUrl:e.appConfig?.tonExplorerUrl,hasAdminRights:d,currentUserEmojiStatus:A,collectibleEmojiStatuses:p,currentUser:u}}))((({modal:e,fromPeer:t,targetPeer:a,currentUserId:l,starGiftMaxConvertPeriod:c,hasAdminRights:h,currentUserEmojiStatus:g,collectibleEmojiStatuses:S,tonExplorerUrl:E,currentUser:v})=>{const{closeGiftInfoModal:N,changeGiftVisibility:b,convertGiftToStars:C,openChatWithInfo:I,focusMessage:k,openGiftUpgradeModal:G,showNotification:w,buyStarGift:P}=(0,s.ko)(),[M,U,x]=(0,B.A)(),R=(0,T.A)(),O=(0,u.A)(),[F,L]=(0,r.J0)(!1),q=Boolean(e),V=(0,m.A)(e),J=(0,m.A)(t),j=(0,m.A)(a),_=j&&(0,n.vj)(j),{gift:X}=V||{},Y=X&&"gift"in X,Z=Y?X:void 0,$=Z?.fromId===l,ee=Z&&c&&Z.date+c-(0,pt.Fm)()||0,te=Math.ceil(ee/60/60/24),ae=Y?X.gift:X,re=ae&&(0,W.yQ)(ae),se=ee>0&&Boolean(Z?.starsToConvert),ne=ae&&"starGiftUnique"===ae.type,ie=ne?ae:void 0,oe=Boolean(Z?.upgradeMsgId),ce=!oe&&Z?.inputGift&&(_?h:j?.id===l),me=ne?ae.resellPriceInStars:void 0,de=!ce&&Boolean(me),ue=(()=>{if(!ne)return;const{ownerName:e,ownerId:t}=ae,a=(0,s.mS)(),r=t?(0,i.PVB)(a,t):void 0;return r?(0,n.F9)(R,r):e})(),Ae=(0,d.A)((()=>{N()})),ye=(0,d.A)((()=>{const e=$?j:J;if(!Z?.upgradeMsgId||!e)return;const{upgradeMsgId:t}=Z;k({chatId:e.id,messageId:t}),Ae()})),ge=(0,d.A)((()=>{const{inputGift:e,isUnsaved:t}=Z;b({gift:e,shouldUnsave:!t}),Ae()})),Se=(0,d.A)((()=>{const{inputGift:e}=Z;C({gift:e}),x(),Ae()})),Ee=(0,d.A)((()=>{Z&&G({giftId:Z.gift.id,gift:Z})})),ve=(0,d.A)((()=>{Z&&"starGiftUnique"===ae?.type&&ae.resellPriceInStars&&L(!0)})),Ne=(0,d.A)((()=>{L(!1)})),be=(0,d.A)((()=>{Z&&"starGiftUnique"===ae?.type&&ae.resellPriceInStars&&(Ne(),P({slug:ae.slug,stars:ae.resellPriceInStars}))})),Ce=(0,r.Kr)((()=>ae&&(0,W.uc)(ae)),[ae]),Ie=(0,r.Kr)((()=>({onTrigger:e})=>r.Ay.createElement("div",{className:(0,o.A)(bt.headerButton,bt.left),tabIndex:0,role:"button","aria-haspopup":"menu","aria-label":R("AriaMoreButton"),onClick:e},r.Ay.createElement(p.A,{name:"more",className:bt.icon}))),[R]),ke=(0,d.A)((()=>de?r.Ay.createElement(y.A,{noForcedUpperCase:!0,size:"smaller",onClick:ve},R("ButtonBuyGift",{stars:(0,le.U)(R,me,{asFont:!0})},{withNodes:!0})):oe?r.Ay.createElement(y.A,{size:"smaller",onClick:ye},R("GiftInfoViewUpgraded")):ce&&Z?.alreadyPaidUpgradeStars&&!Z.upgradeMsgId?r.Ay.createElement(y.A,{size:"smaller",isShiny:!0,onClick:Ee},R("GiftInfoUpgradeForFree")):r.Ay.createElement(y.A,{size:"smaller",onClick:Ae},R("OK")))),we=(0,r.Kr)((()=>{if(!ae)return;let e="";return"starGift"===ae.type&&(ae.firstSaleDate&&(e+=`${R("GiftInfoFirstSale")} ${(0,K.L2)(1e3*ae.firstSaleDate,R.code,!0)}`),ae.lastSaleDate&&(e+="\n",e+=`${R("GiftInfoLastSale")} ${(0,K.L2)(1e3*ae.lastSaleDate,R.code,!0)}`)),e}),[ae,R]),Pe=(0,r.Kr)((()=>{if(!X||!ae)return;const{fromId:e,isNameHidden:t,starsToConvert:a,isUnsaved:l,isConverted:c,upgradeMsgId:m}=Z||{},d=se&&Boolean(a),u=t&&j,y=(()=>{if(!Z)return R("GiftInfoSoldOutDescription");if(!_){if(Z.upgradeMsgId)return R("GiftInfoDescriptionUpgraded");if(Z.canUpgrade&&Z.alreadyPaidUpgradeStars)return ce?R("GiftInfoDescriptionFreeUpgrade"):R("GiftInfoPeerDescriptionFreeUpgradeOut",{peer:(0,n.F9)(R,j)});if(ce||$)return c&&d?ce?R("GiftInfoDescriptionConverted",{amount:a},{pluralValue:a,withNodes:!0,withMarkdown:!0}):R("GiftInfoPeerDescriptionOutConverted",{amount:a,peer:(0,n.F9)(R,j)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):Z.canUpgrade&&ce?d?R("GiftInfoDescriptionUpgrade",{amount:a},{pluralValue:a,withNodes:!0,withMarkdown:!0}):R("GiftInfoDescriptionUpgradeRegular"):ce?d?R("GiftInfoDescription",{amount:a},{withNodes:!0,withMarkdown:!0,pluralValue:a}):R("GiftInfoDescriptionRegular"):d?R("GiftInfoPeerDescriptionOut",{amount:a,peer:(0,n.F9)(R,j)},{withNodes:!0,withMarkdown:!0,pluralValue:a}):R("GiftInfoPeerDescriptionOutRegular",{peer:(0,n.F9)(R,j)})}})(),h=r.Ay.createElement(Ge.A,{className:"with-menu-transitions",trigger:Ie,positionX:"right"},r.Ay.createElement(yt.A,{peerId:V.peerId,gift:X,canManage:ce,collectibleEmojiStatuses:S,currentUserEmojiStatus:g})),v=r.Ay.createElement("div",{className:bt.modalHeader},Boolean(ce&&me)&&r.Ay.createElement("div",{className:bt.giftResalePriceContainer},(0,le.U)(R,me,{asFont:!0,className:bt.giftResalePriceStar})),r.Ay.createElement("div",{className:bt.headerSplitButton},q&&h,r.Ay.createElement("div",{className:(0,o.A)(bt.headerButton,bt.right),tabIndex:0,role:"button","aria-haspopup":"menu","aria-label":R("Close"),onClick:Ae},r.Ay.createElement(p.A,{name:"close",className:(0,o.A)(bt.icon,bt.moreIcon)})))),b=ne&&r.Ay.createElement("div",{className:(0,o.A)(bt.header,bt.uniqueGift)},r.Ay.createElement(he,{backdropAttribute:Ce.backdrop,patternAttribute:Ce.pattern,modelAttribute:Ce.model,title:ae.title,subtitle:R("GiftInfoCollectible",{number:ae.number})})),C=r.Ay.createElement("div",{className:bt.header},r.Ay.createElement(Q.A,{className:bt.giftSticker,sticker:re,size:120}),r.Ay.createElement("h1",{className:bt.title},ne?ae.title:R(Z?ce?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),y&&r.Ay.createElement("p",{className:(0,o.A)(bt.description,!Z&&"starGift"===ae?.type&&bt.soldOut)},y)),k=[];if("starGift"===ae.type){(e||t)&&k.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:bt.unknown},O(H.I5.titleKey)))]),Z?.date&&k.push([R("GiftInfoDate"),r.Ay.createElement("span",{title:we},(0,K.L2)(1e3*Z.date,R.code,!0))]),ae.firstSaleDate&&!Z&&k.push([R("GiftInfoFirstSale"),(0,K.L2)(1e3*ae.firstSaleDate,R.code,!0)]),ae.lastSaleDate&&!Z&&k.push([R("GiftInfoLastSale"),(0,K.L2)(1e3*ae.lastSaleDate,R.code,!0)]);const s=ae.stars+(Z?.alreadyPaidUpgradeStars||0);k.push([R("GiftInfoValue"),r.Ay.createElement("div",{className:bt.giftValue},(0,le.U)(R,s,{className:bt.starAmountIcon}),ce&&se&&Boolean(a)&&r.Ay.createElement(D.A,{onClick:U},R("GiftInfoConvert",{amount:a},{pluralValue:a})))]),ae.availabilityTotal&&k.push([R("GiftInfoAvailability"),R("GiftInfoAvailabilityValue",{count:ae.availabilityRemains||0,total:ae.availabilityTotal},{pluralValue:ae.availabilityRemains||0})]),ae.upgradeStars&&!m&&k.push([R("GiftInfoStatus"),r.Ay.createElement("div",{className:bt.giftValue},R("GiftInfoStatusNonUnique"),ce&&r.Ay.createElement(D.A,{onClick:Ee},R("GiftInfoUpgradeBadge")))]),Z?.message&&k.push([void 0,(0,ft.fd)(Z.message)])}if(ne){const{ownerName:e,ownerAddress:t,ownerId:a}=ae,{model:o,backdrop:l,pattern:c,originalDetails:m}=Ce||{};if(t?k.push([R("GiftInfoOwner"),r.Ay.createElement("span",{className:bt.ownerAddress,onClick:()=>{(0,pe.eM)(t),w({message:{key:"WalletAddressCopied"},icon:"copy"})}},t,r.Ay.createElement(p.A,{className:bt.copyIcon,name:"copy"}))]):k.push([R("GiftInfoOwner"),a?{chatId:a,withEmojiStatus:!0}:e||""]),o&&k.push([R("GiftAttributeModel"),r.Ay.createElement("span",{className:bt.uniqueAttribute},o.name,r.Ay.createElement(D.A,null,(0,z.l9)(o.rarityPercent)))]),l&&k.push([R("GiftAttributeBackdrop"),r.Ay.createElement("span",{className:bt.uniqueAttribute},l.name,r.Ay.createElement(D.A,null,(0,z.l9)(l.rarityPercent)))]),c&&k.push([R("GiftAttributeSymbol"),r.Ay.createElement("span",{className:bt.uniqueAttribute},c.name,r.Ay.createElement(D.A,null,(0,z.l9)(c.rarityPercent)))]),k.push([R("GiftInfoAvailability"),R("GiftInfoIssued",{issued:ae.issuedCount,total:ae.totalCount})]),m){const{date:e,recipientId:t,message:a,senderId:o}=m,l=(0,s.mS)(),c=e=>{I({id:e}),N()},d=(0,i.PVB)(l,t),u=o?(0,i.PVB)(l,o):void 0,A=(0,K.L2)(1e3*e,R.code,!0),p=r.Ay.createElement(Qe.A,{onClick:()=>c(t),isPrimary:!0},(0,n.F9)(R,d));let f;if(u&&o!==t){const e=r.Ay.createElement(Qe.A,{onClick:()=>c(u.id),isPrimary:!0},(0,n.F9)(R,u));f=a?R("GiftInfoPeerOriginalInfoTextSender",{peer:p,sender:e,text:(0,ft.fd)(a),date:A},{withNodes:!0}):R("GiftInfoPeerOriginalInfoSender",{peer:p,date:A,sender:e},{withNodes:!0})}else f=a?R("GiftInfoPeerOriginalInfoText",{peer:p,text:(0,ft.fd)(a),date:A},{withNodes:!0}):R("GiftInfoPeerOriginalInfo",{peer:p,date:A},{withNodes:!0});k.push([void 0,r.Ay.createElement("span",null,f)])}}const G=E&&ne&&ae.giftAddress&&`${E}${ae.giftAddress}`,P=r.Ay.createElement("div",{className:bt.footer},(ce||G||de)&&r.Ay.createElement("div",{className:bt.footerDescription},G&&r.Ay.createElement("div",null,R("GiftInfoTonText",{link:r.Ay.createElement(f.A,{url:G,shouldSkipModal:!0,text:R("GiftInfoTonLinkText")})},{withNodes:!0})),ce&&r.Ay.createElement("div",null,R(`GiftInfo${_?"Channel":""}${l?"Hidden":"Saved"}`,{link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:ge},R("GiftInfoSaved"+(l?"Show":"Hide")))},{withNodes:!0})),!de&&u&&r.Ay.createElement("div",null,R("GiftInfoSenderHidden")),de&&ue&&r.Ay.createElement("div",null,R("GiftInfoBuyGift",{user:ue},{withNodes:!0}))),ke());return{modalHeader:ne?v:void 0,header:ne?b:C,tableData:k,footer:P}}),[X,Z,j,re,R,ce,se,$,O,E,ae,Ce,ke,_,Ie,ne,V,S,g,we,de,ue,q,me]);return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(fe.A,{isOpen:q,modalHeader:Pe?.modalHeader,header:Pe?.header,hasBackdrop:ne,tableData:Pe?.tableData,footer:Pe?.footer,className:bt.modal,onClose:Ae,withBalanceBar:Boolean(de),isLowStackPriority:!0}),ie&&v&&me&&r.Ay.createElement(Nt.A,{isOpen:F,noDefaultTitle:!0,onClose:Ne,confirmLabel:R("ButtonBuyGift",{stars:(0,le.U)(R,me,{asFont:!0})},{withNodes:!0}),confirmHandler:be},r.Ay.createElement(vt,{peer:v,gift:ie}),r.Ay.createElement("p",null,R("GiftBuyConfirmDescription",{gift:R("GiftUnique",{title:ie.title,number:ie.number}),stars:(0,le.K)(R,me)},{withNodes:!0,withMarkdown:!0}))),Z&&r.Ay.createElement(Nt.A,{isOpen:M,onClose:x,confirmHandler:Se,title:R("GiftInfoConvertTitle")},r.Ay.createElement("div",null,R("GiftInfoPeerConvertDescription",{amount:(0,le.K)(R,Z.starsToConvert),peer:(0,n.F9)(R,J)},{withNodes:!0,withMarkdown:!0})),se&&r.Ay.createElement("div",null,R("GiftInfoConvertDescriptionPeriod",{count:te},{withNodes:!0,withMarkdown:!0,pluralValue:te})),r.Ay.createElement("div",null,R("GiftInfoConvertDescription2"))))})));var It=a(40664);const kt=(0,r.ph)((0,s.EK)((e=>{const t=e.appConfig?.starsStargiftResaleCommissionPermille,a=t?t/1e3:void 0,r=e.appConfig?.starsStargiftResaleAmountMin||0,s=e.appConfig?.starsStargiftResaleAmountMax,n=e.appConfig?.starsUsdWithdrawRateX1000;return{starsStargiftResaleCommissionPermille:a,starsStargiftResaleAmountMin:r,starsStargiftResaleAmountMax:s,starsUsdWithdrawRate:n?n/1e3:1}}))((({modal:e,starsStargiftResaleCommissionPermille:t,starsStargiftResaleAmountMin:a,starsStargiftResaleAmountMax:n,starsUsdWithdrawRate:i})=>{const{closeGiftResalePriceComposerModal:o,closeGiftInfoModal:c,updateStarGiftPrice:u,showNotification:A}=(0,s.ko)(),p=Boolean(e),[f,g]=(0,r.J0)(void 0),S=(0,m.A)(e),{gift:E}=S||{},v=E&&"gift"in E?E:void 0,N=Boolean(f),b=(0,T.A)(),C=(0,d.A)((e=>{const t=e.target.value,a=parseFloat(t),r=""===t||Number.isNaN(a)?void 0:n?Math.min(a,n):a;g(r)})),I=(0,d.A)((()=>{o()})),k=(0,d.A)((()=>{v&&"starGiftUnique"===v.gift.type&&v.inputGift&&f&&(o(),c(),u({gift:v.inputGift,price:f}),A({icon:"sell-outline",message:{key:"NotificationGiftIsSale",variables:{gift:b("GiftUnique",{title:v.gift.title,number:v.gift.number})}}}))})),G=t,w=N&&f>a;return r.Ay.createElement(h.A,{isOpen:p,title:b("GiftSellTitle"),hasCloseButton:!0,isSlim:!0,onClose:I},r.Ay.createElement("div",{className:"ElDo1Bru"},r.Ay.createElement(It.A,{label:b("InputPlaceholderGiftResalePrice"),onChange:C,value:f?.toString(),inputMode:"numeric",tabIndex:0,teactExperimentControlled:!0})),r.Ay.createElement("div",{className:"wqkAvYGE"},r.Ay.createElement("span",null,!w&&G&&b("DescriptionComposerGiftMinimumPrice",{stars:(0,le.K)(b,a)},{withMarkdown:!0,withNodes:!0}),w&&b("DescriptionComposerGiftResalePrice",{stars:(0,le.K)(b,G?Number((f*G).toFixed()):f)},{withMarkdown:!0,withNodes:!0})),w&&i&&r.Ay.createElement("span",{className:"r9R0VR_w"},`≈ ${(0,l.A)(f*i,"USD",b.code)}`)),r.Ay.createElement(y.A,{noForcedUpperCase:!0,disabled:!w,size:"smaller",onClick:k},w&&b("ButtonSellGift",{stars:(0,le.U)(b,f,{asFont:!0})},{withNodes:!0}),!w&&b("Sell")))})));var Gt=a(58554),wt=a(32625),Pt=a(5463);const Bt="_Dt6RSQV",Tt=(0,r.ph)((0,s.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,s.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)(),h=(0,T.A)(),g=(0,d.A)((()=>a())),S=(0,d.A)((()=>{const e=l?.gift;e?.inputGift&&(i({gift:e.inputGift,shouldKeepOriginalDetails:u,upgradeStars:e.alreadyPaidUpgradeStars?void 0:e.gift.upgradeStars}),g())})),E=(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)),s=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:s[Math.floor(Math.random()*s.length)]}}(l.sampleAttributes,p))}));(0,wt.A)(E,o?3e3:void 0,!0),(0,r.vJ)((()=>{o&&l?.sampleAttributes&&E()}),[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,C.Mw)(e,"full"))).forEach((e=>{(0,Gt.hd)(e,He.qZ.BlobUrl)}))}),[l?.sampleAttributes]);const v=(0,r.Kr)((()=>{if(!p||!o)return;const e=l?.gift,t=[["diamond",h("GiftUpgradeUniqueTitle"),h("GiftUpgradeUniqueDescription")],["trade",h("GiftUpgradeTransferableTitle"),h("GiftUpgradeTransferableDescription")],["auction",h("GiftUpgradeTradeableTitle"),h("GiftUpgradeTradeableDescription")]],a=c?h("GiftPeerUpgradeText",{peer:(0,n.F9)(h,c)}):h("GiftUpgradeTextOwn");return{listItemData:t,header:r.Ay.createElement(he,{modelAttribute:p.model,backdropAttribute:p.backdrop,patternAttribute:p.pattern,title:h("GiftUpgradeTitle"),subtitle:a}),footer:r.Ay.createElement("div",{className:"EWaVCxY4"},!e&&r.Ay.createElement(y.A,{className:Bt,size:"smaller",onClick:g},h("OK")),e&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(ke.A,{label:h("GiftUpgradeKeepDetails"),onCheck:A,checked:u}),r.Ay.createElement(y.A,{className:Bt,size:"smaller",isShiny:!0,onClick:S},e.alreadyPaidUpgradeStars?h("GeneralConfirm"):h("GiftUpgradeButton",{amount:(0,le.U)(h,e.gift.upgradeStars,{asFont:!0})},{withNodes:!0}))))}}),[p,o,h,c,l?.gift,u]);return r.Ay.createElement(Pt.A,{isOpen:o,header:v?.header,footer:v?.footer,listItemData:v?.listItemData,hasBackdrop:!0,onClose:g})})));var Mt=a(47483);const Ut=(0,r.ph)((0,s.EK)((e=>({currentUser:(0,i.mBe)(e,e.currentUserId),isCurrentUserPremium:(0,i.g29)(e)})))((({modal:e,currentUser:t,isCurrentUserPremium:a})=>{const{closeGiftStatusInfoModal:n,setEmojiStatus:i}=(0,s.ko)(),l=(0,T.A)(),c=Boolean(e),u=(0,m.A)(e),{emojiStatus:f}=u||{},h=f?.textColor,g=(0,Mt.A)(f?.patternDocumentId),S=(0,d.A)((()=>{n()})),E=(0,d.A)((()=>{f&&i({emojiStatus:f}),n()})),v=(0,r.Kr)((()=>{if(!f||!c)return;const e=[f.centerColor,f.edgeColor],t=f.patternColor;return r.Ay.createElement(X.A,{className:"_1RfhkfB",backgroundColors:e,patternColor:t,patternIcon:g.customEmoji})}),[f,c,g]),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)(h&&`color: ${h}`)},v,r.Ay.createElement(A.A,{peer:N,size:"jumbo",className:"JK2zOWA7"}),r.Ay.createElement(Ie.A,{peer:N,className:"lxxbgNCl",withEmojiStatus:!0,noFake:!0,noVerified:!0,statusSparklesColor:h}),r.Ay.createElement("p",{className:"MLMdxkUg",style:(0,ye.A)(h&&`color: ${h}`)},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"))))),[h,v,N,l]),C=[["radial-badge",l("UniqueStatusBadgeBenefitTitle"),l("UniqueStatusBadgeDescription")],["unique-profile",l("UniqueStatusProfileDesignBenefitTitle"),l("UniqueStatusProfileDesignDescription")],["proof-of-ownership",l("UniqueStatusProofOfOwnershipBenefitTitle"),l("UniqueStatusProofOfOwnershipDescription")]],I=(0,r.Kr)((()=>{if(c)return r.Ay.createElement("div",{className:"VDrvalBo"},r.Ay.createElement(y.A,{size:"smaller",onClick:E},l("UniqueStatusWearButton"),!a&&r.Ay.createElement(p.A,{name:"lock-badge",className:"jiPObOWv"})))}),[l,a,c]);return r.Ay.createElement(Pt.A,{isOpen:c,header:b,listItemData:C,footer:I,hasBackdrop:!0,onClose:S})})));var xt=a(21309),Rt=a(15535);const Dt={header:"LQgz8Nlx",giftPreview:"hgs0ts_O",backdrop:"OnBhMaBw",description:"HBxB4QPY",arrow:"kXTOUpfb",noPassword:"BnqLhoKr"},Ot={isCustomPeer:!0,avatarIcon:"fragment",title:"",customPeerAvatarColor:"#000000"},Ft=4.5*ht.$,Lt=(0,r.ph)((0,s.EK)((e=>{const{settings:{byKey:{hasPassword:t}},twoFaSettings:{hint:a}}=e;return{hasPassword:t,passwordHint:a}}))((({modal:e,hasPassword:t,passwordHint:a})=>{const{closeGiftWithdrawModal:n,clearGiftWithdrawError:i,closeGiftInfoModal:o,processStarGiftWithdrawal:l,openSettingsScreen:c}=(0,s.ko)(),u=Boolean(e),[f,g]=(0,r.J0)(!1),S=(0,T.A)(),E=(0,m.A)(e),v=E?.gift?.gift,N=v&&(0,W.uc)(v),b=E?.gift?.canExportAt?Math.max(E.gift.canExportAt-(0,pt.Fm)(),0):void 0,C=(0,d.A)((()=>{n()})),I=(0,d.A)((e=>{l({gift:E.gift.inputGift,password:e})})),k=(0,d.A)((()=>{c({screen:Ae.VS.TwoFaDisabled}),n(),o()}));return r.Ay.createElement(h.A,{isOpen:u,title:S("GiftWithdrawTitle"),hasCloseButton:!0,isSlim:!0,onClose:C},N&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:Dt.header},r.Ay.createElement("div",{className:Dt.giftPreview},r.Ay.createElement(X.A,{className:Dt.backdrop,backgroundColors:[N.backdrop.centerColor,N.backdrop.edgeColor],patternColor:N.backdrop?.patternColor,patternIcon:N.pattern?.sticker}),r.Ay.createElement(Q.A,{className:Dt.sticker,size:Ft,sticker:N.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:Dt.arrow}),r.Ay.createElement(A.A,{peer:Ot,size:"giant",className:Dt.avatar})),r.Ay.createElement("p",{className:Dt.description},S("GiftWithdrawDescription",{gift:`${v.title} #${v.number}`},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}))),Boolean(b)&&r.Ay.createElement("p",{className:Dt.exportHint},S("GiftWithdrawWait",{days:(0,xt._k)(b)},{pluralValue:(0,xt._k)(b)})),!t&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("span",{className:Dt.noPassword},S("ErrorPasswordMissing")),r.Ay.createElement(y.A,{className:"mt-2",size:"smaller",onClick:k},S("SetUp2FA"))),t&&!b&&r.Ay.createElement(Rt.A,{shouldShowSubmit:!0,placeholder:S("CheckPasswordPlaceholder"),error:E?.errorKey&&S.withRegular(E?.errorKey),description:S("CheckPasswordDescription"),clearError:i,isLoading:E?.isLoading,hint:a,isPasswordVisible:f,shouldResetValue:u,onChangePasswordVisibility:g,submitLabel:S("GiftWithdrawSubmit"),onSubmit:I}))})));var Kt=a(79824),zt=a(74984),qt=a(4875),Vt=a(56863),Jt=a(30857),Ht=a(84080),Wt=a(56133),jt=a(35297);function _t(){}async function Qt(e){const t=await(0,qt.px)("searchChats",{query:e});if(t)return[...t.accountResultIds,...t.globalResultIds]}const Xt=(0,r.ph)((0,s.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,s.ko)(),u=Boolean(e),A=(0,T.A)(),[p,f]=(0,r.J0)(""),y=(0,m.A)(e),h=y?.gift?.gift,g=h&&(0,W.uc)(h),[S,E]=(0,r.J0)(),v=(0,m.A)(S),N=(0,r.Kr)((()=>{const e=(0,s.mS)();return v?(0,i.PVB)(e,v):void 0}),[v]),C=(0,zt.Rh)(b.DSF),P=(0,r.Kr)((()=>(0,I.Am)([...t||[],...C||[]])),[t,C]),{result:B,currentResultsQuery:M}=function({query:e,queryFn:t=Qt,defaultValue:a,debounceTimeout:s=300,isDisabled:n}){const i=function(e,t,a){const[s,n]=(0,r.J0)(),{isFrozen:i,updateWhenUnfrozen:o}=function(){const e=(0,r.li)(!1),t=(0,r.hb)((()=>{e.current=!0}),[]),a=(0,Jt.A)(),s=(0,r.hb)((()=>{e.current&&(e.current=!1,a())}),[a]);return(0,Ht.Ay)(_t,s),{isFrozen:(0,r.OV)(),updateWhenUnfrozen:t}}(),l=(0,Wt.A)(t,!0);return(0,jt.A)((()=>{i?o():l((()=>{n(e())}))}),[...a,i]),s}((()=>e),s,[e]),[o,l]=(0,r.J0)(""),c=e?i:e,m=(0,d.A)(t);return{...(0,Vt.A)((async()=>{if(!c||n)return l(""),Promise.resolve(a);const e=await m(c);return l(c),e}),[c,a,m,n],a),currentResultsQuery:o}}({query:p,defaultValue:P}),U=M!==p,x=(0,r.Kr)((()=>M?Kt.p:[{type:"withdraw",isCustomPeer:!0,avatarIcon:"toncoin",peerColorId:5,title:A("GiftTransferTON")}]),[A,M]),R=(0,d.A)((e=>{"withdraw"===e&&(l({gift:y.gift}),o())})),D=(0,r.Kr)((()=>{if(U)return Kt.p;const e=(0,s.mS)();return(0,k.A)((B||[]).filter((t=>t!==a&&(0,i.X2D)(e,t))),!1)}),[U,B,a]),O=(0,d.A)((()=>{E(void 0)}));(0,r.vJ)((()=>{u||E(void 0)}),[u]);const F=(0,d.A)((()=>{y?.gift.inputGift&&(c({gift:y.gift.inputGift,recipientId:v,transferStars:y.gift.transferStars}),O(),o())}));return r.Ay.createElement(w.A,{isOpen:u,onClose:o,title:A("GiftTransferTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,ignoreFreeze:!0},r.Ay.createElement(G.A,{itemIds:D,categories:x,onSelectedCategoryChange:R,withDefaultPadding:!0,withPeerUsernames:!0,isSearchable:!0,noScrollRestore:!0,isLoading:U,filterValue:p,filterPlaceholder:A("Search"),onFilterChange:f,onSelectedIdChange:E}),g&&r.Ay.createElement(Nt.A,{isOpen:Boolean(S),noDefaultTitle:!0,onClose:O,confirmLabel:y?.gift.transferStars?A("GiftTransferConfirmButton",{amount:(0,le.U)(A,y.gift.transferStars,{asFont:!0})},{withNodes:!0}):A("GiftTransferConfirmButtonFree"),confirmHandler:F},N&&r.Ay.createElement(vt,{peer:N,gift:h}),r.Ay.createElement("p",null,y?.gift.transferStars?A("GiftTransferConfirmDescription",{gift:A("GiftUnique",{title:h.title,number:h.number}),amount:(0,le.K)(A,y.gift.transferStars),peer:(0,n.F9)(A,N)},{withNodes:!0,withMarkdown:!0}):A("GiftTransferConfirmDescriptionFree",{gift:A("GiftUnique",{title:h.title,number:h.number}),peer:(0,n.F9)(A,N)},{withNodes:!0,withMarkdown:!0}))))}))),Yt=(0,r.ph)((0,s.EK)(((e,{modal:t})=>({user:t?.userId?(0,i.mBe)(e,t.userId):void 0})))((({modal:e,user:t})=>{const{closeChatRefundModal:a,addNoPaidMessagesException:i}=(0,s.ko)(),[o,l]=(0,r.J0)(!1),c=(0,m.A)(e),u=(0,m.A)(t),{starsToRefund:A,userId:p}=c||{},f=(0,T.A)(),y=Boolean(e),h=(0,d.A)((()=>{a(),p&&i({userId:p,shouldRefundCharged:o})}));return r.Ay.createElement(Nt.A,{isOpen:y,onClose:a,title:f("RemoveFeeTitle"),confirmLabel:f("ConfirmRemoveMessageFee"),confirmHandler:h},f("ConfirmDialogMessageRemoveFee",{peer:u&&(0,n.F9)(f,u)},{withMarkdown:!0,withNodes:!0}),Boolean(A)&&r.Ay.createElement(ke.A,{className:"dialog-checkbox",label:f("ConfirmDialogRemoveFeeRefundStars",{amount:(0,le.K)(f,A)},{withMarkdown:!0,withNodes:!0}),checked:o,onCheck:l}))})))},84991:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(84051),s=a(87357),n=a(39351),i=a(21849),o=a(18276);const l={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"},c=(0,r.ph)((({peer:e,avatarWebPhoto:t,avatarSize:a,text:c,badgeText:m,badgeIcon:d,className:u,badgeClassName:A,badgeIconClassName:p,textClassName:f,onClick:y})=>{const h=(0,n.A)();return r.Ay.createElement("div",{className:(0,s.A)(l.root,y&&l.clickable,u),onClick:y},r.Ay.createElement("div",{className:l.top},r.Ay.createElement(i.A,{size:a,peer:e,webPhoto:t}),m&&r.Ay.createElement("div",{className:(0,s.A)(l.badge,A),dir:h.isRtl?"rtl":"ltr"},d&&r.Ay.createElement(o.A,{name:d,className:p}),m)),c&&r.Ay.createElement("p",{className:(0,s.A)(l.text,f)},c))}))},34642:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(84051),s=a(87357),n=a(59030),i=a(64493),o=a(22337);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,n.A)(),p=Boolean(e||m);return r.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&&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),s=a(87357),n=a(18276),i=a(64493),o=a(22720),l=a(22337),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:h})=>r.Ay.createElement(l.A,{isOpen:e,className:(0,s.A)("LAh8evux",h),contentClassName:"hrizpMDe",hasAbsoluteCloseButton:!0,absoluteCloseButtonColor:A?"translucent-white":void 0,onClose:f},a&&r.Ay.createElement("div",{className:"jySLtQNG"},r.Ay.createElement(n.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),s=a(13439),n=a(87357),i=a(17712),o=a(21849),l=a(10187),c=a(64493),m=a(22337);const d="Cnh5ENvm",u=(0,r.ph)((({isOpen:e,title:t,tableData:a,headerAvatarPeer:u,header:A,modalHeader:p,footer:f,buttonText:y,className:h,hasBackdrop:g,onClose:S,onButtonClick:E,withBalanceBar:v,isLowStackPriority:N})=>{const{openChat:b}=(0,s.ko)(),C=(0,i.A)((e=>{b({id:e}),S()}));return r.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:g?"translucent-white":void 0,isSlim:!0,header:p,title:t,className:h,contentClassName:"KYHkJ9Qf",onClose:S,withBalanceBar:v,isLowStackPriority:N},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,n.A)(d,"AwnUe4Qk")},e),r.Ay.createElement("div",{className:(0,n.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:C}):t))))),f,y&&r.Ay.createElement(c.A,{className:f?void 0:"cSamlkt9",size:"smaller",onClick:E||S},y))}))},1526:(e,t,a)=>{a.d(t,{A:()=>f});var r=a(84051),s=a(87357),n=a(17142),i=a(14242),o=a(4961),l=a(37661),c=a(39351),m=a(59030),d=a(18276),u=a(9267),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:h,onClick:g})=>{const S=(0,m.A)(),E=(0,c.A)(),[v,N,b]=(0,l.A)();(0,r.vJ)((()=>{e||b()}),[e]);const[C,I]=(0,r.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=h&&e.stars<h,r=[];let s=0,n=!1;return a.forEach(((e,i)=>{e.isExtended||s++,h&&!t&&e.stars<h||(v||!e.isExtended?r.push({option:e,starsCount:Math.min(s,6),isWide:i===a.length-1}):n=!0)})),[r,n]}),[v,a,h]);return r.Ay.createElement("div",{className:(0,s.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,s.A)(p.option,!c&&a&&p.wideOption,m&&p.active),key:e.stars,onClick:()=>g?.(e)},r.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(e.stars),r.Ay.createElement("div",{className:p.stackedStars,dir:E.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,n.v)(E,e.amount,e.currency)),(m||f&&"winners"in f)&&d&&r.Ay.createElement("div",{className:p.optionBottom},r.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(S("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!v&&I&&r.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:N},S("Stars.Purchase.ShowMore"),r.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))}}]);
|
|
//# sourceMappingURL=6930.af148124858f59b9cd16.js.map
|