import { defineComponent as T, inject as q, provide as G, ref as h, computed as S, resolveComponent as o, openBlock as a, createBlock as p, withCtx as t, createVNode as e, unref as i, createElementVNode as s, normalizeStyle as C, createTextVNode as k, toDisplayString as f, createElementBlock as w, Fragment as M, renderList as z, resolveDynamicComponent as L } from "vue";
import { g as H, i as v, u as J, b as K, _ as P } from "./index-e250a75e.mjs";
const Q = { style: { "font-weight": "700" } }, U = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, W = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, X = /* @__PURE__ */ T({
  __name: "index",
  setup(Y) {
    const _ = q("globalContext"), u = H(_);
    G("appContext", u);
    const y = _.router.currentRoute.value.params.app;
    u.load(y);
    const c = h(!v().value), b = h([]);
    _.request({
      method: "GET",
      url: "deployed/menus",
      params: {
        id: y
      }
    }).then(function(l) {
      b.value = l.list;
    });
    const F = S(() => {
      let l = "", d = "";
      const r = _.router.currentRoute.value.params.page;
      if (r)
        for (const m of b.value || [])
          for (const x of m.pages || [])
            r == x._id && (l = m.name, d = x.name);
      return [l, d];
    }), B = h(), { enter: R } = J(B), V = S(() => {
      const l = u.getCode().colorBackground;
      return l ? { "background-color": l } : {};
    });
    return (l, d) => {
      const r = o("lc-icon"), m = o("el-menu-item"), x = o("el-sub-menu"), j = o("el-menu"), D = o("el-aside"), E = o("el-breadcrumb-item"), $ = o("el-breadcrumb"), A = o("el-header"), I = o("router-view"), O = o("el-main"), N = o("el-container");
      return a(), p(N, null, {
        default: t(() => [
          e(D, {
            width: c.value ? "260px" : i(v)().value ? "40px" : "60px",
            style: { height: "100vh", background: "var(--el-color-white)", "border-right": "1px solid var(--el-border-color)" }
          }, {
            default: t(() => [
              s("div", {
                style: C([{ height: "24px", "border-bottom": "1px solid var(--el-border-color)", overflow: "hidden", "white-space": "nowrap" }, "padding: 12px 0 12px " + (i(v)().value ? "8px" : "16px")])
              }, [
                e(r, {
                  size: "medium",
                  icon: i(u).getCode().icon,
                  style: { "margin-right": "16px" }
                }, null, 8, ["icon"]),
                k(" " + f(c.value ? i(u).getCode().name : ""), 1)
              ], 4),
              e(j, {
                router: !0,
                collapse: !c.value,
                style: { "margin-top": "12px" }
              }, {
                default: t(() => [
                  (a(!0), w(M, null, z(b.value, (n) => (a(), p(x, {
                    index: "/" + n._id,
                    key: n._id
                  }, {
                    title: t(() => [
                      e(r, {
                        icon: n.icon || "mdiMenu",
                        size: "small",
                        style: C([{ "margin-right": "8px" }, "margin-left:" + (i(v)().value ? "10px" : "20px")])
                      }, null, 8, ["icon", "style"]),
                      s("span", Q, f(n.name), 1)
                    ]),
                    default: t(() => [
                      (a(!0), w(M, null, z(n.pages || [], (g) => (a(), p(m, {
                        index: "/deploy/" + i(y) + "/" + g._id,
                        key: g._id
                      }, {
                        default: t(() => [
                          s("span", null, [
                            e(r, {
                              icon: g.icon || "mdiChartBoxOutline",
                              size: "small",
                              style: { "margin-right": "8px" }
                            }, null, 8, ["icon"]),
                            k(" " + f(g.name), 1)
                          ])
                        ]),
                        _: 2
                      }, 1032, ["index"]))), 128))
                    ]),
                    _: 2
                  }, 1032, ["index"]))), 128))
                ]),
                _: 1
              }, 8, ["collapse"])
            ]),
            _: 1
          }, 8, ["width"]),
          e(N, null, {
            default: t(() => [
              e(A, { style: { height: "48px", padding: "12px 0 12px 16px", "box-sizing": "border-box", "border-bottom": "1px solid var(--el-border-color)" } }, {
                default: t(() => [
                  s("div", U, [
                    s("div", W, [
                      e(r, {
                        icon: c.value ? "mdiMenuOpen" : "mdiMenuClose",
                        size: "large",
                        style: { cursor: "pointer" },
                        onClick: d[0] || (d[0] = (n) => c.value = !c.value)
                      }, null, 8, ["icon"]),
                      e($, {
                        separator: ">",
                        style: { "margin-left": "25px" }
                      }, {
                        default: t(() => [
                          (a(!0), w(M, null, z(F.value, (n) => (a(), p(E, {
                            key: n.id
                          }, {
                            default: t(() => [
                              k(f(n), 1)
                            ]),
                            _: 2
                          }, 1024))), 128))
                        ]),
                        _: 1
                      })
                    ]),
                    s("div", null, [
                      e(K, { style: { "line-height": "28px", "margin-right": "4px" } }),
                      e(r, {
                        icon: "mdi-fullscreen",
                        tooltip: l.$t("_.components.layout.fullScreen"),
                        size: "large",
                        style: { "margin-right": "32px" },
                        onClick: i(R)
                      }, null, 8, ["tooltip", "onClick"])
                    ])
                  ])
                ]),
                _: 1
              }),
              e(O, {
                ref_key: "elMainRef",
                ref: B,
                id: "lcViewMainArea",
                style: C([{ "max-height": "calc(100vh - 48px)", margin: "0px" }, V.value])
              }, {
                default: t(() => [
                  e(I, null, {
                    default: t(({ Component: n }) => [
                      (a(), p(L(n)))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["style"])
            ]),
            _: 1
          })
        ]),
        _: 1
      });
    };
  }
});
const te = /* @__PURE__ */ P(X, [["__scopeId", "data-v-9b188f7a"]]);
export {
  te as default
};
