import React from "react";
export default function (props, beaviours) {
  let {
    togglePopup,
    isPopupOpen,
    removeClose,
    position,
    children,
    placement,
    getTargetRef,
    getContainerRef,
    contentProps,
    targetProps,
    focusVisible,
    focusProps
  } = props;
  let popupProps = {
    togglePopup,
    isPopupOpen,
    removeClose,
    position,
    placement,
    getTargetRef,
    getContainerRef,
    contentProps,
    targetProps,
    focusVisible,
    focusProps,
    ...beaviours
  };
  const childrenWithProps = React.Children.map(children, (child, index) => {
    return /*#__PURE__*/React.cloneElement(child, popupProps);
  });
  delete childrenWithProps.children;
  return childrenWithProps;
}