import { defineComponent as V, openBlock as t, createElementBlock as l, normalizeClass as Z, createVNode as s, createSlots as z, withCtx as H, createTextVNode as L, toDisplayString as c, unref as f, createCommentVNode as a, createElementVNode as p, Fragment as n, renderList as i, createBlock as T, pushScopeId as M, popScopeId as $ } from "vue";
import { ScalarMarkdown as h } from "@scalar/components";
import m from "./Schema.vue.js";
import A from "./SchemaPropertyHeading.vue.js";
const G = (d) => (M("data-v-fb06e93b"), d = d(), $(), d), J = {
  key: 0,
  class: "property-description"
}, K = {
  key: 1,
  class: "property-description"
}, Q = {
  key: 2,
  class: "property-example custom-scroll"
}, W = /* @__PURE__ */ G(() => /* @__PURE__ */ p("span", { class: "property-example-label" }, "Example", -1)), X = { class: "property-example-value" }, Y = {
  key: 3,
  class: "property-enum"
}, _ = {
  key: 0,
  class: "property-list"
}, x = { class: "property-heading" }, ee = { class: "property-name" }, te = { class: "property-description" }, le = {
  key: 1,
  class: "property-enum-values"
}, oe = {
  key: 4,
  class: "children"
}, re = {
  key: 0,
  class: "children"
}, ae = {
  key: 0,
  class: "property-rule"
}, ne = {
  key: 1,
  class: "property-rule"
}, ue = /* @__PURE__ */ V({
  __name: "SchemaProperty",
  props: {
    value: {},
    level: { default: 0 },
    name: {},
    required: { type: Boolean, default: !1 },
    compact: { type: Boolean, default: !1 },
    description: {},
    additional: { type: Boolean }
  },
  setup(d) {
    const k = {
      integer: {
        _default: "Integer numbers.",
        int32: "Signed 32-bit integers (commonly used integer type).",
        int64: "Signed 64-bit integers (long type)."
      },
      string: {
        date: "full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21",
        "date-time": "the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z",
        password: "a hint to UIs to mask the input",
        byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
        binary: "binary data, used to describe files"
      }
    }, g = function(e, o) {
      return o != null && o.properties || o != null && o.additionalProperties ? null : e || (o == null ? void 0 : o.description) || null;
    }, b = function(e) {
      return !e || !k[e.type] ? null : k[e.type][e.format || "_default"];
    }, u = function(e) {
      var o;
      return (e == null ? void 0 : e.enum) || ((o = e == null ? void 0 : e.items) == null ? void 0 : o.enum) || [];
    }, U = ["oneOf", "anyOf", "allOf", "not"];
    return (e, o) => {
      var S, B, C, w, D, I, N, P, q, E, F;
      return t(), l("div", {
        class: Z(["property", [
          `property--level-${e.level}`,
          {
            "property--compact": e.compact,
            "property--deprecated": (S = e.value) == null ? void 0 : S.deprecated
          }
        ]])
      }, [
        s(A, {
          additional: e.additional,
          enum: u(e.value).length > 1,
          required: e.required,
          value: e.value
        }, z({ _: 2 }, [
          e.name ? {
            name: "name",
            fn: H(() => [
              L(c(e.name), 1)
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["additional", "enum", "required", "value"]),
        g(e.description, e.value) ? (t(), l("div", J, [
          s(f(h), {
            value: g(e.description, e.value)
          }, null, 8, ["value"])
        ])) : b(e.value) ? (t(), l("div", K, [
          s(f(h), {
            value: b(e.value) || ""
          }, null, 8, ["value"])
        ])) : a("", !0),
        (B = e.value) != null && B.example || (w = (C = e.value) == null ? void 0 : C.items) != null && w.example ? (t(), l("div", Q, [
          W,
          p("code", X, c(e.value.example || ((D = e.value) == null ? void 0 : D.items.example)), 1)
        ])) : a("", !0),
        ((I = u(e.value)) == null ? void 0 : I.length) > 1 ? (t(), l("div", Y, [
          (N = e.value) != null && N["x-enumDescriptions"] ? (t(), l("div", _, [
            (t(!0), l(n, null, i(u(e.value), (r) => (t(), l("div", {
              key: r,
              class: "property"
            }, [
              p("div", x, [
                p("div", ee, c(r), 1)
              ]),
              p("div", te, [
                s(f(h), {
                  value: e.value["x-enumDescriptions"][r]
                }, null, 8, ["value"])
              ])
            ]))), 128))
          ])) : (t(), l("ul", le, [
            (t(!0), l(n, null, i(u(e.value), (r) => (t(), l("li", {
              key: r,
              class: "property-enum-value"
            }, c(r), 1))), 128))
          ]))
        ])) : a("", !0),
        ((P = e.value) == null ? void 0 : P.type) === "object" && ((q = e.value) != null && q.properties || (E = e.value) != null && E.additionalProperties) ? (t(), l("div", oe, [
          s(m, {
            compact: e.compact,
            level: e.level + 1,
            value: e.value
          }, null, 8, ["compact", "level", "value"])
        ])) : a("", !0),
        (F = e.value) != null && F.items ? (t(), l(n, { key: 5 }, [
          ["object"].includes(e.value.items.type) ? (t(), l("div", re, [
            s(m, {
              compact: e.compact,
              level: e.level + 1,
              value: e.value.items
            }, null, 8, ["compact", "level", "value"])
          ])) : a("", !0)
        ], 64)) : a("", !0),
        (t(), l(n, null, i(U, (r) => {
          var O, j, R;
          return t(), l(n, { key: r }, [
            (O = e.value) != null && O[r] ? (t(), l("div", ae, [
              (t(!0), l(n, null, i(e.value[r], (v, y) => (t(), T(m, {
                key: y,
                compact: e.compact,
                level: e.level + 1,
                value: v
              }, null, 8, ["compact", "level", "value"]))), 128))
            ])) : a("", !0),
            (R = (j = e.value) == null ? void 0 : j.items) != null && R[r] && e.level < 3 ? (t(), l("div", ne, [
              (t(!0), l(n, null, i(e.value.items[r], (v, y) => (t(), T(m, {
                key: y,
                compact: e.compact,
                level: e.level + 1,
                value: v
              }, null, 8, ["compact", "level", "value"]))), 128))
            ])) : a("", !0)
          ], 64);
        }), 64))
      ], 2);
    };
  }
});
export {
  ue as default
};
