'use client'; import * as React from 'react'; import useFocusableWhenDisabled from "../utils/useFocusableWhenDisabled.mjs"; const EMPTY = {}; export default function useButtonBase(parameters) { const { nativeButton, nativeButtonProp, internalNativeButton = nativeButton, allowInferredHostMismatch = false, disabled, type, hasFormAction = false, tabIndex = 0, focusableWhenDisabled: focusableWhenDisabledParam, stopEventPropagation = false, onBeforeKeyDown, onBeforeKeyUp } = parameters; const rootRef = React.useRef(null); const focusableWhenDisabled = focusableWhenDisabledParam === true; const focusableWhenDisabledProps = useFocusableWhenDisabled({ focusableWhenDisabled, disabled, isNativeButton: nativeButton, tabIndex }); if (process.env.NODE_ENV !== 'production') { // eslint-disable-next-line react-hooks/rules-of-hooks React.useEffect(() => { const root = rootRef.current; if (root == null) { return; } const isButtonTag = root.tagName === 'BUTTON'; if (nativeButtonProp !== undefined) { if (nativeButtonProp && !isButtonTag) { const message = 'MUI: A component that acts as a button expected a native