forked from bombastictranz/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
5196-f23c37d855c10de5.js.download
8 lines (8 loc) · 35.5 KB
/
5196-f23c37d855c10de5.js.download
1
2
3
4
5
6
7
8
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5196],{35196:function(o,i,u){function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(o,i){if(null==o)return{};var u,s,a={},l=Object.keys(o);for(s=0;s<l.length;s++)u=l[s],i.indexOf(u)>=0||(a[u]=o[u]);return a}function extends_extends(){return(extends_extends=Object.assign||function(o){for(var i=1;i<arguments.length;i++){var u=arguments[i];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(o[s]=u[s])}return o}).apply(this,arguments)}u.d(i,{Kb:function(){return useCombobox},M$:function(){return useMultipleSelection},L7:function(){return useSelect}});var s=u(13980),a=u.n(s),l=u(2784);function t(o){return"object"==typeof o&&null!=o&&1===o.nodeType}function e(o,i){return(!i||"hidden"!==o)&&"visible"!==o&&"clip"!==o}function n(o,i){if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){var u,s=getComputedStyle(o,null);return e(s.overflowY,i)||e(s.overflowX,i)||!!(u=function(o){if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch(o){return null}}(o))&&(u.clientHeight<o.scrollHeight||u.clientWidth<o.scrollWidth)}return!1}function r(o,i,u,s,a,l,c,d){return l<o&&c>i||l>o&&c<i?0:l<=o&&d<=u||c>=i&&d>=u?l-o-s:c>i&&d<u||l<o&&d>u?c-i+a:0}u(8041);var c=0;function noop(){}function isOrContainsNode(o,i,u){return o===i||i instanceof u.Node&&o.contains&&o.contains(i)}function debounce(o,i){var u;function cancel(){u&&clearTimeout(u)}function wrapper(){for(var s=arguments.length,a=Array(s),l=0;l<s;l++)a[l]=arguments[l];cancel(),u=setTimeout(function(){u=null,o.apply(void 0,a)},i)}return wrapper.cancel=cancel,wrapper}function callAllEventHandlers(){for(var o=arguments.length,i=Array(o),u=0;u<o;u++)i[u]=arguments[u];return function(o){for(var u=arguments.length,s=Array(u>1?u-1:0),a=1;a<u;a++)s[a-1]=arguments[a];return i.some(function(i){return i&&i.apply(void 0,[o].concat(s)),o.preventDownshiftDefault||o.hasOwnProperty("nativeEvent")&&o.nativeEvent.preventDownshiftDefault})}}function handleRefs(){for(var o=arguments.length,i=Array(o),u=0;u<o;u++)i[u]=arguments[u];return function(o){i.forEach(function(i){"function"==typeof i?i(o):i&&(i.current=o)})}}function getState(o,i){return Object.keys(o).reduce(function(u,s){return u[s]=void 0!==i[s]?i[s]:o[s],u},{})}function normalizeArrowKey(o){var i=o.key,u=o.keyCode;return u>=37&&u<=40&&0!==i.indexOf("Arrow")?"Arrow"+i:i}function getNextWrappingIndex(o,i,u,s,a){if(void 0===a&&(a=!0),0===u)return -1;var l=u-1;("number"!=typeof i||i<0||i>=u)&&(i=o>0?-1:l+1);var c=i+o;c<0?c=a?l:0:c>l&&(c=a?0:l);var d=getNextNonDisabledIndex(o,c,u,s,a);return -1===d?i>=u?-1:i:d}function getNextNonDisabledIndex(o,i,u,s,a){var l=s(i);if(!l||!l.hasAttribute("disabled"))return i;if(o>0){for(var c=i+1;c<u;c++)if(!s(c).hasAttribute("disabled"))return c}else for(var d=i-1;d>=0;d--)if(!s(d).hasAttribute("disabled"))return d;return a?o>0?getNextNonDisabledIndex(1,0,u,s,!1):getNextNonDisabledIndex(-1,u-1,u,s,!1):-1}function targetWithinDownshift(o,i,u,s){return void 0===s&&(s=!0),i.some(function(i){return i&&(isOrContainsNode(i,o,u)||s&&isOrContainsNode(i,u.document.activeElement,u))})}var d=debounce(function(o){getStatusDiv(o).textContent=""},500);function setStatus(o,i){var u=getStatusDiv(i);o&&(u.textContent=o,d(i))}function getStatusDiv(o){void 0===o&&(o=document);var i=o.getElementById("a11y-status-message");return i||((i=o.createElement("div")).setAttribute("id","a11y-status-message"),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-relevant","additions text"),Object.assign(i.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),o.body.appendChild(i)),i}var f={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},g=debounce(function(o,i){setStatus(o(),i)},200),h="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function useElementIds(o){var i=o.id,u=void 0===i?"downshift-"+String(c++):i,s=o.labelId,a=o.menuId,d=o.getItemId,f=o.toggleButtonId,g=o.inputId;return(0,l.useRef)({labelId:s||u+"-label",menuId:a||u+"-menu",getItemId:d||function(o){return u+"-item-"+o},toggleButtonId:f||u+"-toggle-button",inputId:g||u+"-input"}).current}function getItemIndex(o,i,u){return void 0!==o?o:0===u.length?-1:u.indexOf(i)}function isAcceptedCharacterKey(o){return/^\S{1}$/.test(o)}function capitalizeString(o){return""+o.slice(0,1).toUpperCase()+o.slice(1)}function useLatestRef(o){var i=(0,l.useRef)(o);return i.current=o,i}function useEnhancedReducer(o,i,u){var s=(0,l.useRef)(),a=(0,l.useRef)(),c=(0,l.useCallback)(function(i,u){a.current=u;var s=o(i=getState(i,u.props),u);return u.props.stateReducer(i,extends_extends({},u,{changes:s}))},[o]),d=(0,l.useReducer)(c,i),f=d[0],g=d[1],h=useLatestRef(u),p=(0,l.useCallback)(function(o){return g(extends_extends({props:h.current},o))},[h]),m=a.current;return(0,l.useEffect)(function(){if(m&&s.current&&s.current!==f){var o,i,u,a;o=getState(s.current,m.props),i=m.props,u=m.type,a={},Object.keys(o).forEach(function(i){var u,s,l;u=m.props,s=m.type,u[l="on"+capitalizeString(i)+"Change"]&&void 0!==f[i]&&f[i]!==o[i]&&u[l](extends_extends({type:s},f)),f[i]!==o[i]&&(a[i]=f[i])}),i.onStateChange&&Object.keys(a).length&&i.onStateChange(extends_extends({type:u},a))}s.current=f},[f,u,m]),[f,p]}function useControlledReducer$1(o,i,u){var s=useEnhancedReducer(o,i,u),a=s[0],l=s[1];return[getState(a,u),l]}var p={itemToString:function(o){return o?String(o):""},stateReducer:function(o,i){return i.changes},getA11ySelectionMessage:function(o){var i=o.selectedItem,u=o.itemToString;return i?u(i)+" has been selected.":""},scrollIntoView:function(o,i){o&&(function(o,i){var u=window,s=i.scrollMode,a=i.block,l=i.inline,c=i.boundary,d=i.skipOverflowHiddenElements,f="function"==typeof c?c:function(o){return o!==c};if(!t(o))throw TypeError("Invalid target");for(var g=document.scrollingElement||document.documentElement,h=[],p=o;t(p)&&f(p);){if((p=p.parentElement)===g){h.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,d)&&h.push(p)}for(var m=u.visualViewport?u.visualViewport.width:innerWidth,I=u.visualViewport?u.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,x=window.scrollY||pageYOffset,y=o.getBoundingClientRect(),b=y.height,w=y.width,k=y.top,C=y.right,M=y.bottom,E=y.left,D="start"===a||"nearest"===a?k:"end"===a?M:k+b/2,S="center"===l?E+w/2:"end"===l?C:E,O=[],K=0;K<h.length;K++){var R=h[K],V=R.getBoundingClientRect(),A=V.height,N=V.width,_=V.top,P=V.right,T=V.bottom,L=V.left;if("if-needed"===s&&k>=0&&E>=0&&M<=I&&C<=m&&k>=_&&M<=T&&E>=L&&C<=P)break;var F=getComputedStyle(R),H=parseInt(F.borderLeftWidth,10),W=parseInt(F.borderTopWidth,10),B=parseInt(F.borderRightWidth,10),j=parseInt(F.borderBottomWidth,10),$=0,z=0,U="offsetWidth"in R?R.offsetWidth-R.clientWidth-H-B:0,G="offsetHeight"in R?R.offsetHeight-R.clientHeight-W-j:0;if(g===R)$="start"===a?D:"end"===a?D-I:"nearest"===a?r(x,x+I,I,W,j,x+D,x+D+b,b):D-I/2,z="start"===l?S:"center"===l?S-m/2:"end"===l?S-m:r(v,v+m,m,H,B,v+S,v+S+w,w),$=Math.max(0,$+x),z=Math.max(0,z+v);else{$="start"===a?D-_-W:"end"===a?D-T+j+G:"nearest"===a?r(_,T,A,W,j+G,D,D+b,b):D-(_+A/2)+G/2,z="start"===l?S-L-H:"center"===l?S-(L+N/2)+U/2:"end"===l?S-P+B+U:r(L,P,N,H,B+U,S,S+w,w);var X=R.scrollLeft,Y=R.scrollTop;D+=Y-($=Math.max(0,Math.min(Y+$,R.scrollHeight-A+G))),S+=X-(z=Math.max(0,Math.min(X+z,R.scrollWidth-N+U)))}O.push({el:R,top:$,left:z})}return O})(o,{boundary:i,block:"nearest",scrollMode:"if-needed"}).forEach(function(o){var i=o.el,u=o.top,s=o.left;i.scrollTop=u,i.scrollLeft=s})},circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function getDefaultValue$1(o,i,u){void 0===u&&(u=f);var s="default"+capitalizeString(i);return s in o?o[s]:u[i]}function getInitialValue$1(o,i,u){if(void 0===u&&(u=f),i in o)return o[i];var s="initial"+capitalizeString(i);return s in o?o[s]:getDefaultValue$1(o,i,u)}function getInitialState$2(o){var i=getInitialValue$1(o,"selectedItem"),u=getInitialValue$1(o,"isOpen"),s=getInitialValue$1(o,"highlightedIndex"),a=getInitialValue$1(o,"inputValue");return{highlightedIndex:s<0&&i&&u?o.items.indexOf(i):s,isOpen:u,selectedItem:i,inputValue:a}}function getHighlightedIndexOnOpen(o,i,u,s){var a=o.items,l=o.initialHighlightedIndex,c=o.defaultHighlightedIndex,d=i.selectedItem,f=i.highlightedIndex;return 0===a.length?-1:void 0!==l&&f===l?l:void 0!==c?c:d?0===u?a.indexOf(d):getNextWrappingIndex(u,a.indexOf(d),a.length,s,!1):0===u?-1:u<0?a.length-1:0}function useMouseAndTouchTracker(o,i,u,s){var a=(0,l.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,l.useEffect)(function(){var onMouseDown=function(){a.current.isMouseDown=!0},onMouseUp=function(l){a.current.isMouseDown=!1,o&&!targetWithinDownshift(l.target,i.map(function(o){return o.current}),u)&&s()},onTouchStart=function(){a.current.isTouchMove=!1},onTouchMove=function(){a.current.isTouchMove=!0},onTouchEnd=function(l){!o||a.current.isTouchMove||targetWithinDownshift(l.target,i.map(function(o){return o.current}),u,!1)||s()};return u.addEventListener("mousedown",onMouseDown),u.addEventListener("mouseup",onMouseUp),u.addEventListener("touchstart",onTouchStart),u.addEventListener("touchmove",onTouchMove),u.addEventListener("touchend",onTouchEnd),function(){u.removeEventListener("mousedown",onMouseDown),u.removeEventListener("mouseup",onMouseUp),u.removeEventListener("touchstart",onTouchStart),u.removeEventListener("touchmove",onTouchMove),u.removeEventListener("touchend",onTouchEnd)}},[o,u]),a}var useGetterPropsCalledChecker=function(){return noop};function useA11yMessageSetter(o,i,u){var s=u.isInitialMount,a=u.highlightedIndex,c=u.items,d=u.environment,f=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(u,["isInitialMount","highlightedIndex","items","environment"]);(0,l.useEffect)(function(){s||g(function(){return o(extends_extends({highlightedIndex:a,highlightedItem:c[a],resultCount:c.length},f))},d.document)},i)}function useScrollIntoView(o){var i=o.highlightedIndex,u=o.isOpen,s=o.itemRefs,a=o.getItemNodeFromIndex,c=o.menuElement,d=o.scrollIntoView,f=(0,l.useRef)(!0);return h(function(){!(i<0)&&u&&Object.keys(s.current).length&&(!1===f.current?f.current=!0:d(a(i),c))},[i]),f}function downshiftCommonReducer(o,i,u){var s,a=i.type,l=i.props;switch(a){case u.ItemMouseMove:s={highlightedIndex:i.index};break;case u.MenuMouseLeave:s={highlightedIndex:-1};break;case u.ToggleButtonClick:case u.FunctionToggleMenu:s={isOpen:!o.isOpen,highlightedIndex:o.isOpen?-1:getHighlightedIndexOnOpen(l,o,0)};break;case u.FunctionOpenMenu:s={isOpen:!0,highlightedIndex:getHighlightedIndexOnOpen(l,o,0)};break;case u.FunctionCloseMenu:s={isOpen:!1};break;case u.FunctionSetHighlightedIndex:s={highlightedIndex:i.highlightedIndex};break;case u.FunctionSetInputValue:s={inputValue:i.inputValue};break;case u.FunctionReset:s={highlightedIndex:getDefaultValue$1(l,"highlightedIndex"),isOpen:getDefaultValue$1(l,"isOpen"),selectedItem:getDefaultValue$1(l,"selectedItem"),inputValue:getDefaultValue$1(l,"inputValue")};break;default:throw Error("Reducer called without proper action type.")}return extends_extends({},o,s)}function getItemIndexByCharacterKey(o,i,u,s,a){for(var l=o.toLowerCase(),c=0;c<u.length;c++){var d=(c+i+1)%u.length;if(s(u[d]).toLowerCase().startsWith(l)){var f=a(d);if(!(f&&f.hasAttribute("disabled")))return d}}return i}a().array.isRequired,a().func,a().func,a().func,a().bool,a().number,a().number,a().number,a().bool,a().bool,a().bool,a().any,a().any,a().any,a().string,a().string,a().string,a().func,a().string,a().func,a().func,a().func,a().func,a().func,a().shape({addEventListener:a().func,removeEventListener:a().func,document:a().shape({getElementById:a().func,activeElement:a().any,body:a().any})});var m=extends_extends({},p,{getA11yStatusMessage:function(o){var i=o.isOpen,u=o.resultCount,s=o.previousResultCount;return i?u?u!==s?u+" result"+(1===u?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}}),I=Object.freeze({__proto__:null,MenuKeyDownArrowDown:0,MenuKeyDownArrowUp:1,MenuKeyDownEscape:2,MenuKeyDownHome:3,MenuKeyDownEnd:4,MenuKeyDownEnter:5,MenuKeyDownSpaceButton:6,MenuKeyDownCharacter:7,MenuBlur:8,MenuMouseLeave:9,ItemMouseMove:10,ItemClick:11,ToggleButtonClick:12,ToggleButtonKeyDownArrowDown:13,ToggleButtonKeyDownArrowUp:14,ToggleButtonKeyDownCharacter:15,FunctionToggleMenu:16,FunctionOpenMenu:17,FunctionCloseMenu:18,FunctionSetHighlightedIndex:19,FunctionSelectItem:20,FunctionSetInputValue:21,FunctionReset:22});function downshiftSelectReducer(o,i){var u,s=i.type,a=i.props,l=i.shiftKey;switch(s){case 11:u={isOpen:getDefaultValue$1(a,"isOpen"),highlightedIndex:getDefaultValue$1(a,"highlightedIndex"),selectedItem:a.items[i.index]};break;case 15:var c=i.key,d=""+o.inputValue+c,f=getItemIndexByCharacterKey(d,o.selectedItem?a.items.indexOf(o.selectedItem):-1,a.items,a.itemToString,i.getItemNodeFromIndex);u=extends_extends({inputValue:d},f>=0&&{selectedItem:a.items[f]});break;case 13:u={highlightedIndex:getHighlightedIndexOnOpen(a,o,1,i.getItemNodeFromIndex),isOpen:!0};break;case 14:u={highlightedIndex:getHighlightedIndexOnOpen(a,o,-1,i.getItemNodeFromIndex),isOpen:!0};break;case 5:case 6:u=extends_extends({isOpen:getDefaultValue$1(a,"isOpen"),highlightedIndex:getDefaultValue$1(a,"highlightedIndex")},o.highlightedIndex>=0&&{selectedItem:a.items[o.highlightedIndex]});break;case 3:u={highlightedIndex:getNextNonDisabledIndex(1,0,a.items.length,i.getItemNodeFromIndex,!1)};break;case 4:u={highlightedIndex:getNextNonDisabledIndex(-1,a.items.length-1,a.items.length,i.getItemNodeFromIndex,!1)};break;case 2:case 8:u={isOpen:!1,highlightedIndex:-1};break;case 7:var g=i.key,h=""+o.inputValue+g,p=getItemIndexByCharacterKey(h,o.highlightedIndex,a.items,a.itemToString,i.getItemNodeFromIndex);u=extends_extends({inputValue:h},p>=0&&{highlightedIndex:p});break;case 0:u={highlightedIndex:getNextWrappingIndex(l?5:1,o.highlightedIndex,a.items.length,i.getItemNodeFromIndex,a.circularNavigation)};break;case 1:u={highlightedIndex:getNextWrappingIndex(l?-5:-1,o.highlightedIndex,a.items.length,i.getItemNodeFromIndex,a.circularNavigation)};break;case 20:u={selectedItem:i.selectedItem};break;default:return downshiftCommonReducer(o,i,I)}return extends_extends({},o,u)}function useSelect(o){void 0===o&&(o={});var i=extends_extends({},m,o),u=i.items,s=i.scrollIntoView,a=i.environment,c=i.initialIsOpen,d=i.defaultIsOpen,f=i.itemToString,g=i.getA11ySelectionMessage,h=i.getA11yStatusMessage,p=useControlledReducer$1(downshiftSelectReducer,getInitialState$2(i),i),I=p[0],v=p[1],x=I.isOpen,y=I.highlightedIndex,b=I.selectedItem,w=I.inputValue,k=(0,l.useRef)(null),C=(0,l.useRef)(null),M=(0,l.useRef)({}),E=(0,l.useRef)(!0),D=(0,l.useRef)(null),S=useElementIds(i),O=(0,l.useRef)(),K=(0,l.useRef)(!0),R=useLatestRef({state:I,props:i}),V=(0,l.useCallback)(function(o){return M.current[S.getItemId(o)]},[S]);useA11yMessageSetter(h,[x,y,w,u],extends_extends({isInitialMount:K.current,previousResultCount:O.current,items:u,environment:a,itemToString:f},I)),useA11yMessageSetter(g,[b],extends_extends({isInitialMount:K.current,previousResultCount:O.current,items:u,environment:a,itemToString:f},I));var A=useScrollIntoView({menuElement:C.current,highlightedIndex:y,isOpen:x,itemRefs:M,scrollIntoView:s,getItemNodeFromIndex:V});(0,l.useEffect)(function(){return D.current=debounce(function(o){o({type:21,inputValue:""})},500),function(){D.current.cancel()}},[]),(0,l.useEffect)(function(){w&&D.current(v)},[v,w]),K.current,(0,l.useEffect)(function(){if(K.current){(c||d||x)&&C.current&&C.current.focus();return}if(x){C.current&&C.current.focus();return}a.document.activeElement===C.current&&k.current&&(E.current=!1,k.current.focus())},[x]),(0,l.useEffect)(function(){K.current||(O.current=u.length)});var N=useMouseAndTouchTracker(x,[C,k],a,function(){v({type:8})}),_=useGetterPropsCalledChecker("getMenuProps","getToggleButtonProps");(0,l.useEffect)(function(){K.current=!1},[]),(0,l.useEffect)(function(){x||(M.current={})},[x]);var P=(0,l.useMemo)(function(){return{ArrowDown:function(o){o.preventDefault(),v({type:13,getItemNodeFromIndex:V,shiftKey:o.shiftKey})},ArrowUp:function(o){o.preventDefault(),v({type:14,getItemNodeFromIndex:V,shiftKey:o.shiftKey})}}},[v,V]),T=(0,l.useMemo)(function(){return{ArrowDown:function(o){o.preventDefault(),v({type:0,getItemNodeFromIndex:V,shiftKey:o.shiftKey})},ArrowUp:function(o){o.preventDefault(),v({type:1,getItemNodeFromIndex:V,shiftKey:o.shiftKey})},Home:function(o){o.preventDefault(),v({type:3,getItemNodeFromIndex:V})},End:function(o){o.preventDefault(),v({type:4,getItemNodeFromIndex:V})},Escape:function(){v({type:2})},Enter:function(o){o.preventDefault(),v({type:5})}," ":function(o){o.preventDefault(),v({type:6})}}},[v,V]),L=(0,l.useCallback)(function(){v({type:16})},[v]),F=(0,l.useCallback)(function(){v({type:18})},[v]),H=(0,l.useCallback)(function(){v({type:17})},[v]),W=(0,l.useCallback)(function(o){v({type:19,highlightedIndex:o})},[v]),B=(0,l.useCallback)(function(o){v({type:20,selectedItem:o})},[v]),j=(0,l.useCallback)(function(){v({type:22})},[v]),$=(0,l.useCallback)(function(o){v({type:21,inputValue:o})},[v]),z=(0,l.useCallback)(function(o){return extends_extends({id:S.labelId,htmlFor:S.toggleButtonId},o)},[S]),U=(0,l.useCallback)(function(o,i){var u,s=void 0===o?{}:o,a=s.onMouseLeave,l=s.refKey,c=void 0===l?"ref":l,d=s.onKeyDown,f=s.onBlur,g=s.ref,h=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(s,["onMouseLeave","refKey","onKeyDown","onBlur","ref"]),p=(void 0===i?{}:i).suppressRefError,m=void 0!==p&&p,I=R.current.state;return _("getMenuProps",m,c,C),extends_extends(((u={})[c]=handleRefs(g,function(o){C.current=o}),u.id=S.menuId,u.role="listbox",u["aria-labelledby"]=S.labelId,u.tabIndex=-1,u),I.isOpen&&I.highlightedIndex>-1&&{"aria-activedescendant":S.getItemId(I.highlightedIndex)},{onMouseLeave:callAllEventHandlers(a,function(){v({type:9})}),onKeyDown:callAllEventHandlers(d,function(o){var i=normalizeArrowKey(o);i&&T[i]?T[i](o):isAcceptedCharacterKey(i)&&v({type:7,key:i,getItemNodeFromIndex:V})}),onBlur:callAllEventHandlers(f,function(){if(!1===E.current){E.current=!0;return}N.current.isMouseDown||v({type:8})})},h)},[v,R,T,N,_,S,V]);return{getToggleButtonProps:(0,l.useCallback)(function(o,i){var u,s=void 0===o?{}:o,a=s.onClick,l=s.onKeyDown,c=s.refKey,d=void 0===c?"ref":c,f=s.ref,g=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(s,["onClick","onKeyDown","refKey","ref"]),h=(void 0===i?{}:i).suppressRefError,p=void 0!==h&&h,m=extends_extends(((u={})[d]=handleRefs(f,function(o){k.current=o}),u.id=S.toggleButtonId,u["aria-haspopup"]="listbox",u["aria-expanded"]=R.current.state.isOpen,u["aria-labelledby"]=S.labelId+" "+S.toggleButtonId,u),g);return g.disabled||(m.onClick=callAllEventHandlers(a,function(){v({type:12})}),m.onKeyDown=callAllEventHandlers(l,function(o){var i=normalizeArrowKey(o);i&&P[i]?P[i](o):isAcceptedCharacterKey(i)&&v({type:15,key:i,getItemNodeFromIndex:V})})),_("getToggleButtonProps",p,d,k),m},[v,R,P,_,S,V]),getLabelProps:z,getMenuProps:U,getItemProps:(0,l.useCallback)(function(o){var i,u=void 0===o?{}:o,s=u.item,a=u.index,l=u.onMouseMove,c=u.onClick,d=u.refKey,f=u.ref,g=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(u,["item","index","onMouseMove","onClick","refKey","ref"]),h=R.current,p=h.state,m=getItemIndex(a,s,h.props.items);if(m<0)throw Error("Pass either item or item index in getItemProps!");var I=extends_extends(((i={role:"option","aria-selected":""+(m===p.highlightedIndex),id:S.getItemId(m)})[void 0===d?"ref":d]=handleRefs(f,function(o){o&&(M.current[S.getItemId(m)]=o)}),i),g);return g.disabled||(I.onMouseMove=callAllEventHandlers(l,function(){a!==p.highlightedIndex&&(A.current=!1,v({type:10,index:a}))}),I.onClick=callAllEventHandlers(c,function(){v({type:11,index:a})})),I},[v,R,A,S]),toggleMenu:L,openMenu:H,closeMenu:F,setHighlightedIndex:W,selectItem:B,reset:j,setInputValue:$,highlightedIndex:y,isOpen:x,selectedItem:b,inputValue:w}}useSelect.stateChangeTypes=I;var v=Object.freeze({__proto__:null,InputKeyDownArrowDown:0,InputKeyDownArrowUp:1,InputKeyDownEscape:2,InputKeyDownHome:3,InputKeyDownEnd:4,InputKeyDownEnter:5,InputChange:6,InputBlur:7,MenuMouseLeave:8,ItemMouseMove:9,ItemClick:10,ToggleButtonClick:11,FunctionToggleMenu:12,FunctionOpenMenu:13,FunctionCloseMenu:14,FunctionSetHighlightedIndex:15,FunctionSelectItem:16,FunctionSetInputValue:17,FunctionReset:18,ControlledPropUpdatedSelectedItem:19});a().array.isRequired,a().func,a().func,a().func,a().bool,a().number,a().number,a().number,a().bool,a().bool,a().bool,a().any,a().any,a().any,a().string,a().string,a().string,a().string,a().string,a().string,a().func,a().string,a().string,a().func,a().func,a().func,a().func,a().func,a().func,a().shape({addEventListener:a().func,removeEventListener:a().func,document:a().shape({getElementById:a().func,activeElement:a().any,body:a().any})});var x=extends_extends({},p,{getA11yStatusMessage:function(o){var i=o.isOpen,u=o.resultCount,s=o.previousResultCount;return i?u?u!==s?u+" result"+(1===u?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""},circularNavigation:!0});function downshiftUseComboboxReducer(o,i){var u,s=i.type,a=i.props,l=i.shiftKey;switch(s){case 10:u={isOpen:getDefaultValue$1(a,"isOpen"),highlightedIndex:getDefaultValue$1(a,"highlightedIndex"),selectedItem:a.items[i.index],inputValue:a.itemToString(a.items[i.index])};break;case 0:u=o.isOpen?{highlightedIndex:getNextWrappingIndex(l?5:1,o.highlightedIndex,a.items.length,i.getItemNodeFromIndex,a.circularNavigation)}:{highlightedIndex:getHighlightedIndexOnOpen(a,o,1,i.getItemNodeFromIndex),isOpen:a.items.length>=0};break;case 1:u=o.isOpen?{highlightedIndex:getNextWrappingIndex(l?-5:-1,o.highlightedIndex,a.items.length,i.getItemNodeFromIndex,a.circularNavigation)}:{highlightedIndex:getHighlightedIndexOnOpen(a,o,-1,i.getItemNodeFromIndex),isOpen:a.items.length>=0};break;case 5:u=extends_extends({},o.isOpen&&o.highlightedIndex>=0&&{selectedItem:a.items[o.highlightedIndex],isOpen:getDefaultValue$1(a,"isOpen"),highlightedIndex:getDefaultValue$1(a,"highlightedIndex"),inputValue:a.itemToString(a.items[o.highlightedIndex])});break;case 2:u=extends_extends({isOpen:!1,highlightedIndex:-1},!o.isOpen&&{selectedItem:null,inputValue:""});break;case 3:u={highlightedIndex:getNextNonDisabledIndex(1,0,a.items.length,i.getItemNodeFromIndex,!1)};break;case 4:u={highlightedIndex:getNextNonDisabledIndex(-1,a.items.length-1,a.items.length,i.getItemNodeFromIndex,!1)};break;case 7:u=extends_extends({isOpen:!1,highlightedIndex:-1},o.highlightedIndex>=0&&i.selectItem&&{selectedItem:a.items[o.highlightedIndex],inputValue:a.itemToString(a.items[o.highlightedIndex])});break;case 6:u={isOpen:!0,highlightedIndex:getDefaultValue$1(a,"highlightedIndex"),inputValue:i.inputValue};break;case 16:u={selectedItem:i.selectedItem,inputValue:a.itemToString(i.selectedItem)};break;case 19:u={inputValue:i.inputValue};break;default:return downshiftCommonReducer(o,i,v)}return extends_extends({},o,u)}function useCombobox(o){void 0===o&&(o={});var i,u,s,a,c,d,f,g=extends_extends({},x,o),h=g.initialIsOpen,p=g.defaultIsOpen,m=g.items,I=g.scrollIntoView,v=g.environment,y=g.getA11yStatusMessage,b=g.getA11ySelectionMessage,w=g.itemToString,k=(u=(i=getInitialState$2(g)).selectedItem,""===(s=i.inputValue)&&u&&void 0===g.defaultInputValue&&void 0===g.initialInputValue&&void 0===g.inputValue&&(s=g.itemToString(u)),extends_extends({},i,{inputValue:s})),C=(a=(0,l.useRef)(),d=(c=useEnhancedReducer(downshiftUseComboboxReducer,k,g))[0],f=c[1],(0,l.useEffect)(function(){void 0!==g.selectedItem&&(a.current!==g.selectedItem&&f({type:19,inputValue:g.itemToString(g.selectedItem)}),a.current=d.selectedItem===a.current?g.selectedItem:d.selectedItem)}),[getState(d,g),f]),M=C[0],E=C[1],D=M.isOpen,S=M.highlightedIndex,O=M.selectedItem,K=M.inputValue,R=(0,l.useRef)(null),V=(0,l.useRef)({}),A=(0,l.useRef)(null),N=(0,l.useRef)(null),_=(0,l.useRef)(null),P=(0,l.useRef)(!0),T=useElementIds(g),L=(0,l.useRef)(),F=useLatestRef({state:M,props:g}),H=(0,l.useCallback)(function(o){return V.current[T.getItemId(o)]},[T]);useA11yMessageSetter(y,[D,S,K,m],extends_extends({isInitialMount:P.current,previousResultCount:L.current,items:m,environment:v,itemToString:w},M)),useA11yMessageSetter(b,[O],extends_extends({isInitialMount:P.current,previousResultCount:L.current,items:m,environment:v,itemToString:w},M));var W=useScrollIntoView({menuElement:R.current,highlightedIndex:S,isOpen:D,itemRefs:V,scrollIntoView:I,getItemNodeFromIndex:H});P.current,(0,l.useEffect)(function(){(h||p||D)&&A.current&&A.current.focus()},[]),(0,l.useEffect)(function(){P.current||(L.current=m.length)});var B=useMouseAndTouchTracker(D,[_,R,N],v,function(){E({type:7,selectItem:!1})}),j=useGetterPropsCalledChecker("getInputProps","getComboboxProps","getMenuProps");(0,l.useEffect)(function(){P.current=!1},[]),(0,l.useEffect)(function(){D||(V.current={})},[D]);var $=(0,l.useMemo)(function(){return{ArrowDown:function(o){o.preventDefault(),E({type:0,shiftKey:o.shiftKey,getItemNodeFromIndex:H})},ArrowUp:function(o){o.preventDefault(),E({type:1,shiftKey:o.shiftKey,getItemNodeFromIndex:H})},Home:function(o){F.current.state.isOpen&&(o.preventDefault(),E({type:3,getItemNodeFromIndex:H}))},End:function(o){F.current.state.isOpen&&(o.preventDefault(),E({type:4,getItemNodeFromIndex:H}))},Escape:function(){var o=F.current.state;(o.isOpen||o.inputValue||o.selectedItem||o.highlightedIndex>-1)&&E({type:2})},Enter:function(o){var i=F.current.state;i.isOpen&&!(i.highlightedIndex<0)&&229!==o.which&&(o.preventDefault(),E({type:5,getItemNodeFromIndex:H}))}}},[E,F,H]),z=(0,l.useCallback)(function(o){return extends_extends({id:T.labelId,htmlFor:T.inputId},o)},[T]),U=(0,l.useCallback)(function(o,i){var u,s=void 0===o?{}:o,a=s.onMouseLeave,l=s.refKey,c=void 0===l?"ref":l,d=s.ref,f=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(s,["onMouseLeave","refKey","ref"]),g=(void 0===i?{}:i).suppressRefError;return j("getMenuProps",void 0!==g&&g,c,R),extends_extends(((u={})[c]=handleRefs(d,function(o){R.current=o}),u.id=T.menuId,u.role="listbox",u["aria-labelledby"]=T.labelId,u.onMouseLeave=callAllEventHandlers(a,function(){E({type:8})}),u),f)},[E,j,T]),G=(0,l.useCallback)(function(o){var i,u,s=void 0===o?{}:o,a=s.item,l=s.index,c=s.refKey,d=s.ref,f=s.onMouseMove,g=s.onClick;s.onPress;var h=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(s,["item","index","refKey","ref","onMouseMove","onClick","onPress"]),p=F.current,m=p.props,I=p.state,v=getItemIndex(l,a,m.items);if(v<0)throw Error("Pass either item or item index in getItemProps!");return extends_extends(((i={})[void 0===c?"ref":c]=handleRefs(d,function(o){o&&(V.current[T.getItemId(v)]=o)}),i.role="option",i["aria-selected"]=""+(v===I.highlightedIndex),i.id=T.getItemId(v),i),!h.disabled&&((u={onMouseMove:callAllEventHandlers(f,function(){l!==I.highlightedIndex&&(W.current=!1,E({type:9,index:l}))})}).onClick=callAllEventHandlers(g,function(){E({type:10,index:l}),A.current&&A.current.focus()}),u),h)},[E,F,W,T]),X=(0,l.useCallback)(function(o){var i,u=void 0===o?{}:o,s=u.onClick;u.onPress;var a=u.refKey,l=u.ref,c=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(u,["onClick","onPress","refKey","ref"]);return extends_extends(((i={})[void 0===a?"ref":a]=handleRefs(l,function(o){N.current=o}),i.id=T.toggleButtonId,i.tabIndex=-1,i),!c.disabled&&extends_extends({},{onClick:callAllEventHandlers(s,function(){E({type:11}),!F.current.state.isOpen&&A.current&&A.current.focus()})}),c)},[E,F,T]),Y=(0,l.useCallback)(function(o,i){var u,s,a=void 0===o?{}:o,l=a.onKeyDown,c=a.onChange,d=a.onInput,f=a.onBlur;a.onChangeText;var g=a.refKey,h=void 0===g?"ref":g,p=a.ref,m=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(a,["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"]),I=(void 0===i?{}:i).suppressRefError;j("getInputProps",void 0!==I&&I,h,A);var v=F.current.state,x={};return m.disabled||((s={}).onChange=callAllEventHandlers(c,d,function(o){E({type:6,inputValue:o.target.value})}),s.onKeyDown=callAllEventHandlers(l,function(o){var i=normalizeArrowKey(o);i&&$[i]&&$[i](o)}),s.onBlur=callAllEventHandlers(f,function(){v.isOpen&&!B.current.isMouseDown&&E({type:7,selectItem:!0})}),x=s),extends_extends(((u={})[h]=handleRefs(p,function(o){A.current=o}),u.id=T.inputId,u["aria-autocomplete"]="list",u["aria-controls"]=T.menuId,u),v.isOpen&&v.highlightedIndex>-1&&{"aria-activedescendant":T.getItemId(v.highlightedIndex)},{"aria-labelledby":T.labelId,autoComplete:"off",value:v.inputValue},x,m)},[E,$,F,B,j,T]),q=(0,l.useCallback)(function(o,i){var u,s=void 0===o?{}:o,a=s.refKey,l=void 0===a?"ref":a,c=s.ref,d=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(s,["refKey","ref"]),f=(void 0===i?{}:i).suppressRefError;return j("getComboboxProps",void 0!==f&&f,l,_),extends_extends(((u={})[l]=handleRefs(c,function(o){_.current=o}),u.role="combobox",u["aria-haspopup"]="listbox",u["aria-owns"]=T.menuId,u["aria-expanded"]=F.current.state.isOpen,u),d)},[F,j,T]),J=(0,l.useCallback)(function(){E({type:12})},[E]),Q=(0,l.useCallback)(function(){E({type:14})},[E]),Z=(0,l.useCallback)(function(){E({type:13})},[E]),ee=(0,l.useCallback)(function(o){E({type:15,highlightedIndex:o})},[E]),et=(0,l.useCallback)(function(o){E({type:16,selectedItem:o})},[E]);return{getItemProps:G,getLabelProps:z,getMenuProps:U,getInputProps:Y,getComboboxProps:q,getToggleButtonProps:X,toggleMenu:J,openMenu:Z,closeMenu:Q,setHighlightedIndex:ee,setInputValue:(0,l.useCallback)(function(o){E({type:17,inputValue:o})},[E]),selectItem:et,reset:(0,l.useCallback)(function(){E({type:18})},[E]),highlightedIndex:S,isOpen:D,selectedItem:O,inputValue:K}}useCombobox.stateChangeTypes=v;var y={activeIndex:-1,selectedItems:[]};function isKeyDownOperationPermitted(o){if(o.shiftKey||o.metaKey||o.ctrlKey||o.altKey)return!1;var i=o.target;return!(i instanceof HTMLInputElement)||""===i.value||0===i.selectionStart&&0===i.selectionEnd}a().array,a().array,a().array,a().func,a().func,a().func,a().number,a().number,a().number,a().func,a().func,a().string,a().string,a().shape({addEventListener:a().func,removeEventListener:a().func,document:a().shape({getElementById:a().func,activeElement:a().any,body:a().any})});var b={itemToString:p.itemToString,stateReducer:p.stateReducer,environment:p.environment,getA11yRemovalMessage:function(o){var i=o.removedSelectedItem;return(0,o.itemToString)(i)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},w=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 downshiftMultipleSelectionReducer(o,i){var u,s=i.type,a=i.index,l=i.props,c=i.selectedItem,d=o.activeIndex,f=o.selectedItems;switch(s){case 0:u={activeIndex:a};break;case 4:u={activeIndex:d-1<0?0:d-1};break;case 3:u={activeIndex:d+1>=f.length?-1:d+1};break;case 2:case 1:var g=d;1===f.length?g=-1:d===f.length-1&&(g=f.length-2),u=extends_extends({selectedItems:[].concat(f.slice(0,d),f.slice(d+1))},{activeIndex:g});break;case 5:u={activeIndex:f.length-1};break;case 6:u={selectedItems:f.slice(0,f.length-1)};break;case 8:u={selectedItems:[].concat(f,[c])};break;case 7:u={activeIndex:-1};break;case 9:var h=d,p=f.indexOf(c);1===f.length?h=-1:p===f.length-1&&(h=f.length-2),u=extends_extends({selectedItems:[].concat(f.slice(0,p),f.slice(p+1))},{activeIndex:h});break;case 10:u={selectedItems:i.selectedItems};break;case 11:u={activeIndex:i.activeIndex};break;case 12:u={activeIndex:getDefaultValue$1(l,"activeIndex",y),selectedItems:getDefaultValue$1(l,"selectedItems",y)};break;default:throw Error("Reducer called without proper action type.")}return extends_extends({},o,u)}function useMultipleSelection(o){void 0===o&&(o={});var i=extends_extends({},b,o),u=i.getA11yRemovalMessage,s=i.itemToString,a=i.environment,c=i.keyNavigationNext,d=i.keyNavigationPrevious,f=useControlledReducer$1(downshiftMultipleSelectionReducer,{activeIndex:getInitialValue$1(i,"activeIndex",y),selectedItems:getInitialValue$1(i,"selectedItems",y)},i),g=f[0],h=f[1],p=g.activeIndex,m=g.selectedItems,I=(0,l.useRef)(!0),v=(0,l.useRef)(null),x=(0,l.useRef)(m),w=(0,l.useRef)();w.current=[];var k=useLatestRef({state:g,props:i});(0,l.useEffect)(function(){if(!I.current){if(m.length<x.current.length){var o=x.current.find(function(o){return 0>m.indexOf(o)});setStatus(u({itemToString:s,resultCount:m.length,removedSelectedItem:o,activeIndex:p,activeSelectedItem:m[p]}),a.document)}x.current=m}},[m.length]),(0,l.useEffect)(function(){!I.current&&(-1===p&&v.current?v.current.focus():w.current[p]&&w.current[p].focus())},[p]),I.current;var C=useGetterPropsCalledChecker("getDropdownProps");(0,l.useEffect)(function(){I.current=!1},[]);var M=(0,l.useMemo)(function(){var o;return(o={})[d]=function(){h({type:4})},o[c]=function(){h({type:3})},o.Delete=function(){h({type:1})},o.Backspace=function(){h({type:2})},o},[h,c,d]),E=(0,l.useMemo)(function(){var o;return(o={})[d]=function(o){isKeyDownOperationPermitted(o)&&h({type:5})},o.Backspace=function(o){isKeyDownOperationPermitted(o)&&h({type:6})},o},[h,d]);return{getSelectedItemProps:(0,l.useCallback)(function(o){var i,u=void 0===o?{}:o,s=u.refKey,a=u.ref,l=u.onClick,c=u.onKeyDown,d=u.selectedItem,f=u.index,g=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(u,["refKey","ref","onClick","onKeyDown","selectedItem","index"]),p=k.current.state;if(0>getItemIndex(f,d,p.selectedItems))throw Error("Pass either selectedItem or index in getSelectedItemProps!");return extends_extends(((i={})[void 0===s?"ref":s]=handleRefs(a,function(o){o&&w.current.push(o)}),i.tabIndex=f===p.activeIndex?0:-1,i.onClick=callAllEventHandlers(l,function(){h({type:0,index:f})}),i.onKeyDown=callAllEventHandlers(c,function(o){var i=normalizeArrowKey(o);i&&M[i]&&M[i](o)}),i),g)},[h,k,M]),getDropdownProps:(0,l.useCallback)(function(o,i){var u,s=void 0===o?{}:o,a=s.refKey,l=void 0===a?"ref":a,c=s.ref,d=s.onKeyDown,f=s.onClick,g=s.preventKeyAction,p=void 0!==g&&g,m=objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(s,["refKey","ref","onKeyDown","onClick","preventKeyAction"]),I=(void 0===i?{}:i).suppressRefError;return C("getDropdownProps",void 0!==I&&I,l,v),extends_extends(((u={})[l]=handleRefs(c,function(o){o&&(v.current=o)}),u),!p&&{onKeyDown:callAllEventHandlers(d,function(o){var i=normalizeArrowKey(o);i&&E[i]&&E[i](o)}),onClick:callAllEventHandlers(f,function(){h({type:7})})},m)},[h,E,C]),addSelectedItem:(0,l.useCallback)(function(o){h({type:8,selectedItem:o})},[h]),removeSelectedItem:(0,l.useCallback)(function(o){h({type:9,selectedItem:o})},[h]),setSelectedItems:(0,l.useCallback)(function(o){h({type:10,selectedItems:o})},[h]),setActiveIndex:(0,l.useCallback)(function(o){h({type:11,activeIndex:o})},[h]),reset:(0,l.useCallback)(function(){h({type:12})},[h]),selectedItems:m,activeIndex:p}}useMultipleSelection.stateChangeTypes=w},4899:function(o,i){/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var u=60103,s=60106,a=60107,l=60108,c=60114,d=60109,f=60110,g=60112,h=60113,p=60120,m=60115,I=60116;if("function"==typeof Symbol&&Symbol.for){var v=Symbol.for;v("react.element"),v("react.portal"),v("react.fragment"),v("react.strict_mode"),v("react.profiler"),v("react.provider"),v("react.context"),v("react.forward_ref"),v("react.suspense"),v("react.suspense_list"),v("react.memo"),v("react.lazy"),v("react.block"),v("react.server.block"),v("react.fundamental"),v("react.debug_trace_mode"),v("react.legacy_hidden")}},8041:function(o,i,u){u(4899)}}]);