import { useDisclosure } from './F5MUBM3I.js';
import { useDialogProviderContext } from './RS7LB2H4.js';
import { createHook, forwardRef as forwardRef2, createElement } from './LMDWO4NN.js';
import { __objRest, __spreadValues } from './3YLGPPWQ.js';
import { getPopupRole } from '../../../../../../@ariakit_core@0.4.15/node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.js';
import { invariant } from '../../../../../../@ariakit_core@0.4.15/node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js';

var TagName = "button";
var useDialogDisclosure = createHook(
  function useDialogDisclosure2(_a) {
    var _b = _a, { store } = _b, props = __objRest(_b, ["store"]);
    const context = useDialogProviderContext();
    store = store || context;
    invariant(
      store,
      process.env.NODE_ENV !== "production" && "DialogDisclosure must receive a `store` prop or be wrapped in a DialogProvider component."
    );
    const contentElement = store.useState("contentElement");
    props = __spreadValues({
      "aria-haspopup": getPopupRole(contentElement, "dialog")
    }, props);
    props = useDisclosure(__spreadValues({ store }, props));
    return props;
  }
);
forwardRef2(function DialogDisclosure2(props) {
  const htmlProps = useDialogDisclosure(props);
  return createElement(TagName, htmlProps);
});

export { useDialogDisclosure };
//# sourceMappingURL=NTITENHD.js.map
