import "../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import cloneDeep from "../../../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/cloneDeep.mjs";
import { useChartEditStore } from "../../../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import { EditCanvasConfigEnum } from "../../../../../../../store/modules/chartEditStore/chartEditStore.d.mjs";
import { useDesignStore } from "../../../../../../../store/modules/designStore/designStore.mjs";
import "../../../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import "../../../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import "../../../../../../../enums/pageEnum.mjs";
import "../../../../../../../router/index.mjs";
import { colorCustomMerge } from "../../../../../../../utils/style.mjs";
import "../../../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../../../../../components/GoSkeleton/index.vue.mjs";
import "../../../../../../../components/GoLoading/index.mjs";
import { icon } from "../../../../../../../plugins/icon.mjs";
import "../../../../../../../settings/designSetting.mjs";
import { loadAsyncComponent } from "../../../../../../../utils/components.mjs";
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode as createBaseVNode, createTextVNode, pushScopeId, popScopeId } from "../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { useCssVars } from "../../../../../../../../node_modules/.pnpm/@vue_runtime-dom@3.3.4/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.mjs";
import { ref, unref } from "../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString, normalizeStyle, normalizeClass } from "../../../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _withScopeId = (n) => (pushScopeId("data-v-4ce90fea"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "go-chart-theme-color" };
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("span", null, "自定义颜色", -1));
const _hoisted_3 = { class: "go-flex-items-center" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    useCssVars((_ctx) => ({
      "d133daf6": themeColor.value
    }));
    const CreateColor = loadAsyncComponent(() => import("../CreateColor/index.vue.mjs"));
    const { SquareIcon, AddIcon } = icon.ionicons5;
    const chartEditStore = useChartEditStore();
    const designStore = useDesignStore();
    const createColorModelShow = ref(false);
    const comChartColors = computed(() => {
      return colorCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo);
    });
    const themeColor = computed(() => {
      return designStore.getAppTheme;
    });
    const selectName = computed(() => {
      return chartEditStore.getEditCanvasConfig.chartThemeColor;
    });
    const createColorHandle = () => {
      createColorModelShow.value = true;
    };
    const colorBackgroundImage = (item) => {
      return `linear-gradient(to right, ${item.color[0]} 0%, ${item.color[5]} 100%)`;
    };
    const fetchShowColors = (colors) => {
      return cloneDeep(colors).splice(0, 6);
    };
    const selectTheme = (theme) => {
      chartEditStore.setEditCanvasConfig(EditCanvasConfigEnum.CHART_THEME_COLOR, theme);
    };
    return (_ctx, _cache) => {
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_text = resolveComponent("n-text");
      const _component_n_card = resolveComponent("n-card");
      const _component_n_ellipsis = resolveComponent("n-ellipsis");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_n_card, {
          class: "card-box",
          size: "small",
          hoverable: "",
          embedded: "",
          onClick: createColorHandle
        }, {
          default: withCtx(() => [
            createVNode(_component_n_text, { class: "go-flex-items-center" }, {
              default: withCtx(() => [
                _hoisted_2,
                createVNode(_component_n_icon, { size: "16" }, {
                  default: withCtx(() => [
                    createVNode(unref(AddIcon))
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        (openBlock(true), createElementBlock(Fragment, null, renderList(comChartColors.value, (value, key) => {
          return openBlock(), createBlock(_component_n_card, {
            key,
            class: normalizeClass(["card-box", { selected: key === selectName.value }]),
            size: "small",
            hoverable: "",
            embedded: "",
            onClick: ($event) => selectTheme(key)
          }, {
            default: withCtx(() => [
              createBaseVNode("div", _hoisted_3, [
                createVNode(_component_n_ellipsis, { style: { "text-align": "left", "width": "60px" } }, {
                  default: withCtx(() => [
                    createTextVNode(toDisplayString(value.name), 1)
                  ]),
                  _: 2
                }, 1024),
                (openBlock(true), createElementBlock(Fragment, null, renderList(fetchShowColors(value.color), (colorItem) => {
                  return openBlock(), createElementBlock("span", {
                    class: "theme-color-item",
                    key: colorItem,
                    style: normalizeStyle({ backgroundColor: colorItem })
                  }, null, 4);
                }), 128))
              ]),
              createBaseVNode("div", {
                class: "theme-bottom",
                style: normalizeStyle({ backgroundImage: colorBackgroundImage(value) })
              }, null, 4)
            ]),
            _: 2
          }, 1032, ["class", "onClick"]);
        }), 128)),
        createVNode(unref(CreateColor), {
          modelShow: createColorModelShow.value,
          "onUpdate:modelShow": _cache[0] || (_cache[0] = ($event) => createColorModelShow.value = $event)
        }, null, 8, ["modelShow"])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
