/* empty css       */import{C as l}from"./CommandLogo.js";import{r as _,o as h,c as u,a as e,t,b as a,d as r,_ as v}from"./index.js";const f={class:"scoreboard-wrapper"},p={class:"scoreboard"},g={class:"scoreboard__time"},T={class:"commands commands--v1"},y={class:"command command--v1 command-stat"},b={class:"command__data"},N={class:"command__logo"},L={class:"command__name"},I=e("div",{class:"commands-divide-dots"},":",-1),w={class:"command command--v1 command-stat"},x={class:"command__data"},B={class:"command__name"},k={class:"command__logo"},z={class:"scoreboard-notify",ref:"notify"},D={class:"command-name"},P={class:"notify-text"},S={class:"time"};function C(o,i,n,m,s,d){const c=_("command-logo");return h(),u("div",f,[e("div",p,[e("div",g,[e("span",null,t(d.formatedTime()),1),e("span",null,t(s.timeNumber)+"/2",1)]),e("div",T,[e("div",y,[e("div",b,[e("div",N,[a(c,{size:40,colorBackground:s.commands[0][1][0],colorLogo:s.commands[0][1][1],typeLogo:s.commands[0][1][2]},null,8,["colorBackground","colorLogo","typeLogo"])]),e("div",L,t(s.commands[0][0]),1)]),e("div",{class:"command__score",style:r({color:s.commands[0][2]>s.commands[1][2]?"#feb900":"white"})},t(s.commands[0][2]),5)]),I,e("div",w,[e("div",{class:"command__score",style:r({color:s.commands[1][2]>s.commands[0][2]?"#feb900":"white"})},t(s.commands[1][2]),5),e("div",x,[e("div",B,t(s.commands[1][0]),1),e("div",k,[a(c,{size:40,colorBackground:s.commands[1][1][0],colorLogo:s.commands[1][1][1],typeLogo:s.commands[1][1][2]},null,8,["colorBackground","colorLogo","typeLogo"])])])])]),e("div",z,[e("div",D,t(s.notify.name),1),e("div",P,t(s.notify.text),1),e("div",S,t(s.notify.time),1)],512)])])}const M={props:["openParams"],components:{CommandLogo:l},data(){return{commands:[],remainingTime:0,timeNumber:1,pauseTime:0,openingTime:0,notify:{name:null,text:null,time:null},intervalId:null}},created(){const o=this.openParams||[["Aztecas",["b74e4e","000000",3],4],["Groove",["249dd6","dddddd",4],2],Date.now()/1e3+200,2,Date.now()/1e3];this.setInterfaceParams(o),this.intervalId=setInterval(()=>{this.pauseTime>0?this.pauseTime-=1:(this.remainingTime-=1,this.openingTime+=1),this.remainingTime<=0&&clearInterval(this.intervalId)},1e3)},unmounted(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},methods:{stopTimer(o){this.pauseTime=Number(o)},startTimer(){this.pauseTime=0},addTimeToRemaining(o){this.remainingTime+=Number(o)},setTimeToRemaining(o){this.remainingTime=Number(o)},setTimeNumber(o){this.timeNumber=Number(o)},setInterfaceParams(o){let i=o[4]||Date.now()/1e3;this.commands=[o[0],o[1]],this.remainingTime=Number(o[2])-i,this.timeNumber=Number(o[3])},formatedTime(o=this.remainingTime){const i=Math.floor(o/60)%60,n=Math.floor(o-i*60)%60;return(i>=10?i:"0"+i)+":"+(n>=10?n:"0"+n)},goal(o,i="Забивает гол!",n=0){this.notify.name=this.commands[o][0],this.notify.text=i,this.notify.time=this.formatedTime(this.openingTime),this.commands[o][2]+=1;const m=this.$refs.notify;m.classList.add("notify-show"),setTimeout(()=>{m.classList.remove("notify-show")},6700),n!=0&&this.stopTimer(n)}}},E=v(M,[["render",C]]);export{E as default};
