import{t as q}from"./debounce-Xd493GvO.js";import{r as g}from"./request-CEvu378m.js";import{ax as $,r as y,c as f,w as p,j as K,X as V,B as j,z as B,D as a,H as m,W as o,u as c}from"./vue-BJk78QHK.js";import{_ as C}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const O={style:{}},k={class:"traffic-light"},z=Object.assign({name:"TrafficLights"},{__name:"TrafficLights",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(t){const e=t,r=$(),s=y(null),w=y(0),d=f(()=>e.propValue.data),v=f(()=>{const i=e.element.style.width,l=e.element.style.height;return{width:i,height:l}});return p(v,q(()=>{w.value++},500),{deep:!0}),K(()=>{var i,l;e.request&&(s.value=g(e.request,e.propValue,"data")),((l=(i=e.request)==null?void 0:i.global)==null?void 0:l.length)>0&&p(()=>r.state.globalKey,()=>{e.request.global.forEach(x=>{const u=r.state.globalKey.findIndex(n=>n.globalKey===x);if(u>-1){const n=[r.state.globalKey[u].globalKey,r.state.globalKey[u].globalValue],h=e.request.data.findIndex(b=>b[0]===n[0]);h>-1?e.request.data[h][1]=n[1]:e.request.data.push(n)}}),s.value&&s.value(),s.value=g(e.request,e.propValue,"data")},{deep:!0})}),V(()=>{e.request&&s.value&&s.value()}),(i,l)=>(B(),j("div",{class:"light-main",style:o({width:t.element.style.width,height:t.element.style.height})},[a("div",O,[a("div",k,[l[0]||(l[0]=a("div",{class:"protector"},null,-1)),l[1]||(l[1]=a("div",{class:"protector"},null,-1)),l[2]||(l[2]=a("div",{class:"protector"},null,-1)),a("div",{style:o({width:`${t.element.style.width/2}px`,margin:`${t.element.style.margin}px`,height:`${t.element.style.width/2}px`}),class:m(["light-red",{redC:c(d).red}])},null,6),a("div",{style:o({width:`${t.element.style.width/2}px`,margin:`${t.element.style.margin}px`,height:`${t.element.style.width/2}px`}),class:m(["light-yellow",{yellowC:c(d).yellow}])},null,6),a("div",{style:o({width:`${t.element.style.width/2}px`,margin:`${t.element.style.margin}px`,height:`${t.element.style.width/2}px`}),class:m(["light-green",{greenC:c(d).green}])},null,6)])])],4))}}),M=C(z,[["__scopeId","data-v-8dd0b60d"]]);export{M as default};
