this.primereact=this.primereact||{},this.primereact.multiselect=function(e,t,n,i,r,o,l,s,p,a,u){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=c(t),d=c(a);function f(){return f=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw o}}}}function J(e,t){if(e){if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(e,t):void 0}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0}},{key:"isAllSelected",value:function(){var e=this;if(this.props.onSelectAll)return this.props.selectAll;var t=this.getVisibleOptions();if(n.ObjectUtils.isEmpty(t))return!1;if(t=t.filter((function(t){return!e.isOptionDisabled(t)})),this.props.optionGroupLabel){var i,r=_(t);try{for(r.s();!(i=r.n()).done;){var o,l=this.getOptionGroupChildren(i.value).filter((function(t){return!e.isOptionDisabled(t)})),s=_(l);try{for(s.s();!(o=s.n()).done;){if(!this.isSelected(o.value))return!1}}catch(e){s.e(e)}finally{s.f()}}}catch(e){r.e(e)}finally{r.f()}}else{var p,a=_(t);try{for(a.s();!(p=a.n()).done;){if(!this.isSelected(p.value))return!1}}catch(e){a.e(e)}finally{a.f()}}return!0}},{key:"getOptionLabel",value:function(e){return this.props.optionLabel?n.ObjectUtils.resolveFieldData(e,this.props.optionLabel):e&&void 0!==e.label?e.label:e}},{key:"getOptionValue",value:function(e){if(this.props.optionValue){var t=n.ObjectUtils.resolveFieldData(e,this.props.optionValue);return null!==t?t:e}return e&&void 0!==e.value?e.value:e}},{key:"getOptionRenderKey",value:function(e){return this.props.dataKey?n.ObjectUtils.resolveFieldData(e,this.props.dataKey):this.getOptionLabel(e)}},{key:"getOptionGroupRenderKey",value:function(e){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupLabel",value:function(e){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupLabel)}},{key:"getOptionGroupChildren",value:function(e){return n.ObjectUtils.resolveFieldData(e,this.props.optionGroupChildren)}},{key:"isOptionDisabled",value:function(e){return this.props.optionDisabled?n.ObjectUtils.isFunction(this.props.optionDisabled)?this.props.optionDisabled(e):n.ObjectUtils.resolveFieldData(e,this.props.optionDisabled):!(!e||void 0===e.disabled)&&e.disabled}},{key:"isOptionValueUsed",value:function(e){return this.props.optionValue||e&&void 0!==e.value}},{key:"getVisibleOptions",value:function(){if(this.hasFilter()){var e=this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale),t=this.props.filterBy?this.props.filterBy.split(","):[this.props.optionLabel||"label"];if(this.props.optionGroupLabel){var n,i=[],r=_(this.props.options);try{for(r.s();!(n=r.n()).done;){var o=n.value,l=a.FilterService.filter(this.getOptionGroupChildren(o),t,e,this.props.filterMatchMode,this.props.filterLocale);l&&l.length&&i.push(z(z({},o),{items:l}))}}catch(e){r.e(e)}finally{r.f()}return i}return a.FilterService.filter(this.props.options,t,e,this.props.filterMatchMode,this.props.filterLocale)}return this.props.options}},{key:"isEmpty",value:function(){return!this.props.value||0===this.props.value.length}},{key:"equalityKey",value:function(){return this.props.optionValue?null:this.props.dataKey}},{key:"checkValidity",value:function(){return this.inputRef.current.checkValidity()}},{key:"removeChip",value:function(e,t){var i=this.equalityKey(),r=this.props.value.filter((function(e){return!n.ObjectUtils.equals(e,t,i)}));this.updateModel(e,r)}},{key:"getSelectedItemsLabel",value:function(){var e=/{(.*?)}/;return e.test(this.props.selectedItemsLabel)?this.props.selectedItemsLabel.replace(this.props.selectedItemsLabel.match(e)[0],this.props.value.length+""):this.props.selectedItemsLabel}},{key:"getLabel",value:function(){var e;if(!this.isEmpty()&&!this.props.fixedPlaceholder){if(this.props.maxSelectedLabels&&this.props.value.length>this.props.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(var t=0;tthis.props.maxSelectedLabels?this.getSelectedItemsLabel():this.props.value.map((function(t,i){var r=n.ObjectUtils.getJSXElement(e.props.selectedItemTemplate,t);return h.default.createElement(h.default.Fragment,{key:i},r)})):"chip"!==this.props.display||this.isEmpty()?this.getLabel():this.props.value.slice(0,this.props.maxSelectedLabels||this.props.value.length).map((function(t){var i=e.getLabelByValue(t);return h.default.createElement("div",{className:"p-multiselect-token",key:i},h.default.createElement("span",{className:"p-multiselect-token-label"},i),!e.props.disabled&&n.IconUtils.getJSXIcon(e.props.removeIcon,{className:"p-multiselect-token-icon",onClick:function(n){return e.removeChip(n,t)}},{props:e.props}))}))}},{key:"renderTooltip",value:function(){this.tooltip=i.tip({target:this.container,content:this.props.tooltip,options:this.props.tooltipOptions})}},{key:"renderClearIcon",value:function(){var e=this;return this.isEmpty()||!this.props.showClear||this.props.disabled?null:h.default.createElement("i",{className:"p-multiselect-clear-icon pi pi-times",onClick:function(t){return e.updateModel(t,null)}})}},{key:"renderLabel",value:function(){var e=this,t=this.isEmpty(),i=this.getLabelContent(),r=n.classNames("p-multiselect-label",{"p-placeholder":t&&this.props.placeholder,"p-multiselect-label-empty":t&&!this.props.placeholder&&!this.props.selectedItemTemplate,"p-multiselect-items-label":!t&&"chip"!==this.props.display&&this.props.value.length>this.props.maxSelectedLabels});return h.default.createElement("div",{ref:function(t){return e.label=t},className:"p-multiselect-label-container"},h.default.createElement("div",{className:r},i||this.props.placeholder||"empty"))}},{key:"render",value:function(){var e=this,t=n.classNames("p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.props.display,"p-disabled":this.props.disabled,"p-multiselect-clearable":this.props.showClear&&!this.props.disabled,"p-focus":this.state.focused,"p-inputwrapper-filled":this.props.value&&this.props.value.length>0,"p-inputwrapper-focus":this.state.focused||this.state.overlayVisible},this.props.className),i=this.getVisibleOptions(),r=this.renderLabel(),o=this.renderClearIcon();return h.default.createElement("div",{id:this.props.id,className:t,onClick:this.onClick,ref:function(t){return e.container=t},style:this.props.style},h.default.createElement("div",{className:"p-hidden-accessible"},h.default.createElement("input",{ref:this.inputRef,id:this.props.inputId,name:this.props.name,readOnly:!0,type:"text",onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,role:"listbox","aria-haspopup":"listbox","aria-labelledby":this.props.ariaLabelledBy,"aria-expanded":this.state.overlayVisible,disabled:this.props.disabled,tabIndex:this.props.tabIndex})),r,o,h.default.createElement("div",{className:"p-multiselect-trigger"},n.IconUtils.getJSXIcon(this.props.dropdownIcon,{className:"p-multiselect-trigger-icon p-c"},{props:this.props})),h.default.createElement(M,f({ref:this.overlayRef,visibleOptions:i},this.props,{onClick:this.onPanelClick,onOverlayHide:this.hide,filterValue:this.state.filter,hasFilter:this.hasFilter,onFilterInputChange:this.onFilterInputChange,onCloseClick:this.onCloseClick,onSelectAll:this.onSelectAll,getOptionLabel:this.getOptionLabel,getOptionRenderKey:this.getOptionRenderKey,isOptionDisabled:this.isOptionDisabled,getOptionGroupChildren:this.getOptionGroupChildren,getOptionGroupLabel:this.getOptionGroupLabel,getOptionGroupRenderKey:this.getOptionGroupRenderKey,isSelected:this.isSelected,getSelectedOptionIndex:this.getSelectedOptionIndex,isAllSelected:this.isAllSelected,onOptionSelect:this.onOptionSelect,allowOptionSelect:this.allowOptionSelect,onOptionKeyDown:this.onOptionKeyDown,in:this.state.overlayVisible,onEnter:this.onOverlayEnter,onEntered:this.onOverlayEntered,onExit:this.onOverlayExit,onExited:this.onOverlayExited})))}}]),s}(t.Component);return R(W,"defaultProps",{id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,display:"comma",style:null,className:null,panelClassName:null,panelStyle:null,virtualScrollerOptions:null,scrollHeight:"200px",placeholder:null,fixedPlaceholder:!1,disabled:!1,showClear:!1,filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyFilterMessage:null,resetFilterOnHide:!1,tabIndex:0,dataKey:null,inputId:null,appendTo:null,tooltip:null,tooltipOptions:null,maxSelectedLabels:null,selectionLimit:null,selectedItemsLabel:"{0} items selected",ariaLabelledBy:null,itemTemplate:null,selectedItemTemplate:null,panelHeaderTemplate:null,panelFooterTemplate:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",removeIcon:"pi pi-times-circle",showSelectAll:!0,selectAll:!1,onChange:null,onFocus:null,onBlur:null,onShow:null,onHide:null,onFilter:null,onSelectAll:null}),e.MultiSelect=W,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.tooltip,primereact.csstransition,primereact.portal,primereact.inputtext,primereact.ripple,primereact.virtualscroller,primereact.api,primereact.overlayservice);