|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[10636],{10636:function(e,n,t){t.d(n,{Z:function(){return Lt}});var o=t(94184),r=t.n(o),a=t(87462),i=t(74902),l=t(1413),u=t(97685),c=t(45987),s=t(71002),d=t(4942),f=t(21770),p=t(80334),v=t(67294),h=t(8410),m=t(15105),g=t(42550),y=function(e){var n,t=e.className,o=e.customizeIcon,a=e.customizeIconProps,i=e.onMouseDown,l=e.onClick,u=e.children;return n="function"==typeof o?o(a):o,v.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),i&&i(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},void 0!==n?n:v.createElement("span",{className:r()(t.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},u))};var b=v.createContext(null);function E(){return v.useContext(b)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,n=v.useRef(null),t=v.useRef(null);function o(o){(o||null===n.current)&&(n.current=o),window.clearTimeout(t.current),t.current=window.setTimeout((function(){n.current=null}),e)}return v.useEffect((function(){return function(){window.clearTimeout(t.current)}}),[]),[function(){return n.current},o]}var C=t(64217),Z=t(48555),k=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],S=void 0;function N(e,n){var t=e.prefixCls,o=e.invalidate,i=e.item,u=e.renderItem,s=e.responsive,d=e.responsiveDisabled,f=e.registerSize,p=e.itemKey,h=e.className,m=e.style,g=e.children,y=e.display,b=e.order,E=e.component,w=void 0===E?"div":E,C=(0,c.Z)(e,k),N=s&&!y;function x(e){f(p,e)}v.useEffect((function(){return function(){x(null)}}),[]);var K,D=u&&i!==S?u(i):g;o||(K={opacity:N?0:1,height:N?0:S,overflowY:N?"hidden":S,order:s?b:S,pointerEvents:N?"none":S,position:N?"absolute":S});var M={};N&&(M["aria-hidden"]=!0);var I=v.createElement(w,(0,a.Z)({className:r()(!o&&t,h),style:(0,l.Z)((0,l.Z)({},K),m)},M,C,{ref:n}),D);return s&&(I=v.createElement(Z.Z,{onResize:function(e){x(e.offsetWidth)},disabled:d},I)),I}var x=v.forwardRef(N);x.displayName="Item";var K=x,D=t(66680),M=t(73935),I=t(75164);function P(){var e=v.useRef(null);return function(n){e.current||(e.current=[],function(e){if("undefined"==typeof MessageChannel)(0,I.Z)(e);else{var n=new MessageChannel;n.port1.onmessage=function(){return e()},n.port2.postMessage(void 0)}}((function(){(0,M.unstable_batchedUpdates)((function(){e.current.forEach((function(e){e()})),e.current=null}))}))),e.current.push(n)}}function R(e,n){var t=v.useState(n),o=(0,u.Z)(t,2),r=o[0],a=o[1];return[r,(0,D.Z)((function(n){e((function(){a(n)}))}))]}var T=v.createContext(null),L=["component"],O=["className"],A=["className"],H=function(e,n){var t=v.useContext(T);if(!t){var o=e.component,i=void 0===o?"div":o,l=(0,c.Z)(e,L);return v.createElement(i,(0,a.Z)({},l,{ref:n}))}var u=t.className,s=(0,c.Z)(t,O),d=e.className,f=(0,c.Z)(e,A);return v.createElement(T.Provider,{value:null},v.createElement(K,(0,a.Z)({ref:n,className:r()(u,d)},s,f)))},V=v.forwardRef(H);V.displayName="RawItem";var F=V,_=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],W="responsive",U="invalidate";function z(e){return"+ ".concat(e.length," ...")}function j(e,n){var t=e.prefixCls,o=void 0===t?"rc-overflow":t,i=e.data,s=void 0===i?[]:i,d=e.renderItem,f=e.renderRawItem,p=e.itemKey,m=e.itemWidth,g=void 0===m?10:m,y=e.ssr,b=e.style,E=e.className,w=e.maxCount,C=e.renderRest,k=e.renderRawRest,S=e.suffix,N=e.component,x=void 0===N?"div":N,D=e.itemComponent,M=e.onVisibleChange,I=(0,c.Z)(e,_),L="full"===y,O=P(),A=R(O,null),H=(0,u.Z)(A,2),V=H[0],F=H[1],j=V||0,Y=R(O,new Map),$=(0,u.Z)(Y,2),B=$[0],q=$[1],G=R(O,0),X=(0,u.Z)(G,2),J=X[0],Q=X[1],ee=R(O,0),ne=(0,u.Z)(ee,2),te=ne[0],oe=ne[1],re=R(O,0),ae=(0,u.Z)(re,2),ie=ae[0],le=ae[1],ue=(0,v.useState)(null),ce=(0,u.Z)(ue,2),se=ce[0],de=ce[1],fe=(0,v.useState)(null),pe=(0,u.Z)(fe,2),ve=pe[0],he=pe[1],me=v.useMemo((function(){return null===ve&&L?Number.MAX_SAFE_INTEGER:ve||0}),[ve,V]),ge=(0,v.useState)(!1),ye=(0,u.Z)(ge,2),be=ye[0],Ee=ye[1],we="".concat(o,"-item"),Ce=Math.max(J,te),Ze=w===W,ke=s.length&&Ze,Se=w===U,Ne=ke||"number"==typeof w&&s.length>w,xe=(0,v.useMemo)((function(){var e=s;return ke?e=null===V&&L?s:s.slice(0,Math.min(s.length,j/g)):"number"==typeof w&&(e=s.slice(0,w)),e}),[s,g,V,w,ke]),Ke=(0,v.useMemo)((function(){return ke?s.slice(me+1):s.slice(xe.length)}),[s,xe,ke,me]),De=(0,v.useCallback)((function(e,n){var t;return"function"==typeof p?p(e):null!==(t=p&&(null==e?void 0:e[p]))&&void 0!==t?t:n}),[p]),Me=(0,v.useCallback)(d||function(e){return e},[d]);function Ie(e,n,t){(ve!==e||void 0!==n&&n!==se)&&(he(e),t||(Ee(e<s.length-1),null==M||M(e)),void 0!==n&&de(n))}function Pe(e,n){q((function(t){var o=new Map(t);return null===n?o.delete(e):o.set(e,n),o}))}function Re(e){return B.get(De(xe[e],e))}(0,h.Z)((function(){if(j&&"number"==typeof Ce&&xe){var e=ie,n=xe.length,t=n-1;if(!n)return void Ie(0,null);for(var o=0;o<n;o+=1){var r=Re(o);if(L&&(r=r||0),void 0===r){Ie(o-1,void 0,!0);break}if(e+=r,0===t&&e<=j||o===t-1&&e+Re(t)<=j){Ie(t,null);break}if(e+Ce>j){Ie(o-1,e-r-ie+te);break}}S&&Re(0)+ie>j&&de(null)}}),[j,B,te,ie,De,xe]);var Te=be&&!!Ke.length,Le={};null!==se&&ke&&(Le={position:"absolute",left:se,top:0});var Oe,Ae={prefixCls:we,responsive:ke,component:D,invalidate:Se},He=f?function(e,n){var t=De(e,n);return v.createElement(T.Provider,{key:t,value:(0,l.Z)((0,l.Z)({},Ae),{},{order:n,item:e,itemKey:t,registerSize:Pe,display:n<=me})},f(e,n))}:function(e,n){var t=De(e,n);return v.createElement(K,(0,a.Z)({},Ae,{order:n,key:t,item:e,renderItem:Me,itemKey:t,registerSize:Pe,display:n<=me}))},Ve={order:Te?me:Number.MAX_SAFE_INTEGER,className:"".concat(we,"-rest"),registerSize:function(e,n){oe(n),Q(te)},display:Te};if(k)k&&(Oe=v.createElement(T.Provider,{value:(0,l.Z)((0,l.Z)({},Ae),Ve)},k(Ke)));else{var Fe=C||z;Oe=v.createElement(K,(0,a.Z)({},Ae,Ve),"function"==typeof Fe?Fe(Ke):Fe)}var _e=v.createElement(x,(0,a.Z)({className:r()(!Se&&o,E),style:b,ref:n},I),xe.map(He),Ne?Oe:null,S&&v.createElement(K,(0,a.Z)({},Ae,{responsive:Ze,responsiveDisabled:!ke,order:me,className:"".concat(we,"-suffix"),registerSize:function(e,n){le(n)},display:!0,style:Le}),S));return Ze&&(_e=v.createElement(Z.Z,{onResize:function(e,n){F(n.clientWidth)},disabled:!ke},_e)),_e}var Y=v.forwardRef(j);Y.displayName="Overflow",Y.Item=F,Y.RESPONSIVE=W,Y.INVALIDATE=U;var $=Y,B=function(e,n){var t,o,a=e.prefixCls,i=e.id,u=e.inputElement,c=e.disabled,s=e.tabIndex,d=e.autoFocus,f=e.autoComplete,h=e.editable,m=e.activeDescendantId,y=e.value,b=e.maxLength,E=e.onKeyDown,w=e.onMouseDown,C=e.onChange,Z=e.onPaste,k=e.onCompositionStart,S=e.onCompositionEnd,N=e.open,x=e.attrs,K=u||v.createElement("input",null),D=K,M=D.ref,I=D.props,P=I.onKeyDown,R=I.onChange,T=I.onMouseDown,L=I.onCompositionStart,O=I.onCompositionEnd,A=I.style;return(0,p.Kp)(!("maxLength"in K.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),K=v.cloneElement(K,(0,l.Z)((0,l.Z)((0,l.Z)({type:"search"},I),{},{id:i,ref:(0,g.sQ)(n,M),disabled:c,tabIndex:s,autoComplete:f||"off",autoFocus:d,className:r()("".concat(a,"-selection-search-input"),null===(t=K)||void 0===t||null===(o=t.props)||void 0===o?void 0:o.className),role:"combobox","aria-label":"Search","aria-expanded":N||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":N?m:void 0},x),{},{value:h?y:"",maxLength:b,readOnly:!h,unselectable:h?null:"on",style:(0,l.Z)((0,l.Z)({},A),{},{opacity:h?null:0}),onKeyDown:function(e){E(e),P&&P(e)},onMouseDown:function(e){w(e),T&&T(e)},onChange:function(e){C(e),R&&R(e)},onCompositionStart:function(e){k(e),L&&L(e)},onCompositionEnd:function(e){S(e),O&&O(e)},onPaste:Z}))},q=v.forwardRef(B);q.displayName="Input";var G=q;function X(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var J="undefined"!=typeof window&&window.document&&window.document.documentElement;function Q(e){return["string","number"].includes((0,s.Z)(e))}function ee(e){var n=void 0;return e&&(Q(e.title)?n=e.title.toString():Q(e.label)&&(n=e.label.toString())),n}function ne(e){var n;return null!==(n=e.key)&&void 0!==n?n:e.value}var te=function(e){e.preventDefault(),e.stopPropagation()},oe=function(e){var n,t,o=e.id,a=e.prefixCls,i=e.values,l=e.open,c=e.searchValue,s=e.autoClearSearchValue,f=e.inputRef,p=e.placeholder,h=e.disabled,m=e.mode,g=e.showSearch,b=e.autoFocus,E=e.autoComplete,w=e.activeDescendantId,Z=e.tabIndex,k=e.removeIcon,S=e.maxTagCount,N=e.maxTagTextLength,x=e.maxTagPlaceholder,K=void 0===x?function(e){return"+ ".concat(e.length," ...")}:x,D=e.tagRender,M=e.onToggleOpen,I=e.onRemove,P=e.onInputChange,R=e.onInputPaste,T=e.onInputKeyDown,L=e.onInputMouseDown,O=e.onInputCompositionStart,A=e.onInputCompositionEnd,H=v.useRef(null),V=(0,v.useState)(0),F=(0,u.Z)(V,2),_=F[0],W=F[1],U=(0,v.useState)(!1),z=(0,u.Z)(U,2),j=z[0],Y=z[1],B="".concat(a,"-selection"),q=l||"multiple"===m&&!1===s||"tags"===m?c:"",X="tags"===m||"multiple"===m&&!1===s||g&&(l||j);function Q(e,n,t,o,a){return v.createElement("span",{className:r()("".concat(B,"-item"),(0,d.Z)({},"".concat(B,"-item-disabled"),t)),title:ee(e)},v.createElement("span",{className:"".concat(B,"-item-content")},n),o&&v.createElement(y,{className:"".concat(B,"-item-remove"),onMouseDown:te,onClick:a,customizeIcon:k},"×"))}n=function(){W(H.current.scrollWidth)},t=[q],J?v.useLayoutEffect(n,t):v.useEffect(n,t);var oe=v.createElement("div",{className:"".concat(B,"-search"),style:{width:_},onFocus:function(){Y(!0)},onBlur:function(){Y(!1)}},v.createElement(G,{ref:f,open:l,prefixCls:a,id:o,inputElement:null,disabled:h,autoFocus:b,autoComplete:E,editable:X,activeDescendantId:w,value:q,onKeyDown:T,onMouseDown:L,onChange:P,onPaste:R,onCompositionStart:O,onCompositionEnd:A,tabIndex:Z,attrs:(0,C.Z)(e,!0)}),v.createElement("span",{ref:H,className:"".concat(B,"-search-mirror"),"aria-hidden":!0},q," ")),re=v.createElement($,{prefixCls:"".concat(B,"-overflow"),data:i,renderItem:function(e){var n=e.disabled,t=e.label,o=e.value,r=!h&&!n,a=t;if("number"==typeof N&&("string"==typeof t||"number"==typeof t)){var i=String(a);i.length>N&&(a="".concat(i.slice(0,N),"..."))}var u=function(n){n&&n.stopPropagation(),I(e)};return"function"==typeof D?function(e,n,t,o,r){return v.createElement("span",{onMouseDown:function(e){te(e),M(!l)}},D({label:n,value:e,disabled:t,closable:o,onClose:r}))}(o,a,n,r,u):Q(e,a,n,r,u)},renderRest:function(e){var n="function"==typeof K?K(e):K;return Q({title:n},n,!1)},suffix:oe,itemKey:ne,maxCount:S});return v.createElement(v.Fragment,null,re,!i.length&&!q&&v.createElement("span",{className:"".concat(B,"-placeholder")},p))},re=function(e){var n=e.inputElement,t=e.prefixCls,o=e.id,r=e.inputRef,a=e.disabled,i=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,s=e.mode,d=e.open,f=e.values,p=e.placeholder,h=e.tabIndex,m=e.showSearch,g=e.searchValue,y=e.activeValue,b=e.maxLength,E=e.onInputKeyDown,w=e.onInputMouseDown,Z=e.onInputChange,k=e.onInputPaste,S=e.onInputCompositionStart,N=e.onInputCompositionEnd,x=e.title,K=v.useState(!1),D=(0,u.Z)(K,2),M=D[0],I=D[1],P="combobox"===s,R=P||m,T=f[0],L=g||"";P&&y&&!M&&(L=y),v.useEffect((function(){P&&I(!1)}),[P,y]);var O=!("combobox"!==s&&!d&&!m)&&!!L,A=void 0===x?ee(T):x;return v.createElement(v.Fragment,null,v.createElement("span",{className:"".concat(t,"-selection-search")},v.createElement(G,{ref:r,prefixCls:t,id:o,open:d,inputElement:n,disabled:a,autoFocus:i,autoComplete:l,editable:R,activeDescendantId:c,value:L,onKeyDown:E,onMouseDown:w,onChange:function(e){I(!0),Z(e)},onPaste:k,onCompositionStart:S,onCompositionEnd:N,tabIndex:h,attrs:(0,C.Z)(e,!0),maxLength:P?b:void 0})),!P&&T?v.createElement("span",{className:"".concat(t,"-selection-item"),title:A,style:O?{visibility:"hidden"}:void 0},T.label):null,function(){if(T)return null;var e=O?{visibility:"hidden"}:void 0;return v.createElement("span",{className:"".concat(t,"-selection-placeholder"),style:e},p)}())};var ae=function(e,n){var t=(0,v.useRef)(null),o=(0,v.useRef)(!1),r=e.prefixCls,i=e.open,l=e.mode,c=e.showSearch,s=e.tokenWithEnter,d=e.autoClearSearchValue,f=e.onSearch,p=e.onSearchSubmit,h=e.onToggleOpen,g=e.onInputKeyDown,y=e.domRef;v.useImperativeHandle(n,(function(){return{focus:function(){t.current.focus()},blur:function(){t.current.blur()}}}));var b=w(0),E=(0,u.Z)(b,2),C=E[0],Z=E[1],k=(0,v.useRef)(null),S=function(e){!1!==f(e,!0,o.current)&&h(!0)},N={inputRef:t,onInputKeyDown:function(e){var n,t=e.which;t!==m.Z.UP&&t!==m.Z.DOWN||e.preventDefault(),g&&g(e),t!==m.Z.ENTER||"tags"!==l||o.current||i||null==p||p(e.target.value),n=t,[m.Z.ESC,m.Z.SHIFT,m.Z.BACKSPACE,m.Z.TAB,m.Z.WIN_KEY,m.Z.ALT,m.Z.META,m.Z.WIN_KEY_RIGHT,m.Z.CTRL,m.Z.SEMICOLON,m.Z.EQUALS,m.Z.CAPS_LOCK,m.Z.CONTEXT_MENU,m.Z.F1,m.Z.F2,m.Z.F3,m.Z.F4,m.Z.F5,m.Z.F6,m.Z.F7,m.Z.F8,m.Z.F9,m.Z.F10,m.Z.F11,m.Z.F12].includes(n)||h(!0)},onInputMouseDown:function(){Z(!0)},onInputChange:function(e){var n=e.target.value;if(s&&k.current&&/[\r\n]/.test(k.current)){var t=k.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");n=n.replace(t,k.current)}k.current=null,S(n)},onInputPaste:function(e){var n=e.clipboardData.getData("text");k.current=n},onInputCompositionStart:function(){o.current=!0},onInputCompositionEnd:function(e){o.current=!1,"combobox"!==l&&S(e.target.value)}},x="multiple"===l||"tags"===l?v.createElement(oe,(0,a.Z)({},e,N)):v.createElement(re,(0,a.Z)({},e,N));return v.createElement("div",{ref:y,className:"".concat(r,"-selector"),onClick:function(e){e.target!==t.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){t.current.focus()})):t.current.focus())},onMouseDown:function(e){var n=C();e.target===t.current||n||"combobox"===l||e.preventDefault(),("combobox"===l||c&&n)&&i||(i&&!1!==d&&f("",!0,!1),h())}},x)},ie=v.forwardRef(ae);ie.displayName="Selector";var le=ie,ue=t(62709),ce=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],se=function(e,n){var t=e.prefixCls,o=(e.disabled,e.visible),i=e.children,u=e.popupElement,s=e.animation,f=e.transitionName,p=e.dropdownStyle,h=e.dropdownClassName,m=e.direction,g=void 0===m?"ltr":m,y=e.placement,b=e.builtinPlacements,E=e.dropdownMatchSelectWidth,w=e.dropdownRender,C=e.dropdownAlign,Z=e.getPopupContainer,k=e.empty,S=e.getTriggerDOMNode,N=e.onPopupVisibleChange,x=e.onPopupMouseEnter,K=(0,c.Z)(e,ce),D="".concat(t,"-dropdown"),M=u;w&&(M=w(u));var I=v.useMemo((function(){return b||function(e){var n=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1},htmlRegion:"scroll"}}}(E)}),[b,E]),P=s?"".concat(D,"-").concat(s):f,R="number"==typeof E,T=v.useMemo((function(){return R?null:!1===E?"minWidth":"width"}),[E,R]),L=p;R&&(L=(0,l.Z)((0,l.Z)({},L),{},{width:E}));var O=v.useRef(null);return v.useImperativeHandle(n,(function(){return{getPopupElement:function(){return O.current}}})),v.createElement(ue.Z,(0,a.Z)({},K,{showAction:N?["click"]:[],hideAction:N?["click"]:[],popupPlacement:y||("rtl"===g?"bottomRight":"bottomLeft"),builtinPlacements:I,prefixCls:D,popupTransitionName:P,popup:v.createElement("div",{ref:O,onMouseEnter:x},M),stretch:T,popupAlign:C,popupVisible:o,getPopupContainer:Z,popupClassName:r()(h,(0,d.Z)({},"".concat(D,"-empty"),k)),popupStyle:L,getTriggerDOMNode:S,onPopupVisibleChange:N}),i)},de=v.forwardRef(se);de.displayName="SelectTrigger";var fe=de,pe=t(84506);function ve(e,n){var t,o=e.key;return"value"in e&&(t=e.value),null!=o?o:void 0!==t?t:"rc-index-key-".concat(n)}function he(e,n){var t=e||{},o=t.label||(n?"children":"label");return{label:o,value:t.value||"value",options:t.options||"options",groupLabel:t.groupLabel||o}}function me(e){var n=(0,l.Z)({},e);return"props"in n||Object.defineProperty(n,"props",{get:function(){return(0,p.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),n}}),n}var ge=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],ye=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function be(e){return"tags"===e||"multiple"===e}var Ee=v.forwardRef((function(e,n){var t,o,p=e.id,E=e.prefixCls,C=e.className,Z=e.showSearch,k=e.tagRender,S=e.direction,N=e.omitDomProps,x=e.displayValues,K=e.onDisplayValuesChange,D=e.emptyOptions,M=e.notFoundContent,I=void 0===M?"Not Found":M,P=e.onClear,R=e.mode,T=e.disabled,L=e.loading,O=e.getInputElement,A=e.getRawInputElement,H=e.open,V=e.defaultOpen,F=e.onDropdownVisibleChange,_=e.activeValue,W=e.onActiveValueChange,U=e.activeDescendantId,z=e.searchValue,j=e.autoClearSearchValue,Y=e.onSearch,$=e.onSearchSplit,B=e.tokenSeparators,q=e.allowClear,G=e.suffixIcon,X=e.clearIcon,J=e.OptionList,Q=e.animation,ee=e.transitionName,ne=e.dropdownStyle,te=e.dropdownClassName,oe=e.dropdownMatchSelectWidth,re=e.dropdownRender,ae=e.dropdownAlign,ie=e.placement,ue=e.builtinPlacements,ce=e.getPopupContainer,se=e.showAction,de=void 0===se?[]:se,ve=e.onFocus,he=e.onBlur,me=e.onKeyUp,Ee=e.onKeyDown,we=e.onMouseDown,Ce=(0,c.Z)(e,ge),Ze=be(R),ke=(void 0!==Z?Z:Ze)||"combobox"===R,Se=(0,l.Z)({},Ce);ye.forEach((function(e){delete Se[e]})),null==N||N.forEach((function(e){delete Se[e]}));var Ne=v.useState(!1),xe=(0,u.Z)(Ne,2),Ke=xe[0],De=xe[1];v.useEffect((function(){De(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[]);var Me=v.useRef(null),Ie=v.useRef(null),Pe=v.useRef(null),Re=v.useRef(null),Te=v.useRef(null),Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=v.useState(!1),t=(0,u.Z)(n,2),o=t[0],r=t[1],a=v.useRef(null),i=function(){window.clearTimeout(a.current)};return v.useEffect((function(){return i}),[]),[o,function(n,t){i(),a.current=window.setTimeout((function(){r(n),t&&t()}),e)},i]}(),Oe=(0,u.Z)(Le,3),Ae=Oe[0],He=Oe[1],Ve=Oe[2];v.useImperativeHandle(n,(function(){var e,n;return{focus:null===(e=Re.current)||void 0===e?void 0:e.focus,blur:null===(n=Re.current)||void 0===n?void 0:n.blur,scrollTo:function(e){var n;return null===(n=Te.current)||void 0===n?void 0:n.scrollTo(e)}}}));var Fe=v.useMemo((function(){var e;if("combobox"!==R)return z;var n=null===(e=x[0])||void 0===e?void 0:e.value;return"string"==typeof n||"number"==typeof n?String(n):""}),[z,R,x]),_e="combobox"===R&&"function"==typeof O&&O()||null,We="function"==typeof A&&A(),Ue=(0,g.x1)(Ie,null==We||null===(t=We.props)||void 0===t?void 0:t.ref),ze=v.useState(!1),je=(0,u.Z)(ze,2),Ye=je[0],$e=je[1];(0,h.Z)((function(){$e(!0)}),[]);var Be=(0,f.Z)(!1,{defaultValue:V,value:H}),qe=(0,u.Z)(Be,2),Ge=qe[0],Xe=qe[1],Je=!!Ye&&Ge,Qe=!I&&D;(T||Qe&&Je&&"combobox"===R)&&(Je=!1);var en=!Qe&&Je,nn=v.useCallback((function(e){var n=void 0!==e?e:!Je;T||(Xe(n),Je!==n&&(null==F||F(n)))}),[T,Je,Xe,F]),tn=v.useMemo((function(){return(B||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[B]),on=function(e,n,t){var o=!0,r=e;null==W||W(null);var a=t?null:function(e,n){if(!n||!n.length)return null;var t=!1,o=function e(n,o){var r=(0,pe.Z)(o),a=r[0],l=r.slice(1);if(!a)return[n];var u=n.split(a);return t=t||u.length>1,u.reduce((function(n,t){return[].concat((0,i.Z)(n),(0,i.Z)(e(t,l)))}),[]).filter((function(e){return e}))}(e,n);return t?o:null}(e,B);return"combobox"!==R&&a&&(r="",null==$||$(a),nn(!1),o=!1),Y&&Fe!==r&&Y(r,{source:n?"typing":"effect"}),o};v.useEffect((function(){Je||Ze||"combobox"===R||on("",!1,!1)}),[Je]),v.useEffect((function(){Ge&&T&&Xe(!1),T&&He(!1)}),[T]);var rn=w(),an=(0,u.Z)(rn,2),ln=an[0],un=an[1],cn=v.useRef(!1),sn=[];v.useEffect((function(){return function(){sn.forEach((function(e){return clearTimeout(e)})),sn.splice(0,sn.length)}}),[]);var dn,fn=v.useState({}),pn=(0,u.Z)(fn,2)[1];We&&(dn=function(e){nn(e)}),function(e,n,t,o){var r=v.useRef(null);r.current={open:n,triggerOpen:t,customizedTrigger:o},v.useEffect((function(){function n(n){var t;if(null===(t=r.current)||void 0===t||!t.customizedTrigger){var o=n.target;o.shadowRoot&&n.composed&&(o=n.composedPath()[0]||o),r.current.open&&e().filter((function(e){return e})).every((function(e){return!e.contains(o)&&e!==o}))&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",n),function(){return window.removeEventListener("mousedown",n)}}),[])}((function(){var e;return[Me.current,null===(e=Pe.current)||void 0===e?void 0:e.getPopupElement()]}),en,nn,!!We);var vn,hn=v.useMemo((function(){return(0,l.Z)((0,l.Z)({},e),{},{notFoundContent:I,open:Je,triggerOpen:en,id:p,showSearch:ke,multiple:Ze,toggleOpen:nn})}),[e,I,en,Je,p,ke,Ze,nn]),mn=!!G||L;mn&&(vn=v.createElement(y,{className:r()("".concat(E,"-arrow"),(0,d.Z)({},"".concat(E,"-arrow-loading"),L)),customizeIcon:G,customizeIconProps:{loading:L,searchValue:Fe,open:Je,focused:Ae,showSearch:ke}}));var gn,yn=function(e,n,t,o,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,u=v.useMemo((function(){return"object"===(0,s.Z)(o)?o.clearIcon:r||void 0}),[o,r]),c=v.useMemo((function(){return!(a||!o||!t.length&&!i||"combobox"===l&&""===i)}),[o,a,t.length,i,l]);return{allowClear:c,clearIcon:v.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:u},"×")}}(E,(function(){var e;null==P||P(),null===(e=Re.current)||void 0===e||e.focus(),K([],{type:"clear",values:x}),on("",!1,!1)}),x,q,X,T,Fe,R),bn=yn.allowClear,En=yn.clearIcon,wn=v.createElement(J,{ref:Te}),Cn=r()(E,C,(o={},(0,d.Z)(o,"".concat(E,"-focused"),Ae),(0,d.Z)(o,"".concat(E,"-multiple"),Ze),(0,d.Z)(o,"".concat(E,"-single"),!Ze),(0,d.Z)(o,"".concat(E,"-allow-clear"),q),(0,d.Z)(o,"".concat(E,"-show-arrow"),mn),(0,d.Z)(o,"".concat(E,"-disabled"),T),(0,d.Z)(o,"".concat(E,"-loading"),L),(0,d.Z)(o,"".concat(E,"-open"),Je),(0,d.Z)(o,"".concat(E,"-customize-input"),_e),(0,d.Z)(o,"".concat(E,"-show-search"),ke),o)),Zn=v.createElement(fe,{ref:Pe,disabled:T,prefixCls:E,visible:en,popupElement:wn,animation:Q,transitionName:ee,dropdownStyle:ne,dropdownClassName:te,direction:S,dropdownMatchSelectWidth:oe,dropdownRender:re,dropdownAlign:ae,placement:ie,builtinPlacements:ue,getPopupContainer:ce,empty:D,getTriggerDOMNode:function(){return Ie.current},onPopupVisibleChange:dn,onPopupMouseEnter:function(){pn({})}},We?v.cloneElement(We,{ref:Ue}):v.createElement(le,(0,a.Z)({},e,{domRef:Ie,prefixCls:E,inputElement:_e,ref:Re,id:p,showSearch:ke,autoClearSearchValue:j,mode:R,activeDescendantId:U,tagRender:k,values:x,open:Je,onToggleOpen:nn,activeValue:_,searchValue:Fe,onSearch:on,onSearchSubmit:function(e){e&&e.trim()&&Y(e,{source:"submit"})},onRemove:function(e){var n=x.filter((function(n){return n!==e}));K(n,{type:"remove",values:[e]})},tokenWithEnter:tn})));return gn=We?Zn:v.createElement("div",(0,a.Z)({className:Cn},Se,{ref:Me,onMouseDown:function(e){var n,t=e.target,o=null===(n=Pe.current)||void 0===n?void 0:n.getPopupElement();if(o&&o.contains(t)){var r=setTimeout((function(){var e,n=sn.indexOf(r);-1!==n&&sn.splice(n,1),Ve(),Ke||o.contains(document.activeElement)||null===(e=Re.current)||void 0===e||e.focus()}));sn.push(r)}for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];null==we||we.apply(void 0,[e].concat(i))},onKeyDown:function(e){var n,t=ln(),o=e.which;if(o===m.Z.ENTER&&("combobox"!==R&&e.preventDefault(),Je||nn(!0)),un(!!Fe),o===m.Z.BACKSPACE&&!t&&Ze&&!Fe&&x.length){for(var r=(0,i.Z)(x),a=null,l=r.length-1;l>=0;l-=1){var u=r[l];if(!u.disabled){r.splice(l,1),a=u;break}}a&&K(r,{type:"remove",values:[a]})}for(var c=arguments.length,s=new Array(c>1?c-1:0),d=1;d<c;d++)s[d-1]=arguments[d];Je&&Te.current&&(n=Te.current).onKeyDown.apply(n,[e].concat(s)),null==Ee||Ee.apply(void 0,[e].concat(s))},onKeyUp:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];var r;Je&&Te.current&&(r=Te.current).onKeyUp.apply(r,[e].concat(t)),null==me||me.apply(void 0,[e].concat(t))},onFocus:function(){He(!0),T||(ve&&!cn.current&&ve.apply(void 0,arguments),de.includes("focus")&&nn(!0)),cn.current=!0},onBlur:function(){He(!1,(function(){cn.current=!1,nn(!1)})),T||(Fe&&("tags"===R?Y(Fe,{source:"submit"}):"multiple"===R&&Y("",{source:"blur"})),he&&he.apply(void 0,arguments))}}),Ae&&!Je&&v.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(x.map((function(e){var n=e.label,t=e.value;return["number","string"].includes((0,s.Z)(n))?n:t})).join(", "))),Zn,vn,bn&&En),v.createElement(b.Provider,{value:hn},gn)}));var we=Ee;function Ce(e,n){return X(e).join("").toUpperCase().includes(n)}var Ze=t(98924),ke=0,Se=(0,Ze.Z)();function Ne(e){var n=v.useState(),t=(0,u.Z)(n,2),o=t[0],r=t[1];return v.useEffect((function(){var e;r("rc_select_".concat((Se?(e=ke,ke+=1):e="TEST_OR_SSR",e)))}),[]),e||o}var xe=t(50344),Ke=["children","value"],De=["children"];function Me(e){var n=e,t=n.key,o=n.props,r=o.children,a=o.value,i=(0,c.Z)(o,Ke);return(0,l.Z)({key:t,value:void 0!==a?a:t,children:r},i)}function Ie(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,xe.Z)(e).map((function(e,t){if(!v.isValidElement(e)||!e.type)return null;var o=e,r=o.type.isSelectOptGroup,a=o.key,i=o.props,u=i.children,s=(0,c.Z)(i,De);return n||!r?Me(e):(0,l.Z)((0,l.Z)({key:"__RC_SELECT_GRP__".concat(null===a?t:a,"__"),label:a},s),{},{options:Ie(u)})})).filter((function(e){return e}))}function Pe(e,n,t,o,r){return v.useMemo((function(){var a=e;!e&&(a=Ie(n));var i=new Map,l=new Map,u=function(e,n,t){t&&"string"==typeof t&&e.set(n[t],n)};return function e(n){for(var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c<n.length;c+=1){var s=n[c];!s[t.options]||a?(i.set(s[t.value],s),u(l,s,t.label),u(l,s,o),u(l,s,r)):e(s[t.options],!0)}}(a),{options:a,valueOptions:i,labelOptions:l}}),[e,n,t,o,r])}function Re(e){var n=v.useRef();n.current=e;var t=v.useCallback((function(){return n.current.apply(n,arguments)}),[]);return t}var Te=function(){return null};Te.isSelectOptGroup=!0;var Le=Te,Oe=function(){return null};Oe.isSelectOption=!0;var Ae=Oe,He=t(56982),Ve=t(98423),Fe=v.forwardRef((function(e,n){var t=e.height,o=e.offset,i=e.children,u=e.prefixCls,c=e.onInnerResize,s=e.innerProps,f={},p={display:"flex",flexDirection:"column"};return void 0!==o&&(f={height:t,position:"relative",overflow:"hidden"},p=(0,l.Z)((0,l.Z)({},p),{},{transform:"translateY(".concat(o,"px)"),position:"absolute",left:0,right:0,top:0})),v.createElement("div",{style:f},v.createElement(Z.Z,{onResize:function(e){e.offsetHeight&&c&&c()}},v.createElement("div",(0,a.Z)({style:p,className:r()((0,d.Z)({},"".concat(u,"-holder-inner"),u)),ref:n},s),i)))}));Fe.displayName="Filler";var _e=Fe,We=t(15671),Ue=t(43144),ze=t(60136),je=t(51630);function Ye(e){return"touches"in e?e.touches[0].pageY:e.pageY}var $e=function(e){(0,ze.Z)(t,e);var n=(0,je.Z)(t);function t(){var e;(0,We.Z)(this,t);for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a];return(e=n.call.apply(n,[this].concat(r))).moveRaf=null,e.scrollbarRef=v.createRef(),e.thumbRef=v.createRef(),e.visibleTimeout=null,e.state={dragging:!1,pageY:null,startTop:null,visible:!1},e.delayHidden=function(){clearTimeout(e.visibleTimeout),e.setState({visible:!0}),e.visibleTimeout=setTimeout((function(){e.setState({visible:!1})}),2e3)},e.onScrollbarTouchStart=function(e){e.preventDefault()},e.onContainerMouseDown=function(e){e.stopPropagation(),e.preventDefault()},e.patchEvents=function(){window.addEventListener("mousemove",e.onMouseMove),window.addEventListener("mouseup",e.onMouseUp),e.thumbRef.current.addEventListener("touchmove",e.onMouseMove),e.thumbRef.current.addEventListener("touchend",e.onMouseUp)},e.removeEvents=function(){window.removeEventListener("mousemove",e.onMouseMove),window.removeEventListener("mouseup",e.onMouseUp),e.thumbRef.current&&(e.thumbRef.current.removeEventListener("touchmove",e.onMouseMove),e.thumbRef.current.removeEventListener("touchend",e.onMouseUp)),I.Z.cancel(e.moveRaf)},e.onMouseDown=function(n){var t=e.props.onStartMove;e.setState({dragging:!0,pageY:Ye(n),startTop:e.getTop()}),t(),e.patchEvents(),n.stopPropagation(),n.preventDefault()},e.onMouseMove=function(n){var t=e.state,o=t.dragging,r=t.pageY,a=t.startTop,i=e.props.onScroll;if(I.Z.cancel(e.moveRaf),o){var l=a+(Ye(n)-r),u=e.getEnableScrollRange(),c=e.getEnableHeightRange(),s=c?l/c:0,d=Math.ceil(s*u);e.moveRaf=(0,I.Z)((function(){i(d)}))}},e.onMouseUp=function(){var n=e.props.onStopMove;e.setState({dragging:!1}),n(),e.removeEvents()},e.getSpinHeight=function(){var n=e.props,t=n.height,o=t/n.count*10;return o=Math.max(o,20),o=Math.min(o,t/2),Math.floor(o)},e.getEnableScrollRange=function(){var n=e.props;return n.scrollHeight-n.height||0},e.getEnableHeightRange=function(){return e.props.height-e.getSpinHeight()||0},e.getTop=function(){var n=e.props.scrollTop,t=e.getEnableScrollRange(),o=e.getEnableHeightRange();return 0===n||0===t?0:n/t*o},e.showScroll=function(){var n=e.props,t=n.height;return n.scrollHeight>t},e}return(0,Ue.Z)(t,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(e){e.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){var e,n;this.removeEvents(),null===(e=this.scrollbarRef.current)||void 0===e||e.removeEventListener("touchstart",this.onScrollbarTouchStart),null===(n=this.thumbRef.current)||void 0===n||n.removeEventListener("touchstart",this.onMouseDown),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var e=this.state,n=e.dragging,t=e.visible,o=this.props,a=o.prefixCls,i=o.direction,u=this.getSpinHeight(),c=this.getTop(),s=this.showScroll(),f=s&&t,p="rtl"===i?{left:0}:{right:0};return v.createElement("div",{ref:this.scrollbarRef,className:r()("".concat(a,"-scrollbar"),(0,d.Z)({},"".concat(a,"-scrollbar-show"),s)),style:(0,l.Z)((0,l.Z)({width:8,top:0,bottom:0},p),{},{position:"absolute",display:f?null:"none"}),onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},v.createElement("div",{ref:this.thumbRef,className:r()("".concat(a,"-scrollbar-thumb"),(0,d.Z)({},"".concat(a,"-scrollbar-thumb-moving"),n)),style:{width:"100%",height:u,top:c,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),t}(v.Component);function Be(e){var n=e.children,t=e.setRef,o=v.useCallback((function(e){t(e)}),[]);return v.cloneElement(n,{ref:o})}var qe=t(34203),Ge=function(){function e(){(0,We.Z)(this,e),this.maps=void 0,this.maps=Object.create(null)}return(0,Ue.Z)(e,[{key:"set",value:function(e,n){this.maps[e]=n}},{key:"get",value:function(e){return this.maps[e]}}]),e}();function Xe(e,n,t){var o=v.useState(e),r=(0,u.Z)(o,2),a=r[0],i=r[1],l=v.useState(null),c=(0,u.Z)(l,2),s=c[0],d=c[1];return v.useEffect((function(){var o=function(e,n,t){var o,r,a=e.length,i=n.length;if(0===a&&0===i)return null;a<i?(o=e,r=n):(o=n,r=e);var l={__EMPTY_ITEM__:!0};function u(e){return void 0!==e?t(e):l}for(var c=null,s=1!==Math.abs(a-i),d=0;d<r.length;d+=1){var f=u(o[d]);if(f!==u(r[d])){c=d,s=s||f!==u(r[d+1]);break}}return null===c?null:{index:c,multiple:s}}(a||[],e||[],n);void 0!==(null==o?void 0:o.index)&&(null==t||t(o.index),d(e[o.index])),i(e)}),[e]),[s]}var Je="object"===("undefined"==typeof navigator?"undefined":(0,s.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),Qe=function(e,n){var t=(0,v.useRef)(!1),o=(0,v.useRef)(null);function r(){clearTimeout(o.current),t.current=!0,o.current=setTimeout((function(){t.current=!1}),50)}var a=(0,v.useRef)({top:e,bottom:n});return a.current.top=e,a.current.bottom=n,function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e<0&&a.current.top||e>0&&a.current.bottom;return n&&i?(clearTimeout(o.current),t.current=!1):i&&!t.current||r(),!t.current&&i}};var en=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","component","onScroll","onVisibleChange","innerProps"],nn=[],tn={overflowY:"auto",overflowAnchor:"none"};function on(e,n){var t=e.prefixCls,o=void 0===t?"rc-virtual-list":t,i=e.className,f=e.height,p=e.itemHeight,m=e.fullHeight,g=void 0===m||m,y=e.style,b=e.data,E=e.children,w=e.itemKey,C=e.virtual,Z=e.direction,k=e.component,S=void 0===k?"div":k,N=e.onScroll,x=e.onVisibleChange,K=e.innerProps,D=(0,c.Z)(e,en),M=!(!1===C||!f||!p),P=M&&b&&p*b.length>f,R=(0,v.useState)(0),T=(0,u.Z)(R,2),L=T[0],O=T[1],A=(0,v.useState)(!1),H=(0,u.Z)(A,2),V=H[0],F=H[1],_=r()(o,(0,d.Z)({},"".concat(o,"-rtl"),"rtl"===Z),i),W=b||nn,U=(0,v.useRef)(),z=(0,v.useRef)(),j=(0,v.useRef)(),Y=v.useCallback((function(e){return"function"==typeof w?w(e):null==e?void 0:e[w]}),[w]),$={getKey:Y};function B(e){O((function(n){var t=function(e){var n=e;Number.isNaN(de.current)||(n=Math.min(n,de.current));return n=Math.max(n,0),n}("function"==typeof e?e(n):e);return U.current.scrollTop=t,t}))}var q=(0,v.useRef)({start:0,end:W.length}),G=(0,v.useRef)(),X=Xe(W,Y),J=(0,u.Z)(X,1)[0];G.current=J;var Q=function(e,n,t){var o=v.useState(0),r=(0,u.Z)(o,2),a=r[0],i=r[1],l=(0,v.useRef)(new Map),c=(0,v.useRef)(new Ge),s=(0,v.useRef)();function d(){I.Z.cancel(s.current)}function f(){d(),s.current=(0,I.Z)((function(){l.current.forEach((function(e,n){if(e&&e.offsetParent){var t=(0,qe.Z)(e),o=t.offsetHeight;c.current.get(n)!==o&&c.current.set(n,t.offsetHeight)}})),i((function(e){return e+1}))}))}return(0,v.useEffect)((function(){return d}),[]),[function(o,r){var a=e(o),i=l.current.get(a);r?(l.current.set(a,r),f()):l.current.delete(a),!i!=!r&&(r?null==n||n(o):null==t||t(o))},f,c.current,a]}(Y,null,null),ee=(0,u.Z)(Q,4),ne=ee[0],te=ee[1],oe=ee[2],re=ee[3],ae=v.useMemo((function(){if(!M)return{scrollHeight:void 0,start:0,end:W.length-1,offset:void 0};var e;if(!P)return{scrollHeight:(null===(e=z.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:W.length-1,offset:void 0};for(var n,t,o,r=0,a=W.length,i=0;i<a;i+=1){var l=W[i],u=Y(l),c=oe.get(u),s=r+(void 0===c?p:c);s>=L&&void 0===n&&(n=i,t=r),s>L+f&&void 0===o&&(o=i),r=s}return void 0===n&&(n=0,t=0,o=Math.ceil(f/p)),void 0===o&&(o=W.length-1),{scrollHeight:r,start:n,end:o=Math.min(o+1,W.length),offset:t}}),[P,M,L,W,re,f]),ie=ae.scrollHeight,le=ae.start,ue=ae.end,ce=ae.offset;q.current.start=le,q.current.end=ue;var se=ie-f,de=(0,v.useRef)(se);de.current=se;var fe=L<=0,pe=L>=se,ve=Qe(fe,pe);var he=function(e,n,t,o){var r=(0,v.useRef)(0),a=(0,v.useRef)(null),i=(0,v.useRef)(null),l=(0,v.useRef)(!1),u=Qe(n,t);return[function(n){if(e){I.Z.cancel(a.current);var t=n.deltaY;r.current+=t,i.current=t,u(t)||(Je||n.preventDefault(),a.current=(0,I.Z)((function(){var e=l.current?10:1;o(r.current*e),r.current=0})))}},function(n){e&&(l.current=n.detail===i.current)}]}(M,fe,pe,(function(e){B((function(n){return n+e}))})),me=(0,u.Z)(he,2),ge=me[0],ye=me[1];!function(e,n,t){var o,r=(0,v.useRef)(!1),a=(0,v.useRef)(0),i=(0,v.useRef)(null),l=(0,v.useRef)(null),u=function(e){if(r.current){var n=Math.ceil(e.touches[0].pageY),o=a.current-n;a.current=n,t(o)&&e.preventDefault(),clearInterval(l.current),l.current=setInterval((function(){(!t(o*=.9333333333333333,!0)||Math.abs(o)<=.1)&&clearInterval(l.current)}),16)}},c=function(){r.current=!1,o()},s=function(e){o(),1!==e.touches.length||r.current||(r.current=!0,a.current=Math.ceil(e.touches[0].pageY),i.current=e.target,i.current.addEventListener("touchmove",u),i.current.addEventListener("touchend",c))};o=function(){i.current&&(i.current.removeEventListener("touchmove",u),i.current.removeEventListener("touchend",c))},(0,h.Z)((function(){return e&&n.current.addEventListener("touchstart",s),function(){var e;null===(e=n.current)||void 0===e||e.removeEventListener("touchstart",s),o(),clearInterval(l.current)}}),[e])}(M,U,(function(e,n){return!ve(e,n)&&(ge({preventDefault:function(){},deltaY:e}),!0)})),(0,h.Z)((function(){function e(e){M&&e.preventDefault()}return U.current.addEventListener("wheel",ge),U.current.addEventListener("DOMMouseScroll",ye),U.current.addEventListener("MozMousePixelScroll",e),function(){U.current&&(U.current.removeEventListener("wheel",ge),U.current.removeEventListener("DOMMouseScroll",ye),U.current.removeEventListener("MozMousePixelScroll",e))}}),[M]);var be=function(e,n,t,o,r,a,i,l){var u=v.useRef();return function(c){if(null!=c){if(I.Z.cancel(u.current),"number"==typeof c)i(c);else if(c&&"object"===(0,s.Z)(c)){var d,f=c.align;d="index"in c?c.index:n.findIndex((function(e){return r(e)===c.key}));var p=c.offset,v=void 0===p?0:p;!function l(c,s){if(!(c<0)&&e.current){var p=e.current.clientHeight,h=!1,m=s;if(p){for(var g=s||f,y=0,b=0,E=0,w=Math.min(n.length,d),C=0;C<=w;C+=1){var Z=r(n[C]);b=y;var k=t.get(Z);y=E=b+(void 0===k?o:k),C===d&&void 0===k&&(h=!0)}var S=null;switch(g){case"top":S=b-v;break;case"bottom":S=E-p+v;break;default:var N=e.current.scrollTop;b<N?m="top":E>N+p&&(m="bottom")}null!==S&&S!==e.current.scrollTop&&i(S)}u.current=(0,I.Z)((function(){h&&a(),l(c-1,m)}),2)}}(3)}}else l()}}(U,W,oe,p,Y,te,B,(function(){var e;null===(e=j.current)||void 0===e||e.delayHidden()}));v.useImperativeHandle(n,(function(){return{scrollTo:be}})),(0,h.Z)((function(){if(x){var e=W.slice(le,ue+1);x(e,W)}}),[le,ue,W]);var Ee=function(e,n,t,o,r,a){var i=a.getKey;return e.slice(n,t+1).map((function(e,t){var a=r(e,n+t,{}),l=i(e);return v.createElement(Be,{key:l,setRef:function(n){return o(e,n)}},a)}))}(W,le,ue,ne,E,$),we=null;return f&&(we=(0,l.Z)((0,d.Z)({},g?"height":"maxHeight",f),tn),M&&(we.overflowY="hidden",V&&(we.pointerEvents="none"))),v.createElement("div",(0,a.Z)({style:(0,l.Z)((0,l.Z)({},y),{},{position:"relative"}),className:_},D),v.createElement(S,{className:"".concat(o,"-holder"),style:we,ref:U,onScroll:function(e){var n=e.currentTarget.scrollTop;n!==L&&B(n),null==N||N(e)}},v.createElement(_e,{prefixCls:o,height:ie,offset:ce,onInnerResize:te,ref:z,innerProps:K},Ee)),M&&v.createElement($e,{ref:j,prefixCls:o,scrollTop:L,height:f,scrollHeight:ie,count:W.length,direction:Z,onScroll:function(e){B(e)},onStartMove:function(){F(!0)},onStopMove:function(){F(!1)}}))}var rn=v.forwardRef(on);rn.displayName="List";var an=rn,ln=v.createContext(null);var un=["disabled","title","children","style","className"];function cn(e){return"string"==typeof e||"number"==typeof e}var sn=function(e,n){var t=E(),o=t.prefixCls,l=t.id,s=t.open,f=t.multiple,p=t.mode,h=t.searchValue,g=t.toggleOpen,b=t.notFoundContent,w=t.onPopupScroll,Z=v.useContext(ln),k=Z.flattenOptions,S=Z.onActiveValue,N=Z.defaultActiveFirstOption,x=Z.onSelect,K=Z.menuItemSelectedIcon,D=Z.rawValues,M=Z.fieldNames,I=Z.virtual,P=Z.direction,R=Z.listHeight,T=Z.listItemHeight,L="".concat(o,"-item"),O=(0,He.Z)((function(){return k}),[s,k],(function(e,n){return n[0]&&e[1]!==n[1]})),A=v.useRef(null),H=function(e){e.preventDefault()},V=function(e){A.current&&A.current.scrollTo("number"==typeof e?{index:e}:e)},F=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=O.length,o=0;o<t;o+=1){var r=(e+o*n+t)%t,a=O[r],i=a.group,l=a.data;if(!i&&!l.disabled)return r}return-1},_=v.useState((function(){return F(0)})),W=(0,u.Z)(_,2),U=W[0],z=W[1],j=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];z(e);var t={source:n?"keyboard":"mouse"},o=O[e];o?S(o.value,e,t):S(null,-1,t)};(0,v.useEffect)((function(){j(!1!==N?F(0):-1)}),[O.length,h]);var Y=v.useCallback((function(e){return D.has(e)&&"combobox"!==p}),[p,(0,i.Z)(D).toString(),D.size]);(0,v.useEffect)((function(){var e,n=setTimeout((function(){if(!f&&s&&1===D.size){var e=Array.from(D)[0],n=O.findIndex((function(n){return n.data.value===e}));-1!==n&&(j(n),V(n))}}));s&&(null===(e=A.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(n)}}),[s,h,k.length]);var $=function(e){void 0!==e&&x(e,{selected:!D.has(e)}),f||g(!1)};if(v.useImperativeHandle(n,(function(){return{onKeyDown:function(e){var n=e.which,t=e.ctrlKey;switch(n){case m.Z.N:case m.Z.P:case m.Z.UP:case m.Z.DOWN:var o=0;if(n===m.Z.UP?o=-1:n===m.Z.DOWN?o=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&t&&(n===m.Z.N?o=1:n===m.Z.P&&(o=-1)),0!==o){var r=F(U+o,o);V(r),j(r,!0)}break;case m.Z.ENTER:var a=O[U];a&&!a.data.disabled?$(a.value):$(void 0),s&&e.preventDefault();break;case m.Z.ESC:g(!1),s&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){V(e)}}})),0===O.length)return v.createElement("div",{role:"listbox",id:"".concat(l,"_list"),className:"".concat(L,"-empty"),onMouseDown:H},b);var B=Object.keys(M).map((function(e){return M[e]})),q=function(e){return e.label};function G(e,n){return{role:e.group?"presentation":"option",id:"".concat(l,"_list_").concat(n)}}var X=function(e){var n=O[e];if(!n)return null;var t=n.data||{},o=t.value,r=n.group,i=(0,C.Z)(t,!0),l=q(n);return n?v.createElement("div",(0,a.Z)({"aria-label":"string"!=typeof l||r?null:l},i,{key:e},G(n,e),{"aria-selected":Y(o)}),o):null},J={role:"listbox",id:"".concat(l,"_list")};return v.createElement(v.Fragment,null,I&&v.createElement("div",(0,a.Z)({},J,{style:{height:0,width:0,overflow:"hidden"}}),X(U-1),X(U),X(U+1)),v.createElement(an,{itemKey:"key",ref:A,data:O,height:R,itemHeight:T,fullHeight:!1,onMouseDown:H,onScroll:w,virtual:I,direction:P,innerProps:I?null:J},(function(e,n){var t,o=e.group,i=e.groupOption,l=e.data,u=e.label,s=e.value,f=l.key;if(o){var p,h=null!==(p=l.title)&&void 0!==p?p:cn(u)?u.toString():void 0;return v.createElement("div",{className:r()(L,"".concat(L,"-group")),title:h},void 0!==u?u:f)}var m=l.disabled,g=l.title,b=(l.children,l.style),E=l.className,w=(0,c.Z)(l,un),Z=(0,Ve.Z)(w,B),k=Y(s),S="".concat(L,"-option"),N=r()(L,S,E,(t={},(0,d.Z)(t,"".concat(S,"-grouped"),i),(0,d.Z)(t,"".concat(S,"-active"),U===n&&!m),(0,d.Z)(t,"".concat(S,"-disabled"),m),(0,d.Z)(t,"".concat(S,"-selected"),k),t)),x=q(e),D=!K||"function"==typeof K||k,M="number"==typeof x?x:x||s,P=cn(M)?M.toString():void 0;return void 0!==g&&(P=g),v.createElement("div",(0,a.Z)({},(0,C.Z)(Z),I?{}:G(e,n),{"aria-selected":k,className:N,title:P,onMouseMove:function(){U===n||m||j(n)},onClick:function(){m||$(s)},style:b}),v.createElement("div",{className:"".concat(S,"-content")},M),v.isValidElement(K)||k,D&&v.createElement(y,{className:"".concat(L,"-option-state"),customizeIcon:K,customizeIconProps:{isSelected:k}},k?"✓":null))})))},dn=v.forwardRef(sn);dn.displayName="OptionList";var fn=dn;var pn=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],vn=["inputValue"];var hn=v.forwardRef((function(e,n){var t=e.id,o=e.mode,r=e.prefixCls,p=void 0===r?"rc-select":r,h=e.backfill,m=e.fieldNames,g=e.inputValue,y=e.searchValue,b=e.onSearch,E=e.autoClearSearchValue,w=void 0===E||E,C=e.onSelect,Z=e.onDeselect,k=e.dropdownMatchSelectWidth,S=void 0===k||k,N=e.filterOption,x=e.filterSort,K=e.optionFilterProp,D=e.optionLabelProp,M=e.options,I=e.children,P=e.defaultActiveFirstOption,R=e.menuItemSelectedIcon,T=e.virtual,L=e.direction,O=e.listHeight,A=void 0===O?200:O,H=e.listItemHeight,V=void 0===H?20:H,F=e.value,_=e.defaultValue,W=e.labelInValue,U=e.onChange,z=(0,c.Z)(e,pn),j=Ne(t),Y=be(o),$=!(M||!I),B=v.useMemo((function(){return(void 0!==N||"combobox"!==o)&&N}),[N,o]),q=v.useMemo((function(){return he(m,$)}),[JSON.stringify(m),$]),G=(0,f.Z)("",{value:void 0!==y?y:g,postState:function(e){return e||""}}),J=(0,u.Z)(G,2),Q=J[0],ee=J[1],ne=Pe(M,I,q,K,D),te=ne.valueOptions,oe=ne.labelOptions,re=ne.options,ae=v.useCallback((function(e){return X(e).map((function(e){var n,t,o,r,a,i;(function(e){return!e||"object"!==(0,s.Z)(e)})(e)?n=e:(o=e.key,t=e.label,n=null!==(i=e.value)&&void 0!==i?i:o);var l,u=te.get(n);u&&(void 0===t&&(t=null==u?void 0:u[D||q.label]),void 0===o&&(o=null!==(l=null==u?void 0:u.key)&&void 0!==l?l:n),r=null==u?void 0:u.disabled,a=null==u?void 0:u.title);return{label:t,value:n,key:o,disabled:r,title:a}}))}),[q,D,te]),ie=(0,f.Z)(_,{value:F}),le=(0,u.Z)(ie,2),ue=le[0],ce=le[1],se=v.useMemo((function(){var e,n=ae(ue);return"combobox"===o&&function(e){return!e&&0!==e}(null===(e=n[0])||void 0===e?void 0:e.value)?[]:n}),[ue,ae,o]),de=function(e,n){var t=v.useRef({values:new Map,options:new Map});return[v.useMemo((function(){var o=t.current,r=o.values,a=o.options,i=e.map((function(e){var n;return void 0===e.label?(0,l.Z)((0,l.Z)({},e),{},{label:null===(n=r.get(e.value))||void 0===n?void 0:n.label}):e})),u=new Map,c=new Map;return i.forEach((function(e){u.set(e.value,e),c.set(e.value,n.get(e.value)||a.get(e.value))})),t.current.values=u,t.current.options=c,i}),[e,n]),v.useCallback((function(e){return n.get(e)||t.current.options.get(e)}),[n])]}(se,te),fe=(0,u.Z)(de,2),pe=fe[0],ge=fe[1],ye=v.useMemo((function(){if(!o&&1===pe.length){var e=pe[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return pe.map((function(e){var n;return(0,l.Z)((0,l.Z)({},e),{},{label:null!==(n=e.label)&&void 0!==n?n:e.value})}))}),[o,pe]),Ee=v.useMemo((function(){return new Set(pe.map((function(e){return e.value})))}),[pe]);v.useEffect((function(){if("combobox"===o){var e,n=null===(e=pe[0])||void 0===e?void 0:e.value;ee(function(e){return null!=e}(n)?String(n):"")}}),[pe]);var Ze=Re((function(e,n){var t,o=null!=n?n:e;return t={},(0,d.Z)(t,q.value,e),(0,d.Z)(t,q.label,o),t})),ke=function(e,n,t,o,r){return v.useMemo((function(){if(!t||!1===o)return e;var a=n.options,i=n.label,u=n.value,c=[],s="function"==typeof o,f=t.toUpperCase(),p=s?o:function(e,n){return r?Ce(n[r],f):n[a]?Ce(n["children"!==i?i:"label"],f):Ce(n[u],f)},v=s?function(e){return me(e)}:function(e){return e};return e.forEach((function(e){if(e[a])if(p(t,v(e)))c.push(e);else{var n=e[a].filter((function(e){return p(t,v(e))}));n.length&&c.push((0,l.Z)((0,l.Z)({},e),{},(0,d.Z)({},a,n)))}else p(t,v(e))&&c.push(e)})),c}),[e,o,r,t,n])}(v.useMemo((function(){if("tags"!==o)return re;var e=(0,i.Z)(re);return(0,i.Z)(pe).sort((function(e,n){return e.value<n.value?-1:1})).forEach((function(n){var t=n.value;(function(e){return te.has(e)})(t)||e.push(Ze(t,n.label))})),e}),[Ze,re,te,pe,o]),q,Q,B,K),Se=v.useMemo((function(){return"tags"!==o||!Q||ke.some((function(e){return e[K||"value"]===Q}))||ke.some((function(e){return e[q.value]===Q}))?ke:[Ze(Q)].concat((0,i.Z)(ke))}),[Ze,K,o,ke,Q,q]),xe=v.useMemo((function(){return x?(0,i.Z)(Se).sort((function(e,n){return x(e,n)})):Se}),[Se,x]),Ke=v.useMemo((function(){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.fieldNames,o=n.childrenAsData,r=[],a=he(t,!1),i=a.label,l=a.value,u=a.options,c=a.groupLabel;function s(e,n){e.forEach((function(e){if(n||!(u in e)){var t=e[l];r.push({key:ve(e,r.length),groupOption:n,data:e,label:e[i],value:t})}else{var a=e[c];void 0===a&&o&&(a=e.label),r.push({key:ve(e,r.length),group:!0,data:e,label:a}),s(e[u],!0)}}))}return s(e,!1),r}(xe,{fieldNames:q,childrenAsData:$})}),[xe,q,$]),De=function(e){var n=ae(e);if(ce(n),U&&(n.length!==pe.length||n.some((function(e,n){var t;return(null===(t=pe[n])||void 0===t?void 0:t.value)!==(null==e?void 0:e.value)})))){var t=W?n:n.map((function(e){return e.value})),o=n.map((function(e){return me(ge(e.value))}));U(Y?t:t[0],Y?o:o[0])}},Me=v.useState(null),Ie=(0,u.Z)(Me,2),Te=Ie[0],Le=Ie[1],Oe=v.useState(0),Ae=(0,u.Z)(Oe,2),He=Ae[0],Ve=Ae[1],Fe=void 0!==P?P:"combobox"!==o,_e=v.useCallback((function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.source,a=void 0===r?"keyboard":r;Ve(n),h&&"combobox"===o&&null!==e&&"keyboard"===a&&Le(String(e))}),[h,o]),We=function(e,n,t){var o=function(){var n,t=ge(e);return[W?{label:null==t?void 0:t[q.label],value:e,key:null!==(n=null==t?void 0:t.key)&&void 0!==n?n:e}:e,me(t)]};if(n&&C){var r=o(),a=(0,u.Z)(r,2),i=a[0],l=a[1];C(i,l)}else if(!n&&Z&&"clear"!==t){var c=o(),s=(0,u.Z)(c,2),d=s[0],f=s[1];Z(d,f)}},Ue=Re((function(e,n){var t,r=!Y||n.selected;t=r?Y?[].concat((0,i.Z)(pe),[e]):[e]:pe.filter((function(n){return n.value!==e})),De(t),We(e,r),"combobox"===o?Le(""):be&&!w||(ee(""),Le(""))})),ze=v.useMemo((function(){var e=!1!==T&&!1!==S;return(0,l.Z)((0,l.Z)({},ne),{},{flattenOptions:Ke,onActiveValue:_e,defaultActiveFirstOption:Fe,onSelect:Ue,menuItemSelectedIcon:R,rawValues:Ee,fieldNames:q,virtual:e,direction:L,listHeight:A,listItemHeight:V,childrenAsData:$})}),[ne,Ke,_e,Fe,Ue,R,Ee,q,T,S,A,V,$]);return v.createElement(ln.Provider,{value:ze},v.createElement(we,(0,a.Z)({},z,{id:j,prefixCls:p,ref:n,omitDomProps:vn,mode:o,displayValues:ye,onDisplayValuesChange:function(e,n){De(e);var t=n.type,o=n.values;"remove"!==t&&"clear"!==t||o.forEach((function(e){We(e.value,!1,t)}))},direction:L,searchValue:Q,onSearch:function(e,n){if(ee(e),Le(null),"submit"!==n.source)"blur"!==n.source&&("combobox"===o&&De(e),null==b||b(e));else{var t=(e||"").trim();if(t){var r=Array.from(new Set([].concat((0,i.Z)(Ee),[t])));De(r),We(t,!0),ee("")}}},autoClearSearchValue:w,onSearchSplit:function(e){var n=e;"tags"!==o&&(n=e.map((function(e){var n=oe.get(e);return null==n?void 0:n.value})).filter((function(e){return void 0!==e})));var t=Array.from(new Set([].concat((0,i.Z)(Ee),(0,i.Z)(n))));De(t),t.forEach((function(e){We(e,!0)}))},dropdownMatchSelectWidth:S,OptionList:fn,emptyOptions:!Ke.length,activeValue:Te,activeDescendantId:"".concat(j,"_list_").concat(He)})))}));var mn=hn;mn.Option=Ae,mn.OptGroup=Le;var gn=t(17341),yn=t(1089),bn=function(){return null},En=["children","value"];function wn(e){return(0,xe.Z)(e).map((function(e){if(!v.isValidElement(e)||!e.type)return null;var n=e,t=n.key,o=n.props,r=o.children,a=o.value,i=(0,c.Z)(o,En),u=(0,l.Z)({key:t,value:a},i),s=wn(r);return s.length&&(u.children=s),u})).filter((function(e){return e}))}function Cn(e){if(!e)return e;var n=(0,l.Z)({},e);return"props"in n||Object.defineProperty(n,"props",{get:function(){return(0,p.ZP)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),n}}),n}function Zn(e){var n=v.useRef();n.current=e;var t=v.useCallback((function(){return n.current.apply(n,arguments)}),[]);return t}function kn(e,n,t){return v.useMemo((function(){return e?t?function(e,n){var t=n.id,o=n.pId,r=n.rootPId,a={},i=[];return e.map((function(e){var n=(0,l.Z)({},e),o=n[t];return a[o]=n,n.key=n.key||o,n})).forEach((function(e){var n=e[o],t=a[n];t&&(t.children=t.children||[],t.children.push(e)),(n===r||!t&&null===r)&&i.push(e)})),i}(e,(0,l.Z)({id:"id",pId:"pId",rootPId:null},!0!==t?t:{})):e:wn(n)}),[n,t,e])}var Sn=v.createContext(null),Nn=t(97326),xn=t(27822),Kn=t(10225),Dn=t(36459),Mn=t(73453),In=t(62874),Pn=t(86128),Rn=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Tn=function(e,n){var t=e.className,o=e.style,i=e.motion,l=e.motionNodes,s=e.motionType,d=e.onMotionStart,f=e.onMotionEnd,p=e.active,h=e.treeNodeRequiredProps,m=(0,c.Z)(e,Rn),g=v.useState(!0),y=(0,u.Z)(g,2),b=y[0],E=y[1],w=v.useContext(xn.k).prefixCls,C=v.useRef(!1),Z=function(){C.current||f(),C.current=!0};return(0,v.useEffect)((function(){l&&"hide"===s&&b&&E(!1)}),[l]),(0,v.useEffect)((function(){return l&&d(),function(){l&&Z()}}),[]),l?v.createElement(In.Z,(0,a.Z)({ref:n,visible:b},i,{motionAppear:"show"===s,onAppearEnd:Z,onLeaveEnd:Z}),(function(e,n){var t=e.className,o=e.style;return v.createElement("div",{ref:n,className:r()("".concat(w,"-treenode-motion"),t),style:o},l.map((function(e){var n=(0,a.Z)({},((0,Dn.Z)(e.data),e.data)),t=e.title,o=e.key,r=e.isStart,i=e.isEnd;delete n.children;var l=(0,yn.H8)(o,h);return v.createElement(Pn.Z,(0,a.Z)({},n,l,{title:t,active:p,data:e.data,key:o,isStart:r,isEnd:i}))})))})):v.createElement(Pn.Z,(0,a.Z)({domRef:n,className:t,style:o},m,{active:p}))};Tn.displayName="MotionTreeNode";var Ln=v.forwardRef(Tn);function On(e,n,t){var o=e.findIndex((function(e){return e.key===t})),r=e[o+1],a=n.findIndex((function(e){return e.key===t}));if(r){var i=n.findIndex((function(e){return e.key===r.key}));return n.slice(a+1,i)}return n.slice(a+1)}var An=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Hn={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Vn=function(){},Fn="RC_TREE_MOTION_".concat(Math.random()),_n={key:Fn},Wn={key:Fn,level:0,index:0,pos:"0",node:_n,nodes:[_n]},Un={parent:null,children:[],pos:Wn.pos,data:_n,title:null,key:Fn,isStart:[],isEnd:[]};function zn(e,n,t,o){return!1!==n&&t?e.slice(0,Math.ceil(t/o)+1):e}function jn(e){var n=e.key,t=e.pos;return(0,yn.km)(n,t)}var Yn=v.forwardRef((function(e,n){var t=e.prefixCls,o=e.data,r=(e.selectable,e.checkable,e.expandedKeys),i=e.selectedKeys,l=e.checkedKeys,s=e.loadedKeys,d=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,h=e.disabled,m=e.dragging,g=e.dragOverNodeKey,y=e.dropPosition,b=e.motion,E=e.height,w=e.itemHeight,C=e.virtual,Z=e.focusable,k=e.activeItem,S=e.focused,N=e.tabIndex,x=e.onKeyDown,K=e.onFocus,D=e.onBlur,M=e.onActiveChange,I=e.onListChangeStart,P=e.onListChangeEnd,R=(0,c.Z)(e,An),T=v.useRef(null),L=v.useRef(null);v.useImperativeHandle(n,(function(){return{scrollTo:function(e){T.current.scrollTo(e)},getIndentWidth:function(){return L.current.offsetWidth}}}));var O=v.useState(r),A=(0,u.Z)(O,2),H=A[0],V=A[1],F=v.useState(o),_=(0,u.Z)(F,2),W=_[0],U=_[1],z=v.useState(o),j=(0,u.Z)(z,2),Y=j[0],$=j[1],B=v.useState([]),q=(0,u.Z)(B,2),G=q[0],X=q[1],J=v.useState(null),Q=(0,u.Z)(J,2),ee=Q[0],ne=Q[1],te=v.useRef(o);function oe(){var e=te.current;U(e),$(e),X([]),ne(null),P()}te.current=o,v.useEffect((function(){V(r);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=e.length,o=n.length;if(1!==Math.abs(t-o))return{add:!1,key:null};function r(e,n){var t=new Map;e.forEach((function(e){t.set(e,!0)}));var o=n.filter((function(e){return!t.has(e)}));return 1===o.length?o[0]:null}return t<o?{add:!0,key:r(e,n)}:{add:!1,key:r(n,e)}}(H,r);if(null!==e.key)if(e.add){var n=W.findIndex((function(n){return n.key===e.key})),t=zn(On(W,o,e.key),C,E,w),a=W.slice();a.splice(n+1,0,Un),$(a),X(t),ne("show")}else{var i=o.findIndex((function(n){return n.key===e.key})),l=zn(On(o,W,e.key),C,E,w),u=o.slice();u.splice(i+1,0,Un),$(u),X(l),ne("hide")}else W!==o&&(U(o),$(o))}),[r,o]),v.useEffect((function(){m||oe()}),[m]);var re=b?Y:o,ae={expandedKeys:r,selectedKeys:i,loadedKeys:s,loadingKeys:d,checkedKeys:l,halfCheckedKeys:f,dragOverNodeKey:g,dropPosition:y,keyEntities:p};return v.createElement(v.Fragment,null,S&&k&&v.createElement("span",{style:Hn,"aria-live":"assertive"},function(e){for(var n=String(e.data.key),t=e;t.parent;)t=t.parent,n="".concat(t.data.key," > ").concat(n);return n}(k)),v.createElement("div",null,v.createElement("input",{style:Hn,disabled:!1===Z||h,tabIndex:!1!==Z?N:null,onKeyDown:x,onFocus:K,onBlur:D,value:"",onChange:Vn,"aria-label":"for screen reader"})),v.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},v.createElement("div",{className:"".concat(t,"-indent")},v.createElement("div",{ref:L,className:"".concat(t,"-indent-unit")}))),v.createElement(Mn.Z,(0,a.Z)({},R,{data:re,itemKey:jn,height:E,fullHeight:!1,virtual:C,itemHeight:w,prefixCls:"".concat(t,"-list"),ref:T,onVisibleChange:function(e,n){var t=new Set(e);n.filter((function(e){return!t.has(e)})).some((function(e){return jn(e)===Fn}))&&oe()}}),(function(e){var n=e.pos,t=(0,a.Z)({},((0,Dn.Z)(e.data),e.data)),o=e.title,r=e.key,i=e.isStart,l=e.isEnd,u=(0,yn.km)(r,n);delete t.key,delete t.children;var c=(0,yn.H8)(u,ae);return v.createElement(Ln,(0,a.Z)({},t,c,{title:o,active:!!k&&r===k.key,pos:n,data:e.data,isStart:i,isEnd:l,motion:b,motionNodes:r===Fn?G:null,motionType:ee,onMotionStart:I,onMotionEnd:oe,treeNodeRequiredProps:ae,onMouseMove:function(){M(null)}}))})))}));Yn.displayName="NodeList";var $n=Yn;var Bn=function(e){(0,ze.Z)(t,e);var n=(0,je.Z)(t);function t(){var e;(0,We.Z)(this,t);for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a];return(e=n.call.apply(n,[this].concat(r))).destroyed=!1,e.delayedDragEnterLogic=void 0,e.loadingRetryTimes={},e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,yn.w$)()},e.dragStartMousePosition=null,e.dragNode=void 0,e.currentMouseOverDroppableNodeKey=null,e.listRef=v.createRef(),e.onNodeDragStart=function(n,t){var o=e.state,r=o.expandedKeys,a=o.keyEntities,i=e.props.onDragStart,l=t.props.eventKey;e.dragNode=t,e.dragStartMousePosition={x:n.clientX,y:n.clientY};var u=(0,Kn._5)(r,l);e.setState({draggingNodeKey:l,dragChildrenKeys:(0,Kn.wA)(l,a),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(u),window.addEventListener("dragend",e.onWindowDragEnd),null==i||i({event:n,node:(0,yn.F)(t.props)})},e.onNodeDragEnter=function(n,t){var o=e.state,r=o.expandedKeys,a=o.keyEntities,l=o.dragChildrenKeys,u=o.flattenNodes,c=o.indent,s=e.props,d=s.onDragEnter,f=s.onExpand,p=s.allowDrop,v=s.direction,h=t.props,m=h.pos,g=h.eventKey,y=(0,Nn.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==g&&(e.currentMouseOverDroppableNodeKey=g),y){var b=(0,Kn.OM)(n,y,t,c,e.dragStartMousePosition,p,u,a,r,v),E=b.dropPosition,w=b.dropLevelOffset,C=b.dropTargetKey,Z=b.dropContainerKey,k=b.dropTargetPos,S=b.dropAllowed,N=b.dragOverNodeKey;-1===l.indexOf(C)&&S?(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach((function(n){clearTimeout(e.delayedDragEnterLogic[n])})),y.props.eventKey!==t.props.eventKey&&(n.persist(),e.delayedDragEnterLogic[m]=window.setTimeout((function(){if(null!==e.state.draggingNodeKey){var o=(0,i.Z)(r),l=a[t.props.eventKey];l&&(l.children||[]).length&&(o=(0,Kn.L0)(r,t.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(o),null==f||f(o,{node:(0,yn.F)(t.props),expanded:!0,nativeEvent:n.nativeEvent})}}),800)),y.props.eventKey!==C||0!==w?(e.setState({dragOverNodeKey:N,dropPosition:E,dropLevelOffset:w,dropTargetKey:C,dropContainerKey:Z,dropTargetPos:k,dropAllowed:S}),null==d||d({event:n,node:(0,yn.F)(t.props),expandedKeys:r})):e.resetDragState()):e.resetDragState()}else e.resetDragState()},e.onNodeDragOver=function(n,t){var o=e.state,r=o.dragChildrenKeys,a=o.flattenNodes,i=o.keyEntities,l=o.expandedKeys,u=o.indent,c=e.props,s=c.onDragOver,d=c.allowDrop,f=c.direction,p=(0,Nn.Z)(e).dragNode;if(p){var v=(0,Kn.OM)(n,p,t,u,e.dragStartMousePosition,d,a,i,l,f),h=v.dropPosition,m=v.dropLevelOffset,g=v.dropTargetKey,y=v.dropContainerKey,b=v.dropAllowed,E=v.dropTargetPos,w=v.dragOverNodeKey;-1===r.indexOf(g)&&b&&(p.props.eventKey===g&&0===m?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():h===e.state.dropPosition&&m===e.state.dropLevelOffset&&g===e.state.dropTargetKey&&y===e.state.dropContainerKey&&E===e.state.dropTargetPos&&b===e.state.dropAllowed&&w===e.state.dragOverNodeKey||e.setState({dropPosition:h,dropLevelOffset:m,dropTargetKey:g,dropContainerKey:y,dropTargetPos:E,dropAllowed:b,dragOverNodeKey:w}),null==s||s({event:n,node:(0,yn.F)(t.props)}))}},e.onNodeDragLeave=function(n,t){e.currentMouseOverDroppableNodeKey!==t.props.eventKey||n.currentTarget.contains(n.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var o=e.props.onDragLeave;null==o||o({event:n,node:(0,yn.F)(t.props)})},e.onWindowDragEnd=function(n){e.onNodeDragEnd(n,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(n,t){var o=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==o||o({event:n,node:(0,yn.F)(t.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(n,t){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,u=a.dropPosition,c=a.dropTargetKey,s=a.dropTargetPos,d=a.dropAllowed;if(d){var f=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==c){var v=(0,l.Z)((0,l.Z)({},(0,yn.H8)(c,e.getTreeNodeRequiredProps())),{},{active:(null===(o=e.getActiveItem())||void 0===o?void 0:o.key)===c,data:e.state.keyEntities[c].node}),h=-1!==i.indexOf(c);(0,p.ZP)(!h,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var m=(0,Kn.yx)(s),g={event:n,node:(0,yn.F)(v),dragNode:e.dragNode?(0,yn.F)(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==u,dropPosition:u+Number(m[m.length-1])};r||null==f||f(g),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(n,t){var o=e.state,r=o.expandedKeys,a=o.flattenNodes,i=t.expanded,u=t.key;if(!(t.isLeaf||n.shiftKey||n.metaKey||n.ctrlKey)){var c=a.filter((function(e){return e.key===u}))[0],s=(0,yn.F)((0,l.Z)((0,l.Z)({},(0,yn.H8)(u,e.getTreeNodeRequiredProps())),{},{data:c.data}));e.setExpandedKeys(i?(0,Kn._5)(r,u):(0,Kn.L0)(r,u)),e.onNodeExpand(n,s)}},e.onNodeClick=function(n,t){var o=e.props,r=o.onClick;"click"===o.expandAction&&e.triggerExpandActionExpand(n,t),null==r||r(n,t)},e.onNodeDoubleClick=function(n,t){var o=e.props,r=o.onDoubleClick;"doubleClick"===o.expandAction&&e.triggerExpandActionExpand(n,t),null==r||r(n,t)},e.onNodeSelect=function(n,t){var o=e.state.selectedKeys,r=e.state,a=r.keyEntities,i=r.fieldNames,l=e.props,u=l.onSelect,c=l.multiple,s=t.selected,d=t[i.key],f=!s,p=(o=f?c?(0,Kn.L0)(o,d):[d]:(0,Kn._5)(o,d)).map((function(e){var n=a[e];return n?n.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:o}),null==u||u(o,{event:"select",selected:f,node:t,selectedNodes:p,nativeEvent:n.nativeEvent})},e.onNodeCheck=function(n,t,o){var r,a=e.state,l=a.keyEntities,u=a.checkedKeys,c=a.halfCheckedKeys,s=e.props,d=s.checkStrictly,f=s.onCheck,p=t.key,v={event:"check",node:t,checked:o,nativeEvent:n.nativeEvent};if(d){var h=o?(0,Kn.L0)(u,p):(0,Kn._5)(u,p);r={checked:h,halfChecked:(0,Kn._5)(c,p)},v.checkedNodes=h.map((function(e){return l[e]})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:h})}else{var m=(0,gn.S)([].concat((0,i.Z)(u),[p]),!0,l),g=m.checkedKeys,y=m.halfCheckedKeys;if(!o){var b=new Set(g);b.delete(p);var E=(0,gn.S)(Array.from(b),{checked:!1,halfCheckedKeys:y},l);g=E.checkedKeys,y=E.halfCheckedKeys}r=g,v.checkedNodes=[],v.checkedNodesPositions=[],v.halfCheckedKeys=y,g.forEach((function(e){var n=l[e];if(n){var t=n.node,o=n.pos;v.checkedNodes.push(t),v.checkedNodesPositions.push({node:t,pos:o})}})),e.setUncontrolledState({checkedKeys:g},!1,{halfCheckedKeys:y})}null==f||f(r,v)},e.onNodeLoad=function(n){var t=n.key,o=new Promise((function(o,r){e.setState((function(a){var i=a.loadedKeys,l=void 0===i?[]:i,u=a.loadingKeys,c=void 0===u?[]:u,s=e.props,d=s.loadData,f=s.onLoad;return d&&-1===l.indexOf(t)&&-1===c.indexOf(t)?(d(n).then((function(){var r=e.state.loadedKeys,a=(0,Kn.L0)(r,t);null==f||f(a,{event:"load",node:n}),e.setUncontrolledState({loadedKeys:a}),e.setState((function(e){return{loadingKeys:(0,Kn._5)(e.loadingKeys,t)}})),o()})).catch((function(n){if(e.setState((function(e){return{loadingKeys:(0,Kn._5)(e.loadingKeys,t)}})),e.loadingRetryTimes[t]=(e.loadingRetryTimes[t]||0)+1,e.loadingRetryTimes[t]>=10){var a=e.state.loadedKeys;(0,p.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:(0,Kn.L0)(a,t)}),o()}r(n)})),{loadingKeys:(0,Kn.L0)(c,t)}):null}))}));return o.catch((function(){})),o},e.onNodeMouseEnter=function(n,t){var o=e.props.onMouseEnter;null==o||o({event:n,node:t})},e.onNodeMouseLeave=function(n,t){var o=e.props.onMouseLeave;null==o||o({event:n,node:t})},e.onNodeContextMenu=function(n,t){var o=e.props.onRightClick;o&&(n.preventDefault(),o({event:n,node:t}))},e.onFocus=function(){var n=e.props.onFocus;e.setState({focused:!0});for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];null==n||n.apply(void 0,o)},e.onBlur=function(){var n=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];null==n||n.apply(void 0,o)},e.getTreeNodeRequiredProps=function(){var n=e.state;return{expandedKeys:n.expandedKeys||[],selectedKeys:n.selectedKeys||[],loadedKeys:n.loadedKeys||[],loadingKeys:n.loadingKeys||[],checkedKeys:n.checkedKeys||[],halfCheckedKeys:n.halfCheckedKeys||[],dragOverNodeKey:n.dragOverNodeKey,dropPosition:n.dropPosition,keyEntities:n.keyEntities}},e.setExpandedKeys=function(n){var t=e.state,o=t.treeData,r=t.fieldNames,a=(0,yn.oH)(o,n,r);e.setUncontrolledState({expandedKeys:n,flattenNodes:a},!0)},e.onNodeExpand=function(n,t){var o=e.state.expandedKeys,r=e.state,a=r.listChanging,i=r.fieldNames,l=e.props,u=l.onExpand,c=l.loadData,s=t.expanded,d=t[i.key];if(!a){var f=o.indexOf(d),v=!s;if((0,p.ZP)(s&&-1!==f||!s&&-1===f,"Expand state not sync with index check"),o=v?(0,Kn.L0)(o,d):(0,Kn._5)(o,d),e.setExpandedKeys(o),null==u||u(o,{node:t,expanded:v,nativeEvent:n.nativeEvent}),v&&c){var h=e.onNodeLoad(t);h&&h.then((function(){var n=(0,yn.oH)(e.state.treeData,o,i);e.setUncontrolledState({flattenNodes:n})})).catch((function(){var n=e.state.expandedKeys,t=(0,Kn._5)(n,d);e.setExpandedKeys(t)}))}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout((function(){e.setUncontrolledState({listChanging:!1})}))},e.onActiveChange=function(n){var t=e.state.activeKey,o=e.props.onActiveChange;t!==n&&(e.setState({activeKey:n}),null!==n&&e.scrollTo({key:n}),null==o||o(n))},e.getActiveItem=function(){var n=e.state,t=n.activeKey,o=n.flattenNodes;return null===t?null:o.find((function(e){return e.key===t}))||null},e.offsetActiveKey=function(n){var t=e.state,o=t.flattenNodes,r=t.activeKey,a=o.findIndex((function(e){return e.key===r}));-1===a&&n<0&&(a=o.length);var i=o[a=(a+n+o.length)%o.length];if(i){var l=i.key;e.onActiveChange(l)}else e.onActiveChange(null)},e.onKeyDown=function(n){var t=e.state,o=t.activeKey,r=t.expandedKeys,a=t.checkedKeys,i=t.fieldNames,u=e.props,c=u.onKeyDown,s=u.checkable,d=u.selectable;switch(n.which){case m.Z.UP:e.offsetActiveKey(-1),n.preventDefault();break;case m.Z.DOWN:e.offsetActiveKey(1),n.preventDefault()}var f=e.getActiveItem();if(f&&f.data){var p=e.getTreeNodeRequiredProps(),v=!1===f.data.isLeaf||!!(f.data[i.children]||[]).length,h=(0,yn.F)((0,l.Z)((0,l.Z)({},(0,yn.H8)(o,p)),{},{data:f.data,active:!0}));switch(n.which){case m.Z.LEFT:v&&r.includes(o)?e.onNodeExpand({},h):f.parent&&e.onActiveChange(f.parent.key),n.preventDefault();break;case m.Z.RIGHT:v&&!r.includes(o)?e.onNodeExpand({},h):f.children&&f.children.length&&e.onActiveChange(f.children[0].key),n.preventDefault();break;case m.Z.ENTER:case m.Z.SPACE:!s||h.disabled||!1===h.checkable||h.disableCheckbox?s||!d||h.disabled||!1===h.selectable||e.onNodeSelect({},h):e.onNodeCheck({},h,!a.includes(o))}}null==c||c(n)},e.setUncontrolledState=function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,i={};Object.keys(n).forEach((function(t){t in e.props?a=!1:(r=!0,i[t]=n[t])})),!r||t&&!a||e.setState((0,l.Z)((0,l.Z)({},i),o))}},e.scrollTo=function(n){e.listRef.current.scrollTo(n)},e}return(0,Ue.Z)(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props.activeKey;void 0!==e&&e!==this.state.activeKey&&(this.setState({activeKey:e}),null!==e&&this.scrollTo({key:e}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,n,t=this.state,o=t.focused,i=t.flattenNodes,l=t.keyEntities,u=t.draggingNodeKey,c=t.activeKey,f=t.dropLevelOffset,p=t.dropContainerKey,h=t.dropTargetKey,m=t.dropPosition,g=t.dragOverNodeKey,y=t.indent,b=this.props,E=b.prefixCls,w=b.className,Z=b.style,k=b.showLine,S=b.focusable,N=b.tabIndex,x=void 0===N?0:N,K=b.selectable,D=b.showIcon,M=b.icon,I=b.switcherIcon,P=b.draggable,R=b.checkable,T=b.checkStrictly,L=b.disabled,O=b.motion,A=b.loadData,H=b.filterTreeNode,V=b.height,F=b.itemHeight,_=b.virtual,W=b.titleRender,U=b.dropIndicatorRender,z=b.onContextMenu,j=b.onScroll,Y=b.direction,$=b.rootClassName,B=b.rootStyle,q=(0,C.Z)(this.props,{aria:!0,data:!0});return P&&(n="object"===(0,s.Z)(P)?P:"function"==typeof P?{nodeDraggable:P}:{}),v.createElement(xn.k.Provider,{value:{prefixCls:E,selectable:K,showIcon:D,icon:M,switcherIcon:I,draggable:n,draggingNodeKey:u,checkable:R,checkStrictly:T,disabled:L,keyEntities:l,dropLevelOffset:f,dropContainerKey:p,dropTargetKey:h,dropPosition:m,dragOverNodeKey:g,indent:y,direction:Y,dropIndicatorRender:U,loadData:A,filterTreeNode:H,titleRender:W,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},v.createElement("div",{role:"tree",className:r()(E,w,$,(e={},(0,d.Z)(e,"".concat(E,"-show-line"),k),(0,d.Z)(e,"".concat(E,"-focused"),o),(0,d.Z)(e,"".concat(E,"-active-focused"),null!==c),e)),style:B},v.createElement($n,(0,a.Z)({ref:this.listRef,prefixCls:E,style:Z,data:i,disabled:L,selectable:K,checkable:!!R,motion:O,dragging:null!==u,height:V,itemHeight:F,virtual:_,focusable:S,focused:o,tabIndex:x,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:z,onScroll:j},this.getTreeNodeRequiredProps(),q))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){var t,o=n.prevProps,r={prevProps:e};function a(n){return!o&&n in e||o&&o[n]!==e[n]}var i=n.fieldNames;if(a("fieldNames")&&(i=(0,yn.w$)(e.fieldNames),r.fieldNames=i),a("treeData")?t=e.treeData:a("children")&&((0,p.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),t=(0,yn.zn)(e.children)),t){r.treeData=t;var u=(0,yn.I8)(t,{fieldNames:i});r.keyEntities=(0,l.Z)((0,d.Z)({},Fn,Wn),u.keyEntities)}var c,s=r.keyEntities||n.keyEntities;if(a("expandedKeys")||o&&a("autoExpandParent"))r.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?(0,Kn.r7)(e.expandedKeys,s):e.expandedKeys;else if(!o&&e.defaultExpandAll){var f=(0,l.Z)({},s);delete f[Fn],r.expandedKeys=Object.keys(f).map((function(e){return f[e].key}))}else!o&&e.defaultExpandedKeys&&(r.expandedKeys=e.autoExpandParent||e.defaultExpandParent?(0,Kn.r7)(e.defaultExpandedKeys,s):e.defaultExpandedKeys);if(r.expandedKeys||delete r.expandedKeys,t||r.expandedKeys){var v=(0,yn.oH)(t||n.treeData,r.expandedKeys||n.expandedKeys,i);r.flattenNodes=v}if((e.selectable&&(a("selectedKeys")?r.selectedKeys=(0,Kn.BT)(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(r.selectedKeys=(0,Kn.BT)(e.defaultSelectedKeys,e))),e.checkable)&&(a("checkedKeys")?c=(0,Kn.E6)(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?c=(0,Kn.E6)(e.defaultCheckedKeys)||{}:t&&(c=(0,Kn.E6)(e.checkedKeys)||{checkedKeys:n.checkedKeys,halfCheckedKeys:n.halfCheckedKeys}),c)){var h=c,m=h.checkedKeys,g=void 0===m?[]:m,y=h.halfCheckedKeys,b=void 0===y?[]:y;if(!e.checkStrictly){var E=(0,gn.S)(g,!0,s);g=E.checkedKeys,b=E.halfCheckedKeys}r.checkedKeys=g,r.halfCheckedKeys=b}return a("loadedKeys")&&(r.loadedKeys=e.loadedKeys),r}}]),t}(v.Component);Bn.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var n=e.dropPosition,t=e.dropLevelOffset,o=e.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(n){case-1:r.top=0,r.left=-t*o;break;case 1:r.bottom=0,r.left=-t*o;break;case 0:r.bottom=0,r.left=o}return v.createElement("div",{style:r})},allowDrop:function(){return!0},expandAction:!1},Bn.TreeNode=Pn.Z;var qn=Bn,Gn=v.createContext(null);function Xn(e){return!e||e.disabled||e.disableCheckbox||!1===e.checkable}function Jn(e){return null==e}var Qn={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},et=function(e,n){var t=E(),o=t.prefixCls,r=t.multiple,l=t.searchValue,c=t.toggleOpen,s=t.open,d=t.notFoundContent,f=v.useContext(Gn),p=f.virtual,h=f.listHeight,g=f.listItemHeight,y=f.treeData,b=f.fieldNames,w=f.onSelect,C=f.dropdownMatchSelectWidth,Z=f.treeExpandAction,k=v.useContext(Sn),S=k.checkable,N=k.checkedKeys,x=k.halfCheckedKeys,K=k.treeExpandedKeys,D=k.treeDefaultExpandAll,M=k.treeDefaultExpandedKeys,I=k.onTreeExpand,P=k.treeIcon,R=k.showTreeIcon,T=k.switcherIcon,L=k.treeLine,O=k.treeNodeFilterProp,A=k.loadData,H=k.treeLoadedKeys,V=k.treeMotion,F=k.onTreeLoad,_=k.keyEntities,W=v.useRef(),U=(0,He.Z)((function(){return y}),[s,y],(function(e,n){return n[0]&&e[1]!==n[1]})),z=v.useState(null),j=(0,u.Z)(z,2),Y=j[0],$=j[1],B=_[Y],q=v.useMemo((function(){return S?{checked:N,halfChecked:x}:null}),[S,N,x]);v.useEffect((function(){var e;s&&!r&&N.length&&(null===(e=W.current)||void 0===e||e.scrollTo({key:N[0]}),$(N[0]))}),[s]);var G=String(l).toLowerCase(),X=v.useState(M),J=(0,u.Z)(X,2),Q=J[0],ee=J[1],ne=v.useState(null),te=(0,u.Z)(ne,2),oe=te[0],re=te[1],ae=v.useMemo((function(){return K?(0,i.Z)(K):l?oe:Q}),[Q,oe,K,l]);v.useEffect((function(){l&&re(function(e,n){var t=[];return function e(o){o.forEach((function(o){var r=o[n.children];r&&(t.push(o[n.value]),e(r))}))}(e),t}(y,b))}),[l]);var ie=function(e){e.preventDefault()},le=function(e,n){var t=n.node;S&&Xn(t)||(w(t.key,{selected:!N.includes(t.key)}),r||c(!1))};if(v.useImperativeHandle(n,(function(){var e;return{scrollTo:null===(e=W.current)||void 0===e?void 0:e.scrollTo,onKeyDown:function(e){var n;switch(e.which){case m.Z.UP:case m.Z.DOWN:case m.Z.LEFT:case m.Z.RIGHT:null===(n=W.current)||void 0===n||n.onKeyDown(e);break;case m.Z.ENTER:if(B){var t=(null==B?void 0:B.node)||{},o=t.selectable,r=t.value;!1!==o&&le(0,{node:{key:Y},selected:!N.includes(r)})}break;case m.Z.ESC:c(!1)}},onKeyUp:function(){}}})),0===U.length)return v.createElement("div",{role:"listbox",className:"".concat(o,"-empty"),onMouseDown:ie},d);var ue={fieldNames:b};return H&&(ue.loadedKeys=H),ae&&(ue.expandedKeys=ae),v.createElement("div",{onMouseDown:ie},B&&s&&v.createElement("span",{style:Qn,"aria-live":"assertive"},B.node.value),v.createElement(qn,(0,a.Z)({ref:W,focusable:!1,prefixCls:"".concat(o,"-tree"),treeData:U,height:h,itemHeight:g,virtual:!1!==p&&!1!==C,multiple:r,icon:P,showIcon:R,switcherIcon:T,showLine:L,loadData:l?null:A,motion:V,activeKey:Y,checkable:S,checkStrictly:!0,checkedKeys:q,selectedKeys:S?[]:N,defaultExpandAll:D},ue,{onActiveChange:$,onSelect:le,onCheck:le,onExpand:function(e){ee(e),re(e),I&&I(e)},onLoad:F,filterTreeNode:function(e){return!!G&&String(e[O]).toLowerCase().includes(G)},expandAction:Z})))},nt=v.forwardRef(et);nt.displayName="OptionList";var tt=nt,ot="SHOW_ALL",rt="SHOW_PARENT",at="SHOW_CHILD";function it(e,n,t,o){var r=new Set(e);return n===at?e.filter((function(e){var n=t[e];return!(n&&n.children&&n.children.some((function(e){var n=e.node;return r.has(n[o.value])}))&&n.children.every((function(e){var n=e.node;return Xn(n)||r.has(n[o.value])})))})):n===rt?e.filter((function(e){var n=t[e],o=n?n.parent:null;return!(o&&!Xn(o.node)&&r.has(o.key))})):e}var lt=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion"];var ut=v.forwardRef((function(e,n){var t=e.id,o=e.prefixCls,r=void 0===o?"rc-tree-select":o,h=e.value,m=e.defaultValue,g=e.onChange,y=e.onSelect,b=e.onDeselect,E=e.searchValue,w=e.inputValue,C=e.onSearch,Z=e.autoClearSearchValue,k=void 0===Z||Z,S=e.filterTreeNode,N=e.treeNodeFilterProp,x=void 0===N?"value":N,K=e.showCheckedStrategy,D=e.treeNodeLabelProp,M=e.multiple,I=e.treeCheckable,P=e.treeCheckStrictly,R=e.labelInValue,T=e.fieldNames,L=e.treeDataSimpleMode,O=e.treeData,A=e.children,H=e.loadData,V=e.treeLoadedKeys,F=e.onTreeLoad,_=e.treeDefaultExpandAll,W=e.treeExpandedKeys,U=e.treeDefaultExpandedKeys,z=e.onTreeExpand,j=e.treeExpandAction,Y=e.virtual,$=e.listHeight,B=void 0===$?200:$,q=e.listItemHeight,G=void 0===q?20:q,X=e.onDropdownVisibleChange,J=e.dropdownMatchSelectWidth,Q=void 0===J||J,ee=e.treeLine,ne=e.treeIcon,te=e.showTreeIcon,oe=e.switcherIcon,re=e.treeMotion,ae=(0,c.Z)(e,lt),ie=Ne(t),le=I&&!P,ue=I||P,ce=P||R,se=ue||M,de=(0,f.Z)(m,{value:h}),fe=(0,u.Z)(de,2),pe=fe[0],ve=fe[1],he=v.useMemo((function(){return I?K||at:ot}),[K,I]);var me,ge,ye=v.useMemo((function(){return function(e){var n=e||{},t=n.label,o=n.value||"value";return{_title:t?[t]:["title","label"],value:o,key:o,children:n.children||"children"}}(T)}),[JSON.stringify(T)]),be=(0,f.Z)("",{value:void 0!==E?E:w,postState:function(e){return e||""}}),Ee=(0,u.Z)(be,2),Ce=Ee[0],Ze=Ee[1],ke=kn(O,A,L),Se=function(e,n){return v.useMemo((function(){return(0,yn.I8)(e,{fieldNames:n,initWrapper:function(e){return(0,l.Z)((0,l.Z)({},e),{},{valueEntities:new Map})},processEntity:function(e,t){var o=e.node[n.value];t.valueEntities.set(o,e)}})}),[e,n])}(ke,ye),xe=Se.keyEntities,Ke=Se.valueEntities,De=v.useCallback((function(e){var n=[],t=[];return e.forEach((function(e){Ke.has(e)?t.push(e):n.push(e)})),{missingRawValues:n,existRawValues:t}}),[Ke]),Me=function(e,n,t){var o=t.treeNodeFilterProp,r=t.filterTreeNode,a=t.fieldNames.children;return v.useMemo((function(){if(!n||!1===r)return e;var t;if("function"==typeof r)t=r;else{var i=n.toUpperCase();t=function(e,n){var t=n[o];return String(t).toUpperCase().includes(i)}}return function e(o){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o.reduce((function(o,i){var u=i[a],c=r||t(n,Cn(i)),s=e(u||[],c);return(c||s.length)&&o.push((0,l.Z)((0,l.Z)({},i),{},(0,d.Z)({isLeaf:void 0},a,s))),o}),[])}(e)}),[e,n,a,o,r])}(ke,Ce,{fieldNames:ye,treeNodeFilterProp:x,filterTreeNode:S}),Ie=v.useCallback((function(e){if(e){if(D)return e[D];for(var n=ye._title,t=0;t<n.length;t+=1){var o=e[n[t]];if(void 0!==o)return o}}}),[ye,D]),Pe=v.useCallback((function(e){var n=function(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}(e);return n.map((function(e){return function(e){return!e||"object"!==(0,s.Z)(e)}(e)?{value:e}:e}))}),[]),Re=v.useCallback((function(e){return Pe(e).map((function(e){var n,t,o=e.label,r=e.value,a=e.halfChecked,i=Ke.get(r);if(i)o=null!==(t=o)&&void 0!==t?t:Ie(i.node),n=i.node.disabled;else if(void 0===o){o=Pe(pe).find((function(e){return e.value===r})).label}return{label:o,value:r,halfChecked:a,disabled:n}}))}),[Ke,Ie,Pe,pe]),Te=v.useMemo((function(){return Pe(pe)}),[Pe,pe]),Le=v.useMemo((function(){var e=[],n=[];return Te.forEach((function(t){t.halfChecked?n.push(t):e.push(t)})),[e,n]}),[Te]),Oe=(0,u.Z)(Le,2),Ae=Oe[0],He=Oe[1],Ve=v.useMemo((function(){return Ae.map((function(e){return e.value}))}),[Ae]),Fe=function(e,n,t,o){return v.useMemo((function(){var r=e.map((function(e){return e.value})),a=n.map((function(e){return e.value})),l=r.filter((function(e){return!o[e]}));if(t){var u=(0,gn.S)(r,!0,o);r=u.checkedKeys,a=u.halfCheckedKeys}return[Array.from(new Set([].concat((0,i.Z)(l),(0,i.Z)(r)))),a]}),[e,n,t,o])}(Ae,He,le,xe),_e=(0,u.Z)(Fe,2),We=_e[0],Ue=_e[1],ze=v.useMemo((function(){var e=it(We,he,xe,ye).map((function(e){var n,t,o;return null!==(n=null===(t=xe[e])||void 0===t||null===(o=t.node)||void 0===o?void 0:o[ye.value])&&void 0!==n?n:e})).map((function(e){var n=Ae.find((function(n){return n.value===e}));return{value:e,label:null==n?void 0:n.label}})),n=Re(e),t=n[0];return!se&&t&&Jn(t.value)&&Jn(t.label)?[]:n.map((function(e){var n;return(0,l.Z)((0,l.Z)({},e),{},{label:null!==(n=e.label)&&void 0!==n?n:e.value})}))}),[ye,se,We,Ae,Re,he,xe]),je=(me=ze,ge=v.useRef({valueLabels:new Map}),v.useMemo((function(){var e=ge.current.valueLabels,n=new Map,t=me.map((function(t){var o,r=t.value,a=null!==(o=t.label)&&void 0!==o?o:e.get(r);return n.set(r,a),(0,l.Z)((0,l.Z)({},t),{},{label:a})}));return ge.current.valueLabels=n,[t]}),[me])),Ye=(0,u.Z)(je,1)[0],$e=Zn((function(e,n,t){var o=Re(e);if(ve(o),k&&Ze(""),g){var r=e;if(le){var a=it(e,he,xe,ye);r=a.map((function(e){var n=Ke.get(e);return n?n.node[ye.value]:e}))}var l=n||{triggerValue:void 0,selected:void 0},u=l.triggerValue,c=l.selected,s=r;if(P){var d=He.filter((function(e){return!r.includes(e.value)}));s=[].concat((0,i.Z)(s),(0,i.Z)(d))}var f=Re(s),h={preValue:Ae,triggerValue:u},m=!0;(P||"selection"===t&&!c)&&(m=!1),function(e,n,t,o,r,a){var i=null,l=null;function u(){l||(l=[],function e(o){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0",u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return o.map((function(o,c){var s="".concat(r,"-").concat(c),d=o[a.value],f=t.includes(d),p=e(o[a.children]||[],s,f),h=v.createElement(bn,o,p.map((function(e){return e.node})));if(n===d&&(i=h),f){var m={pos:s,node:h,children:p};return u||l.push(m),m}return null})).filter((function(e){return e}))}(o),l.sort((function(e,n){var o=e.node.props.value,r=n.node.props.value;return t.indexOf(o)-t.indexOf(r)})))}Object.defineProperty(e,"triggerNode",{get:function(){return(0,p.ZP)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),u(),i}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return(0,p.ZP)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),u(),r?l:l.map((function(e){return e.node}))}})}(h,u,e,ke,m,ye),ue?h.checked=c:h.selected=c;var y=ce?f:f.map((function(e){return e.value}));g(se?y:y[0],ce?null:f.map((function(e){return e.label})),h)}})),Be=v.useCallback((function(e,n){var t,o=n.selected,r=n.source,a=xe[e],l=null==a?void 0:a.node,u=null!==(t=null==l?void 0:l[ye.value])&&void 0!==t?t:e;if(se){var c=o?[].concat((0,i.Z)(Ve),[u]):We.filter((function(e){return e!==u}));if(le){var s,d=De(c),f=d.missingRawValues,p=d.existRawValues.map((function(e){return Ke.get(e).key}));if(o)s=(0,gn.S)(p,!0,xe).checkedKeys;else s=(0,gn.S)(p,{checked:!1,halfCheckedKeys:Ue},xe).checkedKeys;c=[].concat((0,i.Z)(f),(0,i.Z)(s.map((function(e){return xe[e].node[ye.value]}))))}$e(c,{selected:o,triggerValue:u},r||"option")}else $e([u],{selected:!0,triggerValue:u},"option");o||!se?null==y||y(u,Cn(l)):null==b||b(u,Cn(l))}),[De,Ke,xe,ye,se,Ve,$e,le,y,b,We,Ue]),qe=v.useCallback((function(e){if(X){var n={};Object.defineProperty(n,"documentClickClose",{get:function(){return(0,p.ZP)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),X(e,n)}}),[X]),Ge=Zn((function(e,n){var t=e.map((function(e){return e.value}));"clear"!==n.type?n.values.length&&Be(n.values[0].value,{selected:!1,source:"selection"}):$e(t,{},"selection")})),Xe=v.useMemo((function(){return{virtual:Y,dropdownMatchSelectWidth:Q,listHeight:B,listItemHeight:G,treeData:Me,fieldNames:ye,onSelect:Be,treeExpandAction:j}}),[Y,Q,B,G,Me,ye,Be,j]),Je=v.useMemo((function(){return{checkable:ue,loadData:H,treeLoadedKeys:V,onTreeLoad:F,checkedKeys:We,halfCheckedKeys:Ue,treeDefaultExpandAll:_,treeExpandedKeys:W,treeDefaultExpandedKeys:U,onTreeExpand:z,treeIcon:ne,treeMotion:re,showTreeIcon:te,switcherIcon:oe,treeLine:ee,treeNodeFilterProp:x,keyEntities:xe}}),[ue,H,V,F,We,Ue,_,W,U,z,ne,re,te,oe,ee,x,xe]);return v.createElement(Gn.Provider,{value:Xe},v.createElement(Sn.Provider,{value:Je},v.createElement(we,(0,a.Z)({ref:n},ae,{id:ie,prefixCls:r,mode:se?"multiple":void 0,displayValues:Ye,onDisplayValuesChange:Ge,searchValue:Ce,onSearch:function(e){Ze(e),null==C||C(e)},OptionList:tt,emptyOptions:!ke.length,onDropdownVisibleChange:qe,dropdownMatchSelectWidth:Q}))))}));var ct=ut;ct.TreeNode=bn,ct.SHOW_ALL=ot,ct.SHOW_PARENT=rt,ct.SHOW_CHILD=at;var st=ct,dt=t(10366),ft=t(8745),pt=t(33603),vt=t(9708),ht=t(53124),mt=t(98866),gt=t(88258),yt=t(98675),bt=t(65223),Et=t(87244),wt=t(13458),Ct=t(78642),Zt=t(46163),kt=t(4173),St=t(7349),Nt=t(63185),xt=t(45503),Kt=t(67968),Dt=t(32157);const Mt=e=>{const{componentCls:n,treePrefixCls:t,colorBgElevated:o}=e,r=`.${t}`;return[{[`${n}-dropdown`]:[{padding:`${e.paddingXS}px ${e.paddingXS/2}px`},(0,Dt.Yk)(t,(0,xt.TS)(e,{colorBgContainer:o})),{[r]:{borderRadius:0,[`${r}-list-holder-inner`]:{alignItems:"stretch",[`${r}-treenode`]:{[`${r}-node-content-wrapper`]:{flex:"auto"}}}}},(0,Nt.C2)(`${t}-checkbox`,e),{"&-rtl":{direction:"rtl",[`${r}-switcher${r}-switcher_close`]:{[`${r}-switcher-icon svg`]:{transform:"rotate(90deg)"}}}}]}]};var It=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t};const Pt=(e,n)=>{var t,{prefixCls:o,size:a,disabled:i,bordered:l=!0,className:u,rootClassName:c,treeCheckable:s,multiple:d,listHeight:f=256,listItemHeight:p=26,placement:h,notFoundContent:m,switcherIcon:g,treeLine:y,getPopupContainer:b,popupClassName:E,dropdownClassName:w,treeIcon:C=!1,transitionName:Z,choiceTransitionName:k="",status:S,treeExpandAction:N,builtinPlacements:x,dropdownMatchSelectWidth:K,popupMatchSelectWidth:D,allowClear:M}=e,I=It(e,["prefixCls","size","disabled","bordered","className","rootClassName","treeCheckable","multiple","listHeight","listItemHeight","placement","notFoundContent","switcherIcon","treeLine","getPopupContainer","popupClassName","dropdownClassName","treeIcon","transitionName","choiceTransitionName","status","treeExpandAction","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","allowClear"]);const{getPopupContainer:P,getPrefixCls:R,renderEmpty:T,direction:L,virtual:O,popupMatchSelectWidth:A,popupOverflow:H}=v.useContext(ht.E_);const V=R(),F=R("select",o),_=R("select-tree",o),W=R("tree-select",o),{compactSize:U,compactItemClassnames:z}=(0,kt.ri)(F,L),[j,Y]=(0,Et.Z)(F),[$]=function(e,n){return(0,Kt.Z)("TreeSelect",(e=>{const t=(0,xt.TS)(e,{treePrefixCls:n});return[Mt(t)]}),Dt.TM)(e)}(W,_),B=r()(E||w,`${W}-dropdown`,{[`${W}-dropdown-rtl`]:"rtl"===L},c,Y),q=!(!s&&!d),G=(0,Ct.Z)(I.suffixIcon,I.showArrow),X=null!==(t=null!=D?D:K)&&void 0!==t?t:A,{status:J,hasFeedback:Q,isFormItemInput:ee,feedbackIcon:ne}=v.useContext(bt.aM),te=(0,vt.F)(J,S),{suffixIcon:oe,removeIcon:re,clearIcon:ae}=(0,Zt.Z)(Object.assign(Object.assign({},I),{multiple:q,showSuffixIcon:G,hasFeedback:Q,feedbackIcon:ne,prefixCls:F,componentName:"TreeSelect"})),ie=!0===M?{clearIcon:ae}:M;let le;le=void 0!==m?m:(null==T?void 0:T("Select"))||v.createElement(gt.Z,{componentName:"Select"});const ue=(0,dt.Z)(I,["suffixIcon","itemIcon","removeIcon","clearIcon","switcherIcon"]),ce=v.useMemo((()=>void 0!==h?h:"rtl"===L?"bottomRight":"bottomLeft"),[h,L]),se=(0,wt.Z)(x,H),de=(0,yt.Z)((e=>{var n;return null!==(n=null!=a?a:U)&&void 0!==n?n:e})),fe=v.useContext(mt.Z),pe=null!=i?i:fe,ve=r()(!o&&W,{[`${F}-lg`]:"large"===de,[`${F}-sm`]:"small"===de,[`${F}-rtl`]:"rtl"===L,[`${F}-borderless`]:!l,[`${F}-in-form-item`]:ee},(0,vt.Z)(F,te,Q),z,u,c,Y);return j($(v.createElement(st,Object.assign({virtual:O,disabled:pe},ue,{dropdownMatchSelectWidth:X,builtinPlacements:se,ref:n,prefixCls:F,className:ve,listHeight:f,listItemHeight:p,treeCheckable:s?v.createElement("span",{className:`${F}-tree-checkbox-inner`}):s,treeLine:!!y,suffixIcon:oe,multiple:q,placement:ce,removeIcon:re,allowClear:ie,switcherIcon:e=>v.createElement(St.Z,{prefixCls:_,switcherIcon:g,treeNodeProps:e,showLine:y}),showTreeIcon:C,notFoundContent:le,getPopupContainer:b||P,treeMotion:null,dropdownClassName:B,choiceTransitionName:(0,pt.m)(V,"",k),transitionName:(0,pt.m)(V,"slide-up",Z),treeExpandAction:N}))))},Rt=v.forwardRef(Pt),Tt=(0,ft.Z)(Rt);Rt.TreeNode=bn,Rt.SHOW_ALL=ot,Rt.SHOW_PARENT=rt,Rt.SHOW_CHILD=at,Rt._InternalPanelDoNotUseOrYouWillBeFired=Tt;var Lt=Rt}}]); |