'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _recompose = require('recompose');

var _BandwidthThemeProvider = require('../BandwidthThemeProvider');

var _BandwidthThemeProvider2 = _interopRequireDefault(_BandwidthThemeProvider);

var _StyleRoot = require('./styles/StyleRoot');

var _StyleRoot2 = _interopRequireDefault(_StyleRoot);

var _withDragDropContext = require('./withDragDropContext');

var _withDragDropContext2 = _interopRequireDefault(_withDragDropContext);

var _DragLayer = require('../DragLayer');

var _DragLayer2 = _interopRequireDefault(_DragLayer);

require('./styles/global');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// injects a global stylesheet

var Provider = function Provider(_ref) {
  var StyleRoot = _ref.StyleRoot,
      ThemeProvider = _ref.ThemeProvider,
      DragLayer = _ref.DragLayer,
      children = _ref.children;
  return _react2.default.createElement(
    ThemeProvider,
    null,
    _react2.default.createElement(
      StyleRoot,
      null,
      children,
      _react2.default.createElement(DragLayer, null)
    )
  );
};

Provider.propTypes = {
  StyleRoot: _propTypes2.default.func,
  ThemeProvider: _propTypes2.default.func,
  DragLayer: _propTypes2.default.func,
  children: _propTypes2.default.node.isRequired
};

Provider.defaultProps = {
  StyleRoot: _StyleRoot2.default,
  ThemeProvider: _BandwidthThemeProvider2.default,
  DragLayer: _DragLayer2.default
};

exports.default = (0, _withDragDropContext2.default)(Provider);