Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1/*!2* tabbable 6.4.03* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE4*/5'use strict';6 7// NOTE: separate `:not()` selectors has broader browser support than the newer8// `:not([inert], [inert] *)` (Feb 2023)9var candidateSelectors = ['input:not([inert]):not([inert] *)', 'select:not([inert]):not([inert] *)', 'textarea:not([inert]):not([inert] *)', 'a[href]:not([inert]):not([inert] *)', 'button:not([inert]):not([inert] *)', '[tabindex]:not(slot):not([inert]):not([inert] *)', 'audio[controls]:not([inert]):not([inert] *)', 'video[controls]:not([inert]):not([inert] *)', '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', 'details>summary:first-of-type:not([inert]):not([inert] *)', 'details:not([inert]):not([inert] *)'];10var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');11var NoElement = typeof Element === 'undefined';12var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;13var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {14 var _element$getRootNode;15 return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);16} : function (element) {17 return element === null || element === void 0 ? void 0 : element.ownerDocument;18};19 20/**21 * Determines if a node is inert or in an inert ancestor.22 * @param {Node} [node]23 * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to24 * see if any of them are inert. If false, only `node` itself is considered.25 * @returns {boolean} True if inert itself or by way of being in an inert ancestor.26 * False if `node` is falsy.27 */28var _isInert = function isInert(node, lookUp) {29 var _node$getAttribute;30 if (lookUp === void 0) {31 lookUp = true;32 }33 // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`34 // JS API property; we have to check the attribute, which can either be empty or 'true';35 // if it's `null` (not specified) or 'false', it's an active element36 var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');37 var inert = inertAtt === '' || inertAtt === 'true';38 39 // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`40 // if it weren't for `matches()` not being a function on shadow roots; the following41 // code works for any kind of node42 var result = inert || lookUp && node && (43 // closest does not exist on shadow roots, so we fall back to a manual44 // lookup upward, in case it is not defined.45 typeof node.closest === 'function' ? node.closest('[inert]') : _isInert(node.parentNode));46 return result;47};48 49/**50 * Determines if a node's content is editable.51 * @param {Element} [node]52 * @returns True if it's content-editable; false if it's not or `node` is falsy.53 */54var isContentEditable = function isContentEditable(node) {55 var _node$getAttribute2;56 // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have57 // to use the attribute directly to check for this, which can either be empty or 'true';58 // if it's `null` (not specified) or 'false', it's a non-editable element59 var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');60 return attValue === '' || attValue === 'true';61};62 63/**64 * @param {Element} el container to check in65 * @param {boolean} includeContainer add container to check66 * @param {(node: Element) => boolean} filter filter candidates67 * @returns {Element[]}68 */69var getCandidates = function getCandidates(el, includeContainer, filter) {70 // even if `includeContainer=false`, we still have to check it for inertness because71 // if it's inert (either by itself or via its parent), then all its children are inert72 if (_isInert(el)) {73 return [];74 }75 var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));76 if (includeContainer && matches.call(el, candidateSelector)) {77 candidates.unshift(el);78 }79 candidates = candidates.filter(filter);80 return candidates;81};82 83/**84 * @callback GetShadowRoot85 * @param {Element} element to check for shadow root86 * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.87 */88 89/**90 * @callback ShadowRootFilter91 * @param {Element} shadowHostNode the element which contains shadow content92 * @returns {boolean} true if a shadow root could potentially contain valid candidates.93 */94 95/**96 * @typedef {Object} CandidateScope97 * @property {Element} scopeParent contains inner candidates98 * @property {Element[]} candidates list of candidates found in the scope parent99 */100 101/**102 * @typedef {Object} IterativeOptions103 * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;104 * if a function, implies shadow support is enabled and either returns the shadow root of an element105 * or a boolean stating if it has an undisclosed shadow root106 * @property {(node: Element) => boolean} filter filter candidates107 * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list108 * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;109 */110 111/**112 * @param {Element[]} elements list of element containers to match candidates from113 * @param {boolean} includeContainer add container list to check114 * @param {IterativeOptions} options115 * @returns {Array.<Element|CandidateScope>}116 */117var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {118 var candidates = [];119 var elementsToCheck = Array.from(elements);120 while (elementsToCheck.length) {121 var element = elementsToCheck.shift();122 if (_isInert(element, false)) {123 // no need to look up since we're drilling down124 // anything inside this container will also be inert125 continue;126 }127 if (element.tagName === 'SLOT') {128 // add shadow dom slot scope (slot itself cannot be focusable)129 var assigned = element.assignedElements();130 var content = assigned.length ? assigned : element.children;131 var nestedCandidates = _getCandidatesIteratively(content, true, options);132 if (options.flatten) {133 candidates.push.apply(candidates, nestedCandidates);134 } else {135 candidates.push({136 scopeParent: element,137 candidates: nestedCandidates138 });139 }140 } else {141 // check candidate element142 var validCandidate = matches.call(element, candidateSelector);143 if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {144 candidates.push(element);145 }146 147 // iterate over shadow content if possible148 var shadowRoot = element.shadowRoot ||149 // check for an undisclosed shadow150 typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);151 152 // no inert look up because we're already drilling down and checking for inertness153 // on the way down, so all containers to this root node should have already been154 // vetted as non-inert155 var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));156 if (shadowRoot && validShadowRoot) {157 // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed158 // shadow exists, so look at light dom children as fallback BUT create a scope for any159 // child candidates found because they're likely slotted elements (elements that are160 // children of the web component element (which has the shadow), in the light dom, but161 // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,162 // _after_ we return from this recursive call163 var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);164 if (options.flatten) {165 candidates.push.apply(candidates, _nestedCandidates);166 } else {167 candidates.push({168 scopeParent: element,169 candidates: _nestedCandidates170 });171 }172 } else {173 // there's not shadow so just dig into the element's (light dom) children174 // __without__ giving the element special scope treatment175 elementsToCheck.unshift.apply(elementsToCheck, element.children);176 }177 }178 }179 return candidates;180};181 182/**183 * @private184 * Determines if the node has an explicitly specified `tabindex` attribute.185 * @param {HTMLElement} node186 * @returns {boolean} True if so; false if not.187 */188var hasTabIndex = function hasTabIndex(node) {189 return !isNaN(parseInt(node.getAttribute('tabindex'), 10));190};191 192/**193 * Determine the tab index of a given node.194 * @param {HTMLElement} node195 * @returns {number} Tab order (negative, 0, or positive number).196 * @throws {Error} If `node` is falsy.197 */198var getTabIndex = function getTabIndex(node) {199 if (!node) {200 throw new Error('No node provided');201 }202 if (node.tabIndex < 0) {203 // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default204 // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,205 // yet they are still part of the regular tab order; in FF, they get a default206 // `tabIndex` of 0; since Chrome still puts those elements in the regular tab207 // order, consider their tab index to be 0.208 // Also browsers do not return `tabIndex` correctly for contentEditable nodes;209 // so if they don't have a tabindex attribute specifically set, assume it's 0.210 if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {211 return 0;212 }213 }214 return node.tabIndex;215};216 217/**218 * Determine the tab index of a given node __for sort order purposes__.219 * @param {HTMLElement} node220 * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,221 * has tabIndex -1, but needs to be sorted by document order in order for its content to be222 * inserted into the correct sort position.223 * @returns {number} Tab order (negative, 0, or positive number).224 */225var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {226 var tabIndex = getTabIndex(node);227 if (tabIndex < 0 && isScope && !hasTabIndex(node)) {228 return 0;229 }230 return tabIndex;231};232var sortOrderedTabbables = function sortOrderedTabbables(a, b) {233 return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;234};235var isInput = function isInput(node) {236 return node.tagName === 'INPUT';237};238var isHiddenInput = function isHiddenInput(node) {239 return isInput(node) && node.type === 'hidden';240};241var isDetailsWithSummary = function isDetailsWithSummary(node) {242 var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {243 return child.tagName === 'SUMMARY';244 });245 return r;246};247var getCheckedRadio = function getCheckedRadio(nodes, form) {248 for (var i = 0; i < nodes.length; i++) {249 if (nodes[i].checked && nodes[i].form === form) {250 return nodes[i];251 }252 }253};254var isTabbableRadio = function isTabbableRadio(node) {255 if (!node.name) {256 return true;257 }258 var radioScope = node.form || getRootNode(node);259 var queryRadios = function queryRadios(name) {260 return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');261 };262 var radioSet;263 if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {264 radioSet = queryRadios(window.CSS.escape(node.name));265 } else {266 try {267 radioSet = queryRadios(node.name);268 } catch (err) {269 // eslint-disable-next-line no-console270 console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);271 return false;272 }273 }274 var checked = getCheckedRadio(radioSet, node.form);275 return !checked || checked === node;276};277var isRadio = function isRadio(node) {278 return isInput(node) && node.type === 'radio';279};280var isNonTabbableRadio = function isNonTabbableRadio(node) {281 return isRadio(node) && !isTabbableRadio(node);282};283 284// determines if a node is ultimately attached to the window's document285var isNodeAttached = function isNodeAttached(node) {286 var _nodeRoot;287 // The root node is the shadow root if the node is in a shadow DOM; some document otherwise288 // (but NOT _the_ document; see second 'If' comment below for more).289 // If rootNode is shadow root, it'll have a host, which is the element to which the shadow290 // is attached, and the one we need to check if it's in the document or not (because the291 // shadow, and all nodes it contains, is never considered in the document since shadows292 // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,293 // is hidden, or is not in the document itself but is detached, it will affect the shadow's294 // visibility, including all the nodes it contains). The host could be any normal node,295 // or a custom element (i.e. web component). Either way, that's the one that is considered296 // part of the document, not the shadow root, nor any of its children (i.e. the node being297 // tested).298 // To further complicate things, we have to look all the way up until we find a shadow HOST299 // that is attached (or find none) because the node might be in nested shadows...300 // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the301 // document (per the docs) and while it's a Document-type object, that document does not302 // appear to be the same as the node's `ownerDocument` for some reason, so it's safer303 // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,304 // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when305 // node is actually detached.306 // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible307 // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed308 // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then309 // `ownerDocument` will be `null`, hence the optional chaining on it.310 var nodeRoot = node && getRootNode(node);311 var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;312 313 // in some cases, a detached node will return itself as the root instead of a document or314 // shadow root object, in which case, we shouldn't try to look further up the host chain315 var attached = false;316 if (nodeRoot && nodeRoot !== node) {317 var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;318 attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));319 while (!attached && nodeRootHost) {320 var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;321 // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,322 // which means we need to get the host's host and check if that parent host is contained323 // in (i.e. attached to) the document324 nodeRoot = getRootNode(nodeRootHost);325 nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;326 attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));327 }328 }329 return attached;330};331var isZeroArea = function isZeroArea(node) {332 var _node$getBoundingClie = node.getBoundingClientRect(),333 width = _node$getBoundingClie.width,334 height = _node$getBoundingClie.height;335 return width === 0 && height === 0;336};337var isHidden = function isHidden(node, _ref) {338 var displayCheck = _ref.displayCheck,339 getShadowRoot = _ref.getShadowRoot;340 if (displayCheck === 'full-native') {341 if ('checkVisibility' in node) {342 // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4343 // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility344 var visible = node.checkVisibility({345 // Checking opacity might be desirable for some use cases, but natively,346 // opacity zero elements _are_ focusable and tabbable.347 checkOpacity: false,348 opacityProperty: false,349 contentVisibilityAuto: true,350 visibilityProperty: true,351 // This is an alias for `visibilityProperty`. Contemporary browsers352 // support both. However, this alias has wider browser support (Chrome353 // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so354 // we include it anyway.355 checkVisibilityCSS: true356 });357 return !visible;358 }359 // Fall through to manual visibility checks360 }361 362 // NOTE: visibility will be `undefined` if node is detached from the document363 // (see notes about this further down), which means we will consider it visible364 // (this is legacy behavior from a very long way back)365 // NOTE: we check this regardless of `displayCheck="none"` because this is a366 // _visibility_ check, not a _display_ check367 if (getComputedStyle(node).visibility === 'hidden') {368 return true;369 }370 var isDirectSummary = matches.call(node, 'details>summary:first-of-type');371 var nodeUnderDetails = isDirectSummary ? node.parentElement : node;372 if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {373 return true;374 }375 if (!displayCheck || displayCheck === 'full' ||376 // full-native can run this branch when it falls through in case377 // Element#checkVisibility is unsupported378 displayCheck === 'full-native' || displayCheck === 'legacy-full') {379 if (typeof getShadowRoot === 'function') {380 // figure out if we should consider the node to be in an undisclosed shadow and use the381 // 'non-zero-area' fallback382 var originalNode = node;383 while (node) {384 var parentElement = node.parentElement;385 var rootNode = getRootNode(node);386 if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow387 ) {388 // node has an undisclosed shadow which means we can only treat it as a black box, so we389 // fall back to a non-zero-area test390 return isZeroArea(node);391 } else if (node.assignedSlot) {392 // iterate up slot393 node = node.assignedSlot;394 } else if (!parentElement && rootNode !== node.ownerDocument) {395 // cross shadow boundary396 node = rootNode.host;397 } else {398 // iterate up normal dom399 node = parentElement;400 }401 }402 node = originalNode;403 }404 // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support405 // (i.e. it does not also presume that all nodes might have undisclosed shadows); or406 // it might be a falsy value, which means shadow DOM support is disabled407 408 // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)409 // now we can just test to see if it would normally be visible or not, provided it's410 // attached to the main document.411 // NOTE: We must consider case where node is inside a shadow DOM and given directly to412 // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.413 414 if (isNodeAttached(node)) {415 // this works wherever the node is: if there's at least one client rect, it's416 // somehow displayed; it also covers the CSS 'display: contents' case where the417 // node itself is hidden in place of its contents; and there's no need to search418 // up the hierarchy either419 return !node.getClientRects().length;420 }421 422 // Else, the node isn't attached to the document, which means the `getClientRects()`423 // API will __always__ return zero rects (this can happen, for example, if React424 // is used to render nodes onto a detached tree, as confirmed in this thread:425 // https://github.com/facebook/react/issues/9117#issuecomment-284228870)426 //427 // It also means that even window.getComputedStyle(node).display will return `undefined`428 // because styles are only computed for nodes that are in the document.429 //430 // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable431 // somehow. Though it was never stated officially, anyone who has ever used tabbable432 // APIs on nodes in detached containers has actually implicitly used tabbable in what433 // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially434 // considering __everything__ to be visible because of the innability to determine styles.435 //436 // v6.0.0: As of this major release, the default 'full' option __no longer treats detached437 // nodes as visible with the 'none' fallback.__438 if (displayCheck !== 'legacy-full') {439 return true; // hidden440 }441 // else, fallback to 'none' mode and consider the node visible442 } else if (displayCheck === 'non-zero-area') {443 // NOTE: Even though this tests that the node's client rect is non-zero to determine444 // whether it's displayed, and that a detached node will __always__ have a zero-area445 // client rect, we don't special-case for whether the node is attached or not. In446 // this mode, we do want to consider nodes that have a zero area to be hidden at all447 // times, and that includes attached or not.448 return isZeroArea(node);449 }450 451 // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume452 // it's visible453 return false;454};455 456// form fields (nested) inside a disabled fieldset are not focusable/tabbable457// unless they are in the _first_ <legend> element of the top-most disabled458// fieldset459var isDisabledFromFieldset = function isDisabledFromFieldset(node) {460 if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {461 var parentNode = node.parentElement;462 // check if `node` is contained in a disabled <fieldset>463 while (parentNode) {464 if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {465 // look for the first <legend> among the children of the disabled <fieldset>466 for (var i = 0; i < parentNode.children.length; i++) {467 var child = parentNode.children.item(i);468 // when the first <legend> (in document order) is found469 if (child.tagName === 'LEGEND') {470 // if its parent <fieldset> is not nested in another disabled <fieldset>,471 // return whether `node` is a descendant of its first <legend>472 return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);473 }474 }475 // the disabled <fieldset> containing `node` has no <legend>476 return true;477 }478 parentNode = parentNode.parentElement;479 }480 }481 482 // else, node's tabbable/focusable state should not be affected by a fieldset's483 // enabled/disabled state484 return false;485};486var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {487 if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||488 // For a details element with a summary, the summary element gets the focus489 isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {490 return false;491 }492 return true;493};494var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {495 if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {496 return false;497 }498 return true;499};500var isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {501 var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);502 if (isNaN(tabIndex) || tabIndex >= 0) {503 return true;504 }505 // If a custom element has an explicit negative tabindex,506 // browsers will not allow tab targeting said element's children.507 return false;508};509 510/**511 * @param {Array.<Element|CandidateScope>} candidates512 * @returns Element[]513 */514var _sortByOrder = function sortByOrder(candidates) {515 var regularTabbables = [];516 var orderedTabbables = [];517 candidates.forEach(function (item, i) {518 var isScope = !!item.scopeParent;519 var element = isScope ? item.scopeParent : item;520 var candidateTabindex = getSortOrderTabIndex(element, isScope);521 var elements = isScope ? _sortByOrder(item.candidates) : element;522 if (candidateTabindex === 0) {523 isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);524 } else {525 orderedTabbables.push({526 documentOrder: i,527 tabIndex: candidateTabindex,528 item: item,529 isScope: isScope,530 content: elements531 });532 }533 });534 return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {535 sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);536 return acc;537 }, []).concat(regularTabbables);538};539var tabbable = function tabbable(container, options) {540 options = options || {};541 var candidates;542 if (options.getShadowRoot) {543 candidates = _getCandidatesIteratively([container], options.includeContainer, {544 filter: isNodeMatchingSelectorTabbable.bind(null, options),545 flatten: false,546 getShadowRoot: options.getShadowRoot,547 shadowRootFilter: isShadowRootTabbable548 });549 } else {550 candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));551 }552 return _sortByOrder(candidates);553};554var focusable = function focusable(container, options) {555 options = options || {};556 var candidates;557 if (options.getShadowRoot) {558 candidates = _getCandidatesIteratively([container], options.includeContainer, {559 filter: isNodeMatchingSelectorFocusable.bind(null, options),560 flatten: true,561 getShadowRoot: options.getShadowRoot562 });563 } else {564 candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));565 }566 return candidates;567};568var isTabbable = function isTabbable(node, options) {569 options = options || {};570 if (!node) {571 throw new Error('No node provided');572 }573 if (matches.call(node, candidateSelector) === false) {574 return false;575 }576 return isNodeMatchingSelectorTabbable(options, node);577};578var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe:not([inert]):not([inert] *)').join(',');579var isFocusable = function isFocusable(node, options) {580 options = options || {};581 if (!node) {582 throw new Error('No node provided');583 }584 if (matches.call(node, focusableCandidateSelector) === false) {585 return false;586 }587 return isNodeMatchingSelectorFocusable(options, node);588};589 590exports.focusable = focusable;591exports.getTabIndex = getTabIndex;592exports.isFocusable = isFocusable;593exports.isTabbable = isTabbable;594exports.tabbable = tabbable;595//# sourceMappingURL=index.js.map596 