"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const cloneDeep = require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/cloneDeep.js");
const chartEditStore = require("../../../../../store/modules/chartEditStore/chartEditStore.js");
require("../../../../../store/modules/designStore/designStore.js");
require("../../../../../settings/designSetting.js");
require("../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js");
require("../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js");
const eventEnum = require("../../../../../enums/eventEnum.js");
require("../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../../../../enums/pageEnum.js");
require("../../../../../router/index.js");
require("../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../../components/GoSkeleton/index.vue.js");
require("../../../../../components/GoLoading/index.js");
require("../../../../../api/axios.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/merge.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js");
require("../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/index.js");
require("../../../../../store/modules/langStore/langStore.js");
const useChartInteract_hook = require("../../../../../hooks/useChartInteract.hook.js");
const interact = require("./interact.js");
const runtimeCore_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    reactivity_esmBundler.toRefs(props.chartConfig.attr);
    const option = reactivity_esmBundler.shallowReactive({
      value: cloneDeep.default(props.chartConfig.option)
    });
    const onChange = (v) => {
      if (v === void 0)
        return;
      const selectItem = option.value.dataset.find((item) => item.label === v);
      useChartInteract_hook.useChartInteract(
        props.chartConfig,
        chartEditStore.useChartEditStore,
        { [interact.ComponentInteractParamsEnum.DATA]: selectItem.value },
        eventEnum.InteractEventOn.CHANGE
      );
    };
    runtimeCore_esmBundler.watch(
      () => props.chartConfig.option,
      (newData) => {
        option.value = newData;
        onChange(newData.tabValue);
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_tab = runtimeCore_esmBundler.resolveComponent("n-tab");
      const _component_n_tabs = runtimeCore_esmBundler.resolveComponent("n-tabs");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_tabs, {
        type: reactivity_esmBundler.unref(option).value.tabType,
        "onUpdate:value": onChange,
        "default-value": reactivity_esmBundler.unref(option).value.tabLabel
      }, {
        default: runtimeCore_esmBundler.withCtx(() => [
          (runtimeCore_esmBundler.openBlock(true), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, runtimeCore_esmBundler.renderList(reactivity_esmBundler.unref(option).value.dataset, (item, index) => {
            return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_tab, {
              name: item.label,
              key: index
            }, {
              default: runtimeCore_esmBundler.withCtx(() => [
                runtimeCore_esmBundler.createTextVNode(shared_esmBundler.toDisplayString(item.label), 1)
              ]),
              _: 2
            }, 1032, ["name"]);
          }), 128))
        ]),
        _: 1
      }, 8, ["type", "default-value"]);
    };
  }
});
exports.default = _sfc_main;
