@pnx-mixtape/mxds 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.storybook/main.ts +4 -1
  2. package/.storybook/vitest.setup.ts +37 -1
  3. package/dist/build/accordion.css +1 -103
  4. package/dist/build/accordion.entry.js +1 -1
  5. package/dist/build/chunks/{DropMenu-plGsgySm.js → DropMenu-LnJEp-sg.js} +1 -1
  6. package/dist/build/constants.css +1 -100
  7. package/dist/build/drop-menu.entry.js +2 -2
  8. package/dist/build/filters.entry.js +1 -1
  9. package/dist/build/header.entry.js +450 -330
  10. package/dist/build/popover.entry.js +1 -1
  11. package/dist/build/tabs.entry.js +2 -2
  12. package/package.json +9 -11
  13. package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +1 -1
  14. package/src/Component/Accordion/accordion.css +4 -0
  15. package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +6 -6
  16. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +4 -4
  17. package/src/Component/Filters/__snapshots__/FilterItem.stories.ts.snap +2 -2
  18. package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +8 -8
  19. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +2 -2
  20. package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +22 -3
  21. package/src/Component/InPageNavigation/InPageNavigation.stories.ts +10 -0
  22. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +24 -19
  23. package/src/Component/InPageNavigation/in-page-navigation.css +3 -1
  24. package/src/Component/InPageNavigation/in-page-navigation.twig +3 -2
  25. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +18 -18
  26. package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +26 -26
  27. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +8 -8
  28. package/src/Component/UtilityList/__snapshots__/UtilityList.stories.ts.snap +6 -6
  29. package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +8 -8
  30. package/src/Form/Search/search-form.twig +2 -1
  31. package/src/Form/Select/__snapshots__/Select.stories.ts.snap +1 -1
  32. package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +1 -1
  33. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +23 -23
  34. package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +5 -5
  35. package/src/Layout/Section/section.twig +2 -1
  36. /package/dist/build/chunks/{Accordion-Dwh42fp7.js → Accordion-BzKLBuWL.js} +0 -0
  37. /package/dist/build/chunks/{Popover-Bws25suh.js → Popover-C4gisyxr.js} +0 -0
@@ -1,63 +1,63 @@
1
1
  import { o as DisclosureWidget } from "./chunks/utilities-DepaJdUg.js";
2
2
  var candidateSelectors = [
3
- "input:not([inert])",
4
- "select:not([inert])",
5
- "textarea:not([inert])",
6
- "a[href]:not([inert])",
7
- "button:not([inert])",
8
- "[tabindex]:not(slot):not([inert])",
9
- "audio[controls]:not([inert])",
10
- "video[controls]:not([inert])",
11
- "[contenteditable]:not([contenteditable=\"false\"]):not([inert])",
12
- "details>summary:first-of-type:not([inert])",
13
- "details:not([inert])"
3
+ "input:not([inert]):not([inert] *)",
4
+ "select:not([inert]):not([inert] *)",
5
+ "textarea:not([inert]):not([inert] *)",
6
+ "a[href]:not([inert]):not([inert] *)",
7
+ "button:not([inert]):not([inert] *)",
8
+ "[tabindex]:not(slot):not([inert]):not([inert] *)",
9
+ "audio[controls]:not([inert]):not([inert] *)",
10
+ "video[controls]:not([inert]):not([inert] *)",
11
+ "[contenteditable]:not([contenteditable=\"false\"]):not([inert]):not([inert] *)",
12
+ "details>summary:first-of-type:not([inert]):not([inert] *)",
13
+ "details:not([inert]):not([inert] *)"
14
14
  ], candidateSelector = /* @__PURE__ */ candidateSelectors.join(","), NoElement = typeof Element > "u", matches = NoElement ? function() {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, getRootNode = !NoElement && Element.prototype.getRootNode ? function(e) {
15
15
  return e?.getRootNode?.call(e);
16
16
  } : function(e) {
17
17
  return e?.ownerDocument;
18
- }, _isInert = function(e, O) {
19
- O === void 0 && (O = !0);
20
- var k = e?.getAttribute?.call(e, "inert");
21
- return k === "" || k === "true" || O && e && _isInert(e.parentNode);
18
+ }, _isInert = function(e, D) {
19
+ D === void 0 && (D = !0);
20
+ var O = e?.getAttribute?.call(e, "inert");
21
+ return O === "" || O === "true" || D && e && (typeof e.closest == "function" ? e.closest("[inert]") : _isInert(e.parentNode));
22
22
  }, isContentEditable = function(e) {
23
- var O = e?.getAttribute?.call(e, "contenteditable");
24
- return O === "" || O === "true";
25
- }, getCandidates = function(e, O, A) {
23
+ var D = e?.getAttribute?.call(e, "contenteditable");
24
+ return D === "" || D === "true";
25
+ }, getCandidates = function(e, D, k) {
26
26
  if (_isInert(e)) return [];
27
- var M = Array.prototype.slice.apply(e.querySelectorAll(candidateSelector));
28
- return O && matches.call(e, candidateSelector) && M.unshift(e), M = M.filter(A), M;
29
- }, _getCandidatesIteratively = function(e, O, A) {
30
- for (var M = [], P = Array.from(e); P.length;) {
31
- var F = P.shift();
32
- if (!_isInert(F, !1)) if (F.tagName === "SLOT") {
33
- var L = F.assignedElements(), R = _getCandidatesIteratively(L.length ? L : F.children, !0, A);
34
- A.flatten ? M.push.apply(M, R) : M.push({
35
- scopeParent: F,
36
- candidates: R
27
+ var j = Array.prototype.slice.apply(e.querySelectorAll(candidateSelector));
28
+ return D && matches.call(e, candidateSelector) && j.unshift(e), j = j.filter(k), j;
29
+ }, _getCandidatesIteratively = function(e, D, k) {
30
+ for (var j = [], N = Array.from(e); N.length;) {
31
+ var P = N.shift();
32
+ if (!_isInert(P, !1)) if (P.tagName === "SLOT") {
33
+ var I = P.assignedElements(), L = _getCandidatesIteratively(I.length ? I : P.children, !0, k);
34
+ k.flatten ? j.push.apply(j, L) : j.push({
35
+ scopeParent: P,
36
+ candidates: L
37
37
  });
38
38
  } else {
39
- matches.call(F, candidateSelector) && A.filter(F) && (O || !e.includes(F)) && M.push(F);
40
- var z = F.shadowRoot || typeof A.getShadowRoot == "function" && A.getShadowRoot(F), B = !_isInert(z, !1) && (!A.shadowRootFilter || A.shadowRootFilter(F));
41
- if (z && B) {
42
- var V = _getCandidatesIteratively(z === !0 ? F.children : z.children, !0, A);
43
- A.flatten ? M.push.apply(M, V) : M.push({
44
- scopeParent: F,
45
- candidates: V
39
+ matches.call(P, candidateSelector) && k.filter(P) && (D || !e.includes(P)) && j.push(P);
40
+ var R = P.shadowRoot || typeof k.getShadowRoot == "function" && k.getShadowRoot(P), z = !_isInert(R, !1) && (!k.shadowRootFilter || k.shadowRootFilter(P));
41
+ if (R && z) {
42
+ var B = _getCandidatesIteratively(R === !0 ? P.children : R.children, !0, k);
43
+ k.flatten ? j.push.apply(j, B) : j.push({
44
+ scopeParent: P,
45
+ candidates: B
46
46
  });
47
- } else P.unshift.apply(P, F.children);
47
+ } else N.unshift.apply(N, P.children);
48
48
  }
49
49
  }
50
- return M;
50
+ return j;
51
51
  }, hasTabIndex = function(e) {
52
52
  return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
53
53
  }, getTabIndex = function(e) {
54
54
  if (!e) throw Error("No node provided");
55
55
  return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || isContentEditable(e)) && !hasTabIndex(e) ? 0 : e.tabIndex;
56
- }, getSortOrderTabIndex = function(e, O) {
57
- var k = getTabIndex(e);
58
- return k < 0 && O && !hasTabIndex(e) ? 0 : k;
59
- }, sortOrderedTabbables = function(e, O) {
60
- return e.tabIndex === O.tabIndex ? e.documentOrder - O.documentOrder : e.tabIndex - O.tabIndex;
56
+ }, getSortOrderTabIndex = function(e, D) {
57
+ var O = getTabIndex(e);
58
+ return O < 0 && D && !hasTabIndex(e) ? 0 : O;
59
+ }, sortOrderedTabbables = function(e, D) {
60
+ return e.tabIndex === D.tabIndex ? e.documentOrder - D.documentOrder : e.tabIndex - D.tabIndex;
61
61
  }, isInput = function(e) {
62
62
  return e.tagName === "INPUT";
63
63
  }, isHiddenInput = function(e) {
@@ -66,41 +66,41 @@ var candidateSelectors = [
66
66
  return e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(e) {
67
67
  return e.tagName === "SUMMARY";
68
68
  });
69
- }, getCheckedRadio = function(e, O) {
70
- for (var k = 0; k < e.length; k++) if (e[k].checked && e[k].form === O) return e[k];
69
+ }, getCheckedRadio = function(e, D) {
70
+ for (var O = 0; O < e.length; O++) if (e[O].checked && e[O].form === D) return e[O];
71
71
  }, isTabbableRadio = function(e) {
72
72
  if (!e.name) return !0;
73
- var O = e.form || getRootNode(e), k = function(e) {
74
- return O.querySelectorAll("input[type=\"radio\"][name=\"" + e + "\"]");
75
- }, A;
76
- if (typeof window < "u" && window.CSS !== void 0 && typeof window.CSS.escape == "function") A = k(window.CSS.escape(e.name));
73
+ var D = e.form || getRootNode(e), O = function(e) {
74
+ return D.querySelectorAll("input[type=\"radio\"][name=\"" + e + "\"]");
75
+ }, k;
76
+ if (typeof window < "u" && window.CSS !== void 0 && typeof window.CSS.escape == "function") k = O(window.CSS.escape(e.name));
77
77
  else try {
78
- A = k(e.name);
78
+ k = O(e.name);
79
79
  } catch (e) {
80
80
  return 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", e.message), !1;
81
81
  }
82
- var j = getCheckedRadio(A, e.form);
83
- return !j || j === e;
82
+ var A = getCheckedRadio(k, e.form);
83
+ return !A || A === e;
84
84
  }, isRadio = function(e) {
85
85
  return isInput(e) && e.type === "radio";
86
86
  }, isNonTabbableRadio = function(e) {
87
87
  return isRadio(e) && !isTabbableRadio(e);
88
88
  }, isNodeAttached = function(e) {
89
- var O = e && getRootNode(e), k = O?.host, A = !1;
90
- if (O && O !== e) {
91
- var j, N, P;
92
- for (A = !!((j = k) != null && (N = j.ownerDocument) != null && N.contains(k) || e != null && (P = e.ownerDocument) != null && P.contains(e)); !A && k;) {
93
- var F, I;
94
- O = getRootNode(k), k = O?.host, A = !!((F = k) != null && (I = F.ownerDocument) != null && I.contains(k));
89
+ var D = e && getRootNode(e), O = D?.host, k = !1;
90
+ if (D && D !== e) {
91
+ var A, M, N;
92
+ for (k = !!((A = O) != null && (M = A.ownerDocument) != null && M.contains(O) || e != null && (N = e.ownerDocument) != null && N.contains(e)); !k && O;) {
93
+ var P, F;
94
+ D = getRootNode(O), O = D?.host, k = !!((P = O) != null && (F = P.ownerDocument) != null && F.contains(O));
95
95
  }
96
96
  }
97
- return A;
97
+ return k;
98
98
  }, isZeroArea = function(e) {
99
- var O = e.getBoundingClientRect(), k = O.width, A = O.height;
100
- return k === 0 && A === 0;
101
- }, isHidden = function(e, O) {
102
- var k = O.displayCheck, A = O.getShadowRoot;
103
- if (k === "full-native" && "checkVisibility" in e) return !e.checkVisibility({
99
+ var D = e.getBoundingClientRect(), O = D.width, k = D.height;
100
+ return O === 0 && k === 0;
101
+ }, isHidden = function(e, D) {
102
+ var O = D.displayCheck, k = D.getShadowRoot;
103
+ if (O === "full-native" && "checkVisibility" in e) return !e.checkVisibility({
104
104
  checkOpacity: !1,
105
105
  opacityProperty: !1,
106
106
  contentVisibilityAuto: !0,
@@ -108,89 +108,132 @@ var candidateSelectors = [
108
108
  checkVisibilityCSS: !0
109
109
  });
110
110
  if (getComputedStyle(e).visibility === "hidden") return !0;
111
- var N = matches.call(e, "details>summary:first-of-type") ? e.parentElement : e;
112
- if (matches.call(N, "details:not([open]) *")) return !0;
113
- if (!k || k === "full" || k === "full-native" || k === "legacy-full") {
114
- if (typeof A == "function") {
115
- for (var P = e; e;) {
116
- var F = e.parentElement, I = getRootNode(e);
117
- if (F && !F.shadowRoot && A(F) === !0) return isZeroArea(e);
118
- e = e.assignedSlot ? e.assignedSlot : !F && I !== e.ownerDocument ? I.host : F;
111
+ var M = matches.call(e, "details>summary:first-of-type") ? e.parentElement : e;
112
+ if (matches.call(M, "details:not([open]) *")) return !0;
113
+ if (!O || O === "full" || O === "full-native" || O === "legacy-full") {
114
+ if (typeof k == "function") {
115
+ for (var N = e; e;) {
116
+ var P = e.parentElement, F = getRootNode(e);
117
+ if (P && !P.shadowRoot && k(P) === !0) return isZeroArea(e);
118
+ e = e.assignedSlot ? e.assignedSlot : !P && F !== e.ownerDocument ? F.host : P;
119
119
  }
120
- e = P;
120
+ e = N;
121
121
  }
122
122
  if (isNodeAttached(e)) return !e.getClientRects().length;
123
- if (k !== "legacy-full") return !0;
124
- } else if (k === "non-zero-area") return isZeroArea(e);
123
+ if (O !== "legacy-full") return !0;
124
+ } else if (O === "non-zero-area") return isZeroArea(e);
125
125
  return !1;
126
126
  }, isDisabledFromFieldset = function(e) {
127
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) for (var O = e.parentElement; O;) {
128
- if (O.tagName === "FIELDSET" && O.disabled) {
129
- for (var k = 0; k < O.children.length; k++) {
130
- var A = O.children.item(k);
131
- if (A.tagName === "LEGEND") return matches.call(O, "fieldset[disabled] *") ? !0 : !A.contains(e);
127
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) for (var D = e.parentElement; D;) {
128
+ if (D.tagName === "FIELDSET" && D.disabled) {
129
+ for (var O = 0; O < D.children.length; O++) {
130
+ var k = D.children.item(O);
131
+ if (k.tagName === "LEGEND") return matches.call(D, "fieldset[disabled] *") ? !0 : !k.contains(e);
132
132
  }
133
133
  return !0;
134
134
  }
135
- O = O.parentElement;
135
+ D = D.parentElement;
136
136
  }
137
137
  return !1;
138
- }, isNodeMatchingSelectorFocusable = function(e, O) {
139
- return !(O.disabled || _isInert(O) || isHiddenInput(O) || isHidden(O, e) || isDetailsWithSummary(O) || isDisabledFromFieldset(O));
140
- }, isNodeMatchingSelectorTabbable = function(e, O) {
141
- return !(isNonTabbableRadio(O) || getTabIndex(O) < 0 || !isNodeMatchingSelectorFocusable(e, O));
138
+ }, isNodeMatchingSelectorFocusable = function(e, D) {
139
+ return !(D.disabled || isHiddenInput(D) || isHidden(D, e) || isDetailsWithSummary(D) || isDisabledFromFieldset(D));
140
+ }, isNodeMatchingSelectorTabbable = function(e, D) {
141
+ return !(isNonTabbableRadio(D) || getTabIndex(D) < 0 || !isNodeMatchingSelectorFocusable(e, D));
142
142
  }, isShadowRootTabbable = function(e) {
143
- var O = parseInt(e.getAttribute("tabindex"), 10);
144
- return !!(isNaN(O) || O >= 0);
143
+ var D = parseInt(e.getAttribute("tabindex"), 10);
144
+ return !!(isNaN(D) || D >= 0);
145
145
  }, _sortByOrder = function(e) {
146
- var O = [], k = [];
147
- return e.forEach(function(e, A) {
148
- var j = !!e.scopeParent, M = j ? e.scopeParent : e, N = getSortOrderTabIndex(M, j), P = j ? _sortByOrder(e.candidates) : M;
149
- N === 0 ? j ? O.push.apply(O, P) : O.push(M) : k.push({
150
- documentOrder: A,
151
- tabIndex: N,
146
+ var D = [], O = [];
147
+ return e.forEach(function(e, k) {
148
+ var A = !!e.scopeParent, j = A ? e.scopeParent : e, M = getSortOrderTabIndex(j, A), N = A ? _sortByOrder(e.candidates) : j;
149
+ M === 0 ? A ? D.push.apply(D, N) : D.push(j) : O.push({
150
+ documentOrder: k,
151
+ tabIndex: M,
152
152
  item: e,
153
- isScope: j,
154
- content: P
153
+ isScope: A,
154
+ content: N
155
155
  });
156
- }), k.sort(sortOrderedTabbables).reduce(function(e, O) {
157
- return O.isScope ? e.push.apply(e, O.content) : e.push(O.content), e;
158
- }, []).concat(O);
159
- }, tabbable = function(e, O) {
160
- return O ||= {}, _sortByOrder(O.getShadowRoot ? _getCandidatesIteratively([e], O.includeContainer, {
161
- filter: isNodeMatchingSelectorTabbable.bind(null, O),
156
+ }), O.sort(sortOrderedTabbables).reduce(function(e, D) {
157
+ return D.isScope ? e.push.apply(e, D.content) : e.push(D.content), e;
158
+ }, []).concat(D);
159
+ }, tabbable = function(e, D) {
160
+ return D ||= {}, _sortByOrder(D.getShadowRoot ? _getCandidatesIteratively([e], D.includeContainer, {
161
+ filter: isNodeMatchingSelectorTabbable.bind(null, D),
162
162
  flatten: !1,
163
- getShadowRoot: O.getShadowRoot,
163
+ getShadowRoot: D.getShadowRoot,
164
164
  shadowRootFilter: isShadowRootTabbable
165
- }) : getCandidates(e, O.includeContainer, isNodeMatchingSelectorTabbable.bind(null, O)));
166
- }, focusable = function(e, O) {
167
- return O ||= {}, O.getShadowRoot ? _getCandidatesIteratively([e], O.includeContainer, {
168
- filter: isNodeMatchingSelectorFocusable.bind(null, O),
165
+ }) : getCandidates(e, D.includeContainer, isNodeMatchingSelectorTabbable.bind(null, D)));
166
+ }, focusable = function(e, D) {
167
+ return D ||= {}, D.getShadowRoot ? _getCandidatesIteratively([e], D.includeContainer, {
168
+ filter: isNodeMatchingSelectorFocusable.bind(null, D),
169
169
  flatten: !0,
170
- getShadowRoot: O.getShadowRoot
171
- }) : getCandidates(e, O.includeContainer, isNodeMatchingSelectorFocusable.bind(null, O));
172
- }, isTabbable = function(e, O) {
173
- if (O ||= {}, !e) throw Error("No node provided");
174
- return matches.call(e, candidateSelector) === !1 ? !1 : isNodeMatchingSelectorTabbable(O, e);
175
- }, focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","), isFocusable = function(e, O) {
176
- if (O ||= {}, !e) throw Error("No node provided");
177
- return matches.call(e, focusableCandidateSelector) === !1 ? !1 : isNodeMatchingSelectorFocusable(O, e);
170
+ getShadowRoot: D.getShadowRoot
171
+ }) : getCandidates(e, D.includeContainer, isNodeMatchingSelectorFocusable.bind(null, D));
172
+ }, isTabbable = function(e, D) {
173
+ if (D ||= {}, !e) throw Error("No node provided");
174
+ return matches.call(e, candidateSelector) === !1 ? !1 : isNodeMatchingSelectorTabbable(D, e);
175
+ }, focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe:not([inert]):not([inert] *)").join(","), isFocusable = function(e, D) {
176
+ if (D ||= {}, !e) throw Error("No node provided");
177
+ return matches.call(e, focusableCandidateSelector) === !1 ? !1 : isNodeMatchingSelectorFocusable(D, e);
178
178
  };
179
- function _arrayLikeToArray(e, O) {
180
- (O == null || O > e.length) && (O = e.length);
181
- for (var k = 0, A = Array(O); k < O; k++) A[k] = e[k];
182
- return A;
179
+ function _arrayLikeToArray(e, D) {
180
+ (D == null || D > e.length) && (D = e.length);
181
+ for (var O = 0, k = Array(D); O < D; O++) k[O] = e[O];
182
+ return k;
183
183
  }
184
184
  function _arrayWithoutHoles(e) {
185
185
  if (Array.isArray(e)) return _arrayLikeToArray(e);
186
186
  }
187
- function _defineProperty(e, O, k) {
188
- return (O = _toPropertyKey(O)) in e ? Object.defineProperty(e, O, {
189
- value: k,
187
+ function _createForOfIteratorHelper(e, D) {
188
+ var O = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
189
+ if (!O) {
190
+ if (Array.isArray(e) || (O = _unsupportedIterableToArray(e)) || D) {
191
+ O && (e = O);
192
+ var k = 0, A = function() {};
193
+ return {
194
+ s: A,
195
+ n: function() {
196
+ return k >= e.length ? { done: !0 } : {
197
+ done: !1,
198
+ value: e[k++]
199
+ };
200
+ },
201
+ e: function(e) {
202
+ throw e;
203
+ },
204
+ f: A
205
+ };
206
+ }
207
+ throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
208
+ }
209
+ var j, M = !0, N = !1;
210
+ return {
211
+ s: function() {
212
+ O = O.call(e);
213
+ },
214
+ n: function() {
215
+ var e = O.next();
216
+ return M = e.done, e;
217
+ },
218
+ e: function(e) {
219
+ N = !0, j = e;
220
+ },
221
+ f: function() {
222
+ try {
223
+ M || O.return == null || O.return();
224
+ } finally {
225
+ if (N) throw j;
226
+ }
227
+ }
228
+ };
229
+ }
230
+ function _defineProperty(e, D, O) {
231
+ return (D = _toPropertyKey(D)) in e ? Object.defineProperty(e, D, {
232
+ value: O,
190
233
  enumerable: !0,
191
234
  configurable: !0,
192
235
  writable: !0
193
- }) : e[O] = k, e;
236
+ }) : e[D] = O, e;
194
237
  }
195
238
  function _iterableToArray(e) {
196
239
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
@@ -198,23 +241,23 @@ function _iterableToArray(e) {
198
241
  function _nonIterableSpread() {
199
242
  throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
200
243
  }
201
- function ownKeys(e, O) {
202
- var k = Object.keys(e);
244
+ function ownKeys(e, D) {
245
+ var O = Object.keys(e);
203
246
  if (Object.getOwnPropertySymbols) {
204
- var A = Object.getOwnPropertySymbols(e);
205
- O && (A = A.filter(function(O) {
206
- return Object.getOwnPropertyDescriptor(e, O).enumerable;
207
- })), k.push.apply(k, A);
247
+ var k = Object.getOwnPropertySymbols(e);
248
+ D && (k = k.filter(function(D) {
249
+ return Object.getOwnPropertyDescriptor(e, D).enumerable;
250
+ })), O.push.apply(O, k);
208
251
  }
209
- return k;
252
+ return O;
210
253
  }
211
254
  function _objectSpread2(e) {
212
- for (var O = 1; O < arguments.length; O++) {
213
- var k = arguments[O] == null ? {} : arguments[O];
214
- O % 2 ? ownKeys(Object(k), !0).forEach(function(O) {
215
- _defineProperty(e, O, k[O]);
216
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(k)) : ownKeys(Object(k)).forEach(function(O) {
217
- Object.defineProperty(e, O, Object.getOwnPropertyDescriptor(k, O));
255
+ for (var D = 1; D < arguments.length; D++) {
256
+ var O = arguments[D] == null ? {} : arguments[D];
257
+ D % 2 ? ownKeys(Object(O), !0).forEach(function(D) {
258
+ _defineProperty(e, D, O[D]);
259
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(O)) : ownKeys(Object(O)).forEach(function(D) {
260
+ Object.defineProperty(e, D, Object.getOwnPropertyDescriptor(O, D));
218
261
  });
219
262
  }
220
263
  return e;
@@ -222,39 +265,46 @@ function _objectSpread2(e) {
222
265
  function _toConsumableArray(e) {
223
266
  return _arrayWithoutHoles(e) || _iterableToArray(e) || _unsupportedIterableToArray(e) || _nonIterableSpread();
224
267
  }
225
- function _toPrimitive(e, O) {
268
+ function _toPrimitive(e, D) {
226
269
  if (typeof e != "object" || !e) return e;
227
- var k = e[Symbol.toPrimitive];
228
- if (k !== void 0) {
229
- var A = k.call(e, O);
230
- if (typeof A != "object") return A;
270
+ var O = e[Symbol.toPrimitive];
271
+ if (O !== void 0) {
272
+ var k = O.call(e, D);
273
+ if (typeof k != "object") return k;
231
274
  throw TypeError("@@toPrimitive must return a primitive value.");
232
275
  }
233
- return (O === "string" ? String : Number)(e);
276
+ return (D === "string" ? String : Number)(e);
234
277
  }
235
278
  function _toPropertyKey(e) {
236
- var O = _toPrimitive(e, "string");
237
- return typeof O == "symbol" ? O : O + "";
279
+ var D = _toPrimitive(e, "string");
280
+ return typeof D == "symbol" ? D : D + "";
238
281
  }
239
- function _unsupportedIterableToArray(e, O) {
282
+ function _unsupportedIterableToArray(e, D) {
240
283
  if (e) {
241
- if (typeof e == "string") return _arrayLikeToArray(e, O);
242
- var k = {}.toString.call(e).slice(8, -1);
243
- return k === "Object" && e.constructor && (k = e.constructor.name), k === "Map" || k === "Set" ? Array.from(e) : k === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k) ? _arrayLikeToArray(e, O) : void 0;
284
+ if (typeof e == "string") return _arrayLikeToArray(e, D);
285
+ var O = {}.toString.call(e).slice(8, -1);
286
+ return O === "Object" && e.constructor && (O = e.constructor.name), O === "Map" || O === "Set" ? Array.from(e) : O === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O) ? _arrayLikeToArray(e, D) : void 0;
244
287
  }
245
288
  }
246
289
  var activeFocusTraps = {
247
- activateTrap: function(e, O) {
248
- if (e.length > 0) {
249
- var k = e[e.length - 1];
250
- k !== O && k._setPausedState(!0);
251
- }
252
- var A = e.indexOf(O);
253
- A === -1 || e.splice(A, 1), e.push(O);
290
+ getActiveTrap: function(e) {
291
+ return e?.length > 0 ? e[e.length - 1] : null;
254
292
  },
255
- deactivateTrap: function(e, O) {
256
- var k = e.indexOf(O);
257
- k !== -1 && e.splice(k, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
293
+ activateTrap: function(e, D) {
294
+ D !== activeFocusTraps.getActiveTrap(e) && activeFocusTraps.pauseTrap(e);
295
+ var O = e.indexOf(D);
296
+ O === -1 || e.splice(O, 1), e.push(D);
297
+ },
298
+ deactivateTrap: function(e, D) {
299
+ var O = e.indexOf(D);
300
+ O !== -1 && e.splice(O, 1), activeFocusTraps.unpauseTrap(e);
301
+ },
302
+ pauseTrap: function(e) {
303
+ activeFocusTraps.getActiveTrap(e)?._setPausedState(!0);
304
+ },
305
+ unpauseTrap: function(e) {
306
+ var D = activeFocusTraps.getActiveTrap(e);
307
+ D && !D._isManuallyPaused() && D._setPausedState(!1);
258
308
  }
259
309
  }, isSelectableInput = function(e) {
260
310
  return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
@@ -269,21 +319,24 @@ var activeFocusTraps = {
269
319
  }, delay = function(e) {
270
320
  return setTimeout(e, 0);
271
321
  }, valueOrHandler = function(e) {
272
- var O = [...arguments].slice(1);
273
- return typeof e == "function" ? e.apply(void 0, O) : e;
322
+ var D = [...arguments].slice(1);
323
+ return typeof e == "function" ? e.apply(void 0, D) : e;
274
324
  }, getActualTarget = function(e) {
275
325
  return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
276
- }, internalTrapStack = [], createFocusTrap = function(e, O) {
277
- var k = O?.document || document, A = O?.trapStack || internalTrapStack, j = _objectSpread2({
326
+ }, internalTrapStack = [], createFocusTrap = function(e, D) {
327
+ var O = D?.document || document, k = D?.trapStack || internalTrapStack, A = _objectSpread2({
278
328
  returnFocusOnDeactivate: !0,
279
329
  escapeDeactivates: !0,
280
330
  delayInitialFocus: !0,
331
+ isolateSubtrees: !1,
281
332
  isKeyForward,
282
333
  isKeyBackward
283
- }, O), M = {
334
+ }, D), j = {
284
335
  containers: [],
285
336
  containerGroups: [],
286
337
  tabbableGroups: [],
338
+ adjacentElements: /* @__PURE__ */ new Set(),
339
+ alreadySilent: /* @__PURE__ */ new Set(),
287
340
  nodeFocusedBeforeActivation: null,
288
341
  mostRecentlyFocusedNode: null,
289
342
  active: !1,
@@ -291,258 +344,325 @@ var activeFocusTraps = {
291
344
  manuallyPaused: !1,
292
345
  delayInitialFocusTimer: void 0,
293
346
  recentNavEvent: void 0
294
- }, N, P = function(e, O, k) {
295
- return e && e[O] !== void 0 ? e[O] : j[k || O];
296
- }, F = function(e, O) {
297
- var k = typeof O?.composedPath == "function" ? O.composedPath() : void 0;
298
- return M.containerGroups.findIndex(function(O) {
299
- var A = O.container, j = O.tabbableNodes;
300
- return A.contains(e) || k?.includes(A) || j.find(function(O) {
301
- return O === e;
347
+ }, M, N = function(e, D, O) {
348
+ return e && e[D] !== void 0 ? e[D] : A[O || D];
349
+ }, P = function(e, D) {
350
+ var O = typeof D?.composedPath == "function" ? D.composedPath() : void 0;
351
+ return j.containerGroups.findIndex(function(D) {
352
+ var k = D.container, A = D.tabbableNodes;
353
+ return k.contains(e) || O?.includes(k) || A.find(function(D) {
354
+ return D === e;
302
355
  });
303
356
  });
304
- }, I = function(e) {
305
- var O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, A = O.hasFallback, M = A === void 0 ? !1 : A, N = O.params, P = N === void 0 ? [] : N, F = j[e];
306
- if (typeof F == "function" && (F = F.apply(void 0, _toConsumableArray(P))), F === !0 && (F = void 0), !F) {
307
- if (F === void 0 || F === !1) return F;
357
+ }, F = function(e) {
358
+ var D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, k = D.hasFallback, j = k === void 0 ? !1 : k, M = D.params, N = M === void 0 ? [] : M, P = A[e];
359
+ if (typeof P == "function" && (P = P.apply(void 0, _toConsumableArray(N))), P === !0 && (P = void 0), !P) {
360
+ if (P === void 0 || P === !1) return P;
308
361
  throw Error(`\`${e}\` was specified but was not a node, or did not return a node`);
309
362
  }
310
- var I = F;
311
- if (typeof F == "string") {
363
+ var F = P;
364
+ if (typeof P == "string") {
312
365
  try {
313
- I = k.querySelector(F);
314
- } catch (O) {
315
- throw Error(`\`${e}\` appears to be an invalid selector; error="${O.message}"`);
366
+ F = O.querySelector(P);
367
+ } catch (D) {
368
+ throw Error(`\`${e}\` appears to be an invalid selector; error="${D.message}"`);
316
369
  }
317
- if (!I && !M) throw Error(`\`${e}\` as selector refers to no known node`);
370
+ if (!F && !j) throw Error(`\`${e}\` as selector refers to no known node`);
318
371
  }
319
- return I;
320
- }, L = function() {
321
- var e = I("initialFocus", { hasFallback: !0 });
372
+ return F;
373
+ }, I = function() {
374
+ var e = F("initialFocus", { hasFallback: !0 });
322
375
  if (e === !1) return !1;
323
- if (e === void 0 || e && !isFocusable(e, j.tabbableOptions)) if (F(k.activeElement) >= 0) e = k.activeElement;
376
+ if (e === void 0 || e && !isFocusable(e, A.tabbableOptions)) if (P(O.activeElement) >= 0) e = O.activeElement;
324
377
  else {
325
- var O = M.tabbableGroups[0];
326
- e = O && O.firstTabbableNode || I("fallbackFocus");
378
+ var D = j.tabbableGroups[0];
379
+ e = D && D.firstTabbableNode || F("fallbackFocus");
327
380
  }
328
- else e === null && (e = I("fallbackFocus"));
381
+ else e === null && (e = F("fallbackFocus"));
329
382
  if (!e) throw Error("Your focus-trap needs to have at least one focusable element");
330
383
  return e;
331
- }, z = function() {
332
- if (M.containerGroups = M.containers.map(function(e) {
333
- var O = tabbable(e, j.tabbableOptions), k = focusable(e, j.tabbableOptions), A = O.length > 0 ? O[0] : void 0, M = O.length > 0 ? O[O.length - 1] : void 0, N = k.find(function(e) {
384
+ }, R = function() {
385
+ if (j.containerGroups = j.containers.map(function(e) {
386
+ var D = tabbable(e, A.tabbableOptions), O = focusable(e, A.tabbableOptions), k = D.length > 0 ? D[0] : void 0, j = D.length > 0 ? D[D.length - 1] : void 0, M = O.find(function(e) {
334
387
  return isTabbable(e);
335
- }), P = k.slice().reverse().find(function(e) {
388
+ }), N = O.slice().reverse().find(function(e) {
336
389
  return isTabbable(e);
337
390
  });
338
391
  return {
339
392
  container: e,
340
- tabbableNodes: O,
341
- focusableNodes: k,
342
- posTabIndexesFound: !!O.find(function(e) {
393
+ tabbableNodes: D,
394
+ focusableNodes: O,
395
+ posTabIndexesFound: !!D.find(function(e) {
343
396
  return getTabIndex(e) > 0;
344
397
  }),
345
- firstTabbableNode: A,
346
- lastTabbableNode: M,
347
- firstDomTabbableNode: N,
348
- lastDomTabbableNode: P,
398
+ firstTabbableNode: k,
399
+ lastTabbableNode: j,
400
+ firstDomTabbableNode: M,
401
+ lastDomTabbableNode: N,
349
402
  nextTabbableNode: function(e) {
350
- var A = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, j = O.indexOf(e);
351
- return j < 0 ? A ? k.slice(k.indexOf(e) + 1).find(function(e) {
403
+ var k = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, A = D.indexOf(e);
404
+ return A < 0 ? k ? O.slice(O.indexOf(e) + 1).find(function(e) {
352
405
  return isTabbable(e);
353
- }) : k.slice(0, k.indexOf(e)).reverse().find(function(e) {
406
+ }) : O.slice(0, O.indexOf(e)).reverse().find(function(e) {
354
407
  return isTabbable(e);
355
- }) : O[j + (A ? 1 : -1)];
408
+ }) : D[A + (k ? 1 : -1)];
356
409
  }
357
410
  };
358
- }), M.tabbableGroups = M.containerGroups.filter(function(e) {
411
+ }), j.tabbableGroups = j.containerGroups.filter(function(e) {
359
412
  return e.tabbableNodes.length > 0;
360
- }), M.tabbableGroups.length <= 0 && !I("fallbackFocus")) throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
361
- if (M.containerGroups.find(function(e) {
413
+ }), j.tabbableGroups.length <= 0 && !F("fallbackFocus")) throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
414
+ if (j.containerGroups.find(function(e) {
362
415
  return e.posTabIndexesFound;
363
- }) && M.containerGroups.length > 1) throw 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.");
416
+ }) && j.containerGroups.length > 1) throw 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.");
417
+ }, z = function(e) {
418
+ var D = e.activeElement;
419
+ if (D) return D.shadowRoot && D.shadowRoot.activeElement !== null ? z(D.shadowRoot) : D;
364
420
  }, B = function(e) {
365
- var O = e.activeElement;
366
- if (O) return O.shadowRoot && O.shadowRoot.activeElement !== null ? B(O.shadowRoot) : O;
367
- }, V = function(e) {
368
- if (e !== !1 && e !== B(document)) {
421
+ if (e !== !1 && e !== z(document)) {
369
422
  if (!e || !e.focus) {
370
- V(L());
423
+ B(I());
371
424
  return;
372
425
  }
373
- e.focus({ preventScroll: !!j.preventScroll }), M.mostRecentlyFocusedNode = e, isSelectableInput(e) && e.select();
426
+ e.focus({ preventScroll: !!A.preventScroll }), j.mostRecentlyFocusedNode = e, isSelectableInput(e) && e.select();
374
427
  }
428
+ }, V = function(e) {
429
+ var D = F("setReturnFocus", { params: [e] });
430
+ return D || (D === !1 ? !1 : e);
375
431
  }, H = function(e) {
376
- var O = I("setReturnFocus", { params: [e] });
377
- return O || (O === !1 ? !1 : e);
378
- }, U = function(e) {
379
- var O = e.target, k = e.event, A = e.isBackward, N = A === void 0 ? !1 : A;
380
- O ||= getActualTarget(k), z();
381
- var P = null;
382
- if (M.tabbableGroups.length > 0) {
383
- var L = F(O, k), B = L >= 0 ? M.containerGroups[L] : void 0;
384
- if (L < 0) P = N ? M.tabbableGroups[M.tabbableGroups.length - 1].lastTabbableNode : M.tabbableGroups[0].firstTabbableNode;
385
- else if (N) {
386
- var V = M.tabbableGroups.findIndex(function(e) {
387
- var k = e.firstTabbableNode;
388
- return O === k;
432
+ var D = e.target, O = e.event, k = e.isBackward, M = k === void 0 ? !1 : k;
433
+ D ||= getActualTarget(O), R();
434
+ var N = null;
435
+ if (j.tabbableGroups.length > 0) {
436
+ var I = P(D, O), z = I >= 0 ? j.containerGroups[I] : void 0;
437
+ if (I < 0) N = M ? j.tabbableGroups[j.tabbableGroups.length - 1].lastTabbableNode : j.tabbableGroups[0].firstTabbableNode;
438
+ else if (M) {
439
+ var B = j.tabbableGroups.findIndex(function(e) {
440
+ var O = e.firstTabbableNode;
441
+ return D === O;
389
442
  });
390
- if (V < 0 && (B.container === O || isFocusable(O, j.tabbableOptions) && !isTabbable(O, j.tabbableOptions) && !B.nextTabbableNode(O, !1)) && (V = L), V >= 0) {
391
- var H = V === 0 ? M.tabbableGroups.length - 1 : V - 1, U = M.tabbableGroups[H];
392
- P = getTabIndex(O) >= 0 ? U.lastTabbableNode : U.lastDomTabbableNode;
393
- } else isTabEvent(k) || (P = B.nextTabbableNode(O, !1));
443
+ if (B < 0 && (z.container === D || isFocusable(D, A.tabbableOptions) && !isTabbable(D, A.tabbableOptions) && !z.nextTabbableNode(D, !1)) && (B = I), B >= 0) {
444
+ var V = B === 0 ? j.tabbableGroups.length - 1 : B - 1, H = j.tabbableGroups[V];
445
+ N = getTabIndex(D) >= 0 ? H.lastTabbableNode : H.lastDomTabbableNode;
446
+ } else isTabEvent(O) || (N = z.nextTabbableNode(D, !1));
394
447
  } else {
395
- var W = M.tabbableGroups.findIndex(function(e) {
396
- var k = e.lastTabbableNode;
397
- return O === k;
448
+ var U = j.tabbableGroups.findIndex(function(e) {
449
+ var O = e.lastTabbableNode;
450
+ return D === O;
398
451
  });
399
- if (W < 0 && (B.container === O || isFocusable(O, j.tabbableOptions) && !isTabbable(O, j.tabbableOptions) && !B.nextTabbableNode(O)) && (W = L), W >= 0) {
400
- var G = W === M.tabbableGroups.length - 1 ? 0 : W + 1, K = M.tabbableGroups[G];
401
- P = getTabIndex(O) >= 0 ? K.firstTabbableNode : K.firstDomTabbableNode;
402
- } else isTabEvent(k) || (P = B.nextTabbableNode(O));
452
+ if (U < 0 && (z.container === D || isFocusable(D, A.tabbableOptions) && !isTabbable(D, A.tabbableOptions) && !z.nextTabbableNode(D)) && (U = I), U >= 0) {
453
+ var W = U === j.tabbableGroups.length - 1 ? 0 : U + 1, G = j.tabbableGroups[W];
454
+ N = getTabIndex(D) >= 0 ? G.firstTabbableNode : G.firstDomTabbableNode;
455
+ } else isTabEvent(O) || (N = z.nextTabbableNode(D));
403
456
  }
404
- } else P = I("fallbackFocus");
405
- return P;
406
- }, W = function(e) {
407
- if (!(F(getActualTarget(e), e) >= 0)) {
408
- if (valueOrHandler(j.clickOutsideDeactivates, e)) {
409
- N.deactivate({ returnFocus: j.returnFocusOnDeactivate });
457
+ } else N = F("fallbackFocus");
458
+ return N;
459
+ }, U = function(e) {
460
+ if (!(P(getActualTarget(e), e) >= 0)) {
461
+ if (valueOrHandler(A.clickOutsideDeactivates, e)) {
462
+ M.deactivate({ returnFocus: A.returnFocusOnDeactivate });
410
463
  return;
411
464
  }
412
- valueOrHandler(j.allowOutsideClick, e) || e.preventDefault();
465
+ valueOrHandler(A.allowOutsideClick, e) || e.preventDefault();
413
466
  }
414
- }, G = function(e) {
415
- var O = getActualTarget(e), k = F(O, e) >= 0;
416
- if (k || O instanceof Document) k && (M.mostRecentlyFocusedNode = O);
467
+ }, W = function(e) {
468
+ var D = getActualTarget(e), O = P(D, e) >= 0;
469
+ if (O || D instanceof Document) O && (j.mostRecentlyFocusedNode = D);
417
470
  else {
418
471
  e.stopImmediatePropagation();
419
- var A, N = !0;
420
- if (M.mostRecentlyFocusedNode) if (getTabIndex(M.mostRecentlyFocusedNode) > 0) {
421
- var P = F(M.mostRecentlyFocusedNode), I = M.containerGroups[P].tabbableNodes;
422
- if (I.length > 0) {
423
- var z = I.findIndex(function(e) {
424
- return e === M.mostRecentlyFocusedNode;
472
+ var k, M = !0;
473
+ if (j.mostRecentlyFocusedNode) if (getTabIndex(j.mostRecentlyFocusedNode) > 0) {
474
+ var N = P(j.mostRecentlyFocusedNode), F = j.containerGroups[N].tabbableNodes;
475
+ if (F.length > 0) {
476
+ var R = F.findIndex(function(e) {
477
+ return e === j.mostRecentlyFocusedNode;
425
478
  });
426
- z >= 0 && (j.isKeyForward(M.recentNavEvent) ? z + 1 < I.length && (A = I[z + 1], N = !1) : z - 1 >= 0 && (A = I[z - 1], N = !1));
479
+ R >= 0 && (A.isKeyForward(j.recentNavEvent) ? R + 1 < F.length && (k = F[R + 1], M = !1) : R - 1 >= 0 && (k = F[R - 1], M = !1));
427
480
  }
428
- } else M.containerGroups.some(function(e) {
481
+ } else j.containerGroups.some(function(e) {
429
482
  return e.tabbableNodes.some(function(e) {
430
483
  return getTabIndex(e) > 0;
431
484
  });
432
- }) || (N = !1);
433
- else N = !1;
434
- N && (A = U({
435
- target: M.mostRecentlyFocusedNode,
436
- isBackward: j.isKeyBackward(M.recentNavEvent)
437
- })), V(A || M.mostRecentlyFocusedNode || L());
485
+ }) || (M = !1);
486
+ else M = !1;
487
+ M && (k = H({
488
+ target: j.mostRecentlyFocusedNode,
489
+ isBackward: A.isKeyBackward(j.recentNavEvent)
490
+ })), B(k || j.mostRecentlyFocusedNode || I());
438
491
  }
439
- M.recentNavEvent = void 0;
440
- }, K = function(e) {
441
- var O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
442
- M.recentNavEvent = e;
443
- var k = U({
492
+ j.recentNavEvent = void 0;
493
+ }, G = function(e) {
494
+ var D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
495
+ j.recentNavEvent = e;
496
+ var O = H({
444
497
  event: e,
445
- isBackward: O
498
+ isBackward: D
446
499
  });
447
- k && (isTabEvent(e) && e.preventDefault(), V(k));
500
+ O && (isTabEvent(e) && e.preventDefault(), B(O));
501
+ }, K = function(e) {
502
+ (A.isKeyForward(e) || A.isKeyBackward(e)) && G(e, A.isKeyBackward(e));
448
503
  }, q = function(e) {
449
- (j.isKeyForward(e) || j.isKeyBackward(e)) && K(e, j.isKeyBackward(e));
504
+ isEscapeEvent(e) && valueOrHandler(A.escapeDeactivates, e) !== !1 && (e.preventDefault(), M.deactivate());
450
505
  }, J = function(e) {
451
- isEscapeEvent(e) && valueOrHandler(j.escapeDeactivates, e) !== !1 && (e.preventDefault(), N.deactivate());
452
- }, Y = function(e) {
453
- F(getActualTarget(e), e) >= 0 || valueOrHandler(j.clickOutsideDeactivates, e) || valueOrHandler(j.allowOutsideClick, e) || (e.preventDefault(), e.stopImmediatePropagation());
454
- }, X = function() {
455
- if (M.active) return activeFocusTraps.activateTrap(A, N), M.delayInitialFocusTimer = j.delayInitialFocus ? delay(function() {
456
- V(L());
457
- }) : V(L()), k.addEventListener("focusin", G, !0), k.addEventListener("mousedown", W, {
506
+ P(getActualTarget(e), e) >= 0 || valueOrHandler(A.clickOutsideDeactivates, e) || valueOrHandler(A.allowOutsideClick, e) || (e.preventDefault(), e.stopImmediatePropagation());
507
+ }, Y = function() {
508
+ if (j.active) return activeFocusTraps.activateTrap(k, M), j.delayInitialFocusTimer = A.delayInitialFocus ? delay(function() {
509
+ B(I());
510
+ }) : B(I()), O.addEventListener("focusin", W, !0), O.addEventListener("mousedown", U, {
458
511
  capture: !0,
459
512
  passive: !1
460
- }), k.addEventListener("touchstart", W, {
513
+ }), O.addEventListener("touchstart", U, {
461
514
  capture: !0,
462
515
  passive: !1
463
- }), k.addEventListener("click", Y, {
516
+ }), O.addEventListener("click", J, {
464
517
  capture: !0,
465
518
  passive: !1
466
- }), k.addEventListener("keydown", q, {
519
+ }), O.addEventListener("keydown", K, {
467
520
  capture: !0,
468
521
  passive: !1
469
- }), k.addEventListener("keydown", J), N;
522
+ }), O.addEventListener("keydown", q), M;
523
+ }, X = function(e) {
524
+ j.active && !j.paused && M._setSubtreeIsolation(!1), j.adjacentElements.clear(), j.alreadySilent.clear();
525
+ var D = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Set(), k = _createForOfIteratorHelper(e), A;
526
+ try {
527
+ for (k.s(); !(A = k.n()).done;) {
528
+ var N = A.value;
529
+ D.add(N);
530
+ for (var P = typeof ShadowRoot < "u" && N.getRootNode() instanceof ShadowRoot, F = N; F;) {
531
+ D.add(F);
532
+ var I = F.parentElement, L = [];
533
+ I ? L = I.children : !I && P && (L = F.getRootNode().children, I = F.getRootNode().host, P = typeof ShadowRoot < "u" && I.getRootNode() instanceof ShadowRoot);
534
+ var R = _createForOfIteratorHelper(L), z;
535
+ try {
536
+ for (R.s(); !(z = R.n()).done;) {
537
+ var B = z.value;
538
+ O.add(B);
539
+ }
540
+ } catch (e) {
541
+ R.e(e);
542
+ } finally {
543
+ R.f();
544
+ }
545
+ F = I;
546
+ }
547
+ }
548
+ } catch (e) {
549
+ k.e(e);
550
+ } finally {
551
+ k.f();
552
+ }
553
+ D.forEach(function(e) {
554
+ O.delete(e);
555
+ }), j.adjacentElements = O;
470
556
  }, Z = function() {
471
- if (M.active) return k.removeEventListener("focusin", G, !0), k.removeEventListener("mousedown", W, !0), k.removeEventListener("touchstart", W, !0), k.removeEventListener("click", Y, !0), k.removeEventListener("keydown", q, !0), k.removeEventListener("keydown", J), N;
557
+ if (j.active) return O.removeEventListener("focusin", W, !0), O.removeEventListener("mousedown", U, !0), O.removeEventListener("touchstart", U, !0), O.removeEventListener("click", J, !0), O.removeEventListener("keydown", K, !0), O.removeEventListener("keydown", q), M;
472
558
  }, Q = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(function(e) {
473
559
  e.some(function(e) {
474
560
  return Array.from(e.removedNodes).some(function(e) {
475
- return e === M.mostRecentlyFocusedNode;
561
+ return e === j.mostRecentlyFocusedNode;
476
562
  });
477
- }) && V(L());
563
+ }) && B(I());
478
564
  }) : void 0, $ = function() {
479
- Q && (Q.disconnect(), M.active && !M.paused && M.containers.map(function(e) {
565
+ Q && (Q.disconnect(), j.active && !j.paused && j.containers.map(function(e) {
480
566
  Q.observe(e, {
481
567
  subtree: !0,
482
568
  childList: !0
483
569
  });
484
570
  }));
485
571
  };
486
- return N = {
572
+ return M = {
487
573
  get active() {
488
- return M.active;
574
+ return j.active;
489
575
  },
490
576
  get paused() {
491
- return M.paused;
577
+ return j.paused;
492
578
  },
493
579
  activate: function(e) {
494
- if (M.active) return this;
495
- var O = P(e, "onActivate"), A = P(e, "onPostActivate"), j = P(e, "checkCanFocusTrap");
496
- j || z(), M.active = !0, M.paused = !1, M.nodeFocusedBeforeActivation = B(k), O?.();
497
- var N = function() {
498
- j && z(), X(), $(), A?.();
499
- };
500
- return j ? (j(M.containers.concat()).then(N, N), this) : (N(), this);
580
+ if (j.active) return this;
581
+ var D = N(e, "onActivate"), P = N(e, "onPostActivate"), F = N(e, "checkCanFocusTrap"), I = activeFocusTraps.getActiveTrap(k), L = !1;
582
+ if (I && !I.paused) {
583
+ var B;
584
+ (B = I._setSubtreeIsolation) == null || B.call(I, !1), L = !0;
585
+ }
586
+ try {
587
+ F || R(), j.active = !0, j.paused = !1, j.nodeFocusedBeforeActivation = z(O), D?.();
588
+ var V = function() {
589
+ F && R(), Y(), $(), A.isolateSubtrees && M._setSubtreeIsolation(!0), P?.();
590
+ };
591
+ if (F) return F(j.containers.concat()).then(V, V), this;
592
+ V();
593
+ } catch (e) {
594
+ if (I === activeFocusTraps.getActiveTrap(k) && L) {
595
+ var H;
596
+ (H = I._setSubtreeIsolation) == null || H.call(I, !0);
597
+ }
598
+ throw e;
599
+ }
600
+ return this;
501
601
  },
502
602
  deactivate: function(e) {
503
- if (!M.active) return this;
504
- var O = _objectSpread2({
505
- onDeactivate: j.onDeactivate,
506
- onPostDeactivate: j.onPostDeactivate,
507
- checkCanReturnFocus: j.checkCanReturnFocus
603
+ if (!j.active) return this;
604
+ var D = _objectSpread2({
605
+ onDeactivate: A.onDeactivate,
606
+ onPostDeactivate: A.onPostDeactivate,
607
+ checkCanReturnFocus: A.checkCanReturnFocus
508
608
  }, e);
509
- clearTimeout(M.delayInitialFocusTimer), M.delayInitialFocusTimer = void 0, Z(), M.active = !1, M.paused = !1, $(), activeFocusTraps.deactivateTrap(A, N);
510
- var k = P(O, "onDeactivate"), F = P(O, "onPostDeactivate"), I = P(O, "checkCanReturnFocus"), L = P(O, "returnFocus", "returnFocusOnDeactivate");
511
- k?.();
512
- var R = function() {
609
+ clearTimeout(j.delayInitialFocusTimer), j.delayInitialFocusTimer = void 0, j.paused || M._setSubtreeIsolation(!1), j.alreadySilent.clear(), Z(), j.active = !1, j.paused = !1, $(), activeFocusTraps.deactivateTrap(k, M);
610
+ var O = N(D, "onDeactivate"), P = N(D, "onPostDeactivate"), F = N(D, "checkCanReturnFocus"), I = N(D, "returnFocus", "returnFocusOnDeactivate");
611
+ O?.();
612
+ var L = function() {
513
613
  delay(function() {
514
- L && V(H(M.nodeFocusedBeforeActivation)), F?.();
614
+ I && B(V(j.nodeFocusedBeforeActivation)), P?.();
515
615
  });
516
616
  };
517
- return L && I ? (I(H(M.nodeFocusedBeforeActivation)).then(R, R), this) : (R(), this);
617
+ return I && F ? (F(V(j.nodeFocusedBeforeActivation)).then(L, L), this) : (L(), this);
518
618
  },
519
619
  pause: function(e) {
520
- return M.active ? (M.manuallyPaused = !0, this._setPausedState(!0, e)) : this;
620
+ return j.active ? (j.manuallyPaused = !0, this._setPausedState(!0, e)) : this;
521
621
  },
522
622
  unpause: function(e) {
523
- return !M.active || (M.manuallyPaused = !1, A[A.length - 1] !== this) ? this : this._setPausedState(!1, e);
623
+ return !j.active || (j.manuallyPaused = !1, k[k.length - 1] !== this) ? this : this._setPausedState(!1, e);
524
624
  },
525
625
  updateContainerElements: function(e) {
526
- return M.containers = [].concat(e).filter(Boolean).map(function(e) {
527
- return typeof e == "string" ? k.querySelector(e) : e;
528
- }), M.active && z(), $(), this;
626
+ return j.containers = [].concat(e).filter(Boolean).map(function(e) {
627
+ return typeof e == "string" ? O.querySelector(e) : e;
628
+ }), A.isolateSubtrees && X(j.containers), j.active && (R(), A.isolateSubtrees && !j.paused && M._setSubtreeIsolation(!0)), $(), this;
529
629
  }
530
- }, Object.defineProperties(N, {
630
+ }, Object.defineProperties(M, {
531
631
  _isManuallyPaused: { value: function() {
532
- return M.manuallyPaused;
632
+ return j.manuallyPaused;
533
633
  } },
534
- _setPausedState: { value: function(e, O) {
535
- if (M.paused === e) return this;
536
- if (M.paused = e, e) {
537
- var k = P(O, "onPause"), A = P(O, "onPostPause");
538
- k?.(), Z(), $(), A?.();
634
+ _setPausedState: { value: function(e, D) {
635
+ if (j.paused === e) return this;
636
+ if (j.paused = e, e) {
637
+ var O = N(D, "onPause"), k = N(D, "onPostPause");
638
+ O?.(), Z(), $(), M._setSubtreeIsolation(!1), k?.();
539
639
  } else {
540
- var j = P(O, "onUnpause"), N = P(O, "onPostUnpause");
541
- j?.(), z(), X(), $(), N?.();
640
+ var A = N(D, "onUnpause"), P = N(D, "onPostUnpause");
641
+ A?.(), M._setSubtreeIsolation(!0), R(), Y(), $(), P?.();
542
642
  }
543
643
  return this;
644
+ } },
645
+ _setSubtreeIsolation: { value: function(e) {
646
+ A.isolateSubtrees && j.adjacentElements.forEach(function(D) {
647
+ if (e) switch (A.isolateSubtrees) {
648
+ case "aria-hidden":
649
+ (D.ariaHidden === "true" || D.getAttribute("aria-hidden")?.toLowerCase() === "true") && j.alreadySilent.add(D), D.setAttribute("aria-hidden", "true");
650
+ break;
651
+ default:
652
+ (D.inert || D.hasAttribute("inert")) && j.alreadySilent.add(D), D.setAttribute("inert", !0);
653
+ break;
654
+ }
655
+ else if (!j.alreadySilent.has(D)) switch (A.isolateSubtrees) {
656
+ case "aria-hidden":
657
+ D.removeAttribute("aria-hidden");
658
+ break;
659
+ default:
660
+ D.removeAttribute("inert");
661
+ break;
662
+ }
663
+ });
544
664
  } }
545
- }), N.updateContainerElements(e), N;
665
+ }), M.updateContainerElements(e), M;
546
666
  }, GlobalToggle = class extends HTMLElement {
547
667
  internals_;
548
668
  controller;
@@ -571,34 +691,34 @@ var activeFocusTraps = {
571
691
  allowOutsideClick: !0,
572
692
  onActivate: () => document.body.classList.add(this.scrollLockClass),
573
693
  onDeactivate: () => document.body.classList.remove(this.scrollLockClass),
574
- checkCanFocusTrap: ([e]) => new Promise((O) => {
575
- let k = setInterval(() => {
576
- getComputedStyle(e).visibility !== "hidden" && (O(), clearInterval(k));
694
+ checkCanFocusTrap: ([e]) => new Promise((D) => {
695
+ let O = setInterval(() => {
696
+ getComputedStyle(e).visibility !== "hidden" && (D(), clearInterval(O));
577
697
  }, 5);
578
698
  })
579
699
  });
580
- let { signal: O } = this.controller;
581
- this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal: O }), document.addEventListener("keydown", this.handleKeyDown, { signal: O });
700
+ let { signal: D } = this.controller;
701
+ this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal: D }), document.addEventListener("keydown", this.handleKeyDown, { signal: D });
582
702
  }
583
703
  disconnectedCallback() {
584
704
  this.widget.detach(), this.controller.abort();
585
705
  }
586
706
  handleBreakpoint = ({ matches: e }) => {
587
707
  if (!this.trigger) return;
588
- let { signal: O } = this.controller;
589
- e ? (this.widget.attach(), this.target.setAttribute("inert", ""), this.trigger.addEventListener("disclosure-toggle", this.handleDisclosure, { signal: O })) : (this.widget.detach(), this.target.removeAttribute("inert"), this.target.classList.remove(this.scrollLockClass), this.trigger.removeEventListener("disclosure-toggle", this.handleDisclosure), this.focusTrap.deactivate());
708
+ let { signal: D } = this.controller;
709
+ e ? (this.widget.attach(), this.target.setAttribute("inert", ""), this.trigger.addEventListener("disclosure-toggle", this.handleDisclosure, { signal: D })) : (this.widget.detach(), this.target.removeAttribute("inert"), this.target.classList.remove(this.scrollLockClass), this.trigger.removeEventListener("disclosure-toggle", this.handleDisclosure), this.focusTrap.deactivate());
590
710
  };
591
711
  handleDisclosure = ({ detail: e }) => {
592
- let { isOpen: O } = e, k = O ? "Open" : "Close", A = O ? "Close" : "Open";
593
- this.trigger.textContent = this.triggerText.replace(k, A), O ? this.focusTrap.activate() : this.focusTrap.deactivate(), O && this.hideOther && this.otherTrigger && this.otherTrigger.getAttribute("aria-expanded") === "true" && this.otherTrigger.click(), this.trigger.classList.toggle(this.isSearch ? this.searchIconClass : this.menuIconClass), this.trigger.classList.toggle(this.closeIconClass), this.target.classList.toggle(this.backgroundClass), this.trigger.removeAttribute("no-focus"), this.isOpen = O;
712
+ let { isOpen: D } = e, O = D ? "Open" : "Close", k = D ? "Close" : "Open";
713
+ this.trigger.textContent = this.triggerText.replace(O, k), D ? this.focusTrap.activate() : this.focusTrap.deactivate(), D && this.hideOther && this.otherTrigger && this.otherTrigger.getAttribute("aria-expanded") === "true" && this.otherTrigger.click(), this.trigger.classList.toggle(this.isSearch ? this.searchIconClass : this.menuIconClass), this.trigger.classList.toggle(this.closeIconClass), this.target.classList.toggle(this.backgroundClass), this.trigger.removeAttribute("no-focus"), this.isOpen = D;
594
714
  };
595
715
  handleKeyDown = (e) => {
596
716
  this.isOpen && e.key === "Escape" && this.widget.handleToggle();
597
717
  };
598
718
  get trigger() {
599
- let e = this.querySelector(":scope > button"), O = e.getAttribute("aria-controls");
600
- if (!e || !O) throw Error(`${this.localName} must contain a <button aria-controls="element-to-trigger"> element.`);
601
- return e.removeAttribute("disabled"), this.controls = O, this.triggerText = e.textContent, e;
719
+ let e = this.querySelector(":scope > button"), D = e.getAttribute("aria-controls");
720
+ if (!e || !D) throw Error(`${this.localName} must contain a <button aria-controls="element-to-trigger"> element.`);
721
+ return e.removeAttribute("disabled"), this.controls = D, this.triggerText = e.textContent, e;
602
722
  }
603
723
  get target() {
604
724
  let e = document.querySelector(`div[id="${this.controls}"]`);