import { useEffect } from 'react';
import { HoneybadgerErrorBoundary as HoneybadgerErrorBoundary$1, Honeybadger } from '@honeybadger-io/react';
import initializeHoneybadger, { setHoneybadgerErrorFilter } from '../../initializers/honeybadger/index.js';
import FallbackComponent from './FallbackComponent.js';
import { jsx } from 'react/jsx-runtime';
import '../../../defineProperty-Dcer7TUY.js';
import '../../../toPropertyKey-BAXkSB3z.js';
import '../../../typeof-D-UKOauR.js';
import '../../initializers/honeybadger/constants.js';
import '../../initializers/honeybadger/utils.js';
import '@bigbinary/neeto-atoms';
import 'dompurify';
import 'ramda';
import 'react-i18next';

var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
  var children = _ref.children,
    _ref$ErrorComponent = _ref.ErrorComponent,
    ErrorComponent = _ref$ErrorComponent === void 0 ? FallbackComponent : _ref$ErrorComponent,
    _ref$filterErrors = _ref.filterErrors,
    filterErrors = _ref$filterErrors === void 0 ? undefined : _ref$filterErrors,
    config = _ref.config;
  setHoneybadgerErrorFilter(filterErrors);
  useEffect(function () {
    if (config) initializeHoneybadger(config);
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  useEffect(function () {
    return function () {
      setHoneybadgerErrorFilter(null);
    };
  }, []);
  return /*#__PURE__*/jsx(HoneybadgerErrorBoundary$1, {
    ErrorComponent: ErrorComponent,
    honeybadger: Honeybadger,
    children: children
  });
};

export { HoneybadgerErrorBoundary as default };
//# sourceMappingURL=HoneybadgerErrorBoundary.js.map
