"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),s=require("lodash"),f=require("../../core/useChart.js"),i=require("../../utils/parseDataset.js"),v={class:"zerov-widget"},b=["id"],_=c.defineComponent({name:"zv-chart-pie-index"}),w=c.defineComponent({..._,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(l,{expose:d,emit:p}){const e=l,h=p,{id:m,setOption:u,chart:D,renderChart:a,renderData:o}=f.useChart({basicOption:s.cloneDeep(e.basicOption),useEvents:s.cloneDeep(e.useEvents),customRenderData:t=>{t=s.cloneDeep(t);const r=s.cloneDeep(e.basicOption.title.text);window.SHJDatasourceV2({tId:e.uuid,sources:e.sources,callback:({data:n})=>{try{window.SHJParseEvent(e.useEvents,"dataListener",n),t.dataset=i.parseDataset(s.cloneDeep(n)),t.title.text=(i.parseDataset(s.cloneDeep(n)).source[0][i.parseDataset(s.cloneDeep(n)).dimensions[1]]||0)+r,u(t)}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),u(t)}}})},emit:h});return c.watch(()=>e.sources,()=>{e.sources&&e.sources.length>0&&o(e.basicOption)},{deep:!0}),c.watch(()=>s.cloneDeep(e.basicOption),(t,r)=>{s.isEqual(t,r)||a(t)},{deep:!0}),d({getEchartsInstance:()=>D.value,refresh:()=>{e.sources&&e.sources.length>0&&a(e.basicOption),o(e.basicOption)},refreshView:()=>{e.sources&&e.sources.length>0&&a(e.basicOption)},refreshData:()=>{o(e.basicOption)}}),(t,r)=>(c.openBlock(),c.createElementBlock("div",v,[c.createElementVNode("div",{id:c.unref(m),class:"widget"},null,8,b)]))}});exports.default=w;
