"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),i=require("lodash"),E=require("./hooks/useCommonChart.js"),f=require("../../../../../commons/plugins/datasource/index.js"),C=require("../../hooks/useChart.js"),d=require("../../../../../commons/plugins/event/index.js"),D={class:"zerov-widget"},q=["id"],x=r.defineComponent({__name:"index",props:{option:{},sources:{},useEvents:{},uuid:{}},emits:["dataListener","chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(l,{expose:h,emit:p}){const e=l,n=p,{id:m,setOption:u,chart:v,renderChart:a,renderData:o}=C.useChart({basicOption:i.cloneDeep(e.option),useEvents:i.cloneDeep(e.useEvents),customRenderData:t=>{t=i.cloneDeep(t),f.SHJDatasourceV2.parse({tId:e.uuid,sources:e.sources,callback:s=>{try{n("dataListener",s.data),d.SHJParseEvent.parseEvents(e.useEvents,"dataListener",s.data);const c=t.series.find(_=>_._sourceId===s.id);c&&(c.data=s.data[0].data),u(t)}catch{n("dataListener",null),d.SHJParseEvent.parseEvents(e.useEvents,"dataListener",null),u(t)}}})},emits:n});return E.useCommonChart(e,o,a),h({getEchartsInstance:()=>v.value,refresh:()=>{o(e.option),a(e.option)},refreshView:()=>{a(e.option)},refreshData:()=>{o(e.option)}}),(t,s)=>(r.openBlock(),r.createElementBlock("div",D,[r.createElementVNode("div",{id:r.unref(m),class:"widget"},null,8,q)]))}});exports.default=x;
