import { defineComponent as n, ref as f, createBlock as p, openBlock as m, mergeProps as l } from "vue";
import { cloneDeep as r } from "lodash";
import d from "../../../commons/components/common-chart/index.vue.mjs";
import { parseDataset as o } from "../../../../../commons/utils/parseDataset.mjs";
const h = n({ name: "zv-chart-pie-index" }), k = /* @__PURE__ */ n({
  ...h,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  setup(v, { expose: a }) {
    const u = (e, t, i) => {
      const c = r(e.title.text);
      e.dataset = o(r(t)), e.title.text = (o(r(t)).source[0][o(r(t)).dimensions[1]] || 0) + c, i(e);
    }, s = f();
    return a({
      getEchartsInstance: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.getEchartsInstance();
      },
      refresh: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.refresh();
      },
      refreshView: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.refreshView();
      },
      refreshData: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.refreshData();
      }
    }), (e, t) => (m(), p(d, l({
      ref_key: "componentRef",
      ref: s,
      option: e.basicOption,
      sources: e.sources,
      "use-events": e.useEvents,
      uuid: e.uuid,
      "is-multi-series": !1,
      "custom-render-data": u
    }, e.$attrs), null, 16, ["option", "sources", "use-events", "uuid"]));
  }
});
export {
  k as default
};
