@sps-woodland/focused-task 8.24.0 → 8.24.2
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.
- package/lib/index.js +504 -502
- package/lib/index.umd.cjs +3 -3
- package/lib/style.css +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
import { Metadata as Le, cl as
|
2
|
-
import { Button as
|
3
|
-
import * as
|
4
|
-
import h, { useRef as
|
5
|
-
import
|
6
|
-
import { code as
|
7
|
-
const
|
1
|
+
import { Metadata as Le, cl as X, combineEventHandlers as $e, useChildTestIdAttrBuilder as Ze, selectChildren as et, contentOf as he } from "@sps-woodland/core";
|
2
|
+
import { Button as tt } from "@sps-woodland/buttons";
|
3
|
+
import * as f from "react";
|
4
|
+
import h, { useRef as y, useCallback as S, useState as j, useContext as A, useEffect as P, useMemo as H, createContext as nt } from "react";
|
5
|
+
import rt from "react-dom";
|
6
|
+
import { code as Ee } from "@spscommerce/utils";
|
7
|
+
const E = typeof document < "u" ? h.useLayoutEffect : () => {
|
8
8
|
};
|
9
|
-
function
|
10
|
-
const t =
|
11
|
-
return
|
9
|
+
function K(e) {
|
10
|
+
const t = y(null);
|
11
|
+
return E(() => {
|
12
12
|
t.current = e;
|
13
13
|
}, [
|
14
14
|
e
|
@@ -17,8 +17,8 @@ function q(e) {
|
|
17
17
|
return r == null ? void 0 : r(...n);
|
18
18
|
}, []);
|
19
19
|
}
|
20
|
-
function
|
21
|
-
let [t, n] =
|
20
|
+
function ot(e) {
|
21
|
+
let [t, n] = j(e), r = y(null), o = K(() => {
|
22
22
|
if (!r.current) return;
|
23
23
|
let a = r.current.next();
|
24
24
|
if (a.done) {
|
@@ -27,10 +27,10 @@ function lt(e) {
|
|
27
27
|
}
|
28
28
|
t === a.value ? o() : n(a.value);
|
29
29
|
});
|
30
|
-
|
30
|
+
E(() => {
|
31
31
|
r.current && o();
|
32
32
|
});
|
33
|
-
let i =
|
33
|
+
let i = K((a) => {
|
34
34
|
r.current = a(t), o();
|
35
35
|
});
|
36
36
|
return [
|
@@ -38,13 +38,13 @@ function lt(e) {
|
|
38
38
|
i
|
39
39
|
];
|
40
40
|
}
|
41
|
-
const
|
41
|
+
const Y = {
|
42
42
|
prefix: String(Math.round(Math.random() * 1e10)),
|
43
43
|
current: 0
|
44
|
-
}, Ce = /* @__PURE__ */ h.createContext(
|
45
|
-
let
|
46
|
-
function
|
47
|
-
let t =
|
44
|
+
}, Ce = /* @__PURE__ */ h.createContext(Y), at = /* @__PURE__ */ h.createContext(!1);
|
45
|
+
let it = !!(typeof window < "u" && window.document && window.document.createElement), oe = /* @__PURE__ */ new WeakMap();
|
46
|
+
function lt(e = !1) {
|
47
|
+
let t = A(Ce), n = y(null);
|
48
48
|
if (n.current === null && !e) {
|
49
49
|
var r, o;
|
50
50
|
let i = (o = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || o === void 0 || (r = o.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
|
@@ -59,41 +59,41 @@ function ct(e = !1) {
|
|
59
59
|
}
|
60
60
|
return n.current;
|
61
61
|
}
|
62
|
-
function
|
63
|
-
let t =
|
64
|
-
t ===
|
65
|
-
let n =
|
62
|
+
function st(e) {
|
63
|
+
let t = A(Ce);
|
64
|
+
t === Y && !it && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
65
|
+
let n = lt(!!e), r = t === Y && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
|
66
66
|
return e || `${r}-${n}`;
|
67
67
|
}
|
68
|
-
function
|
69
|
-
let t = h.useId(), [n] =
|
68
|
+
function ct(e) {
|
69
|
+
let t = h.useId(), [n] = j(_e()), r = n || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${Y.prefix}`;
|
70
70
|
return e || `${r}-${t}`;
|
71
71
|
}
|
72
|
-
const
|
73
|
-
function
|
72
|
+
const ut = typeof h.useId == "function" ? ct : st;
|
73
|
+
function dt() {
|
74
74
|
return !1;
|
75
75
|
}
|
76
|
-
function
|
76
|
+
function ft() {
|
77
77
|
return !0;
|
78
78
|
}
|
79
|
-
function
|
79
|
+
function pt(e) {
|
80
80
|
return () => {
|
81
81
|
};
|
82
82
|
}
|
83
83
|
function _e() {
|
84
|
-
return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(
|
84
|
+
return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(pt, dt, ft) : A(at);
|
85
85
|
}
|
86
|
-
let
|
86
|
+
let vt = !!(typeof window < "u" && window.document && window.document.createElement), L = /* @__PURE__ */ new Map();
|
87
87
|
function Oe(e) {
|
88
|
-
let [t, n] =
|
88
|
+
let [t, n] = j(e), r = y(null), o = ut(t), i = S((a) => {
|
89
89
|
r.current = a;
|
90
90
|
}, []);
|
91
|
-
return
|
91
|
+
return vt && (L.has(o) && !L.get(o).includes(i) ? L.set(o, [
|
92
92
|
...L.get(o),
|
93
93
|
i
|
94
94
|
]) : L.set(o, [
|
95
95
|
i
|
96
|
-
])),
|
96
|
+
])), E(() => {
|
97
97
|
let a = o;
|
98
98
|
return () => {
|
99
99
|
L.delete(a);
|
@@ -105,7 +105,7 @@ function Oe(e) {
|
|
105
105
|
a && (r.current = null, n(a));
|
106
106
|
}), o;
|
107
107
|
}
|
108
|
-
function
|
108
|
+
function bt(e, t) {
|
109
109
|
if (e === t) return e;
|
110
110
|
let n = L.get(e);
|
111
111
|
if (n)
|
@@ -113,8 +113,8 @@ function ht(e, t) {
|
|
113
113
|
let r = L.get(t);
|
114
114
|
return r ? (r.forEach((o) => o(e)), e) : t;
|
115
115
|
}
|
116
|
-
function
|
117
|
-
let t = Oe(), [n, r] =
|
116
|
+
function mt(e = []) {
|
117
|
+
let t = Oe(), [n, r] = ot(t), o = S(() => {
|
118
118
|
r(function* () {
|
119
119
|
yield t, yield document.getElementById(t) ? t : void 0;
|
120
120
|
});
|
@@ -122,21 +122,21 @@ function gt(e = []) {
|
|
122
122
|
t,
|
123
123
|
r
|
124
124
|
]);
|
125
|
-
return
|
125
|
+
return E(o, [
|
126
126
|
t,
|
127
127
|
o,
|
128
128
|
...e
|
129
129
|
]), n;
|
130
130
|
}
|
131
|
-
function
|
131
|
+
function Q(...e) {
|
132
132
|
return (...t) => {
|
133
133
|
for (let n of e) typeof n == "function" && n(...t);
|
134
134
|
};
|
135
135
|
}
|
136
|
-
const
|
136
|
+
const g = (e) => {
|
137
137
|
var t;
|
138
138
|
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
139
|
-
},
|
139
|
+
}, Z = (e) => e && "window" in e && e.window === e ? e : g(e).defaultView || window;
|
140
140
|
function Me(e) {
|
141
141
|
var t, n, r = "";
|
142
142
|
if (typeof e == "string" || typeof e == "number") r += e;
|
@@ -146,11 +146,11 @@ function Me(e) {
|
|
146
146
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
147
147
|
return r;
|
148
148
|
}
|
149
|
-
function
|
149
|
+
function $t() {
|
150
150
|
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Me(e)) && (r && (r += " "), r += t);
|
151
151
|
return r;
|
152
152
|
}
|
153
|
-
function
|
153
|
+
function ht(...e) {
|
154
154
|
let t = {
|
155
155
|
...e[0]
|
156
156
|
};
|
@@ -161,19 +161,19 @@ function wt(...e) {
|
|
161
161
|
typeof i == "function" && typeof a == "function" && // This is a lot faster than a regex.
|
162
162
|
o[0] === "o" && o[1] === "n" && o.charCodeAt(2) >= /* 'A' */
|
163
163
|
65 && o.charCodeAt(2) <= /* 'Z' */
|
164
|
-
90 ? t[o] =
|
164
|
+
90 ? t[o] = Q(i, a) : (o === "className" || o === "UNSAFE_className") && typeof i == "string" && typeof a == "string" ? t[o] = $t(i, a) : o === "id" && i && a ? t.id = bt(i, a) : t[o] = a !== void 0 ? a : i;
|
165
165
|
}
|
166
166
|
}
|
167
167
|
return t;
|
168
168
|
}
|
169
|
-
const
|
169
|
+
const Et = /* @__PURE__ */ new Set([
|
170
170
|
"id"
|
171
|
-
]),
|
171
|
+
]), gt = /* @__PURE__ */ new Set([
|
172
172
|
"aria-label",
|
173
173
|
"aria-labelledby",
|
174
174
|
"aria-describedby",
|
175
175
|
"aria-details"
|
176
|
-
]),
|
176
|
+
]), wt = /* @__PURE__ */ new Set([
|
177
177
|
"href",
|
178
178
|
"hrefLang",
|
179
179
|
"target",
|
@@ -181,37 +181,37 @@ const yt = /* @__PURE__ */ new Set([
|
|
181
181
|
"download",
|
182
182
|
"ping",
|
183
183
|
"referrerPolicy"
|
184
|
-
]),
|
185
|
-
function
|
184
|
+
]), yt = /^(data-.*)$/;
|
185
|
+
function Tt(e, t = {}) {
|
186
186
|
let { labelable: n, isLink: r, propNames: o } = t, i = {};
|
187
|
-
for (const a in e) Object.prototype.hasOwnProperty.call(e, a) && (
|
187
|
+
for (const a in e) Object.prototype.hasOwnProperty.call(e, a) && (Et.has(a) || n && gt.has(a) || r && wt.has(a) || o != null && o.has(a) || yt.test(a)) && (i[a] = e[a]);
|
188
188
|
return i;
|
189
189
|
}
|
190
|
-
function
|
191
|
-
if (
|
190
|
+
function ge(e) {
|
191
|
+
if (xt()) e.focus({
|
192
192
|
preventScroll: !0
|
193
193
|
});
|
194
194
|
else {
|
195
|
-
let t =
|
196
|
-
e.focus(),
|
195
|
+
let t = kt(e);
|
196
|
+
e.focus(), St(t);
|
197
197
|
}
|
198
198
|
}
|
199
|
-
let
|
200
|
-
function
|
201
|
-
if (
|
202
|
-
|
199
|
+
let U = null;
|
200
|
+
function xt() {
|
201
|
+
if (U == null) {
|
202
|
+
U = !1;
|
203
203
|
try {
|
204
204
|
document.createElement("div").focus({
|
205
205
|
get preventScroll() {
|
206
|
-
return
|
206
|
+
return U = !0, !0;
|
207
207
|
}
|
208
208
|
});
|
209
209
|
} catch {
|
210
210
|
}
|
211
211
|
}
|
212
|
-
return
|
212
|
+
return U;
|
213
213
|
}
|
214
|
-
function
|
214
|
+
function kt(e) {
|
215
215
|
let t = e.parentNode, n = [], r = document.scrollingElement || document.documentElement;
|
216
216
|
for (; t instanceof HTMLElement && t !== r; )
|
217
217
|
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push({
|
@@ -225,11 +225,11 @@ function Ft(e) {
|
|
225
225
|
scrollLeft: r.scrollLeft
|
226
226
|
}), n;
|
227
227
|
}
|
228
|
-
function
|
228
|
+
function St(e) {
|
229
229
|
for (let { element: t, scrollTop: n, scrollLeft: r } of e)
|
230
230
|
t.scrollTop = n, t.scrollLeft = r;
|
231
231
|
}
|
232
|
-
function
|
232
|
+
function Nt(e) {
|
233
233
|
var t;
|
234
234
|
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
|
235
235
|
}
|
@@ -237,25 +237,23 @@ function pe(e) {
|
|
237
237
|
var t;
|
238
238
|
return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
|
239
239
|
}
|
240
|
-
function
|
240
|
+
function q(e) {
|
241
241
|
let t = null;
|
242
242
|
return () => (t == null && (t = e()), t);
|
243
243
|
}
|
244
|
-
const
|
244
|
+
const De = q(function() {
|
245
245
|
return pe(/^Mac/i);
|
246
|
-
}),
|
246
|
+
}), Ft = q(function() {
|
247
247
|
return pe(/^iPhone/i);
|
248
|
-
}),
|
248
|
+
}), Pt = q(function() {
|
249
249
|
return pe(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
250
|
-
|
251
|
-
}),
|
252
|
-
return
|
253
|
-
}),
|
254
|
-
return
|
255
|
-
}), We = I(function() {
|
256
|
-
return De(/Android/i);
|
250
|
+
De() && navigator.maxTouchPoints > 1;
|
251
|
+
}), Lt = q(function() {
|
252
|
+
return Ft() || Pt();
|
253
|
+
}), Ct = q(function() {
|
254
|
+
return Nt(/Android/i);
|
257
255
|
});
|
258
|
-
let
|
256
|
+
let M = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set();
|
259
257
|
function we() {
|
260
258
|
if (typeof window > "u") return;
|
261
259
|
function e(r) {
|
@@ -263,14 +261,14 @@ function we() {
|
|
263
261
|
}
|
264
262
|
let t = (r) => {
|
265
263
|
if (!e(r) || !r.target) return;
|
266
|
-
let o =
|
267
|
-
o || (o = /* @__PURE__ */ new Set(),
|
264
|
+
let o = M.get(r.target);
|
265
|
+
o || (o = /* @__PURE__ */ new Set(), M.set(r.target, o), r.target.addEventListener("transitioncancel", n, {
|
268
266
|
once: !0
|
269
267
|
})), o.add(r.propertyName);
|
270
268
|
}, n = (r) => {
|
271
269
|
if (!e(r) || !r.target) return;
|
272
|
-
let o =
|
273
|
-
if (o && (o.delete(r.propertyName), o.size === 0 && (r.target.removeEventListener("transitioncancel", n),
|
270
|
+
let o = M.get(r.target);
|
271
|
+
if (o && (o.delete(r.propertyName), o.size === 0 && (r.target.removeEventListener("transitioncancel", n), M.delete(r.target)), M.size === 0)) {
|
274
272
|
for (let i of le) i();
|
275
273
|
le.clear();
|
276
274
|
}
|
@@ -278,65 +276,64 @@ function we() {
|
|
278
276
|
document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", n);
|
279
277
|
}
|
280
278
|
typeof document < "u" && (document.readyState !== "loading" ? we() : document.addEventListener("DOMContentLoaded", we));
|
281
|
-
function
|
279
|
+
function _t(e) {
|
282
280
|
requestAnimationFrame(() => {
|
283
|
-
|
281
|
+
M.size === 0 ? e() : le.add(e);
|
284
282
|
});
|
285
283
|
}
|
286
284
|
function ye(e, t) {
|
287
|
-
if (!e) return !1;
|
288
285
|
let n = window.getComputedStyle(e), r = /(auto|scroll)/.test(n.overflow + n.overflowX + n.overflowY);
|
289
286
|
return r && t && (r = e.scrollHeight !== e.clientHeight || e.scrollWidth !== e.clientWidth), r;
|
290
287
|
}
|
291
|
-
function
|
288
|
+
function Ae(e, t) {
|
292
289
|
let n = e;
|
293
290
|
for (ye(n, t) && (n = n.parentElement); n && !ye(n, t); ) n = n.parentElement;
|
294
291
|
return n || document.scrollingElement || document.documentElement;
|
295
292
|
}
|
296
|
-
function
|
297
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 :
|
293
|
+
function Ot(e) {
|
294
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Ct() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
298
295
|
}
|
299
|
-
function
|
300
|
-
let [r, o] =
|
296
|
+
function Mt(e, t, n) {
|
297
|
+
let [r, o] = j(e || t), i = y(e !== void 0), a = e !== void 0;
|
301
298
|
P(() => {
|
302
299
|
let l = i.current;
|
303
300
|
l !== a && console.warn(`WARN: A component changed from ${l ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}.`), i.current = a;
|
304
301
|
}, [
|
305
302
|
a
|
306
303
|
]);
|
307
|
-
let
|
308
|
-
let d = (
|
309
|
-
n && (Object.is(
|
304
|
+
let c = a ? e : r, u = S((l, ...s) => {
|
305
|
+
let d = (p, ...b) => {
|
306
|
+
n && (Object.is(c, p) || n(p, ...b)), a || (c = p);
|
310
307
|
};
|
311
|
-
typeof l == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), o((
|
312
|
-
let k = l(a ?
|
313
|
-
return d(k, ...
|
314
|
-
})) : (a || o(l), d(l, ...
|
308
|
+
typeof l == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), o((b, ...v) => {
|
309
|
+
let k = l(a ? c : b, ...v);
|
310
|
+
return d(k, ...s), a ? b : k;
|
311
|
+
})) : (a || o(l), d(l, ...s));
|
315
312
|
}, [
|
316
313
|
a,
|
317
|
-
|
314
|
+
c,
|
318
315
|
n
|
319
316
|
]);
|
320
317
|
return [
|
321
|
-
|
322
|
-
|
318
|
+
c,
|
319
|
+
u
|
323
320
|
];
|
324
321
|
}
|
325
|
-
const
|
322
|
+
const We = h.createContext({
|
326
323
|
register: () => {
|
327
324
|
}
|
328
325
|
});
|
329
|
-
|
330
|
-
function
|
331
|
-
let t =
|
326
|
+
We.displayName = "PressResponderContext";
|
327
|
+
function Dt({ children: e }) {
|
328
|
+
let t = H(() => ({
|
332
329
|
register: () => {
|
333
330
|
}
|
334
331
|
}), []);
|
335
|
-
return /* @__PURE__ */ h.createElement(
|
332
|
+
return /* @__PURE__ */ h.createElement(We.Provider, {
|
336
333
|
value: t
|
337
334
|
}, e);
|
338
335
|
}
|
339
|
-
class
|
336
|
+
class At {
|
340
337
|
isDefaultPrevented() {
|
341
338
|
return this.nativeEvent.defaultPrevented;
|
342
339
|
}
|
@@ -355,25 +352,25 @@ class It {
|
|
355
352
|
this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = t;
|
356
353
|
}
|
357
354
|
}
|
358
|
-
function
|
359
|
-
let t =
|
355
|
+
function Wt(e) {
|
356
|
+
let t = y({
|
360
357
|
isFocused: !1,
|
361
358
|
observer: null
|
362
359
|
});
|
363
|
-
|
360
|
+
E(() => {
|
364
361
|
const r = t.current;
|
365
362
|
return () => {
|
366
363
|
r.observer && (r.observer.disconnect(), r.observer = null);
|
367
364
|
};
|
368
365
|
}, []);
|
369
|
-
let n =
|
366
|
+
let n = K((r) => {
|
370
367
|
e == null || e(r);
|
371
368
|
});
|
372
369
|
return S((r) => {
|
373
370
|
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
|
374
371
|
t.current.isFocused = !0;
|
375
372
|
let o = r.target, i = (a) => {
|
376
|
-
t.current.isFocused = !1, o.disabled && n(new
|
373
|
+
t.current.isFocused = !1, o.disabled && n(new At("blur", a)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
377
374
|
};
|
378
375
|
o.addEventListener("focusout", i, {
|
379
376
|
once: !0
|
@@ -381,12 +378,12 @@ function Rt(e) {
|
|
381
378
|
if (t.current.isFocused && o.disabled) {
|
382
379
|
var a;
|
383
380
|
(a = t.current.observer) === null || a === void 0 || a.disconnect();
|
384
|
-
let
|
381
|
+
let c = o === document.activeElement ? null : document.activeElement;
|
385
382
|
o.dispatchEvent(new FocusEvent("blur", {
|
386
|
-
relatedTarget:
|
383
|
+
relatedTarget: c
|
387
384
|
})), o.dispatchEvent(new FocusEvent("focusout", {
|
388
385
|
bubbles: !0,
|
389
|
-
relatedTarget:
|
386
|
+
relatedTarget: c
|
390
387
|
}));
|
391
388
|
}
|
392
389
|
}), t.current.observer.observe(o, {
|
@@ -400,59 +397,59 @@ function Rt(e) {
|
|
400
397
|
n
|
401
398
|
]);
|
402
399
|
}
|
403
|
-
let
|
404
|
-
function
|
405
|
-
for (let n of
|
400
|
+
let z = null, It = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Map(), O = !1, se = !1;
|
401
|
+
function ve(e, t) {
|
402
|
+
for (let n of It) n(e, t);
|
406
403
|
}
|
407
|
-
function
|
408
|
-
return !(e.metaKey || !
|
404
|
+
function Bt(e) {
|
405
|
+
return !(e.metaKey || !De() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
409
406
|
}
|
410
|
-
function
|
411
|
-
|
407
|
+
function ee(e) {
|
408
|
+
O = !0, Bt(e) && (z = "keyboard", ve("keyboard", e));
|
412
409
|
}
|
413
|
-
function
|
414
|
-
|
410
|
+
function x(e) {
|
411
|
+
z = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (O = !0, ve("pointer", e));
|
415
412
|
}
|
416
|
-
function
|
417
|
-
|
413
|
+
function Ie(e) {
|
414
|
+
Ot(e) && (O = !0, z = "virtual");
|
418
415
|
}
|
419
|
-
function
|
420
|
-
e.target === window || e.target === document || (!
|
416
|
+
function Be(e) {
|
417
|
+
e.target === window || e.target === document || (!O && !se && (z = "virtual", ve("virtual", e)), O = !1, se = !1);
|
421
418
|
}
|
422
|
-
function
|
423
|
-
|
419
|
+
function Re() {
|
420
|
+
O = !1, se = !0;
|
424
421
|
}
|
425
422
|
function Te(e) {
|
426
|
-
if (typeof window > "u" ||
|
427
|
-
const t =
|
423
|
+
if (typeof window > "u" || V.get(Z(e))) return;
|
424
|
+
const t = Z(e), n = g(e);
|
428
425
|
let r = t.HTMLElement.prototype.focus;
|
429
426
|
t.HTMLElement.prototype.focus = function() {
|
430
|
-
|
431
|
-
}, n.addEventListener("keydown",
|
432
|
-
|
427
|
+
O = !0, r.apply(this, arguments);
|
428
|
+
}, n.addEventListener("keydown", ee, !0), n.addEventListener("keyup", ee, !0), n.addEventListener("click", Ie, !0), t.addEventListener("focus", Be, !0), t.addEventListener("blur", Re, !1), typeof PointerEvent < "u" ? (n.addEventListener("pointerdown", x, !0), n.addEventListener("pointermove", x, !0), n.addEventListener("pointerup", x, !0)) : (n.addEventListener("mousedown", x, !0), n.addEventListener("mousemove", x, !0), n.addEventListener("mouseup", x, !0)), t.addEventListener("beforeunload", () => {
|
429
|
+
He(e);
|
433
430
|
}, {
|
434
431
|
once: !0
|
435
|
-
}),
|
432
|
+
}), V.set(t, {
|
436
433
|
focus: r
|
437
434
|
});
|
438
435
|
}
|
439
|
-
const
|
440
|
-
const n =
|
441
|
-
t && r.removeEventListener("DOMContentLoaded", t),
|
436
|
+
const He = (e, t) => {
|
437
|
+
const n = Z(e), r = g(e);
|
438
|
+
t && r.removeEventListener("DOMContentLoaded", t), V.has(n) && (n.HTMLElement.prototype.focus = V.get(n).focus, r.removeEventListener("keydown", ee, !0), r.removeEventListener("keyup", ee, !0), r.removeEventListener("click", Ie, !0), n.removeEventListener("focus", Be, !0), n.removeEventListener("blur", Re, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", x, !0), r.removeEventListener("pointermove", x, !0), r.removeEventListener("pointerup", x, !0)) : (r.removeEventListener("mousedown", x, !0), r.removeEventListener("mousemove", x, !0), r.removeEventListener("mouseup", x, !0)), V.delete(n));
|
442
439
|
};
|
443
|
-
function
|
444
|
-
const t =
|
440
|
+
function Rt(e) {
|
441
|
+
const t = g(e);
|
445
442
|
let n;
|
446
443
|
return t.readyState !== "loading" ? Te(e) : (n = () => {
|
447
444
|
Te(e);
|
448
|
-
}, t.addEventListener("DOMContentLoaded", n)), () =>
|
445
|
+
}, t.addEventListener("DOMContentLoaded", n)), () => He(e, n);
|
449
446
|
}
|
450
|
-
typeof document < "u" &&
|
451
|
-
function
|
452
|
-
return
|
447
|
+
typeof document < "u" && Rt();
|
448
|
+
function Ht() {
|
449
|
+
return z;
|
453
450
|
}
|
454
|
-
function
|
455
|
-
let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, i =
|
451
|
+
function Vt(e) {
|
452
|
+
let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, i = y({
|
456
453
|
isFocusWithin: !1
|
457
454
|
}), a = S((l) => {
|
458
455
|
i.current.isFocusWithin && !l.currentTarget.contains(l.relatedTarget) && (i.current.isFocusWithin = !1, n && n(l), o && o(!1));
|
@@ -460,12 +457,12 @@ function Kt(e) {
|
|
460
457
|
n,
|
461
458
|
o,
|
462
459
|
i
|
463
|
-
]),
|
464
|
-
!i.current.isFocusWithin && document.activeElement === l.target && (r && r(l), o && o(!0), i.current.isFocusWithin = !0,
|
460
|
+
]), c = Wt(a), u = S((l) => {
|
461
|
+
!i.current.isFocusWithin && document.activeElement === l.target && (r && r(l), o && o(!0), i.current.isFocusWithin = !0, c(l));
|
465
462
|
}, [
|
466
463
|
r,
|
467
464
|
o,
|
468
|
-
|
465
|
+
c
|
469
466
|
]);
|
470
467
|
return t ? {
|
471
468
|
focusWithinProps: {
|
@@ -475,49 +472,49 @@ function Kt(e) {
|
|
475
472
|
}
|
476
473
|
} : {
|
477
474
|
focusWithinProps: {
|
478
|
-
onFocus:
|
475
|
+
onFocus: u,
|
479
476
|
onBlur: a
|
480
477
|
}
|
481
478
|
};
|
482
479
|
}
|
483
|
-
function
|
484
|
-
let { ref: t, onInteractOutside: n, isDisabled: r, onInteractOutsideStart: o } = e, i =
|
480
|
+
function Kt(e) {
|
481
|
+
let { ref: t, onInteractOutside: n, isDisabled: r, onInteractOutsideStart: o } = e, i = y({
|
485
482
|
isPointerDown: !1,
|
486
483
|
ignoreEmulatedMouseEvents: !1
|
487
|
-
}), a =
|
488
|
-
n &&
|
489
|
-
}),
|
490
|
-
n && n(
|
484
|
+
}), a = K((u) => {
|
485
|
+
n && G(u, t) && (o && o(u), i.current.isPointerDown = !0);
|
486
|
+
}), c = K((u) => {
|
487
|
+
n && n(u);
|
491
488
|
});
|
492
489
|
P(() => {
|
493
|
-
let
|
490
|
+
let u = i.current;
|
494
491
|
if (r) return;
|
495
|
-
const l = t.current,
|
492
|
+
const l = t.current, s = g(l);
|
496
493
|
if (typeof PointerEvent < "u") {
|
497
|
-
let d = (
|
498
|
-
|
494
|
+
let d = (p) => {
|
495
|
+
u.isPointerDown && G(p, t) && c(p), u.isPointerDown = !1;
|
499
496
|
};
|
500
|
-
return
|
501
|
-
|
497
|
+
return s.addEventListener("pointerdown", a, !0), s.addEventListener("pointerup", d, !0), () => {
|
498
|
+
s.removeEventListener("pointerdown", a, !0), s.removeEventListener("pointerup", d, !0);
|
502
499
|
};
|
503
500
|
} else {
|
504
|
-
let d = (
|
505
|
-
|
506
|
-
},
|
507
|
-
|
501
|
+
let d = (b) => {
|
502
|
+
u.ignoreEmulatedMouseEvents ? u.ignoreEmulatedMouseEvents = !1 : u.isPointerDown && G(b, t) && c(b), u.isPointerDown = !1;
|
503
|
+
}, p = (b) => {
|
504
|
+
u.ignoreEmulatedMouseEvents = !0, u.isPointerDown && G(b, t) && c(b), u.isPointerDown = !1;
|
508
505
|
};
|
509
|
-
return
|
510
|
-
|
506
|
+
return s.addEventListener("mousedown", a, !0), s.addEventListener("mouseup", d, !0), s.addEventListener("touchstart", a, !0), s.addEventListener("touchend", p, !0), () => {
|
507
|
+
s.removeEventListener("mousedown", a, !0), s.removeEventListener("mouseup", d, !0), s.removeEventListener("touchstart", a, !0), s.removeEventListener("touchend", p, !0);
|
511
508
|
};
|
512
509
|
}
|
513
510
|
}, [
|
514
511
|
t,
|
515
512
|
r,
|
516
513
|
a,
|
517
|
-
|
514
|
+
c
|
518
515
|
]);
|
519
516
|
}
|
520
|
-
function
|
517
|
+
function G(e, t) {
|
521
518
|
if (e.button > 0) return !1;
|
522
519
|
if (e.target) {
|
523
520
|
const n = e.target.ownerDocument;
|
@@ -525,88 +522,88 @@ function J(e, t) {
|
|
525
522
|
}
|
526
523
|
return t.current && !t.current.contains(e.target);
|
527
524
|
}
|
528
|
-
function
|
529
|
-
const t =
|
530
|
-
if (
|
525
|
+
function ce(e) {
|
526
|
+
const t = g(e);
|
527
|
+
if (Ht() === "virtual") {
|
531
528
|
let n = t.activeElement;
|
532
|
-
|
533
|
-
t.activeElement === n && e.isConnected &&
|
529
|
+
_t(() => {
|
530
|
+
t.activeElement === n && e.isConnected && ge(e);
|
534
531
|
});
|
535
|
-
} else
|
532
|
+
} else ge(e);
|
536
533
|
}
|
537
|
-
function
|
538
|
-
const t =
|
534
|
+
function jt(e) {
|
535
|
+
const t = Z(e);
|
539
536
|
if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement)) return !1;
|
540
537
|
let { display: n, visibility: r } = e.style, o = n !== "none" && r !== "hidden" && r !== "collapse";
|
541
538
|
if (o) {
|
542
539
|
const { getComputedStyle: i } = e.ownerDocument.defaultView;
|
543
|
-
let { display: a, visibility:
|
544
|
-
o = a !== "none" &&
|
540
|
+
let { display: a, visibility: c } = i(e);
|
541
|
+
o = a !== "none" && c !== "hidden" && c !== "collapse";
|
545
542
|
}
|
546
543
|
return o;
|
547
544
|
}
|
548
|
-
function
|
545
|
+
function qt(e, t) {
|
549
546
|
return !e.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking.
|
550
547
|
!e.hasAttribute("data-react-aria-prevent-focus") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
|
551
548
|
}
|
552
|
-
function
|
553
|
-
return e.nodeName !== "#comment" &&
|
549
|
+
function Ve(e, t) {
|
550
|
+
return e.nodeName !== "#comment" && jt(e) && qt(e, t) && (!e.parentElement || Ve(e.parentElement, e));
|
554
551
|
}
|
555
|
-
const xe = /* @__PURE__ */ h.createContext(null),
|
556
|
-
let
|
557
|
-
function
|
558
|
-
let { children: t, contain: n, restoreFocus: r, autoFocus: o } = e, i =
|
559
|
-
scopeRef:
|
552
|
+
const xe = /* @__PURE__ */ h.createContext(null), ue = "react-aria-focus-scope-restore";
|
553
|
+
let m = null;
|
554
|
+
function zt(e) {
|
555
|
+
let { children: t, contain: n, restoreFocus: r, autoFocus: o } = e, i = y(null), a = y(null), c = y([]), { parentNode: u } = A(xe) || {}, l = H(() => new fe({
|
556
|
+
scopeRef: c
|
560
557
|
}), [
|
561
|
-
|
558
|
+
c
|
562
559
|
]);
|
563
|
-
|
564
|
-
let
|
565
|
-
if ($.getTreeNode(
|
566
|
-
let
|
567
|
-
|
560
|
+
E(() => {
|
561
|
+
let p = u || $.root;
|
562
|
+
if ($.getTreeNode(p.scopeRef) && m && !ne(m, p.scopeRef)) {
|
563
|
+
let b = $.getTreeNode(m);
|
564
|
+
b && (p = b);
|
568
565
|
}
|
569
|
-
|
566
|
+
p.addChild(l), $.addNode(l);
|
570
567
|
}, [
|
571
568
|
l,
|
572
|
-
|
573
|
-
]),
|
574
|
-
let
|
575
|
-
|
569
|
+
u
|
570
|
+
]), E(() => {
|
571
|
+
let p = $.getTreeNode(c);
|
572
|
+
p && (p.contain = !!n);
|
576
573
|
}, [
|
577
574
|
n
|
578
|
-
]),
|
579
|
-
var
|
580
|
-
let
|
581
|
-
for (;
|
582
|
-
|
583
|
-
return
|
584
|
-
for (let
|
575
|
+
]), E(() => {
|
576
|
+
var p;
|
577
|
+
let b = (p = i.current) === null || p === void 0 ? void 0 : p.nextSibling, v = [], k = (W) => W.stopPropagation();
|
578
|
+
for (; b && b !== a.current; )
|
579
|
+
v.push(b), b.addEventListener(ue, k), b = b.nextSibling;
|
580
|
+
return c.current = v, () => {
|
581
|
+
for (let W of v) W.removeEventListener(ue, k);
|
585
582
|
};
|
586
583
|
}, [
|
587
584
|
t
|
588
|
-
]),
|
589
|
-
const
|
590
|
-
let
|
591
|
-
if (
|
592
|
-
for (let
|
593
|
-
|
585
|
+
]), Zt(c, r, n), Xt(c, n), tn(c, r, n), Qt(c, o), P(() => {
|
586
|
+
const p = g(c.current ? c.current[0] : void 0).activeElement;
|
587
|
+
let b = null;
|
588
|
+
if (w(p, c.current)) {
|
589
|
+
for (let v of $.traverse()) v.scopeRef && w(p, v.scopeRef.current) && (b = v);
|
590
|
+
b === $.getTreeNode(c) && (m = b.scopeRef);
|
594
591
|
}
|
595
592
|
}, [
|
596
|
-
|
597
|
-
]),
|
598
|
-
var
|
599
|
-
let k = (
|
600
|
-
(
|
593
|
+
c
|
594
|
+
]), E(() => () => {
|
595
|
+
var p, b, v;
|
596
|
+
let k = (v = (b = $.getTreeNode(c)) === null || b === void 0 || (p = b.parent) === null || p === void 0 ? void 0 : p.scopeRef) !== null && v !== void 0 ? v : null;
|
597
|
+
(c === m || ne(c, m)) && (!k || $.getTreeNode(k)) && (m = k), $.removeTreeNode(c);
|
601
598
|
}, [
|
602
|
-
|
599
|
+
c
|
603
600
|
]);
|
604
|
-
let
|
605
|
-
focusManager:
|
601
|
+
let s = H(() => Ut(c), []), d = H(() => ({
|
602
|
+
focusManager: s,
|
606
603
|
parentNode: l
|
607
604
|
}), [
|
608
605
|
l,
|
609
|
-
|
606
|
+
s
|
610
607
|
]);
|
611
608
|
return /* @__PURE__ */ h.createElement(xe.Provider, {
|
612
609
|
value: d
|
@@ -620,47 +617,47 @@ function Ut(e) {
|
|
620
617
|
ref: a
|
621
618
|
}));
|
622
619
|
}
|
623
|
-
function
|
620
|
+
function Ut(e) {
|
624
621
|
return {
|
625
622
|
focusNext(t = {}) {
|
626
|
-
let n = e.current, { from: r, tabbable: o, wrap: i, accept: a } = t,
|
623
|
+
let n = e.current, { from: r, tabbable: o, wrap: i, accept: a } = t, c = r || g(n[0]).activeElement, u = n[0].previousElementSibling, l = _(n), s = C(l, {
|
627
624
|
tabbable: o,
|
628
625
|
accept: a
|
629
626
|
}, n);
|
630
|
-
|
631
|
-
let d =
|
632
|
-
return !d && i && (
|
627
|
+
s.currentNode = w(c, n) ? c : u;
|
628
|
+
let d = s.nextNode();
|
629
|
+
return !d && i && (s.currentNode = u, d = s.nextNode()), d && F(d, !0), d;
|
633
630
|
},
|
634
631
|
focusPrevious(t = {}) {
|
635
|
-
let n = e.current, { from: r, tabbable: o, wrap: i, accept: a } = t,
|
632
|
+
let n = e.current, { from: r, tabbable: o, wrap: i, accept: a } = t, c = r || g(n[0]).activeElement, u = n[n.length - 1].nextElementSibling, l = _(n), s = C(l, {
|
636
633
|
tabbable: o,
|
637
634
|
accept: a
|
638
635
|
}, n);
|
639
|
-
|
640
|
-
let d =
|
641
|
-
return !d && i && (
|
636
|
+
s.currentNode = w(c, n) ? c : u;
|
637
|
+
let d = s.previousNode();
|
638
|
+
return !d && i && (s.currentNode = u, d = s.previousNode()), d && F(d, !0), d;
|
642
639
|
},
|
643
640
|
focusFirst(t = {}) {
|
644
|
-
let n = e.current, { tabbable: r, accept: o } = t, i =
|
641
|
+
let n = e.current, { tabbable: r, accept: o } = t, i = _(n), a = C(i, {
|
645
642
|
tabbable: r,
|
646
643
|
accept: o
|
647
644
|
}, n);
|
648
645
|
a.currentNode = n[0].previousElementSibling;
|
649
|
-
let
|
650
|
-
return
|
646
|
+
let c = a.nextNode();
|
647
|
+
return c && F(c, !0), c;
|
651
648
|
},
|
652
649
|
focusLast(t = {}) {
|
653
|
-
let n = e.current, { tabbable: r, accept: o } = t, i =
|
650
|
+
let n = e.current, { tabbable: r, accept: o } = t, i = _(n), a = C(i, {
|
654
651
|
tabbable: r,
|
655
652
|
accept: o
|
656
653
|
}, n);
|
657
654
|
a.currentNode = n[n.length - 1].nextElementSibling;
|
658
|
-
let
|
659
|
-
return
|
655
|
+
let c = a.previousNode();
|
656
|
+
return c && F(c, !0), c;
|
660
657
|
}
|
661
658
|
};
|
662
659
|
}
|
663
|
-
const
|
660
|
+
const be = [
|
664
661
|
"input:not([disabled]):not([type=hidden])",
|
665
662
|
"select:not([disabled])",
|
666
663
|
"textarea:not([disabled])",
|
@@ -673,79 +670,78 @@ const me = [
|
|
673
670
|
"embed",
|
674
671
|
"audio[controls]",
|
675
672
|
"video[controls]",
|
676
|
-
|
677
|
-
],
|
678
|
-
|
679
|
-
const
|
680
|
-
function
|
673
|
+
"[contenteditable]"
|
674
|
+
], Gt = be.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
675
|
+
be.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
676
|
+
const Jt = be.join(':not([hidden]):not([tabindex="-1"]),');
|
677
|
+
function _(e) {
|
681
678
|
return e[0].parentElement;
|
682
679
|
}
|
683
|
-
function
|
684
|
-
let t = $.getTreeNode(
|
680
|
+
function R(e) {
|
681
|
+
let t = $.getTreeNode(m);
|
685
682
|
for (; t && t.scopeRef !== e; ) {
|
686
683
|
if (t.contain) return !1;
|
687
684
|
t = t.parent;
|
688
685
|
}
|
689
686
|
return !0;
|
690
687
|
}
|
691
|
-
function
|
692
|
-
let n =
|
693
|
-
|
688
|
+
function Xt(e, t) {
|
689
|
+
let n = y(void 0), r = y(void 0);
|
690
|
+
E(() => {
|
694
691
|
let o = e.current;
|
695
692
|
if (!t) {
|
696
693
|
r.current && (cancelAnimationFrame(r.current), r.current = void 0);
|
697
694
|
return;
|
698
695
|
}
|
699
|
-
const i =
|
696
|
+
const i = g(o ? o[0] : void 0);
|
700
697
|
let a = (l) => {
|
701
|
-
if (l.key !== "Tab" || l.altKey || l.ctrlKey || l.metaKey || !
|
702
|
-
let
|
703
|
-
if (!d || !
|
704
|
-
let
|
698
|
+
if (l.key !== "Tab" || l.altKey || l.ctrlKey || l.metaKey || !R(e) || l.isComposing) return;
|
699
|
+
let s = i.activeElement, d = e.current;
|
700
|
+
if (!d || !w(s, d)) return;
|
701
|
+
let p = _(d), b = C(p, {
|
705
702
|
tabbable: !0
|
706
703
|
}, d);
|
707
|
-
if (!
|
708
|
-
|
709
|
-
let
|
710
|
-
|
711
|
-
}, s = (l) => {
|
712
|
-
(!v || ne(v, e)) && x(l.target, e.current) ? (v = e, n.current = l.target) : V(e) && !C(l.target, e) ? n.current ? n.current.focus() : v && v.current && de(v.current) : V(e) && (n.current = l.target);
|
704
|
+
if (!s) return;
|
705
|
+
b.currentNode = s;
|
706
|
+
let v = l.shiftKey ? b.previousNode() : b.nextNode();
|
707
|
+
v || (b.currentNode = l.shiftKey ? d[d.length - 1].nextElementSibling : d[0].previousElementSibling, v = l.shiftKey ? b.previousNode() : b.nextNode()), l.preventDefault(), v && F(v, !0);
|
713
708
|
}, c = (l) => {
|
709
|
+
(!m || ne(m, e)) && w(l.target, e.current) ? (m = e, n.current = l.target) : R(e) && !te(l.target, e) ? n.current ? n.current.focus() : m && m.current && de(m.current) : R(e) && (n.current = l.target);
|
710
|
+
}, u = (l) => {
|
714
711
|
r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
} else v.current && de(v.current);
|
712
|
+
if (i.activeElement && R(e) && !te(i.activeElement, e))
|
713
|
+
if (m = e, i.body.contains(l.target)) {
|
714
|
+
var s;
|
715
|
+
n.current = l.target, (s = n.current) === null || s === void 0 || s.focus();
|
716
|
+
} else m.current && de(m.current);
|
721
717
|
});
|
722
718
|
};
|
723
|
-
return i.addEventListener("keydown", a, !1), i.addEventListener("focusin",
|
724
|
-
i.removeEventListener("keydown", a, !1), i.removeEventListener("focusin",
|
719
|
+
return i.addEventListener("keydown", a, !1), i.addEventListener("focusin", c, !1), o == null || o.forEach((l) => l.addEventListener("focusin", c, !1)), o == null || o.forEach((l) => l.addEventListener("focusout", u, !1)), () => {
|
720
|
+
i.removeEventListener("keydown", a, !1), i.removeEventListener("focusin", c, !1), o == null || o.forEach((l) => l.removeEventListener("focusin", c, !1)), o == null || o.forEach((l) => l.removeEventListener("focusout", u, !1));
|
725
721
|
};
|
726
722
|
}, [
|
727
723
|
e,
|
728
724
|
t
|
729
|
-
]),
|
725
|
+
]), E(() => () => {
|
730
726
|
r.current && cancelAnimationFrame(r.current);
|
731
727
|
}, [
|
732
728
|
r
|
733
729
|
]);
|
734
730
|
}
|
735
|
-
function
|
736
|
-
return
|
731
|
+
function Ke(e) {
|
732
|
+
return te(e);
|
737
733
|
}
|
738
|
-
function
|
734
|
+
function w(e, t) {
|
739
735
|
return !e || !t ? !1 : t.some((n) => n.contains(e));
|
740
736
|
}
|
741
|
-
function
|
737
|
+
function te(e, t = null) {
|
742
738
|
if (e instanceof Element && e.closest("[data-react-aria-top-layer]")) return !0;
|
743
739
|
for (let { scopeRef: n } of $.traverse($.getTreeNode(t)))
|
744
|
-
if (n &&
|
740
|
+
if (n && w(e, n.current)) return !0;
|
745
741
|
return !1;
|
746
742
|
}
|
747
|
-
function
|
748
|
-
return
|
743
|
+
function Yt(e) {
|
744
|
+
return te(e, m);
|
749
745
|
}
|
750
746
|
function ne(e, t) {
|
751
747
|
var n;
|
@@ -758,7 +754,7 @@ function ne(e, t) {
|
|
758
754
|
}
|
759
755
|
function F(e, t = !1) {
|
760
756
|
if (e != null && !t) try {
|
761
|
-
|
757
|
+
ce(e);
|
762
758
|
} catch {
|
763
759
|
}
|
764
760
|
else if (e != null) try {
|
@@ -766,40 +762,40 @@ function F(e, t = !1) {
|
|
766
762
|
} catch {
|
767
763
|
}
|
768
764
|
}
|
769
|
-
function
|
770
|
-
let n = e[0].previousElementSibling, r =
|
765
|
+
function je(e, t = !0) {
|
766
|
+
let n = e[0].previousElementSibling, r = _(e), o = C(r, {
|
771
767
|
tabbable: t
|
772
768
|
}, e);
|
773
769
|
o.currentNode = n;
|
774
770
|
let i = o.nextNode();
|
775
|
-
return t && !i && (r =
|
771
|
+
return t && !i && (r = _(e), o = C(r, {
|
776
772
|
tabbable: !1
|
777
773
|
}, e), o.currentNode = n, i = o.nextNode()), i;
|
778
774
|
}
|
779
775
|
function de(e, t = !0) {
|
780
|
-
F(
|
776
|
+
F(je(e, t));
|
781
777
|
}
|
782
|
-
function
|
778
|
+
function Qt(e, t) {
|
783
779
|
const n = h.useRef(t);
|
784
780
|
P(() => {
|
785
781
|
if (n.current) {
|
786
|
-
|
787
|
-
const r =
|
788
|
-
!
|
782
|
+
m = e;
|
783
|
+
const r = g(e.current ? e.current[0] : void 0);
|
784
|
+
!w(r.activeElement, m.current) && e.current && de(e.current);
|
789
785
|
}
|
790
786
|
n.current = !1;
|
791
787
|
}, [
|
792
788
|
e
|
793
789
|
]);
|
794
790
|
}
|
795
|
-
function
|
796
|
-
|
791
|
+
function Zt(e, t, n) {
|
792
|
+
E(() => {
|
797
793
|
if (t || n) return;
|
798
794
|
let r = e.current;
|
799
|
-
const o =
|
795
|
+
const o = g(r ? r[0] : void 0);
|
800
796
|
let i = (a) => {
|
801
|
-
let
|
802
|
-
|
797
|
+
let c = a.target;
|
798
|
+
w(c, e.current) ? m = e : Ke(c) || (m = null);
|
803
799
|
};
|
804
800
|
return o.addEventListener("focusin", i, !1), r == null || r.forEach((a) => a.addEventListener("focusin", i, !1)), () => {
|
805
801
|
o.removeEventListener("focusin", i, !1), r == null || r.forEach((a) => a.removeEventListener("focusin", i, !1));
|
@@ -810,8 +806,8 @@ function en(e, t, n) {
|
|
810
806
|
n
|
811
807
|
]);
|
812
808
|
}
|
813
|
-
function
|
814
|
-
let t = $.getTreeNode(
|
809
|
+
function en(e) {
|
810
|
+
let t = $.getTreeNode(m);
|
815
811
|
for (; t && t.scopeRef !== e; ) {
|
816
812
|
if (t.nodeToRestore) return !1;
|
817
813
|
t = t.parent;
|
@@ -819,40 +815,40 @@ function ke(e) {
|
|
819
815
|
return (t == null ? void 0 : t.scopeRef) === e;
|
820
816
|
}
|
821
817
|
function tn(e, t, n) {
|
822
|
-
const r =
|
823
|
-
|
818
|
+
const r = y(typeof document < "u" ? g(e.current ? e.current[0] : void 0).activeElement : null);
|
819
|
+
E(() => {
|
824
820
|
let o = e.current;
|
825
|
-
const i =
|
821
|
+
const i = g(o ? o[0] : void 0);
|
826
822
|
if (!t || n) return;
|
827
823
|
let a = () => {
|
828
|
-
(!
|
824
|
+
(!m || ne(m, e)) && w(i.activeElement, e.current) && (m = e);
|
829
825
|
};
|
830
|
-
return i.addEventListener("focusin", a, !1), o == null || o.forEach((
|
831
|
-
i.removeEventListener("focusin", a, !1), o == null || o.forEach((
|
826
|
+
return i.addEventListener("focusin", a, !1), o == null || o.forEach((c) => c.addEventListener("focusin", a, !1)), () => {
|
827
|
+
i.removeEventListener("focusin", a, !1), o == null || o.forEach((c) => c.removeEventListener("focusin", a, !1));
|
832
828
|
};
|
833
829
|
}, [
|
834
830
|
e,
|
835
831
|
n
|
836
|
-
]),
|
837
|
-
const o =
|
832
|
+
]), E(() => {
|
833
|
+
const o = g(e.current ? e.current[0] : void 0);
|
838
834
|
if (!t) return;
|
839
835
|
let i = (a) => {
|
840
|
-
if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !
|
841
|
-
let
|
842
|
-
if (!
|
843
|
-
let
|
844
|
-
if (!
|
845
|
-
let l =
|
836
|
+
if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !R(e) || a.isComposing) return;
|
837
|
+
let c = o.activeElement;
|
838
|
+
if (!w(c, e.current)) return;
|
839
|
+
let u = $.getTreeNode(e);
|
840
|
+
if (!u) return;
|
841
|
+
let l = u.nodeToRestore, s = C(o.body, {
|
846
842
|
tabbable: !0
|
847
843
|
});
|
848
|
-
|
849
|
-
let d = a.shiftKey ?
|
850
|
-
if ((!l || !o.body.contains(l) || l === o.body) && (l = void 0,
|
851
|
-
|
844
|
+
s.currentNode = c;
|
845
|
+
let d = a.shiftKey ? s.previousNode() : s.nextNode();
|
846
|
+
if ((!l || !o.body.contains(l) || l === o.body) && (l = void 0, u.nodeToRestore = void 0), (!d || !w(d, e.current)) && l) {
|
847
|
+
s.currentNode = l;
|
852
848
|
do
|
853
|
-
d = a.shiftKey ?
|
854
|
-
while (
|
855
|
-
a.preventDefault(), a.stopPropagation(), d ? F(d, !0) :
|
849
|
+
d = a.shiftKey ? s.previousNode() : s.nextNode();
|
850
|
+
while (w(d, e.current));
|
851
|
+
a.preventDefault(), a.stopPropagation(), d ? F(d, !0) : Ke(l) ? F(l, !0) : c.blur();
|
856
852
|
}
|
857
853
|
};
|
858
854
|
return n || o.addEventListener("keydown", i, !0), () => {
|
@@ -862,35 +858,36 @@ function tn(e, t, n) {
|
|
862
858
|
e,
|
863
859
|
t,
|
864
860
|
n
|
865
|
-
]),
|
866
|
-
const o =
|
861
|
+
]), E(() => {
|
862
|
+
const o = g(e.current ? e.current[0] : void 0);
|
867
863
|
if (!t) return;
|
868
864
|
let i = $.getTreeNode(e);
|
869
865
|
if (i) {
|
870
866
|
var a;
|
871
867
|
return i.nodeToRestore = (a = r.current) !== null && a !== void 0 ? a : void 0, () => {
|
872
|
-
let
|
873
|
-
if (!
|
874
|
-
let
|
875
|
-
if (t &&
|
868
|
+
let c = $.getTreeNode(e);
|
869
|
+
if (!c) return;
|
870
|
+
let u = c.nodeToRestore;
|
871
|
+
if (t && u && // eslint-disable-next-line react-hooks/exhaustive-deps
|
872
|
+
(w(o.activeElement, e.current) || o.activeElement === o.body && en(e))) {
|
876
873
|
let l = $.clone();
|
877
874
|
requestAnimationFrame(() => {
|
878
875
|
if (o.activeElement === o.body) {
|
879
|
-
let
|
880
|
-
for (;
|
881
|
-
if (
|
882
|
-
|
876
|
+
let s = l.getTreeNode(e);
|
877
|
+
for (; s; ) {
|
878
|
+
if (s.nodeToRestore && s.nodeToRestore.isConnected) {
|
879
|
+
ke(s.nodeToRestore);
|
883
880
|
return;
|
884
881
|
}
|
885
|
-
|
882
|
+
s = s.parent;
|
886
883
|
}
|
887
|
-
for (
|
888
|
-
if (
|
889
|
-
let d =
|
890
|
-
|
884
|
+
for (s = l.getTreeNode(e); s; ) {
|
885
|
+
if (s.scopeRef && s.scopeRef.current && $.getTreeNode(s.scopeRef)) {
|
886
|
+
let d = je(s.scopeRef.current, !0);
|
887
|
+
ke(d);
|
891
888
|
return;
|
892
889
|
}
|
893
|
-
|
890
|
+
s = s.parent;
|
894
891
|
}
|
895
892
|
}
|
896
893
|
});
|
@@ -902,22 +899,22 @@ function tn(e, t, n) {
|
|
902
899
|
t
|
903
900
|
]);
|
904
901
|
}
|
905
|
-
function
|
906
|
-
e.dispatchEvent(new CustomEvent(
|
902
|
+
function ke(e) {
|
903
|
+
e.dispatchEvent(new CustomEvent(ue, {
|
907
904
|
bubbles: !0,
|
908
905
|
cancelable: !0
|
909
906
|
})) && F(e);
|
910
907
|
}
|
911
|
-
function
|
912
|
-
let r = t != null && t.tabbable ?
|
908
|
+
function C(e, t, n) {
|
909
|
+
let r = t != null && t.tabbable ? Jt : Gt, o = g(e).createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
913
910
|
acceptNode(i) {
|
914
911
|
var a;
|
915
|
-
return !(t == null || (a = t.from) === null || a === void 0) && a.contains(i) ? NodeFilter.FILTER_REJECT : i.matches(r) &&
|
912
|
+
return !(t == null || (a = t.from) === null || a === void 0) && a.contains(i) ? NodeFilter.FILTER_REJECT : i.matches(r) && Ve(i) && (!n || w(i, n)) && (!(t != null && t.accept) || t.accept(i)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
916
913
|
}
|
917
914
|
});
|
918
915
|
return t != null && t.from && (o.currentNode = t.from), o;
|
919
916
|
}
|
920
|
-
class
|
917
|
+
class me {
|
921
918
|
get size() {
|
922
919
|
return this.fastMap.size;
|
923
920
|
}
|
@@ -940,7 +937,7 @@ class ve {
|
|
940
937
|
let n = this.fastMap.get(t);
|
941
938
|
if (!n) return;
|
942
939
|
let r = n.parent;
|
943
|
-
for (let i of this.traverse()) i !== n && n.nodeToRestore && i.nodeToRestore && n.scopeRef && n.scopeRef.current &&
|
940
|
+
for (let i of this.traverse()) i !== n && n.nodeToRestore && i.nodeToRestore && n.scopeRef && n.scopeRef.current && w(i.nodeToRestore, n.scopeRef.current) && (i.nodeToRestore = n.nodeToRestore);
|
944
941
|
let o = n.children;
|
945
942
|
r && (r.removeChild(n), o.size > 0 && o.forEach((i) => r && r.addChild(i))), this.fastMap.delete(n.scopeRef);
|
946
943
|
}
|
@@ -950,7 +947,7 @@ class ve {
|
|
950
947
|
}
|
951
948
|
clone() {
|
952
949
|
var t;
|
953
|
-
let n = new
|
950
|
+
let n = new me();
|
954
951
|
var r;
|
955
952
|
for (let o of this.traverse()) n.addTreeNode(o.scopeRef, (r = (t = o.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, o.nodeToRestore);
|
956
953
|
return n;
|
@@ -972,64 +969,66 @@ class fe {
|
|
972
969
|
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
|
973
970
|
}
|
974
971
|
}
|
975
|
-
let $ = new
|
972
|
+
let $ = new me();
|
976
973
|
const nn = /* @__PURE__ */ new WeakMap(), N = [];
|
977
974
|
function rn(e, t) {
|
978
|
-
let { onClose: n, shouldCloseOnBlur: r, isOpen: o, isDismissable: i = !1, isKeyboardDismissDisabled: a = !1, shouldCloseOnInteractOutside:
|
975
|
+
let { onClose: n, shouldCloseOnBlur: r, isOpen: o, isDismissable: i = !1, isKeyboardDismissDisabled: a = !1, shouldCloseOnInteractOutside: c } = e;
|
979
976
|
P(() => (o && N.push(t), () => {
|
980
|
-
let
|
981
|
-
|
977
|
+
let v = N.indexOf(t);
|
978
|
+
v >= 0 && N.splice(v, 1);
|
982
979
|
}), [
|
983
980
|
o,
|
984
981
|
t
|
985
982
|
]);
|
986
|
-
let
|
983
|
+
let u = () => {
|
987
984
|
N[N.length - 1] === t && n && n();
|
988
|
-
}, l = (
|
989
|
-
(!
|
990
|
-
},
|
991
|
-
(!
|
992
|
-
}, d = (
|
993
|
-
|
985
|
+
}, l = (v) => {
|
986
|
+
(!c || c(v.target)) && N[N.length - 1] === t && (v.stopPropagation(), v.preventDefault());
|
987
|
+
}, s = (v) => {
|
988
|
+
(!c || c(v.target)) && (N[N.length - 1] === t && (v.stopPropagation(), v.preventDefault()), u());
|
989
|
+
}, d = (v) => {
|
990
|
+
v.key === "Escape" && !a && !v.nativeEvent.isComposing && (v.stopPropagation(), v.preventDefault(), u());
|
994
991
|
};
|
995
|
-
|
992
|
+
Kt({
|
996
993
|
ref: t,
|
997
|
-
onInteractOutside: i && o ?
|
994
|
+
onInteractOutside: i && o ? s : null,
|
998
995
|
onInteractOutsideStart: l
|
999
996
|
});
|
1000
|
-
let { focusWithinProps:
|
997
|
+
let { focusWithinProps: p } = Vt({
|
1001
998
|
isDisabled: !r,
|
1002
|
-
onBlurWithin: (
|
1003
|
-
!
|
999
|
+
onBlurWithin: (v) => {
|
1000
|
+
!v.relatedTarget || Yt(v.relatedTarget) || (!c || c(v.relatedTarget)) && n();
|
1004
1001
|
}
|
1005
|
-
}),
|
1006
|
-
|
1002
|
+
}), b = (v) => {
|
1003
|
+
v.target === v.currentTarget && v.preventDefault();
|
1007
1004
|
};
|
1008
1005
|
return {
|
1009
1006
|
overlayProps: {
|
1010
1007
|
onKeyDown: d,
|
1011
|
-
...
|
1008
|
+
...p
|
1012
1009
|
},
|
1013
1010
|
underlayProps: {
|
1014
|
-
onPointerDown:
|
1011
|
+
onPointerDown: b
|
1015
1012
|
}
|
1016
1013
|
};
|
1017
1014
|
}
|
1018
1015
|
function on(e, t, n) {
|
1019
|
-
let {
|
1016
|
+
let { type: r } = e, { isOpen: o } = t;
|
1020
1017
|
P(() => {
|
1021
1018
|
n && n.current && nn.set(n.current, t.close);
|
1022
1019
|
});
|
1023
|
-
let
|
1020
|
+
let i;
|
1021
|
+
r === "menu" ? i = !0 : r === "listbox" && (i = "listbox");
|
1022
|
+
let a = Oe();
|
1024
1023
|
return {
|
1025
1024
|
triggerProps: {
|
1026
|
-
"aria-haspopup":
|
1027
|
-
"aria-expanded":
|
1028
|
-
"aria-controls":
|
1025
|
+
"aria-haspopup": i,
|
1026
|
+
"aria-expanded": o,
|
1027
|
+
"aria-controls": o ? a : null,
|
1029
1028
|
onPress: t.toggle
|
1030
1029
|
},
|
1031
1030
|
overlayProps: {
|
1032
|
-
id:
|
1031
|
+
id: a
|
1033
1032
|
}
|
1034
1033
|
};
|
1035
1034
|
}
|
@@ -1044,127 +1043,130 @@ const ae = typeof document < "u" && window.visualViewport, an = /* @__PURE__ */
|
|
1044
1043
|
"submit",
|
1045
1044
|
"reset"
|
1046
1045
|
]);
|
1047
|
-
let
|
1046
|
+
let J = 0, ie;
|
1048
1047
|
function ln(e = {}) {
|
1049
1048
|
let { isDisabled: t } = e;
|
1050
|
-
|
1049
|
+
E(() => {
|
1051
1050
|
if (!t)
|
1052
|
-
return
|
1053
|
-
|
1051
|
+
return J++, J === 1 && (Lt() ? ie = cn() : ie = sn()), () => {
|
1052
|
+
J--, J === 0 && ie();
|
1054
1053
|
};
|
1055
1054
|
}, [
|
1056
1055
|
t
|
1057
1056
|
]);
|
1058
1057
|
}
|
1059
1058
|
function sn() {
|
1060
|
-
return
|
1059
|
+
return Q(D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"));
|
1061
1060
|
}
|
1062
|
-
function
|
1061
|
+
function cn() {
|
1063
1062
|
let e, t, n = (l) => {
|
1064
|
-
e =
|
1063
|
+
e = Ae(l.target, !0), !(e === document.documentElement && e === document.body) && e instanceof HTMLElement && window.getComputedStyle(e).overscrollBehavior === "auto" && (t = D(e, "overscrollBehavior", "contain"));
|
1065
1064
|
}, r = (l) => {
|
1066
1065
|
if (!e || e === document.documentElement || e === document.body) {
|
1067
1066
|
l.preventDefault();
|
1068
1067
|
return;
|
1069
1068
|
}
|
1070
1069
|
e.scrollHeight === e.clientHeight && e.scrollWidth === e.clientWidth && l.preventDefault();
|
1071
|
-
}, o = () => {
|
1072
|
-
|
1070
|
+
}, o = (l) => {
|
1071
|
+
let s = l.target;
|
1072
|
+
Ne(s) && s !== document.activeElement && (l.preventDefault(), c(), s.style.transform = "translateY(-2000px)", s.focus(), requestAnimationFrame(() => {
|
1073
|
+
s.style.transform = "";
|
1074
|
+
})), t && t();
|
1073
1075
|
}, i = (l) => {
|
1074
|
-
let
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
}) : ae.addEventListener("resize", () =>
|
1076
|
+
let s = l.target;
|
1077
|
+
Ne(s) && (c(), s.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
1078
|
+
s.style.transform = "", ae && (ae.height < window.innerHeight ? requestAnimationFrame(() => {
|
1079
|
+
Se(s);
|
1080
|
+
}) : ae.addEventListener("resize", () => Se(s), {
|
1079
1081
|
once: !0
|
1080
1082
|
}));
|
1081
1083
|
}));
|
1082
|
-
}, a = null,
|
1084
|
+
}, a = null, c = () => {
|
1083
1085
|
if (a) return;
|
1084
1086
|
let l = () => {
|
1085
1087
|
window.scrollTo(0, 0);
|
1086
|
-
},
|
1087
|
-
a =
|
1088
|
-
window.scrollTo(
|
1088
|
+
}, s = window.pageXOffset, d = window.pageYOffset;
|
1089
|
+
a = Q(I(window, "scroll", l), D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"), D(document.body, "marginTop", `-${d}px`), () => {
|
1090
|
+
window.scrollTo(s, d);
|
1089
1091
|
}), window.scrollTo(0, 0);
|
1090
|
-
},
|
1092
|
+
}, u = Q(I(document, "touchstart", n, {
|
1091
1093
|
passive: !1,
|
1092
1094
|
capture: !0
|
1093
|
-
}),
|
1095
|
+
}), I(document, "touchmove", r, {
|
1094
1096
|
passive: !1,
|
1095
1097
|
capture: !0
|
1096
|
-
}),
|
1098
|
+
}), I(document, "touchend", o, {
|
1097
1099
|
passive: !1,
|
1098
1100
|
capture: !0
|
1099
|
-
}),
|
1101
|
+
}), I(document, "focus", i, !0));
|
1100
1102
|
return () => {
|
1101
|
-
t == null || t(), a == null || a(),
|
1103
|
+
t == null || t(), a == null || a(), u();
|
1102
1104
|
};
|
1103
1105
|
}
|
1104
|
-
function
|
1106
|
+
function D(e, t, n) {
|
1105
1107
|
let r = e.style[t];
|
1106
1108
|
return e.style[t] = n, () => {
|
1107
1109
|
e.style[t] = r;
|
1108
1110
|
};
|
1109
1111
|
}
|
1110
|
-
function
|
1112
|
+
function I(e, t, n, r) {
|
1111
1113
|
return e.addEventListener(t, n, r), () => {
|
1112
1114
|
e.removeEventListener(t, n, r);
|
1113
1115
|
};
|
1114
1116
|
}
|
1115
|
-
function
|
1116
|
-
let t = document.scrollingElement || document.documentElement
|
1117
|
-
for (;
|
1118
|
-
let
|
1119
|
-
if (
|
1120
|
-
let
|
1121
|
-
|
1117
|
+
function Se(e) {
|
1118
|
+
let t = document.scrollingElement || document.documentElement;
|
1119
|
+
for (; e && e !== t; ) {
|
1120
|
+
let n = Ae(e);
|
1121
|
+
if (n !== document.documentElement && n !== document.body && n !== e) {
|
1122
|
+
let r = n.getBoundingClientRect().top, o = e.getBoundingClientRect().top;
|
1123
|
+
o > r + e.clientHeight && (n.scrollTop += o - r);
|
1122
1124
|
}
|
1123
|
-
|
1125
|
+
e = n.parentElement;
|
1124
1126
|
}
|
1125
1127
|
}
|
1126
|
-
function
|
1128
|
+
function Ne(e) {
|
1127
1129
|
return e instanceof HTMLInputElement && !an.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
1128
1130
|
}
|
1129
|
-
let
|
1130
|
-
function
|
1131
|
-
let n = new Set(e), r = /* @__PURE__ */ new Set(), o = (
|
1132
|
-
for (let
|
1133
|
-
let l = (
|
1134
|
-
if (n.has(
|
1135
|
-
for (let
|
1136
|
-
if (
|
1131
|
+
let B = /* @__PURE__ */ new WeakMap(), T = [];
|
1132
|
+
function un(e, t = document.body) {
|
1133
|
+
let n = new Set(e), r = /* @__PURE__ */ new Set(), o = (u) => {
|
1134
|
+
for (let p of u.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) n.add(p);
|
1135
|
+
let l = (p) => {
|
1136
|
+
if (n.has(p) || r.has(p.parentElement) && p.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
|
1137
|
+
for (let b of n)
|
1138
|
+
if (p.contains(b)) return NodeFilter.FILTER_SKIP;
|
1137
1139
|
return NodeFilter.FILTER_ACCEPT;
|
1138
|
-
},
|
1140
|
+
}, s = document.createTreeWalker(u, NodeFilter.SHOW_ELEMENT, {
|
1139
1141
|
acceptNode: l
|
1140
|
-
}), d = l(
|
1141
|
-
if (d === NodeFilter.FILTER_ACCEPT && i(
|
1142
|
-
let
|
1143
|
-
for (;
|
1144
|
-
i(
|
1142
|
+
}), d = l(u);
|
1143
|
+
if (d === NodeFilter.FILTER_ACCEPT && i(u), d !== NodeFilter.FILTER_REJECT) {
|
1144
|
+
let p = s.nextNode();
|
1145
|
+
for (; p != null; )
|
1146
|
+
i(p), p = s.nextNode();
|
1145
1147
|
}
|
1146
|
-
}, i = (
|
1148
|
+
}, i = (u) => {
|
1147
1149
|
var l;
|
1148
|
-
let
|
1149
|
-
|
1150
|
+
let s = (l = B.get(u)) !== null && l !== void 0 ? l : 0;
|
1151
|
+
u.getAttribute("aria-hidden") === "true" && s === 0 || (s === 0 && u.setAttribute("aria-hidden", "true"), r.add(u), B.set(u, s + 1));
|
1150
1152
|
};
|
1151
|
-
|
1152
|
-
let a = new MutationObserver((
|
1153
|
-
for (let l of
|
1153
|
+
T.length && T[T.length - 1].disconnect(), o(t);
|
1154
|
+
let a = new MutationObserver((u) => {
|
1155
|
+
for (let l of u)
|
1154
1156
|
if (!(l.type !== "childList" || l.addedNodes.length === 0) && ![
|
1155
1157
|
...n,
|
1156
1158
|
...r
|
1157
|
-
].some((
|
1158
|
-
for (let
|
1159
|
-
for (let
|
1160
|
-
(
|
1159
|
+
].some((s) => s.contains(l.target))) {
|
1160
|
+
for (let s of l.removedNodes) s instanceof Element && (n.delete(s), r.delete(s));
|
1161
|
+
for (let s of l.addedNodes)
|
1162
|
+
(s instanceof HTMLElement || s instanceof SVGElement) && (s.dataset.liveAnnouncer === "true" || s.dataset.reactAriaTopLayer === "true") ? n.add(s) : s instanceof Element && o(s);
|
1161
1163
|
}
|
1162
1164
|
});
|
1163
1165
|
a.observe(t, {
|
1164
1166
|
childList: !0,
|
1165
1167
|
subtree: !0
|
1166
1168
|
});
|
1167
|
-
let
|
1169
|
+
let c = {
|
1168
1170
|
observe() {
|
1169
1171
|
a.observe(t, {
|
1170
1172
|
childList: !0,
|
@@ -1175,47 +1177,47 @@ function dn(e, t = document.body) {
|
|
1175
1177
|
a.disconnect();
|
1176
1178
|
}
|
1177
1179
|
};
|
1178
|
-
return
|
1180
|
+
return T.push(c), () => {
|
1179
1181
|
a.disconnect();
|
1180
|
-
for (let
|
1181
|
-
let l =
|
1182
|
-
l
|
1182
|
+
for (let u of r) {
|
1183
|
+
let l = B.get(u);
|
1184
|
+
l === 1 ? (u.removeAttribute("aria-hidden"), B.delete(u)) : B.set(u, l - 1);
|
1183
1185
|
}
|
1184
|
-
|
1186
|
+
c === T[T.length - 1] ? (T.pop(), T.length && T[T.length - 1].observe()) : T.splice(T.indexOf(c), 1);
|
1185
1187
|
};
|
1186
1188
|
}
|
1187
|
-
const
|
1188
|
-
function
|
1189
|
+
const dn = /* @__PURE__ */ nt({});
|
1190
|
+
function fn() {
|
1189
1191
|
var e;
|
1190
|
-
return (e =
|
1192
|
+
return (e = A(dn)) !== null && e !== void 0 ? e : {};
|
1191
1193
|
}
|
1192
|
-
const
|
1193
|
-
function
|
1194
|
-
let t = _e(), { portalContainer: n = t ? null : document.body, isExiting: r } = e, [o, i] =
|
1194
|
+
const qe = /* @__PURE__ */ h.createContext(null);
|
1195
|
+
function pn(e) {
|
1196
|
+
let t = _e(), { portalContainer: n = t ? null : document.body, isExiting: r } = e, [o, i] = j(!1), a = H(() => ({
|
1195
1197
|
contain: o,
|
1196
1198
|
setContain: i
|
1197
1199
|
}), [
|
1198
1200
|
o,
|
1199
1201
|
i
|
1200
|
-
]), { getContainer:
|
1201
|
-
if (!e.portalContainer &&
|
1202
|
-
let
|
1203
|
-
return e.disableFocusManagement || (
|
1202
|
+
]), { getContainer: c } = fn();
|
1203
|
+
if (!e.portalContainer && c && (n = c()), !n) return null;
|
1204
|
+
let u = e.children;
|
1205
|
+
return e.disableFocusManagement || (u = /* @__PURE__ */ h.createElement(zt, {
|
1204
1206
|
restoreFocus: !0,
|
1205
1207
|
contain: o && !r
|
1206
|
-
},
|
1208
|
+
}, u)), u = /* @__PURE__ */ h.createElement(qe.Provider, {
|
1207
1209
|
value: a
|
1208
|
-
}, /* @__PURE__ */ h.createElement(
|
1210
|
+
}, /* @__PURE__ */ h.createElement(Dt, null, u)), /* @__PURE__ */ rt.createPortal(u, n);
|
1209
1211
|
}
|
1210
|
-
function
|
1211
|
-
let e =
|
1212
|
-
|
1212
|
+
function ze() {
|
1213
|
+
let e = A(qe), t = e == null ? void 0 : e.setContain;
|
1214
|
+
E(() => {
|
1213
1215
|
t == null || t(!0);
|
1214
1216
|
}, [
|
1215
1217
|
t
|
1216
1218
|
]);
|
1217
1219
|
}
|
1218
|
-
function
|
1220
|
+
function vn(e, t, n) {
|
1219
1221
|
let { overlayProps: r, underlayProps: o } = rn({
|
1220
1222
|
...e,
|
1221
1223
|
isOpen: t.isOpen,
|
@@ -1223,27 +1225,27 @@ function mn(e, t, n) {
|
|
1223
1225
|
}, n);
|
1224
1226
|
return ln({
|
1225
1227
|
isDisabled: !t.isOpen
|
1226
|
-
}),
|
1227
|
-
if (t.isOpen
|
1228
|
+
}), ze(), P(() => {
|
1229
|
+
if (t.isOpen) return un([
|
1228
1230
|
n.current
|
1229
1231
|
]);
|
1230
1232
|
}, [
|
1231
1233
|
t.isOpen,
|
1232
1234
|
n
|
1233
1235
|
]), {
|
1234
|
-
modalProps:
|
1236
|
+
modalProps: ht(r),
|
1235
1237
|
underlayProps: o
|
1236
1238
|
};
|
1237
1239
|
}
|
1238
|
-
function
|
1239
|
-
let { role: n = "dialog" } = e, r =
|
1240
|
+
function bn(e, t) {
|
1241
|
+
let { role: n = "dialog" } = e, r = mt();
|
1240
1242
|
r = e["aria-label"] ? void 0 : r;
|
1241
|
-
let o =
|
1243
|
+
let o = y(!1);
|
1242
1244
|
return P(() => {
|
1243
1245
|
if (t.current && !t.current.contains(document.activeElement)) {
|
1244
|
-
|
1246
|
+
ce(t.current);
|
1245
1247
|
let i = setTimeout(() => {
|
1246
|
-
document.activeElement === t.current && (o.current = !0, t.current && (t.current.blur(),
|
1248
|
+
document.activeElement === t.current && (o.current = !0, t.current && (t.current.blur(), ce(t.current)), o.current = !1);
|
1247
1249
|
}, 500);
|
1248
1250
|
return () => {
|
1249
1251
|
clearTimeout(i);
|
@@ -1251,9 +1253,9 @@ function vn(e, t) {
|
|
1251
1253
|
}
|
1252
1254
|
}, [
|
1253
1255
|
t
|
1254
|
-
]),
|
1256
|
+
]), ze(), {
|
1255
1257
|
dialogProps: {
|
1256
|
-
...
|
1258
|
+
...Tt(e, {
|
1257
1259
|
labelable: !0
|
1258
1260
|
}),
|
1259
1261
|
role: n,
|
@@ -1271,7 +1273,7 @@ function vn(e, t) {
|
|
1271
1273
|
}
|
1272
1274
|
};
|
1273
1275
|
}
|
1274
|
-
function
|
1276
|
+
function mn(e, t, n) {
|
1275
1277
|
return t in e ? Object.defineProperty(e, t, {
|
1276
1278
|
value: n,
|
1277
1279
|
enumerable: !0,
|
@@ -1293,47 +1295,47 @@ function Pe(e) {
|
|
1293
1295
|
for (var t = 1; t < arguments.length; t++) {
|
1294
1296
|
var n = arguments[t] != null ? arguments[t] : {};
|
1295
1297
|
t % 2 ? Fe(Object(n), !0).forEach(function(r) {
|
1296
|
-
|
1298
|
+
mn(e, r, n[r]);
|
1297
1299
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Fe(Object(n)).forEach(function(r) {
|
1298
1300
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
1299
1301
|
});
|
1300
1302
|
}
|
1301
1303
|
return e;
|
1302
1304
|
}
|
1303
|
-
var
|
1305
|
+
var $n = (e, t, n) => {
|
1304
1306
|
for (var r of Object.keys(e)) {
|
1305
1307
|
var o;
|
1306
1308
|
if (e[r] !== ((o = t[r]) !== null && o !== void 0 ? o : n[r]))
|
1307
1309
|
return !1;
|
1308
1310
|
}
|
1309
1311
|
return !0;
|
1310
|
-
},
|
1312
|
+
}, hn = (e) => (t) => {
|
1311
1313
|
var n = e.defaultClassName, r = Pe(Pe({}, e.defaultVariants), t);
|
1312
1314
|
for (var o in r) {
|
1313
1315
|
var i, a = (i = r[o]) !== null && i !== void 0 ? i : e.defaultVariants[o];
|
1314
1316
|
if (a != null) {
|
1315
|
-
var
|
1316
|
-
typeof
|
1317
|
-
var
|
1317
|
+
var c = a;
|
1318
|
+
typeof c == "boolean" && (c = c === !0 ? "true" : "false");
|
1319
|
+
var u = (
|
1318
1320
|
// @ts-expect-error
|
1319
|
-
e.variantClassNames[o][
|
1321
|
+
e.variantClassNames[o][c]
|
1320
1322
|
);
|
1321
|
-
|
1323
|
+
u && (n += " " + u);
|
1322
1324
|
}
|
1323
1325
|
}
|
1324
|
-
for (var [l,
|
1325
|
-
|
1326
|
+
for (var [l, s] of e.compoundVariants)
|
1327
|
+
$n(l, r, e.defaultVariants) && (n += " " + s);
|
1326
1328
|
return n;
|
1327
|
-
}, En =
|
1328
|
-
function
|
1329
|
+
}, En = hn({ defaultClassName: "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq1", variantClassNames: { fullWidth: { true: "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq2", false: "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq3" } }, defaultVariants: {}, compoundVariants: [] }), gn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq5", wn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq0", yn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq9", Tn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psqa", xn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq8", kn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq4", Sn = "pkg_sps-woodland_focused-task__version_8_24_2__hash_1io4psq7";
|
1330
|
+
function Ue({
|
1329
1331
|
children: e,
|
1330
1332
|
className: t = "",
|
1331
1333
|
...n
|
1332
1334
|
}) {
|
1333
|
-
return /* @__PURE__ */
|
1335
|
+
return /* @__PURE__ */ f.createElement("div", { className: X(xn, t), ...n }, /* @__PURE__ */ f.createElement("div", { className: X(yn) }, /* @__PURE__ */ f.createElement("div", { className: X(Tn) }, e)));
|
1334
1336
|
}
|
1335
|
-
Le.set(
|
1336
|
-
function
|
1337
|
+
Le.set(Ue, { name: "FocusedTaskActions" });
|
1338
|
+
function Nn({
|
1337
1339
|
children: e,
|
1338
1340
|
className: t,
|
1339
1341
|
"data-testid": n,
|
@@ -1341,49 +1343,49 @@ function Fn({
|
|
1341
1343
|
onFocus: o,
|
1342
1344
|
overlayProps: i,
|
1343
1345
|
state: a,
|
1344
|
-
onClose:
|
1345
|
-
fullWidth:
|
1346
|
+
onClose: c,
|
1347
|
+
fullWidth: u = !1,
|
1346
1348
|
...l
|
1347
1349
|
}) {
|
1348
|
-
const
|
1350
|
+
const s = f.useRef(null), { modalProps: d, underlayProps: p } = vn(
|
1349
1351
|
{ ...l },
|
1350
1352
|
a,
|
1351
|
-
|
1352
|
-
), { dialogProps:
|
1353
|
-
function
|
1354
|
-
|
1353
|
+
s
|
1354
|
+
), { dialogProps: b, titleProps: v } = bn(l, s), k = $e(d.onFocus, b.onFocus, o), W = $e(d.onBlur, b.onBlur, r), Je = Ze({ "data-testid": n }), [re, Xe] = et(e, [{ type: Ue }]);
|
1355
|
+
function Ye() {
|
1356
|
+
c && typeof c == "function" && c(), a.close();
|
1355
1357
|
}
|
1356
|
-
const
|
1357
|
-
|
1358
|
+
const Qe = /* @__PURE__ */ f.createElement(
|
1359
|
+
tt,
|
1358
1360
|
{
|
1359
1361
|
"aria-label": "Close",
|
1360
|
-
onClick:
|
1362
|
+
onClick: Ye,
|
1361
1363
|
kind: "icon",
|
1362
1364
|
icon: "x",
|
1363
|
-
className:
|
1365
|
+
className: gn
|
1364
1366
|
}
|
1365
1367
|
);
|
1366
|
-
return /* @__PURE__ */
|
1368
|
+
return /* @__PURE__ */ f.createElement(pn, null, /* @__PURE__ */ f.createElement("div", { className: Sn, ...p, ...l }, /* @__PURE__ */ f.createElement(
|
1367
1369
|
"div",
|
1368
1370
|
{
|
1369
1371
|
...d,
|
1370
|
-
...
|
1372
|
+
...b,
|
1371
1373
|
...i,
|
1372
1374
|
onFocus: k,
|
1373
|
-
onBlur:
|
1374
|
-
...
|
1375
|
-
ref:
|
1376
|
-
className:
|
1375
|
+
onBlur: W,
|
1376
|
+
...Je("dialog"),
|
1377
|
+
ref: s,
|
1378
|
+
className: X(wn, t)
|
1377
1379
|
},
|
1378
|
-
/* @__PURE__ */
|
1379
|
-
/* @__PURE__ */
|
1380
|
-
re && re.length > 0 && /* @__PURE__ */
|
1380
|
+
/* @__PURE__ */ f.createElement("div", { ...v, className: kn }, Qe),
|
1381
|
+
/* @__PURE__ */ f.createElement("div", { className: En({ fullWidth: u }) }, he(Xe, a.close)),
|
1382
|
+
re && re.length > 0 && /* @__PURE__ */ f.createElement(f.Fragment, null, he(re, a.close))
|
1381
1383
|
)));
|
1382
1384
|
}
|
1383
|
-
function
|
1384
|
-
return e.state.isOpen ? /* @__PURE__ */
|
1385
|
+
function Ge(e) {
|
1386
|
+
return e.state.isOpen ? /* @__PURE__ */ f.createElement(Nn, { ...e }, e.children) : /* @__PURE__ */ f.createElement(f.Fragment, null);
|
1385
1387
|
}
|
1386
|
-
Le.set(
|
1388
|
+
Le.set(Ge, {
|
1387
1389
|
name: "FocusedTask",
|
1388
1390
|
props: {
|
1389
1391
|
fullWidth: { type: "boolean", default: "false" },
|
@@ -1392,8 +1394,8 @@ Le.set(Ye, {
|
|
1392
1394
|
onFocus: { type: "() => void" }
|
1393
1395
|
}
|
1394
1396
|
});
|
1395
|
-
function
|
1396
|
-
let [t, n] =
|
1397
|
+
function Fn(e) {
|
1398
|
+
let [t, n] = Mt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
|
1397
1399
|
const r = S(() => {
|
1398
1400
|
n(!0);
|
1399
1401
|
}, [
|
@@ -1416,8 +1418,8 @@ function Pn(e) {
|
|
1416
1418
|
toggle: i
|
1417
1419
|
};
|
1418
1420
|
}
|
1419
|
-
function
|
1420
|
-
const t =
|
1421
|
+
function Dn(e = {}) {
|
1422
|
+
const t = Fn(e), n = y(null), { triggerProps: r, overlayProps: o } = on({ type: "dialog" }, t, n), { onPress: i, ...a } = r;
|
1421
1423
|
return {
|
1422
1424
|
triggerProps: {
|
1423
1425
|
...a,
|
@@ -1428,18 +1430,18 @@ function An(e = {}) {
|
|
1428
1430
|
focusedTaskProps: { overlayProps: o, state: t }
|
1429
1431
|
};
|
1430
1432
|
}
|
1431
|
-
const
|
1432
|
-
components: [
|
1433
|
+
const Pn = {
|
1434
|
+
components: [Ge],
|
1433
1435
|
examples: {
|
1434
1436
|
hooks: {
|
1435
1437
|
label: "Using the Hook",
|
1436
|
-
description: () => /* @__PURE__ */
|
1438
|
+
description: () => /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("p", null, "To use the focused task component, you must call the ", /* @__PURE__ */ f.createElement("code", null, "useFocusedTask"), " hook. Optional arguments for this hook include:"), /* @__PURE__ */ f.createElement("dl", null, /* @__PURE__ */ f.createElement("dt", null, /* @__PURE__ */ f.createElement("code", null, "isOpen"), ": boolean"), /* @__PURE__ */ f.createElement("dd", null, "Whether the overlay is open by default (controlled)"), /* @__PURE__ */ f.createElement("dt", null, /* @__PURE__ */ f.createElement("code", null, "defaultOpen"), ": boolean"), /* @__PURE__ */ f.createElement("dd", null, "Whether the overlay is open by default (uncontrolled)."), /* @__PURE__ */ f.createElement("dt", null, /* @__PURE__ */ f.createElement("code", null, "onOpenChange"), ": function"), /* @__PURE__ */ f.createElement("dd", null, "Handler that is called when the overlay's open state changes.", /* @__PURE__ */ f.createElement("code", null, "(isOpen: boolean) => void"))), /* @__PURE__ */ f.createElement("h5", null, "Focused Task Props, Focused Task State, and Trigger Props"), /* @__PURE__ */ f.createElement("p", null, "The ", /* @__PURE__ */ f.createElement("code", null, "useFocusedTask"), " returns an object with ", /* @__PURE__ */ f.createElement("code", null, "focusedTaskProps"), ",", " ", /* @__PURE__ */ f.createElement("code", null, "focusedTaskState"), " and ", /* @__PURE__ */ f.createElement("code", null, "triggerProps")), /* @__PURE__ */ f.createElement("p", null, "The ", /* @__PURE__ */ f.createElement("code", null, "triggerProps"), " need to be spread on the element that triggers the focused task."), /* @__PURE__ */ f.createElement("p", null, "The ", /* @__PURE__ */ f.createElement("code", null, "focusedTaskState"), " object (which is also included in ", /* @__PURE__ */ f.createElement("code", null, "focusedTaskProps"), ") allows programmatic access to the state of the focused task. This includes a read only", " ", /* @__PURE__ */ f.createElement("code", null, "isOpen"), " property, a ", /* @__PURE__ */ f.createElement("code", null, "setOpen(isOpen: boolean)"), " method which can be use to set whether the overlay is open, an ", /* @__PURE__ */ f.createElement("code", null, "open()"), " method which opens the overlay, a ", /* @__PURE__ */ f.createElement("code", null, "close()"), " method which closes the overlay and a", " ", /* @__PURE__ */ f.createElement("code", null, "toggle()"), " method that toggles the overlay's visiblity."), /* @__PURE__ */ f.createElement("p", null, "The ", /* @__PURE__ */ f.createElement("code", null, "focusedTaskProps"), " should be spread on the actual ", /* @__PURE__ */ f.createElement("code", null, "FocusedTask"), " component."), /* @__PURE__ */ f.createElement("p", null, "Please refer to the examples to see its implementation"))
|
1437
1439
|
},
|
1438
1440
|
standard: {
|
1439
1441
|
label: "Standard",
|
1440
1442
|
examples: {
|
1441
1443
|
basic: {
|
1442
|
-
react:
|
1444
|
+
react: Ee`
|
1443
1445
|
import { FocusedTask, FocusedTaskActions, useFocusedTask } from "@sps-woodland/focused-task";
|
1444
1446
|
import { Button } from "@sps-woodland/buttons";
|
1445
1447
|
import { Card } from "@sps-woodland/cards";
|
@@ -1485,7 +1487,7 @@ const Ln = {
|
|
1485
1487
|
label: "Fill Width",
|
1486
1488
|
examples: {
|
1487
1489
|
basic: {
|
1488
|
-
react:
|
1490
|
+
react: Ee`
|
1489
1491
|
import { FocusedTask, FocusedTaskActions, useFocusedTask } from "@sps-woodland/focused-task";
|
1490
1492
|
import { Button } from "@sps-woodland/buttons";
|
1491
1493
|
import { Card } from "@sps-woodland/cards";
|
@@ -1529,12 +1531,12 @@ const Ln = {
|
|
1529
1531
|
}
|
1530
1532
|
}
|
1531
1533
|
}
|
1532
|
-
},
|
1533
|
-
"Focused Task":
|
1534
|
+
}, An = {
|
1535
|
+
"Focused Task": Pn
|
1534
1536
|
};
|
1535
1537
|
export {
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1538
|
+
Ge as FocusedTask,
|
1539
|
+
Ue as FocusedTaskActions,
|
1540
|
+
An as MANIFEST,
|
1541
|
+
Dn as useFocusedTask
|
1540
1542
|
};
|