import { defineComponent as z, computed as m, createElementBlock as p, openBlock as a, Fragment as y, renderList as f, createBlock as r, unref as o, withCtx as c, resolveDynamicComponent as S, createVNode as h } from "vue";
import { ScalarErrorBoundary as B } from "@scalar/components";
import { useNavState as I } from "../../../hooks/useNavState.js";
import T from "./TagAccordion.vue.js";
import W from "./TagSection.vue.js";
import { useSidebar as C } from "../../../features/sidebar/hooks/useSidebar.js";
import v from "../Lazy/Lazy.vue2.js";
import E from "../../../features/Operation/Operation.vue.js";
const G = /* @__PURE__ */ z({
  __name: "TagList",
  props: {
    id: {},
    document: {},
    collection: {},
    tags: {},
    spec: {},
    layout: {},
    server: {}
  },
  setup(s) {
    const { getTagId: l, hash: k } = I(), { collapsedSidebarItems: n } = C(), L = m(
      () => s.layout === "classic" ? T : W
    ), b = m(
      () => s.tags.findIndex((e) => !n[l(e)]) + 1
    ), u = (e) => s.layout !== "classic" && !k.value.startsWith("model") && e > b.value;
    return (e, N) => (a(!0), p(y, null, f(e.tags, (t, d) => (a(), r(o(v), {
      id: e.id || o(l)(t),
      key: e.id || o(l)(t),
      isLazy: u(d)
    }, {
      default: c(() => [
        (a(), r(S(L.value), {
          id: e.id || o(l)(t),
          collection: e.collection,
          spec: e.spec,
          tag: t
        }, {
          default: c(() => [
            (a(!0), p(y, null, f(t.operations, (i, g) => (a(), r(o(v), {
              id: i.id,
              key: i.id,
              isLazy: u(d) || o(n)[o(l)(t)] && g > 0
            }, {
              default: c(() => [
                h(o(B), null, {
                  default: c(() => [
                    h(o(E), {
                      path: i.path,
                      method: i.httpVerb,
                      isWebhook: i.isWebhook,
                      id: i.id,
                      document: e.document,
                      collection: e.collection,
                      layout: e.layout,
                      server: e.server
                    }, null, 8, ["path", "method", "isWebhook", "id", "document", "collection", "layout", "server"])
                  ]),
                  _: 2
                }, 1024)
              ]),
              _: 2
            }, 1032, ["id", "isLazy"]))), 128))
          ]),
          _: 2
        }, 1032, ["id", "collection", "spec", "tag"]))
      ]),
      _: 2
    }, 1032, ["id", "isLazy"]))), 128));
  }
});
export {
  G as default
};
