import "../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import "../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import { renderIcon } from "../../../../utils/utils.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 "../../../../store/modules/designStore/designStore.mjs";
import "../../../../settings/designSetting.mjs";
import "../../../../components/GoLoading/index.mjs";
import "../../../../components/GoSkeleton/index.vue.mjs";
import { icon } from "../../../../plugins/icon.mjs";
import { getCharts, themeColor, setItem } from "./useLayout.hook.mjs";
import { PackagesCategoryEnum, PackagesCategoryName } from "../../../../packages/index.d.mjs";
import { usePackagesStore } from "../../../../store/modules/packagesStore/packagesStore.mjs";
import { ChartLayoutStoreEnum } from "../../../../store/modules/chartLayoutStore/chartLayoutStore.d.mjs";
import { ref } from "../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const { AirPlaneOutlineIcon, ImageIcon, BarChartIcon } = icon.ionicons5;
const { TableSplitIcon, RoadmapIcon, SpellCheckIcon, GraphicalDataFlowIcon } = icon.carbon;
const packagesListObj = {
  [PackagesCategoryEnum.CHARTS]: {
    icon: renderIcon(RoadmapIcon),
    label: PackagesCategoryName.CHARTS
  },
  [PackagesCategoryEnum.INFORMATIONS]: {
    icon: renderIcon(SpellCheckIcon),
    label: PackagesCategoryName.INFORMATIONS
  },
  [PackagesCategoryEnum.TABLES]: {
    icon: renderIcon(TableSplitIcon),
    label: PackagesCategoryName.TABLES
  },
  [PackagesCategoryEnum.DECORATES]: {
    icon: renderIcon(GraphicalDataFlowIcon),
    label: PackagesCategoryName.DECORATES
  },
  [PackagesCategoryEnum.PHOTOS]: {
    icon: renderIcon(ImageIcon),
    label: PackagesCategoryName.PHOTOS
  },
  [PackagesCategoryEnum.ICONS]: {
    icon: renderIcon(AirPlaneOutlineIcon),
    label: PackagesCategoryName.ICONS
  }
};
const useAsideHook = () => {
  const packagesStore = usePackagesStore();
  const menuOptions = [];
  const handlePackagesList = () => {
    for (const val in packagesStore.getPackagesList) {
      menuOptions.push({
        key: val,
        // @ts-ignore
        icon: packagesListObj[val].icon,
        // @ts-ignore
        label: packagesListObj[val].label,
        // @ts-ignore
        list: packagesStore.getPackagesList[val]
      });
    }
  };
  handlePackagesList();
  let beforeSelect = menuOptions[0]["key"];
  const selectValue = ref(menuOptions[0]["key"]);
  const selectOptions = ref(menuOptions[0]);
  const clickItemHandle = (key, item) => {
    selectOptions.value = item;
    if (beforeSelect === key) {
      setItem(ChartLayoutStoreEnum.CHARTS, !getCharts.value, false);
    } else {
      setItem(ChartLayoutStoreEnum.CHARTS, true, false);
    }
    beforeSelect = key;
  };
  return {
    getCharts,
    BarChartIcon,
    themeColor,
    selectOptions,
    selectValue,
    clickItemHandle,
    menuOptions
  };
};
export {
  useAsideHook
};
