import { g as F, a as G, r as q, m as V, d as U, b as B, S as X } from "../oneof-branch-detection-BED_n2MT.js";
import { Fragment as z, html as l, attr as r, Empty as E, Value as d, MapSignal as _ } from "@tempots/dom";
import { r as R } from "../utils-DEbsp9Q9.js";
function H(e) {
  return e === null ? "null" : Array.isArray(e) ? "array" : typeof e == "object" ? "object" : typeof e == "string" ? "string" : typeof e == "number" ? Number.isInteger(e) ? "integer" : "number" : typeof e == "boolean" ? "boolean" : "unknown";
}
function Q(e, t) {
  return e === t || t === "number" && e === "integer";
}
function S(e, t, i = []) {
  if (typeof t == "boolean")
    return t === !1 ? [
      {
        kind: "type-mismatch",
        path: i,
        message: "Schema disallows any value",
        actual: String(e)
      }
    ] : [];
  const a = [], n = t;
  if (n.type != null && e !== void 0) {
    const s = Array.isArray(n.type) ? n.type : [n.type], o = H(e);
    if (o !== "unknown" && !s.some((p) => Q(o, p)))
      return a.push({
        kind: "type-mismatch",
        path: i,
        message: `Expected ${s.join(" | ")}, got ${o}`,
        expected: s.join(" | "),
        actual: o
      }), a;
  }
  if (n.enum != null && e !== void 0 && (n.enum.some(
    (o) => JSON.stringify(o) === JSON.stringify(e)
  ) || a.push({
    kind: "enum-mismatch",
    path: i,
    message: `Value not in enum: ${JSON.stringify(n.enum)}`,
    expected: n.enum.map(String).join(", "),
    actual: String(e)
  })), n.const !== void 0 && e !== void 0 && JSON.stringify(n.const) !== JSON.stringify(e) && a.push({
    kind: "const-mismatch",
    path: i,
    message: `Expected const ${JSON.stringify(n.const)}, got ${JSON.stringify(e)}`,
    expected: JSON.stringify(n.const),
    actual: JSON.stringify(e)
  }), typeof e == "string" && (n.minLength != null && e.length < n.minLength && a.push({
    kind: "constraint-violation",
    path: i,
    message: `String length ${e.length} < minLength ${n.minLength}`,
    expected: `>= ${n.minLength} chars`,
    actual: `${e.length} chars`
  }), n.maxLength != null && e.length > n.maxLength && a.push({
    kind: "constraint-violation",
    path: i,
    message: `String length ${e.length} > maxLength ${n.maxLength}`,
    expected: `<= ${n.maxLength} chars`,
    actual: `${e.length} chars`
  }), n.pattern != null))
    try {
      new RegExp(n.pattern).test(e) || a.push({
        kind: "constraint-violation",
        path: i,
        message: `String does not match pattern /${n.pattern}/`,
        expected: `/${n.pattern}/`,
        actual: e
      });
    } catch {
    }
  if (typeof e == "number" && (n.minimum != null && e < n.minimum && a.push({
    kind: "constraint-violation",
    path: i,
    message: `Value ${e} < minimum ${n.minimum}`,
    expected: `>= ${n.minimum}`,
    actual: String(e)
  }), n.maximum != null && e > n.maximum && a.push({
    kind: "constraint-violation",
    path: i,
    message: `Value ${e} > maximum ${n.maximum}`,
    expected: `<= ${n.maximum}`,
    actual: String(e)
  }), n.exclusiveMinimum != null && e <= n.exclusiveMinimum && a.push({
    kind: "constraint-violation",
    path: i,
    message: `Value ${e} <= exclusiveMinimum ${n.exclusiveMinimum}`,
    expected: `> ${n.exclusiveMinimum}`,
    actual: String(e)
  }), n.exclusiveMaximum != null && e >= n.exclusiveMaximum && a.push({
    kind: "constraint-violation",
    path: i,
    message: `Value ${e} >= exclusiveMaximum ${n.exclusiveMaximum}`,
    expected: `< ${n.exclusiveMaximum}`,
    actual: String(e)
  }), n.multipleOf != null && e % n.multipleOf !== 0 && a.push({
    kind: "constraint-violation",
    path: i,
    message: `Value ${e} is not a multiple of ${n.multipleOf}`,
    expected: `multiple of ${n.multipleOf}`,
    actual: String(e)
  })), typeof e == "object" && e !== null && !Array.isArray(e)) {
    const s = e, o = Object.keys(s);
    if (n.required != null)
      for (const p of n.required)
        p in s || a.push({
          kind: "missing-required",
          path: [...i, p],
          message: `Missing required property "${p}"`,
          expected: p
        });
    if (n.additionalProperties === !1 && n.properties != null) {
      const p = new Set(Object.keys(n.properties));
      if (n.patternProperties != null) {
        const c = Object.keys(n.patternProperties).map(
          (m) => new RegExp(m)
        );
        for (const m of o)
          !p.has(m) && !c.some((u) => u.test(m)) && a.push({
            kind: "extra-property",
            path: [...i, m],
            message: `Extra property "${m}" not allowed`,
            actual: m
          });
      } else
        for (const c of o)
          p.has(c) || a.push({
            kind: "extra-property",
            path: [...i, c],
            message: `Extra property "${c}" not allowed`,
            actual: c
          });
    }
    if (n.properties != null)
      for (const [p, c] of Object.entries(n.properties))
        p in s && a.push(
          ...S(s[p], c, [...i, p])
        );
  }
  if (Array.isArray(e)) {
    if (n.minItems != null && e.length < n.minItems && a.push({
      kind: "constraint-violation",
      path: i,
      message: `Array length ${e.length} < minItems ${n.minItems}`,
      expected: `>= ${n.minItems} items`,
      actual: `${e.length} items`
    }), n.maxItems != null && e.length > n.maxItems && a.push({
      kind: "constraint-violation",
      path: i,
      message: `Array length ${e.length} > maxItems ${n.maxItems}`,
      expected: `<= ${n.maxItems} items`,
      actual: `${e.length} items`
    }), n.prefixItems != null) {
      for (let s = 0; s < e.length && s < n.prefixItems.length; s++)
        a.push(
          ...S(e[s], n.prefixItems[s], [...i, s])
        );
      if (n.items != null && !Array.isArray(n.items))
        for (let s = n.prefixItems.length; s < e.length; s++)
          a.push(
            ...S(e[s], n.items, [...i, s])
          );
    } else if (Array.isArray(n.items)) {
      for (let s = 0; s < e.length && s < n.items.length; s++)
        a.push(
          ...S(e[s], n.items[s], [...i, s])
        );
      if (n.additionalItems != null)
        for (let s = n.items.length; s < e.length; s++)
          a.push(
            ...S(e[s], n.additionalItems, [...i, s])
          );
    } else if (n.items != null)
      for (let s = 0; s < e.length; s++)
        a.push(
          ...S(e[s], n.items, [...i, s])
        );
  }
  return a;
}
class Y {
  widgets = [];
  register(t) {
    this.widgets.push(t), this.widgets.sort((i, a) => (a.priority ?? 50) - (i.priority ?? 50));
  }
  /**
   * Find the best display widget for a schema context.
   * Returns the factory if found, undefined otherwise.
   */
  findBestWidget(t) {
    const i = R(t.definition, t.name);
    if (i?.widget) {
      const a = this.widgets.find(
        (n) => n.displayName === i.widget && n.matcher(t)
      );
      if (a)
        return { factory: a.factory, resolved: i };
    }
    for (const a of this.widgets)
      try {
        if (a.matcher(t))
          return { factory: a.factory, resolved: i };
      } catch (n) {
        console.warn(
          `Error in display widget matcher "${a.displayName ?? "unknown"}":`,
          n
        );
      }
  }
}
function de(e, t, i) {
  return {
    factory: t,
    matcher: (a) => {
      const s = a.definition["x:ui"];
      return s === e || typeof s == "object" && s !== null && s.widget === e;
    },
    displayName: i?.displayName ?? e,
    priority: i?.priority ?? 100,
    ...i
  };
}
function he(e, t, i) {
  return {
    factory: t,
    matcher: (a) => a.definition.format === e,
    displayName: i?.displayName ?? `${e} display`,
    priority: i?.priority ?? 75,
    ...i
  };
}
function ye(e, t, i, a) {
  return {
    factory: i,
    matcher: (n) => {
      const s = n.definition;
      return s.type === e && s.format === t;
    },
    displayName: a?.displayName ?? `${e}:${t} display`,
    priority: a?.priority ?? 80,
    ...a
  };
}
function Z(e) {
  return e.length === 0 ? E : l.div(
    r.class("bc-json-schema-display__mismatches"),
    ...e.map(
      (t) => l.span(
        r.class(
          `bc-json-schema-display__mismatch bc-json-schema-display__mismatch--${t.kind}`
        ),
        r.title(
          t.expected ? `Expected: ${t.expected}${t.actual ? `, got: ${t.actual}` : ""}` : t.message
        ),
        t.message
      )
    )
  );
}
function g({
  ctx: e,
  mismatches: t,
  children: i
}) {
  const a = e.widgetLabel, n = e.isPropertyRequired, s = e.isDeprecated, o = e.description;
  if (e.isRoot && !t?.length)
    return z(i);
  const p = t ? t.filter((c) => {
    const m = c.path.map(String).join("."), u = e.path.map(String).join(".");
    return m === u;
  }) : [];
  return l.div(
    r.class("bc-json-schema-display__field"),
    // Label row
    a || n || s ? l.div(
      r.class("bc-json-schema-display__label-row"),
      a ? l.span(r.class("bc-json-schema-display__label"), a) : null,
      n ? l.span(r.class("bc-json-schema-display__required"), "*") : null,
      s ? l.span(
        r.class("bc-json-schema-display__deprecated"),
        "deprecated"
      ) : null
    ) : null,
    // Value content
    i,
    // Description
    o ? l.div(r.class("bc-json-schema-display__description"), o) : null,
    // Mismatch indicators
    Z(p)
  );
}
function W(e, t) {
  switch (t) {
    case "email":
      return e ? l.a(
        r.class("bc-json-schema-display__link"),
        r.href(`mailto:${e}`),
        e
      ) : l.span(r.class("bc-json-schema-display__value--null"), "—");
    case "uri":
    case "uri-reference":
    case "url":
      return e ? l.a(
        r.class("bc-json-schema-display__link"),
        r.href(e),
        r.target("_blank"),
        r.rel("noopener noreferrer"),
        e
      ) : l.span(r.class("bc-json-schema-display__value--null"), "—");
    case "color":
      return e ? l.span(
        r.class("bc-json-schema-display__color-display"),
        l.span(
          r.class("bc-json-schema-display__color-swatch"),
          r.style(`background-color: ${e}`)
        ),
        l.span(r.class("bc-json-schema-display__monospace"), e)
      ) : l.span(r.class("bc-json-schema-display__value--null"), "—");
    case "date-time":
    case "date":
    case "time":
      if (!e)
        return l.span(
          r.class("bc-json-schema-display__value--null"),
          "—"
        );
      try {
        if (t === "time") return l.span(e);
        const i = new Date(e);
        return isNaN(i.getTime()) ? l.span(e) : l.span(
          t === "date" ? i.toLocaleDateString() : i.toLocaleString()
        );
      } catch {
        return l.span(e);
      }
    case "password":
      return e ? l.span(
        r.class("bc-json-schema-display__value"),
        "•".repeat(Math.min(e.length, 12))
      ) : l.span(r.class("bc-json-schema-display__value--null"), "—");
    case "uuid":
      return e ? l.span(r.class("bc-json-schema-display__monospace"), e) : l.span(r.class("bc-json-schema-display__value--null"), "—");
    case "textarea":
    case "markdown":
      return e ? l.pre(r.class("bc-json-schema-display__pre"), e) : l.span(r.class("bc-json-schema-display__value--null"), "—");
    default:
      return e !== "" ? l.span(r.class("bc-json-schema-display__value"), e) : l.span(r.class("bc-json-schema-display__value--null"), "—");
  }
}
function v({
  ctx: e,
  value: t,
  mismatches: i
}) {
  const a = e.definition, s = R(a, e.name)?.widget, o = d.map(t, (c) => c != null ? String(c) : ""), p = _(o, (c) => W(c, s));
  return g({
    ctx: e,
    mismatches: i,
    children: p
  });
}
function ee(e) {
  if (e == null) return "—";
  const t = Number(e);
  return isNaN(t) ? String(e) : t.toLocaleString();
}
function ne(e) {
  return e == null ? "bc-json-schema-display__value--null" : "bc-json-schema-display__value";
}
function se({
  ctx: e,
  value: t,
  mismatches: i
}) {
  return g({
    ctx: e,
    mismatches: i,
    children: l.span(
      r.class(d.map(t, ne)),
      d.map(t, ee)
    )
  });
}
function te(e) {
  return e == null ? "bc-json-schema-display__value--null" : `bc-json-schema-display__boolean bc-json-schema-display__boolean--${!!e ? "true" : "false"}`;
}
function ie(e) {
  return e == null ? "—" : e ? "true" : "false";
}
function ae({
  ctx: e,
  value: t,
  mismatches: i
}) {
  return g({
    ctx: e,
    mismatches: i,
    children: l.span(
      r.class(d.map(t, te)),
      d.map(t, ie)
    )
  });
}
function re({
  ctx: e,
  mismatches: t
}) {
  return g({
    ctx: e,
    mismatches: t,
    children: l.span(
      r.class("bc-json-schema-display__value--null"),
      "null"
    )
  });
}
function le(e, t) {
  if (e.prefixItems != null && t < e.prefixItems.length)
    return e.prefixItems[t];
  if (Array.isArray(e.items) && t < e.items.length)
    return e.items[t];
  if (e.prefixItems != null && t >= e.prefixItems.length)
    return e.items != null && !Array.isArray(e.items) ? e.items : void 0;
  if (e.items != null && !Array.isArray(e.items))
    return e.items;
}
function ce({
  ctx: e,
  value: t,
  mismatches: i,
  displayWidgetRegistry: a
}) {
  const n = e.definition, s = d.toSignal(t), o = _(s, (p) => Array.isArray(p) ? p.length === 0 ? l.span(
    r.class("bc-json-schema-display__empty"),
    "(empty array)"
  ) : l.div(
    r.class("bc-json-schema-display__array"),
    ...p.map((c, m) => {
      const u = le(n, m), h = e.with({
        definition: u ?? !0
      }).append(m), b = i?.filter((j) => {
        const y = j.path.map(String), $ = [...e.path.map(String), String(m)];
        return y.length >= $.length && $.every((x, N) => y[N] === x);
      });
      return l.div(
        r.class("bc-json-schema-display__array-item"),
        l.span(
          r.class("bc-json-schema-display__array-index"),
          `[${m}]`
        ),
        O({
          ctx: h,
          value: c,
          mismatches: b,
          displayWidgetRegistry: a
        })
      );
    })
  ) : p == null ? l.span(
    r.class("bc-json-schema-display__value--null"),
    "—"
  ) : l.span(r.class("bc-json-schema-display__value"), String(p)));
  return g({ ctx: e, mismatches: i, children: o });
}
function oe({
  ctx: e,
  value: t,
  mismatches: i,
  displayWidgetRegistry: a
}) {
  const n = e.definition, s = d.toSignal(t), o = _(s, (p) => {
    if (p == null)
      return l.span(
        r.class("bc-json-schema-display__value--null"),
        "—"
      );
    if (typeof p != "object" || Array.isArray(p))
      return l.span(
        r.class("bc-json-schema-display__value"),
        JSON.stringify(p)
      );
    const c = p, m = n.properties ?? {}, u = Object.keys(m), h = Object.keys(c), b = u.map((f) => {
      const P = m[f], w = e.with({
        definition: P,
        isPropertyRequired: e.hasRequiredProperty(f)
      }).append(f), L = i?.filter((D) => {
        const I = D.path.map(String), k = [...e.path.map(String), f];
        return I.length >= k.length && k.every((T, K) => I[K] === T);
      }), A = f in c ? c[f] : void 0;
      return !(f in c) && e.hasRequiredProperty(f) ? l.div(
        r.class("bc-json-schema-display__field"),
        l.div(
          r.class("bc-json-schema-display__label-row"),
          l.span(
            r.class("bc-json-schema-display__label"),
            w.widgetLabel ?? f
          ),
          l.span(r.class("bc-json-schema-display__required"), "*")
        ),
        l.span(
          r.class("bc-json-schema-display__value--missing"),
          "(missing)"
        )
      ) : f in c ? O({
        ctx: w,
        value: A,
        mismatches: L,
        displayWidgetRegistry: a
      }) : E;
    }), j = new Set(u), y = h.filter((f) => !j.has(f)), $ = y.map((f) => {
      const P = e.with({ definition: !0 }).append(f), w = i?.filter((L) => {
        const A = L.path.map(String), D = [...e.path.map(String), f];
        return A.length >= D.length && D.every((I, k) => A[k] === I);
      });
      return l.div(
        r.class("bc-json-schema-display__extra-property"),
        O({
          ctx: P,
          value: c[f],
          mismatches: w,
          displayWidgetRegistry: a
        })
      );
    }), x = [...b, ...$], N = F(e);
    return N ? G(N, e, x, [
      ...u,
      ...y
    ]) : e.isRoot ? l.div(
      r.class("bc-json-schema-display__fields"),
      ...x
    ) : l.div(
      r.class("bc-json-schema-display__object"),
      ...x
    );
  });
  return e.isRoot ? o : l.div(
    r.class("bc-json-schema-display__field"),
    e.widgetLabel ? l.div(
      r.class("bc-json-schema-display__label-row"),
      l.span(
        r.class("bc-json-schema-display__label"),
        e.widgetLabel
      ),
      e.isPropertyRequired ? l.span(r.class("bc-json-schema-display__required"), "*") : null,
      e.isDeprecated ? l.span(
        r.class("bc-json-schema-display__deprecated"),
        "deprecated"
      ) : null
    ) : null,
    o,
    e.description ? l.div(
      r.class("bc-json-schema-display__description"),
      e.description
    ) : null
  );
}
function M({
  ctx: e,
  value: t,
  mismatches: i
}) {
  const a = e.definition, n = d.toSignal(t), s = _(n, (o) => {
    if (o == null)
      return l.span(
        r.class("bc-json-schema-display__value--null"),
        "—"
      );
    const p = typeof o == "string" ? o : JSON.stringify(o);
    let c = !0;
    return a.enum != null ? c = a.enum.some((m) => JSON.stringify(m) === JSON.stringify(o)) : a.const !== void 0 && (c = JSON.stringify(a.const) === JSON.stringify(o)), l.span(
      r.class(
        `bc-json-schema-display__value${c ? "" : " bc-json-schema-display__mismatch--enum-mismatch"}`
      ),
      p,
      c ? null : l.span(
        r.class("bc-json-schema-display__mismatch-indicator"),
        a.enum != null ? ` (not in enum: ${a.enum.map((m) => JSON.stringify(m)).join(", ")})` : ` (expected: ${JSON.stringify(a.const)})`
      )
    );
  });
  return g({ ctx: e, mismatches: i, children: s });
}
function pe({
  ctx: e,
  value: t,
  mismatches: i,
  displayWidgetRegistry: a
}) {
  const n = e.definition;
  if (n.allOf != null) {
    const c = n.allOf.filter(
      (m) => typeof m == "object" && m !== null
    );
    if (c.length > 0) {
      const m = c.map(
        ($) => q($, e.schema, e.ajv)
      ), { mergedSchema: u } = V(m, e.path), { allOf: h, ...b } = n, j = { ...b, ...u }, y = e.with({ definition: j });
      return O({
        ctx: y,
        value: t,
        mismatches: i,
        displayWidgetRegistry: a
      });
    }
  }
  const s = n.oneOf ?? n.anyOf;
  if (!Array.isArray(s) || s.length === 0) {
    const c = d.toSignal(t);
    return g({
      ctx: e,
      mismatches: i,
      children: _(
        c,
        (m) => l.span(
          r.class("bc-json-schema-display__value"),
          JSON.stringify(m)
        )
      )
    });
  }
  const o = d.toSignal(t), p = _(o, (c) => {
    const m = U(e, c, e.ajv);
    if (m.matchingBranch >= 0) {
      const u = s[m.matchingBranch], h = typeof u == "object" && u !== null && u.$ref ? B(u, e.schema) : u;
      if ((typeof h == "object" ? h?.type : void 0) === "object") {
        const y = e.with({ definition: h });
        return O({
          ctx: y,
          value: c,
          mismatches: i,
          displayWidgetRegistry: a
        });
      }
      const j = typeof c == "string" ? c : JSON.stringify(c);
      return l.span(
        r.class("bc-json-schema-display__value"),
        j
      );
    }
    return m.isAmbiguous ? l.div(
      l.span(
        r.class(
          "bc-json-schema-display__branch-label bc-json-schema-display__branch-label--ambiguous"
        ),
        `Ambiguous (${m.validBranches.length} branches match)`
      ),
      l.pre(
        r.class("bc-json-schema-display__pre"),
        JSON.stringify(c, null, 2)
      )
    ) : l.div(
      l.span(
        r.class(
          "bc-json-schema-display__branch-label bc-json-schema-display__branch-label--no-match"
        ),
        "No matching branch"
      ),
      l.pre(
        r.class("bc-json-schema-display__pre"),
        JSON.stringify(c, null, 2)
      )
    );
  });
  return g({ ctx: e, mismatches: i, children: p });
}
function J({
  ctx: e,
  value: t,
  mismatches: i
}) {
  const a = d.toSignal(t), n = _(a, (s) => {
    if (s == null)
      return l.span(
        r.class("bc-json-schema-display__value--null"),
        s === null ? "null" : "—"
      );
    if (typeof s == "boolean")
      return l.span(
        r.class(
          `bc-json-schema-display__boolean bc-json-schema-display__boolean--${s ? "true" : "false"}`
        ),
        String(s)
      );
    if (typeof s == "number")
      return l.span(
        r.class("bc-json-schema-display__value"),
        s.toLocaleString()
      );
    if (typeof s == "string")
      return l.span(r.class("bc-json-schema-display__value"), s);
    try {
      return l.pre(
        r.class("bc-json-schema-display__pre"),
        JSON.stringify(s, null, 2)
      );
    } catch {
      return l.span(r.class("bc-json-schema-display__value"), String(s));
    }
  });
  return g({ ctx: e, mismatches: i, children: n });
}
function O({
  ctx: e,
  value: t,
  mismatches: i,
  displayWidgetRegistry: a
}) {
  const n = typeof e.definition == "boolean" ? {} : e.definition;
  let s = n?.$ref ? B(n, e.schema) : n, o = e.with({ definition: s });
  if (s?.allOf != null) {
    const p = s.allOf.filter(
      (c) => typeof c == "object" && c !== null
    );
    if (p.length > 0) {
      const c = p.map(
        (b) => q(b, e.schema, e.ajv)
      ), { mergedSchema: m } = V(c, e.path), { allOf: u, ...h } = s;
      s = { ...h, ...m }, o = e.with({ definition: s });
    }
  }
  if (a) {
    const p = a.findBestWidget(o);
    if (p)
      return p.factory({
        value: t,
        ctx: o,
        mismatches: i
      });
  }
  if (s == null)
    return J({
      ctx: o,
      value: t,
      mismatches: i
    });
  if (s.enum != null)
    return M({
      ctx: o,
      value: t,
      mismatches: i
    });
  if (s.const !== void 0)
    return M({
      ctx: o,
      value: t,
      mismatches: i
    });
  if (s.anyOf != null || s.oneOf != null)
    return pe({
      ctx: o,
      value: t,
      mismatches: i,
      displayWidgetRegistry: a
    });
  if (s.type == null)
    return J({
      ctx: o,
      value: t,
      mismatches: i
    });
  if (Array.isArray(s.type)) {
    const c = s.type.filter((m) => m !== "null");
    return c.length === 1 && ["string", "number", "integer", "boolean"].includes(c[0]) ? C(c[0], {
      ctx: o,
      value: t,
      mismatches: i,
      displayWidgetRegistry: a
    }) : J({
      ctx: o,
      value: t,
      mismatches: i
    });
  }
  return C(s.type, {
    ctx: o,
    value: t,
    mismatches: i,
    displayWidgetRegistry: a
  });
}
function C(e, t) {
  switch (e) {
    case "string":
      return v(t);
    case "number":
    case "integer":
      return se(t);
    case "boolean":
      return ae(t);
    case "array":
      return ce(t);
    case "object":
      return oe(t);
    case "null":
      return re(t);
    default:
      return J(t);
  }
}
function ge({
  schema: e,
  value: t,
  showMismatches: i = !0,
  customWidgets: a,
  horizontal: n = !1
}) {
  const s = new X({
    schema: e,
    definition: e,
    horizontal: n,
    isPropertyRequired: !1,
    path: []
  });
  let o;
  if (a && a.length > 0) {
    o = new Y();
    for (const c of a)
      o.register(c);
  }
  const p = d.toSignal(t);
  return _(p, (c) => {
    const m = i ? S(c, e) : void 0;
    return O({
      ctx: s,
      value: c,
      mismatches: m,
      displayWidgetRegistry: o
    });
  });
}
export {
  J as AnyDisplay,
  ce as ArrayDisplay,
  ae as BooleanDisplay,
  pe as CompositionDisplay,
  Y as DisplayWidgetRegistry,
  g as DisplayWrapper,
  M as EnumConstDisplay,
  O as GenericDisplay,
  ge as JSONSchemaDisplay,
  re as NullDisplay,
  se as NumberDisplay,
  oe as ObjectDisplay,
  v as StringDisplay,
  S as detectMismatches,
  he as forDisplayFormat,
  ye as forDisplayTypeAndFormat,
  de as forDisplayXUI
};
