"use strict";(self.webpackChunkbongacams=self.webpackChunkbongacams||[]).push([[367],{31348:function(n,t,e){e.d(t,{Cb:function(){return u},I$:function(){return a}});var o=e(9613),i=e(72418),r="spoof",u=function(){var n={index:"FIRST",time:Date.now()},t=(0,o.Ri)(r);if(t){var e=JSON.parse(t).index;n.index="FIRST"===e?"SECOND":"THIRD"}(0,o.TV)(r,JSON.stringify(n),{expires:1,expiresType:"day",domain:(0,i.getRealDomain)()})},a=function(){var n=(0,o.Ri)(r),t=3e4;if(n){var e=JSON.parse(n),i=e.index,u=e.time,a=Date.now()-u;t="FIRST"===i?a<18e4?18e4-a:3e4:"SECOND"===i?a<3e5?3e5-a:3e4:a<864e5?864e5-a:864e5}return Math.floor(t/1e3)}},55053:function(n,t,e){e.r(t),e.d(t,{SpoofIm:function(){return _},init:function(){return L}});var o=e(50172),i=e(98614),r=e(37350),u=e(19826),a=e(80554),c=e(52661),f=e(52276),s=e(23385),l=e(7187),d=e(62614),p=e(31348),m=e(15215),g=e(13907),v=e(89836),S=e(52982),I=e(58369),C=e(9853),h=e(73324),b=e(41669),T=e(41669),M=function(){function n(){}var t;return t=n,n.getModelInfoForSpoof=function(n,e){return(0,m.sH)(void 0,void 0,void 0,(function(){var o,i,a,c,f,s,l,d,p,M,A,_,L,R,y,x,O,F,N,E,P,D,w,k,H;return(0,m.YH)(t,(function(t){switch(t.label){case 0:return o=window.chat,i=o.performerData,a=o.visibility,c=u.A.getState(),f=(0,v.Hh)(c),s=(0,I.mq)(c),l=(0,S.RX)(c),d=c.chatHost,p=c.lang,A=(M="visible"===a)?d.gender:f,[4,T.ajax({cache:!1,data:{gender:A,lang:p,versionId:n,isChat:Number(M)},dataType:"json",type:"get",url:(0,g.ip)("@ajax_get_spoof_im")})];case 1:if(_=t.sent(),L="",R="",y="",x=_.result.spoofId,O=_.result.messageId,F=_.result.spoofCountryCode,N=_.result.spoofBlurredImagePostfix,E=_.result.spoofVoicePostfix,M){if(!i)return[2];R=i.username,L=i.displayName,y=(0,g.X8)(i).replace("avatars","avatar120x120")}else{if(!s)return[2];if(P=s.length,w=l>=(D=P<30?P:30)?D:l,k=C.o8.rangeInt(0,w),H=s[k],0===w||!H)return[2];L=H.display_name,function(n){var t=u.A.getState().liveTab;b.ajax({success:function(n){if(h.A.isSuccess(n.status)){var e=n.result.user.profileImageUrls.avatar_120x120||"/images/default/thumb_m_".concat(t,".png");(0,r.um)(e)}},type:"get",url:(0,g.ip)("@api_get_user_info?username=".concat(n))})}(R=H.username)}return(0,r.eJ)({avatarUrl:y,displayName:L,gender:A,spoofBlurredImagePostfix:N,spoofCountryCode:F,spoofMessageId:O,spoofVersionId:x,spoofVoicePostfix:E,time:e||180,username:R}),[2]}}))}))},n.getTimeoutForSpoof=function(){return 1e4},n}(),A=(e(79959),e(41669)),_=function(){function n(){}var t;return n.init=function(){t.isAuthenticated||t.isInited||(document.body.classList.contains("page_index")&&t.startSpoofing(),A(document).on("chat:visibility",(function(){var n,e=window.chat.visibility;"hidden"===e?(t.startSpoofing(),null===(n=s.X.instance)||void 0===n||n.setTime(f.L.SPOOF_IM,(0,p.I$)())):"collapse"===e&&t.stopSpoofing()})),(0,l.c5)(a.R.SPA_NAVIGATE_START,(function(n){var e=n.detail;e&&!e.isAjaxLoad&&t.stopSpoofing()})),A(document).on("chat:open",(function(){var n;(0,p.Cb)(),t.stopSpoofing(),null===(n=s.X.instance)||void 0===n||n.setTime(f.L.SPOOF_IM,10)})),A(document).on(a.R.ON_CURRENT_CHATHOST_CHANGE,(function(){var n=u.A.getState().spoofIm;s.X.instance&&(s.X.instance.enableTask(f.L.SPOOF_IM),s.X.instance.setTime(f.L.SPOOF_IM,10),n.username&&s.X.instance.close()),t.startSpoofing()})),(0,l.c5)(a.R.SPOOF_START,(function(){return t.openFromConfig()})),(0,l.c5)(a.R.SPOOF_DEBUG,(function(n){return t.debugShow(null==n?void 0:n.detail)})),t.isInited=!0)},n.startSpoofing=function(){(0,r.d0)()},n.stopSpoofing=function(){(0,r.d0)(),clearTimeout(t.spoofTimeout)},n.openFromConfig=function(){M.getModelInfoForSpoof(),t.SpoofIMComponent||t.attachReactSpoofIM()},n.debugShow=function(n){var e=n.spoofVersionId,o=n.time;M.getModelInfoForSpoof(e,o),t.SpoofIMComponent||t.attachReactSpoofIM()},t=n,n.isInited=!1,n.isAuthenticated=u.A.getState().isAuthenticated,n.isDebug=c.o.isDev&&"1"===localStorage.getItem("spoof_im_debug"),n.renderComponent=function(){var n=document.createElement("div");n.classList.add("js-spoofIM"),document.body.appendChild(n),n.innerHTML="",t.rootNode=d.w.append((0,o.h)(i.Kq,{store:u.A},(0,o.h)(t.SpoofIMComponent,{nextMessageDelayMs:t.isDebug?50:void 0,nextMessageDurationMs:t.isDebug?50:void 0})),n)},n.attachReactSpoofIM=function(){t.rootNode||document.querySelectorAll("#bChat .video_limit_alert").length||!document.querySelectorAll(".js-index_banner").length||Promise.all([e.e(11),e.e(574),e.e(271)]).then(e.bind(e,1147)).then((function(n){t.SpoofIMComponent=n.default,t.renderComponent()}))},n}();function L(){_.init()}},10373:function(n,t,e){e.d(t,{n:function(){return i}});var o=e(23110),i=function(n){return[o.n.ALL,o.n.FEMALE,o.n.MALE,o.n.TRANSSEXUAL].includes(n)}},37350:function(n,t,e){e.d(t,{d0:function(){return u},eJ:function(){return r},um:function(){return a}});var o=e(15215),i=e(19826),r=i.A.action((function(n,t){return{spoofIm:(0,o.Cl)((0,o.Cl)({},n.spoofIm),t)}})),u=i.A.action((function(n){return{spoofIm:(0,o.Cl)((0,o.Cl)({},n.spoofIm),{avatarUrl:"",username:"",displayName:"",spoofVersionId:null,spoofMessageId:null,gender:null,time:180})}})),a=i.A.action((function(n,t){return{spoofIm:(0,o.Cl)((0,o.Cl)({},n.spoofIm),{avatarUrl:t})}}))},89836:function(n,t,e){e.d(t,{FC:function(){return s},Hh:function(){return r},Ux:function(){return f},jI:function(){return u},l1:function(){return p},mk:function(){return l},nE:function(){return c},oL:function(){return d},pc:function(){return m},q5:function(){return a}});var o=e(23110),i=e(10373),r=function(n){return n.liveTab},u=function(n){return n.pinnedLiveTab},a=function(n){return n.skinLiveTab},c=function(n){return n.listingInitialLiveTab},f=function(n){return n.listingLiveTabCounters},s=function(n){return n.listingAvailableLiveTabs},l=function(n){return u(n)||a(n)},d=function(n){var t=r(n);return t&&t===l(n)},p=function(n){var t=r(n);return t&&t===a(n)},m=function(n){var t=r(n);return(0,i.n)(t)?t:function(n){var t=l(n);return(0,i.n)(t)?t:o.n.FEMALE}(n)}},52982:function(n,t,e){e.d(t,{B0:function(){return p},Js:function(){return d},Km:function(){return v},Mk:function(){return c},Qy:function(){return a},RX:function(){return s},Ws:function(){return l},Ze:function(){return m},li:function(){return g},v1:function(){return u},wH:function(){return f}});var o=e(15839),i=e(74214),r=function(n){return n.listingLoader},u=function(n){return r(n).type},a=function(n){return r(n).offset},c=function(n){return r(n).limit},f=function(n){return r(n).totalCount},s=function(n){return r(n).onlineCount},l=function(n){return r(n).isPinSorting},d=function(n){return r(n).sorting},p=function(n){var t=a(n),e=c(n);return(Math.floor(t/e)||0)+1},m=function(n){var t=f(n),e=c(n);return Math.ceil(t/e)},g=function(n){return u(n)===i.J.PAGER},v=function(n){return!n.isModerator&&(0,o.TD)(n)}},58369:function(n,t,e){e.d(t,{Cd:function(){return r},_n:function(){return a},gt:function(){return u},mq:function(){return o},sr:function(){return i}});var o=function(n){return n.listingModels||[]},i=function(n){return n.listingBlocks},r=function(n){return n.listingInitialBlocks},u=function(n){return n.listingBlocksPinnedModels},a=function(n){return o(n).length||0}},74214:function(n,t,e){var o;e.d(t,{J:function(){return o}}),function(n){n.INFINITE_SCROLL="infinite_scroll",n.PAGER="pager",n.BLOCKS="blocks"}(o||(o={}))}}]);