import{_ as H}from"./bomb.js";import{_ as b}from"./time2.js";import{o as w,c as f,a as o,e as h,t as r,n as P,_ as S,Q as x,r as M,b as y,y as l,H as N,R as B}from"./index.js";const C={class:"helloween-hot-potato-position__value"},D=o("div",{class:"helloween-hot-potato-position__value__divider"},[o("div",{class:"helloween-hot-potato-position__value__divider-line"})],-1),V=o("div",{class:"helloween-hot-potato-position__value__total"},[h("Количество "),o("br"),h("участников")],-1),k={class:"helloween-hot-potato-position__alerts"},I=o("img",{class:"helloween-hot-potato-position__hint__icon",src:H},null,-1),z={class:"helloween-hot-potato-position__hint__text"},A={class:"helloween-hot-potato-position__time"},E=o("img",{src:b},null,-1),Q={class:"helloween-hot-potato-position__time__value"},R={class:"helloween-hot-potato-position__time__seconds"};function U(n,s,e,t,a,_){return w(),f("div",{class:P(["helloween-hot-potato-position",{"helloween-hot-potato-position_mobile":_.isMobile}])},[o("div",C,[h(r(e.totalPosition),1),D,V]),o("div",k,[o("div",{class:P(["helloween-hot-potato-position__hint",{"helloween-hot-potato-position__hint_hidden":!e.isShowHint}])},[I,o("div",z,r(e.currentPosition),1)],2),o("div",A,[E,o("div",Q,[h(r(t.formatedTime.h)+":"+r(t.formatedTime.m),1),o("div",R,":"+r(t.formatedTime.s),1)])])])],2)}const $={props:{time:Number,currentPosition:String,totalPosition:Number,isShowHint:Boolean},setup(n){return{formatedTime:x(()=>{const e=Math.floor(n.time/3600),t=Math.floor(n.time%3600/60),a=Math.floor(n.time%3600%60);return{h:e.toString().padStart(2,"0"),m:t.toString().padStart(2,"0"),s:a.toString().padStart(2,"0")}})}},computed:{isMobile(){return this.$root.isMobile}}},j=S($,[["render",U]]),q={class:"helloween-hot-potato iface-container"};function F(n,s,e,t,a,_){const c=M("Position");return w(),f("div",q,[y(c,{currentPosition:t.currentPosition,totalPosition:t.totalPosition,time:t.time,isShowHint:t.isShowHint},null,8,["currentPosition","totalPosition","time","isShowHint"])])}const G={props:["openParams"],components:{Position:j},data:()=>({noAdaptation:!0}),setup(n){const s=l(3),e=l(40),t=l(3600),a=l(new Date().getTime()),_=l(null),c=l(!0),d=i=>t.value=i,m=i=>s.value=i,p=i=>e.value=i,u=i=>c.value=i;if(n.openParams){const[i,T,g]=n.openParams;m(T),p(i),d(g),u(!0)}const v=()=>clearInterval(_.value);return N(()=>{_.value=setInterval(()=>{const i=Math.round((new Date().getTime()-a.value)/1e3);a.value=new Date().getTime(),t.value-=i,t.value<=0&&v()},1e3)}),B(v),{currentPosition:s,totalPosition:e,time:t,isShowHint:c,setCurrentPosition:m,setTotalPosition:p,setHint:u,setTime:d}},methods:{update(n,s,e){this.setCurrentPosition(s),this.setTotalPosition(n),this.setTime(e)}}},O=S(G,[["render",F]]);export{O as default};
