"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _reselect = require("reselect");
var _lodash = require("lodash");
var _featuresSelector = _interopRequireDefault(require("./featuresSelector"));
var _sequenceLengthSelector = _interopRequireDefault(require("./sequenceLengthSelector"));
var _editorUtils = require("../utils/editorUtils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function filteredFeaturesSelector(features, seqLen, featureIndividualToHide, featureTypesToHide, lengthsToHide) {
  return (0, _lodash.omitBy)(features, function (ann) {
    var hideIndividually = featureIndividualToHide[ann.id];
    var hideFeaturesByType = featureTypesToHide[ann.type];
    return (0, _editorUtils.hideAnnByLengthFilter)(lengthsToHide, ann, seqLen) || hideFeaturesByType || hideIndividually;
  });
}
var _default = (0, _reselect.createSelector)(_featuresSelector["default"], _sequenceLengthSelector["default"], function (state) {
  return state.annotationVisibility.featureIndividualToHide;
}, function (state) {
  return state.annotationVisibility.featureTypesToHide;
}, function (state) {
  return state.featureLengthsToHide;
}, filteredFeaturesSelector);
exports["default"] = _default;
module.exports = exports.default;