var x=Object.defineProperty;var k=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var w=(n,t,r)=>t in n?x(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,z=(n,t)=>{for(var r in t||(t={}))C.call(t,r)&&w(n,r,t[r]);if(k)for(var r of k(t))b.call(t,r)&&w(n,r,t[r]);return n};import{useTimeoutFn as c}from"./useTimeout-DC8132dd.js";import{B as y,m as B,x as H,ak as R,v as S}from"./index-CYriLmQo.js";import{e as D,f as T,w as h,u as i,n as L}from"./vue-vendor-CxLCUzY4.js";import O from"./echarts-DjaBQeb6.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./renderers-qdWQN0CG.js";function P(n,t="default"){const{getDarkMode:r}=y(),u=D(()=>t==="default"?r.value:t);let e=null,l=v;const a=T({});let d=()=>{};l=S(v,200);const g=D(()=>u.value!=="dark"?a.value:z({backgroundColor:"transparent"},a.value));function m(s=t){const o=i(n);if(!o||!i(o))return;e=O.init(o,s);const{removeEvent:f}=H({el:window,name:"resize",listener:l});d=f;const{widthRef:F,screenEnum:M}=R();(i(F)<=M.MD||o.offsetHeight===0)&&c(()=>{l()},30)}function p(s,o=!0){var f;if(a.value=s,((f=i(n))==null?void 0:f.offsetHeight)===0){c(()=>{p(i(g))},30);return}L(()=>{c(()=>{!e&&(m(u.value),!e)||(o&&(e==null||e.clear()),e==null||e.setOption(i(g)))},30)})}function v(){e==null||e.resize()}h(()=>u.value,s=>{e&&(e.dispose(),m(s),p(a.value))}),B(()=>{e&&(d(),e.dispose(),e=null)});function E(){return e||m(u.value),e}return{setOptions:p,resize:v,echarts:O,getInstance:E}}export{P as useECharts};
