'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var React = require('react');
var index = require('../../node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.0.5_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@1_e7gmnqwdc4f4ybjj7qkfdho6zy/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs');
var cell = require('./cell.cjs');
var dropdownMenuRoot = require('./dropdown-menu-root.cjs');
var JMHAJKUZ = require('../../node_modules/.pnpm/@ariakit_react-core@0.4.16_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@ariakit/react-core/esm/__chunks/JMHAJKUZ.cjs');
var utils = require('./utils.cjs');

const DropdownMenuItem = React.forwardRef(({ children, value, ...props }, ref) => {
    const { autocomplete, searchValue } = dropdownMenuRoot.useDropdownContext();
    const menuLevel = dropdownMenuRoot.useMenuLevel();
    const item = (jsxRuntime.jsxRuntimeExports.jsx(index.Item, { ref: ref, ...props, asChild: true, children: jsxRuntime.jsxRuntimeExports.jsx(cell.Cell, { isComboboxCell: autocomplete, children: children }) }));
    if (menuLevel >= 2)
        return item;
    const computedValue = utils.getValue(value, children);
    if (autocomplete && !utils.getMatch(computedValue, searchValue))
        return null;
    if (autocomplete)
        return jsxRuntime.jsxRuntimeExports.jsx(JMHAJKUZ.ComboboxItem, { render: item, value: value });
    return item;
});
const DropdownMenuRadioItem = React.forwardRef(({ children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx(index.RadioItem, { ref: ref, ...props, asChild: true, children: jsxRuntime.jsxRuntimeExports.jsx(cell.Cell, { type: "select", children: children }) })));
DropdownMenuRadioItem.displayName = index.RadioItem.displayName;
const DropdownMenuRadioGroup = index.RadioGroup;

exports.DropdownMenuItem = DropdownMenuItem;
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
//# sourceMappingURL=dropdown-menu-item.cjs.map
