"use strict";

exports.__esModule = true;
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _instance = _interopRequireDefault(require("./instance"));

var _locale = _interopRequireDefault(require("./../locale"));

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

function Context(_ref) {
  var _ref$locale = _ref.locale,
      locale = _ref$locale === void 0 ? {} : _ref$locale,
      portal = _ref.portal,
      children = _ref.children;
  var data = null;
  data = locale;

  if (!data || Object.keys(data).length === 0) {
    console.log('国际化数据为空');
  }

  if (data && Object.keys(data).length) {
    window.localeData = data;
  }

  return /*#__PURE__*/_react["default"].createElement(_instance["default"].Provider, {
    value: {
      locale: function locale() {
        return _locale["default"].apply(void 0, arguments);
      },
      portal: portal
    }
  }, children);
}

var _default = Context;
exports["default"] = _default;
module.exports = exports.default;