"use strict";(self.webpackChunkbongacams=self.webpackChunkbongacams||[]).push([[392],{16164:function(e,n,t){var a=t(15215),s=t(74848),i=t(96540),o=t(99128),l=t(73437),r=t(90289),c=t(80742),u=t(57510),d=t(84435),p=t(46017),m=t(46955),_=t(83375),f=function(e){function n(n){var t=e.call(this,n)||this;return t.caretStart=null,t.caretEnd=null,t.inFocus=!1,t.forceBlurUpdate=!1,t.handleInput=function(e){var n=t.props,a=n.value,s=n.onInput,i=e.target,o=i.value;null==a&&""===o||a===o||s(e),t.isIE&&t.inFocus&&i.value&&"number"==typeof i.selectionStart&&(t.caretStart=i.selectionStart,t.caretEnd=i.selectionEnd)},t.handleChange=function(e){(0,t.props.onChange)(e)},t.handleFocus=function(e){var n=t.props.onFocus;if(t.inFocus=!0,t.setState({inFocus:!0}),t.isIE){var a=e.target;t.caretStart=a.selectionStart,t.caretEnd=a.selectionEnd}window.requestAnimationFrame(function(){t.props.selectOnClick&&e.target.select()}),n(e)},t.handleBlur=function(e){t.inFocus=!1,t.setState({inFocus:!1}),t.isIE&&(t.forceBlurUpdate=!0,t.caretStart=null,t.caretEnd=null),(0,t.props.onBlur)(e)},t.isTextarea=function(){return[p.A.TEXTAREA,p.A.TEXT_AREA].includes(t.props.type)},t.textareaRef=function(e){return t.textareaEL=e},t.inputRef=function(e){return t.inputEL=e},t.inputWrapRef=function(e){return t.inputWrapEl=e},t.getRemindCount=function(){var e=t.props,n=e.maxLength,a=e.value,s=n-String(a).length;return s>=0?"".concat(s," ").concat(__("characters left")):"".concat(-s," ").concat(__("characters exceeded"))},t.renderLabel=function(){var e=t.props,n=e.label,a=e.labelRequired,s="string"==typeof n?n:o.w.renderToString(n);return a&&(s='*'.concat(s)),s},t.fieldId=n.id||"".concat((0,r.q2)(n.name),"_").concat(c.Random.rangeInt()),t.isIE=Boolean(d.BrowserDetect.detectIE()),t.state={inFocus:!1},t}return(0,a.C6)(n,e),n.prototype.componentDidMount=function(){var e=this.props.isFocusOnMount,n=this.inputEL;e&&n&&(n.focus(),this.setState({inFocus:!0}))},n.prototype.componentDidUpdate=function(e,n){this.isIE&&this.textareaEL&&null!==this.caretStart&&null!==this.caretEnd&&this.textareaEL.setSelectionRange(this.caretStart,this.caretEnd),this.ieSetPlaceholder()},n.prototype.shouldComponentUpdate=function(e,n){return this.isIE?this.forceBlurUpdate?(this.forceBlurUpdate=!1,!0):this.props.value!==e.value||this.props.error!==e.error||this.props.type!==e.type:!((0,m.b)(e,this.props)&&(0,m.b)(n,this.state))},Object.defineProperty(n.prototype,"element",{get:function(){return this.inputEL||this.textareaEL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataAttrs",{get:function(){var e={};return(0,u.loopv)(this.props.data,function(n,t){return e["data-".concat(t)]=n}),e},enumerable:!1,configurable:!0}),n.prototype.ieSetPlaceholder=function(){var e=this,n=this.props,t=n.placeholder,a=n.value;this.isIE&&setTimeout(function(){e.textareaEL&&t&&!a&&(e.textareaEL.textContent=t,e.textareaEL.value="")},0)},n.prototype.render=function(){var e,n,t,i,o,l,r,c,u,d=this.props,m=d.type,f=d.name,h=d.rows,b=d.cols,v=d.label,g=d.children,x=d.placeholder,C=d.autoComplete,N=d.required,y=d.disabled,j=d.iconLeft,k=d.readonly,S=d.isFocusOnMount,w=d.onKeyDown,T=d.onKeyPress,B=d.onKeyUp,E=this.props,A=E.value,L=E.error,P=E.success,R=E.className,I=E.maxLength,D=E.labelWrapClassName,F=E.labelClassName,O=E.inputClassName,M=E.inputInnerClassName,U=E.inputWrapClassName,H=E.textAreaClassName,q=E.textAreaInnerClassName,V=E.errorClassName,K=this.props,G=K.isShowLimit,W=K.isShowLimitFocus,X=K.isShowLimitOnFocus,z=K.onClick,$=K.onChange,Q=this.state.inFocus;if(!p.A.isInputType(m))return null;var Y=g&&g.length>0,J=this.isTextarea();return(0,s.jsxs)("div",{className:(0,_.n)((e={bcf_row:!0,__focused:Q},e[R]=Boolean(R),e)),onClick:z,"data-anchor":f,children:[Boolean(v)&&(0,s.jsx)("div",{className:(0,_.n)((n={bcf_label_wrp:!0},n[D]=Boolean(D),n)),children:(0,s.jsx)("label",{className:(0,_.n)((t={bcf_label:!0,__required:N},t[F]=Boolean(F),t)),htmlFor:this.fieldId,dangerouslySetInnerHTML:{__html:this.renderLabel()}})}),(0,s.jsxs)("div",{ref:this.inputWrapRef,className:(0,_.n)((i={bcf_input_wrp:!0,__error:L,__success:!L&&P,__icon_left:Y&&j,__textarea:J,__focused:Q,__disabled:y,bcf_icon_input:Y},i[U]=Boolean(U),i)),children:[(0,s.jsxs)("div",{className:(0,_.n)((o={bcf_input_block:!0,__focused:Q},o[O]=Boolean(O),o)),children:[!J&&(0,s.jsx)("input",(0,a.Cl)({ref:this.inputRef,className:(0,_.n)((l={bcf_control:!0,__error:L},l[M]=Boolean(M),l)),value:A,type:m||p.A.TEXT,id:this.fieldId,name:f,placeholder:x,autoComplete:C,maxLength:I,formNoValidate:!0,disabled:y,readOnly:k,required:N,autoFocus:S,onChange:$,onInput:this.handleInput,onKeyDown:w,onKeyPress:T,onKeyUp:B,onFocus:this.handleFocus,onBlur:this.handleBlur},this.dataAttrs),this.fieldId),J&&(0,s.jsx)("div",{className:(0,_.n)((r={bcf_textarea_wrp:!0},r[H]=Boolean(H),r)),children:(0,s.jsx)("textarea",(0,a.Cl)({className:(0,_.n)((c={"bcf_control __textarea":!0,__error:L},c[q]=Boolean(q),c)),ref:this.textareaRef,value:A,rows:h,cols:b,id:this.fieldId,name:f,placeholder:x,disabled:y,readOnly:k,required:N,autoFocus:S,onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:w,onKeyPress:T,onKeyUp:B},this.dataAttrs),this.fieldId)}),g]}),(G||W||X&&Q)&&(0,s.jsx)("div",{className:(0,_.n)({notifier:!0,too_long:String(A).length>I,__hidden:W&&!Q}),children:this.getRemindCount()}),L&&(0,s.jsx)("div",{className:(0,_.n)((u={form_errors_in_row:!0},u[V]=Boolean(V),u)),children:(0,s.jsx)("div",{className:"form_error",children:L})})]})]})},n.defaultProps={name:"",type:p.A.TEXT,className:"",autoComplete:"off",iconLeft:!1,autoHeight:!1,selectOnClick:!1,isShowLimit:!1,labelRequired:!1,isShowLimitFocus:!1,isFocusOnMount:!1,isShowLimitOnFocus:!1,onClick:l.noop,onChange:l.noop,onInput:l.noop,onKeyDown:l.noop,onKeyPress:l.noop,onKeyUp:l.noop,onBlur:l.noop,onFocus:l.noop},n}(i.Component);n.A=f},88488:function(e,n,t){t.d(n,{fM:function(){return o},pk:function(){return l},wl:function(){return r}});var a=t(15215),s=(t(99525),t(24629)),i=(t(17448),t(57510));function o(e,n,t){var s=e.miniProfile,o=(0,a.fX)([],s.socialProfiles.groups,!0);return(0,i.loopv)(o,function(e){(0,i.loopv)(e.items,function(e){e.id===n&&(e.socialProfileLink=t,e.isPurchased=!0)})}),{miniProfile:(0,a.Cl)((0,a.Cl)({},s),{socialProfiles:(0,a.Cl)((0,a.Cl)({},s.socialProfiles),{groups:o})})}}function l(e,n){var t=e.user,o=(void 0===t?{}:t).balance,l=e.miniProfile,r=(0,a.fX)([],l.socialProfiles.groups,!0),c=e.lang===s.A.RU,u=new Set;return(0,i.loopv)(n,function(e){(0,i.loopv)(e,function(e,n){u.add(n)})}),(0,i.loopv)(r,function(e,n){var t=e.items,a=[];(0,i.loopv)(t,function(e){u.has(e.id)&&a.push(e)}),r[n].items=a}),r=r.filter(function(e){return e.items.length}),(0,i.loopv)(n,function(e,n){(0,i.loopv)(r,function(t,s){if(t.type===n){var l=[];(0,i.loopv)(t.items,function(n){(0,i.loopv)(e,function(e,t){n.id===t&&l.push((0,a.Cl)((0,a.Cl)({},n),{description:c&&e.descriptionRu?e.descriptionRu:e.description,price:e.price,isBuyTokenRequired:o1,r[s].items=l}})}),{miniProfile:(0,a.Cl)((0,a.Cl)({},l),{socialProfiles:(0,a.Cl)((0,a.Cl)({},l.socialProfiles),{groups:r})})}}function r(e,n){var t,s,i,o=null===(i=null===(s=null===(t=null==e?void 0:e.miniProfile)||void 0===t?void 0:t.socialProfiles)||void 0===s?void 0:s.groups)||void 0===i?void 0:i.reduce(function(e,t){var s=t.items.reduce(function(e,t){return(0,a.fX)((0,a.fX)([],e,!0),[(0,a.Cl)((0,a.Cl)({},t),{isBuyTokenRequired:n'.concat(_.kX.pluralise("tokens",c.K),"")})})}),(0,s.jsx)(l.E,{className:"mp_bb_text_wrp",tagName:"div",html:__("Activate %b%Fan Boost%b_cl% to raise %displayname% to the 1st place on the site’s main page for %seconds% %s_nw%seconds %icon_top%%s_nw_cl%",{displayname:''.concat(n,""),seconds:c.r,b:'',b_cl:"",s_nw:'',s_nw_cl:"",icon_top:p.w.renderToString((0,s.jsx)(r.A,{group:"mp_bb_up_icon",icon:"#svg_fbp_to_up_arrow",url:u.jq}))})})]}),(0,s.jsx)("div",{className:"mp_bb_action",children:(0,s.jsx)(o.$n,{className:(0,m.n)({mp_bb_btn:!0,__mrn_disabled:!t}),variant:"success",onClick:a,children:__("Buy and Activate")})})]})}),h=t(19223),b=t(54469),v=t(21492),g=t(76480),x=t(89105),C=t(15215),N=t(46517),y=t(40756),j=t(49635),k=t(34710),S=t(67257),w=t(99655),T=t(72983),B=(0,i.memo)(function(e){var n,t,l,r=e.form,c=e.gifts,u=function(e){var n,t,a,s=e.form,o=e.onClose,l=e.onConfirmChange,r=(0,N.wA)(),c=(0,N.d4)(j.R1),u=(0,i.useState)((null==s?void 0:s.selectedGift)||null),d=u[0],p=u[1],m=(0,i.useState)((null===(a=null===(t=null===(n=null==s?void 0:s.privacy)||void 0===n?void 0:n.options)||void 0===t?void 0:t[0])||void 0===a?void 0:a.value)||""),_=m[0],f=m[1],b=(0,i.useState)(""),v=b[0],g=b[1],x=(0,i.useState)(null),B=x[0],E=x[1],A=(0,i.useState)(""),L=A[0],P=A[1],R=(0,i.useRef)({elementFitType:T.isRTLCulture?"top-left":"top-right",styleClass:"__unicode_size_xs",unicode:!0,isAppendToRootElement:!0,isCloseButtonHidden:!0}),I=(0,i.useCallback)(function(e){g(e)},[]);return(0,i.useEffect)(function(){l(Boolean(B))},[B,l]),{refs:{smilePanelOptionsRef:R},actions:{handleChangeComment:I,handleClickConfirm:function(e){return(0,C.sH)(void 0,void 0,void 0,function(){var n,t,a,s,i,l,c,u,d,p;return(0,C.YH)(this,function(m){switch(m.label){case 0:return[4,e()];case 1:return(null==(n=m.sent())?void 0:n.data)&&(t=n.data,a=t.gifts,s=t.messages,i=(a||{}).lastAddedGift,c=(l=s||{}).countMessage,u=l.message,(null==i?void 0:i.image)&&(null==i?void 0:i.detailsPopupDataApiUrl)&&c&&u&&(d={alt:i.image.alt||"",detailsPopupDataApiUrl:i.detailsPopupDataApiUrl,src:i.image.src,title:i.comment},r(y.actionProfileUpdateGiftHeader)(c),r(y.actionProfileUpdateGiftList)(d)),(0,w.c)([{message:(0,h.Oy)({attributes:{"{{/highlight}}":"","{{highlight}}":''},phrase:u,isLastVersion:!0}),type:S.y.GIFT_SENT}]),o()),(null==n?void 0:n.error)&&(p=(0,k.u1)(n.error),E(null),P(p||"")),[2]}})})},handleClickPrivacyOption:function(e){f(e)},handleCloseConfirmDialog:function(){E(null)},handlePickGift:function(e){p(e)},handleSubmitGift:function(){var e,n,t,a,i,o,l,r,u;if((null==d?void 0:d.id)&&(null==d?void 0:d.price))if(d.priceValue>c)P(__("You don't have enough Tokens"));else if("object"==typeof(null===(n=null===(e=null==s?void 0:s.confirmDialog)||void 0===e?void 0:e.confirmButton)||void 0===n?void 0:n.url)){P("");var p={comment:v,giftId:d.id,privacy:_},m=(0,C.Cl)((0,C.Cl)({},null==s?void 0:s.confirmDialog),{confirmButton:(0,C.Cl)((0,C.Cl)({},null===(t=null==s?void 0:s.confirmDialog)||void 0===t?void 0:t.confirmButton),{url:(0,C.Cl)((0,C.Cl)({},null===(i=null===(a=null==s?void 0:s.confirmDialog)||void 0===a?void 0:a.confirmButton)||void 0===i?void 0:i.url),{body:(0,C.Cl)((0,C.Cl)({},null===(r=null===(l=null===(o=null==s?void 0:s.confirmDialog)||void 0===o?void 0:o.confirmButton)||void 0===l?void 0:l.url)||void 0===r?void 0:r.body),p)})}),message:(0,h.Oy)({attributes:{privacy:"public"===_.toString()?__("Public gift"):__("Private gift"),"{{/ellipsis}}":"","{{/highlight}}":"","{{ellipsis}}":'',"{{highlight}}":''},phrase:null===(u=null==s?void 0:s.confirmDialog)||void 0===u?void 0:u.message,isLastVersion:!0})});E(m)}}},states:{confirmDialogPopupState:B,errorMessageState:L,pickedGiftState:d,pickedPrivacyState:_}}}(e),d=u.refs.smilePanelOptionsRef,p=u.actions,_=p.handleChangeComment,f=p.handleClickConfirm,B=p.handleClickPrivacyOption,E=p.handleCloseConfirmDialog,A=p.handlePickGift,L=p.handleSubmitGift,P=u.states,R=P.confirmDialogPopupState,I=P.errorMessageState,D=P.pickedGiftState,F=P.pickedPrivacyState;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mpg_inner mp_wd_inner bc_flex bc_flex_justify_s_between",children:[(0,s.jsx)("div",{className:"mpg_list",children:(0,s.jsx)(x.M,{className:"plt_t_scroll",children:null===(n=null==c?void 0:c.gifts)||void 0===n?void 0:n.map(function(e){return(0,s.jsx)(v.h,{className:(0,m.n)({mpg_item:!0,__active:(null==D?void 0:D.id)===e.id,__fit_contain:!0}),image:e.image,type:"__gift",onClick:function(){return A(e)}},e.id)})})}),(0,s.jsxs)("div",{className:"mpg_content bc_flex bc_flex_column",children:[(0,s.jsxs)("div",{className:"mpg_top",children:[D&&(0,s.jsxs)("div",{className:"mpg_picked_wrp",children:[(0,s.jsx)(v.h,{className:"mpg_picked __fit_contain",image:D.image,type:"__gift"}),(0,s.jsx)("p",{className:"mpg_text bc_bold",children:__("Price:")}),(0,s.jsx)("span",{className:"mpg_price bc_bold",children:"".concat(D.price," ").concat(D.pricePlural)})]}),(null===(t=null==r?void 0:r.privacy)||void 0===t?void 0:t.options)&&(0,s.jsxs)("div",{className:"mpg_text_wrp",children:[(0,s.jsx)("p",{className:"mpg_text bc_bold",children:__("Privacy:")}),(0,s.jsx)("div",{className:"bc_flex bc_flex_wrap",children:r.privacy.options.map(function(e){return(0,s.jsx)("button",{className:(0,m.n)({"bc_mrn_btn __mrn_def":!0,mpg_badge:!0,__active:F===e.value,__mrn_light:!0}),onClick:function(){return B(e.value)},children:e.label},e.value)})})]})]}),(null===(l=null==r?void 0:r.comment)||void 0===l?void 0:l.label)&&(0,s.jsx)(g.V,{id:b.a.COMMENTS_GIFT,className:"mpg_comment bc_flex bc_flex_column js-chat_msg_input",classNameLabel:"mpg_text bc_bold",classNameSmileButton:"mpg_smile",label:r.comment.label,limit:500,smilePanelOptions:d.current,dontSendMessageByEnter:!0,onChange:_}),(null==r?void 0:r.submitButton)&&(0,s.jsx)(o.$n,{className:"mpg_btn",variant:"success",onClick:L,children:(0,h.Oy)({phrase:r.submitButton.text,isLastVersion:!0})}),I&&(0,s.jsxs)("p",{className:"mpg_error bc_flex bc_flex_column bc_flex_full_center",children:[(0,s.jsx)("span",{className:"mpg_e_text",children:I}),(null==r?void 0:r.purchaseTokensLink)&&(0,s.jsx)("a",{className:"mpg_e_link",href:(0,h.FC)(r.purchaseTokensLink.url),rel:r.purchaseTokensLink.rel,children:r.purchaseTokensLink.text})]})]})]}),R&&(0,s.jsx)(a.PopupConfirmationDialog,{classNameWrapper:"__action_dialog",data:R,onClickClose:E,onClickConfirm:f})]})}),E=t(93039),A=t(20657),L=t(70726),P=t(16164),R=t(57933),I=t(57510),D=t(73437),F=t(88526),O=__("Required."),M=function(e){function n(n){var t,a=e.call(this,n)||this;return a.abortControllerRef=null,a.abortControllerRef=new AbortController,a.state={error:"",errorContent:null,fields:(t={},t.social_profile=[{id:"".concat("social_profile","_").concat("social_username"),label:trans("Enter your %sm_type% username:",{sm_type:''.concat(n.type,"")}),name:"social_username"}],t),loading:!1,isValid:!1},a}return(0,C.C6)(n,e),n.prototype.submitAction=function(e){var n=this;if(!this.state.loading){var t=this.props,a=t.purchaseSocialProfileLinkApiUrl,s=t.onSuccess;this.abortControllerRef.abort&&this.abortControllerRef.abort();var i=function(e){var n,t,a,s;return(null===(t=null===(n=null==e?void 0:e.errors)||void 0===n?void 0:n.socialUsername)||void 0===t?void 0:t[0])||(null===(s=null===(a=null==e?void 0:e.errors)||void 0===a?void 0:a.global)||void 0===s?void 0:s[0])||O};this.abortControllerRef=new AbortController;var o=new FormData;(0,I.loopv)((0,F.Z)((0,C.Cl)({},e)),function(e,n){o.append(n,e)}),this.setState({loading:!0}),(0,R.AT)(a,{abortController:this.abortControllerRef,body:o,method:"POST"}).then(function(e){e.errors?n.setState({errorContent:i(e)}):e.data&&s(e.data)}).then(function(){n.setState({loading:!1})})}},n.prototype.render=function(){var e=this.props,n=e.variant,t=void 0===n?"default":n,a=e.onCancel,i=this.state,l=i.errorContent,c=i.loading,d=this.getField("social_username","social_profile");return(0,s.jsxs)("form",{className:"sbp_form",onSubmit:this.handleSubmitForm,children:[(0,s.jsx)(P.A,(0,C.Cl)({},d,{className:"sbpf_row","data-testid":d.id,error:l,inputClassName:"sbpf_field",inputWrapClassName:"sbpf_field_wrp",labelWrapClassName:"sbpf_label",onInput:this.handleChangeFieldByName})),(0,s.jsxs)("div",{className:"sbpf_actions",children:["modern"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.$n,{className:"sbpf_btn sbpf_btn_submit","data-testid":"submit",type:"submit",variant:"success",isLoading:c,children:__("Buy")}),(0,s.jsx)(o.$n,{className:"sbpf_btn __mrn_border","data-testid":"cancel",type:"button",variant:"light",onClick:a,children:__("Cancel")})]}),"default"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.$n,{className:"sbpf_btn mls_btn mls_btn_green sbpf_btn_submit","data-testid":"submit",disabled:c,type:"submit",children:[(0,s.jsx)("span",{className:(0,m.n)({spf_b_inner:!0,__hide:c}),children:__("Buy")}),(0,s.jsx)("span",{className:(0,m.n)({"bc_spinner_wrp sbpf_b_spinner":!0,__show:c}),children:(0,s.jsx)(r.A,{group:"bc_spinner",icon:"#svg_ui_circle_loader",url:u.Jp})})]}),(0,s.jsx)(o.$n,{className:"sbpf_btn mls_btn mls_btn_grey","data-testid":"cancel",type:"button",onClick:a,children:__("Cancel")})]})]})]})},n.defaultProps={purchaseSocialProfileLinkApiUrl:"",type:"",isAvailable:!1,onCancel:D.noop,onSuccess:D.noop},n}(L.A),U=t(99525),H=t(88488),q=t(80554),V=t(12341),K=t(94535),G=t(3050),W=function(e){var n,t,a,o,l=e.content,c=void 0===l?null:l,d=e.form,p=e.header,f=e.qrCodeData,b=e.variant,v=void 0===b?"default":b,g=e.isDisableCloseButton,x=e.onBuySuccess,N=e.onClose,y=void 0===N?D.noop:N,j=p||{},k=j.displayName,S=j.socialProfileIcon,w=j.tokens,T=void 0===w?0:w,B=j.type,E=function(e){var n=e.qrCodeData,t=e.onBuySuccess,a=e.onClose,s=void 0===a?D.noop:a,o=(0,i.useState)(Boolean(n)),l=o[0],r=o[1],c=(0,i.useState)(""),u=c[0],d=c[1],p=(0,i.useState)(""),m=p[0],_=p[1],f=(0,i.useState)((null==n?void 0:n.url)||""),b=f[0],v=f[1];return{forwardLinkState:u,openedLink:m,qrDataUrl:b,isShowSuccess:l,handleClose:(0,i.useCallback)(function(e){e.preventDefault(),s()},[s]),handleOnSuccess:function(e){var n=e.id,a=e.forwardLink,s=e.qrCodeData,i=e.url,o=e.urlHash;d((0,h.FC)(a.url)),_(i),r(!0),v((null==s?void 0:s.url)||""),(0,G.w)(q.R.BUY_SOCIAL_LINK,{id:n}),V.U.instance.sendMessage({id:n,forwardLink:a,target:V.B.PROFILE});var l=!0;t&&(l=t(e)),l&&(U.A.action(H.fM)(n,a),U.A.action(K.Cp)(o,a))}}}({qrCodeData:f,onBuySuccess:x,onClose:y}),L=E.forwardLinkState,P=E.openedLink,R=E.qrDataUrl,I=E.isShowSuccess,F=E.handleClose,O=E.handleOnSuccess;return(0,s.jsxs)("div",{className:(0,m.n)((n={bc_social_by_popup:!0},n["__sbp_".concat(v)]=Boolean(v),n)),children:[!g&&(0,s.jsx)("div",{className:"popup_close bc_flex bc_flex_full_center",onClick:F,children:(0,s.jsx)(r.A,{group:"pc_icon",icon:"#svg_ui_close_angular",url:u.Jp})}),!I&&(0,s.jsxs)("div",{className:"sbp_wrp __by",children:[(0,s.jsxs)("div",{className:"sbp_info bc_flex bc_flex_items_center",children:[(0,s.jsx)("img",{className:"sbp_icon",alt:B,src:null==S?void 0:S.src}),"modern"===v&&(0,s.jsxs)("div",{className:"sbp_i_title",children:[(0,s.jsx)("p",{className:"bc_bold",dangerouslySetInnerHTML:{__html:__("Purchase access to %modelname%'s %sm_type%",{modelname:k||"",sm_type:''.concat(B,"")})},"data-testid":"display-name-view"}),(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:__("%s1%Price:%s2% %price% %tokens_plural%",{price:T,s1:'',s2:"",tokens_plural:''.concat(_.kX.pluralise("tokens",T),"")})}})]}),"modern"!==v&&(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:__("Buy %modelname%'s %sm_type% for %s1%%price% %tokens_plural%?%s2%",{modelname:k||"",price:T,s1:'',s2:"",sm_type:''.concat(B,""),tokens_plural:''.concat(_.kX.pluralise("tokens",T),"")})},"data-testid":"display-name-view"})]}),(0,s.jsx)(M,(0,C.Cl)({},d,{variant:(o=v,"modern"===o?"modern":"default"),onCancel:F,onSuccess:O}))]}),I&&(0,s.jsxs)("div",{className:"sbp_wrp __success bc_flex bc_flex_items_center",children:[(0,s.jsx)("div",{className:"sbp_qr_code",children:(0,s.jsx)(A.r,{containerClassName:"qrc_img bc_flex bc_flex_items_center bc_flex_justify_center",size:114,value:R})}),(0,s.jsxs)("div",{className:"sbp_info",children:[P&&(0,s.jsx)("p",{className:"sbp_desc",children:__("Thank you for your purchase!")}),(0,s.jsxs)("div",{className:"sbp_info_wrp bc_flex bc_flex_items_center",children:[(0,s.jsx)("img",{className:"sbp_icon",alt:B,src:null==S?void 0:S.src}),(0,s.jsxs)("div",{className:"sbp_desc_wrp",children:[(0,s.jsx)("p",{className:"bc_regular",dangerouslySetInnerHTML:{__html:__("Follow %modelname% on %sm_type%:",{modelname:''.concat(k||(null==c?void 0:c.modelDisplayName),""),sm_type:''.concat(B||(null==c?void 0:c.socialProfileType),"")})}}),(0,s.jsx)("a",{className:"sbp_text_overflow sbp_link",href:L||(0,h.z6)(null===(t=null==c?void 0:c.socialProfileLink)||void 0===t?void 0:t.url).urlString,rel:"noreferrer",target:"_blank",children:P||(0,h.b8)(null===(a=null==c?void 0:c.socialProfileLink)||void 0===a?void 0:a.text)})]})]}),(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:__("Click the link %s1%or%s2% scan the QR code.",{s1:'',s2:""})}})]})]})]})},X=t(28527),z=t(40522),$=(0,i.memo)(function(e){var n=e.children,t=e.imTarget;return(0,s.jsx)(o.tV,{className:"__mrn_border",icon:{group:"mrn_icon",type:"#svg_btna_send_message",url:u.MQ},imTarget:t,popupOptions:{disableClickOutside:!0,enableScroll:!0,italicHeader:!1,styleVariant:z.W.MODERN,transparentOverlay:!0},variant:"light",children:n})}),Q=t(40172),Y=t(8119),J=t(76294),Z=t(99948),ee=(0,i.memo)(function(e){var n,t,a,l=e.data,c=e.modelUsername,p=e.isModelOnline,m=e.onClose,_=e.onDontShowAgainChange,f=l.actions,b=f.allModelsByTagLink,v=f.fullPrivateChatButton,g=f.privateChatButton,x=f.privateMessageButton,C=f.sendTipButton,y=l.content,j=y.displayName,k=y.profileLink,S=y.profilePhoto,w=y.tag,T=y.textInfo,B=l.footer.dontShowAgain,E=function(e){var n=e.modelUsername,t=e.onClose,a=e.onDontShowAgainChange,s=(0,N.d4)(Q.UQ),o=(0,i.useRef)(!1),l=(0,i.useState)(!1),r=l[0],c=l[1],u=function(){document.location.assign("".concat((0,d.ip)("@homepage")).concat(n))};return(0,i.useEffect)(function(){return function(){o.current&&a()}},[a]),(0,i.useEffect)(function(){function e(){t()}return document.addEventListener("@@profileSendTip/success",e),function(){document.removeEventListener("@@profileSendTip/success",e)}},[t]),{actions:{handleNavigateToFullPrivateChat:function(){s?(J.DT.setItem(Y.Z.SHOW_PRIVATE,"true"),u()):(0,Z.a)()},handleNavigateToPrivateChat:function(){s?(J.DT.setItem(Y.Z.SHOW_PRIVATE,"false"),u()):(0,Z.a)()},handleOnDontShowChange:function(e){o.current=e.currentTarget.checked,c(o.current)}},states:{isDontShowCheckboxState:r}}}({modelUsername:c,onClose:m,onDontShowAgainChange:_}),A=E.actions,L=A.handleNavigateToFullPrivateChat,P=A.handleNavigateToPrivateChat,R=A.handleOnDontShowChange,I=E.states.isDontShowCheckboxState;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mpt_inner",children:[(0,s.jsx)("p",{className:"mpt_text",dangerouslySetInnerHTML:{__html:__("If you want to see %s1%«%tag%»%s2% performed by %a1%%avatar% %displayname%%a_cl%, invite the model to a private chat or send generous tips, telling about your wish in a free chat or in a private message.",{a_cl:"",a1:'',avatar:").concat(null===(t=null==S?void 0:S.image)||void 0===t?void 0:t.alt,"),displayname:''.concat((0,h.Oy)({phrase:null==k?void 0:k.text}),""),s1:'',s2:"",tag:w})}}),Boolean(T)&&(0,s.jsx)("p",{className:"mpt_text __info",children:T})]}),(0,s.jsxs)("div",{className:"mpt_actions",children:[C&&(0,s.jsx)(o.qJ,{data:{modelDisplayName:j,modelUsername:c},icon:{group:"mrn_icon",type:"#svg_btna_send_tip",url:u.MQ},popupOptions:{enableScroll:!0,overlayClass:"highest_overlay",transparentOverlay:!0},children:C.text}),g&&(0,s.jsx)(o.$n,{className:"__mrn_border",icon:{group:"mrn_icon",type:"#svg_btna_private",url:u.MQ},variant:"light",onClick:P,children:g.text}),v&&(0,s.jsx)(o.$n,{className:"__mrn_border",icon:{group:"mrn_icon",type:"#svg_btna_full_profile",url:u.MQ},variant:"light",onClick:L,children:v.text}),x&&(0,s.jsx)($,{imTarget:{avatarSrc:null===(a=null==S?void 0:S.image)||void 0===a?void 0:a.src,displayName:j,username:c,isModel:!0,isOnline:p},children:x.text})]}),(0,s.jsx)("a",{className:"mpt_link",href:(0,h.z6)(null==b?void 0:b.url).urlString,rel:"noopener noreferrer",target:"_blank",children:(0,h.Oy)({phrase:null==b?void 0:b.text})}),B&&(0,s.jsx)("div",{className:"mpt_footer bc_flex bc_flex_items_center",children:(0,s.jsxs)(X.A,{checked:I,onChange:R,children:[(0,s.jsx)(r.A,{group:"mpt_icon",icon:"#svg_ui_checkbox",url:u.Jp}),(0,h.Oy)({phrase:B.label})]})})]})}),ne=t(2241),te=t(54096),ae=t(35733),se=(0,i.memo)(function(e){var n=e.feature,t=e.onClick;return(0,s.jsxs)("li",{className:"fbw_item bc_flex bc_flex_items_center",children:[(0,s.jsx)("img",{className:"fbw_img",alt:"",src:(0,d.oF)("chat/icons/".concat(ae.A.getIconName(n.membershipType),".svg"))}),(0,s.jsxs)("div",{className:"bc_flex bc_flex_column bc_flex_items_start",children:[(0,s.jsx)("a",{className:(0,m.n)({"fbw_link bc_uppercase":!0,__disabled:n.isDisabled}),href:(0,h.z6)(n.membershipLink.url).urlString,rel:"noopener noreferrer",target:"_blank",onClick:t,children:(0,h.Oy)({phrase:n.membershipLink.text})}),(0,s.jsx)("p",{className:"fbw_caption",children:n.caption})]})]})}),ie=(0,i.memo)(function(e){var n=e.benefitsContainer,t=e.boostTimeout,a=e.footer,o=e.freeRiseTimer,l=e.membership,c=e.onFeatureClick,d=(0,i.useMemo)(function(){return(0,te.Y)(o/ne.iC,!0)},[o]);return(0,s.jsxs)(s.Fragment,{children:[!o&&(0,s.jsx)("p",{className:"mp_fb_txt",children:(0,h.Oy)({attributes:{"{{/bold}}":"","{{/modelName}}":"","{{/uppercase}}":"","{{bold}}":'',"{{modelName}}":'',"{{uppercase}}":''},phrase:n.caption,isLastVersion:!0})}),Boolean(o)&&(0,s.jsx)("p",{className:"mp_fb_txt",children:(0,h.Oy)({attributes:{"{{/bold}}":"","{{bold}}":'',"{{timeout/}}":''.concat(d,"")},phrase:t.caption,isLastVersion:!0})}),Boolean(n.benefits.length)&&(0,s.jsx)("ul",{className:"mp_fb_benefits",children:n.benefits.map(function(e){return(0,s.jsxs)("li",{className:"mp_fb_item bc_flex bc_flex_items_center",children:[(0,s.jsx)(r.A,{group:"mp_fb_icon __check",icon:"#svg_fbp_check",url:u.jq}),(0,h.Oy)({attributes:{"{{/bold}}":"","{{bold}}":''},phrase:e,isLastVersion:!0})]},e.text)})}),(0,s.jsx)("p",{className:"mp_fb_info bc_fw_bold",children:(0,h.Oy)({phrase:l.caption,isLastVersion:!0})}),(0,s.jsx)("ul",{className:"mp_fb_statuses",children:l.items.map(function(e){return(0,s.jsx)(se,{feature:e,onClick:c},e.caption)})}),(0,s.jsx)("p",{className:"mp_fb_txt",children:(0,h.Oy)({attributes:{"{{/modelName}}":"","{{/nowrap}}":"","{{icon/}}":p.w.renderToString((0,s.jsx)(r.A,{group:"mp_fb_icon __heart",icon:"#svg_fbp_heart",url:u.jq})),"{{modelName}}":'',"{{nowrap}}":''},phrase:a.phrase,isLastVersion:!0})})]})}),oe=t(36194),le=function(e){var n=e.popup,t=n.actions,a=n.confirmDialog,o=n.notEnoughTokensError,l=e.onClose,r=e.onConfirmChange,c=(0,N.d4)(Q.UQ),u=(0,N.d4)(j.R1),d=(0,N.wA)(),p=(0,i.useState)({price:50}),m=p[0],f=p[1],b=(0,i.useState)(""),v=b[0],g=b[1],x=(0,i.useState)(null),y=x[0],B=x[1],E=(0,i.useState)(null),A=E[0],L=E[1],P=(0,i.useRef)(null),R=(0,i.useRef)({elementFitType:T.isRTLCulture?"top-left":"top-right",styleClass:"__unicode_size_xs",unicode:!0,isAppendToRootElement:!0,isCloseButtonHidden:!0}),I=(0,i.useMemo)(function(){return!t.some(function(e){return e.price===m.price})},[t,m]),D=(0,i.useCallback)(function(e){g(e)},[]);return(0,i.useEffect)(function(){(null==e?void 0:e.popup)||l()},[e,l]),(0,i.useEffect)(function(){r(Boolean(y))},[y,r]),{ref:{inputElementRef:P,smilePanelOptionsRef:R},actions:{handleChangeComment:D,handleChangeCustomTipAmount:function(e){e.preventDefault();var n=Number(e.currentTarget.value);f(function(e){var t=Number.isFinite(n)&&n<=Number.MAX_SAFE_INTEGER?Math.max(0,n):e.price;return P.current&&(P.current.value=t.toString()),(0,C.Cl)((0,C.Cl)({},e),{price:t})})},handleChangeTipAmount:function(e){f(function(n){return(0,C.Cl)((0,C.Cl)({},n),{price:e})})},handleClickConfirm:function(e,n,t){var a,i;if(m.price&&"object"==typeof(null==n?void 0:n.url)&&"string"==typeof(null===(i=null===(a=n.url)||void 0===a?void 0:a.body)||void 0===i?void 0:i.username)){t(!0);var r={layout:3,source:"regular",sub_type:"new_message",tokens:m.price,username:n.url.body.username,onError:function(e){B(null),L("string"==typeof e?{code:0,message:e}:5===e||4===e?{code:5,message:(0,h.Oy)({phrase:o,isLastVersion:!0})}:{code:0,message:k.Rb})},onFinally:function(){t(!1)},onSuccess:function(e){var n,t;if((null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.is_myself)&&(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.tip_message_params)){var a=e.data.tip_message_params;(0,w.c)([{message:__("You sent {{highlight}}%amount% %tokens_plural%{{/highlight}} to model {{modelName}}%model_name%{{/modelName}}",{amount:m.price,model_name:null==a?void 0:a.model_name,tokens_plural:_.kX.pluralise("tokens",m.price),"{{highlight}}(.*?){{/highlight}}":function(e){var n=e.args[0];return(0,s.jsx)("span",{className:"bc_bold",children:n})},"{{modelName}}(.*?){{/modelName}}":function(e){var n=e.args[0];return(0,s.jsx)("span",{className:"bc_bold bc_text_ellipsis bc_dir_ltr",children:n})}}),type:S.y.WISH_TIP_SENT}])}l()}};v&&(r.text=v),d(oe.q3)(r)}},handleCloseConfirmationDialog:function(){B(null)},handleOpenConfirmationDialog:function(){var e,n,t,s;if(c){var i=v.trim().length>500?{code:0,message:__("Too long (%max_length% characters max).",{max_length:500})}:m.price&&u","{{/highlight}}":"","{{ellipsis}}":"","{{highlight}}":""},phrase:null==a?void 0:a.message,isLastVersion:!0})});B(l)}}else(0,Z.a)()}},states:{confirmDialogPopupState:y,errorMessageState:A,formState:m,isCustomAmountWasSet:I}}},re=(0,i.memo)(function(e){var n=le(e),t=n.ref,i=t.inputElementRef,l=t.smilePanelOptionsRef,r=n.actions,c=r.handleChangeComment,u=r.handleChangeCustomTipAmount,d=r.handleChangeTipAmount,p=r.handleClickConfirm,_=r.handleCloseConfirmationDialog,f=r.handleOpenConfirmationDialog,x=n.states,C=x.confirmDialogPopupState,N=x.errorMessageState,y=x.formState,j=x.isCustomAmountWasSet;if(!(null==e?void 0:e.popup))return null;var k=e.popup,S=k.actions,w=k.amountInput,T=k.amountPostfix,B=k.caption,E=k.description,A=k.image,L=k.messageInput,P=k.purchaseTokensLink;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mpw_inner mp_wd_inner",children:[(0,s.jsx)(v.h,{className:"mpw_img_wrp",image:A,type:"__photo"}),"object"==typeof B&&(0,s.jsx)("a",{className:"mpw_caption __link bc_uppercase",href:(0,h.FC)(B.url),rel:"noopener noreferrer",target:"_blank",children:(0,h.Oy)({phrase:B.text,isLastVersion:!0})}),"string"==typeof B&&(0,s.jsx)("span",{className:"mpw_caption bc_uppercase",children:B}),Boolean(E)&&(0,s.jsx)("p",{className:"mpw_description",children:E}),(0,s.jsxs)("div",{className:"mpw_action",children:[S.map(function(e){return(0,s.jsx)(o.$n,{className:(0,m.n)({mpw_btn:!0,__mrn_border:e.price!==y.price}),label:e.caption,variant:e.price===y.price?"success":"light",onClick:function(){return d(e.price)}},e.caption)}),(0,s.jsxs)("label",{className:"mpw_amount",children:[(0,s.jsx)("span",{className:"mpw_label",children:w.label}),(0,s.jsxs)("span",{className:"bc_flex bc_flex_items_center",children:[(0,s.jsx)("input",{ref:i,className:(0,m.n)({mpw_input:!0,__success:j}),name:w.name,type:w.type,value:y.price,onChange:u}),(0,s.jsx)("span",{className:"mpw_postfix",children:T})]})]})]}),L&&(0,s.jsx)(g.V,{id:b.a.COMMENTS_GIFT,className:"mpw_comment",label:L.label,limit:500,smilePanelOptions:l.current,dontSendMessageByEnter:!0,onChange:c}),(0,s.jsxs)("div",{className:"mpw_bottom bc_flex bc_flex_justify_s_between bc_flex_items_center",children:[(0,s.jsx)(o.$n,{className:"mpw_send",disabled:!y.price,label:__("Send"),variant:"success",onClick:f}),N&&(0,s.jsxs)("p",{className:"mpw_msg",children:[(0,s.jsx)("span",{className:"mpw_error",children:N.message}),5===N.code&&P&&(0,s.jsx)("a",{className:"mpw_link",href:(0,h.FC)(P.url),rel:P.rel,children:P.text})]})]})]}),C&&(0,s.jsx)(a.PopupConfirmationDialog,{classNameWrapper:"__action_dialog",data:C,onClickClose:_,onClickConfirm:p})]})}),ce=t(64641)},20657:function(e,n,t){t.d(n,{r:function(){return o}});var a=t(15215),s=t(74848),i=t(47290),o=function(e){var n=e.containerClassName,t=(0,a.Tt)(e,["containerClassName"]);return(0,s.jsx)("div",{className:n,children:(0,s.jsx)(i.hp,(0,a.Cl)({},t))})}},12341:function(e,n,t){var a;t.d(n,{B:function(){return a},U:function(){return s}}),function(e){e.MINI_PROFILE="miniProfile",e.PROFILE="profile",e.STREAM="stream"}(a||(a={}));var s=function(){function e(){this.broadcastChannelIsAvailable="BroadcastChannel"in window,this.broadcastChannelIsAvailable&&(this.channel=new BroadcastChannel("socialProfilesChannel"),this.channel.addEventListener("message",this.broadcastChannelEventHandler.bind(this))),this.handlers={}}return Object.defineProperty(e,"instance",{get:function(){return this._instance||(this._instance=new this),this._instance},enumerable:!1,configurable:!0}),e.prototype.setHandler=function(e,n){var t;this.handlers[e]=null!==(t=this.handlers[e])&&void 0!==t?t:[],this.handlers[e].push(n)},e.prototype.removeHandler=function(e,n){this.handlers[e]=this.handlers[e].filter(function(e){return e!==n})},e.prototype.sendMessage=function(e){this.broadcastChannelIsAvailable&&this.channel.postMessage(e)},e.prototype.broadcastChannelEventHandler=function(e){this.handlers[e.data.target]&&this.handlers[e.data.target].forEach(function(n){return n(e.data)})},e}()},2241:function(e,n,t){t.d(n,{iC:function(){return l},KI:function(){return o},WD:function(){return r}});var a=t(96540),s=t(67356),i=t(80554),o=function(e){var n=e.boostTimeLeft,t=e.timeToEnableFreeRaise,o=e.isFreeRiseAvailable,l=e.onRaiseModelSocketMessage,r=e.onBoostTimeEnd,c=e.onFreeRiseAvailable,u=(0,a.useRef)({fanBoostEndDate:null,fanBoostTimeout:null,nextAvailableRaiseModelDate:null,nextAvailableRaiseModelTimeout:null}),d=(0,a.useCallback)(function(e){var n=Date.now(),t=0,a=u.current,s=a.fanBoostTimeout,i=a.fanBoostEndDate;e&&!i?(t=e,u.current.fanBoostEndDate=n+t):i&&(t=i-n),s&&window.clearTimeout(s),u.current.fanBoostTimeout=window.setTimeout(function(){if(u.current.fanBoostTimeout=null,u.current.fanBoostEndDate=null,r){r({boostTimeLeft:0})}},Math.max(t,0))},[r]),p=(0,a.useCallback)(function(e){var n=Date.now(),t=0,a=u.current,s=a.nextAvailableRaiseModelDate,i=a.nextAvailableRaiseModelTimeout;e&&!s?(t=1e3*e,u.current.nextAvailableRaiseModelDate=n+t):s&&(t=s-n),i&&window.clearTimeout(i),u.current.nextAvailableRaiseModelTimeout=window.setTimeout(function(){if(u.current.nextAvailableRaiseModelDate=null,u.current.nextAvailableRaiseModelTimeout=null,c){c({isFreeRiseAvailable:!0,nextAvailableBoostTimestamp:0,timeToEnable:0})}},Math.max(t,0))},[c]),m=(0,a.useCallback)(function(e){var n=e.detail;if("rm"===n.type){var t=1e3*s.r,a={boostTimeLeft:t,nextAvailableBoostTimestamp:Date.now()+1e3*n.timeout,timeToEnable:n.timeout,isFreeRiseAvailable:!1};l&&l(n,a),d(t),p(n.timeout)}},[d,p,l]);(0,a.useEffect)(function(){return document.addEventListener(i.R.SOCKET_NOTIFICATION_MESSAGE,m),function(){document.removeEventListener(i.R.SOCKET_NOTIFICATION_MESSAGE,m)}},[m]),(0,a.useEffect)(function(){n&&d(n)},[n,d]),(0,a.useEffect)(function(){!o&&t&&p(t)},[t,p,o])},l=1e3,r=function(e){var n=e.boostTimeout,t=(0,a.useState)(function(e){if(!e)return 0;var n=(new Date).getTime()-e.serverTime*l;return e.timeToEnable*l-n}(n)),s=t[0],i=t[1],o=(0,a.useRef)(0);return(0,a.useEffect)(function(){s>0&&!o.current&&(o.current=window.setInterval(function(){i(function(e){var n=e-l;return n<=0?0:n})},l)),0===s&&o.current&&(window.clearInterval(o.current),o.current=0)},[s]),{states:{freeRiseTimeoutState:s}}}}}]);