import{ac as a,B as e,ad as t,ae as s,af as n,ag as o,ah as i,ai as r,aj as l,ak as u,av as m,an as p,ao as d,ap as v}from"./echarts.js?v=1764830988434";import{d3 as c}from"./naive.js?v=1764830988434";import{k as f,r as h,w as g,o as y,n as j,ap as w,b as _,R as B,V as b,I as x,U as I}from"./vue.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./common.js?v=1764830988434";e([t,s,n,o,i,r,l,u,m,p,d,v]);const k=f({__name:"index",props:{width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"200px"},dataZoom:{type:Boolean,default:!1},option:{type:Object,required:!0}},setup(e){const t=e,s=h(null);function n(){if(null===s.value)return;let e=a.getInstanceByDom(s.value);null==e&&(e=a.init(s.value)),e.setOption(t.option,!0)}g(()=>t.option,a=>{a&&j(()=>{n()})},{immediate:!0,deep:!0});const o=w(function(){var e;null!==s.value&&(null==(e=a.getInstanceByDom(s.value))||e.resize())},300,{maxWait:800});return y(()=>{j(()=>{n(),window.addEventListener("resize",o)})}),_(()=>{var e;s.value&&(null==(e=a.getInstanceByDom(s.value))||e.dispose(),window.removeEventListener("resize",o))}),(a,t)=>(b(),B("div",{ref_key:"chartRef",ref:s,style:x({width:I(c)(e.width),height:I(c)(e.height)})},null,4))}});export{k as default};
