import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import _sfc_main$1 from "../ProjectLayoutCreate/index.vue.mjs";
import ProjectLayoutAsideFooter from "../ProjectLayoutAsideFooter/index.vue.mjs";
import { asideWidth } from "../../../../../settings/designSetting.mjs";
import { useRoute } from "../../../../../../node_modules/.pnpm/vue-router@4.0.12_vue@3.3.4/node_modules/vue-router/dist/vue-router.esm-bundler.mjs";
import { useSettingStore } from "../../../../../store/modules/settingStore/settingStore.mjs";
import { menuOptionsInit, expandedKeys } from "./menu.mjs";
import { defineComponent, computed, onMounted, onUnmounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode as createBaseVNode, createVNode } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { ref, toRefs, unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _hoisted_1 = { class: "go-project-sider-flex" };
const _hoisted_2 = { class: "sider-bottom" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    const collapsed = ref(false);
    const { getAsideCollapsedWidth } = toRefs(useSettingStore());
    const route = useRoute();
    const menuValue = computed(() => route.name);
    const menuOptions = menuOptionsInit();
    const defaultExpandedKeys = expandedKeys();
    const watchWidth = () => {
      const Width = document.body.clientWidth;
      if (Width <= 950) {
        collapsed.value = true;
      } else
        collapsed.value = false;
    };
    onMounted(() => {
      window.addEventListener("resize", watchWidth);
    });
    onUnmounted(() => {
      window.removeEventListener("resize", watchWidth);
    });
    return (_ctx, _cache) => {
      const _component_n_space = resolveComponent("n-space");
      const _component_n_menu = resolveComponent("n-menu");
      const _component_n_layout_sider = resolveComponent("n-layout-sider");
      return openBlock(), createBlock(_component_n_layout_sider, {
        class: "go-project-sider",
        bordered: "",
        "collapse-mode": "width",
        "show-trigger": "bar",
        collapsed: collapsed.value,
        "native-scrollbar": false,
        "collapsed-width": unref(getAsideCollapsedWidth),
        width: unref(asideWidth),
        onCollapse: _cache[0] || (_cache[0] = ($event) => collapsed.value = true),
        onExpand: _cache[1] || (_cache[1] = ($event) => collapsed.value = false)
      }, {
        default: withCtx(() => [
          createBaseVNode("div", _hoisted_1, [
            createBaseVNode("aside", null, [
              createVNode(_component_n_space, {
                vertical: "",
                class: "go-project-sider-top"
              }, {
                default: withCtx(() => [
                  createVNode(unref(_sfc_main$1), { collapsed: collapsed.value }, null, 8, ["collapsed"])
                ]),
                _: 1
              }),
              createVNode(_component_n_menu, {
                value: menuValue.value,
                options: unref(menuOptions),
                "collapsed-width": unref(getAsideCollapsedWidth),
                "collapsed-icon-size": 22,
                "default-expanded-keys": unref(defaultExpandedKeys)
              }, null, 8, ["value", "options", "collapsed-width", "default-expanded-keys"])
            ]),
            createBaseVNode("div", _hoisted_2, [
              createVNode(unref(ProjectLayoutAsideFooter), { collapsed: collapsed.value }, null, 8, ["collapsed"])
            ])
          ])
        ]),
        _: 1
      }, 8, ["collapsed", "collapsed-width", "width"]);
    };
  }
});
export {
  _sfc_main as default
};
