@jobber/components 7.8.0 → 7.9.0

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 (64) hide show
  1. package/dist/Autocomplete/index.mjs +1 -1
  2. package/dist/Button/buttonRenderAdapter.d.ts +304 -0
  3. package/dist/Card/index.cjs +7 -4
  4. package/dist/Card/index.mjs +7 -4
  5. package/dist/Countdown/index.cjs +1 -1
  6. package/dist/Countdown/index.mjs +1 -1
  7. package/dist/Countdown-cjs.js +1 -1
  8. package/dist/Countdown-es.js +1 -1
  9. package/dist/DataDump/index.cjs +7 -4
  10. package/dist/DataDump/index.mjs +7 -4
  11. package/dist/DrawerRoot-cjs.js +2634 -2142
  12. package/dist/DrawerRoot-es.js +2523 -2065
  13. package/dist/InputAvatar/index.cjs +1 -1
  14. package/dist/InputAvatar/index.mjs +1 -1
  15. package/dist/InputFile/index.cjs +1 -1
  16. package/dist/InputFile/index.mjs +1 -1
  17. package/dist/InputFile-cjs.js +1 -1
  18. package/dist/InputFile-es.js +1 -1
  19. package/dist/InputNumber/index.cjs +2441 -186
  20. package/dist/InputNumber/index.mjs +2361 -106
  21. package/dist/Menu/Menu.Legacy.d.ts +3 -0
  22. package/dist/Menu/Menu.d.ts +66 -24
  23. package/dist/Menu/Menu.types.d.ts +8 -108
  24. package/dist/Menu/MenuBottomSheet.d.ts +29 -0
  25. package/dist/Menu/MenuDropdown.d.ts +29 -0
  26. package/dist/Menu/index.cjs +7 -4
  27. package/dist/Menu/index.mjs +7 -4
  28. package/dist/Menu/menuComposableShared.d.ts +27 -0
  29. package/dist/Menu/menuComposableTypes.d.ts +99 -0
  30. package/dist/Menu-cjs.js +828 -8419
  31. package/dist/Menu-es.js +823 -8414
  32. package/dist/MenuSubmenuTrigger-cjs.js +5283 -0
  33. package/dist/MenuSubmenuTrigger-es.js +5224 -0
  34. package/dist/Modal/index.mjs +1 -1
  35. package/dist/Page/index.cjs +6 -3
  36. package/dist/Page/index.mjs +6 -3
  37. package/dist/Page-cjs.js +1 -1
  38. package/dist/Page-es.js +1 -1
  39. package/dist/RecurringSelect/index.cjs +0 -1
  40. package/dist/RecurringSelect/index.mjs +0 -1
  41. package/dist/docs/Menu/Menu.md +7 -62
  42. package/dist/floating-ui.react-dom-es.js +1 -1
  43. package/dist/floating-ui.react-es.js +2 -2
  44. package/dist/index-cjs.js +1161 -166
  45. package/dist/index-es.js +1160 -166
  46. package/dist/index.cjs +7 -3
  47. package/dist/index.esm-es.js +1 -1
  48. package/dist/index.mjs +7 -3
  49. package/dist/primitives/BottomSheet/index.cjs +0 -1
  50. package/dist/primitives/BottomSheet/index.mjs +0 -1
  51. package/dist/primitives/index.cjs +0 -1
  52. package/dist/primitives/index.mjs +0 -1
  53. package/dist/styles.css +540 -31
  54. package/dist/unstyledPrimitives/index.cjs +6662 -8039
  55. package/dist/unstyledPrimitives/index.d.ts +2 -1
  56. package/dist/unstyledPrimitives/index.mjs +6733 -8111
  57. package/dist/useRenderElement-cjs.js +212 -212
  58. package/dist/useRenderElement-es.js +213 -213
  59. package/dist/utils/meta/meta.json +9 -0
  60. package/package.json +2 -2
  61. package/dist/Text-cjs2.js +0 -2484
  62. package/dist/Text-es2.js +0 -2417
  63. package/dist/index-cjs2.js +0 -1189
  64. package/dist/index-es2.js +0 -1186
package/dist/Text-es2.js DELETED
@@ -1,2417 +0,0 @@
1
- import React__default, { useRef, useCallback, useState, useContext, useEffect, useMemo, forwardRef, createContext } from 'react';
2
- import { c as clsx } from './clsx-es.js';
3
-
4
- /*
5
- * Copyright 2020 Adobe. All rights reserved.
6
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License. You may obtain a copy
8
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software distributed under
11
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
- * OF ANY KIND, either express or implied. See the License for the specific language
13
- * governing permissions and limitations under the License.
14
- */
15
- const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (React__default).useLayoutEffect : ()=>{};
16
-
17
- /*
18
- * Copyright 2023 Adobe. All rights reserved.
19
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
- * you may not use this file except in compliance with the License. You may obtain a copy
21
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software distributed under
24
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
- * OF ANY KIND, either express or implied. See the License for the specific language
26
- * governing permissions and limitations under the License.
27
- */
28
-
29
- var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
30
- // Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
31
- // before all layout effects, but is available only in React 18 and later.
32
- const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = (React__default)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
33
- function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
34
- const ref = (useRef)(null);
35
- $8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
36
- ref.current = fn;
37
- }, [
38
- fn
39
- ]);
40
- // @ts-ignore
41
- return (useCallback)((...args)=>{
42
- const f = ref.current;
43
- return f === null || f === void 0 ? void 0 : f(...args);
44
- }, []);
45
- }
46
-
47
- /*
48
- * Copyright 2020 Adobe. All rights reserved.
49
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
50
- * you may not use this file except in compliance with the License. You may obtain a copy
51
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
52
- *
53
- * Unless required by applicable law or agreed to in writing, software distributed under
54
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
55
- * OF ANY KIND, either express or implied. See the License for the specific language
56
- * governing permissions and limitations under the License.
57
- */
58
-
59
- function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
60
- let [value, setValue] = (useState)(defaultValue);
61
- let effect = (useRef)(null);
62
- // Store the function in a ref so we can always access the current version
63
- // which has the proper `value` in scope.
64
- let nextRef = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
65
- if (!effect.current) return;
66
- // Run the generator to the next yield.
67
- let newValue = effect.current.next();
68
- // If the generator is done, reset the effect.
69
- if (newValue.done) {
70
- effect.current = null;
71
- return;
72
- }
73
- // If the value is the same as the current value,
74
- // then continue to the next yield. Otherwise,
75
- // set the value in state and wait for the next layout effect.
76
- if (value === newValue.value) nextRef();
77
- else setValue(newValue.value);
78
- });
79
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
80
- // If there is an effect currently running, continue to the next yield.
81
- if (effect.current) nextRef();
82
- });
83
- let queue = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((fn)=>{
84
- effect.current = fn(value);
85
- nextRef();
86
- });
87
- return [
88
- value,
89
- queue
90
- ];
91
- }
92
-
93
- /*
94
- * Copyright 2020 Adobe. All rights reserved.
95
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
96
- * you may not use this file except in compliance with the License. You may obtain a copy
97
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
98
- *
99
- * Unless required by applicable law or agreed to in writing, software distributed under
100
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
101
- * OF ANY KIND, either express or implied. See the License for the specific language
102
- * governing permissions and limitations under the License.
103
- */ // We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is
104
- // guarded by a check that it only runs on the client side.
105
- // eslint-disable-next-line rulesdir/useLayoutEffectRule
106
-
107
- // Default context value to use in case there is no SSRProvider. This is fine for
108
- // client-only apps. In order to support multiple copies of React Aria potentially
109
- // being on the page at once, the prefix is set to a random number. SSRProvider
110
- // will reset this to zero for consistency between server and client, so in the
111
- // SSR case multiple copies of React Aria is not supported.
112
- const $b5e257d569688ac6$var$defaultContext = {
113
- prefix: String(Math.round(Math.random() * 10000000000)),
114
- current: 0
115
- };
116
- const $b5e257d569688ac6$var$SSRContext = /*#__PURE__*/ (React__default).createContext($b5e257d569688ac6$var$defaultContext);
117
- const $b5e257d569688ac6$var$IsSSRContext = /*#__PURE__*/ (React__default).createContext(false);
118
- let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
119
- let $b5e257d569688ac6$var$componentIds = new WeakMap();
120
- function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
121
- let ctx = (useContext)($b5e257d569688ac6$var$SSRContext);
122
- let ref = (useRef)(null);
123
- // eslint-disable-next-line rulesdir/pure-render
124
- if (ref.current === null && !isDisabled) {
125
- var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
126
- // In strict mode, React renders components twice, and the ref will be reset to null on the second render.
127
- // This means our id counter will be incremented twice instead of once. This is a problem because on the
128
- // server, components are only rendered once and so ids generated on the server won't match the client.
129
- // In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this
130
- // we need to use some React internals to access the underlying Fiber instance, which is stable between renders.
131
- // This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.
132
- // To ensure that we only increment the global counter once, we store the starting id for this component in
133
- // a weak map associated with the Fiber. On the second render, we reset the global counter to this value.
134
- // Since React runs the second render immediately after the first, this is safe.
135
- // @ts-ignore
136
- let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = (React__default).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
137
- if (currentOwner) {
138
- let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
139
- if (prevComponentValue == null) // On the first render, and first call to useId, store the id and state in our weak map.
140
- $b5e257d569688ac6$var$componentIds.set(currentOwner, {
141
- id: ctx.current,
142
- state: currentOwner.memoizedState
143
- });
144
- else if (currentOwner.memoizedState !== prevComponentValue.state) {
145
- // On the second render, the memoizedState gets reset by React.
146
- // Reset the counter, and remove from the weak map so we don't
147
- // do this for subsequent useId calls.
148
- ctx.current = prevComponentValue.id;
149
- $b5e257d569688ac6$var$componentIds.delete(currentOwner);
150
- }
151
- }
152
- // eslint-disable-next-line rulesdir/pure-render
153
- ref.current = ++ctx.current;
154
- }
155
- // eslint-disable-next-line rulesdir/pure-render
156
- return ref.current;
157
- }
158
- function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
159
- let ctx = (useContext)($b5e257d569688ac6$var$SSRContext);
160
- // If we are rendering in a non-DOM environment, and there's no SSRProvider,
161
- // provide a warning to hint to the developer to add one.
162
- if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM && process.env.NODE_ENV !== 'production') console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
163
- let counter = $b5e257d569688ac6$var$useCounter(!!defaultId);
164
- let prefix = ctx === $b5e257d569688ac6$var$defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;
165
- return defaultId || `${prefix}-${counter}`;
166
- }
167
- function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
168
- let id = (React__default).useId();
169
- let [didSSR] = (useState)($b5e257d569688ac6$export$535bd6ca7f90a273());
170
- let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
171
- return defaultId || `${prefix}-${id}`;
172
- }
173
- const $b5e257d569688ac6$export$619500959fc48b26 = typeof (React__default)['useId'] === 'function' ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
174
- function $b5e257d569688ac6$var$getSnapshot() {
175
- return false;
176
- }
177
- function $b5e257d569688ac6$var$getServerSnapshot() {
178
- return true;
179
- }
180
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
181
- function $b5e257d569688ac6$var$subscribe(onStoreChange) {
182
- // noop
183
- return ()=>{};
184
- }
185
- function $b5e257d569688ac6$export$535bd6ca7f90a273() {
186
- // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.
187
- if (typeof (React__default)['useSyncExternalStore'] === 'function') return (React__default)['useSyncExternalStore']($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
188
- // eslint-disable-next-line react-hooks/rules-of-hooks
189
- return (useContext)($b5e257d569688ac6$var$IsSSRContext);
190
- }
191
-
192
- /*
193
- * Copyright 2020 Adobe. All rights reserved.
194
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
195
- * you may not use this file except in compliance with the License. You may obtain a copy
196
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
197
- *
198
- * Unless required by applicable law or agreed to in writing, software distributed under
199
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
200
- * OF ANY KIND, either express or implied. See the License for the specific language
201
- * governing permissions and limitations under the License.
202
- */
203
-
204
-
205
-
206
- // copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
207
- let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
208
- let $bdb11010cef70236$export$d41a04c74483c6ef = new Map();
209
- // This allows us to clean up the idsUpdaterMap when the id is no longer used.
210
- // Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
211
- // This can happen in suspended components where mount/unmount is not called.
212
- let $bdb11010cef70236$var$registry;
213
- if (typeof FinalizationRegistry !== 'undefined') $bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue)=>{
214
- $bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
215
- });
216
- function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
217
- let [value, setValue] = (useState)(defaultId);
218
- let nextId = (useRef)(null);
219
- let res = ($b5e257d569688ac6$export$619500959fc48b26)(value);
220
- let cleanupRef = (useRef)(null);
221
- if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.register(cleanupRef, res);
222
- if ($bdb11010cef70236$var$canUseDOM) {
223
- const cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
224
- if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
225
- else $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
226
- nextId
227
- ]);
228
- }
229
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
230
- let r = res;
231
- return ()=>{
232
- // In Suspense, the cleanup function may be not called
233
- // when it is though, also remove it from the finalization registry.
234
- if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.unregister(cleanupRef);
235
- $bdb11010cef70236$export$d41a04c74483c6ef.delete(r);
236
- };
237
- }, [
238
- res
239
- ]);
240
- // This cannot cause an infinite loop because the ref is always cleaned up.
241
- // eslint-disable-next-line
242
- (useEffect)(()=>{
243
- let newId = nextId.current;
244
- if (newId) setValue(newId);
245
- return ()=>{
246
- if (newId) nextId.current = null;
247
- };
248
- });
249
- return res;
250
- }
251
- function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
252
- if (idA === idB) return idA;
253
- let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
254
- if (setIdsA) {
255
- setIdsA.forEach((ref)=>ref.current = idB);
256
- return idB;
257
- }
258
- let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
259
- if (setIdsB) {
260
- setIdsB.forEach((ref)=>ref.current = idA);
261
- return idA;
262
- }
263
- return idB;
264
- }
265
- function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
266
- let id = $bdb11010cef70236$export$f680877a34711e37();
267
- let [resolvedId, setResolvedId] = ($1dbecbe27a04f9af$export$14d238f342723f25)(id);
268
- let updateId = (useCallback)(()=>{
269
- setResolvedId(function*() {
270
- yield id;
271
- yield document.getElementById(id) ? id : undefined;
272
- });
273
- }, [
274
- id,
275
- setResolvedId
276
- ]);
277
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
278
- id,
279
- updateId,
280
- ...depArray
281
- ]);
282
- return resolvedId;
283
- }
284
-
285
- /*
286
- * Copyright 2020 Adobe. All rights reserved.
287
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
288
- * you may not use this file except in compliance with the License. You may obtain a copy
289
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
290
- *
291
- * Unless required by applicable law or agreed to in writing, software distributed under
292
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
293
- * OF ANY KIND, either express or implied. See the License for the specific language
294
- * governing permissions and limitations under the License.
295
- */ /**
296
- * Calls all functions in the order they were chained with the same arguments.
297
- */ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
298
- return (...args)=>{
299
- for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
300
- };
301
- }
302
-
303
- const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
304
- var _el_ownerDocument;
305
- return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
306
- };
307
- const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
308
- if (el && 'window' in el && el.window === el) return el;
309
- const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
310
- return doc.defaultView || window;
311
- };
312
- /**
313
- * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
314
- */ function $431fbd86ca7dc216$var$isNode(value) {
315
- return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
316
- }
317
- function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
318
- return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
319
- }
320
-
321
- let $f4e2df6bd15f8569$var$_shadowDOM = false;
322
- function $f4e2df6bd15f8569$export$98658e8c59125e6a() {
323
- return $f4e2df6bd15f8569$var$_shadowDOM;
324
- }
325
-
326
- // Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
327
-
328
-
329
- function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
330
- if (!($f4e2df6bd15f8569$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
331
- if (!node || !otherNode) return false;
332
- let currentNode = otherNode;
333
- while(currentNode !== null){
334
- if (currentNode === node) return true;
335
- if (currentNode.tagName === 'SLOT' && currentNode.assignedSlot) // Element is slotted
336
- currentNode = currentNode.assignedSlot.parentNode;
337
- else if (($431fbd86ca7dc216$export$af51f0f06c0f328a)(currentNode)) // Element is in shadow root
338
- currentNode = currentNode.host;
339
- else currentNode = currentNode.parentNode;
340
- }
341
- return false;
342
- }
343
- const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
344
- var _activeElement_shadowRoot;
345
- if (!($f4e2df6bd15f8569$export$98658e8c59125e6a)()) return doc.activeElement;
346
- let activeElement = doc.activeElement;
347
- while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0 ? void 0 : _activeElement_shadowRoot.activeElement))activeElement = activeElement.shadowRoot.activeElement;
348
- return activeElement;
349
- };
350
- function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
351
- if (($f4e2df6bd15f8569$export$98658e8c59125e6a)() && event.target.shadowRoot) {
352
- if (event.composedPath) return event.composedPath()[0];
353
- }
354
- return event.target;
355
- }
356
-
357
- /*
358
- * Copyright 2020 Adobe. All rights reserved.
359
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
360
- * you may not use this file except in compliance with the License. You may obtain a copy
361
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
362
- *
363
- * Unless required by applicable law or agreed to in writing, software distributed under
364
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
365
- * OF ANY KIND, either express or implied. See the License for the specific language
366
- * governing permissions and limitations under the License.
367
- */
368
-
369
-
370
- function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
371
- // Start with a base clone of the first argument. This is a lot faster than starting
372
- // with an empty object and adding properties as we go.
373
- let result = {
374
- ...args[0]
375
- };
376
- for(let i = 1; i < args.length; i++){
377
- let props = args[i];
378
- for(let key in props){
379
- let a = result[key];
380
- let b = props[key];
381
- // Chain events
382
- if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
383
- key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = ($ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
384
- else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (clsx)(a, b);
385
- else if (key === 'id' && a && b) result.id = ($bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
386
- else result[key] = b !== undefined ? b : a;
387
- }
388
- }
389
- return result;
390
- }
391
-
392
- /*
393
- * Copyright 2020 Adobe. All rights reserved.
394
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
395
- * you may not use this file except in compliance with the License. You may obtain a copy
396
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
397
- *
398
- * Unless required by applicable law or agreed to in writing, software distributed under
399
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
400
- * OF ANY KIND, either express or implied. See the License for the specific language
401
- * governing permissions and limitations under the License.
402
- */ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
403
- if (refs.length === 1 && refs[0]) return refs[0];
404
- return (value)=>{
405
- let hasCleanup = false;
406
- const cleanups = refs.map((ref)=>{
407
- const cleanup = $5dc95899b306f630$var$setRef(ref, value);
408
- hasCleanup || (hasCleanup = typeof cleanup == 'function');
409
- return cleanup;
410
- });
411
- if (hasCleanup) return ()=>{
412
- cleanups.forEach((cleanup, i)=>{
413
- if (typeof cleanup === 'function') cleanup();
414
- else $5dc95899b306f630$var$setRef(refs[i], null);
415
- });
416
- };
417
- };
418
- }
419
- function $5dc95899b306f630$var$setRef(ref, value) {
420
- if (typeof ref === 'function') return ref(value);
421
- else if (ref != null) ref.current = value;
422
- }
423
-
424
- /*
425
- * Copyright 2020 Adobe. All rights reserved.
426
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
427
- * you may not use this file except in compliance with the License. You may obtain a copy
428
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
429
- *
430
- * Unless required by applicable law or agreed to in writing, software distributed under
431
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
432
- * OF ANY KIND, either express or implied. See the License for the specific language
433
- * governing permissions and limitations under the License.
434
- */ const $65484d02dcb7eb3e$var$DOMPropNames = new Set([
435
- 'id'
436
- ]);
437
- const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
438
- 'aria-label',
439
- 'aria-labelledby',
440
- 'aria-describedby',
441
- 'aria-details'
442
- ]);
443
- // See LinkDOMProps in dom.d.ts.
444
- const $65484d02dcb7eb3e$var$linkPropNames = new Set([
445
- 'href',
446
- 'hrefLang',
447
- 'target',
448
- 'rel',
449
- 'download',
450
- 'ping',
451
- 'referrerPolicy'
452
- ]);
453
- const $65484d02dcb7eb3e$var$globalAttrs = new Set([
454
- 'dir',
455
- 'lang',
456
- 'hidden',
457
- 'inert',
458
- 'translate'
459
- ]);
460
- const $65484d02dcb7eb3e$var$globalEvents = new Set([
461
- 'onClick',
462
- 'onAuxClick',
463
- 'onContextMenu',
464
- 'onDoubleClick',
465
- 'onMouseDown',
466
- 'onMouseEnter',
467
- 'onMouseLeave',
468
- 'onMouseMove',
469
- 'onMouseOut',
470
- 'onMouseOver',
471
- 'onMouseUp',
472
- 'onTouchCancel',
473
- 'onTouchEnd',
474
- 'onTouchMove',
475
- 'onTouchStart',
476
- 'onPointerDown',
477
- 'onPointerMove',
478
- 'onPointerUp',
479
- 'onPointerCancel',
480
- 'onPointerEnter',
481
- 'onPointerLeave',
482
- 'onPointerOver',
483
- 'onPointerOut',
484
- 'onGotPointerCapture',
485
- 'onLostPointerCapture',
486
- 'onScroll',
487
- 'onWheel',
488
- 'onAnimationStart',
489
- 'onAnimationEnd',
490
- 'onAnimationIteration',
491
- 'onTransitionCancel',
492
- 'onTransitionEnd',
493
- 'onTransitionRun',
494
- 'onTransitionStart'
495
- ]);
496
- const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
497
- function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
498
- let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
499
- let filteredProps = {};
500
- for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && $65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
501
- return filteredProps;
502
- }
503
-
504
- /*
505
- * Copyright 2020 Adobe. All rights reserved.
506
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
507
- * you may not use this file except in compliance with the License. You may obtain a copy
508
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
509
- *
510
- * Unless required by applicable law or agreed to in writing, software distributed under
511
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
512
- * OF ANY KIND, either express or implied. See the License for the specific language
513
- * governing permissions and limitations under the License.
514
- */ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
515
- if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
516
- preventScroll: true
517
- });
518
- else {
519
- let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
520
- element.focus();
521
- $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
522
- }
523
- }
524
- let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
525
- function $7215afc6de606d6b$var$supportsPreventScroll() {
526
- if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
527
- $7215afc6de606d6b$var$supportsPreventScrollCached = false;
528
- try {
529
- let focusElem = document.createElement('div');
530
- focusElem.focus({
531
- get preventScroll () {
532
- $7215afc6de606d6b$var$supportsPreventScrollCached = true;
533
- return true;
534
- }
535
- });
536
- } catch {
537
- // Ignore
538
- }
539
- }
540
- return $7215afc6de606d6b$var$supportsPreventScrollCached;
541
- }
542
- function $7215afc6de606d6b$var$getScrollableElements(element) {
543
- let parent = element.parentNode;
544
- let scrollableElements = [];
545
- let rootScrollingElement = document.scrollingElement || document.documentElement;
546
- while(parent instanceof HTMLElement && parent !== rootScrollingElement){
547
- if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
548
- element: parent,
549
- scrollTop: parent.scrollTop,
550
- scrollLeft: parent.scrollLeft
551
- });
552
- parent = parent.parentNode;
553
- }
554
- if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
555
- element: rootScrollingElement,
556
- scrollTop: rootScrollingElement.scrollTop,
557
- scrollLeft: rootScrollingElement.scrollLeft
558
- });
559
- return scrollableElements;
560
- }
561
- function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
562
- for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
563
- element.scrollTop = scrollTop;
564
- element.scrollLeft = scrollLeft;
565
- }
566
- }
567
-
568
- /*
569
- * Copyright 2020 Adobe. All rights reserved.
570
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
571
- * you may not use this file except in compliance with the License. You may obtain a copy
572
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
573
- *
574
- * Unless required by applicable law or agreed to in writing, software distributed under
575
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
576
- * OF ANY KIND, either express or implied. See the License for the specific language
577
- * governing permissions and limitations under the License.
578
- */ function $c87311424ea30a05$var$testUserAgent(re) {
579
- var _window_navigator_userAgentData;
580
- if (typeof window === 'undefined' || window.navigator == null) return false;
581
- let brands = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
582
- return Array.isArray(brands) && brands.some((brand)=>re.test(brand.brand)) || re.test(window.navigator.userAgent);
583
- }
584
- function $c87311424ea30a05$var$testPlatform(re) {
585
- var _window_navigator_userAgentData;
586
- return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
587
- }
588
- function $c87311424ea30a05$var$cached(fn) {
589
- if (process.env.NODE_ENV === 'test') return fn;
590
- let res = null;
591
- return ()=>{
592
- if (res == null) res = fn();
593
- return res;
594
- };
595
- }
596
- const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
597
- return $c87311424ea30a05$var$testPlatform(/^Mac/i);
598
- });
599
- const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
600
- return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
601
- });
602
- const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
603
- return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
604
- $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
605
- });
606
- const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
607
- return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
608
- });
609
- const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
610
- return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
611
- });
612
- const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
613
- return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
614
- });
615
- const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
616
- return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
617
- });
618
- const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
619
- return $c87311424ea30a05$var$testUserAgent(/Android/i);
620
- });
621
- const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
622
- return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
623
- });
624
-
625
- /*
626
- * Copyright 2020 Adobe. All rights reserved.
627
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
628
- * you may not use this file except in compliance with the License. You may obtain a copy
629
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
630
- *
631
- * Unless required by applicable law or agreed to in writing, software distributed under
632
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
633
- * OF ANY KIND, either express or implied. See the License for the specific language
634
- * governing permissions and limitations under the License.
635
- */ // We store a global list of elements that are currently transitioning,
636
- // mapped to a set of CSS properties that are transitioning for that element.
637
- // This is necessary rather than a simple count of transitions because of browser
638
- // bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
639
- // than one or the other. So we need to track what's actually transitioning so that
640
- // we can ignore these duplicate events.
641
- let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
642
- // A list of callbacks to call once there are no transitioning elements.
643
- let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
644
- function $bbed8b41f857bcc0$var$setupGlobalEvents() {
645
- if (typeof window === 'undefined') return;
646
- function isTransitionEvent(event) {
647
- return 'propertyName' in event;
648
- }
649
- let onTransitionStart = (e)=>{
650
- if (!isTransitionEvent(e) || !e.target) return;
651
- // Add the transitioning property to the list for this element.
652
- let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
653
- if (!transitions) {
654
- transitions = new Set();
655
- $bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
656
- // The transitioncancel event must be registered on the element itself, rather than as a global
657
- // event. This enables us to handle when the node is deleted from the document while it is transitioning.
658
- // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
659
- e.target.addEventListener('transitioncancel', onTransitionEnd, {
660
- once: true
661
- });
662
- }
663
- transitions.add(e.propertyName);
664
- };
665
- let onTransitionEnd = (e)=>{
666
- if (!isTransitionEvent(e) || !e.target) return;
667
- // Remove property from list of transitioning properties.
668
- let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
669
- if (!properties) return;
670
- properties.delete(e.propertyName);
671
- // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
672
- if (properties.size === 0) {
673
- e.target.removeEventListener('transitioncancel', onTransitionEnd);
674
- $bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
675
- }
676
- // If no transitioning elements, call all of the queued callbacks.
677
- if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
678
- for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
679
- $bbed8b41f857bcc0$var$transitionCallbacks.clear();
680
- }
681
- };
682
- document.body.addEventListener('transitionrun', onTransitionStart);
683
- document.body.addEventListener('transitionend', onTransitionEnd);
684
- }
685
- if (typeof document !== 'undefined') {
686
- if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
687
- else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
688
- }
689
- /**
690
- * Cleans up any elements that are no longer in the document.
691
- * This is necessary because we can't rely on transitionend events to fire
692
- * for elements that are removed from the document while transitioning.
693
- */ function $bbed8b41f857bcc0$var$cleanupDetachedElements() {
694
- for (const [eventTarget] of $bbed8b41f857bcc0$var$transitionsByElement)// Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids
695
- // the explicit instanceof check, since it may be different in different contexts.
696
- if ('isConnected' in eventTarget && !eventTarget.isConnected) $bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget);
697
- }
698
- function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
699
- // Wait one frame to see if an animation starts, e.g. a transition on mount.
700
- requestAnimationFrame(()=>{
701
- $bbed8b41f857bcc0$var$cleanupDetachedElements();
702
- // If no transitions are running, call the function immediately.
703
- // Otherwise, add it to a list of callbacks to run at the end of the animation.
704
- if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
705
- else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
706
- });
707
- }
708
-
709
- /*
710
- * Copyright 2020 Adobe. All rights reserved.
711
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
712
- * you may not use this file except in compliance with the License. You may obtain a copy
713
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
714
- *
715
- * Unless required by applicable law or agreed to in writing, software distributed under
716
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
717
- * OF ANY KIND, either express or implied. See the License for the specific language
718
- * governing permissions and limitations under the License.
719
- */
720
- function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
721
- let globalListeners = (useRef)(new Map());
722
- let addGlobalListener = (useCallback)((eventTarget, type, listener, options)=>{
723
- // Make sure we remove the listener after it is called with the `once` option.
724
- let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
725
- globalListeners.current.delete(listener);
726
- listener(...args);
727
- } : listener;
728
- globalListeners.current.set(listener, {
729
- type: type,
730
- eventTarget: eventTarget,
731
- fn: fn,
732
- options: options
733
- });
734
- eventTarget.addEventListener(type, fn, options);
735
- }, []);
736
- let removeGlobalListener = (useCallback)((eventTarget, type, listener, options)=>{
737
- var _globalListeners_current_get;
738
- let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
739
- eventTarget.removeEventListener(type, fn, options);
740
- globalListeners.current.delete(listener);
741
- }, []);
742
- let removeAllGlobalListeners = (useCallback)(()=>{
743
- globalListeners.current.forEach((value, key)=>{
744
- removeGlobalListener(value.eventTarget, value.type, key, value.options);
745
- });
746
- }, [
747
- removeGlobalListener
748
- ]);
749
- (useEffect)(()=>{
750
- return removeAllGlobalListeners;
751
- }, [
752
- removeAllGlobalListeners
753
- ]);
754
- return {
755
- addGlobalListener: addGlobalListener,
756
- removeGlobalListener: removeGlobalListener,
757
- removeAllGlobalListeners: removeAllGlobalListeners
758
- };
759
- }
760
-
761
- /*
762
- * Copyright 2020 Adobe. All rights reserved.
763
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
764
- * you may not use this file except in compliance with the License. You may obtain a copy
765
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
766
- *
767
- * Unless required by applicable law or agreed to in writing, software distributed under
768
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
769
- * OF ANY KIND, either express or implied. See the License for the specific language
770
- * governing permissions and limitations under the License.
771
- */
772
- function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
773
- let { id: id, 'aria-label': label, 'aria-labelledby': labelledBy } = props;
774
- // If there is both an aria-label and aria-labelledby,
775
- // combine them by pointing to the element itself.
776
- id = ($bdb11010cef70236$export$f680877a34711e37)(id);
777
- if (labelledBy && label) {
778
- let ids = new Set([
779
- id,
780
- ...labelledBy.trim().split(/\s+/)
781
- ]);
782
- labelledBy = [
783
- ...ids
784
- ].join(' ');
785
- } else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(' ');
786
- // If no labels are provided, use the default
787
- if (!label && !labelledBy && defaultLabel) label = defaultLabel;
788
- return {
789
- id: id,
790
- 'aria-label': label,
791
- 'aria-labelledby': labelledBy
792
- };
793
- }
794
-
795
- /*
796
- * Copyright 2021 Adobe. All rights reserved.
797
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
798
- * you may not use this file except in compliance with the License. You may obtain a copy
799
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
800
- *
801
- * Unless required by applicable law or agreed to in writing, software distributed under
802
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
803
- * OF ANY KIND, either express or implied. See the License for the specific language
804
- * governing permissions and limitations under the License.
805
- */
806
- function $df56164dff5785e2$export$4338b53315abf666(ref) {
807
- const objRef = (useRef)(null);
808
- const cleanupRef = (useRef)(undefined);
809
- const refEffect = (useCallback)((instance)=>{
810
- if (typeof ref === 'function') {
811
- const refCallback = ref;
812
- const refCleanup = refCallback(instance);
813
- return ()=>{
814
- if (typeof refCleanup === 'function') refCleanup();
815
- else refCallback(null);
816
- };
817
- } else if (ref) {
818
- ref.current = instance;
819
- return ()=>{
820
- ref.current = null;
821
- };
822
- }
823
- }, [
824
- ref
825
- ]);
826
- return (useMemo)(()=>({
827
- get current () {
828
- return objRef.current;
829
- },
830
- set current (value){
831
- objRef.current = value;
832
- if (cleanupRef.current) {
833
- cleanupRef.current();
834
- cleanupRef.current = undefined;
835
- }
836
- if (value != null) cleanupRef.current = refEffect(value);
837
- }
838
- }), [
839
- refEffect
840
- ]);
841
- }
842
-
843
- /*
844
- * Copyright 2020 Adobe. All rights reserved.
845
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
846
- * you may not use this file except in compliance with the License. You may obtain a copy
847
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
848
- *
849
- * Unless required by applicable law or agreed to in writing, software distributed under
850
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
851
- * OF ANY KIND, either express or implied. See the License for the specific language
852
- * governing permissions and limitations under the License.
853
- */
854
- function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
855
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
856
- if (context && context.ref && ref) {
857
- context.ref.current = ref.current;
858
- return ()=>{
859
- if (context.ref) context.ref.current = null;
860
- };
861
- }
862
- });
863
- }
864
-
865
- /*
866
- * Copyright 2021 Adobe. All rights reserved.
867
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
868
- * you may not use this file except in compliance with the License. You may obtain a copy
869
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
870
- *
871
- * Unless required by applicable law or agreed to in writing, software distributed under
872
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
873
- * OF ANY KIND, either express or implied. See the License for the specific language
874
- * governing permissions and limitations under the License.
875
- */
876
-
877
- function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
878
- let handleEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(handler);
879
- let isDisabled = handler == null;
880
- (useEffect)(()=>{
881
- if (isDisabled || !ref.current) return;
882
- let element = ref.current;
883
- element.addEventListener(event, handleEvent, options);
884
- return ()=>{
885
- element.removeEventListener(event, handleEvent, options);
886
- };
887
- }, [
888
- ref,
889
- event,
890
- options,
891
- isDisabled,
892
- handleEvent
893
- ]);
894
- }
895
-
896
- /*
897
- * Copyright 2022 Adobe. All rights reserved.
898
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
899
- * you may not use this file except in compliance with the License. You may obtain a copy
900
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
901
- *
902
- * Unless required by applicable law or agreed to in writing, software distributed under
903
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
904
- * OF ANY KIND, either express or implied. See the License for the specific language
905
- * governing permissions and limitations under the License.
906
- */
907
- function $6a7db85432448f7f$export$60278871457622de(event) {
908
- // JAWS/NVDA with Firefox.
909
- if (event.pointerType === '' && event.isTrusted) return true;
910
- // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
911
- // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
912
- // to detect TalkBack virtual clicks.
913
- if (($c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
914
- return event.detail === 0 && !event.pointerType;
915
- }
916
- function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
917
- // If the pointer size is zero, then we assume it's from a screen reader.
918
- // Android TalkBack double tap will sometimes return a event with width and height of 1
919
- // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
920
- // Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
921
- // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
922
- // Talkback double tap from Windows Firefox touch screen press
923
- return !($c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
924
- }
925
-
926
- /*
927
- * Copyright 2021 Adobe. All rights reserved.
928
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
929
- * you may not use this file except in compliance with the License. You may obtain a copy
930
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
931
- *
932
- * Unless required by applicable law or agreed to in writing, software distributed under
933
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
934
- * OF ANY KIND, either express or implied. See the License for the specific language
935
- * governing permissions and limitations under the License.
936
- */
937
- const $7d2416ea0959daaa$var$supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;
938
- function $7d2416ea0959daaa$var$isStyleVisible(element) {
939
- const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
940
- if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
941
- let { display: display, visibility: visibility } = element.style;
942
- let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
943
- if (isVisible) {
944
- const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
945
- let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
946
- isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
947
- }
948
- return isVisible;
949
- }
950
- function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
951
- return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
952
- !element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
953
- }
954
- function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
955
- if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility() && !element.closest('[data-react-aria-prevent-focus]');
956
- return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
957
- }
958
-
959
- /*
960
- * Copyright 2025 Adobe. All rights reserved.
961
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
962
- * you may not use this file except in compliance with the License. You may obtain a copy
963
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
964
- *
965
- * Unless required by applicable law or agreed to in writing, software distributed under
966
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
967
- * OF ANY KIND, either express or implied. See the License for the specific language
968
- * governing permissions and limitations under the License.
969
- */
970
- const $b4b717babfbb907b$var$focusableElements = [
971
- 'input:not([disabled]):not([type=hidden])',
972
- 'select:not([disabled])',
973
- 'textarea:not([disabled])',
974
- 'button:not([disabled])',
975
- 'a[href]',
976
- 'area[href]',
977
- 'summary',
978
- 'iframe',
979
- 'object',
980
- 'embed',
981
- 'audio[controls]',
982
- 'video[controls]',
983
- '[contenteditable]:not([contenteditable^="false"])',
984
- 'permission'
985
- ];
986
- const $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
987
- $b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
988
- const $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
989
- function $b4b717babfbb907b$export$4c063cf1350e6fed(element) {
990
- return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR) && ($7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
991
- }
992
- function $b4b717babfbb907b$export$bebd5a1431fec25d(element) {
993
- return element.matches($b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR) && ($7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
994
- }
995
- function $b4b717babfbb907b$var$isInert(element) {
996
- let node = element;
997
- while(node != null){
998
- if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return true;
999
- node = node.parentElement;
1000
- }
1001
- return false;
1002
- }
1003
-
1004
- /*
1005
- * Copyright 2020 Adobe. All rights reserved.
1006
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1007
- * you may not use this file except in compliance with the License. You may obtain a copy
1008
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1009
- *
1010
- * Unless required by applicable law or agreed to in writing, software distributed under
1011
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1012
- * OF ANY KIND, either express or implied. See the License for the specific language
1013
- * governing permissions and limitations under the License.
1014
- */
1015
- function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
1016
- let [stateValue, setStateValue] = (useState)(value || defaultValue);
1017
- let isControlledRef = (useRef)(value !== undefined);
1018
- let isControlled = value !== undefined;
1019
- (useEffect)(()=>{
1020
- let wasControlled = isControlledRef.current;
1021
- if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
1022
- isControlledRef.current = isControlled;
1023
- }, [
1024
- isControlled
1025
- ]);
1026
- let currentValue = isControlled ? value : stateValue;
1027
- let setValue = (useCallback)((value, ...args)=>{
1028
- let onChangeCaller = (value, ...onChangeArgs)=>{
1029
- if (onChange) {
1030
- if (!Object.is(currentValue, value)) onChange(value, ...onChangeArgs);
1031
- }
1032
- if (!isControlled) // If uncontrolled, mutate the currentValue local variable so that
1033
- // calling setState multiple times with the same value only emits onChange once.
1034
- // We do not use a ref for this because we specifically _do_ want the value to
1035
- // reset every render, and assigning to a ref in render breaks aborted suspended renders.
1036
- // eslint-disable-next-line react-hooks/exhaustive-deps
1037
- currentValue = value;
1038
- };
1039
- if (typeof value === 'function') {
1040
- if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
1041
- // this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
1042
- // when someone using useControlledState calls setControlledState(myFunc)
1043
- // this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
1044
- // if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
1045
- // otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
1046
- let updateFunction = (oldValue, ...functionArgs)=>{
1047
- let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
1048
- onChangeCaller(interceptedValue, ...args);
1049
- if (!isControlled) return interceptedValue;
1050
- return oldValue;
1051
- };
1052
- setStateValue(updateFunction);
1053
- } else {
1054
- if (!isControlled) setStateValue(value);
1055
- onChangeCaller(value, ...args);
1056
- }
1057
- }, [
1058
- isControlled,
1059
- currentValue,
1060
- onChange
1061
- ]);
1062
- return [
1063
- currentValue,
1064
- setValue
1065
- ];
1066
- }
1067
-
1068
- /*
1069
- * Copyright 2020 Adobe. All rights reserved.
1070
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1071
- * you may not use this file except in compliance with the License. You may obtain a copy
1072
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1073
- *
1074
- * Unless required by applicable law or agreed to in writing, software distributed under
1075
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1076
- * OF ANY KIND, either express or implied. See the License for the specific language
1077
- * governing permissions and limitations under the License.
1078
- */ /**
1079
- * Takes a value and forces it to the closest min/max if it's outside. Also forces it to the closest valid step.
1080
- */ function $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, min = -Infinity, max = Infinity) {
1081
- let newValue = Math.min(Math.max(value, min), max);
1082
- return newValue;
1083
- }
1084
- function $9446cca9a3875146$export$e1a7b8e69ef6c52f(value, step) {
1085
- let roundedValue = value;
1086
- let precision = 0;
1087
- let stepString = step.toString();
1088
- // Handle negative exponents in exponential notation (e.g., "1e-7" → precision 8)
1089
- let eIndex = stepString.toLowerCase().indexOf('e-');
1090
- if (eIndex > 0) precision = Math.abs(Math.floor(Math.log10(Math.abs(step)))) + eIndex;
1091
- else {
1092
- let pointIndex = stepString.indexOf('.');
1093
- if (pointIndex >= 0) precision = stepString.length - pointIndex;
1094
- }
1095
- if (precision > 0) {
1096
- let pow = Math.pow(10, precision);
1097
- roundedValue = Math.round(roundedValue * pow) / pow;
1098
- }
1099
- return roundedValue;
1100
- }
1101
- function $9446cca9a3875146$export$cb6e0bb50bc19463(value, min, max, step) {
1102
- min = Number(min);
1103
- max = Number(max);
1104
- let remainder = (value - (isNaN(min) ? 0 : min)) % step;
1105
- let snappedValue = $9446cca9a3875146$export$e1a7b8e69ef6c52f(Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder, step);
1106
- if (!isNaN(min)) {
1107
- if (snappedValue < min) snappedValue = min;
1108
- else if (!isNaN(max) && snappedValue > max) snappedValue = min + Math.floor($9446cca9a3875146$export$e1a7b8e69ef6c52f((max - min) / step, step)) * step;
1109
- } else if (!isNaN(max) && snappedValue > max) snappedValue = Math.floor($9446cca9a3875146$export$e1a7b8e69ef6c52f(max / step, step)) * step;
1110
- // correct floating point behavior by rounding to step precision
1111
- snappedValue = $9446cca9a3875146$export$e1a7b8e69ef6c52f(snappedValue, step);
1112
- return snappedValue;
1113
- }
1114
-
1115
- /*
1116
- * Copyright 2022 Adobe. All rights reserved.
1117
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1118
- * you may not use this file except in compliance with the License. You may obtain a copy
1119
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1120
- *
1121
- * Unless required by applicable law or agreed to in writing, software distributed under
1122
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1123
- * OF ANY KIND, either express or implied. See the License for the specific language
1124
- * governing permissions and limitations under the License.
1125
- */
1126
-
1127
- const $64fa3d84918910a7$export$c62b8e45d58ddad9 = Symbol('default');
1128
- function $64fa3d84918910a7$export$2881499e37b75b9a({ values: values, children: children }) {
1129
- for (let [Context, value] of values)// @ts-ignore
1130
- children = /*#__PURE__*/ (React__default).createElement(Context.Provider, {
1131
- value: value
1132
- }, children);
1133
- return children;
1134
- }
1135
- function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
1136
- let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values } = props;
1137
- return (useMemo)(()=>{
1138
- let computedClassName;
1139
- let computedStyle;
1140
- let computedChildren;
1141
- if (typeof className === 'function') computedClassName = className({
1142
- ...values,
1143
- defaultClassName: defaultClassName
1144
- });
1145
- else computedClassName = className;
1146
- if (typeof style === 'function') computedStyle = style({
1147
- ...values,
1148
- defaultStyle: defaultStyle || {}
1149
- });
1150
- else computedStyle = style;
1151
- if (typeof children === 'function') computedChildren = children({
1152
- ...values,
1153
- defaultChildren: defaultChildren
1154
- });
1155
- else if (children == null) computedChildren = defaultChildren;
1156
- else computedChildren = children;
1157
- return {
1158
- className: computedClassName !== null && computedClassName !== void 0 ? computedClassName : defaultClassName,
1159
- style: computedStyle || defaultStyle ? {
1160
- ...defaultStyle,
1161
- ...computedStyle
1162
- } : undefined,
1163
- children: computedChildren !== null && computedChildren !== void 0 ? computedChildren : defaultChildren,
1164
- 'data-rac': ''
1165
- };
1166
- }, [
1167
- className,
1168
- style,
1169
- children,
1170
- defaultClassName,
1171
- defaultChildren,
1172
- defaultStyle,
1173
- values
1174
- ]);
1175
- }
1176
- function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) {
1177
- let ctx = (useContext)(context);
1178
- if (slot === null) // An explicit `null` slot means don't use context.
1179
- return null;
1180
- if (ctx && typeof ctx === 'object' && 'slots' in ctx && ctx.slots) {
1181
- let slotKey = slot || $64fa3d84918910a7$export$c62b8e45d58ddad9;
1182
- if (!ctx.slots[slotKey]) {
1183
- let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map((p)=>`"${p}"`));
1184
- let errorMessage = slot ? `Invalid slot "${slot}".` : 'A slot prop is required.';
1185
- throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`);
1186
- }
1187
- return ctx.slots[slotKey];
1188
- }
1189
- // @ts-ignore
1190
- return ctx;
1191
- }
1192
- function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) {
1193
- let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e(context, props.slot) || {};
1194
- // @ts-ignore - TS says "Type 'unique symbol' cannot be used as an index type." but not sure why.
1195
- let { ref: contextRef, ...contextProps } = ctx;
1196
- let mergedRef = ($df56164dff5785e2$export$4338b53315abf666)((useMemo)(()=>($5dc95899b306f630$export$c9058316764c140e)(ref, contextRef), [
1197
- ref,
1198
- contextRef
1199
- ]));
1200
- let mergedProps = ($3ef42575df84b30b$export$9d1611c77c2fe928)(contextProps, props);
1201
- // mergeProps does not merge `style`. Adding this there might be a breaking change.
1202
- if ('style' in contextProps && contextProps.style && 'style' in props && props.style) {
1203
- if (typeof contextProps.style === 'function' || typeof props.style === 'function') // @ts-ignore
1204
- mergedProps.style = (renderProps)=>{
1205
- let contextStyle = typeof contextProps.style === 'function' ? contextProps.style(renderProps) : contextProps.style;
1206
- let defaultStyle = {
1207
- ...renderProps.defaultStyle,
1208
- ...contextStyle
1209
- };
1210
- let style = typeof props.style === 'function' ? props.style({
1211
- ...renderProps,
1212
- defaultStyle: defaultStyle
1213
- }) : props.style;
1214
- return {
1215
- ...defaultStyle,
1216
- ...style
1217
- };
1218
- };
1219
- else // @ts-ignore
1220
- mergedProps.style = {
1221
- ...contextProps.style,
1222
- ...props.style
1223
- };
1224
- }
1225
- return [
1226
- mergedProps,
1227
- mergedRef
1228
- ];
1229
- }
1230
- function $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(initialState = true) {
1231
- // Initial state is typically based on the parent having an aria-label or aria-labelledby.
1232
- // If it does, this value should be false so that we don't update the state and cause a rerender when we go through the layoutEffect
1233
- let [hasSlot, setHasSlot] = (useState)(initialState);
1234
- let hasRun = (useRef)(false);
1235
- // A callback ref which will run when the slotted element mounts.
1236
- // This should happen before the useLayoutEffect below.
1237
- let ref = (useCallback)((el)=>{
1238
- hasRun.current = true;
1239
- setHasSlot(!!el);
1240
- }, []);
1241
- // If the callback hasn't been called, then reset to false.
1242
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
1243
- if (!hasRun.current) setHasSlot(false);
1244
- }, []);
1245
- return [
1246
- ref,
1247
- hasSlot
1248
- ];
1249
- }
1250
- function $64fa3d84918910a7$export$ef03459518577ad4(props) {
1251
- const prefix = /^(data-.*)$/;
1252
- let filteredProps = {};
1253
- for(const prop in props)if (!prefix.test(prop)) filteredProps[prop] = props[prop];
1254
- return filteredProps;
1255
- }
1256
-
1257
- /*
1258
- * Copyright 2020 Adobe. All rights reserved.
1259
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1260
- * you may not use this file except in compliance with the License. You may obtain a copy
1261
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1262
- *
1263
- * Unless required by applicable law or agreed to in writing, software distributed under
1264
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1265
- * OF ANY KIND, either express or implied. See the License for the specific language
1266
- * governing permissions and limitations under the License.
1267
- */ // https://en.wikipedia.org/wiki/Right-to-left
1268
- const $148a7a147e38ea7f$var$RTL_SCRIPTS = new Set([
1269
- 'Arab',
1270
- 'Syrc',
1271
- 'Samr',
1272
- 'Mand',
1273
- 'Thaa',
1274
- 'Mend',
1275
- 'Nkoo',
1276
- 'Adlm',
1277
- 'Rohg',
1278
- 'Hebr'
1279
- ]);
1280
- const $148a7a147e38ea7f$var$RTL_LANGS = new Set([
1281
- 'ae',
1282
- 'ar',
1283
- 'arc',
1284
- 'bcc',
1285
- 'bqi',
1286
- 'ckb',
1287
- 'dv',
1288
- 'fa',
1289
- 'glk',
1290
- 'he',
1291
- 'ku',
1292
- 'mzn',
1293
- 'nqo',
1294
- 'pnb',
1295
- 'ps',
1296
- 'sd',
1297
- 'ug',
1298
- 'ur',
1299
- 'yi'
1300
- ]);
1301
- function $148a7a147e38ea7f$export$702d680b21cbd764(localeString) {
1302
- // If the Intl.Locale API is available, use it to get the locale's text direction.
1303
- if (Intl.Locale) {
1304
- let locale = new Intl.Locale(localeString).maximize();
1305
- // Use the text info object to get the direction if possible.
1306
- // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.
1307
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
1308
- let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;
1309
- if (textInfo) return textInfo.direction === 'rtl';
1310
- // Fallback: guess using the script.
1311
- // This is more accurate than guessing by language, since languages can be written in multiple scripts.
1312
- if (locale.script) return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(locale.script);
1313
- }
1314
- // If not, just guess by the language (first part of the locale)
1315
- let lang = localeString.split('-')[0];
1316
- return $148a7a147e38ea7f$var$RTL_LANGS.has(lang);
1317
- }
1318
-
1319
- /*
1320
- * Copyright 2020 Adobe. All rights reserved.
1321
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1322
- * you may not use this file except in compliance with the License. You may obtain a copy
1323
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1324
- *
1325
- * Unless required by applicable law or agreed to in writing, software distributed under
1326
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1327
- * OF ANY KIND, either express or implied. See the License for the specific language
1328
- * governing permissions and limitations under the License.
1329
- */
1330
-
1331
-
1332
- // Locale passed from server by PackageLocalizationProvider.
1333
- const $1e5a04cdaf7d1af8$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
1334
- function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
1335
- let locale = typeof window !== 'undefined' && window[$1e5a04cdaf7d1af8$var$localeSymbol] || typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
1336
- try {
1337
- Intl.DateTimeFormat.supportedLocalesOf([
1338
- locale
1339
- ]);
1340
- } catch {
1341
- locale = 'en-US';
1342
- }
1343
- return {
1344
- locale: locale,
1345
- direction: ($148a7a147e38ea7f$export$702d680b21cbd764)(locale) ? 'rtl' : 'ltr'
1346
- };
1347
- }
1348
- let $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
1349
- let $1e5a04cdaf7d1af8$var$listeners = new Set();
1350
- function $1e5a04cdaf7d1af8$var$updateLocale() {
1351
- $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
1352
- for (let listener of $1e5a04cdaf7d1af8$var$listeners)listener($1e5a04cdaf7d1af8$var$currentLocale);
1353
- }
1354
- function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
1355
- let isSSR = ($b5e257d569688ac6$export$535bd6ca7f90a273)();
1356
- let [defaultLocale, setDefaultLocale] = (useState)($1e5a04cdaf7d1af8$var$currentLocale);
1357
- (useEffect)(()=>{
1358
- if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.addEventListener('languagechange', $1e5a04cdaf7d1af8$var$updateLocale);
1359
- $1e5a04cdaf7d1af8$var$listeners.add(setDefaultLocale);
1360
- return ()=>{
1361
- $1e5a04cdaf7d1af8$var$listeners.delete(setDefaultLocale);
1362
- if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.removeEventListener('languagechange', $1e5a04cdaf7d1af8$var$updateLocale);
1363
- };
1364
- }, []);
1365
- // We cannot determine the browser's language on the server, so default to
1366
- // en-US. This will be updated after hydration on the client to the correct value.
1367
- if (isSSR) return {
1368
- locale: 'en-US',
1369
- direction: 'ltr'
1370
- };
1371
- return defaultLocale;
1372
- }
1373
-
1374
- /*
1375
- * Copyright 2020 Adobe. All rights reserved.
1376
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1377
- * you may not use this file except in compliance with the License. You may obtain a copy
1378
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1379
- *
1380
- * Unless required by applicable law or agreed to in writing, software distributed under
1381
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1382
- * OF ANY KIND, either express or implied. See the License for the specific language
1383
- * governing permissions and limitations under the License.
1384
- */
1385
-
1386
-
1387
- const $18f2051aff69b9bf$var$I18nContext = /*#__PURE__*/ (React__default).createContext(null);
1388
- function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
1389
- let defaultLocale = ($1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a)();
1390
- let context = (useContext)($18f2051aff69b9bf$var$I18nContext);
1391
- return context || defaultLocale;
1392
- }
1393
-
1394
- /*
1395
- * Copyright 2022 Adobe. All rights reserved.
1396
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1397
- * you may not use this file except in compliance with the License. You may obtain a copy
1398
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1399
- *
1400
- * Unless required by applicable law or agreed to in writing, software distributed under
1401
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1402
- * OF ANY KIND, either express or implied. See the License for the specific language
1403
- * governing permissions and limitations under the License.
1404
- */ const $5b160d28a433310d$var$localeSymbol = Symbol.for('react-aria.i18n.locale');
1405
- const $5b160d28a433310d$var$stringsSymbol = Symbol.for('react-aria.i18n.strings');
1406
- let $5b160d28a433310d$var$cachedGlobalStrings = undefined;
1407
- class $5b160d28a433310d$export$c17fa47878dc55b6 {
1408
- /** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {
1409
- let strings = this.getStringsForLocale(locale);
1410
- let string = strings[key];
1411
- if (!string) throw new Error(`Could not find intl message ${key} in ${locale} locale`);
1412
- return string;
1413
- }
1414
- /** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {
1415
- let strings = this.strings[locale];
1416
- if (!strings) {
1417
- strings = $5b160d28a433310d$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
1418
- this.strings[locale] = strings;
1419
- }
1420
- return strings;
1421
- }
1422
- static getGlobalDictionaryForPackage(packageName) {
1423
- if (typeof window === 'undefined') return null;
1424
- let locale = window[$5b160d28a433310d$var$localeSymbol];
1425
- if ($5b160d28a433310d$var$cachedGlobalStrings === undefined) {
1426
- let globalStrings = window[$5b160d28a433310d$var$stringsSymbol];
1427
- if (!globalStrings) return null;
1428
- $5b160d28a433310d$var$cachedGlobalStrings = {};
1429
- for(let pkg in globalStrings)$5b160d28a433310d$var$cachedGlobalStrings[pkg] = new $5b160d28a433310d$export$c17fa47878dc55b6({
1430
- [locale]: globalStrings[pkg]
1431
- }, locale);
1432
- }
1433
- let dictionary = $5b160d28a433310d$var$cachedGlobalStrings === null || $5b160d28a433310d$var$cachedGlobalStrings === void 0 ? void 0 : $5b160d28a433310d$var$cachedGlobalStrings[packageName];
1434
- if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
1435
- return dictionary;
1436
- }
1437
- constructor(messages, defaultLocale = 'en-US'){
1438
- // Clone messages so we don't modify the original object.
1439
- // Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
1440
- this.strings = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
1441
- this.defaultLocale = defaultLocale;
1442
- }
1443
- }
1444
- function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
1445
- // If there is an exact match, use it.
1446
- if (strings[locale]) return strings[locale];
1447
- // Attempt to find the closest match by language.
1448
- // For example, if the locale is fr-CA (French Canadian), but there is only
1449
- // an fr-FR (France) set of strings, use that.
1450
- // This could be replaced with Intl.LocaleMatcher once it is supported.
1451
- // https://github.com/tc39/proposal-intl-localematcher
1452
- let language = $5b160d28a433310d$var$getLanguage(locale);
1453
- if (strings[language]) return strings[language];
1454
- for(let key in strings){
1455
- if (key.startsWith(language + '-')) return strings[key];
1456
- }
1457
- // Nothing close, use english.
1458
- return strings[defaultLocale];
1459
- }
1460
- function $5b160d28a433310d$var$getLanguage(locale) {
1461
- // @ts-ignore
1462
- if (Intl.Locale) // @ts-ignore
1463
- return new Intl.Locale(locale).language;
1464
- return locale.split('-')[0];
1465
- }
1466
-
1467
- /*
1468
- * Copyright 2022 Adobe. All rights reserved.
1469
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1470
- * you may not use this file except in compliance with the License. You may obtain a copy
1471
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1472
- *
1473
- * Unless required by applicable law or agreed to in writing, software distributed under
1474
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1475
- * OF ANY KIND, either express or implied. See the License for the specific language
1476
- * governing permissions and limitations under the License.
1477
- */ const $6db58dc88e78b024$var$pluralRulesCache = new Map();
1478
- const $6db58dc88e78b024$var$numberFormatCache = new Map();
1479
- class $6db58dc88e78b024$export$2f817fcdc4b89ae0 {
1480
- /** Formats a localized string for the given key with the provided variables. */ format(key, variables) {
1481
- let message = this.strings.getStringForLocale(key, this.locale);
1482
- return typeof message === 'function' ? message(variables, this) : message;
1483
- }
1484
- plural(count, options, type = 'cardinal') {
1485
- let opt = options['=' + count];
1486
- if (opt) return typeof opt === 'function' ? opt() : opt;
1487
- let key = this.locale + ':' + type;
1488
- let pluralRules = $6db58dc88e78b024$var$pluralRulesCache.get(key);
1489
- if (!pluralRules) {
1490
- pluralRules = new Intl.PluralRules(this.locale, {
1491
- type: type
1492
- });
1493
- $6db58dc88e78b024$var$pluralRulesCache.set(key, pluralRules);
1494
- }
1495
- let selected = pluralRules.select(count);
1496
- opt = options[selected] || options.other;
1497
- return typeof opt === 'function' ? opt() : opt;
1498
- }
1499
- number(value) {
1500
- let numberFormat = $6db58dc88e78b024$var$numberFormatCache.get(this.locale);
1501
- if (!numberFormat) {
1502
- numberFormat = new Intl.NumberFormat(this.locale);
1503
- $6db58dc88e78b024$var$numberFormatCache.set(this.locale, numberFormat);
1504
- }
1505
- return numberFormat.format(value);
1506
- }
1507
- select(options, value) {
1508
- let opt = options[value] || options.other;
1509
- return typeof opt === 'function' ? opt() : opt;
1510
- }
1511
- constructor(locale, strings){
1512
- this.locale = locale;
1513
- this.strings = strings;
1514
- }
1515
- }
1516
-
1517
- /*
1518
- * Copyright 2022 Adobe. All rights reserved.
1519
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1520
- * you may not use this file except in compliance with the License. You may obtain a copy
1521
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1522
- *
1523
- * Unless required by applicable law or agreed to in writing, software distributed under
1524
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1525
- * OF ANY KIND, either express or implied. See the License for the specific language
1526
- * governing permissions and limitations under the License.
1527
- */
1528
-
1529
-
1530
- const $fca6afa0e843324b$var$cache = new WeakMap();
1531
- function $fca6afa0e843324b$var$getCachedDictionary(strings) {
1532
- let dictionary = $fca6afa0e843324b$var$cache.get(strings);
1533
- if (!dictionary) {
1534
- dictionary = new ($5b160d28a433310d$export$c17fa47878dc55b6)(strings);
1535
- $fca6afa0e843324b$var$cache.set(strings, dictionary);
1536
- }
1537
- return dictionary;
1538
- }
1539
- function $fca6afa0e843324b$export$87b761675e8eaa10(strings, packageName) {
1540
- return packageName && ($5b160d28a433310d$export$c17fa47878dc55b6).getGlobalDictionaryForPackage(packageName) || $fca6afa0e843324b$var$getCachedDictionary(strings);
1541
- }
1542
- function $fca6afa0e843324b$export$f12b703ca79dfbb1(strings, packageName) {
1543
- let { locale: locale } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
1544
- let dictionary = $fca6afa0e843324b$export$87b761675e8eaa10(strings, packageName);
1545
- return (useMemo)(()=>new ($6db58dc88e78b024$export$2f817fcdc4b89ae0)(locale, dictionary), [
1546
- locale,
1547
- dictionary
1548
- ]);
1549
- }
1550
-
1551
- /*
1552
- * Copyright 2020 Adobe. All rights reserved.
1553
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1554
- * you may not use this file except in compliance with the License. You may obtain a copy
1555
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1556
- *
1557
- * Unless required by applicable law or agreed to in writing, software distributed under
1558
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1559
- * OF ANY KIND, either express or implied. See the License for the specific language
1560
- * governing permissions and limitations under the License.
1561
- */
1562
-
1563
- function $8a9cb279dc87e130$export$525bc4921d56d4a(nativeEvent) {
1564
- let event = nativeEvent;
1565
- event.nativeEvent = nativeEvent;
1566
- event.isDefaultPrevented = ()=>event.defaultPrevented;
1567
- // cancelBubble is technically deprecated in the spec, but still supported in all browsers.
1568
- event.isPropagationStopped = ()=>event.cancelBubble;
1569
- event.persist = ()=>{};
1570
- return event;
1571
- }
1572
- function $8a9cb279dc87e130$export$c2b7abe5d61ec696(event, target) {
1573
- Object.defineProperty(event, 'target', {
1574
- value: target
1575
- });
1576
- Object.defineProperty(event, 'currentTarget', {
1577
- value: target
1578
- });
1579
- }
1580
- function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
1581
- let stateRef = (useRef)({
1582
- isFocused: false,
1583
- observer: null
1584
- });
1585
- // Clean up MutationObserver on unmount. See below.
1586
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
1587
- const state = stateRef.current;
1588
- return ()=>{
1589
- if (state.observer) {
1590
- state.observer.disconnect();
1591
- state.observer = null;
1592
- }
1593
- };
1594
- }, []);
1595
- let dispatchBlur = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
1596
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
1597
- });
1598
- // This function is called during a React onFocus event.
1599
- return (useCallback)((e)=>{
1600
- // React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
1601
- // Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
1602
- // MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
1603
- // For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
1604
- if (e.target instanceof HTMLButtonElement || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement) {
1605
- stateRef.current.isFocused = true;
1606
- let target = e.target;
1607
- let onBlurHandler = (e)=>{
1608
- stateRef.current.isFocused = false;
1609
- if (target.disabled) {
1610
- // For backward compatibility, dispatch a (fake) React synthetic event.
1611
- let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e);
1612
- dispatchBlur(event);
1613
- }
1614
- // We no longer need the MutationObserver once the target is blurred.
1615
- if (stateRef.current.observer) {
1616
- stateRef.current.observer.disconnect();
1617
- stateRef.current.observer = null;
1618
- }
1619
- };
1620
- target.addEventListener('focusout', onBlurHandler, {
1621
- once: true
1622
- });
1623
- stateRef.current.observer = new MutationObserver(()=>{
1624
- if (stateRef.current.isFocused && target.disabled) {
1625
- var _stateRef_current_observer;
1626
- (_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
1627
- let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
1628
- target.dispatchEvent(new FocusEvent('blur', {
1629
- relatedTarget: relatedTargetEl
1630
- }));
1631
- target.dispatchEvent(new FocusEvent('focusout', {
1632
- bubbles: true,
1633
- relatedTarget: relatedTargetEl
1634
- }));
1635
- }
1636
- });
1637
- stateRef.current.observer.observe(target, {
1638
- attributes: true,
1639
- attributeFilter: [
1640
- 'disabled'
1641
- ]
1642
- });
1643
- }
1644
- }, [
1645
- dispatchBlur
1646
- ]);
1647
- }
1648
- let $8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
1649
- function $8a9cb279dc87e130$export$cabe61c495ee3649(target) {
1650
- // The browser will focus the nearest focusable ancestor of our target.
1651
- while(target && !($b4b717babfbb907b$export$4c063cf1350e6fed)(target))target = target.parentElement;
1652
- let window = ($431fbd86ca7dc216$export$f21a1ffae260145a)(target);
1653
- let activeElement = window.document.activeElement;
1654
- if (!activeElement || activeElement === target) return;
1655
- $8a9cb279dc87e130$export$fda7da73ab5d4c48 = true;
1656
- let isRefocusing = false;
1657
- let onBlur = (e)=>{
1658
- if (e.target === activeElement || isRefocusing) e.stopImmediatePropagation();
1659
- };
1660
- let onFocusOut = (e)=>{
1661
- if (e.target === activeElement || isRefocusing) {
1662
- e.stopImmediatePropagation();
1663
- // If there was no focusable ancestor, we don't expect a focus event.
1664
- // Re-focus the original active element here.
1665
- if (!target && !isRefocusing) {
1666
- isRefocusing = true;
1667
- ($7215afc6de606d6b$export$de79e2c695e052f3)(activeElement);
1668
- cleanup();
1669
- }
1670
- }
1671
- };
1672
- let onFocus = (e)=>{
1673
- if (e.target === target || isRefocusing) e.stopImmediatePropagation();
1674
- };
1675
- let onFocusIn = (e)=>{
1676
- if (e.target === target || isRefocusing) {
1677
- e.stopImmediatePropagation();
1678
- if (!isRefocusing) {
1679
- isRefocusing = true;
1680
- ($7215afc6de606d6b$export$de79e2c695e052f3)(activeElement);
1681
- cleanup();
1682
- }
1683
- }
1684
- };
1685
- window.addEventListener('blur', onBlur, true);
1686
- window.addEventListener('focusout', onFocusOut, true);
1687
- window.addEventListener('focusin', onFocusIn, true);
1688
- window.addEventListener('focus', onFocus, true);
1689
- let cleanup = ()=>{
1690
- cancelAnimationFrame(raf);
1691
- window.removeEventListener('blur', onBlur, true);
1692
- window.removeEventListener('focusout', onFocusOut, true);
1693
- window.removeEventListener('focusin', onFocusIn, true);
1694
- window.removeEventListener('focus', onFocus, true);
1695
- $8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
1696
- isRefocusing = false;
1697
- };
1698
- let raf = requestAnimationFrame(cleanup);
1699
- return cleanup;
1700
- }
1701
-
1702
- /*
1703
- * Copyright 2020 Adobe. All rights reserved.
1704
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1705
- * you may not use this file except in compliance with the License. You may obtain a copy
1706
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1707
- *
1708
- * Unless required by applicable law or agreed to in writing, software distributed under
1709
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1710
- * OF ANY KIND, either express or implied. See the License for the specific language
1711
- * governing permissions and limitations under the License.
1712
- */ // Portions of the code in this file are based on code from react.
1713
- // Original licensing for the following can be found in the
1714
- // NOTICE file in the root directory of this source tree.
1715
- // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
1716
-
1717
-
1718
-
1719
-
1720
- let $507fabe10e71c6fb$var$currentModality = null;
1721
- let $507fabe10e71c6fb$var$changeHandlers = new Set();
1722
- let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
1723
- let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
1724
- let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
1725
- // Only Tab or Esc keys will make focus visible on text input elements
1726
- const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
1727
- Tab: true,
1728
- Escape: true
1729
- };
1730
- function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
1731
- for (let handler of $507fabe10e71c6fb$var$changeHandlers)handler(modality, e);
1732
- }
1733
- /**
1734
- * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
1735
- */ function $507fabe10e71c6fb$var$isValidKey(e) {
1736
- // Control and Shift keys trigger when navigating back to the tab with keyboard.
1737
- return !(e.metaKey || !($c87311424ea30a05$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
1738
- }
1739
- function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
1740
- $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
1741
- if ($507fabe10e71c6fb$var$isValidKey(e)) {
1742
- $507fabe10e71c6fb$var$currentModality = 'keyboard';
1743
- $507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
1744
- }
1745
- }
1746
- function $507fabe10e71c6fb$var$handlePointerEvent(e) {
1747
- $507fabe10e71c6fb$var$currentModality = 'pointer';
1748
- if (e.type === 'mousedown' || e.type === 'pointerdown') {
1749
- $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
1750
- $507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
1751
- }
1752
- }
1753
- function $507fabe10e71c6fb$var$handleClickEvent(e) {
1754
- if (($6a7db85432448f7f$export$60278871457622de)(e)) {
1755
- $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
1756
- $507fabe10e71c6fb$var$currentModality = 'virtual';
1757
- }
1758
- }
1759
- function $507fabe10e71c6fb$var$handleFocusEvent(e) {
1760
- // Firefox fires two extra focus events when the user first clicks into an iframe:
1761
- // first on the window, then on the document. We ignore these events so they don't
1762
- // cause keyboard focus rings to appear.
1763
- if (e.target === window || e.target === document || ($8a9cb279dc87e130$export$fda7da73ab5d4c48) || !e.isTrusted) return;
1764
- // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
1765
- // This occurs, for example, when navigating a form with the next/previous buttons on iOS.
1766
- if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
1767
- $507fabe10e71c6fb$var$currentModality = 'virtual';
1768
- $507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
1769
- }
1770
- $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
1771
- $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
1772
- }
1773
- function $507fabe10e71c6fb$var$handleWindowBlur() {
1774
- if ($8a9cb279dc87e130$export$fda7da73ab5d4c48) return;
1775
- // When the window is blurred, reset state. This is necessary when tabbing out of the window,
1776
- // for example, since a subsequent focus event won't be fired.
1777
- $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
1778
- $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
1779
- }
1780
- /**
1781
- * Setup global event listeners to control when keyboard focus style should be visible.
1782
- */ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
1783
- if (typeof window === 'undefined' || typeof document === 'undefined' || $507fabe10e71c6fb$export$d90243b58daecda7.get(($431fbd86ca7dc216$export$f21a1ffae260145a)(element))) return;
1784
- const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
1785
- const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
1786
- // Programmatic focus() calls shouldn't affect the current input modality.
1787
- // However, we need to detect other cases when a focus event occurs without
1788
- // a preceding user event (e.g. screen reader focus). Overriding the focus
1789
- // method on HTMLElement.prototype is a bit hacky, but works.
1790
- let focus = windowObject.HTMLElement.prototype.focus;
1791
- windowObject.HTMLElement.prototype.focus = function() {
1792
- $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
1793
- focus.apply(this, arguments);
1794
- };
1795
- documentObject.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
1796
- documentObject.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
1797
- documentObject.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
1798
- // Register focus events on the window so they are sure to happen
1799
- // before React's event listeners (registered on the document).
1800
- windowObject.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
1801
- windowObject.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
1802
- if (typeof PointerEvent !== 'undefined') {
1803
- documentObject.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
1804
- documentObject.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
1805
- documentObject.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
1806
- } else if (process.env.NODE_ENV === 'test') {
1807
- documentObject.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
1808
- documentObject.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
1809
- documentObject.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
1810
- }
1811
- // Add unmount handler
1812
- windowObject.addEventListener('beforeunload', ()=>{
1813
- $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
1814
- }, {
1815
- once: true
1816
- });
1817
- $507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
1818
- focus: focus
1819
- });
1820
- }
1821
- const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener)=>{
1822
- const windowObject = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
1823
- const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
1824
- if (loadListener) documentObject.removeEventListener('DOMContentLoaded', loadListener);
1825
- if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
1826
- windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
1827
- documentObject.removeEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
1828
- documentObject.removeEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
1829
- documentObject.removeEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
1830
- windowObject.removeEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
1831
- windowObject.removeEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
1832
- if (typeof PointerEvent !== 'undefined') {
1833
- documentObject.removeEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
1834
- documentObject.removeEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
1835
- documentObject.removeEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
1836
- } else if (process.env.NODE_ENV === 'test') {
1837
- documentObject.removeEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
1838
- documentObject.removeEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
1839
- documentObject.removeEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
1840
- }
1841
- $507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
1842
- };
1843
- function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
1844
- const documentObject = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
1845
- let loadListener;
1846
- if (documentObject.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
1847
- else {
1848
- loadListener = ()=>{
1849
- $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
1850
- };
1851
- documentObject.addEventListener('DOMContentLoaded', loadListener);
1852
- }
1853
- return ()=>$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
1854
- }
1855
- // Server-side rendering does not have the document object defined
1856
- // eslint-disable-next-line no-restricted-globals
1857
- if (typeof document !== 'undefined') $507fabe10e71c6fb$export$2f1888112f558a7d();
1858
- function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
1859
- return $507fabe10e71c6fb$var$currentModality !== 'pointer';
1860
- }
1861
- function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
1862
- return $507fabe10e71c6fb$var$currentModality;
1863
- }
1864
- function $507fabe10e71c6fb$export$8397ddfc504fdb9a(modality) {
1865
- $507fabe10e71c6fb$var$currentModality = modality;
1866
- $507fabe10e71c6fb$var$triggerChangeHandlers(modality, null);
1867
- }
1868
- const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
1869
- 'checkbox',
1870
- 'radio',
1871
- 'range',
1872
- 'color',
1873
- 'file',
1874
- 'image',
1875
- 'button',
1876
- 'submit',
1877
- 'reset'
1878
- ]);
1879
- /**
1880
- * If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
1881
- * focus visible style can be properly set.
1882
- */ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
1883
- let document1 = ($431fbd86ca7dc216$export$b204af158042fbac)(e === null || e === void 0 ? void 0 : e.target);
1884
- const IHTMLInputElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
1885
- const IHTMLTextAreaElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
1886
- const IHTMLElement = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
1887
- const IKeyboardEvent = typeof window !== 'undefined' ? ($431fbd86ca7dc216$export$f21a1ffae260145a)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
1888
- // For keyboard events that occur on a non-input element that will move focus into input element (aka ArrowLeft going from Datepicker button to the main input group)
1889
- // we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element
1890
- isTextInput = isTextInput || document1.activeElement instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(document1.activeElement.type) || document1.activeElement instanceof IHTMLTextAreaElement || document1.activeElement instanceof IHTMLElement && document1.activeElement.isContentEditable;
1891
- return !(isTextInput && modality === 'keyboard' && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
1892
- }
1893
- function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
1894
- $507fabe10e71c6fb$var$setupGlobalFocusEvents();
1895
- (useEffect)(()=>{
1896
- let handler = (modality, e)=>{
1897
- // We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape
1898
- if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
1899
- fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
1900
- };
1901
- $507fabe10e71c6fb$var$changeHandlers.add(handler);
1902
- return ()=>{
1903
- $507fabe10e71c6fb$var$changeHandlers.delete(handler);
1904
- };
1905
- // eslint-disable-next-line react-hooks/exhaustive-deps
1906
- }, deps);
1907
- }
1908
-
1909
- /*
1910
- * Copyright 2020 Adobe. All rights reserved.
1911
- * This file is licensed to you under the Apache License, Version 2.0 (the 'License');
1912
- * you may not use this file except in compliance with the License. You may obtain a copy
1913
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1914
- *
1915
- * Unless required by applicable law or agreed to in writing, software distributed under
1916
- * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1917
- * OF ANY KIND, either express or implied. See the License for the specific language
1918
- * governing permissions and limitations under the License.
1919
- */
1920
-
1921
- function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
1922
- // If the user is interacting with a virtual cursor, e.g. screen reader, then
1923
- // wait until after any animated transitions that are currently occurring on
1924
- // the page before shifting focus. This avoids issues with VoiceOver on iOS
1925
- // causing the page to scroll when moving focus if the element is transitioning
1926
- // from off the screen.
1927
- const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(element);
1928
- const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
1929
- if (($507fabe10e71c6fb$export$630ff653c5ada6a9)() === 'virtual') {
1930
- let lastFocusedElement = activeElement;
1931
- ($bbed8b41f857bcc0$export$24490316f764c430)(()=>{
1932
- // If focus did not move and the element is still in the document, focus it.
1933
- if (($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument) === lastFocusedElement && element.isConnected) ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
1934
- });
1935
- } else ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
1936
- }
1937
-
1938
- /*
1939
- * Copyright 2020 Adobe. All rights reserved.
1940
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1941
- * you may not use this file except in compliance with the License. You may obtain a copy
1942
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1943
- *
1944
- * Unless required by applicable law or agreed to in writing, software distributed under
1945
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1946
- * OF ANY KIND, either express or implied. See the License for the specific language
1947
- * governing permissions and limitations under the License.
1948
- */ // Portions of the code in this file are based on code from react.
1949
- // Original licensing for the following can be found in the
1950
- // NOTICE file in the root directory of this source tree.
1951
- // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
1952
-
1953
-
1954
-
1955
- function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
1956
- let { isDisabled: isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange: onFocusChange } = props;
1957
- const onBlur = (useCallback)((e)=>{
1958
- if (e.target === e.currentTarget) {
1959
- if (onBlurProp) onBlurProp(e);
1960
- if (onFocusChange) onFocusChange(false);
1961
- return true;
1962
- }
1963
- }, [
1964
- onBlurProp,
1965
- onFocusChange
1966
- ]);
1967
- const onSyntheticFocus = ($8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
1968
- const onFocus = (useCallback)((e)=>{
1969
- // Double check that document.activeElement actually matches e.target in case a previously chained
1970
- // focus handler already moved focus somewhere else.
1971
- const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(e.target);
1972
- const activeElement = ownerDocument ? ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument) : ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
1973
- if (e.target === e.currentTarget && activeElement === ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent)) {
1974
- if (onFocusProp) onFocusProp(e);
1975
- if (onFocusChange) onFocusChange(true);
1976
- onSyntheticFocus(e);
1977
- }
1978
- }, [
1979
- onFocusChange,
1980
- onFocusProp,
1981
- onSyntheticFocus
1982
- ]);
1983
- return {
1984
- focusProps: {
1985
- onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : undefined,
1986
- onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : undefined
1987
- }
1988
- };
1989
- }
1990
-
1991
- /*
1992
- * Copyright 2020 Adobe. All rights reserved.
1993
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1994
- * you may not use this file except in compliance with the License. You may obtain a copy
1995
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1996
- *
1997
- * Unless required by applicable law or agreed to in writing, software distributed under
1998
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1999
- * OF ANY KIND, either express or implied. See the License for the specific language
2000
- * governing permissions and limitations under the License.
2001
- */ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
2002
- if (!handler) return undefined;
2003
- let shouldStopPropagation = true;
2004
- return (e)=>{
2005
- let event = {
2006
- ...e,
2007
- preventDefault () {
2008
- e.preventDefault();
2009
- },
2010
- isDefaultPrevented () {
2011
- return e.isDefaultPrevented();
2012
- },
2013
- stopPropagation () {
2014
- if (shouldStopPropagation && process.env.NODE_ENV !== 'production') console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');
2015
- else shouldStopPropagation = true;
2016
- },
2017
- continuePropagation () {
2018
- shouldStopPropagation = false;
2019
- },
2020
- isPropagationStopped () {
2021
- return shouldStopPropagation;
2022
- }
2023
- };
2024
- handler(event);
2025
- if (shouldStopPropagation) e.stopPropagation();
2026
- };
2027
- }
2028
-
2029
- /*
2030
- * Copyright 2020 Adobe. All rights reserved.
2031
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2032
- * you may not use this file except in compliance with the License. You may obtain a copy
2033
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2034
- *
2035
- * Unless required by applicable law or agreed to in writing, software distributed under
2036
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2037
- * OF ANY KIND, either express or implied. See the License for the specific language
2038
- * governing permissions and limitations under the License.
2039
- */
2040
- function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
2041
- return {
2042
- keyboardProps: props.isDisabled ? {} : {
2043
- onKeyDown: ($93925083ecbb358c$export$48d1ea6320830260)(props.onKeyDown),
2044
- onKeyUp: ($93925083ecbb358c$export$48d1ea6320830260)(props.onKeyUp)
2045
- }
2046
- };
2047
- }
2048
-
2049
- /*
2050
- * Copyright 2020 Adobe. All rights reserved.
2051
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2052
- * you may not use this file except in compliance with the License. You may obtain a copy
2053
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2054
- *
2055
- * Unless required by applicable law or agreed to in writing, software distributed under
2056
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2057
- * OF ANY KIND, either express or implied. See the License for the specific language
2058
- * governing permissions and limitations under the License.
2059
- */
2060
-
2061
-
2062
-
2063
-
2064
- let $f645667febf57a63$export$f9762fab77588ecb = /*#__PURE__*/ (React__default).createContext(null);
2065
- function $f645667febf57a63$var$useFocusableContext(ref) {
2066
- let context = (useContext)($f645667febf57a63$export$f9762fab77588ecb) || {};
2067
- ($e7801be82b4b2a53$export$4debdb1a3f0fa79e)(context, ref);
2068
- // eslint-disable-next-line
2069
- let { ref: _, ...otherProps } = context;
2070
- return otherProps;
2071
- }
2072
- function $f645667febf57a63$export$4c014de7c8940b4c(props, domRef) {
2073
- let { focusProps: focusProps } = ($a1ea59d68270f0dd$export$f8168d8dd8fd66e6)(props);
2074
- let { keyboardProps: keyboardProps } = ($46d819fcbaf35654$export$8f71654801c2f7cd)(props);
2075
- let interactions = ($3ef42575df84b30b$export$9d1611c77c2fe928)(focusProps, keyboardProps);
2076
- let domProps = $f645667febf57a63$var$useFocusableContext(domRef);
2077
- let interactionProps = props.isDisabled ? {} : domProps;
2078
- let autoFocusRef = (useRef)(props.autoFocus);
2079
- (useEffect)(()=>{
2080
- if (autoFocusRef.current && domRef.current) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(domRef.current);
2081
- autoFocusRef.current = false;
2082
- }, [
2083
- domRef
2084
- ]);
2085
- // Always set a tabIndex so that Safari allows focusing native buttons and inputs.
2086
- let tabIndex = props.excludeFromTabOrder ? -1 : 0;
2087
- if (props.isDisabled) tabIndex = undefined;
2088
- return {
2089
- focusableProps: ($3ef42575df84b30b$export$9d1611c77c2fe928)({
2090
- ...interactions,
2091
- tabIndex: tabIndex
2092
- }, interactionProps)
2093
- };
2094
- }
2095
-
2096
- /*
2097
- * Copyright 2020 Adobe. All rights reserved.
2098
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2099
- * you may not use this file except in compliance with the License. You may obtain a copy
2100
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2101
- *
2102
- * Unless required by applicable law or agreed to in writing, software distributed under
2103
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2104
- * OF ANY KIND, either express or implied. See the License for the specific language
2105
- * governing permissions and limitations under the License.
2106
- */ // Portions of the code in this file are based on code from react.
2107
- // Original licensing for the following can be found in the
2108
- // NOTICE file in the root directory of this source tree.
2109
- // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
2110
-
2111
-
2112
-
2113
- function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
2114
- let { isDisabled: isDisabled, onBlurWithin: onBlurWithin, onFocusWithin: onFocusWithin, onFocusWithinChange: onFocusWithinChange } = props;
2115
- let state = (useRef)({
2116
- isFocusWithin: false
2117
- });
2118
- let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
2119
- let onBlur = (useCallback)((e)=>{
2120
- // Ignore events bubbling through portals.
2121
- if (!e.currentTarget.contains(e.target)) return;
2122
- // We don't want to trigger onBlurWithin and then immediately onFocusWithin again
2123
- // when moving focus inside the element. Only trigger if the currentTarget doesn't
2124
- // include the relatedTarget (where focus is moving).
2125
- if (state.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
2126
- state.current.isFocusWithin = false;
2127
- removeAllGlobalListeners();
2128
- if (onBlurWithin) onBlurWithin(e);
2129
- if (onFocusWithinChange) onFocusWithinChange(false);
2130
- }
2131
- }, [
2132
- onBlurWithin,
2133
- onFocusWithinChange,
2134
- state,
2135
- removeAllGlobalListeners
2136
- ]);
2137
- let onSyntheticFocus = ($8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
2138
- let onFocus = (useCallback)((e)=>{
2139
- // Ignore events bubbling through portals.
2140
- if (!e.currentTarget.contains(e.target)) return;
2141
- // Double check that document.activeElement actually matches e.target in case a previously chained
2142
- // focus handler already moved focus somewhere else.
2143
- const ownerDocument = ($431fbd86ca7dc216$export$b204af158042fbac)(e.target);
2144
- const activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)(ownerDocument);
2145
- if (!state.current.isFocusWithin && activeElement === ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent)) {
2146
- if (onFocusWithin) onFocusWithin(e);
2147
- if (onFocusWithinChange) onFocusWithinChange(true);
2148
- state.current.isFocusWithin = true;
2149
- onSyntheticFocus(e);
2150
- // Browsers don't fire blur events when elements are removed from the DOM.
2151
- // However, if a focus event occurs outside the element we're tracking, we
2152
- // can manually fire onBlur.
2153
- let currentTarget = e.currentTarget;
2154
- addGlobalListener(ownerDocument, 'focus', (e)=>{
2155
- if (state.current.isFocusWithin && !($d4ee10de306f2510$export$4282f70798064fe0)(currentTarget, e.target)) {
2156
- let nativeEvent = new ownerDocument.defaultView.FocusEvent('blur', {
2157
- relatedTarget: e.target
2158
- });
2159
- ($8a9cb279dc87e130$export$c2b7abe5d61ec696)(nativeEvent, currentTarget);
2160
- let event = ($8a9cb279dc87e130$export$525bc4921d56d4a)(nativeEvent);
2161
- onBlur(event);
2162
- }
2163
- }, {
2164
- capture: true
2165
- });
2166
- }
2167
- }, [
2168
- onFocusWithin,
2169
- onFocusWithinChange,
2170
- onSyntheticFocus,
2171
- addGlobalListener,
2172
- onBlur
2173
- ]);
2174
- if (isDisabled) return {
2175
- focusWithinProps: {
2176
- // These cannot be null, that would conflict in mergeProps
2177
- onFocus: undefined,
2178
- onBlur: undefined
2179
- }
2180
- };
2181
- return {
2182
- focusWithinProps: {
2183
- onFocus: onFocus,
2184
- onBlur: onBlur
2185
- }
2186
- };
2187
- }
2188
-
2189
- /*
2190
- * Copyright 2020 Adobe. All rights reserved.
2191
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2192
- * you may not use this file except in compliance with the License. You may obtain a copy
2193
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2194
- *
2195
- * Unless required by applicable law or agreed to in writing, software distributed under
2196
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2197
- * OF ANY KIND, either express or implied. See the License for the specific language
2198
- * governing permissions and limitations under the License.
2199
- */ // Portions of the code in this file are based on code from react.
2200
- // Original licensing for the following can be found in the
2201
- // NOTICE file in the root directory of this source tree.
2202
- // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
2203
-
2204
-
2205
- // iOS fires onPointerEnter twice: once with pointerType="touch" and again with pointerType="mouse".
2206
- // We want to ignore these emulated events so they do not trigger hover behavior.
2207
- // See https://bugs.webkit.org/show_bug.cgi?id=214609.
2208
- let $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
2209
- let $6179b936705e76d3$var$hoverCount = 0;
2210
- function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
2211
- $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = true;
2212
- // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter
2213
- // with pointerType="mouse" immediately after onPointerUp and before onFocus. On other
2214
- // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in
2215
- // the distant future because a user previously touched the element.
2216
- setTimeout(()=>{
2217
- $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
2218
- }, 50);
2219
- }
2220
- function $6179b936705e76d3$var$handleGlobalPointerEvent(e) {
2221
- if (e.pointerType === 'touch') $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
2222
- }
2223
- function $6179b936705e76d3$var$setupGlobalTouchEvents() {
2224
- if (typeof document === 'undefined') return;
2225
- if ($6179b936705e76d3$var$hoverCount === 0) {
2226
- if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
2227
- else if (process.env.NODE_ENV === 'test') document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
2228
- }
2229
- $6179b936705e76d3$var$hoverCount++;
2230
- return ()=>{
2231
- $6179b936705e76d3$var$hoverCount--;
2232
- if ($6179b936705e76d3$var$hoverCount > 0) return;
2233
- if (typeof PointerEvent !== 'undefined') document.removeEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
2234
- else if (process.env.NODE_ENV === 'test') document.removeEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
2235
- };
2236
- }
2237
- function $6179b936705e76d3$export$ae780daf29e6d456(props) {
2238
- let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, isDisabled: isDisabled } = props;
2239
- let [isHovered, setHovered] = (useState)(false);
2240
- let state = (useRef)({
2241
- isHovered: false,
2242
- ignoreEmulatedMouseEvents: false,
2243
- pointerType: '',
2244
- target: null
2245
- }).current;
2246
- (useEffect)($6179b936705e76d3$var$setupGlobalTouchEvents, []);
2247
- let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
2248
- let { hoverProps: hoverProps, triggerHoverEnd: triggerHoverEnd } = (useMemo)(()=>{
2249
- let triggerHoverStart = (event, pointerType)=>{
2250
- state.pointerType = pointerType;
2251
- if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) return;
2252
- state.isHovered = true;
2253
- let target = event.currentTarget;
2254
- state.target = target;
2255
- // When an element that is hovered over is removed, no pointerleave event is fired by the browser,
2256
- // even though the originally hovered target may have shrunk in size so it is no longer hovered.
2257
- // However, a pointerover event will be fired on the new target the mouse is over.
2258
- // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
2259
- addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(event.target), 'pointerover', (e)=>{
2260
- if (state.isHovered && state.target && !($d4ee10de306f2510$export$4282f70798064fe0)(state.target, e.target)) triggerHoverEnd(e, e.pointerType);
2261
- }, {
2262
- capture: true
2263
- });
2264
- if (onHoverStart) onHoverStart({
2265
- type: 'hoverstart',
2266
- target: target,
2267
- pointerType: pointerType
2268
- });
2269
- if (onHoverChange) onHoverChange(true);
2270
- setHovered(true);
2271
- };
2272
- let triggerHoverEnd = (event, pointerType)=>{
2273
- let target = state.target;
2274
- state.pointerType = '';
2275
- state.target = null;
2276
- if (pointerType === 'touch' || !state.isHovered || !target) return;
2277
- state.isHovered = false;
2278
- removeAllGlobalListeners();
2279
- if (onHoverEnd) onHoverEnd({
2280
- type: 'hoverend',
2281
- target: target,
2282
- pointerType: pointerType
2283
- });
2284
- if (onHoverChange) onHoverChange(false);
2285
- setHovered(false);
2286
- };
2287
- let hoverProps = {};
2288
- if (typeof PointerEvent !== 'undefined') {
2289
- hoverProps.onPointerEnter = (e)=>{
2290
- if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') return;
2291
- triggerHoverStart(e, e.pointerType);
2292
- };
2293
- hoverProps.onPointerLeave = (e)=>{
2294
- if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, e.pointerType);
2295
- };
2296
- } else if (process.env.NODE_ENV === 'test') {
2297
- hoverProps.onTouchStart = ()=>{
2298
- state.ignoreEmulatedMouseEvents = true;
2299
- };
2300
- hoverProps.onMouseEnter = (e)=>{
2301
- if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, 'mouse');
2302
- state.ignoreEmulatedMouseEvents = false;
2303
- };
2304
- hoverProps.onMouseLeave = (e)=>{
2305
- if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, 'mouse');
2306
- };
2307
- }
2308
- return {
2309
- hoverProps: hoverProps,
2310
- triggerHoverEnd: triggerHoverEnd
2311
- };
2312
- }, [
2313
- onHoverStart,
2314
- onHoverChange,
2315
- onHoverEnd,
2316
- isDisabled,
2317
- state,
2318
- addGlobalListener,
2319
- removeAllGlobalListeners
2320
- ]);
2321
- (useEffect)(()=>{
2322
- // Call the triggerHoverEnd as soon as isDisabled changes to true
2323
- // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering
2324
- if (isDisabled) triggerHoverEnd({
2325
- currentTarget: state.target
2326
- }, state.pointerType);
2327
- // eslint-disable-next-line react-hooks/exhaustive-deps
2328
- }, [
2329
- isDisabled
2330
- ]);
2331
- return {
2332
- hoverProps: hoverProps,
2333
- isHovered: isHovered
2334
- };
2335
- }
2336
-
2337
- /*
2338
- * Copyright 2024 Adobe. All rights reserved.
2339
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2340
- * you may not use this file except in compliance with the License. You may obtain a copy
2341
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2342
- *
2343
- * Unless required by applicable law or agreed to in writing, software distributed under
2344
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2345
- * OF ANY KIND, either express or implied. See the License for the specific language
2346
- * governing permissions and limitations under the License.
2347
- */
2348
- // React doesn't understand the <template> element, which doesn't have children like a normal element.
2349
- // It will throw an error during hydration when it expects the firstChild to contain content rendered
2350
- // on the server, when in reality, the browser will have placed this inside the `content` document fragment.
2351
- // This monkey patches the firstChild property for our special hidden template elements to work around this error.
2352
- // See https://github.com/facebook/react/issues/19932
2353
- if (typeof HTMLTemplateElement !== 'undefined') {
2354
- const getFirstChild = Object.getOwnPropertyDescriptor(Node.prototype, 'firstChild').get;
2355
- Object.defineProperty(HTMLTemplateElement.prototype, 'firstChild', {
2356
- configurable: true,
2357
- enumerable: true,
2358
- get: function() {
2359
- if (this.dataset.reactAriaHidden) return this.content.firstChild;
2360
- else return getFirstChild.call(this);
2361
- }
2362
- });
2363
- }
2364
- const $f39a9eba43920ace$export$94b6d0abf7d33e8c = /*#__PURE__*/ (createContext)(false);
2365
- function $f39a9eba43920ace$export$8dc98ba7eadeaa56(props) {
2366
- let isHidden = (useContext)($f39a9eba43920ace$export$94b6d0abf7d33e8c);
2367
- if (isHidden) // Don't hide again if we are already hidden.
2368
- return /*#__PURE__*/ (React__default).createElement((React__default).Fragment, null, props.children);
2369
- let children = /*#__PURE__*/ (React__default).createElement($f39a9eba43920ace$export$94b6d0abf7d33e8c.Provider, {
2370
- value: true
2371
- }, props.children);
2372
- // In SSR, portals are not supported by React. Instead, always render into a <template>
2373
- // element, which the browser will never display to the user. In addition, the
2374
- // content is not part of the accessible DOM tree, so it won't affect ids or other accessibility attributes.
2375
- return /*#__PURE__*/ (React__default).createElement("template", {
2376
- "data-react-aria-hidden": true
2377
- }, children);
2378
- }
2379
- function $f39a9eba43920ace$export$86427a43e3e48ebb(fn) {
2380
- let Wrapper = (props, ref)=>{
2381
- let isHidden = (useContext)($f39a9eba43920ace$export$94b6d0abf7d33e8c);
2382
- if (isHidden) return null;
2383
- return fn(props, ref);
2384
- };
2385
- // @ts-ignore - for react dev tools
2386
- Wrapper.displayName = fn.displayName || fn.name;
2387
- return (forwardRef)(Wrapper);
2388
- }
2389
- function $f39a9eba43920ace$export$b5d7cc18bb8d2b59() {
2390
- return (useContext)($f39a9eba43920ace$export$94b6d0abf7d33e8c);
2391
- }
2392
-
2393
- /*
2394
- * Copyright 2022 Adobe. All rights reserved.
2395
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2396
- * you may not use this file except in compliance with the License. You may obtain a copy
2397
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2398
- *
2399
- * Unless required by applicable law or agreed to in writing, software distributed under
2400
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2401
- * OF ANY KIND, either express or implied. See the License for the specific language
2402
- * governing permissions and limitations under the License.
2403
- */
2404
-
2405
- const $514c0188e459b4c0$export$9afb8bc826b033ea = /*#__PURE__*/ (createContext)({});
2406
- const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /*#__PURE__*/ (forwardRef)(function Text(props, ref) {
2407
- [props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $514c0188e459b4c0$export$9afb8bc826b033ea);
2408
- let { elementType: ElementType = 'span', ...domProps } = props;
2409
- // @ts-ignore
2410
- return /*#__PURE__*/ (React__default).createElement(ElementType, {
2411
- className: "react-aria-Text",
2412
- ...domProps,
2413
- ref: ref
2414
- });
2415
- });
2416
-
2417
- export { $8ae05eaa5c114e9c$export$7f54fc3180508a52 as $, $64fa3d84918910a7$export$4d86445c2cf5e3 as A, $514c0188e459b4c0$export$5f1af8db9871e1d6 as B, $6179b936705e76d3$export$ae780daf29e6d456 as C, $64fa3d84918910a7$export$fabf2dc03a41866e as D, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as E, $64fa3d84918910a7$export$ef03459518577ad4 as F, $64fa3d84918910a7$export$2881499e37b75b9a as G, $514c0188e459b4c0$export$9afb8bc826b033ea as H, $f4e2df6bd15f8569$export$98658e8c59125e6a as I, $d4ee10de306f2510$export$4282f70798064fe0 as J, $c87311424ea30a05$export$b7d78993b74f766d as K, $c87311424ea30a05$export$9ac100e40613ea10 as L, $c87311424ea30a05$export$78551043582a6a98 as M, $c87311424ea30a05$export$7bef049ce92e4224 as N, $7215afc6de606d6b$export$de79e2c695e052f3 as O, $431fbd86ca7dc216$export$b204af158042fbac as P, $bbed8b41f857bcc0$export$24490316f764c430 as Q, $8a9cb279dc87e130$export$c2b7abe5d61ec696 as R, $8a9cb279dc87e130$export$525bc4921d56d4a as S, $d4ee10de306f2510$export$e58f029f0fbfdb29 as T, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as U, $8a9cb279dc87e130$export$cabe61c495ee3649 as V, $6a7db85432448f7f$export$60278871457622de as W, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as X, $df56164dff5785e2$export$4338b53315abf666 as Y, $b4b717babfbb907b$export$4c063cf1350e6fed as Z, $5dc95899b306f630$export$c9058316764c140e as _, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as a, $d4ee10de306f2510$export$cd4e5573fbe2b576 as a0, $3ad3f6e1647bc98d$export$80f3e147d781571c as a1, $b4b717babfbb907b$export$bebd5a1431fec25d as a2, $c87311424ea30a05$export$6446a186d09e379e as a3, $507fabe10e71c6fb$export$630ff653c5ada6a9 as a4, $b5e257d569688ac6$export$535bd6ca7f90a273 as a5, $c87311424ea30a05$export$e1865c3bedcd822b as a6, $46d819fcbaf35654$export$8f71654801c2f7cd as a7, $f39a9eba43920ace$export$8dc98ba7eadeaa56 as a8, $f645667febf57a63$export$f9762fab77588ecb as a9, $f39a9eba43920ace$export$b5d7cc18bb8d2b59 as aa, $64fa3d84918910a7$export$c62b8e45d58ddad9 as ab, $e9faafb641e167db$export$90fc3a17d93f704c as b, $507fabe10e71c6fb$export$b9b3dfddab17db27 as c, $507fabe10e71c6fb$export$ec71b4b83ac08ec3 as d, $a1ea59d68270f0dd$export$f8168d8dd8fd66e6 as e, $9ab94262bd0047c7$export$420e68273165f4ec as f, $bdb11010cef70236$export$f680877a34711e37 as g, $313b98861ee5dd6c$export$d6875122194c7b44 as h, $bdb11010cef70236$export$b4cc09c592e8fdb8 as i, $3ef42575df84b30b$export$9d1611c77c2fe928 as j, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as k, $507fabe10e71c6fb$export$8397ddfc504fdb9a as l, $458b0a5536c1a7cf$export$40bfa8c7b0832715 as m, $f645667febf57a63$export$4c014de7c8940b4c as n, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as o, $431fbd86ca7dc216$export$f21a1ffae260145a as p, $9446cca9a3875146$export$cb6e0bb50bc19463 as q, $9446cca9a3875146$export$7d15b64cf5a3a4c4 as r, $fca6afa0e843324b$export$f12b703ca79dfbb1 as s, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as t, $c87311424ea30a05$export$186c6964ca17d99 as u, $c87311424ea30a05$export$a11b0059900ceec8 as v, $ff5963eb1fccf552$export$e08e3b67e392101e as w, $c87311424ea30a05$export$fedb369cb70207f1 as x, $f39a9eba43920ace$export$86427a43e3e48ebb as y, $64fa3d84918910a7$export$29f1550f4b0d4415 as z };