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BAAuBA,EAAE,kBAAoBA,EAAE,uBAAyBA,EAAE,cAAgBA,EAAE,cAAgBA,EAAE,eAAiBA,EAAE,sBAAwBA,EAAE,qBAAuBA,EAAE,0BAA4BA,EAAE,yB,mCCNza,U,kCCMF,IAAIC,EAAuB,EAAQ,OAEnC,SAASC,KACT,SAASC,KACTA,EAAuBC,kBAAoBF,EAE3C9a,EAAOC,QAAU,WACf,SAASgb,EAAKpV,EAAOqV,EAAUC,EAAeC,EAAUC,EAAcC,GACpE,GAAIA,IAAWT,EAAf,CAIA,IAAIU,EAAM,IAAIjH,MACZ,mLAKF,MADAiH,EAAIC,KAAO,sBACLD,GAGR,SAASE,IACP,OAAOR,EAFTA,EAAKS,WAAaT,EAMlB,IAAIU,EAAiB,CACnBC,MAAOX,EACPY,KAAMZ,EACNa,KAAMb,EACNc,OAAQd,EACRe,OAAQf,EACR5Q,OAAQ4Q,EACRgB,OAAQhB,EAERiB,IAAKjB,EACLkB,QAASV,EACT3J,QAASmJ,EACTmB,YAAanB,EACboB,WAAYZ,EACZlW,KAAM0V,EACNqB,SAAUb,EACVc,MAAOd,EACPe,UAAWf,EACXgB,MAAOhB,EACPiB,MAAOjB,EAEPkB,eAAgB5B,EAChBC,kBAAmBF,GAKrB,OAFAa,EAAeiB,UAAYjB,EAEpBA,I,qBC7CP3b,EAAOC,QAAU,EAAQ,KAAR,I,+BCNnBD,EAAOC,QAFoB","sources":["webpack://richie-education/./node_modules/core-js/internals/object-to-array.js","webpack://richie-education/./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://richie-education/./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/extends.js","webpack://richie-education/./node_modules/compute-scroll-into-view/src/index.ts","webpack://richie-education/./node_modules/downshift/node_modules/tslib/tslib.es6.js","webpack://richie-education/./node_modules/downshift/dist/downshift.esm.js","webpack://richie-education/./node_modules/downshift/node_modules/react-is/cjs/react-is.production.min.js","webpack://richie-education/./node_modules/downshift/node_modules/react-is/index.js","webpack://richie-education/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://richie-education/./node_modules/prop-types/index.js","webpack://richie-education/./node_modules/prop-types/lib/ReactPropTypesSecret.js"],"sourcesContent":["var DESCRIPTORS = require('../internals/descriptors');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\nvar propertyIsEnumerable = uncurryThis($propertyIsEnumerable);\nvar push = uncurryThis([].push);\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {\n push(result, TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.es/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.es/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","export default function _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}","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","// Compute what scrolling needs to be done on required scrolling boxes for target to be in view\n\n// The type names here are named after the spec to make it easier to find more information around what they mean:\n// To reduce churn and reduce things that need be maintained things from the official TS DOM library is used here\n// https://drafts.csswg.org/cssom-view/\n\n// For a definition on what is \"block flow direction\" exactly, check this: https://drafts.csswg.org/css-writing-modes-4/#block-flow-direction\n\n// add support for visualViewport object currently implemented in chrome\ninterface visualViewport {\n height: number\n width: number\n}\n\ntype ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest'\n// This new option is tracked in this PR, which is the most likely candidate at the time: https://github.com/w3c/csswg-drafts/pull/1805\ntype ScrollMode = 'always' | 'if-needed'\n// New option that skips auto-scrolling all nodes with overflow: hidden set\n// See FF implementation: https://hg.mozilla.org/integration/fx-team/rev/c48c3ec05012#l7.18\ntype SkipOverflowHiddenElements = boolean\n\ninterface Options {\n block?: ScrollLogicalPosition\n inline?: ScrollLogicalPosition\n scrollMode?: ScrollMode\n boundary?: CustomScrollBoundary\n skipOverflowHiddenElements?: SkipOverflowHiddenElements\n}\n\n// Custom behavior, not in any spec\ntype CustomScrollBoundaryCallback = (parent: Element) => boolean\ntype CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null\ninterface CustomScrollAction {\n el: Element\n top: number\n left: number\n}\n\n// @TODO better shadowdom test, 11 = document fragment\nfunction isElement(el: any): el is Element {\n return typeof el === 'object' && el != null && el.nodeType === 1\n}\n\nfunction canOverflow(\n overflow: string | null,\n skipOverflowHiddenElements?: boolean\n) {\n if (skipOverflowHiddenElements && overflow === 'hidden') {\n return false\n }\n\n return overflow !== 'visible' && overflow !== 'clip'\n}\n\nfunction getFrameElement(el: Element) {\n if (!el.ownerDocument || !el.ownerDocument.defaultView) {\n return null\n }\n\n try {\n return el.ownerDocument.defaultView.frameElement\n } catch (e) {\n return null\n }\n}\n\nfunction isHiddenByFrame(el: Element): boolean {\n const frame = getFrameElement(el)\n if (!frame) {\n return false\n }\n\n return (\n frame.clientHeight < el.scrollHeight || frame.clientWidth < el.scrollWidth\n )\n}\n\nfunction isScrollable(el: Element, skipOverflowHiddenElements?: boolean) {\n if (el.clientHeight < el.scrollHeight || el.clientWidth < el.scrollWidth) {\n const style = getComputedStyle(el, null)\n return (\n canOverflow(style.overflowY, skipOverflowHiddenElements) ||\n canOverflow(style.overflowX, skipOverflowHiddenElements) ||\n isHiddenByFrame(el)\n )\n }\n\n return false\n}\n/**\n * Find out which edge to align against when logical scroll position is \"nearest\"\n * Interesting fact: \"nearest\" works similarily to \"if-needed\", if the element is fully visible it will not scroll it\n *\n * Legends:\n * ┌────────┐ ┏ ━ ━ ━ ┓\n * │ target │ frame\n * └────────┘ ┗ ━ ━ ━ ┛\n */\nfunction alignNearest(\n scrollingEdgeStart: number,\n scrollingEdgeEnd: number,\n scrollingSize: number,\n scrollingBorderStart: number,\n scrollingBorderEnd: number,\n elementEdgeStart: number,\n elementEdgeEnd: number,\n elementSize: number\n) {\n /**\n * If element edge A and element edge B are both outside scrolling box edge A and scrolling box edge B\n *\n * ┌──┐\n * ┏━│━━│━┓\n * │ │\n * ┃ │ │ ┃ do nothing\n * │ │\n * ┗━│━━│━┛\n * └──┘\n *\n * If element edge C and element edge D are both outside scrolling box edge C and scrolling box edge D\n *\n * ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐\n * │┃ ┃│ do nothing\n * └───────────┘\n * ┗ ━ ━ ━ ━ ┛\n */\n if (\n (elementEdgeStart < scrollingEdgeStart &&\n elementEdgeEnd > scrollingEdgeEnd) ||\n (elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd)\n ) {\n return 0\n }\n\n /**\n * If element edge A is outside scrolling box edge A and element height is less than scrolling box height\n *\n * ┌──┐\n * ┏━│━━│━┓ ┏━┌━━┐━┓\n * └──┘ │ │\n * from ┃ ┃ to ┃ └──┘ ┃\n *\n * ┗━ ━━ ━┛ ┗━ ━━ ━┛\n *\n * If element edge B is outside scrolling box edge B and element height is greater than scrolling box height\n *\n * ┏━ ━━ ━┓ ┏━┌━━┐━┓\n * │ │\n * from ┃ ┌──┐ ┃ to ┃ │ │ ┃\n * │ │ │ │\n * ┗━│━━│━┛ ┗━│━━│━┛\n * │ │ └──┘\n * │ │\n * └──┘\n *\n * If element edge C is outside scrolling box edge C and element width is less than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───┐ ┌───┐\n * │ ┃ │ ┃ ┃ │ ┃\n * └───┘ └───┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n * If element edge D is outside scrolling box edge D and element width is greater than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐ ┌───────────┐\n * ┃ │ ┃ │ ┃ ┃ │\n * └───────────┘ └───────────┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n */\n if (\n (elementEdgeStart <= scrollingEdgeStart && elementSize <= scrollingSize) ||\n (elementEdgeEnd >= scrollingEdgeEnd && elementSize >= scrollingSize)\n ) {\n return elementEdgeStart - scrollingEdgeStart - scrollingBorderStart\n }\n\n /**\n * If element edge B is outside scrolling box edge B and element height is less than scrolling box height\n *\n * ┏━ ━━ ━┓ ┏━ ━━ ━┓\n *\n * from ┃ ┃ to ┃ ┌──┐ ┃\n * ┌──┐ │ │\n * ┗━│━━│━┛ ┗━└━━┘━┛\n * └──┘\n *\n * If element edge A is outside scrolling box edge A and element height is greater than scrolling box height\n *\n * ┌──┐\n * │ │\n * │ │ ┌──┐\n * ┏━│━━│━┓ ┏━│━━│━┓\n * │ │ │ │\n * from ┃ └──┘ ┃ to ┃ │ │ ┃\n * │ │\n * ┗━ ━━ ━┛ ┗━└━━┘━┛\n *\n * If element edge C is outside scrolling box edge C and element width is greater than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐ ┌───────────┐\n * │ ┃ │ ┃ │ ┃ ┃\n * └───────────┘ └───────────┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n * If element edge D is outside scrolling box edge D and element width is less than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───┐ ┌───┐\n * ┃ │ ┃ │ ┃ │ ┃\n * └───┘ └───┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n */\n if (\n (elementEdgeEnd > scrollingEdgeEnd && elementSize < scrollingSize) ||\n (elementEdgeStart < scrollingEdgeStart && elementSize > scrollingSize)\n ) {\n return elementEdgeEnd - scrollingEdgeEnd + scrollingBorderEnd\n }\n\n return 0\n}\n\nexport default (target: Element, options: Options): CustomScrollAction[] => {\n //TODO: remove this hack when microbundle will support typescript >= 4.0\n const windowWithViewport = (window as unknown) as Window & {\n visualViewport: visualViewport\n }\n\n const {\n scrollMode,\n block,\n inline,\n boundary,\n skipOverflowHiddenElements,\n } = options\n // Allow using a callback to check the boundary\n // The default behavior is to check if the current target matches the boundary element or not\n // If undefined it'll check that target is never undefined (can happen as we recurse up the tree)\n const checkBoundary =\n typeof boundary === 'function' ? boundary : (node: any) => node !== boundary\n\n if (!isElement(target)) {\n throw new TypeError('Invalid target')\n }\n\n // Used to handle the top most element that can be scrolled\n const scrollingElement = document.scrollingElement || document.documentElement\n\n // Collect all the scrolling boxes, as defined in the spec: https://drafts.csswg.org/cssom-view/#scrolling-box\n const frames: Element[] = []\n let cursor: Element | null = target\n while (isElement(cursor) && checkBoundary(cursor)) {\n // Move cursor to parent\n cursor = cursor.parentElement\n\n // Stop when we reach the viewport\n if (cursor === scrollingElement) {\n frames.push(cursor)\n break\n }\n\n // Skip document.body if it's not the scrollingElement and documentElement isn't independently scrollable\n if (\n cursor != null &&\n cursor === document.body &&\n isScrollable(cursor) &&\n !isScrollable(document.documentElement)\n ) {\n continue\n }\n\n // Now we check if the element is scrollable, this code only runs if the loop haven't already hit the viewport or a custom boundary\n if (cursor != null && isScrollable(cursor, skipOverflowHiddenElements)) {\n frames.push(cursor)\n }\n }\n\n // Support pinch-zooming properly, making sure elements scroll into the visual viewport\n // Browsers that don't support visualViewport will report the layout viewport dimensions on document.documentElement.clientWidth/Height\n // and viewport dimensions on window.innerWidth/Height\n // https://www.quirksmode.org/mobile/viewports2.html\n // https://bokand.github.io/viewport/index.html\n const viewportWidth = windowWithViewport.visualViewport\n ? windowWithViewport.visualViewport.width\n : innerWidth\n const viewportHeight = windowWithViewport.visualViewport\n ? windowWithViewport.visualViewport.height\n : innerHeight\n\n // Newer browsers supports scroll[X|Y], page[X|Y]Offset is\n const viewportX = window.scrollX || pageXOffset\n const viewportY = window.scrollY || pageYOffset\n\n const {\n height: targetHeight,\n width: targetWidth,\n top: targetTop,\n right: targetRight,\n bottom: targetBottom,\n left: targetLeft,\n } = target.getBoundingClientRect()\n\n // These values mutate as we loop through and generate scroll coordinates\n let targetBlock: number =\n block === 'start' || block === 'nearest'\n ? targetTop\n : block === 'end'\n ? targetBottom\n : targetTop + targetHeight / 2 // block === 'center\n let targetInline: number =\n inline === 'center'\n ? targetLeft + targetWidth / 2\n : inline === 'end'\n ? targetRight\n : targetLeft // inline === 'start || inline === 'nearest\n\n // Collect new scroll positions\n const computations: CustomScrollAction[] = []\n // In chrome there's no longer a difference between caching the `frames.length` to a var or not, so we don't in this case (size > speed anyways)\n for (let index = 0; index < frames.length; index++) {\n const frame = frames[index]\n\n // @TODO add a shouldScroll hook here that allows userland code to take control\n\n const {\n height,\n width,\n top,\n right,\n bottom,\n left,\n } = frame.getBoundingClientRect()\n\n // If the element is already visible we can end it here\n // @TODO targetBlock and targetInline should be taken into account to be compliant with https://github.com/w3c/csswg-drafts/pull/1805/files#diff-3c17f0e43c20f8ecf89419d49e7ef5e0R1333\n if (\n scrollMode === 'if-needed' &&\n targetTop >= 0 &&\n targetLeft >= 0 &&\n targetBottom <= viewportHeight &&\n targetRight <= viewportWidth &&\n targetTop >= top &&\n targetBottom <= bottom &&\n targetLeft >= left &&\n targetRight <= right\n ) {\n // Break the loop and return the computations for things that are not fully visible\n return computations\n }\n\n const frameStyle = getComputedStyle(frame)\n const borderLeft = parseInt(frameStyle.borderLeftWidth as string, 10)\n const borderTop = parseInt(frameStyle.borderTopWidth as string, 10)\n const borderRight = parseInt(frameStyle.borderRightWidth as string, 10)\n const borderBottom = parseInt(frameStyle.borderBottomWidth as string, 10)\n\n let blockScroll: number = 0\n let inlineScroll: number = 0\n\n // The property existance checks for offfset[Width|Height] is because only HTMLElement objects have them, but any Element might pass by here\n // @TODO find out if the \"as HTMLElement\" overrides can be dropped\n const scrollbarWidth =\n 'offsetWidth' in frame\n ? (frame as HTMLElement).offsetWidth -\n (frame as HTMLElement).clientWidth -\n borderLeft -\n borderRight\n : 0\n const scrollbarHeight =\n 'offsetHeight' in frame\n ? (frame as HTMLElement).offsetHeight -\n (frame as HTMLElement).clientHeight -\n borderTop -\n borderBottom\n : 0\n\n if (scrollingElement === frame) {\n // Handle viewport logic (document.documentElement or document.body)\n\n if (block === 'start') {\n blockScroll = targetBlock\n } else if (block === 'end') {\n blockScroll = targetBlock - viewportHeight\n } else if (block === 'nearest') {\n blockScroll = alignNearest(\n viewportY,\n viewportY + viewportHeight,\n viewportHeight,\n borderTop,\n borderBottom,\n viewportY + targetBlock,\n viewportY + targetBlock + targetHeight,\n targetHeight\n )\n } else {\n // block === 'center' is the default\n blockScroll = targetBlock - viewportHeight / 2\n }\n\n if (inline === 'start') {\n inlineScroll = targetInline\n } else if (inline === 'center') {\n inlineScroll = targetInline - viewportWidth / 2\n } else if (inline === 'end') {\n inlineScroll = targetInline - viewportWidth\n } else {\n // inline === 'nearest' is the default\n inlineScroll = alignNearest(\n viewportX,\n viewportX + viewportWidth,\n viewportWidth,\n borderLeft,\n borderRight,\n viewportX + targetInline,\n viewportX + targetInline + targetWidth,\n targetWidth\n )\n }\n\n // Apply scroll position offsets and ensure they are within bounds\n // @TODO add more test cases to cover this 100%\n blockScroll = Math.max(0, blockScroll + viewportY)\n inlineScroll = Math.max(0, inlineScroll + viewportX)\n } else {\n // Handle each scrolling frame that might exist between the target and the viewport\n\n if (block === 'start') {\n blockScroll = targetBlock - top - borderTop\n } else if (block === 'end') {\n blockScroll = targetBlock - bottom + borderBottom + scrollbarHeight\n } else if (block === 'nearest') {\n blockScroll = alignNearest(\n top,\n bottom,\n height,\n borderTop,\n borderBottom + scrollbarHeight,\n targetBlock,\n targetBlock + targetHeight,\n targetHeight\n )\n } else {\n // block === 'center' is the default\n blockScroll = targetBlock - (top + height / 2) + scrollbarHeight / 2\n }\n\n if (inline === 'start') {\n inlineScroll = targetInline - left - borderLeft\n } else if (inline === 'center') {\n inlineScroll = targetInline - (left + width / 2) + scrollbarWidth / 2\n } else if (inline === 'end') {\n inlineScroll = targetInline - right + borderRight + scrollbarWidth\n } else {\n // inline === 'nearest' is the default\n inlineScroll = alignNearest(\n left,\n right,\n width,\n borderLeft,\n borderRight + scrollbarWidth,\n targetInline,\n targetInline + targetWidth,\n targetWidth\n )\n }\n\n const { scrollLeft, scrollTop } = frame\n // Ensure scroll coordinates are not out of bounds while applying scroll offsets\n blockScroll = Math.max(\n 0,\n Math.min(\n scrollTop + blockScroll,\n frame.scrollHeight - height + scrollbarHeight\n )\n )\n inlineScroll = Math.max(\n 0,\n Math.min(\n scrollLeft + inlineScroll,\n frame.scrollWidth - width + scrollbarWidth\n )\n )\n\n // Cache the offset so that parent frames can scroll this into view correctly\n targetBlock += scrollTop - blockScroll\n targetInline += scrollLeft - inlineScroll\n }\n\n computations.push({ el: frame, top: blockScroll, left: inlineScroll })\n }\n\n return computations\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport PropTypes from 'prop-types';\nimport { cloneElement, Component, useRef, useEffect, useCallback, useLayoutEffect, useReducer, useMemo } from 'react';\nimport { isForwardRef } from 'react-is';\nimport computeScrollIntoView from 'compute-scroll-into-view';\nimport { __assign } from 'tslib';\n\nvar idCounter = 0;\n/**\n * Accepts a parameter and returns it if it's a function\n * or a noop function if it's not. This allows us to\n * accept a callback, but not worry about it if it's not\n * passed.\n * @param {Function} cb the callback\n * @return {Function} a function\n */\n\nfunction cbToCb(cb) {\n return typeof cb === 'function' ? cb : noop;\n}\n\nfunction noop() {}\n/**\n * Scroll node into view if necessary\n * @param {HTMLElement} node the element that should scroll into view\n * @param {HTMLElement} menuNode the menu element of the component\n */\n\n\nfunction scrollIntoView(node, menuNode) {\n if (!node) {\n return;\n }\n\n var actions = computeScrollIntoView(node, {\n boundary: menuNode,\n block: 'nearest',\n scrollMode: 'if-needed'\n });\n actions.forEach(function (_ref) {\n var el = _ref.el,\n top = _ref.top,\n left = _ref.left;\n el.scrollTop = top;\n el.scrollLeft = left;\n });\n}\n/**\n * @param {HTMLElement} parent the parent node\n * @param {HTMLElement} child the child node\n * @param {Window} environment The window context where downshift renders.\n * @return {Boolean} whether the parent is the child or the child is in the parent\n */\n\n\nfunction isOrContainsNode(parent, child, environment) {\n var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child);\n return result;\n}\n/**\n * Simple debounce implementation. Will call the given\n * function once after the time given has passed since\n * it was last called.\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n * @return {Function} the debounced function\n */\n\n\nfunction debounce(fn, time) {\n var timeoutId;\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n }\n\n function wrapper() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n cancel();\n timeoutId = setTimeout(function () {\n timeoutId = null;\n fn.apply(void 0, args);\n }, time);\n }\n\n wrapper.cancel = cancel;\n return wrapper;\n}\n/**\n * This is intended to be used to compose event handlers.\n * They are executed in order until one of them sets\n * `event.preventDownshiftDefault = true`.\n * @param {...Function} fns the event handler functions\n * @return {Function} the event handler to add to an element\n */\n\n\nfunction callAllEventHandlers() {\n for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n fns[_key2] = arguments[_key2];\n }\n\n return function (event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return fns.some(function (fn) {\n if (fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return event.preventDownshiftDefault || event.hasOwnProperty('nativeEvent') && event.nativeEvent.preventDownshiftDefault;\n });\n };\n}\n\nfunction handleRefs() {\n for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n refs[_key4] = arguments[_key4];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n });\n };\n}\n/**\n * This generates a unique ID for an instance of Downshift\n * @return {String} the unique ID\n */\n\n\nfunction generateId() {\n return String(idCounter++);\n}\n/**\n * Resets idCounter to 0. Used for SSR.\n */\n\n\nfunction resetIdCounter() {\n idCounter = 0;\n}\n/**\n * Default implementation for status message. Only added when menu is open.\n * Will specify if there are results in the list, and if so, how many,\n * and what keys are relevant.\n *\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\n\n\nfunction getA11yStatusMessage$1(_ref2) {\n var isOpen = _ref2.isOpen,\n resultCount = _ref2.resultCount,\n previousResultCount = _ref2.previousResultCount;\n\n if (!isOpen) {\n return '';\n }\n\n if (!resultCount) {\n return 'No results are available.';\n }\n\n if (resultCount !== previousResultCount) {\n return resultCount + \" result\" + (resultCount === 1 ? ' is' : 's are') + \" available, use up and down arrow keys to navigate. Press Enter key to select.\";\n }\n\n return '';\n}\n/**\n * Takes an argument and if it's an array, returns the first item in the array\n * otherwise returns the argument\n * @param {*} arg the maybe-array\n * @param {*} defaultValue the value if arg is falsey not defined\n * @return {*} the arg or it's first item\n */\n\n\nfunction unwrapArray(arg, defaultValue) {\n arg = Array.isArray(arg) ?\n /* istanbul ignore next (preact) */\n arg[0] : arg;\n\n if (!arg && defaultValue) {\n return defaultValue;\n } else {\n return arg;\n }\n}\n/**\n * @param {Object} element (P)react element\n * @return {Boolean} whether it's a DOM element\n */\n\n\nfunction isDOMElement(element) {\n\n\n return typeof element.type === 'string';\n}\n/**\n * @param {Object} element (P)react element\n * @return {Object} the props\n */\n\n\nfunction getElementProps(element) {\n\n return element.props;\n}\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\n\n\nfunction requiredProp(fnName, propName) {\n // eslint-disable-next-line no-console\n console.error(\"The property \\\"\" + propName + \"\\\" is required in \\\"\" + fnName + \"\\\"\");\n}\n\nvar stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];\n/**\n * @param {Object} state the state object\n * @return {Object} state that is relevant to downshift\n */\n\nfunction pickState(state) {\n if (state === void 0) {\n state = {};\n }\n\n var result = {};\n stateKeys.forEach(function (k) {\n if (state.hasOwnProperty(k)) {\n result[k] = state[k];\n }\n });\n return result;\n}\n/**\n * This will perform a shallow merge of the given state object\n * with the state coming from props\n * (for the controlled component scenario)\n * This is used in state updater functions so they're referencing\n * the right state regardless of where it comes from.\n *\n * @param {Object} state The state of the component/hook.\n * @param {Object} props The props that may contain controlled values.\n * @returns {Object} The merged controlled state.\n */\n\n\nfunction getState(state, props) {\n return Object.keys(state).reduce(function (prevState, key) {\n prevState[key] = isControlledProp(props, key) ? props[key] : state[key];\n return prevState;\n }, {});\n}\n/**\n * This determines whether a prop is a \"controlled prop\" meaning it is\n * state which is controlled by the outside of this component rather\n * than within this component.\n *\n * @param {Object} props The props that may contain controlled values.\n * @param {String} key the key to check\n * @return {Boolean} whether it is a controlled controlled prop\n */\n\n\nfunction isControlledProp(props, key) {\n return props[key] !== undefined;\n}\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n * @param {Object} event a keyboardEvent object\n * @return {String} keyboard key\n */\n\n\nfunction normalizeArrowKey(event) {\n var key = event.key,\n keyCode = event.keyCode;\n /* istanbul ignore next (ie) */\n\n if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {\n return \"Arrow\" + key;\n }\n\n return key;\n}\n/**\n * Simple check if the value passed is object literal\n * @param {*} obj any things\n * @return {Boolean} whether it's object literal\n */\n\n\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n/**\n * Returns the new index in the list, in a circular way. If next value is out of bonds from the total,\n * it will wrap to either 0 or itemCount - 1.\n *\n * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.\n * @param {number} baseIndex The initial position to move from.\n * @param {number} itemCount The total number of items.\n * @param {Function} getItemNodeFromIndex Used to check if item is disabled.\n * @param {boolean} circular Specify if navigation is circular. Default is true.\n * @returns {number} The new index after the move.\n */\n\n\nfunction getNextWrappingIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) {\n if (circular === void 0) {\n circular = true;\n }\n\n if (itemCount === 0) {\n return -1;\n }\n\n var itemsLastIndex = itemCount - 1;\n\n if (typeof baseIndex !== 'number' || baseIndex < 0 || baseIndex >= itemCount) {\n baseIndex = moveAmount > 0 ? -1 : itemsLastIndex + 1;\n }\n\n var newIndex = baseIndex + moveAmount;\n\n if (newIndex < 0) {\n newIndex = circular ? itemsLastIndex : 0;\n } else if (newIndex > itemsLastIndex) {\n newIndex = circular ? 0 : itemsLastIndex;\n }\n\n var nonDisabledNewIndex = getNextNonDisabledIndex(moveAmount, newIndex, itemCount, getItemNodeFromIndex, circular);\n\n if (nonDisabledNewIndex === -1) {\n return baseIndex >= itemCount ? -1 : baseIndex;\n }\n\n return nonDisabledNewIndex;\n}\n/**\n * Returns the next index in the list of an item that is not disabled.\n *\n * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.\n * @param {number} baseIndex The initial position to move from.\n * @param {number} itemCount The total number of items.\n * @param {Function} getItemNodeFromIndex Used to check if item is disabled.\n * @param {boolean} circular Specify if navigation is circular. Default is true.\n * @returns {number} The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1.\n */\n\n\nfunction getNextNonDisabledIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) {\n var currentElementNode = getItemNodeFromIndex(baseIndex);\n\n if (!currentElementNode || !currentElementNode.hasAttribute('disabled')) {\n return baseIndex;\n }\n\n if (moveAmount > 0) {\n for (var index = baseIndex + 1; index < itemCount; index++) {\n if (!getItemNodeFromIndex(index).hasAttribute('disabled')) {\n return index;\n }\n }\n } else {\n for (var _index = baseIndex - 1; _index >= 0; _index--) {\n if (!getItemNodeFromIndex(_index).hasAttribute('disabled')) {\n return _index;\n }\n }\n }\n\n if (circular) {\n return moveAmount > 0 ? getNextNonDisabledIndex(1, 0, itemCount, getItemNodeFromIndex, false) : getNextNonDisabledIndex(-1, itemCount - 1, itemCount, getItemNodeFromIndex, false);\n }\n\n return -1;\n}\n/**\n * Checks if event target is within the downshift elements.\n *\n * @param {EventTarget} target Target to check.\n * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).\n * @param {Window} environment The window context where downshift renders.\n * @param {boolean} checkActiveElement Whether to also check activeElement.\n *\n * @returns {boolean} Whether or not the target is within downshift elements.\n */\n\n\nfunction targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {\n if (checkActiveElement === void 0) {\n checkActiveElement = true;\n }\n\n return downshiftElements.some(function (contextNode) {\n return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment));\n });\n} // eslint-disable-next-line import/no-mutable-exports\n\n\nvar validateControlledUnchanged = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged = function validateControlledUnchanged(state, prevProps, nextProps) {\n var warningDescription = \"This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props\";\n Object.keys(state).forEach(function (propKey) {\n if (prevProps[propKey] !== undefined && nextProps[propKey] === undefined) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: A component has changed the controlled prop \\\"\" + propKey + \"\\\" to be uncontrolled. \" + warningDescription);\n } else if (prevProps[propKey] === undefined && nextProps[propKey] !== undefined) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: A component has changed the uncontrolled prop \\\"\" + propKey + \"\\\" to be controlled. \" + warningDescription);\n }\n });\n };\n}\n\nvar cleanupStatus = debounce(function (documentProp) {\n getStatusDiv(documentProp).textContent = '';\n}, 500);\n/**\n * @param {String} status the status message\n * @param {Object} documentProp document passed by the user.\n */\n\nfunction setStatus(status, documentProp) {\n var div = getStatusDiv(documentProp);\n\n if (!status) {\n return;\n }\n\n div.textContent = status;\n cleanupStatus(documentProp);\n}\n/**\n * Get the status node or create it if it does not already exist.\n * @param {Object} documentProp document passed by the user.\n * @return {HTMLElement} the status node.\n */\n\n\nfunction getStatusDiv(documentProp) {\n if (documentProp === void 0) {\n documentProp = document;\n }\n\n var statusDiv = documentProp.getElementById('a11y-status-message');\n\n if (statusDiv) {\n return statusDiv;\n }\n\n statusDiv = documentProp.createElement('div');\n statusDiv.setAttribute('id', 'a11y-status-message');\n statusDiv.setAttribute('role', 'status');\n statusDiv.setAttribute('aria-live', 'polite');\n statusDiv.setAttribute('aria-relevant', 'additions text');\n Object.assign(statusDiv.style, {\n border: '0',\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n });\n documentProp.body.appendChild(statusDiv);\n return statusDiv;\n}\n\nvar unknown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_unknown__' : 0;\nvar mouseUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_mouseup__' : 1;\nvar itemMouseEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_item_mouseenter__' : 2;\nvar keyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_up__' : 3;\nvar keyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_down__' : 4;\nvar keyDownEscape = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_escape__' : 5;\nvar keyDownEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_enter__' : 6;\nvar keyDownHome = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_home__' : 7;\nvar keyDownEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_end__' : 8;\nvar clickItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_item__' : 9;\nvar blurInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_input__' : 10;\nvar changeInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_change_input__' : 11;\nvar keyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_space_button__' : 12;\nvar clickButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_button__' : 13;\nvar blurButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_button__' : 14;\nvar controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_controlled_prop_updated_selected_item__' : 15;\nvar touchEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_touchend__' : 16;\n\nvar stateChangeTypes$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n unknown: unknown,\n mouseUp: mouseUp,\n itemMouseEnter: itemMouseEnter,\n keyDownArrowUp: keyDownArrowUp,\n keyDownArrowDown: keyDownArrowDown,\n keyDownEscape: keyDownEscape,\n keyDownEnter: keyDownEnter,\n keyDownHome: keyDownHome,\n keyDownEnd: keyDownEnd,\n clickItem: clickItem,\n blurInput: blurInput,\n changeInput: changeInput,\n keyDownSpaceButton: keyDownSpaceButton,\n clickButton: clickButton,\n blurButton: blurButton,\n controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,\n touchEnd: touchEnd\n});\n\nvar _excluded$4 = [\"refKey\", \"ref\"],\n _excluded2$3 = [\"onClick\", \"onPress\", \"onKeyDown\", \"onKeyUp\", \"onBlur\"],\n _excluded3$2 = [\"onKeyDown\", \"onBlur\", \"onChange\", \"onInput\", \"onChangeText\"],\n _excluded4$1 = [\"refKey\", \"ref\"],\n _excluded5$1 = [\"onMouseMove\", \"onMouseDown\", \"onClick\", \"onPress\", \"index\", \"item\"];\n\nvar Downshift = /*#__PURE__*/function () {\n var Downshift = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Downshift, _Component);\n\n function Downshift(_props) {\n var _this;\n\n _this = _Component.call(this, _props) || this; // fancy destructuring + defaults + aliases\n // this basically says each value of state should either be set to\n // the initial value or the default value if the initial value is not provided\n\n _this.id = _this.props.id || \"downshift-\" + generateId();\n _this.menuId = _this.props.menuId || _this.id + \"-menu\";\n _this.labelId = _this.props.labelId || _this.id + \"-label\";\n _this.inputId = _this.props.inputId || _this.id + \"-input\";\n\n _this.getItemId = _this.props.getItemId || function (index) {\n return _this.id + \"-item-\" + index;\n };\n\n _this.input = null;\n _this.items = [];\n _this.itemCount = null;\n _this.previousResultCount = 0;\n _this.timeoutIds = [];\n\n _this.internalSetTimeout = function (fn, time) {\n var id = setTimeout(function () {\n _this.timeoutIds = _this.timeoutIds.filter(function (i) {\n return i !== id;\n });\n fn();\n }, time);\n\n _this.timeoutIds.push(id);\n };\n\n _this.setItemCount = function (count) {\n _this.itemCount = count;\n };\n\n _this.unsetItemCount = function () {\n _this.itemCount = null;\n };\n\n _this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) {\n if (highlightedIndex === void 0) {\n highlightedIndex = _this.props.defaultHighlightedIndex;\n }\n\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState(_extends({\n highlightedIndex: highlightedIndex\n }, otherStateToSet));\n };\n\n _this.clearSelection = function (cb) {\n _this.internalSetState({\n selectedItem: null,\n inputValue: '',\n highlightedIndex: _this.props.defaultHighlightedIndex,\n isOpen: _this.props.defaultIsOpen\n }, cb);\n };\n\n _this.selectItem = function (item, otherStateToSet, cb) {\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState(_extends({\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n selectedItem: item,\n inputValue: _this.props.itemToString(item)\n }, otherStateToSet), cb);\n };\n\n _this.selectItemAtIndex = function (itemIndex, otherStateToSet, cb) {\n var item = _this.items[itemIndex];\n\n if (item == null) {\n return;\n }\n\n _this.selectItem(item, otherStateToSet, cb);\n };\n\n _this.selectHighlightedItem = function (otherStateToSet, cb) {\n return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb);\n };\n\n _this.internalSetState = function (stateToSet, cb) {\n var isItemSelected, onChangeArg;\n var onStateChangeArg = {};\n var isStateToSetFunction = typeof stateToSet === 'function'; // we want to call `onInputValueChange` before the `setState` call\n // so someone controlling the `inputValue` state gets notified of\n // the input change as soon as possible. This avoids issues with\n // preserving the cursor position.\n // See https://github.com/downshift-js/downshift/issues/217 for more info.\n\n if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {\n _this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet));\n }\n\n return _this.setState(function (state) {\n state = _this.getState(state);\n var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet; // Your own function that could modify the state that will be set.\n\n newStateToSet = _this.props.stateReducer(state, newStateToSet); // checks if an item is selected, regardless of if it's different from\n // what was selected before\n // used to determine if onSelect and onChange callbacks should be called\n\n isItemSelected = newStateToSet.hasOwnProperty('selectedItem'); // this keeps track of the object we want to call with setState\n\n var nextState = {}; // this is just used to tell whether the state changed\n\n var nextFullState = {}; // we need to call on change if the outside world is controlling any of our state\n // and we're trying to update that state. OR if the selection has changed and we're\n // trying to update the selection\n\n if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) {\n onChangeArg = newStateToSet.selectedItem;\n }\n\n newStateToSet.type = newStateToSet.type || unknown;\n Object.keys(newStateToSet).forEach(function (key) {\n // onStateChangeArg should only have the state that is\n // actually changing\n if (state[key] !== newStateToSet[key]) {\n onStateChangeArg[key] = newStateToSet[key];\n } // the type is useful for the onStateChangeArg\n // but we don't actually want to set it in internal state.\n // this is an undocumented feature for now... Not all internalSetState\n // calls support it and I'm not certain we want them to yet.\n // But it enables users controlling the isOpen state to know when\n // the isOpen state changes due to mouseup events which is quite handy.\n\n\n if (key === 'type') {\n return;\n }\n\n nextFullState[key] = newStateToSet[key]; // if it's coming from props, then we don't care to set it internally\n\n if (!isControlledProp(_this.props, key)) {\n nextState[key] = newStateToSet[key];\n }\n }); // if stateToSet is a function, then we weren't able to call onInputValueChange\n // earlier, so we'll call it now that we know what the inputValue state will be.\n\n if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {\n _this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet));\n }\n\n return nextState;\n }, function () {\n // call the provided callback if it's a function\n cbToCb(cb)(); // only call the onStateChange and onChange callbacks if\n // we have relevant information to pass them.\n\n var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;\n\n if (hasMoreStateThanType) {\n _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers());\n }\n\n if (isItemSelected) {\n _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers());\n }\n\n if (onChangeArg !== undefined) {\n _this.props.onChange(onChangeArg, _this.getStateAndHelpers());\n } // this is currently undocumented and therefore subject to change\n // We'll try to not break it, but just be warned.\n\n\n _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers());\n });\n };\n\n _this.rootRef = function (node) {\n return _this._rootNode = node;\n };\n\n _this.getRootProps = function (_temp, _temp2) {\n var _extends2;\n\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);\n\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n\n // this is used in the render to know whether the user has called getRootProps.\n // It uses that to know whether to apply the props automatically\n _this.getRootProps.called = true;\n _this.getRootProps.refKey = refKey;\n _this.getRootProps.suppressRefError = suppressRefError;\n\n var _this$getState = _this.getState(),\n isOpen = _this$getState.isOpen;\n\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : null, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest);\n };\n\n _this.keyDownHandlers = {\n ArrowDown: function ArrowDown(event) {\n var _this2 = this;\n\n event.preventDefault();\n\n if (this.getState().isOpen) {\n var amount = event.shiftKey ? 5 : 1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowDown\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowDown\n }, function () {\n var itemCount = _this2.getItemCount();\n\n if (itemCount > 0) {\n var _this2$getState = _this2.getState(),\n highlightedIndex = _this2$getState.highlightedIndex;\n\n var nextHighlightedIndex = getNextWrappingIndex(1, highlightedIndex, itemCount, function (index) {\n return _this2.getItemNodeFromIndex(index);\n });\n\n _this2.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowDown\n });\n }\n });\n }\n },\n ArrowUp: function ArrowUp(event) {\n var _this3 = this;\n\n event.preventDefault();\n\n if (this.getState().isOpen) {\n var amount = event.shiftKey ? -5 : -1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowUp\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowUp\n }, function () {\n var itemCount = _this3.getItemCount();\n\n if (itemCount > 0) {\n var _this3$getState = _this3.getState(),\n highlightedIndex = _this3$getState.highlightedIndex;\n\n var nextHighlightedIndex = getNextWrappingIndex(-1, highlightedIndex, itemCount, function (index) {\n return _this3.getItemNodeFromIndex(index);\n });\n\n _this3.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowUp\n });\n }\n });\n }\n },\n Enter: function Enter(event) {\n if (event.which === 229) {\n return;\n }\n\n var _this$getState2 = this.getState(),\n isOpen = _this$getState2.isOpen,\n highlightedIndex = _this$getState2.highlightedIndex;\n\n if (isOpen && highlightedIndex != null) {\n event.preventDefault();\n var item = this.items[highlightedIndex];\n var itemNode = this.getItemNodeFromIndex(highlightedIndex);\n\n if (item == null || itemNode && itemNode.hasAttribute('disabled')) {\n return;\n }\n\n this.selectHighlightedItem({\n type: keyDownEnter\n });\n }\n },\n Escape: function Escape(event) {\n event.preventDefault();\n this.reset(_extends({\n type: keyDownEscape\n }, !this.state.isOpen && {\n selectedItem: null,\n inputValue: ''\n }));\n }\n };\n _this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, {\n ' ': function _(event) {\n event.preventDefault();\n this.toggleMenu({\n type: keyDownSpaceButton\n });\n }\n });\n _this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, {\n Home: function Home(event) {\n var _this4 = this;\n\n var _this$getState3 = this.getState(),\n isOpen = _this$getState3.isOpen;\n\n if (!isOpen) {\n return;\n }\n\n event.preventDefault();\n var itemCount = this.getItemCount();\n\n if (itemCount <= 0 || !isOpen) {\n return;\n } // get next non-disabled starting downwards from 0 if that's disabled.\n\n\n var newHighlightedIndex = getNextNonDisabledIndex(1, 0, itemCount, function (index) {\n return _this4.getItemNodeFromIndex(index);\n }, false);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownHome\n });\n },\n End: function End(event) {\n var _this5 = this;\n\n var _this$getState4 = this.getState(),\n isOpen = _this$getState4.isOpen;\n\n if (!isOpen) {\n return;\n }\n\n event.preventDefault();\n var itemCount = this.getItemCount();\n\n if (itemCount <= 0 || !isOpen) {\n return;\n } // get next non-disabled starting upwards from last index if that's disabled.\n\n\n var newHighlightedIndex = getNextNonDisabledIndex(-1, itemCount - 1, itemCount, function (index) {\n return _this5.getItemNodeFromIndex(index);\n }, false);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownEnd\n });\n }\n });\n\n _this.getToggleButtonProps = function (_temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n onClick = _ref3.onClick;\n _ref3.onPress;\n var onKeyDown = _ref3.onKeyDown,\n onKeyUp = _ref3.onKeyUp,\n onBlur = _ref3.onBlur,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);\n\n var _this$getState5 = _this.getState(),\n isOpen = _this$getState5.isOpen;\n\n var enabledEventHandlers = {\n onClick: callAllEventHandlers(onClick, _this.buttonHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown),\n onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp),\n onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)\n };\n var eventHandlers = rest.disabled ? {} : enabledEventHandlers;\n return _extends({\n type: 'button',\n role: 'button',\n 'aria-label': isOpen ? 'close menu' : 'open menu',\n 'aria-haspopup': true,\n 'data-toggle': true\n }, eventHandlers, rest);\n };\n\n _this.buttonHandleKeyUp = function (event) {\n // Prevent click event from emitting in Firefox\n event.preventDefault();\n };\n\n _this.buttonHandleKeyDown = function (event) {\n var key = normalizeArrowKey(event);\n\n if (_this.buttonKeyDownHandlers[key]) {\n _this.buttonKeyDownHandlers[key].call(_assertThisInitialized(_this), event);\n }\n };\n\n _this.buttonHandleClick = function (event) {\n event.preventDefault(); // handle odd case for Safari and Firefox which\n // don't give the button the focus properly.\n\n /* istanbul ignore if (can't reasonably test this) */\n\n if (_this.props.environment.document.activeElement === _this.props.environment.document.body) {\n event.target.focus();\n } // to simplify testing components that use downshift, we'll not wrap this in a setTimeout\n // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated\n // when building for production and should therefore have no impact on production code.\n\n\n if (process.env.NODE_ENV === 'test') {\n _this.toggleMenu({\n type: clickButton\n });\n } else {\n // Ensure that toggle of menu occurs after the potential blur event in iOS\n _this.internalSetTimeout(function () {\n return _this.toggleMenu({\n type: clickButton\n });\n });\n }\n };\n\n _this.buttonHandleBlur = function (event) {\n var blurTarget = event.target; // Save blur target for comparison with activeElement later\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element\n\n _this.internalSetTimeout(function () {\n if (!_this.isMouseDown && (_this.props.environment.document.activeElement == null || _this.props.environment.document.activeElement.id !== _this.inputId) && _this.props.environment.document.activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS)\n ) {\n _this.reset({\n type: blurButton\n });\n }\n });\n };\n\n _this.getLabelProps = function (props) {\n return _extends({\n htmlFor: _this.inputId,\n id: _this.labelId\n }, props);\n };\n\n _this.getInputProps = function (_temp4) {\n var _ref4 = _temp4 === void 0 ? {} : _temp4,\n onKeyDown = _ref4.onKeyDown,\n onBlur = _ref4.onBlur,\n onChange = _ref4.onChange,\n onInput = _ref4.onInput;\n _ref4.onChangeText;\n var rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$2);\n\n var onChangeKey;\n var eventHandlers = {};\n /* istanbul ignore next (preact) */\n\n {\n onChangeKey = 'onChange';\n }\n\n var _this$getState6 = _this.getState(),\n inputValue = _this$getState6.inputValue,\n isOpen = _this$getState6.isOpen,\n highlightedIndex = _this$getState6.highlightedIndex;\n\n if (!rest.disabled) {\n var _eventHandlers;\n\n eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers);\n }\n\n return _extends({\n 'aria-autocomplete': 'list',\n 'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : null,\n 'aria-controls': isOpen ? _this.menuId : null,\n 'aria-labelledby': _this.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: inputValue,\n id: _this.inputId\n }, eventHandlers, rest);\n };\n\n _this.inputHandleKeyDown = function (event) {\n var key = normalizeArrowKey(event);\n\n if (key && _this.inputKeyDownHandlers[key]) {\n _this.inputKeyDownHandlers[key].call(_assertThisInitialized(_this), event);\n }\n };\n\n _this.inputHandleChange = function (event) {\n _this.internalSetState({\n type: changeInput,\n isOpen: true,\n inputValue: event.target.value,\n highlightedIndex: _this.props.defaultHighlightedIndex\n });\n };\n\n _this.inputHandleBlur = function () {\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element\n _this.internalSetTimeout(function () {\n var downshiftButtonIsActive = _this.props.environment.document && !!_this.props.environment.document.activeElement && !!_this.props.environment.document.activeElement.dataset && _this.props.environment.document.activeElement.dataset.toggle && _this._rootNode && _this._rootNode.contains(_this.props.environment.document.activeElement);\n\n if (!_this.isMouseDown && !downshiftButtonIsActive) {\n _this.reset({\n type: blurInput\n });\n }\n });\n };\n\n _this.menuRef = function (node) {\n _this._menuNode = node;\n };\n\n _this.getMenuProps = function (_temp5, _temp6) {\n var _extends3;\n\n var _ref5 = _temp5 === void 0 ? {} : _temp5,\n _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n props = _objectWithoutPropertiesLoose(_ref5, _excluded4$1);\n\n var _ref6 = _temp6 === void 0 ? {} : _temp6,\n _ref6$suppressRefErro = _ref6.suppressRefError,\n suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro;\n\n _this.getMenuProps.called = true;\n _this.getMenuProps.refKey = refKey;\n _this.getMenuProps.suppressRefError = suppressRefError;\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = 'listbox', _extends3['aria-labelledby'] = props && props['aria-label'] ? null : _this.labelId, _extends3.id = _this.menuId, _extends3), props);\n };\n\n _this.getItemProps = function (_temp7) {\n var _enabledEventHandlers;\n\n var _ref7 = _temp7 === void 0 ? {} : _temp7,\n onMouseMove = _ref7.onMouseMove,\n onMouseDown = _ref7.onMouseDown,\n onClick = _ref7.onClick;\n _ref7.onPress;\n var index = _ref7.index,\n _ref7$item = _ref7.item,\n item = _ref7$item === void 0 ? process.env.NODE_ENV === 'production' ?\n /* istanbul ignore next */\n undefined : requiredProp('getItemProps', 'item') : _ref7$item,\n rest = _objectWithoutPropertiesLoose(_ref7, _excluded5$1);\n\n if (index === undefined) {\n _this.items.push(item);\n\n index = _this.items.indexOf(item);\n } else {\n _this.items[index] = item;\n }\n\n var onSelectKey = 'onClick';\n var customClickHandler = onClick;\n var enabledEventHandlers = (_enabledEventHandlers = {\n // onMouseMove is used over onMouseEnter here. onMouseMove\n // is only triggered on actual mouse movement while onMouseEnter\n // can fire on DOM changes, interrupting keyboard navigation\n onMouseMove: callAllEventHandlers(onMouseMove, function () {\n if (index === _this.getState().highlightedIndex) {\n return;\n }\n\n _this.setHighlightedIndex(index, {\n type: itemMouseEnter\n }); // We never want to manually scroll when changing state based\n // on `onMouseMove` because we will be moving the element out\n // from under the user which is currently scrolling/moving the\n // cursor\n\n\n _this.avoidScrolling = true;\n\n _this.internalSetTimeout(function () {\n return _this.avoidScrolling = false;\n }, 250);\n }),\n onMouseDown: callAllEventHandlers(onMouseDown, function (event) {\n // This prevents the activeElement from being changed\n // to the item so it can remain with the current activeElement\n // which is a more common use case.\n event.preventDefault();\n })\n }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function () {\n _this.selectItemAtIndex(index, {\n type: clickItem\n });\n }), _enabledEventHandlers); // Passing down the onMouseDown handler to prevent redirect\n // of the activeElement if clicking on disabled items\n\n var eventHandlers = rest.disabled ? {\n onMouseDown: enabledEventHandlers.onMouseDown\n } : enabledEventHandlers;\n return _extends({\n id: _this.getItemId(index),\n role: 'option',\n 'aria-selected': _this.getState().highlightedIndex === index\n }, eventHandlers, rest);\n };\n\n _this.clearItems = function () {\n _this.items = [];\n };\n\n _this.reset = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState(function (_ref8) {\n var selectedItem = _ref8.selectedItem;\n return _extends({\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n inputValue: _this.props.itemToString(selectedItem)\n }, otherStateToSet);\n }, cb);\n };\n\n _this.toggleMenu = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState(function (_ref9) {\n var isOpen = _ref9.isOpen;\n return _extends({\n isOpen: !isOpen\n }, isOpen && {\n highlightedIndex: _this.props.defaultHighlightedIndex\n }, otherStateToSet);\n }, function () {\n var _this$getState7 = _this.getState(),\n isOpen = _this$getState7.isOpen,\n highlightedIndex = _this$getState7.highlightedIndex;\n\n if (isOpen) {\n if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') {\n _this.setHighlightedIndex(highlightedIndex, otherStateToSet);\n }\n }\n\n cbToCb(cb)();\n });\n };\n\n _this.openMenu = function (cb) {\n _this.internalSetState({\n isOpen: true\n }, cb);\n };\n\n _this.closeMenu = function (cb) {\n _this.internalSetState({\n isOpen: false\n }, cb);\n };\n\n _this.updateStatus = debounce(function () {\n var state = _this.getState();\n\n var item = _this.items[state.highlightedIndex];\n\n var resultCount = _this.getItemCount();\n\n var status = _this.props.getA11yStatusMessage(_extends({\n itemToString: _this.props.itemToString,\n previousResultCount: _this.previousResultCount,\n resultCount: resultCount,\n highlightedItem: item\n }, state));\n\n _this.previousResultCount = resultCount;\n setStatus(status, _this.props.environment.document);\n }, 200);\n\n var _this$props = _this.props,\n defaultHighlightedIndex = _this$props.defaultHighlightedIndex,\n _this$props$initialHi = _this$props.initialHighlightedIndex,\n _highlightedIndex = _this$props$initialHi === void 0 ? defaultHighlightedIndex : _this$props$initialHi,\n defaultIsOpen = _this$props.defaultIsOpen,\n _this$props$initialIs = _this$props.initialIsOpen,\n _isOpen = _this$props$initialIs === void 0 ? defaultIsOpen : _this$props$initialIs,\n _this$props$initialIn = _this$props.initialInputValue,\n _inputValue = _this$props$initialIn === void 0 ? '' : _this$props$initialIn,\n _this$props$initialSe = _this$props.initialSelectedItem,\n _selectedItem = _this$props$initialSe === void 0 ? null : _this$props$initialSe;\n\n var _state = _this.getState({\n highlightedIndex: _highlightedIndex,\n isOpen: _isOpen,\n inputValue: _inputValue,\n selectedItem: _selectedItem\n });\n\n if (_state.selectedItem != null && _this.props.initialInputValue === undefined) {\n _state.inputValue = _this.props.itemToString(_state.selectedItem);\n }\n\n _this.state = _state;\n return _this;\n }\n\n var _proto = Downshift.prototype;\n\n /**\n * Clear all running timeouts\n */\n _proto.internalClearTimeouts = function internalClearTimeouts() {\n this.timeoutIds.forEach(function (id) {\n clearTimeout(id);\n });\n this.timeoutIds = [];\n }\n /**\n * Gets the state based on internal state or props\n * If a state value is passed via props, then that\n * is the value given, otherwise it's retrieved from\n * stateToMerge\n *\n * @param {Object} stateToMerge defaults to this.state\n * @return {Object} the state\n */\n ;\n\n _proto.getState = function getState$1(stateToMerge) {\n if (stateToMerge === void 0) {\n stateToMerge = this.state;\n }\n\n return getState(stateToMerge, this.props);\n };\n\n _proto.getItemCount = function getItemCount() {\n // things read better this way. They're in priority order:\n // 1. `this.itemCount`\n // 2. `this.props.itemCount`\n // 3. `this.items.length`\n var itemCount = this.items.length;\n\n if (this.itemCount != null) {\n itemCount = this.itemCount;\n } else if (this.props.itemCount !== undefined) {\n itemCount = this.props.itemCount;\n }\n\n return itemCount;\n };\n\n _proto.getItemNodeFromIndex = function getItemNodeFromIndex(index) {\n return this.props.environment.document.getElementById(this.getItemId(index));\n };\n\n _proto.scrollHighlightedItemIntoView = function scrollHighlightedItemIntoView() {\n /* istanbul ignore else (react-native) */\n {\n var node = this.getItemNodeFromIndex(this.getState().highlightedIndex);\n this.props.scrollIntoView(node, this._menuNode);\n }\n };\n\n _proto.moveHighlightedIndex = function moveHighlightedIndex(amount, otherStateToSet) {\n var _this6 = this;\n\n var itemCount = this.getItemCount();\n\n var _this$getState8 = this.getState(),\n highlightedIndex = _this$getState8.highlightedIndex;\n\n if (itemCount > 0) {\n var nextHighlightedIndex = getNextWrappingIndex(amount, highlightedIndex, itemCount, function (index) {\n return _this6.getItemNodeFromIndex(index);\n });\n this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);\n }\n };\n\n _proto.getStateAndHelpers = function getStateAndHelpers() {\n var _this$getState9 = this.getState(),\n highlightedIndex = _this$getState9.highlightedIndex,\n inputValue = _this$getState9.inputValue,\n selectedItem = _this$getState9.selectedItem,\n isOpen = _this$getState9.isOpen;\n\n var itemToString = this.props.itemToString;\n var id = this.id;\n var getRootProps = this.getRootProps,\n getToggleButtonProps = this.getToggleButtonProps,\n getLabelProps = this.getLabelProps,\n getMenuProps = this.getMenuProps,\n getInputProps = this.getInputProps,\n getItemProps = this.getItemProps,\n openMenu = this.openMenu,\n closeMenu = this.closeMenu,\n toggleMenu = this.toggleMenu,\n selectItem = this.selectItem,\n selectItemAtIndex = this.selectItemAtIndex,\n selectHighlightedItem = this.selectHighlightedItem,\n setHighlightedIndex = this.setHighlightedIndex,\n clearSelection = this.clearSelection,\n clearItems = this.clearItems,\n reset = this.reset,\n setItemCount = this.setItemCount,\n unsetItemCount = this.unsetItemCount,\n setState = this.internalSetState;\n return {\n // prop getters\n getRootProps: getRootProps,\n getToggleButtonProps: getToggleButtonProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getInputProps: getInputProps,\n getItemProps: getItemProps,\n // actions\n reset: reset,\n openMenu: openMenu,\n closeMenu: closeMenu,\n toggleMenu: toggleMenu,\n selectItem: selectItem,\n selectItemAtIndex: selectItemAtIndex,\n selectHighlightedItem: selectHighlightedItem,\n setHighlightedIndex: setHighlightedIndex,\n clearSelection: clearSelection,\n clearItems: clearItems,\n setItemCount: setItemCount,\n unsetItemCount: unsetItemCount,\n setState: setState,\n // props\n itemToString: itemToString,\n // derived\n id: id,\n // state\n highlightedIndex: highlightedIndex,\n inputValue: inputValue,\n isOpen: isOpen,\n selectedItem: selectedItem\n };\n } //////////////////////////// ROOT\n ;\n\n _proto.componentDidMount = function componentDidMount() {\n var _this7 = this;\n\n /* istanbul ignore if (react-native) */\n if (process.env.NODE_ENV !== 'production' && !false && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n /* istanbul ignore if (react-native) */\n\n\n {\n // this.isMouseDown helps us track whether the mouse is currently held down.\n // This is useful when the user clicks on an item in the list, but holds the mouse\n // down long enough for the list to disappear (because the blur event fires on the input)\n // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should\n // trigger hiding the menu.\n var onMouseDown = function onMouseDown() {\n _this7.isMouseDown = true;\n };\n\n var onMouseUp = function onMouseUp(event) {\n _this7.isMouseDown = false; // if the target element or the activeElement is within a downshift node\n // then we don't want to reset downshift\n\n var contextWithinDownshift = targetWithinDownshift(event.target, [_this7._rootNode, _this7._menuNode], _this7.props.environment);\n\n if (!contextWithinDownshift && _this7.getState().isOpen) {\n _this7.reset({\n type: mouseUp\n }, function () {\n return _this7.props.onOuterClick(_this7.getStateAndHelpers());\n });\n }\n }; // Touching an element in iOS gives focus and hover states, but touching out of\n // the element will remove hover, and persist the focus state, resulting in the\n // blur event not being triggered.\n // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.\n // If the user taps outside of Downshift, the component should be reset,\n // but not if the user is swiping\n\n\n var onTouchStart = function onTouchStart() {\n _this7.isTouchMove = false;\n };\n\n var onTouchMove = function onTouchMove() {\n _this7.isTouchMove = true;\n };\n\n var onTouchEnd = function onTouchEnd(event) {\n var contextWithinDownshift = targetWithinDownshift(event.target, [_this7._rootNode, _this7._menuNode], _this7.props.environment, false);\n\n if (!_this7.isTouchMove && !contextWithinDownshift && _this7.getState().isOpen) {\n _this7.reset({\n type: touchEnd\n }, function () {\n return _this7.props.onOuterClick(_this7.getStateAndHelpers());\n });\n }\n };\n\n var environment = this.props.environment;\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n\n this.cleanup = function () {\n _this7.internalClearTimeouts();\n\n _this7.updateStatus.cancel();\n\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n };\n }\n };\n\n _proto.shouldScroll = function shouldScroll(prevState, prevProps) {\n var _ref10 = this.props.highlightedIndex === undefined ? this.getState() : this.props,\n currentHighlightedIndex = _ref10.highlightedIndex;\n\n var _ref11 = prevProps.highlightedIndex === undefined ? prevState : prevProps,\n prevHighlightedIndex = _ref11.highlightedIndex;\n\n var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;\n var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;\n return scrollWhenOpen || scrollWhenNavigating;\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged(this.state, prevProps, this.props);\n /* istanbul ignore if (react-native) */\n\n if (this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n }\n\n if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) {\n this.internalSetState({\n type: controlledPropUpdatedSelectedItem,\n inputValue: this.props.itemToString(this.props.selectedItem)\n });\n }\n\n if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {\n this.scrollHighlightedItemIntoView();\n }\n /* istanbul ignore else (react-native) */\n\n\n {\n this.updateStatus();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cleanup(); // avoids memory leak\n };\n\n _proto.render = function render() {\n var children = unwrapArray(this.props.children, noop); // because the items are rerendered every time we call the children\n // we clear this out each render and it will be populated again as\n // getItemProps is called.\n\n this.clearItems(); // we reset this so we know whether the user calls getRootProps during\n // this render. If they do then we don't need to do anything,\n // if they don't then we need to clone the element they return and\n // apply the props for them.\n\n this.getRootProps.called = false;\n this.getRootProps.refKey = undefined;\n this.getRootProps.suppressRefError = undefined; // we do something similar for getMenuProps\n\n this.getMenuProps.called = false;\n this.getMenuProps.refKey = undefined;\n this.getMenuProps.suppressRefError = undefined; // we do something similar for getLabelProps\n\n this.getLabelProps.called = false; // and something similar for getInputProps\n\n this.getInputProps.called = false;\n var element = unwrapArray(children(this.getStateAndHelpers()));\n\n if (!element) {\n return null;\n }\n\n if (this.getRootProps.called || this.props.suppressRefError) {\n if (process.env.NODE_ENV !== 'production' && !this.getRootProps.suppressRefError && !this.props.suppressRefError) {\n validateGetRootPropsCalledCorrectly(element, this.getRootProps);\n }\n\n return element;\n } else if (isDOMElement(element)) {\n // they didn't apply the root props, but we can clone\n // this and apply the props ourselves\n return /*#__PURE__*/cloneElement(element, this.getRootProps(getElementProps(element)));\n }\n /* istanbul ignore else */\n\n\n if (process.env.NODE_ENV !== 'production') {\n // they didn't apply the root props, but they need to\n // otherwise we can't query around the autocomplete\n throw new Error('downshift: If you return a non-DOM element, you must apply the getRootProps function');\n }\n /* istanbul ignore next */\n\n\n return undefined;\n };\n\n return Downshift;\n }(Component);\n\n Downshift.defaultProps = {\n defaultHighlightedIndex: null,\n defaultIsOpen: false,\n getA11yStatusMessage: getA11yStatusMessage$1,\n itemToString: function itemToString(i) {\n if (i == null) {\n return '';\n }\n\n if (process.env.NODE_ENV !== 'production' && isPlainObject(i) && !i.hasOwnProperty('toString')) {\n // eslint-disable-next-line no-console\n console.warn('downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.', 'The object that was passed:', i);\n }\n\n return String(i);\n },\n onStateChange: noop,\n onInputValueChange: noop,\n onUserAction: noop,\n onChange: noop,\n onSelect: noop,\n onOuterClick: noop,\n selectedItemChanged: function selectedItemChanged(prevItem, item) {\n return prevItem !== item;\n },\n environment:\n /* istanbul ignore next (ssr) */\n typeof window === 'undefined' ? {} : window,\n stateReducer: function stateReducer(state, stateToSet) {\n return stateToSet;\n },\n suppressRefError: false,\n scrollIntoView: scrollIntoView\n };\n Downshift.stateChangeTypes = stateChangeTypes$3;\n return Downshift;\n}();\n\nprocess.env.NODE_ENV !== \"production\" ? Downshift.propTypes = {\n children: PropTypes.func,\n defaultHighlightedIndex: PropTypes.number,\n defaultIsOpen: PropTypes.bool,\n initialHighlightedIndex: PropTypes.number,\n initialSelectedItem: PropTypes.any,\n initialInputValue: PropTypes.string,\n initialIsOpen: PropTypes.bool,\n getA11yStatusMessage: PropTypes.func,\n itemToString: PropTypes.func,\n onChange: PropTypes.func,\n onSelect: PropTypes.func,\n onStateChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n onUserAction: PropTypes.func,\n onOuterClick: PropTypes.func,\n selectedItemChanged: PropTypes.func,\n stateReducer: PropTypes.func,\n itemCount: PropTypes.number,\n id: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n }),\n suppressRefError: PropTypes.bool,\n scrollIntoView: PropTypes.func,\n // things we keep in state for uncontrolled components\n // but can accept as props for controlled components\n\n /* eslint-disable react/no-unused-prop-types */\n selectedItem: PropTypes.any,\n isOpen: PropTypes.bool,\n inputValue: PropTypes.string,\n highlightedIndex: PropTypes.number,\n labelId: PropTypes.string,\n inputId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func\n /* eslint-enable react/no-unused-prop-types */\n\n} : void 0;\nvar Downshift$1 = Downshift;\n\nfunction validateGetMenuPropsCalledCorrectly(node, _ref12) {\n var refKey = _ref12.refKey;\n\n if (!node) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: The ref prop \\\"\" + refKey + \"\\\" from getMenuProps was not applied correctly on your menu element.\");\n }\n}\n\nfunction validateGetRootPropsCalledCorrectly(element, _ref13) {\n var refKey = _ref13.refKey;\n var refKeySpecified = refKey !== 'ref';\n var isComposite = !isDOMElement(element);\n\n if (isComposite && !refKeySpecified && !isForwardRef(element)) {\n // eslint-disable-next-line no-console\n console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');\n } else if (!isComposite && refKeySpecified) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \\\"\" + refKey + \"\\\"\");\n }\n\n if (!isForwardRef(element) && !getElementProps(element)[refKey]) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You must apply the ref prop \\\"\" + refKey + \"\\\" from getRootProps onto your root element.\");\n }\n}\n\nvar _excluded$3 = [\"isInitialMount\", \"highlightedIndex\", \"items\", \"environment\"];\nvar dropdownDefaultStateValues = {\n highlightedIndex: -1,\n isOpen: false,\n selectedItem: null,\n inputValue: ''\n};\n\nfunction callOnChangeProps(action, state, newState) {\n var props = action.props,\n type = action.type;\n var changes = {};\n Object.keys(state).forEach(function (key) {\n invokeOnChangeHandler(key, action, state, newState);\n\n if (newState[key] !== state[key]) {\n changes[key] = newState[key];\n }\n });\n\n if (props.onStateChange && Object.keys(changes).length) {\n props.onStateChange(_extends({\n type: type\n }, changes));\n }\n}\n\nfunction invokeOnChangeHandler(key, action, state, newState) {\n var props = action.props,\n type = action.type;\n var handler = \"on\" + capitalizeString(key) + \"Change\";\n\n if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {\n props[handler](_extends({\n type: type\n }, newState));\n }\n}\n/**\n * Default state reducer that returns the changes.\n *\n * @param {Object} s state.\n * @param {Object} a action with changes.\n * @returns {Object} changes.\n */\n\n\nfunction stateReducer(s, a) {\n return a.changes;\n}\n/**\n * Returns a message to be added to aria-live region when item is selected.\n *\n * @param {Object} selectionParameters Parameters required to build the message.\n * @returns {string} The a11y message.\n */\n\n\nfunction getA11ySelectionMessage(selectionParameters) {\n var selectedItem = selectionParameters.selectedItem,\n itemToStringLocal = selectionParameters.itemToString;\n return selectedItem ? itemToStringLocal(selectedItem) + \" has been selected.\" : '';\n}\n/**\n * Debounced call for updating the a11y message.\n */\n\n\nvar updateA11yStatus = debounce(function (getA11yMessage, document) {\n setStatus(getA11yMessage(), document);\n}, 200); // istanbul ignore next\n\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\nfunction useElementIds(_ref) {\n var _ref$id = _ref.id,\n id = _ref$id === void 0 ? \"downshift-\" + generateId() : _ref$id,\n labelId = _ref.labelId,\n menuId = _ref.menuId,\n getItemId = _ref.getItemId,\n toggleButtonId = _ref.toggleButtonId,\n inputId = _ref.inputId;\n var elementIdsRef = useRef({\n labelId: labelId || id + \"-label\",\n menuId: menuId || id + \"-menu\",\n getItemId: getItemId || function (index) {\n return id + \"-item-\" + index;\n },\n toggleButtonId: toggleButtonId || id + \"-toggle-button\",\n inputId: inputId || id + \"-input\"\n });\n return elementIdsRef.current;\n}\n\nfunction getItemIndex(index, item, items) {\n if (index !== undefined) {\n return index;\n }\n\n if (items.length === 0) {\n return -1;\n }\n\n return items.indexOf(item);\n}\n\nfunction itemToString(item) {\n return item ? String(item) : '';\n}\n\nfunction isAcceptedCharacterKey(key) {\n return /^\\S{1}$/.test(key);\n}\n\nfunction capitalizeString(string) {\n return \"\" + string.slice(0, 1).toUpperCase() + string.slice(1);\n}\n\nfunction useLatestRef(val) {\n var ref = useRef(val); // technically this is not \"concurrent mode safe\" because we're manipulating\n // the value during render (so it's not idempotent). However, the places this\n // hook is used is to support memoizing callbacks which will be called\n // *during* render, so we need the latest values *during* render.\n // If not for this, then we'd probably want to use useLayoutEffect instead.\n\n ref.current = val;\n return ref;\n}\n/**\n * Computes the controlled state using a the previous state, props,\n * two reducers, one from downshift and an optional one from the user.\n * Also calls the onChange handlers for state values that have changed.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} initialState Initial state of the hook.\n * @param {Object} props The hook props.\n * @returns {Array} An array with the state and an action dispatcher.\n */\n\n\nfunction useEnhancedReducer(reducer, initialState, props) {\n var prevStateRef = useRef();\n var actionRef = useRef();\n var enhancedReducer = useCallback(function (state, action) {\n actionRef.current = action;\n state = getState(state, action.props);\n var changes = reducer(state, action);\n var newState = action.props.stateReducer(state, _extends({}, action, {\n changes: changes\n }));\n return newState;\n }, [reducer]);\n\n var _useReducer = useReducer(enhancedReducer, initialState),\n state = _useReducer[0],\n dispatch = _useReducer[1];\n\n var propsRef = useLatestRef(props);\n var dispatchWithProps = useCallback(function (action) {\n return dispatch(_extends({\n props: propsRef.current\n }, action));\n }, [propsRef]);\n var action = actionRef.current;\n useEffect(function () {\n if (action && prevStateRef.current && prevStateRef.current !== state) {\n callOnChangeProps(action, getState(prevStateRef.current, action.props), state);\n }\n\n prevStateRef.current = state;\n }, [state, props, action]);\n return [state, dispatchWithProps];\n}\n/**\n * Wraps the useEnhancedReducer and applies the controlled prop values before\n * returning the new state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} initialState Initial state of the hook.\n * @param {Object} props The hook props.\n * @returns {Array} An array with the state and an action dispatcher.\n */\n\n\nfunction useControlledReducer$1(reducer, initialState, props) {\n var _useEnhancedReducer = useEnhancedReducer(reducer, initialState, props),\n state = _useEnhancedReducer[0],\n dispatch = _useEnhancedReducer[1];\n\n return [getState(state, props), dispatch];\n}\n\nvar defaultProps$3 = {\n itemToString: itemToString,\n stateReducer: stateReducer,\n getA11ySelectionMessage: getA11ySelectionMessage,\n scrollIntoView: scrollIntoView,\n circularNavigation: false,\n environment:\n /* istanbul ignore next (ssr) */\n typeof window === 'undefined' ? {} : window\n};\n\nfunction getDefaultValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n\n var defaultPropKey = \"default\" + capitalizeString(propKey);\n\n if (defaultPropKey in props) {\n return props[defaultPropKey];\n }\n\n return defaultStateValues[propKey];\n}\n\nfunction getInitialValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n\n if (propKey in props) {\n return props[propKey];\n }\n\n var initialPropKey = \"initial\" + capitalizeString(propKey);\n\n if (initialPropKey in props) {\n return props[initialPropKey];\n }\n\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\n\nfunction getInitialState$2(props) {\n var selectedItem = getInitialValue$1(props, 'selectedItem');\n var isOpen = getInitialValue$1(props, 'isOpen');\n var highlightedIndex = getInitialValue$1(props, 'highlightedIndex');\n var inputValue = getInitialValue$1(props, 'inputValue');\n return {\n highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nfunction getHighlightedIndexOnOpen(props, state, offset, getItemNodeFromIndex) {\n var items = props.items,\n initialHighlightedIndex = props.initialHighlightedIndex,\n defaultHighlightedIndex = props.defaultHighlightedIndex;\n var selectedItem = state.selectedItem,\n highlightedIndex = state.highlightedIndex;\n\n if (items.length === 0) {\n return -1;\n } // initialHighlightedIndex will give value to highlightedIndex on initial state only.\n\n\n if (initialHighlightedIndex !== undefined && highlightedIndex === initialHighlightedIndex) {\n return initialHighlightedIndex;\n }\n\n if (defaultHighlightedIndex !== undefined) {\n return defaultHighlightedIndex;\n }\n\n if (selectedItem) {\n if (offset === 0) {\n return items.indexOf(selectedItem);\n }\n\n return getNextWrappingIndex(offset, items.indexOf(selectedItem), items.length, getItemNodeFromIndex, false);\n }\n\n if (offset === 0) {\n return -1;\n }\n\n return offset < 0 ? items.length - 1 : 0;\n}\n/**\n * Reuse the movement tracking of mouse and touch events.\n *\n * @param {boolean} isOpen Whether the dropdown is open or not.\n * @param {Array} downshiftElementRefs Downshift element refs to track movement (toggleButton, menu etc.)\n * @param {Object} environment Environment where component/hook exists.\n * @param {Function} handleBlur Handler on blur from mouse or touch.\n * @returns {Object} Ref containing whether mouseDown or touchMove event is happening\n */\n\n\nfunction useMouseAndTouchTracker(isOpen, downshiftElementRefs, environment, handleBlur) {\n var mouseAndTouchTrackersRef = useRef({\n isMouseDown: false,\n isTouchMove: false\n });\n useEffect(function () {\n // The same strategy for checking if a click occurred inside or outside downsift\n // as in downshift.js.\n var onMouseDown = function onMouseDown() {\n mouseAndTouchTrackersRef.current.isMouseDown = true;\n };\n\n var onMouseUp = function onMouseUp(event) {\n mouseAndTouchTrackersRef.current.isMouseDown = false;\n\n if (isOpen && !targetWithinDownshift(event.target, downshiftElementRefs.map(function (ref) {\n return ref.current;\n }), environment)) {\n handleBlur();\n }\n };\n\n var onTouchStart = function onTouchStart() {\n mouseAndTouchTrackersRef.current.isTouchMove = false;\n };\n\n var onTouchMove = function onTouchMove() {\n mouseAndTouchTrackersRef.current.isTouchMove = true;\n };\n\n var onTouchEnd = function onTouchEnd(event) {\n if (isOpen && !mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElementRefs.map(function (ref) {\n return ref.current;\n }), environment, false)) {\n handleBlur();\n }\n };\n\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n return function cleanup() {\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, environment]);\n return mouseAndTouchTrackersRef;\n}\n/* istanbul ignore next */\n// eslint-disable-next-line import/no-mutable-exports\n\n\nvar useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {\n return noop;\n};\n/**\n * Custom hook that checks if getter props are called correctly.\n *\n * @param {...any} propKeys Getter prop names to be handled.\n * @returns {Function} Setter function called inside getter props to set call information.\n */\n\n/* istanbul ignore next */\n\n\nif (process.env.NODE_ENV !== 'production') {\n useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {\n var isInitialMountRef = useRef(true);\n\n for (var _len = arguments.length, propKeys = new Array(_len), _key = 0; _key < _len; _key++) {\n propKeys[_key] = arguments[_key];\n }\n\n var getterPropsCalledRef = useRef(propKeys.reduce(function (acc, propKey) {\n acc[propKey] = {};\n return acc;\n }, {}));\n useEffect(function () {\n Object.keys(getterPropsCalledRef.current).forEach(function (propKey) {\n var propCallInfo = getterPropsCalledRef.current[propKey];\n\n if (isInitialMountRef.current) {\n if (!Object.keys(propCallInfo).length) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You forgot to call the \" + propKey + \" getter function on your component / element.\");\n return;\n }\n }\n\n var suppressRefError = propCallInfo.suppressRefError,\n refKey = propCallInfo.refKey,\n elementRef = propCallInfo.elementRef;\n\n if ((!elementRef || !elementRef.current) && !suppressRefError) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: The ref prop \\\"\" + refKey + \"\\\" from \" + propKey + \" was not applied correctly on your element.\");\n }\n });\n isInitialMountRef.current = false;\n });\n var setGetterPropCallInfo = useCallback(function (propKey, suppressRefError, refKey, elementRef) {\n getterPropsCalledRef.current[propKey] = {\n suppressRefError: suppressRefError,\n refKey: refKey,\n elementRef: elementRef\n };\n }, []);\n return setGetterPropCallInfo;\n };\n}\n\nfunction useA11yMessageSetter(getA11yMessage, dependencyArray, _ref2) {\n var isInitialMount = _ref2.isInitialMount,\n highlightedIndex = _ref2.highlightedIndex,\n items = _ref2.items,\n environment = _ref2.environment,\n rest = _objectWithoutPropertiesLoose(_ref2, _excluded$3);\n\n // Sets a11y status message on changes in state.\n useEffect(function () {\n if (isInitialMount || false) {\n return;\n }\n\n updateA11yStatus(function () {\n return getA11yMessage(_extends({\n highlightedIndex: highlightedIndex,\n highlightedItem: items[highlightedIndex],\n resultCount: items.length\n }, rest));\n }, environment.document); // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencyArray);\n}\n\nfunction useScrollIntoView(_ref3) {\n var highlightedIndex = _ref3.highlightedIndex,\n isOpen = _ref3.isOpen,\n itemRefs = _ref3.itemRefs,\n getItemNodeFromIndex = _ref3.getItemNodeFromIndex,\n menuElement = _ref3.menuElement,\n scrollIntoViewProp = _ref3.scrollIntoView;\n // used not to scroll on highlight by mouse.\n var shouldScrollRef = useRef(true); // Scroll on highlighted item if change comes from keyboard.\n\n useIsomorphicLayoutEffect(function () {\n if (highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length) {\n return;\n }\n\n if (shouldScrollRef.current === false) {\n shouldScrollRef.current = true;\n } else {\n scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement);\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [highlightedIndex]);\n return shouldScrollRef;\n} // eslint-disable-next-line import/no-mutable-exports\n\n\nvar useControlPropsValidator = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n useControlPropsValidator = function useControlPropsValidator(_ref4) {\n var isInitialMount = _ref4.isInitialMount,\n props = _ref4.props,\n state = _ref4.state;\n // used for checking when props are moving from controlled to uncontrolled.\n var prevPropsRef = useRef(props);\n useEffect(function () {\n if (isInitialMount) {\n return;\n }\n\n validateControlledUnchanged(state, prevPropsRef.current, props);\n prevPropsRef.current = props;\n }, [state, props, isInitialMount]);\n };\n}\n\n/* eslint-disable complexity */\n\nfunction downshiftCommonReducer(state, action, stateChangeTypes) {\n var type = action.type,\n props = action.props;\n var changes;\n\n switch (type) {\n case stateChangeTypes.ItemMouseMove:\n changes = {\n highlightedIndex: action.index\n };\n break;\n\n case stateChangeTypes.MenuMouseLeave:\n changes = {\n highlightedIndex: -1\n };\n break;\n\n case stateChangeTypes.ToggleButtonClick:\n case stateChangeTypes.FunctionToggleMenu:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n\n case stateChangeTypes.FunctionOpenMenu:\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n\n case stateChangeTypes.FunctionCloseMenu:\n changes = {\n isOpen: false\n };\n break;\n\n case stateChangeTypes.FunctionSetHighlightedIndex:\n changes = {\n highlightedIndex: action.highlightedIndex\n };\n break;\n\n case stateChangeTypes.FunctionSetInputValue:\n changes = {\n inputValue: action.inputValue\n };\n break;\n\n case stateChangeTypes.FunctionReset:\n changes = {\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n isOpen: getDefaultValue$1(props, 'isOpen'),\n selectedItem: getDefaultValue$1(props, 'selectedItem'),\n inputValue: getDefaultValue$1(props, 'inputValue')\n };\n break;\n\n default:\n throw new Error('Reducer called without proper action type.');\n }\n\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nfunction getItemIndexByCharacterKey(_a) {\n var keysSoFar = _a.keysSoFar, highlightedIndex = _a.highlightedIndex, items = _a.items, itemToString = _a.itemToString, getItemNodeFromIndex = _a.getItemNodeFromIndex;\n var lowerCasedKeysSoFar = keysSoFar.toLowerCase();\n for (var index = 0; index < items.length; index++) {\n var offsetIndex = (index + highlightedIndex + 1) % items.length;\n var item = items[offsetIndex];\n if (item !== undefined &&\n itemToString(item)\n .toLowerCase()\n .startsWith(lowerCasedKeysSoFar)) {\n var element = getItemNodeFromIndex(offsetIndex);\n if (!(element === null || element === void 0 ? void 0 : element.hasAttribute('disabled'))) {\n return offsetIndex;\n }\n }\n }\n return highlightedIndex;\n}\nvar propTypes$2 = {\n items: PropTypes.array.isRequired,\n itemToString: PropTypes.func,\n getA11yStatusMessage: PropTypes.func,\n getA11ySelectionMessage: PropTypes.func,\n circularNavigation: PropTypes.bool,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n toggleButtonId: PropTypes.string,\n stateReducer: PropTypes.func,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n })\n};\n/**\n * Default implementation for status message. Only added when menu is open.\n * Will specift if there are results in the list, and if so, how many,\n * and what keys are relevant.\n *\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\nfunction getA11yStatusMessage(_a) {\n var isOpen = _a.isOpen, resultCount = _a.resultCount, previousResultCount = _a.previousResultCount;\n if (!isOpen) {\n return '';\n }\n if (!resultCount) {\n return 'No results are available.';\n }\n if (resultCount !== previousResultCount) {\n return resultCount + \" result\" + (resultCount === 1 ? ' is' : 's are') + \" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.\";\n }\n return '';\n}\nvar defaultProps$2 = __assign(__assign({}, defaultProps$3), { getA11yStatusMessage: getA11yStatusMessage });\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes$2 = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$2 = function (options, caller) {\n PropTypes.checkPropTypes(propTypes$2, options, 'prop', caller.name);\n };\n}\n\nvar MenuKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_arrow_down__' : 0;\nvar MenuKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_arrow_up__' : 1;\nvar MenuKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_escape__' : 2;\nvar MenuKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_home__' : 3;\nvar MenuKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_end__' : 4;\nvar MenuKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_enter__' : 5;\nvar MenuKeyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_space_button__' : 6;\nvar MenuKeyDownCharacter = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_character__' : 7;\nvar MenuBlur = process.env.NODE_ENV !== \"production\" ? '__menu_blur__' : 8;\nvar MenuMouseLeave$1 = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 9;\nvar ItemMouseMove$1 = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 10;\nvar ItemClick$1 = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 11;\nvar ToggleButtonClick$1 = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 12;\nvar ToggleButtonKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_down__' : 13;\nvar ToggleButtonKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_up__' : 14;\nvar ToggleButtonKeyDownCharacter = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_character__' : 15;\nvar FunctionToggleMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 16;\nvar FunctionOpenMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 17;\nvar FunctionCloseMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 18;\nvar FunctionSetHighlightedIndex$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 19;\nvar FunctionSelectItem$1 = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 20;\nvar FunctionSetInputValue$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 21;\nvar FunctionReset$2 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 22;\n\nvar stateChangeTypes$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MenuKeyDownArrowDown: MenuKeyDownArrowDown,\n MenuKeyDownArrowUp: MenuKeyDownArrowUp,\n MenuKeyDownEscape: MenuKeyDownEscape,\n MenuKeyDownHome: MenuKeyDownHome,\n MenuKeyDownEnd: MenuKeyDownEnd,\n MenuKeyDownEnter: MenuKeyDownEnter,\n MenuKeyDownSpaceButton: MenuKeyDownSpaceButton,\n MenuKeyDownCharacter: MenuKeyDownCharacter,\n MenuBlur: MenuBlur,\n MenuMouseLeave: MenuMouseLeave$1,\n ItemMouseMove: ItemMouseMove$1,\n ItemClick: ItemClick$1,\n ToggleButtonClick: ToggleButtonClick$1,\n ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,\n ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,\n ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,\n FunctionToggleMenu: FunctionToggleMenu$1,\n FunctionOpenMenu: FunctionOpenMenu$1,\n FunctionCloseMenu: FunctionCloseMenu$1,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,\n FunctionSelectItem: FunctionSelectItem$1,\n FunctionSetInputValue: FunctionSetInputValue$1,\n FunctionReset: FunctionReset$2\n});\n\n/* eslint-disable complexity */\n\nfunction downshiftSelectReducer(state, action) {\n var type = action.type,\n props = action.props,\n shiftKey = action.shiftKey;\n var changes;\n\n switch (type) {\n case ItemClick$1:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n selectedItem: props.items[action.index]\n };\n break;\n\n case ToggleButtonKeyDownCharacter:\n {\n var lowercasedKey = action.key;\n var inputValue = \"\" + state.inputValue + lowercasedKey;\n var itemIndex = getItemIndexByCharacterKey({\n keysSoFar: inputValue,\n highlightedIndex: state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,\n items: props.items,\n itemToString: props.itemToString,\n getItemNodeFromIndex: action.getItemNodeFromIndex\n });\n changes = _extends({\n inputValue: inputValue\n }, itemIndex >= 0 && {\n selectedItem: props.items[itemIndex]\n });\n }\n break;\n\n case ToggleButtonKeyDownArrowDown:\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex),\n isOpen: true\n };\n break;\n\n case ToggleButtonKeyDownArrowUp:\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex),\n isOpen: true\n };\n break;\n\n case MenuKeyDownEnter:\n case MenuKeyDownSpaceButton:\n changes = _extends({\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex')\n }, state.highlightedIndex >= 0 && {\n selectedItem: props.items[state.highlightedIndex]\n });\n break;\n\n case MenuKeyDownHome:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case MenuKeyDownEnd:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case MenuKeyDownEscape:\n changes = {\n isOpen: false,\n highlightedIndex: -1\n };\n break;\n\n case MenuBlur:\n changes = {\n isOpen: false,\n highlightedIndex: -1\n };\n break;\n\n case MenuKeyDownCharacter:\n {\n var _lowercasedKey = action.key;\n\n var _inputValue = \"\" + state.inputValue + _lowercasedKey;\n\n var highlightedIndex = getItemIndexByCharacterKey({\n keysSoFar: _inputValue,\n highlightedIndex: state.highlightedIndex,\n items: props.items,\n itemToString: props.itemToString,\n getItemNodeFromIndex: action.getItemNodeFromIndex\n });\n changes = _extends({\n inputValue: _inputValue\n }, highlightedIndex >= 0 && {\n highlightedIndex: highlightedIndex\n });\n }\n break;\n\n case MenuKeyDownArrowDown:\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n break;\n\n case MenuKeyDownArrowUp:\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n break;\n\n case FunctionSelectItem$1:\n changes = {\n selectedItem: action.selectedItem\n };\n break;\n\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$2);\n }\n\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nvar _excluded$2 = [\"onMouseLeave\", \"refKey\", \"onKeyDown\", \"onBlur\", \"ref\"],\n _excluded2$2 = [\"onClick\", \"onKeyDown\", \"refKey\", \"ref\"],\n _excluded3$1 = [\"item\", \"index\", \"onMouseMove\", \"onClick\", \"refKey\", \"ref\"];\nuseSelect.stateChangeTypes = stateChangeTypes$2;\n\nfunction useSelect(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n validatePropTypes$2(userProps, useSelect); // Props defaults and destructuring.\n\n var props = _extends({}, defaultProps$2, userProps);\n\n var items = props.items,\n scrollIntoView = props.scrollIntoView,\n environment = props.environment,\n initialIsOpen = props.initialIsOpen,\n defaultIsOpen = props.defaultIsOpen,\n itemToString = props.itemToString,\n getA11ySelectionMessage = props.getA11ySelectionMessage,\n getA11yStatusMessage = props.getA11yStatusMessage; // Initial state depending on controlled props.\n\n var initialState = getInitialState$2(props);\n\n var _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, initialState, props),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n\n var isOpen = state.isOpen,\n highlightedIndex = state.highlightedIndex,\n selectedItem = state.selectedItem,\n inputValue = state.inputValue; // Element efs.\n\n var toggleButtonRef = useRef(null);\n var menuRef = useRef(null);\n var itemRefs = useRef({}); // used not to trigger menu blur action in some scenarios.\n\n var shouldBlurRef = useRef(true); // used to keep the inputValue clearTimeout object between renders.\n\n var clearTimeoutRef = useRef(null); // prevent id re-generation between renders.\n\n var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.\n\n var previousResultCountRef = useRef();\n var isInitialMountRef = useRef(true); // utility callback to get item element.\n\n var latest = useLatestRef({\n state: state,\n props: props\n }); // Some utils.\n\n var getItemNodeFromIndex = useCallback(function (index) {\n return itemRefs.current[elementIds.getItemId(index)];\n }, [elementIds]); // Effects.\n // Sets a11y status message on changes in state.\n\n useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], _extends({\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items: items,\n environment: environment,\n itemToString: itemToString\n }, state)); // Sets a11y status message on changes in selectedItem.\n\n useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], _extends({\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items: items,\n environment: environment,\n itemToString: itemToString\n }, state)); // Scroll on highlighted item if change comes from keyboard.\n\n var shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n itemRefs: itemRefs,\n scrollIntoView: scrollIntoView,\n getItemNodeFromIndex: getItemNodeFromIndex\n }); // Sets cleanup for the keysSoFar callback, debounded after 500ms.\n\n useEffect(function () {\n // init the clean function here as we need access to dispatch.\n clearTimeoutRef.current = debounce(function (outerDispatch) {\n outerDispatch({\n type: FunctionSetInputValue$1,\n inputValue: ''\n });\n }, 500); // Cancel any pending debounced calls on mount\n\n return function () {\n clearTimeoutRef.current.cancel();\n };\n }, []); // Invokes the keysSoFar callback set up above.\n\n useEffect(function () {\n if (!inputValue) {\n return;\n }\n\n clearTimeoutRef.current(dispatch);\n }, [dispatch, inputValue]);\n useControlPropsValidator({\n isInitialMount: isInitialMountRef.current,\n props: props,\n state: state\n });\n /* Controls the focus on the menu or the toggle button. */\n\n useEffect(function () {\n // Don't focus menu on first render.\n if (isInitialMountRef.current) {\n // Unless it was initialised as open.\n if ((initialIsOpen || defaultIsOpen || isOpen) && menuRef.current) {\n menuRef.current.focus();\n }\n\n return;\n } // Focus menu on open.\n\n\n if (isOpen) {\n // istanbul ignore else\n if (menuRef.current) {\n menuRef.current.focus();\n }\n\n return;\n } // Focus toggleButton on close, but not if it was closed with (Shift+)Tab.\n\n\n if (environment.document.activeElement === menuRef.current) {\n // istanbul ignore else\n if (toggleButtonRef.current) {\n shouldBlurRef.current = false;\n toggleButtonRef.current.focus();\n }\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [isOpen]);\n useEffect(function () {\n if (isInitialMountRef.current) {\n return;\n }\n\n previousResultCountRef.current = items.length;\n }); // Add mouse/touch events to document.\n\n var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [menuRef, toggleButtonRef], environment, function () {\n dispatch({\n type: MenuBlur\n });\n });\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps'); // Make initial ref false.\n\n useEffect(function () {\n isInitialMountRef.current = false;\n }, []); // Reset itemRefs on close.\n\n useEffect(function () {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]); // Event handler functions.\n\n var toggleButtonKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowDown,\n getItemNodeFromIndex: getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowUp,\n getItemNodeFromIndex: getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n }\n };\n }, [dispatch, getItemNodeFromIndex]);\n var menuKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownArrowDown,\n getItemNodeFromIndex: getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownArrowUp,\n getItemNodeFromIndex: getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n },\n Home: function Home(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownHome,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n },\n End: function End(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownEnd,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n },\n Escape: function Escape() {\n dispatch({\n type: MenuKeyDownEscape\n });\n },\n Enter: function Enter(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownEnter\n });\n },\n ' ': function _(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownSpaceButton\n });\n }\n };\n }, [dispatch, getItemNodeFromIndex]); // Action functions.\n\n var toggleMenu = useCallback(function () {\n dispatch({\n type: FunctionToggleMenu$1\n });\n }, [dispatch]);\n var closeMenu = useCallback(function () {\n dispatch({\n type: FunctionCloseMenu$1\n });\n }, [dispatch]);\n var openMenu = useCallback(function () {\n dispatch({\n type: FunctionOpenMenu$1\n });\n }, [dispatch]);\n var setHighlightedIndex = useCallback(function (newHighlightedIndex) {\n dispatch({\n type: FunctionSetHighlightedIndex$1,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n var selectItem = useCallback(function (newSelectedItem) {\n dispatch({\n type: FunctionSelectItem$1,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset$2\n });\n }, [dispatch]);\n var setInputValue = useCallback(function (newInputValue) {\n dispatch({\n type: FunctionSetInputValue$1,\n inputValue: newInputValue\n });\n }, [dispatch]); // Getter functions.\n\n var getLabelProps = useCallback(function (labelProps) {\n return _extends({\n id: elementIds.labelId,\n htmlFor: elementIds.toggleButtonId\n }, labelProps);\n }, [elementIds]);\n var getMenuProps = useCallback(function (_temp, _temp2) {\n var _extends2;\n\n var _ref = _temp === void 0 ? {} : _temp,\n onMouseLeave = _ref.onMouseLeave,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n onKeyDown = _ref.onKeyDown,\n onBlur = _ref.onBlur,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);\n\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n\n var latestState = latest.current.state;\n\n var menuHandleKeyDown = function menuHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n\n if (key && menuKeyDownHandlers[key]) {\n menuKeyDownHandlers[key](event);\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: MenuKeyDownCharacter,\n key: key,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n }\n };\n\n var menuHandleBlur = function menuHandleBlur() {\n // if the blur was a result of selection, we don't trigger this action.\n if (shouldBlurRef.current === false) {\n shouldBlurRef.current = true;\n return;\n }\n\n var shouldBlur = !mouseAndTouchTrackersRef.current.isMouseDown;\n /* istanbul ignore else */\n\n if (shouldBlur) {\n dispatch({\n type: MenuBlur\n });\n }\n };\n\n var menuHandleMouseLeave = function menuHandleMouseLeave() {\n dispatch({\n type: MenuMouseLeave$1\n });\n };\n\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {\n menuRef.current = menuNode;\n }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.tabIndex = -1, _extends2), latestState.isOpen && latestState.highlightedIndex > -1 && {\n 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)\n }, {\n onMouseLeave: callAllEventHandlers(onMouseLeave, menuHandleMouseLeave),\n onKeyDown: callAllEventHandlers(onKeyDown, menuHandleKeyDown),\n onBlur: callAllEventHandlers(onBlur, menuHandleBlur)\n }, rest);\n }, [dispatch, latest, menuKeyDownHandlers, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);\n var getToggleButtonProps = useCallback(function (_temp3, _temp4) {\n var _extends3;\n\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n onClick = _ref3.onClick,\n onKeyDown = _ref3.onKeyDown,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$2);\n\n var _ref4 = _temp4 === void 0 ? {} : _temp4,\n _ref4$suppressRefErro = _ref4.suppressRefError,\n suppressRefError = _ref4$suppressRefErro === void 0 ? false : _ref4$suppressRefErro;\n\n var toggleButtonHandleClick = function toggleButtonHandleClick() {\n dispatch({\n type: ToggleButtonClick$1\n });\n };\n\n var toggleButtonHandleKeyDown = function toggleButtonHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n\n if (key && toggleButtonKeyDownHandlers[key]) {\n toggleButtonKeyDownHandlers[key](event);\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: ToggleButtonKeyDownCharacter,\n key: key,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n }\n };\n\n var toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {\n toggleButtonRef.current = toggleButtonNode;\n }), _extends3.id = elementIds.toggleButtonId, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-labelledby'] = elementIds.labelId + \" \" + elementIds.toggleButtonId, _extends3), rest);\n\n if (!rest.disabled) {\n toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick);\n toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown);\n }\n\n setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef);\n return toggleProps;\n }, [dispatch, latest, toggleButtonKeyDownHandlers, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);\n var getItemProps = useCallback(function (_temp5) {\n var _extends4;\n\n var _ref5 = _temp5 === void 0 ? {} : _temp5,\n item = _ref5.item,\n index = _ref5.index,\n onMouseMove = _ref5.onMouseMove,\n onClick = _ref5.onClick,\n _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n rest = _objectWithoutPropertiesLoose(_ref5, _excluded3$1);\n\n var _latest$current = latest.current,\n latestState = _latest$current.state,\n latestProps = _latest$current.props;\n\n var itemHandleMouseMove = function itemHandleMouseMove() {\n if (index === latestState.highlightedIndex) {\n return;\n }\n\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove$1,\n index: index\n });\n };\n\n var itemHandleClick = function itemHandleClick() {\n dispatch({\n type: ItemClick$1,\n index: index\n });\n };\n\n var itemIndex = getItemIndex(index, item, latestProps.items);\n\n if (itemIndex < 0) {\n throw new Error('Pass either item or item index in getItemProps!');\n }\n\n var itemProps = _extends((_extends4 = {\n role: 'option',\n 'aria-selected': \"\" + (itemIndex === latestState.highlightedIndex),\n id: elementIds.getItemId(itemIndex)\n }, _extends4[refKey] = handleRefs(ref, function (itemNode) {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;\n }\n }), _extends4), rest);\n\n if (!rest.disabled) {\n itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);\n itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);\n }\n\n return itemProps;\n }, [dispatch, latest, shouldScrollRef, elementIds]);\n return {\n // prop getters.\n getToggleButtonProps: getToggleButtonProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getItemProps: getItemProps,\n // actions.\n toggleMenu: toggleMenu,\n openMenu: openMenu,\n closeMenu: closeMenu,\n setHighlightedIndex: setHighlightedIndex,\n selectItem: selectItem,\n reset: reset,\n setInputValue: setInputValue,\n // state.\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nvar InputKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_down__' : 0;\nvar InputKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_up__' : 1;\nvar InputKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__input_keydown_escape__' : 2;\nvar InputKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__input_keydown_home__' : 3;\nvar InputKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__input_keydown_end__' : 4;\nvar InputKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__input_keydown_enter__' : 5;\nvar InputChange = process.env.NODE_ENV !== \"production\" ? '__input_change__' : 6;\nvar InputBlur = process.env.NODE_ENV !== \"production\" ? '__input_blur__' : 7;\nvar MenuMouseLeave = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 8;\nvar ItemMouseMove = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 9;\nvar ItemClick = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 10;\nvar ToggleButtonClick = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 11;\nvar FunctionToggleMenu = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 12;\nvar FunctionOpenMenu = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 13;\nvar FunctionCloseMenu = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 14;\nvar FunctionSetHighlightedIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 15;\nvar FunctionSelectItem = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 16;\nvar FunctionSetInputValue = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 17;\nvar FunctionReset$1 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 18;\nvar ControlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__controlled_prop_updated_selected_item__' : 19;\n\nvar stateChangeTypes$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n InputKeyDownArrowDown: InputKeyDownArrowDown,\n InputKeyDownArrowUp: InputKeyDownArrowUp,\n InputKeyDownEscape: InputKeyDownEscape,\n InputKeyDownHome: InputKeyDownHome,\n InputKeyDownEnd: InputKeyDownEnd,\n InputKeyDownEnter: InputKeyDownEnter,\n InputChange: InputChange,\n InputBlur: InputBlur,\n MenuMouseLeave: MenuMouseLeave,\n ItemMouseMove: ItemMouseMove,\n ItemClick: ItemClick,\n ToggleButtonClick: ToggleButtonClick,\n FunctionToggleMenu: FunctionToggleMenu,\n FunctionOpenMenu: FunctionOpenMenu,\n FunctionCloseMenu: FunctionCloseMenu,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,\n FunctionSelectItem: FunctionSelectItem,\n FunctionSetInputValue: FunctionSetInputValue,\n FunctionReset: FunctionReset$1,\n ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem\n});\n\nfunction getInitialState$1(props) {\n var initialState = getInitialState$2(props);\n var selectedItem = initialState.selectedItem;\n var inputValue = initialState.inputValue;\n\n if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {\n inputValue = props.itemToString(selectedItem);\n }\n\n return _extends({}, initialState, {\n inputValue: inputValue\n });\n}\n\nvar propTypes$1 = {\n items: PropTypes.array.isRequired,\n itemToString: PropTypes.func,\n getA11yStatusMessage: PropTypes.func,\n getA11ySelectionMessage: PropTypes.func,\n circularNavigation: PropTypes.bool,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n inputValue: PropTypes.string,\n defaultInputValue: PropTypes.string,\n initialInputValue: PropTypes.string,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n inputId: PropTypes.string,\n toggleButtonId: PropTypes.string,\n stateReducer: PropTypes.func,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n })\n};\n/**\n * The useCombobox version of useControlledReducer, which also\n * checks if the controlled prop selectedItem changed between\n * renders. If so, it will also update inputValue with its\n * string equivalent. It uses the common useEnhancedReducer to\n * compute the rest of the state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} initialState Initial state of the hook.\n * @param {Object} props The hook props.\n * @returns {Array} An array with the state and an action dispatcher.\n */\n\nfunction useControlledReducer(reducer, initialState, props) {\n var previousSelectedItemRef = useRef();\n\n var _useEnhancedReducer = useEnhancedReducer(reducer, initialState, props),\n state = _useEnhancedReducer[0],\n dispatch = _useEnhancedReducer[1]; // ToDo: if needed, make same approach as selectedItemChanged from Downshift.\n\n\n useEffect(function () {\n if (isControlledProp(props, 'selectedItem')) {\n if (previousSelectedItemRef.current !== props.selectedItem) {\n dispatch({\n type: ControlledPropUpdatedSelectedItem,\n inputValue: props.itemToString(props.selectedItem)\n });\n }\n\n previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem;\n }\n });\n return [getState(state, props), dispatch];\n} // eslint-disable-next-line import/no-mutable-exports\n\n\nvar validatePropTypes$1 = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$1 = function validatePropTypes(options, caller) {\n PropTypes.checkPropTypes(propTypes$1, options, 'prop', caller.name);\n };\n}\n\nvar defaultProps$1 = _extends({}, defaultProps$3, {\n getA11yStatusMessage: getA11yStatusMessage$1,\n circularNavigation: true\n});\n\n/* eslint-disable complexity */\n\nfunction downshiftUseComboboxReducer(state, action) {\n var type = action.type,\n props = action.props,\n shiftKey = action.shiftKey;\n var changes;\n\n switch (type) {\n case ItemClick:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n selectedItem: props.items[action.index],\n inputValue: props.itemToString(props.items[action.index])\n };\n break;\n\n case InputKeyDownArrowDown:\n if (state.isOpen) {\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n } else {\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex),\n isOpen: props.items.length >= 0\n };\n }\n\n break;\n\n case InputKeyDownArrowUp:\n if (state.isOpen) {\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n } else {\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex),\n isOpen: props.items.length >= 0\n };\n }\n\n break;\n\n case InputKeyDownEnter:\n changes = _extends({}, state.isOpen && state.highlightedIndex >= 0 && {\n selectedItem: props.items[state.highlightedIndex],\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n inputValue: props.itemToString(props.items[state.highlightedIndex])\n });\n break;\n\n case InputKeyDownEscape:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, !state.isOpen && {\n selectedItem: null,\n inputValue: ''\n });\n break;\n\n case InputKeyDownHome:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case InputKeyDownEnd:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case InputBlur:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, state.highlightedIndex >= 0 && action.selectItem && {\n selectedItem: props.items[state.highlightedIndex],\n inputValue: props.itemToString(props.items[state.highlightedIndex])\n });\n break;\n\n case InputChange:\n changes = {\n isOpen: true,\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n inputValue: action.inputValue\n };\n break;\n\n case FunctionSelectItem:\n changes = {\n selectedItem: action.selectedItem,\n inputValue: props.itemToString(action.selectedItem)\n };\n break;\n\n case ControlledPropUpdatedSelectedItem:\n changes = {\n inputValue: action.inputValue\n };\n break;\n\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$1);\n }\n\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nvar _excluded$1 = [\"onMouseLeave\", \"refKey\", \"ref\"],\n _excluded2$1 = [\"item\", \"index\", \"refKey\", \"ref\", \"onMouseMove\", \"onClick\", \"onPress\"],\n _excluded3 = [\"onClick\", \"onPress\", \"refKey\", \"ref\"],\n _excluded4 = [\"onKeyDown\", \"onChange\", \"onInput\", \"onBlur\", \"onChangeText\", \"refKey\", \"ref\"],\n _excluded5 = [\"refKey\", \"ref\"];\nuseCombobox.stateChangeTypes = stateChangeTypes$1;\n\nfunction useCombobox(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n validatePropTypes$1(userProps, useCombobox); // Props defaults and destructuring.\n\n var props = _extends({}, defaultProps$1, userProps);\n\n var initialIsOpen = props.initialIsOpen,\n defaultIsOpen = props.defaultIsOpen,\n items = props.items,\n scrollIntoView = props.scrollIntoView,\n environment = props.environment,\n getA11yStatusMessage = props.getA11yStatusMessage,\n getA11ySelectionMessage = props.getA11ySelectionMessage,\n itemToString = props.itemToString; // Initial state depending on controlled props.\n\n var initialState = getInitialState$1(props);\n\n var _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, initialState, props),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n\n var isOpen = state.isOpen,\n highlightedIndex = state.highlightedIndex,\n selectedItem = state.selectedItem,\n inputValue = state.inputValue; // Element refs.\n\n var menuRef = useRef(null);\n var itemRefs = useRef({});\n var inputRef = useRef(null);\n var toggleButtonRef = useRef(null);\n var comboboxRef = useRef(null);\n var isInitialMountRef = useRef(true); // prevent id re-generation between renders.\n\n var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.\n\n var previousResultCountRef = useRef(); // utility callback to get item element.\n\n var latest = useLatestRef({\n state: state,\n props: props\n });\n var getItemNodeFromIndex = useCallback(function (index) {\n return itemRefs.current[elementIds.getItemId(index)];\n }, [elementIds]); // Effects.\n // Sets a11y status message on changes in state.\n\n useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], _extends({\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items: items,\n environment: environment,\n itemToString: itemToString\n }, state)); // Sets a11y status message on changes in selectedItem.\n\n useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], _extends({\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items: items,\n environment: environment,\n itemToString: itemToString\n }, state)); // Scroll on highlighted item if change comes from keyboard.\n\n var shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n itemRefs: itemRefs,\n scrollIntoView: scrollIntoView,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n useControlPropsValidator({\n isInitialMount: isInitialMountRef.current,\n props: props,\n state: state\n }); // Focus the input on first render if required.\n\n useEffect(function () {\n var focusOnOpen = initialIsOpen || defaultIsOpen || isOpen;\n\n if (focusOnOpen && inputRef.current) {\n inputRef.current.focus();\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n useEffect(function () {\n if (isInitialMountRef.current) {\n return;\n }\n\n previousResultCountRef.current = items.length;\n }); // Add mouse/touch events to document.\n\n var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [comboboxRef, menuRef, toggleButtonRef], environment, function () {\n dispatch({\n type: InputBlur,\n selectItem: false\n });\n });\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getComboboxProps', 'getMenuProps'); // Make initial ref false.\n\n useEffect(function () {\n isInitialMountRef.current = false;\n }, []); // Reset itemRefs on close.\n\n useEffect(function () {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]);\n /* Event handler functions */\n\n var inputKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowDown,\n shiftKey: event.shiftKey,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowUp,\n shiftKey: event.shiftKey,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n },\n Home: function Home(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n\n event.preventDefault();\n dispatch({\n type: InputKeyDownHome,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n },\n End: function End(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnd,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n },\n Escape: function Escape() {\n var latestState = latest.current.state;\n\n if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {\n dispatch({\n type: InputKeyDownEscape\n });\n }\n },\n Enter: function Enter(event) {\n var latestState = latest.current.state; // if closed or no highlighted index, do nothing.\n\n if (!latestState.isOpen || latestState.highlightedIndex < 0 || event.which === 229 // if IME composing, wait for next Enter keydown event.\n ) {\n return;\n }\n\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnter,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n }\n };\n }, [dispatch, latest, getItemNodeFromIndex]); // Getter props.\n\n var getLabelProps = useCallback(function (labelProps) {\n return _extends({\n id: elementIds.labelId,\n htmlFor: elementIds.inputId\n }, labelProps);\n }, [elementIds]);\n var getMenuProps = useCallback(function (_temp, _temp2) {\n var _extends2;\n\n var _ref = _temp === void 0 ? {} : _temp,\n onMouseLeave = _ref.onMouseLeave,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);\n\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {\n menuRef.current = menuNode;\n }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () {\n dispatch({\n type: MenuMouseLeave\n });\n }), _extends2), rest);\n }, [dispatch, setGetterPropCallInfo, elementIds]);\n var getItemProps = useCallback(function (_temp3) {\n var _extends3, _ref4;\n\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n item = _ref3.item,\n index = _ref3.index,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n onMouseMove = _ref3.onMouseMove,\n onClick = _ref3.onClick;\n _ref3.onPress;\n var rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);\n\n var _latest$current = latest.current,\n latestProps = _latest$current.props,\n latestState = _latest$current.state;\n var itemIndex = getItemIndex(index, item, latestProps.items);\n\n if (itemIndex < 0) {\n throw new Error('Pass either item or item index in getItemProps!');\n }\n\n var onSelectKey = 'onClick';\n var customClickHandler = onClick;\n\n var itemHandleMouseMove = function itemHandleMouseMove() {\n if (index === latestState.highlightedIndex) {\n return;\n }\n\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove,\n index: index\n });\n };\n\n var itemHandleClick = function itemHandleClick() {\n dispatch({\n type: ItemClick,\n index: index\n });\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n };\n\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;\n }\n }), _extends3.role = 'option', _extends3['aria-selected'] = \"\" + (itemIndex === latestState.highlightedIndex), _extends3.id = elementIds.getItemId(itemIndex), _extends3), !rest.disabled && (_ref4 = {\n onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove)\n }, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), rest);\n }, [dispatch, latest, shouldScrollRef, elementIds]);\n var getToggleButtonProps = useCallback(function (_temp4) {\n var _extends4;\n\n var _ref5 = _temp4 === void 0 ? {} : _temp4,\n onClick = _ref5.onClick;\n _ref5.onPress;\n var _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n rest = _objectWithoutPropertiesLoose(_ref5, _excluded3);\n\n var toggleButtonHandleClick = function toggleButtonHandleClick() {\n dispatch({\n type: ToggleButtonClick\n });\n\n if (!latest.current.state.isOpen && inputRef.current) {\n inputRef.current.focus();\n }\n };\n\n return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) {\n toggleButtonRef.current = toggleButtonNode;\n }), _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && _extends({}, {\n onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)\n }), rest);\n }, [dispatch, latest, elementIds]);\n var getInputProps = useCallback(function (_temp5, _temp6) {\n var _extends5;\n\n var _ref6 = _temp5 === void 0 ? {} : _temp5,\n onKeyDown = _ref6.onKeyDown,\n onChange = _ref6.onChange,\n onInput = _ref6.onInput,\n onBlur = _ref6.onBlur;\n _ref6.onChangeText;\n var _ref6$refKey = _ref6.refKey,\n refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,\n ref = _ref6.ref,\n rest = _objectWithoutPropertiesLoose(_ref6, _excluded4);\n\n var _ref7 = _temp6 === void 0 ? {} : _temp6,\n _ref7$suppressRefErro = _ref7.suppressRefError,\n suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro;\n\n setGetterPropCallInfo('getInputProps', suppressRefError, refKey, inputRef);\n var latestState = latest.current.state;\n\n var inputHandleKeyDown = function inputHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n\n if (key && inputKeyDownHandlers[key]) {\n inputKeyDownHandlers[key](event);\n }\n };\n\n var inputHandleChange = function inputHandleChange(event) {\n dispatch({\n type: InputChange,\n inputValue: event.target.value\n });\n };\n\n var inputHandleBlur = function inputHandleBlur() {\n /* istanbul ignore else */\n if (latestState.isOpen && !mouseAndTouchTrackersRef.current.isMouseDown) {\n dispatch({\n type: InputBlur,\n selectItem: true\n });\n }\n };\n /* istanbul ignore next (preact) */\n\n\n var onChangeKey = 'onChange';\n var eventHandlers = {};\n\n if (!rest.disabled) {\n var _eventHandlers;\n\n eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers);\n }\n\n return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) {\n inputRef.current = inputNode;\n }), _extends5.id = elementIds.inputId, _extends5['aria-autocomplete'] = 'list', _extends5['aria-controls'] = elementIds.menuId, _extends5), latestState.isOpen && latestState.highlightedIndex > -1 && {\n 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)\n }, {\n 'aria-labelledby': elementIds.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: latestState.inputValue\n }, eventHandlers, rest);\n }, [dispatch, inputKeyDownHandlers, latest, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds]);\n var getComboboxProps = useCallback(function (_temp7, _temp8) {\n var _extends6;\n\n var _ref8 = _temp7 === void 0 ? {} : _temp7,\n _ref8$refKey = _ref8.refKey,\n refKey = _ref8$refKey === void 0 ? 'ref' : _ref8$refKey,\n ref = _ref8.ref,\n rest = _objectWithoutPropertiesLoose(_ref8, _excluded5);\n\n var _ref9 = _temp8 === void 0 ? {} : _temp8,\n _ref9$suppressRefErro = _ref9.suppressRefError,\n suppressRefError = _ref9$suppressRefErro === void 0 ? false : _ref9$suppressRefErro;\n\n setGetterPropCallInfo('getComboboxProps', suppressRefError, refKey, comboboxRef);\n return _extends((_extends6 = {}, _extends6[refKey] = handleRefs(ref, function (comboboxNode) {\n comboboxRef.current = comboboxNode;\n }), _extends6.role = 'combobox', _extends6['aria-haspopup'] = 'listbox', _extends6['aria-owns'] = elementIds.menuId, _extends6['aria-expanded'] = latest.current.state.isOpen, _extends6), rest);\n }, [latest, setGetterPropCallInfo, elementIds]); // returns\n\n var toggleMenu = useCallback(function () {\n dispatch({\n type: FunctionToggleMenu\n });\n }, [dispatch]);\n var closeMenu = useCallback(function () {\n dispatch({\n type: FunctionCloseMenu\n });\n }, [dispatch]);\n var openMenu = useCallback(function () {\n dispatch({\n type: FunctionOpenMenu\n });\n }, [dispatch]);\n var setHighlightedIndex = useCallback(function (newHighlightedIndex) {\n dispatch({\n type: FunctionSetHighlightedIndex,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n var selectItem = useCallback(function (newSelectedItem) {\n dispatch({\n type: FunctionSelectItem,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n var setInputValue = useCallback(function (newInputValue) {\n dispatch({\n type: FunctionSetInputValue,\n inputValue: newInputValue\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset$1\n });\n }, [dispatch]);\n return {\n // prop getters.\n getItemProps: getItemProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getInputProps: getInputProps,\n getComboboxProps: getComboboxProps,\n getToggleButtonProps: getToggleButtonProps,\n // actions.\n toggleMenu: toggleMenu,\n openMenu: openMenu,\n closeMenu: closeMenu,\n setHighlightedIndex: setHighlightedIndex,\n setInputValue: setInputValue,\n selectItem: selectItem,\n reset: reset,\n // state.\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nvar defaultStateValues = {\n activeIndex: -1,\n selectedItems: []\n};\n/**\n * Returns the initial value for a state key in the following order:\n * 1. controlled prop, 2. initial prop, 3. default prop, 4. default\n * value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\n\nfunction getInitialValue(props, propKey) {\n return getInitialValue$1(props, propKey, defaultStateValues);\n}\n/**\n * Returns the default value for a state key in the following order:\n * 1. controlled prop, 2. default prop, 3. default value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\n\n\nfunction getDefaultValue(props, propKey) {\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\n/**\n * Gets the initial state based on the provided props. It uses initial, default\n * and controlled props related to state in order to compute the initial value.\n *\n * @param {Object} props Props passed to the hook.\n * @returns {Object} The initial state.\n */\n\n\nfunction getInitialState(props) {\n var activeIndex = getInitialValue(props, 'activeIndex');\n var selectedItems = getInitialValue(props, 'selectedItems');\n return {\n activeIndex: activeIndex,\n selectedItems: selectedItems\n };\n}\n/**\n * Returns true if dropdown keydown operation is permitted. Should not be\n * allowed on keydown with modifier keys (ctrl, alt, shift, meta), on\n * input element with text content that is either highlighted or selection\n * cursor is not at the starting position.\n *\n * @param {KeyboardEvent} event The event from keydown.\n * @returns {boolean} Whether the operation is allowed.\n */\n\n\nfunction isKeyDownOperationPermitted(event) {\n if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {\n return false;\n }\n\n var element = event.target;\n\n if (element instanceof HTMLInputElement && // if element is a text input\n element.value !== '' && (element.selectionStart !== 0 || element.selectionEnd !== 0)) {\n return false;\n }\n\n return true;\n}\n/**\n * Returns a message to be added to aria-live region when item is removed.\n *\n * @param {Object} selectionParameters Parameters required to build the message.\n * @returns {string} The a11y message.\n */\n\n\nfunction getA11yRemovalMessage(selectionParameters) {\n var removedSelectedItem = selectionParameters.removedSelectedItem,\n itemToStringLocal = selectionParameters.itemToString;\n return itemToStringLocal(removedSelectedItem) + \" has been removed.\";\n}\n\nvar propTypes = {\n selectedItems: PropTypes.array,\n initialSelectedItems: PropTypes.array,\n defaultSelectedItems: PropTypes.array,\n itemToString: PropTypes.func,\n getA11yRemovalMessage: PropTypes.func,\n stateReducer: PropTypes.func,\n activeIndex: PropTypes.number,\n initialActiveIndex: PropTypes.number,\n defaultActiveIndex: PropTypes.number,\n onActiveIndexChange: PropTypes.func,\n onSelectedItemsChange: PropTypes.func,\n keyNavigationNext: PropTypes.string,\n keyNavigationPrevious: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n })\n};\nvar defaultProps = {\n itemToString: defaultProps$3.itemToString,\n stateReducer: defaultProps$3.stateReducer,\n environment: defaultProps$3.environment,\n getA11yRemovalMessage: getA11yRemovalMessage,\n keyNavigationNext: 'ArrowRight',\n keyNavigationPrevious: 'ArrowLeft'\n}; // eslint-disable-next-line import/no-mutable-exports\n\nvar validatePropTypes = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes = function validatePropTypes(options, caller) {\n PropTypes.checkPropTypes(propTypes, options, 'prop', caller.name);\n };\n}\n\nvar SelectedItemClick = process.env.NODE_ENV !== \"production\" ? '__selected_item_click__' : 0;\nvar SelectedItemKeyDownDelete = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_delete__' : 1;\nvar SelectedItemKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_backspace__' : 2;\nvar SelectedItemKeyDownNavigationNext = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_next__' : 3;\nvar SelectedItemKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_previous__' : 4;\nvar DropdownKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_navigation_previous__' : 5;\nvar DropdownKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_backspace__' : 6;\nvar DropdownClick = process.env.NODE_ENV !== \"production\" ? '__dropdown_click__' : 7;\nvar FunctionAddSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_add_selected_item__' : 8;\nvar FunctionRemoveSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_remove_selected_item__' : 9;\nvar FunctionSetSelectedItems = process.env.NODE_ENV !== \"production\" ? '__function_set_selected_items__' : 10;\nvar FunctionSetActiveIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_active_index__' : 11;\nvar FunctionReset = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 12;\n\nvar stateChangeTypes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n SelectedItemClick: SelectedItemClick,\n SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,\n SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,\n SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,\n SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious,\n DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,\n DropdownKeyDownBackspace: DropdownKeyDownBackspace,\n DropdownClick: DropdownClick,\n FunctionAddSelectedItem: FunctionAddSelectedItem,\n FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,\n FunctionSetSelectedItems: FunctionSetSelectedItems,\n FunctionSetActiveIndex: FunctionSetActiveIndex,\n FunctionReset: FunctionReset\n});\n\n/* eslint-disable complexity */\n\nfunction downshiftMultipleSelectionReducer(state, action) {\n var type = action.type,\n index = action.index,\n props = action.props,\n selectedItem = action.selectedItem;\n var activeIndex = state.activeIndex,\n selectedItems = state.selectedItems;\n var changes;\n\n switch (type) {\n case SelectedItemClick:\n changes = {\n activeIndex: index\n };\n break;\n\n case SelectedItemKeyDownNavigationPrevious:\n changes = {\n activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1\n };\n break;\n\n case SelectedItemKeyDownNavigationNext:\n changes = {\n activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1\n };\n break;\n\n case SelectedItemKeyDownBackspace:\n case SelectedItemKeyDownDelete:\n {\n var newActiveIndex = activeIndex;\n\n if (selectedItems.length === 1) {\n newActiveIndex = -1;\n } else if (activeIndex === selectedItems.length - 1) {\n newActiveIndex = selectedItems.length - 2;\n }\n\n changes = _extends({\n selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))\n }, {\n activeIndex: newActiveIndex\n });\n break;\n }\n\n case DropdownKeyDownNavigationPrevious:\n changes = {\n activeIndex: selectedItems.length - 1\n };\n break;\n\n case DropdownKeyDownBackspace:\n changes = {\n selectedItems: selectedItems.slice(0, selectedItems.length - 1)\n };\n break;\n\n case FunctionAddSelectedItem:\n changes = {\n selectedItems: [].concat(selectedItems, [selectedItem])\n };\n break;\n\n case DropdownClick:\n changes = {\n activeIndex: -1\n };\n break;\n\n case FunctionRemoveSelectedItem:\n {\n var _newActiveIndex = activeIndex;\n var selectedItemIndex = selectedItems.indexOf(selectedItem);\n\n if (selectedItems.length === 1) {\n _newActiveIndex = -1;\n } else if (selectedItemIndex === selectedItems.length - 1) {\n _newActiveIndex = selectedItems.length - 2;\n }\n\n changes = _extends({\n selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1))\n }, {\n activeIndex: _newActiveIndex\n });\n break;\n }\n\n case FunctionSetSelectedItems:\n {\n var newSelectedItems = action.selectedItems;\n changes = {\n selectedItems: newSelectedItems\n };\n break;\n }\n\n case FunctionSetActiveIndex:\n {\n var _newActiveIndex2 = action.activeIndex;\n changes = {\n activeIndex: _newActiveIndex2\n };\n break;\n }\n\n case FunctionReset:\n changes = {\n activeIndex: getDefaultValue(props, 'activeIndex'),\n selectedItems: getDefaultValue(props, 'selectedItems')\n };\n break;\n\n default:\n throw new Error('Reducer called without proper action type.');\n }\n\n return _extends({}, state, changes);\n}\n\nvar _excluded = [\"refKey\", \"ref\", \"onClick\", \"onKeyDown\", \"selectedItem\", \"index\"],\n _excluded2 = [\"refKey\", \"ref\", \"onKeyDown\", \"onClick\", \"preventKeyAction\"];\nuseMultipleSelection.stateChangeTypes = stateChangeTypes;\n\nfunction useMultipleSelection(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n validatePropTypes(userProps, useMultipleSelection); // Props defaults and destructuring.\n\n var props = _extends({}, defaultProps, userProps);\n\n var getA11yRemovalMessage = props.getA11yRemovalMessage,\n itemToString = props.itemToString,\n environment = props.environment,\n keyNavigationNext = props.keyNavigationNext,\n keyNavigationPrevious = props.keyNavigationPrevious; // Reducer init.\n\n var _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, getInitialState(props), props),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n\n var activeIndex = state.activeIndex,\n selectedItems = state.selectedItems; // Refs.\n\n var isInitialMountRef = useRef(true);\n var dropdownRef = useRef(null);\n var previousSelectedItemsRef = useRef(selectedItems);\n var selectedItemRefs = useRef();\n selectedItemRefs.current = [];\n var latest = useLatestRef({\n state: state,\n props: props\n }); // Effects.\n\n /* Sets a11y status message on changes in selectedItem. */\n\n useEffect(function () {\n if (isInitialMountRef.current) {\n return;\n }\n\n if (selectedItems.length < previousSelectedItemsRef.current.length) {\n var removedSelectedItem = previousSelectedItemsRef.current.find(function (item) {\n return selectedItems.indexOf(item) < 0;\n });\n setStatus(getA11yRemovalMessage({\n itemToString: itemToString,\n resultCount: selectedItems.length,\n removedSelectedItem: removedSelectedItem,\n activeIndex: activeIndex,\n activeSelectedItem: selectedItems[activeIndex]\n }), environment.document);\n }\n\n previousSelectedItemsRef.current = selectedItems; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedItems.length]); // Sets focus on active item.\n\n useEffect(function () {\n if (isInitialMountRef.current) {\n return;\n }\n\n if (activeIndex === -1 && dropdownRef.current) {\n dropdownRef.current.focus();\n } else if (selectedItemRefs.current[activeIndex]) {\n selectedItemRefs.current[activeIndex].focus();\n }\n }, [activeIndex]);\n useControlPropsValidator({\n isInitialMount: isInitialMountRef.current,\n props: props,\n state: state\n });\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getDropdownProps'); // Make initial ref false.\n\n useEffect(function () {\n isInitialMountRef.current = false;\n }, []); // Event handler functions.\n\n var selectedItemKeyDownHandlers = useMemo(function () {\n var _ref;\n\n return _ref = {}, _ref[keyNavigationPrevious] = function () {\n dispatch({\n type: SelectedItemKeyDownNavigationPrevious\n });\n }, _ref[keyNavigationNext] = function () {\n dispatch({\n type: SelectedItemKeyDownNavigationNext\n });\n }, _ref.Delete = function Delete() {\n dispatch({\n type: SelectedItemKeyDownDelete\n });\n }, _ref.Backspace = function Backspace() {\n dispatch({\n type: SelectedItemKeyDownBackspace\n });\n }, _ref;\n }, [dispatch, keyNavigationNext, keyNavigationPrevious]);\n var dropdownKeyDownHandlers = useMemo(function () {\n var _ref2;\n\n return _ref2 = {}, _ref2[keyNavigationPrevious] = function (event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownNavigationPrevious\n });\n }\n }, _ref2.Backspace = function Backspace(event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownBackspace\n });\n }\n }, _ref2;\n }, [dispatch, keyNavigationPrevious]); // Getter props.\n\n var getSelectedItemProps = useCallback(function (_temp) {\n var _extends2;\n\n var _ref3 = _temp === void 0 ? {} : _temp,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n onClick = _ref3.onClick,\n onKeyDown = _ref3.onKeyDown,\n selectedItem = _ref3.selectedItem,\n index = _ref3.index,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded);\n\n var latestState = latest.current.state;\n var itemIndex = getItemIndex(index, selectedItem, latestState.selectedItems);\n\n if (itemIndex < 0) {\n throw new Error('Pass either selectedItem or index in getSelectedItemProps!');\n }\n\n var selectedItemHandleClick = function selectedItemHandleClick() {\n dispatch({\n type: SelectedItemClick,\n index: index\n });\n };\n\n var selectedItemHandleKeyDown = function selectedItemHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n\n if (key && selectedItemKeyDownHandlers[key]) {\n selectedItemKeyDownHandlers[key](event);\n }\n };\n\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) {\n if (selectedItemNode) {\n selectedItemRefs.current.push(selectedItemNode);\n }\n }), _extends2.tabIndex = index === latestState.activeIndex ? 0 : -1, _extends2.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends2.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends2), rest);\n }, [dispatch, latest, selectedItemKeyDownHandlers]);\n var getDropdownProps = useCallback(function (_temp2, _temp3) {\n var _extends3;\n\n var _ref4 = _temp2 === void 0 ? {} : _temp2,\n _ref4$refKey = _ref4.refKey,\n refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,\n ref = _ref4.ref,\n onKeyDown = _ref4.onKeyDown,\n onClick = _ref4.onClick,\n _ref4$preventKeyActio = _ref4.preventKeyAction,\n preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio,\n rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);\n\n var _ref5 = _temp3 === void 0 ? {} : _temp3,\n _ref5$suppressRefErro = _ref5.suppressRefError,\n suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;\n\n setGetterPropCallInfo('getDropdownProps', suppressRefError, refKey, dropdownRef);\n\n var dropdownHandleKeyDown = function dropdownHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n\n if (key && dropdownKeyDownHandlers[key]) {\n dropdownKeyDownHandlers[key](event);\n }\n };\n\n var dropdownHandleClick = function dropdownHandleClick() {\n dispatch({\n type: DropdownClick\n });\n };\n\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) {\n if (dropdownNode) {\n dropdownRef.current = dropdownNode;\n }\n }), _extends3), !preventKeyAction && {\n onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown),\n onClick: callAllEventHandlers(onClick, dropdownHandleClick)\n }, rest);\n }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]); // returns\n\n var addSelectedItem = useCallback(function (selectedItem) {\n dispatch({\n type: FunctionAddSelectedItem,\n selectedItem: selectedItem\n });\n }, [dispatch]);\n var removeSelectedItem = useCallback(function (selectedItem) {\n dispatch({\n type: FunctionRemoveSelectedItem,\n selectedItem: selectedItem\n });\n }, [dispatch]);\n var setSelectedItems = useCallback(function (newSelectedItems) {\n dispatch({\n type: FunctionSetSelectedItems,\n selectedItems: newSelectedItems\n });\n }, [dispatch]);\n var setActiveIndex = useCallback(function (newActiveIndex) {\n dispatch({\n type: FunctionSetActiveIndex,\n activeIndex: newActiveIndex\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset\n });\n }, [dispatch]);\n return {\n getSelectedItemProps: getSelectedItemProps,\n getDropdownProps: getDropdownProps,\n addSelectedItem: addSelectedItem,\n removeSelectedItem: removeSelectedItem,\n setSelectedItems: setSelectedItems,\n setActiveIndex: setActiveIndex,\n reset: reset,\n selectedItems: selectedItems,\n activeIndex: activeIndex\n };\n}\n\nexport { Downshift$1 as default, resetIdCounter, useCombobox, useMultipleSelection, useSelect };\n","/** @license React v17.0.2\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;\nif(\"function\"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x(\"react.element\");c=x(\"react.portal\");d=x(\"react.fragment\");e=x(\"react.strict_mode\");f=x(\"react.profiler\");g=x(\"react.provider\");h=x(\"react.context\");k=x(\"react.forward_ref\");l=x(\"react.suspense\");m=x(\"react.suspense_list\");n=x(\"react.memo\");p=x(\"react.lazy\");q=x(\"react.block\");r=x(\"react.server.block\");u=x(\"react.fundamental\");v=x(\"react.debug_trace_mode\");w=x(\"react.legacy_hidden\")}\nfunction y(a){if(\"object\"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;\nexports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};\nexports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||\"object\"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};\nexports.typeOf=y;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n"],"names":["DESCRIPTORS","uncurryThis","objectKeys","toIndexedObject","propertyIsEnumerable","push","createMethod","TO_ENTRIES","it","key","O","keys","length","i","result","module","exports","entries","values","source","excluded","target","sourceKeys","Object","indexOf","assign","arguments","prototype","hasOwnProperty","call","apply","this","isElement","el","nodeType","canOverflow","overflow","skipOverflowHiddenElements","isScrollable","clientHeight","scrollHeight","clientWidth","scrollWidth","style","getComputedStyle","overflowY","overflowX","frame","ownerDocument","defaultView","frameElement","e","alignNearest","scrollingEdgeStart","scrollingEdgeEnd","scrollingSize","scrollingBorderStart","scrollingBorderEnd","elementEdgeStart","elementEdgeEnd","elementSize","__assign","t","s","n","p","create","idCounter","noop","isOrContainsNode","parent","child","environment","Node","contains","debounce","fn","time","timeoutId","cancel","clearTimeout","wrapper","_len","args","Array","_key","setTimeout","callAllEventHandlers","_len2","fns","_key2","event","_len3","_key3","some","concat","preventDownshiftDefault","nativeEvent","handleRefs","_len4","refs","_key4","node","forEach","ref","current","getState","state","props","reduce","prevState","undefined","isControlledProp","normalizeArrowKey","keyCode","getNextWrappingIndex","moveAmount","baseIndex","itemCount","getItemNodeFromIndex","circular","itemsLastIndex","newIndex","nonDisabledNewIndex","getNextNonDisabledIndex","currentElementNode","hasAttribute","index","_index","targetWithinDownshift","downshiftElements","checkActiveElement","contextNode","document","activeElement","cleanupStatus","documentProp","getStatusDiv","textContent","statusDiv","getElementById","createElement","setAttribute","border","clip","height","margin","padding","position","width","body","appendChild","_excluded$3","dropdownDefaultStateValues","highlightedIndex","isOpen","selectedItem","inputValue","updateA11yStatus","getA11yMessage","status","div","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","useElementIds","_ref","_ref$id","id","String","labelId","menuId","getItemId","toggleButtonId","inputId","useRef","isAcceptedCharacterKey","test","capitalizeString","string","slice","toUpperCase","useLatestRef","val","useEnhancedReducer","reducer","initialState","prevStateRef","actionRef","enhancedReducer","useCallback","action","changes","stateReducer","_useReducer","useReducer","dispatch","propsRef","dispatchWithProps","newState","type","handler","invokeOnChangeHandler","onStateChange","callOnChangeProps","defaultProps$3","itemToString","item","a","getA11ySelectionMessage","selectionParameters","itemToStringLocal","scrollIntoView","menuNode","options","windowWithViewport","scrollMode","block","inline","boundary","checkBoundary","TypeError","scrollingElement","documentElement","frames","cursor","parentElement","viewportWidth","visualViewport","innerWidth","viewportHeight","innerHeight","viewportX","scrollX","pageXOffset","viewportY","scrollY","pageYOffset","getBoundingClientRect","targetHeight","targetWidth","targetTop","top","targetRight","right","targetBottom","bottom","targetLeft","left","targetBlock","targetInline","computations","frameStyle","borderLeft","parseInt","borderLeftWidth","borderTop","borderTopWidth","borderRight","borderRightWidth","borderBottom","borderBottomWidth","blockScroll","inlineScroll","scrollbarWidth","offsetWidth","scrollbarHeight","offsetHeight","Math","max","scrollLeft","scrollTop","min","circularNavigation","getDefaultValue$1","propKey","defaultStateValues","defaultPropKey","getInitialValue$1","initialPropKey","getHighlightedIndexOnOpen","offset","items","initialHighlightedIndex","defaultHighlightedIndex","useA11yMessageSetter","dependencyArray","_ref2","isInitialMount","rest","highlightedItem","resultCount","useControlPropsValidator","getItemIndexByCharacterKey","_a","keysSoFar","lowerCasedKeysSoFar","toLowerCase","offsetIndex","startsWith","element","addEventListener","removeEventListener","defaultProps$2","getA11yStatusMessage","previousResultCount","validatePropTypes$2","stateChangeTypes$2","freeze","__proto__","MenuKeyDownArrowDown","MenuKeyDownArrowUp","MenuKeyDownEscape","MenuKeyDownHome","MenuKeyDownEnd","MenuKeyDownEnter","MenuKeyDownSpaceButton","MenuKeyDownCharacter","MenuBlur","MenuMouseLeave","ItemMouseMove","ItemClick","ToggleButtonClick","ToggleButtonKeyDownArrowDown","ToggleButtonKeyDownArrowUp","ToggleButtonKeyDownCharacter","FunctionToggleMenu","FunctionOpenMenu","FunctionCloseMenu","FunctionSetHighlightedIndex","FunctionSelectItem","FunctionSetInputValue","FunctionReset","downshiftSelectReducer","shiftKey","lowercasedKey","itemIndex","_lowercasedKey","_inputValue","stateChangeTypes","Error","downshiftCommonReducer","_excluded$2","_excluded2$2","_excluded3$1","useSelect","userProps","initialIsOpen","defaultIsOpen","_useControlledReducer","_useEnhancedReducer","useControlledReducer$1","getInitialState$2","toggleButtonRef","menuRef","itemRefs","shouldBlurRef","clearTimeoutRef","elementIds","previousResultCountRef","isInitialMountRef","latest","shouldScrollRef","_ref3","menuElement","scrollIntoViewProp","useScrollIntoView","outerDispatch","focus","mouseAndTouchTrackersRef","downshiftElementRefs","handleBlur","isMouseDown","isTouchMove","onMouseDown","onMouseUp","map","onTouchStart","onTouchMove","onTouchEnd","useMouseAndTouchTracker","setGetterPropCallInfo","toggleButtonKeyDownHandlers","useMemo","ArrowDown","preventDefault","ArrowUp","menuKeyDownHandlers","Home","End","Escape","Enter","toggleMenu","closeMenu","openMenu","setHighlightedIndex","newHighlightedIndex","selectItem","newSelectedItem","reset","setInputValue","newInputValue","getLabelProps","labelProps","htmlFor","getMenuProps","_temp","_temp2","_extends2","onMouseLeave","_ref$refKey","refKey","onKeyDown","onBlur","_ref2$suppressRefErro","suppressRefError","latestState","role","tabIndex","getToggleButtonProps","_temp3","_temp4","_extends3","onClick","_ref3$refKey","_ref4$suppressRefErro","toggleProps","toggleButtonNode","disabled","getItemProps","_temp5","_extends4","_ref5","onMouseMove","_ref5$refKey","_latest$current","latestProps","getItemIndex","itemProps","itemNode","Symbol","for","x","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","propName","componentName","location","propFullName","secret","err","name","getShim","isRequired","ReactPropTypes","array","bool","func","number","object","symbol","any","arrayOf","elementType","instanceOf","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes"],"sourceRoot":""}