woocommerce/6545.5a93ca9a.iframe.bundle.js

2 lines
56 KiB
JavaScript

/*! For license information please see 6545.5a93ca9a.iframe.bundle.js.LICENSE.txt */
"use strict";(self.webpackChunk_woocommerce_storybook=self.webpackChunk_woocommerce_storybook||[]).push([[6545],{"../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.join.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/export.js"),uncurryThis=__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/function-uncurry-this.js"),IndexedObject=__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/indexed-object.js"),toIndexedObject=__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/to-indexed-object.js"),arrayMethodIsStrict=__webpack_require__("../../node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/internals/array-method-is-strict.js"),nativeJoin=uncurryThis([].join);$({target:"Array",proto:!0,forced:IndexedObject!==Object||!arrayMethodIsStrict("join",",")},{join:function join(separator){return nativeJoin(toIndexedObject(this),void 0===separator?",":separator)}})},"../../node_modules/.pnpm/downshift@6.1.12_react@17.0.2/node_modules/downshift/dist/downshift.esm.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Bp:()=>useCombobox,mH:()=>useMultipleSelection,WM:()=>useSelect});var prop_types=__webpack_require__("../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),react=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");__webpack_require__("../../node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/index.js");function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}var tslib_es6=__webpack_require__("../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs");let idCounter=0;function noop(){}function scrollIntoView(node,menuNode){if(!node)return;const actions=function(e,i){var o=window,l=i.scrollMode,d=i.block,f=i.inline,h=i.boundary,u=i.skipOverflowHiddenElements,s="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var a,c,g=document.scrollingElement||document.documentElement,p=[],m=e;t(m)&&s(m);){if((m=null==(c=(a=m).parentElement)?a.getRootNode().host||null:c)===g){p.push(m);break}null!=m&&m===document.body&&n(m)&&!n(document.documentElement)||null!=m&&n(m,u)&&p.push(m)}for(var w=o.visualViewport?o.visualViewport.width:innerWidth,v=o.visualViewport?o.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,H=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),y=b.height,E=b.width,M=b.top,V=b.right,x=b.bottom,I=b.left,C="start"===d||"nearest"===d?M:"end"===d?x:M+y/2,R="center"===f?I+E/2:"end"===f?V:I,T=[],k=0;k<p.length;k++){var B=p[k],D=B.getBoundingClientRect(),O=D.height,X=D.width,Y=D.top,L=D.right,S=D.bottom,j=D.left;if("if-needed"===l&&M>=0&&I>=0&&x<=v&&V<=w&&M>=Y&&x<=S&&I>=j&&V<=L)return T;var N=getComputedStyle(B),q=parseInt(N.borderLeftWidth,10),z=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),F=parseInt(N.borderBottomWidth,10),G=0,J=0,K="offsetWidth"in B?B.offsetWidth-B.clientWidth-q-A:0,P="offsetHeight"in B?B.offsetHeight-B.clientHeight-z-F:0,Q="offsetWidth"in B?0===B.offsetWidth?0:X/B.offsetWidth:0,U="offsetHeight"in B?0===B.offsetHeight?0:O/B.offsetHeight:0;if(g===B)G="start"===d?C:"end"===d?C-v:"nearest"===d?r(H,H+v,v,z,F,H+C,H+C+y,y):C-v/2,J="start"===f?R:"center"===f?R-w/2:"end"===f?R-w:r(W,W+w,w,q,A,W+R,W+R+E,E),G=Math.max(0,G+H),J=Math.max(0,J+W);else{G="start"===d?C-Y-z:"end"===d?C-S+F+P:"nearest"===d?r(Y,S,O,z,F+P,C,C+y,y):C-(Y+O/2)+P/2,J="start"===f?R-j-q:"center"===f?R-(j+X/2)+K/2:"end"===f?R-L+A+K:r(j,L,X,q,A+K,R,R+E,E);var Z=B.scrollLeft,$=B.scrollTop;C+=$-(G=Math.max(0,Math.min($+G/U,B.scrollHeight-O/U+P))),R+=Z-(J=Math.max(0,Math.min(Z+J/Q,B.scrollWidth-X/Q+K)))}T.push({el:B,top:G,left:J})}return T}(node,{boundary:menuNode,block:"nearest",scrollMode:"if-needed"});actions.forEach((_ref=>{let{el,top,left}=_ref;el.scrollTop=top,el.scrollLeft=left}))}function isOrContainsNode(parent,child,environment){return parent===child||child instanceof environment.Node&&parent.contains&&parent.contains(child)}function debounce(fn,time){let timeoutId;function cancel(){timeoutId&&clearTimeout(timeoutId)}function wrapper(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];cancel(),timeoutId=setTimeout((()=>{timeoutId=null,fn(...args)}),time)}return wrapper.cancel=cancel,wrapper}function callAllEventHandlers(){for(var _len2=arguments.length,fns=new Array(_len2),_key2=0;_key2<_len2;_key2++)fns[_key2]=arguments[_key2];return function(event){for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return fns.some((fn=>(fn&&fn(event,...args),event.preventDownshiftDefault||event.hasOwnProperty("nativeEvent")&&event.nativeEvent.preventDownshiftDefault)))}}function handleRefs(){for(var _len4=arguments.length,refs=new Array(_len4),_key4=0;_key4<_len4;_key4++)refs[_key4]=arguments[_key4];return node=>{refs.forEach((ref=>{"function"==typeof ref?ref(node):ref&&(ref.current=node)}))}}function generateId(){return String(idCounter++)}function getA11yStatusMessage$1(_ref2){let{isOpen,resultCount,previousResultCount}=_ref2;return isOpen?resultCount?resultCount!==previousResultCount?`${resultCount} result${1===resultCount?" is":"s are"} available, use up and down arrow keys to navigate. Press Enter key to select.`:"":"No results are available.":""}function getState(state,props){return Object.keys(state).reduce(((prevState,key)=>(prevState[key]=isControlledProp(props,key)?props[key]:state[key],prevState)),{})}function isControlledProp(props,key){return void 0!==props[key]}function normalizeArrowKey(event){const{key,keyCode}=event;return keyCode>=37&&keyCode<=40&&0!==key.indexOf("Arrow")?`Arrow${key}`:key}function getNextWrappingIndex(moveAmount,baseIndex,itemCount,getItemNodeFromIndex,circular){if(void 0===circular&&(circular=!0),0===itemCount)return-1;const itemsLastIndex=itemCount-1;("number"!=typeof baseIndex||baseIndex<0||baseIndex>=itemCount)&&(baseIndex=moveAmount>0?-1:itemsLastIndex+1);let newIndex=baseIndex+moveAmount;newIndex<0?newIndex=circular?itemsLastIndex:0:newIndex>itemsLastIndex&&(newIndex=circular?0:itemsLastIndex);const nonDisabledNewIndex=getNextNonDisabledIndex(moveAmount,newIndex,itemCount,getItemNodeFromIndex,circular);return-1===nonDisabledNewIndex?baseIndex>=itemCount?-1:baseIndex:nonDisabledNewIndex}function getNextNonDisabledIndex(moveAmount,baseIndex,itemCount,getItemNodeFromIndex,circular){const currentElementNode=getItemNodeFromIndex(baseIndex);if(!currentElementNode||!currentElementNode.hasAttribute("disabled"))return baseIndex;if(moveAmount>0){for(let index=baseIndex+1;index<itemCount;index++)if(!getItemNodeFromIndex(index).hasAttribute("disabled"))return index}else for(let index=baseIndex-1;index>=0;index--)if(!getItemNodeFromIndex(index).hasAttribute("disabled"))return index;return circular?moveAmount>0?getNextNonDisabledIndex(1,0,itemCount,getItemNodeFromIndex,!1):getNextNonDisabledIndex(-1,itemCount-1,itemCount,getItemNodeFromIndex,!1):-1}function targetWithinDownshift(target,downshiftElements,environment,checkActiveElement){return void 0===checkActiveElement&&(checkActiveElement=!0),downshiftElements.some((contextNode=>contextNode&&(isOrContainsNode(contextNode,target,environment)||checkActiveElement&&isOrContainsNode(contextNode,environment.document.activeElement,environment))))}const cleanupStatus=debounce((documentProp=>{getStatusDiv(documentProp).textContent=""}),500);function setStatus(status,documentProp){const div=getStatusDiv(documentProp);status&&(div.textContent=status,cleanupStatus(documentProp))}function getStatusDiv(documentProp){void 0===documentProp&&(documentProp=document);let statusDiv=documentProp.getElementById("a11y-status-message");return statusDiv||(statusDiv=documentProp.createElement("div"),statusDiv.setAttribute("id","a11y-status-message"),statusDiv.setAttribute("role","status"),statusDiv.setAttribute("aria-live","polite"),statusDiv.setAttribute("aria-relevant","additions text"),Object.assign(statusDiv.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),documentProp.body.appendChild(statusDiv),statusDiv)}const dropdownDefaultStateValues={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function callOnChangeProps(action,state,newState){const{props,type}=action,changes={};Object.keys(state).forEach((key=>{!function invokeOnChangeHandler(key,action,state,newState){const{props,type}=action,handler=`on${capitalizeString(key)}Change`;props[handler]&&void 0!==newState[key]&&newState[key]!==state[key]&&props[handler]({type,...newState})}(key,action,state,newState),newState[key]!==state[key]&&(changes[key]=newState[key])})),props.onStateChange&&Object.keys(changes).length&&props.onStateChange({type,...changes})}const updateA11yStatus=debounce(((getA11yMessage,document)=>{setStatus(getA11yMessage(),document)}),200),useIsomorphicLayoutEffect="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?react.useLayoutEffect:react.useEffect;function useElementIds(_ref){let{id=`downshift-${generateId()}`,labelId,menuId,getItemId,toggleButtonId,inputId}=_ref;return(0,react.useRef)({labelId:labelId||`${id}-label`,menuId:menuId||`${id}-menu`,getItemId:getItemId||(index=>`${id}-item-${index}`),toggleButtonId:toggleButtonId||`${id}-toggle-button`,inputId:inputId||`${id}-input`}).current}function getItemIndex(index,item,items){return void 0!==index?index:0===items.length?-1:items.indexOf(item)}function isAcceptedCharacterKey(key){return/^\S{1}$/.test(key)}function capitalizeString(string){return`${string.slice(0,1).toUpperCase()}${string.slice(1)}`}function useLatestRef(val){const ref=(0,react.useRef)(val);return ref.current=val,ref}function useEnhancedReducer(reducer,initialState,props){const prevStateRef=(0,react.useRef)(),actionRef=(0,react.useRef)(),enhancedReducer=(0,react.useCallback)(((state,action)=>{actionRef.current=action,state=getState(state,action.props);const changes=reducer(state,action);return action.props.stateReducer(state,{...action,changes})}),[reducer]),[state,dispatch]=(0,react.useReducer)(enhancedReducer,initialState),propsRef=useLatestRef(props),dispatchWithProps=(0,react.useCallback)((action=>dispatch({props:propsRef.current,...action})),[propsRef]),action=actionRef.current;return(0,react.useEffect)((()=>{action&&prevStateRef.current&&prevStateRef.current!==state&&callOnChangeProps(action,getState(prevStateRef.current,action.props),state),prevStateRef.current=state}),[state,props,action]),[state,dispatchWithProps]}function useControlledReducer$1(reducer,initialState,props){const[state,dispatch]=useEnhancedReducer(reducer,initialState,props);return[getState(state,props),dispatch]}const defaultProps$3={itemToString:function itemToString(item){return item?String(item):""},stateReducer:function stateReducer(s,a){return a.changes},getA11ySelectionMessage:function getA11ySelectionMessage(selectionParameters){const{selectedItem,itemToString:itemToStringLocal}=selectionParameters;return selectedItem?`${itemToStringLocal(selectedItem)} has been selected.`:""},scrollIntoView,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};function getDefaultValue$1(props,propKey,defaultStateValues){void 0===defaultStateValues&&(defaultStateValues=dropdownDefaultStateValues);const defaultValue=props[`default${capitalizeString(propKey)}`];return void 0!==defaultValue?defaultValue:defaultStateValues[propKey]}function getInitialValue$1(props,propKey,defaultStateValues){void 0===defaultStateValues&&(defaultStateValues=dropdownDefaultStateValues);const value=props[propKey];if(void 0!==value)return value;const initialValue=props[`initial${capitalizeString(propKey)}`];return void 0!==initialValue?initialValue:getDefaultValue$1(props,propKey,defaultStateValues)}function getInitialState$2(props){const selectedItem=getInitialValue$1(props,"selectedItem"),isOpen=getInitialValue$1(props,"isOpen"),highlightedIndex=getInitialValue$1(props,"highlightedIndex"),inputValue=getInitialValue$1(props,"inputValue");return{highlightedIndex:highlightedIndex<0&&selectedItem&&isOpen?props.items.indexOf(selectedItem):highlightedIndex,isOpen,selectedItem,inputValue}}function getHighlightedIndexOnOpen(props,state,offset,getItemNodeFromIndex){const{items,initialHighlightedIndex,defaultHighlightedIndex}=props,{selectedItem,highlightedIndex}=state;return 0===items.length?-1:void 0!==initialHighlightedIndex&&highlightedIndex===initialHighlightedIndex?initialHighlightedIndex:void 0!==defaultHighlightedIndex?defaultHighlightedIndex:selectedItem?0===offset?items.indexOf(selectedItem):getNextWrappingIndex(offset,items.indexOf(selectedItem),items.length,getItemNodeFromIndex,!1):0===offset?-1:offset<0?items.length-1:0}function useMouseAndTouchTracker(isOpen,downshiftElementRefs,environment,handleBlur){const mouseAndTouchTrackersRef=(0,react.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,react.useEffect)((()=>{const onMouseDown=()=>{mouseAndTouchTrackersRef.current.isMouseDown=!0},onMouseUp=event=>{mouseAndTouchTrackersRef.current.isMouseDown=!1,isOpen&&!targetWithinDownshift(event.target,downshiftElementRefs.map((ref=>ref.current)),environment)&&handleBlur()},onTouchStart=()=>{mouseAndTouchTrackersRef.current.isTouchMove=!1},onTouchMove=()=>{mouseAndTouchTrackersRef.current.isTouchMove=!0},onTouchEnd=event=>{!isOpen||mouseAndTouchTrackersRef.current.isTouchMove||targetWithinDownshift(event.target,downshiftElementRefs.map((ref=>ref.current)),environment,!1)||handleBlur()};return environment.addEventListener("mousedown",onMouseDown),environment.addEventListener("mouseup",onMouseUp),environment.addEventListener("touchstart",onTouchStart),environment.addEventListener("touchmove",onTouchMove),environment.addEventListener("touchend",onTouchEnd),function cleanup(){environment.removeEventListener("mousedown",onMouseDown),environment.removeEventListener("mouseup",onMouseUp),environment.removeEventListener("touchstart",onTouchStart),environment.removeEventListener("touchmove",onTouchMove),environment.removeEventListener("touchend",onTouchEnd)}}),[isOpen,environment]),mouseAndTouchTrackersRef}let useGetterPropsCalledChecker=()=>noop;function useA11yMessageSetter(getA11yMessage,dependencyArray,_ref2){let{isInitialMount,highlightedIndex,items,environment,...rest}=_ref2;(0,react.useEffect)((()=>{isInitialMount||updateA11yStatus((()=>getA11yMessage({highlightedIndex,highlightedItem:items[highlightedIndex],resultCount:items.length,...rest})),environment.document)}),dependencyArray)}function useScrollIntoView(_ref3){let{highlightedIndex,isOpen,itemRefs,getItemNodeFromIndex,menuElement,scrollIntoView:scrollIntoViewProp}=_ref3;const shouldScrollRef=(0,react.useRef)(!0);return useIsomorphicLayoutEffect((()=>{highlightedIndex<0||!isOpen||!Object.keys(itemRefs.current).length||(!1===shouldScrollRef.current?shouldScrollRef.current=!0:scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex),menuElement))}),[highlightedIndex]),shouldScrollRef}let useControlPropsValidator=noop;function downshiftCommonReducer(state,action,stateChangeTypes){const{type,props}=action;let changes;switch(type){case stateChangeTypes.ItemMouseMove:changes={highlightedIndex:action.disabled?-1:action.index};break;case stateChangeTypes.MenuMouseLeave:changes={highlightedIndex:-1};break;case stateChangeTypes.ToggleButtonClick:case stateChangeTypes.FunctionToggleMenu:changes={isOpen:!state.isOpen,highlightedIndex:state.isOpen?-1:getHighlightedIndexOnOpen(props,state,0)};break;case stateChangeTypes.FunctionOpenMenu:changes={isOpen:!0,highlightedIndex:getHighlightedIndexOnOpen(props,state,0)};break;case stateChangeTypes.FunctionCloseMenu:changes={isOpen:!1};break;case stateChangeTypes.FunctionSetHighlightedIndex:changes={highlightedIndex:action.highlightedIndex};break;case stateChangeTypes.FunctionSetInputValue:changes={inputValue:action.inputValue};break;case stateChangeTypes.FunctionReset:changes={highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),isOpen:getDefaultValue$1(props,"isOpen"),selectedItem:getDefaultValue$1(props,"selectedItem"),inputValue:getDefaultValue$1(props,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return{...state,...changes}}function getItemIndexByCharacterKey(_a){for(var keysSoFar=_a.keysSoFar,highlightedIndex=_a.highlightedIndex,items=_a.items,itemToString=_a.itemToString,getItemNodeFromIndex=_a.getItemNodeFromIndex,lowerCasedKeysSoFar=keysSoFar.toLowerCase(),index=0;index<items.length;index++){var offsetIndex=(index+highlightedIndex+1)%items.length,item=items[offsetIndex];if(void 0!==item&&itemToString(item).toLowerCase().startsWith(lowerCasedKeysSoFar)){var element=getItemNodeFromIndex(offsetIndex);if(!(null==element?void 0:element.hasAttribute("disabled")))return offsetIndex}}return highlightedIndex}prop_types_default().array.isRequired,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().bool,prop_types_default().number,prop_types_default().number,prop_types_default().number,prop_types_default().bool,prop_types_default().bool,prop_types_default().bool,prop_types_default().any,prop_types_default().any,prop_types_default().any,prop_types_default().string,prop_types_default().string,prop_types_default().string,prop_types_default().func,prop_types_default().string,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().shape({addEventListener:prop_types_default().func,removeEventListener:prop_types_default().func,document:prop_types_default().shape({getElementById:prop_types_default().func,activeElement:prop_types_default().any,body:prop_types_default().any})});var defaultProps$2=(0,tslib_es6.Cl)((0,tslib_es6.Cl)({},defaultProps$3),{getA11yStatusMessage:function getA11yStatusMessage(_a){var isOpen=_a.isOpen,resultCount=_a.resultCount,previousResultCount=_a.previousResultCount;return isOpen?resultCount?resultCount!==previousResultCount?"".concat(resultCount," result").concat(1===resultCount?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}}),validatePropTypes$2=noop;const MenuKeyDownArrowDown=0,MenuKeyDownArrowUp=1,MenuKeyDownEscape=2,MenuKeyDownHome=3,MenuKeyDownEnd=4,MenuKeyDownEnter=5,MenuKeyDownSpaceButton=6,MenuKeyDownCharacter=7,MenuBlur=8,MenuMouseLeave$1=9,ItemMouseMove$1=10,ItemClick$1=11,ToggleButtonClick$1=12,ToggleButtonKeyDownArrowDown=13,ToggleButtonKeyDownArrowUp=14,ToggleButtonKeyDownCharacter=15,FunctionToggleMenu$1=16,FunctionOpenMenu$1=17,FunctionCloseMenu$1=18,FunctionSetHighlightedIndex$1=19,FunctionSelectItem$1=20,FunctionSetInputValue$1=21,FunctionReset$2=22;var stateChangeTypes$2=Object.freeze({__proto__:null,MenuKeyDownArrowDown,MenuKeyDownArrowUp,MenuKeyDownEscape,MenuKeyDownHome,MenuKeyDownEnd,MenuKeyDownEnter,MenuKeyDownSpaceButton,MenuKeyDownCharacter,MenuBlur,MenuMouseLeave:MenuMouseLeave$1,ItemMouseMove:ItemMouseMove$1,ItemClick:ItemClick$1,ToggleButtonClick:ToggleButtonClick$1,ToggleButtonKeyDownArrowDown,ToggleButtonKeyDownArrowUp,ToggleButtonKeyDownCharacter,FunctionToggleMenu:FunctionToggleMenu$1,FunctionOpenMenu:FunctionOpenMenu$1,FunctionCloseMenu:FunctionCloseMenu$1,FunctionSetHighlightedIndex:FunctionSetHighlightedIndex$1,FunctionSelectItem:FunctionSelectItem$1,FunctionSetInputValue:FunctionSetInputValue$1,FunctionReset:FunctionReset$2});function downshiftSelectReducer(state,action){const{type,props,shiftKey}=action;let changes;switch(type){case ItemClick$1:changes={isOpen:getDefaultValue$1(props,"isOpen"),highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),selectedItem:props.items[action.index]};break;case ToggleButtonKeyDownCharacter:{const lowercasedKey=action.key,inputValue=`${state.inputValue}${lowercasedKey}`,itemIndex=getItemIndexByCharacterKey({keysSoFar:inputValue,highlightedIndex:state.selectedItem?props.items.indexOf(state.selectedItem):-1,items:props.items,itemToString:props.itemToString,getItemNodeFromIndex:action.getItemNodeFromIndex});changes={inputValue,...itemIndex>=0&&{selectedItem:props.items[itemIndex]}}}break;case ToggleButtonKeyDownArrowDown:changes={highlightedIndex:getHighlightedIndexOnOpen(props,state,1,action.getItemNodeFromIndex),isOpen:!0};break;case ToggleButtonKeyDownArrowUp:changes={highlightedIndex:getHighlightedIndexOnOpen(props,state,-1,action.getItemNodeFromIndex),isOpen:!0};break;case MenuKeyDownEnter:case MenuKeyDownSpaceButton:changes={isOpen:getDefaultValue$1(props,"isOpen"),highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),...state.highlightedIndex>=0&&{selectedItem:props.items[state.highlightedIndex]}};break;case MenuKeyDownHome:changes={highlightedIndex:getNextNonDisabledIndex(1,0,props.items.length,action.getItemNodeFromIndex,!1)};break;case MenuKeyDownEnd:changes={highlightedIndex:getNextNonDisabledIndex(-1,props.items.length-1,props.items.length,action.getItemNodeFromIndex,!1)};break;case MenuKeyDownEscape:case MenuBlur:changes={isOpen:!1,highlightedIndex:-1};break;case MenuKeyDownCharacter:{const lowercasedKey=action.key,inputValue=`${state.inputValue}${lowercasedKey}`,highlightedIndex=getItemIndexByCharacterKey({keysSoFar:inputValue,highlightedIndex:state.highlightedIndex,items:props.items,itemToString:props.itemToString,getItemNodeFromIndex:action.getItemNodeFromIndex});changes={inputValue,...highlightedIndex>=0&&{highlightedIndex}}}break;case MenuKeyDownArrowDown:changes={highlightedIndex:getNextWrappingIndex(shiftKey?5:1,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,props.circularNavigation)};break;case MenuKeyDownArrowUp:changes={highlightedIndex:getNextWrappingIndex(shiftKey?-5:-1,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,props.circularNavigation)};break;case FunctionSelectItem$1:changes={selectedItem:action.selectedItem};break;default:return downshiftCommonReducer(state,action,stateChangeTypes$2)}return{...state,...changes}}function useSelect(userProps){void 0===userProps&&(userProps={}),validatePropTypes$2(userProps,useSelect);const props={...defaultProps$2,...userProps},{items,scrollIntoView,environment,initialIsOpen,defaultIsOpen,itemToString,getA11ySelectionMessage,getA11yStatusMessage}=props,initialState=getInitialState$2(props),[state,dispatch]=useControlledReducer$1(downshiftSelectReducer,initialState,props),{isOpen,highlightedIndex,selectedItem,inputValue}=state,toggleButtonRef=(0,react.useRef)(null),menuRef=(0,react.useRef)(null),itemRefs=(0,react.useRef)({}),shouldBlurRef=(0,react.useRef)(!0),clearTimeoutRef=(0,react.useRef)(null),elementIds=useElementIds(props),previousResultCountRef=(0,react.useRef)(),isInitialMountRef=(0,react.useRef)(!0),latest=useLatestRef({state,props}),getItemNodeFromIndex=(0,react.useCallback)((index=>itemRefs.current[elementIds.getItemId(index)]),[elementIds]);useA11yMessageSetter(getA11yStatusMessage,[isOpen,highlightedIndex,inputValue,items],{isInitialMount:isInitialMountRef.current,previousResultCount:previousResultCountRef.current,items,environment,itemToString,...state}),useA11yMessageSetter(getA11ySelectionMessage,[selectedItem],{isInitialMount:isInitialMountRef.current,previousResultCount:previousResultCountRef.current,items,environment,itemToString,...state});const shouldScrollRef=useScrollIntoView({menuElement:menuRef.current,highlightedIndex,isOpen,itemRefs,scrollIntoView,getItemNodeFromIndex});(0,react.useEffect)((()=>(clearTimeoutRef.current=debounce((outerDispatch=>{outerDispatch({type:FunctionSetInputValue$1,inputValue:""})}),500),()=>{clearTimeoutRef.current.cancel()})),[]),(0,react.useEffect)((()=>{inputValue&&clearTimeoutRef.current(dispatch)}),[dispatch,inputValue]),useControlPropsValidator({isInitialMount:isInitialMountRef.current,props,state}),(0,react.useEffect)((()=>{isInitialMountRef.current?(initialIsOpen||defaultIsOpen||isOpen)&&menuRef.current&&menuRef.current.focus():isOpen?menuRef.current&&menuRef.current.focus():environment.document.activeElement===menuRef.current&&toggleButtonRef.current&&(shouldBlurRef.current=!1,toggleButtonRef.current.focus())}),[isOpen]),(0,react.useEffect)((()=>{isInitialMountRef.current||(previousResultCountRef.current=items.length)}));const mouseAndTouchTrackersRef=useMouseAndTouchTracker(isOpen,[menuRef,toggleButtonRef],environment,(()=>{dispatch({type:MenuBlur})})),setGetterPropCallInfo=useGetterPropsCalledChecker("getMenuProps","getToggleButtonProps");(0,react.useEffect)((()=>{isInitialMountRef.current=!1}),[]),(0,react.useEffect)((()=>{isOpen||(itemRefs.current={})}),[isOpen]);const toggleButtonKeyDownHandlers=(0,react.useMemo)((()=>({ArrowDown(event){event.preventDefault(),dispatch({type:ToggleButtonKeyDownArrowDown,getItemNodeFromIndex,shiftKey:event.shiftKey})},ArrowUp(event){event.preventDefault(),dispatch({type:ToggleButtonKeyDownArrowUp,getItemNodeFromIndex,shiftKey:event.shiftKey})}})),[dispatch,getItemNodeFromIndex]),menuKeyDownHandlers=(0,react.useMemo)((()=>({ArrowDown(event){event.preventDefault(),dispatch({type:MenuKeyDownArrowDown,getItemNodeFromIndex,shiftKey:event.shiftKey})},ArrowUp(event){event.preventDefault(),dispatch({type:MenuKeyDownArrowUp,getItemNodeFromIndex,shiftKey:event.shiftKey})},Home(event){event.preventDefault(),dispatch({type:MenuKeyDownHome,getItemNodeFromIndex})},End(event){event.preventDefault(),dispatch({type:MenuKeyDownEnd,getItemNodeFromIndex})},Escape(){dispatch({type:MenuKeyDownEscape})},Enter(event){event.preventDefault(),dispatch({type:MenuKeyDownEnter})}," "(event){event.preventDefault(),dispatch({type:MenuKeyDownSpaceButton})}})),[dispatch,getItemNodeFromIndex]),toggleMenu=(0,react.useCallback)((()=>{dispatch({type:FunctionToggleMenu$1})}),[dispatch]),closeMenu=(0,react.useCallback)((()=>{dispatch({type:FunctionCloseMenu$1})}),[dispatch]),openMenu=(0,react.useCallback)((()=>{dispatch({type:FunctionOpenMenu$1})}),[dispatch]),setHighlightedIndex=(0,react.useCallback)((newHighlightedIndex=>{dispatch({type:FunctionSetHighlightedIndex$1,highlightedIndex:newHighlightedIndex})}),[dispatch]),selectItem=(0,react.useCallback)((newSelectedItem=>{dispatch({type:FunctionSelectItem$1,selectedItem:newSelectedItem})}),[dispatch]),reset=(0,react.useCallback)((()=>{dispatch({type:FunctionReset$2})}),[dispatch]),setInputValue=(0,react.useCallback)((newInputValue=>{dispatch({type:FunctionSetInputValue$1,inputValue:newInputValue})}),[dispatch]),getLabelProps=(0,react.useCallback)((labelProps=>({id:elementIds.labelId,htmlFor:elementIds.toggleButtonId,...labelProps})),[elementIds]),getMenuProps=(0,react.useCallback)((function(_temp,_temp2){let{onMouseLeave,refKey="ref",onKeyDown,onBlur,ref,...rest}=void 0===_temp?{}:_temp,{suppressRefError=!1}=void 0===_temp2?{}:_temp2;const latestState=latest.current.state;return setGetterPropCallInfo("getMenuProps",suppressRefError,refKey,menuRef),{[refKey]:handleRefs(ref,(menuNode=>{menuRef.current=menuNode})),id:elementIds.menuId,role:"listbox","aria-labelledby":elementIds.labelId,tabIndex:-1,...latestState.isOpen&&latestState.highlightedIndex>-1&&{"aria-activedescendant":elementIds.getItemId(latestState.highlightedIndex)},onMouseLeave:callAllEventHandlers(onMouseLeave,(()=>{dispatch({type:MenuMouseLeave$1})})),onKeyDown:callAllEventHandlers(onKeyDown,(event=>{const key=normalizeArrowKey(event);key&&menuKeyDownHandlers[key]?menuKeyDownHandlers[key](event):isAcceptedCharacterKey(key)&&dispatch({type:MenuKeyDownCharacter,key,getItemNodeFromIndex})})),onBlur:callAllEventHandlers(onBlur,(()=>{if(!1===shouldBlurRef.current)return void(shouldBlurRef.current=!0);!mouseAndTouchTrackersRef.current.isMouseDown&&dispatch({type:MenuBlur})})),...rest}}),[dispatch,latest,menuKeyDownHandlers,mouseAndTouchTrackersRef,setGetterPropCallInfo,elementIds,getItemNodeFromIndex]);return{getToggleButtonProps:(0,react.useCallback)((function(_temp3,_temp4){let{onClick,onKeyDown,refKey="ref",ref,...rest}=void 0===_temp3?{}:_temp3,{suppressRefError=!1}=void 0===_temp4?{}:_temp4;const toggleButtonHandleClick=()=>{dispatch({type:ToggleButtonClick$1})},toggleButtonHandleKeyDown=event=>{const key=normalizeArrowKey(event);key&&toggleButtonKeyDownHandlers[key]?toggleButtonKeyDownHandlers[key](event):isAcceptedCharacterKey(key)&&dispatch({type:ToggleButtonKeyDownCharacter,key,getItemNodeFromIndex})},toggleProps={[refKey]:handleRefs(ref,(toggleButtonNode=>{toggleButtonRef.current=toggleButtonNode})),id:elementIds.toggleButtonId,"aria-haspopup":"listbox","aria-expanded":latest.current.state.isOpen,"aria-labelledby":`${elementIds.labelId} ${elementIds.toggleButtonId}`,...rest};return rest.disabled||(toggleProps.onClick=callAllEventHandlers(onClick,toggleButtonHandleClick),toggleProps.onKeyDown=callAllEventHandlers(onKeyDown,toggleButtonHandleKeyDown)),setGetterPropCallInfo("getToggleButtonProps",suppressRefError,refKey,toggleButtonRef),toggleProps}),[dispatch,latest,toggleButtonKeyDownHandlers,setGetterPropCallInfo,elementIds,getItemNodeFromIndex]),getLabelProps,getMenuProps,getItemProps:(0,react.useCallback)((function(_temp5){let{item,index,onMouseMove,onClick,refKey="ref",ref,disabled,...rest}=void 0===_temp5?{}:_temp5;const{state:latestState,props:latestProps}=latest.current,itemHandleClick=()=>{dispatch({type:ItemClick$1,index})},itemIndex=getItemIndex(index,item,latestProps.items);if(itemIndex<0)throw new Error("Pass either item or item index in getItemProps!");const itemProps={disabled,role:"option","aria-selected":`${itemIndex===latestState.highlightedIndex}`,id:elementIds.getItemId(itemIndex),[refKey]:handleRefs(ref,(itemNode=>{itemNode&&(itemRefs.current[elementIds.getItemId(itemIndex)]=itemNode)})),...rest};return disabled||(itemProps.onClick=callAllEventHandlers(onClick,itemHandleClick)),itemProps.onMouseMove=callAllEventHandlers(onMouseMove,(()=>{index!==latestState.highlightedIndex&&(shouldScrollRef.current=!1,dispatch({type:ItemMouseMove$1,index,disabled}))})),itemProps}),[dispatch,latest,shouldScrollRef,elementIds]),toggleMenu,openMenu,closeMenu,setHighlightedIndex,selectItem,reset,setInputValue,highlightedIndex,isOpen,selectedItem,inputValue}}useSelect.stateChangeTypes=stateChangeTypes$2;const 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$1=18,ControlledPropUpdatedSelectedItem=19;var stateChangeTypes$1=Object.freeze({__proto__:null,InputKeyDownArrowDown,InputKeyDownArrowUp,InputKeyDownEscape,InputKeyDownHome,InputKeyDownEnd,InputKeyDownEnter,InputChange,InputBlur,MenuMouseLeave,ItemMouseMove,ItemClick,ToggleButtonClick,FunctionToggleMenu,FunctionOpenMenu,FunctionCloseMenu,FunctionSetHighlightedIndex,FunctionSelectItem,FunctionSetInputValue,FunctionReset:FunctionReset$1,ControlledPropUpdatedSelectedItem});prop_types_default().array.isRequired,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().bool,prop_types_default().number,prop_types_default().number,prop_types_default().number,prop_types_default().bool,prop_types_default().bool,prop_types_default().bool,prop_types_default().any,prop_types_default().any,prop_types_default().any,prop_types_default().string,prop_types_default().string,prop_types_default().string,prop_types_default().string,prop_types_default().string,prop_types_default().string,prop_types_default().func,prop_types_default().string,prop_types_default().string,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().shape({addEventListener:prop_types_default().func,removeEventListener:prop_types_default().func,document:prop_types_default().shape({getElementById:prop_types_default().func,activeElement:prop_types_default().any,body:prop_types_default().any})});let validatePropTypes$1=noop;const defaultProps$1={...defaultProps$3,getA11yStatusMessage:getA11yStatusMessage$1,circularNavigation:!0};function downshiftUseComboboxReducer(state,action){const{type,props,shiftKey}=action;let changes;switch(type){case ItemClick:changes={isOpen:getDefaultValue$1(props,"isOpen"),highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),selectedItem:props.items[action.index],inputValue:props.itemToString(props.items[action.index])};break;case InputKeyDownArrowDown:changes=state.isOpen?{highlightedIndex:getNextWrappingIndex(shiftKey?5:1,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,props.circularNavigation)}:{highlightedIndex:getHighlightedIndexOnOpen(props,state,1,action.getItemNodeFromIndex),isOpen:props.items.length>=0};break;case InputKeyDownArrowUp:changes=state.isOpen?{highlightedIndex:getNextWrappingIndex(shiftKey?-5:-1,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,props.circularNavigation)}:{highlightedIndex:getHighlightedIndexOnOpen(props,state,-1,action.getItemNodeFromIndex),isOpen:props.items.length>=0};break;case InputKeyDownEnter:changes={...state.isOpen&&state.highlightedIndex>=0&&{selectedItem:props.items[state.highlightedIndex],isOpen:getDefaultValue$1(props,"isOpen"),highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),inputValue:props.itemToString(props.items[state.highlightedIndex])}};break;case InputKeyDownEscape:changes={isOpen:!1,highlightedIndex:-1,...!state.isOpen&&{selectedItem:null,inputValue:""}};break;case InputKeyDownHome:changes={highlightedIndex:getNextNonDisabledIndex(1,0,props.items.length,action.getItemNodeFromIndex,!1)};break;case InputKeyDownEnd:changes={highlightedIndex:getNextNonDisabledIndex(-1,props.items.length-1,props.items.length,action.getItemNodeFromIndex,!1)};break;case InputBlur:changes={isOpen:!1,highlightedIndex:-1,...state.highlightedIndex>=0&&action.selectItem&&{selectedItem:props.items[state.highlightedIndex],inputValue:props.itemToString(props.items[state.highlightedIndex])}};break;case InputChange:changes={isOpen:!0,highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),inputValue:action.inputValue};break;case FunctionSelectItem:changes={selectedItem:action.selectedItem,inputValue:props.itemToString(action.selectedItem)};break;case ControlledPropUpdatedSelectedItem:changes={inputValue:action.inputValue};break;default:return downshiftCommonReducer(state,action,stateChangeTypes$1)}return{...state,...changes}}function useCombobox(userProps){void 0===userProps&&(userProps={}),validatePropTypes$1(userProps,useCombobox);const props={...defaultProps$1,...userProps},{initialIsOpen,defaultIsOpen,items,scrollIntoView,environment,getA11yStatusMessage,getA11ySelectionMessage,itemToString}=props,initialState=function getInitialState$1(props){const initialState=getInitialState$2(props),{selectedItem}=initialState;let{inputValue}=initialState;return""===inputValue&&selectedItem&&void 0===props.defaultInputValue&&void 0===props.initialInputValue&&void 0===props.inputValue&&(inputValue=props.itemToString(selectedItem)),{...initialState,inputValue}}(props),[state,dispatch]=function useControlledReducer(reducer,initialState,props){const previousSelectedItemRef=(0,react.useRef)(),[state,dispatch]=useEnhancedReducer(reducer,initialState,props);return(0,react.useEffect)((()=>{isControlledProp(props,"selectedItem")&&(previousSelectedItemRef.current!==props.selectedItem&&dispatch({type:ControlledPropUpdatedSelectedItem,inputValue:props.itemToString(props.selectedItem)}),previousSelectedItemRef.current=state.selectedItem===previousSelectedItemRef.current?props.selectedItem:state.selectedItem)})),[getState(state,props),dispatch]}(downshiftUseComboboxReducer,initialState,props),{isOpen,highlightedIndex,selectedItem,inputValue}=state,menuRef=(0,react.useRef)(null),itemRefs=(0,react.useRef)({}),inputRef=(0,react.useRef)(null),toggleButtonRef=(0,react.useRef)(null),comboboxRef=(0,react.useRef)(null),isInitialMountRef=(0,react.useRef)(!0),elementIds=useElementIds(props),previousResultCountRef=(0,react.useRef)(),latest=useLatestRef({state,props}),getItemNodeFromIndex=(0,react.useCallback)((index=>itemRefs.current[elementIds.getItemId(index)]),[elementIds]);useA11yMessageSetter(getA11yStatusMessage,[isOpen,highlightedIndex,inputValue,items],{isInitialMount:isInitialMountRef.current,previousResultCount:previousResultCountRef.current,items,environment,itemToString,...state}),useA11yMessageSetter(getA11ySelectionMessage,[selectedItem],{isInitialMount:isInitialMountRef.current,previousResultCount:previousResultCountRef.current,items,environment,itemToString,...state});const shouldScrollRef=useScrollIntoView({menuElement:menuRef.current,highlightedIndex,isOpen,itemRefs,scrollIntoView,getItemNodeFromIndex});useControlPropsValidator({isInitialMount:isInitialMountRef.current,props,state}),(0,react.useEffect)((()=>{(initialIsOpen||defaultIsOpen||isOpen)&&inputRef.current&&inputRef.current.focus()}),[]),(0,react.useEffect)((()=>{isInitialMountRef.current||(previousResultCountRef.current=items.length)}));const mouseAndTouchTrackersRef=useMouseAndTouchTracker(isOpen,[comboboxRef,menuRef,toggleButtonRef],environment,(()=>{dispatch({type:InputBlur,selectItem:!1})})),setGetterPropCallInfo=useGetterPropsCalledChecker("getInputProps","getComboboxProps","getMenuProps");(0,react.useEffect)((()=>{isInitialMountRef.current=!1}),[]),(0,react.useEffect)((()=>{isOpen||(itemRefs.current={})}),[isOpen]);const inputKeyDownHandlers=(0,react.useMemo)((()=>({ArrowDown(event){event.preventDefault(),dispatch({type:InputKeyDownArrowDown,shiftKey:event.shiftKey,getItemNodeFromIndex})},ArrowUp(event){event.preventDefault(),dispatch({type:InputKeyDownArrowUp,shiftKey:event.shiftKey,getItemNodeFromIndex})},Home(event){latest.current.state.isOpen&&(event.preventDefault(),dispatch({type:InputKeyDownHome,getItemNodeFromIndex}))},End(event){latest.current.state.isOpen&&(event.preventDefault(),dispatch({type:InputKeyDownEnd,getItemNodeFromIndex}))},Escape(event){const latestState=latest.current.state;(latestState.isOpen||latestState.inputValue||latestState.selectedItem||latestState.highlightedIndex>-1)&&(event.preventDefault(),dispatch({type:InputKeyDownEscape}))},Enter(event){const latestState=latest.current.state;!latestState.isOpen||latestState.highlightedIndex<0||229===event.which||(event.preventDefault(),dispatch({type:InputKeyDownEnter,getItemNodeFromIndex}))}})),[dispatch,latest,getItemNodeFromIndex]),getLabelProps=(0,react.useCallback)((labelProps=>({id:elementIds.labelId,htmlFor:elementIds.inputId,...labelProps})),[elementIds]),getMenuProps=(0,react.useCallback)((function(_temp,_temp2){let{onMouseLeave,refKey="ref",ref,...rest}=void 0===_temp?{}:_temp,{suppressRefError=!1}=void 0===_temp2?{}:_temp2;return setGetterPropCallInfo("getMenuProps",suppressRefError,refKey,menuRef),{[refKey]:handleRefs(ref,(menuNode=>{menuRef.current=menuNode})),id:elementIds.menuId,role:"listbox","aria-labelledby":elementIds.labelId,onMouseLeave:callAllEventHandlers(onMouseLeave,(()=>{dispatch({type:MenuMouseLeave})})),...rest}}),[dispatch,setGetterPropCallInfo,elementIds]),getItemProps=(0,react.useCallback)((function(_temp3){let{item,index,refKey="ref",ref,onMouseMove,onMouseDown,onClick,onPress,disabled,...rest}=void 0===_temp3?{}:_temp3;const{props:latestProps,state:latestState}=latest.current,itemIndex=getItemIndex(index,item,latestProps.items);if(itemIndex<0)throw new Error("Pass either item or item index in getItemProps!");const customClickHandler=onClick;return{[refKey]:handleRefs(ref,(itemNode=>{itemNode&&(itemRefs.current[elementIds.getItemId(itemIndex)]=itemNode)})),disabled,role:"option","aria-selected":`${itemIndex===latestState.highlightedIndex}`,id:elementIds.getItemId(itemIndex),...!disabled&&{onClick:callAllEventHandlers(customClickHandler,(()=>{dispatch({type:ItemClick,index})}))},onMouseMove:callAllEventHandlers(onMouseMove,(()=>{index!==latestState.highlightedIndex&&(shouldScrollRef.current=!1,dispatch({type:ItemMouseMove,index,disabled}))})),onMouseDown:callAllEventHandlers(onMouseDown,(e=>e.preventDefault())),...rest}}),[dispatch,latest,shouldScrollRef,elementIds]),getToggleButtonProps=(0,react.useCallback)((function(_temp4){let{onClick,onPress,refKey="ref",ref,...rest}=void 0===_temp4?{}:_temp4;return{[refKey]:handleRefs(ref,(toggleButtonNode=>{toggleButtonRef.current=toggleButtonNode})),id:elementIds.toggleButtonId,tabIndex:-1,...!rest.disabled&&{onClick:callAllEventHandlers(onClick,(()=>{dispatch({type:ToggleButtonClick}),!latest.current.state.isOpen&&inputRef.current&&inputRef.current.focus()}))},...rest}}),[dispatch,latest,elementIds]),getInputProps=(0,react.useCallback)((function(_temp5,_temp6){let{onKeyDown,onChange,onInput,onBlur,onChangeText,refKey="ref",ref,...rest}=void 0===_temp5?{}:_temp5,{suppressRefError=!1}=void 0===_temp6?{}:_temp6;setGetterPropCallInfo("getInputProps",suppressRefError,refKey,inputRef);const latestState=latest.current.state,inputHandleKeyDown=event=>{const key=normalizeArrowKey(event);key&&inputKeyDownHandlers[key]&&inputKeyDownHandlers[key](event)},inputHandleChange=event=>{dispatch({type:InputChange,inputValue:event.target.value})},inputHandleBlur=()=>{latestState.isOpen&&!mouseAndTouchTrackersRef.current.isMouseDown&&dispatch({type:InputBlur,selectItem:!0})};let eventHandlers={};return rest.disabled||(eventHandlers={onChange:callAllEventHandlers(onChange,onInput,inputHandleChange),onKeyDown:callAllEventHandlers(onKeyDown,inputHandleKeyDown),onBlur:callAllEventHandlers(onBlur,inputHandleBlur)}),{[refKey]:handleRefs(ref,(inputNode=>{inputRef.current=inputNode})),id:elementIds.inputId,"aria-autocomplete":"list","aria-controls":elementIds.menuId,...latestState.isOpen&&latestState.highlightedIndex>-1&&{"aria-activedescendant":elementIds.getItemId(latestState.highlightedIndex)},"aria-labelledby":elementIds.labelId,autoComplete:"off",value:latestState.inputValue,...eventHandlers,...rest}}),[dispatch,inputKeyDownHandlers,latest,mouseAndTouchTrackersRef,setGetterPropCallInfo,elementIds]),getComboboxProps=(0,react.useCallback)((function(_temp7,_temp8){let{refKey="ref",ref,...rest}=void 0===_temp7?{}:_temp7,{suppressRefError=!1}=void 0===_temp8?{}:_temp8;return setGetterPropCallInfo("getComboboxProps",suppressRefError,refKey,comboboxRef),{[refKey]:handleRefs(ref,(comboboxNode=>{comboboxRef.current=comboboxNode})),role:"combobox","aria-haspopup":"listbox","aria-owns":elementIds.menuId,"aria-expanded":latest.current.state.isOpen,...rest}}),[latest,setGetterPropCallInfo,elementIds]),toggleMenu=(0,react.useCallback)((()=>{dispatch({type:FunctionToggleMenu})}),[dispatch]),closeMenu=(0,react.useCallback)((()=>{dispatch({type:FunctionCloseMenu})}),[dispatch]),openMenu=(0,react.useCallback)((()=>{dispatch({type:FunctionOpenMenu})}),[dispatch]),setHighlightedIndex=(0,react.useCallback)((newHighlightedIndex=>{dispatch({type:FunctionSetHighlightedIndex,highlightedIndex:newHighlightedIndex})}),[dispatch]),selectItem=(0,react.useCallback)((newSelectedItem=>{dispatch({type:FunctionSelectItem,selectedItem:newSelectedItem})}),[dispatch]);return{getItemProps,getLabelProps,getMenuProps,getInputProps,getComboboxProps,getToggleButtonProps,toggleMenu,openMenu,closeMenu,setHighlightedIndex,setInputValue:(0,react.useCallback)((newInputValue=>{dispatch({type:FunctionSetInputValue,inputValue:newInputValue})}),[dispatch]),selectItem,reset:(0,react.useCallback)((()=>{dispatch({type:FunctionReset$1})}),[dispatch]),highlightedIndex,isOpen,selectedItem,inputValue}}useCombobox.stateChangeTypes=stateChangeTypes$1;const defaultStateValues={activeIndex:-1,selectedItems:[]};function getInitialValue(props,propKey){return getInitialValue$1(props,propKey,defaultStateValues)}function getDefaultValue(props,propKey){return getDefaultValue$1(props,propKey,defaultStateValues)}function isKeyDownOperationPermitted(event){if(event.shiftKey||event.metaKey||event.ctrlKey||event.altKey)return!1;const element=event.target;return!(element instanceof HTMLInputElement&&""!==element.value)||0===element.selectionStart&&0===element.selectionEnd}prop_types_default().array,prop_types_default().array,prop_types_default().array,prop_types_default().func,prop_types_default().func,prop_types_default().func,prop_types_default().number,prop_types_default().number,prop_types_default().number,prop_types_default().func,prop_types_default().func,prop_types_default().string,prop_types_default().string,prop_types_default().shape({addEventListener:prop_types_default().func,removeEventListener:prop_types_default().func,document:prop_types_default().shape({getElementById:prop_types_default().func,activeElement:prop_types_default().any,body:prop_types_default().any})});const defaultProps={itemToString:defaultProps$3.itemToString,stateReducer:defaultProps$3.stateReducer,environment:defaultProps$3.environment,getA11yRemovalMessage:function getA11yRemovalMessage(selectionParameters){const{removedSelectedItem,itemToString:itemToStringLocal}=selectionParameters;return`${itemToStringLocal(removedSelectedItem)} has been removed.`},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"};let validatePropTypes=noop;const 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;var stateChangeTypes=Object.freeze({__proto__:null,SelectedItemClick,SelectedItemKeyDownDelete,SelectedItemKeyDownBackspace,SelectedItemKeyDownNavigationNext,SelectedItemKeyDownNavigationPrevious,DropdownKeyDownNavigationPrevious,DropdownKeyDownBackspace,DropdownClick,FunctionAddSelectedItem,FunctionRemoveSelectedItem,FunctionSetSelectedItems,FunctionSetActiveIndex,FunctionReset});function downshiftMultipleSelectionReducer(state,action){const{type,index,props,selectedItem}=action,{activeIndex,selectedItems}=state;let changes;switch(type){case SelectedItemClick:changes={activeIndex:index};break;case SelectedItemKeyDownNavigationPrevious:changes={activeIndex:activeIndex-1<0?0:activeIndex-1};break;case SelectedItemKeyDownNavigationNext:changes={activeIndex:activeIndex+1>=selectedItems.length?-1:activeIndex+1};break;case SelectedItemKeyDownBackspace:case SelectedItemKeyDownDelete:{let newActiveIndex=activeIndex;1===selectedItems.length?newActiveIndex=-1:activeIndex===selectedItems.length-1&&(newActiveIndex=selectedItems.length-2),changes={selectedItems:[...selectedItems.slice(0,activeIndex),...selectedItems.slice(activeIndex+1)],activeIndex:newActiveIndex};break}case DropdownKeyDownNavigationPrevious:changes={activeIndex:selectedItems.length-1};break;case DropdownKeyDownBackspace:changes={selectedItems:selectedItems.slice(0,selectedItems.length-1)};break;case FunctionAddSelectedItem:changes={selectedItems:[...selectedItems,selectedItem]};break;case DropdownClick:changes={activeIndex:-1};break;case FunctionRemoveSelectedItem:{let newActiveIndex=activeIndex;const selectedItemIndex=selectedItems.indexOf(selectedItem);selectedItemIndex>=0&&(1===selectedItems.length?newActiveIndex=-1:selectedItemIndex===selectedItems.length-1&&(newActiveIndex=selectedItems.length-2),changes={selectedItems:[...selectedItems.slice(0,selectedItemIndex),...selectedItems.slice(selectedItemIndex+1)],activeIndex:newActiveIndex});break}case FunctionSetSelectedItems:{const{selectedItems:newSelectedItems}=action;changes={selectedItems:newSelectedItems};break}case FunctionSetActiveIndex:{const{activeIndex:newActiveIndex}=action;changes={activeIndex:newActiveIndex};break}case FunctionReset:changes={activeIndex:getDefaultValue(props,"activeIndex"),selectedItems:getDefaultValue(props,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return{...state,...changes}}function useMultipleSelection(userProps){void 0===userProps&&(userProps={}),validatePropTypes(userProps,useMultipleSelection);const props={...defaultProps,...userProps},{getA11yRemovalMessage,itemToString,environment,keyNavigationNext,keyNavigationPrevious}=props,[state,dispatch]=useControlledReducer$1(downshiftMultipleSelectionReducer,function getInitialState(props){return{activeIndex:getInitialValue(props,"activeIndex"),selectedItems:getInitialValue(props,"selectedItems")}}(props),props),{activeIndex,selectedItems}=state,isInitialMountRef=(0,react.useRef)(!0),dropdownRef=(0,react.useRef)(null),previousSelectedItemsRef=(0,react.useRef)(selectedItems),selectedItemRefs=(0,react.useRef)();selectedItemRefs.current=[];const latest=useLatestRef({state,props});(0,react.useEffect)((()=>{if(!isInitialMountRef.current){if(selectedItems.length<previousSelectedItemsRef.current.length){const removedSelectedItem=previousSelectedItemsRef.current.find((item=>selectedItems.indexOf(item)<0));setStatus(getA11yRemovalMessage({itemToString,resultCount:selectedItems.length,removedSelectedItem,activeIndex,activeSelectedItem:selectedItems[activeIndex]}),environment.document)}previousSelectedItemsRef.current=selectedItems}}),[selectedItems.length]),(0,react.useEffect)((()=>{isInitialMountRef.current||(-1===activeIndex&&dropdownRef.current?dropdownRef.current.focus():selectedItemRefs.current[activeIndex]&&selectedItemRefs.current[activeIndex].focus())}),[activeIndex]),useControlPropsValidator({isInitialMount:isInitialMountRef.current,props,state});const setGetterPropCallInfo=useGetterPropsCalledChecker("getDropdownProps");(0,react.useEffect)((()=>{isInitialMountRef.current=!1}),[]);const selectedItemKeyDownHandlers=(0,react.useMemo)((()=>({[keyNavigationPrevious](){dispatch({type:SelectedItemKeyDownNavigationPrevious})},[keyNavigationNext](){dispatch({type:SelectedItemKeyDownNavigationNext})},Delete(){dispatch({type:SelectedItemKeyDownDelete})},Backspace(){dispatch({type:SelectedItemKeyDownBackspace})}})),[dispatch,keyNavigationNext,keyNavigationPrevious]),dropdownKeyDownHandlers=(0,react.useMemo)((()=>({[keyNavigationPrevious](event){isKeyDownOperationPermitted(event)&&dispatch({type:DropdownKeyDownNavigationPrevious})},Backspace(event){isKeyDownOperationPermitted(event)&&dispatch({type:DropdownKeyDownBackspace})}})),[dispatch,keyNavigationPrevious]);return{getSelectedItemProps:(0,react.useCallback)((function(_temp){let{refKey="ref",ref,onClick,onKeyDown,selectedItem,index,...rest}=void 0===_temp?{}:_temp;const{state:latestState}=latest.current;if(getItemIndex(index,selectedItem,latestState.selectedItems)<0)throw new Error("Pass either selectedItem or index in getSelectedItemProps!");return{[refKey]:handleRefs(ref,(selectedItemNode=>{selectedItemNode&&selectedItemRefs.current.push(selectedItemNode)})),tabIndex:index===latestState.activeIndex?0:-1,onClick:callAllEventHandlers(onClick,(()=>{dispatch({type:SelectedItemClick,index})})),onKeyDown:callAllEventHandlers(onKeyDown,(event=>{const key=normalizeArrowKey(event);key&&selectedItemKeyDownHandlers[key]&&selectedItemKeyDownHandlers[key](event)})),...rest}}),[dispatch,latest,selectedItemKeyDownHandlers]),getDropdownProps:(0,react.useCallback)((function(_temp2,_temp3){let{refKey="ref",ref,onKeyDown,onClick,preventKeyAction=!1,...rest}=void 0===_temp2?{}:_temp2,{suppressRefError=!1}=void 0===_temp3?{}:_temp3;setGetterPropCallInfo("getDropdownProps",suppressRefError,refKey,dropdownRef);return{[refKey]:handleRefs(ref,(dropdownNode=>{dropdownNode&&(dropdownRef.current=dropdownNode)})),...!preventKeyAction&&{onKeyDown:callAllEventHandlers(onKeyDown,(event=>{const key=normalizeArrowKey(event);key&&dropdownKeyDownHandlers[key]&&dropdownKeyDownHandlers[key](event)})),onClick:callAllEventHandlers(onClick,(()=>{dispatch({type:DropdownClick})}))},...rest}}),[dispatch,dropdownKeyDownHandlers,setGetterPropCallInfo]),addSelectedItem:(0,react.useCallback)((selectedItem=>{dispatch({type:FunctionAddSelectedItem,selectedItem})}),[dispatch]),removeSelectedItem:(0,react.useCallback)((selectedItem=>{dispatch({type:FunctionRemoveSelectedItem,selectedItem})}),[dispatch]),setSelectedItems:(0,react.useCallback)((newSelectedItems=>{dispatch({type:FunctionSetSelectedItems,selectedItems:newSelectedItems})}),[dispatch]),setActiveIndex:(0,react.useCallback)((newActiveIndex=>{dispatch({type:FunctionSetActiveIndex,activeIndex:newActiveIndex})}),[dispatch]),reset:(0,react.useCallback)((()=>{dispatch({type:FunctionReset})}),[dispatch]),selectedItems,activeIndex}}useMultipleSelection.stateChangeTypes=stateChangeTypes},"../../node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/cjs/react-is.production.min.js":(__unused_webpack_module,exports)=>{var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;if("function"==typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element"),c=x("react.portal"),d=x("react.fragment"),e=x("react.strict_mode"),f=x("react.profiler"),g=x("react.provider"),h=x("react.context"),k=x("react.forward_ref"),l=x("react.suspense"),m=x("react.suspense_list"),n=x("react.memo"),p=x("react.lazy"),q=x("react.block"),r=x("react.server.block"),u=x("react.fundamental"),v=x("react.debug_trace_mode"),w=x("react.legacy_hidden")}function y(a){if("object"==typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}},"../../node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{__webpack_require__("../../node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/cjs/react-is.production.min.js")},"../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{C6:()=>__extends,Cl:()=>__assign,Ju:()=>__values,Tt:()=>__rest,fX:()=>__spreadArray,zs:()=>__read});var extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)Object.prototype.hasOwnProperty.call(b,p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){if("function"!=typeof b&&null!==b)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}Object.create;function __values(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spreadArray(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}Object.create;"function"==typeof SuppressedError&&SuppressedError}}]);