!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("@blueprintjs/icons"),require("classnames"),require("react")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","@blueprintjs/icons","classnames","react"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("@blueprintjs/icons"),require("classnames"),require("react")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Select=t(e.Blueprint.Core,e.Blueprint.Icons,e.classNames,e.React))}(self,(function(e,t,n,r){return function(){"use strict";var o={762:function(t){t.exports=e},634:function(e){e.exports=t},905:function(e){e.exports=n},359:function(e){e.exports=r}},i={};function l(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,l),n.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return function(){l.r(u),l.d(u,{Classes:function(){return e},MultiSelect:function(){return $},MultiSelect2:function(){return $},Omnibar:function(){return le},QueryList:function(){return N},Select:function(){return he},Select2:function(){return he},Suggest:function(){return Ce},Suggest2:function(){return Ce},executeItemsEqual:function(){return d},getActiveItem:function(){return m},getCreateNewItem:function(){return v},isCreateNewItem:function(){return y},renderFilteredItems:function(){return f}});var e={};l.r(e),l.d(e,{MULTISELECT:function(){return r},MULTISELECT_POPOVER:function(){return o},MULTISELECT_TAG_INPUT_INPUT:function(){return i},OMNIBAR:function(){return s},OMNIBAR_OVERLAY:function(){return a},SELECT_POPOVER:function(){return p},SUGGEST_POPOVER:function(){return c}});var t=l(762),n=t.Classes.getClassNamespace(),r="".concat(n,"-multi-select"),o="".concat(r,"-popover"),i="".concat(r,"-tag-input-input"),s="".concat(n,"-omnibar"),a="".concat(s,"-overlay"),p="".concat(n,"-select-popover"),c="".concat(n,"-suggest-popover");function f(e,t,n){if(0===e.query.length&&void 0!==n)return n;var r=e.filteredItems.map(e.renderItem).filter((function(e){return null!=e}));return r.length>0?r:t}function d(e,n,r){return void 0===e||null==n||null==r?n===r:t.Utils.isFunction(e)?e(n,r):n[e]===r[e]}function v(){return{__blueprintCreateNewItemBrand:"blueprint-create-new-item"}}function y(e){if(null==e)return!1;var t=Object.keys(e);return 1===t.length&&"__blueprintCreateNewItemBrand"===t[0]&&"blueprint-create-new-item"===e.__blueprintCreateNewItemBrand}function m(e){return null==e||y(e)?null:e}var h=l(905),b=l.n(h),O=l(359),P=l(634);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function I(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){j(e,t,n[t])}))}return e}function E(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function C(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function A(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?I(e):t;var n}function T(e,t){return T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},T(e,t)}function k(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=S(e);if(t){var o=S(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return A(this,n)}}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}(l,e);var n,r,o,i=D(l);function l(e){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),j(I(n=i.call(this,e)),"itemsParentRef",void 0),j(I(n),"itemRefs",new Map),j(I(n),"refHandlers",{itemsParent:function(e){return n.itemsParentRef=e}}),j(I(n),"shouldCheckActiveItemInViewport",!1),j(I(n),"expectedNextActiveItem",null),j(I(n),"isEnterKeyPressed",!1),j(I(n),"renderItemList",(function(e){var r=n.props,o=r.initialContent,i=r.noResults,l=e.renderCreateItem(),u=f(e,null!=l?null:i,o);if(null==u&&null==l)return null;var s=n.isCreateItemFirst();return O.createElement(t.Menu,E(R({role:"listbox"},e.menuProps),{ulRef:e.itemsParentRef}),s&&l,u,!s&&l)})),j(I(n),"renderItem",(function(e,t){if(!0!==n.props.disabled){var r=n.state,o=r.activeItem,i=r.query,l=r.filteredItems,u={active:d(n.props.itemsEqual,m(o),e),disabled:q(e,t,n.props.itemDisabled),matchesPredicate:l.indexOf(e)>=0};return n.props.itemRenderer(e,{handleClick:function(t){return n.handleItemSelect(e,t)},handleFocus:function(){return n.setActiveItem(e)},index:t,modifiers:u,query:i,ref:function(e){e?n.itemRefs.set(t,e):n.itemRefs.delete(t)}})}return null})),j(I(n),"renderCreateItemMenuItem",(function(){if(n.isCreateItemRendered(n.state.createNewItem)){var e=n.state,t=e.activeItem,r=e.query.trim(),o=y(t);return n.props.createNewItemRenderer(r,o,(function(e){n.handleItemCreate(r,e)}))}return null})),j(I(n),"handleItemCreate",(function(e,t){var r,o,i=null===(r=(o=n.props).createNewItemFromQuery)||void 0===r?void 0:r.call(o,e);if(null!=i){var l=Array.isArray(i)?i:[i],u=!0,s=!1,a=void 0;try{for(var p,c=l[Symbol.iterator]();!(u=(p=c.next()).done);u=!0){var f,d,v=p.value;null===(f=(d=n.props).onItemSelect)||void 0===f||f.call(d,v,t)}}catch(e){s=!0,a=e}finally{try{u||null==c.return||c.return()}finally{if(s)throw a}}n.maybeResetQuery()}})),j(I(n),"handleItemSelect",(function(e,t){var r,o;n.setActiveItem(e),null===(r=(o=n.props).onItemSelect)||void 0===r||r.call(o,e,t),n.maybeResetQuery()})),j(I(n),"handlePaste",(function(e){var t,r=n.props,o=r.createNewItemFromQuery,i=r.onItemsPaste,l=[],u=[],s=!0,a=!1,p=void 0;try{for(var c,f=e[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value,v=K(d,n.props);if(void 0!==v)t=v,u.push(v);else if(n.canCreateItems()){var y=null==o?void 0:o(d);if(void 0!==y){var m,h=Array.isArray(y)?y:[y];(m=u).push.apply(m,k(h))}}else l.push(d)}}catch(e){a=!0,p=e}finally{try{s||null==f.return||f.return()}finally{if(a)throw p}}n.setQuery(l.join(", "),!1),void 0!==t&&n.setActiveItem(t),null==i||i(u)})),j(I(n),"handleKeyDown",(function(e){var t,r,o=e.key;if("ArrowUp"===o||"ArrowDown"===o){e.preventDefault();var i=n.getNextActiveItem("ArrowUp"===o?-1:1);null!=i&&n.setActiveItem(i)}else"Enter"===o&&(n.isEnterKeyPressed=!0);null===(t=(r=n.props).onKeyDown)||void 0===t||t.call(r,e)})),j(I(n),"handleKeyUp",(function(e){var t=n.props.onKeyUp,r=n.state.activeItem;"Enter"===e.key&&n.isEnterKeyPressed&&(e.preventDefault(),null==r||y(r)?n.handleItemCreate(n.state.query,e):n.handleItemSelect(r,e),n.isEnterKeyPressed=!1),null==t||t(e)})),j(I(n),"handleInputQueryChange",(function(e){var t,r,o=null==e?"":e.target.value;n.setQuery(o),null===(t=(r=n.props).onQueryChange)||void 0===t||t.call(r,o,e)}));var o,u=e.query,s=void 0===u?"":u,a=null===(r=e.createNewItemFromQuery)||void 0===r?void 0:r.call(e,s),p=L(s,e);return n.state={activeItem:void 0!==e.activeItem?e.activeItem:null!==(o=e.initialActiveItem)&&void 0!==o?o:_(p,e.itemDisabled),createNewItem:a,filteredItems:p,query:s},n}return n=l,r=[{key:"render",value:function(){var e=this.props,t=e.className,n=e.items,r=e.renderer,o=e.itemListRenderer,i=void 0===o?this.renderItemList:o,l=e.menuProps,u=this.state,s=(u.createNewItem,C(u,["createNewItem"]));return r(E(R({},s),{className:t,handleItemSelect:this.handleItemSelect,handleKeyDown:this.handleKeyDown,handleKeyUp:this.handleKeyUp,handlePaste:this.handlePaste,handleQueryChange:this.handleInputQueryChange,itemList:i(E(R({},s),{items:n,itemsParentRef:this.refHandlers.itemsParent,menuProps:l,renderCreateItem:this.renderCreateItemMenuItem,renderItem:this.renderItem}))}))}},{key:"componentDidUpdate",value:function(e){var n=this;void 0!==this.props.activeItem&&this.props.activeItem!==this.state.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:this.props.activeItem})),null!=this.props.query&&this.props.query!==e.query?this.setQuery(this.props.query,this.props.resetOnQuery,this.props):t.Utils.shallowCompareKeys(this.props,e,{include:["items","itemListPredicate","itemPredicate"]})||this.setQuery(this.state.query),this.shouldCheckActiveItemInViewport&&(this.requestAnimationFrame((function(){return n.scrollActiveItemIntoView()})),this.shouldCheckActiveItemInViewport=!1)}},{key:"scrollActiveItemIntoView",value:function(){var e=!1!==this.props.scrollToActiveItem,t=!d(this.props.itemsEqual,m(this.expectedNextActiveItem),m(this.props.activeItem));if(this.expectedNextActiveItem=null,e||!t){var n=this.getActiveElement();if(null!=this.itemsParentRef&&null!=n){var r=n.offsetTop,o=n.offsetHeight,i=this.itemsParentRef,l=i.offsetTop,u=i.scrollTop,s=i.clientHeight,a=this.getItemsParentPadding(),p=a.paddingTop,c=r+o+a.paddingBottom-l,f=r-p-l;c>=u+s?this.itemsParentRef.scrollTop=c+o-s:f<=u&&(this.itemsParentRef.scrollTop=f-o)}}}},{key:"setQuery",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.resetOnQuery,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props,o=r.createNewItemFromQuery;this.shouldCheckActiveItemInViewport=!0,e!==this.state.query&&(null===(t=r.onQueryChange)||void 0===t||t.call(r,e));var i=e.trim(),l=L(i,r),u=null!=o&&""!==i?o(i):void 0;this.setState({createNewItem:u,filteredItems:l,query:e});var s=this.getActiveIndex(l);(n||s<0||q(m(this.state.activeItem),s,r.itemDisabled))&&(this.isCreateItemRendered(u)&&this.isCreateItemFirst()?this.setActiveItem({__blueprintCreateNewItemBrand:"blueprint-create-new-item"}):this.setActiveItem(_(l,r.itemDisabled)))}},{key:"setActiveItem",value:function(e){var t,n,r,o;this.expectedNextActiveItem=e,void 0===this.props.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:e})),y(e)?null===(t=(n=this.props).onActiveItemChange)||void 0===t||t.call(n,null,!0):null===(r=(o=this.props).onActiveItemChange)||void 0===r||r.call(o,e,!1)}},{key:"getActiveElement",value:function(){var e=this.state.activeItem;if(null!=this.itemsParentRef){if(y(e)){var t=this.isCreateItemFirst()?0:this.state.filteredItems.length;return this.itemsParentRef.children.item(t)}var n,r=this.getActiveIndex();return null!==(n=this.itemRefs.get(r))&&void 0!==n?n:this.itemsParentRef.children.item(r)}}},{key:"getActiveIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.filteredItems,t=this.state.activeItem;if(null==t||y(t))return-1;for(var n=0;n<e.length;++n)if(d(this.props.itemsEqual,e[n],t))return n;return-1}},{key:"getItemsParentPadding",value:function(){var e=getComputedStyle(this.itemsParentRef),t=e.paddingTop;return{paddingBottom:x(e.paddingBottom),paddingTop:x(t)}}},{key:"getNextActiveItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getActiveIndex();return this.isCreateItemRendered(this.state.createNewItem)&&(0===t&&-1===e||t===this.state.filteredItems.length-1&&1===e)?{__blueprintCreateNewItemBrand:"blueprint-create-new-item"}:_(this.state.filteredItems,this.props.itemDisabled,e,t)}},{key:"isCreateItemRendered",value:function(e){return this.canCreateItems()&&""!==this.state.query&&!this.wouldCreatedItemMatchSomeExistingItem(e)}},{key:"isCreateItemFirst",value:function(){return"first"===this.props.createNewItemPosition}},{key:"canCreateItems",value:function(){return null!=this.props.createNewItemFromQuery&&null!=this.props.createNewItemRenderer}},{key:"wouldCreatedItemMatchSomeExistingItem",value:function(e){var t=this;return this.state.filteredItems.some((function(n){return(Array.isArray(e)?e:[e]).some((function(e){return d(t.props.itemsEqual,n,e)}))}))}},{key:"maybeResetQuery",value:function(){this.props.resetOnSelect&&this.setQuery("",!0)}}],o=[{key:"ofType",value:function(){return l}}],r&&w(n.prototype,r),o&&w(n,o),l}(t.AbstractComponent);function x(e){return null==e?0:parseInt(e.slice(0,-2),10)}function K(e,n){var r=n.items,o=n.itemPredicate;if(t.Utils.isFunction(o))for(var i=0;i<r.length;i++){var l=r[i];if(o(e,l,i,!0))return l}}function L(e,n){var r=n.items,o=n.itemPredicate,i=n.itemListPredicate;return t.Utils.isFunction(i)?i(e,r):t.Utils.isFunction(o)?r.filter((function(t,n){return o(e,t,n)})):r}function q(e,n,r){return null!=r&&null!=e&&(t.Utils.isFunction(r)?r(e,n):!!e[r])}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1;if(0===e.length)return null;var o,i,l,u=r,s=e.length-1;do{if(l=s,!q(e[u=(o=u+n)<(i=0)?l:o>l?i:o],u,t))return e[u]}while(u!==r&&-1!==r);return null}function U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},B(e)}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){F(e,t,n[t])}))}return e}function M(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function V(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function X(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?U(e):t;var n}function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function Y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var o=B(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return X(this,n)}}j(N,"displayName","".concat(t.DISPLAYNAME_PREFIX,".QueryList")),j(N,"defaultProps",{disabled:!1,resetOnQuery:!0});var $=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(a,e);var n,l,u,s=Y(a);function a(){var e,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),F(U(e=s.apply(this,arguments)),"listboxId",t.Utils.uniqueId("listbox")),F(U(e),"state",{isOpen:e.props.popoverProps&&e.props.popoverProps.isOpen||!1}),F(U(e),"input",null),F(U(e),"queryList",null),F(U(e),"refHandlers",{input:(0,t.refHandler)(U(e),"input",null===(n=e.props.tagInputProps)||void 0===n?void 0:n.inputRef),popover:O.createRef(),queryList:function(t){return e.queryList=t}}),F(U(e),"renderQueryList",(function(n){var r=e.props,i=r.disabled,l=r.popoverContentProps,u=void 0===l?{}:l,s=r.popoverProps,a=void 0===s?{}:s,p=n.handleKeyDown,c=n.handleKeyUp,f=void 0===e.props.popoverRef?e.refHandlers.popover:(0,t.mergeRefs)(e.refHandlers.popover,e.props.popoverRef);return O.createElement(t.Popover,M(H({autoFocus:!1,canEscapeKeyClose:!0,disabled:i,enforceFocus:!1,isOpen:e.state.isOpen,placement:a.position||a.placement?void 0:"bottom-start"},a),{className:b()(n.className,a.className),content:O.createElement("div",M(H({},u),{onKeyDown:p,onKeyUp:c}),n.itemList),interactionKind:"click",onInteraction:e.handlePopoverInteraction,onOpened:e.handlePopoverOpened,popoverClassName:b()(o,a.popoverClassName),popupKind:t.PopupKind.LISTBOX,ref:f,renderTarget:e.getPopoverTargetRenderer(n,e.state.isOpen)}))})),F(U(e),"getPopoverTargetRenderer",(function(n,o){return function(l){l.isOpen;var u,s=l.ref,a=V(l,["isOpen","ref"]),p=e.props,c=p.disabled,f=p.fill,d=p.onClear,v=p.placeholder,y=p.popoverProps,m=void 0===y?{}:y,h=p.popoverTargetProps,g=void 0===h?{}:h,I=p.selectedItems,w=p.tagInputProps,j=void 0===w?{}:w,S=n.handleKeyDown,R=n.handleKeyUp,E=M(H({},j.inputProps),{className:b()(null===(u=j.inputProps)||void 0===u?void 0:u.className,i)}),C=void 0!==d&&I.length>0?O.createElement(t.Button,{"aria-label":"Clear selected items",disabled:c,icon:O.createElement(P.Cross,null),minimal:!0,onClick:e.handleClearButtonClick,title:"Clear selected items"}):void 0,A=m.targetTagName,T=void 0===A?"div":A;return O.createElement(T,M(H({"aria-autocomplete":"list","aria-controls":e.listboxId},g,a),{"aria-disabled":c,"aria-expanded":o,className:b()(a.className,g.className,F({},t.Classes.FILL,f)),onKeyDown:e.getTagInputKeyDownHandler(S),onKeyUp:e.getTagInputKeyUpHandler(R),ref:s,role:"combobox"}),O.createElement(t.TagInput,M(H({placeholder:v,rightElement:C},j),{className:b()(r,j.className),disabled:c,fill:f,inputRef:e.refHandlers.input,inputProps:E,inputValue:n.query,onAdd:e.getTagInputAddHandler(n),onInputChange:n.handleQueryChange,onRemove:e.handleTagRemove,values:I.map(e.props.tagRenderer)})))}})),F(U(e),"handleItemSelect",(function(t,n){var r,o,i;null!=e.input&&e.input.focus(),null===(r=(o=e.props).onItemSelect)||void 0===r||r.call(o,t,n),null===(i=e.refHandlers.popover.current)||void 0===i||i.reposition()})),F(U(e),"handleQueryChange",(function(t,n){var r,o;e.setState({isOpen:t.length>0||!e.props.openOnKeyDown}),null===(r=(o=e.props).onQueryChange)||void 0===r||r.call(o,t,n)})),F(U(e),"handlePopoverInteraction",(function(n,r){return e.requestAnimationFrame((function(){var o,i,l=e.input===t.Utils.getActiveElement(e.input);null==e.input||l?e.props.openOnKeyDown||e.setState({isOpen:!0}):e.setState({isOpen:!1}),null===(i=e.props.popoverProps)||void 0===i||null===(o=i.onInteraction)||void 0===o||o.call(i,n,r)}))})),F(U(e),"handlePopoverOpened",(function(t){var n,r;null!=e.queryList&&e.queryList.scrollActiveItemIntoView(),null===(r=e.props.popoverProps)||void 0===r||null===(n=r.onOpened)||void 0===n||n.call(r,t)})),F(U(e),"handleTagRemove",(function(t,n){var r,o,i=e.props,l=i.selectedItems,u=i.onRemove,s=i.tagInputProps;null==u||u(l[n],n),null==s||null===(r=s.onRemove)||void 0===r||r.call(s,t,n),null===(o=e.refHandlers.popover.current)||void 0===o||o.reposition()})),F(U(e),"getTagInputAddHandler",(function(e){return function(t,n){"paste"===n&&e.handlePaste(t)}})),F(U(e),"getTagInputKeyDownHandler",(function(n){return function(r){var o,i;"Escape"===r.key||"Tab"===r.key?(null!=e.input&&e.input.blur(),e.setState({isOpen:!1})):"Backspace"!==r.key&&"ArrowLeft"!==r.key&&"ArrowRight"!==r.key&&e.setState({isOpen:!0});var l=null!=r.target.closest(".".concat(t.Classes.TAG_REMOVE));e.state.isOpen&&!l&&(null==n||n(r)),null===(i=e.props.popoverTargetProps)||void 0===i||null===(o=i.onKeyDown)||void 0===o||o.call(i,r)}})),F(U(e),"getTagInputKeyUpHandler",(function(t){return function(n){var r,o,l=n.target.classList.contains(i);e.state.isOpen&&l&&(null==t||t(n)),null===(o=e.props.popoverTargetProps)||void 0===o||null===(r=o.onKeyDown)||void 0===r||r.call(o,n)}})),F(U(e),"handleClearButtonClick",(function(){var t,n,r;null===(t=(n=e.props).onClear)||void 0===t||t.call(n),null===(r=e.refHandlers.popover.current)||void 0===r||r.reposition()})),e}return n=a,u=[{key:"ofType",value:function(){return a}}],(l=[{key:"componentDidUpdate",value:function(e){var n,r,o,i,l;(null===(n=e.tagInputProps)||void 0===n?void 0:n.inputRef)!==(null===(r=this.props.tagInputProps)||void 0===r?void 0:r.inputRef)&&((0,t.setRef)(null===(o=e.tagInputProps)||void 0===o?void 0:o.inputRef,null),this.refHandlers.input=(0,t.refHandler)(this,"input",null===(i=this.props.tagInputProps)||void 0===i?void 0:i.inputRef),(0,t.setRef)(null===(l=this.props.tagInputProps)||void 0===l?void 0:l.inputRef,this.input)),(void 0===e.onClear&&void 0!==this.props.onClear||void 0!==e.onClear&&void 0===this.props.onClear)&&this.forceUpdate()}},{key:"render",value:function(){var e=this.props,t=e.menuProps,n=(e.openOnKeyDown,e.popoverProps,e.tagInputProps,V(e,["menuProps","openOnKeyDown","popoverProps","tagInputProps"]));return O.createElement(N,M(H({},n),{menuProps:M(H({"aria-label":"selectable options"},t),{"aria-multiselectable":!0,id:this.listboxId}),onItemSelect:this.handleItemSelect,onQueryChange:this.handleQueryChange,ref:this.refHandlers.queryList,renderer:this.renderQueryList}))}}])&&Q(n.prototype,l),u&&Q(n,u),a}(t.AbstractPureComponent);function z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){W(e,t,n[t])}))}return e}function te(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function ne(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function re(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?z(e):t;var n}function oe(e,t){return oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},oe(e,t)}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Z(e);if(t){var o=Z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return re(this,n)}}F($,"displayName","".concat(t.DISPLAYNAME_PREFIX,".MultiSelect")),F($,"defaultProps",{disabled:!1,fill:!1,placeholder:"Search..."});var le=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(l,e);var n,r,o,i=ie(l);function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),W(z(e=i.apply(this,arguments)),"renderQueryList",(function(n){var r=e.props,o=r.inputProps,i=void 0===o?{}:o,l=r.isOpen,u=r.overlayProps,p=void 0===u?{}:u,c=n.handleKeyDown,f=n.handleKeyUp,d=l?{onKeyDown:c,onKeyUp:f}:{};return O.createElement(t.Overlay2,te(ee({hasBackdrop:!0},p),{isOpen:l,className:b()(a,p.className),onClose:e.handleOverlayClose}),O.createElement("div",ee({className:b()(s,n.className)},d),O.createElement(t.InputGroup,te(ee({autoFocus:!0,large:!0,leftIcon:O.createElement(P.Search,null),placeholder:"Search..."},i),{onChange:n.handleQueryChange,value:n.query})),n.itemList))})),W(z(e),"handleOverlayClose",(function(t){var n,r,o,i;null===(r=e.props.overlayProps)||void 0===r||null===(n=r.onClose)||void 0===n||n.call(r,t),null===(o=(i=e.props).onClose)||void 0===o||o.call(i,t)})),e}return n=l,o=[{key:"ofType",value:function(){return l}}],(r=[{key:"render",value:function(){var e=this.props,t=(e.isOpen,e.inputProps,e.overlayProps,ne(e,["isOpen","inputProps","overlayProps"])),n="initialContent"in this.props?this.props.initialContent:null;return O.createElement(N,te(ee({},t),{menuProps:{role:"menu"},initialContent:n,renderer:this.renderQueryList}))}}])&&J(n.prototype,r),o&&J(n,o),l}(O.PureComponent);function ue(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pe(e)}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ae(e,t,n[t])}))}return e}function fe(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function de(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ve(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?ue(e):t;var n}function ye(e,t){return ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ye(e,t)}function me(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pe(e);if(t){var o=pe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ve(this,n)}}W(le,"displayName","".concat(t.DISPLAYNAME_PREFIX,".Omnibar"));var he=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ye(e,t)}(l,e);var n,r,o,i=me(l);function l(){var e,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),ae(ue(e=i.apply(this,arguments)),"state",{isOpen:!1}),ae(ue(e),"inputElement",null),ae(ue(e),"queryList",null),ae(ue(e),"previousFocusedElement",void 0),ae(ue(e),"handleInputRef",(0,t.refHandler)(ue(e),"inputElement",null===(n=e.props.inputProps)||void 0===n?void 0:n.inputRef)),ae(ue(e),"handleQueryListRef",(function(t){return e.queryList=t})),ae(ue(e),"listboxId",t.Utils.uniqueId("listbox")),ae(ue(e),"renderQueryList",(function(n){var r=e.props,o=r.filterable,i=void 0===o||o,l=r.disabled,u=void 0!==l&&l,s=r.inputProps,a=void 0===s?{}:s,c=r.popoverContentProps,f=void 0===c?{}:c,d=r.popoverProps,v=void 0===d?{}:d,y=r.popoverRef,m=O.createElement(t.InputGroup,fe(ce({"aria-autocomplete":"list",leftIcon:O.createElement(P.Search,null),placeholder:"Filter...",rightElement:e.maybeRenderClearButton(n.query)},a),{inputRef:e.handleInputRef,onChange:n.handleQueryChange,value:n.query})),h=n.handleKeyDown,g=n.handleKeyUp;return O.createElement(t.Popover,fe(ce({autoFocus:!1,enforceFocus:!1,isOpen:e.state.isOpen,disabled:u,placement:v.position||v.placement?void 0:"bottom-start"},v),{className:b()(n.className,v.className),content:O.createElement("div",fe(ce({},f),{onKeyDown:h,onKeyUp:g}),i?m:void 0,n.itemList),onClosing:e.handlePopoverClosing,onInteraction:e.handlePopoverInteraction,onOpened:e.handlePopoverOpened,onOpening:e.handlePopoverOpening,popoverClassName:b()(p,v.popoverClassName),popupKind:t.PopupKind.LISTBOX,ref:y,renderTarget:e.getPopoverTargetRenderer(n,e.state.isOpen)}))})),ae(ue(e),"getPopoverTargetRenderer",(function(n,r){return function(o){o.isOpen;var i=o.ref,l=de(o,["isOpen","ref"]),u=e.props,s=u.disabled,a=u.popoverProps,p=void 0===a?{}:a,c=u.popoverTargetProps,f=n.handleKeyDown,d=n.handleKeyUp,v=p.targetTagName,y=void 0===v?"div":v;return O.createElement(y,fe(ce({"aria-controls":e.listboxId},c,l),{"aria-disabled":s,"aria-expanded":r,className:b()(l.className,null==c?void 0:c.className,ae({},t.Classes.FILL,e.props.fill)),onKeyDown:e.withPopoverTargetPropsHandler("keydown",r?f:e.handleTargetKeyDown),onKeyUp:e.withPopoverTargetPropsHandler("keyup",r?d:void 0),ref:i,role:"combobox"}),e.props.children)}})),ae(ue(e),"withPopoverTargetPropsHandler",(function(t,n){switch(t){case"keydown":return function(t){var r,o;null==n||n(t),null===(o=e.props.popoverTargetProps)||void 0===o||null===(r=o.onKeyDown)||void 0===r||r.call(o,t)};case"keyup":return function(t){var r,o;null==n||n(t),null===(o=e.props.popoverTargetProps)||void 0===o||null===(r=o.onKeyUp)||void 0===r||r.call(o,t)}}})),ae(ue(e),"handleTargetKeyDown",(function(n){"ArrowUp"===n.key||"ArrowDown"===n.key?(n.preventDefault(),e.setState({isOpen:!0})):t.Utils.isKeyboardClick(n)&&e.setState({isOpen:!0})})),ae(ue(e),"handleItemSelect",(function(n,r){var o,i,l=null==r?void 0:r.target,u=null==l?void 0:l.closest(".".concat(t.Classes.MENU_ITEM)),s=null==u?void 0:u.matches(".".concat(t.Classes.POPOVER_DISMISS)),a=null==s||s;e.setState({isOpen:!a}),null===(o=(i=e.props).onItemSelect)||void 0===o||o.call(i,n,r)})),ae(ue(e),"handlePopoverInteraction",(function(t,n){var r,o;e.setState({isOpen:t}),null===(o=e.props.popoverProps)||void 0===o||null===(r=o.onInteraction)||void 0===r||r.call(o,t,n)})),ae(ue(e),"handlePopoverOpening",(function(n){var r,o,i;e.previousFocusedElement=null!==(i=t.Utils.getActiveElement(e.inputElement))&&void 0!==i?i:void 0,e.props.resetOnClose&&e.resetQuery(),null===(o=e.props.popoverProps)||void 0===o||null===(r=o.onOpening)||void 0===r||r.call(o,n)})),ae(ue(e),"handlePopoverOpened",(function(t){var n,r;null!=e.queryList&&e.queryList.scrollActiveItemIntoView(),e.requestAnimationFrame((function(){var t,n=e.props.inputProps;!1!==(void 0===n?{}:n).autoFocus&&(null===(t=e.inputElement)||void 0===t||t.focus())})),null===(r=e.props.popoverProps)||void 0===r||null===(n=r.onOpened)||void 0===n||n.call(r,t)})),ae(ue(e),"handlePopoverClosing",(function(t){var n,r;e.requestAnimationFrame((function(){void 0!==e.previousFocusedElement&&(e.previousFocusedElement.focus(),e.previousFocusedElement=void 0)})),null===(r=e.props.popoverProps)||void 0===r||null===(n=r.onClosing)||void 0===n||n.call(r,t)})),ae(ue(e),"resetQuery",(function(){return e.queryList&&e.queryList.setQuery("",!0)})),e}return n=l,o=[{key:"ofType",value:function(){return l}}],(r=[{key:"render",value:function(){var e=this.props,t=(e.filterable,e.inputProps,e.menuProps),n=(e.popoverProps,de(e,["filterable","inputProps","menuProps","popoverProps"]));return O.createElement(N,fe(ce({},n),{menuProps:fe(ce({"aria-label":"selectable options"},t),{id:this.listboxId}),onItemSelect:this.handleItemSelect,ref:this.handleQueryListRef,renderer:this.renderQueryList}))}},{key:"componentDidUpdate",value:function(e,n){var r,o,i,l,u;(null===(r=e.inputProps)||void 0===r?void 0:r.inputRef)!==(null===(o=this.props.inputProps)||void 0===o?void 0:o.inputRef)&&((0,t.setRef)(null===(i=e.inputProps)||void 0===i?void 0:i.inputRef,null),this.handleInputRef=(0,t.refHandler)(this,"inputElement",null===(l=this.props.inputProps)||void 0===l?void 0:l.inputRef),(0,t.setRef)(null===(u=this.props.inputProps)||void 0===u?void 0:u.inputRef,this.inputElement)),this.state.isOpen&&!n.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()}},{key:"maybeRenderClearButton",value:function(e){return e.length>0?O.createElement(t.Button,{"aria-label":"Clear filter query",icon:O.createElement(P.Cross,null),minimal:!0,onClick:this.resetQuery,title:"Clear filter query"}):void 0}}])&&se(n.prototype,r),o&&se(n,o),l}(t.AbstractPureComponent);function be(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ge(e){return ge=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ge(e)}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pe(e,t,n[t])}))}return e}function we(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function je(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Se(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?be(e):t;var n}function Re(e,t){return Re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Re(e,t)}function Ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ge(e);if(t){var o=ge(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Se(this,n)}}ae(he,"displayName","".concat(t.DISPLAYNAME_PREFIX,".Select"));var Ce=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Re(e,t)}(l,e);var n,r,o,i=Ee(l);function l(){var e,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),Pe(be(e=i.apply(this,arguments)),"state",{isOpen:null!=e.props.popoverProps&&e.props.popoverProps.isOpen||!1,selectedItem:e.getInitialSelectedItem()}),Pe(be(e),"inputElement",null),Pe(be(e),"queryList",null),Pe(be(e),"handleInputRef",(0,t.refHandler)(be(e),"inputElement",null===(n=e.props.inputProps)||void 0===n?void 0:n.inputRef)),Pe(be(e),"handleQueryListRef",(function(t){return e.queryList=t})),Pe(be(e),"listboxId",t.Utils.uniqueId("listbox")),Pe(be(e),"renderQueryList",(function(n){var r=e.props,o=r.popoverContentProps,i=void 0===o?{}:o,l=r.popoverProps,u=void 0===l?{}:l,s=r.popoverRef,a=e.state.isOpen,p=n.handleKeyDown,f=n.handleKeyUp;return O.createElement(t.Popover,we(Ie({autoFocus:!1,enforceFocus:!1,isOpen:a,placement:u.position||u.placement?void 0:"bottom-start"},u),{className:b()(n.className,u.className),content:O.createElement("div",we(Ie({},i),{onKeyDown:p,onKeyUp:f}),n.itemList),interactionKind:"click",onInteraction:e.handlePopoverInteraction,onOpened:e.handlePopoverOpened,onOpening:e.handlePopoverOpening,popoverClassName:b()(c,u.popoverClassName),popupKind:t.PopupKind.LISTBOX,ref:s,renderTarget:e.getPopoverTargetRenderer(n,a)}))})),Pe(be(e),"getPopoverTargetRenderer",(function(n,r){return function(o){o.isOpen;var i=o.ref,l=je(o,["isOpen","ref"]),u=e.props,s=u.disabled,a=u.fill,p=u.inputProps,c=void 0===p?{}:p,f=u.inputValueRenderer,d=u.popoverProps,v=void 0===d?{}:d,y=u.resetOnClose,m=e.state.selectedItem,h=n.handleKeyDown,P=n.handleKeyUp,g=null==m?"":f(m),I=c.autoComplete,w=void 0===I?"off":I,j=c.placeholder,S=r&&g?g:void 0===j?"Search...":j,R=r?n.query:""===g?y?"":n.query:g;return O.createElement(t.InputGroup,we(Ie({"aria-controls":e.listboxId,autoComplete:w,disabled:s,tagName:v.targetTagName},l,c),{"aria-autocomplete":"list","aria-expanded":r,className:b()(l.className,c.className),fill:a,inputRef:(0,t.mergeRefs)(e.handleInputRef,i),onChange:n.handleQueryChange,onFocus:e.handleInputFocus,onKeyDown:e.getTargetKeyDownHandler(h),onKeyUp:e.getTargetKeyUpHandler(P),placeholder:S,role:"combobox",value:R}))}})),Pe(be(e),"selectText",(function(){e.requestAnimationFrame((function(){var t;null===(t=e.inputElement)||void 0===t||t.setSelectionRange(0,e.inputElement.value.length)}))})),Pe(be(e),"handleInputFocus",(function(t){var n,r;e.selectText(),e.props.openOnKeyDown||e.setState({isOpen:!0}),null===(r=e.props.inputProps)||void 0===r||null===(n=r.onFocus)||void 0===n||n.call(r,t)})),Pe(be(e),"handleItemSelect",(function(t,n){var r,o,i,l,u;e.props.closeOnSelect?(null===(l=e.inputElement)||void 0===l||l.blur(),i=!1):(null===(u=e.inputElement)||void 0===u||u.focus(),e.selectText(),i=!0);void 0===e.props.selectedItem?e.setState({isOpen:i,selectedItem:t}):e.setState({isOpen:i}),null===(r=(o=e.props).onItemSelect)||void 0===r||r.call(o,t,n)})),Pe(be(e),"handlePopoverInteraction",(function(n,r){return e.requestAnimationFrame((function(){var o,i,l=e.inputElement===t.Utils.getActiveElement(e.inputElement);null==e.inputElement||l||e.setState({isOpen:!1}),null===(i=e.props.popoverProps)||void 0===i||null===(o=i.onInteraction)||void 0===o||o.call(i,n,r)}))})),Pe(be(e),"handlePopoverOpening",(function(t){var n,r;e.props.resetOnClose&&e.queryList&&e.queryList.setQuery("",!0),null===(r=e.props.popoverProps)||void 0===r||null===(n=r.onOpening)||void 0===n||n.call(r,t)})),Pe(be(e),"handlePopoverOpened",(function(t){var n,r;null!=e.queryList&&e.queryList.scrollActiveItemIntoView(),null===(r=e.props.popoverProps)||void 0===r||null===(n=r.onOpened)||void 0===n||n.call(r,t)})),Pe(be(e),"getTargetKeyDownHandler",(function(t){return function(n){var r,o,i;"Escape"===n.key||"Tab"===n.key?(null===(i=e.inputElement)||void 0===i||i.blur(),e.setState({isOpen:!1})):e.props.openOnKeyDown&&"Backspace"!==n.key&&"ArrowLeft"!==n.key&&"ArrowRight"!==n.key&&e.setState({isOpen:!0});e.state.isOpen&&(null==t||t(n)),null===(o=e.props.inputProps)||void 0===o||null===(r=o.onKeyDown)||void 0===r||r.call(o,n)}})),Pe(be(e),"getTargetKeyUpHandler",(function(t){return function(n){var r,o;e.state.isOpen&&(null==t||t(n)),null===(o=e.props.inputProps)||void 0===o||null===(r=o.onKeyUp)||void 0===r||r.call(o,n)}})),e}return n=l,o=[{key:"ofType",value:function(){return l}}],(r=[{key:"render",value:function(){var e,t=this.props,n=(t.disabled,t.inputProps,t.menuProps),r=(t.popoverProps,je(t,["disabled","inputProps","menuProps","popoverProps"]));return O.createElement(N,we(Ie({},r),{menuProps:we(Ie({"aria-label":"selectable options"},n),{id:this.listboxId}),initialActiveItem:null!==(e=this.props.selectedItem)&&void 0!==e?e:void 0,onItemSelect:this.handleItemSelect,ref:this.handleQueryListRef,renderer:this.renderQueryList}))}},{key:"componentDidUpdate",value:function(e,n){var r,o,i,l,u,s=this;if((null===(r=e.inputProps)||void 0===r?void 0:r.inputRef)!==(null===(o=this.props.inputProps)||void 0===o?void 0:o.inputRef)&&((0,t.setRef)(null===(i=e.inputProps)||void 0===i?void 0:i.inputRef,null),this.handleInputRef=(0,t.refHandler)(this,"inputElement",null===(l=this.props.inputProps)||void 0===l?void 0:l.inputRef),(0,t.setRef)(null===(u=this.props.inputProps)||void 0===u?void 0:u.inputRef,this.inputElement)),void 0!==this.props.selectedItem&&this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem}),!1===this.state.isOpen&&!0===n.isOpen){var a,p,c=null!==(p=null===(a=this.props.popoverProps)||void 0===a?void 0:a.transitionDuration)&&void 0!==p?p:t.Popover.defaultProps.transitionDuration;setTimeout((function(){return s.maybeResetActiveItemToSelectedItem()}),c)}this.state.isOpen&&!n.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()}},{key:"getInitialSelectedItem",value:function(){return void 0!==this.props.selectedItem?this.props.selectedItem:void 0!==this.props.defaultSelectedItem?this.props.defaultSelectedItem:null}},{key:"maybeResetActiveItemToSelectedItem",value:function(){var e,t=void 0===this.props.activeItem&&null!==this.state.selectedItem&&!this.props.resetOnSelect;null!==this.queryList&&t&&this.queryList.setActiveItem(null!==(e=this.props.selectedItem)&&void 0!==e?e:this.state.selectedItem)}}])&&Oe(n.prototype,r),o&&Oe(n,o),l}(t.AbstractPureComponent);Pe(Ce,"displayName","".concat(t.DISPLAYNAME_PREFIX,".Suggest")),Pe(Ce,"defaultProps",{closeOnSelect:!0,fill:!1,openOnKeyDown:!1,resetOnClose:!1})}(),u}()}));