"use strict";(self["webpackChunkblivechat"]=self["webpackChunkblivechat"]||[]).push([[626],{626:function(e,t,i){i.r(t),i.d(t,{default:function(){return y}});var a=i(1772),n=i(8697),r=i(8310);const o=["成龙","杨戬","孙悟空","哈基米","大张伟","周冠宇","五条悟","博丽灵梦","御剑侍伶","田所浩二","小岛秀夫","長崎そよ","柚木つばめ","空條承太郎","みもりあいの","ディオ・ブランドー","Dante","xQcOW","Makarov","xfgryujk","Jim Hacker","Rick Astley","Tifa Lockhart","Arthur Morgan"],l=["草","会赢的","让我看看","卑鄙的外乡人","我不做人了，JOJO","想吃广东菜✋😭✋","已经没有什么好怕的了","你这猴子，真令我欢喜","[dog]文本[比心]表情[喝彩]","阿祖，投降吧，外面全是警察","無駄無駄無駄無駄無駄無駄無駄無駄","我衰咗三年，我等緊個機會，爭番口氣","因为你的缘故，我的心中萌生了多余的情感","迷えば、敗れる","逃げるんだよォ！","届かない恋をしていても","なんで春日影やったの！？","kksk","Y.M.C.A.","8888888888","text[吃瓜]emoticon","Remember... no Russian","Never gonna give you up","DU↗DU→DU↗DU↓ Max Verstappen","Farewell, ashen one. May the flame guide thee","Hey Vergil, your portal opening days are over. Give me the Yamato",'<script>alert("CHECK YOUR CODE")<\/script>',"<img src=1 onerror=\"alert('CHECK YOUR CODE')\">"],s=["233","miaoa","lipu","huangdou_xihuan","sakaban_jiayu_yutou"].map((e=>`${window.location.origin}/static/img/emoticons/${e}.png`)),d=["这是翻译","これは翻訳です","blah blah blah"],m=[{weight:10,value:a.g5},{weight:5,value:a.B6},{weight:2,value:a.aD},{weight:1,value:a.Rh}],u=[0,19998,1998,198];function f(){let e,t=w(m);return e=t===a.B6?v(1,3):t===a.aD?v(0,3):0,{authorType:t,privilegeType:e}}const h=["ikun","K学姐","小孤独","Go学长","不登校"];function c(){let e=v(1,4)<=1?0:v(1,40),t=0===e?"":w(h);return{medalLevel:e,medalName:t}}const g=[{giftId:1,giftName:"粉丝团灯牌",totalFreeCoin:200,num:10,giftIconUrl:"//s1.hdslb.com/bfs/live/e051dfd4557678f8edcac4993ed00a0935cbd9cc.png"},{giftId:2,giftName:"可爱捏",totalCoin:9900,giftIconUrl:"//s1.hdslb.com/bfs/live/6dab14826b531c731521345e00d6b56a6708a449.png"},{giftId:3,giftName:"花式夸夸",totalCoin:29900,giftIconUrl:"//s1.hdslb.com/bfs/live/28186596880db45a7b843f17d6ebb70feeac06f9.png"},{giftId:4,giftName:"情书",totalCoin:52e3,num:10,giftIconUrl:"//s1.hdslb.com/bfs/live/14dafbf217618f0931c08897e0b3eefc00d0da22.png"},{giftId:5,giftName:"极速超跑",totalCoin:1e5,giftIconUrl:"//s1.hdslb.com/bfs/live/27b9734d1a5f77ea6fc94957e3fcbeb55505c6b9.png"},{giftId:6,giftName:"为你摘星",totalCoin:52e4,giftIconUrl:"//s1.hdslb.com/bfs/live/5bd584b6fdfb03d66de56102e775582fb29ceab7.png"},{giftId:7,giftName:"次元之城",totalCoin:1245e3,giftIconUrl:"//s1.hdslb.com/bfs/live/cdae8136b1ee767609aeec688bca8124651d4d01.png"}],b=[30,50,100,200,500,1e3],p=[{weight:20,value(){return{type:a.PY,message:new r.rf({...f(),...c(),authorName:w(o),content:w(l),isGiftDanmaku:v(1,10)<=1,authorLevel:v(1,60),isNewbie:v(1,10)<=1,isMobileVerified:v(1,10)<=9,translation:v(1,10)<=1?w(d):""})}}},{weight:5,value(){return{type:a.PY,message:new r.rf({...f(),...c(),authorName:w(o),authorLevel:v(1,60),isNewbie:v(1,10)<=1,isMobileVerified:v(1,10)<=9,emoticon:w(s)})}}},{weight:1,value(){return{type:a.Qx,message:new r.He({...c(),...w(g),authorName:w(o),privilegeType:v(0,3)})}}},{weight:3,value(){return{type:a.Am,message:new r._R({...c(),authorName:w(o),price:w(b),content:w(l),translation:v(1,10)<=1?w(d):"",privilegeType:v(0,3)})}}},{weight:1,value(){let e=v(1,3);return{type:a.RA,message:new r.DZ({...c(),authorName:w(o),privilegeType:e,total_coin:1e3*u[e]})}}}];function w(e){if(0===e.length)return null;for(let a of e)if(void 0===a.weight||void 0===a.value)return e[v(0,e.length-1)];let t=0;for(let a of e)t+=a.weight;let i=v(1,t);for(let a of e)if(i-=a.weight,!(i>0))return a.value instanceof Array?w(a.value):a.value;return null}function v(e,t){return Math.floor(e+(t-e+1)*Math.random())}class y{constructor(){this.msgHandler=n.wR(),this.timerId=null}start(){this.refreshTimer()}stop(){this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)}refreshTimer(){let e;e=0==v(0,4)?v(1e3,2e3):v(0,400),this.timerId&&window.clearTimeout(this.timerId),this.timerId=window.setTimeout(this.onTimeout.bind(this),e)}onTimeout(){this.refreshTimer();let{type:e,message:t}=w(p)();switch(e){case a.PY:this.msgHandler.onAddText(t),this.maybeTranslate(t);break;case a.Qx:this.msgHandler.onAddGift(t);break;case a.RA:this.msgHandler.onAddMember(t);break;case a.Am:this.msgHandler.onAddSuperChat(t),this.maybeTranslate(t),this.maybeDeleteSc(t);break}}maybeTranslate(e){e.translation||v(1,4)<=1||window.setTimeout((()=>{let t=new r.El({id:e.id,translation:w(d)});this.msgHandler.onUpdateTranslation(t)}),v(1e3,3e3))}maybeDeleteSc(e){v(1,5)<=4||window.setTimeout((()=>{let t=new r.EP({ids:[e.id]});this.msgHandler.onDelSuperChat(t)}),v(1e3,3e3))}}}}]);
//# sourceMappingURL=626.17ba29b9.js.map