import { defineComponent, defineAsyncComponent, ref, onMounted, watch, nextTick, resolveComponent, openBlock, createBlock, withCtx, createVNode, unref } from 'vue';
import { useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import '../../../../stores/index.mjs';
import { useThemeConfig } from '../../../../stores/themeConfig.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "transverse",
  setup(__props) {
    const LayoutHeader = defineAsyncComponent(() => import('../component/header.vue.mjs'));
    const LayoutMain = defineAsyncComponent(() => import('../component/main.vue.mjs'));
    const layoutMainRef = ref();
    const storesThemeConfig = useThemeConfig();
    const { themeConfig } = storeToRefs(storesThemeConfig);
    const route = useRoute();
    const updateScrollbar = () => {
      layoutMainRef.value.layoutMainScrollbarRef.update();
    };
    const initScrollBarHeight = () => {
      nextTick(() => {
        setTimeout(() => {
          updateScrollbar();
          layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
        }, 500);
      });
    };
    onMounted(() => {
      initScrollBarHeight();
    });
    watch(
      () => route.path,
      () => {
        initScrollBarHeight();
      }
    );
    watch(
      () => themeConfig.value.isTagsview,
      () => {
        nextTick(() => {
          updateScrollbar();
        });
      },
      {
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_el_container = resolveComponent("el-container");
      return openBlock(), createBlock(_component_el_container, { class: "layout-container flex-center layout-backtop" }, {
        default: withCtx(() => [
          createVNode(unref(LayoutHeader)),
          createVNode(
            unref(LayoutMain),
            {
              ref_key: "layoutMainRef",
              ref: layoutMainRef
            },
            null,
            512
            /* NEED_PATCH */
          )
        ]),
        _: 1
        /* STABLE */
      });
    };
  }
});

export { _sfc_main as default };
