import { defineComponent as S, openBlock as u, createElementBlock as i, renderSlot as w, createCommentVNode as r, Fragment as m, createTextVNode as a, toDisplayString as t, createVNode as p, unref as L, withCtx as l, createBlock as o, createSlots as M, renderList as P } from "vue";
import n from "./SchemaPropertyDetail.vue.js";
import N from "../../Badge/Badge.vue.js";
const C = { class: "property-heading" }, V = {
  key: 0,
  class: "property-name"
}, $ = {
  key: 1,
  class: "property-additional"
}, b = {
  key: 2,
  class: "property-deprecated"
}, A = {
  key: 3,
  class: "property-required"
}, D = {
  key: 4,
  class: "property-const"
}, j = {
  key: 5,
  class: "property-details"
}, E = {
  key: 6,
  class: "property-write-only"
}, F = {
  key: 7,
  class: "property-read-only"
}, K = /* @__PURE__ */ S({
  __name: "SchemaPropertyHeading",
  props: {
    value: {},
    enum: { type: Boolean },
    required: { type: Boolean, default: !1 },
    additional: { type: Boolean }
  },
  setup(H) {
    const O = ["oneOf", "anyOf", "allOf", "not"];
    return (e, T) => {
      var y, f, k, h, g, B, q;
      return u(), i("div", C, [
        e.$slots.name ? (u(), i("div", V, [
          w(e.$slots, "name", {}, void 0, !0)
        ])) : r("", !0),
        e.additional ? (u(), i("div", $, [
          (y = e.value) != null && y["x-additionalPropertiesName"] ? (u(), i(m, { key: 0 }, [
            a(t(e.value["x-additionalPropertiesName"]), 1)
          ], 64)) : (u(), i(m, { key: 1 }, [
            a(" additional properties ")
          ], 64))
        ])) : r("", !0),
        (f = e.value) != null && f.deprecated ? (u(), i("div", b, [
          p(L(N), null, {
            default: l(() => [
              a("deprecated")
            ]),
            _: 1
          })
        ])) : r("", !0),
        e.required ? (u(), i("div", A, " required ")) : r("", !0),
        (k = e.value) != null && k.const || (h = e.value) != null && h.enum && e.value.enum.length === 1 ? (u(), i("div", D, [
          p(n, { truncate: "" }, {
            prefix: l(() => [
              a("const:")
            ]),
            default: l(() => [
              a(" " + t(e.value.const ?? e.value.enum[0]), 1)
            ]),
            _: 1
          })
        ])) : (g = e.value) != null && g.type ? (u(), i("div", j, [
          e.additional ? (u(), o(n, { key: 0 }, {
            prefix: l(() => [
              a("key:")
            ]),
            default: l(() => [
              a(" string ")
            ]),
            _: 1
          })) : r("", !0),
          p(n, null, M({
            default: l(() => {
              var d, s, v;
              return [
                (s = (d = e.value) == null ? void 0 : d.items) != null && s.type ? (u(), i(m, { key: 0 }, [
                  a(t(e.value.type) + " " + t(e.value.items.type) + "[] ", 1)
                ], 64)) : (u(), i(m, { key: 1 }, [
                  a(t(Array.isArray(e.value.type) ? e.value.type.join(" | ") : e.value.type) + " " + t((v = e.value) != null && v.nullable ? " | nullable" : ""), 1)
                ], 64)),
                e.value.minItems || e.value.maxItems ? (u(), i(m, { key: 2 }, [
                  a(t(e.value.minItems) + "…" + t(e.value.maxItems), 1)
                ], 64)) : r("", !0)
              ];
            }),
            _: 2
          }, [
            e.additional ? {
              name: "prefix",
              fn: l(() => [
                a("value:")
              ]),
              key: "0"
            } : void 0
          ]), 1024),
          e.value.minLength ? (u(), o(n, { key: 1 }, {
            prefix: l(() => [
              a("min:")
            ]),
            default: l(() => [
              a(" " + t(e.value.minLength), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.maxLength ? (u(), o(n, { key: 2 }, {
            prefix: l(() => [
              a("max:")
            ]),
            default: l(() => [
              a(" " + t(e.value.maxLength), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.uniqueItems ? (u(), o(n, { key: 3 }, {
            default: l(() => [
              a(" unique! ")
            ]),
            _: 1
          })) : r("", !0),
          e.value.format ? (u(), o(n, { key: 4 }, {
            default: l(() => [
              a(t(e.value.format), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (u(), o(n, { key: 5 }, {
            prefix: l(() => [
              a("greater than:")
            ]),
            default: l(() => [
              a(" " + t(e.value.minimum), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (u(), o(n, { key: 6 }, {
            prefix: l(() => [
              a("min:")
            ]),
            default: l(() => [
              a(" " + t(e.value.minimum), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (u(), o(n, { key: 7 }, {
            prefix: l(() => [
              a("less than:")
            ]),
            default: l(() => [
              a(" " + t(e.value.maximum), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (u(), o(n, { key: 8 }, {
            prefix: l(() => [
              a("max:")
            ]),
            default: l(() => [
              a(" " + t(e.value.maximum), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.value.pattern ? (u(), o(n, {
            key: 9,
            code: "",
            truncate: ""
          }, {
            default: l(() => [
              a(t(e.value.pattern), 1)
            ]),
            _: 1
          })) : r("", !0),
          e.$props.enum ? (u(), o(n, { key: 10 }, {
            default: l(() => [
              a("enum")
            ]),
            _: 1
          })) : r("", !0),
          e.value.default ? (u(), o(n, {
            key: 11,
            truncate: ""
          }, {
            prefix: l(() => [
              a("default:")
            ]),
            default: l(() => [
              a(" " + t(e.value.default), 1)
            ]),
            _: 1
          })) : r("", !0)
        ])) : r("", !0),
        (B = e.value) != null && B.writeOnly ? (u(), i("div", E, " write-only ")) : (q = e.value) != null && q.readOnly ? (u(), i("div", F, " read-only ")) : r("", !0),
        (u(!0), i(m, null, P(O.filter((d) => {
          var s, v, I;
          return ((s = e.value) == null ? void 0 : s[d]) || ((I = (v = e.value) == null ? void 0 : v.items) == null ? void 0 : I[d]);
        }), (d) => (u(), o(L(N), { key: d }, {
          default: l(() => [
            a(t(d), 1)
          ]),
          _: 2
        }, 1024))), 128))
      ]);
    };
  }
});
export {
  K as default
};
