"use client";
const require_create_split_props = require("../../utils/create-split-props.cjs");
const require_factory = require("../factory.cjs");
const require_use_menu_context = require("./use-menu-context.cjs");
const require_use_menu_item_context = require("./use-menu-item-context.cjs");
const require_use_menu_option_item_props_context = require("./use-menu-option-item-props-context.cjs");
const require_use_menu_item_group_context = require("./use-menu-item-group-context.cjs");
let react = require("react");
let _zag_js_react = require("@zag-js/react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/menu/menu-radio-item.tsx
var splitOptionItemProps = require_create_split_props.createSplitProps();
var MenuRadioItem = (0, react.forwardRef)((props, ref) => {
	const [partialItemProps, localProps] = splitOptionItemProps(props, [
		"closeOnSelect",
		"disabled",
		"value",
		"valueText"
	]);
	const menu = require_use_menu_context.useMenuContext();
	const itemGroup = require_use_menu_item_group_context.useMenuItemGroupContext();
	const optionItemProps = {
		...partialItemProps,
		checked: itemGroup.value === partialItemProps.value,
		type: "radio",
		onCheckedChange: () => itemGroup.onValueChange?.({ value: partialItemProps.value })
	};
	const mergedProps = (0, _zag_js_react.mergeProps)(menu.getOptionItemProps(optionItemProps), localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_menu_option_item_props_context.MenuItemPropsProvider, {
		value: optionItemProps,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_menu_item_context.MenuItemProvider, {
			value: menu.getOptionItemState(optionItemProps),
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
				...mergedProps,
				ref
			})
		})
	});
});
MenuRadioItem.displayName = "MenuRadioItem";
//#endregion
exports.MenuRadioItem = MenuRadioItem;
