9 | }var u="function"==typeof Symbol&&Symbol.for,s=u?Symbol.for("react.element"):60103,a=u?Symbol.for("react.portal"):60106,c=u?Symbol.for("react.fragment"):60107,l=u?Symbol.for("react.strict_mode"):60108,d=u?Symbol.for("react.profiler"):60114,p=u?Symbol.for("react.provider"):60109,f=u?Symbol.for("react.context"):60110,h=u?Symbol.for("react.async_mode"):60111,g=u?Symbol.for("react.concurrent_mode"):60111,m=u?Symbol.for("react.forward_ref"):60112,I=u?Symbol.for("react.suspense"):60113,v=u?Symbol.for("react.suspense_list"):60120,y=u?Symbol.for("react.memo"):60115,b=u?Symbol.for("react.lazy"):60116,x=u?Symbol.for("react.block"):60121,w=u?Symbol.for("react.fundamental"):60117,S=u?Symbol.for("react.responder"):60118,C=u?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case s:switch(e=e.type){case h:case g:case c:case d:case l:case I:return e;default:switch(e=e&&e.$$typeof){case f:case m:case b:case y:case p:return e;default:return t}}case a:return t}}}function O(e){return k(e)===g}var M={AsyncMode:h,ConcurrentMode:g,ContextConsumer:f,ContextProvider:p,Element:s,ForwardRef:m,Fragment:c,Lazy:b,Memo:y,Portal:a,Profiler:d,StrictMode:l,Suspense:I,isAsyncMode:function(e){return O(e)||k(e)===h},isConcurrentMode:O,isContextConsumer:function(e){return k(e)===f},isContextProvider:function(e){return k(e)===p},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===s},isForwardRef:function(e){return k(e)===m},isFragment:function(e){return k(e)===c},isLazy:function(e){return k(e)===b},isMemo:function(e){return k(e)===y},isPortal:function(e){return k(e)===a},isProfiler:function(e){return k(e)===d},isStrictMode:function(e){return k(e)===l},isSuspense:function(e){return k(e)===I},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===c||e===g||e===d||e===l||e===I||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===y||e.$$typeof===p||e.$$typeof===f||e.$$typeof===m||e.$$typeof===w||e.$$typeof===S||e.$$typeof===C||e.$$typeof===x)},typeOf:k},E=(i((function(e,t){})),i((function(e){e.exports=M})),Object.getOwnPropertySymbols),D=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;function P(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign,Function.call.bind(Object.prototype.hasOwnProperty);function R(){}function T(){}T.resetWarningCache=R;var H=i((function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){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,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:T,resetWarningCache:R};return n.PropTypes=n,n}()})),V=60103,A=60106,F=60107,N=60108,L=60114,B=60109,_=60110,$=60112,j=60113,U=60120,W=60115,z=60116,q=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"),F=Q("react.fragment"),N=Q("react.strict_mode"),L=Q("react.profiler"),B=Q("react.provider"),_=Q("react.context"),$=Q("react.forward_ref"),j=Q("react.suspense"),U=Q("react.suspense_list"),W=Q("react.memo"),z=Q("react.lazy"),q=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 F:case L:case N:case j:case U:return e;default:switch(e=e&&e.$$typeof){case _:case $:case z:case W:case B:return e;default:return t}}case A:return t}}}var ee={ContextConsumer:_,ContextProvider:B,Element:V,ForwardRef:$,Fragment:F,Lazy:z,Memo:W,Portal:A,Profiler:L,StrictMode:N,Suspense:j,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Z(e)===_},isContextProvider:function(e){return Z(e)===B},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===V},isForwardRef:function(e){return Z(e)===$},isFragment:function(e){return Z(e)===F},isLazy:function(e){return Z(e)===z},isMemo:function(e){return Z(e)===W},isPortal:function(e){return Z(e)===A},isProfiler:function(e){return Z(e)===L},isStrictMode:function(e){return Z(e)===N},isSuspense:function(e){return Z(e)===j},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===F||e===L||e===G||e===N||e===j||e===U||e===J||"object"==typeof e&&null!==e&&(e.$$typeof===z||e.$$typeof===W||e.$$typeof===B||e.$$typeof===_||e.$$typeof===$||e.$$typeof===X||e.$$typeof===q||e[0]===Y)},typeOf:Z};i((function(e,t){})),i((function(e){e.exports=ee}));function te(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function ne(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function re(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return ne(n.overflowY,t)||ne(n.overflowX,t)||function(e){var t=function(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}function oe(e,t,n,r,o,i,u,s){return i<e&&u>t||i>e&&u<t?0:i<=e&&s<=n||u>=t&&s>=n?i-e-r:u>t&&s<n||i<e&&s>n?u-t+o:0}var ie=0;function ue(e){return"function"==typeof e?e:se}function se(){}function ae(e,t){e&&function(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,u=t.boundary,s=t.skipOverflowHiddenElements,a="function"==typeof u?u:function(e){return e!==u};if(!te(e))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,l=[],d=e;te(d)&&a(d);){if((d=d.parentNode)===c){l.push(d);break}d===document.body&&re(d)&&!re(document.documentElement)||re(d,s)&&l.push(d)}for(var p=n.visualViewport?n.visualViewport.width:innerWidth,f=n.visualViewport?n.visualViewport.height:innerHeight,h=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),I=m.height,v=m.width,y=m.top,b=m.right,x=m.bottom,w=m.left,S="start"===o||"nearest"===o?y:"end"===o?x:y+I/2,C="center"===i?w+v/2:"end"===i?b:w,k=[],O=0;O<l.length;O++){var M=l[O],E=M.getBoundingClientRect(),D=E.height,K=E.width,P=E.top,R=E.right,T=E.bottom,H=E.left;if("if-needed"===r&&y>=0&&w>=0&&x<=f&&b<=p&&y>=P&&x<=T&&w>=H&&b<=R)return k;var V=getComputedStyle(M),A=parseInt(V.borderLeftWidth,10),F=parseInt(V.borderTopWidth,10),N=parseInt(V.borderRightWidth,10),L=parseInt(V.borderBottomWidth,10),B=0,_=0,$="offsetWidth"in M?M.offsetWidth-M.clientWidth-A-N:0,j="offsetHeight"in M?M.offsetHeight-M.clientHeight-F-L:0;if(c===M)B="start"===o?S:"end"===o?S-f:"nearest"===o?oe(g,g+f,f,F,L,g+S,g+S+I,I):S-f/2,_="start"===i?C:"center"===i?C-p/2:"end"===i?C-p:oe(h,h+p,p,A,N,h+C,h+C+v,v),B=Math.max(0,B+g),_=Math.max(0,_+h);else{B="start"===o?S-P-F:"end"===o?S-T+L+j:"nearest"===o?oe(P,T,D,F,L+j,S,S+I,I):S-(P+D/2)+j/2,_="start"===i?C-H-A:"center"===i?C-(H+K/2)+$/2:"end"===i?C-R+N+$:oe(H,R,K,A,N+$,C,C+v,v);var U=M.scrollLeft,W=M.scrollTop;S+=W-(B=Math.max(0,Math.min(W+B,M.scrollHeight-D+j))),C+=U-(_=Math.max(0,Math.min(U+_,M.scrollWidth-K+$)))}k.push({el:M,top:B,left:_})}return k}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function ce(e,t){return e===t||t instanceof Node&&e.contains&&e.contains(t)}function le(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function de(){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,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function pe(){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 fe(){return String(ie++)}function he(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?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 ge(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var me=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Ie(e){void 0===e&&(e={});var t={};return me.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function ve(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=ye(t,r)?t[r]:e[r],n}),{})}function ye(e,t){return void 0!==e[t]}function be(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function xe(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var u=t+e;u<0?u=o?i:0:u>i&&(u=o?0:i);var s=we(e,u,n,r,o);return-1===s?t>=n?-1:t:s}function we(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!r(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute("disabled"))return s;return o?e>0?we(1,0,n,r,!1):we(-1,n-1,n,r,!1):-1}function Se(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(ce(t,e)||r&&ce(t,n.activeElement))}))}var Ce=le((function(e){Oe(e).textContent=""}),500);function ke(e,t){var n=Oe(t);e&&(n.textContent=e,Ce(t))}function Oe(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 Me=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}),Ee=function(){var e=function(e){var i,u;function s(t){var i=e.call(this,t)||this;i.id=i.props.id||"downshift-"+fe(),i.menuId=i.props.menuId||i.id+"-menu",i.labelId=i.props.labelId||i.id+"-label",i.inputId=i.props.inputId||i.id+"-input",i.getItemId=i.props.getItemId||function(e){return i.id+"-item-"+e},i.input=null,i.items=[],i.itemCount=null,i.previousResultCount=0,i.timeoutIds=[],i.internalSetTimeout=function(e,t){var n=setTimeout((function(){i.timeoutIds=i.timeoutIds.filter((function(e){return e!==n})),e()}),t);i.timeoutIds.push(n)},i.setItemCount=function(e){i.itemCount=e},i.unsetItemCount=function(){i.itemCount=null},i.setHighlightedIndex=function(e,t){void 0===e&&(e=i.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Ie(t),i.internalSetState(r({highlightedIndex:e},t))},i.clearSelection=function(e){i.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:i.props.defaultHighlightedIndex,isOpen:i.props.defaultIsOpen},e)},i.selectItem=function(e,t,n){t=Ie(t),i.internalSetState(r({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,selectedItem:e,inputValue:i.props.itemToString(e)},t),n)},i.selectItemAtIndex=function(e,t,n){var r=i.items[e];null!=r&&i.selectItem(r,t,n)},i.selectHighlightedItem=function(e,t){return i.selectItemAtIndex(i.getState().highlightedIndex,e,t)},i.internalSetState=function(e,t){var n,o,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&i.props.onInputValueChange(e.inputValue,r({},i.getStateAndHelpers(),e)),i.setState((function(t){t=i.getState(t);var a=s?e(t):e;a=i.props.stateReducer(t,a),n=a.hasOwnProperty("selectedItem");var c={};return n&&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],ye(i.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&i.props.onInputValueChange(a.inputValue,r({},i.getStateAndHelpers(),a)),c}),(function(){ue(t)(),Object.keys(u).length>1&&i.props.onStateChange(u,i.getStateAndHelpers()),n&&i.props.onSelect(e.selectedItem,i.getStateAndHelpers()),void 0!==o&&i.props.onChange(o,i.getStateAndHelpers()),i.props.onUserAction(u,i.getStateAndHelpers())}))},i.rootRef=function(e){return i._rootNode=e},i.getRootProps=function(e,t){var o,u=void 0===e?{}:e,s=u.refKey,a=void 0===s?"ref":s,c=u.ref,l=n(u,["refKey","ref"]),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;i.getRootProps.called=!0,i.getRootProps.refKey=a,i.getRootProps.suppressRefError=p;var f=i.getState().isOpen;return r(((o={})[a]=pe(c,i.rootRef),o.role="combobox",o["aria-expanded"]=f,o["aria-haspopup"]="listbox",o["aria-owns"]=f?i.menuId:null,o["aria-labelledby"]=i.labelId,o),l)},i.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=xe(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));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=xe(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(r({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},i.buttonKeyDownHandlers=r({},i.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),i.inputKeyDownHandlers=r({},i.keyDownHandlers,{Home:function(e){var t=this;e.preventDefault();var n=this.getItemCount(),r=this.getState().isOpen;if(!(n<=0)&&r){var o=we(1,0,n,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}},End:function(e){var t=this;e.preventDefault();var n=this.getItemCount(),r=this.getState().isOpen;if(!(n<=0)&&r){var o=we(-1,n-1,n,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}),i.getToggleButtonProps=function(e){var t=void 0===e?{}:e,o=t.onClick,u=(t.onPress,t.onKeyDown),s=t.onKeyUp,a=t.onBlur,c=n(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),l=i.getState().isOpen,d={onClick:de(o,i.buttonHandleClick),onKeyDown:de(u,i.buttonHandleKeyDown),onKeyUp:de(s,i.buttonHandleKeyUp),onBlur:de(a,i.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":l?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},c.disabled?{}:d,c)},i.buttonHandleKeyUp=function(e){e.preventDefault()},i.buttonHandleKeyDown=function(e){var t=be(e);i.buttonKeyDownHandlers[t]&&i.buttonKeyDownHandlers[t].call(o(i),e)},i.buttonHandleClick=function(e){e.preventDefault(),i.props.environment.document.activeElement===i.props.environment.document.body&&e.target.focus(),i.internalSetTimeout((function(){return i.toggleMenu({type:13})}))},i.buttonHandleBlur=function(e){var t=e.target;i.internalSetTimeout((function(){i.isMouseDown||null!=i.props.environment.document.activeElement&&i.props.environment.document.activeElement.id===i.inputId||i.props.environment.document.activeElement===t||i.reset({type:14})}))},i.getLabelProps=function(e){return r({htmlFor:i.inputId,id:i.labelId},e)},i.getInputProps=function(e){var t=void 0===e?{}:e,o=t.onKeyDown,u=t.onBlur,s=t.onChange,a=t.onInput,c=(t.onChangeText,n(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),l={};var d,p=i.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;c.disabled||((d={}).onChange=de(s,a,i.inputHandleChange),d.onKeyDown=de(o,i.inputHandleKeyDown),d.onBlur=de(u,i.inputHandleBlur),l=d);return r({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?i.getItemId(g):null,"aria-controls":h?i.menuId:null,"aria-labelledby":i.labelId,autoComplete:"off",value:f,id:i.inputId},l,c)},i.inputHandleKeyDown=function(e){var t=be(e);t&&i.inputKeyDownHandlers[t]&&i.inputKeyDownHandlers[t].call(o(i),e)},i.inputHandleChange=function(e){i.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:i.props.defaultHighlightedIndex})},i.inputHandleBlur=function(){i.internalSetTimeout((function(){var e=i.props.environment.document&&!!i.props.environment.document.activeElement&&!!i.props.environment.document.activeElement.dataset&&i.props.environment.document.activeElement.dataset.toggle&&i._rootNode&&i._rootNode.contains(i.props.environment.document.activeElement);i.isMouseDown||e||i.reset({type:10})}))},i.menuRef=function(e){i._menuNode=e},i.getMenuProps=function(e,t){var o,u=void 0===e?{}:e,s=u.refKey,a=void 0===s?"ref":s,c=u.ref,l=n(u,["refKey","ref"]),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return i.getMenuProps.called=!0,i.getMenuProps.refKey=a,i.getMenuProps.suppressRefError=p,r(((o={})[a]=pe(c,i.menuRef),o.role="listbox",o["aria-labelledby"]=l&&l["aria-label"]?null:i.labelId,o.id=i.menuId,o),l)},i.getItemProps=function(e){var t,o=void 0===e?{}:e,u=o.onMouseMove,s=o.onMouseDown,a=o.onClick,c=(o.onPress,o.index),l=o.item,d=void 0===l?void 0:l,p=n(o,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===c?(i.items.push(d),c=i.items.indexOf(d)):i.items[c]=d;var f=a,h=((t={onMouseMove:de(u,(function(){c!==i.getState().highlightedIndex&&(i.setHighlightedIndex(c,{type:2}),i.avoidScrolling=!0,i.internalSetTimeout((function(){return i.avoidScrolling=!1}),250))})),onMouseDown:de(s,(function(e){e.preventDefault()}))}).onClick=de(f,(function(){i.selectItemAtIndex(c,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return r({id:i.getItemId(c),role:"option","aria-selected":i.getState().highlightedIndex===c},g,p)},i.clearItems=function(){i.items=[]},i.reset=function(e,t){void 0===e&&(e={}),e=Ie(e),i.internalSetState((function(t){var n=t.selectedItem;return r({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,inputValue:i.props.itemToString(n)},e)}),t)},i.toggleMenu=function(e,t){void 0===e&&(e={}),e=Ie(e),i.internalSetState((function(t){var n=t.isOpen;return r({isOpen:!n},n&&{highlightedIndex:i.props.defaultHighlightedIndex},e)}),(function(){var n=i.getState(),r=n.isOpen,o=n.highlightedIndex;r&&i.getItemCount()>0&&"number"==typeof o&&i.setHighlightedIndex(o,e),ue(t)()}))},i.openMenu=function(e){i.internalSetState({isOpen:!0},e)},i.closeMenu=function(e){i.internalSetState({isOpen:!1},e)},i.updateStatus=le((function(){var e=i.getState(),t=i.items[e.highlightedIndex],n=i.getItemCount(),o=i.props.getA11yStatusMessage(r({itemToString:i.props.itemToString,previousResultCount:i.previousResultCount,resultCount:n,highlightedItem:t},e));i.previousResultCount=n,ke(o,i.props.environment.document)}),200);var u=i.props,s=u.defaultHighlightedIndex,a=u.initialHighlightedIndex,c=void 0===a?s:a,l=u.defaultIsOpen,d=u.initialIsOpen,p=void 0===d?l:d,f=u.initialInputValue,h=void 0===f?"":f,g=u.initialSelectedItem,m=void 0===g?null:g,I=i.getState({highlightedIndex:c,isOpen:p,inputValue:h,selectedItem:m});return null!=I.selectedItem&&void 0===i.props.initialInputValue&&(I.inputValue=i.props.itemToString(I.selectedItem)),i.state=I,i}u=e,(i=s).prototype=Object.create(u.prototype),i.prototype.constructor=i,i.__proto__=u;var a=s.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),ve(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.document.getElementById(this.getItemId(e))},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=xe(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,u=this.id,s=this.getRootProps,a=this.getToggleButtonProps,c=this.getLabelProps,l=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:a,getLabelProps:c,getMenuProps:l,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},a.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Se(t.target,[e._rootNode,e._menuNode],e.props.environment.document)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=Se(t.target,[e._rootNode,e._menuNode],e.props.environment.document,!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",r),u.addEventListener("touchmove",o),u.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",r),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",i)}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},a.componentDidUpdate=function(e,t){ye(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=ge(this.props.children,se);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=ge(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},s}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:he,itemToString:function(e){return null==e?"":String(e)},onStateChange:se,onInputValueChange:se,onUserAction:se,onChange:se,onSelect:se,onOuterClick:se,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:ae},e.stateChangeTypes=Me,e}(),De={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Ke(e,t,n){var o=e.props,i=e.type,u={};Object.keys(t).forEach((function(o){!function(e,t,n,o){var i=t.props,u=t.type,s="on"+Ae(e)+"Change";i[s]&&void 0!==o[e]&&o[e]!==n[e]&&i[s](r({type:u},o))}(o,e,t,n),n[o]!==t[o]&&(u[o]=n[o])})),o.onStateChange&&Object.keys(u).length&&o.onStateChange(r({type:i},u))}var Pe=le((function(e,t){ke(e(),t)}),200),Re="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function Te(e){var n=e.id,r=void 0===n?"downshift-"+fe():n,o=e.labelId,i=e.menuId,u=e.getItemId,s=e.toggleButtonId,a=e.inputId;return t.useRef({labelId:o||r+"-label",menuId:i||r+"-menu",getItemId:u||function(e){return r+"-item-"+e},toggleButtonId:s||r+"-toggle-button",inputId:a||r+"-input"}).current}function He(e,t,n){return void 0!==e?e:0===n.length?-1:n.indexOf(t)}function Ve(e){return/^\S{1}$/.test(e)}function Ae(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Fe(e){var n=t.useRef(e);return n.current=e,n}function Ne(e,n,o){var i=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=ve(t,n.props);var o=e(t,n);return n.props.stateReducer(t,r({},n,{changes:o}))}),[e]),a=t.useReducer(s,n),c=a[0],l=a[1],d=Fe(o),p=t.useCallback((function(e){return l(r({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&i.current&&i.current!==c&&Ke(f,ve(i.current,f.props),c),i.current=c}),[c,o,f]),[c,p]}function Le(e,t,n){var r=Ne(e,t,n),o=r[0],i=r[1];return[ve(o,n),i]}var Be={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:ae,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function _e(e,t,n){void 0===n&&(n=De);var r="default"+Ae(t);return r in e?e[r]:n[t]}function $e(e,t,n){if(void 0===n&&(n=De),t in e)return e[t];var r="initial"+Ae(t);return r in e?e[r]:_e(e,t,n)}function je(e){var t=$e(e,"selectedItem"),n=$e(e,"isOpen"),r=$e(e,"highlightedIndex"),o=$e(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:o}}function Ue(e,t,n,r){var o=e.items,i=e.initialHighlightedIndex,u=e.defaultHighlightedIndex,s=t.selectedItem,a=t.highlightedIndex;return 0===o.length?-1:void 0!==i&&a===i?i:void 0!==u?u:s?0===n?o.indexOf(s):xe(n,o.indexOf(s),o.length,r,!1):0===n?-1:n<0?o.length-1:0}function We(e,n,r,o){var i=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){var t=function(){i.current.isMouseDown=!0},u=function(t){i.current.isMouseDown=!1,e&&!Se(t.target,n.map((function(e){return e.current})),r.document)&&o()},s=function(){i.current.isTouchMove=!1},a=function(){i.current.isTouchMove=!0},c=function(t){!e||i.current.isTouchMove||Se(t.target,n.map((function(e){return e.current})),r.document,!1)||o()};return r.addEventListener("mousedown",t),r.addEventListener("mouseup",u),r.addEventListener("touchstart",s),r.addEventListener("touchmove",a),r.addEventListener("touchend",c),function(){r.removeEventListener("mousedown",t),r.removeEventListener("mouseup",u),r.removeEventListener("touchstart",s),r.removeEventListener("touchmove",a),r.removeEventListener("touchend",c)}}),[e,r]),i}var ze=function(){return se};function qe(e,o,i){var u=i.isInitialMount,s=i.highlightedIndex,a=i.items,c=i.environment,l=n(i,["isInitialMount","highlightedIndex","items","environment"]);t.useEffect((function(){u||Pe((function(){return e(r({highlightedIndex:s,highlightedItem:a[s],resultCount:a.length},l))}),c.document)}),o)}function Ye(e){var n=e.highlightedIndex,r=e.isOpen,o=e.itemRefs,i=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,a=t.useRef(!0);return Re((function(){n<0||!r||!Object.keys(o.current).length||(!1===a.current?a.current=!0:s(i(n),u))}),[n]),a}var Xe=se;function Ge(e){return 11}function Je(e,t){var n,o=t.type,i=t.props;switch(o){case 1:n={highlightedIndex:t.index};break;case 0:n={highlightedIndex:-1};break;case 3:case 4:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ue(i,e,0)};break;case 5:n={isOpen:!0,highlightedIndex:Ue(i,e,0)};break;case 6:n={isOpen:!1};break;case 7:n={highlightedIndex:t.highlightedIndex};break;case 9:n={inputValue:t.inputValue};break;case 10:n={highlightedIndex:_e(i,"highlightedIndex"),isOpen:_e(i,"isOpen"),selectedItem:_e(i,"selectedItem"),inputValue:_e(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}function Qe(e,t,n,r,o){for(var i=e.toLowerCase(),u=0;u<n.length;u++){var s=(u+t+1)%n.length;if(r(n[s]).toLowerCase().startsWith(i)){var a=o(s);if(!a||!a.hasAttribute("disabled"))return s}}return t}H.array.isRequired,H.func,H.func,H.func,H.bool,H.number,H.number,H.number,H.bool,H.bool,H.bool,H.any,H.any,H.any,H.string,H.string,H.string,H.func,H.string,H.func,H.func,H.func,H.func,H.func,H.shape({addEventListener:H.func,removeEventListener:H.func,document:H.shape({getElementById:H.func,activeElement:H.any,body:H.any})});var Ze=r({},Be,{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(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.":""}}),et=Object.freeze({__proto__:null,MenuKeyDownArrowDown:11,MenuKeyDownArrowUp:11,MenuKeyDownEscape:11,MenuKeyDownHome:11,MenuKeyDownEnd:11,MenuKeyDownEnter:11,MenuKeyDownSpaceButton:11,MenuKeyDownCharacter:11,MenuBlur:11,ToggleButtonKeyDownArrowDown:11,ToggleButtonKeyDownArrowUp:11,ToggleButtonKeyDownCharacter:11,MenuMouseLeave:0,ItemMouseMove:1,ItemClick:2,ToggleButtonClick:3,FunctionToggleMenu:4,FunctionOpenMenu:5,FunctionCloseMenu:6,FunctionSetHighlightedIndex:7,FunctionSelectItem:8,FunctionSetInputValue:9,FunctionReset:10,productionEnumFn:Ge});function tt(e,t){var n,o=t.type,i=t.props,u=t.shiftKey;switch(o){case 2:n={isOpen:_e(i,"isOpen"),highlightedIndex:_e(i,"highlightedIndex"),selectedItem:i.items[t.index]};break;case 11:var s=t.key,a=""+e.inputValue+s,c=Qe(a,e.selectedItem?i.items.indexOf(e.selectedItem):-1,i.items,i.itemToString,t.getItemNodeFromIndex);n=r({inputValue:a},c>=0&&{selectedItem:i.items[c]});break;case 11:n={highlightedIndex:Ue(i,e,1,t.getItemNodeFromIndex),isOpen:!0};break;case 11:n={highlightedIndex:Ue(i,e,-1,t.getItemNodeFromIndex),isOpen:!0};break;case 11:case 11:n=r({isOpen:_e(i,"isOpen"),highlightedIndex:_e(i,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:i.items[e.highlightedIndex]});break;case 11:n={highlightedIndex:we(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case 11:n={highlightedIndex:we(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case 11:case 11:n={isOpen:!1,highlightedIndex:-1};break;case 11:var l=t.key,d=""+e.inputValue+l,p=Qe(d,e.highlightedIndex,i.items,i.itemToString,t.getItemNodeFromIndex);n=r({inputValue:d},p>=0&&{highlightedIndex:p});break;case 11:n={highlightedIndex:xe(u?5:1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,i.circularNavigation)};break;case 11:n={highlightedIndex:xe(u?-5:-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,i.circularNavigation)};break;case 8:n={selectedItem:t.selectedItem};break;default:return Je(e,t)}return r({},e,n)}function nt(e){void 0===e&&(e={});var o=r({},Ze,e),i=o.items,u=o.scrollIntoView,s=o.environment,a=o.initialIsOpen,c=o.defaultIsOpen,l=o.itemToString,d=o.getA11ySelectionMessage,p=o.getA11yStatusMessage,f=Le(tt,je(o),o),h=f[0],g=f[1],m=h.isOpen,I=h.highlightedIndex,v=h.selectedItem,y=h.inputValue,b=t.useRef(null),x=t.useRef(null),w=t.useRef();w.current={};var S=t.useRef(!0),C=t.useRef(null),k=Te(o),O=t.useRef(),M=t.useRef(!0),E=Fe({state:h,props:o}),D=t.useCallback((function(e){return w.current[k.getItemId(e)]}),[k]);qe(p,[m,I,y,i],r({isInitialMount:M.current,previousResultCount:O.current,items:i,environment:s,itemToString:l},h)),qe(d,[v],r({isInitialMount:M.current,previousResultCount:O.current,items:i,environment:s,itemToString:l},h));var K=Ye({menuElement:x.current,highlightedIndex:I,isOpen:m,itemRefs:w,scrollIntoView:u,getItemNodeFromIndex:D});t.useEffect((function(){M.current&&(C.current=le((function(e){e({type:9,inputValue:""})}),500)),y&&C.current(g)}),[g,y]),Xe({isInitialMount:M.current,props:o,state:h}),t.useEffect((function(){M.current?(a||c||m)&&x.current&&x.current.focus():m?x.current&&x.current.focus():s.document.activeElement===x.current&&b.current&&(S.current=!1,b.current.focus())}),[m]),t.useEffect((function(){M.current||(O.current=i.length)}));var P=We(m,[x,b],s,(function(){g({type:11})})),R=ze();t.useEffect((function(){M.current=!1}),[]);var T=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D,shiftKey:e.shiftKey})},ArrowUp:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D,shiftKey:e.shiftKey})}}}),[g,D]),H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D,shiftKey:e.shiftKey})},ArrowUp:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D,shiftKey:e.shiftKey})},Home:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D})},End:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D})},Escape:function(){g({type:11})},Enter:function(e){e.preventDefault(),g({type:11})}," ":function(e){e.preventDefault(),g({type:11})}}}),[g,D]),V=t.useCallback((function(){g({type:4})}),[g]),A=t.useCallback((function(){g({type:6})}),[g]),F=t.useCallback((function(){g({type:5})}),[g]),N=t.useCallback((function(e){g({type:7,highlightedIndex:e})}),[g]),L=t.useCallback((function(e){g({type:8,selectedItem:e})}),[g]),B=t.useCallback((function(){g({type:10})}),[g]),_=t.useCallback((function(e){g({type:9,inputValue:e})}),[g]),$=t.useCallback((function(e){return r({id:k.labelId,htmlFor:k.toggleButtonId},e)}),[k]),j=t.useCallback((function(e,t){var o,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,a=void 0===s?"ref":s,c=i.onKeyDown,l=i.onBlur,d=i.ref,p=n(i,["onMouseLeave","refKey","onKeyDown","onBlur","ref"]),f=((void 0===t?{}:t).suppressRefError,E.current.state);return r(((o={})[a]=pe(d,(function(e){x.current=e})),o.id=k.menuId,o.role="listbox",o["aria-labelledby"]=k.labelId,o.tabIndex=-1,o),f.isOpen&&f.highlightedIndex>-1&&{"aria-activedescendant":k.getItemId(f.highlightedIndex)},{onMouseLeave:de(u,(function(){g({type:0})})),onKeyDown:de(c,(function(e){var t=be(e);t&&H[t]?H[t](e):Ve(t)&&g({type:11,key:t,getItemNodeFromIndex:D})})),onBlur:de(l,(function(){!1!==S.current?!P.current.isMouseDown&&g({type:11}):S.current=!0}))},p)}),[g,E,H,P,R,k,D]);return{getToggleButtonProps:t.useCallback((function(e,t){var o,i=void 0===e?{}:e,u=i.onClick,s=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,l=i.ref,d=n(i,["onClick","onKeyDown","refKey","ref"]),p=((void 0===t?{}:t).suppressRefError,r(((o={})[c]=pe(l,(function(e){b.current=e})),o.id=k.toggleButtonId,o["aria-haspopup"]="listbox",o["aria-expanded"]=E.current.state.isOpen,o["aria-labelledby"]=k.labelId+" "+k.toggleButtonId,o),d));return d.disabled||(p.onClick=de(u,(function(){g({type:3})})),p.onKeyDown=de(s,(function(e){var t=be(e);t&&T[t]?T[t](e):Ve(t)&&g({type:11,key:t,getItemNodeFromIndex:D})}))),p}),[g,E,T,R,k,D]),getLabelProps:$,getMenuProps:j,getItemProps:t.useCallback((function(e){var t,o=void 0===e?{}:e,i=o.item,u=o.index,s=o.onMouseMove,a=o.onClick,c=o.refKey,l=void 0===c?"ref":c,d=o.ref,p=n(o,["item","index","onMouseMove","onClick","refKey","ref"]),f=E.current,h=f.state,m=f.props,I=He(u,i,m.items);if(I<0)throw new Error("Pass either item or item index in getItemProps!");var v=r(((t={role:"option","aria-selected":""+(I===h.highlightedIndex),id:k.getItemId(I)})[l]=pe(d,(function(e){e&&(w.current[k.getItemId(I)]=e)})),t),p);return p.disabled||(v.onMouseMove=de(s,(function(){u!==h.highlightedIndex&&(K.current=!1,g({type:1,index:u}))})),v.onClick=de(a,(function(){g({type:2,index:u})}))),v}),[g,E,K,k]),toggleMenu:V,openMenu:F,closeMenu:A,setHighlightedIndex:N,selectItem:L,reset:B,setInputValue:_,highlightedIndex:I,isOpen:m,selectedItem:v,inputValue:y}}nt.stateChangeTypes=et;var rt=Object.freeze({__proto__:null,InputKeyDownArrowDown:11,InputKeyDownArrowUp:11,InputKeyDownEscape:11,InputKeyDownHome:11,InputKeyDownEnd:11,InputKeyDownEnter:11,InputChange:11,InputBlur:11,ControlledPropUpdatedSelectedItem:11,MenuMouseLeave:0,ItemMouseMove:1,ItemClick:2,ToggleButtonClick:3,FunctionToggleMenu:4,FunctionOpenMenu:5,FunctionCloseMenu:6,FunctionSetHighlightedIndex:7,FunctionSelectItem:8,FunctionSetInputValue:9,FunctionReset:10,productionEnumFn:Ge});H.array.isRequired,H.func,H.func,H.func,H.bool,H.number,H.number,H.number,H.bool,H.bool,H.bool,H.any,H.any,H.any,H.string,H.string,H.string,H.string,H.string,H.string,H.func,H.string,H.string,H.func,H.func,H.func,H.func,H.func,H.func,H.shape({addEventListener:H.func,removeEventListener:H.func,document:H.shape({getElementById:H.func,activeElement:H.any,body:H.any})});var ot=r({},Be,{getA11yStatusMessage:he,circularNavigation:!0});function it(e,t){var n,o=t.type,i=t.props,u=t.shiftKey;switch(o){case 2:n={isOpen:_e(i,"isOpen"),highlightedIndex:_e(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case 11:n=e.isOpen?{highlightedIndex:xe(u?5:1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,i.circularNavigation)}:{highlightedIndex:Ue(i,e,1,t.getItemNodeFromIndex),isOpen:!0};break;case 11:n=e.isOpen?{highlightedIndex:xe(u?-5:-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,i.circularNavigation)}:{highlightedIndex:Ue(i,e,-1,t.getItemNodeFromIndex),isOpen:!0};break;case 11:n=r({},e.isOpen&&e.highlightedIndex>=0&&{selectedItem:i.items[e.highlightedIndex],isOpen:_e(i,"isOpen"),highlightedIndex:_e(i,"highlightedIndex"),inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case 11:n=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case 11:n=r({},e.isOpen&&{highlightedIndex:we(1,0,i.items.length,t.getItemNodeFromIndex,!1)});break;case 11:n=r({},e.isOpen&&{highlightedIndex:we(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)});break;case 11:e.isOpen&&(n=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])}));break;case 11:n={isOpen:!0,highlightedIndex:_e(i,"highlightedIndex"),inputValue:t.inputValue};break;case 8:n={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case 11:n={inputValue:t.inputValue};break;default:return Je(e,t)}return r({},e,n)}function ut(e){void 0===e&&(e={});var o=r({},ot,e),i=o.initialIsOpen,u=o.defaultIsOpen,s=o.items,a=o.scrollIntoView,c=o.environment,l=o.getA11yStatusMessage,d=o.getA11ySelectionMessage,p=o.itemToString,f=function(e,n,r){var o=t.useRef(),i=Ne(e,n,r),u=i[0],s=i[1];return t.useEffect((function(){ye(r,"selectedItem")&&(o.current!==r.selectedItem&&s({type:11,inputValue:r.itemToString(r.selectedItem)}),o.current=u.selectedItem===o.current?r.selectedItem:u.selectedItem)})),[ve(u,r),s]}(it,function(e){var t=je(e),n=t.selectedItem,o=t.inputValue;return""===o&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(o=e.itemToString(n)),r({},t,{inputValue:o})}(o),o),h=f[0],g=f[1],m=h.isOpen,I=h.highlightedIndex,v=h.selectedItem,y=h.inputValue,b=t.useRef(null),x=t.useRef(),w=t.useRef(null),S=t.useRef(null),C=t.useRef(null);x.current={};var k=t.useRef(!0),O=Te(o),M=t.useRef(),E=Fe({state:h,props:o}),D=t.useCallback((function(e){return x.current[O.getItemId(e)]}),[O]);qe(l,[m,I,y,s],r({isInitialMount:k.current,previousResultCount:M.current,items:s,environment:c,itemToString:p},h)),qe(d,[v],r({isInitialMount:k.current,previousResultCount:M.current,items:s,environment:c,itemToString:p},h));var K=Ye({menuElement:b.current,highlightedIndex:I,isOpen:m,itemRefs:x,scrollIntoView:a,getItemNodeFromIndex:D});Xe({isInitialMount:k.current,props:o,state:h}),t.useEffect((function(){(i||u||m)&&w.current&&w.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=s.length)}));var P=We(m,[C,b,S],c,(function(){g({type:11,selectItem:!1})})),R=ze();t.useEffect((function(){k.current=!1}),[]);var T=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),g({type:11,shiftKey:e.shiftKey,getItemNodeFromIndex:D})},ArrowUp:function(e){e.preventDefault(),g({type:11,shiftKey:e.shiftKey,getItemNodeFromIndex:D})},Home:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D})},End:function(e){e.preventDefault(),g({type:11,getItemNodeFromIndex:D})},Escape:function(){g({type:11})},Enter:function(e){229!==e.which&&(E.current.state.isOpen&&e.preventDefault(),g({type:11,getItemNodeFromIndex:D}))}}}),[g,E,D]),H=t.useCallback((function(e){return r({id:O.labelId,htmlFor:O.inputId},e)}),[O]),V=t.useCallback((function(e,t){var o,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,a=void 0===s?"ref":s,c=i.ref,l=n(i,["onMouseLeave","refKey","ref"]);(void 0===t?{}:t).suppressRefError;return r(((o={})[a]=pe(c,(function(e){b.current=e})),o.id=O.menuId,o.role="listbox",o["aria-labelledby"]=O.labelId,o.onMouseLeave=de(u,(function(){g({type:0})})),o),l)}),[g,R,O]),A=t.useCallback((function(e){var t,o,i=void 0===e?{}:e,u=i.item,s=i.index,a=i.refKey,c=void 0===a?"ref":a,l=i.ref,d=i.onMouseMove,p=i.onClick,f=(i.onPress,n(i,["item","index","refKey","ref","onMouseMove","onClick","onPress"])),h=E.current,m=h.props,I=h.state,v=He(s,u,m.items);if(v<0)throw new Error("Pass either item or item index in getItemProps!");var y=p;return r(((t={})[c]=pe(l,(function(e){e&&(x.current[O.getItemId(v)]=e)})),t.role="option",t["aria-selected"]=""+(v===I.highlightedIndex),t.id=O.getItemId(v),t),!f.disabled&&((o={onMouseMove:de(d,(function(){s!==I.highlightedIndex&&(K.current=!1,g({type:1,index:s}))}))}).onClick=de(y,(function(){g({type:2,index:s}),w.current&&w.current.focus()})),o),f)}),[g,E,K,O]),F=t.useCallback((function(e){var t,o=void 0===e?{}:e,i=o.onClick,u=(o.onPress,o.refKey),s=void 0===u?"ref":u,a=o.ref,c=n(o,["onClick","onPress","refKey","ref"]);return r(((t={})[s]=pe(a,(function(e){S.current=e})),t.id=O.toggleButtonId,t.tabIndex=-1,t),!c.disabled&&r({},{onClick:de(i,(function(){g({type:3}),!E.current.state.isOpen&&w.current&&w.current.focus()}))}),c)}),[g,E,O]),N=t.useCallback((function(e,t){var o,i,u=void 0===e?{}:e,s=u.onKeyDown,a=u.onChange,c=u.onInput,l=u.onBlur,d=(u.onChangeText,u.refKey),p=void 0===d?"ref":d,f=u.ref,h=n(u,["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"]),m=((void 0===t?{}:t).suppressRefError,E.current.state),I={};h.disabled||((i={}).onChange=de(a,c,(function(e){g({type:11,inputValue:e.target.value})})),i.onKeyDown=de(s,(function(e){var t=be(e);t&&T[t]&&T[t](e)})),i.onBlur=de(l,(function(){P.current.isMouseDown||g({type:11,selectItem:!0})})),I=i);return r(((o={})[p]=pe(f,(function(e){w.current=e})),o.id=O.inputId,o["aria-autocomplete"]="list",o["aria-controls"]=O.menuId,o),m.isOpen&&m.highlightedIndex>-1&&{"aria-activedescendant":O.getItemId(m.highlightedIndex)},{"aria-labelledby":O.labelId,autoComplete:"off",value:m.inputValue},I,h)}),[g,T,E,P,R,O]),L=t.useCallback((function(e,t){var o,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,a=i.ref,c=n(i,["refKey","ref"]);(void 0===t?{}:t).suppressRefError;return r(((o={})[s]=pe(a,(function(e){C.current=e})),o.role="combobox",o["aria-haspopup"]="listbox",o["aria-owns"]=O.menuId,o["aria-expanded"]=E.current.state.isOpen,o),c)}),[E,R,O]),B=t.useCallback((function(){g({type:4})}),[g]),_=t.useCallback((function(){g({type:6})}),[g]),$=t.useCallback((function(){g({type:5})}),[g]),j=t.useCallback((function(e){g({type:7,highlightedIndex:e})}),[g]),U=t.useCallback((function(e){g({type:8,selectedItem:e})}),[g]);return{getItemProps:A,getLabelProps:H,getMenuProps:V,getInputProps:N,getComboboxProps:L,getToggleButtonProps:F,toggleMenu:B,openMenu:$,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){g({type:9,inputValue:e})}),[g]),selectItem:U,reset:t.useCallback((function(){g({type:10})}),[g]),highlightedIndex:I,isOpen:m,selectedItem:v,inputValue:y}}ut.stateChangeTypes=rt;var st={activeIndex:-1,selectedItems:[]};function at(e,t){return $e(e,t,st)}function ct(e,t){return _e(e,t,st)}function lt(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}H.array,H.array,H.array,H.func,H.func,H.func,H.number,H.number,H.number,H.func,H.func,H.string,H.string,H.shape({addEventListener:H.func,removeEventListener:H.func,document:H.shape({getElementById:H.func,activeElement:H.any,body:H.any})});var dt={itemToString:Be.itemToString,stateReducer:Be.stateReducer,environment:Be.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},pt=Object.freeze({__proto__:null,SelectedItemClick:0,SelectedItemKeyDownDelete:1,SelectedItemKeyDownBackspace:2,SelectedItemKeyDownNavigationNext:3,SelectedItemKeyDownNavigationPrevious:4,DropdownKeyDownNavigationPrevious:5,DropdownKeyDownBackspace:6,DropdownClick:7,FunctionAddSelectedItem:8,FunctionRemoveSelectedItem:9,FunctionSetSelectedItems:10,FunctionSetActiveIndex:11,FunctionReset:12});function ft(e,t){var n,o=t.type,i=t.index,u=t.props,s=t.selectedItem,a=e.activeIndex,c=e.selectedItems;switch(o){case 0:n={activeIndex:i};break;case 4:n={activeIndex:a-1<0?0:a-1};break;case 3:n={activeIndex:a+1>=c.length?-1:a+1};break;case 2:case 1:var l=a;1===c.length?l=-1:a===c.length-1&&(l=c.length-2),n=r({selectedItems:[].concat(c.slice(0,a),c.slice(a+1))},{activeIndex:l});break;case 5:n={activeIndex:c.length-1};break;case 6:n={selectedItems:c.slice(0,c.length-1)};break;case 8:n={selectedItems:[].concat(c,[s])};break;case 7:n={activeIndex:-1};break;case 9:var d=a,p=c.indexOf(s);1===c.length?d=-1:p===c.length-1&&(d=c.length-2),n=r({selectedItems:[].concat(c.slice(0,p),c.slice(p+1))},{activeIndex:d});break;case 10:n={selectedItems:t.selectedItems};break;case 11:n={activeIndex:t.activeIndex};break;case 12:n={activeIndex:ct(u,"activeIndex"),selectedItems:ct(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}function ht(e){void 0===e&&(e={});var o=r({},dt,e),i=o.getA11yRemovalMessage,u=o.itemToString,s=o.environment,a=o.keyNavigationNext,c=o.keyNavigationPrevious,l=Le(ft,function(e){return{activeIndex:at(e,"activeIndex"),selectedItems:at(e,"selectedItems")}}(o),o),d=l[0],p=l[1],f=d.activeIndex,h=d.selectedItems,g=t.useRef(!0),m=t.useRef(null),I=t.useRef(h),v=t.useRef();v.current=[];var y=Fe({state:d,props:o});t.useEffect((function(){if(!g.current){if(h.length<I.current.length){var e=I.current.find((function(e){return h.indexOf(e)<0}));ke(i({itemToString:u,resultCount:h.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:h[f]}),s.document)}I.current=h}}),[h.length]),t.useEffect((function(){g.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),Xe({isInitialMount:g.current,props:o,state:d});var b=ze();t.useEffect((function(){g.current=!1}),[]);var x=t.useMemo((function(){var e;return(e={})[c]=function(){p({type:4})},e[a]=function(){p({type:3})},e.Delete=function(){p({type:1})},e.Backspace=function(){p({type:2})},e}),[p,a,c]),w=t.useMemo((function(){var e;return(e={})[c]=function(e){lt(e)&&p({type:5})},e.Backspace=function(e){lt(e)&&p({type:6})},e}),[p,c]);return{getSelectedItemProps:t.useCallback((function(e){var t,o=void 0===e?{}:e,i=o.refKey,u=void 0===i?"ref":i,s=o.ref,a=o.onClick,c=o.onKeyDown,l=o.selectedItem,d=o.index,f=n(o,["refKey","ref","onClick","onKeyDown","selectedItem","index"]),h=y.current.state;if(He(d,l,h.selectedItems)<0)throw new Error("Pass either selectedItem or index in getSelectedItemProps!");return r(((t={})[u]=pe(s,(function(e){e&&v.current.push(e)})),t.tabIndex=d===h.activeIndex?0:-1,t.onClick=de(a,(function(){p({type:0,index:d})})),t.onKeyDown=de(c,(function(e){var t=be(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var o,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,a=i.ref,c=i.onKeyDown,l=i.onClick,d=i.preventKeyAction,f=void 0!==d&&d,h=n(i,["refKey","ref","onKeyDown","onClick","preventKeyAction"]);(void 0===t?{}:t).suppressRefError;return r(((o={})[s]=pe(a,(function(e){e&&(m.current=e)})),o),!f&&{onKeyDown:de(c,(function(e){var t=be(e);t&&w[t]&&w[t](e)})),onClick:de(l,(function(){p({type:7})}))},h)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:8,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:9,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:10,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:11,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:12})}),[p]),selectedItems:h,activeIndex:f}}ht.stateChangeTypes=pt,e.default=Ee,e.resetIdCounter=function(){ie=0},e.useCombobox=ut,e.useMultipleSelection=ht,e.useSelect=nt,Object.defineProperty(e,"__esModule",{value:!0})}));
|