{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport _regeneratorRuntime from \"@babel/runtime/regenerator\";\nimport $gskSG$react, { useRef as $gskSG$useRef, useState as $gskSG$useState, useEffect as $gskSG$useEffect, useCallback as $gskSG$useCallback } from \"react\";\nimport { useSSRSafeId as $gskSG$useSSRSafeId } from \"@react-aria/ssr\";\nimport $gskSG$clsx from \"clsx\";\nimport { clamp as $5cdbf4ddafd135bc$re_export$clamp, snapValueToStep as $5cdbf4ddafd135bc$re_export$snapValueToStep } from \"@react-stately/utils\";\n\nfunction $parcel$export(e, n, v, s) {\n  Object.defineProperty(e, n, {\n    get: v,\n    set: s,\n    enumerable: true,\n    configurable: true\n  });\n}\n\nvar $4208ab27be92763a$exports = {};\n$parcel$export($4208ab27be92763a$exports, \"useId\", function () {\n  return $4208ab27be92763a$export$f680877a34711e37;\n});\n$parcel$export($4208ab27be92763a$exports, \"mergeIds\", function () {\n  return $4208ab27be92763a$export$cd8c9cb68f842629;\n});\n$parcel$export($4208ab27be92763a$exports, \"useSlotId\", function () {\n  return $4208ab27be92763a$export$b4cc09c592e8fdb8;\n});\nvar $62918828a5c4cefe$exports = {};\n$parcel$export($62918828a5c4cefe$exports, \"useLayoutEffect\", function () {\n  return $62918828a5c4cefe$export$e5c5a5f917a5871c;\n});\nvar $62918828a5c4cefe$export$e5c5a5f917a5871c = typeof window !== 'undefined' ? $gskSG$react.useLayoutEffect : function () {};\nvar $4208ab27be92763a$var$idsUpdaterMap = new Map();\n\nfunction $4208ab27be92763a$export$f680877a34711e37(defaultId) {\n  var isRendering = $gskSG$useRef(true);\n  isRendering.current = true;\n\n  var _$gskSG$useState = $gskSG$useState(defaultId),\n      _$gskSG$useState2 = _slicedToArray(_$gskSG$useState, 2),\n      value = _$gskSG$useState2[0],\n      setValue = _$gskSG$useState2[1];\n\n  var nextId = $gskSG$useRef(null);\n  var res = $gskSG$useSSRSafeId(value);\n\n  var updateValue = function updateValue(val) {\n    if (!isRendering.current) setValue(val);else nextId.current = val;\n  };\n\n  $4208ab27be92763a$var$idsUpdaterMap.set(res, updateValue);\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(function () {\n    isRendering.current = false;\n  }, [updateValue]);\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(function () {\n    var r = res;\n    return function () {\n      $4208ab27be92763a$var$idsUpdaterMap.delete(r);\n    };\n  }, [res]);\n  $gskSG$useEffect(function () {\n    var newId = nextId.current;\n\n    if (newId) {\n      setValue(newId);\n      nextId.current = null;\n    }\n  }, [setValue, updateValue]);\n  return res;\n}\n\nfunction $4208ab27be92763a$export$cd8c9cb68f842629(idA, idB) {\n  if (idA === idB) return idA;\n  var setIdA = $4208ab27be92763a$var$idsUpdaterMap.get(idA);\n\n  if (setIdA) {\n    setIdA(idB);\n    return idB;\n  }\n\n  var setIdB = $4208ab27be92763a$var$idsUpdaterMap.get(idB);\n\n  if (setIdB) {\n    setIdB(idA);\n    return idA;\n  }\n\n  return idB;\n}\n\nfunction $4208ab27be92763a$export$b4cc09c592e8fdb8() {\n  var depArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n  var id = $4208ab27be92763a$export$f680877a34711e37();\n\n  var _$8bfb318ccfa2e412$ex = $8bfb318ccfa2e412$export$14d238f342723f25(id),\n      _$8bfb318ccfa2e412$ex2 = _slicedToArray(_$8bfb318ccfa2e412$ex, 2),\n      resolvedId = _$8bfb318ccfa2e412$ex2[0],\n      setResolvedId = _$8bfb318ccfa2e412$ex2[1];\n\n  var updateId = $gskSG$useCallback(function () {\n    setResolvedId(_regeneratorRuntime.mark(function _callee() {\n      return _regeneratorRuntime.wrap(function _callee$(_context) {\n        while (1) {\n          switch (_context.prev = _context.next) {\n            case 0:\n              _context.next = 2;\n              return id;\n\n            case 2:\n              _context.next = 4;\n              return document.getElementById(id) ? id : null;\n\n            case 4:\n            case \"end\":\n              return _context.stop();\n          }\n        }\n      }, _callee);\n    }));\n  }, [id, setResolvedId]);\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(updateId, [id, updateId].concat(_toConsumableArray(depArray)));\n  return resolvedId;\n}\n\nvar $2aefb161b9a41928$exports = {};\n$parcel$export($2aefb161b9a41928$exports, \"chain\", function () {\n  return $2aefb161b9a41928$export$e08e3b67e392101e;\n});\n\nfunction $2aefb161b9a41928$export$e08e3b67e392101e() {\n  for (var _len = arguments.length, callbacks = new Array(_len), _key = 0; _key < _len; _key++) {\n    callbacks[_key] = arguments[_key];\n  }\n\n  return function () {\n    for (var _iterator = _createForOfIteratorHelperLoose(callbacks), _step; !(_step = _iterator()).done;) {\n      var callback = _step.value;\n      if (typeof callback === 'function') callback.apply(void 0, arguments);\n    }\n  };\n}\n\nvar $699afe8e9e0f66de$exports = {};\n$parcel$export($699afe8e9e0f66de$exports, \"mergeProps\", function () {\n  return $699afe8e9e0f66de$export$9d1611c77c2fe928;\n});\n\nfunction $699afe8e9e0f66de$export$9d1611c77c2fe928() {\n  var result = _objectSpread({}, arguments.length <= 0 ? undefined : arguments[0]);\n\n  for (var i = 1; i < arguments.length; i++) {\n    var props = i < 0 || arguments.length <= i ? undefined : arguments[i];\n\n    for (var key in props) {\n      var a = result[key];\n      var b = props[key];\n      if (typeof a === 'function' && typeof b === 'function' && key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= 65 && key.charCodeAt(2) <= 90) result[key] = $2aefb161b9a41928$export$e08e3b67e392101e(a, b);else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = $gskSG$clsx(a, b);else if (key === 'id' && a && b) result.id = $4208ab27be92763a$export$cd8c9cb68f842629(a, b);else result[key] = b !== undefined ? b : a;\n    }\n  }\n\n  return result;\n}\n\nvar $7efcb978e02fb174$exports = {};\n$parcel$export($7efcb978e02fb174$exports, \"filterDOMProps\", function () {\n  return $7efcb978e02fb174$export$457c3d6518dd4c6f;\n});\nvar $7efcb978e02fb174$var$DOMPropNames = new Set(['id']);\nvar $7efcb978e02fb174$var$labelablePropNames = new Set(['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-details']);\nvar $7efcb978e02fb174$var$propRe = /^(data-.*)$/;\n\nfunction $7efcb978e02fb174$export$457c3d6518dd4c6f(props) {\n  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var labelable = opts.labelable,\n      propNames = opts.propNames;\n  var filteredProps = {};\n\n  for (var prop in props) {\n    if (Object.prototype.hasOwnProperty.call(props, prop) && ($7efcb978e02fb174$var$DOMPropNames.has(prop) || labelable && $7efcb978e02fb174$var$labelablePropNames.has(prop) || propNames != null && propNames.has(prop) || $7efcb978e02fb174$var$propRe.test(prop))) filteredProps[prop] = props[prop];\n  }\n\n  return filteredProps;\n}\n\nvar $0172e2a3384c2851$exports = {};\n$parcel$export($0172e2a3384c2851$exports, \"focusWithoutScrolling\", function () {\n  return $0172e2a3384c2851$export$de79e2c695e052f3;\n});\n\nfunction $0172e2a3384c2851$export$de79e2c695e052f3(element) {\n  if ($0172e2a3384c2851$var$supportsPreventScroll()) element.focus({\n    preventScroll: true\n  });else {\n    var scrollableElements = $0172e2a3384c2851$var$getScrollableElements(element);\n    element.focus();\n    $0172e2a3384c2851$var$restoreScrollPosition(scrollableElements);\n  }\n}\n\nvar $0172e2a3384c2851$var$supportsPreventScrollCached = null;\n\nfunction $0172e2a3384c2851$var$supportsPreventScroll() {\n  if ($0172e2a3384c2851$var$supportsPreventScrollCached == null) {\n    $0172e2a3384c2851$var$supportsPreventScrollCached = false;\n\n    try {\n      var focusElem = document.createElement('div');\n      focusElem.focus({\n        get preventScroll() {\n          $0172e2a3384c2851$var$supportsPreventScrollCached = true;\n          return true;\n        }\n\n      });\n    } catch (e) {}\n  }\n\n  return $0172e2a3384c2851$var$supportsPreventScrollCached;\n}\n\nfunction $0172e2a3384c2851$var$getScrollableElements(element) {\n  var parent = element.parentNode;\n  var scrollableElements = [];\n  var rootScrollingElement = document.scrollingElement || document.documentElement;\n\n  while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n    if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({\n      element: parent,\n      scrollTop: parent.scrollTop,\n      scrollLeft: parent.scrollLeft\n    });\n    parent = parent.parentNode;\n  }\n\n  if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({\n    element: rootScrollingElement,\n    scrollTop: rootScrollingElement.scrollTop,\n    scrollLeft: rootScrollingElement.scrollLeft\n  });\n  return scrollableElements;\n}\n\nfunction $0172e2a3384c2851$var$restoreScrollPosition(scrollableElements) {\n  for (var _iterator2 = _createForOfIteratorHelperLoose(scrollableElements), _step2; !(_step2 = _iterator2()).done;) {\n    var _ref = _step2.value;\n    var element = _ref.element;\n    var scrollTop = _ref.scrollTop;\n    var scrollLeft = _ref.scrollLeft;\n    element.scrollTop = scrollTop;\n    element.scrollLeft = scrollLeft;\n  }\n}\n\nvar $5062b1512bdf762b$exports = {};\n$parcel$export($5062b1512bdf762b$exports, \"getOffset\", function () {\n  return $5062b1512bdf762b$export$622cea445a1c5b7d;\n});\n\nfunction $5062b1512bdf762b$export$622cea445a1c5b7d(element, reverse) {\n  var orientation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'horizontal';\n  var rect = element.getBoundingClientRect();\n  if (reverse) return orientation === 'horizontal' ? rect.right : rect.bottom;\n  return orientation === 'horizontal' ? rect.left : rect.top;\n}\n\nvar $5cdbf4ddafd135bc$exports = {};\n$parcel$export($5cdbf4ddafd135bc$exports, \"clamp\", function () {\n  return $5cdbf4ddafd135bc$re_export$clamp;\n});\n$parcel$export($5cdbf4ddafd135bc$exports, \"snapValueToStep\", function () {\n  return $5cdbf4ddafd135bc$re_export$snapValueToStep;\n});\nvar $fdecdd2f4116564c$exports = {};\n$parcel$export($fdecdd2f4116564c$exports, \"runAfterTransition\", function () {\n  return $fdecdd2f4116564c$export$24490316f764c430;\n});\nvar $fdecdd2f4116564c$var$transitionsByElement = new Map();\nvar $fdecdd2f4116564c$var$transitionCallbacks = new Set();\n\nfunction $fdecdd2f4116564c$var$setupGlobalEvents() {\n  if (typeof window === 'undefined') return;\n\n  var onTransitionStart = function onTransitionStart(e) {\n    var transitions = $fdecdd2f4116564c$var$transitionsByElement.get(e.target);\n\n    if (!transitions) {\n      transitions = new Set();\n      $fdecdd2f4116564c$var$transitionsByElement.set(e.target, transitions);\n      e.target.addEventListener('transitioncancel', onTransitionEnd);\n    }\n\n    transitions.add(e.propertyName);\n  };\n\n  var onTransitionEnd = function onTransitionEnd(e) {\n    var properties = $fdecdd2f4116564c$var$transitionsByElement.get(e.target);\n    if (!properties) return;\n    properties.delete(e.propertyName);\n\n    if (properties.size === 0) {\n      e.target.removeEventListener('transitioncancel', onTransitionEnd);\n      $fdecdd2f4116564c$var$transitionsByElement.delete(e.target);\n    }\n\n    if ($fdecdd2f4116564c$var$transitionsByElement.size === 0) {\n      for (var _iterator3 = _createForOfIteratorHelperLoose($fdecdd2f4116564c$var$transitionCallbacks), _step3; !(_step3 = _iterator3()).done;) {\n        var cb = _step3.value;\n        cb();\n      }\n\n      $fdecdd2f4116564c$var$transitionCallbacks.clear();\n    }\n  };\n\n  document.body.addEventListener('transitionrun', onTransitionStart);\n  document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n  if (document.readyState !== 'loading') $fdecdd2f4116564c$var$setupGlobalEvents();else document.addEventListener('DOMContentLoaded', $fdecdd2f4116564c$var$setupGlobalEvents);\n}\n\nfunction $fdecdd2f4116564c$export$24490316f764c430(fn) {\n  requestAnimationFrame(function () {\n    if ($fdecdd2f4116564c$var$transitionsByElement.size === 0) fn();else $fdecdd2f4116564c$var$transitionCallbacks.add(fn);\n  });\n}\n\nvar $95a0e07fe544f4e9$exports = {};\n$parcel$export($95a0e07fe544f4e9$exports, \"useDrag1D\", function () {\n  return $95a0e07fe544f4e9$export$7bbed75feba39706;\n});\nvar $95a0e07fe544f4e9$var$draggingElements = [];\n\nfunction $95a0e07fe544f4e9$export$7bbed75feba39706(props) {\n  console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n  var containerRef = props.containerRef,\n      reverse = props.reverse,\n      orientation = props.orientation,\n      onHover = props.onHover,\n      onDrag = props.onDrag,\n      onPositionChange = props.onPositionChange,\n      onIncrement = props.onIncrement,\n      onDecrement = props.onDecrement,\n      onIncrementToMax = props.onIncrementToMax,\n      onDecrementToMin = props.onDecrementToMin,\n      onCollapseToggle = props.onCollapseToggle;\n\n  var getPosition = function getPosition(e) {\n    return orientation === 'horizontal' ? e.clientX : e.clientY;\n  };\n\n  var getNextOffset = function getNextOffset(e) {\n    var containerOffset = $5062b1512bdf762b$export$622cea445a1c5b7d(containerRef.current, reverse, orientation);\n    var mouseOffset = getPosition(e);\n    var nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n    return nextOffset;\n  };\n\n  var dragging = $gskSG$useRef(false);\n  var prevPosition = $gskSG$useRef(0);\n  var handlers = $gskSG$useRef({\n    onPositionChange: onPositionChange,\n    onDrag: onDrag\n  });\n  handlers.current.onDrag = onDrag;\n  handlers.current.onPositionChange = onPositionChange;\n\n  var onMouseDragged = function onMouseDragged(e) {\n    e.preventDefault();\n    var nextOffset = getNextOffset(e);\n\n    if (!dragging.current) {\n      dragging.current = true;\n      if (handlers.current.onDrag) handlers.current.onDrag(true);\n      if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);\n    }\n\n    if (prevPosition.current === nextOffset) return;\n    prevPosition.current = nextOffset;\n    if (onPositionChange) onPositionChange(nextOffset);\n  };\n\n  var onMouseUp = function onMouseUp(e) {\n    var target = e.target;\n    dragging.current = false;\n    var nextOffset = getNextOffset(e);\n    if (handlers.current.onDrag) handlers.current.onDrag(false);\n    if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);\n    $95a0e07fe544f4e9$var$draggingElements.splice($95a0e07fe544f4e9$var$draggingElements.indexOf(target), 1);\n    window.removeEventListener('mouseup', onMouseUp, false);\n    window.removeEventListener('mousemove', onMouseDragged, false);\n  };\n\n  var onMouseDown = function onMouseDown(e) {\n    var target = e.currentTarget;\n    if ($95a0e07fe544f4e9$var$draggingElements.some(function (elt) {\n      return target.contains(elt);\n    })) return;\n    $95a0e07fe544f4e9$var$draggingElements.push(target);\n    window.addEventListener('mousemove', onMouseDragged, false);\n    window.addEventListener('mouseup', onMouseUp, false);\n  };\n\n  var onMouseEnter = function onMouseEnter() {\n    if (onHover) onHover(true);\n  };\n\n  var onMouseOut = function onMouseOut() {\n    if (onHover) onHover(false);\n  };\n\n  var onKeyDown = function onKeyDown(e) {\n    switch (e.key) {\n      case 'Left':\n      case 'ArrowLeft':\n        if (orientation === 'horizontal') {\n          e.preventDefault();\n          if (onDecrement && !reverse) onDecrement();else if (onIncrement && reverse) onIncrement();\n        }\n\n        break;\n\n      case 'Up':\n      case 'ArrowUp':\n        if (orientation === 'vertical') {\n          e.preventDefault();\n          if (onDecrement && !reverse) onDecrement();else if (onIncrement && reverse) onIncrement();\n        }\n\n        break;\n\n      case 'Right':\n      case 'ArrowRight':\n        if (orientation === 'horizontal') {\n          e.preventDefault();\n          if (onIncrement && !reverse) onIncrement();else if (onDecrement && reverse) onDecrement();\n        }\n\n        break;\n\n      case 'Down':\n      case 'ArrowDown':\n        if (orientation === 'vertical') {\n          e.preventDefault();\n          if (onIncrement && !reverse) onIncrement();else if (onDecrement && reverse) onDecrement();\n        }\n\n        break;\n\n      case 'Home':\n        e.preventDefault();\n        if (onDecrementToMin) onDecrementToMin();\n        break;\n\n      case 'End':\n        e.preventDefault();\n        if (onIncrementToMax) onIncrementToMax();\n        break;\n\n      case 'Enter':\n        e.preventDefault();\n        if (onCollapseToggle) onCollapseToggle();\n        break;\n    }\n  };\n\n  return {\n    onMouseDown: onMouseDown,\n    onMouseEnter: onMouseEnter,\n    onMouseOut: onMouseOut,\n    onKeyDown: onKeyDown\n  };\n}\n\nvar $042598a43c3fee40$exports = {};\n$parcel$export($042598a43c3fee40$exports, \"useGlobalListeners\", function () {\n  return $042598a43c3fee40$export$4eaf04e54aa8eed6;\n});\n\nfunction $042598a43c3fee40$export$4eaf04e54aa8eed6() {\n  var globalListeners = $gskSG$useRef(new Map());\n  var addGlobalListener = $gskSG$useCallback(function (eventTarget, type, listener, options) {\n    var fn = options != null && options.once ? function () {\n      globalListeners.current.delete(listener);\n      listener.apply(void 0, arguments);\n    } : listener;\n    globalListeners.current.set(listener, {\n      type: type,\n      eventTarget: eventTarget,\n      fn: fn,\n      options: options\n    });\n    eventTarget.addEventListener(type, listener, options);\n  }, []);\n  var removeGlobalListener = $gskSG$useCallback(function (eventTarget, type, listener, options) {\n    var _globalListeners$curr;\n\n    var fn = ((_globalListeners$curr = globalListeners.current.get(listener)) == null ? void 0 : _globalListeners$curr.fn) || listener;\n    eventTarget.removeEventListener(type, fn, options);\n    globalListeners.current.delete(listener);\n  }, []);\n  var removeAllGlobalListeners = $gskSG$useCallback(function () {\n    globalListeners.current.forEach(function (value, key) {\n      removeGlobalListener(value.eventTarget, value.type, key, value.options);\n    });\n  }, [removeGlobalListener]);\n  $gskSG$useEffect(function () {\n    return removeAllGlobalListeners;\n  }, [removeAllGlobalListeners]);\n  return {\n    addGlobalListener: addGlobalListener,\n    removeGlobalListener: removeGlobalListener,\n    removeAllGlobalListeners: removeAllGlobalListeners\n  };\n}\n\nvar $2ab91c20d1fbac23$exports = {};\n$parcel$export($2ab91c20d1fbac23$exports, \"useLabels\", function () {\n  return $2ab91c20d1fbac23$export$d6875122194c7b44;\n});\n\nfunction $2ab91c20d1fbac23$export$d6875122194c7b44(props, defaultLabel) {\n  var id = props.id,\n      label = props['aria-label'],\n      labelledBy = props['aria-labelledby'];\n  id = $4208ab27be92763a$export$f680877a34711e37(id);\n\n  if (labelledBy && label) {\n    var ids = new Set([].concat(_toConsumableArray(labelledBy.trim().split(/\\s+/)), [id]));\n    labelledBy = _toConsumableArray(ids).join(' ');\n  } else if (labelledBy) labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n\n  if (!label && !labelledBy && defaultLabel) label = defaultLabel;\n  return {\n    id: id,\n    'aria-label': label,\n    'aria-labelledby': labelledBy\n  };\n}\n\nvar $1ea3613dec903cb9$exports = {};\n$parcel$export($1ea3613dec903cb9$exports, \"useObjectRef\", function () {\n  return $1ea3613dec903cb9$export$4338b53315abf666;\n});\n\nfunction $1ea3613dec903cb9$export$4338b53315abf666(forwardedRef) {\n  var objRef = $gskSG$useRef();\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(function () {\n    if (!forwardedRef) return;\n    if (typeof forwardedRef === 'function') forwardedRef(objRef.current);else forwardedRef.current = objRef.current;\n  }, [forwardedRef]);\n  return objRef;\n}\n\nvar $d3ab8ae13db3a1fd$exports = {};\n$parcel$export($d3ab8ae13db3a1fd$exports, \"useUpdateEffect\", function () {\n  return $d3ab8ae13db3a1fd$export$496315a1608d9602;\n});\n\nfunction $d3ab8ae13db3a1fd$export$496315a1608d9602(effect, dependencies) {\n  var isInitialMount = $gskSG$useRef(true);\n  $gskSG$useEffect(function () {\n    if (isInitialMount.current) isInitialMount.current = false;else effect();\n  }, dependencies);\n}\n\nvar $f3e728a941364b05$exports = {};\n$parcel$export($f3e728a941364b05$exports, \"useResizeObserver\", function () {\n  return $f3e728a941364b05$export$683480f191c0e3ea;\n});\n\nfunction $f3e728a941364b05$var$hasResizeObserver() {\n  return typeof window.ResizeObserver !== 'undefined';\n}\n\nfunction $f3e728a941364b05$export$683480f191c0e3ea(options) {\n  var ref = options.ref,\n      onResize = options.onResize;\n  $gskSG$useEffect(function () {\n    var element = ref == null ? void 0 : ref.current;\n    if (!element) return;\n\n    if (!$f3e728a941364b05$var$hasResizeObserver()) {\n      window.addEventListener('resize', onResize, false);\n      return function () {\n        window.removeEventListener('resize', onResize, false);\n      };\n    } else {\n      var resizeObserverInstance = new window.ResizeObserver(function (entries) {\n        if (!entries.length) return;\n        onResize();\n      });\n      resizeObserverInstance.observe(element);\n      return function () {\n        if (element) resizeObserverInstance.unobserve(element);\n      };\n    }\n  }, [onResize, ref]);\n}\n\nvar $518b8f251641d71b$exports = {};\n$parcel$export($518b8f251641d71b$exports, \"useSyncRef\", function () {\n  return $518b8f251641d71b$export$4debdb1a3f0fa79e;\n});\n\nfunction $518b8f251641d71b$export$4debdb1a3f0fa79e(context, ref) {\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(function () {\n    if (context && context.ref && ref) {\n      context.ref.current = ref.current;\n      return function () {\n        context.ref.current = null;\n      };\n    }\n  }, [context, ref]);\n}\n\nvar $2fe8625dffd76a00$exports = {};\n$parcel$export($2fe8625dffd76a00$exports, \"getScrollParent\", function () {\n  return $2fe8625dffd76a00$export$cfa2225e87938781;\n});\n\nfunction $2fe8625dffd76a00$export$cfa2225e87938781(node) {\n  while (node && !$2fe8625dffd76a00$var$isScrollable(node)) {\n    node = node.parentElement;\n  }\n\n  return node || document.scrollingElement || document.documentElement;\n}\n\nfunction $2fe8625dffd76a00$var$isScrollable(node) {\n  var style = window.getComputedStyle(node);\n  return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n}\n\nvar $c5fe598a15f005e5$exports = {};\n$parcel$export($c5fe598a15f005e5$exports, \"useViewportSize\", function () {\n  return $c5fe598a15f005e5$export$d699905dd57c73ca;\n});\nvar $c5fe598a15f005e5$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;\n\nfunction $c5fe598a15f005e5$export$d699905dd57c73ca() {\n  var _$gskSG$useState3 = $gskSG$useState(function () {\n    return $c5fe598a15f005e5$var$getViewportSize();\n  }),\n      _$gskSG$useState4 = _slicedToArray(_$gskSG$useState3, 2),\n      size1 = _$gskSG$useState4[0],\n      setSize = _$gskSG$useState4[1];\n\n  $gskSG$useEffect(function () {\n    var onResize = function onResize() {\n      setSize(function (size) {\n        var newSize = $c5fe598a15f005e5$var$getViewportSize();\n        if (newSize.width === size.width && newSize.height === size.height) return size;\n        return newSize;\n      });\n    };\n\n    if (!$c5fe598a15f005e5$var$visualViewport) window.addEventListener('resize', onResize);else $c5fe598a15f005e5$var$visualViewport.addEventListener('resize', onResize);\n    return function () {\n      if (!$c5fe598a15f005e5$var$visualViewport) window.removeEventListener('resize', onResize);else $c5fe598a15f005e5$var$visualViewport.removeEventListener('resize', onResize);\n    };\n  }, []);\n  return size1;\n}\n\nfunction $c5fe598a15f005e5$var$getViewportSize() {\n  return {\n    width: ($c5fe598a15f005e5$var$visualViewport == null ? void 0 : $c5fe598a15f005e5$var$visualViewport.width) || window.innerWidth,\n    height: ($c5fe598a15f005e5$var$visualViewport == null ? void 0 : $c5fe598a15f005e5$var$visualViewport.height) || window.innerHeight\n  };\n}\n\nvar $5475261706737633$exports = {};\n$parcel$export($5475261706737633$exports, \"useDescription\", function () {\n  return $5475261706737633$export$f8aeda7b10753fa1;\n});\nvar $5475261706737633$var$descriptionId = 0;\nvar $5475261706737633$var$descriptionNodes = new Map();\n\nfunction $5475261706737633$export$f8aeda7b10753fa1(description) {\n  var _$gskSG$useState5 = $gskSG$useState(null),\n      _$gskSG$useState6 = _slicedToArray(_$gskSG$useState5, 2),\n      id1 = _$gskSG$useState6[0],\n      setId = _$gskSG$useState6[1];\n\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(function () {\n    if (!description) return;\n    var desc = $5475261706737633$var$descriptionNodes.get(description);\n\n    if (!desc) {\n      var id = \"react-aria-description-\" + $5475261706737633$var$descriptionId++;\n      setId(id);\n      var node = document.createElement('div');\n      node.id = id;\n      node.style.display = 'none';\n      node.textContent = description;\n      document.body.appendChild(node);\n      desc = {\n        refCount: 0,\n        element: node\n      };\n      $5475261706737633$var$descriptionNodes.set(description, desc);\n    } else setId(desc.element.id);\n\n    desc.refCount++;\n    return function () {\n      if (--desc.refCount === 0) {\n        desc.element.remove();\n        $5475261706737633$var$descriptionNodes.delete(description);\n      }\n    };\n  }, [description]);\n  return {\n    'aria-describedby': description ? id1 : undefined\n  };\n}\n\nvar $43a0edf5ccd884bb$exports = {};\n$parcel$export($43a0edf5ccd884bb$exports, \"isMac\", function () {\n  return $43a0edf5ccd884bb$export$9ac100e40613ea10;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isIPhone\", function () {\n  return $43a0edf5ccd884bb$export$186c6964ca17d99;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isIPad\", function () {\n  return $43a0edf5ccd884bb$export$7bef049ce92e4224;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isIOS\", function () {\n  return $43a0edf5ccd884bb$export$fedb369cb70207f1;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isAppleDevice\", function () {\n  return $43a0edf5ccd884bb$export$e1865c3bedcd822b;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isWebKit\", function () {\n  return $43a0edf5ccd884bb$export$78551043582a6a98;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isChrome\", function () {\n  return $43a0edf5ccd884bb$export$6446a186d09e379e;\n});\n$parcel$export($43a0edf5ccd884bb$exports, \"isAndroid\", function () {\n  return $43a0edf5ccd884bb$export$a11b0059900ceec8;\n});\n\nfunction $43a0edf5ccd884bb$var$testUserAgent(re) {\n  return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.userAgent) : false;\n}\n\nfunction $43a0edf5ccd884bb$var$testPlatform(re) {\n  return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : false;\n}\n\nfunction $43a0edf5ccd884bb$export$9ac100e40613ea10() {\n  return $43a0edf5ccd884bb$var$testPlatform(/^Mac/);\n}\n\nfunction $43a0edf5ccd884bb$export$186c6964ca17d99() {\n  return $43a0edf5ccd884bb$var$testPlatform(/^iPhone/);\n}\n\nfunction $43a0edf5ccd884bb$export$7bef049ce92e4224() {\n  return $43a0edf5ccd884bb$var$testPlatform(/^iPad/) || $43a0edf5ccd884bb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;\n}\n\nfunction $43a0edf5ccd884bb$export$fedb369cb70207f1() {\n  return $43a0edf5ccd884bb$export$186c6964ca17d99() || $43a0edf5ccd884bb$export$7bef049ce92e4224();\n}\n\nfunction $43a0edf5ccd884bb$export$e1865c3bedcd822b() {\n  return $43a0edf5ccd884bb$export$9ac100e40613ea10() || $43a0edf5ccd884bb$export$fedb369cb70207f1();\n}\n\nfunction $43a0edf5ccd884bb$export$78551043582a6a98() {\n  return $43a0edf5ccd884bb$var$testUserAgent(/AppleWebKit/) && !$43a0edf5ccd884bb$export$6446a186d09e379e();\n}\n\nfunction $43a0edf5ccd884bb$export$6446a186d09e379e() {\n  return $43a0edf5ccd884bb$var$testUserAgent(/Chrome/);\n}\n\nfunction $43a0edf5ccd884bb$export$a11b0059900ceec8() {\n  return $43a0edf5ccd884bb$var$testUserAgent(/Android/);\n}\n\nvar $6f85328eaea47571$exports = {};\n$parcel$export($6f85328eaea47571$exports, \"useEvent\", function () {\n  return $6f85328eaea47571$export$90fc3a17d93f704c;\n});\n\nfunction $6f85328eaea47571$export$90fc3a17d93f704c(ref, event, handler1, options) {\n  var _this = this;\n\n  var handlerRef = $gskSG$useRef(handler1);\n  handlerRef.current = handler1;\n  var isDisabled = handler1 == null;\n  $gskSG$useEffect(function () {\n    if (isDisabled) return;\n    var element = ref.current;\n\n    var handler = function handler(e) {\n      return handlerRef.current.call(_this, e);\n    };\n\n    element.addEventListener(event, handler, options);\n    return function () {\n      element.removeEventListener(event, handler, options);\n    };\n  }, [ref, event, options, isDisabled]);\n}\n\nvar $8bfb318ccfa2e412$exports = {};\n$parcel$export($8bfb318ccfa2e412$exports, \"useValueEffect\", function () {\n  return $8bfb318ccfa2e412$export$14d238f342723f25;\n});\n\nfunction $8bfb318ccfa2e412$export$14d238f342723f25(defaultValue) {\n  var _$gskSG$useState7 = $gskSG$useState(defaultValue),\n      _$gskSG$useState8 = _slicedToArray(_$gskSG$useState7, 2),\n      value = _$gskSG$useState8[0],\n      setValue = _$gskSG$useState8[1];\n\n  var valueRef = $gskSG$useRef(value);\n  var effect = $gskSG$useRef(null);\n  valueRef.current = value;\n  var nextRef = $gskSG$useRef(null);\n\n  nextRef.current = function () {\n    var newValue = effect.current.next();\n\n    if (newValue.done) {\n      effect.current = null;\n      return;\n    }\n\n    if (value === newValue.value) nextRef.current();else setValue(newValue.value);\n  };\n\n  $62918828a5c4cefe$export$e5c5a5f917a5871c(function () {\n    if (effect.current) nextRef.current();\n  });\n  var queue = $gskSG$useCallback(function (fn) {\n    effect.current = fn(valueRef.current);\n    nextRef.current();\n  }, [effect, nextRef]);\n  return [value, queue];\n}\n\nvar $7b1a72e750057d55$exports = {};\n$parcel$export($7b1a72e750057d55$exports, \"scrollIntoView\", function () {\n  return $7b1a72e750057d55$export$53a0910f038337bd;\n});\n\nfunction $7b1a72e750057d55$export$53a0910f038337bd(scrollView, element) {\n  var offsetX = $7b1a72e750057d55$var$relativeOffset(scrollView, element, 'left');\n  var offsetY = $7b1a72e750057d55$var$relativeOffset(scrollView, element, 'top');\n  var width = element.offsetWidth;\n  var height = element.offsetHeight;\n  var x = scrollView.scrollLeft;\n  var y = scrollView.scrollTop;\n  var maxX = x + scrollView.offsetWidth;\n  var maxY = y + scrollView.offsetHeight;\n  if (offsetX <= x) x = offsetX;else if (offsetX + width > maxX) x += offsetX + width - maxX;\n  if (offsetY <= y) y = offsetY;else if (offsetY + height > maxY) y += offsetY + height - maxY;\n  scrollView.scrollLeft = x;\n  scrollView.scrollTop = y;\n}\n\nfunction $7b1a72e750057d55$var$relativeOffset(ancestor, child, axis) {\n  var prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n  var sum = 0;\n\n  while (child.offsetParent) {\n    sum += child[prop];\n    if (child.offsetParent === ancestor) break;else if (child.offsetParent.contains(ancestor)) {\n      sum -= ancestor[prop];\n      break;\n    }\n    child = child.offsetParent;\n  }\n\n  return sum;\n}\n\nexport { $4208ab27be92763a$export$f680877a34711e37 as useId, $4208ab27be92763a$export$cd8c9cb68f842629 as mergeIds, $4208ab27be92763a$export$b4cc09c592e8fdb8 as useSlotId, $2aefb161b9a41928$export$e08e3b67e392101e as chain, $699afe8e9e0f66de$export$9d1611c77c2fe928 as mergeProps, $7efcb978e02fb174$export$457c3d6518dd4c6f as filterDOMProps, $0172e2a3384c2851$export$de79e2c695e052f3 as focusWithoutScrolling, $5062b1512bdf762b$export$622cea445a1c5b7d as getOffset, $5cdbf4ddafd135bc$re_export$clamp as clamp, $5cdbf4ddafd135bc$re_export$snapValueToStep as snapValueToStep, $fdecdd2f4116564c$export$24490316f764c430 as runAfterTransition, $95a0e07fe544f4e9$export$7bbed75feba39706 as useDrag1D, $042598a43c3fee40$export$4eaf04e54aa8eed6 as useGlobalListeners, $2ab91c20d1fbac23$export$d6875122194c7b44 as useLabels, $1ea3613dec903cb9$export$4338b53315abf666 as useObjectRef, $d3ab8ae13db3a1fd$export$496315a1608d9602 as useUpdateEffect, $62918828a5c4cefe$export$e5c5a5f917a5871c as useLayoutEffect, $f3e728a941364b05$export$683480f191c0e3ea as useResizeObserver, $518b8f251641d71b$export$4debdb1a3f0fa79e as useSyncRef, $2fe8625dffd76a00$export$cfa2225e87938781 as getScrollParent, $c5fe598a15f005e5$export$d699905dd57c73ca as useViewportSize, $5475261706737633$export$f8aeda7b10753fa1 as useDescription, $43a0edf5ccd884bb$export$9ac100e40613ea10 as isMac, $43a0edf5ccd884bb$export$186c6964ca17d99 as isIPhone, $43a0edf5ccd884bb$export$7bef049ce92e4224 as isIPad, $43a0edf5ccd884bb$export$fedb369cb70207f1 as isIOS, $43a0edf5ccd884bb$export$e1865c3bedcd822b as isAppleDevice, $43a0edf5ccd884bb$export$78551043582a6a98 as isWebKit, $43a0edf5ccd884bb$export$6446a186d09e379e as isChrome, $43a0edf5ccd884bb$export$a11b0059900ceec8 as isAndroid, $6f85328eaea47571$export$90fc3a17d93f704c as useEvent, $8bfb318ccfa2e412$export$14d238f342723f25 as useValueEffect, $7b1a72e750057d55$export$53a0910f038337bd as scrollIntoView };","map":{"version":3,"sources":["packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/scrollIntoView.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiBO,IAAM,yCAAe,GAAG,OAAO,MAAP,KAAkB,WAAlB,GAC3B,YAAK,CAAC,eADqB,GACN,YACf,CAAE,CAFL;ADAP,IAAI,mCAAa,GAAqC,IAAI,GAAJ,EAAtD;;SAMgB,yC,CAAM,S,EAA4B;AAChD,MAAI,WAAW,GAAG,aAAM,CAAC,IAAD,CAAxB;AACA,EAAA,WAAW,CAAC,OAAZ,GAAsB,IAAtB;;AACA,yBAAwB,eAAQ,CAAC,SAAD,CAAhC;AAAA;AAAA,MAAK,KAAL;AAAA,MAAY,QAAZ;;AACA,MAAI,MAAM,GAAG,aAAM,CAAC,IAAD,CAAnB;AAEA,MAAI,GAAG,GAAG,mBAAY,CAAC,KAAD,CAAtB;;AAGA,MAAI,WAAW,GAAA,SAAX,WAAW,CAAI,GAAJ,EAAY;AACzB,QAAE,CAAG,WAAW,CAAC,OAAjB,EACE,QAAQ,CAAC,GAAD,CAAR,CADF,KAGE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B,EACL,CAAC,IAAI,OAAO,GAAG,KAAV,GAAkB,IAAvB;AAEF,MAAI,OAAO,IAAI,CAAf,EACE,CAAC,GAAG,OAAJ,CADF,KAEO,IAAI,OAAO,GAAG,MAAV,GAAmB,IAAvB,EACL,CAAC,IAAI,OAAO,GAAG,MAAV,GAAmB,IAAxB;AAGF,EAAA,UAAU,CAAC,UAAX,GAAwB,CAAxB;AACA,EAAA,UAAU,CAAC,SAAX,GAAuB,CAAvB;AACD;;AAKE,SACM,oCADN,CACqB,QADrB,EAC4C,KAD5C,EACgE,IADhE,EACoF;AACrF,MAAM,IAAI,GAAG,IAAI,KAAK,MAAT,GAAkB,YAAlB,GAAiC,WAA9C;AACA,MAAI,GAAG,GAAG,CAAV;;SACO,KAAK,CAAC,Y,EAAc;AACzB,IAAA,GAAG,IAAI,KAAK,CAAC,IAAD,CAAZ;AACA,QAAI,KAAK,CAAC,YAAN,KAAuB,QAA3B,EAEE,MAFF,KAGO,IAAI,KAAK,CAAC,YAAN,CAAmB,QAAnB,CAA4B,QAA5B,CAAJ,EAA2C;AAIhD,MAAA,GAAG,IAAI,QAAQ,CAAC,IAAD,CAAf;AACA;AACD;AACD,IAAA,KAAK,GAAG,KAAK,CAAC,YAAd;AACD;;AACD,SAAO,GAAP;AACD","sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useSSRSafeId} from '@react-aria/ssr';\nimport {useValueEffect} from './';\n\nlet idsUpdaterMap: Map<string, (v: string) => void> = new Map();\n\n/**\n * If a default is not provided, generate an id.\n * @param defaultId - Default component id.\n */\nexport function useId(defaultId?: string): string {\n  let isRendering = useRef(true);\n  isRendering.current = true;\n  let [value, setValue] = useState(defaultId);\n  let nextId = useRef(null);\n\n  let res = useSSRSafeId(value);\n\n  // don't memo this, we want it new each render so that the Effects always run\n  let updateValue = (val) => {\n    if (!isRendering.current) {\n      setValue(val);\n    } else {\n      nextId.current = val;\n    }\n  };\n\n  idsUpdaterMap.set(res, updateValue);\n\n  useLayoutEffect(() => {\n    isRendering.current = false;\n  }, [updateValue]);\n\n  useLayoutEffect(() => {\n    let r = res;\n    return () => {\n      idsUpdaterMap.delete(r);\n    };\n  }, [res]);\n\n  useEffect(() => {\n    let newId = nextId.current;\n    if (newId) {\n      setValue(newId);\n      nextId.current = null;\n    }\n  }, [setValue, updateValue]);\n  return res;\n}\n\n/**\n * Merges two ids.\n * Different ids will trigger a side-effect and re-render components hooked up with `useId`.\n */\nexport function mergeIds(idA: string, idB: string): string {\n  if (idA === idB) {\n    return idA;\n  }\n\n  let setIdA = idsUpdaterMap.get(idA);\n  if (setIdA) {\n    setIdA(idB);\n    return idB;\n  }\n\n  let setIdB = idsUpdaterMap.get(idB);\n  if (setIdB) {\n    setIdB(idA);\n    return idA;\n  }\n\n  return idB;\n}\n\n/**\n * Used to generate an id, and after render, check if that id is rendered so we know\n * if we can use it in places such as labelledby.\n * @param depArray - When to recalculate if the id is in the DOM.\n */\nexport function useSlotId(depArray: ReadonlyArray<any> = []): string {\n  let id = useId();\n  let [resolvedId, setResolvedId] = useValueEffect(id);\n  let updateId = useCallback(() => {\n    setResolvedId(function *() {\n      yield id;\n\n      yield document.getElementById(id) ? id : null;\n    });\n  }, [id, setResolvedId]);\n\n  useLayoutEffect(updateId, [id, updateId, ...depArray]);\n\n  return resolvedId;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React from 'react';\n\n// During SSR, React emits a warning when calling useLayoutEffect.\n// Since neither useLayoutEffect nor useEffect run on the server,\n// we can suppress this by replace it with a noop on the server.\nexport const useLayoutEffect = typeof window !== 'undefined'\n  ? React.useLayoutEffect\n  : () => {};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n  return (...args: any[]) => {\n    for (let callback of callbacks) {\n      if (typeof callback === 'function') {\n        callback(...args);\n      }\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n  [key: string]: any\n}\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? V : never;\n// eslint-disable-next-line no-undef, @typescript-eslint/no-unused-vars\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated - different ids\n * will trigger a side-effect and re-render components hooked up with `useId`.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends Props[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n  // Start with a base clone of the first argument. This is a lot faster than starting\n  // with an empty object and adding properties as we go.\n  let result: Props = {...args[0]};\n  for (let i = 1; i < args.length; i++) {\n    let props = args[i];\n    for (let key in props) {\n      let a = result[key];\n      let b = props[key];\n\n      // Chain events\n      if (\n        typeof a === 'function' &&\n        typeof b === 'function' &&\n        // This is a lot faster than a regex.\n        key[0] === 'o' &&\n        key[1] === 'n' &&\n        key.charCodeAt(2) >= /* 'A' */ 65 &&\n        key.charCodeAt(2) <= /* 'Z' */ 90\n      ) {\n        result[key] = chain(a, b);\n\n        // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n      } else if (\n        (key === 'className' || key === 'UNSAFE_className') &&\n        typeof a === 'string' &&\n        typeof b === 'string'\n      ) {\n        result[key] = clsx(a, b);\n      } else if (key === 'id' && a && b) {\n        result.id = mergeIds(a, b);\n        // Override others\n      } else {\n        result[key] = b !== undefined ? b : a;\n      }\n    }\n  }\n\n  return result as UnionToIntersection<TupleTypes<T>>;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\nimport {HTMLAttributes} from 'react';\n\nconst DOMPropNames = new Set([\n  'id'\n]);\n\nconst labelablePropNames = new Set([\n  'aria-label',\n  'aria-labelledby',\n  'aria-describedby',\n  'aria-details'\n]);\n\ninterface Options {\n  /**\n   * If labelling associated aria properties should be included in the filter.\n   */\n  labelable?: boolean,\n  /**\n   * A Set of other property names that should be included in the filter.\n   */\n  propNames?: Set<string>\n}\n\nconst propRe = /^(data-.*)$/;\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(props: DOMProps & AriaLabelingProps, opts: Options = {}): DOMProps & AriaLabelingProps {\n  let {labelable, propNames} = opts;\n  let filteredProps: HTMLAttributes<HTMLElement> = {};\n\n  for (const prop in props) {\n    if (\n      Object.prototype.hasOwnProperty.call(props, prop) && (\n        DOMPropNames.has(prop) ||\n        (labelable && labelablePropNames.has(prop)) ||\n        propNames?.has(prop) ||\n        propRe.test(prop)\n      )\n    ) {\n      filteredProps[prop] = props[prop];\n    }\n  }\n\n  return filteredProps;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// This is a polyfill for element.focus({preventScroll: true});\n// Currently necessary for Safari and old Edge:\n// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option\n// See https://bugs.webkit.org/show_bug.cgi?id=178583\n//\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/calvellido/focus-options-polyfill\n\ninterface ScrollableElement {\n  element: HTMLElement,\n  scrollTop: number,\n  scrollLeft: number\n}\n\nexport function focusWithoutScrolling(element: HTMLElement) {\n  if (supportsPreventScroll()) {\n    element.focus({preventScroll: true});\n  } else {\n    let scrollableElements = getScrollableElements(element);\n    element.focus();\n    restoreScrollPosition(scrollableElements);\n  }\n}\n\nlet supportsPreventScrollCached: boolean = null;\nfunction supportsPreventScroll() {\n  if (supportsPreventScrollCached == null) {\n    supportsPreventScrollCached = false;\n    try {\n      var focusElem = document.createElement('div');\n      focusElem.focus({\n        get preventScroll() {\n          supportsPreventScrollCached = true;\n          return true;\n        }\n      });\n    } catch (e) {\n      // Ignore\n    }\n  }\n\n  return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element: HTMLElement): ScrollableElement[] {\n  var parent = element.parentNode;\n  var scrollableElements: ScrollableElement[] = [];\n  var rootScrollingElement = document.scrollingElement || document.documentElement;\n\n  while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n    if (\n      parent.offsetHeight < parent.scrollHeight ||\n      parent.offsetWidth < parent.scrollWidth\n    ) {\n      scrollableElements.push({\n        element: parent,\n        scrollTop: parent.scrollTop,\n        scrollLeft: parent.scrollLeft\n      });\n    }\n    parent = parent.parentNode;\n  }\n\n  if (rootScrollingElement instanceof HTMLElement) {\n    scrollableElements.push({\n      element: rootScrollingElement,\n      scrollTop: rootScrollingElement.scrollTop,\n      scrollLeft: rootScrollingElement.scrollLeft\n    });\n  }\n\n  return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n  for (let {element, scrollTop, scrollLeft} of scrollableElements) {\n    element.scrollTop = scrollTop;\n    element.scrollLeft = scrollLeft;\n  }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function getOffset(element, reverse, orientation = 'horizontal') {\n  let rect = element.getBoundingClientRect();\n  if (reverse) {\n    return orientation === 'horizontal' ? rect.right : rect.bottom;\n  }\n  return orientation === 'horizontal' ? rect.left : rect.top;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nlet transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nlet transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n  if (typeof window === 'undefined') {\n    return;\n  }\n\n  let onTransitionStart = (e: TransitionEvent) => {\n    // Add the transitioning property to the list for this element.\n    let transitions = transitionsByElement.get(e.target);\n    if (!transitions) {\n      transitions = new Set();\n      transitionsByElement.set(e.target, transitions);\n\n      // The transitioncancel event must be registered on the element itself, rather than as a global\n      // event. This enables us to handle when the node is deleted from the document while it is transitioning.\n      // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.\n      e.target.addEventListener('transitioncancel', onTransitionEnd);\n    }\n\n    transitions.add(e.propertyName);\n  };\n\n  let onTransitionEnd = (e: TransitionEvent) => {\n    // Remove property from list of transitioning properties.\n    let properties = transitionsByElement.get(e.target);\n    if (!properties) {\n      return;\n    }\n\n    properties.delete(e.propertyName);\n\n    // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n    if (properties.size === 0) {\n      e.target.removeEventListener('transitioncancel', onTransitionEnd);\n      transitionsByElement.delete(e.target);\n    }\n\n    // If no transitioning elements, call all of the queued callbacks.\n    if (transitionsByElement.size === 0) {\n      for (let cb of transitionCallbacks) {\n        cb();\n      }\n\n      transitionCallbacks.clear();\n    }\n  };\n\n  document.body.addEventListener('transitionrun', onTransitionStart);\n  document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n  if (document.readyState !== 'loading') {\n    setupGlobalEvents();\n  } else {\n    document.addEventListener('DOMContentLoaded', setupGlobalEvents);\n  }\n}\n\nexport function runAfterTransition(fn: () => void) {\n  // Wait one frame to see if an animation starts, e.g. a transition on mount.\n  requestAnimationFrame(() => {\n    // If no transitions are running, call the function immediately.\n    // Otherwise, add it to a list of callbacks to run at the end of the animation.\n    if (transitionsByElement.size === 0) {\n      fn();\n    } else {\n      transitionCallbacks.add(fn);\n    }\n  });\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n  containerRef: MutableRefObject<HTMLElement>,\n  reverse?: boolean,\n  orientation?: Orientation,\n  onHover?: (hovered: boolean) => void,\n  onDrag?: (dragging: boolean) => void,\n  onPositionChange?: (position: number) => void,\n  onIncrement?: () => void,\n  onDecrement?: () => void,\n  onIncrementToMax?: () => void,\n  onDecrementToMin?: () => void,\n  onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n  console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n  let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n  let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n  let getNextOffset = (e: MouseEvent) => {\n    let containerOffset = getOffset(containerRef.current, reverse, orientation);\n    let mouseOffset = getPosition(e);\n    let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n    return nextOffset;\n  };\n  let dragging = useRef(false);\n  let prevPosition = useRef(0);\n\n  // Keep track of the current handlers in a ref so that the events can access them.\n  let handlers = useRef({onPositionChange, onDrag});\n  handlers.current.onDrag = onDrag;\n  handlers.current.onPositionChange = onPositionChange;\n\n  let onMouseDragged = (e: MouseEvent) => {\n    e.preventDefault();\n    let nextOffset = getNextOffset(e);\n    if (!dragging.current) {\n      dragging.current = true;\n      if (handlers.current.onDrag) {\n        handlers.current.onDrag(true);\n      }\n      if (handlers.current.onPositionChange) {\n        handlers.current.onPositionChange(nextOffset);\n      }\n    }\n    if (prevPosition.current === nextOffset) {\n      return;\n    }\n    prevPosition.current = nextOffset;\n    if (onPositionChange) {\n      onPositionChange(nextOffset);\n    }\n  };\n\n  let onMouseUp = (e: MouseEvent) => {\n    const target = e.target as HTMLElement;\n    dragging.current = false;\n    let nextOffset = getNextOffset(e);\n    if (handlers.current.onDrag) {\n      handlers.current.onDrag(false);\n    }\n    if (handlers.current.onPositionChange) {\n      handlers.current.onPositionChange(nextOffset);\n    }\n\n    draggingElements.splice(draggingElements.indexOf(target), 1);\n    window.removeEventListener('mouseup', onMouseUp, false);\n    window.removeEventListener('mousemove', onMouseDragged, false);\n  };\n\n  let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n    const target = e.currentTarget;\n    // If we're already handling dragging on a descendant with useDrag1D, then\n    // we don't want to handle the drag motion on this target as well.\n    if (draggingElements.some(elt => target.contains(elt))) {\n      return;\n    }\n    draggingElements.push(target);\n    window.addEventListener('mousemove', onMouseDragged, false);\n    window.addEventListener('mouseup', onMouseUp, false);\n  };\n\n  let onMouseEnter = () => {\n    if (onHover) {\n      onHover(true);\n    }\n  };\n\n  let onMouseOut = () => {\n    if (onHover) {\n      onHover(false);\n    }\n  };\n\n  let onKeyDown = (e) => {\n    switch (e.key) {\n      case 'Left':\n      case 'ArrowLeft':\n        if (orientation === 'horizontal') {\n          e.preventDefault();\n          if (onDecrement && !reverse) {\n            onDecrement();\n          } else if (onIncrement && reverse) {\n            onIncrement();\n          }\n        }\n        break;\n      case 'Up':\n      case 'ArrowUp':\n        if (orientation === 'vertical') {\n          e.preventDefault();\n          if (onDecrement && !reverse) {\n            onDecrement();\n          } else if (onIncrement && reverse) {\n            onIncrement();\n          }\n        }\n        break;\n      case 'Right':\n      case 'ArrowRight':\n        if (orientation === 'horizontal') {\n          e.preventDefault();\n          if (onIncrement && !reverse) {\n            onIncrement();\n          } else if (onDecrement && reverse) {\n            onDecrement();\n          }\n        }\n        break;\n      case 'Down':\n      case 'ArrowDown':\n        if (orientation === 'vertical') {\n          e.preventDefault();\n          if (onIncrement && !reverse) {\n            onIncrement();\n          } else if (onDecrement && reverse) {\n            onDecrement();\n          }\n        }\n        break;\n      case 'Home':\n        e.preventDefault();\n        if (onDecrementToMin) {\n          onDecrementToMin();\n        }\n        break;\n      case 'End':\n        e.preventDefault();\n        if (onIncrementToMax) {\n          onIncrementToMax();\n        }\n        break;\n      case 'Enter':\n        e.preventDefault();\n        if (onCollapseToggle) {\n          onCollapseToggle();\n        }\n        break;\n    }\n  };\n\n  return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef} from 'react';\n\ninterface GlobalListeners {\n  addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,\n  addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void,\n  removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void,\n  removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void,\n  removeAllGlobalListeners(): void\n}\n\nexport function useGlobalListeners(): GlobalListeners {\n  let globalListeners = useRef(new Map());\n  let addGlobalListener = useCallback((eventTarget, type, listener, options) => {\n    // Make sure we remove the listener after it is called with the `once` option.\n    let fn = options?.once ? (...args) => {\n      globalListeners.current.delete(listener);\n      listener(...args);\n    } : listener;\n    globalListeners.current.set(listener, {type, eventTarget, fn, options});\n    eventTarget.addEventListener(type, listener, options);\n  }, []);\n  let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {\n    let fn = globalListeners.current.get(listener)?.fn || listener;\n    eventTarget.removeEventListener(type, fn, options);\n    globalListeners.current.delete(listener);\n  }, []);\n  let removeAllGlobalListeners = useCallback(() => {\n    globalListeners.current.forEach((value, key) => {\n      removeGlobalListener(value.eventTarget, value.type, key, value.options);\n    });\n  }, [removeGlobalListener]);\n\n  // eslint-disable-next-line arrow-body-style\n  useEffect(() => {\n    return removeAllGlobalListeners;\n  }, [removeAllGlobalListeners]);\n\n  return {addGlobalListener, removeGlobalListener, removeAllGlobalListeners};\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\nimport {useId} from './useId';\n\n/**\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n * @param props - Aria label props.\n * @param defaultLabel - Default value for aria-label when not present.\n */\nexport function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps {\n  let {\n    id,\n    'aria-label': label,\n    'aria-labelledby': labelledBy\n  } = props;\n\n  // If there is both an aria-label and aria-labelledby,\n  // combine them by pointing to the element itself.\n  id = useId(id);\n  if (labelledBy && label) {\n    let ids = new Set([...labelledBy.trim().split(/\\s+/), id]);\n    labelledBy = [...ids].join(' ');\n  } else if (labelledBy) {\n    labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n  }\n\n  // If no labels are provided, use the default\n  if (!label && !labelledBy && defaultLabel) {\n    label = defaultLabel;\n  }\n\n  return {\n    id,\n    'aria-label': label,\n    'aria-labelledby': labelledBy\n  };\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, useRef} from 'react';\nimport {useLayoutEffect} from './';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria Hooks.\n *\n * @param forwardedRef The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://reactjs.org/docs/forwarding-refs.html\n */\nexport function useObjectRef<T>(forwardedRef?: ((instance: T | null) => void) | MutableRefObject<T | null> | null): MutableRefObject<T> {\n  const objRef = useRef<T>();\n\n  /**\n   * We're using `useLayoutEffect` here instead of `useEffect` because we want\n   * to make sure that the `ref` value is up to date before other places in the\n   * the execution cycle try to read it.\n   */\n  useLayoutEffect(() => {\n    if (!forwardedRef) {\n      return;\n    }\n\n    if (typeof forwardedRef === 'function') {\n      forwardedRef(objRef.current);\n    } else {\n      forwardedRef.current = objRef.current;\n    }\n  }, [forwardedRef]);\n\n  return objRef;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {EffectCallback, useEffect, useRef} from 'react';\n\n// Like useEffect, but only called for updates after the initial render.\nexport function useUpdateEffect(effect: EffectCallback, dependencies: any[]) {\n  const isInitialMount = useRef(true);\n\n  useEffect(() => {\n    if (isInitialMount.current) {\n      isInitialMount.current = false;\n    } else {\n      effect();\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, dependencies);\n}\n","import {RefObject, useEffect} from 'react';\n\nfunction hasResizeObserver() {\n  return typeof window.ResizeObserver !== 'undefined';\n}\n\ntype useResizeObserverOptionsType<T> = {\n  ref: RefObject<T>,\n  onResize: () => void\n}\n\nexport function useResizeObserver<T extends HTMLElement>(options: useResizeObserverOptionsType<T>) {\n  const {ref, onResize} = options;\n\n  useEffect(() => {\n    let element = ref?.current;\n    if (!element) {\n      return;\n    }\n\n    if (!hasResizeObserver()) {\n      window.addEventListener('resize', onResize, false);\n      return () => {\n        window.removeEventListener('resize', onResize, false);\n      };\n    } else {\n\n      const resizeObserverInstance = new window.ResizeObserver((entries) => {\n        if (!entries.length) {\n          return;\n        }\n\n        onResize();\n      });\n      resizeObserverInstance.observe(element);\n\n      return () => {\n        if (element) {\n          resizeObserverInstance.unobserve(element);\n        }\n      };\n    }\n\n  }, [onResize, ref]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, RefObject} from 'react';\nimport {useLayoutEffect} from './';\n\ninterface ContextValue<T> {\n  ref?: MutableRefObject<T>\n}\n\n// Syncs ref from context with ref passed to hook\nexport function useSyncRef<T>(context: ContextValue<T>, ref: RefObject<T>) {\n  useLayoutEffect(() => {\n    if (context && context.ref && ref) {\n      context.ref.current = ref.current;\n      return () => {\n        context.ref.current = null;\n      };\n    }\n  }, [context, ref]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function getScrollParent(node: Element): Element {\n  while (node && !isScrollable(node)) {\n    node = node.parentElement;\n  }\n\n  return node || document.scrollingElement || document.documentElement;\n}\n\nfunction isScrollable(node: Element): boolean {\n  let style = window.getComputedStyle(node);\n  return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\n\ninterface ViewportSize {\n  width: number,\n  height: number\n}\n\n// @ts-ignore\nlet visualViewport = typeof window !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n  let [size, setSize] = useState(() => getViewportSize());\n\n  useEffect(() => {\n    // Use visualViewport api to track available height even on iOS virtual keyboard opening\n    let onResize = () => {\n      setSize(size => {\n        let newSize = getViewportSize();\n        if (newSize.width === size.width && newSize.height === size.height) {\n          return size;\n        }\n        return newSize;\n      });\n    };\n\n    if (!visualViewport) {\n      window.addEventListener('resize', onResize);\n    } else {\n      visualViewport.addEventListener('resize', onResize);\n    }\n\n    return () => {\n      if (!visualViewport) {\n        window.removeEventListener('resize', onResize);\n      } else {\n        visualViewport.removeEventListener('resize', onResize);\n      }\n    };\n  }, []);\n\n  return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n  return {\n    width: visualViewport?.width || window.innerWidth,\n    height: visualViewport?.height || window.innerHeight\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps} from '@react-types/shared';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useState} from 'react';\n\nlet descriptionId = 0;\nconst descriptionNodes = new Map<string, {refCount: number, element: HTMLElement}>();\n\nexport function useDescription(description: string): AriaLabelingProps {\n  let [id, setId] = useState(null);\n\n  useLayoutEffect(() => {\n    if (!description) {\n      return;\n    }\n\n    let desc = descriptionNodes.get(description);\n    if (!desc) {\n      let id = `react-aria-description-${descriptionId++}`;\n      setId(id);\n\n      let node = document.createElement('div');\n      node.id = id;\n      node.style.display = 'none';\n      node.textContent = description;\n      document.body.appendChild(node);\n      desc = {refCount: 0, element: node};\n      descriptionNodes.set(description, desc);\n    } else {\n      setId(desc.element.id);\n    }\n\n    desc.refCount++;\n    return () => {\n      if (--desc.refCount === 0) {\n        desc.element.remove();\n        descriptionNodes.delete(description);\n      }\n    };\n  }, [description]);\n\n  return {\n    'aria-describedby': description ? id : undefined\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction testUserAgent(re: RegExp) {\n  return typeof window !== 'undefined' && window.navigator != null\n    ? re.test(window.navigator.userAgent)\n    : false;\n}\n\nfunction testPlatform(re: RegExp) {\n  return typeof window !== 'undefined' && window.navigator != null\n    ? re.test(window.navigator.platform)\n    : false;\n}\n\nexport function isMac() {\n  return testPlatform(/^Mac/);\n}\n\nexport function isIPhone() {\n  return testPlatform(/^iPhone/);\n}\n\nexport function isIPad() {\n  return testPlatform(/^iPad/) ||\n    // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n    (isMac() && navigator.maxTouchPoints > 1);\n}\n\nexport function isIOS() {\n  return isIPhone() || isIPad();\n}\n\nexport function isAppleDevice() {\n  return isMac() || isIOS();\n}\n\nexport function isWebKit() {\n  return testUserAgent(/AppleWebKit/) && !isChrome();\n}\n\nexport function isChrome() {\n  return testUserAgent(/Chrome/);\n}\n\nexport function isAndroid() {\n  return testUserAgent(/Android/);\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useEffect, useRef} from 'react';\n\nexport function useEvent<K extends keyof GlobalEventHandlersEventMap>(\n  ref: RefObject<EventTarget>,\n  event: K,\n  handler: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,\n  options?: boolean | AddEventListenerOptions\n) {\n  let handlerRef = useRef(handler);\n  handlerRef.current = handler;\n\n  let isDisabled = handler == null;\n\n  useEffect(() => {\n    if (isDisabled) {\n      return;\n    }\n\n    let element = ref.current;\n    let handler = (e: GlobalEventHandlersEventMap[K]) => handlerRef.current.call(this, e);\n\n    element.addEventListener(event, handler, options);\n    return () => {\n      element.removeEventListener(event, handler, options);\n    };\n  }, [ref, event, options, isDisabled]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Dispatch, useCallback, useRef, useState} from 'react';\nimport {useLayoutEffect} from './';\n\ntype SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;\n\n// This hook works like `useState`, but when setting the value, you pass a generator function\n// that can yield multiple values. Each yielded value updates the state and waits for the next\n// layout effect, then continues the generator. This allows sequential updates to state to be\n// written linearly.\nexport function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {\n  let [value, setValue] = useState(defaultValue);\n  let valueRef = useRef(value);\n  let effect = useRef(null);\n\n  valueRef.current = value;\n\n  // Store the function in a ref so we can always access the current version\n  // which has the proper `value` in scope.\n  let nextRef = useRef(null);\n  nextRef.current = () => {\n    // Run the generator to the next yield.\n    let newValue = effect.current.next();\n\n    // If the generator is done, reset the effect.\n    if (newValue.done) {\n      effect.current = null;\n      return;\n    }\n\n    // If the value is the same as the current value,\n    // then continue to the next yield. Otherwise,\n    // set the value in state and wait for the next layout effect.\n    if (value === newValue.value) {\n      nextRef.current();\n    } else {\n      setValue(newValue.value);\n    }\n  };\n\n  useLayoutEffect(() => {\n    // If there is an effect currently running, continue to the next yield.\n    if (effect.current) {\n      nextRef.current();\n    }\n  });\n\n  let queue = useCallback(fn => {\n    effect.current = fn(valueRef.current);\n    nextRef.current();\n  }, [effect, nextRef]);\n\n  return [value, queue];\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement) {\n  let offsetX = relativeOffset(scrollView, element, 'left');\n  let offsetY = relativeOffset(scrollView, element, 'top');\n  let width = element.offsetWidth;\n  let height = element.offsetHeight;\n  let x = scrollView.scrollLeft;\n  let y = scrollView.scrollTop;\n  let maxX = x + scrollView.offsetWidth;\n  let maxY = y + scrollView.offsetHeight;\n\n  if (offsetX <= x) {\n    x = offsetX;\n  } else if (offsetX + width > maxX) {\n    x += offsetX + width - maxX;\n  }\n  if (offsetY <= y) {\n    y = offsetY;\n  } else if (offsetY + height > maxY) {\n    y += offsetY + height - maxY;\n  }\n\n  scrollView.scrollLeft = x;\n  scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n  const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n  let sum = 0;\n  while (child.offsetParent) {\n    sum += child[prop];\n    if (child.offsetParent === ancestor) {\n      // Stop once we have found the ancestor we are interested in.\n      break;\n    } else if (child.offsetParent.contains(ancestor)) {\n      // If the ancestor is not `position:relative`, then we stop at\n      // _its_ offset parent, and we subtract off _its_ offset, so that\n      // we end up with the proper offset from child to ancestor.\n      sum -= ancestor[prop];\n      break;\n    }\n    child = child.offsetParent as HTMLElement;\n  }\n  return sum;\n}\n"]},"metadata":{},"sourceType":"module"}