import React, { Component } from "react";
import { FocusTrap } from "./focus-trap-react.js";
class FocusManager extends Component {
  constructor(props) {
    super(props);
    this.id = `fm_${Math.floor(Math.random() * 9999)}`;
    this.onActivate = this.onActivate.bind(this);
    this.onDeactivate = this.onDeactivate.bind(this);
  }
  onActivate() {
  }
  onDeactivate() {
  }
  render() {
    const { children, focusTrapOptions, jsdomMode, preventScroll, ...rest } = this.props;
    const options = {
      ...focusTrapOptions,
      onActivate: this.onActivate,
      onDeactivate: this.onDeactivate,
      clickOutsideDeactivates: true
    };
    if (jsdomMode) {
      return /* @__PURE__ */ React.createElement("div", { ...rest }, children);
    } else {
      return /* @__PURE__ */ React.createElement(FocusTrap, { focusTrapOptions: { ...options, preventScroll }, ...rest }, children);
    }
  }
}
FocusManager.defaultProps = {
  focusTrapOptions: {
    clickOutsideDeactivates: true
  },
  jsdomMode: false
};
export {
  FocusManager
};
//# sourceMappingURL=focus-manager.js.map
