"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _react = require("react");

var _reactErrorBoundary = require("react-error-boundary");

var _ErrorFallback = _interopRequireDefault(require("./ErrorFallback"));

var _jsxRuntime = require("react/jsx-runtime");

function withFormulaErrorBoundary(Form) {
  return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
    var props = Object.assign({}, _ref);
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
      FallbackComponent: _ErrorFallback["default"],
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Form, (0, _objectSpread2["default"])({
        ref: ref
      }, props))
    });
  });
}

var _default = withFormulaErrorBoundary;
exports["default"] = _default;
//# sourceMappingURL=withFormulaErrorBoundary.cjs.map