import{c as h,b as e,n as P,J as v,i as l,k as g,a as _,H as k,l as F,t as C,X as I,c_ as $}from"./index-6Jqoo2rk.js";import{af as w}from"./accumulate-BydAFozl.js";import{e as M,I as u}from"./emailSetup-CFcJlzt-.js";import{d as D,aF as i,bv as N,bw as d}from"./appDialogsManager-DnVhdlim.js";import{u as x}from"./useAppConfig-C30L41Bx.js";import{u as R}from"./useStarsCommissionAndWithdrawalPrice-KvJ0lze6.js";import{S as b}from"./space-DBcSn32d.js";import{c as G,P as H}from"./publishTimeField-BiPo2OJk.js";import"./browser-BlRx6CLO.js";import"./_commonjsHelpers-DsqdWQfm.js";import"./iconTsx-Cr8T7ZIv.js";import"./bootstrapIm-BS8HLnlI.js";import"./transition-DuxZkCEv.js";import"./mediaHeader-B5k-4_FU.js";import"./animations-O3syBkMX.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"./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 y=C("<div>"),L=C('<button class="btn-primary btn-color-primary btn-large">'),O=5,K=1e5,U=1,X=D({name:"suggested-post-popup-content",component:s=>{M(s.element,d.Container);const[r,p]=h(s.initialStars?s.initialStars+"":""),[n,c]=h(s.initialTimestamp&&s.initialTimestamp*1e3>Date.now()+U*60*1e3?s.initialTimestamp:void 0),[o]=x(),{willReceiveDollars:a}=R(()=>+r()||0,{commissionKey:"stars_suggested_post_commission_permille"}),S=()=>o()?.stars_suggested_post_amount_min||O,T=()=>o()?.stars_suggested_post_amount_max||K,m=()=>+r()&&+r()<S(),f=()=>m(),E=t=>{p(t&&""+Math.min(T(),+t.replace(/\D/g,"")||0))},A=()=>{f()||s.onFinish({stars:+r()||void 0,timestamp:n()||void 0})};return[e(i,{get value(){return r()},onChange:E,get isError(){return m()},get children(){return[e(i.SideContent,{first:!0,get children(){return N({class:G.Icon})}}),e(i.Input,{type:"number",forceFieldValue:!0}),e(i.Label,{forceOffset:44,get children(){return e(u,{get key(){return m()?"SuggestedPosts.EnterPrice.MinOffer":"SuggestedPosts.EnterPrice.Label"},get args(){return P(()=>!!m())()?[S()+""]:void 0}})}}),e(i.SideContent,{last:!0,get children(){return e(v,{get when(){return a()},get children(){return["~",P(()=>w(a(),",")),"$"]}})}})]}}),(()=>{const t=y();return l(t,e(u,{key:"SuggestedPosts.EnterPrice.Description"})),g(()=>_(t,d.Caption)),t})(),e(b,{amount:"2rem"}),e(H,{noTimeLangKey:"SuggestedPosts.PublishingTime.Anytime",get value(){return n()},onChange:c}),(()=>{const t=y();return l(t,e(u,{key:"SuggestedPosts.PublishingTime.Description"})),g(()=>_(t,d.Caption)),t})(),e(b,{amount:"2rem"}),(()=>{const t=L();return t.$$click=A,k(F,t,()=>!0),l(t,e(u,{key:"SuggestedPosts.MakeAnOffer"})),g(()=>t.disabled=f()),t})()]}});I(["click"]);class Pt extends ${constructor({HotReloadGuard:r,suggestChange:p,onFinish:n,...c}){super("suggested-post-popup",{overlayClosable:!0,closable:!0,body:!0,title:p?"SuggestedPosts.SuggestAChange":"SuggestedPosts.SuggestAPost"});const o=new X;o.HotReloadGuard=r,o.feedProps({...c,onFinish:a=>{n(a),this.hide()}}),this.body.append(o)}}export{Pt as default};
//# sourceMappingURL=index-CINnwZ9C.js.map
