import { defineComponent as F, computed as p, createElementBlock as i, openBlock as t, Fragment as u, createStaticVNode as G, createElementVNode as V, renderSlot as m, createBlock as a, createCommentVNode as c, unref as r, withCtx as E, createVNode as v, normalizeClass as I, renderList as O } from "vue";
import { useWorkspace as R, useActiveEntities as D } from "@scalar/api-client/store";
import { RequestAuth as H } from "@scalar/api-client/views/Request/RequestSection/RequestAuth";
import { ScalarErrorBoundary as J } from "@scalar/components";
import { getSlugUid as K } from "@scalar/oas-utils/transforms";
import { useConfig as P } from "../../hooks/useConfig.js";
import Q from "./Lazy/Loading.vue.js";
/* empty css                  */
import T from "./Introduction/Introduction.vue.js";
import X from "../../features/BaseUrl/BaseUrl.vue.js";
import Y from "./ClientLibraries/ClientLibraries.vue.js";
import U from "./Tag/TagList.vue.js";
import Z from "../../features/Operation/Webhooks.vue.js";
import _ from "./Models/ModelsAccordion.vue.js";
import x from "./Models/Models.vue.js";
import { useSidebar as ee } from "../../hooks/useSidebar.js";
import { getModels as f } from "../../helpers/getModels.js";
import { hasModels as re } from "../../helpers/hasModels.js";
const se = { class: "narrow-references-container" }, te = {
  key: 0,
  class: "scalar-reference-intro-server scalar-client introduction-card-item divide-y text-sm [--scalar-address-bar-height:0px]"
}, ae = {
  key: 1,
  class: "scalar-reference-intro-auth scalar-client introduction-card-item"
}, we = /* @__PURE__ */ F({
  __name: "Content",
  props: {
    parsedSpec: {},
    layout: { default: "modern" }
  },
  setup($) {
    const M = $, S = P(), { hideModels: A } = ee(), { collections: B, securitySchemes: N, servers: y } = R(), {
      activeCollection: W,
      activeEnvVariables: L,
      activeEnvironment: j,
      activeWorkspace: h
    } = D(), s = p(() => {
      if (S.value.slug) {
        const e = B[K(S.value.slug)];
        if (e)
          return e;
      }
      return W.value;
    }), l = p(() => {
      if (s.value) {
        if (s.value.selectedServerUid) {
          const e = y[s.value.selectedServerUid];
          if (e)
            return e;
        }
        return y[s.value.servers[0]];
      }
    }), q = p(
      () => M.layout === "classic" ? "after" : "aside"
    );
    return (e, k) => {
      var g, b, C, w;
      return t(), i(u, null, [
        k[0] || (k[0] = G('<div class="section-flare" data-v-cdc3d662><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div><div class="section-flare-item" data-v-cdc3d662></div></div>', 1)),
        V("div", se, [
          m(e.$slots, "start", {}, void 0, !0),
          s.value ? (t(), a(r(Q), {
            key: 0,
            collection: s.value,
            layout: e.layout,
            parsedSpec: e.parsedSpec,
            server: l.value
          }, null, 8, ["collection", "layout", "parsedSpec", "server"])) : c("", !0),
          (b = (g = e.parsedSpec) == null ? void 0 : g.info) != null && b.title || (w = (C = e.parsedSpec) == null ? void 0 : C.info) != null && w.description ? (t(), a(r(T), {
            key: 1,
            info: e.parsedSpec.info,
            parsedSpec: e.parsedSpec
          }, {
            [q.value]: E(() => [
              v(r(J), null, {
                default: E(() => {
                  var n, o, d;
                  return [
                    V("div", {
                      class: I(["introduction-card", { "introduction-card-row": e.layout === "classic" }])
                    }, [
                      (o = (n = s.value) == null ? void 0 : n.servers) != null && o.length ? (t(), i("div", te, [
                        v(r(X), {
                          collection: s.value,
                          server: l.value
                        }, null, 8, ["collection", "server"])
                      ])) : c("", !0),
                      s.value && r(h) && Object.keys(r(N) ?? {}).length ? (t(), i("div", ae, [
                        v(r(H), {
                          collection: s.value,
                          envVariables: r(L),
                          environment: r(j),
                          layout: "reference",
                          selectedSecuritySchemeUids: ((d = s.value) == null ? void 0 : d.selectedSecuritySchemeUids) ?? [],
                          server: l.value,
                          title: "Authentication",
                          workspace: r(h)
                        }, null, 8, ["collection", "envVariables", "environment", "selectedSecuritySchemeUids", "server", "workspace"])
                      ])) : c("", !0),
                      v(r(Y), { class: "introduction-card-item scalar-reference-intro-clients" })
                    ], 2)
                  ];
                }),
                _: 1
              })
            ]),
            _: 2
          }, 1032, ["info", "parsedSpec"])) : m(e.$slots, "empty-state", { key: 2 }, void 0, !0),
          e.parsedSpec.tags && s.value ? (t(), i(u, { key: 3 }, [
            e.parsedSpec["x-tagGroups"] ? (t(!0), i(u, { key: 0 }, O(e.parsedSpec["x-tagGroups"], (n) => (t(), a(r(U), {
              key: n.name,
              collection: s.value,
              layout: e.layout,
              server: l.value,
              spec: e.parsedSpec,
              tags: n.tags.map((o) => {
                var d;
                return (d = e.parsedSpec.tags) == null ? void 0 : d.find((z) => z.name === o);
              }).filter((o) => !!o)
            }, null, 8, ["collection", "layout", "server", "spec", "tags"]))), 128)) : (t(), a(r(U), {
              key: 1,
              collection: s.value,
              layout: e.layout,
              schemas: r(f)(e.parsedSpec),
              server: l.value,
              spec: e.parsedSpec,
              tags: e.parsedSpec.tags
            }, null, 8, ["collection", "layout", "schemas", "server", "spec", "tags"]))
          ], 64)) : c("", !0),
          e.parsedSpec.webhooks ? (t(), a(r(Z), {
            key: 4,
            webhooks: e.parsedSpec.webhooks
          }, null, 8, ["webhooks"])) : c("", !0),
          r(re)(e.parsedSpec) && !r(A) ? (t(), i(u, { key: 5 }, [
            e.layout === "classic" ? (t(), a(r(_), {
              key: 0,
              schemas: r(f)(e.parsedSpec)
            }, null, 8, ["schemas"])) : (t(), a(r(x), {
              key: 1,
              schemas: r(f)(e.parsedSpec)
            }, null, 8, ["schemas"]))
          ], 64)) : c("", !0),
          m(e.$slots, "end", {}, void 0, !0)
        ])
      ], 64);
    };
  }
});
export {
  we as default
};
