'use strict';

var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
require('core-js/modules/es.array.filter.js');
require('core-js/modules/es.object.to-string.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _toConsumableArray__default = /*#__PURE__*/_interopDefault(_toConsumableArray);

var getKeyboardFoucusableElements = function getKeyboardFoucusableElements() {
  var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  return _toConsumableArray__default.default(element.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')).filter(function (el) {
    return !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden');
  });
};

exports.getKeyboardFoucusableElements = getKeyboardFoucusableElements;
