import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["onRemove", "onValueChange", "onAttach", "initialFiles"];
import React from 'react';
import { FileUploaderControlProvider } from "../FileUploaderControlProvider";
export var withFileUploaderControlProvider = function withFileUploaderControlProvider(Component) {
  return /*#__PURE__*/React.memo( /*#__PURE__*/
  React.forwardRef(function (props, ref) {
    var onRemove = props.onRemove,
      onValueChange = props.onValueChange,
      onAttach = props.onAttach,
      initialFiles = props.initialFiles,
      rest = _objectWithoutPropertiesLoose(props, _excluded);
    return /*#__PURE__*/(
      React.createElement(FileUploaderControlProvider, props, /*#__PURE__*/
      React.createElement(Component, _extends({
        ref: ref
      }, rest)))
    );
  }));
};