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