import { useRef as d, useState as o, useCallback as i } from "react";
import { usePopper as b } from "react-popper";
const R = ({ placement: s = "bottom-start" } = {}) => {
  const p = d(null), [r, n] = o(null), [l, t] = o(!1), e = b(p.current, r, {
    placement: s
  }), u = () => t(!0), c = () => t(!1), a = () => t((m) => !m), f = i(() => {
    e.update?.();
  }, [e.update]);
  return {
    isOpen: l,
    open: u,
    close: c,
    toggle: a,
    update: f,
    referenceRef: p,
    popperElementRef: n,
    popperStyles: e.styles.popper,
    popperAttributes: e.attributes.popper
  };
};
export {
  R as default
};
//# sourceMappingURL=usePopperDropdown.js.map
