"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SidebarContext=void 0;var _extends2=require("babel-runtime/helpers/extends"),_extends3=_interopRequireDefault(_extends2),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=require("babel-runtime/helpers/createClass"),_createClass3=_interopRequireDefault(_createClass2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2);exports.withContext=withContext;var _react=require("react"),React=_interopRequireWildcard(_react),_utils=require("./utils");function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var __rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&(r[n[i]]=e[n[i]])}return r},SidebarContext=exports.SidebarContext=React.createContext();function withContext(n){return function(i){var e,t=(e=React.PureComponent,(0,_inherits3.default)(r,e),(0,_createClass3.default)(r,[{key:"render",value:function(){var r=this,n=(0,_utils.getKey)(this);return React.createElement(SidebarContext.Consumer,null,function(e){var t=__rest(e,[]);return React.createElement(i,(0,_extends3.default)({},r.props,t,{itemKey:n}))})}}]),r);function r(){return(0,_classCallCheck3.default)(this,r),(0,_possibleConstructorReturn3.default)(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return t.rawName=n,t}}