Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

downshift

Package Overview
Dependencies
Maintainers
2
Versions
354
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downshift - npm Package Compare versions

Comparing version 8.2.4-alhpa.0 to 8.2.4-alpha.1

2

dist/downshift.umd.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t);function o(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r.apply(this,arguments)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a,c,d,p,f={exports:{}};f.exports=function(){if(p)return d;p=1;var e=c?a:(c=1,a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,d=function(){function i(t,n,i,o,r,u){if(u!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var h,g=l(f.exports),m={};!function(){if(h)return m;h=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case i:case r:case o:case c:case d:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case f:case p:case u:return e;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference"),m.ContextConsumer=s,m.ContextProvider=u,m.Element=t,m.ForwardRef=a,m.Fragment=i,m.Lazy=f,m.Memo=p,m.Portal=n,m.Profiler=r,m.StrictMode=o,m.Suspense=c,m.SuspenseList=d,m.isAsyncMode=function(){return!1},m.isConcurrentMode=function(){return!1},m.isContextConsumer=function(e){return I(e)===s},m.isContextProvider=function(e){return I(e)===u},m.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},m.isForwardRef=function(e){return I(e)===a},m.isFragment=function(e){return I(e)===i},m.isLazy=function(e){return I(e)===f},m.isMemo=function(e){return I(e)===p},m.isPortal=function(e){return I(e)===n},m.isProfiler=function(e){return I(e)===r},m.isStrictMode=function(e){return I(e)===o},m.isSuspense=function(e){return I(e)===c},m.isSuspenseList=function(e){return I(e)===d},m.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===c||t===d||t===g||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===p||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},m.typeOf=I}();const I=e=>"object"==typeof e&&null!=e&&1===e.nodeType,v=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,y=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return v(n.overflowY,t)||v(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},b=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,x=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var w=0;function S(e){return"function"==typeof e?e:C}function C(){}function k(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:c}=t,d="function"==typeof a?a:e=>e!==a;if(!I(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let h=e;for(;I(h)&&d(h);){if(h=x(h),h===p){f.push(h);break}null!=h&&h===document.body&&y(h)&&!y(document.documentElement)||null!=h&&y(h,c)&&f.push(h)}const g=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,m=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:v,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?k:"end"===s?O:k+S/2,P="center"===l?M+C/2:"end"===l?D:M;const R=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:i,top:o,right:r,bottom:a,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=m&&D<=g&&k>=o&&O<=a&&M>=c&&D<=r)return R;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),I=parseInt(d.borderTopWidth,10),y=parseInt(d.borderRightWidth,10),x=parseInt(d.borderBottomWidth,10);let T=0,K=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-y:0,V="offsetHeight"in t?t.offsetHeight-t.clientHeight-I-x:0,A="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)T="start"===s?E:"end"===s?E-m:"nearest"===s?b(w,w+m,m,I,x,w+E,w+E+S,S):E-m/2,K="start"===l?P:"center"===l?P-g/2:"end"===l?P-g:b(v,v+g,g,h,y,v+P,v+P+C,C),T=Math.max(0,T+w),K=Math.max(0,K+v);else{T="start"===s?E-o-I:"end"===s?E-a+x+V:"nearest"===s?b(o,a,n,I,x+V,E,E+S,S):E-(o+n/2)+V/2,K="start"===l?P-c-h:"center"===l?P-(c+i/2)+H/2:"end"===l?P-r+y+H:b(c,r,i,h,y+H,P,P+C,C);const{scrollLeft:e,scrollTop:u}=t;T=Math.max(0,Math.min(u+T/B,t.scrollHeight-n/B+V)),K=Math.max(0,Math.min(e+K/A,t.scrollWidth-i/A+H)),E+=u-T,P+=e-K}R.push({el:t,top:T,left:K})}return R})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function D(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function O(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function P(){return String(w++)}function R(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function T(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function H(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function V(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=A(t,i)?t[i]:e[i],n}),{})}function A(e,t){return void 0!==e[t]}function B(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function L(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=_(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function _(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?_(t?r-1:0,t,n,i):-1}function F(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(D(t,e,n)||i&&D(t,n.document.activeElement,n))}))}var N=O((function(e){j(e).textContent=""}),500);function j(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function U(e,t){e&&t&&(j(t).textContent=e,N(t))}var W=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),$=["refKey","ref"],q=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],z=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Y=["refKey","ref"],X=["onMouseMove","onMouseDown","onClick","onPress","index","item"],G=function(){var e=function(e){var n,i;function l(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+P(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=H(t),n.internalSetState(r({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=H(t),n.internalSetState(r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var c={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],A(n.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),a)),c}),(function(){S(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,$),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return r(((i={})[l]=E(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=L(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=L(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(r({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=_(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=_(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=o(t,q),c=n.getState().isOpen,d={onClick:M(i,n.buttonHandleClick),onKeyDown:M(u,n.buttonHandleKeyDown),onKeyUp:M(s,n.buttonHandleKeyUp),onBlur:M(l,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=B(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(u(n),e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=o(t,z),c={};var d,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onChange=M(s,l,n.inputHandleChange),d.onKeyDown=M(i,n.inputHandleKeyDown),d.onBlur=M(u,n.inputHandleBlur),c=d);return r({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,a)},n.inputHandleKeyDown=function(e){var t=B(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(u(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,Y),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,r(((i={})[l]=E(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),c)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=o(i,X);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var f=l,h=((t={onMouseMove:M(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:M(s,(function(e){e.preventDefault()}))}).onClick=M(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return r({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=H(e),n.internalSetState((function(t){var i=t.selectedItem;return r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=H(e),n.internalSetState((function(t){var i=t.isOpen;return r({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),S(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=O((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),u=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,U(u,n.props.environment.document)}}),200);var i=n.props,s=i.defaultHighlightedIndex,l=i.initialHighlightedIndex,a=void 0===l?s:l,c=i.defaultIsOpen,d=i.initialIsOpen,p=void 0===d?c:d,f=i.initialInputValue,h=void 0===f?"":f,g=i.initialSelectedItem,m=void 0===g?null:g,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:h,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}i=e,(n=l).prototype=Object.create(i.prototype),n.prototype.constructor=n,s(n,i);var a=l.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),V(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=L(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},a.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!F(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=F(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},a.componentDidUpdate=function(e,t){A(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=T(this.props.children,C);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=T(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},l}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:R,itemToString:function(e){return null==e?"":String(e)},onStateChange:C,onInputValueChange:C,onUserAction:C,onChange:C,onSelect:C,onOuterClick:C,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:k},e.stateChangeTypes=W,e}(),J=G,Q=["isInitialMount","highlightedIndex","items","environment"],Z={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function ee(e,t,n){var i=e.props,o=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,u=t.type,s="on"+re(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](r({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(r({type:o},u))}var te=O((function(e,t){U(e(),t)}),200),ne="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,ie="useId"in i.default?function(e){var n=e.id,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+i.default.useId();return n||(n=a),t.useRef({labelId:o||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+P():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function oe(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function re(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function ue(e){var n=t.useRef(e);return n.current=e,n}function se(e,n,i,o){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=V(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),c=a[0],d=a[1],p=ue(n),f=t.useCallback((function(e){return d(r({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=u.current&&!o(u.current,c);h&&e&&ee(h,V(u.current,h.props),c),u.current=c}),[c,n,h,o]),[c,f]}function le(e,t,n,i){var o=se(e,t,n,i),r=o[0],u=o[1];return[V(r,t),u]}var ae={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:k,environment:"undefined"==typeof window?void 0:window};function ce(e,t,n){void 0===n&&(n=Z);var i=e["default"+re(t)];return void 0!==i?i:n[t]}function de(e,t,n){void 0===n&&(n=Z);var i=e[t];if(void 0!==i)return i;var o=e["initial"+re(t)];return void 0!==o?o:ce(e,t,n)}function pe(e){var t=de(e,"selectedItem"),n=de(e,"isOpen"),i=de(e,"highlightedIndex"),o=de(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function fe(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&s===o?o:void 0!==r?r:u?i.indexOf(u):0===n?-1:n<0?i.length-1:0}function he(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(i){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!F(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||F(t.target,n.map((function(e){return e.current})),i,!1)||o()};return i.addEventListener("mousedown",t),i.addEventListener("mouseup",u),i.addEventListener("touchstart",s),i.addEventListener("touchmove",l),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",a)}}}),[e,i]),r}var ge=function(){return C};function me(e,n,i){var u=i.isInitialMount,s=i.highlightedIndex,l=i.items,a=i.environment,c=o(i,Q);t.useEffect((function(){!u&&null!=a&&a.document&&te((function(){return e(r({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},c))}),a.document)}),n)}function Ie(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return ne((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var ve=C;function ye(e,t,n){var i;return void 0===n&&(n=!0),r({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&r({selectedItem:e.items[t],isOpen:ce(e,"isOpen"),highlightedIndex:ce(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function be(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItemChange===t.selectedItemChange}var xe={environment:g.shape({addEventListener:g.func.isRequired,removeEventListener:g.func.isRequired,document:g.shape({createElement:g.func.isRequired,getElementById:g.func.isRequired,activeElement:g.any.isRequired,body:g.any.isRequired}).isRequired,Node:g.func.isRequired}),itemToString:g.func,stateReducer:g.func},we=r({},xe,{getA11yStatusMessage:g.func,highlightedIndex:g.number,defaultHighlightedIndex:g.number,initialHighlightedIndex:g.number,isOpen:g.bool,defaultIsOpen:g.bool,initialIsOpen:g.bool,selectedItem:g.any,initialSelectedItem:g.any,defaultSelectedItem:g.any,id:g.string,labelId:g.string,menuId:g.string,getItemId:g.func,toggleButtonId:g.string,onSelectedItemChange:g.func,onHighlightedIndexChange:g.func,onStateChange:g.func,onIsOpenChange:g.func,scrollIntoView:g.func});function Se(e,t,n){var i,o=t.type,u=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:fe(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:fe(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:ce(u,"highlightedIndex"),isOpen:ce(u,"isOpen"),selectedItem:ce(u,"selectedItem"),inputValue:ce(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,i)}var Ce=function(){return Ce=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ce.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,Ce(Ce({},we),{items:g.array.isRequired,isItemDisabled:g.func,getA11ySelectionMessage:g.func});var ke=Ce(Ce({},ae),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""},isItemDisabled:function(){return!1}}),De=C,Oe=1,Me=2,Ee=3,Pe=4,Re=5,Te=6,Ke=7,He=8,Ve=9,Ae=10,Be=11,Le=14,_e=19,Fe=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Oe,ToggleButtonKeyDownArrowUp:Me,ToggleButtonKeyDownCharacter:Ee,ToggleButtonKeyDownEscape:Pe,ToggleButtonKeyDownHome:Re,ToggleButtonKeyDownEnd:Te,ToggleButtonKeyDownEnter:Ke,ToggleButtonKeyDownSpaceButton:He,ToggleButtonKeyDownPageUp:Ve,ToggleButtonKeyDownPageDown:Ae,ToggleButtonBlur:Be,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Le,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:_e,FunctionSetInputValue:20,FunctionReset:21});function Ne(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Le:i={isOpen:ce(u,"isOpen"),highlightedIndex:ce(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case Ee:var l=t.key,a=""+e.inputValue+l,c=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.indexOf(e.selectedItem):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled});i={inputValue:a,highlightedIndex:c,isOpen:!0};break;case Oe:i={highlightedIndex:e.isOpen?L(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:fe(u,e,1),isOpen:!0};break;case Me:if(e.isOpen&&s)i=ye(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?L(e.highlightedIndex,-1,u.items,u.isItemDisabled):fe(u,e,-1),isOpen:!0};break;case Ke:case He:i=ye(u,e.highlightedIndex,!1);break;case Re:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Te:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Ve:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Ae:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Pe:i={isOpen:!1,highlightedIndex:-1};break;case Be:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case _e:i={selectedItem:t.selectedItem};break;default:return Se(e,t,Fe)}return r({},e,i)}var je=["onMouseLeave","refKey","ref"],Ue=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],We=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function $e(e){void 0===e&&(e={}),De();var n=r({},ke,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,c=n.getA11yStatusMessage,d=le(Ne,n,pe,be),p=d[0],f=d[1],h=p.isOpen,g=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),w=ie(n),S=t.useRef(),C=t.useRef(!0),k=ue({state:p,props:n}),D=t.useCallback((function(e){return b.current[w.getItemId(e)]}),[w]);me(c,[h,g,I,i],r({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),me(a,[m],r({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p));var P=Ie({menuElement:y.current,highlightedIndex:g,isOpen:h,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:D});t.useEffect((function(){return x.current=O((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),ve({isInitialMount:C.current,props:n,state:p}),t.useEffect((function(){C.current||(S.current=i.length)})),t.useEffect((function(){de(n,"isOpen")&&v.current&&v.current.focus()}),[]);var R=he(h,[y,v],s,(function(){f({type:Be})})),T=ge();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){h||(b.current={})}),[h]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:Oe,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Me,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Re})},End:function(e){e.preventDefault(),f({type:Te})},Escape:function(){k.current.state.isOpen&&f({type:Pe})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?Ke:0})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ve}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ae}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Ee,key:" "}):f({type:He}):f({type:0})}}}),[f,k]),H=t.useCallback((function(){f({type:15})}),[f]),V=t.useCallback((function(){f({type:17})}),[f]),A=t.useCallback((function(){f({type:16})}),[f]),L=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),_=t.useCallback((function(e){f({type:_e,selectedItem:e})}),[f]),F=t.useCallback((function(){f({type:21})}),[f]),N=t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),j=t.useCallback((function(e){return r({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),U=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,je),d=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==d&&d,l,y),r(((n={})[l]=E(a,(function(e){y.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+w.labelId,n.onMouseLeave=M(u,(function(){f({type:12})})),n),c)}),[f,T,w]),W=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,d=i.ref,p=o(i,Ue),h=(void 0===t?{}:t).suppressRefError,g=void 0!==h&&h,m=k.current.state,I=r(((n={})[c]=E(d,(function(e){v.current=e})),n["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",n["aria-controls"]=w.menuId,n["aria-expanded"]=k.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=p&&p["aria-label"]?void 0:""+w.labelId,n.id=w.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=M(u,(function(){m.isOpen&&!R.current.isMouseDown&&f({type:Be})})),n),p);return p.disabled||(I.onClick=M(s,(function(){f({type:0})})),I.onKeyDown=M(l,(function(e){var t=B(e);t&&K[t]?K[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Ee,key:t})}))),T("getToggleButtonProps",g,c,v),I}),[k,w,T,f,R,K]),$=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var c=n.refKey,d=void 0===c?"ref":c,p=n.disabled,h=n.ref,g=o(n,We);void 0!==p&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=k.current,I=m.state,v=m.props,y=oe(i,u,v.items,"Pass either item or index to getItemProps!"),x=y[0],S=y[1],C=v.isItemDisabled(x,S),D=r(((t={})[d]=E(h,(function(e){e&&(b.current[w.getItemId(S)]=e)})),t["aria-disabled"]=C,t["aria-selected"]=""+(x===I.selectedItem),t.id=w.getItemId(S),t.role="option",t),g);return C||(D.onClick=M(l,(function(){f({type:Le,index:S})}))),D.onMouseMove=M(s,(function(){S!==I.highlightedIndex&&(P.current=!1,f({type:13,index:S,disabled:C}))})),D.onMouseDown=M(a,(function(e){return e.preventDefault()})),D}),[k,w,P,f]);return{getToggleButtonProps:W,getLabelProps:j,getMenuProps:U,getItemProps:$,toggleMenu:H,openMenu:A,closeMenu:V,setHighlightedIndex:L,selectItem:_,reset:F,setInputValue:N,highlightedIndex:g,isOpen:h,selectedItem:m,inputValue:I}}$e.stateChangeTypes=Fe;var qe=0,ze=1,Ye=2,Xe=3,Ge=4,Je=5,Qe=6,Ze=7,et=8,tt=9,nt=10,it=13,ot=19,rt=22,ut=Object.freeze({__proto__:null,InputKeyDownArrowDown:qe,InputKeyDownArrowUp:ze,InputKeyDownEscape:Ye,InputKeyDownHome:Xe,InputKeyDownEnd:Ge,InputKeyDownPageUp:Je,InputKeyDownPageDown:Qe,InputKeyDownEnter:Ze,InputChange:et,InputBlur:tt,InputClick:nt,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:it,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:ot,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:rt});function st(e){var t=pe(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),r({},t,{inputValue:i})}r({},we,{items:g.array.isRequired,isItemDisabled:g.func,selectedItemChanged:g.func,getA11ySelectionMessage:g.func,inputValue:g.string,defaultInputValue:g.string,initialInputValue:g.string,inputId:g.string,onInputValueChange:g.func});var lt=C,at=r({},ae,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:R,isItemDisabled:function(){return!1}});function ct(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case it:i={isOpen:ce(u,"isOpen"),highlightedIndex:ce(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case qe:i=e.isOpen?{highlightedIndex:L(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:fe(u,e,1),isOpen:u.items.length>=0};break;case ze:i=e.isOpen?s?ye(u,e.highlightedIndex):{highlightedIndex:L(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:fe(u,e,-1),isOpen:u.items.length>=0};break;case Ze:i=ye(u,e.highlightedIndex);break;case Ye:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Je:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Qe:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Xe:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled)};break;case Ge:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case tt:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case et:i={isOpen:!0,highlightedIndex:ce(u,"highlightedIndex"),inputValue:t.inputValue};break;case nt:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:fe(u,e,0)};break;case ot:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case rt:i={inputValue:t.inputValue};break;default:return Se(e,t,ut)}return r({},e,i)}var dt=["onMouseLeave","refKey","ref"],pt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],ft=["onClick","onPress","refKey","ref"],ht=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function gt(e){void 0===e&&(e={}),lt();var n=r({},at,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,c=n.itemToString,d=function(e,n,i,o){var r=t.useRef(),u=se(e,n,i,o),s=u[0],l=u[1];return t.useEffect((function(){A(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&l({type:rt,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[V(s,n),l]}(ct,n,st,be),p=d[0],f=d[1],h=p.isOpen,g=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef({}),b=t.useRef(null),x=t.useRef(null),w=t.useRef(!0),S=ie(n),C=t.useRef(),k=ue({state:p,props:n}),D=t.useCallback((function(e){return y.current[S.getItemId(e)]}),[S]);me(l,[h,g,I,i],r({isInitialMount:w.current,previousResultCount:C.current,items:i,environment:s,itemToString:c},p)),me(a,[m],r({isInitialMount:w.current,previousResultCount:C.current,items:i,environment:s,itemToString:c},p));var O=Ie({menuElement:v.current,highlightedIndex:g,isOpen:h,itemRefs:y,scrollIntoView:u,getItemNodeFromIndex:D});ve({isInitialMount:w.current,props:n,state:p}),t.useEffect((function(){de(n,"isOpen")&&b.current&&b.current.focus()}),[]),t.useEffect((function(){w.current||(C.current=i.length)}));var P=he(h,[b,v,x],s,(function(){f({type:tt,selectItem:!1})})),R=ge();t.useEffect((function(){return w.current=!1,function(){w.current=!0}}),[]),t.useEffect((function(){h||(y.current={})}),[h]),t.useEffect((function(){var e;h&&null!=s&&s.document&&null!=b&&null!=(e=b.current)&&e.focus&&s.document.activeElement!==b.current&&b.current.focus()}),[h,s]);var T=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:qe,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:ze,altKey:e.altKey})},Home:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Xe}))},End:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ge}))},Escape:function(e){var t=k.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:Ye}))},Enter:function(e){k.current.state.isOpen&&229!==e.which&&(e.preventDefault(),f({type:Ze}))},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Je}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Qe}))}}}),[f,k]),K=t.useCallback((function(e){return r({id:S.labelId,htmlFor:S.inputId},e)}),[S]),H=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,dt),d=(void 0===t?{}:t).suppressRefError;return R("getMenuProps",void 0!==d&&d,l,v),r(((n={})[l]=E(a,(function(e){v.current=e})),n.id=S.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+S.labelId,n.onMouseLeave=M(u,(function(){f({type:11})})),n),c)}),[f,R,S]),L=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,d=i.onMouseMove,p=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=o(i,pt);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var I=k.current,v=I.props,b=I.state,x=oe(u,s,v.items,"Pass either item or index to getItemProps!"),w=x[0],C=x[1],D=v.isItemDisabled(w,C),P=h;return r(((t={})[a]=E(c,(function(e){e&&(y.current[S.getItemId(C)]=e)})),t["aria-disabled"]=D,t["aria-selected"]=""+(C===b.highlightedIndex),t.id=S.getItemId(C),t.role="option",t),!D&&((n={}).onClick=M(P,(function(){f({type:it,index:C})})),n),{onMouseMove:M(d,(function(){C!==b.highlightedIndex&&(O.current=!1,f({type:12,index:C,disabled:D}))})),onMouseDown:M(p,(function(e){return e.preventDefault()}))},m)}),[f,k,O,S]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var u=n.refKey,s=void 0===u?"ref":u,l=n.ref,a=o(n,ft),c=k.current.state;return r(((t={})[s]=E(l,(function(e){x.current=e})),t["aria-controls"]=S.menuId,t["aria-expanded"]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&r({},{onClick:M(i,(function(){f({type:14})}))}),a)}),[f,k,S]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onKeyDown,l=i.onChange,a=i.onInput,c=i.onBlur;i.onChangeText;var d=i.onClick,p=i.refKey,h=void 0===p?"ref":p,g=i.ref,m=o(i,ht),I=(void 0===t?{}:t).suppressRefError;R("getInputProps",void 0!==I&&I,h,b);var v,y=k.current.state,x={};m.disabled||((v={}).onChange=M(l,a,(function(e){f({type:et,inputValue:e.target.value})})),v.onKeyDown=M(u,(function(e){var t=B(e);t&&T[t]&&T[t](e)})),v.onBlur=M(c,(function(e){if(null!=s&&s.document&&y.isOpen&&!P.current.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;f({type:tt,selectItem:!t})}})),v.onClick=M(d,(function(){f({type:nt})})),x=v);return r(((n={})[h]=E(g,(function(e){b.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?S.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=S.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:S.labelId,n.autoComplete="off",n.id=S.inputId,n.role="combobox",n.value=y.inputValue,n),x,m)}),[R,k,S,T,f,P,s]),N=t.useCallback((function(){f({type:15})}),[f]),j=t.useCallback((function(){f({type:17})}),[f]),U=t.useCallback((function(){f({type:16})}),[f]),W=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),$=t.useCallback((function(e){f({type:ot,selectedItem:e})}),[f]);return{getItemProps:L,getLabelProps:K,getMenuProps:H,getInputProps:F,getToggleButtonProps:_,toggleMenu:N,openMenu:U,closeMenu:j,setHighlightedIndex:W,setInputValue:t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),selectItem:$,reset:t.useCallback((function(){f({type:21})}),[f]),highlightedIndex:g,isOpen:h,selectedItem:m,inputValue:I}}gt.stateChangeTypes=ut;var mt={activeIndex:-1,selectedItems:[]};function It(e,t){return de(e,t,mt)}function vt(e,t){return ce(e,t,mt)}function yt(e){return{activeIndex:It(e,"activeIndex"),selectedItems:It(e,"selectedItems")}}function bt(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function xt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}r({},xe,{selectedItems:g.array,initialSelectedItems:g.array,defaultSelectedItems:g.array,getA11yRemovalMessage:g.func,activeIndex:g.number,initialActiveIndex:g.number,defaultActiveIndex:g.number,onActiveIndexChange:g.func,onSelectedItemsChange:g.func,keyNavigationNext:g.string,keyNavigationPrevious:g.string});var wt={itemToString:ae.itemToString,stateReducer:ae.stateReducer,environment:ae.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},St=C,Ct=0,kt=1,Dt=2,Ot=3,Mt=4,Et=5,Pt=6,Rt=7,Tt=8,Kt=9,Ht=10,Vt=11,At=12,Bt=Object.freeze({__proto__:null,SelectedItemClick:Ct,SelectedItemKeyDownDelete:kt,SelectedItemKeyDownBackspace:Dt,SelectedItemKeyDownNavigationNext:Ot,SelectedItemKeyDownNavigationPrevious:Mt,DropdownKeyDownNavigationPrevious:Et,DropdownKeyDownBackspace:Pt,DropdownClick:Rt,FunctionAddSelectedItem:Tt,FunctionRemoveSelectedItem:Kt,FunctionSetSelectedItems:Ht,FunctionSetActiveIndex:Vt,FunctionReset:At});function Lt(e,t){var n,i=t.type,o=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case Ct:n={activeIndex:o};break;case Mt:n={activeIndex:l-1<0?0:l-1};break;case Ot:n={activeIndex:l+1>=a.length?-1:l+1};break;case Dt:case kt:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=r({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Et:n={activeIndex:a.length-1};break;case Pt:n={selectedItems:a.slice(0,a.length-1)};break;case Tt:n={selectedItems:[].concat(a,[s])};break;case Rt:n={activeIndex:-1};break;case Kt:var d=l,p=a.indexOf(s);if(p<0)break;1===a.length?d=-1:p===a.length-1&&(d=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:d};break;case Ht:n={selectedItems:t.selectedItems};break;case Vt:n={activeIndex:t.activeIndex};break;case At:n={activeIndex:vt(u,"activeIndex"),selectedItems:vt(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var _t=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Ft=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Nt(e){void 0===e&&(e={}),St();var n=r({},wt,e),i=n.getA11yRemovalMessage,u=n.itemToString,s=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,c=le(Lt,n,yt,xt),d=c[0],p=c[1],f=d.activeIndex,h=d.selectedItems,g=t.useRef(!0),m=t.useRef(null),I=t.useRef(h),v=t.useRef();v.current=[];var y=ue({state:d,props:n});t.useEffect((function(){if(!g.current&&null!=s&&s.document){if(h.length<I.current.length){var e=I.current.find((function(e){return h.indexOf(e)<0}));U(i({itemToString:u,resultCount:h.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:h[f]}),s.document)}I.current=h}}),[h.length]),t.useEffect((function(){g.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),ve({isInitialMount:g.current,props:n,state:d});var b=ge();t.useEffect((function(){return g.current=!1,function(){g.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Mt})},e[l]=function(){p({type:Ot})},e.Delete=function(){p({type:kt})},e.Backspace=function(){p({type:Dt})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){bt(e)&&p({type:Et})},e.Backspace=function(e){bt(e)&&p({type:Pt})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,u=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,c=n.selectedItem,d=n.index,f=o(n,_t),h=y.current.state,g=oe(c,d,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=g>-1&&g===h.activeIndex;return r(((t={})[u]=E(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=M(l,(function(){p({type:Ct,index:g})})),t.onKeyDown=M(a,(function(e){var t=B(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,d=i.preventKeyAction,f=void 0!==d&&d,h=o(i,Ft),g=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==g&&g,s,m),r(((n={})[s]=E(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:M(a,(function(e){var t=B(e);t&&w[t]&&w[t](e)})),onClick:M(c,(function(){p({type:Rt})}))},h)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:Tt,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Kt,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Ht,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Vt,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:At})}),[p]),selectedItems:h,activeIndex:f}}Nt.stateChangeTypes=Bt,e.default=J,e.resetIdCounter=function(){"useId"in i.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):w=0},e.useCombobox=gt,e.useMultipleSelection=Nt,e.useSelect=$e,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t);function o(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r.apply(this,arguments)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a,c,d,p,f={exports:{}};f.exports=function(){if(p)return d;p=1;var e=c?a:(c=1,a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,d=function(){function i(t,n,i,o,r,u){if(u!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var h,g=l(f.exports),m={};!function(){if(h)return m;h=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case i:case r:case o:case c:case d:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case f:case p:case u:return e;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference"),m.ContextConsumer=s,m.ContextProvider=u,m.Element=t,m.ForwardRef=a,m.Fragment=i,m.Lazy=f,m.Memo=p,m.Portal=n,m.Profiler=r,m.StrictMode=o,m.Suspense=c,m.SuspenseList=d,m.isAsyncMode=function(){return!1},m.isConcurrentMode=function(){return!1},m.isContextConsumer=function(e){return I(e)===s},m.isContextProvider=function(e){return I(e)===u},m.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},m.isForwardRef=function(e){return I(e)===a},m.isFragment=function(e){return I(e)===i},m.isLazy=function(e){return I(e)===f},m.isMemo=function(e){return I(e)===p},m.isPortal=function(e){return I(e)===n},m.isProfiler=function(e){return I(e)===r},m.isStrictMode=function(e){return I(e)===o},m.isSuspense=function(e){return I(e)===c},m.isSuspenseList=function(e){return I(e)===d},m.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===c||t===d||t===g||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===p||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},m.typeOf=I}();const I=e=>"object"==typeof e&&null!=e&&1===e.nodeType,v=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,y=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return v(n.overflowY,t)||v(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},b=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,x=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var w=0;function S(e){return"function"==typeof e?e:C}function C(){}function k(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:c}=t,d="function"==typeof a?a:e=>e!==a;if(!I(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let h=e;for(;I(h)&&d(h);){if(h=x(h),h===p){f.push(h);break}null!=h&&h===document.body&&y(h)&&!y(document.documentElement)||null!=h&&y(h,c)&&f.push(h)}const g=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,m=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:v,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?k:"end"===s?O:k+S/2,P="center"===l?M+C/2:"end"===l?D:M;const R=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:i,top:o,right:r,bottom:a,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=m&&D<=g&&k>=o&&O<=a&&M>=c&&D<=r)return R;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),I=parseInt(d.borderTopWidth,10),y=parseInt(d.borderRightWidth,10),x=parseInt(d.borderBottomWidth,10);let T=0,K=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-y:0,V="offsetHeight"in t?t.offsetHeight-t.clientHeight-I-x:0,A="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)T="start"===s?E:"end"===s?E-m:"nearest"===s?b(w,w+m,m,I,x,w+E,w+E+S,S):E-m/2,K="start"===l?P:"center"===l?P-g/2:"end"===l?P-g:b(v,v+g,g,h,y,v+P,v+P+C,C),T=Math.max(0,T+w),K=Math.max(0,K+v);else{T="start"===s?E-o-I:"end"===s?E-a+x+V:"nearest"===s?b(o,a,n,I,x+V,E,E+S,S):E-(o+n/2)+V/2,K="start"===l?P-c-h:"center"===l?P-(c+i/2)+H/2:"end"===l?P-r+y+H:b(c,r,i,h,y+H,P,P+C,C);const{scrollLeft:e,scrollTop:u}=t;T=Math.max(0,Math.min(u+T/B,t.scrollHeight-n/B+V)),K=Math.max(0,Math.min(e+K/A,t.scrollWidth-i/A+H)),E+=u-T,P+=e-K}R.push({el:t,top:T,left:K})}return R})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function D(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function O(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function P(){return String(w++)}function R(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function T(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function H(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function V(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=A(t,i)?t[i]:e[i],n}),{})}function A(e,t){return void 0!==e[t]}function B(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function L(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=_(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function _(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?_(t?r-1:0,t,n,i):-1}function F(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(D(t,e,n)||i&&D(t,n.document.activeElement,n))}))}var N=O((function(e){j(e).textContent=""}),500);function j(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function U(e,t){e&&t&&(j(t).textContent=e,N(t))}var W=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),$=["refKey","ref"],q=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],z=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Y=["refKey","ref"],X=["onMouseMove","onMouseDown","onClick","onPress","index","item"],G=function(){var e=function(e){var n,i;function l(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+P(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=H(t),n.internalSetState(r({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=H(t),n.internalSetState(r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var c={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],A(n.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),a)),c}),(function(){S(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,$),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return r(((i={})[l]=E(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=L(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=L(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(r({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=_(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=_(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=o(t,q),c=n.getState().isOpen,d={onClick:M(i,n.buttonHandleClick),onKeyDown:M(u,n.buttonHandleKeyDown),onKeyUp:M(s,n.buttonHandleKeyUp),onBlur:M(l,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=B(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(u(n),e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=o(t,z),c={};var d,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onChange=M(s,l,n.inputHandleChange),d.onKeyDown=M(i,n.inputHandleKeyDown),d.onBlur=M(u,n.inputHandleBlur),c=d);return r({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,a)},n.inputHandleKeyDown=function(e){var t=B(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(u(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,Y),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,r(((i={})[l]=E(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),c)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=o(i,X);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var f=l,h=((t={onMouseMove:M(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:M(s,(function(e){e.preventDefault()}))}).onClick=M(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return r({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=H(e),n.internalSetState((function(t){var i=t.selectedItem;return r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=H(e),n.internalSetState((function(t){var i=t.isOpen;return r({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),S(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=O((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),u=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,U(u,n.props.environment.document)}}),200);var i=n.props,s=i.defaultHighlightedIndex,l=i.initialHighlightedIndex,a=void 0===l?s:l,c=i.defaultIsOpen,d=i.initialIsOpen,p=void 0===d?c:d,f=i.initialInputValue,h=void 0===f?"":f,g=i.initialSelectedItem,m=void 0===g?null:g,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:h,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}i=e,(n=l).prototype=Object.create(i.prototype),n.prototype.constructor=n,s(n,i);var a=l.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),V(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=L(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},a.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!F(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=F(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},a.componentDidUpdate=function(e,t){A(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=T(this.props.children,C);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=T(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},l}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:R,itemToString:function(e){return null==e?"":String(e)},onStateChange:C,onInputValueChange:C,onUserAction:C,onChange:C,onSelect:C,onOuterClick:C,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:k},e.stateChangeTypes=W,e}(),J=G,Q=["isInitialMount","highlightedIndex","items","environment"],Z={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function ee(e,t,n){var i=e.props,o=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,u=t.type,s="on"+re(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](r({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(r({type:o},u))}var te=O((function(e,t){U(e(),t)}),200),ne="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,ie="useId"in i.default?function(e){var n=e.id,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+i.default.useId();return n||(n=a),t.useRef({labelId:o||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+P():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function oe(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function re(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function ue(e){var n=t.useRef(e);return n.current=e,n}function se(e,n,i,o){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=V(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),c=a[0],d=a[1],p=ue(n),f=t.useCallback((function(e){return d(r({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=u.current&&!o(u.current,c);h&&e&&ee(h,V(u.current,h.props),c),u.current=c}),[c,n,h,o]),[c,f]}function le(e,t,n,i){var o=se(e,t,n,i),r=o[0],u=o[1];return[V(r,t),u]}var ae={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:k,environment:"undefined"==typeof window?void 0:window};function ce(e,t,n){void 0===n&&(n=Z);var i=e["default"+re(t)];return void 0!==i?i:n[t]}function de(e,t,n){void 0===n&&(n=Z);var i=e[t];if(void 0!==i)return i;var o=e["initial"+re(t)];return void 0!==o?o:ce(e,t,n)}function pe(e){var t=de(e,"selectedItem"),n=de(e,"isOpen"),i=de(e,"highlightedIndex"),o=de(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function fe(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&s===o?o:void 0!==r?r:u?i.indexOf(u):0===n?-1:n<0?i.length-1:0}function he(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(i){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!F(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||F(t.target,n.map((function(e){return e.current})),i,!1)||o()};return i.addEventListener("mousedown",t),i.addEventListener("mouseup",u),i.addEventListener("touchstart",s),i.addEventListener("touchmove",l),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",a)}}}),[e,i]),r}var ge=function(){return C};function me(e,n,i){var u=i.isInitialMount,s=i.highlightedIndex,l=i.items,a=i.environment,c=o(i,Q);t.useEffect((function(){!u&&null!=a&&a.document&&te((function(){return e(r({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},c))}),a.document)}),n)}function Ie(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return ne((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var ve=C;function ye(e,t,n){var i;return void 0===n&&(n=!0),r({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&r({selectedItem:e.items[t],isOpen:ce(e,"isOpen"),highlightedIndex:ce(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function be(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}var xe={environment:g.shape({addEventListener:g.func.isRequired,removeEventListener:g.func.isRequired,document:g.shape({createElement:g.func.isRequired,getElementById:g.func.isRequired,activeElement:g.any.isRequired,body:g.any.isRequired}).isRequired,Node:g.func.isRequired}),itemToString:g.func,stateReducer:g.func},we=r({},xe,{getA11yStatusMessage:g.func,highlightedIndex:g.number,defaultHighlightedIndex:g.number,initialHighlightedIndex:g.number,isOpen:g.bool,defaultIsOpen:g.bool,initialIsOpen:g.bool,selectedItem:g.any,initialSelectedItem:g.any,defaultSelectedItem:g.any,id:g.string,labelId:g.string,menuId:g.string,getItemId:g.func,toggleButtonId:g.string,onSelectedItemChange:g.func,onHighlightedIndexChange:g.func,onStateChange:g.func,onIsOpenChange:g.func,scrollIntoView:g.func});function Se(e,t,n){var i,o=t.type,u=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:fe(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:fe(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:ce(u,"highlightedIndex"),isOpen:ce(u,"isOpen"),selectedItem:ce(u,"selectedItem"),inputValue:ce(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,i)}var Ce=function(){return Ce=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ce.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,Ce(Ce({},we),{items:g.array.isRequired,isItemDisabled:g.func,getA11ySelectionMessage:g.func});var ke=Ce(Ce({},ae),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""},isItemDisabled:function(){return!1}}),De=C,Oe=1,Me=2,Ee=3,Pe=4,Re=5,Te=6,Ke=7,He=8,Ve=9,Ae=10,Be=11,Le=14,_e=19,Fe=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Oe,ToggleButtonKeyDownArrowUp:Me,ToggleButtonKeyDownCharacter:Ee,ToggleButtonKeyDownEscape:Pe,ToggleButtonKeyDownHome:Re,ToggleButtonKeyDownEnd:Te,ToggleButtonKeyDownEnter:Ke,ToggleButtonKeyDownSpaceButton:He,ToggleButtonKeyDownPageUp:Ve,ToggleButtonKeyDownPageDown:Ae,ToggleButtonBlur:Be,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Le,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:_e,FunctionSetInputValue:20,FunctionReset:21});function Ne(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Le:i={isOpen:ce(u,"isOpen"),highlightedIndex:ce(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case Ee:var l=t.key,a=""+e.inputValue+l,c=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.indexOf(e.selectedItem):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled});i={inputValue:a,highlightedIndex:c,isOpen:!0};break;case Oe:i={highlightedIndex:e.isOpen?L(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:fe(u,e,1),isOpen:!0};break;case Me:if(e.isOpen&&s)i=ye(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?L(e.highlightedIndex,-1,u.items,u.isItemDisabled):fe(u,e,-1),isOpen:!0};break;case Ke:case He:i=ye(u,e.highlightedIndex,!1);break;case Re:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Te:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Ve:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Ae:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Pe:i={isOpen:!1,highlightedIndex:-1};break;case Be:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case _e:i={selectedItem:t.selectedItem};break;default:return Se(e,t,Fe)}return r({},e,i)}var je=["onMouseLeave","refKey","ref"],Ue=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],We=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function $e(e){void 0===e&&(e={}),De();var n=r({},ke,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,c=n.getA11yStatusMessage,d=le(Ne,n,pe,be),p=d[0],f=d[1],h=p.isOpen,g=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),w=ie(n),S=t.useRef(),C=t.useRef(!0),k=ue({state:p,props:n}),D=t.useCallback((function(e){return b.current[w.getItemId(e)]}),[w]);me(c,[h,g,I,i],r({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),me(a,[m],r({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p));var P=Ie({menuElement:y.current,highlightedIndex:g,isOpen:h,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:D});t.useEffect((function(){return x.current=O((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),ve({isInitialMount:C.current,props:n,state:p}),t.useEffect((function(){C.current||(S.current=i.length)})),t.useEffect((function(){de(n,"isOpen")&&v.current&&v.current.focus()}),[]);var R=he(h,[y,v],s,(function(){f({type:Be})})),T=ge();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){h||(b.current={})}),[h]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:Oe,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Me,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Re})},End:function(e){e.preventDefault(),f({type:Te})},Escape:function(){k.current.state.isOpen&&f({type:Pe})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?Ke:0})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ve}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ae}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Ee,key:" "}):f({type:He}):f({type:0})}}}),[f,k]),H=t.useCallback((function(){f({type:15})}),[f]),V=t.useCallback((function(){f({type:17})}),[f]),A=t.useCallback((function(){f({type:16})}),[f]),L=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),_=t.useCallback((function(e){f({type:_e,selectedItem:e})}),[f]),F=t.useCallback((function(){f({type:21})}),[f]),N=t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),j=t.useCallback((function(e){return r({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),U=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,je),d=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==d&&d,l,y),r(((n={})[l]=E(a,(function(e){y.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+w.labelId,n.onMouseLeave=M(u,(function(){f({type:12})})),n),c)}),[f,T,w]),W=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,d=i.ref,p=o(i,Ue),h=(void 0===t?{}:t).suppressRefError,g=void 0!==h&&h,m=k.current.state,I=r(((n={})[c]=E(d,(function(e){v.current=e})),n["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",n["aria-controls"]=w.menuId,n["aria-expanded"]=k.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=p&&p["aria-label"]?void 0:""+w.labelId,n.id=w.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=M(u,(function(){m.isOpen&&!R.current.isMouseDown&&f({type:Be})})),n),p);return p.disabled||(I.onClick=M(s,(function(){f({type:0})})),I.onKeyDown=M(l,(function(e){var t=B(e);t&&K[t]?K[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Ee,key:t})}))),T("getToggleButtonProps",g,c,v),I}),[k,w,T,f,R,K]),$=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var c=n.refKey,d=void 0===c?"ref":c,p=n.disabled,h=n.ref,g=o(n,We);void 0!==p&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=k.current,I=m.state,v=m.props,y=oe(i,u,v.items,"Pass either item or index to getItemProps!"),x=y[0],S=y[1],C=v.isItemDisabled(x,S),D=r(((t={})[d]=E(h,(function(e){e&&(b.current[w.getItemId(S)]=e)})),t["aria-disabled"]=C,t["aria-selected"]=""+(x===I.selectedItem),t.id=w.getItemId(S),t.role="option",t),g);return C||(D.onClick=M(l,(function(){f({type:Le,index:S})}))),D.onMouseMove=M(s,(function(){S!==I.highlightedIndex&&(P.current=!1,f({type:13,index:S,disabled:C}))})),D.onMouseDown=M(a,(function(e){return e.preventDefault()})),D}),[k,w,P,f]);return{getToggleButtonProps:W,getLabelProps:j,getMenuProps:U,getItemProps:$,toggleMenu:H,openMenu:A,closeMenu:V,setHighlightedIndex:L,selectItem:_,reset:F,setInputValue:N,highlightedIndex:g,isOpen:h,selectedItem:m,inputValue:I}}$e.stateChangeTypes=Fe;var qe=0,ze=1,Ye=2,Xe=3,Ge=4,Je=5,Qe=6,Ze=7,et=8,tt=9,nt=10,it=13,ot=19,rt=22,ut=Object.freeze({__proto__:null,InputKeyDownArrowDown:qe,InputKeyDownArrowUp:ze,InputKeyDownEscape:Ye,InputKeyDownHome:Xe,InputKeyDownEnd:Ge,InputKeyDownPageUp:Je,InputKeyDownPageDown:Qe,InputKeyDownEnter:Ze,InputChange:et,InputBlur:tt,InputClick:nt,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:it,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:ot,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:rt});function st(e){var t=pe(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),r({},t,{inputValue:i})}r({},we,{items:g.array.isRequired,isItemDisabled:g.func,selectedItemChanged:g.func,getA11ySelectionMessage:g.func,inputValue:g.string,defaultInputValue:g.string,initialInputValue:g.string,inputId:g.string,onInputValueChange:g.func});var lt=C,at=r({},ae,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:R,isItemDisabled:function(){return!1}});function ct(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case it:i={isOpen:ce(u,"isOpen"),highlightedIndex:ce(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case qe:i=e.isOpen?{highlightedIndex:L(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:fe(u,e,1),isOpen:u.items.length>=0};break;case ze:i=e.isOpen?s?ye(u,e.highlightedIndex):{highlightedIndex:L(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:fe(u,e,-1),isOpen:u.items.length>=0};break;case Ze:i=ye(u,e.highlightedIndex);break;case Ye:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Je:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Qe:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Xe:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled)};break;case Ge:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case tt:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case et:i={isOpen:!0,highlightedIndex:ce(u,"highlightedIndex"),inputValue:t.inputValue};break;case nt:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:fe(u,e,0)};break;case ot:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case rt:i={inputValue:t.inputValue};break;default:return Se(e,t,ut)}return r({},e,i)}var dt=["onMouseLeave","refKey","ref"],pt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],ft=["onClick","onPress","refKey","ref"],ht=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function gt(e){void 0===e&&(e={}),lt();var n=r({},at,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,c=n.itemToString,d=function(e,n,i,o){var r=t.useRef(),u=se(e,n,i,o),s=u[0],l=u[1];return t.useEffect((function(){A(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&l({type:rt,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[V(s,n),l]}(ct,n,st,be),p=d[0],f=d[1],h=p.isOpen,g=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef({}),b=t.useRef(null),x=t.useRef(null),w=t.useRef(!0),S=ie(n),C=t.useRef(),k=ue({state:p,props:n}),D=t.useCallback((function(e){return y.current[S.getItemId(e)]}),[S]);me(l,[h,g,I,i],r({isInitialMount:w.current,previousResultCount:C.current,items:i,environment:s,itemToString:c},p)),me(a,[m],r({isInitialMount:w.current,previousResultCount:C.current,items:i,environment:s,itemToString:c},p));var O=Ie({menuElement:v.current,highlightedIndex:g,isOpen:h,itemRefs:y,scrollIntoView:u,getItemNodeFromIndex:D});ve({isInitialMount:w.current,props:n,state:p}),t.useEffect((function(){de(n,"isOpen")&&b.current&&b.current.focus()}),[]),t.useEffect((function(){w.current||(C.current=i.length)}));var P=he(h,[b,v,x],s,(function(){f({type:tt,selectItem:!1})})),R=ge();t.useEffect((function(){return w.current=!1,function(){w.current=!0}}),[]),t.useEffect((function(){h||(y.current={})}),[h]),t.useEffect((function(){var e;h&&null!=s&&s.document&&null!=b&&null!=(e=b.current)&&e.focus&&s.document.activeElement!==b.current&&b.current.focus()}),[h,s]);var T=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:qe,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:ze,altKey:e.altKey})},Home:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Xe}))},End:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ge}))},Escape:function(e){var t=k.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:Ye}))},Enter:function(e){k.current.state.isOpen&&229!==e.which&&(e.preventDefault(),f({type:Ze}))},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Je}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Qe}))}}}),[f,k]),K=t.useCallback((function(e){return r({id:S.labelId,htmlFor:S.inputId},e)}),[S]),H=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,dt),d=(void 0===t?{}:t).suppressRefError;return R("getMenuProps",void 0!==d&&d,l,v),r(((n={})[l]=E(a,(function(e){v.current=e})),n.id=S.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+S.labelId,n.onMouseLeave=M(u,(function(){f({type:11})})),n),c)}),[f,R,S]),L=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,d=i.onMouseMove,p=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=o(i,pt);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var I=k.current,v=I.props,b=I.state,x=oe(u,s,v.items,"Pass either item or index to getItemProps!"),w=x[0],C=x[1],D=v.isItemDisabled(w,C),P=h;return r(((t={})[a]=E(c,(function(e){e&&(y.current[S.getItemId(C)]=e)})),t["aria-disabled"]=D,t["aria-selected"]=""+(C===b.highlightedIndex),t.id=S.getItemId(C),t.role="option",t),!D&&((n={}).onClick=M(P,(function(){f({type:it,index:C})})),n),{onMouseMove:M(d,(function(){C!==b.highlightedIndex&&(O.current=!1,f({type:12,index:C,disabled:D}))})),onMouseDown:M(p,(function(e){return e.preventDefault()}))},m)}),[f,k,O,S]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var u=n.refKey,s=void 0===u?"ref":u,l=n.ref,a=o(n,ft),c=k.current.state;return r(((t={})[s]=E(l,(function(e){x.current=e})),t["aria-controls"]=S.menuId,t["aria-expanded"]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&r({},{onClick:M(i,(function(){f({type:14})}))}),a)}),[f,k,S]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onKeyDown,l=i.onChange,a=i.onInput,c=i.onBlur;i.onChangeText;var d=i.onClick,p=i.refKey,h=void 0===p?"ref":p,g=i.ref,m=o(i,ht),I=(void 0===t?{}:t).suppressRefError;R("getInputProps",void 0!==I&&I,h,b);var v,y=k.current.state,x={};m.disabled||((v={}).onChange=M(l,a,(function(e){f({type:et,inputValue:e.target.value})})),v.onKeyDown=M(u,(function(e){var t=B(e);t&&T[t]&&T[t](e)})),v.onBlur=M(c,(function(e){if(null!=s&&s.document&&y.isOpen&&!P.current.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;f({type:tt,selectItem:!t})}})),v.onClick=M(d,(function(){f({type:nt})})),x=v);return r(((n={})[h]=E(g,(function(e){b.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?S.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=S.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:S.labelId,n.autoComplete="off",n.id=S.inputId,n.role="combobox",n.value=y.inputValue,n),x,m)}),[R,k,S,T,f,P,s]),N=t.useCallback((function(){f({type:15})}),[f]),j=t.useCallback((function(){f({type:17})}),[f]),U=t.useCallback((function(){f({type:16})}),[f]),W=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),$=t.useCallback((function(e){f({type:ot,selectedItem:e})}),[f]);return{getItemProps:L,getLabelProps:K,getMenuProps:H,getInputProps:F,getToggleButtonProps:_,toggleMenu:N,openMenu:U,closeMenu:j,setHighlightedIndex:W,setInputValue:t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),selectItem:$,reset:t.useCallback((function(){f({type:21})}),[f]),highlightedIndex:g,isOpen:h,selectedItem:m,inputValue:I}}gt.stateChangeTypes=ut;var mt={activeIndex:-1,selectedItems:[]};function It(e,t){return de(e,t,mt)}function vt(e,t){return ce(e,t,mt)}function yt(e){return{activeIndex:It(e,"activeIndex"),selectedItems:It(e,"selectedItems")}}function bt(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function xt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}r({},xe,{selectedItems:g.array,initialSelectedItems:g.array,defaultSelectedItems:g.array,getA11yRemovalMessage:g.func,activeIndex:g.number,initialActiveIndex:g.number,defaultActiveIndex:g.number,onActiveIndexChange:g.func,onSelectedItemsChange:g.func,keyNavigationNext:g.string,keyNavigationPrevious:g.string});var wt={itemToString:ae.itemToString,stateReducer:ae.stateReducer,environment:ae.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},St=C,Ct=0,kt=1,Dt=2,Ot=3,Mt=4,Et=5,Pt=6,Rt=7,Tt=8,Kt=9,Ht=10,Vt=11,At=12,Bt=Object.freeze({__proto__:null,SelectedItemClick:Ct,SelectedItemKeyDownDelete:kt,SelectedItemKeyDownBackspace:Dt,SelectedItemKeyDownNavigationNext:Ot,SelectedItemKeyDownNavigationPrevious:Mt,DropdownKeyDownNavigationPrevious:Et,DropdownKeyDownBackspace:Pt,DropdownClick:Rt,FunctionAddSelectedItem:Tt,FunctionRemoveSelectedItem:Kt,FunctionSetSelectedItems:Ht,FunctionSetActiveIndex:Vt,FunctionReset:At});function Lt(e,t){var n,i=t.type,o=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case Ct:n={activeIndex:o};break;case Mt:n={activeIndex:l-1<0?0:l-1};break;case Ot:n={activeIndex:l+1>=a.length?-1:l+1};break;case Dt:case kt:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=r({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Et:n={activeIndex:a.length-1};break;case Pt:n={selectedItems:a.slice(0,a.length-1)};break;case Tt:n={selectedItems:[].concat(a,[s])};break;case Rt:n={activeIndex:-1};break;case Kt:var d=l,p=a.indexOf(s);if(p<0)break;1===a.length?d=-1:p===a.length-1&&(d=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:d};break;case Ht:n={selectedItems:t.selectedItems};break;case Vt:n={activeIndex:t.activeIndex};break;case At:n={activeIndex:vt(u,"activeIndex"),selectedItems:vt(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var _t=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Ft=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Nt(e){void 0===e&&(e={}),St();var n=r({},wt,e),i=n.getA11yRemovalMessage,u=n.itemToString,s=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,c=le(Lt,n,yt,xt),d=c[0],p=c[1],f=d.activeIndex,h=d.selectedItems,g=t.useRef(!0),m=t.useRef(null),I=t.useRef(h),v=t.useRef();v.current=[];var y=ue({state:d,props:n});t.useEffect((function(){if(!g.current&&null!=s&&s.document){if(h.length<I.current.length){var e=I.current.find((function(e){return h.indexOf(e)<0}));U(i({itemToString:u,resultCount:h.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:h[f]}),s.document)}I.current=h}}),[h.length]),t.useEffect((function(){g.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),ve({isInitialMount:g.current,props:n,state:d});var b=ge();t.useEffect((function(){return g.current=!1,function(){g.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Mt})},e[l]=function(){p({type:Ot})},e.Delete=function(){p({type:kt})},e.Backspace=function(){p({type:Dt})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){bt(e)&&p({type:Et})},e.Backspace=function(e){bt(e)&&p({type:Pt})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,u=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,c=n.selectedItem,d=n.index,f=o(n,_t),h=y.current.state,g=oe(c,d,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=g>-1&&g===h.activeIndex;return r(((t={})[u]=E(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=M(l,(function(){p({type:Ct,index:g})})),t.onKeyDown=M(a,(function(e){var t=B(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,d=i.preventKeyAction,f=void 0!==d&&d,h=o(i,Ft),g=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==g&&g,s,m),r(((n={})[s]=E(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:M(a,(function(e){var t=B(e);t&&w[t]&&w[t](e)})),onClick:M(c,(function(){p({type:Rt})}))},h)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:Tt,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Kt,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Ht,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Vt,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:At})}),[p]),selectedItems:h,activeIndex:f}}Nt.stateChangeTypes=Bt,e.default=J,e.resetIdCounter=function(){"useId"in i.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):w=0},e.useCombobox=gt,e.useMultipleSelection=Nt,e.useSelect=$e,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map
{
"name": "downshift",
"version": "8.2.4-alhpa.0",
"version": "8.2.4-alpha.1",
"description": "🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.",

@@ -5,0 +5,0 @@ "main": "dist/downshift.cjs.js",

@@ -10,3 +10,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact/compat"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","preact/compat","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React,e.PropTypes)}(this,(function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(t),r=i(n);function u(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(this,arguments)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}var d,c={};

* LICENSE file in the root directory of this source tree.
*/!function(){if(d)return c;d=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case i:case r:case o:case p:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case h:case g:case u:return e;default:return d}}case n:return d}}}e=Symbol.for("react.module.reference"),c.ContextConsumer=s,c.ContextProvider=u,c.Element=t,c.ForwardRef=a,c.Fragment=i,c.Lazy=h,c.Memo=g,c.Portal=n,c.Profiler=r,c.StrictMode=o,c.Suspense=p,c.SuspenseList=f,c.isAsyncMode=function(){return!1},c.isConcurrentMode=function(){return!1},c.isContextConsumer=function(e){return I(e)===s},c.isContextProvider=function(e){return I(e)===u},c.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},c.isForwardRef=function(e){return I(e)===a},c.isFragment=function(e){return I(e)===i},c.isLazy=function(e){return I(e)===h},c.isMemo=function(e){return I(e)===g},c.isPortal=function(e){return I(e)===n},c.isProfiler=function(e){return I(e)===r},c.isStrictMode=function(e){return I(e)===o},c.isSuspense=function(e){return I(e)===p},c.isSuspenseList=function(e){return I(e)===f},c.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===p||t===f||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===g||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},c.typeOf=I}();const p=e=>"object"==typeof e&&null!=e&&1===e.nodeType,f=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,g=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return f(n.overflowY,t)||f(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},h=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,m=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var I=0;function v(e){return"function"==typeof e?e:y}function y(){}function b(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:d}=t,c="function"==typeof a?a:e=>e!==a;if(!p(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,I=[];let v=e;for(;p(v)&&c(v);){if(v=m(v),v===f){I.push(v);break}null!=v&&v===document.body&&g(v)&&!g(document.documentElement)||null!=v&&g(v,d)&&I.push(v)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?k:"end"===s?O:k+S/2,P="center"===l?M+C/2:"end"===l?D:M;const R=[];for(let e=0;e<I.length;e++){const t=I[e],{height:n,width:i,top:o,right:r,bottom:a,left:d}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=b&&D<=y&&k>=o&&O<=a&&M>=d&&D<=r)return R;const c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),g=parseInt(c.borderTopWidth,10),m=parseInt(c.borderRightWidth,10),v=parseInt(c.borderBottomWidth,10);let K=0,T=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,V="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-v:0,A="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)K="start"===s?E:"end"===s?E-b:"nearest"===s?h(w,w+b,b,g,v,w+E,w+E+S,S):E-b/2,T="start"===l?P:"center"===l?P-y/2:"end"===l?P-y:h(x,x+y,y,p,m,x+P,x+P+C,C),K=Math.max(0,K+w),T=Math.max(0,T+x);else{K="start"===s?E-o-g:"end"===s?E-a+v+V:"nearest"===s?h(o,a,n,g,v+V,E,E+S,S):E-(o+n/2)+V/2,T="start"===l?P-d-p:"center"===l?P-(d+i/2)+H/2:"end"===l?P-r+m+H:h(d,r,i,p,m+H,P,P+C,C);const{scrollLeft:e,scrollTop:u}=t;K=Math.max(0,Math.min(u+K/B,t.scrollHeight-n/B+V)),T=Math.max(0,Math.min(e+T/A,t.scrollWidth-i/A+H)),E+=u-K,P+=e-T}R.push({el:t,top:K,left:T})}return R})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function x(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function w(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function C(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function k(){return String(I++)}function D(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function O(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var M=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function E(e){void 0===e&&(e={});var t={};return M.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function P(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=R(t,i)?t[i]:e[i],n}),{})}function R(e,t){return void 0!==e[t]}function K(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function T(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=H(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function H(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?H(t?r-1:0,t,n,i):-1}function V(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(x(t,e,n)||i&&x(t,n.document.activeElement,n))}))}var A=w((function(e){B(e).textContent=""}),500);function B(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function L(e,t){e&&t&&(B(t).textContent=e,A(t))}var F=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),N=["refKey","ref"],_=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],j=["onKeyDown","onBlur","onChange","onInput","onChangeText"],U=["refKey","ref"],$=["onMouseMove","onMouseDown","onClick","onPress","index","item"],W=function(){var e=function(e){var n,i;function o(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+k(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=E(t),n.internalSetState(s({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=E(t),n.internalSetState(s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,r={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,s({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var d={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(r[e]=a[e]),"type"!==e&&(a[e],R(n.props,e)||(d[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,s({},n.getStateAndHelpers(),a)),d}),(function(){v(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,N),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return s(((i={})[l]=C(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(s({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=s({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=s({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,r=t.onKeyUp,l=t.onBlur,a=u(t,_),d=n.getState().isOpen,c={onClick:S(i,n.buttonHandleClick),onKeyDown:S(o,n.buttonHandleKeyDown),onKeyUp:S(r,n.buttonHandleKeyUp),onBlur:S(l,n.buttonHandleBlur)};return s({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:c,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=K(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(l(n),e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return s({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,r=t.onChange,l=t.onInput;t.onChangeText;var a=u(t,j),d={};var c,p=n.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((c={}).onInput=S(r,l,n.inputHandleChange),c.onKeyDown=S(i,n.inputHandleKeyDown),c.onBlur=S(o,n.inputHandleBlur),d=c);return s({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?n.getItemId(h):void 0,"aria-controls":g?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},d,a)},n.inputHandleKeyDown=function(e){var t=K(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(l(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,U),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,s(((i={})[l]=C(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,r=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=u(i,$);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,g=((t={onMouseMove:S(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:S(r,(function(e){e.preventDefault()}))}).onClick=S(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return s({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},h,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var i=t.selectedItem;return s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var i=t.isOpen;return s({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),v(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=w((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,L(r,n.props.environment.document)}}),200);var i=n.props,o=i.defaultHighlightedIndex,r=i.initialHighlightedIndex,a=void 0===r?o:r,d=i.defaultIsOpen,c=i.initialIsOpen,p=void 0===c?d:c,f=i.initialInputValue,g=void 0===f?"":f,h=i.initialSelectedItem,m=void 0===h?null:h,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}i=e,(n=o).prototype=Object.create(i.prototype),n.prototype.constructor=n,a(n,i);var r=o.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},r.getState=function(e){return void 0===e&&(e=this.state),P(e,this.props)},r.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},r.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},r.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},r.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=T(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},r.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},r.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!V(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=V(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},r.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},r.componentDidUpdate=function(e,t){R(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var e=O(this.props.children,y);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=O(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type||"string"==typeof e.nodeName}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props||e.attributes}(n))):void 0:null},o}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:D,itemToString:function(e){return null==e?"":String(e)},onStateChange:y,onInputValueChange:y,onUserAction:y,onChange:y,onSelect:y,onOuterClick:y,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:b},e.stateChangeTypes=F,e}(),q=W,z=["isInitialMount","highlightedIndex","items","environment"],X={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Y(e,t,n){var i=e.props,o=e.type,r={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,r=t.type,u="on"+ee(e)+"Change";o[u]&&void 0!==i[e]&&i[e]!==n[e]&&o[u](s({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(s({type:o},r))}var G=w((function(e,t){L(e(),t)}),200),J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,Q="useId"in o.default?function(e){var n=e.id,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+o.default.useId();return n||(n=a),t.useRef({labelId:i||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+k():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function Z(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function ee(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function te(e){var n=t.useRef(e);return n.current=e,n}function ne(e,n,i,o){var r=t.useRef(),u=t.useRef(),l=t.useCallback((function(t,n){u.current=n,t=P(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),d=a[0],c=a[1],p=te(n),f=t.useCallback((function(e){return c(s({props:p.current},e))}),[p]),g=u.current;return t.useEffect((function(){var e=r.current&&!o(r.current,d);g&&e&&Y(g,P(r.current,g.props),d),r.current=d}),[d,n,g,o]),[d,f]}function ie(e,t,n,i){var o=ne(e,t,n,i),r=o[0],u=o[1];return[P(r,t),u]}var oe={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:b,environment:"undefined"==typeof window?void 0:window};function re(e,t,n){void 0===n&&(n=X);var i=e["default"+ee(t)];return void 0!==i?i:n[t]}function ue(e,t,n){void 0===n&&(n=X);var i=e[t];if(void 0!==i)return i;var o=e["initial"+ee(t)];return void 0!==o?o:re(e,t,n)}function se(e){var t=ue(e,"selectedItem"),n=ue(e,"isOpen"),i=ue(e,"highlightedIndex"),o=ue(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function le(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&s===o?o:void 0!==r?r:u?i.indexOf(u):0===n?-1:n<0?i.length-1:0}function ae(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(i){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!V(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||V(t.target,n.map((function(e){return e.current})),i,!1)||o()};return i.addEventListener("mousedown",t),i.addEventListener("mouseup",u),i.addEventListener("touchstart",s),i.addEventListener("touchmove",l),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",a)}}}),[e,i]),r}var de=function(){return y};function ce(e,n,i){var o=i.isInitialMount,r=i.highlightedIndex,l=i.items,a=i.environment,d=u(i,z);t.useEffect((function(){!o&&null!=a&&a.document&&G((function(){return e(s({highlightedIndex:r,highlightedItem:l[r],resultCount:l.length},d))}),a.document)}),n)}function pe(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return J((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var fe=y;function ge(e,t,n){var i;return void 0===n&&(n=!0),s({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&s({selectedItem:e.items[t],isOpen:re(e,"isOpen"),highlightedIndex:re(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function he(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItemChange===t.selectedItemChange}var me={environment:r.default.shape({addEventListener:r.default.func.isRequired,removeEventListener:r.default.func.isRequired,document:r.default.shape({createElement:r.default.func.isRequired,getElementById:r.default.func.isRequired,activeElement:r.default.any.isRequired,body:r.default.any.isRequired}).isRequired,Node:r.default.func.isRequired}),itemToString:r.default.func,stateReducer:r.default.func},Ie=s({},me,{getA11yStatusMessage:r.default.func,highlightedIndex:r.default.number,defaultHighlightedIndex:r.default.number,initialHighlightedIndex:r.default.number,isOpen:r.default.bool,defaultIsOpen:r.default.bool,initialIsOpen:r.default.bool,selectedItem:r.default.any,initialSelectedItem:r.default.any,defaultSelectedItem:r.default.any,id:r.default.string,labelId:r.default.string,menuId:r.default.string,getItemId:r.default.func,toggleButtonId:r.default.string,onSelectedItemChange:r.default.func,onHighlightedIndexChange:r.default.func,onStateChange:r.default.func,onIsOpenChange:r.default.func,scrollIntoView:r.default.func});function ve(e,t,n){var i,o=t.type,r=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:le(r,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:re(r,"highlightedIndex"),isOpen:re(r,"isOpen"),selectedItem:re(r,"selectedItem"),inputValue:re(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,i)}var ye=function(){return ye=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ye.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,ye(ye({},Ie),{items:r.default.array.isRequired,isItemDisabled:r.default.func,getA11ySelectionMessage:r.default.func});var be=ye(ye({},oe),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""},isItemDisabled:function(){return!1}}),xe=y,we=1,Se=2,Ce=3,ke=4,De=5,Oe=6,Me=7,Ee=8,Pe=9,Re=10,Ke=11,Te=14,He=19,Ve=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:we,ToggleButtonKeyDownArrowUp:Se,ToggleButtonKeyDownCharacter:Ce,ToggleButtonKeyDownEscape:ke,ToggleButtonKeyDownHome:De,ToggleButtonKeyDownEnd:Oe,ToggleButtonKeyDownEnter:Me,ToggleButtonKeyDownSpaceButton:Ee,ToggleButtonKeyDownPageUp:Pe,ToggleButtonKeyDownPageDown:Re,ToggleButtonBlur:Ke,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Te,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:He,FunctionSetInputValue:20,FunctionReset:21});function Ae(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Te:i={isOpen:re(r,"isOpen"),highlightedIndex:re(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Ce:var l=t.key,a=""+e.inputValue+l,d=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled});i={inputValue:a,highlightedIndex:d,isOpen:!0};break;case we:i={highlightedIndex:e.isOpen?T(e.highlightedIndex,1,r.items,r.isItemDisabled):u&&null==e.selectedItem?-1:le(r,e,1),isOpen:!0};break;case Se:if(e.isOpen&&u)i=ge(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?T(e.highlightedIndex,-1,r.items,r.isItemDisabled):le(r,e,-1),isOpen:!0};break;case Me:case Ee:i=ge(r,e.highlightedIndex,!1);break;case De:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case Oe:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Pe:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Re:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case ke:i={isOpen:!1,highlightedIndex:-1};break;case Ke:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case He:i={selectedItem:t.selectedItem};break;default:return ve(e,t,Ve)}return s({},e,i)}var Be=["onMouseLeave","refKey","ref"],Le=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Fe=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Ne(e){void 0===e&&(e={}),xe();var n=s({},be,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=ie(Ae,n,se,he),p=c[0],f=c[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),k=Q(n),D=t.useRef(),O=t.useRef(!0),M=te({state:p,props:n}),E=t.useCallback((function(e){return b.current[k.getItemId(e)]}),[k]);ce(d,[g,h,I,i],s({isInitialMount:O.current,previousResultCount:D.current,items:i,environment:r,itemToString:l},p)),ce(a,[m],s({isInitialMount:O.current,previousResultCount:D.current,items:i,environment:r,itemToString:l},p));var P=pe({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:b,scrollIntoView:o,getItemNodeFromIndex:E});t.useEffect((function(){return x.current=w((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),fe({isInitialMount:O.current,props:n,state:p}),t.useEffect((function(){O.current||(D.current=i.length)})),t.useEffect((function(){ue(n,"isOpen")&&v.current&&v.current.focus()}),[]);var R=ae(g,[y,v],r,(function(){f({type:Ke})})),T=de();t.useEffect((function(){return O.current=!1,function(){O.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:we,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Se,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:De})},End:function(e){e.preventDefault(),f({type:Oe})},Escape:function(){M.current.state.isOpen&&f({type:ke})},Enter:function(e){e.preventDefault(),f({type:M.current.state.isOpen?Me:0})},PageUp:function(e){M.current.state.isOpen&&(e.preventDefault(),f({type:Pe}))},PageDown:function(e){M.current.state.isOpen&&(e.preventDefault(),f({type:Re}))}," ":function(e){e.preventDefault();var t=M.current.state;t.isOpen?t.inputValue?f({type:Ce,key:" "}):f({type:Ee}):f({type:0})}}}),[f,M]),V=t.useCallback((function(){f({type:15})}),[f]),A=t.useCallback((function(){f({type:17})}),[f]),B=t.useCallback((function(){f({type:16})}),[f]),L=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:He,selectedItem:e})}),[f]),N=t.useCallback((function(){f({type:21})}),[f]),_=t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),j=t.useCallback((function(e){return s({id:k.labelId,htmlFor:k.toggleButtonId},e)}),[k]),U=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,Be),c=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==c&&c,l,y),s(((n={})[l]=C(a,(function(e){y.current=e})),n.id=k.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+k.labelId,n.onMouseLeave=S(o,(function(){f({type:12})})),n),d)}),[f,T,k]),$=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,r=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,c=i.ref,p=u(i,Le),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=M.current.state,I=s(((n={})[d]=C(c,(function(e){v.current=e})),n["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?k.getItemId(m.highlightedIndex):"",n["aria-controls"]=k.menuId,n["aria-expanded"]=M.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=p&&p["aria-label"]?void 0:""+k.labelId,n.id=k.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=S(o,(function(){m.isOpen&&!R.current.isMouseDown&&f({type:Ke})})),n),p);return p.disabled||(I.onClick=S(r,(function(){f({type:0})})),I.onKeyDown=S(l,(function(e){var t=K(e);t&&H[t]?H[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Ce,key:t})}))),T("getToggleButtonProps",h,d,v),I}),[M,k,T,f,R,H]),W=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var d=n.refKey,c=void 0===d?"ref":d,p=n.disabled,g=n.ref,h=u(n,Fe);void 0!==p&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=M.current,I=m.state,v=m.props,y=Z(i,o,v.items,"Pass either item or index to getItemProps!"),x=y[0],w=y[1],D=v.isItemDisabled(x,w),O=s(((t={})[c]=C(g,(function(e){e&&(b.current[k.getItemId(w)]=e)})),t["aria-disabled"]=D,t["aria-selected"]=""+(x===I.selectedItem),t.id=k.getItemId(w),t.role="option",t),h);return D||(O.onClick=S(l,(function(){f({type:Te,index:w})}))),O.onMouseMove=S(r,(function(){w!==I.highlightedIndex&&(P.current=!1,f({type:13,index:w,disabled:D}))})),O.onMouseDown=S(a,(function(e){return e.preventDefault()})),O}),[M,k,P,f]);return{getToggleButtonProps:$,getLabelProps:j,getMenuProps:U,getItemProps:W,toggleMenu:V,openMenu:B,closeMenu:A,setHighlightedIndex:L,selectItem:F,reset:N,setInputValue:_,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}Ne.stateChangeTypes=Ve;var _e=0,je=1,Ue=2,$e=3,We=4,qe=5,ze=6,Xe=7,Ye=8,Ge=9,Je=10,Qe=13,Ze=19,et=22,tt=Object.freeze({__proto__:null,InputKeyDownArrowDown:_e,InputKeyDownArrowUp:je,InputKeyDownEscape:Ue,InputKeyDownHome:$e,InputKeyDownEnd:We,InputKeyDownPageUp:qe,InputKeyDownPageDown:ze,InputKeyDownEnter:Xe,InputChange:Ye,InputBlur:Ge,InputClick:Je,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Qe,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Ze,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:et});function nt(e){var t=se(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),s({},t,{inputValue:i})}s({},Ie,{items:r.default.array.isRequired,isItemDisabled:r.default.func,selectedItemChanged:r.default.func,getA11ySelectionMessage:r.default.func,inputValue:r.default.string,defaultInputValue:r.default.string,initialInputValue:r.default.string,inputId:r.default.string,onInputValueChange:r.default.func});var it=y,ot=s({},oe,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:D,isItemDisabled:function(){return!1}});function rt(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Qe:i={isOpen:re(r,"isOpen"),highlightedIndex:re(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case _e:i=e.isOpen?{highlightedIndex:T(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:le(r,e,1),isOpen:r.items.length>=0};break;case je:i=e.isOpen?u?ge(r,e.highlightedIndex):{highlightedIndex:T(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:le(r,e,-1),isOpen:r.items.length>=0};break;case Xe:i=ge(r,e.highlightedIndex);break;case Ue:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case qe:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case ze:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case $e:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled)};break;case We:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Ge:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Ye:i={isOpen:!0,highlightedIndex:re(r,"highlightedIndex"),inputValue:t.inputValue};break;case Je:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(r,e,0)};break;case Ze:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case et:i={inputValue:t.inputValue};break;default:return ve(e,t,tt)}return s({},e,i)}var ut=["onMouseLeave","refKey","ref"],st=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],lt=["onClick","onPress","refKey","ref"],at=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function dt(e){void 0===e&&(e={}),it();var n=s({},ot,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,d=n.itemToString,c=function(e,n,i,o){var r=t.useRef(),u=ne(e,n,i,o),s=u[0],l=u[1];return t.useEffect((function(){R(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&l({type:et,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[P(s,n),l]}(rt,n,nt,he),p=c[0],f=c[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef({}),b=t.useRef(null),x=t.useRef(null),w=t.useRef(!0),k=Q(n),D=t.useRef(),O=te({state:p,props:n}),M=t.useCallback((function(e){return y.current[k.getItemId(e)]}),[k]);ce(l,[g,h,I,i],s({isInitialMount:w.current,previousResultCount:D.current,items:i,environment:r,itemToString:d},p)),ce(a,[m],s({isInitialMount:w.current,previousResultCount:D.current,items:i,environment:r,itemToString:d},p));var E=pe({menuElement:v.current,highlightedIndex:h,isOpen:g,itemRefs:y,scrollIntoView:o,getItemNodeFromIndex:M});fe({isInitialMount:w.current,props:n,state:p}),t.useEffect((function(){ue(n,"isOpen")&&b.current&&b.current.focus()}),[]),t.useEffect((function(){w.current||(D.current=i.length)}));var T=ae(g,[b,v,x],r,(function(){f({type:Ge,selectItem:!1})})),H=de();t.useEffect((function(){return w.current=!1,function(){w.current=!0}}),[]),t.useEffect((function(){g||(y.current={})}),[g]),t.useEffect((function(){var e;g&&null!=r&&r.document&&null!=b&&null!=(e=b.current)&&e.focus&&r.document.activeElement!==b.current&&b.current.focus()}),[g,r]);var V=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:_e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:je,altKey:e.altKey})},Home:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:$e}))},End:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:We}))},Escape:function(e){var t=O.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:Ue}))},Enter:function(e){O.current.state.isOpen&&229!==e.which&&(e.preventDefault(),f({type:Xe}))},PageUp:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:qe}))},PageDown:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:ze}))}}}),[f,O]),A=t.useCallback((function(e){return s({id:k.labelId,htmlFor:k.inputId},e)}),[k]),B=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,ut),c=(void 0===t?{}:t).suppressRefError;return H("getMenuProps",void 0!==c&&c,l,v),s(((n={})[l]=C(a,(function(e){v.current=e})),n.id=k.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+k.labelId,n.onMouseLeave=S(o,(function(){f({type:11})})),n),d)}),[f,H,k]),L=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,r=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,c=i.onMouseMove,p=i.onMouseDown,g=i.onClick;i.onPress;var h=i.disabled,m=u(i,st);void 0!==h&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var I=O.current,v=I.props,b=I.state,x=Z(o,r,v.items,"Pass either item or index to getItemProps!"),w=x[0],D=x[1],M=v.isItemDisabled(w,D),P=g;return s(((t={})[a]=C(d,(function(e){e&&(y.current[k.getItemId(D)]=e)})),t["aria-disabled"]=M,t["aria-selected"]=""+(D===b.highlightedIndex),t.id=k.getItemId(D),t.role="option",t),!M&&((n={}).onClick=S(P,(function(){f({type:Qe,index:D})})),n),{onMouseMove:S(c,(function(){D!==b.highlightedIndex&&(E.current=!1,f({type:12,index:D,disabled:M}))})),onMouseDown:S(p,(function(e){return e.preventDefault()}))},m)}),[f,O,E,k]),F=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,r=void 0===o?"ref":o,l=n.ref,a=u(n,lt),d=O.current.state;return s(((t={})[r]=C(l,(function(e){x.current=e})),t["aria-controls"]=k.menuId,t["aria-expanded"]=d.isOpen,t.id=k.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:S(i,(function(){f({type:14})}))}),a)}),[f,O,k]),N=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,l=i.onChange,a=i.onInput,d=i.onBlur;i.onChangeText;var c=i.onClick,p=i.refKey,g=void 0===p?"ref":p,h=i.ref,m=u(i,at),I=(void 0===t?{}:t).suppressRefError;H("getInputProps",void 0!==I&&I,g,b);var v,y=O.current.state,x={};m.disabled||((v={}).onInput=S(l,a,(function(e){f({type:Ye,inputValue:e.target.value})})),v.onKeyDown=S(o,(function(e){var t=K(e);t&&V[t]&&V[t](e)})),v.onBlur=S(d,(function(e){if(null!=r&&r.document&&y.isOpen&&!T.current.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;f({type:Ge,selectItem:!t})}})),v.onClick=S(c,(function(){f({type:Je})})),x=v);return s(((n={})[g]=C(h,(function(e){b.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?k.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=k.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:k.labelId,n.autoComplete="off",n.id=k.inputId,n.role="combobox",n.value=y.inputValue,n),x,m)}),[H,O,k,V,f,T,r]),_=t.useCallback((function(){f({type:15})}),[f]),j=t.useCallback((function(){f({type:17})}),[f]),U=t.useCallback((function(){f({type:16})}),[f]),$=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),W=t.useCallback((function(e){f({type:Ze,selectedItem:e})}),[f]);return{getItemProps:L,getLabelProps:A,getMenuProps:B,getInputProps:N,getToggleButtonProps:F,toggleMenu:_,openMenu:U,closeMenu:j,setHighlightedIndex:$,setInputValue:t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),selectItem:W,reset:t.useCallback((function(){f({type:21})}),[f]),highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}dt.stateChangeTypes=tt;var ct={activeIndex:-1,selectedItems:[]};function pt(e,t){return ue(e,t,ct)}function ft(e,t){return re(e,t,ct)}function gt(e){return{activeIndex:pt(e,"activeIndex"),selectedItems:pt(e,"selectedItems")}}function ht(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function mt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}s({},me,{selectedItems:r.default.array,initialSelectedItems:r.default.array,defaultSelectedItems:r.default.array,getA11yRemovalMessage:r.default.func,activeIndex:r.default.number,initialActiveIndex:r.default.number,defaultActiveIndex:r.default.number,onActiveIndexChange:r.default.func,onSelectedItemsChange:r.default.func,keyNavigationNext:r.default.string,keyNavigationPrevious:r.default.string});var It={itemToString:oe.itemToString,stateReducer:oe.stateReducer,environment:oe.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},vt=y,yt=0,bt=1,xt=2,wt=3,St=4,Ct=5,kt=6,Dt=7,Ot=8,Mt=9,Et=10,Pt=11,Rt=12,Kt=Object.freeze({__proto__:null,SelectedItemClick:yt,SelectedItemKeyDownDelete:bt,SelectedItemKeyDownBackspace:xt,SelectedItemKeyDownNavigationNext:wt,SelectedItemKeyDownNavigationPrevious:St,DropdownKeyDownNavigationPrevious:Ct,DropdownKeyDownBackspace:kt,DropdownClick:Dt,FunctionAddSelectedItem:Ot,FunctionRemoveSelectedItem:Mt,FunctionSetSelectedItems:Et,FunctionSetActiveIndex:Pt,FunctionReset:Rt});function Tt(e,t){var n,i=t.type,o=t.index,r=t.props,u=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case yt:n={activeIndex:o};break;case St:n={activeIndex:l-1<0?0:l-1};break;case wt:n={activeIndex:l+1>=a.length?-1:l+1};break;case xt:case bt:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=s({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case Ct:n={activeIndex:a.length-1};break;case kt:n={selectedItems:a.slice(0,a.length-1)};break;case Ot:n={selectedItems:[].concat(a,[u])};break;case Dt:n={activeIndex:-1};break;case Mt:var c=l,p=a.indexOf(u);if(p<0)break;1===a.length?c=-1:p===a.length-1&&(c=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:c};break;case Et:n={selectedItems:t.selectedItems};break;case Pt:n={activeIndex:t.activeIndex};break;case Rt:n={activeIndex:ft(r,"activeIndex"),selectedItems:ft(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Ht=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Vt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function At(e){void 0===e&&(e={}),vt();var n=s({},It,e),i=n.getA11yRemovalMessage,o=n.itemToString,r=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=ie(Tt,n,gt,mt),c=d[0],p=d[1],f=c.activeIndex,g=c.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=te({state:c,props:n});t.useEffect((function(){if(!h.current&&null!=r&&r.document){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));L(i({itemToString:o,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),r.document)}I.current=g}}),[g.length]),t.useEffect((function(){h.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),fe({isInitialMount:h.current,props:n,state:c});var b=de();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:St})},e[l]=function(){p({type:wt})},e.Delete=function(){p({type:bt})},e.Backspace=function(){p({type:xt})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){ht(e)&&p({type:Ct})},e.Backspace=function(e){ht(e)&&p({type:kt})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,r=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,c=n.index,f=u(n,Ht),g=y.current.state,h=Z(d,c,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.activeIndex;return s(((t={})[o]=C(r,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=S(l,(function(){p({type:yt,index:h})})),t.onKeyDown=S(a,(function(e){var t=K(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,r=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,c=i.preventKeyAction,f=void 0!==c&&c,g=u(i,Vt),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,r,m),s(((n={})[r]=C(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:S(a,(function(e){var t=K(e);t&&w[t]&&w[t](e)})),onClick:S(d,(function(){p({type:Dt})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:Ot,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Mt,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Et,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Pt,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Rt})}),[p]),selectedItems:g,activeIndex:f}}At.stateChangeTypes=Kt,e.default=q,e.resetIdCounter=function(){"useId"in o.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):I=0},e.useCombobox=dt,e.useMultipleSelection=At,e.useSelect=Ne,Object.defineProperty(e,"__esModule",{value:!0})}));
*/!function(){if(d)return c;d=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case i:case r:case o:case p:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case h:case g:case u:return e;default:return d}}case n:return d}}}e=Symbol.for("react.module.reference"),c.ContextConsumer=s,c.ContextProvider=u,c.Element=t,c.ForwardRef=a,c.Fragment=i,c.Lazy=h,c.Memo=g,c.Portal=n,c.Profiler=r,c.StrictMode=o,c.Suspense=p,c.SuspenseList=f,c.isAsyncMode=function(){return!1},c.isConcurrentMode=function(){return!1},c.isContextConsumer=function(e){return I(e)===s},c.isContextProvider=function(e){return I(e)===u},c.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},c.isForwardRef=function(e){return I(e)===a},c.isFragment=function(e){return I(e)===i},c.isLazy=function(e){return I(e)===h},c.isMemo=function(e){return I(e)===g},c.isPortal=function(e){return I(e)===n},c.isProfiler=function(e){return I(e)===r},c.isStrictMode=function(e){return I(e)===o},c.isSuspense=function(e){return I(e)===p},c.isSuspenseList=function(e){return I(e)===f},c.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===p||t===f||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===g||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},c.typeOf=I}();const p=e=>"object"==typeof e&&null!=e&&1===e.nodeType,f=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,g=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return f(n.overflowY,t)||f(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},h=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,m=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var I=0;function v(e){return"function"==typeof e?e:y}function y(){}function b(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:d}=t,c="function"==typeof a?a:e=>e!==a;if(!p(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,I=[];let v=e;for(;p(v)&&c(v);){if(v=m(v),v===f){I.push(v);break}null!=v&&v===document.body&&g(v)&&!g(document.documentElement)||null!=v&&g(v,d)&&I.push(v)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?k:"end"===s?O:k+S/2,P="center"===l?M+C/2:"end"===l?D:M;const R=[];for(let e=0;e<I.length;e++){const t=I[e],{height:n,width:i,top:o,right:r,bottom:a,left:d}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=b&&D<=y&&k>=o&&O<=a&&M>=d&&D<=r)return R;const c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),g=parseInt(c.borderTopWidth,10),m=parseInt(c.borderRightWidth,10),v=parseInt(c.borderBottomWidth,10);let K=0,T=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,V="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-v:0,A="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)K="start"===s?E:"end"===s?E-b:"nearest"===s?h(w,w+b,b,g,v,w+E,w+E+S,S):E-b/2,T="start"===l?P:"center"===l?P-y/2:"end"===l?P-y:h(x,x+y,y,p,m,x+P,x+P+C,C),K=Math.max(0,K+w),T=Math.max(0,T+x);else{K="start"===s?E-o-g:"end"===s?E-a+v+V:"nearest"===s?h(o,a,n,g,v+V,E,E+S,S):E-(o+n/2)+V/2,T="start"===l?P-d-p:"center"===l?P-(d+i/2)+H/2:"end"===l?P-r+m+H:h(d,r,i,p,m+H,P,P+C,C);const{scrollLeft:e,scrollTop:u}=t;K=Math.max(0,Math.min(u+K/B,t.scrollHeight-n/B+V)),T=Math.max(0,Math.min(e+T/A,t.scrollWidth-i/A+H)),E+=u-K,P+=e-T}R.push({el:t,top:K,left:T})}return R})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function x(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function w(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function C(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function k(){return String(I++)}function D(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function O(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var M=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function E(e){void 0===e&&(e={});var t={};return M.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function P(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=R(t,i)?t[i]:e[i],n}),{})}function R(e,t){return void 0!==e[t]}function K(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function T(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=H(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function H(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?H(t?r-1:0,t,n,i):-1}function V(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(x(t,e,n)||i&&x(t,n.document.activeElement,n))}))}var A=w((function(e){B(e).textContent=""}),500);function B(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function L(e,t){e&&t&&(B(t).textContent=e,A(t))}var F=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),N=["refKey","ref"],_=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],j=["onKeyDown","onBlur","onChange","onInput","onChangeText"],U=["refKey","ref"],$=["onMouseMove","onMouseDown","onClick","onPress","index","item"],W=function(){var e=function(e){var n,i;function o(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+k(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=E(t),n.internalSetState(s({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=E(t),n.internalSetState(s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,r={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,s({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var d={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(r[e]=a[e]),"type"!==e&&(a[e],R(n.props,e)||(d[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,s({},n.getStateAndHelpers(),a)),d}),(function(){v(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,N),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return s(((i={})[l]=C(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=T(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(s({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=s({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=s({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=H(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,r=t.onKeyUp,l=t.onBlur,a=u(t,_),d=n.getState().isOpen,c={onClick:S(i,n.buttonHandleClick),onKeyDown:S(o,n.buttonHandleKeyDown),onKeyUp:S(r,n.buttonHandleKeyUp),onBlur:S(l,n.buttonHandleBlur)};return s({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:c,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=K(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(l(n),e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return s({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,r=t.onChange,l=t.onInput;t.onChangeText;var a=u(t,j),d={};var c,p=n.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((c={}).onInput=S(r,l,n.inputHandleChange),c.onKeyDown=S(i,n.inputHandleKeyDown),c.onBlur=S(o,n.inputHandleBlur),d=c);return s({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?n.getItemId(h):void 0,"aria-controls":g?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},d,a)},n.inputHandleKeyDown=function(e){var t=K(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(l(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,U),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,s(((i={})[l]=C(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,r=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=u(i,$);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,g=((t={onMouseMove:S(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:S(r,(function(e){e.preventDefault()}))}).onClick=S(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return s({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},h,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var i=t.selectedItem;return s({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var i=t.isOpen;return s({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),v(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=w((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,L(r,n.props.environment.document)}}),200);var i=n.props,o=i.defaultHighlightedIndex,r=i.initialHighlightedIndex,a=void 0===r?o:r,d=i.defaultIsOpen,c=i.initialIsOpen,p=void 0===c?d:c,f=i.initialInputValue,g=void 0===f?"":f,h=i.initialSelectedItem,m=void 0===h?null:h,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}i=e,(n=o).prototype=Object.create(i.prototype),n.prototype.constructor=n,a(n,i);var r=o.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},r.getState=function(e){return void 0===e&&(e=this.state),P(e,this.props)},r.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},r.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},r.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},r.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=T(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},r.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},r.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!V(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=V(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}}else this.cleanup=function(){e.internalClearTimeouts()}},r.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},r.componentDidUpdate=function(e,t){R(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var e=O(this.props.children,y);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=O(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type||"string"==typeof e.nodeName}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props||e.attributes}(n))):void 0:null},o}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:D,itemToString:function(e){return null==e?"":String(e)},onStateChange:y,onInputValueChange:y,onUserAction:y,onChange:y,onSelect:y,onOuterClick:y,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:b},e.stateChangeTypes=F,e}(),q=W,z=["isInitialMount","highlightedIndex","items","environment"],X={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Y(e,t,n){var i=e.props,o=e.type,r={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,r=t.type,u="on"+ee(e)+"Change";o[u]&&void 0!==i[e]&&i[e]!==n[e]&&o[u](s({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(s({type:o},r))}var G=w((function(e,t){L(e(),t)}),200),J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,Q="useId"in o.default?function(e){var n=e.id,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+o.default.useId();return n||(n=a),t.useRef({labelId:i||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+k():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current};function Z(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function ee(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function te(e){var n=t.useRef(e);return n.current=e,n}function ne(e,n,i,o){var r=t.useRef(),u=t.useRef(),l=t.useCallback((function(t,n){u.current=n,t=P(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),d=a[0],c=a[1],p=te(n),f=t.useCallback((function(e){return c(s({props:p.current},e))}),[p]),g=u.current;return t.useEffect((function(){var e=r.current&&!o(r.current,d);g&&e&&Y(g,P(r.current,g.props),d),r.current=d}),[d,n,g,o]),[d,f]}function ie(e,t,n,i){var o=ne(e,t,n,i),r=o[0],u=o[1];return[P(r,t),u]}var oe={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:b,environment:"undefined"==typeof window?void 0:window};function re(e,t,n){void 0===n&&(n=X);var i=e["default"+ee(t)];return void 0!==i?i:n[t]}function ue(e,t,n){void 0===n&&(n=X);var i=e[t];if(void 0!==i)return i;var o=e["initial"+ee(t)];return void 0!==o?o:re(e,t,n)}function se(e){var t=ue(e,"selectedItem"),n=ue(e,"isOpen"),i=ue(e,"highlightedIndex"),o=ue(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function le(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&s===o?o:void 0!==r?r:u?i.indexOf(u):0===n?-1:n<0?i.length-1:0}function ae(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(i){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!V(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||V(t.target,n.map((function(e){return e.current})),i,!1)||o()};return i.addEventListener("mousedown",t),i.addEventListener("mouseup",u),i.addEventListener("touchstart",s),i.addEventListener("touchmove",l),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",a)}}}),[e,i]),r}var de=function(){return y};function ce(e,n,i){var o=i.isInitialMount,r=i.highlightedIndex,l=i.items,a=i.environment,d=u(i,z);t.useEffect((function(){!o&&null!=a&&a.document&&G((function(){return e(s({highlightedIndex:r,highlightedItem:l[r],resultCount:l.length},d))}),a.document)}),n)}function pe(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return J((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var fe=y;function ge(e,t,n){var i;return void 0===n&&(n=!0),s({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&s({selectedItem:e.items[t],isOpen:re(e,"isOpen"),highlightedIndex:re(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function he(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}var me={environment:r.default.shape({addEventListener:r.default.func.isRequired,removeEventListener:r.default.func.isRequired,document:r.default.shape({createElement:r.default.func.isRequired,getElementById:r.default.func.isRequired,activeElement:r.default.any.isRequired,body:r.default.any.isRequired}).isRequired,Node:r.default.func.isRequired}),itemToString:r.default.func,stateReducer:r.default.func},Ie=s({},me,{getA11yStatusMessage:r.default.func,highlightedIndex:r.default.number,defaultHighlightedIndex:r.default.number,initialHighlightedIndex:r.default.number,isOpen:r.default.bool,defaultIsOpen:r.default.bool,initialIsOpen:r.default.bool,selectedItem:r.default.any,initialSelectedItem:r.default.any,defaultSelectedItem:r.default.any,id:r.default.string,labelId:r.default.string,menuId:r.default.string,getItemId:r.default.func,toggleButtonId:r.default.string,onSelectedItemChange:r.default.func,onHighlightedIndexChange:r.default.func,onStateChange:r.default.func,onIsOpenChange:r.default.func,scrollIntoView:r.default.func});function ve(e,t,n){var i,o=t.type,r=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:le(r,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:re(r,"highlightedIndex"),isOpen:re(r,"isOpen"),selectedItem:re(r,"selectedItem"),inputValue:re(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,i)}var ye=function(){return ye=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ye.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,ye(ye({},Ie),{items:r.default.array.isRequired,isItemDisabled:r.default.func,getA11ySelectionMessage:r.default.func});var be=ye(ye({},oe),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""},isItemDisabled:function(){return!1}}),xe=y,we=1,Se=2,Ce=3,ke=4,De=5,Oe=6,Me=7,Ee=8,Pe=9,Re=10,Ke=11,Te=14,He=19,Ve=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:we,ToggleButtonKeyDownArrowUp:Se,ToggleButtonKeyDownCharacter:Ce,ToggleButtonKeyDownEscape:ke,ToggleButtonKeyDownHome:De,ToggleButtonKeyDownEnd:Oe,ToggleButtonKeyDownEnter:Me,ToggleButtonKeyDownSpaceButton:Ee,ToggleButtonKeyDownPageUp:Pe,ToggleButtonKeyDownPageDown:Re,ToggleButtonBlur:Ke,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Te,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:He,FunctionSetInputValue:20,FunctionReset:21});function Ae(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Te:i={isOpen:re(r,"isOpen"),highlightedIndex:re(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Ce:var l=t.key,a=""+e.inputValue+l,d=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled});i={inputValue:a,highlightedIndex:d,isOpen:!0};break;case we:i={highlightedIndex:e.isOpen?T(e.highlightedIndex,1,r.items,r.isItemDisabled):u&&null==e.selectedItem?-1:le(r,e,1),isOpen:!0};break;case Se:if(e.isOpen&&u)i=ge(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?T(e.highlightedIndex,-1,r.items,r.isItemDisabled):le(r,e,-1),isOpen:!0};break;case Me:case Ee:i=ge(r,e.highlightedIndex,!1);break;case De:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case Oe:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Pe:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Re:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case ke:i={isOpen:!1,highlightedIndex:-1};break;case Ke:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case He:i={selectedItem:t.selectedItem};break;default:return ve(e,t,Ve)}return s({},e,i)}var Be=["onMouseLeave","refKey","ref"],Le=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Fe=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Ne(e){void 0===e&&(e={}),xe();var n=s({},be,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=ie(Ae,n,se,he),p=c[0],f=c[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),k=Q(n),D=t.useRef(),O=t.useRef(!0),M=te({state:p,props:n}),E=t.useCallback((function(e){return b.current[k.getItemId(e)]}),[k]);ce(d,[g,h,I,i],s({isInitialMount:O.current,previousResultCount:D.current,items:i,environment:r,itemToString:l},p)),ce(a,[m],s({isInitialMount:O.current,previousResultCount:D.current,items:i,environment:r,itemToString:l},p));var P=pe({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:b,scrollIntoView:o,getItemNodeFromIndex:E});t.useEffect((function(){return x.current=w((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),fe({isInitialMount:O.current,props:n,state:p}),t.useEffect((function(){O.current||(D.current=i.length)})),t.useEffect((function(){ue(n,"isOpen")&&v.current&&v.current.focus()}),[]);var R=ae(g,[y,v],r,(function(){f({type:Ke})})),T=de();t.useEffect((function(){return O.current=!1,function(){O.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:we,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Se,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:De})},End:function(e){e.preventDefault(),f({type:Oe})},Escape:function(){M.current.state.isOpen&&f({type:ke})},Enter:function(e){e.preventDefault(),f({type:M.current.state.isOpen?Me:0})},PageUp:function(e){M.current.state.isOpen&&(e.preventDefault(),f({type:Pe}))},PageDown:function(e){M.current.state.isOpen&&(e.preventDefault(),f({type:Re}))}," ":function(e){e.preventDefault();var t=M.current.state;t.isOpen?t.inputValue?f({type:Ce,key:" "}):f({type:Ee}):f({type:0})}}}),[f,M]),V=t.useCallback((function(){f({type:15})}),[f]),A=t.useCallback((function(){f({type:17})}),[f]),B=t.useCallback((function(){f({type:16})}),[f]),L=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:He,selectedItem:e})}),[f]),N=t.useCallback((function(){f({type:21})}),[f]),_=t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),j=t.useCallback((function(e){return s({id:k.labelId,htmlFor:k.toggleButtonId},e)}),[k]),U=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,Be),c=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==c&&c,l,y),s(((n={})[l]=C(a,(function(e){y.current=e})),n.id=k.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+k.labelId,n.onMouseLeave=S(o,(function(){f({type:12})})),n),d)}),[f,T,k]),$=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,r=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,c=i.ref,p=u(i,Le),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=M.current.state,I=s(((n={})[d]=C(c,(function(e){v.current=e})),n["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?k.getItemId(m.highlightedIndex):"",n["aria-controls"]=k.menuId,n["aria-expanded"]=M.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=p&&p["aria-label"]?void 0:""+k.labelId,n.id=k.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=S(o,(function(){m.isOpen&&!R.current.isMouseDown&&f({type:Ke})})),n),p);return p.disabled||(I.onClick=S(r,(function(){f({type:0})})),I.onKeyDown=S(l,(function(e){var t=K(e);t&&H[t]?H[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Ce,key:t})}))),T("getToggleButtonProps",h,d,v),I}),[M,k,T,f,R,H]),W=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var d=n.refKey,c=void 0===d?"ref":d,p=n.disabled,g=n.ref,h=u(n,Fe);void 0!==p&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=M.current,I=m.state,v=m.props,y=Z(i,o,v.items,"Pass either item or index to getItemProps!"),x=y[0],w=y[1],D=v.isItemDisabled(x,w),O=s(((t={})[c]=C(g,(function(e){e&&(b.current[k.getItemId(w)]=e)})),t["aria-disabled"]=D,t["aria-selected"]=""+(x===I.selectedItem),t.id=k.getItemId(w),t.role="option",t),h);return D||(O.onClick=S(l,(function(){f({type:Te,index:w})}))),O.onMouseMove=S(r,(function(){w!==I.highlightedIndex&&(P.current=!1,f({type:13,index:w,disabled:D}))})),O.onMouseDown=S(a,(function(e){return e.preventDefault()})),O}),[M,k,P,f]);return{getToggleButtonProps:$,getLabelProps:j,getMenuProps:U,getItemProps:W,toggleMenu:V,openMenu:B,closeMenu:A,setHighlightedIndex:L,selectItem:F,reset:N,setInputValue:_,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}Ne.stateChangeTypes=Ve;var _e=0,je=1,Ue=2,$e=3,We=4,qe=5,ze=6,Xe=7,Ye=8,Ge=9,Je=10,Qe=13,Ze=19,et=22,tt=Object.freeze({__proto__:null,InputKeyDownArrowDown:_e,InputKeyDownArrowUp:je,InputKeyDownEscape:Ue,InputKeyDownHome:$e,InputKeyDownEnd:We,InputKeyDownPageUp:qe,InputKeyDownPageDown:ze,InputKeyDownEnter:Xe,InputChange:Ye,InputBlur:Ge,InputClick:Je,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Qe,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Ze,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:et});function nt(e){var t=se(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),s({},t,{inputValue:i})}s({},Ie,{items:r.default.array.isRequired,isItemDisabled:r.default.func,selectedItemChanged:r.default.func,getA11ySelectionMessage:r.default.func,inputValue:r.default.string,defaultInputValue:r.default.string,initialInputValue:r.default.string,inputId:r.default.string,onInputValueChange:r.default.func});var it=y,ot=s({},oe,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:D,isItemDisabled:function(){return!1}});function rt(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Qe:i={isOpen:re(r,"isOpen"),highlightedIndex:re(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case _e:i=e.isOpen?{highlightedIndex:T(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:le(r,e,1),isOpen:r.items.length>=0};break;case je:i=e.isOpen?u?ge(r,e.highlightedIndex):{highlightedIndex:T(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:le(r,e,-1),isOpen:r.items.length>=0};break;case Xe:i=ge(r,e.highlightedIndex);break;case Ue:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case qe:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case ze:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case $e:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled)};break;case We:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Ge:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Ye:i={isOpen:!0,highlightedIndex:re(r,"highlightedIndex"),inputValue:t.inputValue};break;case Je:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(r,e,0)};break;case Ze:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case et:i={inputValue:t.inputValue};break;default:return ve(e,t,tt)}return s({},e,i)}var ut=["onMouseLeave","refKey","ref"],st=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],lt=["onClick","onPress","refKey","ref"],at=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function dt(e){void 0===e&&(e={}),it();var n=s({},ot,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,d=n.itemToString,c=function(e,n,i,o){var r=t.useRef(),u=ne(e,n,i,o),s=u[0],l=u[1];return t.useEffect((function(){R(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&l({type:et,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[P(s,n),l]}(rt,n,nt,he),p=c[0],f=c[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef({}),b=t.useRef(null),x=t.useRef(null),w=t.useRef(!0),k=Q(n),D=t.useRef(),O=te({state:p,props:n}),M=t.useCallback((function(e){return y.current[k.getItemId(e)]}),[k]);ce(l,[g,h,I,i],s({isInitialMount:w.current,previousResultCount:D.current,items:i,environment:r,itemToString:d},p)),ce(a,[m],s({isInitialMount:w.current,previousResultCount:D.current,items:i,environment:r,itemToString:d},p));var E=pe({menuElement:v.current,highlightedIndex:h,isOpen:g,itemRefs:y,scrollIntoView:o,getItemNodeFromIndex:M});fe({isInitialMount:w.current,props:n,state:p}),t.useEffect((function(){ue(n,"isOpen")&&b.current&&b.current.focus()}),[]),t.useEffect((function(){w.current||(D.current=i.length)}));var T=ae(g,[b,v,x],r,(function(){f({type:Ge,selectItem:!1})})),H=de();t.useEffect((function(){return w.current=!1,function(){w.current=!0}}),[]),t.useEffect((function(){g||(y.current={})}),[g]),t.useEffect((function(){var e;g&&null!=r&&r.document&&null!=b&&null!=(e=b.current)&&e.focus&&r.document.activeElement!==b.current&&b.current.focus()}),[g,r]);var V=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:_e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:je,altKey:e.altKey})},Home:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:$e}))},End:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:We}))},Escape:function(e){var t=O.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:Ue}))},Enter:function(e){O.current.state.isOpen&&229!==e.which&&(e.preventDefault(),f({type:Xe}))},PageUp:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:qe}))},PageDown:function(e){O.current.state.isOpen&&(e.preventDefault(),f({type:ze}))}}}),[f,O]),A=t.useCallback((function(e){return s({id:k.labelId,htmlFor:k.inputId},e)}),[k]),B=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,ut),c=(void 0===t?{}:t).suppressRefError;return H("getMenuProps",void 0!==c&&c,l,v),s(((n={})[l]=C(a,(function(e){v.current=e})),n.id=k.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+k.labelId,n.onMouseLeave=S(o,(function(){f({type:11})})),n),d)}),[f,H,k]),L=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,r=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,c=i.onMouseMove,p=i.onMouseDown,g=i.onClick;i.onPress;var h=i.disabled,m=u(i,st);void 0!==h&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var I=O.current,v=I.props,b=I.state,x=Z(o,r,v.items,"Pass either item or index to getItemProps!"),w=x[0],D=x[1],M=v.isItemDisabled(w,D),P=g;return s(((t={})[a]=C(d,(function(e){e&&(y.current[k.getItemId(D)]=e)})),t["aria-disabled"]=M,t["aria-selected"]=""+(D===b.highlightedIndex),t.id=k.getItemId(D),t.role="option",t),!M&&((n={}).onClick=S(P,(function(){f({type:Qe,index:D})})),n),{onMouseMove:S(c,(function(){D!==b.highlightedIndex&&(E.current=!1,f({type:12,index:D,disabled:M}))})),onMouseDown:S(p,(function(e){return e.preventDefault()}))},m)}),[f,O,E,k]),F=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,r=void 0===o?"ref":o,l=n.ref,a=u(n,lt),d=O.current.state;return s(((t={})[r]=C(l,(function(e){x.current=e})),t["aria-controls"]=k.menuId,t["aria-expanded"]=d.isOpen,t.id=k.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:S(i,(function(){f({type:14})}))}),a)}),[f,O,k]),N=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,l=i.onChange,a=i.onInput,d=i.onBlur;i.onChangeText;var c=i.onClick,p=i.refKey,g=void 0===p?"ref":p,h=i.ref,m=u(i,at),I=(void 0===t?{}:t).suppressRefError;H("getInputProps",void 0!==I&&I,g,b);var v,y=O.current.state,x={};m.disabled||((v={}).onInput=S(l,a,(function(e){f({type:Ye,inputValue:e.target.value})})),v.onKeyDown=S(o,(function(e){var t=K(e);t&&V[t]&&V[t](e)})),v.onBlur=S(d,(function(e){if(null!=r&&r.document&&y.isOpen&&!T.current.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;f({type:Ge,selectItem:!t})}})),v.onClick=S(c,(function(){f({type:Je})})),x=v);return s(((n={})[g]=C(h,(function(e){b.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?k.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=k.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:k.labelId,n.autoComplete="off",n.id=k.inputId,n.role="combobox",n.value=y.inputValue,n),x,m)}),[H,O,k,V,f,T,r]),_=t.useCallback((function(){f({type:15})}),[f]),j=t.useCallback((function(){f({type:17})}),[f]),U=t.useCallback((function(){f({type:16})}),[f]),$=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),W=t.useCallback((function(e){f({type:Ze,selectedItem:e})}),[f]);return{getItemProps:L,getLabelProps:A,getMenuProps:B,getInputProps:N,getToggleButtonProps:F,toggleMenu:_,openMenu:U,closeMenu:j,setHighlightedIndex:$,setInputValue:t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),selectItem:W,reset:t.useCallback((function(){f({type:21})}),[f]),highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}dt.stateChangeTypes=tt;var ct={activeIndex:-1,selectedItems:[]};function pt(e,t){return ue(e,t,ct)}function ft(e,t){return re(e,t,ct)}function gt(e){return{activeIndex:pt(e,"activeIndex"),selectedItems:pt(e,"selectedItems")}}function ht(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}function mt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}s({},me,{selectedItems:r.default.array,initialSelectedItems:r.default.array,defaultSelectedItems:r.default.array,getA11yRemovalMessage:r.default.func,activeIndex:r.default.number,initialActiveIndex:r.default.number,defaultActiveIndex:r.default.number,onActiveIndexChange:r.default.func,onSelectedItemsChange:r.default.func,keyNavigationNext:r.default.string,keyNavigationPrevious:r.default.string});var It={itemToString:oe.itemToString,stateReducer:oe.stateReducer,environment:oe.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},vt=y,yt=0,bt=1,xt=2,wt=3,St=4,Ct=5,kt=6,Dt=7,Ot=8,Mt=9,Et=10,Pt=11,Rt=12,Kt=Object.freeze({__proto__:null,SelectedItemClick:yt,SelectedItemKeyDownDelete:bt,SelectedItemKeyDownBackspace:xt,SelectedItemKeyDownNavigationNext:wt,SelectedItemKeyDownNavigationPrevious:St,DropdownKeyDownNavigationPrevious:Ct,DropdownKeyDownBackspace:kt,DropdownClick:Dt,FunctionAddSelectedItem:Ot,FunctionRemoveSelectedItem:Mt,FunctionSetSelectedItems:Et,FunctionSetActiveIndex:Pt,FunctionReset:Rt});function Tt(e,t){var n,i=t.type,o=t.index,r=t.props,u=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case yt:n={activeIndex:o};break;case St:n={activeIndex:l-1<0?0:l-1};break;case wt:n={activeIndex:l+1>=a.length?-1:l+1};break;case xt:case bt:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=s({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case Ct:n={activeIndex:a.length-1};break;case kt:n={selectedItems:a.slice(0,a.length-1)};break;case Ot:n={selectedItems:[].concat(a,[u])};break;case Dt:n={activeIndex:-1};break;case Mt:var c=l,p=a.indexOf(u);if(p<0)break;1===a.length?c=-1:p===a.length-1&&(c=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:c};break;case Et:n={selectedItems:t.selectedItems};break;case Pt:n={activeIndex:t.activeIndex};break;case Rt:n={activeIndex:ft(r,"activeIndex"),selectedItems:ft(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Ht=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Vt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function At(e){void 0===e&&(e={}),vt();var n=s({},It,e),i=n.getA11yRemovalMessage,o=n.itemToString,r=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=ie(Tt,n,gt,mt),c=d[0],p=d[1],f=c.activeIndex,g=c.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=te({state:c,props:n});t.useEffect((function(){if(!h.current&&null!=r&&r.document){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));L(i({itemToString:o,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),r.document)}I.current=g}}),[g.length]),t.useEffect((function(){h.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),fe({isInitialMount:h.current,props:n,state:c});var b=de();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:St})},e[l]=function(){p({type:wt})},e.Delete=function(){p({type:bt})},e.Backspace=function(){p({type:xt})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){ht(e)&&p({type:Ct})},e.Backspace=function(e){ht(e)&&p({type:kt})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,r=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,c=n.index,f=u(n,Ht),g=y.current.state,h=Z(d,c,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.activeIndex;return s(((t={})[o]=C(r,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=S(l,(function(){p({type:yt,index:h})})),t.onKeyDown=S(a,(function(e){var t=K(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,r=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,c=i.preventKeyAction,f=void 0!==c&&c,g=u(i,Vt),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,r,m),s(((n={})[r]=C(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:S(a,(function(e){var t=K(e);t&&w[t]&&w[t](e)})),onClick:S(d,(function(){p({type:Dt})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:Ot,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Mt,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Et,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Pt,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Rt})}),[p]),selectedItems:g,activeIndex:f}}At.stateChangeTypes=Kt,e.default=q,e.resetIdCounter=function(){"useId"in o.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):I=0},e.useCombobox=dt,e.useMultipleSelection=At,e.useSelect=Ne,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc