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.1.1 to 8.2.0

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)}var a={exports:{}},l={},c="function"==typeof Symbol&&Symbol.for,d=c?Symbol.for("react.element"):60103,p=c?Symbol.for("react.portal"):60106,f=c?Symbol.for("react.fragment"):60107,g=c?Symbol.for("react.strict_mode"):60108,h=c?Symbol.for("react.profiler"):60114,m=c?Symbol.for("react.provider"):60109,I=c?Symbol.for("react.context"):60110,v=c?Symbol.for("react.async_mode"):60111,y=c?Symbol.for("react.concurrent_mode"):60111,b=c?Symbol.for("react.forward_ref"):60112,x=c?Symbol.for("react.suspense"):60113,w=c?Symbol.for("react.suspense_list"):60120,S=c?Symbol.for("react.memo"):60115,C=c?Symbol.for("react.lazy"):60116,k=c?Symbol.for("react.block"):60121,D=c?Symbol.for("react.fundamental"):60117,O=c?Symbol.for("react.responder"):60118,M=c?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case d:switch(e=e.type){case v:case y:case f:case h:case g:case x:return e;default:switch(e=e&&e.$$typeof){case I:case b:case C:case S:case m:return e;default:return t}}case p:return t}}}function P(e){return E(e)===y}l.AsyncMode=v,l.ConcurrentMode=y,l.ContextConsumer=I,l.ContextProvider=m,l.Element=d,l.ForwardRef=b,l.Fragment=f,l.Lazy=C,l.Memo=S,l.Portal=p,l.Profiler=h,l.StrictMode=g,l.Suspense=x,l.isAsyncMode=function(e){return P(e)||E(e)===v},l.isConcurrentMode=P,l.isContextConsumer=function(e){return E(e)===I},l.isContextProvider=function(e){return E(e)===m},l.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===d},l.isForwardRef=function(e){return E(e)===b},l.isFragment=function(e){return E(e)===f},l.isLazy=function(e){return E(e)===C},l.isMemo=function(e){return E(e)===S},l.isPortal=function(e){return E(e)===p},l.isProfiler=function(e){return E(e)===h},l.isStrictMode=function(e){return E(e)===g},l.isSuspense=function(e){return E(e)===x},l.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===f||e===y||e===h||e===g||e===x||e===w||"object"==typeof e&&null!==e&&(e.$$typeof===C||e.$$typeof===S||e.$$typeof===m||e.$$typeof===I||e.$$typeof===b||e.$$typeof===D||e.$$typeof===O||e.$$typeof===M||e.$$typeof===k)},l.typeOf=E;function R(){}function K(){}K.resetWarningCache=R;a.exports=function(){function e(e,t,n,i,o,r){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==r){var u=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 u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:K,resetWarningCache:R};return n.PropTypes=n,n}();var T=a.exports,H={},V=60103,A=60106,B=60107,L=60108,_=60114,F=60109,$=60110,N=60112,j=60113,U=60120,W=60115,q=60116,z=60121,Y=60122,X=60117,G=60129,J=60131;if("function"==typeof Symbol&&Symbol.for){var Q=Symbol.for;V=Q("react.element"),A=Q("react.portal"),B=Q("react.fragment"),L=Q("react.strict_mode"),_=Q("react.profiler"),F=Q("react.provider"),$=Q("react.context"),N=Q("react.forward_ref"),j=Q("react.suspense"),U=Q("react.suspense_list"),W=Q("react.memo"),q=Q("react.lazy"),z=Q("react.block"),Y=Q("react.server.block"),X=Q("react.fundamental"),G=Q("react.debug_trace_mode"),J=Q("react.legacy_hidden")}function Z(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case V:switch(e=e.type){case B:case _:case L:case j:case U:return e;default:switch(e=e&&e.$$typeof){case $:case N:case q:case W:case F:return e;default:return t}}case A:return t}}}var ee=F,te=V,ne=N,ie=B,oe=q,re=W,ue=A,se=_,ae=L,le=j;H.ContextConsumer=$,H.ContextProvider=ee,H.Element=te,H.ForwardRef=ne,H.Fragment=ie,H.Lazy=oe,H.Memo=re,H.Portal=ue,H.Profiler=se,H.StrictMode=ae,H.Suspense=le,H.isAsyncMode=function(){return!1},H.isConcurrentMode=function(){return!1},H.isContextConsumer=function(e){return Z(e)===$},H.isContextProvider=function(e){return Z(e)===F},H.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===V},H.isForwardRef=function(e){return Z(e)===N},H.isFragment=function(e){return Z(e)===B},H.isLazy=function(e){return Z(e)===q},H.isMemo=function(e){return Z(e)===W},H.isPortal=function(e){return Z(e)===A},H.isProfiler=function(e){return Z(e)===_},H.isStrictMode=function(e){return Z(e)===L},H.isSuspense=function(e){return Z(e)===j},H.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===B||e===_||e===G||e===L||e===j||e===U||e===J||"object"==typeof e&&null!==e&&(e.$$typeof===q||e.$$typeof===W||e.$$typeof===F||e.$$typeof===$||e.$$typeof===N||e.$$typeof===X||e.$$typeof===z||e[0]===Y)},H.typeOf=Z;let ce=e=>"object"==typeof e&&null!=e&&1===e.nodeType,de=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,pe=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return de(n.overflowY,t)||de(n.overflowX,t)||(e=>{let 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},fe=(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,ge=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var he=0;function me(e){return"function"==typeof e?e:Ie}function Ie(){}function ve(e,t){if(e){var n=((e,t)=>{var n,i,o,r,u,s;if("undefined"==typeof document)return[];let{scrollMode:a,block:l,inline:c,boundary:d,skipOverflowHiddenElements:p}=t,f="function"==typeof d?d:e=>e!==d;if(!ce(e))throw new TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,h=[],m=e;for(;ce(m)&&f(m);){if(m=ge(m),m===g){h.push(m);break}null!=m&&m===document.body&&pe(m)&&!pe(document.documentElement)||null!=m&&pe(m,p)&&h.push(m)}let I=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,v=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,b=null!=(s=window.scrollY)?s:pageYOffset,{height:x,width:w,top:S,right:C,bottom:k,left:D}=e.getBoundingClientRect(),O="start"===l||"nearest"===l?S:"end"===l?k:S+x/2,M="center"===c?D+w/2:"end"===c?C:D,E=[];for(let e=0;e<h.length;e++){let t=h[e],{height:n,width:i,top:o,right:r,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===a&&S>=0&&D>=0&&k<=v&&C<=I&&S>=o&&k<=u&&D>=s&&C<=r)return E;let d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),f=parseInt(d.borderTopWidth,10),m=parseInt(d.borderRightWidth,10),P=parseInt(d.borderBottomWidth,10),R=0,K=0,T="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-P:0,V="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)R="start"===l?O:"end"===l?O-v:"nearest"===l?fe(b,b+v,v,f,P,b+O,b+O+x,x):O-v/2,K="start"===c?M:"center"===c?M-I/2:"end"===c?M-I:fe(y,y+I,I,p,m,y+M,y+M+w,w),R=Math.max(0,R+b),K=Math.max(0,K+y);else{R="start"===l?O-o-f:"end"===l?O-u+P+H:"nearest"===l?fe(o,u,n,f,P+H,O,O+x,x):O-(o+n/2)+H/2,K="start"===c?M-s-p:"center"===c?M-(s+i/2)+T/2:"end"===c?M-r+m+T:fe(s,r,i,p,m+T,M,M+w,w);let{scrollLeft:e,scrollTop:a}=t;R=Math.max(0,Math.min(a+R/A,t.scrollHeight-n/A+H)),K=Math.max(0,Math.min(e+K/V,t.scrollWidth-i/V+T)),O+=a-R,M+=e-K}E.push({el:t,top:R,left:K})}return E})(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 ye(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function be(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 xe(){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 we(){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 Se(){return String(he++)}function Ce(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 ke(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var De=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Oe(e){void 0===e&&(e={});var t={};return De.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function Me(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=Ee(t,i)?t[i]:e[i],n}),{})}function Ee(e,t){return void 0!==e[t]}function Pe(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function Re(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 a=Ke(s,t<0,n,i,o);return-1===a?e>=r?-1:e:a}function Ke(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?Ke(t?r-1:0,t,n,i):-1}function Te(e,t,n,i){return void 0===i&&(i=!0),t.some((function(t){return t&&(ye(t,e,n)||i&&ye(t,n.document.activeElement,n))}))}var He=be((function(e){Ae(e).textContent=""}),500);function Ve(e,t){var n=Ae(t);e&&(n.textContent=e,He(t))}function Ae(e){void 0===e&&(e=document);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)}var Be=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}),Le=["refKey","ref"],_e=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],Fe=["onKeyDown","onBlur","onChange","onInput","onChangeText"],$e=["refKey","ref"],Ne=["onMouseMove","onMouseDown","onClick","onPress","index","item"],je=function(){var e=function(e){var n,i;function a(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+Se(),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.input=null,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=Oe(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=Oe(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){t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var l={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),a.type=a.type||0,Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],Ee(n.props,e)||(l[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),a)),l}),(function(){me(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,a=void 0===s?"ref":s,l=u.ref,c=o(u,Le),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return r(((i={})[a]=we(l,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=Re(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=Re(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=Ke(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=Ke(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,a=t.onBlur,l=o(t,_e),c=n.getState().isOpen,d={onClick:xe(i,n.buttonHandleClick),onKeyDown:xe(u,n.buttonHandleKeyDown),onKeyUp:xe(s,n.buttonHandleKeyUp),onBlur:xe(a,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l.disabled?{}:d,l)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=Pe(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(u(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===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,a=t.onInput;t.onChangeText;var l=o(t,Fe),c={};var d,p=n.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;l.disabled||((d={}).onChange=xe(s,a,n.inputHandleChange),d.onKeyDown=xe(i,n.inputHandleKeyDown),d.onBlur=xe(u,n.inputHandleBlur),c=d);return r({"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":l&&l["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,l)},n.inputHandleKeyDown=function(e){var t=Pe(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=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||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,a=void 0===s?"ref":s,l=u.ref,c=o(u,$e),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=p,r(((i={})[a]=we(l,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,a=i.onClick;i.onPress;var l=i.index,c=i.item,d=void 0===c?void 0:c,p=o(i,Ne);void 0===l?(n.items.push(d),l=n.items.indexOf(d)):n.items[l]=d;var f=a,g=((t={onMouseMove:xe(u,(function(){l!==n.getState().highlightedIndex&&(n.setHighlightedIndex(l,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:xe(s,(function(e){e.preventDefault()}))}).onClick=xe(f,(function(){n.selectItemAtIndex(l,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return r({id:n.getItemId(l),role:"option","aria-selected":n.getState().highlightedIndex===l},h,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=Oe(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=Oe(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),me(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=be((function(){var e=n.getState(),t=n.items[e.highlightedIndex],i=n.getItemCount(),o=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:i,highlightedItem:t},e));n.previousResultCount=i,Ve(o,n.props.environment.document)}),200);var i=n.props,s=i.defaultHighlightedIndex,a=i.initialHighlightedIndex,l=void 0===a?s:a,c=i.defaultIsOpen,d=i.initialIsOpen,p=void 0===d?c:d,f=i.initialInputValue,g=void 0===f?"":f,h=i.initialSelectedItem,m=void 0===h?null:h,I=n.getState({highlightedIndex:l,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=a).prototype=Object.create(i.prototype),n.prototype.constructor=n,s(n,i);var l=a.prototype;return l.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},l.getState=function(e){return void 0===e&&(e=this.state),Me(e,this.props)},l.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},l.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},l.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},l.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=Re(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},l.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,a=this.getToggleButtonProps,l=this.getLabelProps,c=this.getMenuProps,d=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:a,getLabelProps:l,getMenuProps:c,getInputProps:d,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}},l.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Te(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=Te(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)}},l.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},l.componentDidUpdate=function(e,t){Ee(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()},l.componentWillUnmount=function(){this.cleanup()},l.render=function(){var e=ke(this.props.children,Ie);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=ke(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},a}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:Ce,itemToString:function(e){return null==e?"":String(e)},onStateChange:Ie,onInputValueChange:Ie,onUserAction:Ie,onChange:Ie,onSelect:Ie,onOuterClick:Ie,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:ve},e.stateChangeTypes=Be,e}(),Ue=je,We=["isInitialMount","highlightedIndex","items","environment"],qe={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function ze(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"+Qe(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 Ye=be((function(e,t){Ve(e(),t)}),200),Xe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,Ge="useId"in i.default?function(e){var n=e.id,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,a=e.inputId,l="downshift-"+i.default.useId();return n||(n=l),t.useRef({labelId:o||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:a||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+Se():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,a=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:a||i+"-input"}).current};function Je(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 Qe(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Ze(e){var n=t.useRef(e);return n.current=e,n}function et(e,n,i){var o=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=Me(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),a=t.useReducer(s,n),l=a[0],c=a[1],d=Ze(i),p=t.useCallback((function(e){return c(r({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&o.current&&o.current!==l&&ze(f,Me(o.current,f.props),l),o.current=l}),[l,i,f]),[l,p]}function tt(e,t,n){var i=et(e,t,n),o=i[0],r=i[1];return[Me(o,n),r]}var nt={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:ve,environment:"undefined"==typeof window?{}:window};function it(e,t,n){void 0===n&&(n=qe);var i=e["default"+Qe(t)];return void 0!==i?i:n[t]}function ot(e,t,n){void 0===n&&(n=qe);var i=e[t];if(void 0!==i)return i;var o=e["initial"+Qe(t)];return void 0!==o?o:it(e,t,n)}function rt(e){var t=ot(e,"selectedItem"),n=ot(e,"isOpen"),i=ot(e,"highlightedIndex"),o=ot(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function ut(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 st(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==i?void 0:i.addEventListener)){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!Te(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},a=function(){r.current.isTouchMove=!0},l=function(t){!e||r.current.isTouchMove||Te(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",a),i.addEventListener("touchend",l),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",a),i.removeEventListener("touchend",l)}}}),[e,i]),r}var at=function(){return Ie};function lt(e,n,i){var u=i.isInitialMount,s=i.highlightedIndex,a=i.items,l=i.environment,c=o(i,We);t.useEffect((function(){u||Ye((function(){return e(r({highlightedIndex:s,highlightedItem:a[s],resultCount:a.length},c))}),l.document)}),n)}function ct(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,a=t.useRef(!0);return Xe((function(){n<0||!i||!Object.keys(o.current).length||(!1===a.current?a.current=!0:s(r(n),u))}),[n]),a}var dt=Ie;function pt(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:it(e,"isOpen"),highlightedIndex:it(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}var ft={environment:T.shape({addEventListener:T.func.isRequired,removeEventListener:T.func.isRequired,document:T.shape({createElement:T.func.isRequired,getElementById:T.func.isRequired,activeElement:T.any.isRequired,body:T.any.isRequired}).isRequired,Node:T.func.isRequired}),itemToString:T.func,stateReducer:T.func},gt=r({},ft,{getA11yStatusMessage:T.func,highlightedIndex:T.number,defaultHighlightedIndex:T.number,initialHighlightedIndex:T.number,isOpen:T.bool,defaultIsOpen:T.bool,initialIsOpen:T.bool,selectedItem:T.any,initialSelectedItem:T.any,defaultSelectedItem:T.any,id:T.string,labelId:T.string,menuId:T.string,getItemId:T.func,toggleButtonId:T.string,onSelectedItemChange:T.func,onHighlightedIndexChange:T.func,onStateChange:T.func,onIsOpenChange:T.func,scrollIntoView:T.func});function ht(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:ut(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:ut(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:it(u,"highlightedIndex"),isOpen:it(u,"isOpen"),selectedItem:it(u,"selectedItem"),inputValue:it(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,i)}var mt=function(){return mt=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},mt.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,mt(mt({},gt),{items:T.array.isRequired,isItemDisabled:T.func,getA11ySelectionMessage:T.func});var It=mt(mt({},nt),{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}}),vt=Ie,yt=1,bt=2,xt=3,wt=4,St=5,Ct=6,kt=7,Dt=8,Ot=9,Mt=10,Et=11,Pt=14,Rt=19,Kt=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:yt,ToggleButtonKeyDownArrowUp:bt,ToggleButtonKeyDownCharacter:xt,ToggleButtonKeyDownEscape:wt,ToggleButtonKeyDownHome:St,ToggleButtonKeyDownEnd:Ct,ToggleButtonKeyDownEnter:kt,ToggleButtonKeyDownSpaceButton:Dt,ToggleButtonKeyDownPageUp:Ot,ToggleButtonKeyDownPageDown:Mt,ToggleButtonBlur:Et,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Pt,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Rt,FunctionSetInputValue:20,FunctionReset:21});function Tt(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Pt:i={isOpen:it(u,"isOpen"),highlightedIndex:it(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case xt:var a=t.key,l=""+e.inputValue+a,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 a=(s+n+(t.length<2?1:0))%i.length,l=i[a];if(void 0!==l&&o(l).toLowerCase().startsWith(u)&&!r(l,a))return a}return n}({keysSoFar:l,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.indexOf(e.selectedItem):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled});i={inputValue:l,highlightedIndex:c,isOpen:!0};break;case yt:i={highlightedIndex:e.isOpen?Re(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:ut(u,e,1),isOpen:!0};break;case bt:if(e.isOpen&&s)i=pt(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?Re(e.highlightedIndex,-1,u.items,u.isItemDisabled):ut(u,e,-1),isOpen:!0};break;case kt:case Dt:i=pt(u,e.highlightedIndex,!1);break;case St:i={highlightedIndex:Ke(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Ct:i={highlightedIndex:Ke(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Ot:i={highlightedIndex:Re(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Mt:i={highlightedIndex:Re(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case wt:i={isOpen:!1,highlightedIndex:-1};break;case Et:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Rt:i={selectedItem:t.selectedItem};break;default:return ht(e,t,Kt)}return r({},e,i)}var Ht=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],Vt=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],At=["item","index","onMouseMove","onClick","onPress","refKey","disabled","ref"];function Bt(e){void 0===e&&(e={}),vt();var n=r({},It,e),i=n.items,u=n.scrollIntoView,s=n.environment,a=n.itemToString,l=n.getA11ySelectionMessage,c=n.getA11yStatusMessage,d=tt(Tt,rt(n),n),p=d[0],f=d[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),w=Ge(n),S=t.useRef(),C=t.useRef(!0),k=Ze({state:p,props:n}),D=t.useCallback((function(e){return b.current[w.getItemId(e)]}),[w]);lt(c,[g,h,I,i],r({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:a},p)),lt(l,[m],r({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:a},p));var O=ct({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:D});t.useEffect((function(){return x.current=be((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),dt({isInitialMount:C.current,props:n,state:p}),t.useEffect((function(){C.current||(S.current=i.length)})),t.useEffect((function(){ot(n,"isOpen")&&v.current&&v.current.focus()}),[]);var M=st(g,[y,v],s,(function(){f({type:Et})})),E=at();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var P=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:yt,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:bt,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:St})},End:function(e){e.preventDefault(),f({type:Ct})},Escape:function(){k.current.state.isOpen&&f({type:wt})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?kt:0})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ot}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Mt}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:xt,key:" "}):f({type:Dt}):f({type:0})}}}),[f,k]),R=t.useCallback((function(){f({type:15})}),[f]),K=t.useCallback((function(){f({type:17})}),[f]),T=t.useCallback((function(){f({type:16})}),[f]),H=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),V=t.useCallback((function(e){f({type:Rt,selectedItem:e})}),[f]),A=t.useCallback((function(){f({type:21})}),[f]),B=t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),L=t.useCallback((function(e){return r({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),_=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,a=void 0===s?"ref":s;i.onKeyDown,i.onBlur;var l=i.ref,c=o(i,Ht),d=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==d&&d,a,y),r(((n={})[a]=we(l,(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=xe(u,(function(){f({type:12})})),n),c)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var a=i.onKeyDown,l=i.refKey,c=void 0===l?"ref":l,d=i.ref,p=o(i,Vt),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.current.state,I=r(((n={})[c]=we(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=xe(u,(function(){m.isOpen&&!M.current.isMouseDown&&f({type:Et})})),n),p);return p.disabled||(I.onClick=xe(s,(function(){f({type:0})})),I.onKeyDown=xe(a,(function(e){var t=Pe(e);t&&P[t]?P[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:xt,key:t})}))),E("getToggleButtonProps",h,c,v),I}),[k,w,E,f,M,P]),getLabelProps:L,getMenuProps:_,getItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,a=n.onClick;n.onPress;var l=n.refKey,c=void 0===l?"ref":l,d=n.disabled,p=n.ref,g=o(n,At);void 0!==d&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var h=k.current,m=h.state,I=h.props,v=Je(i,u,I.items,"Pass either item or index to getItemProps!"),y=v[0],x=v[1],S=I.isItemDisabled(y,x),C=r(((t={})[c]=we(p,(function(e){e&&(b.current[w.getItemId(x)]=e)})),t["aria-disabled"]=S,t["aria-selected"]=""+(y===m.selectedItem),t.id=w.getItemId(x),t.role="option",t),g);return S||(C.onClick=xe(a,(function(){f({type:Pt,index:x})}))),C.onMouseMove=xe(s,(function(){x!==m.highlightedIndex&&(O.current=!1,f({type:13,index:x,disabled:S}))})),C}),[k,w,O,f]),toggleMenu:R,openMenu:T,closeMenu:K,setHighlightedIndex:H,selectItem:V,reset:A,setInputValue:B,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}Bt.stateChangeTypes=Kt;var Lt=0,_t=1,Ft=2,$t=3,Nt=4,jt=5,Ut=6,Wt=7,qt=8,zt=9,Yt=10,Xt=13,Gt=19,Jt=22,Qt=Object.freeze({__proto__:null,InputKeyDownArrowDown:Lt,InputKeyDownArrowUp:_t,InputKeyDownEscape:Ft,InputKeyDownHome:$t,InputKeyDownEnd:Nt,InputKeyDownPageUp:jt,InputKeyDownPageDown:Ut,InputKeyDownEnter:Wt,InputChange:qt,InputBlur:zt,InputClick:Yt,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Xt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Gt,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:Jt});r({},gt,{items:T.array.isRequired,isItemDisabled:T.func,selectedItemChanged:T.func,getA11ySelectionMessage:T.func,inputValue:T.string,defaultInputValue:T.string,initialInputValue:T.string,inputId:T.string,onInputValueChange:T.func});var Zt=Ie,en=r({},nt,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:Ce,isItemDisabled:function(){return!1}});function tn(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Xt:i={isOpen:it(u,"isOpen"),highlightedIndex:it(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case Lt:i=e.isOpen?{highlightedIndex:Re(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:ut(u,e,1),isOpen:u.items.length>=0};break;case _t:i=e.isOpen?s?pt(u,e.highlightedIndex):{highlightedIndex:Re(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:ut(u,e,-1),isOpen:u.items.length>=0};break;case Wt:i=pt(u,e.highlightedIndex);break;case Ft:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case jt:i={highlightedIndex:Re(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Ut:i={highlightedIndex:Re(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case $t:i={highlightedIndex:Ke(0,!1,u.items,u.isItemDisabled)};break;case Nt:i={highlightedIndex:Ke(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case zt: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 qt:i={isOpen:!0,highlightedIndex:it(u,"highlightedIndex"),inputValue:t.inputValue};break;case Yt:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ut(u,e,0)};break;case Gt:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case Jt:i={inputValue:t.inputValue};break;default:return ht(e,t,Qt)}return r({},e,i)}var nn=["onMouseLeave","refKey","ref"],on=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],rn=["onClick","onPress","refKey","ref"],un=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function sn(e){void 0===e&&(e={}),Zt();var n=r({},en,e),i=n.items,u=n.scrollIntoView,s=n.environment,a=n.getA11yStatusMessage,l=n.getA11ySelectionMessage,c=n.itemToString,d=function(e){var t=rt(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})}(n),p=function(e,n,i){var o=t.useRef(),r=et(e,n,i),u=r[0],s=r[1];return t.useEffect((function(){Ee(i,"selectedItem")&&(i.selectedItemChanged(o.current,i.selectedItem)&&s({type:Jt,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[u.selectedItem,i.selectedItem]),[Me(u,i),s]}(tn,d,n),f=p[0],g=p[1],h=f.isOpen,m=f.highlightedIndex,I=f.selectedItem,v=f.inputValue,y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),w=t.useRef(null),S=t.useRef(!0),C=Ge(n),k=t.useRef(),D=Ze({state:f,props:n}),O=t.useCallback((function(e){return b.current[C.getItemId(e)]}),[C]);lt(a,[h,m,v,i],r({isInitialMount:S.current,previousResultCount:k.current,items:i,environment:s,itemToString:c},f)),lt(l,[I],r({isInitialMount:S.current,previousResultCount:k.current,items:i,environment:s,itemToString:c},f));var M=ct({menuElement:y.current,highlightedIndex:m,isOpen:h,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:O});dt({isInitialMount:S.current,props:n,state:f}),t.useEffect((function(){ot(n,"isOpen")&&x.current&&x.current.focus()}),[]),t.useEffect((function(){S.current||(k.current=i.length)}));var E=st(h,[x,y,w],s,(function(){g({type:zt,selectItem:!1})})),P=at();t.useEffect((function(){return S.current=!1,function(){S.current=!0}}),[]),t.useEffect((function(){var e;if(h){if((null==(e=s.document)?void 0:e.activeElement)!==x.current){var t;null==x||null==(t=x.current)||t.focus()}}else b.current={}}),[h,s]);var R=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:Lt,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),g({type:_t,altKey:e.altKey})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:$t}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:Nt}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),g({type:Ft}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),g({type:Wt}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:jt}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:Ut}))}}}),[g,D]),K=t.useCallback((function(e){return r({id:C.labelId,htmlFor:C.inputId},e)}),[C]),T=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,a=void 0===s?"ref":s,l=i.ref,c=o(i,nn),d=(void 0===t?{}:t).suppressRefError;return P("getMenuProps",void 0!==d&&d,a,y),r(((n={})[a]=we(l,(function(e){y.current=e})),n.id=C.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+C.labelId,n.onMouseLeave=xe(u,(function(){g({type:11})})),n),c)}),[g,P,C]),H=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,u=i.item,s=i.index,a=i.refKey,l=void 0===a?"ref":a,c=i.ref,d=i.onMouseMove,p=i.onMouseDown,f=i.onClick;i.onPress;var h=i.disabled,m=o(i,on);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=D.current,v=I.props,y=I.state,x=Je(u,s,v.items,"Pass either item or index to getItemProps!"),w=x[0],S=x[1],k=v.isItemDisabled(w,S),O=f;return r(((t={})[l]=we(c,(function(e){e&&(b.current[C.getItemId(S)]=e)})),t["aria-disabled"]=k,t["aria-selected"]=""+(S===y.highlightedIndex),t.id=C.getItemId(S),t.role="option",t),!k&&((n={}).onClick=xe(O,(function(){g({type:Xt,index:S})})),n),{onMouseMove:xe(d,(function(){S!==y.highlightedIndex&&(M.current=!1,g({type:12,index:S,disabled:k}))})),onMouseDown:xe(p,(function(e){return e.preventDefault()}))},m)}),[g,D,M,C]),V=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,a=n.ref,l=o(n,rn),c=D.current.state;return r(((t={})[s]=we(a,(function(e){w.current=e})),t["aria-controls"]=C.menuId,t["aria-expanded"]=c.isOpen,t.id=C.toggleButtonId,t.tabIndex=-1,t),!l.disabled&&r({},{onClick:xe(i,(function(){g({type:14})}))}),l)}),[g,D,C]),A=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onKeyDown,a=i.onChange,l=i.onInput,c=i.onBlur;i.onChangeText;var d=i.onClick,p=i.refKey,f=void 0===p?"ref":p,h=i.ref,m=o(i,un),I=(void 0===t?{}:t).suppressRefError;P("getInputProps",void 0!==I&&I,f,x);var v,y=D.current.state,b={};m.disabled||((v={}).onChange=xe(a,l,(function(e){g({type:qt,inputValue:e.target.value})})),v.onKeyDown=xe(u,(function(e){var t=Pe(e);t&&R[t]&&R[t](e)})),v.onBlur=xe(c,(function(e){if(y.isOpen&&!E.current.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;g({type:zt,selectItem:!t})}})),v.onClick=xe(d,(function(){g({type:Yt})})),b=v);return r(((n={})[f]=we(h,(function(e){x.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?C.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=C.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:C.labelId,n.autoComplete="off",n.id=C.inputId,n.role="combobox",n.value=y.inputValue,n),b,m)}),[P,D,C,R,g,E,s]),B=t.useCallback((function(){g({type:15})}),[g]),L=t.useCallback((function(){g({type:17})}),[g]),_=t.useCallback((function(){g({type:16})}),[g]),F=t.useCallback((function(e){g({type:18,highlightedIndex:e})}),[g]),$=t.useCallback((function(e){g({type:Gt,selectedItem:e})}),[g]);return{getItemProps:H,getLabelProps:K,getMenuProps:T,getInputProps:A,getToggleButtonProps:V,toggleMenu:B,openMenu:_,closeMenu:L,setHighlightedIndex:F,setInputValue:t.useCallback((function(e){g({type:20,inputValue:e})}),[g]),selectItem:$,reset:t.useCallback((function(){g({type:21})}),[g]),highlightedIndex:m,isOpen:h,selectedItem:I,inputValue:v}}sn.stateChangeTypes=Qt;var an={activeIndex:-1,selectedItems:[]};function ln(e,t){return ot(e,t,an)}function cn(e,t){return it(e,t,an)}function dn(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}r({},ft,{selectedItems:T.array,initialSelectedItems:T.array,defaultSelectedItems:T.array,getA11yRemovalMessage:T.func,activeIndex:T.number,initialActiveIndex:T.number,defaultActiveIndex:T.number,onActiveIndexChange:T.func,onSelectedItemsChange:T.func,keyNavigationNext:T.string,keyNavigationPrevious:T.string});var pn={itemToString:nt.itemToString,stateReducer:nt.stateReducer,environment:nt.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},fn=Ie,gn=0,hn=1,mn=2,In=3,vn=4,yn=5,bn=6,xn=7,wn=8,Sn=9,Cn=10,kn=11,Dn=12,On=Object.freeze({__proto__:null,SelectedItemClick:gn,SelectedItemKeyDownDelete:hn,SelectedItemKeyDownBackspace:mn,SelectedItemKeyDownNavigationNext:In,SelectedItemKeyDownNavigationPrevious:vn,DropdownKeyDownNavigationPrevious:yn,DropdownKeyDownBackspace:bn,DropdownClick:xn,FunctionAddSelectedItem:wn,FunctionRemoveSelectedItem:Sn,FunctionSetSelectedItems:Cn,FunctionSetActiveIndex:kn,FunctionReset:Dn});function Mn(e,t){var n,i=t.type,o=t.index,u=t.props,s=t.selectedItem,a=e.activeIndex,l=e.selectedItems;switch(i){case gn:n={activeIndex:o};break;case vn:n={activeIndex:a-1<0?0:a-1};break;case In:n={activeIndex:a+1>=l.length?-1:a+1};break;case mn:case hn:if(a<0)break;var c=a;1===l.length?c=-1:a===l.length-1&&(c=l.length-2),n=r({selectedItems:[].concat(l.slice(0,a),l.slice(a+1))},{activeIndex:c});break;case yn:n={activeIndex:l.length-1};break;case bn:n={selectedItems:l.slice(0,l.length-1)};break;case wn:n={selectedItems:[].concat(l,[s])};break;case xn:n={activeIndex:-1};break;case Sn:var d=a,p=l.indexOf(s);if(p<0)break;1===l.length?d=-1:p===l.length-1&&(d=l.length-2),n={selectedItems:[].concat(l.slice(0,p),l.slice(p+1)),activeIndex:d};break;case Cn:n={selectedItems:t.selectedItems};break;case kn:n={activeIndex:t.activeIndex};break;case Dn:n={activeIndex:cn(u,"activeIndex"),selectedItems:cn(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var En=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Pn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Rn(e){void 0===e&&(e={}),fn();var n=r({},pn,e),i=n.getA11yRemovalMessage,u=n.itemToString,s=n.environment,a=n.keyNavigationNext,l=n.keyNavigationPrevious,c=tt(Mn,function(e){return{activeIndex:ln(e,"activeIndex"),selectedItems:ln(e,"selectedItems")}}(n),n),d=c[0],p=c[1],f=d.activeIndex,g=d.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=Ze({state:d,props:n});t.useEffect((function(){if(!h.current){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));Ve(i({itemToString:u,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),s.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]),dt({isInitialMount:h.current,props:n,state:d});var b=at();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[l]=function(){p({type:vn})},e[a]=function(){p({type:In})},e.Delete=function(){p({type:hn})},e.Backspace=function(){p({type:mn})},e}),[p,a,l]),w=t.useMemo((function(){var e;return(e={})[l]=function(e){dn(e)&&p({type:yn})},e.Backspace=function(e){dn(e)&&p({type:bn})},e}),[p,l]);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,a=n.onClick,l=n.onKeyDown,c=n.selectedItem,d=n.index,f=o(n,En),g=y.current.state,h=Je(c,d,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.activeIndex;return r(((t={})[u]=we(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=xe(a,(function(){p({type:gn,index:h})})),t.onKeyDown=xe(l,(function(e){var t=Pe(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,a=i.ref,l=i.onKeyDown,c=i.onClick,d=i.preventKeyAction,f=void 0!==d&&d,g=o(i,Pn),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,s,m),r(((n={})[s]=we(a,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:xe(l,(function(e){var t=Pe(e);t&&w[t]&&w[t](e)})),onClick:xe(c,(function(){p({type:xn})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:wn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Sn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Cn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:kn,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Dn})}),[p]),selectedItems:g,activeIndex:f}}Rn.stateChangeTypes=On,e.default=Ue,e.resetIdCounter=function(){"useId"in i.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):he=0},e.useCombobox=sn,e.useMultipleSelection=Rn,e.useSelect=Bt,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 g,h=l(f.exports),m={};!function(){if(g)return m;g=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"),h=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var g=e.$$typeof;switch(g){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 g}}case n:return g}}}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===h||"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 g=e;for(;I(g)&&d(g);){if(g=x(g),g===p){f.push(g);break}null!=g&&g===document.body&&y(g)&&!y(document.documentElement)||null!=g&&y(g,c)&&f.push(g)}const h=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<=h&&k>=o&&O<=a&&M>=c&&D<=r)return R;const d=getComputedStyle(t),g=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-g-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-h/2:"end"===l?P-h:b(v,v+h,h,g,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-g:"center"===l?P-(c+i/2)+H/2:"end"===l?P-r+y+H:b(c,r,i,g,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,g=p.isOpen,h=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":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},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,g=((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),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return r({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=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,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=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,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:c,getInputProps:d,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}},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){var o=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=V(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),l=t.useReducer(s,n),a=l[0],c=l[1],d=ue(i),p=t.useCallback((function(e){return c(r({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&o.current&&o.current!==a&&ee(f,V(o.current,f.props),a),o.current=a}),[a,i,f]),[a,p]}function le(e,t,n){var i=se(e,t,n),o=i[0],r=i[1];return[V(o,n),r]}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 ge(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 he=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])}))}var be={environment:h.shape({addEventListener:h.func.isRequired,removeEventListener:h.func.isRequired,document:h.shape({createElement:h.func.isRequired,getElementById:h.func.isRequired,activeElement:h.any.isRequired,body:h.any.isRequired}).isRequired,Node:h.func.isRequired}),itemToString:h.func,stateReducer:h.func},xe=r({},be,{getA11yStatusMessage:h.func,highlightedIndex:h.number,defaultHighlightedIndex:h.number,initialHighlightedIndex:h.number,isOpen:h.bool,defaultIsOpen:h.bool,initialIsOpen:h.bool,selectedItem:h.any,initialSelectedItem:h.any,defaultSelectedItem:h.any,id:h.string,labelId:h.string,menuId:h.string,getItemId:h.func,toggleButtonId:h.string,onSelectedItemChange:h.func,onHighlightedIndexChange:h.func,onStateChange:h.func,onIsOpenChange:h.func,scrollIntoView:h.func});function we(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 Se=function(){return Se=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},Se.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,Se(Se({},xe),{items:h.array.isRequired,isItemDisabled:h.func,getA11ySelectionMessage:h.func});var Ce=Se(Se({},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}}),ke=C,De=1,Oe=2,Me=3,Ee=4,Pe=5,Re=6,Te=7,Ke=8,He=9,Ve=10,Ae=11,Be=14,Le=19,_e=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:De,ToggleButtonKeyDownArrowUp:Oe,ToggleButtonKeyDownCharacter:Me,ToggleButtonKeyDownEscape:Ee,ToggleButtonKeyDownHome:Pe,ToggleButtonKeyDownEnd:Re,ToggleButtonKeyDownEnter:Te,ToggleButtonKeyDownSpaceButton:Ke,ToggleButtonKeyDownPageUp:He,ToggleButtonKeyDownPageDown:Ve,ToggleButtonBlur:Ae,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Be,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Le,FunctionSetInputValue:20,FunctionReset:21});function Fe(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Be:i={isOpen:ce(u,"isOpen"),highlightedIndex:ce(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case Me: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 De: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 Oe: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 Te:case Ke:i=ye(u,e.highlightedIndex,!1);break;case Pe:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Re:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case He:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Ve:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Ee:i={isOpen:!1,highlightedIndex:-1};break;case Ae:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Le:i={selectedItem:t.selectedItem};break;default:return we(e,t,_e)}return r({},e,i)}var Ne=["onMouseLeave","refKey","ref"],je=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Ue=["item","index","onMouseMove","onClick","onPress","refKey","disabled","ref"];function We(e){void 0===e&&(e={}),ke();var n=r({},Ce,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,c=n.getA11yStatusMessage,d=le(Fe,pe(n),n),p=d[0],f=d[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),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,[g,h,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:h,isOpen:g,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=ge(g,[y,v],s,(function(){f({type:Ae})})),T=he();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:De,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Oe,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Pe})},End:function(e){e.preventDefault(),f({type:Re})},Escape:function(){k.current.state.isOpen&&f({type:Ee})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?Te:0})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:He}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ve}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Me,key:" "}):f({type:Ke}):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:Le,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,Ne),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]);return{getToggleButtonProps: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,je),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,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:Ae})})),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:Me,key:t})}))),T("getToggleButtonProps",h,c,v),I}),[k,w,T,f,R,K]),getLabelProps:j,getMenuProps:U,getItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,l=n.onClick;n.onPress;var a=n.refKey,c=void 0===a?"ref":a,d=n.disabled,p=n.ref,g=o(n,Ue);void 0!==d&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var h=k.current,m=h.state,I=h.props,v=oe(i,u,I.items,"Pass either item or index to getItemProps!"),y=v[0],x=v[1],S=I.isItemDisabled(y,x),C=r(((t={})[c]=E(p,(function(e){e&&(b.current[w.getItemId(x)]=e)})),t["aria-disabled"]=S,t["aria-selected"]=""+(y===m.selectedItem),t.id=w.getItemId(x),t.role="option",t),g);return S||(C.onClick=M(l,(function(){f({type:Be,index:x})}))),C.onMouseMove=M(s,(function(){x!==m.highlightedIndex&&(P.current=!1,f({type:13,index:x,disabled:S}))})),C}),[k,w,P,f]),toggleMenu:H,openMenu:A,closeMenu:V,setHighlightedIndex:L,selectItem:_,reset:F,setInputValue:N,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}We.stateChangeTypes=_e;var $e=0,qe=1,ze=2,Ye=3,Xe=4,Ge=5,Je=6,Qe=7,Ze=8,et=9,tt=10,nt=13,it=19,ot=22,rt=Object.freeze({__proto__:null,InputKeyDownArrowDown:$e,InputKeyDownArrowUp:qe,InputKeyDownEscape:ze,InputKeyDownHome:Ye,InputKeyDownEnd:Xe,InputKeyDownPageUp:Ge,InputKeyDownPageDown:Je,InputKeyDownEnter:Qe,InputChange:Ze,InputBlur:et,InputClick:tt,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:nt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:it,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:ot});r({},xe,{items:h.array.isRequired,isItemDisabled:h.func,selectedItemChanged:h.func,getA11ySelectionMessage:h.func,inputValue:h.string,defaultInputValue:h.string,initialInputValue:h.string,inputId:h.string,onInputValueChange:h.func});var ut=C,st=r({},ae,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:R,isItemDisabled:function(){return!1}});function lt(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case nt:i={isOpen:ce(u,"isOpen"),highlightedIndex:ce(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case $e: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 qe: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 Qe:i=ye(u,e.highlightedIndex);break;case ze:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ge:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Je:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Ye:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled)};break;case Xe:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case et: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 Ze:i={isOpen:!0,highlightedIndex:ce(u,"highlightedIndex"),inputValue:t.inputValue};break;case tt:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:fe(u,e,0)};break;case it:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case ot:i={inputValue:t.inputValue};break;default:return we(e,t,rt)}return r({},e,i)}var at=["onMouseLeave","refKey","ref"],ct=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],dt=["onClick","onPress","refKey","ref"],pt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function ft(e){void 0===e&&(e={}),ut();var n=r({},st,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,c=n.itemToString,d=function(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})}(n),p=function(e,n,i){var o=t.useRef(),r=se(e,n,i),u=r[0],s=r[1];return t.useEffect((function(){A(i,"selectedItem")&&(i.selectedItemChanged(o.current,i.selectedItem)&&s({type:ot,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[u.selectedItem,i.selectedItem]),[V(u,i),s]}(lt,d,n),f=p[0],g=p[1],h=f.isOpen,m=f.highlightedIndex,I=f.selectedItem,v=f.inputValue,y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),w=t.useRef(null),S=t.useRef(!0),C=ie(n),k=t.useRef(),D=ue({state:f,props:n}),O=t.useCallback((function(e){return b.current[C.getItemId(e)]}),[C]);me(l,[h,m,v,i],r({isInitialMount:S.current,previousResultCount:k.current,items:i,environment:s,itemToString:c},f)),me(a,[I],r({isInitialMount:S.current,previousResultCount:k.current,items:i,environment:s,itemToString:c},f));var P=Ie({menuElement:y.current,highlightedIndex:m,isOpen:h,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:O});ve({isInitialMount:S.current,props:n,state:f}),t.useEffect((function(){de(n,"isOpen")&&x.current&&x.current.focus()}),[]),t.useEffect((function(){S.current||(k.current=i.length)}));var R=ge(h,[x,y,w],s,(function(){g({type:et,selectItem:!1})})),T=he();t.useEffect((function(){return S.current=!1,function(){S.current=!0}}),[]),t.useEffect((function(){h||(b.current={})}),[h]),t.useEffect((function(){var e;h&&null!=s&&s.document&&null!=x&&null!=(e=x.current)&&e.focus&&s.document.activeElement!==x.current&&x.current.focus()}),[h,s]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:$e,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),g({type:qe,altKey:e.altKey})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:Ye}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:Xe}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),g({type:ze}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),g({type:Qe}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:Ge}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:Je}))}}}),[g,D]),H=t.useCallback((function(e){return r({id:C.labelId,htmlFor:C.inputId},e)}),[C]),L=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,at),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=C.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+C.labelId,n.onMouseLeave=M(u,(function(){g({type:11})})),n),c)}),[g,T,C]),_=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,f=i.onClick;i.onPress;var h=i.disabled,m=o(i,ct);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=D.current,v=I.props,y=I.state,x=oe(u,s,v.items,"Pass either item or index to getItemProps!"),w=x[0],S=x[1],k=v.isItemDisabled(w,S),O=f;return r(((t={})[a]=E(c,(function(e){e&&(b.current[C.getItemId(S)]=e)})),t["aria-disabled"]=k,t["aria-selected"]=""+(S===y.highlightedIndex),t.id=C.getItemId(S),t.role="option",t),!k&&((n={}).onClick=M(O,(function(){g({type:nt,index:S})})),n),{onMouseMove:M(d,(function(){S!==y.highlightedIndex&&(P.current=!1,g({type:12,index:S,disabled:k}))})),onMouseDown:M(p,(function(e){return e.preventDefault()}))},m)}),[g,D,P,C]),F=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,dt),c=D.current.state;return r(((t={})[s]=E(l,(function(e){w.current=e})),t["aria-controls"]=C.menuId,t["aria-expanded"]=c.isOpen,t.id=C.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&r({},{onClick:M(i,(function(){g({type:14})}))}),a)}),[g,D,C]),N=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,f=void 0===p?"ref":p,h=i.ref,m=o(i,pt),I=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==I&&I,f,x);var v,y=D.current.state,b={};m.disabled||((v={}).onChange=M(l,a,(function(e){g({type:Ze,inputValue:e.target.value})})),v.onKeyDown=M(u,(function(e){var t=B(e);t&&K[t]&&K[t](e)})),v.onBlur=M(c,(function(e){if(null!=s&&s.document&&y.isOpen&&!R.current.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;g({type:et,selectItem:!t})}})),v.onClick=M(d,(function(){g({type:tt})})),b=v);return r(((n={})[f]=E(h,(function(e){x.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?C.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=C.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:C.labelId,n.autoComplete="off",n.id=C.inputId,n.role="combobox",n.value=y.inputValue,n),b,m)}),[T,D,C,K,g,R,s]),j=t.useCallback((function(){g({type:15})}),[g]),U=t.useCallback((function(){g({type:17})}),[g]),W=t.useCallback((function(){g({type:16})}),[g]),$=t.useCallback((function(e){g({type:18,highlightedIndex:e})}),[g]),q=t.useCallback((function(e){g({type:it,selectedItem:e})}),[g]);return{getItemProps:_,getLabelProps:H,getMenuProps:L,getInputProps:N,getToggleButtonProps:F,toggleMenu:j,openMenu:W,closeMenu:U,setHighlightedIndex:$,setInputValue:t.useCallback((function(e){g({type:20,inputValue:e})}),[g]),selectItem:q,reset:t.useCallback((function(){g({type:21})}),[g]),highlightedIndex:m,isOpen:h,selectedItem:I,inputValue:v}}ft.stateChangeTypes=rt;var gt={activeIndex:-1,selectedItems:[]};function ht(e,t){return de(e,t,gt)}function mt(e,t){return ce(e,t,gt)}function It(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}r({},be,{selectedItems:h.array,initialSelectedItems:h.array,defaultSelectedItems:h.array,getA11yRemovalMessage:h.func,activeIndex:h.number,initialActiveIndex:h.number,defaultActiveIndex:h.number,onActiveIndexChange:h.func,onSelectedItemsChange:h.func,keyNavigationNext:h.string,keyNavigationPrevious:h.string});var vt={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"},yt=C,bt=0,xt=1,wt=2,St=3,Ct=4,kt=5,Dt=6,Ot=7,Mt=8,Et=9,Pt=10,Rt=11,Tt=12,Kt=Object.freeze({__proto__:null,SelectedItemClick:bt,SelectedItemKeyDownDelete:xt,SelectedItemKeyDownBackspace:wt,SelectedItemKeyDownNavigationNext:St,SelectedItemKeyDownNavigationPrevious:Ct,DropdownKeyDownNavigationPrevious:kt,DropdownKeyDownBackspace:Dt,DropdownClick:Ot,FunctionAddSelectedItem:Mt,FunctionRemoveSelectedItem:Et,FunctionSetSelectedItems:Pt,FunctionSetActiveIndex:Rt,FunctionReset:Tt});function Ht(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 bt:n={activeIndex:o};break;case Ct:n={activeIndex:l-1<0?0:l-1};break;case St:n={activeIndex:l+1>=a.length?-1:l+1};break;case wt:case xt: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 kt:n={activeIndex:a.length-1};break;case Dt:n={selectedItems:a.slice(0,a.length-1)};break;case Mt:n={selectedItems:[].concat(a,[s])};break;case Ot:n={activeIndex:-1};break;case Et: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 Pt:n={selectedItems:t.selectedItems};break;case Rt:n={activeIndex:t.activeIndex};break;case Tt:n={activeIndex:mt(u,"activeIndex"),selectedItems:mt(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var Vt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],At=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Bt(e){void 0===e&&(e={}),yt();var n=r({},vt,e),i=n.getA11yRemovalMessage,u=n.itemToString,s=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,c=le(Ht,function(e){return{activeIndex:ht(e,"activeIndex"),selectedItems:ht(e,"selectedItems")}}(n),n),d=c[0],p=c[1],f=d.activeIndex,g=d.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=ue({state:d,props:n});t.useEffect((function(){if(!h.current&&null!=s&&s.document){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));U(i({itemToString:u,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),s.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]),ve({isInitialMount:h.current,props:n,state:d});var b=he();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Ct})},e[l]=function(){p({type:St})},e.Delete=function(){p({type:xt})},e.Backspace=function(){p({type:wt})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){It(e)&&p({type:kt})},e.Backspace=function(e){It(e)&&p({type:Dt})},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,Vt),g=y.current.state,h=oe(c,d,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.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:bt,index:h})})),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,g=o(i,At),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,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:Ot})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:Mt,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Et,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Pt,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Rt,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Tt})}),[p]),selectedItems:g,activeIndex:f}}Bt.stateChangeTypes=Kt,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=ft,e.useMultipleSelection=Bt,e.useSelect=We,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map

@@ -20,5 +20,5 @@ import { A11yStatusMessageOptions } from '../../types';

scrollIntoView: typeof import("../../utils").scrollIntoView;
environment: {};
environment: (Window & typeof globalThis) | undefined;
};
export declare let validatePropTypes: (options: unknown, caller: Function) => void;
export {};

@@ -52,3 +52,3 @@ export let useControlPropsValidator: typeof noop;

export { scrollIntoView };
export const environment: {};
export const environment: (Window & typeof globalThis) | undefined;
}

@@ -55,0 +55,0 @@ /**

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

export default setStatus;
/**

@@ -6,2 +5,2 @@ * @param {String} status the status message

*/
declare function setStatus(status: string, documentProp: Object): void;
export default function setStatus(status: string, documentProp: Object): void;

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

import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
{
"name": "downshift",
"version": "8.1.1",
"version": "8.2.0",
"description": "🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.",

@@ -37,3 +37,3 @@ "main": "dist/downshift.cjs.js",

"setup": "npm install && npm run validate",
"validate": "kcd-scripts validate lint,build-and-test,test:cover,test:ts,test:flow:coverage,test:ssr,test:cypress"
"validate": "kcd-scripts validate lint,build-and-test,test:cover,test:ts,test:ssr,test:cypress"
},

@@ -72,31 +72,30 @@ "husky": {

"dependencies": {
"@babel/runtime": "^7.14.8",
"compute-scroll-into-view": "^2.0.4",
"prop-types": "^15.7.2",
"react-is": "^17.0.2",
"tslib": "^2.3.0"
"@babel/runtime": "^7.22.15",
"compute-scroll-into-view": "^3.0.3",
"prop-types": "^15.8.1",
"react-is": "^18.2.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@babel/helpers": "^7.14.8",
"@babel/helpers": "^7.22.15",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@cypress/webpack-preprocessor": "^5.14.0",
"@docusaurus/core": "^2.0.1",
"@docusaurus/module-type-aliases": "^2.0.1",
"@docusaurus/preset-classic": "^2.0.1",
"@mdx-js/react": "^1.6.22",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-typescript": "^8.2.5",
"@testing-library/cypress": "^8.0.0",
"@testing-library/dom": "^8.1.0",
"@testing-library/jest-dom": "^5.14.1",
"@cypress/webpack-preprocessor": "^6.0.0",
"@docusaurus/core": "3.0.0-alpha.0",
"@docusaurus/module-type-aliases": "3.0.0-alpha.0",
"@docusaurus/preset-classic": "3.0.0-alpha.0",
"@mdx-js/react": "^2.3.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-typescript": "^11.1.3",
"@testing-library/cypress": "^10.0.1",
"@testing-library/dom": "^9.3.1",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/preact": "^2.0.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^7.0.1",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^26.0.24",
"@types/react": "^17.0.15",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"@types/jest": "^29.5.4",
"@types/react": "^18.2.21",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"babel-plugin-macros": "^3.1.0",

@@ -106,25 +105,30 @@ "babel-plugin-no-side-effect-class-properties": "0.0.7",

"buble": "^0.20.0",
"cpy-cli": "^3.1.1",
"cpy-cli": "^5.0.0",
"cross-env": "^7.0.3",
"cypress": "10.8.0",
"eslint": "^7.32.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-react": "7.24.0",
"flow-bin": "^0.156.0",
"cypress": "13.2.0",
"eslint": "^8.49.0",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-react": "7.33.2",
"flow-bin": "^0.216.1",
"flow-coverage-report": "^0.8.0",
"get-pkg-repo": "4.1.1",
"kcd-scripts": "^11.2.0",
"node-polyfill-webpack-plugin": "^2.0.0",
"get-pkg-repo": "5.0.0",
"kcd-scripts": "^14.0.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npm-run-all": "^4.1.5",
"preact": "^10.5.14",
"prism-react-renderer": "^1.3.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-native": "^0.68.0",
"react-test-renderer": "^17.0.2",
"serve": "^12.0.0",
"start-server-and-test": "^1.13.1",
"typescript": "^4.3.5"
"preact": "^10.17.1",
"prism-react-renderer": "^2.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "^0.72.4",
"react-test-renderer": "^18.2.0",
"serve": "^14.2.1",
"start-server-and-test": "^2.0.0",
"typescript": "^5.2.2"
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 2023,
"project": "./tsconfig.json",
"sourceType": "module"
},
"settings": {

@@ -131,0 +135,0 @@ "import/no-unresolved": [

@@ -1,3 +0,4 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","preact","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.preact,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=60103,p=60106,f=60107,g=60108,h=60114,m=60109,I=60110,v=60112,y=60113,b=60120,x=60115,w=60116,S=60121,C=60122,k=60117,D=60129,O=60131;
/** @license React v17.0.2
!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 React
* react-is.production.min.js

@@ -9,3 +10,3 @@ *

* LICENSE file in the root directory of this source tree.
*/if("function"==typeof Symbol&&Symbol.for){var M=Symbol.for;c=M("react.element"),p=M("react.portal"),f=M("react.fragment"),g=M("react.strict_mode"),h=M("react.profiler"),m=M("react.provider"),I=M("react.context"),v=M("react.forward_ref"),y=M("react.suspense"),b=M("react.suspense_list"),x=M("react.memo"),w=M("react.lazy"),S=M("react.block"),C=M("react.server.block"),k=M("react.fundamental"),D=M("react.debug_trace_mode"),O=M("react.legacy_hidden")}function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case c:switch(e=e.type){case f:case h:case g:case y:case b:return e;default:switch(e=e&&e.$$typeof){case I:case v:case w:case x:case m:return e;default:return t}}case p:return t}}}var P=m,K=c,R=v,T=f,H=w,V=x,A=p,B=h,L=g,F=y;d.ContextConsumer=I,d.ContextProvider=P,d.Element=K,d.ForwardRef=R,d.Fragment=T,d.Lazy=H,d.Memo=V,d.Portal=A,d.Profiler=B,d.StrictMode=L,d.Suspense=F,d.isAsyncMode=function(){return!1},d.isConcurrentMode=function(){return!1},d.isContextConsumer=function(e){return E(e)===I},d.isContextProvider=function(e){return E(e)===m},d.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===c},d.isForwardRef=function(e){return E(e)===v},d.isFragment=function(e){return E(e)===f},d.isLazy=function(e){return E(e)===w},d.isMemo=function(e){return E(e)===x},d.isPortal=function(e){return E(e)===p},d.isProfiler=function(e){return E(e)===h},d.isStrictMode=function(e){return E(e)===g},d.isSuspense=function(e){return E(e)===y},d.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===f||e===h||e===D||e===g||e===y||e===b||e===O||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===x||e.$$typeof===m||e.$$typeof===I||e.$$typeof===v||e.$$typeof===k||e.$$typeof===S||e[0]===C)},d.typeOf=E;let _=e=>"object"==typeof e&&null!=e&&1===e.nodeType,N=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,j=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return N(n.overflowY,t)||N(n.overflowX,t)||(e=>{let 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},U=(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,$=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var W=0;function q(e){return"function"==typeof e?e:z}function z(){}function X(e,t){if(e){var n=((e,t)=>{var n,i,o,r,u,s;if("undefined"==typeof document)return[];let{scrollMode:l,block:a,inline:d,boundary:c,skipOverflowHiddenElements:p}=t,f="function"==typeof c?c:e=>e!==c;if(!_(e))throw new TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,h=[],m=e;for(;_(m)&&f(m);){if(m=$(m),m===g){h.push(m);break}null!=m&&m===document.body&&j(m)&&!j(document.documentElement)||null!=m&&j(m,p)&&h.push(m)}let I=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,v=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,b=null!=(s=window.scrollY)?s:pageYOffset,{height:x,width:w,top:S,right:C,bottom:k,left:D}=e.getBoundingClientRect(),O="start"===a||"nearest"===a?S:"end"===a?k:S+x/2,M="center"===d?D+w/2:"end"===d?C:D,E=[];for(let e=0;e<h.length;e++){let t=h[e],{height:n,width:i,top:o,right:r,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&D>=0&&k<=v&&C<=I&&S>=o&&k<=u&&D>=s&&C<=r)return E;let c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),f=parseInt(c.borderTopWidth,10),m=parseInt(c.borderRightWidth,10),P=parseInt(c.borderBottomWidth,10),K=0,R=0,T="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-P:0,V="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)K="start"===a?O:"end"===a?O-v:"nearest"===a?U(b,b+v,v,f,P,b+O,b+O+x,x):O-v/2,R="start"===d?M:"center"===d?M-I/2:"end"===d?M-I:U(y,y+I,I,p,m,y+M,y+M+w,w),K=Math.max(0,K+b),R=Math.max(0,R+y);else{K="start"===a?O-o-f:"end"===a?O-u+P+H:"nearest"===a?U(o,u,n,f,P+H,O,O+x,x):O-(o+n/2)+H/2,R="start"===d?M-s-p:"center"===d?M-(s+i/2)+T/2:"end"===d?M-r+m+T:U(s,r,i,p,m+T,M,M+w,w);let{scrollLeft:e,scrollTop:l}=t;K=Math.max(0,Math.min(l+K/A,t.scrollHeight-n/A+H)),R=Math.max(0,Math.min(e+R/V,t.scrollWidth-i/V+T)),O+=l-K,M+=e-R}E.push({el:t,top:K,left:R})}return E})(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 Y(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function G(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 J(){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 Q(){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 Z(){return String(W++)}function ee(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 te(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var ne=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function ie(e){void 0===e&&(e={});var t={};return ne.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function oe(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=re(t,i)?t[i]:e[i],n}),{})}function re(e,t){return void 0!==e[t]}function ue(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function se(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=le(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function le(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?le(t?r-1:0,t,n,i):-1}function ae(e,t,n,i){return void 0===i&&(i=!0),t.some((function(t){return t&&(Y(t,e,n)||i&&Y(t,n.document.activeElement,n))}))}var de=G((function(e){pe(e).textContent=""}),500);function ce(e,t){var n=pe(t);e&&(n.textContent=e,de(t))}function pe(e){void 0===e&&(e=document);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)}var fe=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}),ge=["refKey","ref"],he=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],me=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Ie=["refKey","ref"],ve=["onMouseMove","onMouseDown","onClick","onPress","index","item"],ye=function(){var e=function(e){var n,i;function o(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+Z(),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.input=null,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=ie(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=ie(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){t=n.getState(t);var l=u?e(t):e;l=n.props.stateReducer(t,l),i=l.hasOwnProperty("selectedItem");var a={};return i&&l.selectedItem!==t.selectedItem&&(o=l.selectedItem),l.type=l.type||0,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(r[e]=l[e]),"type"!==e&&(l[e],re(n.props,e)||(a[e]=l[e]))})),u&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,s({},n.getStateAndHelpers(),l)),a}),(function(){q(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,ge),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]=Q(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=se(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=se(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=le(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=le(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,he),d=n.getState().isOpen,c={onClick:J(i,n.buttonHandleClick),onKeyDown:J(o,n.buttonHandleKeyDown),onKeyUp:J(r,n.buttonHandleKeyUp),onBlur:J(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=ue(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(l(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===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,me),d={};var c,p=n.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((c={}).onInput=J(r,l,n.inputHandleChange),c.onKeyDown=J(i,n.inputHandleKeyDown),c.onBlur=J(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=ue(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=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||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,Ie),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]=Q(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,ve);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,g=((t={onMouseMove:J(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:J(r,(function(e){e.preventDefault()}))}).onClick=J(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=ie(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=ie(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),q(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=G((function(){var e=n.getState(),t=n.items[e.highlightedIndex],i=n.getItemCount(),o=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:i,highlightedItem:t},e));n.previousResultCount=i,ce(o,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),oe(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.document.getElementById(this.getItemId(e))},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=se(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,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!ae(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=ae(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)}},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){re(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=te(this.props.children,z);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=te(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:ee,itemToString:function(e){return null==e?"":String(e)},onStateChange:z,onInputValueChange:z,onUserAction:z,onChange:z,onSelect:z,onOuterClick:z,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:X},e.stateChangeTypes=fe,e}(),be=ye,xe=["isInitialMount","highlightedIndex","items","environment"],we={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Se(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"+Me(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 Ce=G((function(e,t){ce(e(),t)}),200),ke="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,De="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-"+Z():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 Me(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Ee(e){var n=t.useRef(e);return n.current=e,n}function Pe(e,n,i){var o=t.useRef(),r=t.useRef(),u=t.useCallback((function(t,n){r.current=n,t=oe(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),l=t.useReducer(u,n),a=l[0],d=l[1],c=Ee(i),p=t.useCallback((function(e){return d(s({props:c.current},e))}),[c]),f=r.current;return t.useEffect((function(){f&&o.current&&o.current!==a&&Se(f,oe(o.current,f.props),a),o.current=a}),[a,i,f]),[a,p]}function Ke(e,t,n){var i=Pe(e,t,n),o=i[0],r=i[1];return[oe(o,n),r]}var Re={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:X,environment:"undefined"==typeof window?{}:window};function Te(e,t,n){void 0===n&&(n=we);var i=e["default"+Me(t)];return void 0!==i?i:n[t]}function He(e,t,n){void 0===n&&(n=we);var i=e[t];if(void 0!==i)return i;var o=e["initial"+Me(t)];return void 0!==o?o:Te(e,t,n)}function Ve(e){var t=He(e,"selectedItem"),n=He(e,"isOpen"),i=He(e,"highlightedIndex"),o=He(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function Ae(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 Be(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==i?void 0:i.addEventListener)){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!ae(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||ae(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 Le=function(){return z};function Fe(e,n,i){var o=i.isInitialMount,r=i.highlightedIndex,l=i.items,a=i.environment,d=u(i,xe);t.useEffect((function(){o||Ce((function(){return e(s({highlightedIndex:r,highlightedItem:l[r],resultCount:l.length},d))}),a.document)}),n)}function _e(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 ke((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var Ne=z;function je(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:Te(e,"isOpen"),highlightedIndex:Te(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}var Ue={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},$e=s({},Ue,{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 We(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:Ae(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:Ae(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:Te(r,"highlightedIndex"),isOpen:Te(r,"isOpen"),selectedItem:Te(r,"selectedItem"),inputValue:Te(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,i)}var qe=function(){return qe=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},qe.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,qe(qe({},$e),{items:r.default.array.isRequired,isItemDisabled:r.default.func,getA11ySelectionMessage:r.default.func});var ze=qe(qe({},Re),{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=z,Ye=1,Ge=2,Je=3,Qe=4,Ze=5,et=6,tt=7,nt=8,it=9,ot=10,rt=11,ut=14,st=19,lt=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Ye,ToggleButtonKeyDownArrowUp:Ge,ToggleButtonKeyDownCharacter:Je,ToggleButtonKeyDownEscape:Qe,ToggleButtonKeyDownHome:Ze,ToggleButtonKeyDownEnd:et,ToggleButtonKeyDownEnter:tt,ToggleButtonKeyDownSpaceButton:nt,ToggleButtonKeyDownPageUp:it,ToggleButtonKeyDownPageDown:ot,ToggleButtonBlur:rt,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:ut,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:st,FunctionSetInputValue:20,FunctionReset:21});function at(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case ut:i={isOpen:Te(r,"isOpen"),highlightedIndex:Te(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Je: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 Ye:i={highlightedIndex:e.isOpen?se(e.highlightedIndex,1,r.items,r.isItemDisabled):u&&null==e.selectedItem?-1:Ae(r,e,1),isOpen:!0};break;case Ge:if(e.isOpen&&u)i=je(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?se(e.highlightedIndex,-1,r.items,r.isItemDisabled):Ae(r,e,-1),isOpen:!0};break;case tt:case nt:i=je(r,e.highlightedIndex,!1);break;case Ze:i={highlightedIndex:le(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case et:i={highlightedIndex:le(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case it:i={highlightedIndex:se(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case ot:i={highlightedIndex:se(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case Qe:i={isOpen:!1,highlightedIndex:-1};break;case rt:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case st:i={selectedItem:t.selectedItem};break;default:return We(e,t,lt)}return s({},e,i)}var dt=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],ct=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],pt=["item","index","onMouseMove","onClick","onPress","refKey","disabled","ref"];function ft(e){void 0===e&&(e={}),Xe();var n=s({},ze,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=Ke(at,Ve(n),n),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),w=De(n),S=t.useRef(),C=t.useRef(!0),k=Ee({state:p,props:n}),D=t.useCallback((function(e){return b.current[w.getItemId(e)]}),[w]);Fe(d,[g,h,I,i],s({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:r,itemToString:l},p)),Fe(a,[m],s({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:r,itemToString:l},p));var O=_e({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:b,scrollIntoView:o,getItemNodeFromIndex:D});t.useEffect((function(){return x.current=G((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),Ne({isInitialMount:C.current,props:n,state:p}),t.useEffect((function(){C.current||(S.current=i.length)})),t.useEffect((function(){He(n,"isOpen")&&v.current&&v.current.focus()}),[]);var M=Be(g,[y,v],r,(function(){f({type:rt})})),E=Le();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var P=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:Ye,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Ge,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Ze})},End:function(e){e.preventDefault(),f({type:et})},Escape:function(){k.current.state.isOpen&&f({type:Qe})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?tt:0})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:it}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:ot}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Je,key:" "}):f({type:nt}):f({type:0})}}}),[f,k]),K=t.useCallback((function(){f({type:15})}),[f]),R=t.useCallback((function(){f({type:17})}),[f]),T=t.useCallback((function(){f({type:16})}),[f]),H=t.useCallback((function(e){f({type:18,highlightedIndex:e})}),[f]),V=t.useCallback((function(e){f({type:st,selectedItem:e})}),[f]),A=t.useCallback((function(){f({type:21})}),[f]),B=t.useCallback((function(e){f({type:20,inputValue:e})}),[f]),L=t.useCallback((function(e){return s({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r;i.onKeyDown,i.onBlur;var a=i.ref,d=u(i,dt),c=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==c&&c,l,y),s(((n={})[l]=Q(a,(function(e){y.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+w.labelId,n.onMouseLeave=J(o,(function(){f({type:12})})),n),d)}),[f,E,w]);return{getToggleButtonProps: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,ct),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.current.state,I=s(((n={})[d]=Q(c,(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=J(o,(function(){m.isOpen&&!M.current.isMouseDown&&f({type:rt})})),n),p);return p.disabled||(I.onClick=J(r,(function(){f({type:0})})),I.onKeyDown=J(l,(function(e){var t=ue(e);t&&P[t]?P[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Je,key:t})}))),E("getToggleButtonProps",h,d,v),I}),[k,w,E,f,M,P]),getLabelProps:L,getMenuProps:F,getItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick;n.onPress;var a=n.refKey,d=void 0===a?"ref":a,c=n.disabled,p=n.ref,g=u(n,pt);void 0!==c&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var h=k.current,m=h.state,I=h.props,v=Oe(i,o,I.items,"Pass either item or index to getItemProps!"),y=v[0],x=v[1],S=I.isItemDisabled(y,x),C=s(((t={})[d]=Q(p,(function(e){e&&(b.current[w.getItemId(x)]=e)})),t["aria-disabled"]=S,t["aria-selected"]=""+(y===m.selectedItem),t.id=w.getItemId(x),t.role="option",t),g);return S||(C.onClick=J(l,(function(){f({type:ut,index:x})}))),C.onMouseMove=J(r,(function(){x!==m.highlightedIndex&&(O.current=!1,f({type:13,index:x,disabled:S}))})),C}),[k,w,O,f]),toggleMenu:K,openMenu:T,closeMenu:R,setHighlightedIndex:H,selectItem:V,reset:A,setInputValue:B,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}ft.stateChangeTypes=lt;var gt=0,ht=1,mt=2,It=3,vt=4,yt=5,bt=6,xt=7,wt=8,St=9,Ct=10,kt=13,Dt=19,Ot=22,Mt=Object.freeze({__proto__:null,InputKeyDownArrowDown:gt,InputKeyDownArrowUp:ht,InputKeyDownEscape:mt,InputKeyDownHome:It,InputKeyDownEnd:vt,InputKeyDownPageUp:yt,InputKeyDownPageDown:bt,InputKeyDownEnter:xt,InputChange:wt,InputBlur:St,InputClick:Ct,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:kt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Dt,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:Ot});s({},$e,{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 Et=z,Pt=s({},Re,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:ee,isItemDisabled:function(){return!1}});function Kt(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case kt:i={isOpen:Te(r,"isOpen"),highlightedIndex:Te(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case gt:i=e.isOpen?{highlightedIndex:se(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:Ae(r,e,1),isOpen:r.items.length>=0};break;case ht:i=e.isOpen?u?je(r,e.highlightedIndex):{highlightedIndex:se(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:Ae(r,e,-1),isOpen:r.items.length>=0};break;case xt:i=je(r,e.highlightedIndex);break;case mt:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case yt:i={highlightedIndex:se(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case bt:i={highlightedIndex:se(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case It:i={highlightedIndex:le(0,!1,r.items,r.isItemDisabled)};break;case vt:i={highlightedIndex:le(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case St: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 wt:i={isOpen:!0,highlightedIndex:Te(r,"highlightedIndex"),inputValue:t.inputValue};break;case Ct:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ae(r,e,0)};break;case Dt:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Ot:i={inputValue:t.inputValue};break;default:return We(e,t,Mt)}return s({},e,i)}var Rt=["onMouseLeave","refKey","ref"],Tt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Ht=["onClick","onPress","refKey","ref"],Vt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function At(e){void 0===e&&(e={}),Et();var n=s({},Pt,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,d=n.itemToString,c=function(e){var t=Ve(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})}(n),p=function(e,n,i){var o=t.useRef(),r=Pe(e,n,i),u=r[0],s=r[1];return t.useEffect((function(){re(i,"selectedItem")&&(i.selectedItemChanged(o.current,i.selectedItem)&&s({type:Ot,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[u.selectedItem,i.selectedItem]),[oe(u,i),s]}(Kt,c,n),f=p[0],g=p[1],h=f.isOpen,m=f.highlightedIndex,I=f.selectedItem,v=f.inputValue,y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),w=t.useRef(null),S=t.useRef(!0),C=De(n),k=t.useRef(),D=Ee({state:f,props:n}),O=t.useCallback((function(e){return b.current[C.getItemId(e)]}),[C]);Fe(l,[h,m,v,i],s({isInitialMount:S.current,previousResultCount:k.current,items:i,environment:r,itemToString:d},f)),Fe(a,[I],s({isInitialMount:S.current,previousResultCount:k.current,items:i,environment:r,itemToString:d},f));var M=_e({menuElement:y.current,highlightedIndex:m,isOpen:h,itemRefs:b,scrollIntoView:o,getItemNodeFromIndex:O});Ne({isInitialMount:S.current,props:n,state:f}),t.useEffect((function(){He(n,"isOpen")&&x.current&&x.current.focus()}),[]),t.useEffect((function(){S.current||(k.current=i.length)}));var E=Be(h,[x,y,w],r,(function(){g({type:St,selectItem:!1})})),P=Le();t.useEffect((function(){return S.current=!1,function(){S.current=!0}}),[]),t.useEffect((function(){var e;if(h){if((null==(e=r.document)?void 0:e.activeElement)!==x.current){var t;null==x||null==(t=x.current)||t.focus()}}else b.current={}}),[h,r]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:gt,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),g({type:ht,altKey:e.altKey})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:It}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:vt}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),g({type:mt}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),g({type:xt}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:yt}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),g({type:bt}))}}}),[g,D]),R=t.useCallback((function(e){return s({id:C.labelId,htmlFor:C.inputId},e)}),[C]),T=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,Rt),c=(void 0===t?{}:t).suppressRefError;return P("getMenuProps",void 0!==c&&c,l,y),s(((n={})[l]=Q(a,(function(e){y.current=e})),n.id=C.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+C.labelId,n.onMouseLeave=J(o,(function(){g({type:11})})),n),d)}),[g,P,C]),H=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,f=i.onClick;i.onPress;var h=i.disabled,m=u(i,Tt);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=D.current,v=I.props,y=I.state,x=Oe(o,r,v.items,"Pass either item or index to getItemProps!"),w=x[0],S=x[1],k=v.isItemDisabled(w,S),O=f;return s(((t={})[a]=Q(d,(function(e){e&&(b.current[C.getItemId(S)]=e)})),t["aria-disabled"]=k,t["aria-selected"]=""+(S===y.highlightedIndex),t.id=C.getItemId(S),t.role="option",t),!k&&((n={}).onClick=J(O,(function(){g({type:kt,index:S})})),n),{onMouseMove:J(c,(function(){S!==y.highlightedIndex&&(M.current=!1,g({type:12,index:S,disabled:k}))})),onMouseDown:J(p,(function(e){return e.preventDefault()}))},m)}),[g,D,M,C]),V=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,Ht),d=D.current.state;return s(((t={})[r]=Q(l,(function(e){w.current=e})),t["aria-controls"]=C.menuId,t["aria-expanded"]=d.isOpen,t.id=C.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:J(i,(function(){g({type:14})}))}),a)}),[g,D,C]),A=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,f=void 0===p?"ref":p,h=i.ref,m=u(i,Vt),I=(void 0===t?{}:t).suppressRefError;P("getInputProps",void 0!==I&&I,f,x);var v,y=D.current.state,b={};m.disabled||((v={}).onInput=J(l,a,(function(e){g({type:wt,inputValue:e.target.value})})),v.onKeyDown=J(o,(function(e){var t=ue(e);t&&K[t]&&K[t](e)})),v.onBlur=J(d,(function(e){if(y.isOpen&&!E.current.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;g({type:St,selectItem:!t})}})),v.onClick=J(c,(function(){g({type:Ct})})),b=v);return s(((n={})[f]=Q(h,(function(e){x.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?C.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=C.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:C.labelId,n.autoComplete="off",n.id=C.inputId,n.role="combobox",n.value=y.inputValue,n),b,m)}),[P,D,C,K,g,E,r]),B=t.useCallback((function(){g({type:15})}),[g]),L=t.useCallback((function(){g({type:17})}),[g]),F=t.useCallback((function(){g({type:16})}),[g]),_=t.useCallback((function(e){g({type:18,highlightedIndex:e})}),[g]),N=t.useCallback((function(e){g({type:Dt,selectedItem:e})}),[g]);return{getItemProps:H,getLabelProps:R,getMenuProps:T,getInputProps:A,getToggleButtonProps:V,toggleMenu:B,openMenu:F,closeMenu:L,setHighlightedIndex:_,setInputValue:t.useCallback((function(e){g({type:20,inputValue:e})}),[g]),selectItem:N,reset:t.useCallback((function(){g({type:21})}),[g]),highlightedIndex:m,isOpen:h,selectedItem:I,inputValue:v}}At.stateChangeTypes=Mt;var Bt={activeIndex:-1,selectedItems:[]};function Lt(e,t){return He(e,t,Bt)}function Ft(e,t){return Te(e,t,Bt)}function _t(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}s({},Ue,{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 Nt={itemToString:Re.itemToString,stateReducer:Re.stateReducer,environment:Re.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},jt=z,Ut=0,$t=1,Wt=2,qt=3,zt=4,Xt=5,Yt=6,Gt=7,Jt=8,Qt=9,Zt=10,en=11,tn=12,nn=Object.freeze({__proto__:null,SelectedItemClick:Ut,SelectedItemKeyDownDelete:$t,SelectedItemKeyDownBackspace:Wt,SelectedItemKeyDownNavigationNext:qt,SelectedItemKeyDownNavigationPrevious:zt,DropdownKeyDownNavigationPrevious:Xt,DropdownKeyDownBackspace:Yt,DropdownClick:Gt,FunctionAddSelectedItem:Jt,FunctionRemoveSelectedItem:Qt,FunctionSetSelectedItems:Zt,FunctionSetActiveIndex:en,FunctionReset:tn});function on(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 Ut:n={activeIndex:o};break;case zt:n={activeIndex:l-1<0?0:l-1};break;case qt:n={activeIndex:l+1>=a.length?-1:l+1};break;case Wt:case $t: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 Xt:n={activeIndex:a.length-1};break;case Yt:n={selectedItems:a.slice(0,a.length-1)};break;case Jt:n={selectedItems:[].concat(a,[u])};break;case Gt:n={activeIndex:-1};break;case Qt: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 Zt:n={selectedItems:t.selectedItems};break;case en:n={activeIndex:t.activeIndex};break;case tn: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 rn=["refKey","ref","onClick","onKeyDown","selectedItem","index"],un=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function sn(e){void 0===e&&(e={}),jt();var n=s({},Nt,e),i=n.getA11yRemovalMessage,o=n.itemToString,r=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=Ke(on,function(e){return{activeIndex:Lt(e,"activeIndex"),selectedItems:Lt(e,"selectedItems")}}(n),n),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=Ee({state:c,props:n});t.useEffect((function(){if(!h.current){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));ce(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]),Ne({isInitialMount:h.current,props:n,state:c});var b=Le();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:zt})},e[l]=function(){p({type:qt})},e.Delete=function(){p({type:$t})},e.Backspace=function(){p({type:Wt})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){_t(e)&&p({type:Xt})},e.Backspace=function(e){_t(e)&&p({type:Yt})},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,rn),g=y.current.state,h=Oe(d,c,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.activeIndex;return s(((t={})[o]=Q(r,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=J(l,(function(){p({type:Ut,index:h})})),t.onKeyDown=J(a,(function(e){var t=ue(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,un),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,r,m),s(((n={})[r]=Q(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:J(a,(function(e){var t=ue(e);t&&w[t]&&w[t](e)})),onClick:J(d,(function(){p({type:Gt})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:Jt,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Qt,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Zt,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:en,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:tn})}),[p]),selectedItems:g,activeIndex:f}}sn.stateChangeTypes=nn,e.default=be,e.resetIdCounter=function(){"useId"in o.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):W=0},e.useCombobox=At,e.useMultipleSelection=sn,e.useSelect=ft,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){var o=t.useRef(),r=t.useRef(),u=t.useCallback((function(t,n){r.current=n,t=P(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),l=t.useReducer(u,n),a=l[0],d=l[1],c=te(i),p=t.useCallback((function(e){return d(s({props:c.current},e))}),[c]),f=r.current;return t.useEffect((function(){f&&o.current&&o.current!==a&&Y(f,P(o.current,f.props),a),o.current=a}),[a,i,f]),[a,p]}function ie(e,t,n){var i=ne(e,t,n),o=i[0],r=i[1];return[P(o,n),r]}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])}))}var he={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},me=s({},he,{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 Ie(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 ve=function(){return ve=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},ve.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,ve(ve({},me),{items:r.default.array.isRequired,isItemDisabled:r.default.func,getA11ySelectionMessage:r.default.func});var ye=ve(ve({},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}}),be=y,xe=1,we=2,Se=3,Ce=4,ke=5,De=6,Oe=7,Me=8,Ee=9,Pe=10,Re=11,Ke=14,Te=19,He=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:xe,ToggleButtonKeyDownArrowUp:we,ToggleButtonKeyDownCharacter:Se,ToggleButtonKeyDownEscape:Ce,ToggleButtonKeyDownHome:ke,ToggleButtonKeyDownEnd:De,ToggleButtonKeyDownEnter:Oe,ToggleButtonKeyDownSpaceButton:Me,ToggleButtonKeyDownPageUp:Ee,ToggleButtonKeyDownPageDown:Pe,ToggleButtonBlur:Re,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Ke,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Te,FunctionSetInputValue:20,FunctionReset:21});function Ve(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Ke:i={isOpen:re(r,"isOpen"),highlightedIndex:re(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Se: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 xe: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 we: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 Oe:case Me:i=ge(r,e.highlightedIndex,!1);break;case ke:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case De:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Ee:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Pe:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case Ce:i={isOpen:!1,highlightedIndex:-1};break;case Re:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case Te:i={selectedItem:t.selectedItem};break;default:return Ie(e,t,He)}return s({},e,i)}var Ae=["onMouseLeave","refKey","ref"],Be=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Le=["item","index","onMouseMove","onClick","onPress","refKey","disabled","ref"];function Fe(e){void 0===e&&(e={}),be();var n=s({},ye,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=ie(Ve,se(n),n),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:Re})})),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:xe,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:we,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:ke})},End:function(e){e.preventDefault(),f({type:De})},Escape:function(){M.current.state.isOpen&&f({type:Ce})},Enter:function(e){e.preventDefault(),f({type:M.current.state.isOpen?Oe:0})},PageUp:function(e){M.current.state.isOpen&&(e.preventDefault(),f({type:Ee}))},PageDown:function(e){M.current.state.isOpen&&(e.preventDefault(),f({type:Pe}))}," ":function(e){e.preventDefault();var t=M.current.state;t.isOpen?t.inputValue?f({type:Se,key:" "}):f({type:Me}):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:Te,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,Ae),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]);return{getToggleButtonProps: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,Be),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:Re})})),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:Se,key:t})}))),T("getToggleButtonProps",h,d,v),I}),[M,k,T,f,R,H]),getLabelProps:j,getMenuProps:U,getItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick;n.onPress;var a=n.refKey,d=void 0===a?"ref":a,c=n.disabled,p=n.ref,g=u(n,Le);void 0!==c&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var h=M.current,m=h.state,I=h.props,v=Z(i,o,I.items,"Pass either item or index to getItemProps!"),y=v[0],x=v[1],w=I.isItemDisabled(y,x),D=s(((t={})[d]=C(p,(function(e){e&&(b.current[k.getItemId(x)]=e)})),t["aria-disabled"]=w,t["aria-selected"]=""+(y===m.selectedItem),t.id=k.getItemId(x),t.role="option",t),g);return w||(D.onClick=S(l,(function(){f({type:Ke,index:x})}))),D.onMouseMove=S(r,(function(){x!==m.highlightedIndex&&(P.current=!1,f({type:13,index:x,disabled:w}))})),D}),[M,k,P,f]),toggleMenu:V,openMenu:B,closeMenu:A,setHighlightedIndex:L,selectItem:F,reset:N,setInputValue:_,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}Fe.stateChangeTypes=He;var Ne=0,_e=1,je=2,Ue=3,$e=4,We=5,qe=6,ze=7,Xe=8,Ye=9,Ge=10,Je=13,Qe=19,Ze=22,et=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ne,InputKeyDownArrowUp:_e,InputKeyDownEscape:je,InputKeyDownHome:Ue,InputKeyDownEnd:$e,InputKeyDownPageUp:We,InputKeyDownPageDown:qe,InputKeyDownEnter:ze,InputChange:Xe,InputBlur:Ye,InputClick:Ge,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Je,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Qe,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:Ze});s({},me,{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 tt=y,nt=s({},oe,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:D,isItemDisabled:function(){return!1}});function it(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Je:i={isOpen:re(r,"isOpen"),highlightedIndex:re(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case Ne: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 _e: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 ze:i=ge(r,e.highlightedIndex);break;case je:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case We:i={highlightedIndex:T(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case qe:i={highlightedIndex:T(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case Ue:i={highlightedIndex:H(0,!1,r.items,r.isItemDisabled)};break;case $e:i={highlightedIndex:H(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Ye: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 Xe:i={isOpen:!0,highlightedIndex:re(r,"highlightedIndex"),inputValue:t.inputValue};break;case Ge:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(r,e,0)};break;case Qe:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Ze:i={inputValue:t.inputValue};break;default:return Ie(e,t,et)}return s({},e,i)}var ot=["onMouseLeave","refKey","ref"],rt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],ut=["onClick","onPress","refKey","ref"],st=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function lt(e){void 0===e&&(e={}),tt();var n=s({},nt,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=n.getA11ySelectionMessage,d=n.itemToString,c=function(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})}(n),p=function(e,n,i){var o=t.useRef(),r=ne(e,n,i),u=r[0],s=r[1];return t.useEffect((function(){R(i,"selectedItem")&&(i.selectedItemChanged(o.current,i.selectedItem)&&s({type:Ze,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[u.selectedItem,i.selectedItem]),[P(u,i),s]}(it,c,n),f=p[0],g=p[1],h=f.isOpen,m=f.highlightedIndex,I=f.selectedItem,v=f.inputValue,y=t.useRef(null),b=t.useRef({}),x=t.useRef(null),w=t.useRef(null),k=t.useRef(!0),D=Q(n),O=t.useRef(),M=te({state:f,props:n}),E=t.useCallback((function(e){return b.current[D.getItemId(e)]}),[D]);ce(l,[h,m,v,i],s({isInitialMount:k.current,previousResultCount:O.current,items:i,environment:r,itemToString:d},f)),ce(a,[I],s({isInitialMount:k.current,previousResultCount:O.current,items:i,environment:r,itemToString:d},f));var T=pe({menuElement:y.current,highlightedIndex:m,isOpen:h,itemRefs:b,scrollIntoView:o,getItemNodeFromIndex:E});fe({isInitialMount:k.current,props:n,state:f}),t.useEffect((function(){ue(n,"isOpen")&&x.current&&x.current.focus()}),[]),t.useEffect((function(){k.current||(O.current=i.length)}));var H=ae(h,[x,y,w],r,(function(){g({type:Ye,selectItem:!1})})),V=de();t.useEffect((function(){return k.current=!1,function(){k.current=!0}}),[]),t.useEffect((function(){h||(b.current={})}),[h]),t.useEffect((function(){var e;h&&null!=r&&r.document&&null!=x&&null!=(e=x.current)&&e.focus&&r.document.activeElement!==x.current&&x.current.focus()}),[h,r]);var A=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:Ne,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),g({type:_e,altKey:e.altKey})},Home:function(e){M.current.state.isOpen&&(e.preventDefault(),g({type:Ue}))},End:function(e){M.current.state.isOpen&&(e.preventDefault(),g({type:$e}))},Escape:function(e){var t=M.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),g({type:je}))},Enter:function(e){M.current.state.isOpen&&229!==e.which&&(e.preventDefault(),g({type:ze}))},PageUp:function(e){M.current.state.isOpen&&(e.preventDefault(),g({type:We}))},PageDown:function(e){M.current.state.isOpen&&(e.preventDefault(),g({type:qe}))}}}),[g,M]),B=t.useCallback((function(e){return s({id:D.labelId,htmlFor:D.inputId},e)}),[D]),L=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,ot),c=(void 0===t?{}:t).suppressRefError;return V("getMenuProps",void 0!==c&&c,l,y),s(((n={})[l]=C(a,(function(e){y.current=e})),n.id=D.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+D.labelId,n.onMouseLeave=S(o,(function(){g({type:11})})),n),d)}),[g,V,D]),F=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,f=i.onClick;i.onPress;var h=i.disabled,m=u(i,rt);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=M.current,v=I.props,y=I.state,x=Z(o,r,v.items,"Pass either item or index to getItemProps!"),w=x[0],k=x[1],O=v.isItemDisabled(w,k),E=f;return s(((t={})[a]=C(d,(function(e){e&&(b.current[D.getItemId(k)]=e)})),t["aria-disabled"]=O,t["aria-selected"]=""+(k===y.highlightedIndex),t.id=D.getItemId(k),t.role="option",t),!O&&((n={}).onClick=S(E,(function(){g({type:Je,index:k})})),n),{onMouseMove:S(c,(function(){k!==y.highlightedIndex&&(T.current=!1,g({type:12,index:k,disabled:O}))})),onMouseDown:S(p,(function(e){return e.preventDefault()}))},m)}),[g,M,T,D]),N=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,ut),d=M.current.state;return s(((t={})[r]=C(l,(function(e){w.current=e})),t["aria-controls"]=D.menuId,t["aria-expanded"]=d.isOpen,t.id=D.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:S(i,(function(){g({type:14})}))}),a)}),[g,M,D]),_=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,f=void 0===p?"ref":p,h=i.ref,m=u(i,st),I=(void 0===t?{}:t).suppressRefError;V("getInputProps",void 0!==I&&I,f,x);var v,y=M.current.state,b={};m.disabled||((v={}).onInput=S(l,a,(function(e){g({type:Xe,inputValue:e.target.value})})),v.onKeyDown=S(o,(function(e){var t=K(e);t&&A[t]&&A[t](e)})),v.onBlur=S(d,(function(e){if(null!=r&&r.document&&y.isOpen&&!H.current.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;g({type:Ye,selectItem:!t})}})),v.onClick=S(c,(function(){g({type:Ge})})),b=v);return s(((n={})[f]=C(h,(function(e){x.current=e})),n["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?D.getItemId(y.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=D.menuId,n["aria-expanded"]=y.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:D.labelId,n.autoComplete="off",n.id=D.inputId,n.role="combobox",n.value=y.inputValue,n),b,m)}),[V,M,D,A,g,H,r]),j=t.useCallback((function(){g({type:15})}),[g]),U=t.useCallback((function(){g({type:17})}),[g]),$=t.useCallback((function(){g({type:16})}),[g]),W=t.useCallback((function(e){g({type:18,highlightedIndex:e})}),[g]),q=t.useCallback((function(e){g({type:Qe,selectedItem:e})}),[g]);return{getItemProps:F,getLabelProps:B,getMenuProps:L,getInputProps:_,getToggleButtonProps:N,toggleMenu:j,openMenu:$,closeMenu:U,setHighlightedIndex:W,setInputValue:t.useCallback((function(e){g({type:20,inputValue:e})}),[g]),selectItem:q,reset:t.useCallback((function(){g({type:21})}),[g]),highlightedIndex:m,isOpen:h,selectedItem:I,inputValue:v}}lt.stateChangeTypes=et;var at={activeIndex:-1,selectedItems:[]};function dt(e,t){return ue(e,t,at)}function ct(e,t){return re(e,t,at)}function pt(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}s({},he,{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 ft={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"},gt=y,ht=0,mt=1,It=2,vt=3,yt=4,bt=5,xt=6,wt=7,St=8,Ct=9,kt=10,Dt=11,Ot=12,Mt=Object.freeze({__proto__:null,SelectedItemClick:ht,SelectedItemKeyDownDelete:mt,SelectedItemKeyDownBackspace:It,SelectedItemKeyDownNavigationNext:vt,SelectedItemKeyDownNavigationPrevious:yt,DropdownKeyDownNavigationPrevious:bt,DropdownKeyDownBackspace:xt,DropdownClick:wt,FunctionAddSelectedItem:St,FunctionRemoveSelectedItem:Ct,FunctionSetSelectedItems:kt,FunctionSetActiveIndex:Dt,FunctionReset:Ot});function Et(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 ht:n={activeIndex:o};break;case yt:n={activeIndex:l-1<0?0:l-1};break;case vt:n={activeIndex:l+1>=a.length?-1:l+1};break;case It:case mt: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 bt:n={activeIndex:a.length-1};break;case xt:n={selectedItems:a.slice(0,a.length-1)};break;case St:n={selectedItems:[].concat(a,[u])};break;case wt:n={activeIndex:-1};break;case Ct: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 kt:n={selectedItems:t.selectedItems};break;case Dt:n={activeIndex:t.activeIndex};break;case Ot:n={activeIndex:ct(r,"activeIndex"),selectedItems:ct(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Pt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Rt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Kt(e){void 0===e&&(e={}),gt();var n=s({},ft,e),i=n.getA11yRemovalMessage,o=n.itemToString,r=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=ie(Et,function(e){return{activeIndex:dt(e,"activeIndex"),selectedItems:dt(e,"selectedItems")}}(n),n),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:yt})},e[l]=function(){p({type:vt})},e.Delete=function(){p({type:mt})},e.Backspace=function(){p({type:It})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){pt(e)&&p({type:bt})},e.Backspace=function(e){pt(e)&&p({type:xt})},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,Pt),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:ht,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,Rt),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:wt})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:St,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Ct,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:kt,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Dt,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Ot})}),[p]),selectedItems:g,activeIndex:f}}Kt.stateChangeTypes=Mt,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=lt,e.useMultipleSelection=Kt,e.useSelect=Fe,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