import { useMergeParentKey as e } from "./hooks/useMergeParentKey.js";
import { FormElement as t } from "./FormElement.js";
import { useSortedPropertyNames as n } from "./hooks/useSortPropertyNames.js";
import "react";
import { jsx as r } from "react/jsx-runtime";
//#region src/components/dynamic-form/ObjectController.tsx
var i = ({ name: i, schema: a, ui: o, form: s, disabled: c, parentKey: l, viewOnly: u }) => {
	let d = a, f = o, p = n(d.properties ?? {}, f?.order), m = e(l, i), h = d.required ?? [];
	return /* @__PURE__ */ r("div", {
		className: p.length === 2 ? "grid grid-cols-2 gap-x-4" : void 0,
		children: p.map((e) => {
			let n = d.properties?.[e];
			return n ? /* @__PURE__ */ r(t, {
				form: s,
				disabled: c,
				viewOnly: u,
				parentKey: m,
				name: e,
				schema: n,
				ui: f?.properties?.[e],
				required: h.includes(e)
			}, `el-${e}`) : null;
		})
	});
};
//#endregion
export { i as ObjectController };
