import { defineComponent as $, inject as D, computed as T, onMounted as _, createBlock as u, openBlock as l, unref as e, withCtx as t, createVNode as n, renderSlot as k, createElementVNode as y, createCommentVNode as m, createTextVNode as a, toDisplayString as f } from "vue";
import B from "../../../features/download-link/DownloadLink.vue.js";
import { useConfig as E } from "../../../hooks/useConfig.js";
import { useNavState as A } from "../../../hooks/useNavState.js";
import H from "./Description.vue.js";
import { OPENAPI_VERSION_SYMBOL as U } from "../../../features/download-link/openapi-version-symbol.js";
import w from "../../Section/SectionContainer.vue.js";
import M from "../../Section/Section.vue.js";
import { DEFAULT_INTRODUCTION_SLUG as P } from "../../../features/traverse-schema/helpers/traverse-description.js";
import R from "../../Section/SectionContent.vue.js";
import I from "../../Badge/Badge.vue.js";
import b from "../../Section/SectionHeader.vue.js";
import j from "../../Section/SectionHeaderTag.vue.js";
import F from "../../Section/SectionColumns.vue.js";
import L from "../../Section/SectionColumn.vue.js";
import O from "../../../features/specification-extension/SpecificationExtension.vue.js";
const G = { class: "flex gap-1" }, Y = { class: "sticky-cards" }, lo = /* @__PURE__ */ $({
  __name: "Introduction",
  props: {
    document: {}
  },
  setup(i) {
    const { getHeadingId: V } = A(), c = D(U), s = T(() => {
      var o, r;
      return typeof ((o = i.document.info) == null ? void 0 : o.version) == "string" ? i.document.info.version.toString().match(/^\d/) ? `v${i.document.info.version}` : i.document.info.version : typeof ((r = i.document.info) == null ? void 0 : r.version) == "number" ? `v${i.document.info.version}` : void 0;
    }), v = E();
    return _(() => {
      var o, r;
      return (r = (o = v.value).onLoaded) == null ? void 0 : r.call(o);
    }), (o, r) => (l(), u(e(w), null, {
      default: t(() => [
        n(e(M), {
          class: "introduction-section gap-12",
          id: e(V)({
            slug: e(P),
            depth: 1,
            value: "Introduction"
          })
        }, {
          default: t(() => {
            var p, g, S, C;
            return [
              n(e(R), {
                loading: e(v).isLoading ?? (!((g = (p = o.document) == null ? void 0 : p.info) != null && g.description) && !((C = (S = o.document) == null ? void 0 : S.info) != null && C.title))
              }, {
                default: t(() => {
                  var N;
                  return [
                    y("div", G, [
                      s.value ? (l(), u(e(I), { key: 0 }, {
                        default: t(() => [
                          a(f(s.value), 1)
                        ]),
                        _: 1
                      })) : m("", !0),
                      e(c) ? (l(), u(e(I), { key: 1 }, {
                        default: t(() => [
                          a("OAS " + f(e(c)), 1)
                        ]),
                        _: 1
                      })) : m("", !0)
                    ]),
                    n(e(b), {
                      loading: !((N = o.document.info) != null && N.title),
                      tight: ""
                    }, {
                      default: t(() => [
                        n(e(j), { level: 1 }, {
                          default: t(() => {
                            var d;
                            return [
                              a(f((d = o.document.info) == null ? void 0 : d.title), 1)
                            ];
                          }),
                          _: 1
                        })
                      ]),
                      _: 1
                    }, 8, ["loading"]),
                    n(e(F), null, {
                      default: t(() => [
                        n(e(L), null, {
                          default: t(() => {
                            var d, h;
                            return [
                              n(B, {
                                title: (d = o.document.info) == null ? void 0 : d.title
                              }, null, 8, ["title"]),
                              n(H, {
                                value: (h = o.document.info) == null ? void 0 : h.description
                              }, null, 8, ["value"])
                            ];
                          }),
                          _: 1
                        }),
                        o.$slots.aside ? (l(), u(e(L), { key: 0 }, {
                          default: t(() => [
                            y("div", Y, [
                              k(o.$slots, "aside", {}, void 0, !0)
                            ])
                          ]),
                          _: 3
                        })) : m("", !0)
                      ]),
                      _: 3
                    }),
                    n(e(O), { value: o.document }, null, 8, ["value"]),
                    n(e(O), {
                      value: o.document.info
                    }, null, 8, ["value"])
                  ];
                }),
                _: 3
              }, 8, ["loading"]),
              k(o.$slots, "after", {}, void 0, !0)
            ];
          }),
          _: 3
        }, 8, ["id"])
      ]),
      _: 3
    }));
  }
});
export {
  lo as default
};
