import{r as f,b as e,c as l,bZ as C,h as w,v as P,J as M}from"./index-6Jqoo2rk.js";import{T as x}from"./transition-DuxZkCEv.js";import{u as R}from"./useStarsCommissionAndWithdrawalPrice-KvJ0lze6.js";import{by as g,ar as m,ap as h}from"./appDialogsManager-DnVhdlim.js";import{S as v}from"./starsRangeInput-BLe-6A9X.js";import{S as A}from"./staticSwitch-DQBt4NKu.js";import"./useAppConfig-C30L41Bx.js";import"./emailSetup-CFcJlzt-.js";import"./iconTsx-Cr8T7ZIv.js";import"./bootstrapIm-BS8HLnlI.js";import"./mediaHeader-B5k-4_FU.js";import"./animations-O3syBkMX.js";import"./accumulate-BydAFozl.js";import"./browser-BlRx6CLO.js";import"./_commonjsHelpers-DsqdWQfm.js";import"./putPreloader-WBjcuDFX.js";import"./htmlToSpan-DhAls8qz.js";import"./anchorCallback-DsA1XczG.js";import"./toast-B3QB1-N7.js";import"./paintQrCode-u2FNs0A8.js";import"./fastBlur-Co-79rP4.js";import"./space-DBcSn32d.js";import"./telInputField-Fj4gE689.js";import"./readBlobAsDataURL-DL2tTmc_.js";import"./tracking-CIK7NCFD.js";import"./getInputPasskeyResponse-RiY9Fe0r.js";import"./base64ToBytes-B7rMxzcy.js";import"./sha256-BMgYLqDy.js";import"./bytesCmp-DgkPox5J.js";const d={duration:200,easing:"ease-out"},T=i=>{const[o,s]=l(!!i.initialStars),[r,n]=l(i.initialStars||0),{commissionPercents:u,willReceiveDollars:S}=R(r);C(()=>{o()?n(t=>t||i.initialStars||1):n(0)});let p=!0;return w(()=>{if(p){p=!1,r();return}i.onStarsChange(r())}),[e(h,{caption:"PaidMessages.ChargeForGroupMessagesDescription",get children(){return e(m,{clickable:()=>{s(t=>!t)},get children(){return[e(m.Title,{get children(){return P("PaidMessages.ChargeForMessages")}}),e(m.RightContent,{get children(){return e(A,{get checked(){return o()}})}})]}})}}),e(x,{onEnter:async(t,a)=>{const c=t.scrollHeight;await t.animate({height:["0px",c+"px"]},d).finished,a()},onExit:async(t,a)=>{const c=t.clientHeight;await t.animate({height:[c+"px","0px"],opacity:[1,0]},d).finished,a()},get children(){return e(M,{get when(){return o()},get children(){return e(h,{name:"PaidMessages.SetPrice",class:"overflow-hidden",caption:"PaidMessages.SetPriceGroupDescription",get captionArgs(){return[u(),S()]},get children(){return e(v,{get value(){return r()},onChange:n})}})}})}})]},re=(i,o)=>{const s=document.createElement("div"),r=g.createHelper(),n=f(()=>e(o,{get children(){return e(g,{get onCollect(){return r.onCollect},get children(){return e(T,i)}})}}),s);return{element:s,dispose:n,promise:r.await()}};export{re as default};
//# sourceMappingURL=chargeForMessasgesSection-BgPqpOq0.js.map
