@react-aria/overlays 3.12.0 → 3.13.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.
package/dist/module.js CHANGED
@@ -10,40 +10,68 @@ import {VisuallyHidden as $k7QOs$VisuallyHidden} from "@react-aria/visually-hidd
10
10
  function $parcel$interopDefault(a) {
11
11
  return a && a.__esModule ? a.default : a;
12
12
  }
13
- const $edcf132a9284368a$var$AXIS = {
14
- top: 'top',
15
- bottom: 'top',
16
- left: 'left',
17
- right: 'left'
13
+ /*
14
+ * Copyright 2020 Adobe. All rights reserved.
15
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License. You may obtain a copy
17
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software distributed under
20
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
+ * OF ANY KIND, either express or implied. See the License for the specific language
22
+ * governing permissions and limitations under the License.
23
+ */ /*
24
+ * Copyright 2020 Adobe. All rights reserved.
25
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License. You may obtain a copy
27
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software distributed under
30
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
31
+ * OF ANY KIND, either express or implied. See the License for the specific language
32
+ * governing permissions and limitations under the License.
33
+ */ /*
34
+ * Copyright 2020 Adobe. All rights reserved.
35
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
36
+ * you may not use this file except in compliance with the License. You may obtain a copy
37
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
38
+ *
39
+ * Unless required by applicable law or agreed to in writing, software distributed under
40
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
41
+ * OF ANY KIND, either express or implied. See the License for the specific language
42
+ * governing permissions and limitations under the License.
43
+ */ const $edcf132a9284368a$var$AXIS = {
44
+ top: "top",
45
+ bottom: "top",
46
+ left: "left",
47
+ right: "left"
18
48
  };
19
49
  const $edcf132a9284368a$var$FLIPPED_DIRECTION = {
20
- top: 'bottom',
21
- bottom: 'top',
22
- left: 'right',
23
- right: 'left'
50
+ top: "bottom",
51
+ bottom: "top",
52
+ left: "right",
53
+ right: "left"
24
54
  };
25
55
  const $edcf132a9284368a$var$CROSS_AXIS = {
26
- top: 'left',
27
- left: 'top'
56
+ top: "left",
57
+ left: "top"
28
58
  };
29
59
  const $edcf132a9284368a$var$AXIS_SIZE = {
30
- top: 'height',
31
- left: 'width'
32
- };
33
- const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {
60
+ top: "height",
61
+ left: "width"
34
62
  };
63
+ const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
35
64
  // @ts-ignore
36
- let $edcf132a9284368a$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
65
+ let $edcf132a9284368a$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
37
66
  function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
38
67
  let width = 0, height = 0, top = 0, left = 0;
39
- let scroll = {
40
- };
41
- if (containerNode.tagName === 'BODY') {
68
+ let scroll = {};
69
+ if (containerNode.tagName === "BODY") {
42
70
  let documentElement = document.documentElement;
43
- var ref;
44
- width = (ref = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && ref !== void 0 ? ref : documentElement.clientWidth;
45
- var ref1;
46
- height = (ref1 = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && ref1 !== void 0 ? ref1 : documentElement.clientHeight;
71
+ var _visualViewport_width;
72
+ width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : documentElement.clientWidth;
73
+ var _visualViewport_height;
74
+ height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : documentElement.clientHeight;
47
75
  scroll.top = documentElement.scrollTop || containerNode.scrollTop;
48
76
  scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
49
77
  } else {
@@ -87,10 +115,10 @@ function $edcf132a9284368a$var$getMargins(node) {
87
115
  }
88
116
  function $edcf132a9284368a$var$parsePlacement(input) {
89
117
  if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]) return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
90
- let [placement, crossPlacement] = input.split(' ');
91
- let axis = $edcf132a9284368a$var$AXIS[placement] || 'right';
118
+ let [placement, crossPlacement] = input.split(" ");
119
+ let axis = $edcf132a9284368a$var$AXIS[placement] || "right";
92
120
  let crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis];
93
- if (!$edcf132a9284368a$var$AXIS[crossPlacement]) crossPlacement = 'center';
121
+ if (!$edcf132a9284368a$var$AXIS[crossPlacement]) crossPlacement = "center";
94
122
  let size = $edcf132a9284368a$var$AXIS_SIZE[axis];
95
123
  let crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis];
96
124
  $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = {
@@ -105,11 +133,10 @@ function $edcf132a9284368a$var$parsePlacement(input) {
105
133
  }
106
134
  function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned) {
107
135
  let { placement: placement , crossPlacement: crossPlacement , axis: axis , crossAxis: crossAxis , size: size , crossSize: crossSize } = placementInfo;
108
- let position = {
109
- };
136
+ let position = {};
110
137
  // button position
111
138
  position[crossAxis] = childOffset[crossAxis];
112
- if (crossPlacement === 'center') // + (button size / 2) - (overlay size / 2)
139
+ if (crossPlacement === "center") // + (button size / 2) - (overlay size / 2)
113
140
  // at this point the overlay center should match the button center
114
141
  position[crossAxis] += (childOffset[crossSize] - overlaySize[crossSize]) / 2;
115
142
  else if (crossPlacement !== crossAxis) // + (button size) - (overlay size)
@@ -138,9 +165,13 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
138
165
  return position;
139
166
  }
140
167
  function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
141
- return position.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top - (containerOffsetWithBoundary.top + position.top) - (margins.top + margins.bottom + padding) // save additional space for margin and padding
142
- ) : Math.max(0, childOffset.top + containerOffsetWithBoundary.top - (boundaryDimensions.top + boundaryDimensions.scroll.top) - (margins.top + margins.bottom + padding) // save additional space for margin and padding
143
- );
168
+ return position.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top // this is the bottom of the boundary
169
+ - (containerOffsetWithBoundary.top + position.top // this is the top of the overlay
170
+ ) - (margins.top + margins.bottom + padding // save additional space for margin and padding
171
+ )) : Math.max(0, childOffset.top + containerOffsetWithBoundary.top // this is the top of the trigger
172
+ - (boundaryDimensions.top + boundaryDimensions.scroll.top // this is the top of the boundary
173
+ ) - (margins.top + margins.bottom + padding // save additional space for margin and padding
174
+ ));
144
175
  }
145
176
  function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
146
177
  let { placement: placement , axis: axis , size: size } = placementInfo;
@@ -173,8 +204,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
173
204
  position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
174
205
  delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
175
206
  position[crossAxis] += delta;
176
- let arrowPosition = {
177
- };
207
+ let arrowPosition = {};
178
208
  arrowPosition[crossAxis] = childOffset[crossAxis] - position[crossAxis] + childOffset[crossSize] / 2;
179
209
  return {
180
210
  position: position,
@@ -187,9 +217,9 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
187
217
  function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
188
218
  let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight } = opts;
189
219
  let container = overlayNode instanceof HTMLElement && overlayNode.offsetParent || document.body;
190
- let isBodyContainer = container.tagName === 'BODY';
220
+ let isBodyContainer = container.tagName === "BODY";
191
221
  const containerPositionStyle = window.getComputedStyle(container).position;
192
- let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== 'static';
222
+ let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
193
223
  let childOffset = isBodyContainer ? $edcf132a9284368a$var$getOffset(targetNode) : $edcf132a9284368a$var$getPosition(targetNode, container);
194
224
  if (!isBodyContainer) {
195
225
  let { marginTop: marginTop , marginLeft: marginLeft } = window.getComputedStyle(targetNode);
@@ -202,7 +232,7 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
202
232
  overlaySize.height += margins.top + margins.bottom;
203
233
  let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
204
234
  let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
205
- let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
235
+ let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
206
236
  return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight);
207
237
  }
208
238
  function $edcf132a9284368a$var$getOffset(node) {
@@ -218,7 +248,7 @@ function $edcf132a9284368a$var$getOffset(node) {
218
248
  function $edcf132a9284368a$var$getPosition(node, parent) {
219
249
  let style = window.getComputedStyle(node);
220
250
  let offset;
221
- if (style.position === 'fixed') {
251
+ if (style.position === "fixed") {
222
252
  let { top: top , left: left , width: width , height: height } = node.getBoundingClientRect();
223
253
  offset = {
224
254
  top: top,
@@ -242,11 +272,21 @@ function $edcf132a9284368a$var$getPosition(node, parent) {
242
272
 
243
273
 
244
274
 
245
-
275
+ /*
276
+ * Copyright 2020 Adobe. All rights reserved.
277
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
278
+ * you may not use this file except in compliance with the License. You may obtain a copy
279
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
280
+ *
281
+ * Unless required by applicable law or agreed to in writing, software distributed under
282
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
283
+ * OF ANY KIND, either express or implied. See the License for the specific language
284
+ * governing permissions and limitations under the License.
285
+ */
246
286
  const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
247
287
  function $dd149f63282afbbf$export$18fc8428861184da(opts) {
248
288
  let { triggerRef: triggerRef , isOpen: isOpen , onClose: onClose } = opts;
249
- $k7QOs$useEffect(()=>{
289
+ (0, $k7QOs$useEffect)(()=>{
250
290
  if (!isOpen || onClose === null) return;
251
291
  let onScroll = (e)=>{
252
292
  // Ignore if scrolling an scrollable region outside the trigger's tree.
@@ -256,9 +296,9 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
256
296
  let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
257
297
  if (onCloseHandler) onCloseHandler();
258
298
  };
259
- window.addEventListener('scroll', onScroll, true);
299
+ window.addEventListener("scroll", onScroll, true);
260
300
  return ()=>{
261
- window.removeEventListener('scroll', onScroll, true);
301
+ window.removeEventListener("scroll", onScroll, true);
262
302
  };
263
303
  }, [
264
304
  isOpen,
@@ -271,13 +311,12 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
271
311
 
272
312
 
273
313
  // @ts-ignore
274
- let $2a41e45df1593e64$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
314
+ let $2a41e45df1593e64$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
275
315
  function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
276
- let { direction: direction } = $k7QOs$useLocale();
277
- let { targetRef: targetRef , overlayRef: overlayRef , scrollRef: scrollRef = overlayRef , placement: placement = 'bottom' , containerPadding: containerPadding = 12 , shouldFlip: shouldFlip = true , boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null , offset: offset = 0 , crossOffset: crossOffset = 0 , shouldUpdatePosition: shouldUpdatePosition = true , isOpen: isOpen = true , onClose: onClose , maxHeight: maxHeight } = props;
278
- let [position, setPosition] = $k7QOs$useState({
279
- position: {
280
- },
316
+ let { direction: direction } = (0, $k7QOs$useLocale)();
317
+ let { targetRef: targetRef , overlayRef: overlayRef , scrollRef: scrollRef = overlayRef , placement: placement = "bottom" , containerPadding: containerPadding = 12 , shouldFlip: shouldFlip = true , boundaryElement: boundaryElement = typeof document !== "undefined" ? document.body : null , offset: offset = 0 , crossOffset: crossOffset = 0 , shouldUpdatePosition: shouldUpdatePosition = true , isOpen: isOpen = true , onClose: onClose , maxHeight: maxHeight } = props;
318
+ let [position, setPosition] = (0, $k7QOs$useState)({
319
+ position: {},
281
320
  arrowOffsetLeft: undefined,
282
321
  arrowOffsetTop: undefined,
283
322
  maxHeight: undefined,
@@ -298,9 +337,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
298
337
  direction,
299
338
  maxHeight
300
339
  ];
301
- let updatePosition = $k7QOs$useCallback(()=>{
340
+ let updatePosition = (0, $k7QOs$useCallback)(()=>{
302
341
  if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) return;
303
- setPosition($edcf132a9284368a$export$b3ceb0cbf1056d98({
342
+ let position = (0, $edcf132a9284368a$export$b3ceb0cbf1056d98)({
304
343
  placement: $2a41e45df1593e64$var$translateRTL(placement, direction),
305
344
  overlayNode: overlayRef.current,
306
345
  targetNode: targetRef.current,
@@ -311,23 +350,29 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
311
350
  offset: offset,
312
351
  crossOffset: crossOffset,
313
352
  maxHeight: maxHeight
314
- }));
353
+ });
354
+ // Modify overlay styles directly so positioning happens immediately without the need of a second render
355
+ // This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers
356
+ Object.keys(position.position).forEach((key)=>overlayRef.current.style[key] = position.position[key] + "px");
357
+ overlayRef.current.style.maxHeight = position.maxHeight != null ? position.maxHeight + "px" : undefined;
358
+ // Trigger a set state for a second render anyway for arrow positioning
359
+ setPosition(position);
315
360
  // eslint-disable-next-line react-hooks/exhaustive-deps
316
361
  }, deps);
317
362
  // Update position when anything changes
318
363
  // eslint-disable-next-line react-hooks/exhaustive-deps
319
- $k7QOs$useLayoutEffect(updatePosition, deps);
364
+ (0, $k7QOs$useLayoutEffect)(updatePosition, deps);
320
365
  // Update position on window resize
321
366
  $2a41e45df1593e64$var$useResize(updatePosition);
322
367
  // Update position when the overlay changes size (might need to flip).
323
- $k7QOs$useResizeObserver({
368
+ (0, $k7QOs$useResizeObserver)({
324
369
  ref: overlayRef,
325
370
  onResize: updatePosition
326
371
  });
327
372
  // Reposition the overlay and do not close on scroll while the visual viewport is resizing.
328
373
  // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.
329
- let isResizing = $k7QOs$useRef(false);
330
- $k7QOs$useLayoutEffect(()=>{
374
+ let isResizing = (0, $k7QOs$useRef)(false);
375
+ (0, $k7QOs$useLayoutEffect)(()=>{
331
376
  let timeout;
332
377
  let onResize = ()=>{
333
378
  isResizing.current = true;
@@ -337,14 +382,14 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
337
382
  }, 500);
338
383
  updatePosition();
339
384
  };
340
- $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener('resize', onResize);
385
+ $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("resize", onResize);
341
386
  return ()=>{
342
- $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener('resize', onResize);
387
+ $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener("resize", onResize);
343
388
  };
344
389
  }, [
345
390
  updatePosition
346
391
  ]);
347
- let close = $k7QOs$useCallback(()=>{
392
+ let close = (0, $k7QOs$useCallback)(()=>{
348
393
  if (!isResizing.current) onClose();
349
394
  }, [
350
395
  onClose,
@@ -352,7 +397,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
352
397
  ]);
353
398
  // When scrolling a parent scrollable region of the trigger (other than the body),
354
399
  // we hide the popover. Otherwise, its position would be incorrect.
355
- $dd149f63282afbbf$export$18fc8428861184da({
400
+ (0, $dd149f63282afbbf$export$18fc8428861184da)({
356
401
  triggerRef: targetRef,
357
402
  isOpen: isOpen,
358
403
  onClose: onClose && close
@@ -360,7 +405,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
360
405
  return {
361
406
  overlayProps: {
362
407
  style: {
363
- position: 'absolute',
408
+ position: "absolute",
364
409
  zIndex: 100000,
365
410
  ...position.position,
366
411
  maxHeight: position.maxHeight
@@ -377,29 +422,39 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
377
422
  };
378
423
  }
379
424
  function $2a41e45df1593e64$var$useResize(onResize) {
380
- $k7QOs$useLayoutEffect(()=>{
381
- window.addEventListener('resize', onResize, false);
425
+ (0, $k7QOs$useLayoutEffect)(()=>{
426
+ window.addEventListener("resize", onResize, false);
382
427
  return ()=>{
383
- window.removeEventListener('resize', onResize, false);
428
+ window.removeEventListener("resize", onResize, false);
384
429
  };
385
430
  }, [
386
431
  onResize
387
432
  ]);
388
433
  }
389
434
  function $2a41e45df1593e64$var$translateRTL(position, direction) {
390
- if (direction === 'rtl') return position.replace('start', 'right').replace('end', 'left');
391
- return position.replace('start', 'left').replace('end', 'right');
435
+ if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
436
+ return position.replace("start", "left").replace("end", "right");
392
437
  }
393
438
 
394
439
 
395
-
440
+ /*
441
+ * Copyright 2020 Adobe. All rights reserved.
442
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
443
+ * you may not use this file except in compliance with the License. You may obtain a copy
444
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
445
+ *
446
+ * Unless required by applicable law or agreed to in writing, software distributed under
447
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
448
+ * OF ANY KIND, either express or implied. See the License for the specific language
449
+ * governing permissions and limitations under the License.
450
+ */
396
451
 
397
452
 
398
453
  const $a11501f3d1d39e6c$var$visibleOverlays = [];
399
454
  function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
400
455
  let { onClose: onClose , shouldCloseOnBlur: shouldCloseOnBlur , isOpen: isOpen , isDismissable: isDismissable = false , isKeyboardDismissDisabled: isKeyboardDismissDisabled = false , shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
401
456
  // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
402
- $k7QOs$useEffect(()=>{
457
+ (0, $k7QOs$useEffect)(()=>{
403
458
  if (isOpen) $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
404
459
  return ()=>{
405
460
  let index = $a11501f3d1d39e6c$var$visibleOverlays.indexOf(ref);
@@ -432,25 +487,25 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
432
487
  };
433
488
  // Handle the escape key
434
489
  let onKeyDown = (e)=>{
435
- if (e.key === 'Escape' && !isKeyboardDismissDisabled) {
490
+ if (e.key === "Escape" && !isKeyboardDismissDisabled) {
436
491
  e.stopPropagation();
437
492
  e.preventDefault();
438
493
  onHide();
439
494
  }
440
495
  };
441
496
  // Handle clicking outside the overlay to close it
442
- $k7QOs$useInteractOutside({
497
+ (0, $k7QOs$useInteractOutside)({
443
498
  ref: ref,
444
499
  onInteractOutside: isDismissable ? onInteractOutside : null,
445
500
  onInteractOutsideStart: onInteractOutsideStart
446
501
  });
447
- let { focusWithinProps: focusWithinProps } = $k7QOs$useFocusWithin({
502
+ let { focusWithinProps: focusWithinProps } = (0, $k7QOs$useFocusWithin)({
448
503
  isDisabled: !shouldCloseOnBlur,
449
504
  onBlurWithin: (e)=>{
450
505
  // If focus is moving into a child focus scope (e.g. menu inside a dialog),
451
506
  // do not close the outer overlay. At this point, the active scope should
452
507
  // still be the outer overlay, since blur events run before focus.
453
- if (e.relatedTarget && $k7QOs$isElementInChildOfActiveScope(e.relatedTarget)) return;
508
+ if (e.relatedTarget && (0, $k7QOs$isElementInChildOfActiveScope)(e.relatedTarget)) return;
454
509
  if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose();
455
510
  }
456
511
  });
@@ -470,7 +525,17 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
470
525
  }
471
526
 
472
527
 
473
-
528
+ /*
529
+ * Copyright 2020 Adobe. All rights reserved.
530
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
531
+ * you may not use this file except in compliance with the License. You may obtain a copy
532
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
533
+ *
534
+ * Unless required by applicable law or agreed to in writing, software distributed under
535
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
536
+ * OF ANY KIND, either express or implied. See the License for the specific language
537
+ * governing permissions and limitations under the License.
538
+ */
474
539
 
475
540
 
476
541
  function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
@@ -478,22 +543,22 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
478
543
  let { isOpen: isOpen } = state;
479
544
  // Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
480
545
  // without forcing users to pass onClose.
481
- $k7QOs$useEffect(()=>{
482
- if (ref && ref.current) $dd149f63282afbbf$export$f6211563215e3b37.set(ref.current, state.close);
546
+ (0, $k7QOs$useEffect)(()=>{
547
+ if (ref && ref.current) (0, $dd149f63282afbbf$export$f6211563215e3b37).set(ref.current, state.close);
483
548
  });
484
549
  // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
485
550
  // https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
486
551
  // However, we only add it for menus for now because screen readers often
487
552
  // announce it as a menu even for other values.
488
553
  let ariaHasPopup = undefined;
489
- if (type === 'menu') ariaHasPopup = true;
490
- else if (type === 'listbox') ariaHasPopup = 'listbox';
491
- let overlayId = $k7QOs$useId();
554
+ if (type === "menu") ariaHasPopup = true;
555
+ else if (type === "listbox") ariaHasPopup = "listbox";
556
+ let overlayId = (0, $k7QOs$useId)();
492
557
  return {
493
558
  triggerProps: {
494
- 'aria-haspopup': ariaHasPopup,
495
- 'aria-expanded': isOpen,
496
- 'aria-controls': isOpen ? overlayId : null,
559
+ "aria-haspopup": ariaHasPopup,
560
+ "aria-expanded": isOpen,
561
+ "aria-controls": isOpen ? overlayId : null,
497
562
  onPress: state.toggle
498
563
  },
499
564
  overlayProps: {
@@ -503,28 +568,47 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
503
568
  }
504
569
 
505
570
 
506
-
571
+ /*
572
+ * Copyright 2020 Adobe. All rights reserved.
573
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
574
+ * you may not use this file except in compliance with the License. You may obtain a copy
575
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
576
+ *
577
+ * Unless required by applicable law or agreed to in writing, software distributed under
578
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
579
+ * OF ANY KIND, either express or implied. See the License for the specific language
580
+ * governing permissions and limitations under the License.
581
+ */
507
582
  // @ts-ignore
508
- const $49c51c25361d4cd2$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
583
+ const $49c51c25361d4cd2$var$visualViewport = typeof window !== "undefined" && window.visualViewport;
509
584
  // HTML input types that do not cause the software keyboard to appear.
510
585
  const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
511
- 'checkbox',
512
- 'radio',
513
- 'range',
514
- 'color',
515
- 'file',
516
- 'image',
517
- 'button',
518
- 'submit',
519
- 'reset'
586
+ "checkbox",
587
+ "radio",
588
+ "range",
589
+ "color",
590
+ "file",
591
+ "image",
592
+ "button",
593
+ "submit",
594
+ "reset"
520
595
  ]);
521
- function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {
522
- }) {
596
+ // The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
597
+ let $49c51c25361d4cd2$var$preventScrollCount = 0;
598
+ let $49c51c25361d4cd2$var$restore;
599
+ function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
523
600
  let { isDisabled: isDisabled } = options;
524
- $k7QOs$useLayoutEffect(()=>{
601
+ (0, $k7QOs$useLayoutEffect)(()=>{
525
602
  if (isDisabled) return;
526
- if ($k7QOs$isIOS()) return $49c51c25361d4cd2$var$preventScrollMobileSafari();
527
- else return $49c51c25361d4cd2$var$preventScrollStandard();
603
+ $49c51c25361d4cd2$var$preventScrollCount++;
604
+ if ($49c51c25361d4cd2$var$preventScrollCount === 1) {
605
+ if ((0, $k7QOs$isIOS)()) $49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollMobileSafari();
606
+ else $49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollStandard();
607
+ }
608
+ return ()=>{
609
+ $49c51c25361d4cd2$var$preventScrollCount--;
610
+ if ($49c51c25361d4cd2$var$preventScrollCount === 0) $49c51c25361d4cd2$var$restore();
611
+ };
528
612
  }, [
529
613
  isDisabled
530
614
  ]);
@@ -532,7 +616,7 @@ function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {
532
616
  // For most browsers, all we need to do is set `overflow: hidden` on the root element, and
533
617
  // add some padding to prevent the page from shifting when the scrollbar is hidden.
534
618
  function $49c51c25361d4cd2$var$preventScrollStandard() {
535
- return $k7QOs$chain($49c51c25361d4cd2$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden'));
619
+ return (0, $k7QOs$chain)($49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"));
536
620
  }
537
621
  // Mobile Safari is a whole different beast. Even with overflow: hidden,
538
622
  // it still scrolls the page in many situations:
@@ -565,7 +649,7 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
565
649
  let lastY = 0;
566
650
  let onTouchStart = (e)=>{
567
651
  // Store the nearest scrollable parent element from the element that the user touched.
568
- scrollable = $k7QOs$getScrollParent(e.target);
652
+ scrollable = (0, $k7QOs$getScrollParent)(e.target);
569
653
  if (scrollable === document.documentElement && scrollable === document.body) return;
570
654
  lastY = e.changedTouches[0].pageY;
571
655
  };
@@ -593,10 +677,10 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
593
677
  // Apply a transform to trick Safari into thinking the input is at the top of the page
594
678
  // so it doesn't try to scroll it into view. When tapping on an input, this needs to
595
679
  // be done before the "focus" event, so we have to focus the element ourselves.
596
- target.style.transform = 'translateY(-2000px)';
680
+ target.style.transform = "translateY(-2000px)";
597
681
  target.focus();
598
682
  requestAnimationFrame(()=>{
599
- target.style.transform = '';
683
+ target.style.transform = "";
600
684
  });
601
685
  }
602
686
  };
@@ -607,9 +691,9 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
607
691
  // other than tapping on an input directly, e.g. the next/previous buttons in the
608
692
  // software keyboard. In these cases, it seems applying the transform in the focus event
609
693
  // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️
610
- target.style.transform = 'translateY(-2000px)';
694
+ target.style.transform = "translateY(-2000px)";
611
695
  requestAnimationFrame(()=>{
612
- target.style.transform = '';
696
+ target.style.transform = "";
613
697
  // This will have prevented the browser from scrolling the focused element into view,
614
698
  // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
615
699
  if ($49c51c25361d4cd2$var$visualViewport) {
@@ -620,8 +704,7 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
620
704
  });
621
705
  else // Otherwise, wait for the visual viewport to resize before scrolling so we can
622
706
  // measure the correct position to scroll to.
623
- $49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target)
624
- , {
707
+ $49c51c25361d4cd2$var$visualViewport.addEventListener("resize", ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
625
708
  once: true
626
709
  });
627
710
  }
@@ -638,19 +721,19 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
638
721
  // enable us to scroll the window to the top, which is required for the rest of this to work.
639
722
  let scrollX = window.pageXOffset;
640
723
  let scrollY = window.pageYOffset;
641
- let restoreStyles = $k7QOs$chain($49c51c25361d4cd2$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden'), $49c51c25361d4cd2$var$setStyle(document.body, 'marginTop', `-${scrollY}px`));
724
+ let restoreStyles = (0, $k7QOs$chain)($49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"), $49c51c25361d4cd2$var$setStyle(document.body, "marginTop", `-${scrollY}px`));
642
725
  // Scroll to the top. The negative margin on the body will make this appear the same.
643
726
  window.scrollTo(0, 0);
644
- let removeEvents = $k7QOs$chain($49c51c25361d4cd2$var$addEvent(document, 'touchstart', onTouchStart, {
727
+ let removeEvents = (0, $k7QOs$chain)($49c51c25361d4cd2$var$addEvent(document, "touchstart", onTouchStart, {
645
728
  passive: false,
646
729
  capture: true
647
- }), $49c51c25361d4cd2$var$addEvent(document, 'touchmove', onTouchMove, {
730
+ }), $49c51c25361d4cd2$var$addEvent(document, "touchmove", onTouchMove, {
648
731
  passive: false,
649
732
  capture: true
650
- }), $49c51c25361d4cd2$var$addEvent(document, 'touchend', onTouchEnd, {
733
+ }), $49c51c25361d4cd2$var$addEvent(document, "touchend", onTouchEnd, {
651
734
  passive: false,
652
735
  capture: true
653
- }), $49c51c25361d4cd2$var$addEvent(document, 'focus', onFocus, true), $49c51c25361d4cd2$var$addEvent(window, 'scroll', onWindowScroll));
736
+ }), $49c51c25361d4cd2$var$addEvent(document, "focus", onFocus, true), $49c51c25361d4cd2$var$addEvent(window, "scroll", onWindowScroll));
654
737
  return ()=>{
655
738
  // Restore styles and scroll the page back to where it was.
656
739
  restoreStyles();
@@ -677,7 +760,7 @@ function $49c51c25361d4cd2$var$scrollIntoView(target) {
677
760
  let root = document.scrollingElement || document.documentElement;
678
761
  while(target && target !== root){
679
762
  // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
680
- let scrollable = $k7QOs$getScrollParent(target);
763
+ let scrollable = (0, $k7QOs$getScrollParent)(target);
681
764
  if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
682
765
  let scrollableTop = scrollable.getBoundingClientRect().top;
683
766
  let targetTop = target.getBoundingClientRect().top;
@@ -691,41 +774,48 @@ function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
691
774
  }
692
775
 
693
776
 
777
+ /*
778
+ * Copyright 2020 Adobe. All rights reserved.
779
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
780
+ * you may not use this file except in compliance with the License. You may obtain a copy
781
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
782
+ *
783
+ * Unless required by applicable law or agreed to in writing, software distributed under
784
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
785
+ * OF ANY KIND, either express or implied. See the License for the specific language
786
+ * governing permissions and limitations under the License.
787
+ */
694
788
 
695
789
 
696
-
697
- const $f57aed4a881a3485$var$Context = /*#__PURE__*/ $k7QOs$react.createContext(null);
790
+ const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
698
791
  function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
699
792
  let { children: children } = props;
700
- let parent = $k7QOs$useContext($f57aed4a881a3485$var$Context);
701
- let [modalCount, setModalCount] = $k7QOs$useState(0);
702
- let context = $k7QOs$useMemo(()=>({
793
+ let parent = (0, $k7QOs$useContext)($f57aed4a881a3485$var$Context);
794
+ let [modalCount, setModalCount] = (0, $k7QOs$useState)(0);
795
+ let context = (0, $k7QOs$useMemo)(()=>({
703
796
  parent: parent,
704
797
  modalCount: modalCount,
705
798
  addModal () {
706
- setModalCount((count)=>count + 1
707
- );
799
+ setModalCount((count)=>count + 1);
708
800
  if (parent) parent.addModal();
709
801
  },
710
802
  removeModal () {
711
- setModalCount((count)=>count - 1
712
- );
803
+ setModalCount((count)=>count - 1);
713
804
  if (parent) parent.removeModal();
714
805
  }
715
- })
716
- , [
806
+ }), [
717
807
  parent,
718
808
  modalCount
719
809
  ]);
720
- return(/*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$var$Context.Provider, {
810
+ return /*#__PURE__*/ (0, $k7QOs$react).createElement($f57aed4a881a3485$var$Context.Provider, {
721
811
  value: context
722
- }, children));
812
+ }, children);
723
813
  }
724
814
  function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
725
- let context = $k7QOs$useContext($f57aed4a881a3485$var$Context);
815
+ let context = (0, $k7QOs$useContext)($f57aed4a881a3485$var$Context);
726
816
  return {
727
817
  modalProviderProps: {
728
- 'aria-hidden': context && context.modalCount > 0 ? true : null
818
+ "aria-hidden": context && context.modalCount > 0 ? true : null
729
819
  }
730
820
  };
731
821
  }
@@ -733,32 +823,32 @@ function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
733
823
  * Creates a root node that will be aria-hidden if there are other modals open.
734
824
  */ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
735
825
  let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
736
- return(/*#__PURE__*/ $k7QOs$react.createElement("div", {
826
+ return /*#__PURE__*/ (0, $k7QOs$react).createElement("div", {
737
827
  "data-overlay-container": true,
738
828
  ...props,
739
829
  ...modalProviderProps
740
- }));
830
+ });
741
831
  }
742
832
  function $f57aed4a881a3485$export$bf688221f59024e5(props) {
743
- return(/*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$var$OverlayContainerDOM, props)));
833
+ return /*#__PURE__*/ (0, $k7QOs$react).createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /*#__PURE__*/ (0, $k7QOs$react).createElement($f57aed4a881a3485$var$OverlayContainerDOM, props));
744
834
  }
745
835
  function $f57aed4a881a3485$export$b47c3594eab58386(props) {
746
- let isSSR = $k7QOs$useIsSSR();
836
+ let isSSR = (0, $k7QOs$useIsSSR)();
747
837
  let { portalContainer: portalContainer = isSSR ? null : document.body , ...rest } = props;
748
- $k7QOs$react.useEffect(()=>{
749
- if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest('[data-overlay-container]')) throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
838
+ (0, $k7QOs$react).useEffect(()=>{
839
+ if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
750
840
  }, [
751
841
  portalContainer
752
842
  ]);
753
843
  if (!portalContainer) return null;
754
- let contents = /*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
755
- return(/*#__PURE__*/ $k7QOs$reactdom.createPortal(contents, portalContainer));
844
+ let contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
845
+ return /*#__PURE__*/ (0, $k7QOs$reactdom).createPortal(contents, portalContainer);
756
846
  }
757
847
  function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
758
848
  // Add aria-hidden to all parent providers on mount, and restore on unmount.
759
- let context = $k7QOs$useContext($f57aed4a881a3485$var$Context);
760
- if (!context) throw new Error('Modal is not contained within a provider');
761
- $k7QOs$useEffect(()=>{
849
+ let context = (0, $k7QOs$useContext)($f57aed4a881a3485$var$Context);
850
+ if (!context) throw new Error("Modal is not contained within a provider");
851
+ (0, $k7QOs$useEffect)(()=>{
762
852
  if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
763
853
  // The immediate context is from the provider containing this modal, so we only
764
854
  // want to trigger aria-hidden on its parents not on the modal provider itself.
@@ -773,13 +863,23 @@ function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
773
863
  ]);
774
864
  return {
775
865
  modalProps: {
776
- 'data-ismodal': !(options === null || options === void 0 ? void 0 : options.isDisabled)
866
+ "data-ismodal": !(options === null || options === void 0 ? void 0 : options.isDisabled)
777
867
  }
778
868
  };
779
869
  }
780
870
 
781
871
 
782
- var $61fe14465afefc5e$exports = {};
872
+ /*
873
+ * Copyright 2020 Adobe. All rights reserved.
874
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
875
+ * you may not use this file except in compliance with the License. You may obtain a copy
876
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
877
+ *
878
+ * Unless required by applicable law or agreed to in writing, software distributed under
879
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
880
+ * OF ANY KIND, either express or implied. See the License for the specific language
881
+ * governing permissions and limitations under the License.
882
+ */ var $61fe14465afefc5e$exports = {};
783
883
  var $773d5888b972f1cf$exports = {};
784
884
  $773d5888b972f1cf$exports = {
785
885
  "dismiss": `تجاهل`
@@ -1028,16 +1128,16 @@ $61fe14465afefc5e$exports = {
1028
1128
 
1029
1129
  function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
1030
1130
  let { onDismiss: onDismiss , ...otherProps } = props;
1031
- let stringFormatter = $k7QOs$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($61fe14465afefc5e$exports)));
1032
- let labels = $k7QOs$useLabels(otherProps, stringFormatter.format('dismiss'));
1131
+ let stringFormatter = (0, $k7QOs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($61fe14465afefc5e$exports))));
1132
+ let labels = (0, $k7QOs$useLabels)(otherProps, stringFormatter.format("dismiss"));
1033
1133
  let onClick = ()=>{
1034
1134
  if (onDismiss) onDismiss();
1035
1135
  };
1036
- return(/*#__PURE__*/ $k7QOs$react.createElement($k7QOs$VisuallyHidden, null, /*#__PURE__*/ $k7QOs$react.createElement("button", {
1136
+ return /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$VisuallyHidden), null, /*#__PURE__*/ (0, $k7QOs$react).createElement("button", {
1037
1137
  ...labels,
1038
1138
  tabIndex: -1,
1039
1139
  onClick: onClick
1040
- })));
1140
+ }));
1041
1141
  }
1042
1142
 
1043
1143
 
@@ -1058,51 +1158,66 @@ let $5e3802645cc19319$var$observerStack = [];
1058
1158
  function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body) {
1059
1159
  let visibleNodes = new Set(targets);
1060
1160
  let hiddenNodes = new Set();
1061
- let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
1062
- acceptNode (node) {
1063
- // If this node is a live announcer, add it to the set of nodes to keep visible.
1064
- if ((node instanceof HTMLElement || node instanceof SVGElement) && node.dataset.liveAnnouncer === 'true') visibleNodes.add(node);
1161
+ let walk = (root)=>{
1162
+ // Keep live announcer and top layer elements (e.g. toasts) visible.
1163
+ for (let element of root.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))visibleNodes.add(element);
1164
+ let acceptNode = (node)=>{
1065
1165
  // Skip this node and its children if it is one of the target nodes, or a live announcer.
1066
1166
  // Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is
1067
1167
  // made for elements with role="row" since VoiceOver on iOS has issues hiding elements with role="row".
1068
1168
  // For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).
1069
- if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
1169
+ if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
1070
1170
  // Skip this node but continue to children if one of the targets is inside the node.
1071
- if (targets.some((target)=>node.contains(target)
1072
- )) return NodeFilter.FILTER_SKIP;
1171
+ for (let target of visibleNodes){
1172
+ if (node.contains(target)) return NodeFilter.FILTER_SKIP;
1173
+ }
1073
1174
  return NodeFilter.FILTER_ACCEPT;
1175
+ };
1176
+ let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
1177
+ acceptNode: acceptNode
1178
+ });
1179
+ // TreeWalker does not include the root.
1180
+ let acceptRoot = acceptNode(root);
1181
+ if (acceptRoot === NodeFilter.FILTER_ACCEPT) hide(root);
1182
+ if (acceptRoot !== NodeFilter.FILTER_REJECT) {
1183
+ let node = walker.nextNode();
1184
+ while(node != null){
1185
+ hide(node);
1186
+ node = walker.nextNode();
1187
+ }
1074
1188
  }
1075
- });
1189
+ };
1076
1190
  let hide = (node)=>{
1077
- var ref;
1078
- let refCount = (ref = $5e3802645cc19319$var$refCountMap.get(node)) !== null && ref !== void 0 ? ref : 0;
1191
+ var _refCountMap_get;
1192
+ let refCount = (_refCountMap_get = $5e3802645cc19319$var$refCountMap.get(node)) !== null && _refCountMap_get !== void 0 ? _refCountMap_get : 0;
1079
1193
  // If already aria-hidden, and the ref count is zero, then this element
1080
1194
  // was already hidden and there's nothing for us to do.
1081
- if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) return;
1082
- if (refCount === 0) node.setAttribute('aria-hidden', 'true');
1195
+ if (node.getAttribute("aria-hidden") === "true" && refCount === 0) return;
1196
+ if (refCount === 0) node.setAttribute("aria-hidden", "true");
1083
1197
  hiddenNodes.add(node);
1084
1198
  $5e3802645cc19319$var$refCountMap.set(node, refCount + 1);
1085
1199
  };
1086
1200
  // If there is already a MutationObserver listening from a previous call,
1087
1201
  // disconnect it so the new on takes over.
1088
1202
  if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].disconnect();
1089
- let node1 = walker.nextNode();
1090
- while(node1 != null){
1091
- hide(node1);
1092
- node1 = walker.nextNode();
1093
- }
1203
+ walk(root);
1094
1204
  let observer = new MutationObserver((changes)=>{
1095
1205
  for (let change of changes){
1096
- if (change.type !== 'childList' || change.addedNodes.length === 0) continue;
1206
+ if (change.type !== "childList" || change.addedNodes.length === 0) continue;
1097
1207
  // If the parent element of the added nodes is not within one of the targets,
1098
1208
  // and not already inside a hidden node, hide all of the new children.
1099
1209
  if (![
1100
1210
  ...visibleNodes,
1101
1211
  ...hiddenNodes
1102
- ].some((node)=>node.contains(change.target)
1103
- )) for (let node2 of change.addedNodes){
1104
- if ((node2 instanceof HTMLElement || node2 instanceof SVGElement) && node2.dataset.liveAnnouncer === 'true') visibleNodes.add(node2);
1105
- else if (node2 instanceof Element) hide(node2);
1212
+ ].some((node)=>node.contains(change.target))) {
1213
+ for (let node of change.removedNodes)if (node instanceof Element) {
1214
+ visibleNodes.delete(node);
1215
+ hiddenNodes.delete(node);
1216
+ }
1217
+ for (let node1 of change.addedNodes){
1218
+ if ((node1 instanceof HTMLElement || node1 instanceof SVGElement) && (node1.dataset.liveAnnouncer === "true" || node1.dataset.reactAriaTopLayer === "true")) visibleNodes.add(node1);
1219
+ else if (node1 instanceof Element) walk(node1);
1220
+ }
1106
1221
  }
1107
1222
  }
1108
1223
  });
@@ -1127,7 +1242,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
1127
1242
  for (let node of hiddenNodes){
1128
1243
  let count = $5e3802645cc19319$var$refCountMap.get(node);
1129
1244
  if (count === 1) {
1130
- node.removeAttribute('aria-hidden');
1245
+ node.removeAttribute("aria-hidden");
1131
1246
  $5e3802645cc19319$var$refCountMap.delete(node);
1132
1247
  } else $5e3802645cc19319$var$refCountMap.set(node, count - 1);
1133
1248
  }
@@ -1140,43 +1255,42 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
1140
1255
  }
1141
1256
 
1142
1257
 
1143
-
1144
-
1258
+ /*
1259
+ * Copyright 2022 Adobe. All rights reserved.
1260
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1261
+ * you may not use this file except in compliance with the License. You may obtain a copy
1262
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1263
+ *
1264
+ * Unless required by applicable law or agreed to in writing, software distributed under
1265
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1266
+ * OF ANY KIND, either express or implied. See the License for the specific language
1267
+ * governing permissions and limitations under the License.
1268
+ */
1145
1269
 
1146
1270
 
1147
1271
 
1148
1272
 
1149
1273
  function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
1150
1274
  let { triggerRef: triggerRef , popoverRef: popoverRef , isNonModal: isNonModal , isKeyboardDismissDisabled: isKeyboardDismissDisabled , ...otherProps } = props;
1151
- let { overlayProps: overlayProps , underlayProps: underlayProps } = $a11501f3d1d39e6c$export$ea8f71083e90600f({
1275
+ let { overlayProps: overlayProps , underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
1152
1276
  isOpen: state.isOpen,
1153
1277
  onClose: state.close,
1154
1278
  shouldCloseOnBlur: true,
1155
1279
  isDismissable: !isNonModal,
1156
1280
  isKeyboardDismissDisabled: isKeyboardDismissDisabled
1157
1281
  }, popoverRef);
1158
- let { overlayProps: positionProps , arrowProps: arrowProps , placement: placement } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
1282
+ let { overlayProps: positionProps , arrowProps: arrowProps , placement: placement } = (0, $2a41e45df1593e64$export$d39e1813b3bdd0e1)({
1159
1283
  ...otherProps,
1160
1284
  targetRef: triggerRef,
1161
1285
  overlayRef: popoverRef,
1162
1286
  isOpen: state.isOpen,
1163
1287
  onClose: null
1164
1288
  });
1165
- // Delay preventing scroll until popover is positioned to avoid extra scroll padding.
1166
- // This requires a layout effect so that positioning has been committed to the DOM
1167
- // by the time usePreventScroll measures the element.
1168
- let [isPositioned, setPositioned] = $k7QOs$useState(false);
1169
- $k7QOs$useLayoutEffect(()=>{
1170
- if (!isNonModal && placement) setPositioned(true);
1171
- }, [
1172
- isNonModal,
1173
- placement
1174
- ]);
1175
- $49c51c25361d4cd2$export$ee0f7cc6afcd1c18({
1176
- isDisabled: isNonModal || !isPositioned
1289
+ (0, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18)({
1290
+ isDisabled: isNonModal
1177
1291
  });
1178
- $k7QOs$useLayoutEffect(()=>{
1179
- if (state.isOpen && !isNonModal && popoverRef.current) return $5e3802645cc19319$export$1c3ebcada18427bf([
1292
+ (0, $k7QOs$useLayoutEffect)(()=>{
1293
+ if (state.isOpen && !isNonModal && popoverRef.current) return (0, $5e3802645cc19319$export$1c3ebcada18427bf)([
1180
1294
  popoverRef.current
1181
1295
  ]);
1182
1296
  }, [
@@ -1185,7 +1299,7 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
1185
1299
  popoverRef
1186
1300
  ]);
1187
1301
  return {
1188
- popoverProps: $k7QOs$mergeProps(overlayProps, positionProps),
1302
+ popoverProps: (0, $k7QOs$mergeProps)(overlayProps, positionProps),
1189
1303
  arrowProps: arrowProps,
1190
1304
  underlayProps: underlayProps,
1191
1305
  placement: placement
@@ -1193,41 +1307,60 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
1193
1307
  }
1194
1308
 
1195
1309
 
1310
+ /*
1311
+ * Copyright 2022 Adobe. All rights reserved.
1312
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1313
+ * you may not use this file except in compliance with the License. You may obtain a copy
1314
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1315
+ *
1316
+ * Unless required by applicable law or agreed to in writing, software distributed under
1317
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1318
+ * OF ANY KIND, either express or implied. See the License for the specific language
1319
+ * governing permissions and limitations under the License.
1320
+ */
1196
1321
 
1197
1322
 
1198
1323
 
1324
+ /*
1325
+ * Copyright 2022 Adobe. All rights reserved.
1326
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1327
+ * you may not use this file except in compliance with the License. You may obtain a copy
1328
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1329
+ *
1330
+ * Unless required by applicable law or agreed to in writing, software distributed under
1331
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1332
+ * OF ANY KIND, either express or implied. See the License for the specific language
1333
+ * governing permissions and limitations under the License.
1334
+ */
1199
1335
 
1200
1336
 
1201
1337
 
1202
1338
 
1203
-
1204
-
1205
- const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ $k7QOs$react.createContext(null);
1339
+ const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
1206
1340
  function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
1207
- let isSSR = $k7QOs$useIsSSR();
1341
+ let isSSR = (0, $k7QOs$useIsSSR)();
1208
1342
  let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
1209
- let [contain, setContain] = $k7QOs$useState(false);
1210
- let contextValue = $k7QOs$useMemo(()=>({
1343
+ let [contain, setContain] = (0, $k7QOs$useState)(false);
1344
+ let contextValue = (0, $k7QOs$useMemo)(()=>({
1211
1345
  contain: contain,
1212
1346
  setContain: setContain
1213
- })
1214
- , [
1347
+ }), [
1215
1348
  contain,
1216
1349
  setContain
1217
1350
  ]);
1218
1351
  if (!portalContainer) return null;
1219
- let contents = /*#__PURE__*/ $k7QOs$react.createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
1352
+ let contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
1220
1353
  value: contextValue
1221
- }, /*#__PURE__*/ $k7QOs$react.createElement($k7QOs$FocusScope, {
1354
+ }, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
1222
1355
  restoreFocus: true,
1223
1356
  contain: contain
1224
1357
  }, props.children));
1225
- return(/*#__PURE__*/ $k7QOs$reactdom.createPortal(contents, portalContainer));
1358
+ return /*#__PURE__*/ (0, $k7QOs$reactdom).createPortal(contents, portalContainer);
1226
1359
  }
1227
1360
  function $337b884510726a0d$export$14c98a7594375490() {
1228
- let ctx = $k7QOs$useContext($337b884510726a0d$export$a2200b96afd16271);
1361
+ let ctx = (0, $k7QOs$useContext)($337b884510726a0d$export$a2200b96afd16271);
1229
1362
  let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
1230
- $k7QOs$useLayoutEffect(()=>{
1363
+ (0, $k7QOs$useLayoutEffect)(()=>{
1231
1364
  setContain === null || setContain === void 0 ? void 0 : setContain(true);
1232
1365
  }, [
1233
1366
  setContain
@@ -1237,17 +1370,17 @@ function $337b884510726a0d$export$14c98a7594375490() {
1237
1370
 
1238
1371
 
1239
1372
  function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
1240
- let { overlayProps: overlayProps , underlayProps: underlayProps } = $a11501f3d1d39e6c$export$ea8f71083e90600f({
1373
+ let { overlayProps: overlayProps , underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
1241
1374
  ...props,
1242
1375
  isOpen: state.isOpen,
1243
1376
  onClose: state.close
1244
1377
  }, ref);
1245
- $49c51c25361d4cd2$export$ee0f7cc6afcd1c18({
1378
+ (0, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18)({
1246
1379
  isDisabled: !state.isOpen
1247
1380
  });
1248
- $337b884510726a0d$export$14c98a7594375490();
1249
- $k7QOs$useEffect(()=>{
1250
- if (state.isOpen) return $5e3802645cc19319$export$1c3ebcada18427bf([
1381
+ (0, $337b884510726a0d$export$14c98a7594375490)();
1382
+ (0, $k7QOs$useEffect)(()=>{
1383
+ if (state.isOpen) return (0, $5e3802645cc19319$export$1c3ebcada18427bf)([
1251
1384
  ref.current
1252
1385
  ]);
1253
1386
  }, [
@@ -1255,7 +1388,7 @@ function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
1255
1388
  ref
1256
1389
  ]);
1257
1390
  return {
1258
- modalProps: $k7QOs$mergeProps(overlayProps),
1391
+ modalProps: (0, $k7QOs$mergeProps)(overlayProps),
1259
1392
  underlayProps: underlayProps
1260
1393
  };
1261
1394
  }