From c608dcde5d708b8a731c905f5461ccd6dd01ceb3 Mon Sep 17 00:00:00 2001 From: radmanplays Date: Tue, 5 Mar 2024 10:42:01 +0330 Subject: [PATCH] add searching --- docs/.vitepress/cache/deps/@theme_index.js | 46 +- docs/.vitepress/cache/deps/_metadata.json | 32 +- ...ess___@vueuse_integrations_useFocusTrap.js | 1093 ++ ...__@vueuse_integrations_useFocusTrap.js.map | 7 + .../vitepress___mark__js_src_vanilla__js.js | 1665 +++ ...itepress___mark__js_src_vanilla__js.js.map | 7 + .../cache/deps/vitepress___minisearch.js | 1856 +++ .../cache/deps/vitepress___minisearch.js.map | 7 + .../deps_temp_8aecc3e0/chunk-IMASPWRS.js | 11377 ++++++++++++++++ .../deps_temp_8aecc3e0/chunk-IMASPWRS.js.map | 7 + .../deps_temp_8aecc3e0/chunk-QXV7JJUW.js | 8965 ++++++++++++ .../deps_temp_8aecc3e0/chunk-QXV7JJUW.js.map | 7 + .../cache/deps_temp_8aecc3e0/package.json | 3 + .../vitepress___@vue_devtools-api.js | 2526 ++++ .../vitepress___@vue_devtools-api.js.map | 7 + .../vitepress___@vueuse_core.js | 563 + .../vitepress___@vueuse_core.js.map | 7 + ...ess___@vueuse_integrations_useFocusTrap.js | 1093 ++ ...__@vueuse_integrations_useFocusTrap.js.map | 7 + .../vitepress___mark__js_src_vanilla__js.js | 1665 +++ ...itepress___mark__js_src_vanilla__js.js.map | 7 + .../vitepress___minisearch.js | 1856 +++ .../vitepress___minisearch.js.map | 7 + .../cache/deps_temp_8aecc3e0/vue.js | 323 + .../cache/deps_temp_8aecc3e0/vue.js.map | 7 + docs/.vitepress/config.ts | 4 + 26 files changed, 33114 insertions(+), 30 deletions(-) create mode 100644 docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js create mode 100644 docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map create mode 100644 docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js create mode 100644 docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map create mode 100644 docs/.vitepress/cache/deps/vitepress___minisearch.js create mode 100644 docs/.vitepress/cache/deps/vitepress___minisearch.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/chunk-IMASPWRS.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/chunk-IMASPWRS.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/chunk-QXV7JJUW.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/chunk-QXV7JJUW.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/package.json create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___@vue_devtools-api.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___@vue_devtools-api.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___@vueuse_core.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___@vueuse_core.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___@vueuse_integrations_useFocusTrap.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___@vueuse_integrations_useFocusTrap.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___mark__js_src_vanilla__js.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___mark__js_src_vanilla__js.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___minisearch.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vitepress___minisearch.js.map create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vue.js create mode 100644 docs/.vitepress/cache/deps_temp_8aecc3e0/vue.js.map diff --git a/docs/.vitepress/cache/deps/@theme_index.js b/docs/.vitepress/cache/deps/@theme_index.js index 21927a1..9d2c3e2 100644 --- a/docs/.vitepress/cache/deps/@theme_index.js +++ b/docs/.vitepress/cache/deps/@theme_index.js @@ -9,31 +9,31 @@ import { } from "./chunk-IMASPWRS.js"; // node_modules/vitepress/dist/client/theme-default/index.js -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/fonts.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/fonts.css"; // node_modules/vitepress/dist/client/theme-default/without-fonts.js -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/vars.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/base.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/utils.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css"; -import "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css"; -import VPBadge from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; -import Layout from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/Layout.vue"; -import { default as default2 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; -import { default as default3 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue"; -import { default as default4 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue"; -import { default as default5 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue"; -import { default as default6 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue"; -import { default as default7 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue"; -import { default as default8 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue"; -import { default as default9 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue"; -import { default as default10 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue"; -import { default as default11 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue"; -import { default as default12 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue"; -import { default as default13 } from "C:/Users/HOME/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/vars.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/base.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/utils.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css"; +import "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css"; +import VPBadge from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; +import Layout from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/Layout.vue"; +import { default as default2 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; +import { default as default3 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue"; +import { default as default4 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue"; +import { default as default5 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue"; +import { default as default6 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue"; +import { default as default7 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue"; +import { default as default8 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue"; +import { default as default9 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue"; +import { default as default10 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue"; +import { default as default11 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue"; +import { default as default12 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue"; +import { default as default13 } from "C:/Users/Home/Documents/GitHub/eaglerforge.github.io/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue"; // node_modules/vitepress/dist/client/shared.js var inBrowser = typeof document !== "undefined"; diff --git a/docs/.vitepress/cache/deps/_metadata.json b/docs/.vitepress/cache/deps/_metadata.json index b4f2c09..2f9f2d3 100644 --- a/docs/.vitepress/cache/deps/_metadata.json +++ b/docs/.vitepress/cache/deps/_metadata.json @@ -1,31 +1,49 @@ { - "hash": "4b0757b2", - "configHash": "fc81c693", + "hash": "ad520fb1", + "configHash": "cddd562f", "lockfileHash": "7c5de84f", - "browserHash": "a630f1bf", + "browserHash": "13d1902a", "optimized": { "vue": { "src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "76637531", + "fileHash": "5bd94b37", "needsInterop": false }, "vitepress > @vue/devtools-api": { "src": "../../../../node_modules/@vue/devtools-api/dist/index.js", "file": "vitepress___@vue_devtools-api.js", - "fileHash": "23b35625", + "fileHash": "6fd54c91", "needsInterop": false }, "vitepress > @vueuse/core": { "src": "../../../../node_modules/@vueuse/core/index.mjs", "file": "vitepress___@vueuse_core.js", - "fileHash": "b4a83756", + "fileHash": "03ca4cda", + "needsInterop": false + }, + "vitepress > @vueuse/integrations/useFocusTrap": { + "src": "../../../../node_modules/@vueuse/integrations/useFocusTrap.mjs", + "file": "vitepress___@vueuse_integrations_useFocusTrap.js", + "fileHash": "3e3aa1af", + "needsInterop": false + }, + "vitepress > mark.js/src/vanilla.js": { + "src": "../../../../node_modules/mark.js/src/vanilla.js", + "file": "vitepress___mark__js_src_vanilla__js.js", + "fileHash": "9a8969de", + "needsInterop": false + }, + "vitepress > minisearch": { + "src": "../../../../node_modules/minisearch/dist/es/index.js", + "file": "vitepress___minisearch.js", + "fileHash": "2fc2c1b1", "needsInterop": false }, "@theme/index": { "src": "../../../../node_modules/vitepress/dist/client/theme-default/index.js", "file": "@theme_index.js", - "fileHash": "388cf2b0", + "fileHash": "0ebc615e", "needsInterop": false } }, diff --git a/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js b/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js new file mode 100644 index 0000000..a62d92a --- /dev/null +++ b/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js @@ -0,0 +1,1093 @@ +import { + tryOnScopeDispose, + unrefElement +} from "./chunk-QXV7JJUW.js"; +import { + ref, + watch +} from "./chunk-IMASPWRS.js"; + +// node_modules/tabbable/dist/index.esm.js +var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"]; +var candidateSelector = candidateSelectors.join(","); +var NoElement = typeof Element === "undefined"; +var matches = NoElement ? function() { +} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; +var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + var _element$getRootNode; + return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element); +} : function(element) { + return element === null || element === void 0 ? void 0 : element.ownerDocument; +}; +var isInert = function isInert2(node, lookUp) { + var _node$getAttribute; + if (lookUp === void 0) { + lookUp = true; + } + 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"); + var inert = inertAtt === "" || inertAtt === "true"; + var result = inert || lookUp && node && isInert2(node.parentNode); + return result; +}; +var isContentEditable = function isContentEditable2(node) { + var _node$getAttribute2; + 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"); + return attValue === "" || attValue === "true"; +}; +var getCandidates = function getCandidates2(el, includeContainer, filter) { + if (isInert(el)) { + return []; + } + var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); + if (includeContainer && matches.call(el, candidateSelector)) { + candidates.unshift(el); + } + candidates = candidates.filter(filter); + return candidates; +}; +var getCandidatesIteratively = function getCandidatesIteratively2(elements, includeContainer, options) { + var candidates = []; + var elementsToCheck = Array.from(elements); + while (elementsToCheck.length) { + var element = elementsToCheck.shift(); + if (isInert(element, false)) { + continue; + } + if (element.tagName === "SLOT") { + var assigned = element.assignedElements(); + var content = assigned.length ? assigned : element.children; + var nestedCandidates = getCandidatesIteratively2(content, true, options); + if (options.flatten) { + candidates.push.apply(candidates, nestedCandidates); + } else { + candidates.push({ + scopeParent: element, + candidates: nestedCandidates + }); + } + } else { + var validCandidate = matches.call(element, candidateSelector); + if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) { + candidates.push(element); + } + var shadowRoot = element.shadowRoot || // check for an undisclosed shadow + typeof options.getShadowRoot === "function" && options.getShadowRoot(element); + var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element)); + if (shadowRoot && validShadowRoot) { + var _nestedCandidates = getCandidatesIteratively2(shadowRoot === true ? element.children : shadowRoot.children, true, options); + if (options.flatten) { + candidates.push.apply(candidates, _nestedCandidates); + } else { + candidates.push({ + scopeParent: element, + candidates: _nestedCandidates + }); + } + } else { + elementsToCheck.unshift.apply(elementsToCheck, element.children); + } + } + } + return candidates; +}; +var hasTabIndex = function hasTabIndex2(node) { + return !isNaN(parseInt(node.getAttribute("tabindex"), 10)); +}; +var getTabIndex = function getTabIndex2(node) { + if (!node) { + throw new Error("No node provided"); + } + if (node.tabIndex < 0) { + if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) { + return 0; + } + } + return node.tabIndex; +}; +var getSortOrderTabIndex = function getSortOrderTabIndex2(node, isScope) { + var tabIndex = getTabIndex(node); + if (tabIndex < 0 && isScope && !hasTabIndex(node)) { + return 0; + } + return tabIndex; +}; +var sortOrderedTabbables = function sortOrderedTabbables2(a, b) { + return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex; +}; +var isInput = function isInput2(node) { + return node.tagName === "INPUT"; +}; +var isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; +}; +var isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; +}; +var getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } +}; +var isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; +}; +var isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; +}; +var isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); +}; +var isNodeAttached = function isNodeAttached2(node) { + var _nodeRoot; + var nodeRoot = node && getRootNode(node); + var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host; + var attached = false; + if (nodeRoot && nodeRoot !== node) { + var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument; + 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)); + while (!attached && nodeRootHost) { + var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD; + nodeRoot = getRootNode(nodeRootHost); + nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host; + attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost)); + } + } + return attached; +}; +var isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; +}; +var isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + if (!displayCheck || displayCheck === "full" || displayCheck === "legacy-full") { + if (typeof getShadowRoot === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (isNodeAttached(node)) { + return !node.getClientRects().length; + } + if (displayCheck !== "legacy-full") { + return true; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; +}; +var isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; +}; +var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor + // because we're limited in the type of selectors we can use in JSDom (see related + // note related to `candidateSelectors`) + isInert(node) || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; +}; +var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; +}; +var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNode) { + var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); + if (isNaN(tabIndex) || tabIndex >= 0) { + return true; + } + return false; +}; +var sortByOrder = function sortByOrder2(candidates) { + var regularTabbables = []; + var orderedTabbables = []; + candidates.forEach(function(item, i) { + var isScope = !!item.scopeParent; + var element = isScope ? item.scopeParent : item; + var candidateTabindex = getSortOrderTabIndex(element, isScope); + var elements = isScope ? sortByOrder2(item.candidates) : element; + if (candidateTabindex === 0) { + isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); + } else { + orderedTabbables.push({ + documentOrder: i, + tabIndex: candidateTabindex, + item, + isScope, + content: elements + }); + } + }); + return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { + sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); + return acc; + }, []).concat(regularTabbables); +}; +var tabbable = function tabbable2(container, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = getCandidatesIteratively([container], options.includeContainer, { + filter: isNodeMatchingSelectorTabbable.bind(null, options), + flatten: false, + getShadowRoot: options.getShadowRoot, + shadowRootFilter: isValidShadowRootTabbable + }); + } else { + candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options)); + } + return sortByOrder(candidates); +}; +var focusable = function focusable2(container, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = getCandidatesIteratively([container], options.includeContainer, { + filter: isNodeMatchingSelectorFocusable.bind(null, options), + flatten: true, + getShadowRoot: options.getShadowRoot + }); + } else { + candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options)); + } + return candidates; +}; +var isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); +}; +var focusableCandidateSelector = candidateSelectors.concat("iframe").join(","); +var isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); +}; + +// node_modules/focus-trap/dist/focus-trap.esm.js +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); +} +function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); +} +var activeFocusTraps = { + activateTrap: function activateTrap(trapStack, trap) { + if (trapStack.length > 0) { + var activeTrap = trapStack[trapStack.length - 1]; + if (activeTrap !== trap) { + activeTrap.pause(); + } + } + var trapIndex = trapStack.indexOf(trap); + if (trapIndex === -1) { + trapStack.push(trap); + } else { + trapStack.splice(trapIndex, 1); + trapStack.push(trap); + } + }, + deactivateTrap: function deactivateTrap(trapStack, trap) { + var trapIndex = trapStack.indexOf(trap); + if (trapIndex !== -1) { + trapStack.splice(trapIndex, 1); + } + if (trapStack.length > 0) { + trapStack[trapStack.length - 1].unpause(); + } + } +}; +var isSelectableInput = function isSelectableInput2(node) { + return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function"; +}; +var isEscapeEvent = function isEscapeEvent2(e) { + return (e === null || e === void 0 ? void 0 : e.key) === "Escape" || (e === null || e === void 0 ? void 0 : e.key) === "Esc" || (e === null || e === void 0 ? void 0 : e.keyCode) === 27; +}; +var isTabEvent = function isTabEvent2(e) { + return (e === null || e === void 0 ? void 0 : e.key) === "Tab" || (e === null || e === void 0 ? void 0 : e.keyCode) === 9; +}; +var isKeyForward = function isKeyForward2(e) { + return isTabEvent(e) && !e.shiftKey; +}; +var isKeyBackward = function isKeyBackward2(e) { + return isTabEvent(e) && e.shiftKey; +}; +var delay = function delay2(fn) { + return setTimeout(fn, 0); +}; +var findIndex = function findIndex2(arr, fn) { + var idx = -1; + arr.every(function(value, i) { + if (fn(value)) { + idx = i; + return false; + } + return true; + }); + return idx; +}; +var valueOrHandler = function valueOrHandler2(value) { + for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + params[_key - 1] = arguments[_key]; + } + return typeof value === "function" ? value.apply(void 0, params) : value; +}; +var getActualTarget = function getActualTarget2(event) { + return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target; +}; +var internalTrapStack = []; +var createFocusTrap = function createFocusTrap2(elements, userOptions) { + var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document; + var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack; + var config = _objectSpread2({ + returnFocusOnDeactivate: true, + escapeDeactivates: true, + delayInitialFocus: true, + isKeyForward, + isKeyBackward + }, userOptions); + var state = { + // containers given to createFocusTrap() + // @type {Array} + containers: [], + // list of objects identifying tabbable nodes in `containers` in the trap + // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap + // is active, but the trap should never get to a state where there isn't at least one group + // with at least one tabbable node in it (that would lead to an error condition that would + // result in an error being thrown) + // @type {Array<{ + // container: HTMLElement, + // tabbableNodes: Array, // empty if none + // focusableNodes: Array, // empty if none + // posTabIndexesFound: boolean, + // firstTabbableNode: HTMLElement|undefined, + // lastTabbableNode: HTMLElement|undefined, + // firstDomTabbableNode: HTMLElement|undefined, + // lastDomTabbableNode: HTMLElement|undefined, + // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined + // }>} + containerGroups: [], + // same order/length as `containers` list + // references to objects in `containerGroups`, but only those that actually have + // tabbable nodes in them + // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__ + // the same length + tabbableGroups: [], + nodeFocusedBeforeActivation: null, + mostRecentlyFocusedNode: null, + active: false, + paused: false, + // timer ID for when delayInitialFocus is true and initial focus in this trap + // has been delayed during activation + delayInitialFocusTimer: void 0, + // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any + recentNavEvent: void 0 + }; + var trap; + var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) { + return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName]; + }; + var findContainerIndex = function findContainerIndex2(element, event) { + var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === "function" ? event.composedPath() : void 0; + return state.containerGroups.findIndex(function(_ref) { + var container = _ref.container, tabbableNodes = _ref.tabbableNodes; + return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any + // web components if the `tabbableOptions.getShadowRoot` option was used for + // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't + // look inside web components even if open) + (composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function(node) { + return node === element; + }); + }); + }; + var getNodeForOption = function getNodeForOption2(optionName) { + var optionValue = config[optionName]; + if (typeof optionValue === "function") { + for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + params[_key2 - 1] = arguments[_key2]; + } + optionValue = optionValue.apply(void 0, params); + } + if (optionValue === true) { + optionValue = void 0; + } + if (!optionValue) { + if (optionValue === void 0 || optionValue === false) { + return optionValue; + } + throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node")); + } + var node = optionValue; + if (typeof optionValue === "string") { + node = doc.querySelector(optionValue); + if (!node) { + throw new Error("`".concat(optionName, "` as selector refers to no known node")); + } + } + return node; + }; + var getInitialFocusNode = function getInitialFocusNode2() { + var node = getNodeForOption("initialFocus"); + if (node === false) { + return false; + } + if (node === void 0 || !isFocusable(node, config.tabbableOptions)) { + if (findContainerIndex(doc.activeElement) >= 0) { + node = doc.activeElement; + } else { + var firstTabbableGroup = state.tabbableGroups[0]; + var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; + node = firstTabbableNode || getNodeForOption("fallbackFocus"); + } + } + if (!node) { + throw new Error("Your focus-trap needs to have at least one focusable element"); + } + return node; + }; + var updateTabbableNodes = function updateTabbableNodes2() { + state.containerGroups = state.containers.map(function(container) { + var tabbableNodes = tabbable(container, config.tabbableOptions); + var focusableNodes = focusable(container, config.tabbableOptions); + var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : void 0; + var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : void 0; + var firstDomTabbableNode = focusableNodes.find(function(node) { + return isTabbable(node); + }); + var lastDomTabbableNode = focusableNodes.slice().reverse().find(function(node) { + return isTabbable(node); + }); + var posTabIndexesFound = !!tabbableNodes.find(function(node) { + return getTabIndex(node) > 0; + }); + return { + container, + tabbableNodes, + focusableNodes, + /** True if at least one node with positive `tabindex` was found in this container. */ + posTabIndexesFound, + /** First tabbable node in container, __tabindex__ order; `undefined` if none. */ + firstTabbableNode, + /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */ + lastTabbableNode, + // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out + // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition + // because that API doesn't work with Shadow DOM as well as it should (@see + // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far, + // to address an edge case related to positive tabindex support, this seems like a much easier, + // "close enough most of the time" alternative for positive tabindexes which should generally + // be avoided anyway... + /** First tabbable node in container, __DOM__ order; `undefined` if none. */ + firstDomTabbableNode, + /** Last tabbable node in container, __DOM__ order; `undefined` if none. */ + lastDomTabbableNode, + /** + * Finds the __tabbable__ node that follows the given node in the specified direction, + * in this container, if any. + * @param {HTMLElement} node + * @param {boolean} [forward] True if going in forward tab order; false if going + * in reverse. + * @returns {HTMLElement|undefined} The next tabbable node, if any. + */ + nextTabbableNode: function nextTabbableNode(node) { + var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var nodeIdx = tabbableNodes.indexOf(node); + if (nodeIdx < 0) { + if (forward) { + return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function(el) { + return isTabbable(el); + }); + } + return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function(el) { + return isTabbable(el); + }); + } + return tabbableNodes[nodeIdx + (forward ? 1 : -1)]; + } + }; + }); + state.tabbableGroups = state.containerGroups.filter(function(group) { + return group.tabbableNodes.length > 0; + }); + if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) { + throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times"); + } + if (state.containerGroups.find(function(g) { + return g.posTabIndexesFound; + }) && state.containerGroups.length > 1) { + throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps."); + } + }; + var getActiveElement = function getActiveElement2(el) { + var activeElement = el.activeElement; + if (!activeElement) { + return; + } + if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) { + return getActiveElement2(activeElement.shadowRoot); + } + return activeElement; + }; + var tryFocus = function tryFocus2(node) { + if (node === false) { + return; + } + if (node === getActiveElement(document)) { + return; + } + if (!node || !node.focus) { + tryFocus2(getInitialFocusNode()); + return; + } + node.focus({ + preventScroll: !!config.preventScroll + }); + state.mostRecentlyFocusedNode = node; + if (isSelectableInput(node)) { + node.select(); + } + }; + var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) { + var node = getNodeForOption("setReturnFocus", previousActiveElement); + return node ? node : node === false ? false : previousActiveElement; + }; + var findNextNavNode = function findNextNavNode2(_ref2) { + var target = _ref2.target, event = _ref2.event, _ref2$isBackward = _ref2.isBackward, isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward; + target = target || getActualTarget(event); + updateTabbableNodes(); + var destinationNode = null; + if (state.tabbableGroups.length > 0) { + var containerIndex = findContainerIndex(target, event); + var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0; + if (containerIndex < 0) { + if (isBackward) { + destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode; + } else { + destinationNode = state.tabbableGroups[0].firstTabbableNode; + } + } else if (isBackward) { + var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) { + var firstTabbableNode = _ref3.firstTabbableNode; + return target === firstTabbableNode; + }); + if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) { + startOfGroupIndex = containerIndex; + } + if (startOfGroupIndex >= 0) { + var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1; + var destinationGroup = state.tabbableGroups[destinationGroupIndex]; + destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode; + } else if (!isTabEvent(event)) { + destinationNode = containerGroup.nextTabbableNode(target, false); + } + } else { + var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref4) { + var lastTabbableNode = _ref4.lastTabbableNode; + return target === lastTabbableNode; + }); + if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) { + lastOfGroupIndex = containerIndex; + } + if (lastOfGroupIndex >= 0) { + var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1; + var _destinationGroup = state.tabbableGroups[_destinationGroupIndex]; + destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode; + } else if (!isTabEvent(event)) { + destinationNode = containerGroup.nextTabbableNode(target); + } + } + } else { + destinationNode = getNodeForOption("fallbackFocus"); + } + return destinationNode; + }; + var checkPointerDown = function checkPointerDown2(e) { + var target = getActualTarget(e); + if (findContainerIndex(target, e) >= 0) { + return; + } + if (valueOrHandler(config.clickOutsideDeactivates, e)) { + trap.deactivate({ + // NOTE: by setting `returnFocus: false`, deactivate() will do nothing, + // which will result in the outside click setting focus to the node + // that was clicked (and if not focusable, to "nothing"); by setting + // `returnFocus: true`, we'll attempt to re-focus the node originally-focused + // on activation (or the configured `setReturnFocus` node), whether the + // outside click was on a focusable node or not + returnFocus: config.returnFocusOnDeactivate + }); + return; + } + if (valueOrHandler(config.allowOutsideClick, e)) { + return; + } + e.preventDefault(); + }; + var checkFocusIn = function checkFocusIn2(event) { + var target = getActualTarget(event); + var targetContained = findContainerIndex(target, event) >= 0; + if (targetContained || target instanceof Document) { + if (targetContained) { + state.mostRecentlyFocusedNode = target; + } + } else { + event.stopImmediatePropagation(); + var nextNode; + var navAcrossContainers = true; + if (state.mostRecentlyFocusedNode) { + if (getTabIndex(state.mostRecentlyFocusedNode) > 0) { + var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode); + var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes; + if (tabbableNodes.length > 0) { + var mruTabIdx = tabbableNodes.findIndex(function(node) { + return node === state.mostRecentlyFocusedNode; + }); + if (mruTabIdx >= 0) { + if (config.isKeyForward(state.recentNavEvent)) { + if (mruTabIdx + 1 < tabbableNodes.length) { + nextNode = tabbableNodes[mruTabIdx + 1]; + navAcrossContainers = false; + } + } else { + if (mruTabIdx - 1 >= 0) { + nextNode = tabbableNodes[mruTabIdx - 1]; + navAcrossContainers = false; + } + } + } + } + } else { + if (!state.containerGroups.some(function(g) { + return g.tabbableNodes.some(function(n) { + return getTabIndex(n) > 0; + }); + })) { + navAcrossContainers = false; + } + } + } else { + navAcrossContainers = false; + } + if (navAcrossContainers) { + nextNode = findNextNavNode({ + // move FROM the MRU node, not event-related node (which will be the node that is + // outside the trap causing the focus escape we're trying to fix) + target: state.mostRecentlyFocusedNode, + isBackward: config.isKeyBackward(state.recentNavEvent) + }); + } + if (nextNode) { + tryFocus(nextNode); + } else { + tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); + } + } + state.recentNavEvent = void 0; + }; + var checkKeyNav = function checkKeyNav2(event) { + var isBackward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + state.recentNavEvent = event; + var destinationNode = findNextNavNode({ + event, + isBackward + }); + if (destinationNode) { + if (isTabEvent(event)) { + event.preventDefault(); + } + tryFocus(destinationNode); + } + }; + var checkKey = function checkKey2(event) { + if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) { + event.preventDefault(); + trap.deactivate(); + return; + } + if (config.isKeyForward(event) || config.isKeyBackward(event)) { + checkKeyNav(event, config.isKeyBackward(event)); + } + }; + var checkClick = function checkClick2(e) { + var target = getActualTarget(e); + if (findContainerIndex(target, e) >= 0) { + return; + } + if (valueOrHandler(config.clickOutsideDeactivates, e)) { + return; + } + if (valueOrHandler(config.allowOutsideClick, e)) { + return; + } + e.preventDefault(); + e.stopImmediatePropagation(); + }; + var addListeners = function addListeners2() { + if (!state.active) { + return; + } + activeFocusTraps.activateTrap(trapStack, trap); + state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() { + tryFocus(getInitialFocusNode()); + }) : tryFocus(getInitialFocusNode()); + doc.addEventListener("focusin", checkFocusIn, true); + doc.addEventListener("mousedown", checkPointerDown, { + capture: true, + passive: false + }); + doc.addEventListener("touchstart", checkPointerDown, { + capture: true, + passive: false + }); + doc.addEventListener("click", checkClick, { + capture: true, + passive: false + }); + doc.addEventListener("keydown", checkKey, { + capture: true, + passive: false + }); + return trap; + }; + var removeListeners = function removeListeners2() { + if (!state.active) { + return; + } + doc.removeEventListener("focusin", checkFocusIn, true); + doc.removeEventListener("mousedown", checkPointerDown, true); + doc.removeEventListener("touchstart", checkPointerDown, true); + doc.removeEventListener("click", checkClick, true); + doc.removeEventListener("keydown", checkKey, true); + return trap; + }; + var checkDomRemoval = function checkDomRemoval2(mutations) { + var isFocusedNodeRemoved = mutations.some(function(mutation) { + var removedNodes = Array.from(mutation.removedNodes); + return removedNodes.some(function(node) { + return node === state.mostRecentlyFocusedNode; + }); + }); + if (isFocusedNodeRemoved) { + tryFocus(getInitialFocusNode()); + } + }; + var mutationObserver = typeof window !== "undefined" && "MutationObserver" in window ? new MutationObserver(checkDomRemoval) : void 0; + var updateObservedNodes = function updateObservedNodes2() { + if (!mutationObserver) { + return; + } + mutationObserver.disconnect(); + if (state.active && !state.paused) { + state.containers.map(function(container) { + mutationObserver.observe(container, { + subtree: true, + childList: true + }); + }); + } + }; + trap = { + get active() { + return state.active; + }, + get paused() { + return state.paused; + }, + activate: function activate(activateOptions) { + if (state.active) { + return this; + } + var onActivate = getOption(activateOptions, "onActivate"); + var onPostActivate = getOption(activateOptions, "onPostActivate"); + var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap"); + if (!checkCanFocusTrap) { + updateTabbableNodes(); + } + state.active = true; + state.paused = false; + state.nodeFocusedBeforeActivation = doc.activeElement; + onActivate === null || onActivate === void 0 || onActivate(); + var finishActivation = function finishActivation2() { + if (checkCanFocusTrap) { + updateTabbableNodes(); + } + addListeners(); + updateObservedNodes(); + onPostActivate === null || onPostActivate === void 0 || onPostActivate(); + }; + if (checkCanFocusTrap) { + checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation); + return this; + } + finishActivation(); + return this; + }, + deactivate: function deactivate(deactivateOptions) { + if (!state.active) { + return this; + } + var options = _objectSpread2({ + onDeactivate: config.onDeactivate, + onPostDeactivate: config.onPostDeactivate, + checkCanReturnFocus: config.checkCanReturnFocus + }, deactivateOptions); + clearTimeout(state.delayInitialFocusTimer); + state.delayInitialFocusTimer = void 0; + removeListeners(); + state.active = false; + state.paused = false; + updateObservedNodes(); + activeFocusTraps.deactivateTrap(trapStack, trap); + var onDeactivate = getOption(options, "onDeactivate"); + var onPostDeactivate = getOption(options, "onPostDeactivate"); + var checkCanReturnFocus = getOption(options, "checkCanReturnFocus"); + var returnFocus = getOption(options, "returnFocus", "returnFocusOnDeactivate"); + onDeactivate === null || onDeactivate === void 0 || onDeactivate(); + var finishDeactivation = function finishDeactivation2() { + delay(function() { + if (returnFocus) { + tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)); + } + onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate(); + }); + }; + if (returnFocus && checkCanReturnFocus) { + checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation); + return this; + } + finishDeactivation(); + return this; + }, + pause: function pause(pauseOptions) { + if (state.paused || !state.active) { + return this; + } + var onPause = getOption(pauseOptions, "onPause"); + var onPostPause = getOption(pauseOptions, "onPostPause"); + state.paused = true; + onPause === null || onPause === void 0 || onPause(); + removeListeners(); + updateObservedNodes(); + onPostPause === null || onPostPause === void 0 || onPostPause(); + return this; + }, + unpause: function unpause(unpauseOptions) { + if (!state.paused || !state.active) { + return this; + } + var onUnpause = getOption(unpauseOptions, "onUnpause"); + var onPostUnpause = getOption(unpauseOptions, "onPostUnpause"); + state.paused = false; + onUnpause === null || onUnpause === void 0 || onUnpause(); + updateTabbableNodes(); + addListeners(); + updateObservedNodes(); + onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause(); + return this; + }, + updateContainerElements: function updateContainerElements(containerElements) { + var elementsAsArray = [].concat(containerElements).filter(Boolean); + state.containers = elementsAsArray.map(function(element) { + return typeof element === "string" ? doc.querySelector(element) : element; + }); + if (state.active) { + updateTabbableNodes(); + } + updateObservedNodes(); + return this; + } + }; + trap.updateContainerElements(elements); + return trap; +}; + +// node_modules/@vueuse/integrations/useFocusTrap.mjs +function useFocusTrap(target, options = {}) { + let trap; + const { immediate, ...focusTrapOptions } = options; + const hasFocus = ref(false); + const isPaused = ref(false); + const activate = (opts) => trap && trap.activate(opts); + const deactivate = (opts) => trap && trap.deactivate(opts); + const pause = () => { + if (trap) { + trap.pause(); + isPaused.value = true; + } + }; + const unpause = () => { + if (trap) { + trap.unpause(); + isPaused.value = false; + } + }; + watch( + () => unrefElement(target), + (el) => { + if (!el) + return; + trap = createFocusTrap(el, { + ...focusTrapOptions, + onActivate() { + hasFocus.value = true; + if (options.onActivate) + options.onActivate(); + }, + onDeactivate() { + hasFocus.value = false; + if (options.onDeactivate) + options.onDeactivate(); + } + }); + if (immediate) + activate(); + }, + { flush: "post" } + ); + tryOnScopeDispose(() => deactivate()); + return { + hasFocus, + isPaused, + activate, + deactivate, + pause, + unpause + }; +} +export { + useFocusTrap +}; +/*! Bundled license information: + +tabbable/dist/index.esm.js: + (*! + * tabbable 6.2.0 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) + +focus-trap/dist/focus-trap.esm.js: + (*! + * focus-trap 7.5.4 + * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=vitepress___@vueuse_integrations_useFocusTrap.js.map diff --git a/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map b/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map new file mode 100644 index 0000000..15769a7 --- /dev/null +++ b/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../../node_modules/tabbable/src/index.js", "../../../../node_modules/focus-trap/index.js", "../../../../node_modules/@vueuse/integrations/useFocusTrap.mjs"], + "sourcesContent": ["// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\n// CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes\n// the entire query to fail, resulting in no nodes found, which will break a lot\n// of things... so we have to rely on JS to identify nodes inside an inert container\nconst candidateSelectors = [\n 'input:not([inert])',\n 'select:not([inert])',\n 'textarea:not([inert])',\n 'a[href]:not([inert])',\n 'button:not([inert])',\n '[tabindex]:not(slot):not([inert])',\n 'audio[controls]:not([inert])',\n 'video[controls]:not([inert])',\n '[contenteditable]:not([contenteditable=\"false\"]):not([inert])',\n 'details>summary:first-of-type:not([inert])',\n 'details:not([inert])',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst NoElement = typeof Element === 'undefined';\n\nconst matches = NoElement\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getRootNode =\n !NoElement && Element.prototype.getRootNode\n ? (element) => element?.getRootNode?.()\n : (element) => element?.ownerDocument;\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Element} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nconst isInert = function (node, lookUp = true) {\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n const inertAtt = node?.getAttribute?.('inert');\n const inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`\n // so it likely would not support `:is([inert] *)` either...\n const result = inert || (lookUp && node && isInert(node.parentNode)); // recursive\n\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nconst isContentEditable = function (node) {\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n const attValue = node?.getAttribute?.('contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nconst getCandidates = function (el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert, all its children are inert\n if (isInert(el)) {\n return [];\n }\n\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nconst getCandidatesIteratively = function (\n elements,\n includeContainer,\n options\n) {\n const candidates = [];\n const elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n const element = elementsToCheck.shift();\n if (isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n const assigned = element.assignedElements();\n const content = assigned.length ? assigned : element.children;\n const nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // check candidate element\n const validCandidate = matches.call(element, candidateSelector);\n if (\n validCandidate &&\n options.filter(element) &&\n (includeContainer || !elements.includes(element))\n ) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n const shadowRoot =\n element.shadowRoot ||\n // check for an undisclosed shadow\n (typeof options.getShadowRoot === 'function' &&\n options.getShadowRoot(element));\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n const validShadowRoot =\n !isInert(shadowRoot, false) &&\n (!options.shadowRootFilter || options.shadowRootFilter(element));\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n const nestedCandidates = getCandidatesIteratively(\n shadowRoot === true ? element.children : shadowRoot.children,\n true,\n options\n );\n\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift(...element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nconst hasTabIndex = function (node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nconst getTabIndex = function (node) {\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (node.tabIndex < 0) {\n // in Chrome,
,