import{_ as $,a as D}from"./line.js";import{o as h,c as m,a as n,e as d,t as s,F as H,i as V,n as u,_ as v,Q as A,r as M,b as T,y as c,H as F,R as I}from"./index.js";import{_ as z}from"./time2.js";const E=n("div",{class:"helloween-royal-race-top__shadow"},null,-1),J={class:"helloween-royal-race-top__position"},L={class:"helloween-royal-race-top__position__total"},O={key:0,class:"helloween-royal-race-top__line",src:$},Q={key:1,class:"helloween-royal-race-top__line",src:D},U={class:"helloween-royal-race-top__items"},q={class:"helloween-royal-race-top__item__position"},G={class:"helloween-royal-race-top__item__name"};function K(a,p,e,t,r,_){return h(),m("div",{class:u(["helloween-royal-race-top",{"helloween-royal-race-top_mobile":e.isMobile}])},[E,n("div",J,[d(s(e.currentPosition),1),n("div",L,"/"+s(e.totalPosition),1)]),e.isMobile?(h(),m("img",O)):(h(),m("img",Q)),n("div",U,[(h(!0),m(H,null,V(e.isMobile?e.players.slice(0,3):e.players,(i,l)=>(h(),m("div",{class:u(["helloween-royal-race-top__item",{"helloween-royal-race-top__item_current":e.currentPosition===l+1}]),key:l},[n("div",q,s(l+1),1),n("div",G,s(i.split("_").join(" ")),1)],2))),128))])],2)}const W={props:{isMobile:Boolean,players:Array,currentPosition:Number,totalPosition:Number},setup(){}},X=v(W,[["render",K]]),Y=n("div",{class:"helloween-royal-race-checkpoint__bg"},null,-1),Z={class:"helloween-royal-race-checkpoint__value"},j={class:"helloween-royal-race-checkpoint__value__total"},ee=n("div",{class:"helloween-royal-race-checkpoint__text"},"Чекпоинтов пройдено",-1),oe={class:"helloween-royal-race-checkpoint__time"},te=n("img",{src:z},null,-1),ne={class:"helloween-royal-race-checkpoint__time__value"},ae={class:"helloween-royal-race-checkpoint__time__seconds"};function se(a,p,e,t,r,_){return h(),m("div",{class:u(["helloween-royal-race-checkpoint",{"helloween-royal-race-checkpoint_mobile":e.isMobile}])},[Y,n("div",Z,[d(s(e.currentCheckpoint),1),n("div",j,"/"+s(e.totalCheckpoint),1)]),ee,n("div",oe,[te,n("div",ne,[d(s(t.formatedTime.h)+":"+s(t.formatedTime.m),1),n("div",ae,":"+s(t.formatedTime.s),1)])])],2)}const ie={props:{isMobile:Boolean,time:Number,currentCheckpoint:Number,totalCheckpoint:Number},setup(a){return{formatedTime:A(()=>{const e=Math.floor(a.time/3600),t=Math.floor(a.time%3600/60),r=Math.floor(a.time%3600%60);return{h:e.toString().padStart(2,"0"),m:t.toString().padStart(2,"0"),s:r.toString().padStart(2,"0")}})}}},le=v(ie,[["render",se]]),ce={class:"helloween-royal-race iface-container"};function re(a,p,e,t,r,_){const i=M("Top"),l=M("Checkpoint");return h(),m("div",ce,[T(i,{isMobile:_.isMobile,players:t.players,currentPosition:t.currentPosition,totalPosition:t.totalPosition},null,8,["isMobile","players","currentPosition","totalPosition"]),T(l,{isMobile:_.isMobile,currentCheckpoint:t.currentCheckpoint,totalCheckpoint:t.totalCheckpoint,time:t.time},null,8,["isMobile","currentCheckpoint","totalCheckpoint","time"])])}const _e={props:["openParams"],components:{Top:X,Checkpoint:le},data:()=>({noAdaptation:!0}),setup(a){const p=c(["Pavel_Nabokov","Pavel_Nabokov","Pavel_Nabokov","Pavel_Nabokov","Pavel_Nabokov"]),e=c(3),t=c(40),r=c(7),_=c(40),i=c(3600),l=c(new Date().getTime()),y=c(null),g=o=>i.value=o,k=o=>p.value=typeof o=="string"?JSON.parse(o):o,b=o=>e.value=o,w=o=>t.value=o,P=o=>r.value=o,f=o=>_.value=o;if(a.openParams){const[o,N,S,x,B,R]=a.openParams;b(o),w(N),P(S),f(x),g(B),k(R)}const C=()=>clearInterval(y.value);return F(()=>{y.value=setInterval(()=>{const o=Math.round((new Date().getTime()-l.value)/1e3);l.value=new Date().getTime(),i.value-=o,i.value<=0&&C()},1e3)}),I(C),{players:p,currentPosition:e,totalPosition:t,currentCheckpoint:r,totalCheckpoint:_,time:i,setCurrentPosition:b,setTotalPosition:w,setCurrentCheckpoint:P,setTotalCheckpoint:f,setPlayers:k}},computed:{isMobile(){return this.$root.isMobile}}},de=v(_e,[["render",re]]);export{de as default};
