react-functional-select
Advanced tools
Comparing version 4.0.1 to 4.1.0
import React, { type FormEventHandler, type FocusEventHandler } from 'react'; | ||
declare const AutosizeInput: React.ForwardRefExoticComponent<Readonly<{ | ||
id?: string | undefined; | ||
menuId?: string | undefined; | ||
menuOpen: boolean; | ||
readOnly: boolean; | ||
@@ -8,2 +10,3 @@ ariaLabel?: string | undefined; | ||
required?: boolean | undefined; | ||
isInvalid?: boolean | undefined; | ||
ariaLabelledBy?: string | undefined; | ||
@@ -10,0 +13,0 @@ hasSelectedOptions: boolean; |
@@ -5,2 +5,3 @@ import { type MutableRefObject, type FunctionComponent } from 'react'; | ||
interface MenuProps extends MenuListProps { | ||
id?: string; | ||
menuTop?: string; | ||
@@ -7,0 +8,0 @@ menuOpen: boolean; |
import type { TestableElement } from '../types'; | ||
import type { HTMLAttributes, InputHTMLAttributes } from 'react'; | ||
import type { InputHTMLAttributes } from 'react'; | ||
export declare const ARIA_LIVE_CONTEXT_ID = "aria-context"; | ||
@@ -24,8 +24,4 @@ export declare const ARIA_LIVE_SELECTION_ID = "aria-selection"; | ||
/** | ||
* Static attributes for 'SelectWrapper' div element. | ||
*/ | ||
export declare const SELECT_WRAPPER_ATTRS: HTMLAttributes<HTMLDivElement> & TestableElement; | ||
/** | ||
* Static attributes for 'AutosizeInput' input element. | ||
*/ | ||
export declare const AUTOSIZE_INPUT_ATTRS: InputHTMLAttributes<HTMLInputElement> & TestableElement; |
@@ -7,2 +7,2 @@ export { default as useDebounce } from './useDebounce'; | ||
export { default as useUpdateEffect } from './useUpdateEffect'; | ||
export { default as useMenuPositioner } from './useMenuPositioner'; | ||
export { default as useMenuPosition } from './useMenuPosition'; |
import type { CallbackFn } from '../types'; | ||
/** | ||
* Hook that converts a callback to a ref to avoid triggering re-renders when | ||
* passed as a prop or avoid re-executing effects when passed as a dependency | ||
* Creates a stable callback function that has access to the latest | ||
* state and can be used within event handlers and effect callbacks. | ||
* | ||
@@ -6,0 +6,0 @@ * @param callback the callback to write to ref object |
@@ -1,5 +0,4 @@ | ||
import { useEffect } from 'react'; | ||
import { type EffectCallback, type DependencyList } from 'react'; | ||
/** | ||
* Run an effect only on updates. | ||
* Skip the first effect execution that occurrs on initial mount. | ||
* `React.useEffect` that will not run on the first render. | ||
* | ||
@@ -9,3 +8,3 @@ * @param effect the effect to execute | ||
*/ | ||
declare const useUpdateEffect: typeof useEffect; | ||
declare const useUpdateEffect: (effect: EffectCallback, deps?: DependencyList) => void; | ||
export default useUpdateEffect; |
@@ -1,1 +0,1 @@ | ||
"use strict";var e,n=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),t=require("@babel/runtime/helpers/extends"),o=require("react"),i=require("styled-components"),r=require("react-dom"),a=require("react-window"),l={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},u={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},c="top",s="auto",d="bottom",f="any",p=0,m=1,g=2,h=3,v=4,b=5,w=i.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),x=i.keyframes(["from{opacity:0;}to{opacity:1;}"]),y=i.css([""," 0.2s ease-in"],x),C={border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},O={color:C,input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:i.css([""," 1.19s ease-in-out infinite"],w),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 14px",clear:{width:"14px",height:"16px",animation:y,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",padding:"2px 8px",boxShadow:"0 0 0 0.2rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:y,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",padding:"0.375rem 0.75rem",selectedBgColor:C.primary,focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:y,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:C.danger,transition:"color 0.2s ease-out"}}},S=[],I={index:-1},E={optionLabel:function(e){return e.label},optionValue:function(e){return e.value},isOptionDisabled:function(e){return!!e.isDisabled},optionFilter:function(e){return"string"==typeof e.label?e.label:""+e.label}},k=function(e){return M(e)?window.pageYOffset:e.scrollTop},M=function(e){return e===document.body||e===document.documentElement||e===window},z=function(e){var n=getComputedStyle(e);if("fixed"===n.position)return document.documentElement;for(var t=/(auto|scroll)/,o="absolute"===n.position,i=e;i=null==(r=i)?void 0:r.parentElement;){var r;if(n=getComputedStyle(i),(!o||"static"!==n.position)&&t.test(""+n.overflow+n.overflowX+n.overflowY))return i}return document.documentElement},L=function(e,n,t,o){void 0===t&&(t=300);var i=0,r=k(e),a=n-r;requestAnimationFrame((function n(){var l,u=a*((l=(l=i+=5)/t-1)*l*l+1)+r;!function(e,n){M(e)?window.scrollTo(0,n):e.scrollTop=n}(e,u),i<t?requestAnimationFrame(n):null==o||o()}))},D=/[\u0300-\u036f]/g,N=function(e){return"boolean"==typeof e},R=function(e){return"function"==typeof e},T=function(e){return Array.isArray(e)&&!!e.length},V=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},A=function(e){e.preventDefault(),e.stopPropagation()},F=function(e,n,t){var o=e.trim();return n&&(o=o.toLowerCase()),t?o.normalize("NFD").replace(D,""):o},B=function(e,n,t){var o=Array.isArray(e)?e:V(e)?[e]:S;return T(o)?o.map((function(e){return{data:e,value:n(e),label:t(e)}})):o},q=function e(n,o){var i=t({},n);return Object.keys(o).forEach((function(t){var r=o[t];i[t]="animation"!==t&&V(r)?n[t]?e(n[t],r):r:null!=r?r:""})),i},P=function(e,n){return n.data.memoOptions&&a.areEqual(e,n)},W=o.memo((function(e){var n,t,i,r=e.index,a=e.style,l=e.data,u=l.menuOptions,c=l.selectOption,s=l.renderOptionLabel,d=l.focusedOptionIndex,f=u[r],p=(n=f.isDisabled,t=f.isSelected,i="rfs-option",n&&(i+=" rfs-option-disabled"),t&&(i+=" rfs-option-selected"),r===d&&(i+=" rfs-option-focused"),i);return o.createElement("div",{style:a,className:p,onClick:function(){return c(f)}},s(f.data))}),P);W.displayName="Option";var j=i.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(function(e){return e.theme.noOptions.color}),(function(e){return e.theme.noOptions.margin}),(function(e){return e.theme.noOptions.padding}),(function(e){return e.theme.noOptions.fontSize}),(function(e){return e.theme.noOptions.css})),K=function(e){var n=e.width,t=e.height,i=e.itemSize,r=e.direction,l=e.isLoading,u=e.loadingMsg,c=e.menuOptions,s=e.memoOptions,d=e.selectOption,f=e.noOptionsMsg,p=e.overscanCount,m=e.itemKeySelector,g=e.fixedSizeListRef,h=e.renderOptionLabel,v=e.focusedOptionIndex,b=o.useMemo((function(){return{menuOptions:c,memoOptions:s,selectOption:d,renderOptionLabel:h,focusedOptionIndex:v}}),[c,s,v,d,h]);if(l)return o.createElement(j,null,u);var w=m?function(e,n){return n.menuOptions[e][m]}:void 0;return o.createElement(o.Fragment,null,o.createElement(a.FixedSizeList,{width:n,height:t,itemKey:w,itemSize:i,itemData:b,direction:r,ref:g,overscanCount:p,itemCount:c.length},W),!T(c)&&f&&o.createElement(j,null,f))},H=["menuRef","menuTop","menuOpen","lazyLoadMenu","onMenuMouseDown","menuPortalTarget"],U=i.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(function(e){var n=e.menuTop,t=e.menuOpen,o=e.hideNoOptionsMsg,r=e.theme.menu;return i.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],r.width,r.margin,r.padding,r.animation,r.borderRadius,r.backgroundColor,o?"none":r.boxShadow,!t&&"display: none;",n&&"top: "+n+";")}),(function(e){return e.theme.menu.css}),"rfs-option",(function(e){return e.theme.menu.option.padding}),(function(e){return e.theme.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(function(e){return e.theme.menu.option.focusedBgColor}),"rfs-option-selected",(function(e){return e.theme.menu.option.selectedColor}),(function(e){return e.theme.menu.option.selectedBgColor}),"rfs-option-disabled"),Y=function(e){var i=e.menuRef,a=e.menuTop,l=e.menuOpen,u=e.lazyLoadMenu,c=e.onMenuMouseDown,s=e.menuPortalTarget,d=n(e,H);if(u&&!l)return null;var f=d.menuOptions,p=d.noOptionsMsg,m=l&&!p&&!T(f),g=o.createElement(U,{ref:i,menuTop:a,menuOpen:l,onMouseDown:c,className:"rfs-menu-container",hideNoOptionsMsg:m},o.createElement(K,t({},d)));return s?r.createPortal(g,s):g},X=i.css(["color:",";"],(function(e){return e.theme.multiValue.clear.focusColor})),G=i.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(function(e){var n=e.theme.multiValue;return i.css(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(function(e){return e.theme.multiValue.css})),J=i.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(function(e){return e.theme.multiValue.label.padding}),(function(e){return e.theme.multiValue.label.fontSize}),(function(e){return e.theme.multiValue.label.borderRadius})),Q=i.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(function(e){var n=e.theme.multiValue.clear;return i.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,X)}),(function(e){return e.isFocused&&X})),Z=o.memo((function(e){var n=e.data,t=e.value,i=e.isFocused,r=e.renderOptionLabel,a=e.removeSelectedOption,l=r(n),u=function(){return a(t)};return o.createElement(G,null,o.createElement(J,null,l),o.createElement(Q,{onClick:u,onTouchEnd:u,isFocused:i,onMouseDown:A},"✖"))}));Z.displayName="MultiValue";var $=i.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})(["margin:0 2px;max-width:100%;overflow:hidden;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;grid-area:1 / 1 / 2 / 3;"]),_=i($).withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})(["color:",";"],(function(e){return e.theme.color.placeholder})),ee=function(e){var n=e.isMulti,t=e.inputValue,i=e.placeholder,r=e.selectedOption,a=e.focusedMultiValue,l=e.renderOptionLabel,u=e.renderMultiOptions,c=e.removeSelectedOption,s=!T(r);if(t&&(!n||n&&(s||u)))return null;if(s)return o.createElement(_,null,i);if(!n){var d=l(r[0].data);return o.createElement($,null,d)}return o.createElement(o.Fragment,null,u?u({renderOptionLabel:l,selected:r}):r.map((function(e){var n=e.data,t=e.value;return o.createElement(Z,{key:t,data:n,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:c})})))},ne=i.css(["border:0;margin:0;outline:0;padding:0;font:inherit;min-width:2px;grid-area:1 / 2 / auto / auto;"]),te=i.div.withConfig({displayName:"InputWrapper",componentId:"sc-4er7q8-0"})(['margin:2px;flex:1 1 auto;display:inline-grid;box-sizing:border-box;grid-area:1 / 1 / 2 / 3;grid-template-columns:0px min-content;:after{white-space:pre;visibility:hidden;content:attr(data-value) " ";',"}"],ne),oe=i.input.attrs(u).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["width:100%;background:0;color:inherit;"," :read-only{opacity:0;cursor:default;}:required{","}",""],ne,(function(e){var n=e.theme;return e.isInvalid&&n.input.cssRequired}),(function(e){return e.theme.input.css})),ie=o.forwardRef((function(e,n){var t=e.id,i=e.onBlur,r=e.onFocus,a=e.readOnly,l=e.required,u=e.onChange,c=e.ariaLabel,s=e.inputValue,d=e.ariaLabelledBy,f=e.hasSelectedOptions,p=!!l&&!f;return o.createElement(te,{"data-value":s},o.createElement(oe,{id:t,ref:n,isInvalid:!0,onBlur:i,onFocus:r,value:s,readOnly:a,required:p,"aria-label":c,"aria-labelledby":d,onChange:a?void 0:u}))}));ie.displayName="AutosizeInput";var re=i.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),ae=function(e){var n=e.menuOpen,t=e.isFocused,i=e.inputValue,r=e.optionCount,a=e.isSearchable,l=e.focusedOption,u=e.selectedOption,c=e.ariaLive,s=void 0===c?"polite":c,d=e.ariaLabel;if(!t)return null;var f=n?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":(void 0===d?"Select":d)+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.",p=l.index,m=l.value,g=l.label,h=l.isDisabled,v=((m&&!h?"Option "+g+" is focused, "+(p+1)+" of "+r+".":"")+" "+(r+" option(s) available"+(i?" for search "+i:"")+".")+" "+f).trimStart(),b="Selected option: "+(u.length?u.map((function(e){return e.label})).join(" "):"N/A");return o.createElement(re,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},o.createElement("span",{id:"aria-selection"},b),o.createElement("span",{id:"aria-context"},v))},le=i.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(function(e){return e.theme.loader.padding}),(function(e){var n=e.theme;return i.css(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),ue=function(){return o.createElement(le,{"aria-hidden":!0,className:"rfs-loading-dots"},o.createElement("div",null),o.createElement("div",null),o.createElement("div",null))},ce=i.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(function(e){var n=e.theme;return i.css(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),se=function(){return o.createElement(ce,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},o.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"}))},de=i.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),fe=i.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(function(e){return e.theme.icon.color}),(function(e){return e.theme.icon.padding}),(function(e){return e.theme.icon.hoverColor}),(function(e){return e.theme.icon.css})),pe=i.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:8px 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(function(e){var n=e.theme;return n.color.iconSeparator||n.color.border})),me=i.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(function(e){return e.theme.icon.caret.transition}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){var n=e.theme,t=e.menuOpen,o=e.isInvalid;return t&&i.css(["transform:rotate(180deg);color:",";"],o?n.color.danger:n.color.caretActive||n.color.primary)})),ge=o.memo((function(e){var n=e.menuOpen,t=e.clearIcon,i=e.caretIcon,r=e.isInvalid,a=e.showClear,l=e.isLoading,u=e.isDisabled,c=e.loadingNode,s=e.onCaretMouseDown,d=e.onClearMouseDown,f=function(e){return R(e)?e({menuOpen:n,isLoading:l,isInvalid:r,isDisabled:u}):e};return o.createElement(de,null,a&&!l&&o.createElement(fe,{onTouchEnd:d,onMouseDown:d},f(t)||o.createElement(se,null)),l&&(c||o.createElement(ue,null)),o.createElement(pe,{role:"none"}),o.createElement(fe,{onTouchEnd:s,onMouseDown:s},f(i)||o.createElement(me,{"aria-hidden":!0,menuOpen:n,isInvalid:r,className:"rfs-caret-icon"})))}));ge.displayName="IndicatorIcons";var he=function(e,n){var t=o.useRef(!0);o.useEffect((function(){if(!t.current)return e();t.current=!1}),n)},ve=function(e){var n=o.useRef(e);return n.current=e,n},be=function(e){var n=o.useRef(e);return o.useEffect((function(){n.current=e})),o.useCallback((function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current.apply(n,t)}),[])},we=function(e,n,t,i,r,a,l,u,c,s,d,p,m){void 0===c&&(c=!1),void 0===s&&(s=!1),void 0===d&&(d=!1),void 0===p&&(p=!1);var g=be(l||E.isOptionDisabled),h=be(u||E.optionFilter),v=N(m)?m:d,b=p?"":n;return o.useMemo((function(){var n=i.map((function(e){return e.value})),o=t===f,l=F(b,c,s),u=function(e){var t=r(e),i=a(e),u=g(e),d=n.includes(t),f={data:e,value:t,label:i,isDisabled:u,isSelected:d};return!function(e){if(!l)return!0;var n=h(e),t=F(n,c,s);return o?t.includes(l):t.startsWith(l)}(f)||v&&d?void 0:f};return e.reduce((function(e,n){var t=u(n);return t&&e.push(t),e}),[])}),[e,b,r,a,i,t,c,s,g,h,v])},xe=function(e,n,t,i,r,a,l,u,d,f,p,m){var g=i===c||i===s&&!function(e){if(!e)return!0;var n=z(e),t=e.getBoundingClientRect(),o=t.top,i=t.height;return n.getBoundingClientRect().height-k(n)-o>=i}(e.current),h=be(d),v=be(f),b=o.useRef(!1),w=o.useState(a),x=w[0],y=w[1],C=ve(!g&&!u);he((function(){if(t){var n=function(e){h(),e&&(b.current=!0,y(e))};C.current?function(e,n,t,o){if(e){var i=e.getBoundingClientRect(),r=i.top,a=i.height,l=i.bottom,u=window.innerHeight;if(u-r>=a)o();else{var c=z(e),s=k(c),d=c.getBoundingClientRect().height-s-r,f=d<a;if(!f&&t){var p=parseInt(getComputedStyle(e).marginBottom,10);L(c,l-u+s+p,n,o)}else o(f?d:void 0)}}else o()}(e.current,p,m,n):n()}else v(),b.current&&(b.current=!1,y(a))}),[e,t,a,m,p,h,v]);var O=Math.min(x,l*r),S=g?function(e,n,t){var o,i,r=n&&getComputedStyle(n),a=r?parseInt(r.marginBottom,10):0,l=r?parseInt(r.marginTop,10):0,u=null!=(o=null==t?void 0:t.getBoundingClientRect().height)?o:0,c=e>0?e:null!=(i=null==n?void 0:n.getBoundingClientRect().height)?i:0;return"calc("+-Math.abs(c+u)+"px + "+(a+l)+"px)"}(O,e.current,n.current):void 0;return[S,O]},ye=["isSelected","isDisabled"],Ce=["index"],Oe=i.div.attrs(l).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(function(e){return e.theme.select.css})),Se=i.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;display:",";padding:",";"],(function(e){return e.flex?"flex":"grid"}),(function(e){return e.theme.control.padding})),Ie=i.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(function(e){var n=e.isDisabled,t=e.isFocused,o=e.isInvalid,r=e.theme,a=r.control,l=r.color;return i.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,o?l.danger:t?a.focusedBorderColor:l.border,a.height&&"height: "+a.height+";",n&&"pointer-events:none;user-select:none;",(a.backgroundColor||n)&&"background-color: "+(n?l.disabled:a.backgroundColor)+";",t&&"box-shadow: "+a.boxShadow+" "+(o?l.dangerLight:a.boxShadowColor)+";")}),(function(e){return e.theme.control.css}),(function(e){var n=e.isFocused,t=e.theme;return n&&t.control.focusedCss})),Ee=o.forwardRef((function(r,a){var l,u=r.async,c=r.isMulti,s=r.inputId,w=r.selectId,x=r.required,y=r.ariaLive,C=r.autoFocus,k=r.isLoading,M=r.onKeyDown,z=r.clearIcon,L=r.caretIcon,D=r.isInvalid,F=r.ariaLabel,P=r.menuWidth,W=r.isDisabled,j=r.inputDelay,K=r.onMenuOpen,H=r.onMenuClose,U=r.onInputBlur,X=r.isClearable,G=r.themeConfig,J=r.loadingNode,Q=r.initialValue,Z=r.onInputFocus,$=r.onInputChange,_=r.ariaLabelledBy,ne=r.onOptionChange,te=r.onSearchChange,oe=r.getOptionLabel,re=r.getOptionValue,le=r.itemKeySelector,ue=r.openMenuOnFocus,ce=r.menuPortalTarget,se=r.isAriaLiveEnabled,de=r.menuOverscanCount,fe=r.blurInputOnSelect,pe=r.menuItemDirection,me=r.renderOptionLabel,Ee=r.renderMultiOptions,ke=r.menuScrollDuration,Me=r.filterIgnoreAccents,ze=r.hideSelectedOptions,Le=r.getIsOptionDisabled,De=r.getFilterOptionString,Ne=r.isSearchable,Re=void 0===Ne||Ne,Te=r.memoOptions,Ve=void 0!==Te&&Te,Ae=r.lazyLoadMenu,Fe=void 0!==Ae&&Ae,Be=r.openMenuOnClick,qe=void 0===Be||Be,Pe=r.filterIgnoreCase,We=void 0===Pe||Pe,je=r.tabSelectsOption,Ke=void 0===je||je,He=r.closeMenuOnSelect,Ue=void 0===He||He,Ye=r.scrollMenuIntoView,Xe=void 0===Ye||Ye,Ge=r.backspaceClearsValue,Je=void 0===Ge||Ge,Qe=r.filterMatchFrom,Ze=void 0===Qe?f:Qe,$e=r.menuPosition,_e=void 0===$e?d:$e,en=r.options,nn=void 0===en?S:en,tn=r.pageSize,on=void 0===tn?5:tn,rn=r.loadingMsg,an=void 0===rn?"Loading..":rn,ln=r.placeholder,un=void 0===ln?"Select option..":ln,cn=r.noOptionsMsg,sn=void 0===cn?"No options":cn,dn=r.menuItemSize,fn=void 0===dn?35:dn,pn=r.menuMaxHeight,mn=void 0===pn?300:pn,gn=o.useRef(null),hn=o.useRef(null),vn=o.useRef(null),bn=o.useRef(null),wn=o.useState(""),xn=wn[0],yn=wn[1],Cn=o.useState(!1),On=Cn[0],Sn=Cn[1],In=o.useState(!1),En=In[0],kn=In[1],Mn=o.useState(null),zn=Mn[0],Ln=Mn[1],Dn=o.useState(I),Nn=Dn[0],Rn=Dn[1],Tn=o.useMemo((function(){return V(G)?q(O,G):O}),[G]),Vn=o.useMemo((function(){return oe||E.optionLabel}),[oe]),An=o.useMemo((function(){return re||E.optionValue}),[re]),Fn=o.useMemo((function(){return me||Vn}),[me,Vn]),Bn=function(e,n){void 0===n&&(n=0);var t=o.useState(e),i=t[0],r=t[1];return he((function(){if(!(n<=0)){var t=setTimeout((function(){r(e)}),n);return function(){clearTimeout(t)}}}),[e,n]),n<=0?e:i}(xn,j),qn=be(te),Pn=be(ne),Wn=ve(R(te)),jn=ve(R(ne)),Kn=ve(On),Hn=o.useRef(!1),Un=o.useRef(),Yn=o.useState((function(){return B(Q,An,Vn)})),Xn=Yn[0],Gn=Yn[1],Jn=we(nn,Bn,Ze,Xn,An,Vn,Le,De,We,Me,c,u,ze),Qn=xe(hn,bn,On,_e,fn,mn,Jn.length,!!ce,K,H,ke,Xe),Zn=Qn[0],$n=Qn[1],_n=function(){var e;return null==(e=vn.current)?void 0:e.blur()},et=function(){var e;return null==(e=vn.current)?void 0:e.focus()},nt=function(e){var n;return null==(n=gn.current)?void 0:n.scrollToItem(e)},tt=T(Xn),ot=o.useCallback((function(e){if(T(Jn)){var n=c?-1:Jn.findIndex((function(e){return e.isSelected})),o=n>-1?n:e===h?0:Jn.length-1;nt(o),Sn(!0),Ln(null),Rn(t({index:o},Jn[o]))}else Sn(!0)}),[c,Jn]),it=o.useCallback((function(e){Gn((function(n){return n.filter((function(n){return n.value!==e}))}))}),[]),rt=o.useCallback((function(t){if(!t.isDisabled){if(t.isSelected)c&&it(t.value);else{t.isSelected,t.isDisabled;var o=n(t,ye);Gn((function(e){return c?[].concat(e,[o]):[o]}))}(N(fe)?fe:N(e)?e:e=function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}())?_n():Ue&&(yn(""),Sn(!1))}}),[c,Ue,fe,it]);o.useImperativeHandle(a,(function(){return{menuOpen:Kn.current,blur:_n,focus:et,clearValue:function(){Gn(S),Rn(I)},setValue:function(e){Gn(B(e,An,Vn))},toggleMenu:function(e){e||void 0===e&&!Kn.current?(et(),ot(h)):_n()}}}),[An,Vn,ot]),l=function(){C&&et()},o.useEffect(l,[]),o.useEffect((function(){Wn.current&&Hn.current&&(Hn.current=!1,qn(Bn))}),[qn,Bn]),he((function(){if(jn.current){var e=c?Xn.map((function(e){return e.data})):T(Xn)?Xn[0].data:null;Pn(e)}}),[Pn,c,Xn]),he((function(){var e=Jn.length,n=Un.current,o=e>0&&(u||e!==nn.length||0===n),i=Kn.current&&void 0!==n&&n<e;if(0===e)Rn(I);else if(1===e||o||i){var r=Math.max(0,Jn.findIndex((function(e){return e.isSelected})));nt(r),Rn(t({index:r},Jn[r]))}Un.current=e}),[u,nn,Jn]);var at=function(){Nn.index;var e=n(Nn,Ce);e.data&&rt(e)},lt=function(e){if(T(Jn)){var n=Nn.index;switch(e){case p:n=Nn.index>0?Nn.index-1:Jn.length-1;break;case m:n=(Nn.index+1)%Jn.length;break;case v:var o=Nn.index-on;n=o<0?0:o;break;case b:var i=Nn.index+on;n=i>Jn.length-1?Jn.length-1:i}nt(n),zn&&Ln(null),Rn(t({index:n},Jn[n]))}},ut=function(e){if(!W){En||et();var n="INPUT"!==e.target.nodeName;On?n&&(Sn(!1),yn("")):qe&&ot(h),n&&e.preventDefault()}},ct=function(e){A(e),et()},st=o.useCallback((function(e){ct(e),Gn(S)}),[]),dt=o.useCallback((function(e){W||qe||(ct(e),Kn.current?Sn(!1):ot(h))}),[W,qe,ot]),ft=!!c&&tt,pt=!!X&&!W&&tt,mt=W||!Re||!!zn;return o.createElement(i.ThemeProvider,{theme:Tn},o.createElement(Oe,{id:w,"aria-controls":s,"aria-expanded":On,onKeyDown:function(e){if(!(W||R(M)&&(M(e.key,xn,Nn),e.defaultPrevented))){switch(e.key){case"ArrowDown":On?lt(m):ot(h);break;case"ArrowUp":On?lt(p):ot(g);break;case"ArrowLeft":case"ArrowRight":if(!c||xn||Ee)return;!function(e){if(tt){var n=-1,t=Xn.length-1,o=zn?Xn.findIndex((function(e){return e.value===zn})):-1,i=(n="ArrowRight"===e?o>-1&&o<t?o+1:-1:0!==o?-1===o?t:o-1:0)>=0?Xn[n].value:null;Nn.data&&Rn(I),i!==zn&&Ln(i)}}(e.key);break;case"PageUp":if(!On)return;lt(v);break;case"PageDown":if(!On)return;lt(b);break;case" ":if(xn)return;if(On){if(!Nn.data)return;at()}else ot(h);break;case"Enter":if(!On)return;at();break;case"Escape":On&&(Sn(!1),yn(""));break;case"Tab":if(e.shiftKey||!On||!Ke||!Nn.data)return;at();break;case"Delete":case"Backspace":if(xn)return;if(zn){var n=Xn.findIndex((function(e){return e.value===zn})),t=n>-1&&n<Xn.length-1?Xn[n+1].value:null;it(zn),Ln(t)}else{if(!Je)return;if(!tt)break;if(c&&!Ee){var o=Xn[Xn.length-1].value;it(o)}else X&&Gn(S)}break;default:return}e.preventDefault()}}},o.createElement(Ie,{ref:bn,isInvalid:D,isFocused:En,isDisabled:W,className:"rfs-control-container",onTouchEnd:ut,onMouseDown:ut},o.createElement(Se,{flex:ft},o.createElement(ee,{isMulti:c,inputValue:xn,placeholder:un,selectedOption:Xn,focusedMultiValue:zn,renderMultiOptions:Ee,renderOptionLabel:Fn,removeSelectedOption:it}),o.createElement(ie,{id:s,ref:vn,required:x,ariaLabel:F,inputValue:xn,readOnly:mt,onBlur:function(e){null==U||U(e),kn(!1),Sn(!1),yn("")},onFocus:function(e){null==Z||Z(e),kn(!0),ue&&ot(h)},onChange:function(e){Hn.current=!0,null==$||$(e.currentTarget.value),yn(e.currentTarget.value),Sn(!0)},ariaLabelledBy:_,hasSelectedOptions:tt})),o.createElement(ge,{menuOpen:On,clearIcon:z,caretIcon:L,isInvalid:D,isLoading:k,showClear:pt,isDisabled:W,loadingNode:J,onClearMouseDown:st,onCaretMouseDown:dt})),o.createElement(Y,{menuRef:hn,menuOpen:On,isLoading:k,menuTop:Zn,height:$n,itemSize:fn,loadingMsg:an,menuOptions:Jn,memoOptions:Ve,fixedSizeListRef:gn,lazyLoadMenu:Fe,noOptionsMsg:sn,selectOption:rt,direction:pe,itemKeySelector:le,overscanCount:de,menuPortalTarget:ce,onMenuMouseDown:ct,width:P||Tn.menu.width,renderOptionLabel:Fn,focusedOptionIndex:Nn.index}),se&&o.createElement(ae,{ariaLive:y,menuOpen:On,isFocused:En,ariaLabel:F,inputValue:xn,isSearchable:Re,focusedOption:Nn,selectedOption:Xn,optionCount:Jn.length})))}));Ee.displayName="Select",exports.Select=Ee; | ||
"use strict";var e,n=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),t=require("@babel/runtime/helpers/extends"),o=require("react"),i=require("styled-components"),r=require("react-dom"),a=require("react-window"),l={tabIndex:0,type:"text",role:"combobox",spellCheck:!1,autoCorrect:"off",autoComplete:"off","aria-haspopup":!0,autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},u="top",c="auto",s="bottom",d="any",f=0,p=1,m=2,g=3,h=4,v=5,b=i.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),x=i.keyframes(["from{opacity:0;}to{opacity:1;}"]),w=i.css([""," 0.2s ease-in"],x),y={border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},C={color:y,input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:i.css([""," 1.19s ease-in-out infinite"],b),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 14px",clear:{width:"14px",height:"16px",animation:w,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",padding:"2px 8px",boxShadow:"0 0 0 0.2rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:w,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",padding:"0.375rem 0.75rem",selectedBgColor:y.primary,focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:w,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:y.danger,transition:"color 0.2s ease-out"}}},O=[],S={index:-1},I={optionLabel:function(e){return e.label},optionValue:function(e){return e.value},isOptionDisabled:function(e){return!!e.isDisabled},optionFilter:function(e){return"string"==typeof e.label?e.label:""+e.label}},E=function(e){return M(e)?window.pageYOffset:e.scrollTop},M=function(e){return e===document.body||e===document.documentElement||e===window},k=function(e){var n=getComputedStyle(e);if("fixed"===n.position)return document.documentElement;for(var t=/(auto|scroll)/,o="absolute"===n.position,i=e;i=null==(r=i)?void 0:r.parentElement;){var r;if(n=getComputedStyle(i),(!o||"static"!==n.position)&&t.test(""+n.overflow+n.overflowX+n.overflowY))return i}return document.documentElement},z=function(e,n,t,o){void 0===t&&(t=300);var i=0,r=E(e),a=n-r;requestAnimationFrame((function n(){var l,u=a*((l=(l=i+=5)/t-1)*l*l+1)+r;!function(e,n){M(e)?window.scrollTo(0,n):e.scrollTop=n}(e,u),i<t?requestAnimationFrame(n):null==o||o()}))},L=/[\u0300-\u036f]/g,D=function(e){return"boolean"==typeof e},N=function(e){return"function"==typeof e},R=function(e){return Array.isArray(e)&&!!e.length},T=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},V=function(e){e.preventDefault(),e.stopPropagation()},A=function(e,n,t){var o=e.trim();return n&&(o=o.toLowerCase()),t?o.normalize("NFD").replace(L,""):o},F=function(e,n,t){var o=Array.isArray(e)?e:T(e)?[e]:O;return R(o)?o.map((function(e){return{data:e,value:n(e),label:t(e)}})):o},B=function e(n,o){var i=t({},n);return Object.keys(o).forEach((function(t){var r=o[t];i[t]="animation"!==t&&T(r)?n[t]?e(n[t],r):r:null!=r?r:""})),i},q=function(e,n){return n.data.memoOptions&&a.areEqual(e,n)},P=o.memo((function(e){var n,t,i,r=e.index,a=e.style,l=e.data,u=l.menuOptions,c=l.selectOption,s=l.renderOptionLabel,d=l.focusedOptionIndex,f=u[r],p=(n=f.isDisabled,t=f.isSelected,i="rfs-option",n&&(i+=" rfs-option-disabled"),t&&(i+=" rfs-option-selected"),r===d&&(i+=" rfs-option-focused"),i);return o.createElement("div",{style:a,className:p,onClick:function(){return c(f)}},s(f.data))}),q);P.displayName="Option";var W=i.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(function(e){return e.theme.noOptions.color}),(function(e){return e.theme.noOptions.margin}),(function(e){return e.theme.noOptions.padding}),(function(e){return e.theme.noOptions.fontSize}),(function(e){return e.theme.noOptions.css})),j=function(e){var n=e.width,t=e.height,i=e.itemSize,r=e.direction,l=e.isLoading,u=e.loadingMsg,c=e.menuOptions,s=e.memoOptions,d=e.selectOption,f=e.noOptionsMsg,p=e.overscanCount,m=e.itemKeySelector,g=e.fixedSizeListRef,h=e.renderOptionLabel,v=e.focusedOptionIndex,b=o.useMemo((function(){return{menuOptions:c,memoOptions:s,selectOption:d,renderOptionLabel:h,focusedOptionIndex:v}}),[c,s,v,d,h]);if(l)return o.createElement(W,null,u);var x=m?function(e,n){return n.menuOptions[e][m]}:void 0;return o.createElement(o.Fragment,null,o.createElement(a.FixedSizeList,{width:n,height:t,itemKey:x,itemSize:i,itemData:b,direction:r,ref:g,overscanCount:p,itemCount:c.length},P),!R(c)&&f&&o.createElement(W,null,f))},H=["id","menuRef","menuTop","menuOpen","lazyLoadMenu","onMenuMouseDown","menuPortalTarget"],K=i.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(function(e){var n=e.menuTop,t=e.menuOpen,o=e.hideNoOptionsMsg,r=e.theme.menu;return i.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],r.width,r.margin,r.padding,r.animation,r.borderRadius,r.backgroundColor,o?"none":r.boxShadow,!t&&"display: none;",n&&"top: "+n+";")}),(function(e){return e.theme.menu.css}),"rfs-option",(function(e){return e.theme.menu.option.padding}),(function(e){return e.theme.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(function(e){return e.theme.menu.option.focusedBgColor}),"rfs-option-selected",(function(e){return e.theme.menu.option.selectedColor}),(function(e){return e.theme.menu.option.selectedBgColor}),"rfs-option-disabled"),U=function(e){var i=e.id,a=e.menuRef,l=e.menuTop,u=e.menuOpen,c=e.lazyLoadMenu,s=e.onMenuMouseDown,d=e.menuPortalTarget,f=n(e,H);if(c&&!u)return null;var p=f.menuOptions,m=f.noOptionsMsg,g=u&&!m&&!R(p),h=o.createElement(K,{id:i,ref:a,menuTop:l,menuOpen:u,onMouseDown:s,className:"rfs-menu-container",hideNoOptionsMsg:g},o.createElement(j,t({},f)));return d?r.createPortal(h,d):h},Y=i.css(["color:",";"],(function(e){return e.theme.multiValue.clear.focusColor})),X=i.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(function(e){var n=e.theme.multiValue;return i.css(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(function(e){return e.theme.multiValue.css})),G=i.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(function(e){return e.theme.multiValue.label.padding}),(function(e){return e.theme.multiValue.label.fontSize}),(function(e){return e.theme.multiValue.label.borderRadius})),J=i.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(function(e){var n=e.theme.multiValue.clear;return i.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,Y)}),(function(e){return e.isFocused&&Y})),Q=o.memo((function(e){var n=e.data,t=e.value,i=e.isFocused,r=e.renderOptionLabel,a=e.removeSelectedOption,l=r(n),u=function(){return a(t)};return o.createElement(X,null,o.createElement(G,null,l),o.createElement(J,{onClick:u,onTouchEnd:u,isFocused:i,onMouseDown:V},"✖"))}));Q.displayName="MultiValue";var Z=i.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})(["margin:0 2px;max-width:100%;overflow:hidden;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;grid-area:1 / 1 / 2 / 3;"]),$=i(Z).withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})(["color:",";"],(function(e){return e.theme.color.placeholder})),_=function(e){var n=e.isMulti,t=e.inputValue,i=e.placeholder,r=e.selectedOption,a=e.focusedMultiValue,l=e.renderOptionLabel,u=e.renderMultiOptions,c=e.removeSelectedOption,s=!R(r);if(t&&(!n||n&&(s||u)))return null;if(s)return o.createElement($,null,i);if(!n){var d=l(r[0].data);return o.createElement(Z,null,d)}return o.createElement(o.Fragment,null,u?u({renderOptionLabel:l,selected:r}):r.map((function(e){var n=e.data,t=e.value;return o.createElement(Q,{key:t,data:n,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:c})})))},ee=i.css(["border:0;margin:0;outline:0;padding:0;font:inherit;min-width:2px;grid-area:1 / 2 / auto / auto;"]),ne=i.div.withConfig({displayName:"InputWrapper",componentId:"sc-4er7q8-0"})(['margin:2px;flex:1 1 auto;display:inline-grid;box-sizing:border-box;grid-area:1 / 1 / 2 / 3;grid-template-columns:0px min-content;:after{white-space:pre;visibility:hidden;content:attr(data-value) " ";',"}"],ee),te=i.input.attrs(l).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["width:100%;background:0;color:inherit;"," :read-only{cursor:default;}"," ",""],ee,(function(e){return e.theme.input.css}),(function(e){var n=e.theme;return e.invalid&&n.input.cssRequired})),oe=o.forwardRef((function(e,n){var t=e.id,i=e.menuId,r=e.onBlur,a=e.onFocus,l=e.onChange,u=e.readOnly,c=e.required,s=e.menuOpen,d=e.ariaLabel,f=e.isInvalid,p=e.inputValue,m=e.ariaLabelledBy,g=e.hasSelectedOptions,h=f||c&&!g;return o.createElement(ne,{"data-value":p},o.createElement(te,{invalid:!0,id:t,ref:n,onBlur:r,onFocus:a,value:p,readOnly:u,"aria-owns":i,"aria-controls":i,"aria-label":d,"aria-required":h,"aria-expanded":s,"aria-labelledby":m,onChange:u?void 0:l}))}));oe.displayName="AutosizeInput";var ie=i.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip-path:inset(50%);clip:rect(1px,1px,1px,1px);"]),re=function(e){var n=e.menuOpen,t=e.isFocused,i=e.inputValue,r=e.optionCount,a=e.isSearchable,l=e.focusedOption,u=e.selectedOption,c=e.ariaLive,s=void 0===c?"polite":c,d=e.ariaLabel,f=void 0===d?"Select":d;if(!t)return null;var p=l.index,m=l.label,g=l.isDisabled,h=l.isSelected,v=((m?"Option "+m+" is "+(h?"selected":"focused")+(g?" disabled":"")+", "+(p+1)+" of "+r+".":"")+" "+(r+" option(s) available"+(i?" for search "+i:"")+".")+" "+(n?"Use Up and Down to choose options"+(g?"":", press Enter or Tab to select the currently focused option")+", press Escape to close the menu.":f+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.")).trimStart(),b="Selected option: "+(u.length?u.map((function(e){return e.label})).join(" "):"N/A");return o.createElement(ie,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},o.createElement("span",{id:"aria-selection"},b),o.createElement("span",{id:"aria-context"},v))},ae=i.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(function(e){return e.theme.loader.padding}),(function(e){var n=e.theme;return i.css(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),le=function(){return o.createElement(ae,{"aria-hidden":!0,className:"rfs-loading-dots"},o.createElement("div",null),o.createElement("div",null),o.createElement("div",null))},ue=i.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(function(e){var n=e.theme;return i.css(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),ce=function(){return o.createElement(ue,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},o.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"}))},se=i.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),de=i.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(function(e){return e.theme.icon.color}),(function(e){return e.theme.icon.padding}),(function(e){return e.theme.icon.hoverColor}),(function(e){return e.theme.icon.css})),fe=i.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:8px 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(function(e){var n=e.theme;return n.color.iconSeparator||n.color.border})),pe=i.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(function(e){return e.theme.icon.caret.transition}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){var n=e.theme,t=e.menuOpen,o=e.isInvalid;return t&&i.css(["transform:rotate(180deg);color:",";"],o?n.color.danger:n.color.caretActive||n.color.primary)})),me=o.memo((function(e){var n=e.menuOpen,t=e.clearIcon,i=e.caretIcon,r=e.isInvalid,a=e.showClear,l=e.isLoading,u=e.isDisabled,c=e.loadingNode,s=e.onCaretMouseDown,d=e.onClearMouseDown,f=function(e){return N(e)?e({menuOpen:n,isLoading:l,isInvalid:r,isDisabled:u}):e};return o.createElement(se,null,a&&!l&&o.createElement(de,{onTouchEnd:d,onMouseDown:d},f(t)||o.createElement(ce,null)),l&&(c||o.createElement(le,null)),o.createElement(fe,{role:"none"}),o.createElement(de,{onTouchEnd:s,onMouseDown:s},f(i)||o.createElement(pe,{"aria-hidden":!0,menuOpen:n,isInvalid:r,className:"rfs-caret-icon"})))}));me.displayName="IndicatorIcons";var ge=function(e,n){var t=o.useRef(!0);o.useEffect((function(){if(!t.current)return e();t.current=!1}),n)},he=function(e){var n=o.useRef(e);return n.current=e,n},ve=function(e){var n=o.useRef(e);return o.useEffect((function(){n.current=e})),o.useCallback((function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current.apply(n,t)}),[])},be=function(e,n,t,i,r,a,l,u,c,s,f,p,m){void 0===c&&(c=!1),void 0===s&&(s=!1),void 0===f&&(f=!1),void 0===p&&(p=!1);var g=ve(l||I.isOptionDisabled),h=ve(u||I.optionFilter),v=D(m)?m:f,b=p?"":n;return o.useMemo((function(){var n=i.map((function(e){return e.value})),o=t===d,l=A(b,c,s),u=function(e){var t=r(e),i=a(e),u=g(e),d=n.includes(t),f={data:e,value:t,label:i,isDisabled:u,isSelected:d};return!function(e){if(!l)return!0;var n=h(e),t=A(n,c,s);return o?t.includes(l):t.startsWith(l)}(f)||v&&d?void 0:f};return e.reduce((function(e,n){var t=u(n);return t&&e.push(t),e}),[])}),[e,b,r,a,i,t,c,s,g,h,v])},xe=function(e,n,t,i,r,a,l,s,d,f,p,m){var g=i===u||i===c&&!function(e){if(!e)return!0;var n=k(e),t=e.getBoundingClientRect(),o=t.top,i=t.height;return n.getBoundingClientRect().height-E(n)-o>=i}(e.current),h=ve(d),v=ve(f),b=o.useRef(!1),x=o.useState(a),w=x[0],y=x[1],C=he(!g&&!s);ge((function(){if(t){var n=function(e){h(),e&&(b.current=!0,y(e))};C.current?function(e,n,t,o){if(e){var i=e.getBoundingClientRect(),r=i.top,a=i.height,l=i.bottom,u=window.innerHeight;if(u-r>=a)o();else{var c=k(e),s=E(c),d=c.getBoundingClientRect().height-s-r,f=d<a;if(!f&&t){var p=parseInt(getComputedStyle(e).marginBottom,10);z(c,l-u+s+p,n,o)}else o(f?d:void 0)}}else o()}(e.current,p,m,n):n()}else v(),b.current&&(b.current=!1,y(a))}),[e,t,C,a,m,p,h,v]);var O=Math.min(w,l*r),S=g?function(e,n,t){var o,i,r=n&&getComputedStyle(n),a=r?parseInt(r.marginBottom,10):0,l=r?parseInt(r.marginTop,10):0,u=null!=(o=null==t?void 0:t.getBoundingClientRect().height)?o:0,c=e>0?e:null!=(i=null==n?void 0:n.getBoundingClientRect().height)?i:0;return"calc("+-Math.abs(c+u)+"px + "+(a+l)+"px)"}(O,e.current,n.current):void 0;return{menuStyleTop:S,menuHeightCalc:O}},we=["isSelected","isDisabled"],ye=["index"],Ce=i.div.withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(function(e){return e.theme.select.css})),Oe=i.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;display:",";padding:",";"],(function(e){return e.flex?"flex":"grid"}),(function(e){return e.theme.control.padding})),Se=i.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(function(e){var n=e.isDisabled,t=e.isFocused,o=e.isInvalid,r=e.theme,a=r.control,l=r.color;return i.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,o?l.danger:t?a.focusedBorderColor:l.border,a.height&&"height: "+a.height+";",n&&"pointer-events:none;user-select:none;",(a.backgroundColor||n)&&"background-color: "+(n?l.disabled:a.backgroundColor)+";",t&&"box-shadow: "+a.boxShadow+" "+(o?l.dangerLight:a.boxShadowColor)+";")}),(function(e){return e.theme.control.css}),(function(e){var n=e.isFocused,t=e.theme;return n&&t.control.focusedCss})),Ie=o.forwardRef((function(r,a){var l,u=r.async,c=r.menuId,b=r.isMulti,x=r.inputId,w=r.selectId,y=r.required,E=r.ariaLive,M=r.autoFocus,k=r.isLoading,z=r.onKeyDown,L=r.clearIcon,A=r.caretIcon,q=r.isInvalid,P=r.ariaLabel,W=r.menuWidth,j=r.isDisabled,H=r.inputDelay,K=r.onMenuOpen,Y=r.onMenuClose,X=r.onInputBlur,G=r.isClearable,J=r.themeConfig,Q=r.loadingNode,Z=r.initialValue,$=r.onInputFocus,ee=r.onInputChange,ne=r.ariaLabelledBy,te=r.onOptionChange,ie=r.onSearchChange,ae=r.getOptionLabel,le=r.getOptionValue,ue=r.itemKeySelector,ce=r.openMenuOnFocus,se=r.menuPortalTarget,de=r.isAriaLiveEnabled,fe=r.menuOverscanCount,pe=r.blurInputOnSelect,Ie=r.menuItemDirection,Ee=r.renderOptionLabel,Me=r.renderMultiOptions,ke=r.menuScrollDuration,ze=r.filterIgnoreAccents,Le=r.hideSelectedOptions,De=r.getIsOptionDisabled,Ne=r.getFilterOptionString,Re=r.isSearchable,Te=void 0===Re||Re,Ve=r.memoOptions,Ae=void 0!==Ve&&Ve,Fe=r.lazyLoadMenu,Be=void 0!==Fe&&Fe,qe=r.openMenuOnClick,Pe=void 0===qe||qe,We=r.filterIgnoreCase,je=void 0===We||We,He=r.tabSelectsOption,Ke=void 0===He||He,Ue=r.closeMenuOnSelect,Ye=void 0===Ue||Ue,Xe=r.scrollMenuIntoView,Ge=void 0===Xe||Xe,Je=r.backspaceClearsValue,Qe=void 0===Je||Je,Ze=r.filterMatchFrom,$e=void 0===Ze?d:Ze,_e=r.menuPosition,en=void 0===_e?s:_e,nn=r.options,tn=void 0===nn?O:nn,on=r.pageSize,rn=void 0===on?5:on,an=r.loadingMsg,ln=void 0===an?"Loading..":an,un=r.placeholder,cn=void 0===un?"Select option..":un,sn=r.noOptionsMsg,dn=void 0===sn?"No options":sn,fn=r.menuItemSize,pn=void 0===fn?35:fn,mn=r.menuMaxHeight,gn=void 0===mn?300:mn,hn=o.useRef(null),vn=o.useRef(null),bn=o.useRef(null),xn=o.useRef(null),wn=o.useState(""),yn=wn[0],Cn=wn[1],On=o.useState(!1),Sn=On[0],In=On[1],En=o.useState(!1),Mn=En[0],kn=En[1],zn=o.useState(null),Ln=zn[0],Dn=zn[1],Nn=o.useState(S),Rn=Nn[0],Tn=Nn[1],Vn=o.useMemo((function(){return T(J)?B(C,J):C}),[J]),An=o.useMemo((function(){return ae||I.optionLabel}),[ae]),Fn=o.useMemo((function(){return le||I.optionValue}),[le]),Bn=o.useMemo((function(){return Ee||An}),[Ee,An]),qn=function(e,n){void 0===n&&(n=0);var t=o.useState(e),i=t[0],r=t[1];return ge((function(){if(!(n<=0)){var t=setTimeout((function(){r(e)}),n);return function(){clearTimeout(t)}}}),[e,n]),n<=0?e:i}(yn,H),Pn=ve(ie),Wn=ve(te),jn=he(N(ie)),Hn=he(N(te)),Kn=he(Sn),Un=o.useRef(!1),Yn=o.useRef(),Xn=o.useState((function(){return F(Z,Fn,An)})),Gn=Xn[0],Jn=Xn[1],Qn=be(tn,qn,$e,Gn,Fn,An,De,Ne,je,ze,b,u,Le),Zn=xe(vn,xn,Sn,en,pn,gn,Qn.length,!!se,K,Y,ke,Ge),$n=Zn.menuStyleTop,_n=Zn.menuHeightCalc,et=function(){var e;return null==(e=bn.current)?void 0:e.blur()},nt=function(){var e;return null==(e=bn.current)?void 0:e.focus()},tt=function(e){var n;return null==(n=hn.current)?void 0:n.scrollToItem(e)},ot=R(Gn),it=o.useCallback((function(e){if(R(Qn)){var n=b?-1:Qn.findIndex((function(e){return e.isSelected})),o=n>-1?n:e===g?0:Qn.length-1;tt(o),In(!0),Dn(null),Tn(t({index:o},Qn[o]))}else In(!0)}),[b,Qn]),rt=o.useCallback((function(e){Jn((function(n){return n.filter((function(n){return n.value!==e}))}))}),[]),at=o.useCallback((function(t){if(!t.isDisabled){if(t.isSelected)b&&rt(t.value);else{t.isSelected,t.isDisabled;var o=n(t,we);Jn((function(e){return b?[].concat(e,[o]):[o]}))}(D(pe)?pe:D(e)?e:e=function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}())?et():Ye&&(Cn(""),In(!1))}}),[b,Ye,pe,rt]);o.useImperativeHandle(a,(function(){return{menuOpen:Kn.current,blur:et,focus:nt,clearValue:function(){Jn(O),Tn(S)},setValue:function(e){Jn(F(e,Fn,An))},toggleMenu:function(e){e||void 0===e&&!Kn.current?(nt(),it(g)):et()}}}),[Kn,Fn,An,it]),l=function(){M&&nt()},o.useEffect(l,[]),o.useEffect((function(){jn.current&&Un.current&&(Un.current=!1,Pn(qn))}),[Pn,jn,qn]),ge((function(){if(Hn.current){var e=b?Gn.map((function(e){return e.data})):R(Gn)?Gn[0].data:null;Wn(e)}}),[Wn,Hn,b,Gn]),ge((function(){var e=Qn.length,n=Yn.current,o=e>0&&(u||e!==tn.length||0===n),i=Kn.current&&void 0!==n&&n<e;if(0===e)Tn(S);else if(1===e||o||i){var r=Math.max(0,Qn.findIndex((function(e){return e.isSelected})));tt(r),Tn(t({index:r},Qn[r]))}Yn.current=e}),[u,tn,Kn,Qn]);var lt=function(){Rn.index;var e=n(Rn,ye);e.data&&at(e)},ut=function(e){if(R(Qn)){var n=Rn.index;switch(e){case f:n=Rn.index>0?Rn.index-1:Qn.length-1;break;case p:n=(Rn.index+1)%Qn.length;break;case h:var o=Rn.index-rn;n=o<0?0:o;break;case v:var i=Rn.index+rn;n=i>Qn.length-1?Qn.length-1:i}tt(n),Ln&&Dn(null),Tn(t({index:n},Qn[n]))}},ct=function(e){if(!j){Mn||nt();var n="INPUT"!==e.target.nodeName;Sn?n&&(In(!1),Cn("")):Pe&&it(g),n&&e.preventDefault()}},st=function(e){V(e),nt()},dt=o.useCallback((function(e){st(e),Jn(O)}),[]),ft=o.useCallback((function(e){j||Pe||(st(e),Kn.current?In(!1):it(g))}),[j,Pe,it]),pt=!!b&&ot,mt=!!G&&!j&&ot;return o.createElement(i.ThemeProvider,{theme:Vn},o.createElement(Ce,{id:w,onKeyDown:function(e){if(!(j||z&&(z(e,yn,Rn),e.defaultPrevented))){switch(e.key){case"ArrowDown":Sn?ut(p):it(g);break;case"ArrowUp":Sn?ut(f):it(m);break;case"ArrowLeft":case"ArrowRight":if(!b||yn||Me)return;!function(e){if(ot){var n=-1,t=Gn.length-1,o=Ln?Gn.findIndex((function(e){return e.value===Ln})):-1,i=(n="ArrowRight"===e?o>-1&&o<t?o+1:-1:0!==o?-1===o?t:o-1:0)>-1?Gn[n].value:null;Rn.data&&Tn(S),i!==Ln&&Dn(i)}}(e.key);break;case"PageUp":if(!Sn)return;ut(h);break;case"PageDown":if(!Sn)return;ut(v);break;case" ":if(yn)return;if(Sn){if(!Rn.data)return;lt()}else it(g);break;case"Enter":if(!Sn)return;lt();break;case"Escape":Sn&&(In(!1),Cn(""));break;case"Tab":if(e.shiftKey||!Sn||!Ke||!Rn.data)return;lt();break;case"Delete":case"Backspace":if(yn)return;if(Ln){var n=Gn.findIndex((function(e){return e.value===Ln})),t=n>-1&&n<Gn.length-1?Gn[n+1].value:null;rt(Ln),Dn(t)}else{if(!Qe)return;if(!ot)break;if(b&&!Me){var o=Gn[Gn.length-1].value;rt(o)}else G&&Jn(O)}break;default:return}e.preventDefault()}},className:"rfs-select-container"},o.createElement(Se,{ref:xn,isInvalid:q,isFocused:Mn,isDisabled:j,className:"rfs-control-container",onTouchEnd:ct,onMouseDown:ct},o.createElement(Oe,{flex:pt},o.createElement(_,{isMulti:b,inputValue:yn,placeholder:cn,selectedOption:Gn,focusedMultiValue:Ln,renderMultiOptions:Me,renderOptionLabel:Bn,removeSelectedOption:rt}),o.createElement(oe,{id:x,ref:bn,menuId:c,menuOpen:Sn,required:y,ariaLabel:P,isInvalid:q,inputValue:yn,onBlur:function(e){null==X||X(e),kn(!1),In(!1),Cn("")},onFocus:function(e){null==$||$(e),kn(!0),ce&&it(g)},onChange:function(e){Un.current=!0,null==ee||ee(e.currentTarget.value),Cn(e.currentTarget.value),In(!0)},ariaLabelledBy:ne,hasSelectedOptions:ot,readOnly:!Te||!!Ln})),o.createElement(me,{menuOpen:Sn,clearIcon:L,caretIcon:A,isInvalid:q,isLoading:k,showClear:mt,isDisabled:j,loadingNode:Q,onClearMouseDown:dt,onCaretMouseDown:ft})),o.createElement(U,{id:c,menuRef:vn,menuOpen:Sn,isLoading:k,menuTop:$n,height:_n,itemSize:pn,loadingMsg:ln,menuOptions:Qn,memoOptions:Ae,fixedSizeListRef:hn,lazyLoadMenu:Be,noOptionsMsg:dn,selectOption:at,direction:Ie,itemKeySelector:ue,overscanCount:fe,menuPortalTarget:se,onMenuMouseDown:st,width:W||Vn.menu.width,renderOptionLabel:Bn,focusedOptionIndex:Rn.index}),de&&o.createElement(re,{ariaLive:E,menuOpen:Sn,isFocused:Mn,ariaLabel:P,inputValue:yn,isSearchable:Te,focusedOption:Rn,selectedOption:Gn,optionCount:Qn.length})))}));Ie.displayName="Select",exports.Select=Ie; |
@@ -1,1 +0,1 @@ | ||
import e from"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";import n from"@babel/runtime/helpers/esm/extends";import r,{memo as t,useMemo as o,Fragment as i,forwardRef as a,useRef as l,useEffect as d,useState as s,useCallback as u,useImperativeHandle as c}from"react";import p,{css as m,keyframes as g,ThemeProvider as h}from"styled-components";import{createPortal as f}from"react-dom";import{areEqual as v,FixedSizeList as b}from"react-window";var w,x={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},y={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},O={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},C={ANY:"any",START:"start"},I=0,S=1,E=2,M=3,k=4,z=5,L=g(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),N=m([""," 0.2s ease-in"],g(["from{opacity:0;}to{opacity:1;}"])),D={border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},T={color:D,input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:m([""," 1.19s ease-in-out infinite"],L),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 14px",clear:{width:"14px",height:"16px",animation:N,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",padding:"2px 8px",boxShadow:"0 0 0 0.2rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:N,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",padding:"0.375rem 0.75rem",selectedBgColor:D.primary,focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:N,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:D.danger,transition:"color 0.2s ease-out"}}},A=5,V=35,B=300,R="Loading..",F="No options",P="Select option..",W=[],q={index:-1},j={optionLabel:e=>e.label,optionValue:e=>e.value,isOptionDisabled:e=>!!e.isDisabled,optionFilter:e=>"string"==typeof e.label?e.label:""+e.label},K=e=>U(e)?window.pageYOffset:e.scrollTop,U=e=>e===document.body||e===document.documentElement||e===window,Y=e=>{var n=getComputedStyle(e);if("fixed"===n.position)return document.documentElement;for(var r=/(auto|scroll)/,t="absolute"===n.position,o=e;o=null==(i=o)?void 0:i.parentElement;){var i;if(n=getComputedStyle(o),(!t||"static"!==n.position)&&r.test(""+n.overflow+n.overflowX+n.overflowY))return o}return document.documentElement},H=function(e,n,r,t){void 0===r&&(r=300);var o=0,i=K(e),a=n-i,l=()=>{var n,d=a*((n=(n=o+=5)/r-1)*n*n+1)+i;((e,n)=>{U(e)?window.scrollTo(0,n):e.scrollTop=n})(e,d),o<r?requestAnimationFrame(l):null==t||t()};requestAnimationFrame(l)},X=/[\u0300-\u036f]/g,G=e=>"boolean"==typeof e,J=e=>"function"==typeof e,Q=e=>Array.isArray(e)&&!!e.length,Z=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),$=e=>{e.preventDefault(),e.stopPropagation()},_=(e,n,r)=>{var t=e.trim();return n&&(t=t.toLowerCase()),r?t.normalize("NFD").replace(X,""):t},ee=(e,n,r)=>{var t=Array.isArray(e)?e:Z(e)?[e]:W;return Q(t)?t.map((e=>({data:e,value:n(e),label:r(e)}))):t},ne=(e,r)=>{var t=n({},e);return Object.keys(r).forEach((n=>{var o=r[n];t[n]="animation"!==n&&Z(o)?e[n]?ne(e[n],o):o:null!=o?o:""})),t},re=t((e=>{var n,t,o,{index:i,style:a,data:{menuOptions:l,selectOption:d,renderOptionLabel:s,focusedOptionIndex:u}}=e,c=l[i],p=(n=c.isDisabled,t=c.isSelected,o="rfs-option",n&&(o+=" rfs-option-disabled"),t&&(o+=" rfs-option-selected"),i===u&&(o+=" rfs-option-focused"),o);return r.createElement("div",{style:a,className:p,onClick:()=>d(c)},s(c.data))}),((e,n)=>{var{memoOptions:r}=n.data;return r&&v(e,n)}));re.displayName="Option";var te=p.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:n}=e;return n.noOptions.color}),(e=>{var{theme:n}=e;return n.noOptions.margin}),(e=>{var{theme:n}=e;return n.noOptions.padding}),(e=>{var{theme:n}=e;return n.noOptions.fontSize}),(e=>{var{theme:n}=e;return n.noOptions.css})),oe=e=>{var{width:n,height:t,itemSize:a,direction:l,isLoading:d,loadingMsg:s,menuOptions:u,memoOptions:c,selectOption:p,noOptionsMsg:m,overscanCount:g,itemKeySelector:h,fixedSizeListRef:f,renderOptionLabel:v,focusedOptionIndex:w}=e,x=o((()=>({menuOptions:u,memoOptions:c,selectOption:p,renderOptionLabel:v,focusedOptionIndex:w})),[u,c,w,p,v]);if(d)return r.createElement(te,null,s);var y=h?(e,n)=>n.menuOptions[e][h]:void 0;return r.createElement(i,null,r.createElement(b,{width:n,height:t,itemKey:y,itemSize:a,itemData:x,direction:l,ref:f,overscanCount:g,itemCount:u.length},re),!Q(u)&&m&&r.createElement(te,null,m))},ie=["menuRef","menuTop","menuOpen","lazyLoadMenu","onMenuMouseDown","menuPortalTarget"],ae=p.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:n,menuOpen:r,hideNoOptionsMsg:t,theme:{menu:o}}=e;return m(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,t?"none":o.boxShadow,!r&&"display: none;",n&&"top: "+n+";")}),(e=>{var{theme:n}=e;return n.menu.css}),"rfs-option",(e=>{var{theme:n}=e;return n.menu.option.padding}),(e=>{var{theme:n}=e;return n.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.focusedBgColor}),"rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.selectedColor}),(e=>{var{theme:n}=e;return n.menu.option.selectedBgColor}),"rfs-option-disabled"),le=t=>{var{menuRef:o,menuTop:i,menuOpen:a,lazyLoadMenu:l,onMenuMouseDown:d,menuPortalTarget:s}=t,u=e(t,ie);if(l&&!a)return null;var{menuOptions:c,noOptionsMsg:p}=u,m=a&&!p&&!Q(c),g=r.createElement(ae,{ref:o,menuTop:i,menuOpen:a,onMouseDown:d,className:"rfs-menu-container",hideNoOptionsMsg:m},r.createElement(oe,n({},u)));return s?f(g,s):g},de=m(["color:",";"],(e=>{var{theme:n}=e;return n.multiValue.clear.focusColor})),se=p.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:n}}=e;return m(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(e=>{var{theme:n}=e;return n.multiValue.css})),ue=p.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:n}=e;return n.multiValue.label.padding}),(e=>{var{theme:n}=e;return n.multiValue.label.fontSize}),(e=>{var{theme:n}=e;return n.multiValue.label.borderRadius})),ce=p.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:n}}}=e;return m(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,de)}),(e=>{var{isFocused:n}=e;return n&&de})),pe=t((e=>{var{data:n,value:t,isFocused:o,renderOptionLabel:i,removeSelectedOption:a}=e,l=i(n),d=()=>a(t);return r.createElement(se,null,r.createElement(ue,null,l),r.createElement(ce,{onClick:d,onTouchEnd:d,isFocused:o,onMouseDown:$},"✖"))}));pe.displayName="MultiValue";var me=p.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})(["margin:0 2px;max-width:100%;overflow:hidden;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;grid-area:1 / 1 / 2 / 3;"]),ge=p(me).withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})(["color:",";"],(e=>{var{theme:n}=e;return n.color.placeholder})),he=e=>{var{isMulti:n,inputValue:t,placeholder:o,selectedOption:a,focusedMultiValue:l,renderOptionLabel:d,renderMultiOptions:s,removeSelectedOption:u}=e,c=!Q(a);if(t&&(!n||n&&(c||s)))return null;if(c)return r.createElement(ge,null,o);if(!n){var p=d(a[0].data);return r.createElement(me,null,p)}return r.createElement(i,null,s?s({renderOptionLabel:d,selected:a}):a.map((e=>{var{data:n,value:t}=e;return r.createElement(pe,{key:t,data:n,value:t,renderOptionLabel:d,isFocused:t===l,removeSelectedOption:u})})))},fe=m(["border:0;margin:0;outline:0;padding:0;font:inherit;min-width:2px;grid-area:1 / 2 / auto / auto;"]),ve=p.div.withConfig({displayName:"InputWrapper",componentId:"sc-4er7q8-0"})(['margin:2px;flex:1 1 auto;display:inline-grid;box-sizing:border-box;grid-area:1 / 1 / 2 / 3;grid-template-columns:0px min-content;:after{white-space:pre;visibility:hidden;content:attr(data-value) " ";',"}"],fe),be=p.input.attrs(y).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["width:100%;background:0;color:inherit;"," :read-only{opacity:0;cursor:default;}:required{","}",""],fe,(e=>{var{theme:n,isInvalid:r}=e;return r&&n.input.cssRequired}),(e=>{var{theme:n}=e;return n.input.css})),we=a(((e,n)=>{var{id:t,onBlur:o,onFocus:i,readOnly:a,required:l,onChange:d,ariaLabel:s,inputValue:u,ariaLabelledBy:c,hasSelectedOptions:p}=e,m=!!l&&!p;return r.createElement(ve,{"data-value":u},r.createElement(be,{id:t,ref:n,isInvalid:!0,onBlur:o,onFocus:i,value:u,readOnly:a,required:m,"aria-label":s,"aria-labelledby":c,onChange:a?void 0:d}))}));we.displayName="AutosizeInput";var xe=p.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),ye=e=>{var{menuOpen:n,isFocused:t,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:d,ariaLive:s="polite",ariaLabel:u="Select"}=e;if(!t)return null;var c=n?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":u+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.",{index:p,value:m,label:g,isDisabled:h}=l,f=((m&&!h?"Option "+g+" is focused, "+(p+1)+" of "+i+".":"")+" "+(i+" option(s) available"+(o?" for search "+o:"")+".")+" "+c).trimStart(),v="Selected option: "+(d.length?d.map((e=>e.label)).join(" "):"N/A");return r.createElement(xe,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},r.createElement("span",{id:"aria-selection"},v),r.createElement("span",{id:"aria-context"},f))},Oe=p.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:n}=e;return n.loader.padding}),(e=>{var{theme:n}=e;return m(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),Ce=()=>r.createElement(Oe,{"aria-hidden":!0,className:"rfs-loading-dots"},r.createElement("div",null),r.createElement("div",null),r.createElement("div",null)),Ie=p.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:n}=e;return m(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),Se=()=>r.createElement(Ie,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},r.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Ee=p.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Me=p.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:n}=e;return n.icon.color}),(e=>{var{theme:n}=e;return n.icon.padding}),(e=>{var{theme:n}=e;return n.icon.hoverColor}),(e=>{var{theme:n}=e;return n.icon.css})),ke=p.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:8px 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:n}=e;return n.color.iconSeparator||n.color.border})),ze=p.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:n}=e;return n.icon.caret.transition}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n,menuOpen:r,isInvalid:t}=e;return r&&m(["transform:rotate(180deg);color:",";"],t?n.color.danger:n.color.caretActive||n.color.primary)})),Le=t((e=>{var{menuOpen:n,clearIcon:t,caretIcon:o,isInvalid:i,showClear:a,isLoading:l,isDisabled:d,loadingNode:s,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>J(e)?e({menuOpen:n,isLoading:l,isInvalid:i,isDisabled:d}):e;return r.createElement(Ee,null,a&&!l&&r.createElement(Me,{onTouchEnd:c,onMouseDown:c},p(t)||r.createElement(Se,null)),l&&(s||r.createElement(Ce,null)),r.createElement(ke,{role:"none"}),r.createElement(Me,{onTouchEnd:u,onMouseDown:u},p(o)||r.createElement(ze,{"aria-hidden":!0,menuOpen:n,isInvalid:i,className:"rfs-caret-icon"})))}));Le.displayName="IndicatorIcons";var Ne=(e,n)=>{var r=l(!0);d((()=>{if(!r.current)return e();r.current=!1}),n)},De=e=>{var n=l(e);return n.current=e,n},Te=e=>{var n=l(e);return d((()=>{n.current=e})),u((function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return null==n.current?void 0:n.current(...r)}),[])},Ae=function(e,n,r,t,i,a,l,d,s,u,c,p,m){void 0===s&&(s=!1),void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1);var g=Te(l||j.isOptionDisabled),h=Te(d||j.optionFilter),f=G(m)?m:c,v=p?"":n;return o((()=>{var n=t.map((e=>e.value)),o=r===C.ANY,l=_(v,s,u),d=e=>{var r=i(e),t=a(e),d=g(e),c=n.includes(r),p={data:e,value:r,label:t,isDisabled:d,isSelected:c};return!(e=>{if(!l)return!0;var n=h(e),r=_(n,s,u);return o?r.includes(l):r.startsWith(l)})(p)||f&&c?void 0:p};return e.reduce(((e,n)=>{var r=d(n);return r&&e.push(r),e}),[])}),[e,v,i,a,t,r,s,u,g,h,f])},Ve=(e,n,r,t,o,i,a,d,u,c,p,m)=>{var g=t===O.TOP||t===O.AUTO&&!(e=>{if(!e)return!0;var n=Y(e),{top:r,height:t}=e.getBoundingClientRect();return n.getBoundingClientRect().height-K(n)-r>=t})(e.current),h=Te(u),f=Te(c),v=l(!1),[b,w]=s(i),x=De(!g&&!d);Ne((()=>{if(r){var n=e=>{h(),e&&(v.current=!0,w(e))};x.current?((e,n,r,t)=>{if(e){var{top:o,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=i)t();else{var d=Y(e),s=K(d),u=d.getBoundingClientRect().height-s-o,c=u<i;if(!c&&r){var p=parseInt(getComputedStyle(e).marginBottom,10);H(d,a-l+s+p,n,t)}else t(c?u:void 0)}}else t()})(e.current,p,m,n):n()}else f(),v.current&&(v.current=!1,w(i))}),[e,r,i,m,p,h,f]);var y=Math.min(b,a*o),C=g?((e,n,r)=>{var t,o,i=n&&getComputedStyle(n),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0,d=null!=(t=null==r?void 0:r.getBoundingClientRect().height)?t:0,s=e>0?e:null!=(o=null==n?void 0:n.getBoundingClientRect().height)?o:0;return"calc("+-Math.abs(s+d)+"px + "+(a+l)+"px)"})(y,e.current,n.current):void 0;return[C,y]},Be=["isSelected","isDisabled"],Re=["index"],Fe=p.div.attrs(x).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:n}=e;return n.select.css})),Pe=p.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;display:",";padding:",";"],(e=>{var{flex:n}=e;return n?"flex":"grid"}),(e=>{var{theme:n}=e;return n.control.padding})),We=p.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:n,isFocused:r,isInvalid:t,theme:{control:o,color:i}}=e;return m(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,t?i.danger:r?o.focusedBorderColor:i.border,o.height&&"height: "+o.height+";",n&&"pointer-events:none;user-select:none;",(o.backgroundColor||n)&&"background-color: "+(n?i.disabled:o.backgroundColor)+";",r&&"box-shadow: "+o.boxShadow+" "+(t?i.dangerLight:o.boxShadowColor)+";")}),(e=>{var{theme:n}=e;return n.control.css}),(e=>{var{isFocused:n,theme:r}=e;return n&&r.control.focusedCss})),qe=a(((t,i)=>{var{async:a,isMulti:p,inputId:m,selectId:g,required:f,ariaLive:v,autoFocus:b,isLoading:x,onKeyDown:y,clearIcon:L,caretIcon:N,isInvalid:D,ariaLabel:K,menuWidth:U,isDisabled:Y,inputDelay:H,onMenuOpen:X,onMenuClose:_,onInputBlur:re,isClearable:te,themeConfig:oe,loadingNode:ie,initialValue:ae,onInputFocus:de,onInputChange:se,ariaLabelledBy:ue,onOptionChange:ce,onSearchChange:pe,getOptionLabel:me,getOptionValue:ge,itemKeySelector:fe,openMenuOnFocus:ve,menuPortalTarget:be,isAriaLiveEnabled:xe,menuOverscanCount:Oe,blurInputOnSelect:Ce,menuItemDirection:Ie,renderOptionLabel:Se,renderMultiOptions:Ee,menuScrollDuration:Me,filterIgnoreAccents:ke,hideSelectedOptions:ze,getIsOptionDisabled:qe,getFilterOptionString:je,isSearchable:Ke=!0,memoOptions:Ue=!1,lazyLoadMenu:Ye=!1,openMenuOnClick:He=!0,filterIgnoreCase:Xe=!0,tabSelectsOption:Ge=!0,closeMenuOnSelect:Je=!0,scrollMenuIntoView:Qe=!0,backspaceClearsValue:Ze=!0,filterMatchFrom:$e=C.ANY,menuPosition:_e=O.BOTTOM,options:en=W,pageSize:nn=A,loadingMsg:rn=R,placeholder:tn=P,noOptionsMsg:on=F,menuItemSize:an=V,menuMaxHeight:ln=B}=t,dn=l(null),sn=l(null),un=l(null),cn=l(null),[pn,mn]=s(""),[gn,hn]=s(!1),[fn,vn]=s(!1),[bn,wn]=s(null),[xn,yn]=s(q),On=o((()=>Z(oe)?ne(T,oe):T),[oe]),Cn=o((()=>me||j.optionLabel),[me]),In=o((()=>ge||j.optionValue),[ge]),Sn=o((()=>Se||Cn),[Se,Cn]),En=function(e,n){void 0===n&&(n=0);var[r,t]=s(e);return Ne((()=>{if(!(n<=0)){var r=setTimeout((()=>{t(e)}),n);return()=>{clearTimeout(r)}}}),[e,n]),n<=0?e:r}(pn,H),Mn=Te(pe),kn=Te(ce),zn=De(J(pe)),Ln=De(J(ce)),Nn=De(gn),Dn=l(!1),Tn=l(),[An,Vn]=s((()=>ee(ae,In,Cn))),Bn=Ae(en,En,$e,An,In,Cn,qe,je,Xe,ke,p,a,ze),[Rn,Fn]=Ve(sn,cn,gn,_e,an,ln,Bn.length,!!be,X,_,Me,Qe),Pn=()=>{var e;return null==(e=un.current)?void 0:e.blur()},Wn=()=>{var e;return null==(e=un.current)?void 0:e.focus()},qn=e=>{var n;return null==(n=dn.current)?void 0:n.scrollToItem(e)},jn=Q(An),Kn=u((e=>{if(Q(Bn)){var r=p?-1:Bn.findIndex((e=>e.isSelected)),t=r>-1?r:e===M?0:Bn.length-1;qn(t),hn(!0),wn(null),yn(n({index:t},Bn[t]))}else hn(!0)}),[p,Bn]),Un=u((e=>{Vn((n=>n.filter((n=>n.value!==e))))}),[]),Yn=u((n=>{if(!n.isDisabled){if(n.isSelected)p&&Un(n.value);else{var r=e(n,Be);Vn((e=>p?[...e,r]:[r]))}(G(Ce)?Ce:G(w)?w:w=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})())?Pn():Je&&(mn(""),hn(!1))}}),[p,Je,Ce,Un]);c(i,(()=>({menuOpen:Nn.current,blur:Pn,focus:Wn,clearValue:()=>{Vn(W),yn(q)},setValue:e=>{Vn(ee(e,In,Cn))},toggleMenu:e=>{e||void 0===e&&!Nn.current?(Wn(),Kn(M)):Pn()}})),[In,Cn,Kn]),d((()=>{b&&Wn()}),[]),d((()=>{zn.current&&Dn.current&&(Dn.current=!1,Mn(En))}),[Mn,En]),Ne((()=>{if(Ln.current){var e=p?An.map((e=>e.data)):Q(An)?An[0].data:null;kn(e)}}),[kn,p,An]),Ne((()=>{var e=Bn.length,{current:r}=Tn,t=e>0&&(a||e!==en.length||0===r),o=Nn.current&&void 0!==r&&r<e;if(0===e)yn(q);else if(1===e||t||o){var i=Math.max(0,Bn.findIndex((e=>e.isSelected)));qn(i),yn(n({index:i},Bn[i]))}Tn.current=e}),[a,en,Bn]);var Hn=()=>{var n=e(xn,Re);n.data&&Yn(n)},Xn=e=>{if(Q(Bn)){var r=xn.index;switch(e){case I:r=xn.index>0?xn.index-1:Bn.length-1;break;case S:r=(xn.index+1)%Bn.length;break;case k:var t=xn.index-nn;r=t<0?0:t;break;case z:var o=xn.index+nn;r=o>Bn.length-1?Bn.length-1:o}qn(r),bn&&wn(null),yn(n({index:r},Bn[r]))}},Gn=e=>{if(!Y){fn||Wn();var n="INPUT"!==e.target.nodeName;gn?n&&(hn(!1),mn("")):He&&Kn(M),n&&e.preventDefault()}},Jn=e=>{$(e),Wn()},Qn=u((e=>{Jn(e),Vn(W)}),[]),Zn=u((e=>{Y||He||(Jn(e),Nn.current?hn(!1):Kn(M))}),[Y,He,Kn]),$n=!!p&&jn,_n=!!te&&!Y&&jn,er=Y||!Ke||!!bn;return r.createElement(h,{theme:On},r.createElement(Fe,{id:g,"aria-controls":m,"aria-expanded":gn,onKeyDown:e=>{if(!(Y||J(y)&&(y(e.key,pn,xn),e.defaultPrevented))){switch(e.key){case"ArrowDown":gn?Xn(S):Kn(M);break;case"ArrowUp":gn?Xn(I):Kn(E);break;case"ArrowLeft":case"ArrowRight":if(!p||pn||Ee)return;(e=>{if(jn){var n=-1,r=An.length-1,t=bn?An.findIndex((e=>e.value===bn)):-1,o=(n="ArrowRight"===e?t>-1&&t<r?t+1:-1:0!==t?-1===t?r:t-1:0)>=0?An[n].value:null;xn.data&&yn(q),o!==bn&&wn(o)}})(e.key);break;case"PageUp":if(!gn)return;Xn(k);break;case"PageDown":if(!gn)return;Xn(z);break;case" ":if(pn)return;if(gn){if(!xn.data)return;Hn()}else Kn(M);break;case"Enter":if(!gn)return;Hn();break;case"Escape":gn&&(hn(!1),mn(""));break;case"Tab":if(e.shiftKey||!gn||!Ge||!xn.data)return;Hn();break;case"Delete":case"Backspace":if(pn)return;if(bn){var n=An.findIndex((e=>e.value===bn)),r=n>-1&&n<An.length-1?An[n+1].value:null;Un(bn),wn(r)}else{if(!Ze)return;if(!jn)break;if(p&&!Ee){var{value:t}=An[An.length-1];Un(t)}else te&&Vn(W)}break;default:return}e.preventDefault()}}},r.createElement(We,{ref:cn,isInvalid:D,isFocused:fn,isDisabled:Y,className:"rfs-control-container",onTouchEnd:Gn,onMouseDown:Gn},r.createElement(Pe,{flex:$n},r.createElement(he,{isMulti:p,inputValue:pn,placeholder:tn,selectedOption:An,focusedMultiValue:bn,renderMultiOptions:Ee,renderOptionLabel:Sn,removeSelectedOption:Un}),r.createElement(we,{id:m,ref:un,required:f,ariaLabel:K,inputValue:pn,readOnly:er,onBlur:e=>{null==re||re(e),vn(!1),hn(!1),mn("")},onFocus:e=>{null==de||de(e),vn(!0),ve&&Kn(M)},onChange:e=>{Dn.current=!0,null==se||se(e.currentTarget.value),mn(e.currentTarget.value),hn(!0)},ariaLabelledBy:ue,hasSelectedOptions:jn})),r.createElement(Le,{menuOpen:gn,clearIcon:L,caretIcon:N,isInvalid:D,isLoading:x,showClear:_n,isDisabled:Y,loadingNode:ie,onClearMouseDown:Qn,onCaretMouseDown:Zn})),r.createElement(le,{menuRef:sn,menuOpen:gn,isLoading:x,menuTop:Rn,height:Fn,itemSize:an,loadingMsg:rn,menuOptions:Bn,memoOptions:Ue,fixedSizeListRef:dn,lazyLoadMenu:Ye,noOptionsMsg:on,selectOption:Yn,direction:Ie,itemKeySelector:fe,overscanCount:Oe,menuPortalTarget:be,onMenuMouseDown:Jn,width:U||On.menu.width,renderOptionLabel:Sn,focusedOptionIndex:xn.index}),xe&&r.createElement(ye,{ariaLive:v,menuOpen:gn,isFocused:fn,ariaLabel:K,inputValue:pn,isSearchable:Ke,focusedOption:xn,selectedOption:An,optionCount:Bn.length})))}));qe.displayName="Select";export{qe as Select}; | ||
import e from"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";import n from"@babel/runtime/helpers/esm/extends";import t,{memo as r,useMemo as o,Fragment as i,forwardRef as a,useRef as l,useEffect as d,useState as s,useCallback as u,useImperativeHandle as c}from"react";import p,{css as m,keyframes as g,ThemeProvider as h}from"styled-components";import{createPortal as f}from"react-dom";import{areEqual as v,FixedSizeList as b}from"react-window";var x,w={tabIndex:0,type:"text",role:"combobox",spellCheck:!1,autoCorrect:"off",autoComplete:"off","aria-haspopup":!0,autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},y={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},O={ANY:"any",START:"start"},C=0,I=1,S=2,E=3,M=4,z=5,k=g(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),L=m([""," 0.2s ease-in"],g(["from{opacity:0;}to{opacity:1;}"])),N={border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},D={color:N,input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:m([""," 1.19s ease-in-out infinite"],k),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 14px",clear:{width:"14px",height:"16px",animation:L,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",padding:"2px 8px",boxShadow:"0 0 0 0.2rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:L,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",padding:"0.375rem 0.75rem",selectedBgColor:N.primary,focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:L,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:N.danger,transition:"color 0.2s ease-out"}}},T=5,A=35,V=300,B="Loading..",R="No options",F="Select option..",P=[],W={index:-1},q={optionLabel:e=>e.label,optionValue:e=>e.value,isOptionDisabled:e=>!!e.isDisabled,optionFilter:e=>"string"==typeof e.label?e.label:""+e.label},j=e=>K(e)?window.pageYOffset:e.scrollTop,K=e=>e===document.body||e===document.documentElement||e===window,U=e=>{var n=getComputedStyle(e);if("fixed"===n.position)return document.documentElement;for(var t=/(auto|scroll)/,r="absolute"===n.position,o=e;o=null==(i=o)?void 0:i.parentElement;){var i;if(n=getComputedStyle(o),(!r||"static"!==n.position)&&t.test(""+n.overflow+n.overflowX+n.overflowY))return o}return document.documentElement},H=function(e,n,t,r){void 0===t&&(t=300);var o=0,i=j(e),a=n-i,l=()=>{var n,d=a*((n=(n=o+=5)/t-1)*n*n+1)+i;((e,n)=>{K(e)?window.scrollTo(0,n):e.scrollTop=n})(e,d),o<t?requestAnimationFrame(l):null==r||r()};requestAnimationFrame(l)},Y=/[\u0300-\u036f]/g,X=e=>"boolean"==typeof e,G=e=>"function"==typeof e,J=e=>Array.isArray(e)&&!!e.length,Q=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),Z=e=>{e.preventDefault(),e.stopPropagation()},$=(e,n,t)=>{var r=e.trim();return n&&(r=r.toLowerCase()),t?r.normalize("NFD").replace(Y,""):r},_=(e,n,t)=>{var r=Array.isArray(e)?e:Q(e)?[e]:P;return J(r)?r.map((e=>({data:e,value:n(e),label:t(e)}))):r},ee=(e,t)=>{var r=n({},e);return Object.keys(t).forEach((n=>{var o=t[n];r[n]="animation"!==n&&Q(o)?e[n]?ee(e[n],o):o:null!=o?o:""})),r},ne=r((e=>{var n,r,o,{index:i,style:a,data:{menuOptions:l,selectOption:d,renderOptionLabel:s,focusedOptionIndex:u}}=e,c=l[i],p=(n=c.isDisabled,r=c.isSelected,o="rfs-option",n&&(o+=" rfs-option-disabled"),r&&(o+=" rfs-option-selected"),i===u&&(o+=" rfs-option-focused"),o);return t.createElement("div",{style:a,className:p,onClick:()=>d(c)},s(c.data))}),((e,n)=>{var{memoOptions:t}=n.data;return t&&v(e,n)}));ne.displayName="Option";var te=p.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:n}=e;return n.noOptions.color}),(e=>{var{theme:n}=e;return n.noOptions.margin}),(e=>{var{theme:n}=e;return n.noOptions.padding}),(e=>{var{theme:n}=e;return n.noOptions.fontSize}),(e=>{var{theme:n}=e;return n.noOptions.css})),re=e=>{var{width:n,height:r,itemSize:a,direction:l,isLoading:d,loadingMsg:s,menuOptions:u,memoOptions:c,selectOption:p,noOptionsMsg:m,overscanCount:g,itemKeySelector:h,fixedSizeListRef:f,renderOptionLabel:v,focusedOptionIndex:x}=e,w=o((()=>({menuOptions:u,memoOptions:c,selectOption:p,renderOptionLabel:v,focusedOptionIndex:x})),[u,c,x,p,v]);if(d)return t.createElement(te,null,s);var y=h?(e,n)=>n.menuOptions[e][h]:void 0;return t.createElement(i,null,t.createElement(b,{width:n,height:r,itemKey:y,itemSize:a,itemData:w,direction:l,ref:f,overscanCount:g,itemCount:u.length},ne),!J(u)&&m&&t.createElement(te,null,m))},oe=["id","menuRef","menuTop","menuOpen","lazyLoadMenu","onMenuMouseDown","menuPortalTarget"],ie=p.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:n,menuOpen:t,hideNoOptionsMsg:r,theme:{menu:o}}=e;return m(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,r?"none":o.boxShadow,!t&&"display: none;",n&&"top: "+n+";")}),(e=>{var{theme:n}=e;return n.menu.css}),"rfs-option",(e=>{var{theme:n}=e;return n.menu.option.padding}),(e=>{var{theme:n}=e;return n.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.focusedBgColor}),"rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.selectedColor}),(e=>{var{theme:n}=e;return n.menu.option.selectedBgColor}),"rfs-option-disabled"),ae=r=>{var{id:o,menuRef:i,menuTop:a,menuOpen:l,lazyLoadMenu:d,onMenuMouseDown:s,menuPortalTarget:u}=r,c=e(r,oe);if(d&&!l)return null;var{menuOptions:p,noOptionsMsg:m}=c,g=l&&!m&&!J(p),h=t.createElement(ie,{id:o,ref:i,menuTop:a,menuOpen:l,onMouseDown:s,className:"rfs-menu-container",hideNoOptionsMsg:g},t.createElement(re,n({},c)));return u?f(h,u):h},le=m(["color:",";"],(e=>{var{theme:n}=e;return n.multiValue.clear.focusColor})),de=p.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:n}}=e;return m(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(e=>{var{theme:n}=e;return n.multiValue.css})),se=p.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:n}=e;return n.multiValue.label.padding}),(e=>{var{theme:n}=e;return n.multiValue.label.fontSize}),(e=>{var{theme:n}=e;return n.multiValue.label.borderRadius})),ue=p.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:n}}}=e;return m(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,le)}),(e=>{var{isFocused:n}=e;return n&&le})),ce=r((e=>{var{data:n,value:r,isFocused:o,renderOptionLabel:i,removeSelectedOption:a}=e,l=i(n),d=()=>a(r);return t.createElement(de,null,t.createElement(se,null,l),t.createElement(ue,{onClick:d,onTouchEnd:d,isFocused:o,onMouseDown:Z},"✖"))}));ce.displayName="MultiValue";var pe=p.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})(["margin:0 2px;max-width:100%;overflow:hidden;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;grid-area:1 / 1 / 2 / 3;"]),me=p(pe).withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})(["color:",";"],(e=>{var{theme:n}=e;return n.color.placeholder})),ge=e=>{var{isMulti:n,inputValue:r,placeholder:o,selectedOption:a,focusedMultiValue:l,renderOptionLabel:d,renderMultiOptions:s,removeSelectedOption:u}=e,c=!J(a);if(r&&(!n||n&&(c||s)))return null;if(c)return t.createElement(me,null,o);if(!n){var p=d(a[0].data);return t.createElement(pe,null,p)}return t.createElement(i,null,s?s({renderOptionLabel:d,selected:a}):a.map((e=>{var{data:n,value:r}=e;return t.createElement(ce,{key:r,data:n,value:r,renderOptionLabel:d,isFocused:r===l,removeSelectedOption:u})})))},he=m(["border:0;margin:0;outline:0;padding:0;font:inherit;min-width:2px;grid-area:1 / 2 / auto / auto;"]),fe=p.div.withConfig({displayName:"InputWrapper",componentId:"sc-4er7q8-0"})(['margin:2px;flex:1 1 auto;display:inline-grid;box-sizing:border-box;grid-area:1 / 1 / 2 / 3;grid-template-columns:0px min-content;:after{white-space:pre;visibility:hidden;content:attr(data-value) " ";',"}"],he),ve=p.input.attrs(w).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["width:100%;background:0;color:inherit;"," :read-only{cursor:default;}"," ",""],he,(e=>{var{theme:n}=e;return n.input.css}),(e=>{var{theme:n,invalid:t}=e;return t&&n.input.cssRequired})),be=a(((e,n)=>{var{id:r,menuId:o,onBlur:i,onFocus:a,onChange:l,readOnly:d,required:s,menuOpen:u,ariaLabel:c,isInvalid:p,inputValue:m,ariaLabelledBy:g,hasSelectedOptions:h}=e,f=p||s&&!h;return t.createElement(fe,{"data-value":m},t.createElement(ve,{invalid:!0,id:r,ref:n,onBlur:i,onFocus:a,value:m,readOnly:d,"aria-owns":o,"aria-controls":o,"aria-label":c,"aria-required":f,"aria-expanded":u,"aria-labelledby":g,onChange:d?void 0:l}))}));be.displayName="AutosizeInput";var xe=p.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip-path:inset(50%);clip:rect(1px,1px,1px,1px);"]),we=e=>{var{menuOpen:n,isFocused:r,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:d,ariaLive:s="polite",ariaLabel:u="Select"}=e;if(!r)return null;var{index:c,label:p,isDisabled:m,isSelected:g}=l,h=((p?"Option "+p+" is "+(g?"selected":"focused")+(m?" disabled":"")+", "+(c+1)+" of "+i+".":"")+" "+(i+" option(s) available"+(o?" for search "+o:"")+".")+" "+(n?"Use Up and Down to choose options"+(m?"":", press Enter or Tab to select the currently focused option")+", press Escape to close the menu.":u+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.")).trimStart(),f="Selected option: "+(d.length?d.map((e=>e.label)).join(" "):"N/A");return t.createElement(xe,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},t.createElement("span",{id:"aria-selection"},f),t.createElement("span",{id:"aria-context"},h))},ye=p.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:n}=e;return n.loader.padding}),(e=>{var{theme:n}=e;return m(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),Oe=()=>t.createElement(ye,{"aria-hidden":!0,className:"rfs-loading-dots"},t.createElement("div",null),t.createElement("div",null),t.createElement("div",null)),Ce=p.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:n}=e;return m(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),Ie=()=>t.createElement(Ce,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Se=p.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Ee=p.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:n}=e;return n.icon.color}),(e=>{var{theme:n}=e;return n.icon.padding}),(e=>{var{theme:n}=e;return n.icon.hoverColor}),(e=>{var{theme:n}=e;return n.icon.css})),Me=p.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:8px 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:n}=e;return n.color.iconSeparator||n.color.border})),ze=p.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:n}=e;return n.icon.caret.transition}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n,menuOpen:t,isInvalid:r}=e;return t&&m(["transform:rotate(180deg);color:",";"],r?n.color.danger:n.color.caretActive||n.color.primary)})),ke=r((e=>{var{menuOpen:n,clearIcon:r,caretIcon:o,isInvalid:i,showClear:a,isLoading:l,isDisabled:d,loadingNode:s,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>G(e)?e({menuOpen:n,isLoading:l,isInvalid:i,isDisabled:d}):e;return t.createElement(Se,null,a&&!l&&t.createElement(Ee,{onTouchEnd:c,onMouseDown:c},p(r)||t.createElement(Ie,null)),l&&(s||t.createElement(Oe,null)),t.createElement(Me,{role:"none"}),t.createElement(Ee,{onTouchEnd:u,onMouseDown:u},p(o)||t.createElement(ze,{"aria-hidden":!0,menuOpen:n,isInvalid:i,className:"rfs-caret-icon"})))}));ke.displayName="IndicatorIcons";var Le=(e,n)=>{var t=l(!0);d((()=>{if(!t.current)return e();t.current=!1}),n)},Ne=e=>{var n=l(e);return n.current=e,n},De=e=>{var n=l(e);return d((()=>{n.current=e})),u((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])},Te=function(e,n,t,r,i,a,l,d,s,u,c,p,m){void 0===s&&(s=!1),void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1);var g=De(l||q.isOptionDisabled),h=De(d||q.optionFilter),f=X(m)?m:c,v=p?"":n;return o((()=>{var n=r.map((e=>e.value)),o=t===O.ANY,l=$(v,s,u),d=e=>{var t=i(e),r=a(e),d=g(e),c=n.includes(t),p={data:e,value:t,label:r,isDisabled:d,isSelected:c};return!(e=>{if(!l)return!0;var n=h(e),t=$(n,s,u);return o?t.includes(l):t.startsWith(l)})(p)||f&&c?void 0:p};return e.reduce(((e,n)=>{var t=d(n);return t&&e.push(t),e}),[])}),[e,v,i,a,r,t,s,u,g,h,f])},Ae=(e,n,t,r,o,i,a,d,u,c,p,m)=>{var g=r===y.TOP||r===y.AUTO&&!(e=>{if(!e)return!0;var n=U(e),{top:t,height:r}=e.getBoundingClientRect();return n.getBoundingClientRect().height-j(n)-t>=r})(e.current),h=De(u),f=De(c),v=l(!1),[b,x]=s(i),w=Ne(!g&&!d);Le((()=>{if(t){var n=e=>{h(),e&&(v.current=!0,x(e))};w.current?((e,n,t,r)=>{if(e){var{top:o,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=i)r();else{var d=U(e),s=j(d),u=d.getBoundingClientRect().height-s-o,c=u<i;if(!c&&t){var p=parseInt(getComputedStyle(e).marginBottom,10);H(d,a-l+s+p,n,r)}else r(c?u:void 0)}}else r()})(e.current,p,m,n):n()}else f(),v.current&&(v.current=!1,x(i))}),[e,t,w,i,m,p,h,f]);var O=Math.min(b,a*o),C=g?((e,n,t)=>{var r,o,i=n&&getComputedStyle(n),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0,d=null!=(r=null==t?void 0:t.getBoundingClientRect().height)?r:0,s=e>0?e:null!=(o=null==n?void 0:n.getBoundingClientRect().height)?o:0;return"calc("+-Math.abs(s+d)+"px + "+(a+l)+"px)"})(O,e.current,n.current):void 0;return{menuStyleTop:C,menuHeightCalc:O}},Ve=["isSelected","isDisabled"],Be=["index"],Re=p.div.withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:n}=e;return n.select.css})),Fe=p.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;display:",";padding:",";"],(e=>{var{flex:n}=e;return n?"flex":"grid"}),(e=>{var{theme:n}=e;return n.control.padding})),Pe=p.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:n,isFocused:t,isInvalid:r,theme:{control:o,color:i}}=e;return m(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,r?i.danger:t?o.focusedBorderColor:i.border,o.height&&"height: "+o.height+";",n&&"pointer-events:none;user-select:none;",(o.backgroundColor||n)&&"background-color: "+(n?i.disabled:o.backgroundColor)+";",t&&"box-shadow: "+o.boxShadow+" "+(r?i.dangerLight:o.boxShadowColor)+";")}),(e=>{var{theme:n}=e;return n.control.css}),(e=>{var{isFocused:n,theme:t}=e;return n&&t.control.focusedCss})),We=a(((r,i)=>{var{async:a,menuId:p,isMulti:m,inputId:g,selectId:f,required:v,ariaLive:b,autoFocus:w,isLoading:k,onKeyDown:L,clearIcon:N,caretIcon:j,isInvalid:K,ariaLabel:U,menuWidth:H,isDisabled:Y,inputDelay:$,onMenuOpen:ne,onMenuClose:te,onInputBlur:re,isClearable:oe,themeConfig:ie,loadingNode:le,initialValue:de,onInputFocus:se,onInputChange:ue,ariaLabelledBy:ce,onOptionChange:pe,onSearchChange:me,getOptionLabel:he,getOptionValue:fe,itemKeySelector:ve,openMenuOnFocus:xe,menuPortalTarget:ye,isAriaLiveEnabled:Oe,menuOverscanCount:Ce,blurInputOnSelect:Ie,menuItemDirection:Se,renderOptionLabel:Ee,renderMultiOptions:Me,menuScrollDuration:ze,filterIgnoreAccents:We,hideSelectedOptions:qe,getIsOptionDisabled:je,getFilterOptionString:Ke,isSearchable:Ue=!0,memoOptions:He=!1,lazyLoadMenu:Ye=!1,openMenuOnClick:Xe=!0,filterIgnoreCase:Ge=!0,tabSelectsOption:Je=!0,closeMenuOnSelect:Qe=!0,scrollMenuIntoView:Ze=!0,backspaceClearsValue:$e=!0,filterMatchFrom:_e=O.ANY,menuPosition:en=y.BOTTOM,options:nn=P,pageSize:tn=T,loadingMsg:rn=B,placeholder:on=F,noOptionsMsg:an=R,menuItemSize:ln=A,menuMaxHeight:dn=V}=r,sn=l(null),un=l(null),cn=l(null),pn=l(null),[mn,gn]=s(""),[hn,fn]=s(!1),[vn,bn]=s(!1),[xn,wn]=s(null),[yn,On]=s(W),Cn=o((()=>Q(ie)?ee(D,ie):D),[ie]),In=o((()=>he||q.optionLabel),[he]),Sn=o((()=>fe||q.optionValue),[fe]),En=o((()=>Ee||In),[Ee,In]),Mn=function(e,n){void 0===n&&(n=0);var[t,r]=s(e);return Le((()=>{if(!(n<=0)){var t=setTimeout((()=>{r(e)}),n);return()=>{clearTimeout(t)}}}),[e,n]),n<=0?e:t}(mn,$),zn=De(me),kn=De(pe),Ln=Ne(G(me)),Nn=Ne(G(pe)),Dn=Ne(hn),Tn=l(!1),An=l(),[Vn,Bn]=s((()=>_(de,Sn,In))),Rn=Te(nn,Mn,_e,Vn,Sn,In,je,Ke,Ge,We,m,a,qe),{menuStyleTop:Fn,menuHeightCalc:Pn}=Ae(un,pn,hn,en,ln,dn,Rn.length,!!ye,ne,te,ze,Ze),Wn=()=>{var e;return null==(e=cn.current)?void 0:e.blur()},qn=()=>{var e;return null==(e=cn.current)?void 0:e.focus()},jn=e=>{var n;return null==(n=sn.current)?void 0:n.scrollToItem(e)},Kn=J(Vn),Un=u((e=>{if(J(Rn)){var t=m?-1:Rn.findIndex((e=>e.isSelected)),r=t>-1?t:e===E?0:Rn.length-1;jn(r),fn(!0),wn(null),On(n({index:r},Rn[r]))}else fn(!0)}),[m,Rn]),Hn=u((e=>{Bn((n=>n.filter((n=>n.value!==e))))}),[]),Yn=u((n=>{if(!n.isDisabled){if(n.isSelected)m&&Hn(n.value);else{var t=e(n,Ve);Bn((e=>m?[...e,t]:[t]))}(X(Ie)?Ie:X(x)?x:x=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})())?Wn():Qe&&(gn(""),fn(!1))}}),[m,Qe,Ie,Hn]);c(i,(()=>({menuOpen:Dn.current,blur:Wn,focus:qn,clearValue:()=>{Bn(P),On(W)},setValue:e=>{Bn(_(e,Sn,In))},toggleMenu:e=>{e||void 0===e&&!Dn.current?(qn(),Un(E)):Wn()}})),[Dn,Sn,In,Un]),d((()=>{w&&qn()}),[]),d((()=>{Ln.current&&Tn.current&&(Tn.current=!1,zn(Mn))}),[zn,Ln,Mn]),Le((()=>{if(Nn.current){var e=m?Vn.map((e=>e.data)):J(Vn)?Vn[0].data:null;kn(e)}}),[kn,Nn,m,Vn]),Le((()=>{var e=Rn.length,{current:t}=An,r=e>0&&(a||e!==nn.length||0===t),o=Dn.current&&void 0!==t&&t<e;if(0===e)On(W);else if(1===e||r||o){var i=Math.max(0,Rn.findIndex((e=>e.isSelected)));jn(i),On(n({index:i},Rn[i]))}An.current=e}),[a,nn,Dn,Rn]);var Xn=()=>{var n=e(yn,Be);n.data&&Yn(n)},Gn=e=>{if(J(Rn)){var t=yn.index;switch(e){case C:t=yn.index>0?yn.index-1:Rn.length-1;break;case I:t=(yn.index+1)%Rn.length;break;case M:var r=yn.index-tn;t=r<0?0:r;break;case z:var o=yn.index+tn;t=o>Rn.length-1?Rn.length-1:o}jn(t),xn&&wn(null),On(n({index:t},Rn[t]))}},Jn=e=>{if(!Y){vn||qn();var n="INPUT"!==e.target.nodeName;hn?n&&(fn(!1),gn("")):Xe&&Un(E),n&&e.preventDefault()}},Qn=e=>{Z(e),qn()},Zn=u((e=>{Qn(e),Bn(P)}),[]),$n=u((e=>{Y||Xe||(Qn(e),Dn.current?fn(!1):Un(E))}),[Y,Xe,Un]),_n=!!m&&Kn,et=!!oe&&!Y&&Kn;return t.createElement(h,{theme:Cn},t.createElement(Re,{id:f,onKeyDown:e=>{if(!(Y||L&&(L(e,mn,yn),e.defaultPrevented))){switch(e.key){case"ArrowDown":hn?Gn(I):Un(E);break;case"ArrowUp":hn?Gn(C):Un(S);break;case"ArrowLeft":case"ArrowRight":if(!m||mn||Me)return;(e=>{if(Kn){var n=-1,t=Vn.length-1,r=xn?Vn.findIndex((e=>e.value===xn)):-1,o=(n="ArrowRight"===e?r>-1&&r<t?r+1:-1:0!==r?-1===r?t:r-1:0)>-1?Vn[n].value:null;yn.data&&On(W),o!==xn&&wn(o)}})(e.key);break;case"PageUp":if(!hn)return;Gn(M);break;case"PageDown":if(!hn)return;Gn(z);break;case" ":if(mn)return;if(hn){if(!yn.data)return;Xn()}else Un(E);break;case"Enter":if(!hn)return;Xn();break;case"Escape":hn&&(fn(!1),gn(""));break;case"Tab":if(e.shiftKey||!hn||!Je||!yn.data)return;Xn();break;case"Delete":case"Backspace":if(mn)return;if(xn){var n=Vn.findIndex((e=>e.value===xn)),t=n>-1&&n<Vn.length-1?Vn[n+1].value:null;Hn(xn),wn(t)}else{if(!$e)return;if(!Kn)break;if(m&&!Me){var{value:r}=Vn[Vn.length-1];Hn(r)}else oe&&Bn(P)}break;default:return}e.preventDefault()}},className:"rfs-select-container"},t.createElement(Pe,{ref:pn,isInvalid:K,isFocused:vn,isDisabled:Y,className:"rfs-control-container",onTouchEnd:Jn,onMouseDown:Jn},t.createElement(Fe,{flex:_n},t.createElement(ge,{isMulti:m,inputValue:mn,placeholder:on,selectedOption:Vn,focusedMultiValue:xn,renderMultiOptions:Me,renderOptionLabel:En,removeSelectedOption:Hn}),t.createElement(be,{id:g,ref:cn,menuId:p,menuOpen:hn,required:v,ariaLabel:U,isInvalid:K,inputValue:mn,onBlur:e=>{null==re||re(e),bn(!1),fn(!1),gn("")},onFocus:e=>{null==se||se(e),bn(!0),xe&&Un(E)},onChange:e=>{Tn.current=!0,null==ue||ue(e.currentTarget.value),gn(e.currentTarget.value),fn(!0)},ariaLabelledBy:ce,hasSelectedOptions:Kn,readOnly:!Ue||!!xn})),t.createElement(ke,{menuOpen:hn,clearIcon:N,caretIcon:j,isInvalid:K,isLoading:k,showClear:et,isDisabled:Y,loadingNode:le,onClearMouseDown:Zn,onCaretMouseDown:$n})),t.createElement(ae,{id:p,menuRef:un,menuOpen:hn,isLoading:k,menuTop:Fn,height:Pn,itemSize:ln,loadingMsg:rn,menuOptions:Rn,memoOptions:He,fixedSizeListRef:sn,lazyLoadMenu:Ye,noOptionsMsg:an,selectOption:Yn,direction:Se,itemKeySelector:ve,overscanCount:Ce,menuPortalTarget:ye,onMenuMouseDown:Qn,width:H||Cn.menu.width,renderOptionLabel:En,focusedOptionIndex:yn.index}),Oe&&t.createElement(we,{ariaLive:b,menuOpen:hn,isFocused:vn,ariaLabel:U,inputValue:mn,isSearchable:Ue,focusedOption:yn,selectedOption:Vn,optionCount:Rn.length})))}));We.displayName="Select";export{We as Select}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-dom"),require("react-window")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-dom","react-window"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFunctionalSelect={},e.React,e.styled,e.ReactDOM,e.ReactWindow)}(this,(function(e,t,n,r,o){"use strict";function a(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var l,s="rfs-option",d="rfs-option-focused",u="rfs-option-selected",c="rfs-option-disabled",p={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},m={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},f={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},g={ANY:"any",START:"start"},h=0,v=1,b=2,w=3,x=4,y=5,O=n.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),C=n.keyframes(["from{opacity:0;}to{opacity:1;}"]),S=n.css([""," 0.2s ease-in"],C),I={border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},E={color:I,input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:n.css([""," 1.19s ease-in-out infinite"],O),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 14px",clear:{width:"14px",height:"16px",animation:S,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",padding:"2px 8px",boxShadow:"0 0 0 0.2rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:S,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",padding:"0.375rem 0.75rem",selectedBgColor:I.primary,focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:S,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:I.danger,transition:"color 0.2s ease-out"}}},M=5,k=35,z=300,L="Loading..",N="No options",D="Select option..",R=[],T={index:-1},A={optionLabel:e=>e.label,optionValue:e=>e.value,isOptionDisabled:e=>!!e.isDisabled,optionFilter:e=>"string"==typeof e.label?e.label:""+e.label},V=e=>F(e)?window.pageYOffset:e.scrollTop,F=e=>e===document.body||e===document.documentElement||e===window,B=e=>{var t=getComputedStyle(e);if("fixed"===t.position)return document.documentElement;for(var n=/(auto|scroll)/,r="absolute"===t.position,o=e;o=null==(a=o)?void 0:a.parentElement;){var a;if(t=getComputedStyle(o),(!r||"static"!==t.position)&&n.test(""+t.overflow+t.overflowX+t.overflowY))return o}return document.documentElement},q=function(e,t,n,r){void 0===n&&(n=300);var o=0,a=V(e),i=t-a,l=()=>{var t,s=i*((t=(t=o+=5)/n-1)*t*t+1)+a;((e,t)=>{F(e)?window.scrollTo(0,t):e.scrollTop=t})(e,s),o<n?requestAnimationFrame(l):null==r||r()};requestAnimationFrame(l)},P=/[\u0300-\u036f]/g,W=e=>"boolean"==typeof e,j=e=>"function"==typeof e,K=e=>Array.isArray(e)&&!!e.length,U=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),H=e=>{e.preventDefault(),e.stopPropagation()},Y=(e,t,n)=>{var r=e.trim();return t&&(r=r.toLowerCase()),n?r.normalize("NFD").replace(P,""):r},X=(e,t,n)=>{var r=Array.isArray(e)?e:U(e)?[e]:R;return K(r)?r.map((e=>({data:e,value:t(e),label:n(e)}))):r},G=(e,t)=>{var n=i({},e);return Object.keys(t).forEach((r=>{var o=t[r];n[r]="animation"!==r&&U(o)?e[r]?G(e[r],o):o:null!=o?o:""})),n},J=(e,t)=>{var{memoOptions:n}=t.data;return n&&o.areEqual(e,t)},Q=t.memo((e=>{var n,r,o,{index:a,style:i,data:{menuOptions:l,selectOption:d,renderOptionLabel:u,focusedOptionIndex:c}}=e,p=l[a],m=(n=p.isDisabled,r=p.isSelected,o=s,n&&(o+=" rfs-option-disabled"),r&&(o+=" rfs-option-selected"),a===c&&(o+=" rfs-option-focused"),o);return t.createElement("div",{style:i,className:m,onClick:()=>d(p)},u(p.data))}),J);Q.displayName="Option";var Z=n.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:t}=e;return t.noOptions.color}),(e=>{var{theme:t}=e;return t.noOptions.margin}),(e=>{var{theme:t}=e;return t.noOptions.padding}),(e=>{var{theme:t}=e;return t.noOptions.fontSize}),(e=>{var{theme:t}=e;return t.noOptions.css})),$=e=>{var{width:n,height:r,itemSize:a,direction:i,isLoading:l,loadingMsg:s,menuOptions:d,memoOptions:u,selectOption:c,noOptionsMsg:p,overscanCount:m,itemKeySelector:f,fixedSizeListRef:g,renderOptionLabel:h,focusedOptionIndex:v}=e,b=t.useMemo((()=>({menuOptions:d,memoOptions:u,selectOption:c,renderOptionLabel:h,focusedOptionIndex:v})),[d,u,v,c,h]);if(l)return t.createElement(Z,null,s);var w=f?(e,t)=>t.menuOptions[e][f]:void 0;return t.createElement(t.Fragment,null,t.createElement(o.FixedSizeList,{width:n,height:r,itemKey:w,itemSize:a,itemData:b,direction:i,ref:g,overscanCount:m,itemCount:d.length},Q),!K(d)&&p&&t.createElement(Z,null,p))},_=["menuRef","menuTop","menuOpen","lazyLoadMenu","onMenuMouseDown","menuPortalTarget"],ee=n.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:t,menuOpen:r,hideNoOptionsMsg:o,theme:{menu:a}}=e;return n.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],a.width,a.margin,a.padding,a.animation,a.borderRadius,a.backgroundColor,o?"none":a.boxShadow,!r&&"display: none;",t&&"top: "+t+";")}),(e=>{var{theme:t}=e;return t.menu.css}),s,(e=>{var{theme:t}=e;return t.menu.option.padding}),(e=>{var{theme:t}=e;return t.menu.option.textAlign}),d,c,u,(e=>{var{theme:t}=e;return t.menu.option.focusedBgColor}),u,(e=>{var{theme:t}=e;return t.menu.option.selectedColor}),(e=>{var{theme:t}=e;return t.menu.option.selectedBgColor}),c),te=e=>{var{menuRef:n,menuTop:o,menuOpen:l,lazyLoadMenu:s,onMenuMouseDown:d,menuPortalTarget:u}=e,c=a(e,_);if(s&&!l)return null;var{menuOptions:p,noOptionsMsg:m}=c,f=l&&!m&&!K(p),g=t.createElement(ee,{ref:n,menuTop:o,menuOpen:l,onMouseDown:d,className:"rfs-menu-container",hideNoOptionsMsg:f},t.createElement($,i({},c)));return u?r.createPortal(g,u):g},ne=n.css(["color:",";"],(e=>{var{theme:t}=e;return t.multiValue.clear.focusColor})),re=n.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:t}}=e;return n.css(["margin:",";animation:",";border-radius:",";background-color:",";"],t.margin,t.animation,t.borderRadius,t.backgroundColor)}),(e=>{var{theme:t}=e;return t.multiValue.css})),oe=n.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:t}=e;return t.multiValue.label.padding}),(e=>{var{theme:t}=e;return t.multiValue.label.fontSize}),(e=>{var{theme:t}=e;return t.multiValue.label.borderRadius})),ae=n.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:t}}}=e;return n.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],t.color,t.padding,t.fontSize,t.alignSelf,t.transition,t.fontWeight,ne)}),(e=>{var{isFocused:t}=e;return t&&ne})),ie=t.memo((e=>{var{data:n,value:r,isFocused:o,renderOptionLabel:a,removeSelectedOption:i}=e,l=a(n),s=()=>i(r);return t.createElement(re,null,t.createElement(oe,null,l),t.createElement(ae,{onClick:s,onTouchEnd:s,isFocused:o,onMouseDown:H},"✖"))}));ie.displayName="MultiValue";var le=n.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})(["margin:0 2px;max-width:100%;overflow:hidden;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;grid-area:1 / 1 / 2 / 3;"]),se=n(le).withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})(["color:",";"],(e=>{var{theme:t}=e;return t.color.placeholder})),de=e=>{var{isMulti:n,inputValue:r,placeholder:o,selectedOption:a,focusedMultiValue:i,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:d}=e,u=!K(a);if(r&&(!n||n&&(u||s)))return null;if(u)return t.createElement(se,null,o);if(!n){var c=l(a[0].data);return t.createElement(le,null,c)}return t.createElement(t.Fragment,null,s?s({renderOptionLabel:l,selected:a}):a.map((e=>{var{data:n,value:r}=e;return t.createElement(ie,{key:r,data:n,value:r,renderOptionLabel:l,isFocused:r===i,removeSelectedOption:d})})))},ue=n.css(["border:0;margin:0;outline:0;padding:0;font:inherit;min-width:2px;grid-area:1 / 2 / auto / auto;"]),ce=n.div.withConfig({displayName:"InputWrapper",componentId:"sc-4er7q8-0"})(['margin:2px;flex:1 1 auto;display:inline-grid;box-sizing:border-box;grid-area:1 / 1 / 2 / 3;grid-template-columns:0px min-content;:after{white-space:pre;visibility:hidden;content:attr(data-value) " ";',"}"],ue),pe=n.input.attrs(m).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["width:100%;background:0;color:inherit;"," :read-only{opacity:0;cursor:default;}:required{","}",""],ue,(e=>{var{theme:t,isInvalid:n}=e;return n&&t.input.cssRequired}),(e=>{var{theme:t}=e;return t.input.css})),me=t.forwardRef(((e,n)=>{var{id:r,onBlur:o,onFocus:a,readOnly:i,required:l,onChange:s,ariaLabel:d,inputValue:u,ariaLabelledBy:c,hasSelectedOptions:p}=e,m=!!l&&!p;return t.createElement(ce,{"data-value":u},t.createElement(pe,{id:r,ref:n,isInvalid:!0,onBlur:o,onFocus:a,value:u,readOnly:i,required:m,"aria-label":d,"aria-labelledby":c,onChange:i?void 0:s}))}));me.displayName="AutosizeInput";var fe=n.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),ge=e=>{var{menuOpen:n,isFocused:r,inputValue:o,optionCount:a,isSearchable:i,focusedOption:l,selectedOption:s,ariaLive:d="polite",ariaLabel:u="Select"}=e;if(!r)return null;var c=n?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":u+" is focused"+(i?", type to filter options":"")+", press Down arrow key to open the menu.",{index:p,value:m,label:f,isDisabled:g}=l,h=((m&&!g?"Option "+f+" is focused, "+(p+1)+" of "+a+".":"")+" "+(a+" option(s) available"+(o?" for search "+o:"")+".")+" "+c).trimStart(),v="Selected option: "+(s.length?s.map((e=>e.label)).join(" "):"N/A");return t.createElement(fe,{"aria-atomic":"false","aria-live":d,"aria-relevant":"additions text"},t.createElement("span",{id:"aria-selection"},v),t.createElement("span",{id:"aria-context"},h))},he=n.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:t}=e;return t.loader.padding}),(e=>{var{theme:t}=e;return n.css(["width:",";height:",";animation:",";background-color:",";"],t.loader.size,t.loader.size,t.loader.animation,t.loader.color)})),ve=()=>t.createElement(he,{"aria-hidden":!0,className:"rfs-loading-dots"},t.createElement("div",null),t.createElement("div",null),t.createElement("div",null)),be=n.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:t}=e;return n.css(["width:",";height:",";animation:",";transition:",";"],t.icon.clear.width,t.icon.clear.height,t.icon.clear.animation,t.icon.clear.transition)})),we=()=>t.createElement(be,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),xe=n.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),ye=n.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:t}=e;return t.icon.color}),(e=>{var{theme:t}=e;return t.icon.padding}),(e=>{var{theme:t}=e;return t.icon.hoverColor}),(e=>{var{theme:t}=e;return t.icon.css})),Oe=n.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:8px 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:t}=e;return t.color.iconSeparator||t.color.border})),Ce=n.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:t}=e;return t.icon.caret.transition}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t,menuOpen:r,isInvalid:o}=e;return r&&n.css(["transform:rotate(180deg);color:",";"],o?t.color.danger:t.color.caretActive||t.color.primary)})),Se=t.memo((e=>{var{menuOpen:n,clearIcon:r,caretIcon:o,isInvalid:a,showClear:i,isLoading:l,isDisabled:s,loadingNode:d,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>j(e)?e({menuOpen:n,isLoading:l,isInvalid:a,isDisabled:s}):e;return t.createElement(xe,null,i&&!l&&t.createElement(ye,{onTouchEnd:c,onMouseDown:c},p(r)||t.createElement(we,null)),l&&(d||t.createElement(ve,null)),t.createElement(Oe,{role:"none"}),t.createElement(ye,{onTouchEnd:u,onMouseDown:u},p(o)||t.createElement(Ce,{"aria-hidden":!0,menuOpen:n,isInvalid:a,className:"rfs-caret-icon"})))}));Se.displayName="IndicatorIcons";var Ie=(e,n)=>{var r=t.useRef(!0);t.useEffect((()=>{if(!r.current)return e();r.current=!1}),n)},Ee=e=>{var n=t.useRef(e);return n.current=e,n},Me=e=>{var n=t.useRef(e);return t.useEffect((()=>{n.current=e})),t.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])},ke=function(e,n,r,o,a,i,l,s,d,u,c,p,m){void 0===d&&(d=!1),void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1);var f=Me(l||A.isOptionDisabled),h=Me(s||A.optionFilter),v=W(m)?m:c,b=p?"":n;return t.useMemo((()=>{var t=o.map((e=>e.value)),n=r===g.ANY,l=Y(b,d,u),s=e=>{var r=a(e),o=i(e),s=f(e),c=t.includes(r),p={data:e,value:r,label:o,isDisabled:s,isSelected:c};return!(e=>{if(!l)return!0;var t=h(e),r=Y(t,d,u);return n?r.includes(l):r.startsWith(l)})(p)||v&&c?void 0:p};return e.reduce(((e,t)=>{var n=s(t);return n&&e.push(n),e}),[])}),[e,b,a,i,o,r,d,u,f,h,v])},ze=(e,n,r,o,a,i,l,s,d,u,c,p)=>{var m=o===f.TOP||o===f.AUTO&&!(e=>{if(!e)return!0;var t=B(e),{top:n,height:r}=e.getBoundingClientRect();return t.getBoundingClientRect().height-V(t)-n>=r})(e.current),g=Me(d),h=Me(u),v=t.useRef(!1),[b,w]=t.useState(i),x=Ee(!m&&!s);Ie((()=>{if(r){var t=e=>{g(),e&&(v.current=!0,w(e))};x.current?((e,t,n,r)=>{if(e){var{top:o,height:a,bottom:i}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=a)r();else{var s=B(e),d=V(s),u=s.getBoundingClientRect().height-d-o,c=u<a;if(!c&&n){var p=parseInt(getComputedStyle(e).marginBottom,10);q(s,i-l+d+p,t,r)}else r(c?u:void 0)}}else r()})(e.current,c,p,t):t()}else h(),v.current&&(v.current=!1,w(i))}),[e,r,i,p,c,g,h]);var y=Math.min(b,l*a),O=m?((e,t,n)=>{var r,o,a=t&&getComputedStyle(t),i=a?parseInt(a.marginBottom,10):0,l=a?parseInt(a.marginTop,10):0,s=null!=(r=null==n?void 0:n.getBoundingClientRect().height)?r:0,d=e>0?e:null!=(o=null==t?void 0:t.getBoundingClientRect().height)?o:0;return"calc("+-Math.abs(d+s)+"px + "+(i+l)+"px)"})(y,e.current,n.current):void 0;return[O,y]},Le=["isSelected","isDisabled"],Ne=["index"],De=n.div.attrs(p).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:t}=e;return t.select.css})),Re=n.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;display:",";padding:",";"],(e=>{var{flex:t}=e;return t?"flex":"grid"}),(e=>{var{theme:t}=e;return t.control.padding})),Te=n.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:t,isFocused:r,isInvalid:o,theme:{control:a,color:i}}=e;return n.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,o?i.danger:r?a.focusedBorderColor:i.border,a.height&&"height: "+a.height+";",t&&"pointer-events:none;user-select:none;",(a.backgroundColor||t)&&"background-color: "+(t?i.disabled:a.backgroundColor)+";",r&&"box-shadow: "+a.boxShadow+" "+(o?i.dangerLight:a.boxShadowColor)+";")}),(e=>{var{theme:t}=e;return t.control.css}),(e=>{var{isFocused:t,theme:n}=e;return t&&n.control.focusedCss})),Ae=t.forwardRef(((e,r)=>{var o,{async:s,isMulti:d,inputId:u,selectId:c,required:p,ariaLive:m,autoFocus:O,isLoading:C,onKeyDown:S,clearIcon:I,caretIcon:V,isInvalid:F,ariaLabel:B,menuWidth:q,isDisabled:P,inputDelay:Y,onMenuOpen:J,onMenuClose:Q,onInputBlur:Z,isClearable:$,themeConfig:_,loadingNode:ee,initialValue:ne,onInputFocus:re,onInputChange:oe,ariaLabelledBy:ae,onOptionChange:ie,onSearchChange:le,getOptionLabel:se,getOptionValue:ue,itemKeySelector:ce,openMenuOnFocus:pe,menuPortalTarget:fe,isAriaLiveEnabled:he,menuOverscanCount:ve,blurInputOnSelect:be,menuItemDirection:we,renderOptionLabel:xe,renderMultiOptions:ye,menuScrollDuration:Oe,filterIgnoreAccents:Ce,hideSelectedOptions:Ae,getIsOptionDisabled:Ve,getFilterOptionString:Fe,isSearchable:Be=!0,memoOptions:qe=!1,lazyLoadMenu:Pe=!1,openMenuOnClick:We=!0,filterIgnoreCase:je=!0,tabSelectsOption:Ke=!0,closeMenuOnSelect:Ue=!0,scrollMenuIntoView:He=!0,backspaceClearsValue:Ye=!0,filterMatchFrom:Xe=g.ANY,menuPosition:Ge=f.BOTTOM,options:Je=R,pageSize:Qe=M,loadingMsg:Ze=L,placeholder:$e=D,noOptionsMsg:_e=N,menuItemSize:et=k,menuMaxHeight:tt=z}=e,nt=t.useRef(null),rt=t.useRef(null),ot=t.useRef(null),at=t.useRef(null),[it,lt]=t.useState(""),[st,dt]=t.useState(!1),[ut,ct]=t.useState(!1),[pt,mt]=t.useState(null),[ft,gt]=t.useState(T),ht=t.useMemo((()=>U(_)?G(E,_):E),[_]),vt=t.useMemo((()=>se||A.optionLabel),[se]),bt=t.useMemo((()=>ue||A.optionValue),[ue]),wt=t.useMemo((()=>xe||vt),[xe,vt]),xt=function(e,n){void 0===n&&(n=0);var[r,o]=t.useState(e);return Ie((()=>{if(!(n<=0)){var t=setTimeout((()=>{o(e)}),n);return()=>{clearTimeout(t)}}}),[e,n]),n<=0?e:r}(it,Y),yt=Me(le),Ot=Me(ie),Ct=Ee(j(le)),St=Ee(j(ie)),It=Ee(st),Et=t.useRef(!1),Mt=t.useRef(),[kt,zt]=t.useState((()=>X(ne,bt,vt))),Lt=ke(Je,xt,Xe,kt,bt,vt,Ve,Fe,je,Ce,d,s,Ae),[Nt,Dt]=ze(rt,at,st,Ge,et,tt,Lt.length,!!fe,J,Q,Oe,He),Rt=()=>{var e;return null==(e=ot.current)?void 0:e.blur()},Tt=()=>{var e;return null==(e=ot.current)?void 0:e.focus()},At=e=>{var t;return null==(t=nt.current)?void 0:t.scrollToItem(e)},Vt=K(kt),Ft=t.useCallback((e=>{if(K(Lt)){var t=d?-1:Lt.findIndex((e=>e.isSelected)),n=t>-1?t:e===w?0:Lt.length-1;At(n),dt(!0),mt(null),gt(i({index:n},Lt[n]))}else dt(!0)}),[d,Lt]),Bt=t.useCallback((e=>{zt((t=>t.filter((t=>t.value!==e))))}),[]),qt=t.useCallback((e=>{if(!e.isDisabled){if(e.isSelected)d&&Bt(e.value);else{var t=a(e,Le);zt((e=>d?[...e,t]:[t]))}(W(be)?be:W(l)?l:l=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})())?Rt():Ue&&(lt(""),dt(!1))}}),[d,Ue,be,Bt]);t.useImperativeHandle(r,(()=>({menuOpen:It.current,blur:Rt,focus:Tt,clearValue:()=>{zt(R),gt(T)},setValue:e=>{zt(X(e,bt,vt))},toggleMenu:e=>{e||void 0===e&&!It.current?(Tt(),Ft(w)):Rt()}})),[bt,vt,Ft]),o=()=>{O&&Tt()},t.useEffect(o,[]),t.useEffect((()=>{Ct.current&&Et.current&&(Et.current=!1,yt(xt))}),[yt,xt]),Ie((()=>{if(St.current){var e=d?kt.map((e=>e.data)):K(kt)?kt[0].data:null;Ot(e)}}),[Ot,d,kt]),Ie((()=>{var e=Lt.length,{current:t}=Mt,n=e>0&&(s||e!==Je.length||0===t),r=It.current&&void 0!==t&&t<e;if(0===e)gt(T);else if(1===e||n||r){var o=Math.max(0,Lt.findIndex((e=>e.isSelected)));At(o),gt(i({index:o},Lt[o]))}Mt.current=e}),[s,Je,Lt]);var Pt=()=>{var e=a(ft,Ne);e.data&&qt(e)},Wt=e=>{if(K(Lt)){var t=ft.index;switch(e){case h:t=ft.index>0?ft.index-1:Lt.length-1;break;case v:t=(ft.index+1)%Lt.length;break;case x:var n=ft.index-Qe;t=n<0?0:n;break;case y:var r=ft.index+Qe;t=r>Lt.length-1?Lt.length-1:r}At(t),pt&&mt(null),gt(i({index:t},Lt[t]))}},jt=e=>{if(!P){ut||Tt();var t="INPUT"!==e.target.nodeName;st?t&&(dt(!1),lt("")):We&&Ft(w),t&&e.preventDefault()}},Kt=e=>{H(e),Tt()},Ut=t.useCallback((e=>{Kt(e),zt(R)}),[]),Ht=t.useCallback((e=>{P||We||(Kt(e),It.current?dt(!1):Ft(w))}),[P,We,Ft]),Yt=!!d&&Vt,Xt=!!$&&!P&&Vt,Gt=P||!Be||!!pt;return t.createElement(n.ThemeProvider,{theme:ht},t.createElement(De,{id:c,"aria-controls":u,"aria-expanded":st,onKeyDown:e=>{if(!(P||j(S)&&(S(e.key,it,ft),e.defaultPrevented))){switch(e.key){case"ArrowDown":st?Wt(v):Ft(w);break;case"ArrowUp":st?Wt(h):Ft(b);break;case"ArrowLeft":case"ArrowRight":if(!d||it||ye)return;(e=>{if(Vt){var t=-1,n=kt.length-1,r=pt?kt.findIndex((e=>e.value===pt)):-1,o=(t="ArrowRight"===e?r>-1&&r<n?r+1:-1:0!==r?-1===r?n:r-1:0)>=0?kt[t].value:null;ft.data&>(T),o!==pt&&mt(o)}})(e.key);break;case"PageUp":if(!st)return;Wt(x);break;case"PageDown":if(!st)return;Wt(y);break;case" ":if(it)return;if(st){if(!ft.data)return;Pt()}else Ft(w);break;case"Enter":if(!st)return;Pt();break;case"Escape":st&&(dt(!1),lt(""));break;case"Tab":if(e.shiftKey||!st||!Ke||!ft.data)return;Pt();break;case"Delete":case"Backspace":if(it)return;if(pt){var t=kt.findIndex((e=>e.value===pt)),n=t>-1&&t<kt.length-1?kt[t+1].value:null;Bt(pt),mt(n)}else{if(!Ye)return;if(!Vt)break;if(d&&!ye){var{value:r}=kt[kt.length-1];Bt(r)}else $&&zt(R)}break;default:return}e.preventDefault()}}},t.createElement(Te,{ref:at,isInvalid:F,isFocused:ut,isDisabled:P,className:"rfs-control-container",onTouchEnd:jt,onMouseDown:jt},t.createElement(Re,{flex:Yt},t.createElement(de,{isMulti:d,inputValue:it,placeholder:$e,selectedOption:kt,focusedMultiValue:pt,renderMultiOptions:ye,renderOptionLabel:wt,removeSelectedOption:Bt}),t.createElement(me,{id:u,ref:ot,required:p,ariaLabel:B,inputValue:it,readOnly:Gt,onBlur:e=>{null==Z||Z(e),ct(!1),dt(!1),lt("")},onFocus:e=>{null==re||re(e),ct(!0),pe&&Ft(w)},onChange:e=>{Et.current=!0,null==oe||oe(e.currentTarget.value),lt(e.currentTarget.value),dt(!0)},ariaLabelledBy:ae,hasSelectedOptions:Vt})),t.createElement(Se,{menuOpen:st,clearIcon:I,caretIcon:V,isInvalid:F,isLoading:C,showClear:Xt,isDisabled:P,loadingNode:ee,onClearMouseDown:Ut,onCaretMouseDown:Ht})),t.createElement(te,{menuRef:rt,menuOpen:st,isLoading:C,menuTop:Nt,height:Dt,itemSize:et,loadingMsg:Ze,menuOptions:Lt,memoOptions:qe,fixedSizeListRef:nt,lazyLoadMenu:Pe,noOptionsMsg:_e,selectOption:qt,direction:we,itemKeySelector:ce,overscanCount:ve,menuPortalTarget:fe,onMenuMouseDown:Kt,width:q||ht.menu.width,renderOptionLabel:wt,focusedOptionIndex:ft.index}),he&&t.createElement(ge,{ariaLive:m,menuOpen:st,isFocused:ut,ariaLabel:B,inputValue:it,isSearchable:Be,focusedOption:ft,selectedOption:kt,optionCount:Lt.length})))}));Ae.displayName="Select",e.Select=Ae})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("styled-components"),require("react-dom"),require("react-window")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-dom","react-window"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFunctionalSelect={},e.React,e.styled,e.ReactDOM,e.ReactWindow)}(this,(function(e,n,t,r,o){"use strict";function a(e,n){if(null==e)return{};var t,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},i.apply(this,arguments)}var l,s="rfs-option",d="rfs-option-focused",u="rfs-option-selected",c="rfs-option-disabled",p={tabIndex:0,type:"text",role:"combobox",spellCheck:!1,autoCorrect:"off",autoComplete:"off","aria-haspopup":!0,autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},m={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},f={ANY:"any",START:"start"},g=0,h=1,v=2,b=3,w=4,x=5,y=t.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),O=t.keyframes(["from{opacity:0;}to{opacity:1;}"]),C=t.css([""," 0.2s ease-in"],O),S={border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},I={color:S,input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:t.css([""," 1.19s ease-in-out infinite"],y),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 14px",clear:{width:"14px",height:"16px",animation:C,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",padding:"2px 8px",boxShadow:"0 0 0 0.2rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:C,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",padding:"0.375rem 0.75rem",selectedBgColor:S.primary,focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:C,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:S.danger,transition:"color 0.2s ease-out"}}},E=5,M=35,k=300,z="Loading..",L="No options",N="Select option..",D=[],T={index:-1},R={optionLabel:e=>e.label,optionValue:e=>e.value,isOptionDisabled:e=>!!e.isDisabled,optionFilter:e=>"string"==typeof e.label?e.label:""+e.label},A=e=>V(e)?window.pageYOffset:e.scrollTop,V=e=>e===document.body||e===document.documentElement||e===window,F=e=>{var n=getComputedStyle(e);if("fixed"===n.position)return document.documentElement;for(var t=/(auto|scroll)/,r="absolute"===n.position,o=e;o=null==(a=o)?void 0:a.parentElement;){var a;if(n=getComputedStyle(o),(!r||"static"!==n.position)&&t.test(""+n.overflow+n.overflowX+n.overflowY))return o}return document.documentElement},B=function(e,n,t,r){void 0===t&&(t=300);var o=0,a=A(e),i=n-a,l=()=>{var n,s=i*((n=(n=o+=5)/t-1)*n*n+1)+a;((e,n)=>{V(e)?window.scrollTo(0,n):e.scrollTop=n})(e,s),o<t?requestAnimationFrame(l):null==r||r()};requestAnimationFrame(l)},q=/[\u0300-\u036f]/g,P=e=>"boolean"==typeof e,W=e=>"function"==typeof e,j=e=>Array.isArray(e)&&!!e.length,H=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),K=e=>{e.preventDefault(),e.stopPropagation()},U=(e,n,t)=>{var r=e.trim();return n&&(r=r.toLowerCase()),t?r.normalize("NFD").replace(q,""):r},Y=(e,n,t)=>{var r=Array.isArray(e)?e:H(e)?[e]:D;return j(r)?r.map((e=>({data:e,value:n(e),label:t(e)}))):r},X=(e,n)=>{var t=i({},e);return Object.keys(n).forEach((r=>{var o=n[r];t[r]="animation"!==r&&H(o)?e[r]?X(e[r],o):o:null!=o?o:""})),t},G=(e,n)=>{var{memoOptions:t}=n.data;return t&&o.areEqual(e,n)},J=n.memo((e=>{var t,r,o,{index:a,style:i,data:{menuOptions:l,selectOption:d,renderOptionLabel:u,focusedOptionIndex:c}}=e,p=l[a],m=(t=p.isDisabled,r=p.isSelected,o=s,t&&(o+=" rfs-option-disabled"),r&&(o+=" rfs-option-selected"),a===c&&(o+=" rfs-option-focused"),o);return n.createElement("div",{style:i,className:m,onClick:()=>d(p)},u(p.data))}),G);J.displayName="Option";var Q=t.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:n}=e;return n.noOptions.color}),(e=>{var{theme:n}=e;return n.noOptions.margin}),(e=>{var{theme:n}=e;return n.noOptions.padding}),(e=>{var{theme:n}=e;return n.noOptions.fontSize}),(e=>{var{theme:n}=e;return n.noOptions.css})),Z=e=>{var{width:t,height:r,itemSize:a,direction:i,isLoading:l,loadingMsg:s,menuOptions:d,memoOptions:u,selectOption:c,noOptionsMsg:p,overscanCount:m,itemKeySelector:f,fixedSizeListRef:g,renderOptionLabel:h,focusedOptionIndex:v}=e,b=n.useMemo((()=>({menuOptions:d,memoOptions:u,selectOption:c,renderOptionLabel:h,focusedOptionIndex:v})),[d,u,v,c,h]);if(l)return n.createElement(Q,null,s);var w=f?(e,n)=>n.menuOptions[e][f]:void 0;return n.createElement(n.Fragment,null,n.createElement(o.FixedSizeList,{width:t,height:r,itemKey:w,itemSize:a,itemData:b,direction:i,ref:g,overscanCount:m,itemCount:d.length},J),!j(d)&&p&&n.createElement(Q,null,p))},$=["id","menuRef","menuTop","menuOpen","lazyLoadMenu","onMenuMouseDown","menuPortalTarget"],_=t.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:n,menuOpen:r,hideNoOptionsMsg:o,theme:{menu:a}}=e;return t.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],a.width,a.margin,a.padding,a.animation,a.borderRadius,a.backgroundColor,o?"none":a.boxShadow,!r&&"display: none;",n&&"top: "+n+";")}),(e=>{var{theme:n}=e;return n.menu.css}),s,(e=>{var{theme:n}=e;return n.menu.option.padding}),(e=>{var{theme:n}=e;return n.menu.option.textAlign}),d,c,u,(e=>{var{theme:n}=e;return n.menu.option.focusedBgColor}),u,(e=>{var{theme:n}=e;return n.menu.option.selectedColor}),(e=>{var{theme:n}=e;return n.menu.option.selectedBgColor}),c),ee=e=>{var{id:t,menuRef:o,menuTop:l,menuOpen:s,lazyLoadMenu:d,onMenuMouseDown:u,menuPortalTarget:c}=e,p=a(e,$);if(d&&!s)return null;var{menuOptions:m,noOptionsMsg:f}=p,g=s&&!f&&!j(m),h=n.createElement(_,{id:t,ref:o,menuTop:l,menuOpen:s,onMouseDown:u,className:"rfs-menu-container",hideNoOptionsMsg:g},n.createElement(Z,i({},p)));return c?r.createPortal(h,c):h},ne=t.css(["color:",";"],(e=>{var{theme:n}=e;return n.multiValue.clear.focusColor})),te=t.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:n}}=e;return t.css(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(e=>{var{theme:n}=e;return n.multiValue.css})),re=t.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:n}=e;return n.multiValue.label.padding}),(e=>{var{theme:n}=e;return n.multiValue.label.fontSize}),(e=>{var{theme:n}=e;return n.multiValue.label.borderRadius})),oe=t.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:n}}}=e;return t.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,ne)}),(e=>{var{isFocused:n}=e;return n&&ne})),ae=n.memo((e=>{var{data:t,value:r,isFocused:o,renderOptionLabel:a,removeSelectedOption:i}=e,l=a(t),s=()=>i(r);return n.createElement(te,null,n.createElement(re,null,l),n.createElement(oe,{onClick:s,onTouchEnd:s,isFocused:o,onMouseDown:K},"✖"))}));ae.displayName="MultiValue";var ie=t.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})(["margin:0 2px;max-width:100%;overflow:hidden;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;grid-area:1 / 1 / 2 / 3;"]),le=t(ie).withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})(["color:",";"],(e=>{var{theme:n}=e;return n.color.placeholder})),se=e=>{var{isMulti:t,inputValue:r,placeholder:o,selectedOption:a,focusedMultiValue:i,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:d}=e,u=!j(a);if(r&&(!t||t&&(u||s)))return null;if(u)return n.createElement(le,null,o);if(!t){var c=l(a[0].data);return n.createElement(ie,null,c)}return n.createElement(n.Fragment,null,s?s({renderOptionLabel:l,selected:a}):a.map((e=>{var{data:t,value:r}=e;return n.createElement(ae,{key:r,data:t,value:r,renderOptionLabel:l,isFocused:r===i,removeSelectedOption:d})})))},de=t.css(["border:0;margin:0;outline:0;padding:0;font:inherit;min-width:2px;grid-area:1 / 2 / auto / auto;"]),ue=t.div.withConfig({displayName:"InputWrapper",componentId:"sc-4er7q8-0"})(['margin:2px;flex:1 1 auto;display:inline-grid;box-sizing:border-box;grid-area:1 / 1 / 2 / 3;grid-template-columns:0px min-content;:after{white-space:pre;visibility:hidden;content:attr(data-value) " ";',"}"],de),ce=t.input.attrs(p).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["width:100%;background:0;color:inherit;"," :read-only{cursor:default;}"," ",""],de,(e=>{var{theme:n}=e;return n.input.css}),(e=>{var{theme:n,invalid:t}=e;return t&&n.input.cssRequired})),pe=n.forwardRef(((e,t)=>{var{id:r,menuId:o,onBlur:a,onFocus:i,onChange:l,readOnly:s,required:d,menuOpen:u,ariaLabel:c,isInvalid:p,inputValue:m,ariaLabelledBy:f,hasSelectedOptions:g}=e,h=p||d&&!g;return n.createElement(ue,{"data-value":m},n.createElement(ce,{invalid:!0,id:r,ref:t,onBlur:a,onFocus:i,value:m,readOnly:s,"aria-owns":o,"aria-controls":o,"aria-label":c,"aria-required":h,"aria-expanded":u,"aria-labelledby":f,onChange:s?void 0:l}))}));pe.displayName="AutosizeInput";var me=t.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip-path:inset(50%);clip:rect(1px,1px,1px,1px);"]),fe=e=>{var{menuOpen:t,isFocused:r,inputValue:o,optionCount:a,isSearchable:i,focusedOption:l,selectedOption:s,ariaLive:d="polite",ariaLabel:u="Select"}=e;if(!r)return null;var{index:c,label:p,isDisabled:m,isSelected:f}=l,g=((p?"Option "+p+" is "+(f?"selected":"focused")+(m?" disabled":"")+", "+(c+1)+" of "+a+".":"")+" "+(a+" option(s) available"+(o?" for search "+o:"")+".")+" "+(t?"Use Up and Down to choose options"+(m?"":", press Enter or Tab to select the currently focused option")+", press Escape to close the menu.":u+" is focused"+(i?", type to filter options":"")+", press Down arrow key to open the menu.")).trimStart(),h="Selected option: "+(s.length?s.map((e=>e.label)).join(" "):"N/A");return n.createElement(me,{"aria-atomic":"false","aria-live":d,"aria-relevant":"additions text"},n.createElement("span",{id:"aria-selection"},h),n.createElement("span",{id:"aria-context"},g))},ge=t.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:n}=e;return n.loader.padding}),(e=>{var{theme:n}=e;return t.css(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),he=()=>n.createElement(ge,{"aria-hidden":!0,className:"rfs-loading-dots"},n.createElement("div",null),n.createElement("div",null),n.createElement("div",null)),ve=t.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:n}=e;return t.css(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),be=()=>n.createElement(ve,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),we=t.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),xe=t.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:n}=e;return n.icon.color}),(e=>{var{theme:n}=e;return n.icon.padding}),(e=>{var{theme:n}=e;return n.icon.hoverColor}),(e=>{var{theme:n}=e;return n.icon.css})),ye=t.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:8px 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:n}=e;return n.color.iconSeparator||n.color.border})),Oe=t.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:n}=e;return n.icon.caret.transition}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n,menuOpen:r,isInvalid:o}=e;return r&&t.css(["transform:rotate(180deg);color:",";"],o?n.color.danger:n.color.caretActive||n.color.primary)})),Ce=n.memo((e=>{var{menuOpen:t,clearIcon:r,caretIcon:o,isInvalid:a,showClear:i,isLoading:l,isDisabled:s,loadingNode:d,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>W(e)?e({menuOpen:t,isLoading:l,isInvalid:a,isDisabled:s}):e;return n.createElement(we,null,i&&!l&&n.createElement(xe,{onTouchEnd:c,onMouseDown:c},p(r)||n.createElement(be,null)),l&&(d||n.createElement(he,null)),n.createElement(ye,{role:"none"}),n.createElement(xe,{onTouchEnd:u,onMouseDown:u},p(o)||n.createElement(Oe,{"aria-hidden":!0,menuOpen:t,isInvalid:a,className:"rfs-caret-icon"})))}));Ce.displayName="IndicatorIcons";var Se=(e,t)=>{var r=n.useRef(!0);n.useEffect((()=>{if(!r.current)return e();r.current=!1}),t)},Ie=e=>{var t=n.useRef(e);return t.current=e,t},Ee=e=>{var t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])},Me=function(e,t,r,o,a,i,l,s,d,u,c,p,m){void 0===d&&(d=!1),void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1);var g=Ee(l||R.isOptionDisabled),h=Ee(s||R.optionFilter),v=P(m)?m:c,b=p?"":t;return n.useMemo((()=>{var n=o.map((e=>e.value)),t=r===f.ANY,l=U(b,d,u),s=e=>{var r=a(e),o=i(e),s=g(e),c=n.includes(r),p={data:e,value:r,label:o,isDisabled:s,isSelected:c};return!(e=>{if(!l)return!0;var n=h(e),r=U(n,d,u);return t?r.includes(l):r.startsWith(l)})(p)||v&&c?void 0:p};return e.reduce(((e,n)=>{var t=s(n);return t&&e.push(t),e}),[])}),[e,b,a,i,o,r,d,u,g,h,v])},ke=(e,t,r,o,a,i,l,s,d,u,c,p)=>{var f=o===m.TOP||o===m.AUTO&&!(e=>{if(!e)return!0;var n=F(e),{top:t,height:r}=e.getBoundingClientRect();return n.getBoundingClientRect().height-A(n)-t>=r})(e.current),g=Ee(d),h=Ee(u),v=n.useRef(!1),[b,w]=n.useState(i),x=Ie(!f&&!s);Se((()=>{if(r){var n=e=>{g(),e&&(v.current=!0,w(e))};x.current?((e,n,t,r)=>{if(e){var{top:o,height:a,bottom:i}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=a)r();else{var s=F(e),d=A(s),u=s.getBoundingClientRect().height-d-o,c=u<a;if(!c&&t){var p=parseInt(getComputedStyle(e).marginBottom,10);B(s,i-l+d+p,n,r)}else r(c?u:void 0)}}else r()})(e.current,c,p,n):n()}else h(),v.current&&(v.current=!1,w(i))}),[e,r,x,i,p,c,g,h]);var y=Math.min(b,l*a),O=f?((e,n,t)=>{var r,o,a=n&&getComputedStyle(n),i=a?parseInt(a.marginBottom,10):0,l=a?parseInt(a.marginTop,10):0,s=null!=(r=null==t?void 0:t.getBoundingClientRect().height)?r:0,d=e>0?e:null!=(o=null==n?void 0:n.getBoundingClientRect().height)?o:0;return"calc("+-Math.abs(d+s)+"px + "+(i+l)+"px)"})(y,e.current,t.current):void 0;return{menuStyleTop:O,menuHeightCalc:y}},ze=["isSelected","isDisabled"],Le=["index"],Ne=t.div.withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:n}=e;return n.select.css})),De=t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;display:",";padding:",";"],(e=>{var{flex:n}=e;return n?"flex":"grid"}),(e=>{var{theme:n}=e;return n.control.padding})),Te=t.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:n,isFocused:r,isInvalid:o,theme:{control:a,color:i}}=e;return t.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,o?i.danger:r?a.focusedBorderColor:i.border,a.height&&"height: "+a.height+";",n&&"pointer-events:none;user-select:none;",(a.backgroundColor||n)&&"background-color: "+(n?i.disabled:a.backgroundColor)+";",r&&"box-shadow: "+a.boxShadow+" "+(o?i.dangerLight:a.boxShadowColor)+";")}),(e=>{var{theme:n}=e;return n.control.css}),(e=>{var{isFocused:n,theme:t}=e;return n&&t.control.focusedCss})),Re=n.forwardRef(((e,r)=>{var o,{async:s,menuId:d,isMulti:u,inputId:c,selectId:p,required:y,ariaLive:O,autoFocus:C,isLoading:S,onKeyDown:A,clearIcon:V,caretIcon:F,isInvalid:B,ariaLabel:q,menuWidth:U,isDisabled:G,inputDelay:J,onMenuOpen:Q,onMenuClose:Z,onInputBlur:$,isClearable:_,themeConfig:ne,loadingNode:te,initialValue:re,onInputFocus:oe,onInputChange:ae,ariaLabelledBy:ie,onOptionChange:le,onSearchChange:de,getOptionLabel:ue,getOptionValue:ce,itemKeySelector:me,openMenuOnFocus:ge,menuPortalTarget:he,isAriaLiveEnabled:ve,menuOverscanCount:be,blurInputOnSelect:we,menuItemDirection:xe,renderOptionLabel:ye,renderMultiOptions:Oe,menuScrollDuration:Re,filterIgnoreAccents:Ae,hideSelectedOptions:Ve,getIsOptionDisabled:Fe,getFilterOptionString:Be,isSearchable:qe=!0,memoOptions:Pe=!1,lazyLoadMenu:We=!1,openMenuOnClick:je=!0,filterIgnoreCase:He=!0,tabSelectsOption:Ke=!0,closeMenuOnSelect:Ue=!0,scrollMenuIntoView:Ye=!0,backspaceClearsValue:Xe=!0,filterMatchFrom:Ge=f.ANY,menuPosition:Je=m.BOTTOM,options:Qe=D,pageSize:Ze=E,loadingMsg:$e=z,placeholder:_e=N,noOptionsMsg:en=L,menuItemSize:nn=M,menuMaxHeight:tn=k}=e,rn=n.useRef(null),on=n.useRef(null),an=n.useRef(null),ln=n.useRef(null),[sn,dn]=n.useState(""),[un,cn]=n.useState(!1),[pn,mn]=n.useState(!1),[fn,gn]=n.useState(null),[hn,vn]=n.useState(T),bn=n.useMemo((()=>H(ne)?X(I,ne):I),[ne]),wn=n.useMemo((()=>ue||R.optionLabel),[ue]),xn=n.useMemo((()=>ce||R.optionValue),[ce]),yn=n.useMemo((()=>ye||wn),[ye,wn]),On=function(e,t){void 0===t&&(t=0);var[r,o]=n.useState(e);return Se((()=>{if(!(t<=0)){var n=setTimeout((()=>{o(e)}),t);return()=>{clearTimeout(n)}}}),[e,t]),t<=0?e:r}(sn,J),Cn=Ee(de),Sn=Ee(le),In=Ie(W(de)),En=Ie(W(le)),Mn=Ie(un),kn=n.useRef(!1),zn=n.useRef(),[Ln,Nn]=n.useState((()=>Y(re,xn,wn))),Dn=Me(Qe,On,Ge,Ln,xn,wn,Fe,Be,He,Ae,u,s,Ve),{menuStyleTop:Tn,menuHeightCalc:Rn}=ke(on,ln,un,Je,nn,tn,Dn.length,!!he,Q,Z,Re,Ye),An=()=>{var e;return null==(e=an.current)?void 0:e.blur()},Vn=()=>{var e;return null==(e=an.current)?void 0:e.focus()},Fn=e=>{var n;return null==(n=rn.current)?void 0:n.scrollToItem(e)},Bn=j(Ln),qn=n.useCallback((e=>{if(j(Dn)){var n=u?-1:Dn.findIndex((e=>e.isSelected)),t=n>-1?n:e===b?0:Dn.length-1;Fn(t),cn(!0),gn(null),vn(i({index:t},Dn[t]))}else cn(!0)}),[u,Dn]),Pn=n.useCallback((e=>{Nn((n=>n.filter((n=>n.value!==e))))}),[]),Wn=n.useCallback((e=>{if(!e.isDisabled){if(e.isSelected)u&&Pn(e.value);else{var n=a(e,ze);Nn((e=>u?[...e,n]:[n]))}(P(we)?we:P(l)?l:l=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})())?An():Ue&&(dn(""),cn(!1))}}),[u,Ue,we,Pn]);n.useImperativeHandle(r,(()=>({menuOpen:Mn.current,blur:An,focus:Vn,clearValue:()=>{Nn(D),vn(T)},setValue:e=>{Nn(Y(e,xn,wn))},toggleMenu:e=>{e||void 0===e&&!Mn.current?(Vn(),qn(b)):An()}})),[Mn,xn,wn,qn]),o=()=>{C&&Vn()},n.useEffect(o,[]),n.useEffect((()=>{In.current&&kn.current&&(kn.current=!1,Cn(On))}),[Cn,In,On]),Se((()=>{if(En.current){var e=u?Ln.map((e=>e.data)):j(Ln)?Ln[0].data:null;Sn(e)}}),[Sn,En,u,Ln]),Se((()=>{var e=Dn.length,{current:n}=zn,t=e>0&&(s||e!==Qe.length||0===n),r=Mn.current&&void 0!==n&&n<e;if(0===e)vn(T);else if(1===e||t||r){var o=Math.max(0,Dn.findIndex((e=>e.isSelected)));Fn(o),vn(i({index:o},Dn[o]))}zn.current=e}),[s,Qe,Mn,Dn]);var jn=()=>{var e=a(hn,Le);e.data&&Wn(e)},Hn=e=>{if(j(Dn)){var n=hn.index;switch(e){case g:n=hn.index>0?hn.index-1:Dn.length-1;break;case h:n=(hn.index+1)%Dn.length;break;case w:var t=hn.index-Ze;n=t<0?0:t;break;case x:var r=hn.index+Ze;n=r>Dn.length-1?Dn.length-1:r}Fn(n),fn&&gn(null),vn(i({index:n},Dn[n]))}},Kn=e=>{if(!G){pn||Vn();var n="INPUT"!==e.target.nodeName;un?n&&(cn(!1),dn("")):je&&qn(b),n&&e.preventDefault()}},Un=e=>{K(e),Vn()},Yn=n.useCallback((e=>{Un(e),Nn(D)}),[]),Xn=n.useCallback((e=>{G||je||(Un(e),Mn.current?cn(!1):qn(b))}),[G,je,qn]),Gn=!!u&&Bn,Jn=!!_&&!G&&Bn;return n.createElement(t.ThemeProvider,{theme:bn},n.createElement(Ne,{id:p,onKeyDown:e=>{if(!(G||A&&(A(e,sn,hn),e.defaultPrevented))){switch(e.key){case"ArrowDown":un?Hn(h):qn(b);break;case"ArrowUp":un?Hn(g):qn(v);break;case"ArrowLeft":case"ArrowRight":if(!u||sn||Oe)return;(e=>{if(Bn){var n=-1,t=Ln.length-1,r=fn?Ln.findIndex((e=>e.value===fn)):-1,o=(n="ArrowRight"===e?r>-1&&r<t?r+1:-1:0!==r?-1===r?t:r-1:0)>-1?Ln[n].value:null;hn.data&&vn(T),o!==fn&&gn(o)}})(e.key);break;case"PageUp":if(!un)return;Hn(w);break;case"PageDown":if(!un)return;Hn(x);break;case" ":if(sn)return;if(un){if(!hn.data)return;jn()}else qn(b);break;case"Enter":if(!un)return;jn();break;case"Escape":un&&(cn(!1),dn(""));break;case"Tab":if(e.shiftKey||!un||!Ke||!hn.data)return;jn();break;case"Delete":case"Backspace":if(sn)return;if(fn){var n=Ln.findIndex((e=>e.value===fn)),t=n>-1&&n<Ln.length-1?Ln[n+1].value:null;Pn(fn),gn(t)}else{if(!Xe)return;if(!Bn)break;if(u&&!Oe){var{value:r}=Ln[Ln.length-1];Pn(r)}else _&&Nn(D)}break;default:return}e.preventDefault()}},className:"rfs-select-container"},n.createElement(Te,{ref:ln,isInvalid:B,isFocused:pn,isDisabled:G,className:"rfs-control-container",onTouchEnd:Kn,onMouseDown:Kn},n.createElement(De,{flex:Gn},n.createElement(se,{isMulti:u,inputValue:sn,placeholder:_e,selectedOption:Ln,focusedMultiValue:fn,renderMultiOptions:Oe,renderOptionLabel:yn,removeSelectedOption:Pn}),n.createElement(pe,{id:c,ref:an,menuId:d,menuOpen:un,required:y,ariaLabel:q,isInvalid:B,inputValue:sn,onBlur:e=>{null==$||$(e),mn(!1),cn(!1),dn("")},onFocus:e=>{null==oe||oe(e),mn(!0),ge&&qn(b)},onChange:e=>{kn.current=!0,null==ae||ae(e.currentTarget.value),dn(e.currentTarget.value),cn(!0)},ariaLabelledBy:ie,hasSelectedOptions:Bn,readOnly:!qe||!!fn})),n.createElement(Ce,{menuOpen:un,clearIcon:V,caretIcon:F,isInvalid:B,isLoading:S,showClear:Jn,isDisabled:G,loadingNode:te,onClearMouseDown:Yn,onCaretMouseDown:Xn})),n.createElement(ee,{id:d,menuRef:on,menuOpen:un,isLoading:S,menuTop:Tn,height:Rn,itemSize:nn,loadingMsg:$e,menuOptions:Dn,memoOptions:Pe,fixedSizeListRef:rn,lazyLoadMenu:We,noOptionsMsg:en,selectOption:Wn,direction:xe,itemKeySelector:me,overscanCount:be,menuPortalTarget:he,onMenuMouseDown:Un,width:U||bn.menu.width,renderOptionLabel:yn,focusedOptionIndex:hn.index}),ve&&n.createElement(fe,{ariaLive:O,menuOpen:un,isFocused:pn,ariaLabel:q,inputValue:sn,isSearchable:qe,focusedOption:hn,selectedOption:Ln,optionCount:Dn.length})))}));Re.displayName="Select",e.Select=Re})); |
@@ -7,5 +7,6 @@ import React, { type ReactNode, type KeyboardEvent } from 'react'; | ||
async?: boolean | undefined; | ||
menuId?: string | undefined; | ||
inputId?: string | undefined; | ||
selectId?: string | undefined; | ||
pageSize?: number | undefined; | ||
selectId?: string | undefined; | ||
isMulti?: boolean | undefined; | ||
@@ -12,0 +13,0 @@ ariaLabel?: string | undefined; |
@@ -19,3 +19,3 @@ import type { SyntheticEvent } from 'react'; | ||
*/ | ||
export declare const buildOptionClsName: (isDisabled: boolean, isSelected: boolean, isFocused: boolean) => string; | ||
export declare const buildOptionClass: (isDisabled: boolean, isSelected: boolean, isFocused: boolean) => string; | ||
/** | ||
@@ -22,0 +22,0 @@ * Parses an object or an array of objects into output of SelectedOption[] |
{ | ||
"name": "react-functional-select", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "Micro-sized and micro-optimized select component for React.js", | ||
@@ -51,3 +51,3 @@ "main": "dist/index.cjs.js", | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.20.2", | ||
"@babel/core": "^7.20.5", | ||
"@babel/plugin-transform-runtime": "^7.19.6", | ||
@@ -59,3 +59,3 @@ "@babel/preset-env": "^7.20.2", | ||
"@rollup/plugin-replace": "^5.0.1", | ||
"@rollup/plugin-typescript": "^9.0.2", | ||
"@rollup/plugin-typescript": "^10.0.1", | ||
"@storybook/addon-storysource": "^6.5.13", | ||
@@ -76,4 +76,4 @@ "@storybook/addons": "^6.5.13", | ||
"@types/styled-components": "^5.1.26", | ||
"@typescript-eslint/eslint-plugin": "^5.44.0", | ||
"@typescript-eslint/parser": "^5.44.0", | ||
"@typescript-eslint/eslint-plugin": "^5.45.0", | ||
"@typescript-eslint/parser": "^5.45.0", | ||
"babel-jest": "^29.3.1", | ||
@@ -101,3 +101,3 @@ "babel-loader": "^9.1.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^3.4.0", | ||
"rollup": "^3.5.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
@@ -130,4 +130,4 @@ "styled-components": "^5.3.6", | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.1" | ||
"@babel/runtime": "^7.20.6" | ||
} | ||
} |
@@ -117,4 +117,5 @@ [![NPM](https://img.shields.io/npm/v/react-functional-select.svg?style=flat-square)](https://www.npmjs.com/package/react-functional-select) | ||
:---|:---|:---|:--- | ||
| `inputId`| string | `undefined` | The id of the autosize search input | ||
|`selectId`| string | `undefined` | The id of the parent div | ||
| `inputId`| string | `undefined` | The id of the autosize search input control | ||
|`selectId`| string | `undefined` | The id of the parent select container element | ||
|`menuId`| string | `undefined` | The id of the menu container element | ||
|`ariaLabel`| string | `undefined` | Aria label (for assistive tech) | ||
@@ -121,0 +122,0 @@ |`isMulti`| bool | `false` | Does the control allow for multiple selections (defaults to single-value mode) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115758
754
188
Updated@babel/runtime@^7.20.6