{"version":3,"sources":["webpack:///./node_modules/reakit-utils/es/canUseDOM.js","webpack:///./node_modules/reakit-utils/es/isPlainObject.js","webpack:///./node_modules/body-scroll-lock/lib/bodyScrollLock.esm.js","webpack:///./node_modules/reakit-utils/es/useSealedState.js","webpack:///./node_modules/reakit-utils/es/isButton.js","webpack:///./node_modules/reakit/es/Disclosure/DisclosureState.js","webpack:///./node_modules/reakit/es/Id/IdState.js","webpack:///./node_modules/reakit/es/Dialog/DialogState.js","webpack:///./node_modules/reakit-utils/es/matches.js","webpack:///./node_modules/reakit-utils/es/hasFocus.js","webpack:///./node_modules/reakit-utils/es/ensureFocus.js","webpack:///./node_modules/reakit-utils/es/closest.js","webpack:///./node_modules/reakit-utils/es/useIsomorphicEffect.js","webpack:///./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js","webpack:///./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js","webpack:///./node_modules/reakit-system/es/useCreateElement.js","webpack:///./node_modules/reakit-warning/es/useWarning.js","webpack:///./node_modules/reakit-utils/es/getActiveElement.js","webpack:///./node_modules/reakit-utils/es/hasFocusWithin.js","webpack:///./node_modules/reakit-utils/es/isObject.js","webpack:///./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js","webpack:///./node_modules/reakit/es/Role/Role.js","webpack:///./node_modules/reakit/es/__keys-e6a5cfbe.js","webpack:///./node_modules/reakit/es/Disclosure/DisclosureContent.js","webpack:///./node_modules/reakit/es/Portal/Portal.js","webpack:///./node_modules/reakit/es/MenuContext-6af6cf92.js","webpack:///./node_modules/reakit/es/DialogBackdropContext-8775f78b.js","webpack:///./node_modules/reakit/es/__keys-ed7b48af.js","webpack:///./node_modules/reakit/es/Dialog/Dialog.js","webpack:///./node_modules/reakit-utils/es/getWindow.js","webpack:///./node_modules/reakit-utils/es/removeIndexFromArray.js","webpack:///./node_modules/reakit-warning/es/warning.js","webpack:///./node_modules/reakit-utils/es/useUpdateEffect.js","webpack:///./node_modules/reakit-utils/es/isEmpty.js","webpack:///./node_modules/reakit-utils/es/getNextActiveElementOnBlur.js","webpack:///./node_modules/reakit-utils/es/useForkRef.js","webpack:///./node_modules/reakit-utils/es/removeItemFromArray.js","webpack:///./node_modules/reakit-utils/es/useLiveRef.js","webpack:///./node_modules/reakit-utils/es/splitProps.js","webpack:///./node_modules/reakit-utils/es/normalizePropsAreEqual.js","webpack:///./node_modules/reakit-system/es/createComponent.js","webpack:///./node_modules/reakit-utils/es/toArray.js","webpack:///./node_modules/reakit-utils/es/isSelfTarget.js","webpack:///./node_modules/reakit-utils/es/tabbable.js","webpack:///./node_modules/reakit-utils/es/getDocument.js","webpack:///./node_modules/reakit-system/es/useToken.js","webpack:///./node_modules/reakit-system/es/createHook.js","webpack:///./node_modules/reakit-system/es/useOptions.js","webpack:///./node_modules/reakit-system/es/useProps.js","webpack:///./node_modules/reakit-utils/es/shallowEqual.js","webpack:///./node_modules/reakit-utils/es/contains.js"],"names":["canUseDOM","_window","Boolean","document","createElement","checkIsBrowser","isPlainObject","arg","_proto$constructor","proto","Object","getPrototypeOf","constructor","toString","hasPassiveEvents","window","passiveTestOptions","addEventListener","removeEventListener","isIosDevice","navigator","platform","test","maxTouchPoints","locks","documentListenerAdded","initialClientY","previousBodyOverflowSetting","previousBodyPaddingRight","allowTouchMove","el","some","lock","options","preventDefault","rawEvent","e","event","target","touches","length","restoreOverflowSetting","undefined","body","style","paddingRight","overflow","disableBodyScroll","targetElement","concat","arr","Array","isArray","i","arr2","from","_toConsumableArray","ontouchstart","targetTouches","clientY","ontouchmove","scrollTop","scrollHeight","clientHeight","isTargetElementTotallyScrolled","stopPropagation","handleScroll","passive","_reserveScrollBarGap","reserveScrollBarGap","scrollBarGap","innerWidth","documentElement","clientWidth","setOverflowHidden","console","error","clearAllBodyScrollLocks","forEach","enableBodyScroll","filter","useSealedState","initialState","buttonInputTypes","isButton","element","tagName","input","indexOf","type","useDisclosureState","_useSealedState","_useSealedState$visib","visible","initialVisible","_useSealedState$anima","animated","initialAnimated","id","initialBaseId","baseId","generateId","idCountRef","_React$useState","setBaseId","unstable_idCountRef","unstable_useIdState","setVisible","_React$useState2","setAnimated","_React$useState3","animating","setAnimating","lastVisible","value","lastValue","useIsomorphicEffect","current","useLastValue","visibleHasChanged","timeout","setTimeout","clearTimeout","show","hide","toggle","v","stopAnimation","useDialogState","_useSealedState$modal","modal","initialModal","disclosure","setModal","disclosureRef","unstable_disclosureRef","matches","selectors","msMatchesSelector","webkitMatchesSelector","hasFocus","activeElement","getActiveElement","activeDescendant","getAttribute","ensureFocus","_temp","_ref","preventScroll","_ref$isActive","isActive","focus","requestAnimationFrame","closest","parentElement","parentNode","nodeType","_defineProperty","obj","key","defineProperty","enumerable","configurable","writable","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","push","apply","_objectSpread2","arguments","source","getOwnPropertyDescriptors","defineProperties","_objectWithoutPropertiesLoose","excluded","sourceKeys","useCreateElement","props","children","context","isRenderProp","useWarning","condition","_len","messages","_key","nodeName","hasFocusWithin","querySelector","isObject","_arrayLikeToArray","len","_createForOfIteratorHelperLoose","o","allowArrayLike","it","Symbol","iterator","minLen","n","prototype","call","slice","name","_unsupportedIterableToArray","done","TypeError","next","bind","useRole","createHook","propsAreEqual","prev","prevSystem","unstable_system","prevProps","nextSystem","nextProps","shallowEqual","DISCLOSURE_CONTENT_KEYS","createComponent","as","useHook","useDisclosureContent","compose","useProps","htmlOnTransitionEnd","onTransitionEnd","htmlOnAnimationEnd","onAnimationEnd","htmlStyle","htmlProps","transition","setTransition","hidden","display","onTransitionEndRef","useLiveRef","onAnimationEndRef","raf","cancelAnimationFrame","onEnd","_options$stopAnimatio","isSelfTarget","_onTransitionEndRef$c","_onAnimationEndRef$cu","getBodyElement","PortalContext","Portal","hostNode","className","__className","appendChild","removeChild","Provider","__selector","MenuContext","DialogBackdropContext","DIALOG_STATE_KEYS","DIALOG_KEYS","removeFromDOM","useFocusTrap","dialogRef","visibleModals","portalRef","dialog","usePortalRef","shouldTrap","beforeElement","afterElement","portal","getDocument","tabIndex","position","setAttribute","cloneNode","insertAdjacentElement","before","after","handleFocus","tabbable","useFocusOnHide","shouldFocus","unstable_autoFocusOnHide","useUpdateEffect","_options$unstable_fin","contains","hidByFocusingAnotherElement","finalFocusEl","unstable_finalFocusRef","compositeElement","DialogContext","useEventListenerOutside","containerRef","nestedDialogs","eventType","listener","shouldListen","capture","listenerRef","onEvent","container","isInDocument","isDisclosure","_element$classList","classList","isFocusTrap","backdrop","dialogContains","useHideOnClickOutside","mouseDownRef","hideOnClickOutside","onMouseDown","useMouseDownRef","_options$hide","_options$hide2","isActualElement","useDialog","useOptions","_ref$modal","_ref$hideOnEsc","hideOnEsc","_ref$hideOnClickOutsi","_ref$preventBodyScrol","preventBodyScroll","_ref$unstable_autoFoc","unstable_autoFocusOnShow","_ref$unstable_autoFoc2","unstable_orphan","_ref2","htmlRef","ref","htmlOnKeyDown","onKeyDown","htmlOnBlur","onBlur","htmlWrapElement","wrapElement","hasBackdrop","onFocus","_options$unstable_dis","currentTarget","useDisclosureRef","onKeyDownRef","onBlurRef","focusOnBlur","_React$useReducer","blurred","scheduleFocus","getNextActiveElementOnBlur","useFocusOnBlur","_useNestedDialogs","dialogs","setDialogs","setVisibleModals","addDialog","_context$addDialog","prevDialogs","removeDialog","_context$removeDialog","removeItemFromArray","showDialog","_context$showDialog","hideDialog","_context$hideDialog","_context$addDialog2","_context$removeDialog2","_context$showDialog2","_context$hideDialog2","providerValue","wrap","useNestedDialogs","targetRef","shouldPrevent","usePreventBodyScroll","observer","MutationObserver","mutations","isEmpty","observe","childList","subtree","disconnect","useFocusOnChildUnmount","initialFocusRef","unstable_initialFocusRef","child","useFocusOnShow","useEvent","useDisableHoverOutside","_onKeyDownRef$current","defaultPrevented","_onBlurRef$current","useForkRef","role","Dialog","getWindow","defaultView","removeIndexFromArray","array","index","warning","effect","deps","mounted","isIE11","relatedTarget","setRef","refA","refB","item","__deprecatedSplitProps","picked","omitted","_i","_propsKeys","splitProps","state","_deprecatedSplitProp","restPicked","normalizePropsAreEqual","component","shouldMemo","memo","_ref$propsAreEqual","unstable_propsAreEqual","_ref$keys","__keys","_ref$useCreateElement","useCreateElement$1","Comp","_ref2$as","_as$render","_splitProps","_options","_useHook","elementProps","asKeys","render","asOptions","allProps","_element","toArray","selector","isFocusable","htmlElement","offsetWidth","offsetHeight","getClientRects","isVisible","isTabbable","parseInt","hasNegativeTabIndex","getAllFocusableIn","allFocusable","querySelectorAll","unshift","getFirstFocusableIn","getAllTabbableIn","fallbackToFocusable","allTabbable","getFirstTabbableIn","getLastTabbableIn","getNextTabbableIn","find","getPreviousTabbableIn","reverse","getClosestFocusable","ownerDocument","useToken","token","defaultValue","SystemContext","_options$useState","_composedHooks$","composedHooks","__useOptions","hookOptions","hookName","_step","_iterator","unstable_ignoreUseOptions","useComposeOptions","useComposeProps","_step2","_iterator2","hook","finalHTMLProps","definedHTMLProps","prop","composedKeys","reduce","useState","objA","objB","aKeys","bKeys","_aKeys","parent"],"mappings":"0HAAA,iEAkBA,IAAIA,EAfJ,WACE,IAAIC,EAAU,cAEd,OAAOC,QAA2B,qBAAZD,GAA2BA,EAAQE,UAAYF,EAAQE,SAASC,eAYxEC,I,oCClBhB,qEAQA,SAASC,EAAcC,GACrB,IAAIC,EAEJ,IAAK,mBAASD,GAAM,OAAO,EAC3B,IAAIE,EAAQC,OAAOC,eAAeJ,GAClC,OAAa,MAATE,IACiD,QAA5CD,EAAqBC,EAAMG,mBAAgD,IAAvBJ,OAAgC,EAASA,EAAmBK,cAAgBH,OAAOG,a,oCCdlJ,kKAOA,IAAIC,GAAmB,EACvB,GAAsB,qBAAXC,OAAwB,CACjC,IAAIC,EAAqB,CACvB,cACEF,GAAmB,IAIvBC,OAAOE,iBAAiB,cAAe,KAAMD,GAC7CD,OAAOG,oBAAoB,cAAe,KAAMF,GAGlD,IAAIG,EAAgC,qBAAXJ,QAA0BA,OAAOK,W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,GAEtD,OADArU,EAAKK,KAAKC,MAAMN,EAAMqU,EAAK3D,QAAU,IAC9B1Q,IACN,IAWH,OATA6D,EAAQ6M,OAAS,GAAGhY,OAAO+b,GAA0D,QAA1CjB,EAAoB9b,EAAQid,gBAA4C,IAAtBnB,OAA+B,EAASA,EAAkB9C,SAAW,GAAIhZ,EAAQsI,MAAQ,IACtL6D,EAAQ2M,uBAAyB9Y,EAAQwL,gBAA2D,QAAxCuQ,EAAkBC,EAAc,UAAoC,IAApBD,OAA6B,EAASA,EAAgBjD,yBAA2B/M,EAAA,aAQtLI,I,kCGxHT,SAASJ,EAAamR,EAAMC,GAC1B,GAAID,IAASC,EAAM,OAAO,EAC1B,IAAKD,EAAM,OAAO,EAClB,IAAKC,EAAM,OAAO,EAClB,GAAoB,kBAATD,EAAmB,OAAO,EACrC,GAAoB,kBAATC,EAAmB,OAAO,EACrC,IAAIC,EAAQ3e,OAAO6J,KAAK4U,GACpBG,EAAQ5e,OAAO6J,KAAK6U,GACpB5c,EAAS6c,EAAM7c,OACnB,GAAI8c,EAAM9c,SAAWA,EAAQ,OAAO,EAEpC,IAAK,IAAI4X,EAAK,EAAGmF,EAASF,EAAOjF,EAAKmF,EAAO/c,OAAQ4X,IAAM,CACzD,IAAIrQ,EAAMwV,EAAOnF,GAEjB,GAAI+E,EAAKpV,KAASqV,EAAKrV,GACrB,OAAO,EAIX,OAAO,EA9BT,qD,kCCSA,SAASqI,EAASoN,EAAQhH,GACxB,OAAOgH,IAAWhH,GAASgH,EAAOpN,SAASoG,GAV7C","file":"static/js/64.3e419639.chunk.js","sourcesContent":["import './getDocument.js';\nimport { getWindow } from './getWindow.js';\n\nfunction checkIsBrowser() {\n  var _window = getWindow();\n\n  return Boolean(typeof _window !== \"undefined\" && _window.document && _window.document.createElement);\n}\n/**\n * It's `true` if it is running in a browser environment or `false` if it is not (SSR).\n *\n * @example\n * import { canUseDOM } from \"reakit-utils\";\n *\n * const title = canUseDOM ? document.title : \"\";\n */\n\n\nvar canUseDOM = checkIsBrowser();\n\nexport { canUseDOM };\n","import { isObject } from './isObject.js';\n\n/**\n * Checks whether `arg` is a plain object or not.\n *\n * @returns {boolean}\n */\n\nfunction isPlainObject(arg) {\n  var _proto$constructor;\n\n  if (!isObject(arg)) return false;\n  var proto = Object.getPrototypeOf(arg);\n  if (proto == null) return true;\n  return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString();\n}\n\nexport { isPlainObject };\n","function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n// Older browsers don't support event options, feature detect it.\n\n// Adopted and modified solution from Bohdan Didukh (2017)\n// https://stackoverflow.com/questions/41594997/ios-10-safari-prevent-scrolling-behind-a-fixed-overlay-and-maintain-scroll-posi\n\nvar hasPassiveEvents = false;\nif (typeof window !== 'undefined') {\n  var passiveTestOptions = {\n    get passive() {\n      hasPassiveEvents = true;\n      return undefined;\n    }\n  };\n  window.addEventListener('testPassive', null, passiveTestOptions);\n  window.removeEventListener('testPassive', null, passiveTestOptions);\n}\n\nvar isIosDevice = typeof window !== 'undefined' && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1);\n\n\nvar locks = [];\nvar documentListenerAdded = false;\nvar initialClientY = -1;\nvar previousBodyOverflowSetting = void 0;\nvar previousBodyPaddingRight = void 0;\n\n// returns true if `el` should be allowed to receive touchmove events.\nvar allowTouchMove = function allowTouchMove(el) {\n  return locks.some(function (lock) {\n    if (lock.options.allowTouchMove && lock.options.allowTouchMove(el)) {\n      return true;\n    }\n\n    return false;\n  });\n};\n\nvar preventDefault = function preventDefault(rawEvent) {\n  var e = rawEvent || window.event;\n\n  // For the case whereby consumers adds a touchmove event listener to document.\n  // Recall that we do document.addEventListener('touchmove', preventDefault, { passive: false })\n  // in disableBodyScroll - so if we provide this opportunity to allowTouchMove, then\n  // the touchmove event on document will break.\n  if (allowTouchMove(e.target)) {\n    return true;\n  }\n\n  // Do not prevent if the event has more than one touch (usually meaning this is a multi touch gesture like pinch to zoom).\n  if (e.touches.length > 1) return true;\n\n  if (e.preventDefault) e.preventDefault();\n\n  return false;\n};\n\nvar setOverflowHidden = function setOverflowHidden(options) {\n  // If previousBodyPaddingRight is already set, don't set it again.\n  if (previousBodyPaddingRight === undefined) {\n    var _reserveScrollBarGap = !!options && options.reserveScrollBarGap === true;\n    var scrollBarGap = window.innerWidth - document.documentElement.clientWidth;\n\n    if (_reserveScrollBarGap && scrollBarGap > 0) {\n      previousBodyPaddingRight = document.body.style.paddingRight;\n      document.body.style.paddingRight = scrollBarGap + 'px';\n    }\n  }\n\n  // If previousBodyOverflowSetting is already set, don't set it again.\n  if (previousBodyOverflowSetting === undefined) {\n    previousBodyOverflowSetting = document.body.style.overflow;\n    document.body.style.overflow = 'hidden';\n  }\n};\n\nvar restoreOverflowSetting = function restoreOverflowSetting() {\n  if (previousBodyPaddingRight !== undefined) {\n    document.body.style.paddingRight = previousBodyPaddingRight;\n\n    // Restore previousBodyPaddingRight to undefined so setOverflowHidden knows it\n    // can be set again.\n    previousBodyPaddingRight = undefined;\n  }\n\n  if (previousBodyOverflowSetting !== undefined) {\n    document.body.style.overflow = previousBodyOverflowSetting;\n\n    // Restore previousBodyOverflowSetting to undefined\n    // so setOverflowHidden knows it can be set again.\n    previousBodyOverflowSetting = undefined;\n  }\n};\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions\nvar isTargetElementTotallyScrolled = function isTargetElementTotallyScrolled(targetElement) {\n  return targetElement ? targetElement.scrollHeight - targetElement.scrollTop <= targetElement.clientHeight : false;\n};\n\nvar handleScroll = function handleScroll(event, targetElement) {\n  var clientY = event.targetTouches[0].clientY - initialClientY;\n\n  if (allowTouchMove(event.target)) {\n    return false;\n  }\n\n  if (targetElement && targetElement.scrollTop === 0 && clientY > 0) {\n    // element is at the top of its scroll.\n    return preventDefault(event);\n  }\n\n  if (isTargetElementTotallyScrolled(targetElement) && clientY < 0) {\n    // element is at the bottom of its scroll.\n    return preventDefault(event);\n  }\n\n  event.stopPropagation();\n  return true;\n};\n\nexport var disableBodyScroll = function disableBodyScroll(targetElement, options) {\n  // targetElement must be provided\n  if (!targetElement) {\n    // eslint-disable-next-line no-console\n    console.error('disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.');\n    return;\n  }\n\n  // disableBodyScroll must not have been called on this targetElement before\n  if (locks.some(function (lock) {\n    return lock.targetElement === targetElement;\n  })) {\n    return;\n  }\n\n  var lock = {\n    targetElement: targetElement,\n    options: options || {}\n  };\n\n  locks = [].concat(_toConsumableArray(locks), [lock]);\n\n  if (isIosDevice) {\n    targetElement.ontouchstart = function (event) {\n      if (event.targetTouches.length === 1) {\n        // detect single touch.\n        initialClientY = event.targetTouches[0].clientY;\n      }\n    };\n    targetElement.ontouchmove = function (event) {\n      if (event.targetTouches.length === 1) {\n        // detect single touch.\n        handleScroll(event, targetElement);\n      }\n    };\n\n    if (!documentListenerAdded) {\n      document.addEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);\n      documentListenerAdded = true;\n    }\n  } else {\n    setOverflowHidden(options);\n  }\n};\n\nexport var clearAllBodyScrollLocks = function clearAllBodyScrollLocks() {\n  if (isIosDevice) {\n    // Clear all locks ontouchstart/ontouchmove handlers, and the references.\n    locks.forEach(function (lock) {\n      lock.targetElement.ontouchstart = null;\n      lock.targetElement.ontouchmove = null;\n    });\n\n    if (documentListenerAdded) {\n      document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);\n      documentListenerAdded = false;\n    }\n\n    // Reset initial clientY.\n    initialClientY = -1;\n  } else {\n    restoreOverflowSetting();\n  }\n\n  locks = [];\n};\n\nexport var enableBodyScroll = function enableBodyScroll(targetElement) {\n  if (!targetElement) {\n    // eslint-disable-next-line no-console\n    console.error('enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.');\n    return;\n  }\n\n  locks = locks.filter(function (lock) {\n    return lock.targetElement !== targetElement;\n  });\n\n  if (isIosDevice) {\n    targetElement.ontouchstart = null;\n    targetElement.ontouchmove = null;\n\n    if (documentListenerAdded && locks.length === 0) {\n      document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);\n      documentListenerAdded = false;\n    }\n  } else if (!locks.length) {\n    restoreOverflowSetting();\n  }\n};\n\n","import { useState } from 'react';\n\n/**\n * React custom hook that returns the very first value passed to `initialState`,\n * even if it changes between re-renders.\n */\nfunction useSealedState(initialState) {\n  var _React$useState = useState(initialState),\n      sealed = _React$useState[0];\n\n  return sealed;\n}\n\nexport { useSealedState };\n","var buttonInputTypes = [\"button\", \"color\", \"file\", \"image\", \"reset\", \"submit\"];\n/**\n * Checks whether `element` is a native HTML button element.\n *\n * @example\n * import { isButton } from \"reakit-utils\";\n *\n * isButton(document.querySelector(\"button\")); // true\n * isButton(document.querySelector(\"input[type='button']\")); // true\n * isButton(document.querySelector(\"div\")); // false\n * isButton(document.querySelector(\"input[type='text']\")); // false\n * isButton(document.querySelector(\"div[role='button']\")); // false\n *\n * @returns {boolean}\n */\n\nfunction isButton(element) {\n  if (element.tagName === \"BUTTON\") return true;\n\n  if (element.tagName === \"INPUT\") {\n    var input = element;\n    return buttonInputTypes.indexOf(input.type) !== -1;\n  }\n\n  return false;\n}\n\nexport { isButton };\n","import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport { useState, useEffect, useCallback, useRef } from 'react';\nimport { warning } from 'reakit-warning';\nimport { useIsomorphicEffect } from 'reakit-utils/useIsomorphicEffect';\nimport { useSealedState } from 'reakit-utils/useSealedState';\nimport '../Id/IdProvider.js';\nimport { unstable_useIdState } from '../Id/IdState.js';\n\nfunction useLastValue(value) {\n  var lastValue = useRef(null);\n  useIsomorphicEffect(function () {\n    lastValue.current = value;\n  }, [value]);\n  return lastValue;\n}\n\nfunction useDisclosureState(initialState) {\n  if (initialState === void 0) {\n    initialState = {};\n  }\n\n  var _useSealedState = useSealedState(initialState),\n      _useSealedState$visib = _useSealedState.visible,\n      initialVisible = _useSealedState$visib === void 0 ? false : _useSealedState$visib,\n      _useSealedState$anima = _useSealedState.animated,\n      initialAnimated = _useSealedState$anima === void 0 ? false : _useSealedState$anima,\n      sealed = _objectWithoutPropertiesLoose(_useSealedState, [\"visible\", \"animated\"]);\n\n  var id = unstable_useIdState(sealed);\n\n  var _React$useState = useState(initialVisible),\n      visible = _React$useState[0],\n      setVisible = _React$useState[1];\n\n  var _React$useState2 = useState(initialAnimated),\n      animated = _React$useState2[0],\n      setAnimated = _React$useState2[1];\n\n  var _React$useState3 = useState(false),\n      animating = _React$useState3[0],\n      setAnimating = _React$useState3[1];\n\n  var lastVisible = useLastValue(visible);\n  var visibleHasChanged = lastVisible.current != null && lastVisible.current !== visible;\n\n  if (animated && !animating && visibleHasChanged) {\n    // Sets animating to true when when visible is updated\n    setAnimating(true);\n  }\n\n  useEffect(function () {\n    if (typeof animated === \"number\" && animating) {\n      var timeout = setTimeout(function () {\n        return setAnimating(false);\n      }, animated);\n      return function () {\n        clearTimeout(timeout);\n      };\n    }\n\n    if (animated && animating && process.env.NODE_ENV === \"development\") {\n      var _timeout = setTimeout(function () {\n        process.env.NODE_ENV !== \"production\" ? warning(animating, \"It's been 8 seconds but stopAnimation has not been called. Does the disclousure element have a CSS transition?\") : void 0;\n      }, 8000);\n\n      return function () {\n        clearTimeout(_timeout);\n      };\n    }\n\n    return function () {};\n  }, [animated, animating]);\n  var show = useCallback(function () {\n    return setVisible(true);\n  }, []);\n  var hide = useCallback(function () {\n    return setVisible(false);\n  }, []);\n  var toggle = useCallback(function () {\n    return setVisible(function (v) {\n      return !v;\n    });\n  }, []);\n  var stopAnimation = useCallback(function () {\n    return setAnimating(false);\n  }, []);\n  return _objectSpread2(_objectSpread2({}, id), {}, {\n    visible: visible,\n    animated: animated,\n    animating: animating,\n    show: show,\n    hide: hide,\n    toggle: toggle,\n    setVisible: setVisible,\n    setAnimated: setAnimated,\n    stopAnimation: stopAnimation\n  });\n}\n\nexport { useDisclosureState };\n","import { useContext, useRef, useState } from 'react';\nimport { useSealedState } from 'reakit-utils/useSealedState';\nimport { unstable_IdContext } from './IdProvider.js';\n\nfunction unstable_useIdState(initialState) {\n  if (initialState === void 0) {\n    initialState = {};\n  }\n\n  var _useSealedState = useSealedState(initialState),\n      initialBaseId = _useSealedState.baseId;\n\n  var generateId = useContext(unstable_IdContext);\n  var idCountRef = useRef(0);\n\n  var _React$useState = useState(function () {\n    return initialBaseId || generateId();\n  }),\n      baseId = _React$useState[0],\n      setBaseId = _React$useState[1];\n\n  return {\n    baseId: baseId,\n    setBaseId: setBaseId,\n    unstable_idCountRef: idCountRef\n  };\n}\n\nexport { unstable_useIdState };\n","import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport { useState, useRef } from 'react';\nimport 'reakit-warning';\nimport 'reakit-utils/useIsomorphicEffect';\nimport { useSealedState } from 'reakit-utils/useSealedState';\nimport '../Id/IdProvider.js';\nimport '../Id/IdState.js';\nimport { useDisclosureState } from '../Disclosure/DisclosureState.js';\n\nfunction useDialogState(initialState) {\n  if (initialState === void 0) {\n    initialState = {};\n  }\n\n  var _useSealedState = useSealedState(initialState),\n      _useSealedState$modal = _useSealedState.modal,\n      initialModal = _useSealedState$modal === void 0 ? true : _useSealedState$modal,\n      sealed = _objectWithoutPropertiesLoose(_useSealedState, [\"modal\"]);\n\n  var disclosure = useDisclosureState(sealed);\n\n  var _React$useState = useState(initialModal),\n      modal = _React$useState[0],\n      setModal = _React$useState[1];\n\n  var disclosureRef = useRef(null);\n  return _objectSpread2(_objectSpread2({}, disclosure), {}, {\n    modal: modal,\n    setModal: setModal,\n    unstable_disclosureRef: disclosureRef\n  });\n}\n\nexport { useDialogState };\n","/**\n * Ponyfill for `Element.prototype.matches`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\n */\nfunction matches(element, selectors) {\n  if (\"matches\" in element) {\n    return element.matches(selectors);\n  }\n\n  if (\"msMatchesSelector\" in element) {\n    return element.msMatchesSelector(selectors);\n  }\n\n  return element.webkitMatchesSelector(selectors);\n}\n\nexport { matches };\n","import './getDocument.js';\nimport { getActiveElement } from './getActiveElement.js';\n\n/**\n * Checks if `element` has focus. Elements that are referenced by\n * `aria-activedescendant` are also considered.\n *\n * @example\n * import { hasFocus } from \"reakit-utils\";\n *\n * hasFocus(document.getElementById(\"id\"));\n */\n\nfunction hasFocus(element) {\n  var activeElement = getActiveElement(element);\n  if (!activeElement) return false;\n  if (activeElement === element) return true;\n  var activeDescendant = activeElement.getAttribute(\"aria-activedescendant\");\n  if (!activeDescendant) return false;\n  return activeDescendant === element.id;\n}\n\nexport { hasFocus };\n","import './getDocument.js';\nimport './getActiveElement.js';\nimport { hasFocus } from './hasFocus.js';\n\n/**\n * Ensures `element` will receive focus if it's not already.\n *\n * @example\n * import { ensureFocus } from \"reakit-utils\";\n *\n * ensureFocus(document.activeElement); // does nothing\n *\n * const element = document.querySelector(\"input\");\n *\n * ensureFocus(element); // focuses element\n * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump\n *\n * function isActive(el) {\n *   return el.dataset.active === \"true\";\n * }\n *\n * ensureFocus(document.querySelector(\"[data-active='true']\"), { isActive }); // does nothing\n *\n * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed.\n */\nfunction ensureFocus(element, _temp) {\n  var _ref = _temp === void 0 ? {} : _temp,\n      preventScroll = _ref.preventScroll,\n      _ref$isActive = _ref.isActive,\n      isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive;\n\n  if (isActive(element)) return -1;\n  element.focus({\n    preventScroll: preventScroll\n  });\n  if (isActive(element)) return -1;\n  return requestAnimationFrame(function () {\n    element.focus({\n      preventScroll: preventScroll\n    });\n  });\n}\n\nexport { ensureFocus };\n","import { matches } from './matches.js';\n\n/**\n * Ponyfill for `Element.prototype.closest`\n *\n * @example\n * import { closest } from \"reakit-utils\";\n *\n * closest(document.getElementById(\"id\"), \"div\");\n * // same as\n * document.getElementById(\"id\").closest(\"div\");\n */\nfunction closest(element, selectors) {\n  if (\"closest\" in element) return element.closest(selectors);\n\n  do {\n    if (matches(element, selectors)) return element;\n    element = element.parentElement || element.parentNode;\n  } while (element !== null && element.nodeType === 1);\n\n  return null;\n}\n\nexport { closest };\n","import { useEffect, useLayoutEffect } from 'react';\nimport './getDocument.js';\nimport './getWindow.js';\nimport { canUseDOM } from './canUseDOM.js';\n\n/**\n * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side\n * rendering.\n */\n\nvar useIsomorphicEffect = !canUseDOM ? useEffect : useLayoutEffect;\n\nexport { useIsomorphicEffect };\n","function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n  var keys = Object.keys(object);\n\n  if (Object.getOwnPropertySymbols) {\n    var symbols = Object.getOwnPropertySymbols(object);\n    if (enumerableOnly) symbols = symbols.filter(function (sym) {\n      return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n    });\n    keys.push.apply(keys, symbols);\n  }\n\n  return keys;\n}\n\nfunction _objectSpread2(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i] != null ? arguments[i] : {};\n\n    if (i % 2) {\n      ownKeys(Object(source), true).forEach(function (key) {\n        _defineProperty(target, key, source[key]);\n      });\n    } else if (Object.getOwnPropertyDescriptors) {\n      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n    } else {\n      ownKeys(Object(source)).forEach(function (key) {\n        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n      });\n    }\n  }\n\n  return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n  if (source == null) return {};\n  var target = {};\n  var sourceKeys = Object.keys(source);\n  var key, i;\n\n  for (i = 0; i < sourceKeys.length; i++) {\n    key = sourceKeys[i];\n    if (excluded.indexOf(key) >= 0) continue;\n    target[key] = source[key];\n  }\n\n  return target;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n  return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n  var it;\n\n  if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n    if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n      if (it) o = it;\n      var i = 0;\n      return function () {\n        if (i >= o.length) return {\n          done: true\n        };\n        return {\n          done: false,\n          value: o[i++]\n        };\n      };\n    }\n\n    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  }\n\n  it = o[Symbol.iterator]();\n  return it.next.bind(it);\n}\n\nexport { _objectWithoutPropertiesLoose as _, _objectSpread2 as a, _createForOfIteratorHelperLoose as b };\n","function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n  var keys = Object.keys(object);\n\n  if (Object.getOwnPropertySymbols) {\n    var symbols = Object.getOwnPropertySymbols(object);\n    if (enumerableOnly) symbols = symbols.filter(function (sym) {\n      return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n    });\n    keys.push.apply(keys, symbols);\n  }\n\n  return keys;\n}\n\nfunction _objectSpread2(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i] != null ? arguments[i] : {};\n\n    if (i % 2) {\n      ownKeys(Object(source), true).forEach(function (key) {\n        _defineProperty(target, key, source[key]);\n      });\n    } else if (Object.getOwnPropertyDescriptors) {\n      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n    } else {\n      ownKeys(Object(source)).forEach(function (key) {\n        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n      });\n    }\n  }\n\n  return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n  if (source == null) return {};\n  var target = {};\n  var sourceKeys = Object.keys(source);\n  var key, i;\n\n  for (i = 0; i < sourceKeys.length; i++) {\n    key = sourceKeys[i];\n    if (excluded.indexOf(key) >= 0) continue;\n    target[key] = source[key];\n  }\n\n  return target;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n  return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n  var it;\n\n  if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n    if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n      if (it) o = it;\n      var i = 0;\n      return function () {\n        if (i >= o.length) return {\n          done: true\n        };\n        return {\n          done: false,\n          value: o[i++]\n        };\n      };\n    }\n\n    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  }\n\n  it = o[Symbol.iterator]();\n  return it.next.bind(it);\n}\n\nexport { _objectWithoutPropertiesLoose as _, _objectSpread2 as a, _createForOfIteratorHelperLoose as b };\n","import { useContext, createElement } from 'react';\nimport { SystemContext } from './SystemContext.js';\nimport { a as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-0c84a174.js';\n\nfunction isRenderProp(children) {\n  return typeof children === \"function\";\n}\n\n/**\n * Custom hook that will call `children` if it's a function. If\n * `useCreateElement` has been passed to the context, it'll be used instead.\n *\n * @example\n * import React from \"react\";\n * import { SystemProvider, useCreateElement } from \"reakit-system\";\n *\n * const system = {\n *   useCreateElement(type, props, children = props.children) {\n *     // very similar to what `useCreateElement` does already\n *     if (typeof children === \"function\") {\n *       const { children: _, ...rest } = props;\n *       return children(rest);\n *     }\n *     return React.createElement(type, props, children);\n *   },\n * };\n *\n * function Component(props) {\n *   return useCreateElement(\"div\", props);\n * }\n *\n * function App() {\n *   return (\n *     <SystemProvider unstable_system={system}>\n *       <Component url=\"url\">{({ url }) => <a href={url}>link</a>}</Component>\n *     </SystemProvider>\n *   );\n * }\n */\n\nvar useCreateElement = function useCreateElement(type, props, children) {\n  if (children === void 0) {\n    children = props.children;\n  }\n\n  var context = useContext(SystemContext);\n\n  if (context.useCreateElement) {\n    return context.useCreateElement(type, props, children);\n  }\n\n  if (typeof type === \"string\" && isRenderProp(children)) {\n    var _ = props.children,\n        rest = _objectWithoutPropertiesLoose(props, [\"children\"]);\n\n    return children(rest);\n  }\n\n  return /*#__PURE__*/createElement(type, props, children);\n};\n\nexport { useCreateElement };\n","import 'reakit-utils/flatten';\nimport { warning } from './warning.js';\nimport { useEffect } from 'react';\nimport { isObject } from 'reakit-utils/isObject';\n\nfunction isRefObject(ref) {\n  return isObject(ref) && \"current\" in ref;\n}\n/**\n * Logs `messages` to the console using `console.warn` based on a `condition`.\n * This should be used inside components.\n */\n\n\nfunction useWarning(condition) {\n  for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n    messages[_key - 1] = arguments[_key];\n  }\n\n  if (process.env.NODE_ENV !== \"production\") {\n    useEffect(function () {\n      process.env.NODE_ENV !== \"production\" ? warning.apply(void 0, [condition].concat(messages.map(function (message) {\n        return isRefObject(message) ? message.current : message;\n      }))) : void 0;\n    }, [condition]);\n  }\n}\n\nexport { useWarning };\n","import { getDocument } from './getDocument.js';\n\n/**\n * Returns `element.ownerDocument.activeElement`.\n */\n\nfunction getActiveElement(element) {\n  var _getDocument = getDocument(element),\n      activeElement = _getDocument.activeElement;\n\n  if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) {\n    // In IE11, activeElement might be an empty object if we're interacting\n    // with elements inside of an iframe.\n    return null;\n  }\n\n  return activeElement;\n}\n\nexport { getActiveElement };\n","import './getDocument.js';\nimport { getActiveElement } from './getActiveElement.js';\nimport { contains } from './contains.js';\n\n/**\n * Checks if `element` has focus within. Elements that are referenced by\n * `aria-activedescendant` are also considered.\n *\n * @example\n * import { hasFocusWithin } from \"reakit-utils\";\n *\n * hasFocusWithin(document.getElementById(\"id\"));\n */\n\nfunction hasFocusWithin(element) {\n  var activeElement = getActiveElement(element);\n  if (!activeElement) return false;\n  if (contains(element, activeElement)) return true;\n  var activeDescendant = activeElement.getAttribute(\"aria-activedescendant\");\n  if (!activeDescendant) return false;\n  if (activeDescendant === element.id) return true;\n  return !!element.querySelector(\"#\" + activeDescendant);\n}\n\nexport { hasFocusWithin };\n","/**\n * Checks whether `arg` is an object or not.\n *\n * @returns {boolean}\n */\nfunction isObject(arg) {\n  return typeof arg === \"object\" && arg != null;\n}\n\nexport { isObject };\n","function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n  var keys = Object.keys(object);\n\n  if (Object.getOwnPropertySymbols) {\n    var symbols = Object.getOwnPropertySymbols(object);\n    if (enumerableOnly) symbols = symbols.filter(function (sym) {\n      return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n    });\n    keys.push.apply(keys, symbols);\n  }\n\n  return keys;\n}\n\nfunction _objectSpread2(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i] != null ? arguments[i] : {};\n\n    if (i % 2) {\n      ownKeys(Object(source), true).forEach(function (key) {\n        _defineProperty(target, key, source[key]);\n      });\n    } else if (Object.getOwnPropertyDescriptors) {\n      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n    } else {\n      ownKeys(Object(source)).forEach(function (key) {\n        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n      });\n    }\n  }\n\n  return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n  if (source == null) return {};\n  var target = {};\n  var sourceKeys = Object.keys(source);\n  var key, i;\n\n  for (i = 0; i < sourceKeys.length; i++) {\n    key = sourceKeys[i];\n    if (excluded.indexOf(key) >= 0) continue;\n    target[key] = source[key];\n  }\n\n  return target;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n  return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n  var it;\n\n  if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n    if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n      if (it) o = it;\n      var i = 0;\n      return function () {\n        if (i >= o.length) return {\n          done: true\n        };\n        return {\n          done: false,\n          value: o[i++]\n        };\n      };\n    }\n\n    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  }\n\n  it = o[Symbol.iterator]();\n  return it.next.bind(it);\n}\n\nexport { _objectSpread2 as _, _objectWithoutPropertiesLoose as a, _createForOfIteratorHelperLoose as b };\n","import { _ as _objectWithoutPropertiesLoose } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport { createComponent } from 'reakit-system/createComponent';\nimport { createHook } from 'reakit-system/createHook';\nimport { shallowEqual } from 'reakit-utils/shallowEqual';\n\n// Automatically generated\nvar ROLE_KEYS = [\"unstable_system\"];\n\nvar useRole = createHook({\n  name: \"Role\",\n  keys: ROLE_KEYS,\n  propsAreEqual: function propsAreEqual(prev, next) {\n    var prevSystem = prev.unstable_system,\n        prevProps = _objectWithoutPropertiesLoose(prev, [\"unstable_system\"]);\n\n    var nextSystem = next.unstable_system,\n        nextProps = _objectWithoutPropertiesLoose(next, [\"unstable_system\"]);\n\n    if (prevSystem !== nextSystem && !shallowEqual(prevSystem, nextSystem)) {\n      return false;\n    }\n\n    return shallowEqual(prevProps, nextProps);\n  }\n});\nvar Role = createComponent({\n  as: \"div\",\n  useHook: useRole\n});\n\nexport { Role, useRole };\n","// Automatically generated\nvar DISCLOSURE_STATE_KEYS = [\"baseId\", \"unstable_idCountRef\", \"visible\", \"animated\", \"animating\", \"setBaseId\", \"show\", \"hide\", \"toggle\", \"setVisible\", \"setAnimated\", \"stopAnimation\"];\nvar DISCLOSURE_KEYS = DISCLOSURE_STATE_KEYS;\nvar DISCLOSURE_CONTENT_KEYS = DISCLOSURE_KEYS;\n\nexport { DISCLOSURE_KEYS as D, DISCLOSURE_CONTENT_KEYS as a };\n","import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport { createComponent } from 'reakit-system/createComponent';\nimport { createHook } from 'reakit-system/createHook';\nimport 'reakit-utils/shallowEqual';\nimport { useState, useRef, useEffect, useCallback } from 'react';\nimport { useLiveRef } from 'reakit-utils/useLiveRef';\nimport { isSelfTarget } from 'reakit-utils/isSelfTarget';\nimport { useRole } from '../Role/Role.js';\nimport { a as DISCLOSURE_CONTENT_KEYS } from '../__keys-e6a5cfbe.js';\n\nvar useDisclosureContent = createHook({\n  name: \"DisclosureContent\",\n  compose: useRole,\n  keys: DISCLOSURE_CONTENT_KEYS,\n  useProps: function useProps(options, _ref) {\n    var htmlOnTransitionEnd = _ref.onTransitionEnd,\n        htmlOnAnimationEnd = _ref.onAnimationEnd,\n        htmlStyle = _ref.style,\n        htmlProps = _objectWithoutPropertiesLoose(_ref, [\"onTransitionEnd\", \"onAnimationEnd\", \"style\"]);\n\n    var animating = options.animated && options.animating;\n\n    var _React$useState = useState(null),\n        transition = _React$useState[0],\n        setTransition = _React$useState[1];\n\n    var hidden = !options.visible && !animating;\n    var style = hidden ? _objectSpread2({\n      display: \"none\"\n    }, htmlStyle) : htmlStyle;\n    var onTransitionEndRef = useLiveRef(htmlOnTransitionEnd);\n    var onAnimationEndRef = useLiveRef(htmlOnAnimationEnd);\n    var raf = useRef(0);\n    useEffect(function () {\n      if (!options.animated) return undefined; // Double RAF is needed so the browser has enough time to paint the\n      // default styles before processing the `data-enter` attribute. Otherwise\n      // it wouldn't be considered a transition.\n      // See https://github.com/reakit/reakit/issues/643\n\n      raf.current = window.requestAnimationFrame(function () {\n        raf.current = window.requestAnimationFrame(function () {\n          if (options.visible) {\n            setTransition(\"enter\");\n          } else if (animating) {\n            setTransition(\"leave\");\n          } else {\n            setTransition(null);\n          }\n        });\n      });\n      return function () {\n        return window.cancelAnimationFrame(raf.current);\n      };\n    }, [options.animated, options.visible, animating]);\n    var onEnd = useCallback(function (event) {\n      if (!isSelfTarget(event)) return;\n      if (!animating) return; // Ignores number animated\n\n      if (options.animated === true) {\n        var _options$stopAnimatio;\n\n        (_options$stopAnimatio = options.stopAnimation) === null || _options$stopAnimatio === void 0 ? void 0 : _options$stopAnimatio.call(options);\n      }\n    }, [options.animated, animating, options.stopAnimation]);\n    var onTransitionEnd = useCallback(function (event) {\n      var _onTransitionEndRef$c;\n\n      (_onTransitionEndRef$c = onTransitionEndRef.current) === null || _onTransitionEndRef$c === void 0 ? void 0 : _onTransitionEndRef$c.call(onTransitionEndRef, event);\n      onEnd(event);\n    }, [onEnd]);\n    var onAnimationEnd = useCallback(function (event) {\n      var _onAnimationEndRef$cu;\n\n      (_onAnimationEndRef$cu = onAnimationEndRef.current) === null || _onAnimationEndRef$cu === void 0 ? void 0 : _onAnimationEndRef$cu.call(onAnimationEndRef, event);\n      onEnd(event);\n    }, [onEnd]);\n    return _objectSpread2({\n      id: options.baseId,\n      \"data-enter\": transition === \"enter\" ? \"\" : undefined,\n      \"data-leave\": transition === \"leave\" ? \"\" : undefined,\n      onTransitionEnd: onTransitionEnd,\n      onAnimationEnd: onAnimationEnd,\n      hidden: hidden,\n      style: style\n    }, htmlProps);\n  }\n});\nvar DisclosureContent = createComponent({\n  as: \"div\",\n  useHook: useDisclosureContent\n});\n\nexport { DisclosureContent, useDisclosureContent };\n","import { createContext, useContext, useState, createElement } from 'react';\nimport { useIsomorphicEffect } from 'reakit-utils/useIsomorphicEffect';\nimport { canUseDOM } from 'reakit-utils/canUseDOM';\nimport { createPortal } from 'react-dom';\n\nfunction getBodyElement() {\n  return canUseDOM ? document.body : null;\n}\n\nvar PortalContext = /*#__PURE__*/createContext(getBodyElement());\nfunction Portal(_ref) {\n  var children = _ref.children;\n  // if it's a nested portal, context is the parent portal\n  // otherwise it's document.body\n  // https://github.com/reakit/reakit/issues/513\n  var context = useContext(PortalContext) || getBodyElement();\n\n  var _React$useState = useState(function () {\n    if (canUseDOM) {\n      var element = document.createElement(\"div\");\n      element.className = Portal.__className;\n      return element;\n    } // ssr\n\n\n    return null;\n  }),\n      hostNode = _React$useState[0];\n\n  useIsomorphicEffect(function () {\n    if (!hostNode || !context) return undefined;\n    context.appendChild(hostNode);\n    return function () {\n      context.removeChild(hostNode);\n    };\n  }, [hostNode, context]);\n\n  if (hostNode) {\n    return /*#__PURE__*/createPortal( /*#__PURE__*/createElement(PortalContext.Provider, {\n      value: hostNode\n    }, children), hostNode);\n  } // ssr\n\n\n  return null;\n}\nPortal.__className = \"__reakit-portal\";\nPortal.__selector = \".\" + Portal.__className;\n\nexport { Portal, PortalContext };\n","import { createContext, useContext, useState, useCallback, useEffect, useMemo, createElement } from 'react';\nimport { removeItemFromArray } from 'reakit-utils/removeItemFromArray';\n\nvar MenuContext = /*#__PURE__*/createContext(null);\nfunction useMenuContext(menuRef, role, options) {\n  var orphan = \"unstable_orphan\" in options && options.unstable_orphan;\n  var parent = useContext(MenuContext);\n\n  var _React$useState = useState([]),\n      children = _React$useState[0],\n      setChildren = _React$useState[1];\n\n  var _ref = parent || {},\n      addChildToParent = _ref.addChild,\n      removeChildFromParent = _ref.removeChild;\n\n  var addChild = useCallback(function (ref) {\n    return setChildren(function (refs) {\n      return [].concat(refs, [ref]);\n    });\n  }, []);\n  var removeChild = useCallback(function (ref) {\n    return setChildren(function (refs) {\n      return removeItemFromArray(refs, ref);\n    });\n  }, []); // If it's a nested menu, add it to parent\n\n  useEffect(function () {\n    if (!addChildToParent || orphan) return undefined;\n    addChildToParent(menuRef);\n    return function () {\n      removeChildFromParent === null || removeChildFromParent === void 0 ? void 0 : removeChildFromParent(menuRef);\n    };\n  }, [menuRef, addChildToParent, removeChildFromParent, orphan]);\n  var providerValue = useMemo(function () {\n    return {\n      orientation: options.orientation,\n      next: options.next,\n      previous: options.previous,\n      ref: menuRef,\n      role: role,\n      parent: parent,\n      children: children,\n      addChild: addChild,\n      removeChild: removeChild\n    };\n  }, [options.orientation, options.next, options.previous, menuRef, role, parent, children, addChild, removeChild]);\n  var wrapElement = useCallback(function (element) {\n    return /*#__PURE__*/createElement(MenuContext.Provider, {\n      value: providerValue\n    }, element);\n  }, [providerValue]);\n  return wrapElement;\n}\n\nexport { MenuContext as M, useMenuContext as u };\n","import { createContext } from 'react';\n\nvar DialogBackdropContext = /*#__PURE__*/createContext(undefined);\n\nexport { DialogBackdropContext as D };\n","// Automatically generated\nvar DIALOG_STATE_KEYS = [\"baseId\", \"unstable_idCountRef\", \"visible\", \"animated\", \"animating\", \"setBaseId\", \"show\", \"hide\", \"toggle\", \"setVisible\", \"setAnimated\", \"stopAnimation\", \"modal\", \"unstable_disclosureRef\", \"setModal\"];\nvar DIALOG_KEYS = [].concat(DIALOG_STATE_KEYS, [\"hideOnEsc\", \"hideOnClickOutside\", \"preventBodyScroll\", \"unstable_initialFocusRef\", \"unstable_finalFocusRef\", \"unstable_orphan\", \"unstable_autoFocusOnShow\", \"unstable_autoFocusOnHide\"]);\nvar DIALOG_BACKDROP_KEYS = DIALOG_STATE_KEYS;\nvar DIALOG_DISCLOSURE_KEYS = DIALOG_BACKDROP_KEYS;\n\nexport { DIALOG_KEYS as D, DIALOG_BACKDROP_KEYS as a, DIALOG_DISCLOSURE_KEYS as b };\n","import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from '../_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport { createComponent } from 'reakit-system/createComponent';\nimport { createHook } from 'reakit-system/createHook';\nimport 'reakit-utils/shallowEqual';\nimport { useRef, useEffect, useContext, useState, useCallback, useMemo, createElement, createContext, useReducer } from 'react';\nimport { useForkRef } from 'reakit-utils/useForkRef';\nimport { isButton } from 'reakit-utils/isButton';\nimport { warning, useWarning } from 'reakit-warning';\nimport { useLiveRef } from 'reakit-utils/useLiveRef';\nimport 'reakit-utils/isSelfTarget';\nimport { useIsomorphicEffect } from 'reakit-utils/useIsomorphicEffect';\nimport { hasFocusWithin } from 'reakit-utils/hasFocusWithin';\nimport { getFirstTabbableIn, getLastTabbableIn, isTabbable } from 'reakit-utils/tabbable';\nimport '../Role/Role.js';\nimport { useUpdateEffect } from 'reakit-utils/useUpdateEffect';\nimport { useCreateElement } from 'reakit-system/useCreateElement';\nimport { getDocument } from 'reakit-utils/getDocument';\nimport 'reakit-utils/canUseDOM';\nimport { getNextActiveElementOnBlur } from 'reakit-utils/getNextActiveElementOnBlur';\nimport { ensureFocus } from 'reakit-utils/ensureFocus';\nimport '../__keys-e6a5cfbe.js';\nimport { useDisclosureContent } from '../Disclosure/DisclosureContent.js';\nimport 'react-dom';\nimport { Portal } from '../Portal/Portal.js';\nimport { removeItemFromArray } from 'reakit-utils/removeItemFromArray';\nimport { M as MenuContext } from '../MenuContext-6af6cf92.js';\nimport { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';\nimport { closest } from 'reakit-utils/closest';\nimport { getActiveElement } from 'reakit-utils/getActiveElement';\nimport { contains } from 'reakit-utils/contains';\nimport { D as DialogBackdropContext } from '../DialogBackdropContext-8775f78b.js';\nimport { isEmpty } from 'reakit-utils/isEmpty';\nimport { D as DIALOG_KEYS } from '../__keys-ed7b48af.js';\n\nfunction useDisclosureRef(dialogRef, options) {\n  var ref = useRef(null);\n  var animating = !!(options.animated && options.animating);\n  useEffect(function () {\n    if (options.visible || animating) return undefined; // We get the last focused element before the dialog opens, so we can move\n    // focus back to it when the dialog closes.\n\n    var onFocus = function onFocus(event) {\n      var target = event.target;\n\n      if (\"focus\" in target) {\n        ref.current = target;\n\n        if (options.unstable_disclosureRef) {\n          options.unstable_disclosureRef.current = target;\n        }\n      }\n    };\n\n    var document = getDocument(dialogRef.current);\n    document.addEventListener(\"focusin\", onFocus);\n    return function () {\n      return document.removeEventListener(\"focusin\", onFocus);\n    };\n  }, [options.visible, animating, options.unstable_disclosureRef, dialogRef]);\n  useEffect(function () {\n    var _options$unstable_dis;\n\n    if (!options.visible || animating) return undefined; // Safari and Firefox on MacOS don't focus on buttons on mouse down.\n    // Instead, they focus on the closest focusable parent (ultimately, the\n    // body element). This works around that by preventing that behavior and\n    // forcing focus on the disclosure button. Otherwise, we wouldn't be able\n    // to close the dialog by clicking again on the disclosure.\n\n    var onMouseDown = function onMouseDown(event) {\n      var element = event.currentTarget;\n      if (!isButton(element)) return;\n      event.preventDefault();\n      element.focus();\n    };\n\n    var disclosure = ((_options$unstable_dis = options.unstable_disclosureRef) === null || _options$unstable_dis === void 0 ? void 0 : _options$unstable_dis.current) || ref.current;\n    disclosure === null || disclosure === void 0 ? void 0 : disclosure.addEventListener(\"mousedown\", onMouseDown);\n    return function () {\n      return disclosure === null || disclosure === void 0 ? void 0 : disclosure.removeEventListener(\"mousedown\", onMouseDown);\n    };\n  }, [options.visible, animating, options.unstable_disclosureRef]);\n  return options.unstable_disclosureRef || ref;\n}\n\nfunction usePreventBodyScroll(targetRef, options) {\n  var shouldPrevent = Boolean(options.preventBodyScroll && options.visible);\n  useEffect(function () {\n    var element = targetRef.current;\n    if (!element || !shouldPrevent) return undefined;\n    disableBodyScroll(element, {\n      reserveScrollBarGap: true\n    });\n    return function () {\n      return enableBodyScroll(element);\n    };\n  }, [targetRef, shouldPrevent]);\n}\n\nfunction useFocusOnShow(dialogRef, nestedDialogs, options) {\n  var initialFocusRef = options.unstable_initialFocusRef;\n  var shouldFocus = options.visible && options.unstable_autoFocusOnShow;\n  var animating = !!(options.animated && options.animating);\n  useUpdateEffect(function () {\n    var dialog = dialogRef.current;\n    process.env.NODE_ENV !== \"production\" ? warning(!!shouldFocus && !dialog, \"[reakit/Dialog]\", \"Can't set initial focus on dialog because `ref` wasn't passed to the dialog element.\", \"See https://reakit.io/docs/dialog\") : void 0;\n    if (!shouldFocus) return;\n    if (!dialog) return;\n    if (animating) return; // If there're nested open dialogs, let them handle focus\n\n    if (nestedDialogs.some(function (child) {\n      return child.current && !child.current.hidden;\n    })) {\n      return;\n    }\n\n    if (initialFocusRef !== null && initialFocusRef !== void 0 && initialFocusRef.current) {\n      initialFocusRef.current.focus({\n        preventScroll: true\n      });\n    } else {\n      var tabbable = getFirstTabbableIn(dialog, true);\n\n      var isActive = function isActive() {\n        return hasFocusWithin(dialog);\n      };\n\n      if (tabbable) {\n        ensureFocus(tabbable, {\n          preventScroll: true,\n          isActive: isActive\n        });\n      } else {\n        ensureFocus(dialog, {\n          preventScroll: true,\n          isActive: isActive\n        });\n        process.env.NODE_ENV !== \"production\" ? warning(dialog.tabIndex === undefined || dialog.tabIndex < 0, \"It's recommended to have at least one tabbable element inside dialog. The dialog element has been automatically focused.\", \"If this is the intended behavior, pass `tabIndex={0}` to the dialog element to disable this warning.\", \"See https://reakit.io/docs/dialog/#initial-focus\", dialog) : void 0;\n      }\n    }\n  }, [dialogRef, shouldFocus, animating, nestedDialogs, initialFocusRef]);\n}\n\nfunction usePortalRef(dialogRef, options) {\n  var portalRef = useRef(null);\n  useEffect(function () {\n    var dialog = dialogRef.current;\n    if (!dialog || !options.visible) return;\n    portalRef.current = closest(dialog, Portal.__selector);\n  }, [dialogRef, options.visible]);\n  return portalRef;\n}\n\nfunction removeFromDOM(element) {\n  if (element.parentNode == null) return;\n  element.parentNode.removeChild(element);\n}\n\nvar focusTrapClassName = \"__reakit-focus-trap\";\nfunction isFocusTrap(element) {\n  var _element$classList;\n\n  return (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(focusTrapClassName);\n}\nfunction useFocusTrap(dialogRef, visibleModals, options) {\n  var portalRef = usePortalRef(dialogRef, options);\n  var shouldTrap = options.visible && options.modal;\n  var beforeElement = useRef(null);\n  var afterElement = useRef(null); // Create before and after elements\n  // https://github.com/w3c/aria-practices/issues/545\n\n  useEffect(function () {\n    if (!shouldTrap) return undefined;\n    var portal = portalRef.current;\n\n    if (!portal) {\n      process.env.NODE_ENV !== \"production\" ? warning(true, \"Can't trap focus within modal dialog because either `ref` wasn't passed to component or the component wasn't rendered within a portal\", \"See https://reakit.io/docs/dialog\") : void 0;\n      return undefined;\n    }\n\n    if (!beforeElement.current) {\n      var document = getDocument(portal);\n      beforeElement.current = document.createElement(\"div\");\n      beforeElement.current.className = focusTrapClassName;\n      beforeElement.current.tabIndex = 0;\n      beforeElement.current.style.position = \"fixed\";\n      beforeElement.current.setAttribute(\"aria-hidden\", \"true\");\n    }\n\n    if (!afterElement.current) {\n      afterElement.current = beforeElement.current.cloneNode();\n    }\n\n    portal.insertAdjacentElement(\"beforebegin\", beforeElement.current);\n    portal.insertAdjacentElement(\"afterend\", afterElement.current);\n    return function () {\n      if (beforeElement.current) removeFromDOM(beforeElement.current);\n      if (afterElement.current) removeFromDOM(afterElement.current);\n    };\n  }, [portalRef, shouldTrap]); // Focus trap\n\n  useEffect(function () {\n    var before = beforeElement.current;\n    var after = afterElement.current;\n    if (!shouldTrap || !before || !after) return undefined;\n\n    var handleFocus = function handleFocus(event) {\n      var dialog = dialogRef.current;\n      if (!dialog || visibleModals.length) return;\n      event.preventDefault();\n      var isAfter = event.target === after;\n      var tabbable = isAfter ? getFirstTabbableIn(dialog) : getLastTabbableIn(dialog);\n\n      if (tabbable) {\n        tabbable.focus();\n      } else {\n        // fallback to dialog\n        dialog.focus();\n      }\n    };\n\n    before.addEventListener(\"focus\", handleFocus);\n    after.addEventListener(\"focus\", handleFocus);\n    return function () {\n      before.removeEventListener(\"focus\", handleFocus);\n      after.removeEventListener(\"focus\", handleFocus);\n    };\n  }, [dialogRef, visibleModals, shouldTrap]);\n}\n\nfunction hidByFocusingAnotherElement(dialogRef) {\n  var dialog = dialogRef.current;\n  if (!dialog) return false;\n  var activeElement = getActiveElement(dialog);\n  if (!activeElement) return false;\n  if (contains(dialog, activeElement)) return false;\n  if (isTabbable(activeElement)) return true;\n  if (activeElement.getAttribute(\"data-dialog\") === \"true\") return true;\n  return false;\n}\n\nfunction useFocusOnHide(dialogRef, disclosureRef, options) {\n  var shouldFocus = options.unstable_autoFocusOnHide && !options.visible;\n  var animating = !!(options.animated && options.animating);\n  useUpdateEffect(function () {\n    var _options$unstable_fin;\n\n    if (!shouldFocus) return;\n    if (animating) return; // Hide was triggered by a click/focus on a tabbable element outside\n    // the dialog or on another dialog. We won't change focus then.\n\n    if (hidByFocusingAnotherElement(dialogRef)) {\n      return;\n    }\n\n    var finalFocusEl = ((_options$unstable_fin = options.unstable_finalFocusRef) === null || _options$unstable_fin === void 0 ? void 0 : _options$unstable_fin.current) || disclosureRef.current;\n\n    if (finalFocusEl) {\n      if (finalFocusEl.id) {\n        var document = getDocument(finalFocusEl);\n        var compositeElement = document.querySelector(\"[aria-activedescendant='\" + finalFocusEl.id + \"']\");\n\n        if (compositeElement) {\n          ensureFocus(compositeElement);\n          return;\n        }\n      }\n\n      ensureFocus(finalFocusEl);\n      return;\n    }\n\n    process.env.NODE_ENV !== \"production\" ? warning(true, \"Can't return focus after closing dialog. Either render a disclosure component or provide a `unstable_finalFocusRef` prop.\", \"See https://reakit.io/docs/dialog\", dialogRef.current) : void 0;\n  }, [shouldFocus, animating, dialogRef, disclosureRef]);\n}\n\nvar DialogContext = /*#__PURE__*/createContext({});\nfunction useNestedDialogs(dialogRef, options) {\n  var context = useContext(DialogContext);\n\n  var _React$useState = useState([]),\n      dialogs = _React$useState[0],\n      setDialogs = _React$useState[1];\n\n  var _React$useState2 = useState(dialogs),\n      visibleModals = _React$useState2[0],\n      setVisibleModals = _React$useState2[1];\n\n  var addDialog = useCallback(function (ref) {\n    var _context$addDialog;\n\n    (_context$addDialog = context.addDialog) === null || _context$addDialog === void 0 ? void 0 : _context$addDialog.call(context, ref);\n    setDialogs(function (prevDialogs) {\n      return [].concat(prevDialogs, [ref]);\n    });\n  }, [context.addDialog]);\n  var removeDialog = useCallback(function (ref) {\n    var _context$removeDialog;\n\n    (_context$removeDialog = context.removeDialog) === null || _context$removeDialog === void 0 ? void 0 : _context$removeDialog.call(context, ref);\n    setDialogs(function (prevDialogs) {\n      return removeItemFromArray(prevDialogs, ref);\n    });\n  }, [context.removeDialog]);\n  var showDialog = useCallback(function (ref) {\n    var _context$showDialog;\n\n    (_context$showDialog = context.showDialog) === null || _context$showDialog === void 0 ? void 0 : _context$showDialog.call(context, ref);\n    setVisibleModals(function (prevDialogs) {\n      return [].concat(prevDialogs, [ref]);\n    });\n  }, [context.showDialog]);\n  var hideDialog = useCallback(function (ref) {\n    var _context$hideDialog;\n\n    (_context$hideDialog = context.hideDialog) === null || _context$hideDialog === void 0 ? void 0 : _context$hideDialog.call(context, ref);\n    setVisibleModals(function (prevDialogs) {\n      return removeItemFromArray(prevDialogs, ref);\n    });\n  }, [context.hideDialog]); // If it's a nested dialog, add it to context\n\n  useEffect(function () {\n    var _context$addDialog2;\n\n    if (options.unstable_orphan) return undefined;\n    (_context$addDialog2 = context.addDialog) === null || _context$addDialog2 === void 0 ? void 0 : _context$addDialog2.call(context, dialogRef);\n    return function () {\n      var _context$removeDialog2;\n\n      (_context$removeDialog2 = context.removeDialog) === null || _context$removeDialog2 === void 0 ? void 0 : _context$removeDialog2.call(context, dialogRef);\n    };\n  }, [options.unstable_orphan, context.addDialog, dialogRef, context.removeDialog]);\n  useEffect(function () {\n    var _context$showDialog2;\n\n    if (options.unstable_orphan) return undefined;\n    if (!options.modal) return undefined;\n    if (!options.visible) return undefined;\n    (_context$showDialog2 = context.showDialog) === null || _context$showDialog2 === void 0 ? void 0 : _context$showDialog2.call(context, dialogRef);\n    return function () {\n      var _context$hideDialog2;\n\n      (_context$hideDialog2 = context.hideDialog) === null || _context$hideDialog2 === void 0 ? void 0 : _context$hideDialog2.call(context, dialogRef);\n    };\n  }, [options.unstable_orphan, options.modal, options.visible, context.showDialog, dialogRef, context.hideDialog]); // Close all nested dialogs when parent dialog closes\n\n  useEffect(function () {\n    if (context.visible === false && options.visible && !options.unstable_orphan) {\n      var _options$hide;\n\n      (_options$hide = options.hide) === null || _options$hide === void 0 ? void 0 : _options$hide.call(options);\n    }\n  }, [context.visible, options.visible, options.hide, options.unstable_orphan]); // Provider\n\n  var providerValue = useMemo(function () {\n    return {\n      visible: options.visible,\n      addDialog: addDialog,\n      removeDialog: removeDialog,\n      showDialog: showDialog,\n      hideDialog: hideDialog\n    };\n  }, [options.visible, addDialog, removeDialog, showDialog, hideDialog]);\n  var wrap = useCallback(function (element) {\n    return /*#__PURE__*/createElement(DialogContext.Provider, {\n      value: providerValue\n    }, element);\n  }, [providerValue]);\n  return {\n    dialogs: dialogs,\n    visibleModals: visibleModals,\n    wrap: wrap\n  };\n}\n\nfunction dialogContains(target) {\n  return function (dialogRef) {\n    var dialog = dialogRef.current;\n    if (!dialog) return false;\n    if (contains(dialog, target)) return true;\n    var document = getDocument(dialog);\n    var backdrop = document.querySelector(\"[data-dialog-ref=\\\"\" + dialog.id + \"\\\"]\");\n\n    if (backdrop) {\n      return contains(backdrop, target);\n    }\n\n    return false;\n  };\n}\n\nfunction isDisclosure(target, disclosure) {\n  return contains(disclosure, target);\n}\n\nfunction isInDocument(target) {\n  var document = getDocument(target);\n\n  if (target.tagName === \"HTML\") {\n    return true;\n  }\n\n  return contains(document.body, target);\n}\n\nfunction useEventListenerOutside(containerRef, disclosureRef, nestedDialogs, eventType, listener, shouldListen, capture) {\n  var listenerRef = useLiveRef(listener);\n  useEffect(function () {\n    if (!shouldListen) return undefined;\n\n    var onEvent = function onEvent(event) {\n      if (!listenerRef.current) return;\n      var container = containerRef.current;\n      var disclosure = disclosureRef.current;\n      var target = event.target;\n\n      if (!container) {\n        process.env.NODE_ENV !== \"production\" ? warning(true, \"Can't detect events outside dialog because `ref` wasn't passed to component.\", \"See https://reakit.io/docs/dialog\") : void 0;\n        return;\n      } // When an element is unmounted right after it receives focus, the focus\n      // event is triggered after that, when the element isn't part of the\n      // current document anymore. So we ignore it.\n\n\n      if (!isInDocument(target)) return; // Event inside dialog\n\n      if (contains(container, target)) return; // Event on disclosure\n\n      if (disclosure && isDisclosure(target, disclosure)) return; // Event inside a nested dialog or focus trap\n\n      if (isFocusTrap(target) || nestedDialogs.some(dialogContains(target))) {\n        return;\n      }\n\n      listenerRef.current(event);\n    };\n\n    var document = getDocument(containerRef.current);\n    document.addEventListener(eventType, onEvent, capture);\n    return function () {\n      return document.removeEventListener(eventType, onEvent, capture);\n    };\n  }, [containerRef, disclosureRef, nestedDialogs, eventType, shouldListen, listenerRef]);\n}\n\nfunction useMouseDownRef(dialogRef, options) {\n  var mouseDownRef = useRef();\n  useEffect(function () {\n    if (!options.visible) return undefined;\n    if (!options.hideOnClickOutside) return undefined;\n    var document = getDocument(dialogRef.current);\n\n    var onMouseDown = function onMouseDown(event) {\n      mouseDownRef.current = event.target;\n    };\n\n    document.addEventListener(\"mousedown\", onMouseDown);\n    return function () {\n      return document.removeEventListener(\"mousedown\", onMouseDown);\n    };\n  }, [options.visible, options.hideOnClickOutside, dialogRef]);\n  return mouseDownRef;\n}\n\nfunction useHideOnClickOutside(dialogRef, disclosureRef, nestedDialogs, options) {\n  var mouseDownRef = useMouseDownRef(dialogRef, options);\n  useEventListenerOutside(dialogRef, disclosureRef, nestedDialogs, \"click\", function (event) {\n    // Make sure the element that has been clicked is the same that last\n    // triggered the mousedown event. This prevents the dialog from closing\n    // by dragging the cursor (for example, selecting some text inside the\n    // dialog and releasing the mouse outside of it).\n    if (mouseDownRef.current === event.target) {\n      var _options$hide;\n\n      (_options$hide = options.hide) === null || _options$hide === void 0 ? void 0 : _options$hide.call(options);\n    }\n  }, options.visible && options.hideOnClickOutside);\n  useEventListenerOutside(dialogRef, disclosureRef, nestedDialogs, \"focusin\", function (event) {\n    var document = getDocument(dialogRef.current); // Fix for https://github.com/reakit/reakit/issues/619\n    // On IE11, calling element.blur() triggers the focus event on\n    // document.body, so we make sure to ignore it as well.\n\n    if (event.target !== document && event.target !== document.body) {\n      var _options$hide2;\n\n      (_options$hide2 = options.hide) === null || _options$hide2 === void 0 ? void 0 : _options$hide2.call(options);\n    }\n  }, options.visible && options.hideOnClickOutside);\n}\n\nfunction useDisableHoverOutside(portalRef, nestedDialogs, options) {\n  var useEvent = function useEvent(eventType) {\n    return useEventListenerOutside(portalRef, {\n      current: null\n    }, nestedDialogs, eventType, function (event) {\n      event.stopPropagation();\n      event.preventDefault();\n    }, options.visible && options.modal, true);\n  };\n\n  useEvent(\"mouseover\");\n  useEvent(\"mousemove\");\n  useEvent(\"mouseout\");\n}\n\n/**\n * When the focused child gets removed from the DOM, we make sure to move focus\n * to the dialog.\n */\nfunction useFocusOnChildUnmount(dialogRef, options) {\n  useEffect(function () {\n    var dialog = dialogRef.current;\n    if (!options.visible || !dialog) return undefined;\n    var observer = new MutationObserver(function (mutations) {\n      var target = mutations[0].target; // If target is not this dialog, then this observer was triggered by a\n      // nested dialog, so we just ignore it here and let the nested dialog\n      // handle it there.\n\n      if (target !== dialog) return;\n      var document = getDocument(dialog);\n      var activeElement = getActiveElement(dialog); // We can check if the current focused element is the document body. On\n      // IE 11, it's an empty object when the current document is in a frame or\n      // iframe.\n\n      if (activeElement === document.body || isEmpty(activeElement)) {\n        dialog.focus();\n      }\n    });\n    observer.observe(dialog, {\n      childList: true,\n      subtree: true\n    });\n    return function () {\n      observer.disconnect();\n    };\n  }, [options.visible, dialogRef]);\n}\n\nfunction isActualElement(element) {\n  return element && element.tagName && element.tagName !== \"HTML\" && element !== getDocument(element).body;\n}\n\nfunction useFocusOnBlur(dialogRef, options) {\n  var _React$useReducer = useReducer(function (n) {\n    return n + 1;\n  }, 0),\n      blurred = _React$useReducer[0],\n      scheduleFocus = _React$useReducer[1];\n\n  useIsomorphicEffect(function () {\n    var dialog = dialogRef.current;\n    if (!options.visible) return;\n    if (!blurred) return; // After blur, if the active element isn't an actual element, this probably\n    // means that element.blur() was called on an element inside the dialog.\n    // In this case, the browser will automatically focus the body element.\n    // So we move focus back to the dialog.\n\n    if (!isActualElement(getActiveElement(dialog))) {\n      process.env.NODE_ENV !== \"production\" ? warning(!dialog, \"Can't focus dialog after a nested element got blurred because `ref` wasn't passed to the component\", \"See https://reakit.io/docs/dialog\") : void 0;\n      dialog === null || dialog === void 0 ? void 0 : dialog.focus();\n    }\n  }, [blurred, dialogRef]);\n  var onBlur = useCallback(function (event) {\n    if (!options.visible) return;\n    var nextActiveElement = getNextActiveElementOnBlur(event);\n\n    if (!isActualElement(nextActiveElement)) {\n      scheduleFocus();\n    }\n  }, [options.visible]);\n  return onBlur;\n}\n\nvar useDialog = createHook({\n  name: \"Dialog\",\n  compose: useDisclosureContent,\n  keys: DIALOG_KEYS,\n  useOptions: function useOptions(_ref) {\n    var _ref$modal = _ref.modal,\n        modal = _ref$modal === void 0 ? true : _ref$modal,\n        _ref$hideOnEsc = _ref.hideOnEsc,\n        hideOnEsc = _ref$hideOnEsc === void 0 ? true : _ref$hideOnEsc,\n        _ref$hideOnClickOutsi = _ref.hideOnClickOutside,\n        hideOnClickOutside = _ref$hideOnClickOutsi === void 0 ? true : _ref$hideOnClickOutsi,\n        _ref$preventBodyScrol = _ref.preventBodyScroll,\n        preventBodyScroll = _ref$preventBodyScrol === void 0 ? modal : _ref$preventBodyScrol,\n        _ref$unstable_autoFoc = _ref.unstable_autoFocusOnShow,\n        unstable_autoFocusOnShow = _ref$unstable_autoFoc === void 0 ? true : _ref$unstable_autoFoc,\n        _ref$unstable_autoFoc2 = _ref.unstable_autoFocusOnHide,\n        unstable_autoFocusOnHide = _ref$unstable_autoFoc2 === void 0 ? true : _ref$unstable_autoFoc2,\n        unstable_orphan = _ref.unstable_orphan,\n        options = _objectWithoutPropertiesLoose(_ref, [\"modal\", \"hideOnEsc\", \"hideOnClickOutside\", \"preventBodyScroll\", \"unstable_autoFocusOnShow\", \"unstable_autoFocusOnHide\", \"unstable_orphan\"]);\n\n    return _objectSpread2({\n      modal: modal,\n      hideOnEsc: hideOnEsc,\n      hideOnClickOutside: hideOnClickOutside,\n      preventBodyScroll: modal && preventBodyScroll,\n      unstable_autoFocusOnShow: unstable_autoFocusOnShow,\n      unstable_autoFocusOnHide: unstable_autoFocusOnHide,\n      unstable_orphan: modal && unstable_orphan\n    }, options);\n  },\n  useProps: function useProps(options, _ref2) {\n    var htmlRef = _ref2.ref,\n        htmlOnKeyDown = _ref2.onKeyDown,\n        htmlOnBlur = _ref2.onBlur,\n        htmlWrapElement = _ref2.wrapElement,\n        tabIndex = _ref2.tabIndex,\n        htmlProps = _objectWithoutPropertiesLoose(_ref2, [\"ref\", \"onKeyDown\", \"onBlur\", \"wrapElement\", \"tabIndex\"]);\n\n    var dialog = useRef(null);\n    var backdrop = useContext(DialogBackdropContext);\n    var hasBackdrop = backdrop && backdrop === options.baseId;\n    var disclosure = useDisclosureRef(dialog, options);\n    var onKeyDownRef = useLiveRef(htmlOnKeyDown);\n    var onBlurRef = useLiveRef(htmlOnBlur);\n    var focusOnBlur = useFocusOnBlur(dialog, options);\n\n    var _useNestedDialogs = useNestedDialogs(dialog, options),\n        dialogs = _useNestedDialogs.dialogs,\n        visibleModals = _useNestedDialogs.visibleModals,\n        wrap = _useNestedDialogs.wrap; // VoiceOver/Safari accepts only one `aria-modal` container, so if there\n    // are visible child modals, then we don't want to set aria-modal on the\n    // parent modal (this component).\n\n\n    var modal = options.modal && !visibleModals.length ? true : undefined;\n    usePreventBodyScroll(dialog, options);\n    useFocusTrap(dialog, visibleModals, options);\n    useFocusOnChildUnmount(dialog, options);\n    useFocusOnShow(dialog, dialogs, options);\n    useFocusOnHide(dialog, disclosure, options);\n    useHideOnClickOutside(dialog, disclosure, dialogs, options);\n    useDisableHoverOutside(dialog, dialogs, options);\n    var onKeyDown = useCallback(function (event) {\n      var _onKeyDownRef$current;\n\n      (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);\n      if (event.defaultPrevented) return;\n      if (event.key !== \"Escape\") return;\n      if (!options.hideOnEsc) return;\n\n      if (!options.hide) {\n        process.env.NODE_ENV !== \"production\" ? warning(true, \"`hideOnEsc` prop is truthy, but `hide` prop wasn't provided.\", \"See https://reakit.io/docs/dialog\", dialog.current) : void 0;\n        return;\n      }\n\n      event.stopPropagation();\n      options.hide();\n    }, [options.hideOnEsc, options.hide]);\n    var onBlur = useCallback(function (event) {\n      var _onBlurRef$current;\n\n      (_onBlurRef$current = onBlurRef.current) === null || _onBlurRef$current === void 0 ? void 0 : _onBlurRef$current.call(onBlurRef, event);\n      focusOnBlur(event);\n    }, [focusOnBlur]);\n    var wrapElement = useCallback(function (element) {\n      element = wrap(element);\n\n      if (options.modal && !hasBackdrop) {\n        element = /*#__PURE__*/createElement(Portal, null, element);\n      }\n\n      if (htmlWrapElement) {\n        element = htmlWrapElement(element);\n      }\n\n      return (\n        /*#__PURE__*/\n        // Prevents Menu > Dialog > Menu to behave as a sub menu\n        createElement(MenuContext.Provider, {\n          value: null\n        }, element)\n      );\n    }, [wrap, options.modal, hasBackdrop, htmlWrapElement]);\n    return _objectSpread2({\n      ref: useForkRef(dialog, htmlRef),\n      role: \"dialog\",\n      tabIndex: tabIndex != null ? tabIndex : -1,\n      \"aria-modal\": modal,\n      \"data-dialog\": true,\n      onKeyDown: onKeyDown,\n      onBlur: onBlur,\n      wrapElement: wrapElement\n    }, htmlProps);\n  }\n});\nvar Dialog = createComponent({\n  as: \"div\",\n  useHook: useDialog,\n  useCreateElement: function useCreateElement$1(type, props, children) {\n    process.env.NODE_ENV !== \"production\" ? useWarning(!props[\"aria-label\"] && !props[\"aria-labelledby\"], \"You should provide either `aria-label` or `aria-labelledby` props.\", \"See https://reakit.io/docs/dialog\") : void 0;\n    return useCreateElement(type, props, children);\n  }\n});\n\nexport { Dialog, useDialog };\n","import { getDocument } from './getDocument.js';\n\n// Thanks to Fluent UI for doing the [research on IE11 memory leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427)\n\nvar _window; // Note: Accessing \"window\" in IE11 is somewhat expensive, and calling \"typeof window\"\n// hits a memory leak, whereas aliasing it and calling \"typeof _window\" does not.\n// Caching the window value at the file scope lets us minimize the impact.\n\n\ntry {\n  _window = window;\n} catch (e) {\n  /* no-op */\n}\n/**\n * Returns `element.ownerDocument.defaultView || window`.\n */\n\n\nfunction getWindow(element) {\n  if (!element) {\n    return _window;\n  }\n\n  return getDocument(element).defaultView || _window;\n}\n\nexport { getWindow };\n","/**\n * Immutably removes an index from an array.\n *\n * @example\n * import { removeIndexFromArray } from \"reakit-utils\";\n *\n * removeIndexFromArray([\"a\", \"b\", \"c\"], 1); // [\"a\", \"c\"]\n *\n * @returns {Array} A new array without the item in the passed index.\n */\nfunction removeIndexFromArray(array, index) {\n  if (index === -1) return array;\n  return [].concat(array.slice(0, index), array.slice(index + 1));\n}\n\nexport { removeIndexFromArray };\n","import { flatten } from 'reakit-utils/flatten';\n\n/**\n * Logs `messages` to the console using `console.warn` based on a `condition`.\n *\n * @example\n * import { warning } from \"reakit-warning\";\n *\n * warning(true, \"a\", \"b\"); // console.warn(\"a\", \"\\n\", \"b\")\n * warning(false, \"a\", \"b\"); // does nothing\n */\n\nfunction warning(condition) {\n  if (process.env.NODE_ENV !== \"production\") {\n    var _console;\n\n    if (!condition) return;\n\n    for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      messages[_key - 1] = arguments[_key];\n    }\n\n    var warns = flatten(messages.map(function (message) {\n      return [message, \"\\n\"];\n    })); // eslint-disable-next-line no-console\n\n    (_console = console).warn.apply(_console, warns.slice(0, -1)); // Throwing an error and catching it immediately to improve debugging\n    // A consumer can use 'pause on caught exceptions'\n    // https://github.com/facebook/react/issues/4216\n\n\n    try {\n      throw Error(warns.join(\"\"));\n    } catch (x) {// do nothing\n    }\n  }\n}\n\nexport { warning };\n","import { useRef, useEffect } from 'react';\n\n/**\n * A `React.useEffect` that will not run on the first render.\n */\n\nfunction useUpdateEffect(effect, deps) {\n  var mounted = useRef(false);\n  useEffect(function () {\n    if (mounted.current) {\n      return effect();\n    }\n\n    mounted.current = true;\n    return undefined;\n  }, deps);\n}\n\nexport { useUpdateEffect };\n","import { isObject } from './isObject.js';\n\n/**\n * Checks whether `arg` is empty or not.\n *\n * @example\n * import { isEmpty } from \"reakit-utils\";\n *\n * isEmpty([]); // true\n * isEmpty([\"a\"]); // false\n * isEmpty({}); // true\n * isEmpty({ a: \"a\" }); // false\n * isEmpty(); // true\n * isEmpty(null); // true\n * isEmpty(undefined); // true\n * isEmpty(\"\"); // true\n */\n\nfunction isEmpty(arg) {\n  if (Array.isArray(arg)) return !arg.length;\n  if (isObject(arg)) return !Object.keys(arg).length;\n  if (arg == null) return true;\n  if (arg === \"\") return true;\n  return false;\n}\n\nexport { isEmpty };\n","import './getDocument.js';\nimport './getWindow.js';\nimport { canUseDOM } from './canUseDOM.js';\nimport { getActiveElement } from './getActiveElement.js';\n\nvar isIE11 = canUseDOM && \"msCrypto\" in window;\n/**\n * Cross-browser method that returns the next active element (the element that\n * is receiving focus) after a blur event is dispatched. It receives the blur\n * event object as the argument.\n *\n * @example\n * import { getNextActiveElementOnBlur } from \"reakit-utils\";\n *\n * const element = document.getElementById(\"id\");\n * element.addEventListener(\"blur\", (event) => {\n *   const nextActiveElement = getNextActiveElementOnBlur(event);\n * });\n */\n\nfunction getNextActiveElementOnBlur(event) {\n  // IE 11 doesn't support event.relatedTarget on blur.\n  // document.activeElement points the the next active element.\n  // On modern browsers, document.activeElement points to the current target.\n  if (isIE11) {\n    var activeElement = getActiveElement(event.currentTarget);\n    return activeElement;\n  }\n\n  return event.relatedTarget;\n}\n\nexport { getNextActiveElementOnBlur };\n","import { useMemo } from 'react';\n\n// https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js\n\nfunction setRef(ref, value) {\n  if (value === void 0) {\n    value = null;\n  }\n\n  if (!ref) return;\n\n  if (typeof ref === \"function\") {\n    ref(value);\n  } else {\n    ref.current = value;\n  }\n}\n/**\n * Merges up to two React Refs into a single memoized function React Ref so you\n * can pass it to an element.\n *\n * @example\n * import React from \"react\";\n * import { useForkRef } from \"reakit-utils\";\n *\n * const Component = React.forwardRef((props, ref) => {\n *   const internalRef = React.useRef();\n *   return <div {...props} ref={useForkRef(internalRef, ref)} />;\n * });\n */\n\n\nfunction useForkRef(refA, refB) {\n  return useMemo(function () {\n    if (refA == null && refB == null) {\n      return null;\n    }\n\n    return function (value) {\n      setRef(refA, value);\n      setRef(refB, value);\n    };\n  }, [refA, refB]);\n}\n\nexport { useForkRef };\n","import { removeIndexFromArray } from './removeIndexFromArray.js';\n\n/**\n * Immutably removes an item from an array.\n *\n * @example\n * import { removeItemFromArray } from \"reakit-utils\";\n *\n * removeItemFromArray([\"a\", \"b\", \"c\"], \"b\"); // [\"a\", \"c\"]\n *\n * // This only works by reference\n * const obj = {};\n * removeItemFromArray([obj], {}); // [obj]\n * removeItemFromArray([obj], obj); // []\n *\n * @returns {Array} A new array without the passed item.\n */\n\nfunction removeItemFromArray(array, item) {\n  var index = array.indexOf(item);\n  return removeIndexFromArray(array, index);\n}\n\nexport { removeItemFromArray };\n","import { useRef } from 'react';\nimport './getDocument.js';\nimport './getWindow.js';\nimport './canUseDOM.js';\nimport { useIsomorphicEffect } from './useIsomorphicEffect.js';\n\n/**\n * A `React.Ref` that keeps track of the passed `value`.\n */\n\nfunction useLiveRef(value) {\n  var ref = useRef(value);\n  useIsomorphicEffect(function () {\n    ref.current = value;\n  });\n  return ref;\n}\n\nexport { useLiveRef };\n","import { _ as _objectWithoutPropertiesLoose, a as _objectSpread2 } from './_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport './isObject.js';\nimport { isPlainObject } from './isPlainObject.js';\n\n/**\n * Splits an object (`props`) into a tuple where the first item is an object\n * with the passed `keys`, and the second item is an object with these keys\n * omitted.\n *\n * @deprecated will be removed in version 2\n *\n * @example\n * import { splitProps } from \"reakit-utils\";\n *\n * splitProps({ a: \"a\", b: \"b\" }, [\"a\"]); // [{ a: \"a\" }, { b: \"b\" }]\n */\n\nfunction __deprecatedSplitProps(props, keys) {\n  var propsKeys = Object.keys(props);\n  var picked = {};\n  var omitted = {};\n\n  for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) {\n    var key = _propsKeys[_i];\n\n    if (keys.indexOf(key) >= 0) {\n      picked[key] = props[key];\n    } else {\n      omitted[key] = props[key];\n    }\n  }\n\n  return [picked, omitted];\n}\n/**\n * Splits an object (`props`) into a tuple where the first item\n * is the `state` property, and the second item is the rest of the properties.\n *\n * It is also backward compatible with version 1. If `keys` are passed then\n * splits an object (`props`) into a tuple where the first item is an object\n * with the passed `keys`, and the second item is an object with these keys\n * omitted.\n *\n * @example\n * import { splitProps } from \"reakit-utils\";\n *\n * splitProps({ a: \"a\", b: \"b\" }, [\"a\"]); // [{ a: \"a\" }, { b: \"b\" }]\n *\n * @example\n * import { splitProps } from \"reakit-utils\";\n *\n * splitProps({ state: { a: \"a\" }, b: \"b\" }); // [{ a: \"a\" }, { b: \"b\" }]\n */\n\n\nfunction splitProps(props, keys) {\n  if (keys === void 0) {\n    keys = [];\n  }\n\n  if (!isPlainObject(props.state)) {\n    return __deprecatedSplitProps(props, keys);\n  }\n\n  var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, [\"state\"])),\n      picked = _deprecatedSplitProp[0],\n      omitted = _deprecatedSplitProp[1];\n\n  var state = picked.state,\n      restPicked = _objectWithoutPropertiesLoose(picked, [\"state\"]);\n\n  return [_objectSpread2(_objectSpread2({}, state), restPicked), omitted];\n}\n\nexport { splitProps };\n","import { a as _objectSpread2 } from './_rollupPluginBabelHelpers-1f0bf8c2.js';\nimport './isObject.js';\nimport { isPlainObject } from './isPlainObject.js';\n\n/**\n * This higher order functions take `propsAreEqual` function and\n * returns a new function which normalizes the props.\n *\n * Normalizing in our case is making sure the `propsAreEqual` works with\n * both version 1 (object spreading) and version 2 (state object) state passing.\n *\n * To achieve this, the returned function in case of a state object\n * will spread the state object in both `prev` and `next props.\n *\n * Other case it just returns the function as is which makes sure\n * that we are still backward compatible\n */\nfunction normalizePropsAreEqual(propsAreEqual) {\n  if (propsAreEqual.name === \"normalizePropsAreEqualInner\") {\n    return propsAreEqual;\n  }\n\n  return function normalizePropsAreEqualInner(prev, next) {\n    if (!isPlainObject(prev.state) || !isPlainObject(next.state)) {\n      return propsAreEqual(prev, next);\n    }\n\n    return propsAreEqual(_objectSpread2(_objectSpread2({}, prev.state), prev), _objectSpread2(_objectSpread2({}, next.state), next));\n  };\n}\n\nexport { normalizePropsAreEqual };\n","import { forwardRef as forwardRef$1, memo as memo$1 } from 'react';\nimport './SystemContext.js';\nimport { a as _objectWithoutPropertiesLoose, _ as _objectSpread2 } from './_rollupPluginBabelHelpers-0c84a174.js';\nimport { useCreateElement } from './useCreateElement.js';\nimport { splitProps } from 'reakit-utils/splitProps';\nimport { shallowEqual } from 'reakit-utils/shallowEqual';\nimport { normalizePropsAreEqual } from 'reakit-utils/normalizePropsAreEqual';\n\nfunction forwardRef(component) {\n  return /*#__PURE__*/forwardRef$1(component);\n}\n\nfunction memo(component, propsAreEqual) {\n  return /*#__PURE__*/memo$1(component, propsAreEqual);\n}\n\n/**\n * Creates a React component.\n *\n * @example\n * import { createComponent } from \"reakit-system\";\n *\n * const A = createComponent({ as: \"a\" });\n *\n * @param options\n */\nfunction createComponent(_ref) {\n  var type = _ref.as,\n      useHook = _ref.useHook,\n      shouldMemo = _ref.memo,\n      _ref$propsAreEqual = _ref.propsAreEqual,\n      propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual,\n      _ref$keys = _ref.keys,\n      keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys,\n      _ref$useCreateElement = _ref.useCreateElement,\n      useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement : _ref$useCreateElement;\n\n  var Comp = function Comp(_ref2, ref) {\n    var _ref2$as = _ref2.as,\n        as = _ref2$as === void 0 ? type : _ref2$as,\n        props = _objectWithoutPropertiesLoose(_ref2, [\"as\"]);\n\n    if (useHook) {\n      var _as$render;\n\n      var _splitProps = splitProps(props, keys),\n          _options = _splitProps[0],\n          htmlProps = _splitProps[1];\n\n      var _useHook = useHook(_options, _objectSpread2({\n        ref: ref\n      }, htmlProps)),\n          wrapElement = _useHook.wrapElement,\n          elementProps = _objectWithoutPropertiesLoose(_useHook, [\"wrapElement\"]); // @ts-ignore\n\n\n      var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys;\n      var asOptions = asKeys && splitProps(props, asKeys)[0];\n      var allProps = asOptions ? _objectSpread2(_objectSpread2({}, elementProps), asOptions) : elementProps;\n\n      var _element = useCreateElement$1(as, allProps);\n\n      if (wrapElement) {\n        return wrapElement(_element);\n      }\n\n      return _element;\n    }\n\n    return useCreateElement$1(as, _objectSpread2({\n      ref: ref\n    }, props));\n  };\n\n  if (process.env.NODE_ENV !== \"production\" && useHook) {\n    Comp.displayName = useHook.name.replace(/^(unstable_)?use/, \"\");\n  }\n\n  Comp = forwardRef(Comp);\n\n  if (shouldMemo) {\n    Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual));\n  }\n\n  Comp.__keys = keys;\n  Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual);\n  return Comp;\n}\n\nexport { createComponent };\n","/**\n * Transforms `arg` into an array if it's not already.\n *\n * @example\n * import { toArray } from \"reakit-utils\";\n *\n * toArray(\"a\"); // [\"a\"]\n * toArray([\"a\"]); // [\"a\"]\n */\nfunction toArray(arg) {\n  if (Array.isArray(arg)) {\n    return arg;\n  }\n\n  return typeof arg !== \"undefined\" ? [arg] : [];\n}\n\nexport { toArray };\n","/**\n * Returns `true` if `event.target` and `event.currentTarget` are the same.\n */\nfunction isSelfTarget(event) {\n  return event.target === event.currentTarget;\n}\n\nexport { isSelfTarget };\n","import './getDocument.js';\nimport { matches } from './matches.js';\nimport { closest } from './closest.js';\nimport { getActiveElement } from './getActiveElement.js';\n\n/** @module tabbable */\nvar selector = \"input:not([type='hidden']):not([disabled]), select:not([disabled]), \" + \"textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], \" + \"iframe, object, embed, area[href], audio[controls], video[controls], \" + \"[contenteditable]:not([contenteditable='false'])\";\n\nfunction isVisible(element) {\n  var htmlElement = element;\n  return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;\n}\n\nfunction hasNegativeTabIndex(element) {\n  var tabIndex = parseInt(element.getAttribute(\"tabindex\") || \"0\", 10);\n  return tabIndex < 0;\n}\n/**\n * Checks whether `element` is focusable or not.\n *\n * @memberof tabbable\n *\n * @example\n * import { isFocusable } from \"reakit-utils\";\n *\n * isFocusable(document.querySelector(\"input\")); // true\n * isFocusable(document.querySelector(\"input[tabindex='-1']\")); // true\n * isFocusable(document.querySelector(\"input[hidden]\")); // false\n * isFocusable(document.querySelector(\"input:disabled\")); // false\n */\n\n\nfunction isFocusable(element) {\n  return matches(element, selector) && isVisible(element);\n}\n/**\n * Checks whether `element` is tabbable or not.\n *\n * @memberof tabbable\n *\n * @example\n * import { isTabbable } from \"reakit-utils\";\n *\n * isTabbable(document.querySelector(\"input\")); // true\n * isTabbable(document.querySelector(\"input[tabindex='-1']\")); // false\n * isTabbable(document.querySelector(\"input[hidden]\")); // false\n * isTabbable(document.querySelector(\"input:disabled\")); // false\n */\n\nfunction isTabbable(element) {\n  return isFocusable(element) && !hasNegativeTabIndex(element);\n}\n/**\n * Returns all the focusable elements in `container`.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n *\n * @returns {Element[]}\n */\n\nfunction getAllFocusableIn(container) {\n  var allFocusable = Array.from(container.querySelectorAll(selector));\n  allFocusable.unshift(container);\n  return allFocusable.filter(isFocusable);\n}\n/**\n * Returns the first focusable element in `container`.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n *\n * @returns {Element|null}\n */\n\nfunction getFirstFocusableIn(container) {\n  var _getAllFocusableIn = getAllFocusableIn(container),\n      first = _getAllFocusableIn[0];\n\n  return first || null;\n}\n/**\n * Returns all the tabbable elements in `container`, including the container\n * itself.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones.\n *\n * @returns {Element[]}\n */\n\nfunction getAllTabbableIn(container, fallbackToFocusable) {\n  var allFocusable = Array.from(container.querySelectorAll(selector));\n  var allTabbable = allFocusable.filter(isTabbable);\n\n  if (isTabbable(container)) {\n    allTabbable.unshift(container);\n  }\n\n  if (!allTabbable.length && fallbackToFocusable) {\n    return allFocusable;\n  }\n\n  return allTabbable;\n}\n/**\n * Returns the first tabbable element in `container`, including the container\n * itself if it's tabbable.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones.\n *\n * @returns {Element|null}\n */\n\nfunction getFirstTabbableIn(container, fallbackToFocusable) {\n  var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable),\n      first = _getAllTabbableIn[0];\n\n  return first || null;\n}\n/**\n * Returns the last tabbable element in `container`, including the container\n * itself if it's tabbable.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones.\n *\n * @returns {Element|null}\n */\n\nfunction getLastTabbableIn(container, fallbackToFocusable) {\n  var allTabbable = getAllTabbableIn(container, fallbackToFocusable);\n  return allTabbable[allTabbable.length - 1] || null;\n}\n/**\n * Returns the next tabbable element in `container`.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones.\n *\n * @returns {Element|null}\n */\n\nfunction getNextTabbableIn(container, fallbackToFocusable) {\n  var activeElement = getActiveElement(container);\n  var allFocusable = getAllFocusableIn(container);\n  var index = allFocusable.indexOf(activeElement);\n  var slice = allFocusable.slice(index + 1);\n  return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);\n}\n/**\n * Returns the previous tabbable element in `container`.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones.\n *\n * @returns {Element|null}\n */\n\nfunction getPreviousTabbableIn(container, fallbackToFocusable) {\n  var activeElement = getActiveElement(container);\n  var allFocusable = getAllFocusableIn(container).reverse();\n  var index = allFocusable.indexOf(activeElement);\n  var slice = allFocusable.slice(index + 1);\n  return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);\n}\n/**\n * Returns the closest focusable element.\n *\n * @memberof tabbable\n *\n * @param {Element} container\n *\n * @returns {Element|null}\n */\n\nfunction getClosestFocusable(element) {\n  while (element && !isFocusable(element)) {\n    element = closest(element, selector);\n  }\n\n  return element;\n}\n\nexport { getAllFocusableIn, getAllTabbableIn, getClosestFocusable, getFirstFocusableIn, getFirstTabbableIn, getLastTabbableIn, getNextTabbableIn, getPreviousTabbableIn, isFocusable, isTabbable };\n","/**\n * Returns `element.ownerDocument || document`.\n */\nfunction getDocument(element) {\n  return element ? element.ownerDocument || element : document;\n}\n\nexport { getDocument };\n","import { useDebugValue, useContext } from 'react';\nimport { SystemContext } from './SystemContext.js';\n\n/**\n * React custom hook that returns the value of any token defined in the\n * SystemContext. It's mainly used internally in [`useOptions`](#useoptions)\n * and [`useProps`](#useprops).\n *\n * @example\n * import { SystemProvider, useToken } from \"reakit-system\";\n *\n * const system = {\n *   token: \"value\",\n * };\n *\n * function Component(props) {\n *   const token = useToken(\"token\", \"default value\");\n *   return <div {...props}>{token}</div>;\n * }\n *\n * function App() {\n *   return (\n *     <SystemProvider unstable_system={system}>\n *       <Component />\n *     </SystemProvider>\n *   );\n * }\n */\n\nfunction useToken(token, defaultValue) {\n  useDebugValue(token);\n  var context = useContext(SystemContext);\n  return context[token] != null ? context[token] : defaultValue;\n}\n\nexport { useToken };\n","import 'react';\nimport './SystemContext.js';\nimport './useToken.js';\nimport { useProps } from './useProps.js';\nimport { b as _createForOfIteratorHelperLoose } from './_rollupPluginBabelHelpers-0c84a174.js';\nimport { useOptions } from './useOptions.js';\nimport { shallowEqual } from 'reakit-utils/shallowEqual';\nimport { toArray } from 'reakit-utils/toArray';\n\n/**\n * Creates a React custom hook that will return component props.\n *\n * @example\n * import { createHook } from \"reakit-system\";\n *\n * const useA = createHook({\n *   name: \"A\",\n *   keys: [\"url\"], // custom props/options keys\n *   useProps(options, htmlProps) {\n *     return {\n *       ...htmlProps,\n *       href: options.url,\n *     };\n *   },\n * });\n *\n * function A({ url, ...htmlProps }) {\n *   const props = useA({ url }, htmlProps);\n *   return <a {...props} />;\n * }\n *\n * @param options\n */\nfunction createHook(options) {\n  var _options$useState, _composedHooks$;\n\n  var composedHooks = toArray(options.compose);\n\n  var __useOptions = function __useOptions(hookOptions, htmlProps) {\n    // Call the current hook's useOptions first\n    if (options.useOptions) {\n      hookOptions = options.useOptions(hookOptions, htmlProps);\n    } // If there's name, call useOptions from the system context\n\n\n    if (options.name) {\n      hookOptions = useOptions(options.name, hookOptions, htmlProps);\n    } // Run composed hooks useOptions\n\n\n    if (options.compose) {\n      for (var _iterator = _createForOfIteratorHelperLoose(composedHooks), _step; !(_step = _iterator()).done;) {\n        var hook = _step.value;\n        hookOptions = hook.__useOptions(hookOptions, htmlProps);\n      }\n    }\n\n    return hookOptions;\n  };\n\n  var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) {\n    if (hookOptions === void 0) {\n      hookOptions = {};\n    }\n\n    if (htmlProps === void 0) {\n      htmlProps = {};\n    }\n\n    if (unstable_ignoreUseOptions === void 0) {\n      unstable_ignoreUseOptions = false;\n    }\n\n    // This won't execute when useHook was called from within another useHook\n    if (!unstable_ignoreUseOptions) {\n      hookOptions = __useOptions(hookOptions, htmlProps);\n    } // Call the current hook's useProps\n\n\n    if (options.useProps) {\n      htmlProps = options.useProps(hookOptions, htmlProps);\n    } // If there's name, call useProps from the system context\n\n\n    if (options.name) {\n      htmlProps = useProps(options.name, hookOptions, htmlProps);\n    }\n\n    if (options.compose) {\n      if (options.useComposeOptions) {\n        hookOptions = options.useComposeOptions(hookOptions, htmlProps);\n      }\n\n      if (options.useComposeProps) {\n        htmlProps = options.useComposeProps(hookOptions, htmlProps);\n      } else {\n        for (var _iterator2 = _createForOfIteratorHelperLoose(composedHooks), _step2; !(_step2 = _iterator2()).done;) {\n          var hook = _step2.value;\n          htmlProps = hook(hookOptions, htmlProps, true);\n        }\n      }\n    } // Remove undefined values from htmlProps\n\n\n    var finalHTMLProps = {};\n    var definedHTMLProps = htmlProps || {};\n\n    for (var prop in definedHTMLProps) {\n      if (definedHTMLProps[prop] !== undefined) {\n        finalHTMLProps[prop] = definedHTMLProps[prop];\n      }\n    }\n\n    return finalHTMLProps;\n  };\n\n  useHook.__useOptions = __useOptions;\n  var composedKeys = composedHooks.reduce(function (keys, hook) {\n    keys.push.apply(keys, hook.__keys || []);\n    return keys;\n  }, []); // It's used by createComponent to split option props (keys) and html props\n\n  useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []);\n  useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual;\n\n  if (process.env.NODE_ENV !== \"production\" && options.name) {\n    Object.defineProperty(useHook, \"name\", {\n      value: \"use\" + options.name\n    });\n  }\n\n  return useHook;\n}\n\nexport { createHook };\n","import { useDebugValue } from 'react';\nimport './SystemContext.js';\nimport { useToken } from './useToken.js';\nimport { _ as _objectSpread2 } from './_rollupPluginBabelHelpers-0c84a174.js';\n\n/**\n * React custom hook that returns the options returned by a given\n * `use${name}Options` in the SystemContext.\n *\n * @example\n * import React from \"react\";\n * import { SystemProvider, useOptions } from \"reakit-system\";\n *\n * const system = {\n *   useAOptions(options, htmlProps) {\n *     return {\n *       ...options,\n *       url: htmlProps.href,\n *     };\n *   },\n * };\n *\n * function A({ url, ...htmlProps }) {\n *   const options = useOptions(\"A\", { url }, htmlProps);\n *   return <a href={options.url} {...htmlProps} />;\n * }\n *\n * function App() {\n *   return (\n *     <SystemProvider unstable_system={system}>\n *       <A href=\"url\">\n *         It will convert href into url in useAOptions and then url into href in A\n *       </A>\n *     </SystemProvider>\n *   );\n * }\n */\n\nfunction useOptions(name, options, htmlProps) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  if (htmlProps === void 0) {\n    htmlProps = {};\n  }\n\n  var hookName = \"use\" + name + \"Options\";\n  useDebugValue(hookName);\n  var useHook = useToken(hookName);\n\n  if (useHook) {\n    return _objectSpread2(_objectSpread2({}, options), useHook(options, htmlProps));\n  }\n\n  return options;\n}\n\nexport { useOptions };\n","import { useDebugValue } from 'react';\nimport './SystemContext.js';\nimport { useToken } from './useToken.js';\n\n/**\n * React custom hook that returns the props returned by a given\n * `use${name}Props` in the SystemContext.\n *\n * @example\n * import { SystemProvider, useProps } from \"reakit-system\";\n *\n * const system = {\n *   useAProps(options, htmlProps) {\n *     return {\n *       ...htmlProps,\n *       href: options.url,\n *     };\n *   },\n * };\n *\n * function A({ url, ...htmlProps }) {\n *   const props = useProps(\"A\", { url }, htmlProps);\n *   return <a {...props} />;\n * }\n *\n * function App() {\n *   return (\n *     <SystemProvider unstable_system={system}>\n *       <A url=\"url\">It will convert url into href in useAProps</A>\n *     </SystemProvider>\n *   );\n * }\n */\n\nfunction useProps(name, options, htmlProps) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  if (htmlProps === void 0) {\n    htmlProps = {};\n  }\n\n  var hookName = \"use\" + name + \"Props\";\n  useDebugValue(hookName);\n  var useHook = useToken(hookName);\n\n  if (useHook) {\n    return useHook(options, htmlProps);\n  }\n\n  return htmlProps;\n}\n\nexport { useProps };\n","/**\n * Compares two objects.\n *\n * @example\n * import { shallowEqual } from \"reakit-utils\";\n *\n * shallowEqual({ a: \"a\" }, {}); // false\n * shallowEqual({ a: \"a\" }, { b: \"b\" }); // false\n * shallowEqual({ a: \"a\" }, { a: \"a\" }); // true\n * shallowEqual({ a: \"a\" }, { a: \"a\", b: \"b\" }); // false\n */\nfunction shallowEqual(objA, objB) {\n  if (objA === objB) return true;\n  if (!objA) return false;\n  if (!objB) return false;\n  if (typeof objA !== \"object\") return false;\n  if (typeof objB !== \"object\") return false;\n  var aKeys = Object.keys(objA);\n  var bKeys = Object.keys(objB);\n  var length = aKeys.length;\n  if (bKeys.length !== length) return false;\n\n  for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {\n    var key = _aKeys[_i];\n\n    if (objA[key] !== objB[key]) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nexport { shallowEqual };\n","/**\n * Similar to `Element.prototype.contains`, but a little bit faster when\n * `element` is the same as `child`.\n *\n * @example\n * import { contains } from \"reakit-utils\";\n *\n * contains(document.getElementById(\"parent\"), document.getElementById(\"child\"));\n */\nfunction contains(parent, child) {\n  return parent === child || parent.contains(child);\n}\n\nexport { contains };\n"],"sourceRoot":""}