import { defineComponent as f, createElementBlock as h, openBlock as v, createElementVNode as D, unref as E } from "vue";
import { cloneDeep as i } from "lodash";
import { useCommonChart as _ } from "./hooks/useCommonChart.mjs";
import "../../../../text-text-basic/index.mjs";
import "../../../../text-table-basic/index.mjs";
import "../../../../chart-other-gauge/index.mjs";
import "../../../../chart-other-gauge-stage/index.mjs";
import "../../../../chart-other-gauge-grade/index.mjs";
import "../../../../chart-other-word-cloud/index.mjs";
import "../../../../chart-other-liquidfill/index.mjs";
import "../../../../chart-other-funnel/index.mjs";
import "../../../../chart-other-force/index.mjs";
import "../../../../chart-other-radar/index.mjs";
import "../../../../chart-other-funnel-split/index.mjs";
import "../../../../chart-other-funnel-contrast/index.mjs";
import "../../../../chart-other-candlestick-basic/index.mjs";
import "../../../../chart-other-candlestick-shanghai/index.mjs";
import "../../../../chart-other-candlestick-demo/index.mjs";
import "../../../../chart-other-heatmap/index.mjs";
import "../../../../chart-other-force2/index.mjs";
import "../../../../chart-other-graph-basic/index.mjs";
import "../../../../chart-other-graph-basic2/index.mjs";
import "../../../../chart-other-graph-calendar/index.mjs";
import "../../../../chart-other-tree-line/index.mjs";
import "../../../../chart-other-treemap-basic/index.mjs";
import "../../../../chart-other-sunburst-basic/index.mjs";
import "../../../../chart-other-sunburst-basic2/index.mjs";
import "../../../../chart-other-sunburst-basic3/index.mjs";
import "../../../../chart-other-sunburst-basic4/index.mjs";
import "../../../../chart-other-sunburst-book/index.mjs";
import "../../../../chart-other-sunburst-radius/index.mjs";
import "../../../../chart-other-sunburst-flavors/index.mjs";
import "../../../../chart-other-parallel-basic/index.mjs";
import "../../../../chart-other-parallel-mul/index.mjs";
import "../../../../chart-other-circular-graph/index.mjs";
import "../../../../map-earth-basic/index.mjs";
import "../../../../map-earth-cool-tech/index.mjs";
import "../../../../map-earth-particle/index.mjs";
import "../../../../map-earth-hacker/index.mjs";
import "../../../../map-earth-fly-line/index.mjs";
import "../../../../chart-other-grid-percentage/index.mjs";
import "../../../../chart-other-radar-stack/index.mjs";
import "../../../../chart-other-funnel2/index.mjs";
import "../../../../chart-other-label-gauge/index.mjs";
import "../../../../chart-other-theme-river/index.mjs";
import "../../../../chart-other-tree/index.mjs";
import "../../../../chart-other-treemap/index.mjs";
import "../../../../commons-product-model/index.mjs";
import "../../../../commons-vr-photo/index.mjs";
import "../../../../commons-vr-video/index.mjs";
import "../../../../commons-three-loader/index.mjs";
import "../../../../commons-three-loader3/index.mjs";
import "../../../../commons-loop-iterator/index.mjs";
import "../../../../commons-gaussian-splatting-view/index.mjs";
import "../../../../commons-babylon/index.mjs";
import "../../../../commons-svg/index.mjs";
import "../../../../commons-weather/index.mjs";
import "../../../../commons-weather-dynamic/index.mjs";
import "../../../../media-wavesurfer/index.mjs";
import "../../../../interaction-tabs/index.mjs";
import "../../../../interaction-tabs2/index.mjs";
import "../../../../interaction-button/index.mjs";
import "../../../../interaction-button-image/index.mjs";
import "../../../../interaction-select/index.mjs";
import "../../../../interaction-input/index.mjs";
import "../../../../interaction-radio/index.mjs";
import "../../../../interaction-slider/index.mjs";
import "../../../../interaction-switch/index.mjs";
import "../../../../interaction-data-picker/index.mjs";
import "../../../../interaction-button-refresh/index.mjs";
import "../../../../media-image/index.mjs";
import "../../../../text-title/index.mjs";
import "../../../../commons-qrcode/index.mjs";
import "../../../../media-video/index.mjs";
import "../../../../media-audio/index.mjs";
import "../../../../text-real-time/index.mjs";
import "../../../../media-carousel/index.mjs";
import "../../../../media-carousel-slides/index.mjs";
import "../../../../media-iframe-carousel/index.mjs";
import "../../../../media-iframe/index.mjs";
import "../../../../media-m3u8/index.mjs";
import "../../../../media-m3u8-dynamic/index.mjs";
import "../../../../media-audio-dynamic/index.mjs";
import "../../../../media-video-dynamic/index.mjs";
import "../../../../media-image-dynamic/index.mjs";
import "../../../../media-iframe-dynamic/index.mjs";
import "../../../../media-flv/index.mjs";
import "../../../../commons-echarts/index.mjs";
import "../../../../text-over-number/index.mjs";
import "../../../../text-table-scroll/index.mjs";
import "../../../../text-carousel/index.mjs";
import "../../../../text-row-scroll/index.mjs";
import "../../../../text-text-dynamic/index.mjs";
import "../../../../text-count-down/index.mjs";
import "../../../../graphical-circle/index.mjs";
import "../../../../graphical-diamond/index.mjs";
import "../../../../graphical-hexagon/index.mjs";
import "../../../../graphical-isosceles-triangle/index.mjs";
import "../../../../graphical-pentagon/index.mjs";
import "../../../../graphical-rect/index.mjs";
import "../../../../graphical-right-triangle/index.mjs";
import "../../../../scene-map3d/index.mjs";
import "../../../../scene-amap2d/index.mjs";
import "../../../../scene-amap3d/index.mjs";
import "../../../../scene-vr/index.mjs";
import "../../../../scene-unity-iframe/index.mjs";
import "../../../../scene-unity-webgl/index.mjs";
import "../../../../scene-ue-iframe/index.mjs";
import "../../../../scene-ue-shj/index.mjs";
import "../../../../scene-default/index.mjs";
import "../../../../interaction/tabs/index.mjs";
import "../../../../interaction/tabs-icon/index.mjs";
import "../../../../interaction/button/index.mjs";
import "../../../../interaction/date-picker/src/date-picker/index.mjs";
import "../../../../interaction/date-picker/src/date-picker-range/index.mjs";
import "../../../../text/list/index.mjs";
import "../../../src/bar/basic/index.mjs";
import "../../../src/bar/animation/index.mjs";
import "../../../src/bar/contrast/index.mjs";
import "../../../src/bar/contrast2/index.mjs";
import "../../../src/bar/contrast3/index.mjs";
import "../../../src/bar/gradient-column-chart/index.mjs";
import "../../../src/bar/horizontal/index.mjs";
import "../../../src/bar/horizontal-stack/index.mjs";
import "../../../src/bar/line-bar/index.mjs";
import "../../../src/bar/line-bar2/index.mjs";
import "../../../src/bar/loop/index.mjs";
import "../../../src/bar/mini/index.mjs";
import "../../../src/bar/polar/index.mjs";
import "../../../src/bar/polar-stack/index.mjs";
import "../../../src/bar/polar2/index.mjs";
import "../../../src/bar/radius-circle/index.mjs";
import "../../../src/bar/rank/index.mjs";
import "../../../src/bar/segmented-progress/index.mjs";
import "../../../src/bar/spire/index.mjs";
import "../../../src/bar/stack/index.mjs";
import "../../../src/bar/stack-line/index.mjs";
import "../../../src/bar/stack2/index.mjs";
import "../../../src/bar/stack3/index.mjs";
import "../../../src/bar/staggered/index.mjs";
import "../../../src/bar/three/index.mjs";
import "../../../src/bar/waterfall/index.mjs";
import "../../../src/bar/zebra/index.mjs";
import "../../../src/line/area-gradient/index.mjs";
import "../../../src/line/area-highlight/index.mjs";
import "../../../src/line/area-highlight2/index.mjs";
import "../../../src/line/basic/index.mjs";
import "../../../src/line/bump/index.mjs";
import "../../../src/line/dashed/index.mjs";
import "../../../src/line/ladder/index.mjs";
import "../../../src/line/logarithm/index.mjs";
import "../../../src/line/multix/index.mjs";
import "../../../src/line/polar-double/index.mjs";
import "../../../src/line/rain-flow/index.mjs";
import "../../../src/line/scale/index.mjs";
import "../../../src/line/smooth/index.mjs";
import "../../../src/line/smooth-area/index.mjs";
import "../../../src/line/stack/index.mjs";
import "../../../src/line/stack-area/index.mjs";
import "../../../src/line/temp/index.mjs";
import "../../../src/line/vertical/index.mjs";
import "../../../src/map/basic/index.mjs";
import "../../../src/map/bmap-basic/index.mjs";
import "../../../src/map/bmap-heatmap/index.mjs";
import "../../../src/map/bmap-rich/index.mjs";
import "../../../src/map/customize/index.mjs";
import "../../../src/map/lines/index.mjs";
import "../../../src/map/scatter/index.mjs";
import "../../../src/pie/3d/index.mjs";
import "../../../src/pie/basic/index.mjs";
import "../../../src/pie/basic2/index.mjs";
import "../../../src/pie/customized/index.mjs";
import "../../../src/pie/index/index.mjs";
import "../../../src/pie/interval/index.mjs";
import "../../../src/pie/legend-scroll/index.mjs";
import "../../../src/pie/radius/index.mjs";
import "../../../src/pie/rose/index.mjs";
import "../../../src/pie/round/index.mjs";
import "../../../src/pie/sunburst/index.mjs";
import "../../../src/scatter/basic/index.mjs";
import "../../../src/scatter/basic2/index.mjs";
import "../../../src/scatter/bubble/index.mjs";
import "../../../src/scatter/ripples/index.mjs";
import "../../../../commons/custom-component-render/index.mjs";
import "../../../../hj-componets/zv-hj-tree-list/index.mjs";
import "../../../../hj-componets/zv-hj-model-resource/index.mjs";
import "../../../../hj-componets/zv-hj-one-map-config/index.mjs";
import "../../../../hj-componets/zv-hj-video-control/index.mjs";
import "../../../../hj-componets/zv-hj-video-page/index.mjs";
import "../../../../hj-componets/zv-hj-password-input/index.mjs";
import "../../../../hj-componets/zv-hj-carousel/index.mjs";
import "../../../../hj-componets/zv-hj-video-monitor/index.mjs";
import "../../../../hj-componets/zv-hj-scene-amap2d/index.mjs";
import "../../../../hj-componets/zv-hj-scene-amap3d/index.mjs";
import "../../../../hj-componets/zv-hj-person-face/index.mjs";
import "../../../../hj-componets/zv-hj-resource-type-phone/index.mjs";
import "../../../../hj-componets/zv-hj-tree-list-phone/index.mjs";
import "../../../../hj-componets/zv-hj-video-page-phone/index.mjs";
import "../../../../hj-componets/zv-hj-model-resource-phone/index.mjs";
import "../../../../hj-componets/zv-hj-bottom-suspend/index.mjs";
import "../../../../hj-componets/zv-hj-pagination/index.mjs";
import "../../../../hj-componets/zv-hj-password-input-phone/index.mjs";
/* empty css                                 */
/* empty css                                        */
import { SHJDatasourceV2 as S } from "../../../../../plugins/datasource/index.mjs";
import { SHJParseEvent as a } from "../../../../../plugins/event/index.mjs";
import { useChart as k } from "../../hooks/useChart.mjs";
import { parseDataset as x } from "../../../../../commons/utils/parseDataset.mjs";
import { parseScatterData as y } from "../../../../../commons/utils/parseScatterData.mjs";
import { parseOtherData as B } from "../../../../../commons/utils/parseOtherData.mjs";
import { cloneSeries as C } from "../../../../../commons/utils/cloneSeries.mjs";
const L = { class: "zerov-widget" }, O = ["id"], Ci = /* @__PURE__ */ f({
  __name: "index",
  props: {
    option: {},
    sources: {},
    useEvents: {},
    uuid: {},
    isMultiSeries: { type: Boolean },
    customRenderData: { type: Function },
    isParseScatter: { type: Boolean },
    isParseOther: { type: Boolean }
  },
  emits: [
    "dataListener",
    "chart-click",
    "chart-dblclick",
    "chart-mousedown",
    "chart-mouseover",
    "chart-mouseout",
    "chart-contextmenu"
  ],
  setup(n, { expose: c, emit: u }) {
    const t = n, p = u, {
      id: l,
      setOption: m,
      chart: d,
      renderChart: e,
      renderData: s
    } = k({
      basicOption: i(t.option),
      useEvents: i(t.useEvents),
      customRenderData: (r) => {
        r = i(r), S.parse({
          tId: t.uuid,
          sources: t.sources,
          callback: ({ data: o }) => {
            try {
              if (p("dataListener", o), a.parseEvents(t.useEvents, "dataListener", o), t.customRenderData) {
                t.customRenderData(r, o, m);
                return;
              }
              if (t.isParseOther) {
                m(B(o, r));
                return;
              }
              t.isParseScatter ? r.dataset = y(i(o)) : r.dataset = x(i(o)), t.isMultiSeries && (r.series = C(o, r.series)), m(r);
            } catch {
              p("dataListener", null), a.parseEvents(t.useEvents, "dataListener", null), m(r);
            }
          }
        });
      },
      emits: p
    });
    return _(t, s, e), c({
      getEchartsInstance: () => d.value,
      refresh: () => {
        s(t.option), e(t.option);
      },
      refreshView: () => {
        e(t.option);
      },
      refreshData: () => {
        s(t.option);
      }
    }), (r, o) => (v(), h("div", L, [
      D("div", {
        id: E(l),
        class: "widget"
      }, null, 8, O)
    ]));
  }
});
export {
  Ci as default
};
