import{t as d}from"./debounce-Xd493GvO.js";import{r as f}from"./request-CEvu378m.js";import{ar as q}from"./echarts-DB130vfq.js";import{s as x,r as m,ax as V,c as h,w as v,j as K,n as j,X as z,B as O,z as W}from"./vue-BJk78QHK.js";import"./echartsliquidfill-DUkcMcKU.js";import{_ as k}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./echartsgl-CaHWxu1q.js";import"./vxe-Dx3zSILm.js";const B=Object.assign({name:"WaveSphere"},{__name:"WaveSphere",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(g){const e=g,t=x(null),r=m(null),i=m(null),s=V(),b=h(()=>e.propValue.config),y=h(()=>{const a=e.element.style.width,o=e.element.style.height;return{width:a,height:o}});v(y,d(a=>{n()},500),{deep:!0}),v(()=>e.propValue,d(a=>{c()},500),{deep:!0}),K(()=>{var a,o;e.request&&(r.value=f(e.request,e.propValue.config.series[0],"data")),((o=(a=e.request)==null?void 0:a.global)==null?void 0:o.length)>0&&s.watch(()=>s.state.globalKey,()=>{e.request.global.forEach(_=>{const u=s.state.globalKey.findIndex(l=>l.globalKey===_);if(u>-1){const l=[s.state.globalKey[u].globalKey,s.state.globalKey[u].globalValue],p=e.request.data.findIndex(w=>w[0]===l[0]);p>-1?e.request.data[p][1]=l[1]:e.request.data.push(l)}}),r.value(),r.value=f(e.request,e.propValue.config.series[0],"data")},{deep:!0}),t.value=q(i.value,"vintage"),j(()=>{c()}),window.addEventListener("resize",n)}),z(()=>{window.removeEventListener("resize",n),t.value&&(t.value.clear(),t.value=null),e.request&&r.value&&r.value()});function c(){t.value.setOption(b.value,!0)}function n(){t.value&&t.value.resize()}return(a,o)=>(W(),O("div",{ref_key:"chartRef",ref:i,style:{width:"100%",height:"100%"}},null,512))}}),A=k(B,[["__scopeId","data-v-89bd0ad7"]]);export{A as default};
