'use strict';

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

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _immutable = require('immutable');

var _panel = require('./panel');

var _panel2 = _interopRequireDefault(_panel);

var _ti = require('react-icons/ti');

var _fa = require('react-icons/fa');

var _export = require('../style/export');

var _constants = require('../../constants');

var _sharedStyle = require('../../shared-style');

var SharedStyle = _interopRequireWildcard(_sharedStyle);

var _md = require('react-icons/md');

var _browser = require('../../utils/browser');

var _export2 = require('../../class/export');

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var VISIBILITY_MODE = {
  MODE_IDLE: _constants.MODE_IDLE, MODE_2D_ZOOM_IN: _constants.MODE_2D_ZOOM_IN, MODE_2D_ZOOM_OUT: _constants.MODE_2D_ZOOM_OUT, MODE_2D_PAN: _constants.MODE_2D_PAN,
  MODE_3D_VIEW: _constants.MODE_3D_VIEW, MODE_3D_FIRST_PERSON: _constants.MODE_3D_FIRST_PERSON,
  MODE_WAITING_DRAWING_LINE: _constants.MODE_WAITING_DRAWING_LINE, MODE_DRAWING_LINE: _constants.MODE_DRAWING_LINE, MODE_DRAWING_HOLE: _constants.MODE_DRAWING_HOLE, MODE_DRAWING_ITEM: _constants.MODE_DRAWING_ITEM,
  MODE_DRAGGING_LINE: _constants.MODE_DRAGGING_LINE, MODE_DRAGGING_VERTEX: _constants.MODE_DRAGGING_VERTEX, MODE_DRAGGING_ITEM: _constants.MODE_DRAGGING_ITEM, MODE_DRAGGING_HOLE: _constants.MODE_DRAGGING_HOLE,
  MODE_ROTATING_ITEM: _constants.MODE_ROTATING_ITEM, MODE_UPLOADING_IMAGE: _constants.MODE_UPLOADING_IMAGE, MODE_FITTING_IMAGE: _constants.MODE_FITTING_IMAGE
};

var tableSearchStyle = { width: '100%', marginTop: '0.8em' };
var searchIconStyle = { fontSize: '1.5em' };

var styleEditButton = {
  cursor: 'pointer',
  marginLeft: '5px',
  border: '0px',
  background: 'none',
  color: SharedStyle.COLORS.white,
  fontSize: '14px',
  outline: '0px'
};

var tableLayerStyle = {
  width: '100%',
  cursor: 'pointer',
  overflowY: 'auto',
  maxHeight: '20em',
  padding: '0 1em',
  marginLeft: '1px'
};
var chooseCamera = {
  width: '72%',
  padding: 3,
  borderRadius: 3,
  cursor: 'pointer'
};
var iconColStyle = { width: '2em', color: "white" };
var styleHoverColor = { color: SharedStyle.SECONDARY_COLOR.main };
var styleEditButtonHover = _extends({}, styleEditButton, styleHoverColor);
var styleAddLabel = { fontSize: '10px', marginLeft: '5px' };
var styleEyeVisible = { fontSize: '1.25em' };
var styleEyeHidden = _extends({}, styleEyeVisible, { color: '#a5a1a1' });
var firstTdStyle = { width: '6em' };
var newLayerLableStyle = { margin: '0.5em 0', fontSize: '1.3em', cursor: 'pointer', textAlign: 'center' };
var newLayerLableHoverStyle = _extends({}, newLayerLableStyle, styleHoverColor);
var layerInputTableStyle = { width: '100%', borderSpacing: '2px 0', padding: '5px 15px' };
var inputTableButtonStyle = { float: 'right', marginTop: '0.5em', borderSpacing: '0' };
// Merge a `source` object to a `target` recursively
var merge = function merge(target, source) {
  // Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties 

  var _iteratorNormalCompletion = true;
  var _didIteratorError = false;
  var _iteratorError = undefined;

  try {
    for (var _iterator = Object.keys(source)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
      var key = _step.value;

      if (source[key] instanceof Object && target && source) Object.assign(source[key], merge(target[key], source[key]));
    }

    // Join `target` and modified `source`
  } catch (err) {
    _didIteratorError = true;
    _iteratorError = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion && _iterator.return) {
        _iterator.return();
      }
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }
  }

  Object.assign(target || {}, source);
  return target;
};

var PanelLayers = function (_Component) {
  _inherits(PanelLayers, _Component);

  function PanelLayers(props, context) {
    _classCallCheck(this, PanelLayers);

    var _this = _possibleConstructorReturn(this, (PanelLayers.__proto__ || Object.getPrototypeOf(PanelLayers)).call(this, props, context));

    _this.state = {
      headHovered: false,
      layerAddUIVisible: false,
      editingLayer: new _immutable.Map(),
      openLayers: {},
      layerList: [],
      selectedItemId: ""
    };
    return _this;
  }

  // shouldComponentUpdate(nextProps, nextState) {
  //   if(
  //     this.props.state.scene.layers.size !== nextProps.state.scene.layers.size ||
  //     nextState.layerAddUIVisible != this.state.layerAddUIVisible ||
  //     this.state.editingLayer.hashCode() !== nextState.editingLayer.hashCode() ||
  //     this.props.state.sceneHistory.hashCode() !== nextProps.state.sceneHistory.hashCode()
  //   ) return true;

  //   return false;
  // }

  _createClass(PanelLayers, [{
    key: 'addLayer',
    value: function addLayer(e) {
      e.stopPropagation();
      if (!this.state.layerAddUIVisible) {
        this.context.sceneActions.addLayer('', 0);
        this.setState({ layerAddUIVisible: false });
      } else this.setState({ layerAddUIVisible: !this.state.layerAddUIVisible });
    }
  }, {
    key: 'resetLayerMod',
    value: function resetLayerMod(e) {
      e.stopPropagation();
      this.setState({ layerAddUIVisible: false, editingLayer: new _immutable.Map() });
    }
  }, {
    key: 'updateLayer',
    value: function updateLayer(e, layerData) {
      e.stopPropagation();

      var _layerData$toJS = layerData.toJS(),
          id = _layerData$toJS.id,
          name = _layerData$toJS.name,
          opacity = _layerData$toJS.opacity,
          altitude = _layerData$toJS.altitude,
          order = _layerData$toJS.order;

      altitude = parseInt(altitude);

      this.context.sceneActions.setLayerProperties(id, { name: name, opacity: opacity, altitude: altitude, order: order });
      this.setState({ layerAddUIVisible: false, editingLayer: new _immutable.Map() });
    }
  }, {
    key: 'delLayer',
    value: function delLayer(e, layerID) {
      e.stopPropagation();
      this.context.sceneActions.removeLayer(layerID);
      this.setState({ layerAddUIVisible: false, editingLayer: new _immutable.Map() });
    }
  }, {
    key: 'delItem',
    value: function delItem(e, layerId, element) {
      e.stopPropagation();
      var _context = this.context,
          areaActions = _context.areaActions,
          linesActions = _context.linesActions,
          itemsActions = _context.itemsActions;


      switch (element ? element.prototype : 'none') {
        case 'areas':
          areaActions.delectArea(layerId, element.id);
          break;
        case 'lines':
          linesActions.delectLine(layerId, element.id);
          break;
        case 'items':
          itemsActions.delectItem(layerId, element.id);
          break;
      }
    }
  }, {
    key: 'loadFloorPlanFromFile',
    value: function loadFloorPlanFromFile(event) {
      var projectActions = this.context.projectActions;
      var state = this.props.state;


      console.log("project : ", this.context);
      event.stopPropagation();
      (0, _browser.browserUpload)().then(function (data) {

        data = JSON.parse(data);
        console.log("floor plan file : success : ", data);
        var newLayer = {};
        if (Object.keys(data.layers).length > 0) {
          Object.keys(data.layers).map(function (key, i) {
            console.log("layer : ", data.layers[key]);
            if (i == 0) {
              newLayer = data.layers[key];
            } else {
              newLayer = merge(newLayer, data.layers[key]);
            }
          });
        } else {
          return {};
        }

        // projectActions.loadFloorPlan(JSON.parse(data));
        newLayer.name = state.get("floor");
        newLayer.id = 'nl-' + Date.now();
        state = _export2.Project.unselectAll(state).updatedState;
        var saveData = state.get('scene').toJS();
        saveData.layers[newLayer.id] = newLayer;
        console.log("inner plan file : success : ", saveData);
        projectActions.loadFloorPlan(saveData);
      });
    }
  }, {
    key: 'createNewProject',
    value: function createNewProject() {
      console.log("create new project");
    }
  }, {
    key: 'selectClick',
    value: function selectClick(layerID, e) {
      this.context.sceneActions.selectLayer(layerID);
    }
  }, {
    key: 'selectItem',
    value: function selectItem(layerId, element) {
      var _context2 = this.context,
          projectActions = _context2.projectActions,
          areaActions = _context2.areaActions,
          linesActions = _context2.linesActions,
          holesActions = _context2.holesActions,
          itemsActions = _context2.itemsActions;


      console.log("select item : ", element, element.get("prototype"));

      if (element && element.selected) return;

      this.setState({ selectedItemId: element.id });

      switch (element ? element.prototype : 'none') {
        case 'areas':
          areaActions.selectArea(layerId, element.id);
          break;

        case 'lines':
          linesActions.selectLine(layerId, element.id);
          break;

        case 'holes':
          holesActions.selectHole(layerId, element.id);
          break;

        case 'items':
          itemsActions.selectItem(layerId, element.id);
          break;

        case 'none':
          projectActions.unselectAll();
          this.setState({ selectedItemId: "" });
          break;
      }
    }
  }, {
    key: 'swapVisibilityItem',
    value: function swapVisibilityItem(layerID, layer, element, e) {
      e.stopPropagation();
      var visibleItems = layer.visibleItems;
      if (!visibleItems[element.id]) visibleItems[element.id] = true;else visibleItems[element.id] = false;
      if ((typeof visibleItems === 'undefined' ? 'undefined' : _typeof(visibleItems)) != _immutable.Map) {
        var newMap = new _immutable.Map();
        Object.keys(visibleItems).map(function (key) {
          newMap[key] = visibleItems[key];
        });
        visibleItems = newMap;
      }
      this.context.sceneActions.setLayerProperties(layerID, { visibleItems: visibleItems });
    }
  }, {
    key: 'render',
    value: function render() {
      var _this2 = this;

      if (!VISIBILITY_MODE[this.props.state.mode]) return null;
      var _context3 = this.context,
          projectActions = _context3.projectActions,
          translator = _context3.translator;

      var scene = this.props.state.get("scene");
      var isLastLayer = scene.layers.size === 1;
      var openLayers = this.state.openLayers;

      var layerList = scene.layers.entrySeq();
      var itemList = [];

      return _react2.default.createElement(
        _panel2.default,
        { name: this.context.translator.t('Layers') },
        _react2.default.createElement(
          'table',
          { style: tableLayerStyle },
          _react2.default.createElement(
            'thead',
            null,
            _react2.default.createElement(
              'tr',
              null,
              _react2.default.createElement('th', null),
              _react2.default.createElement('th', null),
              _react2.default.createElement(
                'th',
                null,
                this.context.translator.t('Name')
              ),
              _react2.default.createElement('th', { colSpan: '2' })
            )
          ),
          layerList.map(function (_ref) {
            var _ref2 = _slicedToArray(_ref, 2),
                layerID = _ref2[0],
                layer = _ref2[1];

            // let selectClick = e => { }
            var configureClick = function configureClick(e) {
              return _this2.setState({ editingLayer: layer, layerAddUIVisible: true });
            };
            var openLayerItems = function openLayerItems(e) {
              if (!openLayers[layerID]) openLayers[layerID] = true;else openLayers[layerID] = false;
              console.log("open alyers : ", openLayers);
              _this2.setState({ openLayers: openLayers });
            };
            var swapVisibility = function swapVisibility(e) {
              // console.log("swap visibility")
              e.stopPropagation();
              _this2.context.sceneActions.setLayerProperties(layerID, { visible: !layer.visible });
            };
            var isCurrentLayer = layerID === scene.selectedLayer;
            return _react2.default.createElement(
              'tbody',
              { key: layerID },
              _react2.default.createElement(
                'tr',
                {
                  style: !isCurrentLayer ? null : styleHoverColor
                },
                _react2.default.createElement(
                  'td',
                  { style: iconColStyle },
                  _react2.default.createElement(_fa.FaEye, {
                    onClick: swapVisibility,
                    style: !layer.visible ? styleEyeHidden : styleEyeVisible
                  })
                ),
                _react2.default.createElement(
                  'td',
                  null,
                  openLayers[layerID] ? _react2.default.createElement(_fa.FaAngleDown, { onClick: openLayerItems }) : _react2.default.createElement(_fa.FaAngleRight, { onClick: openLayerItems })
                ),
                _react2.default.createElement(
                  'td',
                  { onClick: _this2.selectClick.bind(_this2, layerID) },
                  layer.name
                ),
                _react2.default.createElement(
                  'td',
                  { style: iconColStyle },
                  _react2.default.createElement(_fa.FaPencilAlt, {
                    onClick: configureClick,
                    style: !isCurrentLayer ? styleEditButton : styleEditButtonHover,
                    title: _this2.context.translator.t('Configure layer')
                  })
                ),
                _react2.default.createElement(
                  'td',
                  { style: iconColStyle },
                  !isLastLayer ? _react2.default.createElement(_fa.FaTrash, {
                    onClick: function onClick(e) {
                      return _this2.delLayer(e, layerID);
                    },
                    style: !isCurrentLayer ? styleEditButton : styleEditButtonHover,
                    title: _this2.context.translator.t('Delete layer')
                  }) : _react2.default.createElement(_fa.FaTrash, {
                    onClick: function onClick(e) {
                      return confirm(translator.t('Would you want to start a new Project?')) ? projectActions.newProject() : null;
                    },
                    style: !isCurrentLayer ? styleEditButton : styleEditButtonHover,
                    title: _this2.context.translator.t('Delete layer')
                  })
                )
              ),
              openLayers[layerID] ? layer.items.entrySeq().map(function (_ref3) {
                var _ref4 = _slicedToArray(_ref3, 2),
                    id = _ref4[0],
                    item = _ref4[1];

                return _react2.default.createElement(
                  'tr',
                  { key: id,
                    style: isCurrentLayer && item.id == _this2.state.selectedItemId ? styleHoverColor : null
                  },
                  _react2.default.createElement(
                    'td',
                    null,
                    '\xA0'
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle, onClick: _this2.swapVisibilityItem.bind(_this2, layerID, layer, item) },
                    _react2.default.createElement(_fa.FaEye, {
                      onClick: _this2.swapVisibilityItem.bind(_this2, layerID, layer, item),
                      style: !layer.visibleItems[item.id] ? styleEyeVisible : styleEyeHidden
                    })
                  ),
                  _react2.default.createElement(
                    'td',
                    { onClick: _this2.selectItem.bind(_this2, layerID, item) },
                    item.name
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle },
                    '\xA0'
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle },
                    _react2.default.createElement(_fa.FaTrash, {
                      onClick: function onClick(e) {
                        return _this2.delItem(e, layerID, item);
                      },
                      style: isCurrentLayer && item.id == _this2.state.selectedItemId ? styleEditButtonHover : styleEditButton,
                      title: _this2.context.translator.t('Delete')
                    })
                  )
                );
              }) : null,
              openLayers[layerID] ? layer.lines.entrySeq().map(function (_ref5) {
                var _ref6 = _slicedToArray(_ref5, 2),
                    id = _ref6[0],
                    item = _ref6[1];

                return _react2.default.createElement(
                  'tr',
                  { key: id,
                    style: isCurrentLayer && item.id == _this2.state.selectedItemId ? styleHoverColor : null
                  },
                  _react2.default.createElement(
                    'td',
                    null,
                    '\xA0'
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle, onClick: _this2.swapVisibilityItem.bind(_this2, layerID, layer, item) },
                    _react2.default.createElement(_fa.FaEye, {
                      onClick: _this2.swapVisibilityItem.bind(_this2, layerID, layer, item),
                      style: !layer.visibleItems[item.id] ? styleEyeVisible : styleEyeHidden
                    })
                  ),
                  _react2.default.createElement(
                    'td',
                    { onClick: _this2.selectItem.bind(_this2, layerID, item) },
                    item.name
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle },
                    '\xA0'
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle },
                    _react2.default.createElement(_fa.FaTrash, {
                      onClick: function onClick(e) {
                        return _this2.delItem(e, layerID, item);
                      },
                      style: isCurrentLayer && item.id == _this2.state.selectedItemId ? styleEditButtonHover : styleEditButton,
                      title: _this2.context.translator.t('Delete')
                    })
                  )
                );
              }) : null,
              openLayers[layerID] ? layer.areas.entrySeq().map(function (_ref7) {
                var _ref8 = _slicedToArray(_ref7, 2),
                    id = _ref8[0],
                    item = _ref8[1];

                return _react2.default.createElement(
                  'tr',
                  { key: id,
                    style: isCurrentLayer && item.id == _this2.state.selectedItemId ? styleHoverColor : null
                  },
                  _react2.default.createElement(
                    'td',
                    null,
                    '\xA0'
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle, onClick: _this2.swapVisibilityItem.bind(_this2, layerID, layer, item) },
                    _react2.default.createElement(_fa.FaEye, {
                      onClick: _this2.swapVisibilityItem.bind(_this2, layerID, layer, item),
                      style: !layer.visibleItems[item.id] ? styleEyeVisible : styleEyeHidden
                    })
                  ),
                  _react2.default.createElement(
                    'td',
                    { onClick: _this2.selectItem.bind(_this2, layerID, item) },
                    item.name
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle },
                    '\xA0'
                  ),
                  _react2.default.createElement(
                    'td',
                    { style: iconColStyle },
                    _react2.default.createElement(_fa.FaTrash, {
                      onClick: function onClick(e) {
                        return _this2.delItem(e, layerID, item);
                      },
                      style: isCurrentLayer && item.id == _this2.state.selectedItemId ? styleEditButtonHover : styleEditButton,
                      title: _this2.context.translator.t('Delete')
                    })
                  )
                );
              }) : null
            );
          })
        ),
        this.state.layerAddUIVisible && this.state.editingLayer ? _react2.default.createElement(
          'table',
          { style: layerInputTableStyle },
          _react2.default.createElement(
            'tbody',
            null,
            _react2.default.createElement(
              'tr',
              null,
              _react2.default.createElement(
                'td',
                { style: firstTdStyle },
                this.context.translator.t('opacity'),
                ':'
              ),
              _react2.default.createElement(
                'td',
                null,
                _react2.default.createElement(_export.FormSlider, {
                  min: 0,
                  max: 100,
                  value: Math.round(this.state.editingLayer.get('opacity') * 100),
                  onChange: function onChange(e) {
                    return _this2.setState({ editingLayer: _this2.state.editingLayer.merge({ opacity: e.target.value / 100 }) });
                  }
                })
              )
            ),
            _react2.default.createElement(
              'tr',
              null,
              _react2.default.createElement(
                'td',
                { colSpan: '2' },
                _react2.default.createElement(
                  'table',
                  { style: inputTableButtonStyle },
                  _react2.default.createElement(
                    'tbody',
                    null,
                    _react2.default.createElement(
                      'tr',
                      null,
                      _react2.default.createElement(
                        'td',
                        null,
                        _react2.default.createElement(
                          _export.CancelButton,
                          { size: 'small', onClick: function onClick(e) {
                              _this2.resetLayerMod(e);
                            } },
                          this.context.translator.t('Reset')
                        )
                      ),
                      _react2.default.createElement(
                        'td',
                        null,
                        _react2.default.createElement(
                          _export.FormSubmitButton,
                          { size: 'small', onClick: function onClick(e) {
                              _this2.updateLayer(e, _this2.state.editingLayer);
                            } },
                          this.context.translator.t('Save')
                        )
                      )
                    )
                  )
                )
              )
            )
          )
        ) : null,
        _react2.default.createElement(
          'table',
          { style: tableSearchStyle },
          _react2.default.createElement(
            'thead',
            null,
            _react2.default.createElement(
              'tr',
              null,
              _react2.default.createElement('td', null),
              _react2.default.createElement(
                'td',
                { style: { fontSize: 14, color: 'lightgreen', paddingBottom: 12 } },
                'Upload'
              ),
              _react2.default.createElement('td', null)
            )
          ),
          _react2.default.createElement(
            'tbody',
            null,
            _react2.default.createElement(
              'tr',
              null,
              _react2.default.createElement(
                'td',
                { style: { width: '15%', textAlign: 'center' } },
                _react2.default.createElement(_md.MdFileUpload, { style: searchIconStyle })
              ),
              _react2.default.createElement(
                'td',
                null,
                _react2.default.createElement(
                  'button',
                  { style: chooseCamera, onClick: this.loadFloorPlanFromFile.bind(this) },
                  ' Load Data'
                )
              ),
              _react2.default.createElement('td', null)
            )
          )
        )
      );
    }
  }]);

  return PanelLayers;
}(_react.Component);

exports.default = PanelLayers;


PanelLayers.propTypes = {
  state: _propTypes2.default.object.isRequired
};

PanelLayers.contextTypes = {
  sceneActions: _propTypes2.default.object.isRequired,
  translator: _propTypes2.default.object.isRequired,
  projectActions: _propTypes2.default.object.isRequired,
  itemsActions: _propTypes2.default.object.isRequired,
  holesActions: _propTypes2.default.object.isRequired,
  areaActions: _propTypes2.default.object.isRequired
};