"use client";
const require_create_split_props = require("../../utils/create-split-props.cjs");
const require_factory = require("../factory.cjs");
const require_use_presence_context = require("../presence/use-presence-context.cjs");
const require_use_menu_context = require("./use-menu-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-trigger.tsx
var splitTriggerProps = require_create_split_props.createSplitProps();
var MenuTrigger = (0, react.forwardRef)((props, ref) => {
	const [triggerProps, localProps] = splitTriggerProps(props, ["value"]);
	const menu = require_use_menu_context.useMenuContext();
	const presence = require_use_presence_context.usePresenceContext();
	const triggerPropsRaw = menu.getTriggerProps(triggerProps);
	const mergedProps = (0, _zag_js_react.mergeProps)({
		...triggerPropsRaw,
		"aria-controls": presence.unmounted ? void 0 : triggerPropsRaw["aria-controls"]
	}, localProps);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.button, {
		...mergedProps,
		ref
	});
});
MenuTrigger.displayName = "MenuTrigger";
//#endregion
exports.MenuTrigger = MenuTrigger;
