'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var vueRouter = require('vue-router');
var pinia = require('pinia');
require('../../../../stores/index.js');
var themeConfig = require('../../../../stores/themeConfig.js');

const _hoisted_1 = { class: "flex-center layout-backtop" };
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "classic",
  setup(__props) {
    const LayoutAside = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/aside.vue.js'); }));
    const LayoutHeader = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/header.vue.js'); }));
    const LayoutMain = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/main.vue.js'); }));
    const LayoutTagsView = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../navBars/tagsView/tagsView.vue.js'); }));
    const layoutMainRef = vue.ref();
    const route = vueRouter.useRoute();
    const storesThemeConfig = themeConfig.useThemeConfig();
    const { themeConfig: themeConfig$1 } = pinia.storeToRefs(storesThemeConfig);
    const isTagsview = vue.computed(() => {
      return themeConfig$1.value.isTagsview;
    });
    const updateScrollbar = () => {
      var _a;
      (_a = layoutMainRef.value) == null ? void 0 : _a.layoutMainScrollbarRef.update();
    };
    const initScrollBarHeight = () => {
      vue.nextTick(() => {
        setTimeout(() => {
          updateScrollbar();
          if (layoutMainRef.value) layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
        }, 500);
      });
    };
    vue.onMounted(() => {
      initScrollBarHeight();
    });
    vue.watch(
      () => route.path,
      () => {
        initScrollBarHeight();
      }
    );
    vue.watch(
      () => themeConfig$1.value.isTagsview,
      () => {
        vue.nextTick(() => {
          updateScrollbar();
        });
      },
      {
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_el_container = vue.resolveComponent("el-container");
      return vue.openBlock(), vue.createBlock(_component_el_container, { class: "layout-container flex-center" }, {
        default: vue.withCtx(() => [
          vue.createVNode(vue.unref(LayoutHeader)),
          vue.createVNode(_component_el_container, { class: "layout-mian-height-50" }, {
            default: vue.withCtx(() => [
              vue.createVNode(vue.unref(LayoutAside)),
              vue.createElementVNode("div", _hoisted_1, [
                isTagsview.value ? (vue.openBlock(), vue.createBlock(vue.unref(LayoutTagsView), { key: 0 })) : vue.createCommentVNode("v-if", true),
                vue.createVNode(
                  vue.unref(LayoutMain),
                  {
                    ref_key: "layoutMainRef",
                    ref: layoutMainRef
                  },
                  null,
                  512
                  /* NEED_PATCH */
                )
              ])
            ]),
            _: 1
            /* STABLE */
          })
        ]),
        _: 1
        /* STABLE */
      });
    };
  }
});

exports.default = _sfc_main;
