"use strict";(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[5429],{75429:(t,e,n)=>{n.r(e),n.d(e,{default:()=>m,defaultProps:()=>O,makeAsyncSelect:()=>v});var o=n(45987),s=n(87462),i=n(15671),a=n(43144),u=n(60136),p=n(82963),l=n(61120),r=n(99196),d=n.n(r),c=(n(1103),n(91850),n(48533)),f=n(6224),h=(n(25657),n(66680),n(61085));var O={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},v=function(t){var e,n;return n=e=function(e){(0,u.Z)(h,e);var n,r,f=(n=h,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,l.Z)(n);if(r){var o=(0,l.Z)(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return(0,p.Z)(this,t)});function h(t){var e;return(0,i.Z)(this,h),(e=f.call(this)).select=void 0,e.lastRequest=void 0,e.mounted=!1,e.optionsCache={},e.handleInputChange=function(t,n){var o=e.props,s=o.cacheOptions,i=o.onInputChange,a=(0,c.G)(t,n,i);if(!a)return delete e.lastRequest,void e.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});if(s&&e.optionsCache[a])e.setState({inputValue:a,loadedInputValue:a,loadedOptions:e.optionsCache[a],isLoading:!1,passEmptyOptions:!1});else{var u=e.lastRequest={};e.setState({inputValue:a,isLoading:!0,passEmptyOptions:!e.state.loadedInputValue},(function(){e.loadOptions(a,(function(t){e.mounted&&(t&&(e.optionsCache[a]=t),u===e.lastRequest&&(delete e.lastRequest,e.setState({isLoading:!1,loadedInputValue:a,loadedOptions:t||[],passEmptyOptions:!1})))}))}))}return a},e.state={defaultOptions:Array.isArray(t.defaultOptions)?t.defaultOptions:void 0,inputValue:void 0!==t.inputValue?t.inputValue:"",isLoading:!0===t.defaultOptions,loadedOptions:[],passEmptyOptions:!1},e}return(0,a.Z)(h,[{key:"componentDidMount",value:function(){var t=this;this.mounted=!0;var e=this.props.defaultOptions,n=this.state.inputValue;!0===e&&this.loadOptions(n,(function(e){if(t.mounted){var n=!!t.lastRequest;t.setState({defaultOptions:e||[],isLoading:n})}}))}},{key:"UNSAFE_componentWillReceiveProps",value:function(t){t.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={}),t.defaultOptions!==this.props.defaultOptions&&this.setState({defaultOptions:Array.isArray(t.defaultOptions)?t.defaultOptions:void 0})}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"loadOptions",value:function(t,e){var n=this.props.loadOptions;if(!n)return e();var o=n(t,e);o&&"function"==typeof o.then&&o.then(e,(function(){return e()}))}},{key:"render",value:function(){var e=this,n=this.props,i=(n.loadOptions,n.isLoading),a=(0,o.Z)(n,["loadOptions","isLoading"]),u=this.state,p=u.defaultOptions,l=u.inputValue,r=u.isLoading,c=u.loadedInputValue,f=u.loadedOptions,h=u.passEmptyOptions?[]:l&&c?f:p||[];return d().createElement(t,(0,s.Z)({},a,{ref:function(t){e.select=t},options:h,isLoading:r||i,onInputChange:this.handleInputChange}))}}]),h}(r.Component),e.defaultProps=O,n},y=(0,h.m)(f.S);const m=v(y)}}]);