"use strict";

exports.__esModule = true;
exports.deletionLayerUpdate = exports.deletionLayerDelete = exports.deletionLayerClear = exports["default"] = void 0;
var _reduxAct = require("redux-act");
var _createMetaAction = _interopRequireDefault(require("./utils/createMetaAction"));
var _omit = _interopRequireDefault(require("lodash/omit"));
var _createReducer;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
// ------------------------------------
// Actions
// ------------------------------------
var deletionLayerClear = (0, _createMetaAction["default"])("deletionLayerClear");
exports.deletionLayerClear = deletionLayerClear;
var deletionLayerUpdate = (0, _createMetaAction["default"])("DELETION_LAYER_UPDATE");
exports.deletionLayerUpdate = deletionLayerUpdate;
var deletionLayerDelete = (0, _createMetaAction["default"])("DELETION_LAYER_DELETE");

// ------------------------------------
// Reducer
// ------------------------------------
exports.deletionLayerDelete = deletionLayerDelete;
var _default = (0, _reduxAct.createReducer)((_createReducer = {}, _createReducer[deletionLayerClear] = function () {
  return {};
}, _createReducer[deletionLayerUpdate] = function (state, payload) {
  var _extends2;
  return _extends({}, state, (_extends2 = {}, _extends2[payload.id] = _extends({
    color: "firebrick",
    id: payload.id
  }, payload.range), _extends2));
}, _createReducer[deletionLayerDelete] = function (state, payload) {
  return (0, _omit["default"])(state, payload.id);
}, _createReducer), {});
exports["default"] = _default;