"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const DOMutils = require("./utils/DOMutils.js");
const allAffected = require("./utils/all-affected.js");
const is = require("./utils/is.js");
const parenting = require("./utils/parenting.js");
var getFocusabledIn = function(topNode) {
  var entries = allAffected.getAllAffectedNodes(topNode).filter(is.isNotAGuard);
  var commonParent = parenting.getTopCommonParent(topNode, topNode, entries);
  var visibilityCache = /* @__PURE__ */ new Map();
  var outerNodes = DOMutils.getTabbableNodes([commonParent], visibilityCache, true);
  var innerElements = DOMutils.getTabbableNodes(entries, visibilityCache).filter(function(_a) {
    var node = _a.node;
    return is.isNotAGuard(node);
  }).map(function(_a) {
    var node = _a.node;
    return node;
  });
  return outerNodes.map(function(_a) {
    var node = _a.node, index = _a.index;
    return {
      node,
      index,
      lockItem: innerElements.indexOf(node) >= 0,
      guard: is.isGuard(node)
    };
  });
};
exports.getFocusabledIn = getFocusabledIn;
//# sourceMappingURL=focusables.js.map
