"use client";
const require_create_split_props = require("../../utils/create-split-props.cjs");
const require_compose_refs = require("../../utils/compose-refs.cjs");
const require_factory = require("../factory.cjs");
const require_use_fieldset_context = require("./use-fieldset-context.cjs");
const require_use_fieldset = require("./use-fieldset.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/fieldset/fieldset-root.tsx
var splitRootProps = require_create_split_props.createSplitProps();
var FieldsetRoot = (0, react.forwardRef)((props, ref) => {
	const [useFieldsetProps, localProps] = splitRootProps(props, [
		"id",
		"disabled",
		"invalid"
	]);
	const fieldset = require_use_fieldset.useFieldset(useFieldsetProps);
	const mergedProps = (0, _zag_js_react.mergeProps)(fieldset.getRootProps(), localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_fieldset_context.FieldsetProvider, {
		value: fieldset,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.fieldset, {
			...mergedProps,
			ref: require_compose_refs.composeRefs(ref, fieldset.refs.rootRef)
		})
	});
});
FieldsetRoot.displayName = "FieldsetRoot";
//#endregion
exports.FieldsetRoot = FieldsetRoot;
