import { defineComponent as x, computed as A, createBlock as c, createCommentVNode as C, openBlock as t, unref as e, withCtx as o, createElementBlock as u, Fragment as v, renderList as k, createVNode as n, createTextVNode as N } from "vue";
import { useNavState as y } from "../../../hooks/useNavState.js";
import B from "../../Section/SectionContainerAccordion.vue.js";
import H from "../../Section/SectionAccordion.vue.js";
import S from "../Schema/SchemaProperty.vue.js";
import M from "../../Anchor/Anchor.vue.js";
import V from "../../Section/SectionHeaderTag.vue.js";
import j from "../Schema/SchemaHeading.vue.js";
import O from "../../Section/SectionHeader.vue.js";
const T = {
  key: 0,
  class: "properties"
}, w = { key: 1 }, J = /* @__PURE__ */ x({
  __name: "ModelsAccordion",
  props: {
    schemas: {}
  },
  setup(b) {
    const s = b, g = A(() => s.schemas ? Object.entries(s.schemas).map(([m, i]) => ({
      name: m,
      schema: i
    })) : []), { getModelId: a } = y();
    return (m, i) => s.schemas ? (t(), c(e(B), {
      key: 0,
      class: "reference-models"
    }, {
      title: o(() => [
        n(e(O), { level: 2 }, {
          default: o(() => i[0] || (i[0] = [
            N("Models")
          ])),
          _: 1
        })
      ]),
      default: o(() => [
        (t(!0), u(v, null, k(g.value, ({ name: l, schema: r }) => (t(), c(e(H), {
          id: e(a)({ name: l }),
          key: l,
          label: l
        }, {
          title: o(() => [
            n(e(M), {
              id: e(a)({ name: l }),
              class: "reference-models-anchor"
            }, {
              default: o(() => [
                n(e(V), { level: 3 }, {
                  default: o(() => [
                    n(e(j), {
                      class: "reference-models-label",
                      name: r.title ?? l,
                      value: r
                    }, null, 8, ["name", "value"])
                  ]),
                  _: 2
                }, 1024)
              ]),
              _: 2
            }, 1032, ["id"])
          ]),
          default: o(() => [
            r != null && r.properties ? (t(), u("div", T, [
              (t(!0), u(v, null, k(Object.entries(r.properties), ([d, q]) => {
                var f, p, _;
                return t(), c(e(S), {
                  key: d,
                  name: d,
                  required: ((f = r.required) == null ? void 0 : f.includes(d)) || ((_ = (p = r.properties) == null ? void 0 : p[d]) == null ? void 0 : _.required) === !0,
                  value: q
                }, null, 8, ["name", "required", "value"]);
              }), 128))
            ])) : (t(), u("div", w, [
              n(e(S), { value: r }, null, 8, ["value"])
            ]))
          ]),
          _: 2
        }, 1032, ["id", "label"]))), 128))
      ]),
      _: 1
    })) : C("", !0);
  }
});
export {
  J as default
};
