@syncfusion/ej2-dropdowns 28.2.3 → 28.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * filename: ej2-dropdowns.min.js
3
- * version : 28.2.3
3
+ * version : 28.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionLists"),require("SyncfusionNotifications"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionNavigations")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionLists","SyncfusionNotifications","SyncfusionPopups","SyncfusionInputs","SyncfusionButtons","SyncfusionNavigations"],t):"object"==typeof exports?exports.SyncfusionDropdowns=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionLists"),require("SyncfusionNotifications"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionNavigations")):e.SyncfusionDropdowns=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionLists,e.SyncfusionNotifications,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionButtons,e.SyncfusionNavigations)}(self,((e,t,i,s,l,n,a,o)=>(()=>{"use strict";var r={766:t=>{t.exports=e},741:e=>{e.exports=a},74:e=>{e.exports=t},323:e=>{e.exports=n},90:e=>{e.exports=i},215:e=>{e.exports=o},344:e=>{e.exports=s},197:e=>{e.exports=l}},h={};function u(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return r[e](i,i.exports,u),i.exports}u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return(()=>{u.r(p),u.d(p,{AutoComplete:()=>Ne,CheckBoxSelection:()=>yt,ComboBox:()=>Ae,DropDownBase:()=>D,DropDownList:()=>P,DropDownTree:()=>Ee,FieldSettings:()=>O,Fields:()=>be,ListBox:()=>xt,Mention:()=>At,MultiSelect:()=>ht,Search:()=>o,SelectionSettings:()=>St,ToolbarSettings:()=>Et,TreeSettings:()=>Se,VirtualScroll:()=>S,createFloatLabel:()=>Pe,dropDownBaseClasses:()=>A,dropDownListClasses:()=>T,encodePlaceholder:()=>Me,escapeCharRegExp:()=>r,floatLabelBlur:()=>qe,floatLabelFocus:()=>We,highlightSearch:()=>d,incrementalSearch:()=>a,removeFloating:()=>He,resetIncrementalSearchValues:()=>h,revertHighlightSearch:()=>m,setPlaceHolder:()=>Fe,updateFloatLabelState:()=>Ue});var e="",t="",i="",s=[],l="e-active",n="";function a(a,o,r,h,u,p,d,c,m){var f;if(p&&""!==e?e===t&&(i=String.fromCharCode(a)):""!==i?(e=i+String.fromCharCode(a),i=""):e+=String.fromCharCode(a),c?(setTimeout((function(){i=""}),700),setTimeout((function(){e=""}),3e3)):setTimeout((function(){e=""}),1e3),e=h?e.toLowerCase():e,n!==u||t!==e||m){var v=o,g=e.length,y=void 0;S=r=r?r+1:0;s=[];do{S===v.length&&(S=-1),y=v[f=-1===S?0:S],(h?y.innerText.toLowerCase():y.innerText).substr(0,g)===e&&s.push(v[f]),S++}while(S!==r);if(t=e,n=u,c){for(var C=!1,b=0;b<s.length;b++)if(d&&s[b].textContent.toLowerCase()===d.toLowerCase()){f=b,C=!0;break}return d&&C&&(f+=1),s[f]?s[f]:s[0]}return s[0]}for(var S=0;S<s.length;S++){if(s[S].classList.contains(l)){f=S;break}if(d&&s[S].textContent.toLowerCase()===d.toLowerCase()){f=S;break}}return f+=1,c?s[f]&&s.length-1!==f?s[f]:s[s.length]:s[f]?s[f]:s[0]}function o(e,t,i,s,l,n,a,o){var h=t;s=null==s||s;var u={item:null,index:null};if(e&&e.length){var p=e.length,d=s?e.toLocaleLowerCase():e;d=r(d);for(var c=function(e,r){var h,c=r[e];if(t&&l){var m=c,f=n.text.split(".");l.filter((function(e){Array.prototype.slice.call(f).forEach((function(t){("object"===a&&!e.isHeader&&-1!==m.textContent.toString().indexOf(e[t])&&m.getAttribute("data-value")===e[n.value].toString()||"string"===a&&-1!==m.textContent.toString().indexOf(e))&&(h="object"===a?e[t]:e)}))}))}var v=l&&h?(s?h.toString().toLocaleLowerCase():h).replace(/^\s+|\s+$/g,""):(s?c.textContent.toLocaleLowerCase():c.textContent).replace(/^\s+|\s+$/g,"");if(o&&v&&d&&(v=v.normalize("NFD").replace(/[\u0300-\u036f]/g,""),d=d.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===i&&v===d||"StartsWith"===i&&v.substr(0,p)===d||"EndsWith"===i&&v.substr(v.length-d.length)===d||"Contains"===i&&new RegExp(d,"g").test(v))return u.item=c,u.index=e,{value:{item:c,index:e}}},m=0,f=h;m<f.length;m++){var v=c(m,f);if("object"==typeof v)return v.value}return u}return u}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function h(i){n===i&&(n="",t="",e="",s=[])}function d(e,t,i,s){if(/<[^>]*>/g.test(e.innerText)&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))),""!==t){var l=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c(e,new RegExp("StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")",l))}}function c(e,t){for(var i=0;e.childNodes&&i<e.childNodes.length;i++){if(3===e.childNodes[i].nodeType&&""!==e.childNodes[i].textContent.trim()){var s=e.childNodes[i].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[i].nodeValue="",e.innerHTML=e.innerHTML.trim()+s;break}c(e.childNodes[i],t)}}function m(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;i>=0;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}var f,v=u(766),g=u(74),y=function(){return y=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},y.apply(this,arguments)},C=function(e,t,i,s){return new(i||(i=Promise))((function(l,n){function a(e){try{r(s.next(e))}catch(e){n(e)}}function o(e){try{r(s.throw(e))}catch(e){n(e)}}function r(e){e.done?l(e.value):new i((function(t){t(e.value)})).then(a,o)}r((s=s.apply(e,t||[])).next())}))},b=function(e,t){var i,s,l,n,a={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(l=2&n[0]?s.return:n[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,n[1])).done)return l;switch(s=0,l&&(n=[2&n[0],l.value]),n[0]){case 0:case 1:l=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,s=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(l=a.trys,(l=l.length>0&&l[l.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!l||n[1]>l[0]&&n[1]<l[3])){a.label=n[1];break}if(6===n[0]&&a.label<l[1]){a.label=l[1],l=n;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(n);break}l[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],s=0}finally{i=l=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}},S=function(){function e(e){var t=this;this.sentinelInfo={up:{check:function(e,i){var s=e.top-t.containerElementRect.top;return i.entered=s>=0,s+t.parent.listItemHeight*t.parent.virtualItemCount/2>=0},axis:"Y"},down:{check:function(e,i){var s=e.bottom;return i.entered=e.bottom<=t.containerElementRect.bottom,s-t.parent.listItemHeight*t.parent.virtualItemCount/2<=t.parent.listItemHeight*t.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},e.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe((function(e){return t.scrollListener(e)}))},e.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),v.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new v.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),v.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},e.prototype.getModuleName=function(){return"VirtualScroll"},e.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},e.prototype.getPageQuery=function(e,t,i){return 0===i||this.parent.allowFiltering||"autocomplete"===this.component||(e=e.skip(t)),e},e.prototype.setGeneratedData=function(e,t){for(var i=0,s=this.parent.listData.length+this.parent.virtualItemStartIndex,l=this.parent.virtualItemStartIndex;l<s;l++){if(!this.parent.generatedDataObject[l]&&null!==t&&this.parent.listData.slice(i,i+1).length>0){var n=this.parent.listData.slice(i,i+1);n.length>0&&(this.parent.generatedDataObject[l]=n)}i++}},e.prototype.generateAndExecuteQueryAsync=function(e,t,i,s){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=!1);var l=this.parent.dataSource;if(!s)if((0,v.isNullOrUndefined)(this.parent.query))e=this.getPageQuery(e,t,i);else{var n=this.removeSkipAndTakeEvents(this.parent.query.clone());e=this.getPageQuery(n,t,i)}var a=this.parent.isCustomFilter;if("combobox"===this.component){var o=0;this.parent.dataSource instanceof g.DataManager?o=this.parent.dataSource.dataSource.json.length:this.parent.dataSource&&this.parent.dataSource.length>0&&(o=this.parent.dataSource.length),o>0&&(this.parent.isCustomFilter=o===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter)}this.parent.resetList(l,this.parent.fields,e),this.parent.isCustomFilter=a},e.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter((function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn})),e},e.prototype.setCurrentViewDataAsync=function(e){var t=[],i=!1,s=!0;(0,v.isNullOrUndefined)(this.component)&&(this.component=e.component);var l=this.parent.viewPortInfo.endIndex;if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()){if(this.parent.viewPortInfo.startIndex<this.parent.value.length){if(l=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex){if(this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount)(h=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h),a=(a=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof g.DataManager&&this.parent.appendUncheckList,s=!1;else(h=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h);s=!1}else if(0!==this.parent.viewPortInfo.startIndex){this.parent.updateVirtualReOrderList(!0),(h=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h),s=!1}if(0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length)a=(a=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof g.DataManager&&this.parent.appendUncheckList}else{var n=this.parent.list.querySelectorAll(".e-reorder")[0];this.parent.list.querySelector(".e-virtual-ddl-content")&&n&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(n);var a=this.parent.getForQuery(this.parent.value).clone(),o=this.parent.viewPortInfo.startIndex-this.parent.value.length>=0?this.parent.viewPortInfo.startIndex-this.parent.value.length:0;a=a.skip(o),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),s=!1}this.parent.totalItemsCount()}if(s)for(var r=this.parent.viewPortInfo.startIndex;r<l;r++){var h,u=r;if("multiselect"===this.component&&"CheckBox"===this.parent.mode)(h=this.parent.list.querySelector(".e-list-parent.e-reorder"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h);var p=this.parent.generatedDataObject[u];if("multiselect"===this.component&&this.parent.hideSelectedItem){if(p){var d=(0,v.getValue)(this.parent.fields.value,p[0]);if(this.parent.value&&null!==d&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.value.indexOf(d)<0){a=this.parent.getForQuery(this.parent.value).clone();a=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?a.skip(this.parent.totalItemCount-this.parent.itemCount):a.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),i=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&t.push(p[0])}if(u===l-1&&t.length!==this.parent.itemCount&&this.parent.hideSelectedItem){a=this.parent.value&&this.parent.value.length>0?this.parent.getForQuery(this.parent.value).clone():new g.Query;a=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?a.skip(this.parent.totalItemCount-this.parent.itemCount):a.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),i=!0}}else p&&t.push(p[0]);this.parent.setCurrentView=!1}if(!i&&s){"multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&t.splice(0,0,this.parent.virtualCustomData);var c=[];"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&this.parent.virtualCustomSelectData.length>0&&(c=t.concat(this.parent.virtualCustomSelectData),t=c),this.parent.renderItems(t,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode)}"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof g.DataManager)||this.parent.dataSource instanceof g.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;var m=this.parent.list.getElementsByClassName("e-virtual-ddl")[0];if(m)m.style=this.parent.GetVirtualTrackHeight();else if(!m&&this.parent.skeletonCount>0&&this.parent.popupWrapper){var f=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()});this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(f)}this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item");var y=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];if(y&&(y.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!(0,v.isNullOrUndefined)(this.parent.currentFocuedListElement)){var C=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value"));this.parent.addListFocus(C),this.parent.isScrollChanged=!1}},e.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var i=!1,s=0,l=0,n=this.parent.viewPortInfo.endIndex;if(!t&&0!==n)for(var a=this.parent.viewPortInfo.startIndex;a<=n;a++)a in this.parent.generatedDataObject||(i?l=a===n?a:a+1:(i=!0,s=l=a));!i||this.parent.totalItemCount===s&&this.parent.totalItemCount===l||(this.parent.virtualItemStartIndex=s,this.parent.virtualItemEndIndex=l,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,s,l),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),(!(this.parent.dataSource instanceof g.DataManager)||this.parent.dataSource instanceof g.DataManager&&!this.parent.isRequesting)&&this.setCurrentViewDataAsync()},e.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new g.Query,e)},e.prototype.virtualScrollRefreshAsync=function(){return C(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!(0,v.isNullOrUndefined)(this.parent.filterInput)&&!(0,v.isNullOrUndefined)(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,(this.parent.allowFiltering||"autocomplete"===this.component)&&((0,v.isNullOrUndefined)(this.parent.typedString)||"combobox"===this.component&&!(0,v.isNullOrUndefined)(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof g.DataManager)||this.parent.dataSource instanceof g.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof g.DataManager&&(!(this.parent.dataSource instanceof g.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}}))}))},e.prototype.scrollListener=function(e){var t=this;if(!this.parent.isPreventScrollAction&&!this.parent.isVirtualTrackHeight){this.parent.preventSetCurrentData=!1;var i=e.sentinel,s=this.parent.previousStartIndex;this.parent.viewPortInfo=this.getInfoFromView(e.direction,i,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===s||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=y({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout((function(){t.parent.pageCount=t.parent.getPageCount(),t.virtualScrollRefreshAsync().then((function(){t.parent.popupObj&&(t.parent.list=t.parent.popupObj.element.querySelector(".e-content")||(0,v.select)(".e-content"),t.parent.updateSelectionList(),t.parent.liCollections=t.parent.getItems()),t.parent.isKeyBoardAction=!1,t.parent.isVirtualScrolling=!1,t.parent.isPreventKeyAction=!1}))}),5)),this.parent.previousInfo=this.parent.viewPortInfo}},e.prototype.getInfoFromView=function(e,t,i,s){var l={direction:e,sentinelInfo:t,offsets:i,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},n=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,a=this.parent.listItemHeight,o=i.top/a,r=n/a,h=o+r,u=this.parent.virtualItemCount/4,p=this.parent.totalItemCount;if("down"===l.direction){var d=Math.round(h)-Math.round(u);if((0,v.isNullOrUndefined)(l.startIndex)||h>l.startIndex+Math.round(this.parent.virtualItemCount/2+u)&&l.endIndex!==p){l.startIndex=d>=0?Math.round(d):0,l.startIndex=l.startIndex>o?Math.floor(o):l.startIndex;var c=l.startIndex+this.parent.virtualItemCount;l.startIndex=c<h?Math.ceil(h)-this.parent.virtualItemCount:l.startIndex,l.endIndex=c<p?c:p,l.startIndex=c>=p?l.endIndex-this.parent.virtualItemCount>0?l.endIndex-this.parent.virtualItemCount:0:l.startIndex,l.currentPageNumber=Math.ceil(l.endIndex/this.parent.virtualItemCount)}}else if("up"===l.direction){if(l.startIndex&&l.endIndex||Math.ceil(o)>this.parent.previousStartIndex)if(o<Math.round((l.startIndex*a+u*a)/a)||Math.ceil(o)>this.parent.previousStartIndex){var m=u>r?u:r+r/4;c=Math.round(o+m);l.endIndex=c<p?c:p;d=l.endIndex-this.parent.virtualItemCount;l.startIndex=d>0?d:0,l.endIndex=d<0?this.parent.virtualItemCount:l.endIndex,l.currentPageNumber=Math.ceil(l.startIndex/this.parent.virtualItemCount)}}return s?this.parent.scrollPreStartIndex=l.startIndex:(this.parent.previousStartIndex=l.startIndex,this.parent.startIndex=l.startIndex,this.parent.previousEndIndex=l.endIndex),l},e.prototype.virtualScrollHandler=function(e){var t=this,i="chrome"===v.Browser.info.name?200:100,s=0,l=(0,v.debounce)(e,i),n=(0,v.debounce)(e,50);return function(e){var i=e.target.scrollTop,a=e.target.scrollLeft,o=s<i&&!t.parent.isUpwardScrolling?"down":"up";s=i;var r=t.sentinelInfo[o],h=t.parent.scrollPreStartIndex,u={top:i,left:a};t.parent.list&&t.parent.list.querySelectorAll(".e-virtual-list").length>0&&(t.getInfoFromView(o,r,u,!0),t.parent.scrollPreStartIndex===h||t.parent.isPreventScrollAction||(t.parent.isScrollActionTriggered=!0,t.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+i+"px)"));var p=l;"X"===r.axis&&(p=n),p({direction:o,sentinel:r,offset:{top:i,left:a},focusElement:document.activeElement})}},e.prototype.destroy=function(){this.removeEventListener()},e}(),E=u(90),x=u(344),I=(f=function(e,t){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},f(e,t)},function(e,t){function i(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),w=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),w([(0,v.Property)()],t.prototype,"text",void 0),w([(0,v.Property)()],t.prototype,"value",void 0),w([(0,v.Property)()],t.prototype,"iconCss",void 0),w([(0,v.Property)()],t.prototype,"groupBy",void 0),w([(0,v.Property)()],t.prototype,"htmlAttributes",void 0),w([(0,v.Property)()],t.prototype,"disabled",void 0),t}(v.ChildProperty),A={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},D=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isPreventChange=!1,s.isDynamicDataChange=!1,s.addedNewItem=!1,s.isAddNewItemTemplate=!1,s.isRequesting=!1,s.isVirtualizationEnabled=!1,s.isCustomDataUpdated=!1,s.isAllowFiltering=!1,s.virtualizedItemsCount=0,s.isCheckBoxSelection=!1,s.totalItemCount=0,s.dataCount=0,s.remoteDataCount=-1,s.isRemoteDataUpdated=!1,s.isIncrementalRequest=!1,s.itemCount=30,s.virtualListHeight=0,s.isVirtualScrolling=!1,s.isPreventScrollAction=!1,s.scrollPreStartIndex=0,s.isScrollActionTriggered=!1,s.previousStartIndex=0,s.isMouseScrollAction=!1,s.isKeyBoardAction=!1,s.isScrollChanged=!1,s.isUpwardScrolling=!1,s.startIndex=0,s.currentPageNumber=0,s.pageCount=0,s.isPreventKeyAction=!1,s.generatedDataObject={},s.skeletonCount=32,s.isVirtualTrackHeight=!1,s.virtualSelectAll=!1,s.incrementalQueryString="",s.incrementalEndIndex=0,s.incrementalStartIndex=0,s.incrementalPreQueryString="",s.isObjectCustomValue=!1,s.appendUncheckList=!1,s.getInitialData=!1,s.preventPopupOpen=!0,s.virtualSelectAllState=!1,s.CurrentEvent=null,s.isDynamicData=!1,s.isPrimitiveData=!1,s.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s}return I(t,e),t.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object;s[e]=t[e],l[e]=i[e];var n=new Object;return n.newProperty=s,n.oldProperty=l,n},t.prototype.getValueByText=function(e,t,i){var s=null;return(0,v.isNullOrUndefined)(this.listData)||(s=t?this.checkValueCase(e,!0,i):this.checkValueCase(e,!1,i)),s},t.prototype.checkValueCase=function(e,t,i,s){var l=this,n=null;if(s&&(n=e),!(0,v.isNullOrUndefined)(this.listData)){var a=this.listData,o=this.fields,r=this.typeOfData(a).typeof;if("string"===r||"number"===r||"boolean"===r)for(var h=0,u=a;h<u.length;h++){var p=u[h];(0,v.isNullOrUndefined)(p)||(i?n=this.checkingAccent(String(p),e,t):t?this.checkIgnoreCase(String(p),e)&&(n=this.getItemValue(String(p),e,t)):this.checkNonIgnoreCase(String(p),e)&&(n=this.getItemValue(String(p),e,t,s)))}else if(t)a.filter((function(t){var i=(0,v.getValue)(o.value,t);!(0,v.isNullOrUndefined)(i)&&l.checkIgnoreCase((0,v.getValue)(o.text,t).toString(),e)&&(n=(0,v.getValue)(o.value,t))}));else if(s){var d=null;d=n,a.filter((function(e){var t=(0,v.getValue)(o.value,e);(0,v.isNullOrUndefined)(t)||(0,v.isNullOrUndefined)(n)||t.toString()!==d.toString()||(n=(0,v.getValue)(o.text,e))}))}else a.filter((function(t){l.checkNonIgnoreCase((0,v.getValue)(o.text,t),e)&&(n=(0,v.getValue)(o.value,t))}))}return n},t.prototype.checkingAccent=function(e,t,i){var s=g.DataUtil.ignoreDiacritics(String(e)),l=g.DataUtil.ignoreDiacritics(t.toString()),n=null;return i?this.checkIgnoreCase(s,l)&&(n=this.getItemValue(String(e),t,i)):this.checkNonIgnoreCase(String(e),t)&&(n=this.getItemValue(String(e),t,i)),n},t.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},t.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},t.prototype.getItemValue=function(e,t,i,s){var l=this.listData,n=this.typeOfData(l).typeof;return s?e.toString():i?"string"===n?String(e):this.getFormattedValue(String(e)):"string"===n?t:this.getFormattedValue(t)},t.prototype.templateCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!(0,v.selectAll)(e,document).length}catch(e){t=!1}return t},t.prototype.l10nUpdate=function(e){var t="listbox"===this.getModuleName()?this.ulElement:this.list;if(!(0,v.isNullOrUndefined)(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=void 0,l=e?this.actionFailureTemplateId:this.noRecordsTemplateId;t.innerHTML="";var n=this.templateCompiler(i);s="function"!=typeof i&&n?(0,v.compile)((0,v.select)(i,document).innerHTML.trim()):(0,v.compile)(i);var a=e?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof i?s({},this,a,l,this.isStringTemplate,null):s({},this,a,l,this.isStringTemplate,null,t))&&o.length>0)for(var r=0;r<o.length;r++){if("listbox"===this.getModuleName()&&"noRecordsTemplate"===a)if("#text"===o[r].nodeName)(u=this.createElement("li")).textContent=o[r].textContent,u.classList.add("e-list-nrt"),u.setAttribute("role","option"),t.appendChild(u);else o[r].classList.add("e-list-nr-template"),t.appendChild(o[r]);else(o[r]instanceof HTMLElement||o[r]instanceof Text&&""!==o[r].textContent)&&t.appendChild(o[r])}this.renderReactTemplates()}else{var h=new v.L10n(this.getLocaleName(),{},this.locale);""!==h.getConstant("actionFailureTemplate")||""!==h.getConstant("noRecordsTemplate")?this.l10n=h:this.l10n=new v.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},this.locale);var u,p=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName())(u=this.createElement("li")).textContent=p,t.appendChild(u),u.classList.add("e-list-nrt"),u.setAttribute("role","option");else(0,v.isNullOrUndefined)(t)||(t.innerHTML=p)}},t.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},t.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},t.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul")},t.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},t.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount;this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount;var t=!0;if("autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof g.DataManager&&!(this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),!this.list.classList.contains(A.noData)){if(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl").length>0)this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0&&this.list.querySelector(".e-dropdownbase")){var i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.querySelector(".e-dropdownbase").appendChild(i)}this.list.getElementsByClassName("e-virtual-ddl-content").length>0&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},t.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},t.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,t="height: "+((e=this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?t:"height: 0px;"},t.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},t.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||e)&&this.isVirtualizationEnabled)for(var l=e?t:this.skeletonCount,n=0;n<l;n++){var a=this.createElement("li",{className:A.virtualList,styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px");var o=new x.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"});o.appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(a,i.firstChild.children[0])}},t.prototype.getLocaleName=function(){return"drop-down-base"},t.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},t.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var t=void 0;if(t=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&this.properties.value.length>0?this.typeOfData(this.properties.value):this.typeOfData(this.listData),"number"==typeof(0,v.getValue)(this.fields.value?this.fields.value:"value",t.item)||"number"===t.typeof)return parseFloat(e);if("boolean"==typeof(0,v.getValue)(this.fields.value?this.fields.value:"value",t.item)||"boolean"===t.typeof)return"true"===e||""+e=="true"}return e},t.prototype.setEnableRtl=function(){(0,v.isNullOrUndefined)(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?(0,v.addClass)(this.enableRtlElements,A.rtl):(0,v.removeClass)(this.enableRtlElements,A.rtl))},t.prototype.initialize=function(e){if(this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var t=E.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(t,this.fields)}else if("SELECT"===this.element.tagName){(this.dataSource instanceof Array?this.dataSource.length>0:!(0,v.isNullOrUndefined)(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect()}else this.setListData(this.dataSource,this.fields,this.query,e)},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.updateDataAttribute=function(e){for(var t=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],i={},s=0;s<this.element.attributes.length;s++)-1!==t.indexOf(this.element.attributes[s].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[s].name||(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));(0,v.extend)(i,e,i),this.setProperties({htmlAttributes:i},!0)},t.prototype.renderItemsBySelect=function(){var e,t=this.element,i=t.querySelectorAll("select>optgroup"),s="multiselect"===this.getModuleName()&&this.isGroupChecking&&i.length>0;e=s?{value:"value",text:"text",groupBy:"categeory"}:e={value:"value",text:"text"};var l=[],n=t.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,e),i.length){for(var a=0;a<i.length;a++){var o=i[a],r={};r[e.text]=o.label,r.isHeader=!0;var h=o.querySelectorAll("option");s?this.getJSONfromOption(l,h,e,o.label):(l.push(r),this.getJSONfromOption(l,h,e))}t.querySelectorAll("select>option")}this.updateFields(e.text,e.value,s?e.groupBy:this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,e)},t.prototype.updateFields=function(e,t,i,s,l,n){var a={fields:{text:e,value:t,groupBy:(0,v.isNullOrUndefined)(i)?this.fields&&this.fields.groupBy:i,htmlAttributes:(0,v.isNullOrUndefined)(s)?this.fields&&this.fields.htmlAttributes:s,iconCss:(0,v.isNullOrUndefined)(l)?this.fields&&this.fields.iconCss:l,disabled:(0,v.isNullOrUndefined)(n)?this.fields&&this.fields.disabled:n}};this.setProperties(a,!0)},t.prototype.getJSONfromOption=function(e,t,i,s){void 0===s&&(s=null);for(var l=0,n=t;l<n.length;l++){var a=n[l],o={};o[i.text]=a.innerText,o[i.value]=(0,v.isNullOrUndefined)(a.getAttribute(i.value))?a.innerText:a.getAttribute(i.value),(0,v.isNullOrUndefined)(s)||(o[i.groupBy]=s),e.push(o)}},t.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},t.prototype.setListData=function(e,t,i,s){var l,n=this;t=t||this.fields,this.isActive=!0;var a={cancel:!1,data:e,query:i};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",a,(function(i){if(!i.cancel)if(n.isRequesting=!0,n.showSpinner(),e instanceof g.DataManager){n.isRequested=!0;var a=!1;if(n.isDataFetched)return void n.emptyDataRequest(t);i.data.executeQuery(n.getQuery(i.query)).then((function(e){n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange;var s=!0;if(!n.virtualSelectAll){for(var o=n.getQuery(i.query),r=0;r<o.queries.length;r++)"onWhere"===o.queries[r].fn&&(a=!0);if(n.isVirtualizationEnabled&&0!==e.count&&e.count<2*n.itemCount){if(o)for(r=0;r<o.queries.length;r++)"onTake"===o.queries[r].fn&&(o.queries[r].e.nos=e.count),"multiselect"!==n.getModuleName()||"or"!==o.queries[r].e.condition&&"equal"!==o.queries[r].e.operator||(s=!1)}else if(n.isVirtualTrackHeight=!1,o)for(r=0;r<o.queries.length;r++)"multiselect"===n.getModuleName()&&(o.queries[r].e&&"or"===o.queries[r].e.condition||o.queries[r].e&&"equal"===o.queries[r].e.operator)&&(s=!1)}s&&(n.dataCount=n.totalItemCount=e.count),n.trigger("actionComplete",e,(function(e){if(!e.cancel){n.isRequesting=!1;var i=e.result;if(n.isIncrementalRequest)return void(l=n.renderItems(i,t));if((!n.isVirtualizationEnabled&&0===i.length||n.isVirtualizationEnabled&&0===i.length&&!a)&&(n.isDataFetched=!0),a||(n.remoteDataCount=e.count),n.dataCount=n.virtualSelectAll?n.dataCount:e.count,n.totalItemCount=n.virtualSelectAll?n.totalItemCount:e.count,l=n.renderItems(i,t),n.appendUncheckList=!1,n.onActionComplete(l,i,e),n.groupTemplate&&n.renderGroupTemplate(l),n.isRequested=!1,n.bindChildItems(i,l,t,e),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);n.isVirtualizationEnabled&&n.setCurrentView&&n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),null!=n.keyboardEvent&&n.handleVirtualKeyboardActions(n.keyboardEvent,n.pageCount),n.isVirtualizationEnabled&&n.getFilteringSkeletonCount(),n.virtualSelectAll&&n.virtualSelectAllData&&(n.virtualSelectionAll(n.virtualSelectAllState,n.liCollections,n.CurrentEvent),n.virtualSelectAllState=!1,n.CurrentEvent=null,n.virtualSelectAll=!1)}}))})).catch((function(e){n.isRequested=!1,n.isRequesting=!1,n.onActionFailure(e),n.hideSpinner()}))}else{n.isRequesting=!1;var o=!0,r=void 0;if(n.isVirtualizationEnabled&&!n.virtualGroupDataSource&&n.fields.groupBy){var h=new g.DataManager(n.dataSource).executeLocal((new g.Query).group(n.fields.groupBy));n.virtualGroupDataSource=h.records}var u=n.isVirtualizationEnabled&&n.virtualGroupDataSource&&!n.isCustomDataUpdated?new g.DataManager(n.virtualGroupDataSource):new g.DataManager(i.data);if(r=n.getQuery(i.query).executeLocal(u),!n.virtualSelectAll){var p=n.getQuery(i.query);if(n.isVirtualizationEnabled&&0!==r.count&&r.count<2*n.itemCount){if(p){for(var d=0;d<p.queries.length;d++)"onTake"===p.queries[d].fn&&(p.queries[d].e.nos=r.count,r=p.executeLocal(u)),"multiselect"!==n.getModuleName()||"or"!==p.queries[d].e.condition&&"equal"!==p.queries[d].e.operator||(o=!1);o&&(r=p.executeLocal(u),n.isVirtualTrackHeight=!(n.dataSource instanceof g.DataManager||n.isCustomDataUpdated))}}else if(n.isVirtualTrackHeight=!1,p)for(d=0;d<p.queries.length;d++)"multiselect"===n.getModuleName()&&(p.queries[d].e&&"or"===p.queries[d].e.condition||p.queries[d].e&&"equal"===p.queries[d].e.operator)&&(o=!1)}!o||n.dataSource instanceof g.DataManager||n.isCustomDataUpdated||n.virtualSelectAll||(n.dataCount=n.totalItemCount=n.virtualSelectAll?r.length:r.count);var c={cancel:!1,result:r=n.isVirtualizationEnabled?r.result:r};n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange,n.trigger("actionComplete",c,(function(e){if(n.isIncrementalRequest)l=n.renderItems(e.result,t);else if(!e.cancel){if(l=n.renderItems(e.result,t),n.onActionComplete(l,e.result,s),n.groupTemplate&&n.renderGroupTemplate(l),n.bindChildItems(e.result,l,t),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);setTimeout((function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&l.childElementCount>0&&(l.children[0].childElementCount>0||n.fields.groupBy&&l.children[1]&&l.children[1].childElementCount>0)&&n.updateDataList()}))}}))}}))},t.prototype.handleVirtualKeyboardActions=function(e,t){},t.prototype.updatePopupState=function(){},t.prototype.virtualSelectionAll=function(e,t,i){},t.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},t.prototype.bindChildItems=function(e,t,i,s){var l=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout((function(){var n=l.remainingItems(l.sortedData,i);(0,v.append)(n,t),l.liCollections=l.list.querySelectorAll("."+A.li),l.updateListValues(),l.raiseDataBound(e,s)}),0):this.raiseDataBound(e,s)},t.prototype.isObjectInArray=function(e,t){return t.some((function(t){return Object.keys(e).every((function(i){return Object.prototype.hasOwnProperty.call(t,i)&&t[i]===e[i]}))}))},t.prototype.updateListValues=function(){},t.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var n=[].slice.call(e.querySelectorAll(t)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},t.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},t.prototype.remainingItems=function(e,t){var i=new g.DataManager(e).executeLocal((new g.Query).skip(100));if(this.itemTemplate){var s=this.templateListItem(i,t);return[].slice.call(s.childNodes)}var l=this.typeOfData(i).typeof;return"string"===l||"number"===l||"boolean"===l?E.ListBase.createListItemFromArray(this.createElement,i,!0,this.listOption(i,t),this):E.ListBase.createListItemFromJson(this.createElement,i,this.listOption(i,t),1,!0,this)},t.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},t.prototype.showSpinner=function(){},t.prototype.hideSpinner=function(){},t.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),(0,v.isNullOrUndefined)(this.list)||(0,v.addClass)([this.list],A.noData)},t.prototype.onActionComplete=function(e,t,i){if(this.listData=t,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(var s=0;s<e.childElementCount;s++)e.children[s].classList.contains("e-list-group-item")&&((0,v.isNullOrUndefined)(e.children[s].innerHTML)||""===e.children[s].innerHTML)&&(0,v.addClass)([e.children[s]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&(0,v.setStyleAttribute)(e.children[1],{zIndex:11});(0,v.isNullOrUndefined)(this.list)||this.isVirtualizationEnabled||(this.list.innerHTML="",this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,t,this.bindEvent))},t.prototype.postRender=function(e,t,i){if(this.fields.disabled)for(var s=e.querySelectorAll("."+A.li),l=0;l<s.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.disabled])if((0,v.isNullOrUndefined)(this.fields.groupBy))this.disableListItem(s[l]);else{var n=this.listData[l],a=(0,v.getValue)(this.fields.value?this.fields.value:"value",n),o=e.querySelector('li[data-value="'+a+'"]');(0,v.isNullOrUndefined)(o)||this.disableListItem(o)}var r=this.fields.disabled?e.querySelector("."+A.li+":not(.e-disabled"):e.querySelector("."+A.li),h=e.querySelector("."+A.selected);if(r&&!h){if(this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex){var u=this.ulElement.querySelectorAll("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)");r=u&&u.length>0?u[2]:r}r&&r.classList.add(A.focus)}t.length<=0?(this.l10nUpdate(),(0,v.addClass)([e],A.noData)):e.classList.remove(A.noData)},t.prototype.getQuery=function(e){return e||(this.query?this.query:new g.Query)},t.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},t.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+A.group)){var t=this.dataSource,i={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},s=e.querySelectorAll("."+A.group),l=this.templateCompiler(this.groupTemplate);if("function"!=typeof this.groupTemplate&&l){var n=(0,v.select)(this.groupTemplate,document).innerHTML.trim(),a=E.ListBase.renderGroupTemplate(n,t,this.fields.properties,s,i,this);if(this.isGroupChecking)for(var o=0;o<a.length;o++)this.notify("addItem",{module:"CheckBoxSelection",item:a[o]})}else{a=E.ListBase.renderGroupTemplate(this.groupTemplate,t,this.fields.properties,s,i,this);if(this.isGroupChecking)for(o=0;o<a.length;o++)this.notify("addItem",{module:"CheckBoxSelection",item:a[o]})}this.renderReactTemplates()}},t.prototype.createListItems=function(e,t){if(e){t.groupBy||this.element.querySelector("optgroup")?(t.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=this.element.querySelector("optgroup")&&this.isGroupChecking&&"multiselect"===this.getModuleName()?E.ListBase.groupDataSource(e,t,this.sortOrder):E.ListBase.groupDataSource(e,t.properties,this.sortOrder)),(0,v.addClass)([this.list],A.grouping)):("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(e=this.getSortedDataSource(e));var i=this.listOption(e,t),s=e.length>100?new g.DataManager(e).executeLocal((new g.Query).take(100)):e;return this.sortedData=e,E.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?s:e,i,!0,this)}return null},t.prototype.listOption=function(e,t){var i=!(0,v.isNullOrUndefined)(t.iconCss),s=(0,v.isNullOrUndefined)(t.properties)?t:t.properties,l=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return(0,v.extend)({},l,t,!0)},t.prototype.setFloatingHeader=function(e){(0,v.isNullOrUndefined)(this.list)||this.list.classList.contains(A.noData)||((0,v.isNullOrUndefined)(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:A.fixedHead}),(0,v.isNullOrUndefined)(this.list)||this.list.querySelector("li").classList.contains(A.group)||(this.fixedHeaderElement.style.display="none"),(0,v.isNullOrUndefined)(this.fixedHeaderElement)||(0,v.isNullOrUndefined)(this.list)||(0,v.prepend)([this.fixedHeaderElement],this.list),this.setFixedHeader()),(0,v.isNullOrUndefined)(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},t.prototype.scrollStop=function(e,t){for(var i=(0,v.isNullOrUndefined)(e)?this.list:e.target,s=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),l=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),n=parseInt(l,10),a="multiselect"===this.getModuleName()?parseFloat(s):parseInt(s,10),o=Math.round(i.scrollTop/(a+n)),r=this.list.querySelectorAll("li:not(.e-hide-listitem)"),h=this.list.querySelectorAll(".e-virtual-list").length,u=!1,p=o;p>-1;p--){var d=this.isVirtualizationEnabled?p+h:p;if(this.isVirtualizationEnabled){if(u&&0,this.fixedHeaderElement&&this.updateGroupHeader(d,r,i))break;t&&(!(0,v.isNullOrUndefined)(r[d])&&r[d].classList.contains(A.selected)&&"autocomplete"!==this.getModuleName()||!(0,v.isNullOrUndefined)(r[d])&&r[d].classList.contains(A.focus)&&"autocomplete"===this.getModuleName())&&(u=!0)}else if(this.updateGroupHeader(d,r,i))break}},t.prototype.getPageCount=function(e){if(this.list){var t=this.list.classList.contains(A.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),i=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10));return e?i:Math.round(i)}return 0},t.prototype.updateGroupHeader=function(e,t,i){return!(0,v.isNullOrUndefined)(t[e])&&t[e].classList.contains(A.group)?(this.updateGroupFixedHeader(t[e],i),!0):(this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none",!1)},t.prototype.updateGroupFixedHeader=function(e,t){this.fixedHeaderElement&&((0,v.isNullOrUndefined)(e.innerHTML)||(this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},t.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},t.prototype.renderItems=function(e,t,i){var s;if(this.itemTemplate&&e){"multiselect"===this.getModuleName()&&this.virtualSelectAll&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex));var l=e;l&&t.groupBy?("None"!==this.sortOrder&&(l=this.getSortedDataSource(l)),l=E.ListBase.groupDataSource(l,t.properties,this.sortOrder)):("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(l=this.getSortedDataSource(l)),this.sortedData=l;var n=l.length>100?new g.DataManager(l).executeLocal((new g.Query).take(100)):l;if(s=this.templateListItem("autocomplete"===this.getModuleName()?n:l,t),this.isIncrementalRequest)return this.incrementalLiCollections=s.querySelectorAll("."+A.li),this.incrementalUlElement=s,this.incrementalListData=e,s;if(this.isVirtualizationEnabled){var a=this.list.querySelector(".e-list-parent"),o=this.list.querySelector(".e-virtual-ddl-content");if(e.length>=this.virtualizedItemsCount&&a&&o||a&&o&&this.isAllowFiltering||a&&o&&"autocomplete"===this.getModuleName()){"multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(o.appendChild(s),i=!0):o.replaceChild(s,a);var r=this.list.querySelectorAll(".e-reorder");this.list.querySelector(".e-virtual-ddl-content")&&r&&r.length>0&&!i&&this.list.querySelector(".e-virtual-ddl-content").removeChild(r[0]),this.updateListElements(e)}else o||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(s),this.updateListElements(e))}}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),s=this.createListItems(e,t),this.isIncrementalRequest)return this.incrementalLiCollections=s.querySelectorAll("."+A.li),this.incrementalUlElement=s,this.incrementalListData=e,s;if(this.isVirtualizationEnabled){a=this.list.querySelector(".e-list-parent:not(.e-reorder)"),o=this.list.querySelector(".e-virtual-ddl-content");!a&&this.list.querySelector(".e-list-parent.e-reorder")&&(a=this.list.querySelector(".e-list-parent.e-reorder")),e.length>=this.virtualizedItemsCount&&a&&o||a&&o&&this.isAllowFiltering||a&&o&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(this.appendUncheckList?o.appendChild(s):o.replaceChild(s,a),this.updateListElements(e)):o&&o.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(s),this.updateListElements(e))}}return s},t.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},t.prototype.updateListElements=function(e){this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"),this.listData=e,this.postRender(this.list,e,this.bindEvent)},t.prototype.templateListItem=function(e,t){var i=this.listOption(e,t);i.templateID=this.itemTemplateId,i.isStringTemplate=this.isStringTemplate;var s,l=this.templateCompiler(this.itemTemplate);if("function"!=typeof this.itemTemplate&&l){var n=(0,v.select)(this.itemTemplate,document).innerHTML.trim();return s=E.ListBase.renderContentTemplate(this.createElement,n,e,t.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),s}return s=E.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,t.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),s},t.prototype.typeOfData=function(e){for(var t={typeof:null,item:null},i=0;!(0,v.isNullOrUndefined)(e)&&i<e.length;i++){if(!(0,v.isNullOrUndefined)(e[i]))if(!("string"==typeof e[i]||"number"==typeof e[i]||"boolean"==typeof e[i]?(0,v.isNullOrUndefined)(e[i]):(0,v.isNullOrUndefined)((0,v.getValue)(this.fields.value?this.fields.value:"value",e[i]))))return{typeof:typeof e[i],item:e[i]}}return t},t.prototype.setFixedHeader=function(){(0,v.isNullOrUndefined)(this.list)||(this.list.parentElement.style.display="block");var e=0;this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e)&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10)));if(!(0,v.isNullOrUndefined)(this.liCollections)){var t=this.getValidLi().offsetWidth-e;this.fixedHeaderElement.style.width=t.toString()+"px"}(0,v.setStyleAttribute)(this.fixedHeaderElement,{zIndex:10});var i=this.ulElement.querySelector("."+A.group+":not(.e-hide-listitem)");this.fixedHeaderElement.innerHTML=i.innerHTML},t.prototype.getSortedDataSource=function(e){if(e&&"None"!==this.sortOrder){var t=this.fields.text?this.fields.text:"text";"string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=E.ListBase.getDataSource(e,E.ListBase.addSorting(this.sortOrder,t))}return e},t.prototype.getIndexByValue=function(e){var t,i=[];i=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems();for(var s=0;s<i.length;s++)if(!(0,v.isNullOrUndefined)(e)&&i[s].getAttribute("data-value")===e.toString()){t=s;break}return t},t.prototype.getIndexByValueFilter=function(e,t){var i;if(!t)return null;var s=t.querySelectorAll("li:not(.e-list-group-item)");if(s)for(var l=0;l<s.length;l++)if(!(0,v.isNullOrUndefined)(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},t.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e&&e.dispatchEvent(i)},t.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||(this.isPrimitiveData=!0,this.updateFields("text","text"))},t.prototype.resetList=function(e,t,i,s){if(this.list){if("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)!(e instanceof Array?e.length>0:!(0,v.isNullOrUndefined)(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData);e="combobox"===this.getModuleName()&&this.selectData&&e instanceof Array&&e.length<this.selectData.length&&this.addedNewItem?this.selectData:e,this.addedNewItem=!1,this.setListData(e,t,i,s)}},t.prototype.updateSelectElementData=function(e){(e||this.isVirtualizationEnabled)&&(0,v.isNullOrUndefined)(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},t.prototype.updateSelection=function(){},t.prototype.renderList=function(){this.render()},t.prototype.updateDataSource=function(e,t){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof g.DataManager?this.dataSource.dataSource.json.length:0},t.prototype.setUpdateInitial=function(e,t,i){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var s={},l=0;e.length>l;l++)t[e[l]]&&"fields"===e[l]?(this.setFields(),s[e[l]]=t[e[l]]):t[e[l]]&&(s[e[l]]=t[e[l]]);Object.keys(s).length>0&&(-1===Object.keys(s).indexOf("dataSource")&&(s.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||(0,v.isNullOrUndefined)(t.dataSource)&&(0,v.isNullOrUndefined)(t.sortOrder))||this.updateDataSource(s,i):(this.isDynamicData=!0,this.updateDataSource(s,i)))},t.prototype.onPropertyChanged=function(e,t){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var l=this.ulElement.querySelector("."+A.group);this.fixedHeaderElement.innerHTML=l.innerHTML}break;case"locale":this.list&&!(0,v.isNullOrUndefined)(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}}},t.prototype.render=function(e,t){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:A.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:A.content}),this.list.classList.add(A.root),this.setFields();var i={duration:300,selector:"."+A.li};this.rippleFun=(0,v.rippleEffect)(this.list,i);var s=this.element.querySelector("select>optgroup");if(!this.fields.groupBy&&(0,v.isNullOrUndefined)(s)||this.isGroupChecking||(v.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),v.EventHandler.add(document,"scroll",this.updateGroupFixedHeader,this)),"dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),(0,v.removeClass)([this.element],A.root),this.element.style.display="none";var l=this.createElement("div");this.element.parentElement.insertBefore(l,this.element),l.appendChild(this.element),l.appendChild(this.list)}this.setEnableRtl(),t||this.initialize(e)},t.prototype.removeScrollEvent=function(){this.list&&v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)},t.prototype.getModuleName=function(){return"dropdownbase"},t.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+A.li)},t.prototype.addItem=function(e,t){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&(0,v.isNullOrUndefined)(t)){var i=[].slice.call(this.listData);i.push(e),i=this.getSortedDataSource(i),t=this.fields.groupBy?(i=E.ListBase.groupDataSource(i,this.fields.properties,this.sortOrder)).indexOf(e):i.indexOf(e)}var s,l=this.getItems().length,n=0===l,a=this.list.querySelector("."+A.selected);e=e instanceof Array?e:[e],s=(0,v.isNullOrUndefined)(t)||t<0||t>l-1?l:t;var o=this.fields;e&&o.groupBy&&(e=E.ListBase.groupDataSource(e,o.properties));for(var r=[],h=0;h<e.length;h++){var u=e[h],p=u.isHeader,d=this.createElement("li",{className:p?A.group:A.li,id:"option-add-"+h}),c=u instanceof Object?(0,v.getValue)(o.text,u):u;if(p&&(d.innerText=c),this.itemTemplate&&!p){var m=this.templateCompiler(this.itemTemplate),f=("function"!=typeof this.itemTemplate&&m?(0,v.compile)((0,v.select)(this.itemTemplate,document).innerHTML.trim()):(0,v.compile)(this.itemTemplate))(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d);f&&(0,v.append)(f,d)}else p||d.appendChild(document.createTextNode(c));d.setAttribute("data-value",u instanceof Object?(0,v.getValue)(o.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),r.push(d),"listbox"===this.getModuleName()?(this.listData.splice(n?this.listData.length:s,0,u),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(u),"None"===this.sortOrder&&(0,v.isNullOrUndefined)(t)&&0===s&&(s=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(d,u,n?null:s+h):this.updateActionCompleteData(d,u,s),this.trigger("beforeItemRender",{element:d,item:u})}if(0===l&&(0,v.isNullOrUndefined)(this.list.querySelector("ul")))(0,v.isNullOrUndefined)(this.list)||(this.list.innerHTML="",this.list.classList.remove(A.noData),this.isAddNewItemTemplate=!0,(0,v.isNullOrUndefined)(this.ulElement)||this.list.appendChild(this.ulElement)),this.liCollections=r,(0,v.isNullOrUndefined)(r)||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.append)(r,this.ulElement),this.updateAddItemList(this.list,l);else{"listbox"===this.getModuleName()&&0===l&&(this.ulElement.innerHTML="");var g=[];for(h=0;h<e.length;h++){for(var y=this.ulElement.querySelectorAll(".e-list-group-item"),C=0;C<y.length;C++)g[C]=y[C].innerText;if(g.indexOf(r[h].innerText)>-1&&o.groupBy){for(C=0;C<y.length;C++)if(g[C]===r[h].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(r[h+1],y[C+1]):this.ulElement.insertBefore(r[h+1],this.ulElement.childNodes[t]),h+=1;break}}else this.liCollections[s]&&this.liCollections[s].parentNode?this.liCollections[s].parentNode.insertBefore(r[h],this.liCollections[s]):t&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(r[h],this.ulElement.childNodes[t+h]):this.ulElement.appendChild(r[h]);var b=[].slice.call(this.liCollections);b.splice(s,0,r[h]),this.liCollections=b,s+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),(a||0===t)&&this.updateSelection(),this.addedNewItem=!0},t.prototype.isDisabledElement=function(e){return!(!e||!e.classList.contains("e-disabled"))},t.prototype.isDisabledItemByIndex=function(e){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[e])},t.prototype.disableListItem=function(e){e.classList.add("e-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")},t.prototype.validationAttribute=function(e,t){var i=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",i),e.removeAttribute("name");for(var s=["required","aria-required","form"],l=0;l<s.length;l++)if(e.getAttribute(s[l])){var n=e.getAttribute(s[l]);t.setAttribute(s[l],n),e.removeAttribute(s[l])}},t.prototype.setZIndex=function(){},t.prototype.updateActionCompleteData=function(e,t,i){},t.prototype.updateAddItemList=function(e,t){},t.prototype.updateDataList=function(){},t.prototype.getDataByValue=function(e){if(!(0,v.isNullOrUndefined)(this.listData)){var t=this.typeOfData(this.listData).typeof;if("string"===t||"number"===t||"boolean"===t)for(var i=0,s=this.listData;i<s.length;i++){var l=s[i];if(!(0,v.isNullOrUndefined)(l)&&l===e)return l}else for(var n=0,a=this.listData;n<a.length;n++){l=a[n];if(!(0,v.isNullOrUndefined)(l)&&(0,v.getValue)(this.fields.value?this.fields.value:"value",l)===e)return l}}return null},t.prototype.destroy=function(){document&&(v.EventHandler.remove(document,"scroll",this.updateGroupFixedHeader),document.body.contains(this.list)&&(v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),(0,v.isNullOrUndefined)(this.rippleFun)||this.rippleFun(),(0,v.detach)(this.list))),this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.rippleFun=null,e.prototype.destroy.call(this)},w([(0,v.Complex)({text:null,value:null,iconCss:null,groupBy:null,disabled:null},O)],t.prototype,"fields",void 0),w([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),w([(0,v.Property)(null)],t.prototype,"groupTemplate",void 0),w([(0,v.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),w([(0,v.Property)("Request failed")],t.prototype,"actionFailureTemplate",void 0),w([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),w([(0,v.Property)([])],t.prototype,"dataSource",void 0),w([(0,v.Property)(null)],t.prototype,"query",void 0),w([(0,v.Property)("StartsWith")],t.prototype,"filterType",void 0),w([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),w([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),w([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),w([(0,v.Property)()],t.prototype,"locale",void 0),w([(0,v.Event)()],t.prototype,"actionBegin",void 0),w([(0,v.Event)()],t.prototype,"actionComplete",void 0),w([(0,v.Event)()],t.prototype,"actionFailure",void 0),w([(0,v.Event)()],t.prototype,"select",void 0),w([(0,v.Event)()],t.prototype,"dataBound",void 0),w([(0,v.Event)()],t.prototype,"created",void 0),w([(0,v.Event)()],t.prototype,"destroyed",void 0),t=w([v.NotifyPropertyChanges],t)}(v.Component),k=u(197),N=u(323),L=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),B=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},T={root:"e-dropdownlist",hover:A.hover,selected:A.selected,rtl:A.rtl,li:A.li,disable:A.disabled,base:A.root,focus:A.focus,content:A.content,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",resizeIcon:"e-resizer-right e-icons",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden",virtualList:"e-list-item e-virtual-list"},V={container:null,buttons:[]},P=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isListSearched=!1,s.preventChange=!1,s.isTouched=!1,s.isFocused=!1,s.autoFill=!1,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isReactTemplateUpdate=!1,s}return L(t,e),t.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},t.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},t.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},t.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),e},t.prototype.renderList=function(t,i){e.prototype.render.call(this,t,i),this.dataSource instanceof g.DataManager||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},t.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");""!==this.inputElement.value||this.isInteracted?(0,v.classList)(e,["e-label-top"],["e-label-bottom"]):(0,v.classList)(e,["e-label-bottom"],["e-label-top"])}},t.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},t.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!(0,v.isNullOrUndefined)(this.ulElement)){var e=this.fields.disabled?this.ulElement.querySelector("."+T.li+":not(.e-disabled)"):this.ulElement.querySelector("."+T.li);this.enableVirtualization&&(e=this.liCollections[this.skeletonCount]),e&&e.classList.add(T.focus)}},t.prototype.clearAll=function(e,t){this.previousItemData=(0,v.isNullOrUndefined)(this.itemData)?null:this.itemData,!(0,v.isNullOrUndefined)(t)&&((0,v.isNullOrUndefined)(t)||!(0,v.isNullOrUndefined)(t.dataSource)&&(t.dataSource instanceof g.DataManager||0!==t.dataSource.length))||(this.isActive=!0,this.resetSelection(t));var i=this.getItemData();if(!this.allowObjectBinding&&this.previousValue===i.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value?this.value:i:i.value?this.getDataByValue(i.value):i]))return this.checkAndResetCache(),void(this.enableVirtualization&&this.list&&this.updateInitialData());this.onChangeEvent(e),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData()},t.prototype.resetSelection=function(e){this.list&&((0,v.isNullOrUndefined)(e)||!(0,v.isNullOrUndefined)(e.dataSource)&&(e.dataSource instanceof g.DataManager||0!==e.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!(0,v.isNullOrUndefined)(this.actionCompleteData.ulElement)&&!(0,v.isNullOrUndefined)(this.actionCompleteData.list)&&this.actionCompleteData.list.length>0&&this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),(0,v.isNullOrUndefined)(this.hiddenElement)||(this.hiddenElement.innerHTML=""),(0,v.isNullOrUndefined)(this.inputElement)||(this.inputElement.value=""),this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&((0,v.detach)(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},t.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];if("class"===i){var s=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==s&&(0,v.addClass)([this.inputWrapper.container],s.split(" "))}else if("disabled"===i&&"disabled"===this.htmlAttributes[""+i])this.enabled=!1,this.setEnable();else if("readonly"!==i||(0,v.isNullOrUndefined)(this.htmlAttributes[""+i]))if("style"===i)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+i]);else if("aria-label"===i)"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+i]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+i]);else{var l=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||l.push("tabindex"),["name","required"].indexOf(i)>-1||0===i.indexOf("data")?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):l.indexOf(i)>-1?"placeholder"===i?N.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputElement):this.inputElement.setAttribute(i,this.htmlAttributes[""+i]):this.inputWrapper.container.setAttribute(i,this.htmlAttributes[""+i])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},t.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},t.prototype.setEnableRtl=function(){(0,v.isNullOrUndefined)(this.inputElement)||(0,v.isNullOrUndefined)(this.inputElement.parentElement)||N.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){N.Input.setEnabled(this.enabled,this.inputElement),this.enabled?((0,v.removeClass)([this.inputWrapper.container],T.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),(0,v.addClass)([this.inputWrapper.container],T.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getLocaleName=function(){return"drop-down-list"},t.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},t.prototype.targetElement=function(){return(0,v.isNullOrUndefined)(this.inputWrapper)?null:this.inputWrapper.container},t.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},t.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},t.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},t.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof g.DataManager?this.initialRemoteRender=!0:this.updateValues()},t.prototype.isDisableItemValue=function(e){if("object"==typeof e){var t=JSON.parse(JSON.stringify(e))[this.fields.value];return this.isDisabledItemByIndex(this.getIndexByValue(t))}return this.isDisabledItemByIndex(this.getIndexByValue(e))},t.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),this.selectedValueInfo=this.viewPortInfo,(0,v.isNullOrUndefined)(this.value))if(this.text&&(0,v.isNullOrUndefined)(this.value)){var e=this.getElementByText(this.text);if((0,v.isNullOrUndefined)(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{var t=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.setSelection(this.getElementByValue(t),null)}this.setHiddenValue(),N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.onBlurHandler=function(e){if(this.enabled){var t=e.relatedTarget,i=e.target,s=this.isPreventBlur;this.isPreventBlur=!1,!s||this.isDocumentClick||!this.isPopupOpen||(0,v.isNullOrUndefined)(i)&&(this.isFilterLayout()||!(0,v.isNullOrUndefined)(t))?this.isDocumentClick||!(0,v.isNullOrUndefined)(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(T.mobileFilter)?this.beforePopupOpen||(this.isDocumentClick=!1):(("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&t!==this.inputElement&&(document.activeElement!==t||document.activeElement===t&&i.classList.contains(T.inputFocus))||(0,v.isNullOrUndefined)(t)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&i!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(t)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1):"dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus()}},t.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut(e)},t.prototype.onFocusOut=function(e){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&(0,v.addClass)([this.inputWrapper.clearButton],T.clearIconHide),this.trigger("blur"))},t.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}this.updateIconState(),this.isFocused=!0},t.prototype.resizingWireEvent=function(){v.EventHandler.add(document,"mousemove",this.resizePopup,this),v.EventHandler.add(document,"mouseup",this.stopResizing,this),v.EventHandler.add(document,"touchmove",this.resizePopup,this),v.EventHandler.add(document,"touchend",this.stopResizing,this)},t.prototype.resizingUnWireEvent=function(){v.EventHandler.remove(document,"mousemove",this.resizePopup),v.EventHandler.remove(document,"mouseup",this.stopResizing),v.EventHandler.remove(document,"touchmove",this.resizePopup),v.EventHandler.remove(document,"touchend",this.stopResizing)},t.prototype.resetValueHandler=function(e){var t=(0,v.closest)(this.inputElement,"form");if(t&&e.target===t){var i=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=i}},t.prototype.wireEvent=function(){v.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),v.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),v.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),v.EventHandler.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},t.prototype.bindCommonEvent=function(){v.EventHandler.add(this.targetElement(),"blur",this.onBlurHandler,this);var e=(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.add(e,"reset",this.resetValueHandler,this),v.Browser.isDevice?this.keyboardModule=new v.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new v.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},t.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},t.prototype.bindClearEvent=function(){this.showClearButton&&v.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.unBindCommonEvent=function(){!(0,v.isNullOrUndefined)(this.inputWrapper)&&this.targetElement()&&v.EventHandler.remove(this.targetElement(),"blur",this.onBlurHandler);var e=this.inputElement&&(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.remove(e,"reset",this.resetValueHandler),v.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&v.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},t.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?(0,v.addClass)([this.inputWrapper.clearButton],T.clearIconHide):(0,v.removeClass)([this.inputWrapper.clearButton],T.clearIconHide))},t.prototype.wireListEvents=function(){(0,v.isNullOrUndefined)(this.list)||(v.EventHandler.add(this.list,"click",this.onMouseClick,this),v.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),v.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},t.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},t.prototype.onServerIncrementalSearch=function(e){this.isRequested||(0,v.isNullOrUndefined)(this.list)||(0,v.isNullOrUndefined)(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},t.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},t.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},t.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},t.prototype.onMouseClick=function(e){var t=e.target;this.keyboardEvent=null;var i=(0,v.closest)(t,"."+A.li);if(this.isValidLI(i)&&!this.isDisabledElement(i))if(this.setSelection(i,e),v.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100,e)}},t.prototype.onMouseOver=function(e){var t=(0,v.closest)(e.target,"."+A.li);this.setHover(t)},t.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(A.hover)&&(this.removeHover(),(0,v.addClass)([e],A.hover))},t.prototype.onMouseLeave=function(){this.removeHover()},t.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+A.hover);e&&e.length&&(0,v.removeClass)(e,A.hover)}},t.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},t.prototype.updateIncrementalItemIndex=function(e,t){this.incrementalStartIndex=e,this.incrementalEndIndex=t},t.prototype.incrementalSearch=function(e){if(this.liCollections.length>0)if(this.enableVirtualization){var t=!1,i=!1,s=this.ulElement.getElementsByClassName("e-active")[0],l=s?s.textContent:null;""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(e.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(e.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?i=!0:this.incrementalQueryString=String.fromCharCode(e.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(t=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0),(0!==this.viewPortInfo.startIndex||t)&&this.updateIncrementalView(0,this.itemCount);for(var n=a(e.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,i,l,!0);(0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,(0!==this.viewPortInfo.startIndex||t)&&this.updateIncrementalView(0,this.itemCount),n=a(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0),(0,v.isNullOrUndefined)(n));)if((0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100);break}(0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,(0!==this.viewPortInfo.startIndex||t)&&this.updateIncrementalView(0,this.itemCount),n=a(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0));var o=n&&this.getIndexByValue(n.getAttribute("data-value"));if(o)o-=this.skeletonCount;else for(var r=0;r<this.incrementalLiCollections.length;r++)if(!(0,v.isNullOrUndefined)(n)&&!(0,v.isNullOrUndefined)(n.getAttribute("data-value"))&&this.incrementalLiCollections[r].getAttribute("data-value")===n.getAttribute("data-value").toString()){o=r,o=this.incrementalStartIndex+o;break}if(o&&!(this.viewPortInfo.startIndex>=o&&o>=this.viewPortInfo.endIndex)){var h=o-(this.itemCount/2-2)>0?o-(this.itemCount/2-2):0,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(h,u)}if((0,v.isNullOrUndefined)(n))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(n.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(h,u)}if(n=this.getElementByValue(n.getAttribute("data-value")),this.setSelection(n,e),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}this.incrementalPreQueryString=this.incrementalQueryString}}else{n=void 0;if(this.fields.disabled){var d=this.list.querySelectorAll("."+A.li+":not(.e-disabled)");n=a(e.charCode,d,this.activeIndex,!0,this.element.id)}else n=a(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id);(0,v.isNullOrUndefined)(n)||(this.setSelection(n,e),this.setScrollPosition())}},t.prototype.hideSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||((0,k.hideSpinner)(this.spinnerElement),(0,v.removeClass)([this.spinnerElement],T.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},t.prototype.showSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)&&(this.spinnerElement=v.Browser.isDevice&&!(0,v.isNullOrUndefined)(this.filterInputObj)&&this.filterInputObj.buttons[1]||!(0,v.isNullOrUndefined)(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],(0,v.addClass)([this.spinnerElement],T.disableIcon),(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,k.showSpinner)(this.spinnerElement))},t.prototype.keyActionHandler=function(e){if(this.enabled){this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault();var t="pageUp"===e.action||"pageDown"===e.action,i="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var s="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||t||i)||this.isPopupOpen)&&!this.readonly){var l="tab"===e.action||"close"===e.action;if(!(0,v.isNullOrUndefined)(this.list)||this.isRequested||l||"escape"===e.action||(this.searchKeyEvent=e,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode)||(this.renderList(e),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"))),(0,v.isNullOrUndefined)(this.list)||!(0,v.isNullOrUndefined)(this.liCollections)&&s&&0===this.liCollections.length||this.isRequested)return;switch((l&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!s&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||(this.showPopup(),e.preventDefault()));break;case"open":this.showPopup(e);break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},t.prototype.updateUpDownAction=function(e,t){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var i=this.getItemData().value;(0,v.isNullOrUndefined)(i)&&(i="null");var s=this.getIndexByValue(i);(0,v.isNullOrUndefined)(s)||(this.activeIndex=s)}var l,n=this.list.querySelector("."+T.focus);if(this.isSelectFocusItem(n)&&!t){if(this.setSelection(n,e),this.enableVirtualization){var a=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.fields.groupBy&&(a=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-a:a-this.selectedLI.offsetHeight),this.list.scrollTop=a-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}else if(!(0,v.isNullOrUndefined)(this.liCollections)){var o=this.activeIndex,r="down"===e.action?this.activeIndex+1:this.activeIndex-1;r=t?o:r;var h=0;"autocomplete"===this.getModuleName()&&(h="down"===e.action&&(0,v.isNullOrUndefined)(this.activeIndex)?0:this.liCollections.length-1,r=r<0?this.liCollections.length-1:r===this.liCollections.length?0:r);var u=void 0;if("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)if(this.enableVirtualization)if(t)if("autocomplete"===this.getModuleName()){i=this.getFormattedValue(this.selectedLI.getAttribute("data-value"));u=this.getElementByValue(i)}else u=this.getElementByValue(this.getItemData().value);else u=(0,v.isNullOrUndefined)(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[r],u=(0,v.isNullOrUndefined)(u)||u.classList.contains("e-virtual-list")?null:u;else u=(0,v.isNullOrUndefined)(this.activeIndex)?this.liCollections[h]:this.liCollections[r];if((0,v.isNullOrUndefined)(u)){if(this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===e.action||0!==this.viewPortInfo.startIndex&&"up"===e.action)){if("down"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;i="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null;(p=this.getDataByValue(i))&&(this.itemData=p)}else if("up"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex-this.itemCount>0?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;var p;i="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null;(p=this.getDataByValue(i))&&(this.itemData=p)}this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(e,this.pageCount)}}else{var d=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus");if(this.setSelection(u,e),d&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!t){a=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;a=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-a:a-this.selectedLI.offsetHeight,this.list.scrollTop=a-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}}if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){i=this.getItemData().value,s=this.getIndexByValueFilter(i,this.actionCompleteData.ulElement);(0,v.isNullOrUndefined)(s)||(this.activeIndex=s)}this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&((0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(r=0;r<this.liCollections.length;r++)if(this.liCollections[r].classList.contains(T.focus)||this.liCollections[r].classList.contains(T.selected)){l=r;break}null!=l&&this.isDisabledElement(this.liCollections[l])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===l&&"down"===e.action&&(e.action="up"),0===l&&"up"===e.action&&(e.action="down")),this.updateUpDownAction(e)),e.preventDefault()}},t.prototype.updateHomeEndAction=function(e,t){if("dropdownlist"===this.getModuleName()){var i=0;if("home"===e.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),e.preventDefault(),this.activeIndex===i)return void(t&&this.setSelection(this.liCollections[i],e));if(!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled"))return;this.setSelection(this.liCollections[i],e)}},t.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},t.prototype.mobileKeyActionHandler=function(e){if(this.enabled&&(!this.isEditTextBox()||this.isPopupOpen)&&!this.readonly){if(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),(0,v.isNullOrUndefined)(this.list)||!(0,v.isNullOrUndefined)(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},t.prototype.handleVirtualKeyboardActions=function(e,t){switch(e.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(e,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),e,!0),e.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection((0,v.isNullOrUndefined)(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),e,!0),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e,!0)}this.keyboardEvent=null},t.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+T.focus);if(this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(e),this.focusDropDown(e)}else this.showPopup()},t.prototype.isSelectFocusItem=function(e){return!(0,v.isNullOrUndefined)(e)},t.prototype.pageUpSelection=function(e,t,i){var s=e>=0?this.liCollections[e+1]:this.liCollections[0];if(!this.enableVirtualization&&s&&s.classList.contains("e-disabled"))for(var l=e>=0?e+1:0;l<this.liCollections.length&&(!(s=this.liCollections[l])||s.classList.contains("e-disabled"));)if(--l<0)return;this.enableVirtualization&&null==this.activeIndex&&(s=this.liCollections.length>=e&&e>=0?this.liCollections[e+this.skeletonCount+1]:this.liCollections[0]),!(0,v.isNullOrUndefined)(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(s,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&((0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},t.prototype.PageUpDownSelection=function(e,t){this.enableVirtualization&&((0,v.isNullOrUndefined)(e)||("autocomplete"===this.getModuleName()||e.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||e.classList.contains("e-item-focus")))||this.setSelection(e,t)},t.prototype.pageDownSelection=function(e,t,i){var s=this.getItems(),l=e<=s.length?this.liCollections[e-1]:this.liCollections[s.length-1];if(!this.enableVirtualization&&l&&l.classList.contains("e-disabled"))for(;e>=0&&e<this.liCollections.length&&(!(l=e<=s.length?this.liCollections[e-1]:this.liCollections[s.length-1])||l.classList.contains("e-disabled"));)e++;this.enableVirtualization&&this.skeletonCount>0&&(l=(e="dropdownlist"===this.getModuleName()&&this.allowFiltering?e+1:e)<s.length?this.liCollections[e]:this.liCollections[s.length-1]),this.enableVirtualization&&null==this.activeIndex&&(l=e<=s.length?this.liCollections[e+this.skeletonCount-1]:this.liCollections[s.length-1]),this.PageUpDownSelection(l,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&((0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},t.prototype.unWireEvent=function(){(0,v.isNullOrUndefined)(this.inputWrapper)||(v.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),v.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),v.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),v.EventHandler.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},t.prototype.unWireListEvents=function(){this.list&&(v.EventHandler.remove(this.list,"click",this.onMouseClick),v.EventHandler.remove(this.list,"mouseover",this.onMouseOver),v.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},t.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},t.prototype.onDocumentClick=function(e){var t=e.target;if(!(0,v.isNullOrUndefined)(this.popupObj)&&(0,v.closest)(t,this.checkSelector(this.popupObj.element.id))||(0,v.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.container.contains(e.target))t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&v.Browser.isDevice&&t===this.inputWrapper.buttons[0]||(this.isPreventBlur=(v.Browser.isIE||"edge"===v.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(T.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var i=this.isRequested;"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(e),this.isInteracted=!1,i||(this.onFocusOut(e),this.inputWrapper.container.classList.remove(T.inputFocus))}},t.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(T.inputFocus))},t.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},t.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&(this.keyboardEvent=null,!this.targetElement().classList.contains(T.disable)&&this.inputWrapper.clearButton!==e.target)){var t=e.target;if(t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen?(this.hidePopup(e),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup(e));var i=this,s=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout((function(){i.cloneElements(),i.isSecondClick=!0,i.isSecondClick=!(i.isReact&&i.isFiltering()&&i.dataSource instanceof g.DataManager&&!i.list.querySelector("ul"))}),s)}}},t.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},t.prototype.updateSelectedItem=function(e,t,i,s){var l=this;this.removeSelection(),e.classList.add(A.selected),this.removeHover();var n=null!==e.getAttribute("data-value")?this.getFormattedValue(e.getAttribute("data-value")):null,a=this.getDataByValue(n);if(this.initial||i||(0,v.isNullOrUndefined)(t))this.selectEventCallback(e,t,i,a,n),s&&this.setSelectOptions(e,t);else{var o=this.detachChanges(a);this.isSelected=!0;var r={e:t,item:e,itemData:o,isInteracted:!!t,cancel:!1};this.trigger("select",r,(function(o){o.cancel?e.classList.remove(A.selected):(l.selectEventCallback(e,t,i,a,n),s&&l.setSelectOptions(e,t))}))}},t.prototype.selectEventCallback=function(e,t,i,s,l){this.previousItemData=(0,v.isNullOrUndefined)(this.itemData)?null:this.itemData,this.itemData!==s&&(this.previousValue=(0,v.isNullOrUndefined)(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=e,this.itemData=s;var n=this.list.querySelector("."+A.focus);if(n&&(0,v.removeClass)([n],A.focus),e.setAttribute("aria-selected","true"),(0,v.isNullOrUndefined)(l)&&(l="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var a=this.getIndexByValueFilter(l,this.actionCompleteData.ulElement);(0,v.isNullOrUndefined)(a)?this.activeIndex=this.getIndexByValue(l):this.activeIndex=a}else this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof g.DataManager&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(l)},t.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(A.selected)&&(this.removeSelection(),e.classList.add(A.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},t.prototype.setValue=function(e){var t=this.getItemData();this.isTouched=!(0,v.isNullOrUndefined)(e),null===t.value?N.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):N.Input.setValue(t.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():(0,v.isNullOrUndefined)(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||((0,v.detach)(this.valueTempElement),this.inputElement.style.display="block"),(0,v.isNullOrUndefined)(t.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(t.value,this.actionCompleteData.ulElement));var i=T.clearIcon,s=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+i);return this.isFiltering()&&s&&s.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===t.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value?this.value:t:t.value?this.getDataByValue(t.value):t])?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},t.prototype.setSelection=function(e,t){if(this.isValidLI(e)&&(!e.classList.contains(A.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(A.selected)))this.updateSelectedItem(e,t,!1,!0);else if(this.setSelectOptions(e,t),this.enableVirtualization&&this.value){var i,s=this.isPrimitiveData?"":this.fields.value,l=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof g.DataManager){if((i=new g.DataManager(this.virtualGroupDataSource).executeLocal((new g.Query).where(new g.Predicate(s,"equal",l))))&&i.length>0){this.itemData=i[0];var n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value;(this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text?n.text.toString():n.text,value:a})}}else if((i=new g.DataManager(this.dataSource).executeLocal((new g.Query).where(new g.Predicate(s,"equal",l))))&&i.length>0){this.itemData=i[0];n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value;(this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text?n.text.toString():n.text,value:a})}}},t.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=(0,v.isNullOrUndefined)(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(t)||((!this.isPopupOpen&&!(0,v.isNullOrUndefined)(e)||this.isPopupOpen&&!(0,v.isNullOrUndefined)(t)&&("keydown"!==t.type||"keydown"===t.type&&"enter"===t.action))&&(this.isSelectCustom=!1,this.onChangeEvent(t)),!this.isPopupOpen||(0,v.isNullOrUndefined)(this.selectedLI)||null===this.itemData||t&&"click"===t.type||this.setScrollPosition(t),"mozilla"!==v.Browser.info.name&&this.targetElement()&&((0,v.attributes)(this.targetElement(),{"aria-describedby":""!==this.inputElement.id?this.inputElement.id:this.element.id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},t.prototype.dropdownCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},t.prototype.setValueTemplate=function(){this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement&&((0,v.detach)(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null)),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:T.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var e=this.dropdownCompiler(this.valueTemplate),t=("function"!=typeof this.valueTemplate&&e?(0,v.compile)(document.querySelector(this.valueTemplate).innerHTML.trim()):(0,v.compile)(this.valueTemplate))(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);t&&t.length>0&&(0,v.append)(t,this.valueTempElement),this.renderReactTemplates()},t.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+A.selected);e.length&&((0,v.removeClass)(e,A.selected),e[0].removeAttribute("aria-selected"))}},t.prototype.getItemData=function(){var e,t,i,s=this.fields;return e=this.itemData,(0,v.isNullOrUndefined)(e)||(t=(0,v.getValue)(s.value,e),i=(0,v.getValue)(s.text,e)),{value:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:t,text:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:i}},t.prototype.onChangeEvent=function(e,t){var i=this,s=this.getItemData(),l=this.isSelectCustom?null:this.activeIndex;if(this.enableVirtualization){var n=this.dataSource instanceof g.DataManager?this.virtualGroupDataSource:this.dataSource;if(s.value&&n&&n.length>0){var a=n.findIndex((function(e){return!(0,v.isNullOrUndefined)(s.value)&&(0,v.getValue)(i.fields.value,e)===s.value}));-1!==a&&(l=a)}}var o=this.allowObjectBinding?t?this.value:this.getDataByValue(s.value):s.value;this.setProperties({index:l,text:s.text?s.text.toString():s.text,value:o},!0),this.detachChangeEvent(e)},t.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},t.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=(0,v.isNullOrUndefined)(this.text)?"":this.text,!this.initial){var t=this.detachChanges(this.itemData),i=void 0;i="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue();var s={e,item:this.item,itemData:t,previousItem:this.previousSelectedLI,previousItemData:i,isInteracted:!!e,value:this.value,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",s)}!(0,v.isNullOrUndefined)(this.value)&&""!==this.value||"Always"===this.floatLabelType||(0,v.removeClass)([this.inputWrapper.container],"e-valid-input")},t.prototype.setHiddenValue=function(){if((0,v.isNullOrUndefined)(this.value))this.hiddenElement.innerHTML="";else{var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;if(this.hiddenElement.querySelector("option"))(t=this.hiddenElement.querySelector("option")).textContent=this.text,t.setAttribute("value",e.toString());else if(!(0,v.isNullOrUndefined)(this.hiddenElement)){var t,i=document.createElement("option");i.text=this.text,i.setAttribute("selected",""),this.hiddenElement.appendChild(i),(t=this.hiddenElement.querySelector("option")).setAttribute("value",e.toString())}}},t.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,this.filterArgs=e,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,"autocomplete"!==this.getModuleName()||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])||(0,v.attributes)(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0||""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName()&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName()&&this.hidePopup())),e.preventDefault();break;default:this.isFiltering()&&"combobox"===this.getModuleName()&&(0,v.isNullOrUndefined)(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(e),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof g.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof g.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},t.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},t.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},t.prototype.getQuery=function(e){var t;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){t=e?e.clone():this.query?this.query.clone():new g.Query;var i=""===this.typedString?"contains":this.filterType,s=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==s)&&"number"!==s){if("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString){var l=this.fields.text?this.fields.text:"";t.where(l,i,this.typedString,this.ignoreCase,this.ignoreAccent)}}else t.where("",i,this.typedString,this.ignoreCase,this.ignoreAccent)}else t=this.enableVirtualization&&!(0,v.isNullOrUndefined)(this.customFilterQuery)?this.customFilterQuery.clone():e?e.clone():this.query?this.query.clone():new g.Query;if(this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var n=this.getTakeValue(),a=!1;if(t)for(var o=0;o<t.queries.length;o++)if("onSkip"===t.queries[o].fn){a=!0;break}var r=0,h=0;if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)"onSkip"===t.queries[o].fn&&(h=t.queries[o].e.nos),"onTake"===t.queries[o].fn&&(r=n<=t.queries[o].e.nos?t.queries[o].e.nos:n);if(r<=0&&this.query&&this.query.queries.length>0)for(o=0;o<this.query.queries.length;o++)"onTake"===this.query.queries[o].fn&&(r=n<=this.query.queries[o].e.nos?this.query.queries[o].e.nos:n);if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)"onSkip"!==t.queries[o].fn?"onTake"===t.queries[o].fn&&(r=t.queries[o].e.nos<=r?r:t.queries[o].e.nos,t.queries.splice(o,1),--o):(h=t.queries[o].e.nos,t.queries.splice(o,1),a=!1,--o);!this.allowFiltering&&this.isPopupOpen&&a||(h>0?t.skip(h):t.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?t.take(this.incrementalEndIndex):r>0?t.take(r):t.take(n),t.requiresCount()}return t},t.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},t.prototype.searchLists=function(e){var t=this;(this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+T.clearIcon))&&(this.filterInput.parentElement.querySelector("."+T.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible");if(this.isDataFetched=!1,this.isFiltering()){this.checkAndResetCache(),this.isRequesting=!1;var i={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,t.customFilterQuery=s?s.clone():s,t.filteringAction(e,s,l))},baseEventArgs:e,cancel:!1};this.trigger("filtering",i,(function(e){e.cancel||t.isCustomFilter||e.preventDefaultAction||t.filteringAction(t.dataSource,null,t.fields)}))}},t.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},t.prototype.filteringAction=function(e,t,i){if(!(0,v.isNullOrUndefined)(this.filterInput)){this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData);var s=this.list.classList.contains(A.noData);if(""!==this.filterInput.value.trim()||this.itemTemplate){if(this.isNotSearchList=!1,t=""===this.filterInput.value.trim()?null:t,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(A.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),(0,v.attributes)(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&s&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),!this.list.querySelector(".e-virtual-ddl"))){l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)}}else{if(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,!(0,v.isNullOrUndefined)(this.actionCompleteData.ulElement)&&!(0,v.isNullOrUndefined)(this.actionCompleteData.list)){if(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),s&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),!this.list.querySelector(".e-virtual-ddl")))){var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)}this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)}this.isTyped=!0,(0,v.isNullOrUndefined)(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0}this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements()}},t.prototype.setSearchBox=function(e){if(this.isFiltering()){var t=e.querySelector("."+T.filterParent)?e.querySelector("."+T.filterParent):this.createElement("span",{className:T.filterParent});this.filterInput=this.createElement("input",{attrs:{type:"text"},className:T.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var i=!1;return v.Browser.isDevice&&this.isDeviceFullScreen&&(i=!0),this.filterInputObj=N.Input.createInput({element:this.filterInput,buttons:i?[T.backIcon,T.filterBarClearIcon]:[T.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),(0,v.isNullOrUndefined)(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?(0,v.addClass)([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&(0,v.addClass)([this.filterInputObj.container],"e-filled")),(0,v.append)([this.filterInputObj.container],t),(0,v.prepend)([t],e),(0,v.attributes)(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+T.clearIcon),!v.Browser.isDevice&&this.clearIconElement&&(v.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),v.Browser.isDevice?this.searchKeyModule=new v.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new v.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),v.EventHandler.add(this.filterInput,"input",this.onInput,this),v.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),v.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),v.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),v.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return V},t.prototype.onInput=function(e){!(0,v.isNullOrUndefined)(e)&&!(0,v.isNullOrUndefined)(e.data)&&e.data.length>1&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=e.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),v.Browser.isDevice&&"mozilla"===v.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},t.prototype.pasteHandler=function(e){var t=this;setTimeout((function(){t.typedString=t.filterInput.value,"combobox"===t.getModuleName()&&t.isFiltering()&&(0,v.isNullOrUndefined)(t.list)&&t.renderList(),t.searchLists(e)}))},t.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},t.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&v.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},t.prototype.onActionComplete=function(t,i,s,l){var n=this;if(this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(s)&&!this.virtualGroupDataSource&&(this.totalItemCount=s.count),!this.isNotSearchList||this.enableVirtualization){if(this.getInitialData)return this.updateActionCompleteDataValues(t,i),this.getInitialData=!1,this.isReactTemplateUpdate=!0,void this.searchLists(this.filterArgs);var a=this.itemCount;if(this.isActive||!(0,v.isNullOrUndefined)(t)){var o=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,t,i,s),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!(0,v.isNullOrUndefined)(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!(0,v.isNullOrUndefined)(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),(0,v.isNullOrUndefined)(t)||(0,v.attributes)(t,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender){if(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,this.value&&this.dataSource instanceof g.DataManager){var r=(0,v.isNullOrUndefined)(this.fields.value)?this.fields.text:this.fields.value,h=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(r,this.value):this.value,u=this.fields.value.split("."),p=i.some((function(e){return(0,v.isNullOrUndefined)(e[r])&&u.length>1?n.checkFieldValue(e,u)===h:e[r]===h}));this.enableVirtualization&&this.virtualGroupDataSource&&(p=this.virtualGroupDataSource.some((function(e){return(0,v.isNullOrUndefined)(e[r])&&u.length>1?n.checkFieldValue(e,u)===h:e[r]===h}))),p?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new g.Predicate(r,"equal",h))).then((function(e){e.result.length>0?(n.addItem(e.result,i.length),n.updateValues()):n.updateValues()}))}else this.updateValues();this.initial=!1}else"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue();if("autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped){if((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||(0,v.isNullOrUndefined)(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof g.DataManager||!(0,v.isNullOrUndefined)(this.dataSource)&&!(0,v.isNullOrUndefined)(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout((function(){n.updateActionCompleteDataValues(t,i)}),0):this.updateActionCompleteDataValues(t,i)),this.isDynamicData){var d=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(d),this.selectedLI=this.getElementByValue(d),this.isDynamicData=!1}if((this.allowCustom||this.allowFiltering&&!this.isValueInList(i,this.value)&&this.dataSource instanceof g.DataManager)&&!this.enableVirtualization)this.addNewItem(i,o);else if((this.allowCustom||this.allowFiltering&&this.isValueInList(i,this.value))&&!this.enableVirtualization){var c=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;!(0,v.isNullOrUndefined)(this.value)&&o&&o.getAttribute("data-value")===c.toString()&&this.addNewItem(i,o)}(!(0,v.isNullOrUndefined)(this.itemData)||(0,v.isNullOrUndefined)(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(t,i)}else if(this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()){c=this.getItemData().value;this.activeIndex=this.getIndexByValue(c);var m=this.findListElement(this.list,"li","data-value",c);this.selectedLI=m}else this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount);this.beforePopupOpen&&(this.renderPopup(s),this.enableVirtualization&&(this.list.querySelector(".e-virtual-list")||(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"))),this.enableVirtualization&&a!==this.itemCount&&this.resetList(this.dataSource,this.fields))}}else this.isNotSearchList=!1},t.prototype.isValueInList=function(e,t){if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return!0}else if("object"==typeof e&&null!==e)for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===t)return!0;return!1},t.prototype.checkFieldValue=function(e,t){var i=e;return t.forEach((function(e){i=i[e]})),i},t.prototype.updateActionCompleteDataValues=function(e,t){this.actionCompleteData={ulElement:e.cloneNode(!0),list:t,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},t.prototype.addNewItem=function(e,t){var i=this;if(!(0,v.isNullOrUndefined)(this.itemData)&&!(0,v.isNullOrUndefined)(t)){var s=this.getItemData().value;e.some((function(e){return("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&e===s||(0,v.getValue)(i.fields.value,e)===s}))||this.addItem(this.itemData)}},t.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout((function(){s.actionCompleteDataUpdate(e,t,i)}),0):this.actionCompleteDataUpdate(e,t,i))},t.prototype.actionCompleteDataUpdate=function(e,t,i){null!==i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},t.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.enableVirtualization&&!(0,v.isNullOrUndefined)(e)||!this.enableVirtualization?this.getIndexByValue(e):this.activeIndex;var t=this.findListElement(this.list,"li","data-value",e);this.selectedLI=t,this.activeItem(t),this.enableVirtualization&&(0,v.isNullOrUndefined)(t)||this.removeFocus()},t.prototype.updateSelection=function(){var e=this.list.querySelector("."+A.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+A.li).classList.add(T.focus))},t.prototype.updateSelectionList=function(){if(!(this.list&&this.list.querySelector(".e-active"))&&!(0,v.isNullOrUndefined)(this.value)&&"autocomplete"!==this.getModuleName()){var e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,t=this.findListElement(this.list,"li","data-value",e);t&&t.classList.add("e-active")}},t.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+T.focus);e&&e.length&&(0,v.removeClass)(e,T.focus)},t.prototype.renderPopup=function(e){var t=this;if(this.popupObj&&document.body.contains(this.popupObj.element))this.refreshPopup();else{this.trigger("beforeOpen",{cancel:!1},(function(i){if(i.cancel)t.beforePopupOpen=!1;else{var s=t.createElement("div",{id:t.element.id+"_popup",className:"e-ddl e-popup "+(null!==t.cssClass?t.cssClass:"")});s.setAttribute("aria-label",t.element.id),s.setAttribute("role","dialog");var l=t.setSearchBox(s);if(t.listContainerHeight=t.allowFiltering&&"dropdownlist"===t.getModuleName()&&v.Browser.isDevice?(0,v.formatUnit)(Math.round(window.outerHeight).toString()+"px"):(0,v.formatUnit)(t.popupHeight),t.headerTemplate&&(t.setHeaderTemplate(s),t.isUpdateHeaderHeight=0!==t.header.offsetHeight),(0,v.append)([t.list],s),t.footerTemplate&&(t.setFooterTemplate(s),t.isUpdateFooterHeight=0!==t.footer.offsetHeight),document.body.appendChild(s),s.style.top="0px",t.enableVirtualization&&t.itemTemplate){var n=s.querySelectorAll("li.e-list-item:not(.e-virtual-list)");t.listItemHeight=n.length>0?Math.ceil(n[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(n[0]).marginBottom,10):0}if(t.enableVirtualization&&!t.list.classList.contains(A.noData))if(t.getSkeletonCount(),t.skeletonCount=t.totalItemCount<2*t.itemCount&&(!(t.dataSource instanceof g.DataManager)||t.dataSource instanceof g.DataManager&&t.totalItemCount<=t.itemCount)?0:t.skeletonCount,t.list.querySelector(".e-virtual-ddl-content")?t.list.getElementsByClassName("e-virtual-ddl-content")[0].style=t.getTransformValues():t.list.appendChild(t.createElement("div",{className:"e-virtual-ddl-content",styles:t.getTransformValues()})).appendChild(t.list.querySelector(".e-list-parent")),t.UpdateSkeleton(),t.liCollections=t.list.querySelectorAll("."+A.li),t.virtualItemCount=t.itemCount,t.list.querySelector(".e-virtual-ddl"))t.list.getElementsByClassName("e-virtual-ddl")[0].style=t.GetVirtualTrackHeight();else{var a=t.createElement("div",{id:t.element.id+"_popup",className:"e-virtual-ddl",styles:t.GetVirtualTrackHeight()});s.querySelector(".e-dropdownbase").appendChild(a)}if(s.style.visibility="hidden","auto"!==t.popupHeight){if(t.searchBoxHeight=0,(0,v.isNullOrUndefined)(l.container)||"combobox"===t.getModuleName()||"autocomplete"===t.getModuleName()||(t.searchBoxHeight=l.container.parentElement.getBoundingClientRect().height,t.listContainerHeight=(parseInt(t.listContainerHeight,10)-t.searchBoxHeight).toString()+"px"),t.headerTemplate){t.header=t.header?t.header:s.querySelector(".e-ddl-header");var o=Math.round(t.header.getBoundingClientRect().height);t.listContainerHeight=(parseInt(t.listContainerHeight,10)-(o+t.searchBoxHeight)).toString()+"px"}if(t.footerTemplate){t.footer=t.footer?t.footer:s.querySelector(".e-ddl-footer");o=Math.round(t.footer.getBoundingClientRect().height);t.listContainerHeight=(parseInt(t.listContainerHeight,10)-(o+t.searchBoxHeight)).toString()+"px"}t.list.style.maxHeight=(parseInt(t.listContainerHeight,10)-2).toString()+"px",s.style.maxHeight=(0,v.formatUnit)(t.popupHeight)}else s.style.height="auto";var r=0,h=void 0;if(t.isPreventScrollAction=!0,!(0,v.isNullOrUndefined)(t.selectedLI)&&!(0,v.isNullOrUndefined)(t.activeIndex)&&t.activeIndex>=0||t.enableVirtualization?t.setScrollPosition():t.list.scrollTop=0,v.Browser.isDevice&&t.isDeviceFullScreen&&!t.allowFiltering&&("dropdownlist"===t.getModuleName()||t.isDropDownClick&&"combobox"===t.getModuleName())){r=t.getOffsetValue(s);var u=t.isEmptyList()?t.list:t.liCollections[0];(0,v.isNullOrUndefined)(t.inputElement)||(h=-(parseInt(getComputedStyle(u).textIndent,10)-parseInt(getComputedStyle(t.inputElement).paddingLeft,10)+parseInt(getComputedStyle(t.inputElement.parentElement).borderLeftWidth,10)))}t.createPopup(s,r,h),t.popupContentElement=t.popupObj.element.querySelector(".e-content"),t.getFocusElement(),t.checkCollision(s),v.Browser.isDevice&&(parseInt(t.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==t.getModuleName()||!t.allowFiltering)&&t.popupObj.element.classList.add("e-wide-popup"),t.popupObj.element.classList.add(T.device),("dropdownlist"===t.getModuleName()||"combobox"===t.getModuleName()&&!t.allowFiltering&&t.isDropDownClick)&&(t.popupObj.collision={X:"fit",Y:"fit"}),t.isFilterLayout()&&t.isDeviceFullScreen&&(t.popupObj.element.classList.add(T.mobileFilter),t.popupObj.position={X:0,Y:0},t.popupObj.dataBind(),(0,v.attributes)(t.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),(0,v.addClass)([document.body,t.popupObj.element],T.popupFullScreen),t.setSearchBoxPosition(),t.backIconElement=l.container.querySelector(".e-back-icon"),t.clearIconElement=l.container.querySelector("."+T.clearIcon),v.EventHandler.add(t.backIconElement,"click",t.clickOnBackIcon,t),v.EventHandler.add(t.clearIconElement,"click",t.clearText,t))),s.style.visibility="visible",(0,v.addClass)([s],"e-popup-close");for(var p=0,d=t.popupObj.getScrollableParent(t.inputWrapper.container);p<d.length;p++){var c=d[p];v.EventHandler.add(c,"scroll",t.scrollHandler,t)}(0,v.isNullOrUndefined)(t.list)||(t.unWireListEvents(),t.wireListEvents()),t.selectedElementID=t.selectedLI?t.selectedLI.id:null,t.enableVirtualization&&(t.notify("bindScrollEvent",{module:"VirtualScroll",component:t.getModuleName(),enable:t.enableVirtualization}),setTimeout((function(){(t.value||t.list.querySelector(".e-active"))&&(t.updateSelectionList(),t.selectedValueInfo&&t.viewPortInfo&&t.viewPortInfo.offsets.top?t.list.scrollTop=t.viewPortInfo.offsets.top:t.scrollBottom(!0,!0))}),5)),(0,v.attributes)(t.targetElement(),{"aria-expanded":"true","aria-owns":t.element.id+"_popup","aria-controls":t.element.id}),"dropdownlist"!==t.getModuleName()&&t.list.classList.contains("e-nodata")&&((0,v.attributes)(t.targetElement(),{"aria-activedescendant":"no-record"}),t.popupContentElement.setAttribute("role","status"),t.popupContentElement.setAttribute("id","no-record")),t.inputElement.setAttribute("aria-expanded","true"),t.inputElement.setAttribute("aria-controls",t.element.id+"_popup");var m=t.isFiltering()?t.filterInput.parentElement:t.inputWrapper.container;(0,v.addClass)([m],[T.inputFocus]);t.beforePopupOpen=!0;var f={popup:t.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}};if(t.trigger("open",f,(function(e){e.cancel?(t.beforePopupOpen=!1,t.destroyPopup()):((0,v.isNullOrUndefined)(t.inputWrapper)||(0,v.addClass)([t.inputWrapper.container],[T.iconAnimation]),t.renderReactTemplates(),t.isReact&&t.isFiltering()&&t.dataSource instanceof g.DataManager&&t.list.querySelector("ul")&&!t.isSecondClick&&t.executeCloneElements(),(0,v.isNullOrUndefined)(t.popupObj)||t.popupObj.show(new v.Animation(e.animation),1e3===t.zIndex?t.element:null),t.isReact&&setTimeout((function(){if(t.popupHeight&&t.list&&"auto"!==t.popupHeight&&("dropdownlist"!==t.getModuleName()||!t.allowFiltering)){var e="string"==typeof t.popupHeight?parseInt(t.popupHeight,10):t.popupHeight;if(!t.isUpdateHeaderHeight&&t.headerTemplate&&t.header){var i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.header.offsetHeight).toString()+"px",t.isUpdateHeaderHeight=!0}if(!t.isUpdateFooterHeight&&t.footerTemplate&&t.footer){i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.footer.offsetHeight).toString()+"px",t.isUpdateFooterHeight=!0}}}),15))})),t.allowResize&&("dropdownlist"!==t.getModuleName()||!(v.Browser.isDevice&&t.isDeviceFullScreen&&t.allowFiltering))){t.resizer=t.createElement("div",{id:t.element.id+"_resize-popup",className:T.resizeIcon}),t.list&&t.list.parentElement&&(t.list.parentElement.classList.add("e-resize"),"auto"!==t.popupHeight.toString().toLowerCase()&&(t.list.parentElement.style.height="100%"),t.list.parentElement.style.paddingBottom="dropdownlist"===t.getModuleName()&&t.allowFiltering&&t.searchBoxHeight?(t.searchBoxHeight+16).toString()+"px":16..toString()+"px",(t.header||t.footer||t.itemTemplate)&&(t.list.parentElement.style.paddingBottom=(parseInt(t.list.parentElement.style.maxHeight,10)-parseInt(t.list.style.maxHeight,10)+16).toString()+"px"),t.list.parentElement.appendChild(t.resizer),t.list.parentElement.style.width=t.resizeWidth+"px",t.list.parentElement.style.height=t.resizeHeight+"px",t.list.parentElement.style.maxHeight=t.resizeHeight+"px",t.list.style.maxHeight=t.resizeHeight+"px"),v.EventHandler.add(t.resizer,"mousedown",t.startResizing,t),v.EventHandler.add(t.resizer,"touchstart",t.startResizing,t)}}}))}},t.prototype.checkCollision=function(e){(!v.Browser.isDevice||v.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&((0,k.isCollide)(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},t.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},t.prototype.createPopup=function(e,t,i){var s=this;this.popupObj=new k.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){s.isDocumentClick||s.focusDropDown(),s.isReact&&s.clearTemplate(["headerTemplate","footerTemplate"]),s.isNotSearchList=!1,s.isDocumentClick=!1,s.destroyPopup(),s.isFiltering()&&s.actionCompleteData.list&&s.actionCompleteData.list.length>0?(s.isActive=!0,s.isReactTemplateUpdate&&s.isReact&&s.itemTemplate&&!s.enableVirtualization&&(s.actionCompleteData.ulElement=s.renderItems(s.actionCompleteData.list,s.fields),s.isReactTemplateUpdate=!1),s.enableVirtualization?s.onActionComplete(s.ulElement,s.listData,null,!0):s.onActionComplete(s.actionCompleteData.ulElement,s.actionCompleteData.list,null,!0)):s.enableVirtualization&&s.focusIndexItem()},open:function(){v.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0;var e=s.actionCompleteData&&s.actionCompleteData.ulElement&&s.actionCompleteData.ulElement.querySelector("li"),t=s.list.querySelector("ul li");(0,v.isNullOrUndefined)(s.ulElement)||(0,v.isNullOrUndefined)(s.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(s.ulElement)||(0,v.isNullOrUndefined)(s.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-item-focus")[0].id}),s.isFiltering()&&s.itemTemplate&&s.element.tagName===s.getNgDirective()&&e&&t&&e.textContent!==t.textContent&&"EJS-COMBOBOX"!==s.element.tagName&&s.cloneElements(),s.isFilterLayout()&&((0,v.removeClass)([s.inputWrapper.container],[T.inputFocus]),s.isFilterFocus=!0,s.filterInput.focus(),s.inputWrapper.clearButton&&(0,v.addClass)([s.inputWrapper.clearButton],T.clearIconHide)),s.activeStateChange()},targetExitViewport:function(){v.Browser.isDevice||s.hidePopup()}})},t.prototype.isEmptyList=function(){return!(0,v.isNullOrUndefined)(this.liCollections)&&0===this.liCollections.length},t.prototype.getFocusElement=function(){},t.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},t.prototype.scrollHandler=function(){v.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},t.prototype.isElementInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth},t.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height;this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px";var t=this.filterInput.parentElement.querySelector("."+T.clearIcon);(0,v.detach)(this.filterInput),t.parentElement.insertBefore(this.filterInput,t)},t.prototype.setPopupPosition=function(e){var t,i=e,s=this.list.querySelector("."+T.focus)||this.selectedLI,l=this.isEmptyList()?this.list:this.liCollections[0],n=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],a=l.getBoundingClientRect().height;this.listItemHeight=a+parseInt(window.getComputedStyle(l).marginBottom,10);var o=this.list.offsetHeight/2,r=(0,v.isNullOrUndefined)(s)?l.offsetTop:s.offsetTop;if(n.offsetTop-o<r&&!(0,v.isNullOrUndefined)(this.liCollections)&&this.liCollections.length>0&&!(0,v.isNullOrUndefined)(s)){var h=this.list.offsetHeight/a,u=parseInt(getComputedStyle(this.list).paddingBottom,10);t=(h-(this.liCollections.length-this.activeIndex))*a-i+u,this.list.scrollTop=s.offsetTop}else r>o&&!this.enableVirtualization?(t=o-a/2,this.list.scrollTop=r-o+a/2):t=r;return-(t=t+a+i-(a-this.inputWrapper.container.offsetHeight)/2)},t.prototype.setWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px");if(v.Browser.isDevice&&e.indexOf("px")>-1&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var t=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(t).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},t.prototype.scrollBottom=function(e,t,i){var s=this;if(void 0===t&&(t=!1),void 0===i&&(i=null),(0,v.isNullOrUndefined)(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+A.li),!(0,v.isNullOrUndefined)(this.selectedLI)&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount])),!(0,v.isNullOrUndefined)(this.selectedLI)){var l=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0;this.isUpwardScrolling=!1;var n=this.list.querySelectorAll(".e-virtual-list").length,a=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+l):this.selectedLI.offsetTop,r=this.list.offsetHeight,h=o-n*(this.selectedLI.offsetHeight+l)+(this.selectedLI.offsetHeight+l)-this.list.scrollTop,u=this.list.scrollTop+h-r,p=!1;u=e?u+2*parseInt(getComputedStyle(this.list).paddingTop,10):u+parseInt(getComputedStyle(this.list).paddingTop,10);var d=o-n*(this.selectedLI.offsetHeight+l)+(this.selectedLI.offsetHeight+l)-this.list.scrollTop;if(d=this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?d-this.fixedHeaderElement.offsetHeight:d,0!==this.activeIndex||this.enableVirtualization){if(h>r||!(d>0&&this.list.offsetHeight>d)){var c=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,m="pageDown"===i?this.getPageCount()-2:1;!this.enableVirtualization||this.isKeyBoardAction||t?this.isKeyBoardAction&&this.enableVirtualization&&a&&c===a&&"end"!==i&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=u:(this.enableVirtualization&&(m="pageDown"===i?this.getPageCount()+1:m),this.list.scrollTop+=(this.selectedLI.offsetHeight+l)*m),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===i?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=u):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?e&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,p=this.isKeyBoardAction}}else this.list.scrollTop=0,p=this.isKeyBoardAction;this.isKeyBoardAction=p,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===i&&setTimeout((function(){s.scrollStop(null,!0)}),100)}},t.prototype.scrollTop=function(e){if(void 0===e&&(e=null),!(0,v.isNullOrUndefined)(this.selectedLI)){var t=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,i=this.list.querySelectorAll(".e-virtual-list").length,s=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+t):this.selectedLI.offsetTop,l=s-i*(this.selectedLI.offsetHeight+t)-this.list.scrollTop,n=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;l=this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?l-this.fixedHeaderElement.offsetHeight:l;var a=s-i*(this.selectedLI.offsetHeight+t)+(this.selectedLI.offsetHeight+t)-this.list.scrollTop,o=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&l<=0;if(0!==this.activeIndex||this.enableVirtualization)if(l<0||o){var r=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,h="pageUp"===e?this.getPageCount()-2:1;this.enableVirtualization&&(h="pageUp"===e?this.getPageCount():h),this.enableVirtualization&&this.isKeyBoardAction&&n&&r===n&&"home"!==e&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+t)*h,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===e?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===e&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+l)}else a>0&&this.list.offsetHeight>a||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0}},t.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},t.prototype.isEditTextBox=function(){return!1},t.prototype.isFiltering=function(){return this.allowFiltering},t.prototype.isPopupButton=function(){return!0},t.prototype.setScrollPosition=function(e){if(this.isPreventScrollAction=!0,(0,v.isNullOrUndefined)(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,e.action);break;default:this.isKeyBoardAction="up"===e.action||"pageUp"===e.action||"open"===e.action,this.scrollTop(e.action)}this.isKeyBoardAction=!1},t.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},t.prototype.setEleWidth=function(e){(0,v.isNullOrUndefined)(e)||("number"==typeof e?this.inputWrapper.container.style.width=(0,v.formatUnit)(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:(0,v.formatUnit)(e)))},t.prototype.closePopup=function(e,t){var i=this,s=!(0,v.isNullOrUndefined)(this.filterInput)&&!(0,v.isNullOrUndefined)(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var l=0,n=this.popupObj.getScrollableParent(this.inputWrapper.container);l<n.length;l++){var a=n[l];v.EventHandler.remove(a,"scroll",this.scrollHandler)}v.Browser.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&(0,v.removeClass)([document.body,this.popupObj.element],T.popupFullScreen),this.isFilterLayout()&&(v.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&v.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(v.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),v.EventHandler.remove(this.clearIconElement,"click",this.clearText)),(0,v.isNullOrUndefined)(this.filterInput)||(v.EventHandler.remove(this.filterInput,"input",this.onInput),v.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),v.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),v.EventHandler.remove(this.filterInput,"blur",this.onBlurHandler),v.EventHandler.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),(0,v.attributes)(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(T.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&this.viewPortInfo.endIndex>0?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!(0,v.isNullOrUndefined)(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!(0,v.isNullOrUndefined)(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;var o,r={name:"FadeOut",duration:100,delay:e||0},h={popup:this.popupObj,cancel:!1,animation:r,event:t||null};this.trigger("close",h,(function(e){if("dropdownlist"===i.getModuleName()&&N.Input.destroy({element:i.filterInput,floatLabelType:i.floatLabelType,properties:{placeholder:i.filterBarPlaceholder},buttons:i.clearIconElement},i.clearIconElement),i.filterInputObj=null,!(0,v.isNullOrUndefined)(i.popupObj)&&!(0,v.isNullOrUndefined)(i.popupObj.element.querySelector(".e-fixed-head"))){var t=i.popupObj.element.querySelector(".e-fixed-head");t.parentNode.removeChild(t),i.fixedHeaderElement=null}e.cancel||("autocomplete"===i.getModuleName()&&i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new v.Animation(e.animation)):i.destroyPopup())})),v.Browser.isDevice&&!h.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup"),o=this.dataSource instanceof g.DataManager?this.virtualGroupDataSource&&this.virtualGroupDataSource.length?this.virtualGroupDataSource.length:0:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.enableVirtualization&&this.isFiltering()&&s&&this.totalItemCount!==o&&(this.updateInitialData(),this.checkAndResetCache())}},t.prototype.updateInitialData=function(){var e=this.selectData;if(!(0,v.isNullOrUndefined)(e)){var t=this.renderItems(e,this.fields);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof g.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement){var i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(i)}"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=e,this.updateActionCompleteDataValues(t,e),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},t.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(v.EventHandler.remove(this.resizer,"mousedown",this.startResizing),v.EventHandler.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),(0,v.detach)(this.popupObj.element))},t.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},t.prototype.render=function(){this.preselectedIndex=(0,v.isNullOrUndefined)(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,(0,v.isNullOrUndefined)(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),(0,v.isNullOrUndefined)(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass;(0,v.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!(0,v.isNullOrUndefined)((0,v.closest)(this.element,"fieldset"))&&(0,v.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=N.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[T.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:T.hiddenElement}}),(0,v.prepend)([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=(0,v.formatUnit)(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&N.Input.calculateWidth(this.inputElement,this.inputWrapper.container),!(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var t=this.element.getAttribute("id")?this.element.getAttribute("id"):(0,v.getUniqueID)("ej2_dropdownlist");if(this.element.id=t,this.hiddenElement.id=t+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||(0,v.attributes)(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),(0,v.attributes)(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text)this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index&&(this.activeIndex=this.index+this.skeletonCount)),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount);else if("SELECT"===this.element.tagName&&this.element.options[0]){var i=this.element;this.value=this.allowObjectBinding?this.getDataByValue(i.options[i.selectedIndex].value):i.options[i.selectedIndex].value,this.text=(0,v.isNullOrUndefined)(this.value)?null:i.options[i.selectedIndex].textContent,this.initValue()}this.setEnabled(),this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),(0,v.isNullOrUndefined)(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false");var s=this.inputWrapper.container.getElementsByClassName("e-float-text")[0];(0,v.isNullOrUndefined)(this.element.id)||""===this.element.id||(0,v.isNullOrUndefined)(s)||(s.id="label_"+this.element.id.replace(/ /g,"_"),(0,v.attributes)(this.inputElement,{"aria-labelledby":s.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount},t.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=(0,v.formatUnit)(this.popupHeight);e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var s=Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10);return e.remove(),s},t.prototype.setFooterTemplate=function(e){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),(0,v.addClass)([this.footer],T.footer));var t=this.dropdownCompiler(this.footerTemplate),i=("function"!=typeof this.footerTemplate&&t?(0,v.compile)((0,v.select)(this.footerTemplate,document).innerHTML.trim()):(0,v.compile)(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);i&&i.length>0&&(0,v.append)(i,this.footer),(0,v.append)([this.footer],e)},t.prototype.setHeaderTemplate=function(e){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),(0,v.addClass)([this.header],T.header));var t=this.dropdownCompiler(this.headerTemplate),i=("function"!=typeof this.headerTemplate&&t?(0,v.compile)((0,v.select)(this.headerTemplate,document).innerHTML.trim()):(0,v.compile)(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);i&&i.length&&(0,v.append)(i,this.header);var s=e.querySelector("div.e-content");e.insertBefore(this.header,s)},t.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},t.prototype.setOldText=function(e){this.text=e},t.prototype.setOldValue=function(e){this.value=e},t.prototype.refreshPopup=function(){(0,v.isNullOrUndefined)(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||v.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||((0,v.removeClass)([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},t.prototype.checkData=function(e){!e.dataSource||(0,v.isNullOrUndefined)(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof g.DataManager||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var t=-1!==Object.keys(e).indexOf("value")&&(0,v.isNullOrUndefined)(e.value),i=-1!==Object.keys(e).indexOf("text")&&(0,v.isNullOrUndefined)(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(t||i)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!(0,v.isNullOrUndefined)(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!(0,v.isNullOrUndefined)(Object.keys(e.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},t.prototype.updateDataSource=function(e,t){""===this.inputElement.value&&((0,v.isNullOrUndefined)(e)||!(0,v.isNullOrUndefined)(e.dataSource)&&(e.dataSource instanceof g.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),this.fields.groupBy&&e.fields&&!this.isGroupChecking&&this.list&&(v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),v.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this)),((0,v.isNullOrUndefined)(e)||!(0,v.isNullOrUndefined)(e.dataSource)&&(e.dataSource instanceof g.DataManager||0!==e.dataSource.length)||e.dataSource instanceof g.DataManager||!(0,v.isNullOrUndefined)(e)&&Array.isArray(e.dataSource)&&!(0,v.isNullOrUndefined)(t)&&Array.isArray(t.dataSource)&&e.dataSource.length!==t.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},t.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var t=this.getItemData(),i=this.allowObjectBinding?this.itemData:t.value,s=(0,v.isNullOrUndefined)(i)?null:this.index;(0,v.isNullOrUndefined)(s)&&e===i||this.isAngular?this.setProperties({text:t.text?t.text.toString():t.text,value:i}):this.setProperties({text:t.text?t.text.toString():t.text,index:s,value:i})},t.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.onPropertyChanged=function(t,i){var s=this;(0,v.isNullOrUndefined)(t.dataSource)||this.isTouched||!(0,v.isNullOrUndefined)(t.value)||!(0,v.isNullOrUndefined)(t.index)||(0,v.isNullOrUndefined)(this.preselectedIndex)||(0,v.isNullOrUndefined)(this.index)||(t.index=this.index),(0,v.isNullOrUndefined)(t.value)&&(0,v.isNullOrUndefined)(t.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(t),this.setUpdateInitial(["fields","query","dataSource"],t));for(var l=function(l){switch(l){case"query":case"dataSource":n.getSkeletonCount(),n.checkAndResetCache();break;case"htmlAttributes":n.setHTMLAttributes();break;case"width":n.setEleWidth(t.width),N.Input.calculateWidth(n.inputElement,n.inputWrapper.container);break;case"placeholder":N.Input.setPlaceholder(t.placeholder,n.inputElement);break;case"filterBarPlaceholder":n.filterInput&&N.Input.setPlaceholder(t.filterBarPlaceholder,n.filterInput);break;case"readonly":"dropdownlist"!==n.getModuleName()&&N.Input.setReadonly(t.readonly,n.inputElement),n.setReadOnly();break;case"cssClass":n.setCssClass(t.cssClass,i.cssClass),N.Input.calculateWidth(n.inputElement,n.inputWrapper.container);break;case"enableRtl":n.setEnableRtl();break;case"enabled":n.setEnable();break;case"text":if(n.fields.disabled&&(t.text=t.text&&!n.isDisabledItemByIndex(n.getIndexByValue(n.getValueByText(t.text)))?t.text:null),null===t.text){n.clearAll();break}if(n.enableVirtualization){n.updateValues(),n.updateInputFields(),n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"});break}if(n.list||(n.dataSource instanceof g.DataManager&&(n.initialRemoteRender=!0),n.renderList()),!n.initialRemoteRender){var a=n.getElementByText(t.text);if(!n.checkValidLi(a))if(n.liCollections&&100===n.liCollections.length&&"autocomplete"===n.getModuleName()&&n.listData.length>100)n.setSelectionData(t.text,i.text,"text");else if(t.text&&n.dataSource instanceof g.DataManager){var o=n.getItems().length,r=(0,v.isNullOrUndefined)(n.fields.text)?n.fields.value:n.fields.text;n.typedString="",n.dataSource.executeQuery(n.getQuery(n.query).where(new g.Predicate(r,"equal",t.text))).then((function(e){e.result.length>0?(s.addItem(e.result,o),s.updateValues()):s.setOldText(i.text)}))}else"autocomplete"===n.getModuleName()?n.setInputValue(t,i):n.setOldText(i.text);n.updateInputFields()}break;case"value":if(n.fields.disabled&&(t.value=null==t.value||n.isDisableItemValue(t.value)?null:t.value),null===t.value){n.clearAll();break}if(n.allowObjectBinding&&!(0,v.isNullOrUndefined)(t.value)&&!(0,v.isNullOrUndefined)(i.value)&&n.isObjectInArray(t.value,[i.value]))return{value:void 0};if(n.enableVirtualization){n.updateValues(),n.updateInputFields(),n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),n.preventChange=n.isAngular&&n.preventChange?!n.preventChange:n.preventChange;break}if(n.notify("beforeValueChange",{newProp:t}),n.list||(n.dataSource instanceof g.DataManager&&(n.initialRemoteRender=!0),n.renderList()),!n.initialRemoteRender){var h=n.allowObjectBinding&&!(0,v.isNullOrUndefined)(t.value)?(0,v.getValue)(n.fields.value?n.fields.value:"",t.value):t.value,u=n.getElementByValue(h);if(!n.checkValidLi(u))if(n.liCollections&&100===n.liCollections.length&&"autocomplete"===n.getModuleName()&&n.listData.length>100)n.setSelectionData(t.value,i.value,"value");else if(t.value&&n.dataSource instanceof g.DataManager){var p=n.getItems().length;r=(0,v.isNullOrUndefined)(n.fields.value)?n.fields.text:n.fields.value;n.typedString="";var d=n.allowObjectBinding&&!(0,v.isNullOrUndefined)(t.value)?(0,v.getValue)(r,t.value):t.value;n.dataSource.executeQuery(n.getQuery(n.query).where(new g.Predicate(r,"equal",d))).then((function(e){e.result.length>0?(s.addItem(e.result,p),s.updateValues()):s.setOldValue(i.value)}))}else"autocomplete"===n.getModuleName()?n.setInputValue(t,i):n.setOldValue(i.value);n.updateInputFields(),n.preventChange=n.isAngular&&n.preventChange?!n.preventChange:n.preventChange}break;case"index":if(n.fields.disabled&&(t.index=null==t.index||n.isDisabledItemByIndex(t.index)?null:t.index),null===t.index){n.clearAll();break}if(n.list||(n.dataSource instanceof g.DataManager&&(n.initialRemoteRender=!0),n.renderList()),!n.initialRemoteRender&&n.liCollections){var c=n.liCollections[t.index];n.checkValidLi(c)||(n.liCollections&&100===n.liCollections.length&&"autocomplete"===n.getModuleName()&&n.listData.length>100?n.setSelectionData(t.index,i.index,"index"):n.index=i.index),n.updateInputFields()}break;case"footerTemplate":n.popupObj&&n.setFooterTemplate(n.popupObj.element);break;case"headerTemplate":n.popupObj&&n.setHeaderTemplate(n.popupObj.element);break;case"valueTemplate":(0,v.isNullOrUndefined)(n.itemData)||null===n.valueTemplate||n.setValueTemplate();break;case"allowFiltering":n.allowFiltering&&(n.actionCompleteData={ulElement:n.ulElement,list:n.listData,isUpdated:!0},n.actionData=n.actionCompleteData,n.updateSelectElementData(n.allowFiltering));break;case"floatLabelType":N.Input.removeFloating(n.inputWrapper),N.Input.addFloating(n.inputElement,t.floatLabelType,n.placeholder,n.createElement),!(0,v.isNullOrUndefined)(n.inputWrapper.buttons[0])&&n.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==n.floatLabelType&&n.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":n.inputWrapper.clearButton||(N.Input.setClearButton(t.showClearButton,n.inputElement,n.inputWrapper,null,n.createElement),n.bindClearEvent());break;default:var m=n.getPropObject(l,t,i);e.prototype.onPropertyChanged.call(n,m.newProperty,m.oldProperty)}},n=this,a=0,o=Object.keys(t);a<o.length;a++){var r=l(o[a]);if("object"==typeof r)return r.value}},t.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},t.prototype.setSelectionData=function(e,t,i){var s,l=this;this.updateListValues=function(){if("text"===i)s=l.getElementByText(e),l.checkValidLi(s)||l.setOldText(t);else if("value"===i){var n=l.fields.value?l.fields.value:"";l.allowObjectBinding&&!(0,v.isNullOrUndefined)(e)&&(0,v.getValue)(n,e);s=l.getElementByValue(e),l.checkValidLi(s)||l.setOldValue(t)}else"index"===i&&(s=l.liCollections[e],l.checkValidLi(s)||(l.index=t))}},t.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},t.prototype.setReadOnly=function(){this.readonly?(0,v.addClass)([this.inputWrapper.container],["e-readonly"]):(0,v.removeClass)([this.inputWrapper.container],["e-readonly"])},t.prototype.setInputValue=function(e,t){},t.prototype.setCssClass=function(e,t){(0,v.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,v.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),N.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupObj&&N.Input.setCssClass(e,[this.popupObj.element],t)},t.prototype.getModuleName=function(){return"dropdownlist"},t.prototype.showPopup=function(e){this.enabled&&(this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof g.DataManager&&this.actionData.list!==this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):((0,v.isNullOrUndefined)(this.list)||!(0,v.isUndefined)(this.list)&&(this.list.classList.contains(A.noData)||this.list.querySelectorAll("."+A.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(e)),this.enableVirtualization&&this.listData&&this.listData.length&&((0,v.isNullOrUndefined)(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(e),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&this.selectedValueInfo.startIndex>0&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()))},t.prototype.executeCloneElements=function(){var e=this,t=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout((function(){e.cloneElements(),e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof g.DataManager&&!e.list.querySelector("ul"))}),t)},t.prototype.invokeRenderPopup=function(e){if(v.Browser.isDevice&&this.isFilterLayout()){var t=this;window.onpopstate=function(){t.hidePopup()},history.pushState({},"")}(0,v.isNullOrUndefined)(this.list)||(0,v.isNullOrUndefined)(this.list.children[0])&&!this.list.classList.contains(A.noData)||this.renderPopup(e)},t.prototype.renderHightSearch=function(){},t.prototype.hidePopup=function(e){if(this.isEscapeKey&&"dropdownlist"===this.getModuleName())if((0,v.isNullOrUndefined)(this.inputElement)||N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,(0,v.isNullOrUndefined)(this.index))this.resetSelection();else{var t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,i=this.findListElement(this.ulElement,"li","data-value",t);this.selectedLI=this.liCollections[this.index]||i,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,e);var s=this.getItemData(),l=!(0,v.isNullOrUndefined)(this.selectedLI);l&&this.enableVirtualization&&this.selectedLI.classList&&(l=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||l&&this.inputElement.value!==s.text)&&(this.isSelectCustom=!1,this.clearAll(e))},t.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(T.disable)){var t=!1;this.preventFocus&&v.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,t=!0),t||this.targetElement().focus(),(0,v.addClass)([this.inputWrapper.container],[T.inputFocus]),this.onFocus(e),"Never"!==this.floatLabelType&&N.Input.calculateWidth(this.inputElement,this.inputWrapper.container)}},t.prototype.focusOut=function(e){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),(0,v.removeClass)([this.inputWrapper.container],[T.inputFocus]),"Never"!==this.floatLabelType&&N.Input.calculateWidth(this.inputElement,this.inputWrapper.container))},t.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e)if(e instanceof HTMLLIElement){for(var i=0;i<this.liCollections.length;i++)if(this.liCollections[i]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else{var s=JSON.parse(JSON.stringify(e))[this.fields.value];for(i=0;i<this.listData.length;i++)if(JSON.parse(JSON.stringify(this.listData[i]))[this.fields.value]===s){t=this.getIndexByValue(s);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData,l.classList.contains(T.focus)&&this.removeFocus(),l.classList.contains(T.selected)&&this.clear()}}}}},t.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),h(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&this.popupObj.hide(),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var t=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],i=0;i<t.length;i++)this.inputElement.removeAttribute(t[i]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),N.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName===this.getNgDirective()||this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),(0,v.detach)(this.inputWrapper.container)),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!(0,v.isNullOrUndefined)(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!(0,v.isNullOrUndefined)(this.inputElement.onselect)&&(this.inputElement.onselect=null),N.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,e.prototype.destroy.call(this)}},t.prototype.getItems=function(){return this.list||(this.dataSource instanceof g.DataManager&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},t.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},t.prototype.clear=function(){this.value=null},B([(0,v.Property)(null)],t.prototype,"cssClass",void 0),B([(0,v.Property)("100%")],t.prototype,"width",void 0),B([(0,v.Property)(!0)],t.prototype,"enabled",void 0),B([(0,v.Property)(!1)],t.prototype,"enablePersistence",void 0),B([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),B([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),B([(0,v.Property)(null)],t.prototype,"placeholder",void 0),B([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),B([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),B([(0,v.Property)(null)],t.prototype,"query",void 0),B([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),B([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),B([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),B([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),B([(0,v.Property)(!0)],t.prototype,"isDeviceFullScreen",void 0),B([(0,v.Property)(!1)],t.prototype,"readonly",void 0),B([(0,v.Property)(!1)],t.prototype,"enableVirtualization",void 0),B([(0,v.Property)(!1)],t.prototype,"allowResize",void 0),B([(0,v.Property)(null)],t.prototype,"text",void 0),B([(0,v.Property)(null)],t.prototype,"value",void 0),B([(0,v.Property)(!1)],t.prototype,"allowObjectBinding",void 0),B([(0,v.Property)(null)],t.prototype,"index",void 0),B([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),B([(0,v.Property)(!1)],t.prototype,"showClearButton",void 0),B([(0,v.Event)()],t.prototype,"filtering",void 0),B([(0,v.Event)()],t.prototype,"change",void 0),B([(0,v.Event)()],t.prototype,"beforeOpen",void 0),B([(0,v.Event)()],t.prototype,"open",void 0),B([(0,v.Event)()],t.prototype,"close",void 0),B([(0,v.Event)()],t.prototype,"blur",void 0),B([(0,v.Event)()],t.prototype,"focus",void 0),B([(0,v.Event)()],t.prototype,"resizeStop",void 0),B([(0,v.Event)()],t.prototype,"resizing",void 0),B([(0,v.Event)()],t.prototype,"resizeStart",void 0),t=B([v.NotifyPropertyChanges],t)}(D),U=u(741),H=u(215),F=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),W=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},q="e-rtl",M="e-ddt-hidden",j="e-input-group-icon e-ddt-icon e-icons",R="e-show-chip",z="e-show-clear",K="e-show-dd-icon",_="e-chip-input",G="e-input-focus",Q="e-input-group",J="e-icon-anim",X="e-chips",Y="e-chipcontent",$="e-chips-close",Z="e-icon-hide",ee="e-ddt-icon-hide",te="e-list-parent",ie="e-dropdown",se="e-disabled",le="e-selectall-parent",ne="e-hide-selectall",ae="e-all-text",oe="e-frame",re="e-check",he="e-checkbox-wrapper",ue="e-filter-wrap",pe="e-ddt-icon",de="e-ddt-footer",ce="e-ddt-header",me="e-no-data",fe="e-remain",ve="e-overflow",ge="e-show-text",ye="e-total-count",Ce="e-wrap-count",be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),W([(0,v.Property)("child")],t.prototype,"child",void 0),W([(0,v.Property)([])],t.prototype,"dataSource",void 0),W([(0,v.Property)("expanded")],t.prototype,"expanded",void 0),W([(0,v.Property)("hasChildren")],t.prototype,"hasChildren",void 0),W([(0,v.Property)("htmlAttributes")],t.prototype,"htmlAttributes",void 0),W([(0,v.Property)("iconCss")],t.prototype,"iconCss",void 0),W([(0,v.Property)("imageUrl")],t.prototype,"imageUrl",void 0),W([(0,v.Property)("parentValue")],t.prototype,"parentValue",void 0),W([(0,v.Property)(null)],t.prototype,"query",void 0),W([(0,v.Property)("selectable")],t.prototype,"selectable",void 0),W([(0,v.Property)("selected")],t.prototype,"selected",void 0),W([(0,v.Property)(null)],t.prototype,"tableName",void 0),W([(0,v.Property)("text")],t.prototype,"text",void 0),W([(0,v.Property)("tooltip")],t.prototype,"tooltip",void 0),W([(0,v.Property)("value")],t.prototype,"value",void 0),t}(v.ChildProperty),Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),W([(0,v.Property)(!1)],t.prototype,"autoCheck",void 0),W([(0,v.Property)(!0)],t.prototype,"checkDisabledChildren",void 0),W([(0,v.Property)("Auto")],t.prototype,"expandOn",void 0),W([(0,v.Property)(!1)],t.prototype,"loadOnDemand",void 0),t}(v.ChildProperty),Ee=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.filterTimer=null,s.isFilteredData=!1,s.isFilterRestore=!1,s.selectedData=[],s.filterDelayTime=300,s.isClicked=!1,s.documentClickContext=s.onDocumentClick.bind(s),s.isCheckAllCalled=!1,s.isFromFilterChange=!1,s}return F(t,e),t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getLocaleName=function(){return"drop-down-tree"},t.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",ctrlA:"ctrl+A"}},t.prototype.render=function(){var e=(0,v.select)("#"+this.element.id+"_tree",document);if(e){var t=(0,v.select)("#"+this.element.id+"_options",document);(0,v.detach)(t||e.parentElement)}"INPUT"===this.element.tagName?(this.inputEle=this.element,(0,v.isNullOrUndefined)(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),(0,v.isNullOrUndefined)(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):((0,v.isNullOrUndefined)(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=N.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[j]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains(Q)||this.inputWrapper.classList.add(Q),this.showDropDownIcon&&this.inputWrapper.classList.add(K),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add(ie),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),(0,v.addClass)([this.popupDiv],ee),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof g.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:ve+" "+Z}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&(0,v.addClass)([this.overFlowWrapper],ge))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var i=(0,v.select)("."+te,this.treeObj.element);i&&i.getAttribute("aria-multiselectable")&&i.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},t.prototype.hideCheckAll=function(e){var t=(0,v.isNullOrUndefined)(this.popupEle)?null:this.popupEle.querySelector("."+le);(0,v.isNullOrUndefined)(t)||(e&&!t.classList.contains(ne)?(0,v.addClass)([t],ne):!e&&t.classList.contains(ne)&&(0,v.removeClass)([t],ne))},t.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:ue});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),(0,v.prepend)([this.filterContainer],this.popupEle),this.filterObj=new N.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new v.KeyboardEvents(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.filterKeyAction=function(e){var t,i=this,s={cancel:!1,event:e};this.trigger("keyPress",s,(function(s){if(!s.cancel)switch(e.action){case"altUp":i.isPopupOpen&&i.hidePopup();break;case"shiftTab":(0,v.addClass)([i.inputWrapper],[G]);break;case"moveDown":e.preventDefault(),i.filterObj.element.blur(),(t=i.treeObj.element.querySelector("li"))&&t.focus()}}))},t.prototype.filterChangeHandler=function(e){var t=this;(0,v.isNullOrUndefined)(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout((function(){t.filterHandler(e.value,e.event)}),this.filterDelayTime))},t.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},t.prototype.filterHandler=function(e,t){var i=this;this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData());var s=this.cloneFields(this.fields),l={cancel:!1,preventDefaultAction:!1,event:t,text:e.trim(),fields:s};this.trigger("filtering",l,(function(e){if(!e.cancel){var t=!1,s=void 0;if(i.isFilteredData=!0,""===e.text?(i.isFilteredData=!1,i.isFilterRestore=!0,s=i.cloneFields(i.fields),i.treeObj.element.classList.remove("e-filtering")):e.preventDefaultAction?(s=e.fields,i.treeObj.element.classList.add("e-filtering")):(1===i.treeDataType?s=i.selfReferencefilter(e.text,e.fields):i.fields.dataSource instanceof g.DataManager?((s=i.remoteDataFilter(e.text,e.fields)).child=i.fields.child,i.treeObj.fields=i.getTreeFields(e.fields),i.treeObj.dataBind(),t=!0):s=i.nestedFilter(e.text,e.fields),i.treeObj.element.classList.add("e-filtering")),i.hideCheckAll(i.isFilteredData),t)return;if(i.isRemoteData&&(i.isChildObject()?s.child=i.fields.child:s=e.fields),i.treeObj.fields=i.getTreeFields(s),i.treeObj.dataBind(),i.popupObj&&i.popupObj.refreshPosition(),i.hasTemplate&&i.portals&&i.treeObj.portals){for(var l=0;l<i.treeObj.portals.length;l++)-1===i.portals.indexOf(i.treeObj.portals[l])&&i.portals.push(i.treeObj.portals[l]);i.isReact&&i.renderReactTemplates()}}}))},t.prototype.remoteDataFilter=function(e,t){var i=this;return t.dataSource=this.treeData.map((function(t){return i.remoteChildFilter(e,t)})).filter((function(e){return!(0,v.isNullOrUndefined)(e)})),t},t.prototype.remoteChildFilter=function(e,t,i,s){var l=this.isChildObject()?t.child:t[this.fields.child];if((0,v.isNullOrUndefined)(l))return this.isMatchedNode(e,t,i,s)?t:null;for(var n=[],a=0;a<l.length;a++){var o=this.remoteChildFilter(e,l[a],!0,!0);(0,v.isNullOrUndefined)(o)||n.push(o)}var r=Object.assign({},t);return s=!1,0!==n.length?r.child=n:(r.child=null,r=this.isMatchedNode(e,r)?r:null),r},t.prototype.nestedFilter=function(e,t){for(var i=[],s=0;s<this.treeData.length;s++){var l=this.nestedChildFilter(e,this.treeData[parseInt(s.toString(),10)]);(0,v.isNullOrUndefined)(l)||i.push(l)}return t.dataSource=i,t},t.prototype.nestedChildFilter=function(e,t){var i=t[this.fields.child];if((0,v.isNullOrUndefined)(i))return this.isMatchedNode(e,t)?t:null;for(var s=[],l=0;l<i.length;l++){var n=this.nestedChildFilter(e,i[parseInt(l.toString(),10)]);(0,v.isNullOrUndefined)(n)||s.push(n)}var a=Object.assign({},t);return 0!==s.length?(a[this.fields.child]=s,a):(a[this.fields.child]=null,this.isMatchedNode(e,a)?a:null)},t.prototype.selfReferencefilter=function(e,t){for(var i=[],s=[],l=0;l<this.treeData.length;l++)this.isMatchedNode(e,this.treeData[l])&&i.push(this.treeData[l]);for(l=0;l<i.length;l++)if(-1===s.indexOf(i[l])){s.push(i[l]);for(var n=i[parseInt(l.toString(),10)][this.fields.parentValue];!(0,v.isNullOrUndefined)(n);){for(var a=null,o=0;o<this.treeData.length;o++){var r=this.treeData[parseInt(o.toString(),10)][this.fields.value];if(!(0,v.isNullOrUndefined)(r)&&r===n){a=this.treeData[o];break}}if((0,v.isNullOrUndefined)(a)||-1!==s.indexOf(a))break;s.push(a),n=a[this.fields.parentValue]}}return t.dataSource=s,t},t.prototype.isMatchedNode=function(e,t,i,s){var l;if(!(l=i&&s&&this.isChildObject()?t[this.fields.child.text]:t[this.fields.text])&&!(0,v.isNullOrUndefined)(this.fields.child.text)){for(var n=this.fields.child;!t[n.text];)n=n.child;l=t[n.text]}return this.ignoreCase&&(l=l.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(l=g.DataUtil.ignoreDiacritics(l),e=g.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?l.slice(0,e.length)===e:"EndsWith"===this.filterType?l.slice(-e.length)===e:-1!==l.indexOf(e)},t.prototype.wireEvents=function(){v.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),v.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),v.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),v.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),v.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),v.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),v.EventHandler.add(window,"resize",this.windowResize,this);var e=(0,v.closest)(this.inputWrapper,"form");e&&v.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new v.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.wireTreeEvents=function(){this.keyboardModule=new v.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new v.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.unWireEvents=function(){v.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),v.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),v.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),v.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),v.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),v.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),v.EventHandler.remove(window,"resize",this.windowResize);var e=(0,v.closest)(this.inputWrapper,"form");e&&v.EventHandler.remove(e,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&v.EventHandler.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},t.prototype.dropDownClick=function(e){this.enabled&&!this.readonly&&(this.isClearButtonClick?this.isClearButtonClick=!1:(this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()))},t.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},t.prototype.onMouseLeave=function(){this.inputFocus||((0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z))},t.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},t.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!v.Browser.isIE&&"edge"!==v.Browser.info.name||e.target!==this.inputWrapper)){var t=e.relatedTarget;t===this.inputEle||!(0,v.isNullOrUndefined)(t)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},t.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=(0,v.select)(".e-clear-icon",this.inputWrapper).offsetWidth,(0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z)),(0,v.removeClass)([this.inputWrapper],[G]),this.allowMultiSelection||this.showCheckBox){var t=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_)),t&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText&&t&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},t.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?(0,v.addClass)([this.inputWrapper,this.overFlowWrapper],ge):(0,v.addClass)([this.inputWrapper],R),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&(0,v.addClass)([this.chipWrapper],Z),(0,v.addClass)([this.inputEle],_),this.updateOverFlowView()),this.ensurePlaceHolder())},t.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.setOldValue()}},t.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return(null===e||0===e.length)&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},t.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,(0,v.addClass)([this.inputWrapper],[G]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&((0,v.removeClass)([this.chipWrapper],Z),(0,v.addClass)([this.inputEle],_),this.showOrHideValueTemplate(!1,!0)),(0,v.addClass)([this.inputWrapper],R),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&(0,v.addClass)([this.overFlowWrapper],Z),"Delimiter"===this.mode?((0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_),this.showOrHideValueTemplate(!0)):(0,v.addClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputWrapper],ge),this.ensurePlaceHolder()));var t={isInteracted:!!e,event:e};this.trigger("focus",t)}},t.prototype.treeAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,(function(i){if(i.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":t.inputWrapper.focus(),e.preventDefault(),t.isPopupOpen&&t.hidePopup();break;case"tab":t.isPopupOpen&&t.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":t.showCheckBox||(t.isValueChange=!0,t.keyEventArgs=e);break;case"space":t.isValueChange=!0,t.keyEventArgs=e;break;case"ctrlA":t.allowMultiSelection&&t.selectAll(!0)}}))},t.prototype.keyActionHandler=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,(function(i){if(!i.cancel)switch(e.action){case"escape":case"altUp":t.isPopupOpen&&t.hidePopup();break;case"shiftTab":t.isPopupOpen&&t.hidePopup(),t.inputFocus&&t.onFocusOut();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus();break;case"tab":!t.isPopupOpen&&t.inputFocus&&t.onFocusOut()}}))},t.prototype.checkAllAction=function(e){var t,i=this,s={cancel:!1,event:e};this.trigger("keyPress",s,(function(s){if(!s.cancel)switch(e.action){case"space":i.clickHandler(e);break;case"moveDown":e.preventDefault(),(t=i.treeObj.element.querySelector('li[tabindex="0"]')||i.treeObj.element.querySelector("li")).focus(),(0,v.addClass)([t],["e-node-focus"])}}))},t.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},t.prototype.resetValueHandler=function(e){var t=(0,v.closest)(this.inputWrapper,"form");t&&e.target===t&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},t.prototype.getAriaAttributes=function(){return{}},t.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove(ye),(0,v.removeClass)([this.overFlowWrapper],Z),this.value&&this.value.length){var e="",t=void 0,i=void 0,s=void 0,l=1,n=void 0,a=void 0,o=0;this.overFlowWrapper.innerHTML="";this.l10n=new v.L10n(this.getLocaleName(),{overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},this.locale);var r=this.l10n.getConstant("overflowCountTemplate"),h=this.l10n.getConstant("totalCountTemplate"),u=this.createElement("span",{className:fe});this.overFlowWrapper.appendChild(u),u.innerText=r.replace("${count}",this.value.length.toString());var p=u.offsetWidth;if((0,v.remove)(u),this.showDropDownIcon&&(o=(0,v.select)("."+pe,this.inputWrapper).offsetWidth),!(0,v.isNullOrUndefined)(this.value))if("Box"!==this.mode){if(this.valueTemplate)return a=this.updateChipAndValueTemplate(!1,o,p),this.checkRemainingTemplate(a,u,r,h),void this.updateDelimMode();for(var d=0;!(0,v.isNullOrUndefined)(this.value[d]);d++){if(e+=0===d?"":this.delimiterChar+" ",e+=i=this.getOverflowVal(d),i=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=v.SanitizeHtmlHelper.sanitize(e):this.overFlowWrapper.innerHTML=e,n=this.overFlowWrapper.offsetWidth,t=this.inputWrapper.offsetWidth,n+o+this.clearIconWidth>t){for(void 0!==s&&""!==s&&(i=s,d=l+1),this.overFlowWrapper.innerHTML=i,a=this.value.length-d,n=this.overFlowWrapper.offsetWidth;n+p+o+this.clearIconWidth>=t&&0!==n&&""!==this.overFlowWrapper.innerHTML;){var c=this.overFlowWrapper.innerHTML.split(this.delimiterChar);c.pop(),this.overFlowWrapper.innerHTML=c.join(this.delimiterChar),a++,n=this.overFlowWrapper.offsetWidth}break}n+p+o+this.clearIconWidth<=t?(s=e,l=d):0===d&&(s="",l=-1)}}else a=this.updateChipAndValueTemplate(!0,o,p);this.checkRemainingTemplate(a,u,r,h)}else this.overFlowWrapper.innerHTML="",(0,v.addClass)([this.overFlowWrapper],Z);this.updateDelimMode()},t.prototype.checkRemainingTemplate=function(e,t,i,s){e>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(t,e,i,s)),"Box"!==this.mode||this.overFlowWrapper.classList.contains(ye)||(0,v.addClass)([t],Ce)},t.prototype.updateChipAndValueTemplate=function(e,t,i){void 0===t&&(t=0);var s,l,n,a,o,r="",h=1;(0,v.addClass)([e?this.chipWrapper:this.valueTemplateContainer],Z);for(var u=(e?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0),p=e?(0,v.selectAll)("."+X,u):Array.prototype.slice.call(u.children),d=0;d<p.length;d++){if(l=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(p[d]),r=this.overFlowWrapper.innerHTML,a=this.overFlowWrapper.offsetWidth,s=this.inputWrapper.offsetWidth,a+t+this.clearIconWidth>s){for(void 0!==n&&""!==n&&(l=n,d=h+1),this.overFlowWrapper.innerHTML=l,o=this.value.length-d,a=this.overFlowWrapper.offsetWidth;a+i+t+this.clearIconWidth>=s&&0!==a&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),o++,a=this.overFlowWrapper.offsetWidth;break}a+i+t+this.clearIconWidth<=s?(n=r,h=d):0===d&&(n="",h=-1)}return o},t.prototype.updateRemainTemplate=function(e,t,i,s){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.innerText=this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?i.replace("${count}",t.toString()):s.replace("${count}",t.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?((0,v.addClass)([this.overFlowWrapper],ye),(0,v.removeClass)([this.overFlowWrapper],Ce)):(0,v.removeClass)([this.overFlowWrapper],ye),e},t.prototype.getOverflowVal=function(e){var t=this.getSelectedData(this.value[parseInt(e.toString(),10)]);return(0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.text:"text",t)},t.prototype.updateDelimMode=function(){"Box"!==this.mode?(0,v.select)("."+fe,this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains(ye)?((0,v.addClass)([this.overFlowWrapper],Ce),(0,v.addClass)([this.overFlowWrapper],ge)):(this.overFlowWrapper.classList.remove(Ce),(0,v.removeClass)([this.overFlowWrapper],Ce)):(0,v.select)("."+fe,this.overFlowWrapper)&&this.overFlowWrapper.classList.remove(Ce)},t.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:M,tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:M,"aria-label":this.getModuleName()}}),(0,v.prepend)([this.hiddenElement],this.inputWrapper),this.validationAttribute()},t.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),(0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},t.prototype.validationAttribute=function(){var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name");for(var t=["required","aria-required","form"],i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},t.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),(0,v.addClass)([this.inputWrapper],R),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?(0,v.addClass)([this.inputEle],_):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&(0,v.addClass)([this.chipWrapper],Z))},t.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},t.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:le,attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:ae}),this.selectAllSpan.textContent="";var e=(0,v.closest)(this.element,".e-bigger"),t=(0,v.isNullOrUndefined)(e)?"":"e-small";this.checkBoxElement=(0,U.createCheckBox)(this.createElement,!0,{cssClass:t}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),v.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},t.prototype.clickHandler=function(e){var t;if(t=e.currentTarget&&e.currentTarget.classList.contains(le)?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=(0,v.closest)(t,"."+he),!(0,v.isNullOrUndefined)(this.checkWrapper)){this.isClicked=!0;var i=(0,v.select)("."+oe,this.checkWrapper);this.changeState(this.checkWrapper,i.classList.contains(re)?"uncheck":"check",e),this.isClicked=!1}e.preventDefault()},t.prototype.changeState=function(e,t,i){var s,l=e.getElementsByClassName(oe)[0];"check"!==t||l.classList.contains(re)?"uncheck"===t&&l.classList.contains(re)&&(l.classList.remove(re),s="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(i)),this.setLocale(!1)):(l.classList.add(re),s="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(i)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),s="check"===t?"true":"false",(0,v.isNullOrUndefined)(s)||e.parentElement.setAttribute("aria-checked",s)},t.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var t=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var i=0,s=(0,v.compile)(t)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);i<s.length;i++){var l=s[i];this.selectAllSpan.textContent=l.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},t.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex","0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),(0,v.attributes)(this.inputWrapper,this.getAriaAttributes())},t.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];if("class"===i)this.inputWrapper.classList.add(this.htmlAttributes[""+i]);else if("disabled"===i)this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"===i)this.setProperties({readonly:!0},!0),this.dataBind();else if("style"===i)this.inputWrapper.setAttribute("style",this.htmlAttributes[""+i]);else{0===i.indexOf("data")||["name","required"].indexOf(i)>-1?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(i)>-1&&"placeholder"===i?N.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}}},t.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,t=["class","style","id","type"],i={},s=0;s<this.element.attributes.length;s++)-1===t.indexOf(this.element.attributes[s].name)&&"readonly"!==this.element.attributes[s].name&&(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));(0,v.extend)(i,e,i),this.setProperties({htmlAttributes:i},!0)},t.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&(this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?((0,v.removeClass)([this.overAllClear],Z),(0,v.addClass)([this.inputWrapper],z)):((0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z))))},t.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var t=this.value.length-1;t>=0;t--)e=this.treeObj.getTreeData(this.value[t])[0],(0,v.isNullOrUndefined)(e)&&this.value.splice(t,1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],(0,v.isNullOrUndefined)(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},t.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,t=[];if(this.showCheckBox||this.allowMultiSelection){for(var i=this.text.split(this.delimiterChar),s=0;s<i.length;s++)e=this.getItems(i[s]),(0,v.isNullOrUndefined)(e)||t.push(e[this.fields.value].toString());0!==t.length?(this.setOldValue(),this.setProperties({value:t},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),(0,v.isNullOrUndefined)(e)?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},t.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),this.treeObj.selectedNodes.length>0&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&this.treeObj.checkedNodes.length>0&&(this.setProperties({value:this.treeObj.checkedNodes},!0),(0,v.setValue)("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},t.prototype.setValueTemplate=function(){var e=this;if(this.valueTemplate){var t=this.initializeValueTemplate();this.getValueTemplateElement(this.value[0],t),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter((function(t){return!e.portals.includes(t)})))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.showOrHideValueTemplate(!0)}},t.prototype.getValueTemplateElement=function(e,t){var i=t(this.getNodeData(e,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);i&&(i=Array.prototype.slice.call(i),(0,v.append)(i,this.valueTemplateContainer))},t.prototype.setValidValue=function(){var e=this;if(this.showCheckBox||this.allowMultiSelection){if(this.showCheckBox)(this.value.length!==this.treeObj.checkedNodes.length||this.value.filter((function(t){return-1===e.treeObj.checkedNodes.indexOf(t)})).length>0||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect());else this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues();this.treeObj.dataBind()}else{N.Input.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate();var t=this.value[0].toString();this.treeObj.selectedNodes[0]!==t&&((0,v.setValue)("selectedNodes",[t],this.treeObj),this.fields.dataSource instanceof g.DataManager&&this.updateSelectedValues())}this.currentText=this.text,this.currentValue=this.value,!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&!(0,v.isNullOrUndefined)(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},t.prototype.getItems=function(e){var t;if(1===this.treeDataType)for(var i=0;i<this.treeItems.length;i++){var s=(0,v.getValue)(this.fields.text,this.treeItems[parseInt(i.toString(),10)]);if(!(0,v.isNullOrUndefined)(this.treeItems[i])&&!(0,v.isNullOrUndefined)(s)&&s===e){t=this.treeItems[i];break}}else t=this.getNestedItems(this.treeItems,this.fields,e);return t},t.prototype.getNestedItems=function(e,t,i){for(var s,l=0,n=e.length;l<n;l++){var a=(0,v.getValue)(this.fields.text,e[parseInt(l.toString(),10)]);if(e[l]&&a&&a.toString()===i)return e[l];if("string"!=typeof t.child||(0,v.isNullOrUndefined)((0,v.getValue)(t.child,e[l]))){if(this.fields.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)((0,v.getValue)("child",e[l]))){if(void 0!==(s=this.getNestedItems((0,v.getValue)("child",e[parseInt(l.toString(),10)]),this.getChildType(t),i)))break}}else{var o=(0,v.getValue)(t.child,e[parseInt(l.toString(),10)]);if(void 0!==(s=this.getNestedItems(o,this.getChildType(t),i)))break}}return s},t.prototype.getChildType=function(e){return"string"==typeof e.child||(0,v.isNullOrUndefined)(e.child)?e:e.child},t.prototype.renderTree=function(){this.treeObj=new H.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate,checkDisabledChildren:this.treeSettings.checkDisabledChildren}),this.treeObj.root=this.root?this.root:this,this.treeObj.appendTo(this.tree)},t.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var t=!1;this.trigger("beforeOpen",{cancel:!1},(function(i){if(i.cancel?t=!0:((0,v.addClass)([e.inputWrapper],[J]),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_options",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),e.popupEle.setAttribute("role","region"),e.popupEle.setAttribute("aria-label",e.element.id),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):(e.popupEle=e.popupObj.element,e.isReact&&e.isFilterRestore&&(e.treeObj.refresh(),e.isFilteredData=!0,e.popupEle.removeChild(e.filterContainer)))),(e.isFirstRender&&!t||e.isFilteredData)&&(e.isFilteredData=!1,(0,v.prepend)([e.popupDiv],e.popupEle),(0,v.removeClass)([e.popupDiv],ee),e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains(me)&&(e.createSelectAllWrapper(),e.popupEle.insertBefore(e.checkAllParent,e.popupDiv)),e.headerTemplate&&e.setHeaderTemplate(),e.footerTemplate&&e.setFooterTemplate(),e.isFirstRender=!1,e.hasTemplate&&e.portals&&(e.treeObj.portals&&(e.portals=e.portals.concat(e.treeObj.portals.filter((function(t){return!e.portals.includes(t)})))),e.isReact&&e.renderReactTemplates(e.reactCallBack))),!t){if((0,v.attributes)(e.inputEle,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),(0,v.removeClass)([e.popupEle],ee),e.updatePopupHeight(),e.popupObj.refreshPosition(),(!e.showCheckBox||!e.showSelectAll)&&!e.popupDiv.classList.contains(me)&&e.treeItems.length>0){var s=null!=e.value&&null!=e.text?e.treeObj.element.querySelector('[data-uid="'+e.value[0]+'"]'):null;if(s)e.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),s.setAttribute("tabindex","0");else{var l=e.treeObj.element.querySelector(".e-node-focus");s=e.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||e.treeObj.element.querySelector("li:not(.e-disable)"),l&&l!==s&&(l.setAttribute("tabindex","-1"),(0,v.removeClass)([l],"e-node-focus"))}(0,v.isNullOrUndefined)(s)||(e.allowFiltering||s.focus(),(0,v.addClass)([s],["e-node-focus"]))}if(e.treeObj.checkedNodes.length>0&&!e.isFilterRestore){var n=e.treeObj.element.querySelectorAll("li");if(e.treeObj.element.querySelectorAll("li[aria-checked=true]").length===n.length&&e.checkBoxElement){var a=(0,v.closest)(e.checkBoxElement,"."+he);e.changeState(a,"check"),e.checkSelectAll=!1}}e.allowFiltering&&((0,v.removeClass)([e.inputWrapper],[G]),e.filterObj.element.focus());var o={popup:e.popupObj};e.trigger("open",o)}}))},t.prototype.reactCallBack=function(){(0,v.isNullOrUndefined)(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},t.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){var t=Math.round(this.filterContainer.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}if(this.headerTemplate){t=Math.round(this.header.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}if(this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains(me)){t=Math.round(this.checkAllParent.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}if(this.footerTemplate){t=Math.round(this.footer.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}var i=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);i+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=(0,v.formatUnit)(parseInt(e,10)-i+"px"),this.popupDiv.style.maxHeight=e}},t.prototype.createPopup=function(e){var t=this;this.isFirstRender&&(this.popupObj=new k.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){t.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",t.documentClickContext),t.isPopupOpen=!0},targetExitViewport:function(){v.Browser.isDevice||t.hidePopup()}}))},t.prototype.setElementWidth=function(e){var t=this.inputWrapper;(0,v.isNullOrUndefined)(e)||("number"==typeof e?t.style.width=(0,v.formatUnit)(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:(0,v.formatUnit)(e)))},t.prototype.setWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);return e.indexOf("%")>-1?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},t.prototype.getHeight=function(){var e=(0,v.formatUnit)(this.popupHeight);return e.indexOf("%")>-1?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},t.prototype.onDocumentClick=function(e){var t=e.target,i=(0,v.closest)(t,"."+te),s=(0,v.closest)(t,"."+ue),l=(0,v.closest)(t,"."+ce),n=(0,v.closest)(t,"."+de),a=!!t.classList.contains(ie)||((0,v.matches)(t,".e-ddt .e-popup")||(0,v.matches)(t,".e-ddt .e-treeview"));this.isPopupOpen&&(!(0,v.isNullOrUndefined)(this.inputWrapper)&&this.inputWrapper.contains(t)||i||a||l||n)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&t.classList.contains($)||this.isPopupOpen&&(t.classList.contains(le)||t.classList.contains(ae)||t.classList.contains(oe)))?(this.isDocumentClick=!1,e.preventDefault()):(0,v.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.contains(t)||!this.inputFocus||s||this.focusOut(e)},t.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),(0,v.addClass)([this.popupDiv],me)},t.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),(0,v.addClass)([this.popupDiv],me),this.hideCheckAll(!0)):this.popupDiv.classList.contains(me)&&this.treeItems.length>=1&&((0,v.removeClass)([this.popupDiv],me),this.hideCheckAll(!1)),this.isFilteredData||(this.treeDataType=this.getTreeDataType(this.treeItems,this.fields)),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus(),this.isInitialized=!0);var t={data:e.data};this.trigger("dataBound",t),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},t.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value?this.value:[]:this.treeObj.selectedNodes=this.value?this.value:[]},t.prototype.setCssClass=function(e,t){var i=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];(0,v.isNullOrUndefined)(t)||""===t||(0,v.removeClass)(i,t.split(" ")),(0,v.isNullOrUndefined)(e)||""===e||(0,v.addClass)(i,e.split(" "))},t.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add(q):this.inputWrapper.classList.remove(q),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},t.prototype.setEnable=function(){N.Input.setEnabled(this.enabled,this.inputEle),this.enabled?((0,v.removeClass)([this.inputWrapper],se),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),(0,v.addClass)([this.inputWrapper],se),this.inputWrapper&&this.inputWrapper.classList.contains(G)&&(0,v.removeClass)([this.inputWrapper],[G]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},t.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},t.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},t.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selectable:e.selectable,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},t.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!(0,v.isNullOrUndefined)(e)){var t=e=this.getActualProperties(e);return e.value&&(t.id=e.value),e.parentValue&&(t.parentID=e.parentValue),e.child&&(t.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(t.isChecked=e.selected),t}return null},t.prototype.getTreeDataType=function(e,t){if(this.fields.dataSource instanceof g.DataManager){for(var i=0;i<e.length;i++)if("string"==typeof t.child&&(0,v.isNullOrUndefined)((0,v.getValue)(t.child,e[i])))return 1;return 2}(0,v.isNullOrUndefined)(this.fields.dataSource)&&(this.fields.dataSource=[]);i=0;for(var s=this.fields.dataSource.length;i<s;i++){if("string"==typeof t.child&&!(0,v.isNullOrUndefined)((0,v.getValue)(t.child,this.fields.dataSource[i])))return 2;if(!(0,v.isNullOrUndefined)((0,v.getValue)(t.parentValue,this.fields.dataSource[i]))||!(0,v.isNullOrUndefined)((0,v.getValue)(t.hasChildren,this.fields.dataSource[i])))return 1}return 1},t.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.treeObj.dataBind()},t.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:!!this.isClicked||e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},t.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.setOldValue(),null===this.value&&this.setProperties({value:[]},!0))},t.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},t.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var t,i=this.getEventArgs(e);if(this.trigger("select",i),e.isInteracted){var s=(0,v.getValue)("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[s]},!0),t=this.itemTemplate?(0,v.getValue)("text",this.treeObj.getNode(s)):(0,v.getValue)("text",e.nodeData).toString(),N.Input.setValue(t,this.inputEle,this.floatLabelType),this.setProperties({text:t},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&this.inputWrapper.setAttribute("aria-label",e.nodeData.text.toString()),(0,v.attributes)(this.inputWrapper,{"aria-describedby":this.element.id}),(0,v.attributes)(this.inputWrapper,{"aria-activedescendant":s.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},t.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&(this.isClicked=!0,"true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.isClicked=!1,this.setMultiSelect(),this.ensurePlaceHolder());this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},t.prototype.onNodeChecked=function(e){var t=this.getEventArgs(e);if(this.trigger("select",t),this.isFilteredData&&"uncheck"===e.action){var i=(0,v.getValue)("id",e.data[0]).toString();this.removeSelectedData(i,!0)}if((!this.isChipDelete&&e.isInteracted||!this.isFilteredData&&"check"===e.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var s=this.treeObj.element.querySelectorAll("li"),l=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),n=(0,v.closest)(this.checkBoxElement,"."+he);n&&"uncheck"===e.action&&(e.isInteracted||0===l.length||!(0,v.isNullOrUndefined)(e.data[0])&&"false"===e.data[0].isChecked)||!e.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(n,"uncheck"),this.isReverseUpdate=!1):n&&"check"===e.action&&l.length===s.length&&(e.isInteracted||this.isCheckAllCalled||!(0,v.isNullOrUndefined)(e.data[0])&&"true"===e.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(n,"check"),this.isReverseUpdate=!1)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},t.prototype.beforeCheck=function(e){e.isInteracted&&this.setOldValue()},t.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var e=0;e<this.treeObj.portals.length;e++)-1===this.portals.indexOf(this.treeObj.portals[e])&&this.portals.push(this.treeObj.portals[e]);this.renderReactTemplates()}},t.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?((0,v.removeClass)([this.overAllClear],Z),(0,v.addClass)([this.inputWrapper],z)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):((0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var t=(0,v.selectAll)("."+$,this.chipWrapper),i=0;i<t.length;i++)e?(0,v.removeClass)([t[i]],Z):(0,v.addClass)([t[i]],Z)},t.prototype.updateDropDownIconState=function(e){var t=(0,v.select)("."+pe,this.inputWrapper);e?(t?(0,v.removeClass)([t],Z):N.Input.appendSpan(j,this.inputWrapper,this.createElement),(0,v.addClass)([this.inputWrapper],K)):((0,v.addClass)([t],Z),(0,v.removeClass)([this.inputWrapper],K))},t.prototype.updateMode=function(){if("Custom"!==this.mode)if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(Z)&&e?((0,v.removeClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!1,!0),(0,v.addClass)([this.inputWrapper],R)):e||((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R),this.showOrHideValueTemplate(!0));var t=null!==this.value&&0!==this.value.length;e&&t?(0,v.addClass)([this.inputEle],_):(0,v.removeClass)([this.inputEle],_)}else this.inputEle.classList.contains(_)&&((0,v.removeClass)([this.inputEle],_),this.chipWrapper&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R),this.showOrHideValueTemplate(!0)))},t.prototype.ensurePlaceHolder=function(){((0,v.isNullOrUndefined)(this.value)||null!==this.value&&0===this.value.length)&&((0,v.removeClass)([this.inputEle],_),this.chipWrapper&&((0,v.addClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!0)))},t.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},t.prototype.setMultiSelectValue=function(e){var t=this;if(this.isFilteredData){var i=(0,v.isNullOrUndefined)(this.value)?[]:this.value;i=i.filter((function(e){var i=t.treeObj.getTreeData(e);return!Array.isArray(i)||i.every((function(e){return e.selected}))}));for(var s=0;s<e.length;s++)((0,v.isNullOrUndefined)(this.value)||-1===this.value.indexOf(e[s]))&&i.push(e[s]);this.setProperties({value:i},!0)}else this.setProperties({value:this.isFromFilterChange&&e&&0===e.length?this.value:e},!0),this.isFromFilterChange=!1,!e||0===e.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},t.prototype.setMultiSelect=function(){if(this.showCheckBox&&!this.isDynamicChange)this.setMultiSelectValue(this.treeObj.checkedNodes.slice());else{var e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null;this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())}this.selectedText=[];var t=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!t&&((0,v.removeClass)([this.inputEle],_),(0,v.detach)(this.chipWrapper)),this.getValidMode()&&null!==this.value&&((0,v.addClass)([this.inputEle],_),this.chipWrapper&&((0,v.removeClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!1,!0)));var i=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!i&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputEle],_),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},t.prototype.getSelectedData=function(e){var t=null;if(this.isFilteredData)for(var i=0;i<this.selectedData.length;i++)if((0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[i]).toString()===e){t=this.selectedData[i];break}return(0,v.isNullOrUndefined)(t)&&(t=this.treeSettings.loadOnDemand?this.getNodeData(e,this.treeItems):this.treeObj.getNode(e),(0,v.isNullOrUndefined)(t)||this.selectedData.push(t)),t},t.prototype.getNodeData=function(e,t){var i;if((0,v.isNullOrUndefined)(e))return i;if(1!==this.treeDataType)return this.getChildNodeData(t,this.fields,e);for(var s=0,l=t.length;s<l;s++){var n=(0,v.getValue)(this.fields.value,t[s]);if(!(0,v.isNullOrUndefined)(t[s])&&!(0,v.isNullOrUndefined)(n)&&n.toString()===e)return t[s]}return i},t.prototype.getChildNodeData=function(e,t,i){var s;if((0,v.isNullOrUndefined)(e))return s;for(var l=0,n=e.length;l<n;l++){var a=(0,v.getValue)(t.value,e[l]);if(e[l]&&a&&a.toString()===i)return e[l];if("string"!=typeof t.child||(0,v.isNullOrUndefined)((0,v.getValue)(t.child,e[l]))){if(this.fields.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)((0,v.getValue)("child",e[l]))){if(void 0!==(s=this.getChildNodeData((0,v.getValue)("child",e[l]),this.getChildMapperFields(t),i)))break}}else{var o=(0,v.getValue)(t.child,e[l]);if(void 0!==(s=this.getChildNodeData(o,this.getChildMapperFields(t),i)))break}}return s},t.prototype.getChildMapperFields=function(e){return"string"==typeof e.child||(0,v.isNullOrUndefined)(e.child)?e:e.child},t.prototype.removeSelectedData=function(e,t){var i=(0,v.isNullOrUndefined)(this.value)?[]:this.value.slice();i.splice(i.indexOf(e),1),this.setProperties({value:i},t);for(var s=0;s<this.selectedData.length;s++)if((0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){this.selectedData.splice(s,1);break}},t.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);else this.valueTemplateContainer=this.createElement("span",{className:ve+" "+ge+" e-input-value "+Z});return this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},t.prototype.showOrHideValueTemplate=function(e,t){void 0===t&&(t=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(e?((0,v.removeClass)([this.valueTemplateContainer],Z),(0,v.addClass)([this.inputWrapper],R),(0,v.addClass)([this.inputEle],_)):((0,v.addClass)([this.valueTemplateContainer],Z),t||((0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_))))},t.prototype.updateSelectedValues=function(){var e,t,i=this;this.dataValue="";var s,l="";this.hiddenElement.innerHTML="";var n="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!(0,v.isNullOrUndefined)(this.value)){for(var a=this.initializeValueTemplate(),o=0,r=this.value.length;o<r;o++)s=this.getSelectedData(this.value[o]),t=(0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.text:"text",s),this.selectedText.push(t),e=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+e,l+=","+e):(this.dataValue+=e,l+=e),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[o]),n+='<option selected value ="'+this.value[o]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[o],a);this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter((function(e){return!i.portals.includes(e)})))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.selectedText.length>=1&&this.setProperties({text:l},!0),this.hiddenElement.innerHTML=n,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var h=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||h||(this.chipWrapper&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R)),this.showOrHideValueTemplate(!0)),N.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===l?this.setProperties({text:null},!0):this.setProperties({text:l},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&!(0,v.isNullOrUndefined)(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},t.prototype.setChipValues=function(e,t){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var i=this.createElement("span",{className:X,attrs:{"data-value":t}}),s=this.createElement("span",{className:Y}),l=this.createElement("span",{className:$+" e-icons"});this.enableHtmlSanitizer?s.innerText=v.SanitizeHtmlHelper.sanitize(e):s.innerHTML=e,i.appendChild(s),this.chipCollection.appendChild(i),this.showClearButton&&(i.appendChild(l),v.EventHandler.add(l,"mousedown",this.removeChip,this))},t.prototype.setTagValues=function(){if(null!==this.value&&null!=this.text&&0!==this.value.length){this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(R)||(0,v.addClass)([this.inputWrapper],R);var e=this.createElement("span",{className:X});this.inputEle.classList.contains(_)||(0,v.addClass)([this.inputEle],_),this.chipWrapper.classList.contains(Z)&&((0,v.removeClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!1,!0));var t=this.createElement("span",{className:Y}),i=this.customTemplate,s=this.customTemplateId,l=this.templateComplier(i)({value:this.value,text:this.text},this,"customTemplate",s,this.isStringTemplate,void 0,t);l&&(l=Array.prototype.slice.call(l),(0,v.append)(l,t)),e.appendChild(t),this.chipCollection.appendChild(e)}else this.inputWrapper.contains(this.chipWrapper)&&(0,v.addClass)([this.chipWrapper],Z)},t.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&((0,v.detach)(this.checkAllParent),this.checkAllParent=null))},t.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),(0,v.addClass)([this.header],ce));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),(0,v.append)(e,this.header)),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},t.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?(0,v.compile)(document.querySelector(e).innerHTML.trim()):(0,v.compile)(e)}catch(t){return(0,v.compile)(e)}return(0,v.compile)(e)},t.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),(0,v.addClass)([this.footer],de));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),(0,v.append)(e,this.footer)),(0,v.append)([this.footer],this.popupEle)},t.prototype.clearAll=function(e){this.enabled&&!this.readonly&&(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur||this.triggerChangeEvent(e))},t.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){var t=e.target.parentElement,i=t.getAttribute("data-value");this.chipCollection&&t&&(0,v.remove)(t),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(i,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([i]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},t.prototype.resetValue=function(e){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(N.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],(0,v.setValue)("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder()))},t.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},t.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},t.prototype.selectAllItems=function(e){if(this.showCheckBox)e?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=e;else if(this.allowMultiSelection)if(e){for(var t=(0,v.selectAll)("li",this.treeObj.element),i=void 0,s=[],l=0;l<t.length;l++)i=t[l].getAttribute("data-uid").toString(),s.push(i);this.treeObj.selectedNodes=s}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},t.prototype.updateTreeSettings=function(e){if("autoCheck"===e)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===e)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===e)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===e&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},t.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},t.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},t.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var t=e?this.actionFailureTemplate:this.noRecordsTemplate,i=e?this.actionFailureTemplateId:this.noRecordsTemplateId,s=e?"actionFailureTemplate":"noRecordsTemplate",l=this.templateComplier(t)({},this,s,i,this.isStringTemplate,void 0,this.noRecord);l&&(l=Array.prototype.slice.call(l),(0,v.append)(l,this.noRecord))}else{this.l10n=new v.L10n(this.getLocaleName(),{noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"},this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}(0,v.addClass)([this.noRecord],"e-ddt-nodata"),(0,v.prepend)([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},t.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},t.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:ve+" "+Z}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},t.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},t.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter())},t.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},t.prototype.updateValue=function(e){this.isDynamicChange=!0,(0,v.isNullOrUndefined)(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},t.prototype.updateText=function(e){(0,v.isNullOrUndefined)(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},t.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=(0,v.select)(".e-overflow:not(.e-input-value)",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),(0,v.addClass)([this.inputEle],_),"Box"===this.mode?(0,v.removeClass)([this.overFlowWrapper,this.inputWrapper],ge):(0,v.addClass)([this.overFlowWrapper,this.inputWrapper],ge))}},t.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},t.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":N.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,t.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":N.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":N.Input.removeFloating(this.inputObj),N.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":this.oldValue=t.value,this.updateValue(e.value);break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&(0,v.detach)(this.overFlowWrapper),this.chipWrapper&&(0,v.detach)(this.chipWrapper),this.setTagValues()):("Custom"===t.mode&&this.updateOverflowWrapper(this.wrapText),this.updateModelMode());break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":for(var l=0,n=Object.keys(e.treeSettings);l<n.length;l++){var a=n[l];this.updateTreeSettings(a)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?((0,v.addClass)([this.overFlowWrapper],Z),this.chipWrapper&&"Box"===this.mode?(0,v.removeClass)([this.chipWrapper],Z):((0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_)),this.ensurePlaceHolder()):this.updateView()}}},t.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},t.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),(0,v.detach)(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),N.Input.setValue(null,this.inputEle,this.floatLabelType),(0,v.detach)(this.inputWrapper),(0,v.detach)(this.popupDiv),(0,v.detach)(this.hiddenElement),N.Input.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(_),(0,v.detach)(this.inputObj.container),this.inputObj.buttons.length&&(0,v.detach)(this.inputObj.buttons[0]),this.inputObj=null;this.hiddenElement.options.length>0;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var t=0,i=(0,v.selectAll)(".e-chips-close",this.chipCollection);t<i.length;t++){var s=i[t];v.EventHandler.remove(s,"mousedown",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,e.prototype.destroy.call(this),this.setProperties({value:[]},!0)},t.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),(0,v.detach)(this.filterObj.element),(0,v.detach)(this.filterContainer),this.filterObj=null)},t.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),(0,v.detach)(this.popupObj.element))},t.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},t.prototype.getData=function(e){return this.treeObj.getTreeData(e)},t.prototype.hidePopup=function(){var e={popup:this.popupObj,cancel:!1};this.trigger("close",e),e.cancel||(this.inputWrapper.classList.remove(J),this.popupEle&&(0,v.addClass)([this.popupEle],ee),(0,v.attributes)(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&(0,v.addClass)([this.inputWrapper],[G])),this.destroyPopupOnHide&&(this.isFirstRender=!0,this.destroyPopup())))},t.prototype.selectAll=function(e){this.selectAllItems(e)},t.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},t.prototype.getModuleName=function(){return"dropdowntree"},W([(0,v.Property)("The Request Failed")],t.prototype,"actionFailureTemplate",void 0),W([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),W([(0,v.Property)(!1)],t.prototype,"allowMultiSelection",void 0),W([(0,v.Property)(!0)],t.prototype,"changeOnBlur",void 0),W([(0,v.Property)("")],t.prototype,"cssClass",void 0),W([(0,v.Property)("${value.length} item(s) selected")],t.prototype,"customTemplate",void 0),W([(0,v.Property)(",")],t.prototype,"delimiterChar",void 0),W([(0,v.Property)(!0)],t.prototype,"enabled",void 0),W([(0,v.Complex)({},be)],t.prototype,"fields",void 0),W([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),W([(0,v.Property)("StartsWith")],t.prototype,"filterType",void 0),W([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),W([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),W([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),W([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),W([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),W([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),W([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),W([(0,v.Property)("Default")],t.prototype,"mode",void 0),W([(0,v.Property)("No Records Found")],t.prototype,"noRecordsTemplate",void 0),W([(0,v.Property)(null)],t.prototype,"placeholder",void 0),W([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),W([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),W([(0,v.Property)(!1)],t.prototype,"readonly",void 0),W([(0,v.Property)(!1)],t.prototype,"showSelectAll",void 0),W([(0,v.Property)("Select All")],t.prototype,"selectAllText",void 0),W([(0,v.Property)(!1)],t.prototype,"showCheckBox",void 0),W([(0,v.Property)(!0)],t.prototype,"destroyPopupOnHide",void 0),W([(0,v.Property)(!0)],t.prototype,"enableHtmlSanitizer",void 0),W([(0,v.Property)(!0)],t.prototype,"showClearButton",void 0),W([(0,v.Property)(!0)],t.prototype,"showDropDownIcon",void 0),W([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),W([(0,v.Property)(null)],t.prototype,"text",void 0),W([(0,v.Complex)({},Se)],t.prototype,"treeSettings",void 0),W([(0,v.Property)("Unselect All")],t.prototype,"unSelectAllText",void 0),W([(0,v.Property)(null)],t.prototype,"value",void 0),W([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),W([(0,v.Property)("100%")],t.prototype,"width",void 0),W([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),W([(0,v.Property)(!1)],t.prototype,"wrapText",void 0),W([(0,v.Event)()],t.prototype,"actionFailure",void 0),W([(0,v.Event)()],t.prototype,"beforeOpen",void 0),W([(0,v.Event)()],t.prototype,"change",void 0),W([(0,v.Event)()],t.prototype,"close",void 0),W([(0,v.Event)()],t.prototype,"blur",void 0),W([(0,v.Event)()],t.prototype,"created",void 0),W([(0,v.Event)()],t.prototype,"dataBound",void 0),W([(0,v.Event)()],t.prototype,"destroyed",void 0),W([(0,v.Event)()],t.prototype,"filtering",void 0),W([(0,v.Event)()],t.prototype,"focus",void 0),W([(0,v.Event)()],t.prototype,"keyPress",void 0),W([(0,v.Event)()],t.prototype,"open",void 0),W([(0,v.Event)()],t.prototype,"select",void 0),t=W([v.NotifyPropertyChanges],t)}(v.Component),xe=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ie=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},we="e-atc-spinner-icon";T.root="e-combobox";var Oe={container:null,buttons:[]},Ae=function(e){function t(t,i){return e.call(this,t,i)||this}return xe(t,e),t.prototype.preRender=function(){e.prototype.preRender.call(this)},t.prototype.getLocaleName=function(){return"combo-box"},t.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(v.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),v.EventHandler.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])||v.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),v.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(v.EventHandler.add(this.inputElement,"input",this.onInput,this),v.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),v.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),v.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this),v.EventHandler.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},t.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(T.input)||!v.Browser.isDevice)&&v.Browser.isDevice||e.preventDefault()},t.prototype.onBlurHandler=function(t){var i=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;(0,v.isNullOrUndefined)(this.listData)||(0,v.isNullOrUndefined)(i)||i===this.text||this.customValue(t),e.prototype.onBlurHandler.call(this,t)},t.prototype.targetElement=function(){return this.inputElement},t.prototype.setOldText=function(e){N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},t.prototype.setOldValue=function(e){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},t.prototype.valueMuteChange=function(e){e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(e)?(0,v.getValue)(this.fields.value?this.fields.value:"",e):e;var t=(0,v.isNullOrUndefined)(e)?null:e.toString();N.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton);var i={};if(this.allowObjectBinding&&(e=this.getDataByValue(e),(0,v.isNullOrUndefined)(e))){var s=this.fields,l=!1,n=!1;if(this.allowObjectBinding){var a=Object.keys(this.value);a.forEach((function(e){e!==s.value||(n=!0)})),a.forEach((function(e){e!==s.text||(l=!0)}))}i={text:n?l?(0,v.getValue)(s.text,this.value):(0,v.getValue)(s.value,this.value):null,value:n?this.value:null,index:null}}this.allowObjectBinding?this.setProperties(i,!0):this.setProperties({value:e,text:e?e.toString():e,index:null},!0),this.activeIndex=this.index;var o=this.fields,r={};r[o.text]=(0,v.isNullOrUndefined)(e)?null:e.toString(),r[o.value]=(0,v.isNullOrUndefined)(e)?null:e.toString(),this.itemData=r,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},t.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),(0,v.isNullOrUndefined)(this.value))if(this.text&&(0,v.isNullOrUndefined)(this.value)){(t=this.getElementByText(this.text))?this.setSelection(t,null):(N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue())}else this.setSelection(this.liCollections[this.activeIndex],null);else{var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,t=this.getElementByValue(e),i=!(0,v.isNullOrUndefined)(t);if(this.enableVirtualization&&this.value){var s,l=this.fields.value?this.fields.value:"",n=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof g.DataManager){if((s=new g.DataManager(this.virtualGroupDataSource).executeLocal((new g.Query).where(new g.Predicate(l,"equal",n))))&&s.length>0){this.itemData=s[0],i=!0;var a=this.getItemData(),o=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&this.setProperties({text:a.text?a.text.toString():a.text,value:o})}}else if((s=new g.DataManager(this.dataSource).executeLocal((new g.Query).where(new g.Predicate(l,"equal",n))))&&s.length>0){this.itemData=s[0],i=!0;a=this.getItemData(),o=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&this.setProperties({text:a.text?a.text.toString():a.text,value:o})}}t?this.setSelection(t,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!i?this.valueMuteChange(this.value):(!this.enableVirtualization||this.enableVirtualization&&!i)&&this.valueMuteChange(null)}this.setHiddenValue(),N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?(0,v.removeClass)([this.inputWrapper.clearButton],T.clearIconHide):(0,v.addClass)([this.inputWrapper.clearButton],T.clearIconHide))},t.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},t.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(e.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+T.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+T.li)),this.incrementalSearch(t))},t.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},t.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:Oe},t.prototype.onActionComplete=function(t,i,s,l){var n=this;e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout((function(){n.inlineSearch()}))},t.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),t=(0,v.isNullOrUndefined)(this.list)?this.list:this.list.querySelector("."+T.selected);if(e.text&&e.text.toString()===this.inputElement.value&&!(0,v.isNullOrUndefined)(t))return t;if((v.Browser.isDevice&&!this.isDropDownClick||!v.Browser.isDevice)&&!(0,v.isNullOrUndefined)(this.liCollections)&&this.liCollections.length>0){var i=this.inputElement.value,s=this.sortedData,l=this.typeOfData(s).typeof,n=o(i,this.liCollections,this.filterType,!0,s,this.fields,l,this.ignoreAccent);if(this.enableVirtualization&&""!==i&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var a=!1,r=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,h=0===this.incrementalEndIndex;for((r||h)&&(a=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=h?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0),(0!==this.viewPortInfo.startIndex||a)&&this.updateIncrementalView(0,this.itemCount),n=o(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l);(0,v.isNullOrUndefined)(n.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0,(0!==this.viewPortInfo.startIndex||a)&&this.updateIncrementalView(0,this.itemCount),n=o(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l),!(0,v.isNullOrUndefined)(n)){n.index=n.index+this.incrementalStartIndex;break}if((0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}}var u=n.index-(this.itemCount/2-2)>0?n.index-(this.itemCount/2-2):0,p=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;if(u!==this.viewPortInfo.startIndex&&this.updateIncrementalView(u,p),(0,v.isNullOrUndefined)(n.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{var d=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,c=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(d,c),n.item=this.getElementByValue(n.item.getAttribute("data-value"))}n&&n.item&&(n.item=this.getElementByValue(n.item.getAttribute("data-value")))}var m=n.item;if((0,v.isNullOrUndefined)(m))this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0));else{var f=this.getIndexByValue(m.getAttribute("data-value"))-1,g=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(g)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var y=this.fields.groupBy?this.liCollections[0].offsetHeight:0;if(this.enableVirtualization){if(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var C=m.offsetTop,b=this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0,S=m.offsetHeight,E=C+b*S,x=this.list.querySelectorAll(".e-virtual-list").length*S;this.list.scrollTop=E-x}}else this.list.scrollTop=f*g+y;(0,v.addClass)([m],T.focus)}}return m}return null},t.prototype.setValue=function(t){return(t&&"keydown"===t.type&&"enter"===t.action||t&&"click"===t.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):e.prototype.setValue.call(this,t)},t.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var t=this.getItemData(),i=this.allowObjectBinding?this.itemData:t.value;this.allowCustom&&(0,v.isNullOrUndefined)(t.value)&&(0,v.isNullOrUndefined)(t.text)||this.setProperties({value:i},!this.allowCustom)},t.prototype.showSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||N.Input.appendSpan("e-input-group-icon "+we,this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,(0,v.addClass)([this.spinnerElement],T.disableIcon),(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,k.showSpinner)(this.spinnerElement))},t.prototype.hideSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||((0,k.hideSpinner)(this.spinnerElement),(0,v.removeClass)([this.spinnerElement],T.disableIcon),this.spinnerElement.classList.contains(we)?(0,v.detach)(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},t.prototype.setAutoFill=function(e,t){if(t||this.setHoverList(e),this.autofill&&!this.preventAutoFill){var i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value"));"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==s||this.allowObjectBinding&&this.previousValue&&s&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(s)])?(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e.getAttribute("data-value"))):this.getFormattedValue(e.getAttribute("data-value"))):this.updateSelectedItem(e,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,t)}},t.prototype.isAndroidAutoFill=function(e){if(v.Browser.isAndroid){var t=this.getSelectionPoints(),i=this.prevSelectPoints.end,s=t.end,l=this.prevSelectPoints.start,n=t.start;return 0!==i&&(i===e.length&&l===e.length||l>n&&i>s||i===s&&l===n)}return!1},t.prototype.clearAll=function(t,i){((0,v.isNullOrUndefined)(i)||!(0,v.isNullOrUndefined)(i)&&(0,v.isNullOrUndefined)(i.dataSource))&&e.prototype.clearAll.call(this,t),this.isFiltering()&&!(0,v.isNullOrUndefined)(t)&&t.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(t))},t.prototype.isSelectFocusItem=function(e){return!(0,v.isNullOrUndefined)(e)},t.prototype.inlineSearch=function(e){var t=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),i=t?this.liCollections[this.activeIndex]:this.getFocusElement();if((0,v.isNullOrUndefined)(i)){if((0,v.isNullOrUndefined)(this.inputElement)||""!==this.inputElement.value)this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length>0&&!this.isCustomFilter&&this.removeFocus();else if(this.activeIndex=null,!(0,v.isNullOrUndefined)(this.list)){this.enableVirtualization||(this.list.scrollTop=0);var s=this.list.querySelector("."+T.li);this.setHoverList(s)}}else{if(!t){var l=this.getFormattedValue(i.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l),this.activeIndex=(0,v.isNullOrUndefined)(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(i,t)}},t.prototype.incrementalSearch=function(e){this.showPopup(e),(0,v.isNullOrUndefined)(this.listData)||(this.inlineSearch(e),e.preventDefault())},t.prototype.setAutoFillSelection=function(e,t){void 0===t&&(t=!1);var i=this.getSelectionPoints(),s=this.inputElement.value.substr(0,i.start);if(s&&s.toLowerCase()===e.substr(0,i.start).toLowerCase()){var l=s+e.substr(s.length,e.length);N.Input.setValue(l,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)}else t&&(N.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},t.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,!0,this.ignoreAccent)},t.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(v.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),v.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])||v.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(v.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(v.EventHandler.remove(this.inputElement,"input",this.onInput),v.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),v.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),v.EventHandler.remove(this.inputElement,"paste",this.pasteHandler),v.EventHandler.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},t.prototype.setSelection=function(t,i){e.prototype.setSelection.call(this,t,i),(0,v.isNullOrUndefined)(t)||this.autofill||this.isDropDownClick||this.removeFocus()},t.prototype.selectCurrentItem=function(e){var t;if(this.isPopupOpen){if(t=this.isSelected?this.list.querySelector("."+T.selected):this.list.querySelector("."+T.focus),this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))}"enter"===e.action&&""===this.inputElement.value?this.clearAll(e):this.isTyped&&!this.isSelected&&(0,v.isNullOrUndefined)(t)&&this.customValue(e),this.hidePopup(e)},t.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(T.selected)&&(this.removeFocus(),e.classList.add(T.focus))},t.prototype.targetFocus=function(e){v.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e),N.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},t.prototype.dropDownClick=function(t){t.preventDefault(),v.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,t)},t.prototype.customValue=function(e){var t=this,i=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value){var s=this.value;if((0,v.isNullOrUndefined)(i)){var l=""===this.inputElement.value?null:this.inputElement.value,n={text:l,item:{}};this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(l,n,s):this.trigger("customValueSpecifier",n,(function(i){t.updateCustomValueCallback(l,i,s,e)}))}else this.isSelectCustom=!1,i=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:i}),(!this.allowObjectBinding&&s!==this.value||this.allowObjectBinding&&s&&this.value&&!this.isObjectInArray(s,[this.value]))&&this.onChangeEvent(e)}else this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0);else{var a=this.previousValue,o=this.value;i=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:i}),(0,v.isNullOrUndefined)(this.value)&&N.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&a===this.value||this.allowObjectBinding&&a&&this.isObjectInArray(a,[this.value]))&&(!this.allowObjectBinding&&o!==this.value||this.allowObjectBinding&&o&&!this.isObjectInArray(o,[this.value]))&&this.onChangeEvent(null)}},t.prototype.updateCustomValueCallback=function(e,t,i,s){var l=this,n=this.fields,a=t.item,o={};a&&(0,v.getValue)(n.text,a)&&(0,v.getValue)(n.value,a)?o=a:((0,v.setValue)(n.text,e,o),(0,v.setValue)(n.value,e,o)),this.itemData=o;var r={};if(this.allowObjectBinding){var h=this.listData&&this.listData.length>0?Object.keys(this.listData[0]):Object.keys(this.itemData);this.listData&&this.listData.length>0||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)||(h=this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)),h.forEach((function(e){r[e]=e===n.value||e===n.text?(0,v.getValue)(n.value,l.itemData):null}))}var u={text:(0,v.getValue)(n.text,this.itemData),value:this.allowObjectBinding?r:(0,v.getValue)(n.value,this.itemData),index:null};this.setProperties(u,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&(null==i&&null!==this.value||i&&!this.isObjectInArray(i,[this.value])))&&this.onChangeEvent(s,!0)},t.prototype.onPropertyChanged=function(t,i){"combobox"===this.getModuleName()&&(this.checkData(t),this.setUpdateInitial(["fields","query","dataSource"],t,i));for(var s=0,l=Object.keys(t);s<l.length;s++){var n=l[s];switch(n){case"readonly":N.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(v.EventHandler.remove(this.inputElement,"input",this.onInput),v.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),v.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(v.EventHandler.add(this.inputElement,"input",this.onInput,this),v.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),v.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&(0,v.isNullOrUndefined)(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var a=this.getPropObject(n,t,i);e.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty),this.isFiltering()&&"dataSource"===n&&(0,v.isNullOrUndefined)(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},t.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},t.prototype.getModuleName=function(){return"combobox"},t.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},t.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},t.prototype.showPopup=function(t){e.prototype.showPopup.call(this,t)},t.prototype.hidePopup=function(t){var i=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!(0,v.isNullOrUndefined)(this.listData)){var s=this.isEscapeKey;this.isEscapeKey&&(N.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var l=this.isSelectCustom?{text:""}:this.getItemData(),n=(0,v.isNullOrUndefined)(this.list)?null:this.list.querySelector("."+T.selected);if(this.inputElement&&l.text===this.inputElement.value&&!(0,v.isNullOrUndefined)(n))return this.isSelected&&(this.onChangeEvent(t),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,t);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var a=this.sortedData,r=this.typeOfData(a).typeof,h=o(this.inputElement.value,this.liCollections,"Equal",!0,a,this.fields,r);this.selectedLI=h.item,(0,v.isNullOrUndefined)(h.index)&&(h.index=o(this.inputElement.value,this.liCollections,"StartsWith",!0,a,this.fields,r).index),this.activeIndex=h.index,(0,v.isNullOrUndefined)(this.selectedLI)?s&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(t)}var u=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;(0,v.isNullOrUndefined)(this.listData)&&this.allowCustom&&!(0,v.isNullOrUndefined)(i)&&i!==u&&this.customValue(),e.prototype.hidePopup.call(this,t)},t.prototype.focusIn=function(){this.enabled&&(v.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},t.prototype.clear=function(){this.value=null},t.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},t.prototype.getItems=function(){return e.prototype.getItems.call(this)},t.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},t.prototype.renderHightSearch=function(){},Ie([(0,v.Property)(!1)],t.prototype,"autofill",void 0),Ie([(0,v.Property)(!0)],t.prototype,"allowCustom",void 0),Ie([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),Ie([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),Ie([(0,v.Property)(!0)],t.prototype,"isDeviceFullScreen",void 0),Ie([(0,v.Property)(null)],t.prototype,"query",void 0),Ie([(0,v.Property)(null)],t.prototype,"index",void 0),Ie([(0,v.Property)(!0)],t.prototype,"showClearButton",void 0),Ie([(0,v.Property)(!1)],t.prototype,"enableRtl",void 0),Ie([(0,v.Event)()],t.prototype,"customValueSpecifier",void 0),Ie([(0,v.Event)()],t.prototype,"filtering",void 0),Ie([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),Ie([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),Ie([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),Ie([(0,v.Property)(null)],t.prototype,"cssClass",void 0),Ie([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),Ie([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),Ie([(0,v.Property)(null)],t.prototype,"placeholder",void 0),Ie([(0,v.Property)("100%")],t.prototype,"width",void 0),Ie([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),Ie([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),Ie([(0,v.Property)(!1)],t.prototype,"readonly",void 0),Ie([(0,v.Property)(null)],t.prototype,"text",void 0),Ie([(0,v.Property)(null)],t.prototype,"value",void 0),Ie([(0,v.Property)(!1)],t.prototype,"allowObjectBinding",void 0),t=Ie([v.NotifyPropertyChanges],t)}(P),De=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ke=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};T.root="e-autocomplete",T.icon="e-input-group-icon e-ddl-icon e-search-icon";var Ne=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return De(t,e),t.prototype.preRender=function(){e.prototype.preRender.call(this)},t.prototype.getLocaleName=function(){return"auto-complete"},t.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query,i=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,s=""!==this.queryString||(0,v.isNullOrUndefined)(i)?this.filterType:"equal",l=""!==this.queryString||(0,v.isNullOrUndefined)(i)?this.queryString:i;if(this.isFiltered)if(this.enableVirtualization&&!(0,v.isNullOrUndefined)(this.customFilterQuery))t=this.customFilterQuery.clone();else if(!this.enableVirtualization)return t;if(null!==this.queryString&&""!==this.queryString){var n=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==n)&&"number"!==n){var a=(0,v.isNullOrUndefined)(this.fields.value)?"":this.fields.value;t.where(a,s,l,this.ignoreCase,this.ignoreAccent)}else t.where("",s,l,this.ignoreCase,this.ignoreAccent)}if(!(0,v.isNullOrUndefined)(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(var o=0;o<t.queries.length;o++)"onTake"===t.queries[o].fn&&t.queries.splice(o,1);t.take(this.suggestionCount)}if(this.enableVirtualization){var r=0,h=0,u=this.getTakeValue();if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)"onSkip"===t.queries[o].fn&&(h=t.queries[o].e.nos),"onTake"===t.queries[o].fn&&(r=u<=t.queries[o].e.nos?t.queries[o].e.nos:u);if(r<=0&&this.query&&this.query.queries.length>0)for(o=0;o<this.query.queries.length;o++)if("onTake"===this.query.queries[o].fn){var p=this.query.queries[o].e.nos;r=u<=p?p:u}if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)if("onSkip"!==t.queries[o].fn){if("onTake"===t.queries[o].fn){var d=t.queries[o].e.nos;r=d<=r?r:d,t.queries.splice(o,1),--o}}else h=t.queries[o].e.nos,t.queries.splice(o,1),--o;h>0&&this.virtualItemStartIndex<=h?t.skip(h):t.skip(this.virtualItemStartIndex),r>0&&u<=r?t.take(r):t.take(u),t.requiresCount()}return t},t.prototype.searchLists=function(t){var i=this;if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.checkAndResetCache(),(0,v.isNullOrUndefined)(this.list)&&e.prototype.renderList.call(this,t,!0),this.queryString=this.filterInput.value,"mousedown"!==t.type&&(40===t.keyCode||38===t.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields,null,t);this.isSelected=!1,this.activeIndex=null,this.isRequesting=!1;var s={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,t,l){s.cancel||(i.isFiltered=!0,i.customFilterQuery=t,i.filterAction(e,t,l))},cancel:!1};this.trigger("filtering",s,(function(e){e.cancel||i.isFiltered||e.preventDefaultAction||(i.searchList=!0,i.filterAction(i.dataSource,null,i.fields,t))}))},t.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},t.prototype.filterAction=function(e,t,i,s){this.beforePopupOpen=!0;var l=this.list.classList.contains("e-nodata");if(""!==this.queryString&&this.queryString.length>=this.minLength){if(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t,s),l=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!l){if(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")){var n=this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()});this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))}if(!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement){n=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(n)}}("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof g.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof g.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}else this.hidePopup(s),this.beforePopupOpen=!1;this.renderReactTemplates()},t.prototype.clearAll=function(t,i){((0,v.isNullOrUndefined)(i)||!(0,v.isNullOrUndefined)(i)&&(0,v.isNullOrUndefined)(i.dataSource))&&(e.prototype.clearAll.call(this,t),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},t.prototype.onActionComplete=function(t,i,s,l){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof g.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof g.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),e.prototype.onActionComplete.call(this,t,i,s);var n=this.list.querySelector("."+T.li);(0,v.isNullOrUndefined)(n)||(0,v.removeClass)([n],T.focus),(0,v.isNullOrUndefined)(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},t.prototype.postBackAction=function(){if(this.autofill&&!(0,v.isNullOrUndefined)(this.liCollections[0])&&this.searchList){var t=[this.liCollections[0]],i=this.listData,s=this.typeOfData(i).typeof,l=o(this.inputElement.value,t,"StartsWith",this.ignoreCase,i,this.fields,s);this.searchList=!1,(0,v.isNullOrUndefined)(l.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},t.prototype.setSelection=function(t,i){if(this.isValidLI(t))if(!(0,v.isNullOrUndefined)(i)&&"keydown"===i.type&&"enter"!==i.action&&"tab"!==i.action&&this.isValidLI(t)){var s=this.getFormattedValue(t.getAttribute("data-value"));if(this.activeIndex=this.getIndexByValue(s),this.setHoverList(t),this.selectedLI=t,this.setScrollPosition(i),this.autofill&&this.isPopupOpen){this.preventAutoFill=!1;var l=i&&"down"===i.action||"up"===i.action||"home"===i.action||"end"===i.action||"pageUp"===i.action||"pageDown"===i.action;e.prototype.setAutoFill.call(this,t,l)}}else e.prototype.setSelection.call(this,t,i),this.isFiltered=!1;else this.selectedLI=t},t.prototype.listOption=function(t,i){var s=this,l=e.prototype.listOption.call(this,t,i);if((0,v.isNullOrUndefined)(l.itemCreated))l.itemCreated=function(e){s.highlight&&(s.element.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout((function(){d(e.item,s.queryString,s.ignoreCase,s.filterType)}),0):d(e.item,s.queryString,s.ignoreCase,s.filterType))};else{var n=l.itemCreated;l.itemCreated=function(e){s.highlight&&d(e.item,s.queryString,s.ignoreCase,s.filterType),n.apply(s,[e])}}return l},t.prototype.isFiltering=function(){return!0},t.prototype.renderPopup=function(t){this.enableVirtualization||(this.list.scrollTop=0),e.prototype.renderPopup.call(this,t)},t.prototype.isEditTextBox=function(){return!1},t.prototype.isPopupButton=function(){return this.showPopupButton},t.prototype.isSelectFocusItem=function(e){return!1},t.prototype.setInputValue=function(e,t){var i=t&&t.text?t.text:t?t.value:t,s=e&&e.text?e.text:e&&e.value?e.value:this.value;if(this.allowObjectBinding&&(i=(0,v.isNullOrUndefined)(i)?i:(0,v.getValue)(this.fields.value?this.fields.value:"",i),s=(0,v.isNullOrUndefined)(s)?s:(0,v.getValue)(this.fields.value?this.fields.value:"",s)),!s||""!==this.typedString||this.allowCustom||this.dataSource instanceof g.DataManager)e&&(e.text?this.setOldText(i):this.setOldValue(i));else{var l="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,n=this.getItems().length,a=new g.Query,o=this;new g.DataManager(this.dataSource).executeQuery(a.where(new g.Predicate(l,"equal",s))).then((function(t){t.result.length>0?(o.value=""!==l?o.allowObjectBinding?t.result[0]:t.result[0][o.fields.value].toString():t.result[0].toString(),o.addItem(t.result,n),o.updateValues()):e&&e.text?o.setOldText(i):e&&e.value?o.setOldValue(i):o.updateValues()}))}},t.prototype.showPopup=function(e){this.enabled&&(this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.preventAutoFill=!0,(0,v.isNullOrUndefined)(this.list)?this.renderList(e):this.resetList(this.dataSource,this.fields,null,e)))},t.prototype.hidePopup=function(t){e.prototype.hidePopup.call(this,t),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},t.prototype.onPropertyChanged=function(t,i){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],t);for(var s=0,l=Object.keys(t);s<l.length;s++){var n=l[s];if("showPopupButton"===n)if(this.showPopupButton){var a=N.Input.appendSpan(T.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=a,N.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,v.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&v.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else(0,v.detach)(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null;else{var o=this.getPropObject(n,t,i);e.prototype.onPropertyChanged.call(this,o.newProperty,o.oldProperty)}}},t.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++){var t=this.ulElement.querySelector(".e-active");t||(m(this.liCollections[e]),d(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType)),t=null}},t.prototype.getModuleName=function(){return"autocomplete"},t.prototype.render=function(){e.prototype.render.call(this)},ke([(0,v.Complex)({value:null,iconCss:null,groupBy:null,disabled:null},O)],t.prototype,"fields",void 0),ke([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),ke([(0,v.Property)(!1)],t.prototype,"showPopupButton",void 0),ke([(0,v.Property)(!1)],t.prototype,"highlight",void 0),ke([(0,v.Property)(20)],t.prototype,"suggestionCount",void 0),ke([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),ke([(0,v.Property)(null)],t.prototype,"query",void 0),ke([(0,v.Property)(1)],t.prototype,"minLength",void 0),ke([(0,v.Property)("Contains")],t.prototype,"filterType",void 0),ke([(0,v.Event)()],t.prototype,"filtering",void 0),ke([(0,v.Property)(null)],t.prototype,"index",void 0),ke([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),ke([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),ke([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),ke([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),ke([(0,v.Property)(null)],t.prototype,"text",void 0),t=ke([v.NotifyPropertyChanges],t)}(Ae),Le="e-float-line",Be="e-float-text",Te="e-label-top",Ve="e-label-bottom";function Pe(e,t,i,s,l,n,a){var o=(0,v.createElement)("span",{className:Le}),r=(0,v.createElement)("label",{className:Be}),h=i.getAttribute("id")?i.getAttribute("id"):(0,v.getUniqueID)("ej2_multiselect");i.id=h,(0,v.isNullOrUndefined)(i.id)||""===i.id||(r.id="label_"+i.id.replace(/ /g,"_"),r.setAttribute("for",i.id),(0,v.attributes)(s,{"aria-labelledby":r.id})),(0,v.isNullOrUndefined)(s.placeholder)||""===s.placeholder||(r.innerText=Me(s.placeholder),s.removeAttribute("placeholder")),r.innerText=Me(a),t.appendChild(o),t.appendChild(r),e.classList.add("e-float-input"),Ue(l,r),"Always"===n&&(r.classList.contains(Ve)&&(0,v.removeClass)([r],Ve),(0,v.addClass)([r],Te))}function Ue(e,t){e&&e.length>0?((0,v.addClass)([t],Te),(0,v.removeClass)([t],Ve)):((0,v.removeClass)([t],Te),(0,v.addClass)([t],Ve))}function He(e,t,i,s,l,n,a){var o,r=t.querySelector("."+Be),h=t.querySelector("."+Le);(0,v.isNullOrUndefined)(r)?Fe(l,s,o=null!==a?a:""):(o=r.innerText,(0,v.detach)(i.querySelector("."+Be)),Fe(l,s,o),(0,v.isNullOrUndefined)(h)||(0,v.detach)(i.querySelector("."+Le))),e.classList.remove("e-float-input")}function Fe(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function We(e,t){e.classList.add("e-input-focus");var i=t.querySelector("."+Be);(0,v.isNullOrUndefined)(i)||((0,v.addClass)([i],Te),i.classList.contains(Ve)&&(0,v.removeClass)([i],Ve))}function qe(e,t,i,s,l){e.classList.remove("e-input-focus");var n=t.querySelector("."+Be);i&&i.length<=0&&"Auto"===s&&!(0,v.isNullOrUndefined)(n)&&(n.classList.contains(Te)&&(0,v.removeClass)([n],Te),(0,v.addClass)([n],Ve))}function Me(e){var t="";if(!(0,v.isNullOrUndefined)(e)&&""!==e){var i=document.createElement("span");i.innerHTML='<input placeholder="'+e+'"/>',t=i.children[0].placeholder}return t}var je=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Re=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ze="e-input-focus",Ke="e-disabled",_e="e-hide-listitem",Ge="e-chips",Qe="e-chips-close",Je="e-chip-selected",Xe="e-delimiter",Ye="e-zero-size",$e="e-chips-close e-close-hooker",Ze="e-delim-values",et="e-rtl",tt="e-close-icon-hide",it="e-ddl-disable-icon",st="e-ms-spinner-icon",lt="e-input-group-icon e-ddl-icon",nt="e-icon-anim",at="e-delim-total",ot="e-search-custom-width",rt="e-input-filter",ht=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.previousFilterText="",s.storedSelectAllHeight=0,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isBlurDispatching=!1,s.isFilterPrevented=!1,s.isFilteringAction=!1,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.preventSetCurrentData=!1,s.isSelectAllLoop=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return je(t,e),t.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add(et):this.overAllWrapper.classList.remove(et),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},t.prototype.requiredModules=function(){var e=[];if(this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode){if(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t}this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})}return e},t.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];switch(i){case"class":var s=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==s&&((0,v.addClass)([this.overAllWrapper],s.split(" ")),(0,v.addClass)([this.popupWrapper],s.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(i,this.htmlAttributes[""+i]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:["id"].indexOf(i)>-1?this.element.setAttribute(i,this.htmlAttributes[""+i]):0===i.indexOf("data")||["name","required","aria-required","form"].indexOf(i)>-1?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):["title","role","style","class"].indexOf(i)>-1?this.overAllWrapper.setAttribute(i,this.htmlAttributes[""+i]):"size"===i||(0,v.isNullOrUndefined)(this.inputElement)||this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}}},t.prototype.updateReadonly=function(e){(0,v.isNullOrUndefined)(this.inputElement)||(e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},t.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove(tt)):(this.overAllClear.style.display="none",this.componentWrapper.classList.add(tt))},t.prototype.updateCssClass=function(){if(!(0,v.isNullOrUndefined)(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&((0,v.addClass)([this.overAllWrapper],e.split(" ")),(0,v.addClass)([this.popupWrapper],e.split(" ")))}},t.prototype.updateOldPropCssClass=function(e){(0,v.isNullOrUndefined)(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&((0,v.removeClass)([this.overAllWrapper],e.split(" ")),(0,v.removeClass)([this.popupWrapper],e.split(" ")))},t.prototype.onPopupShown=function(e){var t=this;if(v.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var i=this;window.onpopstate=function(){i.hidePopup(),i.inputElement.focus()},history.pushState({},"")}var s={popup:this.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}};this.trigger("open",s,(function(e){e.cancel||(t.focusAtFirstListItem(!0),t.popupObj&&document.body.appendChild(t.popupObj.element),"CheckBox"===t.mode&&t.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(t.fields.groupBy)&&t.updateListItems(t.list.querySelectorAll("li.e-list-item"),t.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===t.mode||t.showDropDownIcon)&&(0,v.addClass)([t.overAllWrapper],[nt]),t.refreshPopup(),t.renderReactTemplates(),t.popupObj&&t.popupObj.show(e.animation,1e3===t.zIndex?t.element:null),t.isReact&&setTimeout((function(){if(t.popupHeight&&t.list&&"auto"!==t.popupHeight){var e="string"==typeof t.popupHeight?parseInt(t.popupHeight,10):t.popupHeight;if(!t.isUpdateHeaderHeight&&t.headerTemplate&&t.header){var i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.header.offsetHeight).toString()+"px",t.isUpdateHeaderHeight=!0}if(!t.isUpdateFooterHeight&&t.footerTemplate&&t.footer){i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.footer.offsetHeight).toString()+"px",t.isUpdateFooterHeight=!0}}}),15),(0,v.attributes)(t.inputElement,{"aria-expanded":"true","aria-owns":t.element.id+"_popup","aria-controls":t.element.id}),t.updateAriaActiveDescendant(),t.isFirstClick&&(t.enableVirtualization||t.loadTemplate()),"CheckBox"===t.mode&&t.showSelectAll&&v.EventHandler.add(t.popupObj.element,"click",t.clickHandler,t))}))},t.prototype.updateVirtualReOrderList=function(e){var t=this.getForQuery(this.value,!0).clone();if(this.enableVirtualization&&this.dataSource instanceof g.DataManager?this.resetList(this.selectedListData,this.fields,t):this.resetList(this.dataSource,this.fields,t),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(i)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),e&&this.loadTemplate()},t.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},t.prototype.loadTemplate=function(){if(this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode){var e=this.list.querySelectorAll(".e-reorder")[0];this.list.querySelector(".e-virtual-ddl-content")&&e&&this.list.querySelector(".e-virtual-ddl-content").removeChild(e)}"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},t.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0){var e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],t=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",e);(0,v.isNullOrUndefined)(t)||this.scrollBottom(t,void 0,!1,null,!0)}if(this.enableVirtualization){var i=this.list.querySelector("."+A.focus);this.isKeyBoardAction=!1,this.scrollBottom(i,void 0,!1,null,!0)}},t.prototype.focusAtFirstListItem=function(e){if(this.ulElement&&this.ulElement.querySelector("li."+A.li)){var t,i=void 0;if("CheckBox"===this.mode)return void this.removeFocus();this.enableVirtualization?this.fields.disabled?(i=this.ulElement.querySelector("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem):not(."+Ke+")"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(i=(t=this.ulElement.querySelectorAll("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&t.length>0?t[2]:i)):(i=this.ulElement.querySelector("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(i=(t=this.ulElement.querySelectorAll("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&t.length>0?t[2]:i)):i=this.fields.disabled?this.ulElement.querySelector("li."+A.li+":not(."+_e+"):not(."+Ke+")"):this.ulElement.querySelector("li."+A.li+":not(."+_e+")"),null!==i&&(this.removeFocus(),this.addListFocus(i))}},t.prototype.focusAtLastListItem=function(e){var t;e?t=o(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?o(this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null;t&&null!==t.item&&(this.addListFocus(t.item),((this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(t.item,t.index))},t.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},t.prototype.updateListARIA=function(){(0,v.isNullOrUndefined)(this.ulElement)||(0,v.attributes)(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var e=!((0,v.isNullOrUndefined)(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||(0,v.isNullOrUndefined)(this.inputElement)||(0,v.attributes)(this.inputElement,this.getAriaAttributes()),e&&(0,v.attributes)(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},t.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var t=this.htmlAttributes;(0,v.extend)(t,{"aria-disabled":e},t),this.setProperties({htmlAttributes:t},!0)}},t.prototype.removelastSelection=function(e){if(null===this.chipCollectionWrapper.querySelector("span."+Je)){var t=this.chipCollectionWrapper.querySelectorAll("span."+Ge),i=t[t.length-1].getAttribute("data-value");(0,v.isNullOrUndefined)(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice()));var s=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i);this.allowCustomValue&&("false"!==i&&!1===s||!(0,v.isNullOrUndefined)(s)&&"NaN"===s.toString())&&(s=i),this.removeValue(s,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()}else this.removeSelectedChip(e)},t.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},t.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement.value},t.prototype.getForQuery=function(e,t){var i,s=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&e){if(t){for(var l=0;l<e.length;l++){var n=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e[l]):e[l];i=0===l?new g.Predicate(s,"equal",n):i.or(s,"equal",n)}return(new g.Query).where(i)}for(l=0;l<e.length;l++){n=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e[l]):e[l];i=0===l?new g.Predicate(s,"notequal",n):i.and(s,"notequal",n)}return(new g.Query).where(i)}for(l=0;l<e.length;l++)i=0===l?new g.Predicate(s,"equal",e[l]):i.or(s,"equal",e[l]);return this.dataSource instanceof g.DataManager&&this.dataSource.adaptor instanceof g.JsonAdaptor?(new g.Query).where(i):this.getQuery(this.query).clone().where(i)},t.prototype.onActionComplete=function(t,i,s,l){var n=this;if(this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(s)&&!this.virtualGroupDataSource&&(this.totalItemCount=s.count),this.value&&i&&i.length>0&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction){var a=i.every((function(e){var t=(0,v.getValue)(n.fields.value?n.fields.value:"",e);return n.value.some((function(e){var i=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",e):e;return t===i}))}));a&&(t.innerHTML="",i=[])}e.prototype.onActionComplete.call(this,t,i,s),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);if(!(0,v.isNullOrUndefined)(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&this.listData.length>0)for(var o=0;o<this.value.length;o++){var r=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[o]):this.value[o];this.findListElement(this.allowFiltering&&!(0,v.isNullOrUndefined)(this.mainList)?this.mainList:t,"li","data-value",r)||this.dataSource instanceof g.DataManager||(this.value.splice(o,1),o-=1)}var h=[];if((0,v.isNullOrUndefined)(this.value)||(h=this.presentItemValue(this.ulElement)),h.length>0&&this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(this.value)&&null!=this.listData&&!this.enableVirtualization?this.addNonPresentItems(h,this.ulElement,this.listData):this.updateActionList(t,i,s),this.dataSource instanceof g.DataManager&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value){var u=new g.Query;u=this.allowFiltering?u.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):u,this.checkForCustomValue(u,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue}"CheckBox"!==this.mode||!this.enableGroupCheckBox||(0,v.isNullOrUndefined)(this.fields.groupBy)||(0,v.isNullOrUndefined)(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof g.DataManager&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},t.prototype.updateActionList=function(e,t,i,s){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?((0,v.isNullOrUndefined)(this.mainData)||0===this.mainData.length)&&(this.mainData=t):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=t,this.mainListCollection=this.liCollections),(this.remoteCustomValue||t.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!(0,v.isNullOrUndefined)(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof g.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),(0,v.isNullOrUndefined)(this.setInitialValue)||this.setInitialValue(),(0,v.isNullOrUndefined)(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&((0,v.isNullOrUndefined)(this.text)||!(0,v.isNullOrUndefined)(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof g.DataManager)?this.initialValueUpdate(this.listData,!0):this.initialValueUpdate(),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,this.value,null)),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown(i)))},t.prototype.refreshSelection=function(){var e,t,i=this.hideSelectedItem?_e:A.selected;if(!(0,v.isNullOrUndefined)(this.value))for(var s=0;!(0,v.isNullOrUndefined)(this.value[s]);s++)if(e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[s]):this.value[s],t=this.findListElement(this.list,"li","data-value",e)){if((0,v.addClass)([t],i),this.hideSelectedItem&&t.previousSibling&&t.previousElementSibling.classList.contains(A.group)&&(!t.nextElementSibling||t.nextElementSibling.classList.contains(A.group))&&(0,v.addClass)([t.previousElementSibling],i),this.hideSelectedItem&&this.fields.groupBy&&!t.previousElementSibling.classList.contains(_e)&&this.hideGroupItem(e),this.hideSelectedItem&&t.classList.contains(A.focus)){(0,v.removeClass)([t],A.focus);var l=t.parentElement.querySelectorAll("."+A.li+":not(."+_e+"):not(."+Ke+")");l.length>0?((0,v.addClass)([l[0]],A.focus),this.updateAriaActiveDescendant()):this.list&&this.list.querySelectorAll("."+A.li).length>0||(this.l10nUpdate(),(0,v.addClass)([this.list],A.noData))}if(t.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&t.classList.contains("e-active"))if(0===t.getElementsByClassName("e-check").length){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:t,e:null};this.notify("updatelist",n)}}this.checkSelectAll(),this.checkMaxSelection()},t.prototype.hideGroupItem=function(e){var t,i,s=this.hideSelectedItem?_e:A.selected;i=t=this.findListElement(this.ulElement,"li","data-value",e);var l=0,n=0,a=!0,o=!0;do{t&&t.previousElementSibling&&!t.previousElementSibling.classList.contains(_e)&&t.previousElementSibling.classList.contains(A.li)&&(a=!1),!a||!t||t.previousElementSibling&&t.previousElementSibling.classList.contains(A.group)?l=10:t=t.previousElementSibling,i&&i.nextElementSibling&&!i.nextElementSibling.classList.contains(_e)&&i.nextElementSibling.classList.contains(A.li)&&(o=!1),!o||!i||i.nextElementSibling&&i.nextElementSibling.classList.contains(A.group)?n=10:i=i.nextElementSibling}while(l<10||n<10);a&&o&&!t.previousElementSibling.classList.contains(_e)?(0,v.addClass)([t.previousElementSibling],s):a&&o&&t.previousElementSibling.classList.contains(_e)&&(0,v.removeClass)([t.previousElementSibling],s)},t.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+A.li+":not(."+_e+")");return(0,v.isNullOrUndefined)(e)?this.liCollections[0]:e},t.prototype.checkSelectAll=function(){var e=(0,v.isNullOrUndefined)(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active").length:this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)").length,t=this.list.querySelectorAll("li.e-list-item"),i=this.enableVirtualization?this.list.querySelectorAll("li."+A.li+":not(.e-virtual-list)").length:(0,v.isNullOrUndefined)(this.fields.disabled)?this.list.querySelectorAll("li."+A.li).length:this.list.querySelectorAll("li."+A.li+":not(.e-disabled)").length,s=this.list.querySelectorAll("li."+A.selected).length;if(this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(s-=e),!this.enableVirtualization&&(i===s||s===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.virtualSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):i!==s&&"CheckBox"===this.mode&&this.showSelectAll&&(!this.enableVirtualization||this.enableVirtualization&&!this.virtualSelectAll)&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var l=0;l<t.length;l++)this.findGroupStart(t[l]);this.deselectHeader()}},t.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(e)},t.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var t=String.fromCharCode(e.keyCode).match(/\w/);(0,v.isNullOrUndefined)(t)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},t.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query;if(this.isFiltered){if(this.enableVirtualization&&!(0,v.isNullOrUndefined)(this.customFilterQuery))return t=this.customFilterQuery.clone(),this.virtualFilterQuery(t);if(!this.enableVirtualization)return t}if(this.filterAction){if(null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim()){var i=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==i)&&"number"!==i){if(this.enableVirtualization&&""!==this.targetElement()&&!this.isClearAllAction||!this.enableVirtualization){var s=this.fields;t.where((0,v.isNullOrUndefined)(s.text)?"":s.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}}else t.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(t):this.virtualSelectAll?e?e.take(this.maximumSelectionLength).requiresCount():this.query?this.query.take(this.maximumSelectionLength).requiresCount():(new g.Query).take(this.maximumSelectionLength).requiresCount():t}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(t):this.virtualSelectAll?e?e.take(this.maximumSelectionLength).requiresCount():this.query?this.query.take(this.maximumSelectionLength).requiresCount():(new g.Query).take(this.maximumSelectionLength).requiresCount():e||(this.query?this.query:new g.Query)},t.prototype.virtualFilterQuery=function(e){for(var t=this.getTakeValue(),i=!0,s=!0,l=0;l<e.queries.length;l++)"multiselect"===this.getModuleName()&&(e.queries[l].e&&"or"===e.queries[l].e.condition||e.queries[l].e&&"equal"===e.queries[l].e.operator)&&(i=!1),"onSkip"===e.queries[l].fn&&(s=!1),"onTake"===e.queries[l].fn&&!1;var n=0;if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=t<=e.queries[l].e.nos?e.queries[l].e.nos:t);if(n<=0&&this.query&&this.query.queries.length>0)for(l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=t<=this.query.queries[l].e.nos?this.query.queries[l].e.nos:t);if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=e.queries[l].e.nos<=n?n:e.queries[l].e.nos,e.queries.splice(l,1),--l);return(this.allowFiltering&&s||!i||!this.allowFiltering&&s)&&(i?e.skip(this.virtualItemStartIndex):e.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):n>0?e.take(n):e.take(t),e.requiresCount(),e},t.prototype.getTakeValue=function(){return this.allowFiltering&&v.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},t.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;var s=this.list.classList.contains(A.noData);if(""===this.targetElement().trim()){var l=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&this.value.length>0){this.remoteCustomValue=!1;var n=!1;if(this.allowCustomValue&&0===l.querySelectorAll("li").length&&this.mainData.length>0&&(this.mainData=[]),this.enableVirtualization)if(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&this.value.length>0&&"CheckBox"===this.mode)this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),n=!0;else if(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),(s||this.allowCustomValue)&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),!this.list.querySelector(".e-virtual-ddl"))){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)}this.onActionComplete(l,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),n||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this})}}else{if(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder")&&this.list.querySelector(".e-list-parent.e-reorder").remove()),this.resetList(e,i,t),this.enableVirtualization&&(s||this.allowCustomValue)&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),!this.list.querySelector(".e-virtual-ddl"))){a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)}this.allowCustomValue&&(e instanceof g.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,i))}this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},t.prototype.checkForCustomValue=function(e,t){var i=!this.getValueByText(this.inputElement.value,this.ignoreCase),s=t||this.fields;if(this.allowCustomValue&&i){var l=this.inputElement.value,n=!(0,v.isNullOrUndefined)(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if(n&&"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n){var a={};(0,v.setValue)(s.text,l,a),"number"==typeof(0,v.getValue)(this.fields.value?this.fields.value:"value",n)&&this.fields.value!==this.fields.text?(0,v.setValue)(s.value,Math.random(),a):(0,v.setValue)(s.value,l,a);var r={};if(this.allowObjectBinding)(this.listData&&this.listData.length>0?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(a)).forEach((function(e){r[e]=e===t.value||e===t.text?(0,v.getValue)(t.value,a):null}));if(a=this.allowObjectBinding?r:a,this.enableVirtualization){this.virtualCustomData=a;var h=this.dataSource instanceof g.DataManager?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource));this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&h.concat(this.virtualCustomSelectData),h.splice(0,0,a),this.isCustomDataUpdated=!0;var u=this.totalItemCount;this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(h,s,e),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof g.DataManager?u:this.totalItemCount}else{this.dataSource instanceof g.DataManager&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(h=JSON.parse(JSON.stringify(this.listData))).splice(0,0,a),this.resetList(h,s,e)}}else if(this.listData){(h=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),h[0]="number"!=typeof n||isNaN(parseFloat(h[0]))?h[0]:parseFloat(h[0]),h[0]="boolean"==typeof n?"true"===h[0]||"false"!==h[0]&&h[0]:h[0],this.resetList(h,s)}}else if(this.listData&&this.mainData&&!i&&this.allowCustomValue)if(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue)this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,s,e);else if(!this.allowFiltering&&this.list){var p=this.list.querySelectorAll("li."+A.li+":not(.e-hide-listitem)"),d=o(this.targetElement(),p,"StartsWith",this.ignoreCase);d&&null!==d.item&&this.addListFocus(d.item)}this.value&&this.value.length&&this.refreshSelection()},t.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},t.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled)if(e.target!==this.overAllClear){if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf(Qe))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&e.target.className===lt)?this.showPopup(e):(this.hidePopup(e),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(ze)||this.overAllWrapper.classList.add(ze)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}else e.preventDefault()},t.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove(Ke),this.inputElement.removeAttribute("disabled"),(0,v.attributes)(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add(Ke),this.inputElement.setAttribute("disabled","true"),(0,v.attributes)(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},t.prototype.onBlurHandler=function(e,t){var i;if(this.isBlurDispatching&&this.isAngular)this.isBlurDispatching=!1;else if((0,v.isNullOrUndefined)(e)||(i=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(i))"CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&(0,v.addClass)([this.overAllWrapper],"e-valid-input");else{if("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&(0,v.removeClass)([this.overAllWrapper],"e-valid-input"),"CheckBox"===this.mode&&v.Browser.isIE&&!(0,v.isNullOrUndefined)(e)&&!t)return this.inputFocus=!1,void this.overAllWrapper.classList.remove(ze);if(this.scrollFocusStatus)return(0,v.isNullOrUndefined)(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1);if(this.inputFocus=!1,this.overAllWrapper.classList.remove(ze),this.addTagOnBlur){var s=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),l=this.findListElement(this.list,"li","data-value",s),n=this.hideSelectedItem?_e:A.selected;!(!l||l.classList.contains(n))&&(this.updateListSelection(l,e),"Delimiter"===this.mode&&this.updateDelimeter(this.delimiterChar))}this.updateDataList(),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&this.hidePopup(e),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,v.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),qe(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!(0,v.isNullOrUndefined)(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")}},t.prototype.calculateWidth=function(){var e;if(this.overAllWrapper){if(!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top"))e=this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10);else{var t=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10);e=this.overAllWrapper.clientWidth-(t+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))}"Never"!==this.floatLabelType&&N.Input.calculateWidth(e,this.overAllWrapper,this.getModuleName())}},t.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else(0,v.isNullOrUndefined)(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},t.prototype.setPlaceholderSize=function(e){(0,v.isNullOrUndefined)(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":(0,v.addClass)([this.searchWrapper],ot):(0,v.isNullOrUndefined)(this.value)||(this.searchWrapper.removeAttribute("style"),(0,v.removeClass)([this.searchWrapper],ot))},t.prototype.refreshInputHight=function(){(0,v.isNullOrUndefined)(this.searchWrapper)||(this.value&&this.value.length||!(0,v.isNullOrUndefined)(this.text)&&""!==this.text?this.searchWrapper.classList.add(Ye):this.searchWrapper.classList.remove(Ye))},t.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},t.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var n={e,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,t),isInteracted:!!e,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}this.selectedValueInfo=this.viewPortInfo},t.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},t.prototype.updateAriaActiveDescendant=function(){(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])||(0,v.attributes)(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},t.prototype.pageUpSelection=function(e,t){var i=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)"),s=e>=0?i[e+1]:i[0];if(this.fields.disabled&&s&&!this.enableVirtualization){for(;s&&(s.classList.contains("e-disabled")||s.classList.contains(_e)||s.classList.contains(".e-reorder-hide")||s.classList.contains("e-list-group-item"));)s=s.previousElementSibling;if(!s)return}this.enableVirtualization&&t&&(s=this.liCollections.length>=e&&e>=0?this.liCollections[e]:this.liCollections[this.skeletonCount]),!(0,v.isNullOrUndefined)(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.enableVirtualization?((0,v.isNullOrUndefined)(s)||s.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=s):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode))},t.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)"),l=e<=s.length?s[e-1]:s[s.length-1];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(_e)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.nextElementSibling;if(!l)return}this.enableVirtualization&&this.skeletonCount>0&&(l=e<i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&t&&(l=e<=i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.isKeyBoardAction=!0,this.addListFocus(l),this.previousFocusItem=l,this.scrollBottom(l,this.getIndexByValue(l.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},t.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+A.li).length>0?this.ulElement.querySelectorAll("."+A.li+":not(."+_e+")"):[]},t.prototype.focusInHandler=function(e){var t=this;if(this.enabled){if(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode&&(this.viewWrapper.style.display="none")),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove(Ye),this.checkPlaceholderSize(),this.focused){var i={isInteracted:!!e,event:e};this.trigger("focus",i),this.focused=!1}return this.overAllWrapper.classList.contains(ze)||this.overAllWrapper.classList.add(ze),We(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout((function(){t.calculateWidth()}),150),!0}return!1},t.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add(Xe)},t.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove(Xe)},t.prototype.expandTextbox=function(){var e=5;if(this.placeholder){var t=this.placeholder.charCodeAt(0),i=44032<=t&&t<=55215?1.5:19968<=t&&t<=40959?2:1;e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length*i}this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},t.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},t.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},t.prototype.checkTextLength=function(){return this.targetElement().length<1},t.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(e),e.preventDefault())}},t.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+A.focus);if(!(0,v.isNullOrUndefined)(e))if(this.inputElement.setAttribute("aria-activedescendant",e.id),this.allowFiltering){var t=this.popupWrapper.querySelector("."+rt);t&&t.setAttribute("aria-activedescendant",e.id)}else"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",e.id)},t.prototype.homeNavigation=function(e,t){if(this.removeFocus(),this.enableVirtualization)if(e)this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query));else if(this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&this.value.length>0&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)){this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex();var i=(new g.Query).clone();this.value&&this.value.length>0&&(i=(i=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,i)}this.UpdateSkeleton();var s=this.ulElement.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)");if(s.length>0){var l=s[e?0:s.length-1];this.enableVirtualization&&e&&(l=s[this.skeletonCount]),this.removeFocus(),l.classList.add(A.focus),this.enableVirtualization&&e?this.scrollTop(l,void 0,this.keyboardEvent.keyCode):t||this.scrollBottom(l,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant()}},t.prototype.updateSelectionList=function(){if(!(0,v.isNullOrUndefined)(this.value)&&this.value.length)for(var e=0;e<this.value.length;e++){var t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[e]):this.value[e],i=this.getElementByValue(t);i&&!i.classList.contains(A.selected)&&i.classList.add("e-active")}},t.prototype.handleVirtualKeyboardActions=function(e,t){var i,s=this.list.querySelector("."+A.focus);switch(this.isKeyBoardAction=!0,e.keyCode){case 40:this.arrowDown(e,!0);break;case 38:this.arrowUp(e,!0);break;case 33:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===e.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},t.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault(),this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124)))if(e.altKey)this.popupKeyActions(e);else{if(this.isPopupOpen()){var t=this.list.querySelector("."+A.focus),i=void 0;switch(e.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(e);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(e);break;case 27:return e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return e.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(e),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(e),void(this.isKeyBoardAction=!1);case 9:e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),this.inputElement.focus(),this.overAllWrapper.classList.add(ze)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&(this.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(e)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&this.setResize(),this.isKeyBoardAction=!1}},t.prototype.arrowDown=function(e,t){e.preventDefault(),this.moveByList(1,t),this.keyAction=!0,(document.activeElement.classList.contains(rt)||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&v.EventHandler.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},t.prototype.arrowUp=function(e,t){e.preventDefault(),this.keyAction=!0;var i=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+A.li+",li."+A.group+":not(."+_e+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+A.focus);this.focusFirstListItem=!(0,v.isNullOrUndefined)(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),Array.prototype.slice.call(i).indexOf(s)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,t),this.updateAriaAttribute()},t.prototype.spaceKeySelection=function(e){if("CheckBox"===this.mode){var t=this.list.querySelector("li."+A.focus),i=document.getElementsByClassName("e-selectall-parent")[0];if((!(0,v.isNullOrUndefined)(t)||i&&i.classList.contains("e-item-focus"))&&(e.preventDefault(),this.keyAction=!0),this.selectByKey(e),this.keyAction){var s=this.list.querySelector("li."+A.focus);!(0,v.isNullOrUndefined)(s)&&i&&i.classList.contains("e-item-focus")&&s.classList.remove("e-item-focus")}}this.checkPlaceholderSize()},t.prototype.checkBackCommand=function(e){(8===e.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},t.prototype.keyNavigation=function(e){if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else if(8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length){e.preventDefault();var t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1];this.removeValue(this.value[this.value.length-1],e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t)}},t.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},t.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(e=this.tempValues?this.tempValues.slice():[]),this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},t.prototype.scrollBottom=function(e,t,i,s,l){void 0===i&&(i=!1),void 0===s&&(s=null),void 0===l&&(l=!1),(!(0,v.isNullOrUndefined)(e)&&e.classList.contains("e-virtual-list")||this.enableVirtualization&&(0,v.isNullOrUndefined)(e))&&(e=this.liCollections[this.skeletonCount]);var n=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0;this.isUpwardScrolling=!1;var a=this.list.querySelectorAll(".e-virtual-list").length,o=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,r=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+n):e.offsetTop,h=this.list.offsetHeight,u=r-a*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop,p=this.list.scrollTop+u-h,d=!1,c=r-a*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop;if(c=this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?c-this.fixedHeaderElement.offsetHeight:c,0!==t||this.enableVirtualization){if(u>h||!(c>0&&this.list.offsetHeight>c)){var m=e?e.getAttribute("data-value"):null,f=34===s?this.getPageCount()-1:1;!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&o&&m===o&&35!==s&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(e.offsetHeight+n)*f,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===s?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?l&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,d=this.isKeyBoardAction}}else this.list.scrollTop=0;this.isKeyBoardAction=d},t.prototype.scrollTop=function(e,t,i){void 0===i&&(i=null);var s=this.list.querySelectorAll(".e-virtual-list").length,l=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,n=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+l):e.offsetTop,a=n-s*(e.offsetHeight+l)-this.list.scrollTop,o=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;a=this.fields.groupBy&&!(0,v.isUndefined)(this.fixedHeaderElement)?a-this.fixedHeaderElement.offsetHeight:a;var r=n-s*(e.offsetHeight+l)+(e.offsetHeight+l)-this.list.scrollTop,h=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&a<=0;if(0!==t||this.enableVirtualization)if(a<0||h){var u=e?e.getAttribute("data-value"):null,p=33===i?this.getPageCount()-2:1;this.enableVirtualization&&this.isKeyBoardAction&&o&&u===o&&36!==i&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(e.offsetHeight+l)*p,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===i?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+a)}else r>0&&this.list.offsetHeight>r||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0},t.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},t.prototype.selectListByKey=function(e){var t,i=this.list.querySelector("li."+A.focus),s=this.value&&this.value.length?this.value.length:0;if(null!==i){if(e.preventDefault(),i.classList.contains("e-active")&&(s-=1),this.isValidLI(i)&&s<this.maximumSelectionLength){this.updateListSelection(i,e),this.addListFocus(i),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(t=i.firstElementChild.lastElementChild,this.findGroupStart(t),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e);var l=""!==this.targetElement().trim();this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(i.textContent,l),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()}else!this.isValidLI(i)&&s<this.maximumSelectionLength&&((t=i.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,i):this.selectAllItem(!0,e,i));this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup(e)}var n=document.getElementsByClassName("e-selectall-parent")[0];if(n&&n.classList.contains("e-item-focus")){var a=n.childNodes[0];if(a.classList.contains("e-check")){a.classList.remove("e-check");o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!1,e,i)}else{a.classList.add("e-check");var o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!0,e,i)}}this.refreshPlaceHolder()},t.prototype.refreshListItems=function(e,t){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.enableVirtualization)if(this.allowCustomValue&&this.virtualCustomData&&null==e&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount)this.virtualCustomData=null,this.renderItems(this.mainData,this.fields);else if(this.allowFiltering&&t){if(this.updateInitialData(),this.onActionComplete(i,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(s)}}else this.onActionComplete(this.list,this.listData);else this.onActionComplete(i,this.mainData);this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}else!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},t.prototype.removeSelectedChip=function(e){var t,i=this.chipCollectionWrapper.querySelector("span."+Je);if(null!==i){(0,v.isNullOrUndefined)(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(t=i.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(t,e));var s=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i.getAttribute("data-value"))):i.getAttribute("data-value");this.removeValue(s,e),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty()}this.closePopupOnSelect&&this.hidePopup(e),this.checkPlaceholderSize()},t.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+A.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},t.prototype.clickHandler=function(e){var t=e.target.className,i=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==t&&"e-input-group e-control-wrapper e-input-focus"!==t||!i.classList.contains("e-item-focus")||i.classList.remove("e-item-focus")},t.prototype.moveByList=function(e,t){if(this.list){var i=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+A.li+",li."+A.group+":not(."+_e+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+A.focus);this.enableVirtualization&&t&&!(0,v.isNullOrUndefined)(this.currentFocuedListElement)&&(s=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value"))));var l=-1,n=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===e&&!(0,v.isNullOrUndefined)(n)&&!n.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&this.liCollections.length>1)!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):n.classList.contains("e-item-focus")||n.classList.add("e-item-focus");else if(i.length){"CheckBox"===this.mode&&this.showSelectAll&&!(0,v.isNullOrUndefined)(n&&-1===e)&&(!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):this.focusFirstListItem&&!n.classList.contains("e-item-focus")&&n.classList.add("e-item-focus"));for(var a=0;a<i.length;a++)if(i[a]===s){l=a;break}if(e>0)l<i.length-1&&(this.removeFocus(),this.enableVirtualization&&t?this.addListFocus(i[l]):this.enableVirtualization&&i[l+1].classList.contains("e-virtual-list")?this.addListFocus(i[this.skeletonCount]):this.addListFocus(i[++l]),l>-1&&(this.updateCheck(i[l]),this.scrollBottom(i[l],l),this.currentFocuedListElement=i[l]));else if(l>0)if(this.enableVirtualization){var o=i[l-1].classList.contains("e-virtual-list"),r=t?l:l-1;!t&&o||this.removeFocus(),!t&&o||(this.addListFocus(i[r]),this.updateCheck(i[r]),this.scrollTop(i[r],l),this.currentFocuedListElement=i[r])}else this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l)}}var h=this.list?this.list.querySelector(".e-item-focus"):null;if(this.isDisabledElement(h)){if(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&h===this.list.querySelector("li.e-list-group-item"))return void this.removeFocus();0===(a=this.getIndexByValue(h.getAttribute("data-value")))&&(e=1),a===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(e=-1),this.moveByList(e)}},t.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},t.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},t.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span."+Ge),l=this.chipCollectionWrapper.querySelector("span."+Je);null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},t.prototype.chipClick=function(e){if(this.enabled){var t=(0,v.closest)(e.target,"."+Ge);this.removeChipSelection(),this.addChipSelection(t,e)}},t.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},t.prototype.addChipSelection=function(e,t){(0,v.addClass)([e],Je),this.trigger("chipSelection",t)},t.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var t=e.target.parentElement.getAttribute("data-value"),i=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(t)):this.getFormattedValue(t);if(this.allowCustomValue&&("false"!==t&&!1===i||!(0,v.isNullOrUndefined)(i)&&"NaN"===i.toString())&&(i=t),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(e),this.inputFocus||this.inputElement.focus(),this.removeValue(i,e),i=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",i):i,(0,v.isNullOrUndefined)(this.findListElement(this.list,"li","data-value",i))&&this.mainList&&this.listData){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(s,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},t.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},t.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!(0,v.isNullOrUndefined)(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=Me(this.placeholder):this.setFloatLabelType(),this.expandTextbox()},t.prototype.removeAllItems=function(e,t,i,s,l){var n=this.allowObjectBinding?this.indexOfObjectInArray(e,this.value):this.value.indexOf(e),a=this.value.slice(0);a.splice(n,1),this.setProperties({value:[].concat([],a)},!0),s.setAttribute("aria-selected","false");var o=this.hideSelectedItem?_e:A.selected;(0,v.removeClass)([s],o),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:s,e:this,index:n}),this.invokeCheckboxSelection(s,t,i);var r=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e):e;this.updateMainList(!0,r,l),this.updateChipStatus()},t.prototype.invokeCheckboxSelection=function(e,t,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:t}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},t.prototype.removeValue=function(t,i,s,l){var n=this,a=this.allowObjectBinding?this.indexOfObjectInArray(t,this.value):this.value.indexOf(this.getFormattedValue(t));-1===a&&this.allowCustomValue&&!(0,v.isNullOrUndefined)(t)&&(a=this.allowObjectBinding?this.indexOfObjectInArray(t,this.value):this.value.indexOf(t.toString()));var o=i&&i.target;l=!!(l||o&&o.classList.contains("e-close-hooker"))||null;var r=this.hideSelectedItem?_e:A.selected;if(-1!==a){var h=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",t):t,u=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",h),p=this.allowObjectBinding?t:this.getDataByValue(t),d={e:i,item:u,itemData:p,isInteracted:!!i,cancel:!1};this.trigger("removing",d,(function(o){if(o.cancel)n.removeIndex++;else{n.isRemoveSelection=!!n.enableVirtualization||n.isRemoveSelection,n.currentRemoveValue=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",t):t,n.virtualSelectAll=!1;var h=n.value.slice(0);if(h.splice(a,1),n.enableVirtualization&&"CheckBox"===n.mode&&n.selectedListData.splice(a,1),n.setProperties({value:[].concat([],h)},!0),n.enableVirtualization){var d=0===a&&n.text.split(n.delimiterChar)&&1===n.text.split(n.delimiterChar).length?n.text.replace(n.text.split(n.delimiterChar)[a],""):0===a?n.text.replace(n.text.split(n.delimiterChar)[a]+n.delimiterChar,""):n.text.replace(n.delimiterChar+n.text.split(n.delimiterChar)[a],"");n.setProperties({text:d.toString()},!0)}if(null!==u){var c=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",t):t,m=n.findListElement(n.mainList,"li","data-value",c);u.setAttribute("aria-selected","false"),(0,v.removeClass)([u],r),m&&(m.setAttribute("aria-selected","false"),(0,v.removeClass)([u,m],r)),n.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===n.mode,li:u,e:n,index:a}),n.invokeCheckboxSelection(u,i,l)}var f=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",t):t;if(n.hideSelectedItem&&n.fields.groupBy&&u&&n.hideGroupItem(f),n.hideSelectedItem&&n.fixedHeaderElement&&n.fields.groupBy&&"CheckBox"!==n.mode&&n.isPopupOpen()&&e.prototype.scrollStop.call(n),n.updateMainList(!0,f),n.removeChip(f,l),n.updateChipStatus(),(n.value&&n.value.length?n.value.length:0)<n.maximumSelectionLength){var g=n.list.querySelectorAll("li."+A.li+":not(.e-active)");(0,v.removeClass)(g,"e-disable")}n.trigger("removed",o);var y=i&&i.currentTarget,C=!(!y||!y.classList.contains("e-selectall-parent"))||null;if(!n.changeOnBlur&&!l&&i&&s&&!C&&n.isSelectAllTarget&&n.updateValueState(i,n.value,n.tempValues),s&&(n.selectAllEventData.push(p),n.selectAllEventEle.push(u)),1===s){n.changeOnBlur||n.updateValueState(i,n.value,n.tempValues);var b={event:i,items:n.selectAllEventEle,itemData:n.selectAllEventData,isInteracted:!!i,isChecked:!1};n.trigger("selectedAll",b),n.selectAllEventData=[],n.selectAllEventEle=[]}!l||1!==s&&null!==s||n.clearAllCallback(i,l),n.isPopupOpen()&&u&&u.parentElement.classList.contains("e-reorder")&&(n.hideSelectedItem&&n.value&&Array.isArray(n.value)&&n.value.length>0&&n.totalItemsCount(),n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}))}}))}},t.prototype.updateMainList=function(e,t,i){if(this.allowFiltering||"CheckBox"===this.mode){var s=i||this.findListElement(this.mainList,"li","data-value",t);s&&(e?(s.setAttribute("aria-selected","false"),(0,v.removeClass)([s],this.hideSelectedItem?_e:A.selected),"CheckBox"===this.mode&&(0,v.removeClass)([s.firstElementChild.lastElementChild],"e-check")):(s.setAttribute("aria-selected","true"),(0,v.addClass)([s],this.hideSelectedItem?_e:A.selected),"CheckBox"===this.mode&&(0,v.addClass)([s.firstElementChild.lastElementChild],"e-check")))}},t.prototype.removeChip=function(e,t){if(this.chipCollectionWrapper&&(!this.enableVirtualization||!t)){var i=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);i&&(0,v.remove)(i)}},t.prototype.setWidth=function(e){(0,v.isNullOrUndefined)(e)||("number"==typeof e?this.overAllWrapper.style.width=(0,v.formatUnit)(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:(0,v.formatUnit)(e)))},t.prototype.updateChipStatus=function(){this.value&&this.value.length?((0,v.isNullOrUndefined)(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):((0,v.isNullOrUndefined)(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),(0,v.isNullOrUndefined)(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},t.prototype.indexOfObjectInArray=function(e,t){for(var i=function(i){var s=t[i];if(Object.keys(e).every((function(t){return s.hasOwnProperty(t)&&s[t]===e[t]})))return{value:i}},s=0;s<t.length;s++){var l=i(s);if("object"==typeof l)return l.value}return-1},t.prototype.addValue=function(e,t,i){this.value||(this.value=[]);var s=this.allowObjectBinding?this.getDataByValue(e):e;if(this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(e),this.value)||!this.allowObjectBinding&&this.value.indexOf(s)<0){if(this.setProperties({value:[].concat([],this.value,[s])},!0),this.enableVirtualization&&!this.isSelectAllLoop){var l=this.viewWrapper.innerHTML,n=void 0;l+=1===this.value.length?"":this.delimiterChar+" ",l+=n=this.getOverflowVal(this.value.length-1),n=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,l)}if(this.enableVirtualization&&"CheckBox"===this.mode){var a=[],o=(this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],n=t,null!=this.text&&""!==this.text?this.text+this.delimiterChar+n:n);a.push(o),this.setProperties({text:a.toString()},!0)}}var r=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),r&&(this.addListFocus(r),this.addListSelection(r)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},t.prototype.checkMaxSelection=function(){var e=this.value&&this.value.length?this.value.length:0;if(e===this.maximumSelectionLength){var t=this.list.querySelectorAll("li."+A.li+".e-active");(0,v.removeClass)(t,"e-disable");var i=this.list.querySelectorAll("li."+A.li+":not(.e-active)");(0,v.addClass)(i,"e-disable")}if(e<this.maximumSelectionLength){var s=this.list.querySelectorAll("li."+A.li);(0,v.removeClass)(s,"e-disable")}},t.prototype.dispatchSelect=function(t,i,s,l,n,a,o){var r=this,h=this.listData;if(this.initStatus&&!l){t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",t):t;var u=a||this.getDataByValue(t),p={e:i,item:s,itemData:u,isInteracted:!!i,cancel:!1};this.trigger("select",p,(function(l){if(!l.cancel){if(n&&(r.selectAllEventData.push(u),r.selectAllEventEle.push(s)),1===n){var p={event:i,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!i,isChecked:!0};r.trigger("selectedAll",p),r.selectAllEventData=[]}r.allowCustomValue&&r.isServerRendered&&r.listData!==h&&(r.listData=h),t=r.allowObjectBinding?r.getDataByValue(t):t,r.enableVirtualization&&((0,v.isNullOrUndefined)(r.selectedListData)?r.selectedListData=[r.getDataByValue(t)]:a?Array.isArray(r.selectedListData)?r.selectedListData.push(a):r.selectedListData=[r.selectedListData,a]:Array.isArray(r.selectedListData)?r.selectedListData.push(r.getDataByValue(t)):r.selectedListData=[r.selectedListData,r.getDataByValue(t)]),(r.enableVirtualization&&t||!r.enableVirtualization)&&r.updateListSelectEventCallback(t,s,i,o),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&e.prototype.scrollStop.call(r)}}))}},t.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},t.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span."+Ge+"."+Je);if((0,v.removeClass)(e,Je),v.Browser.isDevice)for(var t=this.chipCollectionWrapper.querySelectorAll("span."+Qe.split(" ")[0]),i=0;i<t.length;i++)t[i].style.display="none"},t.prototype.onMobileChipInteraction=function(e){var t=(0,v.closest)(e.target,"."+Ge),i=t.querySelector("span."+Qe.split(" ")[0]);this.enabled&&!this.readonly&&(t.classList.contains(Je)||(this.removeChipFocus(),i.style.display="",t.classList.add(Je)),this.refreshPopup(),e.preventDefault())},t.prototype.multiCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!(0,v.selectAll)(e,document).length}catch(e){t=!1}return t},t.prototype.encodeHtmlEntities=function(e){return e.replace(/[\u00A0-\u9999<>&]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))},t.prototype.getChip=function(e,t,i){var s=this,l={text:t,value:t},n=this.createElement("span",{className:Ge,attrs:{"data-value":t,title:e}}),a=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:Qe});if(this.mainData&&(l=this.getDataByValue(t)),this.valueTemplate&&!(0,v.isNullOrUndefined)(l)){var r=this.multiCompiler(this.valueTemplate),h=("function"!=typeof this.valueTemplate&&r?(0,v.compile)((0,v.select)(this.valueTemplate,document).innerHTML.trim()):(0,v.compile)(this.valueTemplate))(l,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a);h&&h.length>0&&(0,v.append)(h,a),this.renderReactTemplates()}else this.enableHtmlSanitizer?a.innerText=e:a.innerHTML=this.encodeHtmlEntities(e.toString());n.appendChild(a);var u={isInteracted:!!i,itemData:l,e:i,setClass:function(e){(0,v.addClass)([n],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",u,(function(e){e.cancel||(v.Browser.isDevice?(n.classList.add("e-mob-chip"),(0,v.append)([o],n),o.style.display="none",v.EventHandler.add(n,"click",s.onMobileChipInteraction,s)):(v.EventHandler.add(n,"mousedown",s.chipClick,s),s.showClearButton&&n.appendChild(o)),v.EventHandler.add(o,"mousedown",s.onChipRemove,s),s.chipCollectionWrapper.appendChild(n),!s.changeOnBlur&&i&&s.updateValueState(i,s.value,s.tempValues))}))},t.prototype.calcPopupWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px");return e},t.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},t.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},t.prototype.listOption=function(e,t){var i=!(0,v.isNullOrUndefined)(t.iconCss),s=(0,v.isNullOrUndefined)(t.properties)?t:t.properties;return this.listCurrentOptions=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},(0,v.extend)(this.listCurrentOptions,this.listCurrentOptions,t,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:s}),this.listCurrentOptions},t.prototype.renderPopup=function(){var t=this;if(this.list||e.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering)this.refreshPopup();else if(!this.popupObj&&!(0,v.isNullOrUndefined)(this.popupWrapper)){document.body.appendChild(this.popupWrapper);var i=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&i&&this.filterParent&&(i.remove(),this.filterParent=null);var s=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),s-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),(0,v.append)([this.list],this.popupWrapper),!this.list.classList.contains(A.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(A.noData))if(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")?this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")):this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(l)}if(this.footerTemplate&&(this.setFooterTemplate(),s-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),s-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),s=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(s-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(s-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),s=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",n),s-=this.searchBoxHeight),(0,v.addClass)([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=(0,v.formatUnit)(s),this.popupWrapper.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):this.list.style.maxHeight=(0,v.formatUnit)(this.popupHeight),this.popupObj=new k.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){if(t.popupObj.element.parentElement){t.popupObj.unwireScrollEvents();var e=t.popupWrapper.querySelector("."+rt);"CheckBox"===t.mode&&e&&document.activeElement===e&&e.blur(),(0,v.detach)(t.popupObj.element)}},open:function(){if(t.popupObj.resolveCollision(),!t.isFirstClick){var e=t.list.querySelector("ul");e&&("CheckBox"!==t.mode&&(t.allowFiltering||t.allowCustomValue)&&""!==t.targetElement().trim()||(t.mainList=e.cloneNode?e.cloneNode(!0):e)),t.isFirstClick=!0}t.popupObj.wireScrollEvents(),"CheckBox"!==t.mode&&(t.allowFiltering||t.allowCustomValue)&&""!==t.targetElement().trim()||t.enableVirtualization||(t.loadTemplate(),t.enableVirtualization&&"CheckBox"===t.mode&&t.UpdateSkeleton()),t.isPreventScrollAction=!0,t.setScrollPosition(),!t.list.classList.contains(A.noData)&&t.getItems()[1]&&0!==t.getItems()[1].offsetHeight&&(t.listItemHeight=t.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(t.getItems()[1]).marginBottom,10),t.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(t.list.getElementsByClassName("e-virtual-ddl-content")[0].style=t.getTransformValues())),t.allowFiltering&&t.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===t.mode,value:"focus"}),t.enableVirtualization&&(t.notify("bindScrollEvent",{module:"VirtualScroll",component:t.getModuleName(),enable:t.enableVirtualization}),setTimeout((function(){t.value?t.updateSelectionList():t.viewPortInfo&&t.viewPortInfo.offsets.top&&(t.list.scrollTop=t.viewPortInfo.offsets.top)}),5))},targetExitViewport:function(){v.Browser.isDevice||t.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&v.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility=""}},t.prototype.checkCollision=function(e){"CheckBox"===this.mode&&v.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||((0,k.isCollide)(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},t.prototype.setHeaderTemplate=function(){this.header&&this.header.remove(),this.header=this.createElement("div"),(0,v.addClass)([this.header],"e-ddl-header");var e=this.multiCompiler(this.headerTemplate),t=("function"!=typeof this.headerTemplate&&e?(0,v.compile)((0,v.select)(this.headerTemplate,document).innerHTML.trim()):(0,v.compile)(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);t&&t.length>0&&(0,v.append)(t,this.header),"CheckBox"===this.mode&&this.showSelectAll?(0,v.prepend)([this.header],this.popupWrapper):(0,v.append)([this.header],this.popupWrapper),v.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},t.prototype.setFooterTemplate=function(){this.footer&&this.footer.remove(),this.footer=this.createElement("div"),(0,v.addClass)([this.footer],"e-ddl-footer");var e=this.multiCompiler(this.footerTemplate),t=("function"!=typeof this.footerTemplate&&e?(0,v.compile)((0,v.select)(this.footerTemplate,document).innerHTML.trim()):(0,v.compile)(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);t&&t.length>0&&(0,v.append)(t,this.footer),(0,v.append)([this.footer],this.popupWrapper),v.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},t.prototype.updateInitialData=function(){var e=this.selectData;this.renderItems(e,this.fields);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof g.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)}this.listData=e,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},t.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var t=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&this.value.length>0){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode&&this.targetInputElement&&(this.targetInputElement.value=""));var i=this.list&&this.list.querySelectorAll("li.e-list-item");if(i&&i.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,t=this.value[this.removeIndex];this.removeIndex<this.value.length;t=this.value[this.removeIndex])this.removeValue(t,e,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(e);this.checkAndResetCache(),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,v.EventHandler.add(document,"mouseup",this.preventSelection,this)},t.prototype.preventSelection=function(e){this.isClearAllItem&&e.stopPropagation(),this.isClearAllItem=!1,v.EventHandler.remove(document,"mouseup",this.preventSelection)},t.prototype.clearAllCallback=function(e,t){var i=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(s,this.mainData)}this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,i),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&t&&((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!t||!(0,v.isNullOrUndefined)(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},t.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},t.prototype.resetValueHandler=function(e){if(!(0,v.isNullOrUndefined)(this.inputElement)){var t=(0,v.closest)(this.inputElement,"form");if(t&&e.target===t){var i=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=i}}},t.prototype.wireEvent=function(){v.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),v.EventHandler.add(window,"resize",this.windowResize,this),v.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),v.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),v.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&v.EventHandler.add(this.inputElement,"input",this.onInput,this),v.EventHandler.add(this.inputElement,"blur",this.onBlurHandler,this),v.EventHandler.add(this.componentWrapper,"mouseover",this.mouseIn,this);var e=(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.add(e,"reset",this.resetValueHandler,this),v.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),v.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),v.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},t.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,v.Browser.isDevice&&"mozilla"===v.Browser.info.name&&this.search(e)},t.prototype.pasteHandler=function(e){var t=this;setTimeout((function(){t.expandTextbox(),t.search(e)}))},t.prototype.search=function(e){var t=this;if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,(0,v.isNullOrUndefined)(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(e),this.openClick(e),!this.checkTextLength()||this.allowFiltering||(0,v.isNullOrUndefined)(e)||8===e.keyCode){var i=this.targetElement();if(this.allowFiltering){this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache(),this.isRequesting=!1;var s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,i,l){s.cancel||(t.isFiltered=!0,t.customFilterQuery=i,t.remoteFilterAction=!0,t.dataUpdater(e,i,l))},event:e,cancel:!1};this.trigger("filtering",s,(function(e){t.isFilterPrevented=e.cancel,e.cancel||t.isFiltered||e.preventDefaultAction||(t.filterAction=!0,t.isFilteringAction=!0,t.dataSource instanceof g.DataManager&&t.allowCustomValue&&(t.isCustomRendered=!1),t.dataUpdater(t.dataSource,null,t.fields),t.isFilteringAction=!1)}))}else if(this.allowCustomValue){var l=new g.Query;l=this.allowFiltering&&""!==i?l.where(this.fields.text,"startswith",i,this.ignoreCase,this.ignoreAccent):l,this.enableVirtualization?this.dataUpdater(this.dataSource,l,this.fields):this.dataUpdater(this.mainData,l,this.fields),this.UpdateSkeleton()}else{var n=this.list.querySelectorAll("li."+A.li+":not(.e-hide-listitem)"),a=this.typeOfData(this.listData).typeof,r=o(this.targetElement(),n,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var h=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(h=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),h=!1),(0!==this.viewPortInfo.startIndex||h)&&this.updateIncrementalView(0,this.itemCount),r=o(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a);(0,v.isNullOrUndefined)(r)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),h=!0,(0!==this.viewPortInfo.startIndex||h)&&this.updateIncrementalView(0,this.itemCount),r=o(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a),(0,v.isNullOrUndefined)(r));)if((0,v.isNullOrUndefined)(r)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}if(r.index&&!(this.viewPortInfo.startIndex>=r.index&&r.index>=this.viewPortInfo.endIndex)){var u=(p=r.index-(this.itemCount/2-2)>0?r.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:p+this.itemCount;p!==this.viewPortInfo.startIndex&&this.updateIncrementalView(p,u)}if((0,v.isNullOrUndefined)(r.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(r.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){var p=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount;u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(p,u)}r.item=this.getElementByValue(r.item.getAttribute("data-value"))}r&&r.item&&(r.item=this.getElementByValue(r.item.getAttribute("data-value")))}r&&r.item?(this.addListFocus(r.item),this.list.scrollTop=r.item.offsetHeight*r.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},t.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},t.prototype.getLocaleName=function(){return"multi-select"},t.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.filterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},t.prototype.updateData=function(e,t,i){var s,l="",n="Delimiter"===this.mode||"CheckBox"===this.mode,a=[],o=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),(0,v.isNullOrUndefined)(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!(0,v.isNullOrUndefined)(this.value)){for(var r,h=this.value.length,u="",p=function(o){var p=d.allowObjectBinding?(0,v.getValue)(d.fields.value?d.fields.value:"",d.value[o]):d.value[o],c=d.findListElement((0,v.isNullOrUndefined)(d.mainList)?d.ulElement:d.mainList,"li","data-value",p);if(d.enableVirtualization&&(c=d.findListElement((0,v.isNullOrUndefined)(d.list)?d.ulElement:d.list,"li","data-value",p)),(0,v.isNullOrUndefined)(c)&&!d.allowCustomValue&&!d.enableVirtualization&&d.listData&&d.listData.length>0)d.value.splice(o,1),o-=1,h-=1;else{if(d.listData){if(d.enableVirtualization){n&&!d.isDynamicRemoteVirtualData&&(l=d.delimiterWrapper&&""===d.delimiterWrapper.innerHTML?l:d.delimiterWrapper.innerHTML);var m=d.allowObjectBinding?(0,v.getValue)(d.fields.value?d.fields.value:"",d.value[d.value.length-1]):d.value[d.value.length-1];if(d.isRemoveSelection)l=d.text.replace(/,/g,e+" ")+e+" ",a=d.text.split(e);else{s=i&&n?d.text:d.getTextByValue(m);var f=d.isDynamicRemoteVirtualData&&null!=m&&""!==m?d.getTextByValue(m):i?d.text:d.text&&""!==d.text?d.text+d.delimiterChar+s:s;l+=s+e+" ",a.push(f),u=d.hiddenElement.innerHTML}if(t&&t.currentTarget&&t.currentTarget.classList.contains("e-chips-close")||t&&"Backspace"===t.key){var g=t.target.parentElement.getAttribute("data-value");if("Backspace"===t.key){var y=d.hiddenElement.lastChild;y&&d.hiddenElement.removeChild(y)}else d.hiddenElement.childNodes.forEach((function(e){e.value===g&&e.parentNode.removeChild(e)}));u=d.hiddenElement.innerHTML}else u+="<option selected value='"+m+"'>"+o+"</option>";return r=o,"break"}s=d.getTextByValue(p)}else s=p;l+=s+e+" ",a.push(s)}u+='<option selected value="'+p+'">'+o+"</option>",r=o},d=this,c=0;c<h;c++){var m=p(c);if(c=r,"break"===m)break}(0,v.isNullOrUndefined)(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=u)}var f=t&&t.target&&t.target.classList.contains("e-chips-close");(!this.enableVirtualization||this.enableVirtualization&&"CheckBox"!==this.mode&&!f)&&this.setProperties({text:a.toString()},!0),n&&(this.updateWrapperText(this.delimiterWrapper,l),this.delimiterWrapper.setAttribute("id",(0,v.getUniqueID)("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id));var g=t&&t.target,y=!(!g||!g.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&t&&!y||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(t,this.value,this.tempValues)),this.listData=o,this.addValidInputClass()},t.prototype.initialTextUpdate=function(){if((0,v.isNullOrUndefined)(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),t=[],i=0;e.length>i;i++){var s=this.getValueByText(e[i]);(0,v.isNullOrUndefined)(s)?this.allowCustomValue&&t.push(e[i]):t.push(s)}if(t&&t.length){var l=this.allowObjectBinding?this.getDataByValue(t):t;this.setProperties({value:l},!0)}}},t.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),e.prototype.render.call(this,null,t),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},t.prototype.initialValueUpdate=function(e,t){if(this.list){var i=void 0,s=void 0,l=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!(0,v.isNullOrUndefined)(this.value))for(var n=0;!(0,v.isNullOrUndefined)(this.value[n]);n++){l=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[n]):this.value[n],s=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",l);var a=!1;if(this.enableVirtualization){if(i=null,null!=e&&e.length>0)for(var o=0;o<e.length;o++)if(this.isPrimitiveData&&e[o]===l||!this.isPrimitiveData&&(0,v.getValue)(this.fields.value?this.fields.value:"value",e[o])===l){i=this.isPrimitiveData?e[o]:(0,v.getValue)(this.fields.text,e[o]),this.enableVirtualization&&((0,v.isNullOrUndefined)(this.selectedListData)?this.selectedListData=[e[o]]:Array.isArray(this.selectedListData)?this.selectedListData.push(e[o]):this.selectedListData=[this.selectedListData,e[o]]);break}(0,v.isNullOrUndefined)(i)&&this.allowCustomValue&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&t)&&(i=this.getTextByValue(l),a=!0)}else i=this.getTextByValue(l);if(s&&"true"!==s.getAttribute("aria-selected")||s&&"true"===s.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=l&&null!=i&&!a){var r=[],h=this.isDynamicRemoteVirtualData&&null!=i&&""!==i?i:null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i;r.push(h),this.setProperties({text:r.toString()},!0),this.addChip(i,l),this.addListSelection(s)}else if(!this.enableVirtualization&&l&&this.allowCustomValue||this.enableVirtualization&&l&&this.allowCustomValue&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&t)){var u=this.listData.length,p={};(0,v.setValue)(this.fields.text,l,p),(0,v.setValue)(this.fields.value,l,p);var d=this.popupWrapper.querySelector("."+A.noData);this.enableVirtualization||this.addItem(p,u),this.enableVirtualization&&(this.virtualCustomSelectData&&this.virtualCustomSelectData.length>=0?this.virtualCustomSelectData.push(p):this.virtualCustomSelectData=[p]),s=s||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",l),this.popupWrapper.contains(d)&&(this.list.setAttribute("style",d.getAttribute("style")),this.popupWrapper.replaceChild(this.list,d),this.wireListEvents());r=[],h=null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i;r.push(h),this.setProperties({text:r.toString()},!0),this.addChip(i,l),this.addListSelection(s)}}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,t),"CheckBox"!==this.mode||!this.showSelectAll||!(0,v.isNullOrUndefined)(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},t.prototype.updateActionCompleteData=function(e,t){this.value&&(!this.allowObjectBinding&&this.value.indexOf(e.getAttribute("data-value"))>-1||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(e.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem&&(0,v.addClass)([e],_e))},t.prototype.updateAddItemList=function(e,t){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+A.noData)&&e?(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),(0,v.remove)(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"))},t.prototype.updateDataList=function(){if(this.mainList&&this.ulElement&&!(this.isFiltered||this.filterAction||this.targetElement().trim())){var e=this.mainList.childElementCount<this.ulElement.childElementCount,t=this.ulElement.childElementCount>0&&this.ulElement.children[0].childElementCount>0&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&this.ulElement.childElementCount>0&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(this.ulElement.children[0].childElementCount>0||this.fields.groupBy&&this.ulElement.children[1]&&this.ulElement.children[1].childElementCount>0);(e||t||i)&&(this.mainList=this.ulElement)}},t.prototype.isValidLI=function(e){return e&&!e.classList.contains(A.disabled)&&!e.classList.contains(A.group)&&e.classList.contains(A.li)},t.prototype.updateListSelection=function(e,t,i){var s=e.getAttribute("data-value"),l=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(s)):this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!(0,v.isNullOrUndefined)(l)&&"NaN"===l.toString())&&(l=s),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(l)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(l,this.value)?this.dispatchSelect(l,t,e,"true"===e.getAttribute("aria-selected"),i):this.removeValue(l,t,i)},t.prototype.updateListSelectEventCallback=function(e,t,i,s){var l=this;e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e):e;var n=s||this.getTextByValue(e);if((this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",e)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)){var a=t?t.cloneNode(!0):t,o=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof(0,v.getValue)(o,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var r=this.getDataByValue(e),h={newData:r,cancel:!1};this.trigger("customValueSelection",h,(function(t){t.cancel||(l.enableVirtualization&&l.virtualCustomData?(l.virtualCustomSelectData&&l.virtualCustomSelectData.length>=0?l.virtualCustomSelectData.push(r):l.virtualCustomSelectData=[r],l.remoteCustomValue=!1,l.addValue(e,n,i)):((0,v.append)([a],l.mainList),l.mainData.push(r),l.remoteCustomValue=!1,l.addValue(e,n,i)))}))}else this.remoteCustomValue=!1,this.addValue(e,n,i)},t.prototype.removeListSelection=function(){var e=this.hideSelectedItem?_e:A.selected,t=this.list.querySelectorAll("."+e),i=t.length;if(t&&t.length)for((0,v.removeClass)(t,e);i>0;)t[i-1].setAttribute("aria-selected","false"),i--;if(!(0,v.isNullOrUndefined)(this.mainList)){var s=this.mainList.querySelectorAll("."+e),l=s.length;if(s&&s.length)for((0,v.removeClass)(s,e);l>0;)s[l-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(t&&t.length>l-1&&(0,v.removeClass)([t[l-1].firstElementChild.lastElementChild],"e-check"),(0,v.removeClass)([s[l-1].firstElementChild.lastElementChild],"e-check")),l--}},t.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+A.hover);e&&e.length&&(0,v.removeClass)(e,A.hover)},t.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+A.focus),t=this.mainList.querySelectorAll("."+A.focus);e&&e.length&&((0,v.removeClass)(e,A.focus),(0,v.removeClass)(t,A.focus))}},t.prototype.addListHover=function(e){(this.enabled&&this.isValidLI(e)||null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy))&&(this.removeHover(),(0,v.addClass)([e],A.hover))},t.prototype.addListFocus=function(e){this.enabled&&(this.isValidLI(e)||this.fields.disabled&&this.isDisabledElement(e))?(this.removeFocus(),(0,v.addClass)([e],A.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&((0,v.addClass)([e],A.focus),this.updateAriaActiveDescendant())},t.prototype.addListSelection=function(e,t){var i=this.hideSelectedItem?_e:A.selected;if(this.isValidLI(e)&&!e.classList.contains(A.hover)){if((0,v.addClass)([e],i),this.updateMainList(!1,e.getAttribute("data-value"),t),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&e.classList.contains("e-active"))0===e.getElementsByClassName("e-check").length&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this});this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),this.selectedElementID=e.id}},t.prototype.updateDelimeter=function(e,t,i){this.updateData(e,t,i)},t.prototype.onMouseClick=function(e){var t=this;if(!this.isClearAllItem){this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null;var i=e.target,s=(0,v.closest)(i,"."+A.li);if(this.enableVirtualization&&s&&s.classList.contains("e-virtual-list"))return;if((0,v.closest)(i,"."+A.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(i=i.classList.contains("e-list-group-item")?i.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),i.classList.remove("e-check"),i.classList.remove("e-stop"),(0,v.closest)(i,".e-list-group-item").classList.remove("e-active"),i.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),i.classList.remove("e-stop"),i.classList.add("e-check"),(0,v.closest)(i,".e-list-group-item").classList.add("e-active"),i.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(s)){var l=this.value&&this.value.length?this.value.length:0;s.classList.contains("e-active")&&(l-=1),l<this.maximumSelectionLength&&(this.updateListSelection(s,e),this.checkPlaceholderSize(),this.addListFocus(s),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(s.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout((function(){t.updateDelimeter(t.delimiterChar,e)}),0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(e):e.preventDefault();var n=""!==this.targetElement().trim();this.makeTextBoxEmpty(),this.findGroupStart(i),"CheckBox"!==this.mode&&this.refreshListItems((0,v.isNullOrUndefined)(s)?null:s.textContent,n)}else e.preventDefault();if(this.enableVirtualization&&this.hideSelectedItem){var a=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide):not(.e-virtual-list)");if(a.length){var o=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(a.length<o+2){var r=this.getForQuery(this.value).clone();if(r=r.skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,r),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var h=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(h)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}}}this.refreshPlaceHolder(),this.deselectHeader()}}},t.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)){var t=void 0;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),t=this.findGroupAttrtibutes(e,0,0,0,0),t=this.findGroupAttrtibutes(e,t[0],t[1],t[2],1);!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),null!=(e=e.previousElementSibling)););this.updateCheckBox(e,t[0],t[1],t[2])}},t.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(e)||(e.classList.contains("e-list-icon")&&(e=e.parentElement),e.getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++),null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},t.prototype.updateCheckBox=function(e,t,i,s){if(null!==e&&((0,v.isNullOrUndefined)(this.fields.disabled)||0!==s)){var l=e.getElementsByClassName("e-frame")[0];s===t?(l.classList.remove("e-stop"),l.classList.add("e-check"),(0,v.closest)(l,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):s===i?(l.classList.remove("e-check"),l.classList.remove("e-stop"),(0,v.closest)(l,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===t-1?(l.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),(0,v.closest)(l,".e-list-group-item").classList.add("e-active"),l.classList.add("e-check")):(l.classList.remove("e-check"),l.classList.add("e-stop"),(0,v.closest)(l,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},t.prototype.disableGroupHeader=function(){var e=this.list.querySelectorAll("li.e-list-group-item");if(e)for(var t=0;t<e.length;t++){for(var i=!0,s=e[t].nextElementSibling;!s.classList.contains("e-list-group-item");){if(!this.isDisabledElement(s)){i=!1;break}if(null==(s=s.nextElementSibling))break}i&&this.disableListItem(e[t])}},t.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,t=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&(0,v.removeClass)(t,"e-disable"),e===this.maximumSelectionLength&&(0,v.addClass)(t,"e-disable")},t.prototype.onMouseOver=function(e){var t=(0,v.closest)(e.target,"."+A.li);null===t&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.enableGroupCheckBox&&(t=(0,v.closest)(e.target,"."+A.group)),this.addListHover(t)},t.prototype.onMouseLeave=function(){this.removeHover()},t.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},t.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var t=e.target;!(0,v.isNullOrUndefined)(this.popupObj)&&(0,v.closest)(t,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(v.Browser.isIE||"edge"===v.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},t.prototype.wireListEvents=function(){(0,v.isNullOrUndefined)(this.list)||(v.EventHandler.add(document,"mousedown",this.onDocumentClick,this),v.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),v.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),v.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),v.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},t.prototype.unwireListEvents=function(){v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(v.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),v.EventHandler.remove(this.list,"mouseup",this.onMouseClick),v.EventHandler.remove(this.list,"mouseover",this.onMouseOver),v.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},t.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},t.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},t.prototype.showSpinner=function(){if((0,v.isNullOrUndefined)(this.spinnerElement)){var e=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons");"none"!==this.overAllClear.style.display||e?this.spinnerElement=e||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:$e+" "+st}),this.componentWrapper.appendChild(this.spinnerElement)),(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,v.addClass)([this.spinnerElement],it),(0,k.showSpinner)(this.spinnerElement)}},t.prototype.hideSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||((0,k.hideSpinner)(this.spinnerElement),(0,v.removeClass)([this.spinnerElement],it),this.spinnerElement.classList.contains(st)?(0,v.detach)(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},t.prototype.updateWrapperText=function(e,t){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=this.encodeHtmlEntities(t):e.innerText=t},t.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),(0,v.isNullOrUndefined)(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove(at)),this.value&&this.value.length){var e="",t=void 0,i=void 0,s=1,l=void 0,n=void 0,a=0,o=void 0;this.enableVirtualization||this.updateWrapperText(this.viewWrapper,e);var r={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},h=new v.L10n(this.getLocaleName(),r,this.locale);""===h.getConstant("actionFailureTemplate")&&(h=new v.L10n("dropdowns",r,this.locale)),""===h.getConstant("noRecordsTemplate")&&(h=new v.L10n("dropdowns",r,this.locale));var u=h.getConstant("overflowCountTemplate"),p=h.getConstant("totalCountTemplate"),d=this.createElement("span",{className:"e-remain"}),c=u.replace("${count}",this.value.length.toString());d.innerText=c,this.viewWrapper.appendChild(d),this.renderReactTemplates();var m=d.offsetWidth;if((0,v.remove)(d),this.showDropDownIcon&&(a=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!(0,v.isNullOrUndefined)(this.value)&&(this.allowCustomValue||this.listData&&this.listData.length>0))for(var f=0;!(0,v.isNullOrUndefined)(this.value[f]);f++){var g=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?g&&(e+=0===f?"":this.delimiterChar+" ",e+=t=g[f],t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)):(e+=0===f?"":this.delimiterChar+" ",e+=t=this.getOverflowVal(f),t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)),l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),l+a+this.clearIconWidth>o){for(void 0!==i&&""!==i&&(t=i,f=s+1),this.updateWrapperText(this.viewWrapper,t),n=this.value.length-f,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);l+m+a+this.clearIconWidth>o&&0!==l&&""!==this.viewWrapper.innerHTML;){this.viewWrapper.innerHTML=[].join(this.delimiterChar),n=this.value.length,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)}break}l+m+a+this.clearIconWidth<=o?(i=e,s=f):0===f&&(i="",s=-1)}if(n>0){var y=o-a-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(d,this.viewWrapper,n,u,p,y)),this.updateRemainWidth(this.viewWrapper,y),this.updateRemainingText(d,a,n,u,p)}}else(0,v.isNullOrUndefined)(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},t.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},t.prototype.updateRemainWidth=function(e,t){e.classList.contains(at)&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},t.prototype.updateRemainTemplate=function(e,t,i,s,l,n){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var a=s.replace("${count}",i.toString()),o=l.replace("${count}",i.toString());return e.innerText=t.firstChild&&3===t.firstChild.nodeType?a:o,t.firstChild&&3===t.firstChild.nodeType?t.classList.remove(at):(t.classList.add(at),this.updateRemainWidth(t,n)),e},t.prototype.updateRemainingText=function(e,t,i,s,l){var n=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),a=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(a+t>=n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;a+t>n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var o=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);o.pop(),this.viewWrapper.firstChild.nodeValue=o.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,a=this.viewWrapper.offsetWidth}var r=n-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,r)}},t.prototype.getOverflowVal=function(e){var t;if(this.mainData&&this.mainData.length){var i=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];if("CheckBox"===this.mode){var s=this.listData;this.listData=this.mainData,t=this.getTextByValue(i),this.listData=s}else t=this.getTextByValue(i)}else t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];return t},t.prototype.unWireEvent=function(){if((0,v.isNullOrUndefined)(this.componentWrapper)||v.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),v.EventHandler.remove(window,"resize",this.windowResize),!(0,v.isNullOrUndefined)(this.inputElement)){v.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),v.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&v.EventHandler.remove(this.inputElement,"input",this.onInput),v.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.remove(e,"reset",this.resetValueHandler),v.EventHandler.remove(this.inputElement,"blur",this.onBlurHandler)}(0,v.isNullOrUndefined)(this.componentWrapper)||(v.EventHandler.remove(this.componentWrapper,"mouseover",this.mouseIn),v.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut)),(0,v.isNullOrUndefined)(this.overAllClear)||v.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),(0,v.isNullOrUndefined)(this.inputElement)||v.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},t.prototype.resizingWireEvent=function(){v.EventHandler.add(document,"mousemove",this.resizePopup,this),v.EventHandler.add(document,"mouseup",this.stopResizing,this),v.EventHandler.add(document,"touchmove",this.resizePopup,this),v.EventHandler.add(document,"touchend",this.stopResizing,this)},t.prototype.resizingUnWireEvent=function(){v.EventHandler.remove(document,"mousemove",this.resizePopup),v.EventHandler.remove(document,"mouseup",this.stopResizing),v.EventHandler.remove(document,"touchmove",this.resizePopup),v.EventHandler.remove(document,"touchend",this.stopResizing)},t.prototype.selectAllItem=function(e,t,i){var s;if((0,v.isNullOrUndefined)(this.list)||(s=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&t&&t.target&&(0,v.closest)(t.target,".e-close-hooker")&&this.allowFiltering&&(s=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)){var l=t?this.groupTemplate?(0,v.closest)(t.target,".e-list-group-item"):t.target:null;if((l=(l=t&&32===t.keyCode?i:l)&&l.classList.contains("e-frame")?l.parentElement.parentElement:l)&&l.classList.contains("e-list-group-item")){var n=l.nextElementSibling;if((0,v.isNullOrUndefined)(n))return;for(;n.classList.contains("e-list-item");){if(!this.fields.disabled||!this.isDisabledElement(n))if(e){if(!n.firstElementChild.lastElementChild.classList.contains("e-check")){var a=this.value&&this.value.length?this.value.length:0;n.classList.contains("e-active")&&(a-=1),a<this.maximumSelectionLength&&this.updateListSelection(n,t)}}else n.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(n,t);if(null==(n=n.nextElementSibling))break}if(l.classList.contains("e-list-group-item")){var o=this.list.getElementsByClassName("e-item-focus")[0];o&&o.classList.remove("e-item-focus"),e?l.classList.add("e-active"):l.classList.remove("e-active"),l.classList.add("e-item-focus"),this.updateAriaActiveDescendant()}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&t&&this.updateValueState(t,this.value,this.tempValues)}else this.updateValue(t,s,e)}else this.updateValue(t,s,e);this.addValidInputClass()},t.prototype.virtualSelectionAll=function(e,t,i){var s=this,l=0,n=t.length,a=this.maximumSelectionLength;if(e){this.virtualSelectAll=!0,n=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:n,this.listData=this.virtualSelectAllData;var o=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),r=document.createDocumentFragment();o.forEach((function(e){r.appendChild(e.cloneNode(!0))})),t.forEach((function(e){r.appendChild(e.cloneNode(!0))}));var h=r.childNodes;if(this.virtualSelectAllData instanceof Array){for(;l<n&&l<=50&&l<a;){if(this.isSelectAllTarget=n===l+1,h[l]){var u=this.allowObjectBinding?this.getDataByValue(h[l].getAttribute("data-value")):this.getFormattedValue(h[l].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&this.value.indexOf(u)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(u,this.value)>=0){l++;continue}this.updateListSelection(h[l],i,n-l)}else{u=(0,v.getValue)(this.fields.value?this.fields.value:"",this.virtualSelectAllData[l]);if(u=this.allowObjectBinding?this.getDataByValue(u):u,!this.allowObjectBinding&&this.value&&this.value.indexOf(u)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(u,this.value)>=0){l++;continue}this.value&&null!=u&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(u)<0||this.allowObjectBinding&&!this.isObjectInArray(u,this.value))&&this.dispatchSelect(u,i,null,!1,n)}l++}n>50&&setTimeout((function(){if(s.virtualSelectAllData&&s.virtualSelectAllData.length>0&&s.virtualSelectAllData.map((function(e){if(s.value&&null!=e[s.fields.value]&&Array.isArray(s.value)&&(!s.allowObjectBinding&&s.value.indexOf(e[s.fields.value])<0||s.allowObjectBinding&&!s.isObjectInArray(e[s.fields.value],s.value))){var t=e[s.fields.value],l=e[s.fields.text].toString();s.dispatchSelect(t,i,null,!1,n,e,l)}})),s.updatedataValueItems(i),s.isSelectAllLoop=!1,s.changeOnBlur||(s.updateValueState(i,s.value,s.tempValues),s.isSelectAll=s.isSelectAll?!s.isSelectAll:s.isSelectAll),s.updateHiddenElement(!0),s.popupWrapper&&t[l-1]&&t[l-1].classList.contains("e-item-focus")){var e=document.getElementsByClassName("e-selectall-parent")[0];e&&e.classList.contains("e-item-focus")&&t[l-1].classList.remove("e-item-focus")}}),0)}}else this.virtualSelectAllData&&this.virtualSelectAllData.length>0&&this.virtualSelectAllData.map((function(e){s.virtualSelectAll=!0,s.removeValue(s.value[l],i,s.value.length-l)})),this.updatedataValueItems(i),this.changeOnBlur||(this.updateValueState(i,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.virtualSelectAll=!1,(0,v.isNullOrUndefined)(this.viewPortInfo.startIndex)||(0,v.isNullOrUndefined)(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});var p=this.list.getElementsByClassName("e-virtual-ddl")[0];p&&(p.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton();var d=this.list.getElementsByClassName("e-virtual-ddl-content")[0];d&&(d.style=this.getTransformValues())},t.prototype.updateValue=function(e,t,i){var s=this,l=t.length,n={event:e,items:i?t:[],itemData:i?this.listData:[],isInteracted:!!e,isChecked:i,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",n),t&&t.length||this.enableVirtualization&&!i){var a=0,o=0;if(o=this.enableGroupCheckBox?i?this.maximumSelectionLength-(this.value?this.value.length:0):t.length:i?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength,n.preventSelectEvent){for(var r=0;r<t.length&&r<o;r++){this.removeHover();var h=t[r].getAttribute("data-value"),u=this.getFormattedValue(h);u=this.allowObjectBinding?this.getDataByValue(u):u;var p=this.mainList?this.mainList.querySelectorAll(i?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[r]:null;i?(this.value=this.value?this.value:[],(!this.allowObjectBinding&&this.value.indexOf(u)<0||this.allowObjectBinding&&!this.isObjectInArray(u,this.value))&&this.setProperties({value:[].concat([],this.value,[u])},!0),this.removeFocus(),this.addListSelection(t[r],p),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(u,e,!1,t[r],p),this.enableGroupCheckBox&&this.findGroupStart(t[r])}if(!i)if((this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength){var d=this.list.querySelectorAll("li."+A.li+":not(.e-active)");(0,v.removeClass)(d,"e-disable")}var c={event:e,items:i?t:[],itemData:i?this.listData:[],isInteracted:!!e,isChecked:i};this.trigger("selectedAll",c)}else if(this.enableVirtualization)this.virtualSelectAllState=i,this.virtualSelectAll=!0,this.CurrentEvent=e,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new g.Query),this.virtualSelectAllData&&this.virtualSelectionAll(i,t,e);else{for(;a<l&&a<=50&&a<o;)this.isSelectAllTarget=l===a+1,this.updateListSelection(t[a],e,l-a),this.enableGroupCheckBox&&this.findGroupStart(t[a]),a++;l>50&&setTimeout((function(){for(;a<l&&a<o;)s.isSelectAllTarget=l===a+1,s.updateListSelection(t[a],e,l-a),s.enableGroupCheckBox&&s.findGroupStart(t[a]),a++;if(s.updatedataValueItems(e),s.changeOnBlur||(s.updateValueState(e,s.value,s.tempValues),s.isSelectAll=s.isSelectAll?!s.isSelectAll:s.isSelectAll),s.updateHiddenElement(),s.popupWrapper&&t[a-1].classList.contains("e-item-focus")){var i=document.getElementsByClassName("e-selectall-parent")[0];i&&i.classList.contains("e-item-focus")&&t[a-1].classList.remove("e-item-focus")}}),0)}}this.updatedataValueItems(e),this.checkPlaceholderSize(),l<=50&&!n.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),(this.enableVirtualization&&this.value&&this.value.length>0||!this.enableVirtualization)&&this.updateHiddenElement())},t.prototype.updateHiddenElement=function(e){var t=this,i="",s="",l="",n=[];"CheckBox"===this.mode&&(this.value.map((function(a,o){i+='<option selected value ="'+a+'">'+o+"</option>",e||(l=t.listData?t.getTextByValue(a):a,s+=l+t.delimiterChar+" ",n.push(l))})),this.hiddenElement.innerHTML=i,e||(this.updateWrapperText(this.delimiterWrapper,s),this.setProperties({text:n.toString()},!0)),this.delimiterWrapper.setAttribute("id",(0,v.getUniqueID)("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},t.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},t.prototype.textboxValueUpdate=function(e){var t=e&&e.target&&((0,v.closest)(e.target,".e-selectall-parent")||(0,v.closest)(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||t)?this.searchWrapper.classList.remove(Ye):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!t&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},t.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},t.prototype.updateDataSource=function(e){(0,v.isNullOrUndefined)(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},t.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},t.prototype.selectAllItems=function(t,i){var s=this;if((0,v.isNullOrUndefined)(this.list))this.selectAllAction=function(){if("CheckBox"===s.mode&&s.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===s.mode,value:t?"check":"uncheck"};s.notify("checkSelectAll",e)}s.selectAllItem(t,i),s.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var l={value:t?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",l)}this.selectAllItem(t,i)}this.dataSource instanceof g.DataManager&&!(this.dataSource instanceof g.DataManager&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(t,i){(t.dataSource&&!(0,v.isNullOrUndefined)(Object.keys(t.dataSource))||t.query&&!(0,v.isNullOrUndefined)(Object.keys(t.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],t));for(var s=0,l=Object.keys(t);s<l.length;s++){var n=l[s];switch(n){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&((0,v.isNullOrUndefined)(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(t.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":if(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,i.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")){var a=this.list.querySelectorAll("li."+A.li+".e-active.e-disable");(0,v.removeClass)(a,"e-disable")}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(t.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:t.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(t.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(i.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(t.enableRtl),e.prototype.onPropertyChanged.call(this,t,i);break;case"allowResize":if(this.allowResize=t.allowResize,!this.allowResize&&this.popupObj){var o=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=(0,v.formatUnit)(o),this.popupWrapper.style.height=(0,v.formatUnit)(this.popupHeight),this.popupWrapper.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):this.list.style.maxHeight=(0,v.formatUnit)(this.popupHeight)}break;case"readonly":this.updateReadonly(t.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(t.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass(),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":if(this.popupObj){o=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=(0,v.formatUnit)(o),this.popupWrapper.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):this.list.style.maxHeight=(0,v.formatUnit)(this.popupHeight)}break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.removeScrollEvent();break;default:var r=this.getPropObject(n,t,i);e.prototype.onPropertyChanged.call(this,r.newProperty,r.oldProperty)}}},t.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},t.prototype.totalItemsCount=function(){var e;if(this.dataSource instanceof g.DataManager?this.remoteDataCount>=0?e=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):e=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==e?e:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==e&&this.value?e-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0)for(var t=0;t<this.virtualCustomSelectData.length;t++)for(var i=0;i<this.value.length;i++){(this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[i]):this.value[i])===(0,v.getValue)(this.fields.value?this.fields.value:"",this.virtualCustomSelectData[t])&&(this.totalItemCount+=1)}}else this.totalItemCount=0!==e?e:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&(this.totalItemCount+=this.virtualCustomSelectData.length)},t.prototype.presentItemValue=function(e){for(var t=[],i=0;i<this.value.length;i++){var s=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[i]):this.value[i];if(!this.findListElement(this.allowFiltering&&!(0,v.isNullOrUndefined)(this.mainList)?this.mainList:e,"li","data-value",s)){var l=this.allowObjectBinding?this.getDataByValue(this.value[i]):this.value[i];t.push(l)}}return t},t.prototype.addNonPresentItems=function(e,t,i,s){var l=this;this.dataSource.executeQuery(this.getForQuery(e)).then((function(e){e.result.length>0&&l.addItem(e.result,i.length),l.updateActionList(t,i,s)}))},t.prototype.updateVal=function(e,t,i){if(this.list)if(!(this.dataSource instanceof g.DataManager)||this.listData&&this.mainList&&this.mainData){var s=[];if((0,v.isNullOrUndefined)(this.value)||this.allowCustomValue||(s=this.presentItemValue(this.ulElement)),"value"===i&&s.length>0&&this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(this.value)&&null!=this.listData&&!this.enableVirtualization)this.mainData=null,this.setDynValue=!0,this.addNonPresentItems(s,this.ulElement,this.listData);else{if("text"===i&&(this.initialTextUpdate(),e=this.value),((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&(this.tempValues=t),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof g.DataManager)?this.isInitRemoteVirtualData||(this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()):this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,t),this.checkPlaceholderSize()}}else this.onLoadSelect();else this.onLoadSelect();this.changeOnBlur||this.updateValueState(null,e,t)},t.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},t.prototype.hidePopup=function(e){var t=this;if(this.isPopupOpen()){var i={name:"FadeOut",duration:100,delay:100};this.customFilterQuery=null;var s={popup:this.popupObj,cancel:!1,animation:i,event:e||null};this.trigger("close",s,(function(e){if(!e.cancel){t.fields.groupBy&&"CheckBox"!==t.mode&&t.fixedHeaderElement&&((0,v.remove)(t.fixedHeaderElement),t.fixedHeaderElement=null),t.beforePopupOpen=!1,t.overAllWrapper.classList.remove(nt);var i="CheckBox"===t.mode?t.targetElement():null;if(t.popupObj.hide(new v.Animation(e.animation)),(0,v.attributes)(t.inputElement,{"aria-expanded":"false"}),t.inputElement.removeAttribute("aria-owns"),t.inputElement.removeAttribute("aria-activedescendant"),t.allowFiltering&&t.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===t.mode,value:"clear"}),t.popupObj.hide(),(0,v.removeClass)([document.body,t.popupObj.element],"e-popup-full-page"),v.EventHandler.remove(t.list,"keydown",t.onKeyDown),"CheckBox"===t.mode&&t.showSelectAll&&v.EventHandler.remove(t.popupObj.element,"click",t.clickHandler),t.list&&t.list.parentElement&&t.allowResize){t.resizer&&t.list.parentElement.contains(t.resizer)&&t.list.parentElement.removeChild(t.resizer),t.list.parentElement.classList.contains("e-resize")&&t.list.parentElement.classList.remove("e-resize"),t.list.parentElement.style.boxSizing="",t.list.parentElement.style.paddingBottom="";var s=parseInt(t.popupHeight,10);t.list.style.maxHeight=(0,v.formatUnit)(s),t.list.parentElement.style.height=(0,v.formatUnit)(t.popupHeight),t.list.parentElement.style.maxHeight=(0,v.formatUnit)(t.popupHeight)}t.resizer&&(v.EventHandler.remove(t.resizer,"mousedown",t.startResizing),t.resizer.remove()),t.enableVirtualization&&"CheckBox"===t.mode&&t.value&&t.value.length>0&&t.enableSelectionOrder&&(t.viewPortInfo.startIndex=t.virtualItemStartIndex=0,t.viewPortInfo.endIndex=t.virtualItemEndIndex=t.viewPortInfo.startIndex>0?t.viewPortInfo.endIndex:t.itemCount,t.virtualListInfo=t.viewPortInfo,t.previousStartIndex=0,t.previousEndIndex=t.itemCount);var l=void 0;t.dataSource instanceof g.DataManager?t.remoteDataCount>=0?t.totalItemCount=t.dataCount=t.remoteDataCount:t.resetList(t.dataSource):l=t.dataSource&&t.dataSource.length?t.dataSource.length:0,t.enableVirtualization&&(t.allowFiltering||t.allowCustomValue)&&(t.targetElement()||i)&&t.totalItemCount!==l&&(t.checkAndResetCache(),t.updateInitialData()),t.virtualCustomData&&t.viewPortInfo&&0===t.viewPortInfo.startIndex&&t.viewPortInfo.endIndex===t.itemCount&&t.renderItems(t.mainData,t.fields),t.virtualCustomData=null,t.isVirtualTrackHeight=!1}}))}},t.prototype.showPopup=function(t){var i=this;if(this.enabled){this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null;this.trigger("beforeOpen",{cancel:!1},(function(s){if(!s.cancel){if(!i.ulElement)return i.beforePopupOpen=!0,"CheckBox"===i.mode&&v.Browser.isDevice&&i.allowFiltering&&i.isDeviceFullScreen&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode}),void e.prototype.render.call(i,t);"CheckBox"===i.mode&&v.Browser.isDevice&&i.allowFiltering&&i.isDeviceFullScreen&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode});var l=i.ulElement.querySelectorAll("li.e-list-item").length,n=i.ulElement.querySelectorAll("li."+A.li+"."+_e).length;if(l>0&&l===n&&n===i.mainData.length&&(""===i.targetElement()||!i.allowCustomValue))return void(i.beforePopupOpen=!1);if(i.onPopupShown(t),i.enableVirtualization&&i.listData&&i.listData.length&&((0,v.isNullOrUndefined)(i.value)||"dropdownlist"!==i.getModuleName()&&"combobox"!==i.getModuleName()||i.removeHover(),i.beforePopupOpen||(i.hideSelectedItem&&i.value&&Array.isArray(i.value)&&i.value.length>0&&i.totalItemsCount(),i.preventSetCurrentData||(0,v.isNullOrUndefined)(i.viewPortInfo.startIndex)||(0,v.isNullOrUndefined)(i.viewPortInfo.endIndex)||i.notify("setCurrentViewDataAsync",{component:i.getModuleName(),module:"VirtualScroll"}))),i.enableVirtualization&&!i.allowFiltering&&null!=i.selectedValueInfo&&i.selectedValueInfo.startIndex>0&&null!=i.value&&i.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),i.enableVirtualization)i.updatevirtualizationList();else if(i.value&&i.value.length)for(var a=void 0,o=(i.getItems(),0),r=i.value;o<r.length;o++){var h=r[o],u=i.allowObjectBinding?(0,v.getValue)(i.fields.value?i.fields.value:"",h):h;(a=i.getElementByValue(u))&&i.addListSelection(a)}i.allowResize&&i.setResize(),i.preventSetCurrentData=!0}}))}},t.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},t.prototype.getModuleName=function(){return"multiselect"},t.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout((function(){e.setProperties({value:null},!0)}),0):this.setProperties({value:null},!0)},t.prototype.render=function(){!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view "+Ze,styles:"display:none;"}),this.overAllClear=this.createElement("span",{className:$e,styles:"display:none;"}),this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&(0,v.addClass)([this.overAllWrapper],"e-checkbox"),v.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:Ze,styles:"display:none"}),this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection",styles:"display:none"}),"Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",(0,v.getUniqueID)("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",(0,v.getUniqueID)("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!v.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add(tt),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),(0,v.isNullOrUndefined)(this.inputElement)||((0,v.attributes)(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName())),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?Pe(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):(0,v.getUniqueID)("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),!(0,v.isNullOrUndefined)((0,v.closest)(this.element,"fieldset"))&&(0,v.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},t.prototype.setResize=function(){if(this.list&&this.list.parentElement&&(0,v.isNullOrUndefined)(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement){this.list.parentElement.classList.add("e-resize"),"auto"!==this.popupHeight.toString().toLowerCase()&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box";var e="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16;this.list.parentElement.style.paddingBottom=e+"px",this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px"}this.resizer&&(v.EventHandler.add(this.resizer,"mousedown",this.startResizing,this),v.EventHandler.add(this.resizer,"touchstart",this.startResizing,this))},t.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},t.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.resizeWidth=Math.max(this.originalWidth+s,100),this.resizeHeight=Math.max(this.originalHeight+l,130),this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},t.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},t.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=(0,v.formatUnit)(this.popupHeight);e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var s=Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10);return e.remove(),s},t.prototype.removeDisabledItemsValue=function(e){if(e){for(var t=[],i=0,s=0;s<e.length;s++){var l=e[s];"object"==typeof l&&(l=JSON.parse(JSON.stringify(l))[this.fields.value]),null==l||this.isDisabledItemByIndex(this.getIndexByValue(l))||(t[i++]=e[s])}this.value=t.length>0?t:null}},t.prototype.checkInitialValue=function(){var t=this;this.fields.disabled&&this.removeDisabledItemsValue(this.value);var i=this.dataSource instanceof Array?this.dataSource.length>0:!(0,v.isNullOrUndefined)(this.dataSource);if((!this.value||!this.value.length)&&(0,v.isNullOrUndefined)(this.text)&&!i&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var s=this.element.options,l=[],n="",a=0,o=s.length;a<o;a++){var r=s[a];if(!(0,v.isNullOrUndefined)(r.getAttribute("selected")))if(r.getAttribute("value")){var h=this.allowObjectBinding?this.getDataByValue(r.getAttribute("value")):r.getAttribute("value");l.push(h)}else n+=r.text+this.delimiterChar}l.length>0?this.setProperties({value:l},!0):""!==n&&this.setProperties({text:n},!0),(l.length>0||""!==n)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if((this.value&&this.value.length||!(0,v.isNullOrUndefined)(this.text))&&(this.list||e.prototype.render.call(this)),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),(0,v.isNullOrUndefined)(this.text)||!(0,v.isNullOrUndefined)(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){var u;if(this.enableVirtualization){for(var p=this.isPrimitiveData?"":this.fields.value,d=void 0,c=0;c<this.value.length;c++){h=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[c]):this.value[c];d=0===c?new g.Predicate(p,"equal",h):d.or(p,"equal",h)}this.dataSource instanceof g.DataManager?this.dataSource.executeQuery((new g.Query).where(d)).then((function(e){e.result.length>0&&(u=e.result,t.initStatus=!1,t.isInitRemoteVirtualData=!0,setTimeout((function(){t.initialValueUpdate(u,!0),t.initialUpdate(),t.isInitRemoteVirtualData=!1}),100),t.initStatus=!0)})):u=new g.DataManager(this.dataSource).executeLocal((new g.Query).where(d))}this.dataSource instanceof g.DataManager?this.setInitialValue=function(){t.initStatus=!1,t.enableVirtualization&&(!t.enableVirtualization||t.dataSource instanceof g.DataManager)||t.initialValueUpdate(u),t.initialUpdate(),t.setInitialValue=null,t.initStatus=!0}:(this.initialValueUpdate(u,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),(0,v.isNullOrUndefined)(this.text)||this.element.setAttribute("data-initial-value",this.text)},t.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},t.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var e=void 0,t=0,i=this.value;t<i.length;t++){var s=i[t],l=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",s):s;(e=this.getElementByValue(l))&&this.addListSelection(e)}if(this.enableVirtualization&&this.hideSelectedItem){var n=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide):not(.e-virtual-list)");if(n.length){var a=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(n.length<a+2){var o=this.getForQuery(this.value).clone();o=o.skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,o)}}}}},t.prototype.setFloatLabelType=function(){He(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&Pe(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},t.prototype.addValidInputClass=function(){(0,v.isNullOrUndefined)(this.overAllWrapper)||(!(0,v.isNullOrUndefined)(this.value)&&this.value.length||"Always"===this.floatLabelType?(0,v.addClass)([this.overAllWrapper],"e-valid-input"):(0,v.removeClass)([this.overAllWrapper],"e-valid-input"))},t.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:lt}),this.componentWrapper.appendChild(this.dropIcon),(0,v.addClass)([this.componentWrapper],["e-down-icon"])):(0,v.isNullOrUndefined)(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),(0,v.removeClass)([this.componentWrapper],["e-down-icon"]))},t.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},t.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e)if(e instanceof HTMLLIElement){for(var i=0;i<this.liCollections.length;i++)if(this.liCollections[i]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else{var s=JSON.parse(JSON.stringify(e))[this.fields.value];for(i=0;i<this.listData.length;i++)if(JSON.parse(JSON.stringify(this.listData[i]))[this.fields.value]===s){t=this.getIndexByValue(s);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));if(n[this.fields.disabled]=!0,this.listData[t]=n,l.classList.contains(A.focus)&&this.removeFocus(),l.classList.contains(_e)||l.classList.contains(A.selected)){var a=this.value;this.removeDisabledItemsValue(this.value),this.updateVal(this.value,a,"value")}"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.disableGroupHeader()}}}}},t.prototype.destroy=function(){this.isReact&&this.clearTemplate(),(0,v.isNullOrUndefined)(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var t=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],i=t.length;if(!(0,v.isNullOrUndefined)(this.inputElement))for(;i>0;)this.inputElement.removeAttribute(t[i-1]),i--;for((0,v.isNullOrUndefined)(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()||this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),(0,v.remove)(this.overAllWrapper)),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var s=this.overAllWrapper.querySelector("select.e-multi-hidden");for(s&&s.parentElement&&s.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var l=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],n=0;n<l.length;n++)this.inputElement.removeAttribute(l[n]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,e.prototype.destroy.call(this)},Re([(0,v.Complex)({text:null,value:null,iconCss:null,groupBy:null,disabled:null},O)],t.prototype,"fields",void 0),Re([(0,v.Property)(!1)],t.prototype,"enablePersistence",void 0),Re([(0,v.Property)(null)],t.prototype,"groupTemplate",void 0),Re([(0,v.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),Re([(0,v.Property)("Request failed")],t.prototype,"actionFailureTemplate",void 0),Re([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),Re([(0,v.Property)(!0)],t.prototype,"enabled",void 0),Re([(0,v.Property)(!0)],t.prototype,"enableHtmlSanitizer",void 0),Re([(0,v.Property)(!1)],t.prototype,"enableVirtualization",void 0),Re([(0,v.Property)([])],t.prototype,"dataSource",void 0),Re([(0,v.Property)(null)],t.prototype,"query",void 0),Re([(0,v.Property)("StartsWith")],t.prototype,"filterType",void 0),Re([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),Re([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),Re([(0,v.Property)()],t.prototype,"locale",void 0),Re([(0,v.Property)(!1)],t.prototype,"enableGroupCheckBox",void 0),Re([(0,v.Property)(null)],t.prototype,"cssClass",void 0),Re([(0,v.Property)("100%")],t.prototype,"width",void 0),Re([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),Re([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),Re([(0,v.Property)(null)],t.prototype,"placeholder",void 0),Re([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),Re([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),Re([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"allowFiltering",void 0),Re([(0,v.Property)(!0)],t.prototype,"isDeviceFullScreen",void 0),Re([(0,v.Property)(!0)],t.prototype,"changeOnBlur",void 0),Re([(0,v.Property)(!1)],t.prototype,"allowCustomValue",void 0),Re([(0,v.Property)(!0)],t.prototype,"showClearButton",void 0),Re([(0,v.Property)(1e3)],t.prototype,"maximumSelectionLength",void 0),Re([(0,v.Property)(!1)],t.prototype,"readonly",void 0),Re([(0,v.Property)(!1)],t.prototype,"allowResize",void 0),Re([(0,v.Property)(null)],t.prototype,"text",void 0),Re([(0,v.Property)(null)],t.prototype,"value",void 0),Re([(0,v.Property)(!1)],t.prototype,"allowObjectBinding",void 0),Re([(0,v.Property)(!0)],t.prototype,"hideSelectedItem",void 0),Re([(0,v.Property)(!0)],t.prototype,"closePopupOnSelect",void 0),Re([(0,v.Property)("Default")],t.prototype,"mode",void 0),Re([(0,v.Property)(",")],t.prototype,"delimiterChar",void 0),Re([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),Re([(0,v.Property)(!1)],t.prototype,"showDropDownIcon",void 0),Re([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),Re([(0,v.Property)(!1)],t.prototype,"showSelectAll",void 0),Re([(0,v.Property)("Select All")],t.prototype,"selectAllText",void 0),Re([(0,v.Property)("Unselect All")],t.prototype,"unSelectAllText",void 0),Re([(0,v.Property)(!0)],t.prototype,"enableSelectionOrder",void 0),Re([(0,v.Property)(!0)],t.prototype,"openOnClick",void 0),Re([(0,v.Property)(!1)],t.prototype,"addTagOnBlur",void 0),Re([(0,v.Event)()],t.prototype,"change",void 0),Re([(0,v.Event)()],t.prototype,"removing",void 0),Re([(0,v.Event)()],t.prototype,"removed",void 0),Re([(0,v.Event)()],t.prototype,"beforeSelectAll",void 0),Re([(0,v.Event)()],t.prototype,"selectedAll",void 0),Re([(0,v.Event)()],t.prototype,"beforeOpen",void 0),Re([(0,v.Event)()],t.prototype,"open",void 0),Re([(0,v.Event)()],t.prototype,"close",void 0),Re([(0,v.Event)()],t.prototype,"blur",void 0),Re([(0,v.Event)()],t.prototype,"focus",void 0),Re([(0,v.Event)()],t.prototype,"chipSelection",void 0),Re([(0,v.Event)()],t.prototype,"resizeStop",void 0),Re([(0,v.Event)()],t.prototype,"resizing",void 0),Re([(0,v.Event)()],t.prototype,"resizeStart",void 0),Re([(0,v.Event)()],t.prototype,"filtering",void 0),Re([(0,v.Event)()],t.prototype,"tagging",void 0),Re([(0,v.Event)()],t.prototype,"customValueSelection",void 0),t=Re([v.NotifyPropertyChanges],t)}(D),ut="e-frame",pt="e-check",dt="e-checkbox-wrapper",ct="e-stop",mt="e-input-group-icon e-clear-icon e-icons",ft="e-clear-icon",vt="e-popup-full-page",gt="e-input-focus",yt=function(){function e(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"CheckBoxSelection"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlurHandler,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),v.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlurHandler),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},e.prototype.listOption=function(e){var t=this;if((0,v.isNullOrUndefined)(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){t.checboxCreate(e)};else{var i=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){t.checboxCreate(e),i.apply(t,[e])}}},e.prototype.setPlaceholder=function(e){N.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var t;if(t=(0,v.isNullOrUndefined)(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==t.className&&"e-list-group-item"!==t.className){var i=(0,U.createCheckBox)(this.parent.createElement,!0),s=(0,v.select)("div.e-icons",t);return t.insertBefore(i,t.childNodes[(0,v.isNullOrUndefined)(s)?0:1]),(0,v.select)("."+ut,i),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),t}return t},e.prototype.setSelectAll=function(){this.parent.showSelectAll?((0,v.isNullOrUndefined)(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&((0,v.isNullOrUndefined)(this.parent.filterParent)?(0,v.append)([this.checkAllParent],this.parent.popupWrapper):(0,v.append)([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||((0,v.isNullOrUndefined)(this.parent.filterParent)?(0,v.prepend)([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),v.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):(0,v.isNullOrUndefined)(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},e.prototype.listSelection=function(e){var t;if((0,v.isNullOrUndefined)(e.e)){var i=e.li.querySelector(".e-checkbox-wrapper");t=i?i.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{e.li.querySelector(".e-checkbox-wrapper .e-frame");t=(0,v.isNullOrUndefined)(e.e.target)?e.li.querySelector(".e-checkbox-wrapper").childNodes[1]:e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(t=e.li.firstElementChild.childNodes[1]),(0,v.isNullOrUndefined)(t)||(this.checkWrapper=(0,v.closest)(t,"."+dt)),!(0,v.isNullOrUndefined)(this.checkWrapper)){var s=(0,v.select)("."+ut,this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains(pt),e.li,e.e,!1)}},e.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},e.prototype.clickHandler=function(e){var t;t=e.currentTarget.classList.contains(this.checkAllParent.className)||e.currentTarget.classList.value===this.checkAllParent.className?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=(0,v.closest)(t,"."+dt);if(!(0,v.isNullOrUndefined)(this.checkWrapper)){var i=(0,v.select)("."+ut,this.checkWrapper);this.validateCheckNode(this.checkWrapper,i.classList.contains(pt),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,t,i,s,l){var n=e.getElementsByClassName(ut)[0];"check"!==t||n.classList.contains(pt)?"uncheck"===t&&(n.classList.contains(pt)||n.classList.contains(ct))?((0,v.removeClass)([n],[pt,ct]),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):"indeterminate"!==t||n.classList.contains(ct)||((0,v.removeClass)([n],[pt]),n.classList.add(ct),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):(n.classList.remove(ct),n.classList.add(pt),l&&(this.parent.selectAllItems(!0,i),this.setLocale(!0)))},e.prototype.setSearchBox=function(e){if((0,v.isNullOrUndefined)(this.parent.filterParent)){this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element);var t=!1;return v.Browser.isDevice&&this.parent.isDeviceFullScreen&&(t=!0,this.parent.mobFilter=!1),this.filterInputObj=N.Input.createInput({element:this.filterInput,buttons:t?["e-input-group-icon e-back-icon e-icons",mt]:[mt],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),(0,v.isNullOrUndefined)(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?(0,v.addClass)([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&(0,v.addClass)([this.filterInputObj.container],"e-filled")),(0,v.append)([this.filterInputObj.container],this.parent.filterParent),(0,v.prepend)([this.parent.filterParent],e.popupElement),(0,v.attributes)(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":e.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+ft),!v.Browser.isDevice&&this.clearIconElement&&(v.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),v.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),v.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),v.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),v.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),v.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj}},e.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),(0,v.removeClass)([document.body,this.parent.popupObj.element],vt),this.parent.inputElement.focus()},e.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&((0,v.isNullOrUndefined)(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(e),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),e.preventDefault()},e.prototype.preventListSelection=function(e){e.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},e.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector("."+ft),this.clearIconElement.style.visibility="hidden",v.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),v.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,t=0,i=0,s=0;this.checkAllParent&&(t=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(s=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(i=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-t-s-i+"px",this.parent.list.style.height=window.innerHeight-e-t-s-i+"px";var l=this.filterInput.parentElement.querySelector("."+ft);(0,v.detach)(this.filterInput),l.parentElement.insertBefore(this.filterInput,l)},e.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&((0,v.attributes)(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),(0,v.addClass)([document.body,this.parent.popupObj.element],vt),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},e.prototype.targetElement=function(){return(0,v.isNullOrUndefined)(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlurHandler=function(e){if(!this.parent.element.classList.contains("e-listbox")){var t=void 0;if(this.parent.keyAction)return;if(v.Browser.isIE&&(t=!(0,v.isNullOrUndefined)(e)&&e.target),v.Browser.isIE||(t=!(0,v.isNullOrUndefined)(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(t)&&!v.Browser.isIE&&this.filterInput)return void this.filterInput.focus();if(this.parent.scrollFocusStatus&&this.filterInput)return e.preventDefault(),this.filterInput.focus(),void(this.parent.scrollFocusStatus=!1);this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove(gt),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!v.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var t=e.target;!(0,v.isNullOrUndefined)(this.parent.popupObj)&&(0,v.closest)(t,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!(0,v.isNullOrUndefined)(this.parent.popupObj)&&(0,v.closest)(t,'[id="'+this.parent.popupObj.element.id+'"]')||(0,v.isNullOrUndefined)(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(v.Browser.isIE||"edge"===v.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(A.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(e,!0),this.parent.focused=!0),(0,v.isNullOrUndefined)(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(v.Browser.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(e)),this.filterInput===t&&this.filterInput.focus()}},e.prototype.getFocus=function(e){this.parent.overAllWrapper.classList.remove(gt),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value?this.parent.keyAction=!1:("focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),v.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden"))},e.prototype.checkSelectAll=function(e){"check"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},e.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var t=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var i=e?"unSelectAllText":"selectAllText",s=0,l=(0,v.compile)(t)({},this.parent,i,null,!this.parent.isStringTemplate);s<l.length;s++){var n=l[s];this.selectAllSpan.textContent=n.textContent}}else{var a=new v.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===a.getConstant("selectAllText")&&(a=new v.L10n("dropdowns",{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.parent.locale)),(0,v.isNullOrUndefined)(this.selectAllSpan)||(this.selectAllSpan.textContent=e?a.getConstant("unSelectAllText"):a.getConstant("selectAllText"))}},e.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},e.prototype.setReorder=function(e){if(this.parent.enableSelectionOrder&&!(0,v.isNullOrUndefined)(this.parent.value)){var t=this.parent.ulElement.querySelectorAll("li.e-active").length,i=void 0,s=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});if(t>0)if(this.parent.ulElement.querySelectorAll("li.e-active").forEach((function(e){s.appendChild(e)})),i=this.parent.ulElement.querySelectorAll("li.e-active"),(0,v.addClass)(i,"e-reorder-hide"),this.parent.enableVirtualization){var l=this.parent.list.querySelector(".e-virtual-ddl-content");(0,v.prepend)([s],l)}else(0,v.prepend)([s],this.parent.list);this.parent.focusAtFirstListItem()}},e}(),Ct=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),bt=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},St=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ct(t,e),bt([(0,v.Property)("Multiple")],t.prototype,"mode",void 0),bt([(0,v.Property)(!1)],t.prototype,"showCheckbox",void 0),bt([(0,v.Property)(!1)],t.prototype,"showSelectAll",void 0),bt([(0,v.Property)("Left")],t.prototype,"checkboxPosition",void 0),t}(v.ChildProperty),Et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ct(t,e),bt([(0,v.Property)([])],t.prototype,"items",void 0),bt([(0,v.Property)("Right")],t.prototype,"position",void 0),t}(v.ChildProperty),xt=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}var i;return Ct(t,e),i=t,t.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new g.Query,this.fields)},t.prototype.render=function(){if(this.isAngular&&this.allowFiltering){var t=this.element,i=t.cloneNode(!0);t.parentNode.replaceChild(i,t),this.element=i,(0,v.setValue)("ej2_instances",[this],this.element)}this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),e.prototype.render.call(this),this.setEnabled(),this.renderComplete()},t.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});e.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation");for(var t=this.list.querySelectorAll(".e-list-group-item"),i=0;i<t.length;i++)t[i].removeAttribute("tabindex"),t[i].setAttribute("role","option");this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(A.focus),this.itemTemplate&&this.renderReactTemplates(),(0,v.removeClass)([this.list],[A.content,A.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),(0,v.attributes)(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},t.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new v.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{})}},t.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new E.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return e.createElement("span",{className:"e-placeholder"})},helper:function(t){var i=e.list.cloneNode(),s=t.sender.cloneNode(!0);i.appendChild(s);var l=e.getItems()[0];return i.style.width=l.offsetWidth+"px",i.style.height=l.offsetHeight+"px",(e.value&&e.value.length)>1&&e.isSelected(s)&&s.appendChild(e.createElement("span",{className:"e-list-badge",innerHTML:e.value.length+""})),i.style.zIndex=(0,k.getZindexPartial)(e.element)+"",i}})},t.prototype.updateActionCompleteData=function(e,t,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,t)},t.prototype.initToolbar=function(){var e=this.toolbarSettings.position,t=this.element.getAttribute("data-value");if(this.toolbarSettings.items=(0,v.isNullOrUndefined)(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length){var i=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),s=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(s,this.list),s.appendChild("Right"===e?this.list:i),s.appendChild("Right"===e?i:this.list),this.createButtons(i),this.element.id||(this.element.id=(0,v.getUniqueID)("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var l=this.element.getAttribute("data-value");t&&l&&t!==l?(this.tBListBox=(0,v.getComponent)(document.getElementById(t),this.getModuleName()),this.tBListBox.updateToolBarState()):l&&(this.tBListBox=(0,v.getComponent)(document.getElementById(l),this.getModuleName()),this.tBListBox.updateToolBarState())},t.prototype.createButtons=function(e){var t,i,s=this,l=new v.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach((function(n){i=l.getConstant(n),t=s.createElement("button",{attrs:{type:"button","data-value":n,title:i,"aria-label":i}}),e.appendChild(t),new U.Button({iconCss:"e-icons e-"+n.toLowerCase()},t).createElement=s.createElement}))},t.prototype.validationAttribute=function(t,i){this.inputFormName&&t.setAttribute("name",this.inputFormName),e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},t.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=(0,v.formatUnit)(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?(0,v.addClass)([this.list],"e-filter-list"):(0,v.removeClass)([this.list],"e-filter-list")},t.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&(0,v.addClass)([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&(0,v.addClass)([this.list],"e-rtl")},t.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?(0,v.removeClass)([e],E.cssClass.disabled):(0,v.addClass)([e],E.cssClass.disabled)},t.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=(0,v.formatUnit)(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),(0,k.createSpinner)({target:this.spinner},this.createElement),(0,k.showSpinner)(this.spinner)},t.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&(0,k.hideSpinner)(this.spinner),this.spinner.parentElement&&(0,v.detach)(this.spinner)},t.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},t.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},t.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+It.clearIcon)&&(this.filterInput.parentElement.querySelector("."+It.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},t.prototype.onActionComplete=function(t,i,s){var l,n,a;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(l=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===i.length){var o=t.childNodes[0];o&&t.removeChild(o)}if(this.allowFiltering&&(n=this.list.getElementsByClassName("e-input-filter")[0])&&(a=n.selectionStart),e.prototype.onActionComplete.call(this,t,i,s),this.allowFiltering&&!(0,v.isNullOrUndefined)(l)){this.list.insertBefore(l,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(l);var r=l.querySelector(".e-input-filter");r&&(r.addEventListener("focus",(function(){l.childNodes[0].classList.contains("e-input-focus")||l.childNodes[0].classList.add("e-input-focus")})),r.addEventListener("blur",(function(){l.childNodes[0].classList.contains("e-input-focus")&&l.childNodes[0].classList.remove("e-input-focus")})))}if(this.initWrapper(),this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],(0,v.extend)(this.jsonData,i,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],(0,v.extend)(this.jsonData,i,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(n=this.list.getElementsByClassName("e-input-filter")[0],(0,v.isNullOrUndefined)(n))return;n.selectionStart=a,n.selectionEnd=a,""!==n.value&&n.focus()}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!(0,v.isNullOrUndefined)(s)){var h=this.scope.replace("#","");(0,v.getComponent)(document.getElementById(h),this.getModuleName()).initToolbar()}this.initLoad=!1},t.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},t.prototype.triggerDragStart=function(e){var t,i=this,s=(0,v.extend)(this.getDragArgs(e),{dragSelected:!0},{cancel:!1});v.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",s,(function(s){i.allowDragAll=s.dragSelected,i.allowDragAll||(t=i.ulElement.getElementsByClassName("e-list-badge")[0])&&(0,v.detach)(t),s.cancel&&(e.cancel=!0)}))},t.prototype.triggerDrag=function(e){var t,i,s=this,l=10;if(this.itemTemplate&&e.target)if(e.target&&e.target.closest(".e-list-item"))l=e.target.closest(".e-list-item").scrollHeight;else{var n=e.element.querySelector(".e-list-item");n&&(l=n.scrollHeight)}var a,o=e.event;this.stopTimer(),e.target&&(e.target.classList.contains("e-listbox-wrapper")||e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item"))&&(a=e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item")?e.target.closest(".e-listbox-wrapper"):e.target,(t=this.allowFiltering?a.querySelector(".e-list-parent"):a)&&((i=t.getBoundingClientRect()).y+t.offsetHeight-(o.clientY+36)<1?this.timer=window.setInterval((function(){s.setScrollDown(t,l,!0)}),70):o.clientY-36-i.y<1&&(this.timer=window.setInterval((function(){s.setScrollDown(t,l,!1)}),70)))),null!==e.target&&this.trigger("drag",this.getDragArgs(e))},t.prototype.setScrollDown=function(e,t,i){e.scrollTop=i?e.scrollTop+t:e.scrollTop-t},t.prototype.stopTimer=function(){window.clearInterval(this.timer)},t.prototype.beforeDragEnd=function(e){this.stopTimer();var t=[];this.dragValue=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),this.value.indexOf(this.dragValue)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([this.dragValue]),(0,v.extend)(t,e.items),this.trigger("beforeDrop",e),JSON.stringify(e.items)!==JSON.stringify(t)&&(this.customDraggedItem=e.items)},t.prototype.dragEnd=function(e){var t,i,s,l,n,a,o=this,r=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),h=this.getComponent(e.droppedElement),u=this.getDragArgs({target:e.droppedElement},!0),p={previousData:this.dataSource},d={previousData:h.dataSource},c=(0,v.extend)({},u,{target:e.target,source:{previousData:this.dataSource},previousIndex:e.previousIndex,currentIndex:e.currentIndex});if(h!==this){var m=(0,v.extend)(p,{currentData:this.listData});c=(0,v.extend)(c,{source:m,destination:d})}v.Browser.isIos&&(this.list.style.overflow="");var f=this.getComponent(e.target);if(f&&0===f.listData.length){var g=f.ulElement.childNodes[0];g&&f.ulElement.removeChild(g)}if(h===this){var y=this.ulElement;t=[].slice.call(this.listData),i=[].slice.call(this.liCollections),s=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData);var C=e.currentIndex,b=e.currentIndex=this.getCurIdx(this,e.currentIndex),S=t.indexOf(this.getDataByValue(r)),E=s.indexOf(this.getDataByValue(r)),x=a.indexOf(this.getDataByValue(r));t.splice(b,0,t.splice(S,1)[0]),a.splice(C,0,a.splice(x,1)[0]),s.splice(b,0,s.splice(E,1)[0]),i.splice(b,0,i.splice(S,1)[0]),this.allowDragAll&&(n=this.value&&Array.prototype.indexOf.call(this.value,r)>-1?this.value:[r],(0,v.isNullOrUndefined)(this.customDraggedItem)||(n=[],this.customDraggedItem.forEach((function(e){n.push((0,v.getValue)(o.fields.value,e))}))),n.forEach((function(e){if(e!==r){var l=t.indexOf(o.getDataByValue(e)),n=s.indexOf(o.getDataByValue(e)),h=a.indexOf(o.getDataByValue(e));l>b&&b++,s.splice(b,0,s.splice(n,1)[0]),t.splice(b,0,t.splice(l,1)[0]),a.splice(C,0,a.splice(h,1)[0]),i.splice(b,0,i.splice(l,1)[0]),y.insertBefore(o.getItems()[o.getIndexByValue(e)],y.getElementsByClassName("e-placeholder")[0])}}))),this.listData=t,this.jsonData=s,this.sortedData=a,this.liCollections=i}else{var I,w=[].slice.call(this.liCollections),O=e.currentIndex=this.getCurIdx(h,e.currentIndex),A=h.ulElement;t=[].slice.call(h.listData),i=[].slice.call(h.liCollections),s=[].slice.call(h.jsonData),a=[].slice.call(h.sortedData),n=this.value&&Array.prototype.indexOf.call(this.value,r)>-1&&this.allowDragAll?this.value:[r],(0,v.isNullOrUndefined)(this.customDraggedItem)||(n=[],this.customDraggedItem.forEach((function(e){n.push((0,v.getValue)(o.fields.value,e))})));var D=[].slice.call(this.listData),k=[].slice.call(this.sortedData);if(n.forEach((function(n){l=o.getDataByValue(n);var h=o.listData.indexOf(l),u=o.jsonData.indexOf(l),p=o.sortedData.indexOf(l);D.splice(h,1),o.jsonData.splice(u,1),k.splice(p,1),o.listData=D,o.sortedData=k;var d=n===r?e.currentIndex:O;if(t.splice(d,0,l),s.splice(d,0,l),a.splice(d,0,l),i.splice(d,0,w.splice(h,1)[0]),n)I=o.getItems()[o.getIndexByValue(n)];else for(var c=o.getItems(),m=0;m<c.length;m++)if(null===c[m].getAttribute("data-value")&&c[m].classList.contains("e-list-item")){I=c[m];break}I||(I=e.helper),o.removeSelected(o,n===r?[e.droppedElement]:[I]),A.insertBefore(I,A.getElementsByClassName("e-placeholder")[0]),O++})),this.fields.groupBy){var N=this.renderItems(this.listData,this.fields);this.updateListItems(N,this.ulElement),this.setSelection()}if("None"!==h.sortOrder||this.selectionSettings.showCheckbox!==h.selectionSettings.showCheckbox||h.fields.groupBy||h.itemTemplate||this.itemTemplate){var L=(0,v.getComponent)(A,"sortable");N=h.renderItems(t,h.fields);h.updateListItems(N,A),this.setSelection(),L.placeHolderElement&&A.appendChild(L.placeHolderElement),A.appendChild(e.helper),h.setSelection()}this.liCollections=w,h.liCollections=i,h.jsonData=(0,v.extend)([],[],s,!1),h.listData=(0,v.extend)([],[],t,!1),"None"===h.sortOrder&&(h.sortedData=(0,v.extend)([],[],a,!1)),0===this.listData.length&&this.l10nUpdate()}if(this===h){m=(0,v.extend)(p,{currentData:t});c=(0,v.extend)(c,{source:m})}else{var B=(0,v.extend)(d,{currentData:t});c=(0,v.extend)(c,{destination:B})}(0,v.isNullOrUndefined)(this.customDraggedItem)||(c.items=this.customDraggedItem),this.trigger("drop",c);var T=c.elements;if(T.length)for(var V=0;V<T.length;V++)T[V].classList.remove("e-grabbed");this.toolbarSettings.items.length>0?this.updateToolBarState():this.tBListBox&&this.tBListBox.toolbarSettings.items.length>0&&this.tBListBox.updateToolBarState()},t.prototype.updateListItems=function(e,t){t.innerHTML="",t.append.apply(t,e.childNodes)},t.prototype.removeSelected=function(e,t){e.selectionSettings.showCheckbox?t.forEach((function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")})):(0,v.removeClass)(t,E.cssClass.selected)},t.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter((function(e){return e.classList.contains(E.cssClass.group)})).length),t},t.prototype.getComponent=function(e){var t,i="EJS-LISTBOX"===this.element.tagName?(0,v.closest)(e,".e-listbox"):(0,v.closest)(e,".e-listbox-wrapper")&&(0,v.closest)(e,".e-listbox-wrapper").querySelector(".e-listbox");return i&&(t=(0,v.getComponent)(i,this.getModuleName())),t},t.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},t.prototype.listOption=function(t,i){return this.listCurrentOptions=e.prototype.listOption.call(this,t,i),this.listCurrentOptions=(0,v.extend)({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},t.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},t.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},t.prototype.enableItems=function(e,t,i){var s,l=this;if(void 0===t&&(t=!0),e.forEach((function(e){var n=e;(s=l.findListElement(l.list,"li","data-value",i?n:l.getValueByText(n)))&&(t?((0,v.removeClass)([s],E.cssClass.disabled),s.removeAttribute("aria-disabled")):((0,v.addClass)([s],E.cssClass.disabled),s.setAttribute("aria-disabled","true")))})),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&this.toolbarSettings.items.length>0){var n=!1;if(this.ulElement.childNodes.forEach((function(e){e.classList.contains("e-disabled")||(n=!0)})),!n)this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0}},t.prototype.selectItems=function(e,t,i){void 0===t&&(t=!0),t&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach((function(e){e.classList.remove("e-active"),e.removeAttribute("aria-selected"),(0,v.removeClass)([e],E.cssClass.selected)})),this.setSelection(e,t,!i),this.updateSelectedOptions();for(var s=[],l=0;l<e.length;l++)for(var n=this.list.querySelectorAll('[aria-selected="true"]'),a=0;a<n.length;a++)e[l]===this.getFormattedValue(n[a].getAttribute("data-value"))&&s.push(n[a]);this.triggerChange(s,null)},t.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},t.prototype.addItems=function(t,i){e.prototype.addItem.call(this,t,i),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new g.Query,this.fields)},t.prototype.removeItems=function(e,t){this.removeItem(e,t)},t.prototype.removeItem=function(e,t){var i=this,s=[],l=this.list.querySelectorAll("."+A.li);if(e){e=e instanceof Array?e:[e];var n=this.fields,a=void 0,o={},r=[];(0,v.extend)(r,[],this.jsonData);for(var h=[],u=[],p=0;p<r.length;p++){o[r[p]instanceof Object?r[p][n.value]:r[p].toString()]=p}for(var d=0;d<e.length;d++)if(a=e[d]instanceof Object?e[d][n.value]:e[d].toString(),Object.prototype.hasOwnProperty.call(o,a)){var c=o[a];s.push(l[c]),h.push(c),u.push(c)}h.sort((function(e,t){return t-e})).forEach((function(e){i.listData.splice(e,1),i.jsonData.splice(e,1)}));for(var m=u.length-1;m>=0;m--)this.updateLiCollection(u[m])}else t=t||0,s.push(l[t]),this.listData.splice(t,1),this.jsonData.splice(t,1),this.updateLiCollection(t);for(p=0;p<s.length;p++)this.ulElement.removeChild(s[p]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},t.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},t.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},t.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},t.prototype.moveTop=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(null,!1,t,!0)},t.prototype.moveBottom=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t,!1,!0)},t.prototype.moveTo=function(e,t,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),n=s?(0,v.getComponent)(s,i):this.getScopedListBox();this.moveData(this,n,!1,l,t)},t.prototype.moveAllTo=function(e,t){if(this.toolbarAction="moveAllTo",this.listData.length>0){var s=e?(0,v.getComponent)(e,i):this.getScopedListBox();this.moveAllData(this,s,!1,t)}},t.prototype.getDataList=function(){return this.jsonData},t.prototype.getSortedList=function(){var e,t;if(e=t=this.sortedData,this.fields.groupBy){e=[];for(var i=0;i<t.length;i++)t[i].isHeader||e.push(t[i])}return e},t.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},t.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},t.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach((function(t){if(!t.classList.contains(E.cssClass.disabled))if(i.selectionSettings.showCheckbox){var s=t.getElementsByClassName("e-check")[0];(!s&&e||s&&!e)&&(i.notify("updatelist",{li:t,module:"listbox"}),i.maximumSelectionLength>=i.list.querySelectorAll(".e-list-item span.e-check").length&&i.checkMaxSelection())}else e?t.classList.add(E.cssClass.selected):t.classList.remove(E.cssClass.selected)})),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var s=this.list.getElementsByTagName("li"),l=0;if(e){var n=function(){var e=a.getFormattedValue(s[l].getAttribute("data-value"));a.value.some((function(t){return t===e}))||a.value.push(a.getFormattedValue(s[l].getAttribute("data-value")))},a=this;for(l=0;l<s.length;l++)n()}else{var o=function(){var e=r.getFormattedValue(s[l].getAttribute("data-value"));r.value=r.value.filter((function(t){return t!==e}))},r=this;for(l=0;l<s.length;l++)o()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},t.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||document.querySelectorAll("ul").length>1||i!==s)for(var l=0,n=0,a=0;l<i;){if(this.value)for(;n<this.value.length;n++)e[l].getAttribute("data-value")===this.value[n]&&a++;!a&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&a&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,a=0,n=0}},t.prototype.wireEvents=function(){var e=(0,v.closest)(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;v.EventHandler.add(this.list,"click",this.clickHandler,this),v.EventHandler.add(t,"keydown",this.keyDownHandler,this),v.EventHandler.add(t,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&v.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&v.EventHandler.add(e,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},t.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&v.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},t.prototype.unwireEvents=function(){var e=(0,v.closest)(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;v.EventHandler.remove(this.list,"click",this.clickHandler),v.EventHandler.remove(t,"keydown",this.keyDownHandler),v.EventHandler.remove(t,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&v.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&v.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&v.EventHandler.remove(e,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},t.prototype.clickHandler=function(e){var t=(0,v.closest)(e.target,".e-list-item");(0,v.isNullOrUndefined)(t)||this.selectHandler(e)},t.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+A.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query;if(this.allowFiltering){var i=""===this.inputString?"contains":this.filterType,s=this.typeOfData(this.dataSource).typeof;if(null===s&&(s=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof g.DataManager||"string"!==s)&&"number"!==s){var l=this.fields.text?this.fields.text:"";t.where(l,i,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",i,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new g.Query);return t},t.prototype.setFiltering=function(){var e;if(this.initLoad||(0,v.isNullOrUndefined)(this.filterParent))return this.filterParent=this.createElement("span",{className:It.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:It.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=N.Input.createInput({element:this.filterInput,buttons:[It.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),(0,v.append)([e.container],this.filterParent),(0,v.prepend)([this.filterParent],this.list),(0,v.attributes)(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?(0,v.addClass)([this.list],"e-filter-list"):this.height.toString().indexOf("%")>0&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important"),e},t.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+It.clearIcon),this.clearFilterIconElem&&(v.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),v.EventHandler.add(this.filterInput,"input",this.onInput,this),v.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),v.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},t.prototype.selectHandler=function(e,t){var i,s=!0,l=(0,v.closest)(e.target,".e-list-item"),n=[l];if(l&&l.parentElement){if(i=[].slice.call(l.parentElement.children).indexOf(l),this.selectionSettings.showCheckbox?s=!l.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||e.metaKey||v.Browser.isDevice)&&this.isSelected(l)?(l.classList.remove(E.cssClass.selected),l.removeAttribute("aria-selected"),s=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||e.metaKey||v.Browser.isDevice)||(this.getSelectedItems().forEach((function(e){e.removeAttribute("aria-selected")})),(0,v.removeClass)(this.getSelectedItems(),E.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?n=[].slice.call(l.parentElement.children).slice(Math.min(i,this.prevSelIdx),Math.max(i,this.prevSelIdx)+1).filter((function(e){return e.classList.contains("e-list-item")})):this.prevSelIdx=[].slice.call(l.parentElement.children).indexOf(l),s?(this.selectionSettings.showCheckbox||(0,v.addClass)(n,E.cssClass.selected),n.forEach((function(e){e.setAttribute("aria-selected","true")})),this.list.setAttribute("aria-activedescendant",l.id)):n.forEach((function(e){e.setAttribute("aria-selected","false")})),t||!(this.maximumSelectionLength>(this.value&&this.value.length))&&s||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&s||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:l,e,module:"listbox"}),this.allowFiltering&&!t){var a=this.getFormattedValue(l.getAttribute("data-value"));if(s){var o=[];(0,v.extend)(o,this.value),o.push(a),this.value=o}else this.value=this.value.filter((function(e){return e!==a}));document.querySelectorAll("ul").length<2&&this.updateMainList()}this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.list&&this.checkMaxSelection()}},t.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},t.prototype.getDataByElems=function(e){for(var t=[],i=e.length,s=0;s<i;s++){var l=e[s].getAttribute("data-value"),n=this.getFormattedValue(l);t.push(this.getDataByValue(n))}return t},t.prototype.getDataByElements=function(e){var t,i=[],s=0;if(!(0,v.isNullOrUndefined)(this.listData)){var l=this.typeOfData(this.listData).typeof;if("string"===l||"number"===l||"boolean"===l)for(var n=0,a=this.listData;n<a.length;n++){for(var o=a[n],r=s,h=e.length;r<h;r++)if(t=this.getFormattedValue(e[r].getAttribute("data-value")),!(0,v.isNullOrUndefined)(o)&&o===t){s=r,i.push(o);break}if(e.length===i.length)break}else for(var u=0,p=this.listData;u<p.length;u++){for(o=p[u],r=s,h=e.length;r<h;r++)if(t=this.getFormattedValue(e[r].getAttribute("data-value")),!(0,v.isNullOrUndefined)(o)&&(0,v.getValue)(this.fields.value?this.fields.value:"value",o)===t){s=r,i.push(o);break}if(e.length===i.length)break}return i}return null},t.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox)for(var t=0,i=this.list.getElementsByClassName("e-list-item");t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))},t.prototype.toolbarClickHandler=function(e){var t=(0,v.closest)(e.target,"button");if(t){if(this.toolbarAction=t.getAttribute("data-value"),t.disabled)return;switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}}},t.prototype.moveUpDown=function(e,t,i,s,l){var n=this,a=this.getSelectedItems();if(i&&(a=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var o=this.getDataByElems(a),r={cancel:!1,items:o,eventName:this.toolbarAction};this.trigger("actionBegin",r),r.cancel||((e?a:a.reverse()).forEach((function(t){var i=Array.prototype.indexOf.call(n.ulElement.querySelectorAll(".e-list-item"),t),a=Array.prototype.indexOf.call(n.ulElement.children,t);s?((0,E.moveTo)(n.ulElement,n.ulElement,[a],0),n.changeData(a,0,i,t)):l?((0,E.moveTo)(n.ulElement,n.ulElement,[a],n.ulElement.querySelectorAll(".e-list-item").length),n.changeData(a,n.ulElement.querySelectorAll(".e-list-item").length,i,t)):((0,E.moveTo)(n.ulElement,n.ulElement,[a],e?a-1:a+2),n.changeData(a,e?a-1:a+1,e?i-1:i+1,t))})),this.trigger("actionComplete",{items:o,eventName:this.toolbarAction}),a[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},t.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},t.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},t.prototype.moveData=function(e,t,i,s,l){var n=[],a=[],o=[],r=[],h=[].slice.call(e.listData),u=[].slice.call(t.listData),p=[].slice.call(e.sortedData),d=[].slice.call(t.sortedData),c=[].slice.call(e.liCollections),m=[],f=[].slice.call(t.liCollections),g=[],y=[],C=e.getSelectedItems();s&&(C=s);var b="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate;if(e.value=[],C.length){this.removeSelected(e,C);var S,x=Array.prototype.slice.call(e.ulElement.children),I=Array.prototype.slice.call(e.ulElement.querySelectorAll(".e-list-item")),w=e.listData,O=e.sortedData,A=e.jsonData,D={};if(C.length>199)for(var k=0,N=e.listData;k<N.length;k++){var L=N[k];if(!(0,v.isNullOrUndefined)(L)){var B=e.getFormattedValue((0,v.getValue)(e.fields.value?e.fields.value:"value",L));D[B]=L}}C.forEach((function(t){if(C.length<200)S=e.getDataByElems([t])[0];else{var i=t.getAttribute("data-value"),s=e.getFormattedValue(i);S=D[s]}n.push(x.indexOf(t)),m.push(I.indexOf(t)),a.push(w.indexOf(S)),r.push(O.indexOf(S)),o.push(A.indexOf(S))})),"None"!==this.sortOrder?r.forEach((function(t){g.push(e.sortedData[t])})):o.forEach((function(t){g.push(e.jsonData[t])}));var T={cancel:!1,items:g,eventName:this.toolbarAction};if(e.trigger("actionBegin",T),T.cancel)return;var V=[];if(m.sort((function(e,t){return e-t})).reverse().forEach((function(e){V.push(c.splice(e,1)[0])})),e.liCollections=c,l){var P=f.splice(0,l);t.liCollections=P.concat(V.reverse()).concat(f)}else t.liCollections=f.concat(V.reverse());if(0===t.listData.length){var U=t.ulElement.childNodes[0];U&&t.ulElement.removeChild(U)}if(a.sort((function(e,t){return t-e})).forEach((function(e){h.splice(e,1)[0]})),r.sort((function(e,t){return t-e})).forEach((function(e){p.splice(e,1)[0]})),o.slice().reverse().forEach((function(t){y.push(e.jsonData.splice(t,1)[0])})),b)if(e.fields.groupBy){var H=e.renderItems(h,e.fields);e.updateListItems(H,e.ulElement)}else C.forEach((function(e){(0,v.detach)(e)}));else(0,E.moveTo)(e.ulElement,t.ulElement,n,l),e.trigger("actionComplete",{items:g,eventName:this.toolbarAction});t.mainList.childElementCount!==t.jsonData.length&&(t.mainList=t.ulElement);var F=[].slice.call(t.jsonData);d=[].slice.call(t.sortedData),this.selectNextList(C,m,a,e),i&&this.list.focus(),e.listData=h,e.sortedData=p,l=l||u.length;for(var W=g.length-1;W>=0;W--)u.splice(l,0,g[W]),F.splice(l,0,g[W]),d.splice(l,0,g[W]);if(t.listData=u,t.jsonData=F,t.sortedData=d,b){H=t.renderItems(u,t.fields);t.updateListItems(H,t.ulElement),t.setSelection(),e.trigger("actionComplete",{items:g,eventName:this.toolbarAction})}e.updateSelectedOptions(),0===e.listData.length&&e.l10nUpdate()}if(1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value"))),e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction){var q=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],M="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo";if(q)q.querySelector('[data-value="'+M+'"]').disabled=!0}},t.prototype.selectNextList=function(e,t,i,s){var l,n,a=s.ulElement.querySelectorAll(".e-list-item").length,o=-1;1===e.length&&a&&!s.selectionSettings.showCheckbox&&(n=a<=t[0]?a-1:t[0],l=s.ulElement.querySelectorAll(".e-list-item")[n],(o=s.getValidIndex(l,n,a===i[0]?38:40))>-1&&s.ulElement.querySelectorAll(".e-list-item")[o].classList.add(E.cssClass.selected))},t.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},t.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},t.prototype.moveAllData=function(e,t,i,s){var l=[].slice.call(t.listData),n=[].slice.call(t.jsonData),a="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate,o=[],r=[],h=[];this.removeSelected(e,e.getSelectedItems());var u=[].slice.call(e.listData),p={cancel:!1,items:u,eventName:this.toolbarAction};if(e.trigger("actionBegin",p),!p.cancel){if(0===t.listData.length){var d=t.ulElement.childNodes[0];d&&t.ulElement.removeChild(d)}e.listData.length>0&&(h=Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number));for(var c=e.ulElement.childNodes,m=e.ulElement.childElementCount,f=[],v=0;v<m;v++){var g=c[v];g.classList.contains("e-disabled")?(o.push(g),null!=this.sortOrder?r.push(e.sortedData[v]):r.push(e.listData[v])):f.push(v)}h=f,(0,E.moveTo)(e.ulElement,t.ulElement,h,s),e.trigger("actionComplete",{items:u,eventName:this.toolbarAction}),i&&this.list.focus(),s=s||l.length;for(v=0;v<h.length;v++)null!=this.sortOrder?l.splice(s+v,0,e.sortedData[h[v]]):l.splice(s+v,0,e.listData[h[v]]);for(v=0;v<h.length;v++)n.splice(s+v,0,e.jsonData[h[v]]);var y=[];o.length>0?(e.liCollections=o,y=[].slice.call(e.liCollections)):(y=[].slice.call(e.liCollections),e.liCollections=[]);var C=[].slice.call(t.liCollections);if(s){var b=C.splice(0,s);t.liCollections=b.concat(y).concat(C)}else t.liCollections=C.concat(y);e.value=[];var S=(l=(l=l.filter((function(e){return void 0!==e}))).filter((function(e){return!0!==e.isHeader}))).filter((function(e){return-1===t.jsonData.indexOf(e)}));for(v=0;v<S.length;v++)t.jsonData.splice(s+v,0,S[v]);if(t.listData=l,e.listData.length===e.jsonData.length)e.listData=e.sortedData=e.jsonData=r;else if(e.allowFiltering){var x=[];if(o.length>0){for(v=0;v<o.length;v++)x.push(e.getDataByValue(o[v].getAttribute("data-value")));e.listData=e.listData.filter((function(e){return!x.some((function(t){return e===t}))}))}for(v=0;v<e.listData.length;v++)for(var I=0;I<e.jsonData.length;I++)e.listData[v]===e.jsonData[I]&&e.jsonData.splice(I,1);o.length>0?(e.listData=x,e.sortedData=[]):e.listData=e.sortedData=[]}if(a){var w=t.renderItems(l,t.fields);t.updateListItems(w,t.ulElement)}else t.sortedData=l;if(e.updateSelectedOptions(),o.length>0)this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0;0===e.listData.length&&0===o.length&&e.l10nUpdate()}},t.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),n=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData),o=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),r=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),n.splice(i,0,n.splice(o,1)[0]),a.splice(t,0,a.splice(r,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=n,this.liCollections=h,this.sortedData=a},t.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach((function(t){e.push((0,v.closest)(t,".e-list-item"))})):e=[].slice.call(this.ulElement.getElementsByClassName(E.cssClass.selected)),e},t.prototype.getScopedListBox=function(){var e,t=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach((function(i){(0,v.getComponent)(i,t.getModuleName())&&(e=(0,v.getComponent)(i,t.getModuleName()))})),e},t.prototype.getGrabbedItems=function(e){for(var t=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(e.target.getAttribute("data-value"))){t=!0;break}if(t)for(i=0;i<this.value.length;i++)for(var s=this.list.querySelectorAll('[aria-selected="true"]'),l=0;l<s.length;l++)this.value[i]===this.getFormattedValue(s[l].getAttribute("data-value"))&&s[l].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},t.prototype.getDragArgs=function(e,t){var i=this.getGrabbedItems(e);return i.length?t&&i.push(e.target):i=[e.target],{elements:i,event:e.event,items:this.getDataByElems(i)}},t.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},t.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&(!this.allowFiltering||this.allowFiltering&&e.target!==this.filterInput)){if(e.target&&e.target.className.indexOf("e-edit-template")>-1)return;if(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length)this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey});else if(65===e.keyCode&&e.ctrlKey&&"Multiple"===this.selectionSettings.mode)this.selectAll();else if((38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey)this.moveUpDown(38===e.keyCode,!0);else if(!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey)37!==e.keyCode&&39!==e.keyCode&&"KeyA"!==e.code&&this.upDownKeyHandler(e);else{var t=this.tBListBox||this.getScopedListBox();39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0)}}else this.allowFiltering&&(40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e))},t.prototype.upDownKeyHandler=function(e){var t=this.ulElement,i=40===e.keyCode||36===e.keyCode?0:t.childElementCount-1,s=t.getElementsByClassName("e-focused")[0]||t.getElementsByClassName(E.cssClass.selected)[0];if(s){if(35!==e.keyCode&&36!==e.keyCode&&(i=Array.prototype.indexOf.call(t.children,s),40===e.keyCode?i++:i--,i<0||i>t.childElementCount-1))return;(0,v.removeClass)([s],"e-focused")}var l=t.children[i];if(l){if(-1===(i=this.getValidIndex(l,i,e.keyCode)))return void(0,v.addClass)([s],"e-focused");if(t.children[i].focus(),t.children[i].classList.add("e-focused"),e.ctrlKey&&(this.selectionSettings.showCheckbox||!e.shiftKey||36!==e.keyCode&&35!==e.keyCode)||this.selectHandler({target:t.children[i],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0),this.selectionSettings.showCheckbox&&e.ctrlKey&&e.shiftKey&&(36===e.keyCode||35===e.keyCode))for(var n=Array.prototype.indexOf.call(t.children,s),a="Home"===e.code?0:n,o="Home"===e.code?n:t.children.length-1,r=a;r<=o;r++){var h=t.children[r];this.notify("updatelist",{li:h,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},module:"listbox"})}}},t.prototype.KeyUp=function(e){var t=this;if(this.allowFiltering&&(e.ctrlKey&&65===e.keyCode||8===e.keyCode&&!this.filterInput.value))e.preventDefault();else{var i=String.fromCharCode(e.keyCode).match(/\w/);if((0,v.isNullOrUndefined)(i)||(this.isValidKey=!0),this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,i,l){s.cancel||(t.isFiltered=!0,t.remoteFilterAction=!0,t.preventDefActionFilter=s.preventDefaultAction,t.dataUpdater(e,i,l),t.preventDefActionFilter=!1)},event:e,cancel:!1};this.trigger("filtering",s,(function(e){t.isDataFetched=!1,e.cancel||""!==t.filterInput.value&&t.isFiltered||(t.preventDefActionFilter=!1,e.cancel||t.isCustomFiltering||e.preventDefaultAction||(t.inputString=t.filterInput.value,t.filteringAction(t.jsonData,new g.Query,t.fields),t.toolbarSettings.items.length>0&&t.updateToolBarState()),t.isFiltered||t.isCustomFiltering||e.preventDefaultAction||t.dataUpdater(t.jsonData,new g.Query,t.fields))}))}}},t.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},t.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},t.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],(0,v.isNullOrUndefined)(this.targetInputElement)?null:this.targetInputElement.value},t.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;if(this.targetElement()&&""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(s=this.renderItems(this.listData,i)),this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},t.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},t.prototype.resizeHandler=function(){!this.list||this.cssClass&&this.cssClass.indexOf("e-horizontal-listbox")>-1||this.list.getElementsByClassName("e-filter-parent").length>0&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},t.prototype.getValidIndex=function(e,t,i){var s=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(E.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===s.childElementCount?-1:(((e=s.childNodes[t]).classList.contains("e-disabled")||e.classList.contains(E.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},t.prototype.updateSelectedOptions=function(){var e=this,t=[],i=[];if((0,v.extend)(i,this.value),this.getSelectedItems().forEach((function(i){i.classList.contains("e-grabbed")||t.push(e.getFormattedValue(i.getAttribute("data-value")))})),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var s=0;s<t.length;s++)i.indexOf(t[s])>-1||i.push(t[s]);this.setProperties({value:i},!0)}else this.setProperties({value:t},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},t.prototype.clearSelection=function(e){var t,i=this;(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox)&&this.getSelectedItems().forEach((function(s){t=i.getFormattedValue(s.getAttribute("data-value")),e.indexOf(t)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.removeAttribute("aria-selected"))}))},t.prototype.setSelection=function(e,t,i,s){var l,n,a=this;void 0===e&&(e=this.value),void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===s&&(s=!0),e&&e.forEach((function(e){var o;"string"==typeof(o=i?a.getValueByText(e):e)?(o=o.split("\\").join("\\\\"),l=a.list.querySelector('[data-value="'+o.replace(/"/g,'\\"')+'"]')):l=a.list.querySelector('[data-value="'+o+'"]'),l&&(n=a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?l.getElementsByClassName("e-frame")[0].classList.contains("e-check"):l.classList.contains("e-selected"),(!t&&n||t&&!n&&l)&&(a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?(a.notify("updatelist",{li:l,module:"listbox"}),s&&l.focus()):t&&!l.classList.contains("e-disabled")?(l.classList.add(E.cssClass.selected),l.setAttribute("aria-selected","true"),s&&l.focus()):(l.classList.remove(E.cssClass.selected),l.removeAttribute("aria-selected"))))})),this.updateSelectTag()},t.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(!(0,v.isNullOrUndefined)(e)){if(e.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)t+="<option selected>"+this.value[i]+"</option>";e.innerHTML+=t;for(i=0,s=e.childNodes.length;i<s;i++)e.childNodes[i].setAttribute("value",this.value[i].toString())}this.checkSelectAll()}},t.prototype.checkDisabledState=function(e){return(0,v.isNullOrUndefined)(e.ulElement)?!(!(0,v.isNullOrUndefined)(this.dataSource)&&(0,v.isNullOrUndefined)(this.dataSource.length)):e.ulElement.querySelectorAll(".e-disabled").length>0?e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length:0===e.ulElement.querySelectorAll("."+E.cssClass.li).length},t.prototype.updateToolBarState=function(){var e=this;if(this.toolbarSettings.items.length){var t=this.getScopedListBox(),i=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0];this.toolbarSettings.items.forEach((function(s){var l=i.querySelector('[data-value="'+s+'"]');switch(s){case"moveAllTo":l.disabled=e.checkDisabledState(e);break;case"moveAllFrom":l.disabled=e.checkDisabledState(t);break;case"moveFrom":l.disabled=!t.value||!t.value.length;break;case"moveUp":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[0]));break;case"moveDown":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[e.ulElement.childElementCount-1]));break;default:l.disabled=!e.value||!e.value.length}}))}},t.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},t.prototype.showCheckbox=function(e){var t=0,i=this.list.lastElementChild.querySelectorAll("li"),s=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]){var l=new v.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=l.getConstant("selectAllText"),this.unSelectAllText=l.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]);t<s;t++)i[t].classList.contains("e-list-item")&&i[t].removeChild(i[t].getElementsByClassName("e-checkbox-wrapper")[0]),i[t].hasAttribute("aria-selected")&&i[t].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},t.prototype.isSelected=function(e){return!(0,v.isNullOrUndefined)(e)&&(e.classList.contains(E.cssClass.selected)||null!==e.querySelector(".e-check"))},t.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},t.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},t.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},t.prototype.getModuleName=function(){return"listbox"},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getLocaleName=function(){return"listbox"},t.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),(0,v.detach)(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),e.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},t.prototype.onPropertyChanged=function(t,i){var s=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,t,i),this.setUpdateInitial(["fields","query","dataSource"],t);for(var l=0,n=Object.keys(t);l<n.length;l++){switch(n[l]){case"cssClass":i.cssClass&&(0,v.removeClass)([s],i.cssClass.split(" ")),t.cssClass&&(0,v.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":(0,v.removeClass)(this.list.querySelectorAll("."+E.cssClass.selected),E.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":t.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&(0,v.getComponent)(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,(0,v.removeClass)([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&N.Input.setPlaceholder(t.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&((0,v.getComponent)(this.ulElement,"sortable").scope=t.scope),this.toolbarSettings.items.length&&(i.scope&&((0,v.getComponent)(document.querySelector(i.scope),this.getModuleName()).tBListBox=null),t.scope&&((0,v.getComponent)(document.querySelector(t.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var a=void 0,o=t.toolbarSettings.position,r=this.getToolElem();o&&((0,v.removeClass)([s],["e-right","e-left"]),s.classList.add("e-"+o.toLowerCase()),"Left"===o?s.insertBefore(r,this.list):s.appendChild(r)),t.toolbarSettings.items&&(i.toolbarSettings.items=(0,v.isNullOrUndefined)(i.toolbarSettings.items)?[]:i.toolbarSettings.items,i.toolbarSettings&&i.toolbarSettings.items.length&&((a=this.list.parentElement).parentElement.insertBefore(this.list,a),(0,v.detach)(a)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var h=t.selectionSettings.showSelectAll,u=t.selectionSettings.showCheckbox;if(!(0,v.isNullOrUndefined)(h)){if(this.showSelectAll=h,this.showSelectAll){var p=new v.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=p.getConstant("selectAllText"),this.unSelectAllText=p.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}(0,v.isNullOrUndefined)(u)||this.showCheckbox(u),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}}},bt([(0,v.Property)("")],t.prototype,"cssClass",void 0),bt([(0,v.Property)([])],t.prototype,"value",void 0),bt([(0,v.Property)("")],t.prototype,"height",void 0),bt([(0,v.Property)(!0)],t.prototype,"enabled",void 0),bt([(0,v.Property)(!1)],t.prototype,"enablePersistence",void 0),bt([(0,v.Property)(!1)],t.prototype,"allowDragAndDrop",void 0),bt([(0,v.Property)(1e3)],t.prototype,"maximumSelectionLength",void 0),bt([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),bt([(0,v.Property)("")],t.prototype,"scope",void 0),bt([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),bt([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),bt([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),bt([(0,v.Event)()],t.prototype,"beforeItemRender",void 0),bt([(0,v.Event)()],t.prototype,"filtering",void 0),bt([(0,v.Event)()],t.prototype,"select",void 0),bt([(0,v.Event)()],t.prototype,"change",void 0),bt([(0,v.Event)()],t.prototype,"beforeDrop",void 0),bt([(0,v.Event)()],t.prototype,"dragStart",void 0),bt([(0,v.Event)()],t.prototype,"drag",void 0),bt([(0,v.Event)()],t.prototype,"drop",void 0),bt([(0,v.Event)()],t.prototype,"dataBound",void 0),bt([(0,v.Property)(null)],t.prototype,"groupTemplate",void 0),bt([(0,v.Property)("Request failed")],t.prototype,"actionFailureTemplate",void 0),bt([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),bt([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),bt([(0,v.Complex)({},Et)],t.prototype,"toolbarSettings",void 0),bt([(0,v.Complex)({},St)],t.prototype,"selectionSettings",void 0),t=i=bt([v.NotifyPropertyChanges],t)}(D),It={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"},wt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ot=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},At=function(e){function t(t,i){return e.call(this,t,i)||this}return wt(t,e),t.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"minLength":this.minLength=e.minLength;break;case"suffixText":this.suffixText=e.suffixText;break;case"allowSpaces":this.allowSpaces=e.allowSpaces;break;case"mentionChar":this.mentionChar=e.mentionChar;break;case"showMentionChar":this.showMentionChar=e.showMentionChar;break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass)}}},t.prototype.updateCssClass=function(e,t){(0,v.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,v.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),this.setCssClass(e,[this.inputElement],t),this.popupObj&&this.setCssClass(e,[this.popupObj.element],t)},t.prototype.setCssClass=function(e,t,i){(0,v.isNullOrUndefined)(i)||""===i||(0,v.removeClass)(t,i.split(" ")),(0,v.isNullOrUndefined)(e)||""===e||(0,v.addClass)(t,e.split(" "))},t.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},t.prototype.preRender=function(){this.initializeData(),e.prototype.preRender.call(this)},t.prototype.render=function(){var e="string"==typeof this.target;this.inputElement=(0,v.isNullOrUndefined)(this.target)?this.element:this.checkAndUpdateInternalComponent(e?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),(0,v.addClass)([this.inputElement],["e-mention"]),(0,v.isNullOrUndefined)(this.target)&&(0,v.addClass)([this.inputElement],["e-editable-element"])),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},t.prototype.wireEvent=function(){v.EventHandler.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},t.prototype.unWireEvent=function(){v.EventHandler.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},t.prototype.bindCommonEvent=function(){v.Browser.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},t.prototype.hideSpinner=function(){this.hideWaitingSpinner()},t.prototype.hideWaitingSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||(0,k.hideSpinner)(this.spinnerElement),(0,v.isNullOrUndefined)(this.spinnerTemplate)||(0,v.isNullOrUndefined)(this.spinnerTemplateElement)||(0,v.detach)(this.spinnerTemplateElement)},t.prototype.checkAndUpdateInternalComponent=function(e){if(!this.isVue&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===e.nodeName&&e.classList.contains("e-rte-hidden")){var t=e.parentElement;if(t&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content")}return e&&e.parentElement&&e.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),e},t.prototype.showWaitingSpinner=function(){(0,v.isNullOrUndefined)(this.popupObj)||((0,v.isNullOrUndefined)(this.spinnerTemplate)&&(0,v.isNullOrUndefined)(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,k.showSpinner)(this.spinnerElement)),(0,v.isNullOrUndefined)(this.spinnerTemplate)||this.setSpinnerTemplate())},t.prototype.keyDownHandler=function(e){var t=!0;switch(e.keyCode){case 38:e.action=e.altKey?"hide":"up";break;case 40:e.action=e.altKey?"open":"down";break;case 33:e.action="pageUp";break;case 34:e.action="pageDown";break;case 36:e.action="home";break;case 35:e.action="end";break;case 9:e.action=e.shiftKey?"close":"tab";break;case 27:e.action="escape";break;case 32:e.action="space";break;case 13:e.action="enter";break;default:t=!1}t&&this.keyActionHandler(e)},t.prototype.keyActionHandler=function(e){var t="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action,i="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||i||"escape"===e.action||"space"===e.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!((0,v.isNullOrUndefined)(this.list)||!(0,v.isNullOrUndefined)(this.liCollections)&&t&&0===this.liCollections.length||this.isRequested))switch("escape"===e.action&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,e.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(e);break;case"tab":if(this.isPopupOpen){e.preventDefault();var s=this.list.querySelector("."+A.selected);s&&(this.isSelected=!0,this.setSelection(s,e)),this.isPopupOpen&&this.hidePopup(e)}break;case"enter":this.isPopupOpen&&(e.preventDefault(),this.popupObj&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,e,!1,!0));break;case"escape":this.isPopupOpen&&this.hidePopup(e)}},t.prototype.updateUpDownAction=function(e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var t,i=this.list.querySelector("."+A.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else if(!(0,v.isNullOrUndefined)(this.liCollections)){var s=this.list.querySelector("."+A.selected);if(!(0,v.isNullOrUndefined)(s)){var l=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l)}var n,a="down"===e.action?this.activeIndex+1:this.activeIndex-1;n="down"===e.action&&(0,v.isNullOrUndefined)(this.activeIndex)?0:this.liCollections.length-1,a=a<0?this.liCollections.length-1:a===this.liCollections.length?0:a;var o=(0,v.isNullOrUndefined)(this.activeIndex)?this.liCollections[n]:this.liCollections[a];(0,v.isNullOrUndefined)(o)||this.setSelection(o,e)}for(a=0;a<this.liCollections.length;a++)if(this.liCollections[a].classList.contains(A.focus)||this.liCollections[a].classList.contains(A.selected)){t=a;break}null!=t&&this.isDisabledElement(this.liCollections[t])&&this.updateUpDownAction(e),this.isPopupOpen&&e.preventDefault()}},t.prototype.isSelectFocusItem=function(e){return!(0,v.isNullOrUndefined)(e)},t.prototype.unBindCommonEvent=function(){v.Browser.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},t.prototype.onKeyUp=function(e){var t;if(this.isUpDownKey&&this.isPopupOpen&&229===e.keyCode)this.isUpDownKey=!1;else{this.isTyped="Enter"!==e.code&&"Space"!==e.code&&"ArrowDown"!==e.code&&"ArrowUp"!==e.code;var i=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image"));document.activeElement===this.inputElement||i||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),t=this.range.startContainer.textContent.split(""));var s=this.getTextRange(),l=this.getLastLetter(s),n=this.mentionChar.toString()+this.mentionChar.toString(),a=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),o=new RegExp("[a-zA-Z]","g");"Shift"!==e.key&&37!==e.keyCode&&39!==e.keyCode&&(this.beforePopupOpen&&this.isPopupOpen&&l===n?this.hidePopup():!s||!l||"Enter"===e.code||27===e.keyCode||l.match(a)&&l.match(a).length>1||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&this.range.startContainer.textContent.split("").length>0&&(1===t.length||-1===t[t.length-2].indexOf("")||1===this.range.startContainer.nodeType)?this.isPopupOpen&&this.allowSpaces&&s&&""!==s.trim()&&o.test(s)&&-1!==s.indexOf(this.mentionChar)&&!this.isMatchedText()&&s.length>1&&" "!==s.replace(/\u00A0/g," ").charAt(s.length-2)&&this.list&&this.list.querySelectorAll("ul").length>0&&"Enter"!==e.code?(this.queryString=s.substring(s.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):!this.isPopupOpen||this.allowSpaces&&l||"ArrowDown"===e.code||"ArrowUp"===e.code?"Backspace"!==e.key&&"Delete"!==e.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0):(l.includes(this.mentionChar)&&(this.queryString=l.replace(this.mentionChar,"")),this.mentionChar.charCodeAt(0)!==l.charCodeAt(0)||""===this.queryString||38===e.keyCode||40===e.keyCode||this.lineBreak?0===l.indexOf(this.mentionChar)&&!this.isPopupOpen&&8!==e.keyCode&&(!this.popupObj||(0,v.isNullOrUndefined)(this.target)&&!document.body.contains(this.popupObj.element)||!(0,v.isNullOrUndefined)(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(e),this.resetList(this.dataSource,this.fields),(0,v.isNullOrUndefined)(this.list)&&this.initValue(),!this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&s&&""!==s.trim()&&s.replace(" "," ").lastIndexOf(" ")<s.length-1&&38!==e.keyCode&&40!==e.keyCode&&8!==e.keyCode&&(this.mentionChar.charCodeAt(0)===l.charCodeAt(0)||this.liCollections&&this.liCollections.length>0)?(this.queryString=s.substring(s.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):""===this.queryString&&this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.mentionChar.charCodeAt(0)===l.charCodeAt(0)&&(this.searchLists(e),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(e),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(this.isContentEditable(this.inputElement)?this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==e.keyCode&&this.showPopup():this.showPopup())),this.isListResetted=!1))}},t.prototype.isMatchedText=function(){for(var e=!1,t=0;t<(this.liCollections&&this.liCollections.length);t++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[t].getAttribute("data-value").toLowerCase()&&(e=!0);return e},t.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},t.prototype.searchLists=function(t){var i=this;if(this.isDataFetched=!1,(0,v.isNullOrUndefined)(this.list)&&(e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"!==t.type&&(40===t.keyCode||38===t.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields);this.isSelected=!1,this.activeIndex=null;var s={preventDefaultAction:!1,text:this.queryString,updateData:function(e,t,l){s.cancel||(i.isFiltered=!0,i.filterAction(e,t,l))},cancel:!1};this.trigger("filtering",s,(function(e){e.cancel||i.isFiltered||e.preventDefaultAction||i.filterAction(i.dataSource,null,i.fields)}))},t.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(e,i,t),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},t.prototype.onActionComplete=function(t,i,s,l){if(e.prototype.onActionComplete.call(this,t,i,s),this.isActive){if(!(0,v.isNullOrUndefined)(t))(0,v.attributes)(t,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&this.cssClass.indexOf("e-slash-menu")>-1&&(t.id=this.inputElement.id+"_slash_menu_options");var n=this.fields.disabled?t.querySelector("."+A.li+":not(.e-disabled)"):t.querySelector("."+A.li);if(n){n.classList.add(A.selected),this.selectedLI=n;var a=this.getFormattedValue(n.getAttribute("data-value"));this.selectEventCallback(n,this.getDataByValue(a),a,!0)}this.beforePopupOpen&&this.isPopupOpen&&((0,v.isNullOrUndefined)(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())}},t.prototype.setDataIndex=function(){for(var e=0;this.liCollections&&e<this.liCollections.length;e++)this.liCollections[e].setAttribute("data-index",e.toString())},t.prototype.listOption=function(t,i){var s=this,l=e.prototype.listOption.call(this,t,i);if((0,v.isNullOrUndefined)(l.itemCreated))l.itemCreated=function(e){s.highlight&&(s.inputElement.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout((function(){d(e.item,s.queryString,s.ignoreCase,s.filterType)}),0):d(e.item,s.queryString,s.ignoreCase,s.filterType))};else{var n=l.itemCreated;l.itemCreated=function(e){s.highlight&&d(e.item,s.queryString,s.ignoreCase,s.filterType),n.apply(s,[e])}}return l},t.prototype.elementValue=function(){return this.isContentEditable(this.inputElement)?this.inputElement.textContent.replace(this.mentionChar,""):this.inputElement.value.replace(this.mentionChar,"")},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query,i=""!==this.queryString||(0,v.isNullOrUndefined)(this.elementValue())?this.filterType:"equal",s=""!==this.queryString||(0,v.isNullOrUndefined)(this.elementValue())?this.queryString:this.elementValue();if(this.isFiltered)return t;if(null!==this.queryString&&""!==this.queryString){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==l)&&"number"!==l){var n=(0,v.isNullOrUndefined)(this.fields.text)?"":this.fields.text;t.where(n,i,s,this.ignoreCase,this.ignoreAccent)}else t.where("",i,s,this.ignoreCase,this.ignoreAccent)}if(!(0,v.isNullOrUndefined)(this.suggestionCount)){if(25!==this.suggestionCount)for(var a=0;a<t.queries.length;a++)"onTake"===t.queries[a].fn&&t.queries.splice(a,1);t.take(this.suggestionCount)}return t},t.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++){this.ulElement.querySelector(".e-active")||(m(this.liCollections[e]),d(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType))}},t.prototype.getTextRange=function(){var e;if(this.isContentEditable(this.inputElement)){if(this.range){var t=this.range.startContainer;if(!(0,v.isNullOrUndefined)(t)){var i=t.textContent,s=this.range.startOffset;i&&s>=0&&(e=i.substring(0,s))}}}else{var l=this.inputElement;if(!(0,v.isNullOrUndefined)(l)){var n=l.selectionStart;l.value&&n>=0&&(e=l.value.substring(0,n))}}return e},t.prototype.getLastLetter=function(e){if((0,v.isNullOrUndefined)(e))return"";var t=(e.indexOf("​")>-1?e.replace(/\u200B/g,"").replace(/\u00A0/g," "):e.replace(/\u00A0/g," ")).split(/\s+/);return t[t.length-1].trim()},t.prototype.isContentEditable=function(e){return e&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName},t.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),(0,v.isNullOrUndefined)(this.list)&&this.initValue(),this.renderPopup(),(0,v.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.hidePopup=function(e){this.removeSelection(),this.closePopup(0,e)},t.prototype.closePopup=function(e,t){var i=this;if(this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1;var s={name:"FadeOut",duration:100,delay:e||0},l={popup:this.popupObj,cancel:!1,animation:s,event:t||null};this.trigger("closed",l,(function(e){!e.cancel&&i.popupObj&&(i.isPopupOpen?i.popupObj.hide(new v.Animation(e.animation)):i.destroyPopup())}))}},t.prototype.renderPopup=function(){var e=this;this.trigger("beforeOpen",{cancel:!1},(function(t){if(t.cancel)e.beforePopupOpen=!1;else{var i,s;if((0,v.isNullOrUndefined)(e.target)?i=e.createElement("div",{id:e.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=e.cssClass?e.cssClass:"")}):(i=e.element,null!=e.cssClass&&(0,v.addClass)([i],e.cssClass.split(" "))),e.isRTE&&e.cssClass&&e.cssClass.indexOf("e-slash-menu")>-1?i.id=e.inputElement.id+"_slash_menu_popup":(0,v.isNullOrUndefined)(e.target)||(i.id=e.inputElement.id+"_popup"),e.listHeight=(0,v.formatUnit)(e.popupHeight),!(0,v.isNullOrUndefined)(e.list.querySelector("li"))&&!e.initRemoteRender){var l=e.list.querySelector("."+A.focus);if(!(0,v.isNullOrUndefined)(l)){e.selectedLI=l;var n=e.getFormattedValue(l.getAttribute("data-value"));e.selectEventCallback(l,e.getDataByValue(n),n,!0)}}if((0,v.append)([e.list],i),e.inputElement.parentElement){var a=e.inputElement.parentElement.closest(".e-richtexteditor");a&&i.firstElementChild&&i.firstElementChild.childElementCount>0&&(i.firstElementChild.setAttribute("aria-owns",a.id),(0,v.addClass)([i],"e-rte-elements"))}e.popupObj&&document.body.contains(e.popupObj.element)&&(document.contains(i)||!(0,v.isNullOrUndefined)(e.target))||document.body.appendChild(i),i.style.visibility="hidden",e.setHeight(i);e.initializePopup(i,0,0),e.checkCollision(i),i.style.visibility="visible";var o=i.parentElement.offsetWidth-i.offsetWidth,r=i.offsetHeight;(0,v.addClass)([i],["e-mention","e-popup","e-popup-close"]),(0,v.isNullOrUndefined)(e.list)||(e.unWireListEvents(),e.wireListEvents()),e.selectedElementID=e.selectedLI?e.selectedLI.id:null,(0,v.attributes)(e.inputElement,{"aria-owns":e.inputElement.id+"_options","aria-activedescendant":e.selectedElementID}),null==e.selectedElementID&&e.inputElement.removeAttribute("aria-activedescendant");e.beforePopupOpen=!0;var h={popup:e.popupObj,cancel:!1,animation:{name:"FadeIn",duration:100}};e.trigger("opened",h,(function(t){if(t.cancel)e.beforePopupOpen=!1,e.destroyPopup();else{if(e.renderReactTemplates(),e.popupObj&&e.popupObj.show(new v.Animation(t.animation),1e3===e.zIndex?e.inputElement:null),(0,v.isNullOrUndefined)(e.getTriggerCharPosition()))return;s=e.getCoordinates(e.inputElement,e.getTriggerCharPosition()),e.isCollided?(e.collision.length>0&&e.collision.indexOf("right")>-1&&-1===e.collision.indexOf("bottom")?i.style.cssText="top: ".concat(s.top.toString(),"px;\n left: ").concat(o.toString(),"px;\nposition: absolute;\n display: block;"):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&-1===e.collision.indexOf("right")?(i.style.left=(0,v.formatUnit)(s.left),i.style.top=(0,v.formatUnit)(s.top-parseInt(r.toString(),10))):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&e.collision.indexOf("right")>-1?(i.style.left=(0,v.formatUnit)(o),i.style.top=(0,v.formatUnit)(s.top-parseInt(r.toString(),10))):(i.style.left=(0,v.formatUnit)(s.left),i.style.top=(0,v.formatUnit)(s.top-parseInt(e.popupHeight.toString(),10))),e.isCollided=!1,e.collision=[]):i.style.cssText="top: ".concat(s.top.toString(),"px;\n left: ").concat(s.left.toString(),"px;\nposition: absolute;\n display: block;"),i.style.width="100%"===e.popupWidth||(0,v.isNullOrUndefined)(e.popupWidth)?"auto":(0,v.formatUnit)(e.popupWidth),e.setHeight(i),i.style.zIndex=1e3===e.zIndex?(0,k.getZindexPartial)(i).toString():e.zIndex.toString()}}))}}))},t.prototype.setHeight=function(e){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",e.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):e.style.height="auto"},t.prototype.checkCollision=function(e){if(!v.Browser.isDevice||v.Browser.isDevice&&"mention"!==this.getModuleName()){var t=this.getCoordinates(this.inputElement,this.getTriggerCharPosition());this.collision=(0,k.isCollide)(e,null,t.left,t.top),this.collision.length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision()}},t.prototype.getTriggerCharPosition=function(){var e,t=this.getTextRange();if(null!=t){e=0;var i=t.lastIndexOf(this.mentionChar);i>=e&&(e=i)}return e||0},t.prototype.initializePopup=function(e,t,i){var s=this;this.popupObj=new k.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){s.destroyPopup()},open:function(){v.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0,s.setDataIndex()}})},t.prototype.setWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);e.indexOf("%")>-1&&(e=(this.inputElement.offsetWidth*parseFloat(e)/100).toString()+"px");return e},t.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),(0,v.isNullOrUndefined)(this.target)?(0,v.detach)(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},t.prototype.onDocumentClick=function(e){var t=e.target;!(0,v.isNullOrUndefined)(this.popupObj)&&(0,v.closest)(t,"#"+this.popupObj.element.id)||this.hidePopup(e)},t.prototype.getCoordinates=function(e,t){var i,s,l,n,a,o,r;if(this.isContentEditable(this.inputElement)){var h=this.getTriggerCharPosition();n=this.range,l=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(l.setStart(n.startContainer,h),l.setEnd(n.startContainer,h)):(l.setStart(n.startContainer,n.startOffset),l.setEnd(n.startContainer,n.endOffset)),this.isTyped=!1,l.collapse(!1),r=0===l.getBoundingClientRect().top?l.startContainer.getClientRects()[0]:l.getBoundingClientRect()}else i=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(i),o=getComputedStyle(e),i.style.position="absolute",i.style.visibility="hidden",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"].forEach((function(e){i.style[e]=o[e]})),i.textContent=e.value.substring(0,t),"INPUT"===this.inputElement.nodeName&&(i.textContent=i.textContent.replace(/\s/g," ")),(s=this.createElement("span")).textContent=e.value.substring(t)||".",i.appendChild(s),r=e.getBoundingClientRect();var u=r.top,p=r.left,d=document.querySelectorAll("iframe");if(d.length>0)for(var c=0;c<d.length;c++){var m=d[c];if(m.contentDocument&&m.contentDocument.contains(e)){var f=m.getBoundingClientRect();u+=f.top,p+=f.left}}var g=document.documentElement,y=(window.pageXOffset||g.scrollLeft)-(g.clientLeft||0),C=(window.pageYOffset||g.scrollTop)-(g.clientTop||0),b=0;if(!(0,v.isNullOrUndefined)(l)&&0===l.getBoundingClientRect().top)for(c=0;c<this.range.startContainer.childNodes.length;c++)if(this.range.startContainer.childNodes[c].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[c].textContent.trim())b+=this.range.startContainer.childNodes[c].getClientRects()[0].width;else if(""!==this.range.startContainer.childNodes[c].textContent){var S=document.createElement("span");S.innerHTML=this.range.startContainer.childNodes[c].nodeValue,document.body.appendChild(S);var E=S.offsetWidth;document.body.removeChild(S),b+=E}return this.isContentEditable(this.inputElement)?a=this.collision&&this.collision.length>0&&this.collision.indexOf("right")>-1&&-1===this.collision.indexOf("bottom")?{top:u+C+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:p+y+b}:{top:u+C+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:p+y+b}:(a={top:u+C+s.offsetTop+parseInt(o.borderTopWidth,10)+parseInt(o.fontSize,10)+3-e.scrollTop-(this.isCollided?10:0),left:p+y+s.offsetLeft+parseInt(o.borderLeftWidth,10)},document.body.removeChild(i)),a},t.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof g.DataManager?this.initRemoteRender=!0:this.updateValues()},t.prototype.updateValues=function(){var e=this.list.querySelector("."+A.focus);(0,v.isNullOrUndefined)(e)||this.setSelection(e,null)},t.prototype.renderList=function(){e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},t.prototype.wireListEvents=function(){v.EventHandler.add(this.list,this.keyEventName,this.onMouseClick,this),v.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),v.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},t.prototype.unWireListEvents=function(){v.EventHandler.remove(this.list,this.keyEventName,this.onMouseClick),v.EventHandler.remove(this.list,"mouseover",this.onMouseOver),v.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},t.prototype.onMouseClick=function(e){var t=e.target,i=(0,v.closest)(t,"."+A.li);if(this.isValidLI(i)&&!this.isDisabledElement(i)){this.isSelected=!0,this.setSelection(i,e);this.closePopup(100,e),this.inputElement.focus(),this.isRTE||e.preventDefault()}},t.prototype.updateSelectedItem=function(e,t,i,s){var l=this;this.removeSelection(),e.classList.add(A.selected),this.removeHover();var n=this.getFormattedValue(e.getAttribute("data-value")),a=this.getDataByValue(n);if(i||(0,v.isNullOrUndefined)(t)||"down"===t.action||"up"===t.action)this.selectEventCallback(e,a,n),s&&this.setSelectOptions(e,t);else{var o=this.detachChanges(a);this.isSelected=!0;var r={e:t,item:e,itemData:o,isInteracted:!!t,cancel:!1};this.trigger("select",r,(function(i){i.cancel?(e.classList.remove(A.selected),l.isSelected=!1,l.isSelectCancel=!0):(l.selectEventCallback(e,a,n),s&&l.setSelectOptions(e,t))}))}},t.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(A.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(A.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},t.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=(0,v.isNullOrUndefined)(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.isPopupOpen&&!(0,v.isNullOrUndefined)(this.selectedLI)&&this.setScrollPosition(t),(!t||38!==t.keyCode&&40!==t.keyCode)&&!(0,v.isNullOrUndefined)(t)&&this.setValue(t)},t.prototype.setScrollPosition=function(e){if((0,v.isNullOrUndefined)(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},t.prototype.scrollBottom=function(e){if(!(0,v.isNullOrUndefined)(this.selectedLI)){var t=this.list.offsetHeight,i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,s=this.list.scrollTop+i-t;s=e?s+2*parseInt(getComputedStyle(this.list).paddingTop,10):s;var l=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:(i>t||!(l>0&&this.list.offsetHeight>l))&&(this.list.scrollTop=s)}},t.prototype.scrollTop=function(){if(!(0,v.isNullOrUndefined)(this.selectedLI)){var e=(0,v.isNullOrUndefined)(this.fields.groupBy)||(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight);e=this.fields.groupBy&&e;var t=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:t>0&&this.list.offsetHeight>t||(this.list.scrollTop=this.selectedLI.offsetTop)}},t.prototype.selectEventCallback=function(e,t,i,s){this.previousItemData=(0,v.isNullOrUndefined)(this.itemData)?null:this.itemData,this.item=e,this.itemData=t;var l=this.list.querySelector("."+A.focus);l&&(0,v.removeClass)([l],A.focus),s&&(0,v.addClass)([e],A.selected),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(i)},t.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},t.prototype.setValue=function(e){return this.isReact?((0,v.isNullOrUndefined)(this.displayTemplate)?this.updateMentionValue(e):this.setDisplayTemplate(e),!0):((0,v.isNullOrUndefined)(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(e),!0)},t.prototype.updateMentionValue=function(e){var t,i,s,l,n=this.getItemData(),a="string"==typeof this.suffixText?this.suffixText:"",o=this.inputElement.ownerDocument.getSelection(),r=this.getTriggerCharPosition();if(this.isSelectCancel)this.isSelectCancel=!1;else if(null!==n.text&&(t=this.mentionVal(n.text)),this.isContentEditable(this.inputElement)){i=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(i=this.range.endOffset),l=this.range,s=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(s.setStart(l.startContainer,r),s.setEnd(l.startContainer,i)):""!==l.commonAncestorContainer.textContent.trim()&&!(0,v.isNullOrUndefined)(l.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(s.setStart(l.startContainer,l.startOffset-1),s.setEnd(l.startContainer,l.endOffset-1)):(s.setStart(l.startContainer,l.startOffset),s.setEnd(l.startContainer,l.endOffset)),this.isTyped=!1,s.deleteContents(),s.startContainer.parentElement.normalize();var h=this.createElement("div");h.innerHTML=t;for(var u=document.createDocumentFragment(),p=void 0,d=void 0;p=h.firstChild;)d=u.appendChild(p);if(s.insertNode(u),d&&(s=s.cloneRange(),this.isRTE?(s.setStart(d,0),s.setEnd(d,d.textContent.length)):s.setStartAfter(d),s.collapse(!0),o.removeAllRanges(),o.addRange(s)),this.isPopupOpen&&this.hidePopup(),!(0,v.isNullOrUndefined)(e.pointerType)&&"mouse"===e.pointerType){var c=new CustomEvent("content-changed",{detail:{click:!0}});this.inputElement.dispatchEvent(c)}this.onChangeEvent(e)}else{var m=this.inputElement,f=this.getTextRange().substring(r+this.mentionChar.length,this.getTextRange().length);t+=a,i=r+this.mentionChar.length,i+=f.length,m.value=m.value.substring(0,r)+t+m.value.substring(i,m.value.length),m.selectionStart=r+t.length,m.selectionEnd=r+t.length,this.isPopupOpen&&this.hidePopup(),this.onChangeEvent(e)}},t.prototype.mentionVal=function(e){var t=this.showMentionChar?this.mentionChar:"";return(0,v.isNullOrUndefined)(this.displayTemplate)||(0,v.isNullOrUndefined)(this.displayTempElement)||(e=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?v.Browser.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):'<span contenteditable="false" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):t+e},t.prototype.setDisplayTemplate=function(e){var t=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement&&((0,v.detach)(this.displayTempElement),this.displayTempElement=null)),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var i=(0,v.compile)(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);i&&i.length>0&&(0,v.append)(i,this.displayTempElement),this.isReact?this.renderTemplates((function(){t.updateMentionValue(e)})):this.renderTemplates()},t.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},t.prototype.setSpinnerTemplate=function(){var e=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement&&((0,v.detach)(this.spinnerTemplateElement),this.spinnerTemplateElement=null)),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var t=(0,v.compile)(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(t&&t.length>0)for(var i=0;i<t.length;i++)this.spinnerTemplateElement.appendChild(t[i]);this.isReact?this.renderTemplates((function(){e.popupObj.element.appendChild(e.spinnerTemplateElement)})):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},t.prototype.onChangeEvent=function(e){this.isSelected=!1;var t,i=this.detachMentionChanges(this.itemData);t="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData;var s={e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:t,isInteracted:!!e,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",s)},t.prototype.detachMentionChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},t.prototype.getItemData=function(){var e,t,i,s=this.fields;return e=this.itemData,(0,v.isNullOrUndefined)(e)||(t=(0,v.getValue)(s.value,e),i=(0,v.getValue)(s.text,e)),{value:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:t,text:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:i}},t.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+A.selected);e.length&&((0,v.removeClass)(e,A.selected),e[0].removeAttribute("aria-selected"))}},t.prototype.onMouseOver=function(e){var t=(0,v.closest)(e.target,"."+A.li);this.setHover(t)},t.prototype.setHover=function(e){this.isValidLI(e)&&!e.classList.contains(A.hover)&&(this.removeHover(),(0,v.addClass)([e],A.hover))},t.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+A.hover);e&&e.length&&(0,v.removeClass)(e,A.hover)}},t.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},t.prototype.onMouseLeave=function(){this.removeHover()},t.prototype.search=function(e,t,i){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var s=this.getTextRange(),l=this.getLastLetter(s);this.ignoreCase&&(e===l||e===l.toLowerCase())||!this.ignoreCase&&e===l?(this.resetList(this.dataSource,this.fields),(0,v.isNullOrUndefined)(this.list)?(this.renderList(),this.renderPopup()):this.showPopup(),this.popupObj.element.style.left=(0,v.formatUnit)(t),this.popupObj.element.style.top=(0,v.formatUnit)(i)):this.isPopupOpen&&this.hidePopup()},t.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e)if(e instanceof HTMLLIElement){for(var i=0;i<this.liCollections.length;i++)if(this.liCollections[i]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else{var s=JSON.parse(JSON.stringify(e))[this.fields.value];for(i=0;i<this.listData.length;i++)if(JSON.parse(JSON.stringify(this.listData[i]))[this.fields.value]===s){t=this.getIndexByValue(s);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData}}}}},t.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,e.prototype.destroy.call(this))},t.prototype.getLocaleName=function(){return"mention"},t.prototype.getNgDirective=function(){return"EJS-MENTION"},t.prototype.getModuleName=function(){return"mention"},Ot([(0,v.Property)(null)],t.prototype,"cssClass",void 0),Ot([(0,v.Property)("@")],t.prototype,"mentionChar",void 0),Ot([(0,v.Property)(!1)],t.prototype,"showMentionChar",void 0),Ot([(0,v.Property)(!1)],t.prototype,"allowSpaces",void 0),Ot([(0,v.Property)(null)],t.prototype,"suffixText",void 0),Ot([(0,v.Property)(25)],t.prototype,"suggestionCount",void 0),Ot([(0,v.Property)(0)],t.prototype,"minLength",void 0),Ot([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),Ot([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),Ot([(0,v.Property)(!1)],t.prototype,"highlight",void 0),Ot([(0,v.Property)()],t.prototype,"locale",void 0),Ot([(0,v.Property)("auto")],t.prototype,"popupWidth",void 0),Ot([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),Ot([(0,v.Property)(null)],t.prototype,"displayTemplate",void 0),Ot([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),Ot([(0,v.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),Ot([(0,v.Property)(null)],t.prototype,"spinnerTemplate",void 0),Ot([(0,v.Property)()],t.prototype,"target",void 0),Ot([(0,v.Property)([])],t.prototype,"dataSource",void 0),Ot([(0,v.Property)(null)],t.prototype,"query",void 0),Ot([(0,v.Property)("Contains")],t.prototype,"filterType",void 0),Ot([(0,v.Complex)({text:null,value:null,iconCss:null,groupBy:null},O)],t.prototype,"fields",void 0),Ot([(0,v.Event)()],t.prototype,"actionBegin",void 0),Ot([(0,v.Event)()],t.prototype,"actionComplete",void 0),Ot([(0,v.Event)()],t.prototype,"actionFailure",void 0),Ot([(0,v.Event)()],t.prototype,"change",void 0),Ot([(0,v.Event)()],t.prototype,"beforeOpen",void 0),Ot([(0,v.Event)()],t.prototype,"opened",void 0),Ot([(0,v.Event)()],t.prototype,"closed",void 0),Ot([(0,v.Event)()],t.prototype,"select",void 0),Ot([(0,v.Event)()],t.prototype,"filtering",void 0),Ot([(0,v.Event)()],t.prototype,"created",void 0),Ot([(0,v.Event)()],t.prototype,"destroyed",void 0),t=Ot([v.NotifyPropertyChanges],t)}(D)})(),p})()));
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionLists"),require("SyncfusionNotifications"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionNavigations")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionLists","SyncfusionNotifications","SyncfusionPopups","SyncfusionInputs","SyncfusionButtons","SyncfusionNavigations"],t):"object"==typeof exports?exports.SyncfusionDropdowns=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionLists"),require("SyncfusionNotifications"),require("SyncfusionPopups"),require("SyncfusionInputs"),require("SyncfusionButtons"),require("SyncfusionNavigations")):e.SyncfusionDropdowns=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionLists,e.SyncfusionNotifications,e.SyncfusionPopups,e.SyncfusionInputs,e.SyncfusionButtons,e.SyncfusionNavigations)}(self,((e,t,i,s,l,n,a,o)=>(()=>{"use strict";var r={766:t=>{t.exports=e},741:e=>{e.exports=a},74:e=>{e.exports=t},323:e=>{e.exports=n},90:e=>{e.exports=i},215:e=>{e.exports=o},344:e=>{e.exports=s},197:e=>{e.exports=l}},h={};function u(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return r[e](i,i.exports,u),i.exports}u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return(()=>{u.r(p),u.d(p,{AutoComplete:()=>Ne,CheckBoxSelection:()=>yt,ComboBox:()=>Ae,DropDownBase:()=>D,DropDownList:()=>P,DropDownTree:()=>Ee,FieldSettings:()=>O,Fields:()=>be,ListBox:()=>xt,Mention:()=>At,MultiSelect:()=>ht,Search:()=>o,SelectionSettings:()=>St,ToolbarSettings:()=>Et,TreeSettings:()=>Se,VirtualScroll:()=>S,createFloatLabel:()=>Pe,dropDownBaseClasses:()=>A,dropDownListClasses:()=>T,encodePlaceholder:()=>Me,escapeCharRegExp:()=>r,floatLabelBlur:()=>qe,floatLabelFocus:()=>We,highlightSearch:()=>d,incrementalSearch:()=>a,removeFloating:()=>He,resetIncrementalSearchValues:()=>h,revertHighlightSearch:()=>m,setPlaceHolder:()=>Fe,updateFloatLabelState:()=>Ue});var e="",t="",i="",s=[],l="e-active",n="";function a(a,o,r,h,u,p,d,c,m){var f;if(p&&""!==e?e===t&&(i=String.fromCharCode(a)):""!==i?(e=i+String.fromCharCode(a),i=""):e+=String.fromCharCode(a),c?(setTimeout((function(){i=""}),700),setTimeout((function(){e=""}),3e3)):setTimeout((function(){e=""}),1e3),e=h?e.toLowerCase():e,n!==u||t!==e||m){var v=o,g=e.length,y=void 0;S=r=r?r+1:0;s=[];do{S===v.length&&(S=-1),y=v[f=-1===S?0:S],(h?y.innerText.toLowerCase():y.innerText).substr(0,g)===e&&s.push(v[f]),S++}while(S!==r);if(t=e,n=u,c){for(var C=!1,b=0;b<s.length;b++)if(d&&s[b].textContent.toLowerCase()===d.toLowerCase()){f=b,C=!0;break}return d&&C&&(f+=1),s[f]?s[f]:s[0]}return s[0]}for(var S=0;S<s.length;S++){if(s[S].classList.contains(l)){f=S;break}if(d&&s[S].textContent.toLowerCase()===d.toLowerCase()){f=S;break}}return f+=1,c?s[f]&&s.length-1!==f?s[f]:s[s.length]:s[f]?s[f]:s[0]}function o(e,t,i,s,l,n,a,o){var h=t;s=null==s||s;var u={item:null,index:null};if(e&&e.length){var p=e.length,d=s?e.toLocaleLowerCase():e;d=r(d);for(var c=function(e,r){var h,c=r[e];if(t&&l){var m=c,f=n.text.split(".");l.filter((function(e){Array.prototype.slice.call(f).forEach((function(t){("object"===a&&!e.isHeader&&-1!==m.textContent.toString().indexOf(e[t])&&m.getAttribute("data-value")===e[n.value].toString()||"string"===a&&-1!==m.textContent.toString().indexOf(e))&&(h="object"===a?e[t]:e)}))}))}var v=l&&h?(s?h.toString().toLocaleLowerCase():h).replace(/^\s+|\s+$/g,""):(s?c.textContent.toLocaleLowerCase():c.textContent).replace(/^\s+|\s+$/g,"");if(o&&v&&d&&(v=v.normalize("NFD").replace(/[\u0300-\u036f]/g,""),d=d.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===i&&v===d||"StartsWith"===i&&v.substr(0,p)===d||"EndsWith"===i&&v.substr(v.length-d.length)===d||"Contains"===i&&new RegExp(d,"g").test(v))return u.item=c,u.index=e,{value:{item:c,index:e}}},m=0,f=h;m<f.length;m++){var v=c(m,f);if("object"==typeof v)return v.value}return u}return u}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function h(i){n===i&&(n="",t="",e="",s=[])}function d(e,t,i,s){if(/<[^>]*>/g.test(e.innerText)&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))),""!==t){var l=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c(e,new RegExp("StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")",l))}}function c(e,t){for(var i=0;e.childNodes&&i<e.childNodes.length;i++){if(3===e.childNodes[i].nodeType&&""!==e.childNodes[i].textContent.trim()){var s=e.childNodes[i].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[i].nodeValue="",e.innerHTML=e.innerHTML.trim()+s;break}c(e.childNodes[i],t)}}function m(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;i>=0;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}var f,v=u(766),g=u(74),y=function(){return y=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},y.apply(this,arguments)},C=function(e,t,i,s){return new(i||(i=Promise))((function(l,n){function a(e){try{r(s.next(e))}catch(e){n(e)}}function o(e){try{r(s.throw(e))}catch(e){n(e)}}function r(e){e.done?l(e.value):new i((function(t){t(e.value)})).then(a,o)}r((s=s.apply(e,t||[])).next())}))},b=function(e,t){var i,s,l,n,a={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(l=2&n[0]?s.return:n[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,n[1])).done)return l;switch(s=0,l&&(n=[2&n[0],l.value]),n[0]){case 0:case 1:l=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,s=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(l=a.trys,(l=l.length>0&&l[l.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!l||n[1]>l[0]&&n[1]<l[3])){a.label=n[1];break}if(6===n[0]&&a.label<l[1]){a.label=l[1],l=n;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(n);break}l[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],s=0}finally{i=l=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}},S=function(){function e(e){var t=this;this.sentinelInfo={up:{check:function(e,i){var s=e.top-t.containerElementRect.top;return i.entered=s>=0,s+t.parent.listItemHeight*t.parent.virtualItemCount/2>=0},axis:"Y"},down:{check:function(e,i){var s=e.bottom;return i.entered=e.bottom<=t.containerElementRect.bottom,s-t.parent.listItemHeight*t.parent.virtualItemCount/2<=t.parent.listItemHeight*t.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},e.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe((function(e){return t.scrollListener(e)}))},e.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),v.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new v.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),v.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},e.prototype.getModuleName=function(){return"VirtualScroll"},e.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},e.prototype.getPageQuery=function(e,t,i){return 0===i||this.parent.allowFiltering||"autocomplete"===this.component||(e=e.skip(t)),e},e.prototype.setGeneratedData=function(e,t){for(var i=0,s=this.parent.listData.length+this.parent.virtualItemStartIndex,l=this.parent.virtualItemStartIndex;l<s;l++){if(!this.parent.generatedDataObject[l]&&null!==t&&this.parent.listData.slice(i,i+1).length>0){var n=this.parent.listData.slice(i,i+1);n.length>0&&(this.parent.generatedDataObject[l]=n)}i++}},e.prototype.generateAndExecuteQueryAsync=function(e,t,i,s){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=!1);var l=this.parent.dataSource;if(!s)if((0,v.isNullOrUndefined)(this.parent.query))e=this.getPageQuery(e,t,i);else{var n=this.removeSkipAndTakeEvents(this.parent.query.clone());e=this.getPageQuery(n,t,i)}var a=this.parent.isCustomFilter;if("combobox"===this.component){var o=0;this.parent.dataSource instanceof g.DataManager?o=this.parent.dataSource.dataSource.json.length:this.parent.dataSource&&this.parent.dataSource.length>0&&(o=this.parent.dataSource.length),o>0&&(this.parent.isCustomFilter=o===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter)}this.parent.resetList(l,this.parent.fields,e),this.parent.isCustomFilter=a},e.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter((function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn})),e},e.prototype.setCurrentViewDataAsync=function(e){var t=[],i=!1,s=!0;(0,v.isNullOrUndefined)(this.component)&&(this.component=e.component);var l=this.parent.viewPortInfo.endIndex;if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()){if(this.parent.viewPortInfo.startIndex<this.parent.value.length){if(l=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex){if(this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount)(h=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h),a=(a=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof g.DataManager&&this.parent.appendUncheckList,s=!1;else(h=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h);s=!1}else if(0!==this.parent.viewPortInfo.startIndex){this.parent.updateVirtualReOrderList(!0),(h=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h),s=!1}if(0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length)a=(a=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof g.DataManager&&this.parent.appendUncheckList}else{var n=this.parent.list.querySelectorAll(".e-reorder")[0];this.parent.list.querySelector(".e-virtual-ddl-content")&&n&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(n);var a=this.parent.getForQuery(this.parent.value).clone(),o=this.parent.viewPortInfo.startIndex-this.parent.value.length>=0?this.parent.viewPortInfo.startIndex-this.parent.value.length:0;a=a.skip(o),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),s=!1}this.parent.totalItemsCount()}if(s)for(var r=this.parent.viewPortInfo.startIndex;r<l;r++){var h,u=r;if("multiselect"===this.component&&"CheckBox"===this.parent.mode)(h=this.parent.list.querySelector(".e-list-parent.e-reorder"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(h);var p=this.parent.generatedDataObject[u];if("multiselect"===this.component&&this.parent.hideSelectedItem){if(p){var d=(0,v.getValue)(this.parent.fields.value,p[0]);if(this.parent.value&&null!==d&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.value.indexOf(d)<0){a=this.parent.getForQuery(this.parent.value).clone();a=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?a.skip(this.parent.totalItemCount-this.parent.itemCount):a.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),i=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&t.push(p[0])}if(u===l-1&&t.length!==this.parent.itemCount&&this.parent.hideSelectedItem){a=this.parent.value&&this.parent.value.length>0?this.parent.getForQuery(this.parent.value).clone():new g.Query;a=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?a.skip(this.parent.totalItemCount-this.parent.itemCount):a.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,a),i=!0}}else p&&t.push(p[0]);this.parent.setCurrentView=!1}if(!i&&s){"multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&t.splice(0,0,this.parent.virtualCustomData);var c=[];"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&this.parent.virtualCustomSelectData.length>0&&(c=t.concat(this.parent.virtualCustomSelectData),t=c),this.parent.renderItems(t,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode)}"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof g.DataManager)||this.parent.dataSource instanceof g.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;var m=this.parent.list.getElementsByClassName("e-virtual-ddl")[0];if(m)m.style=this.parent.GetVirtualTrackHeight();else if(!m&&this.parent.skeletonCount>0&&this.parent.popupWrapper){var f=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()});this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(f)}this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item");var y=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];if(y&&(y.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!(0,v.isNullOrUndefined)(this.parent.currentFocuedListElement)){var C=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value"));this.parent.addListFocus(C),this.parent.isScrollChanged=!1}},e.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var i=!1,s=0,l=0,n=this.parent.viewPortInfo.endIndex;if(!t&&0!==n)for(var a=this.parent.viewPortInfo.startIndex;a<=n;a++)a in this.parent.generatedDataObject||(i?l=a===n?a:a+1:(i=!0,s=l=a));!i||this.parent.totalItemCount===s&&this.parent.totalItemCount===l||(this.parent.virtualItemStartIndex=s,this.parent.virtualItemEndIndex=l,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,s,l),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&this.parent.value.length>0&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),(!(this.parent.dataSource instanceof g.DataManager)||this.parent.dataSource instanceof g.DataManager&&!this.parent.isRequesting)&&this.setCurrentViewDataAsync()},e.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new g.Query,e)},e.prototype.virtualScrollRefreshAsync=function(){return C(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!(0,v.isNullOrUndefined)(this.parent.filterInput)&&!(0,v.isNullOrUndefined)(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,(this.parent.allowFiltering||"autocomplete"===this.component)&&((0,v.isNullOrUndefined)(this.parent.typedString)||"combobox"===this.component&&!(0,v.isNullOrUndefined)(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof g.DataManager)||this.parent.dataSource instanceof g.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof g.DataManager&&(!(this.parent.dataSource instanceof g.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}}))}))},e.prototype.scrollListener=function(e){var t=this;if(!this.parent.isPreventScrollAction&&!this.parent.isVirtualTrackHeight){this.parent.preventSetCurrentData=!1;var i=e.sentinel,s=this.parent.previousStartIndex;this.parent.viewPortInfo=this.getInfoFromView(e.direction,i,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===s||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=y({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout((function(){t.parent.pageCount=t.parent.getPageCount(),t.virtualScrollRefreshAsync().then((function(){t.parent.popupObj&&(t.parent.list=t.parent.popupObj.element.querySelector(".e-content")||(0,v.select)(".e-content"),t.parent.updateSelectionList(),t.parent.liCollections=t.parent.getItems()),t.parent.isKeyBoardAction=!1,t.parent.isVirtualScrolling=!1,t.parent.isPreventKeyAction=!1}))}),5)),this.parent.previousInfo=this.parent.viewPortInfo}},e.prototype.getInfoFromView=function(e,t,i,s){var l={direction:e,sentinelInfo:t,offsets:i,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},n=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,a=this.parent.listItemHeight,o=i.top/a,r=n/a,h=o+r,u=this.parent.virtualItemCount/4,p=this.parent.totalItemCount;if("down"===l.direction){var d=Math.round(h)-Math.round(u);if((0,v.isNullOrUndefined)(l.startIndex)||h>l.startIndex+Math.round(this.parent.virtualItemCount/2+u)&&l.endIndex!==p){l.startIndex=d>=0?Math.round(d):0,l.startIndex=l.startIndex>o?Math.floor(o):l.startIndex;var c=l.startIndex+this.parent.virtualItemCount;l.startIndex=c<h?Math.ceil(h)-this.parent.virtualItemCount:l.startIndex,l.endIndex=c<p?c:p,l.startIndex=c>=p?l.endIndex-this.parent.virtualItemCount>0?l.endIndex-this.parent.virtualItemCount:0:l.startIndex,l.currentPageNumber=Math.ceil(l.endIndex/this.parent.virtualItemCount)}}else if("up"===l.direction){if(l.startIndex&&l.endIndex||Math.ceil(o)>this.parent.previousStartIndex)if(o<Math.round((l.startIndex*a+u*a)/a)||Math.ceil(o)>this.parent.previousStartIndex){var m=u>r?u:r+r/4;c=Math.round(o+m);l.endIndex=c<p?c:p;d=l.endIndex-this.parent.virtualItemCount;l.startIndex=d>0?d:0,l.endIndex=d<0?this.parent.virtualItemCount:l.endIndex,l.currentPageNumber=Math.ceil(l.startIndex/this.parent.virtualItemCount)}}return s?this.parent.scrollPreStartIndex=l.startIndex:(this.parent.previousStartIndex=l.startIndex,this.parent.startIndex=l.startIndex,this.parent.previousEndIndex=l.endIndex),l},e.prototype.virtualScrollHandler=function(e){var t=this,i="chrome"===v.Browser.info.name?200:100,s=0,l=(0,v.debounce)(e,i),n=(0,v.debounce)(e,50);return function(e){var i=e.target.scrollTop,a=e.target.scrollLeft,o=s<i&&!t.parent.isUpwardScrolling?"down":"up";s=i;var r=t.sentinelInfo[o],h=t.parent.scrollPreStartIndex,u={top:i,left:a};t.parent.list&&t.parent.list.querySelectorAll(".e-virtual-list").length>0&&(t.getInfoFromView(o,r,u,!0),t.parent.scrollPreStartIndex===h||t.parent.isPreventScrollAction||(t.parent.isScrollActionTriggered=!0,t.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+i+"px)"));var p=l;"X"===r.axis&&(p=n),p({direction:o,sentinel:r,offset:{top:i,left:a},focusElement:document.activeElement})}},e.prototype.destroy=function(){this.removeEventListener()},e}(),E=u(90),x=u(344),I=(f=function(e,t){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},f(e,t)},function(e,t){function i(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),w=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),w([(0,v.Property)()],t.prototype,"text",void 0),w([(0,v.Property)()],t.prototype,"value",void 0),w([(0,v.Property)()],t.prototype,"iconCss",void 0),w([(0,v.Property)()],t.prototype,"groupBy",void 0),w([(0,v.Property)()],t.prototype,"htmlAttributes",void 0),w([(0,v.Property)()],t.prototype,"disabled",void 0),t}(v.ChildProperty),A={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},D=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isPreventChange=!1,s.isDynamicDataChange=!1,s.addedNewItem=!1,s.isAddNewItemTemplate=!1,s.isRequesting=!1,s.isVirtualizationEnabled=!1,s.isCustomDataUpdated=!1,s.isAllowFiltering=!1,s.virtualizedItemsCount=0,s.isCheckBoxSelection=!1,s.totalItemCount=0,s.dataCount=0,s.remoteDataCount=-1,s.isRemoteDataUpdated=!1,s.isIncrementalRequest=!1,s.itemCount=30,s.virtualListHeight=0,s.isVirtualScrolling=!1,s.isPreventScrollAction=!1,s.scrollPreStartIndex=0,s.isScrollActionTriggered=!1,s.previousStartIndex=0,s.isMouseScrollAction=!1,s.isKeyBoardAction=!1,s.isScrollChanged=!1,s.isUpwardScrolling=!1,s.startIndex=0,s.currentPageNumber=0,s.pageCount=0,s.isPreventKeyAction=!1,s.generatedDataObject={},s.skeletonCount=32,s.isVirtualTrackHeight=!1,s.virtualSelectAll=!1,s.incrementalQueryString="",s.incrementalEndIndex=0,s.incrementalStartIndex=0,s.incrementalPreQueryString="",s.isObjectCustomValue=!1,s.appendUncheckList=!1,s.getInitialData=!1,s.preventPopupOpen=!0,s.virtualSelectAllState=!1,s.CurrentEvent=null,s.isDynamicData=!1,s.isPrimitiveData=!1,s.isCustomFiltering=!1,s.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},s}return I(t,e),t.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object;s[e]=t[e],l[e]=i[e];var n=new Object;return n.newProperty=s,n.oldProperty=l,n},t.prototype.getValueByText=function(e,t,i){var s=null;return(0,v.isNullOrUndefined)(this.listData)||(s=t?this.checkValueCase(e,!0,i):this.checkValueCase(e,!1,i)),s},t.prototype.checkValueCase=function(e,t,i,s){var l=this,n=null;if(s&&(n=e),!(0,v.isNullOrUndefined)(this.listData)){var a=this.listData,o=this.fields,r=this.typeOfData(a).typeof;if("string"===r||"number"===r||"boolean"===r)for(var h=0,u=a;h<u.length;h++){var p=u[h];(0,v.isNullOrUndefined)(p)||(i?n=this.checkingAccent(String(p),e,t):t?this.checkIgnoreCase(String(p),e)&&(n=this.getItemValue(String(p),e,t)):this.checkNonIgnoreCase(String(p),e)&&(n=this.getItemValue(String(p),e,t,s)))}else if(t)a.filter((function(t){var i=(0,v.getValue)(o.value,t);!(0,v.isNullOrUndefined)(i)&&l.checkIgnoreCase((0,v.getValue)(o.text,t).toString(),e)&&(n=(0,v.getValue)(o.value,t))}));else if(s){var d=null;d=n,a.filter((function(e){var t=(0,v.getValue)(o.value,e);(0,v.isNullOrUndefined)(t)||(0,v.isNullOrUndefined)(n)||t.toString()!==d.toString()||(n=(0,v.getValue)(o.text,e))}))}else a.filter((function(t){l.checkNonIgnoreCase((0,v.getValue)(o.text,t),e)&&(n=(0,v.getValue)(o.value,t))}))}return n},t.prototype.checkingAccent=function(e,t,i){var s=g.DataUtil.ignoreDiacritics(String(e)),l=g.DataUtil.ignoreDiacritics(t.toString()),n=null;return i?this.checkIgnoreCase(s,l)&&(n=this.getItemValue(String(e),t,i)):this.checkNonIgnoreCase(String(e),t)&&(n=this.getItemValue(String(e),t,i)),n},t.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},t.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},t.prototype.getItemValue=function(e,t,i,s){var l=this.listData,n=this.typeOfData(l).typeof;return s?e.toString():i?"string"===n?String(e):this.getFormattedValue(String(e)):"string"===n?t:this.getFormattedValue(t)},t.prototype.templateCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!(0,v.selectAll)(e,document).length}catch(e){t=!1}return t},t.prototype.l10nUpdate=function(e){var t="listbox"===this.getModuleName()?this.ulElement:this.list;if(!(0,v.isNullOrUndefined)(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=void 0,l=e?this.actionFailureTemplateId:this.noRecordsTemplateId;t.innerHTML="";var n=this.templateCompiler(i);s="function"!=typeof i&&n?(0,v.compile)((0,v.select)(i,document).innerHTML.trim()):(0,v.compile)(i);var a=e?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof i?s({},this,a,l,this.isStringTemplate,null):s({},this,a,l,this.isStringTemplate,null,t))&&o.length>0)for(var r=0;r<o.length;r++){if("listbox"===this.getModuleName()&&"noRecordsTemplate"===a)if("#text"===o[r].nodeName)(u=this.createElement("li")).textContent=o[r].textContent,u.classList.add("e-list-nrt"),u.setAttribute("role","option"),t.appendChild(u);else o[r].classList.add("e-list-nr-template"),t.appendChild(o[r]);else(o[r]instanceof HTMLElement||o[r]instanceof Text&&""!==o[r].textContent)&&t.appendChild(o[r])}this.renderReactTemplates()}else{var h=new v.L10n(this.getLocaleName(),{},this.locale);""!==h.getConstant("actionFailureTemplate")||""!==h.getConstant("noRecordsTemplate")?this.l10n=h:this.l10n=new v.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},this.locale);var u,p=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName())(u=this.createElement("li")).textContent=p,t.appendChild(u),u.classList.add("e-list-nrt"),u.setAttribute("role","option");else(0,v.isNullOrUndefined)(t)||(t.innerHTML=p)}},t.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},t.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},t.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul")},t.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},t.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount;this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount;var t=!0;if("autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof g.DataManager&&!(this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),!this.list.classList.contains(A.noData)){if(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl").length>0)this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0&&this.list.querySelector(".e-dropdownbase")){var i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.querySelector(".e-dropdownbase").appendChild(i)}this.list.getElementsByClassName("e-virtual-ddl-content").length>0&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},t.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},t.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,t="height: "+((e=this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?t:"height: 0px;"},t.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},t.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||e)&&this.isVirtualizationEnabled)for(var l=e?t:this.skeletonCount,n=0;n<l;n++){var a=this.createElement("li",{className:A.virtualList,styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px");var o=new x.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"});o.appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(a,i.firstChild.children[0])}},t.prototype.getLocaleName=function(){return"drop-down-base"},t.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},t.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var t=void 0;if(t=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&this.properties.value.length>0?this.typeOfData(this.properties.value):this.typeOfData(this.listData),"number"==typeof(0,v.getValue)(this.fields.value?this.fields.value:"value",t.item)||"number"===t.typeof)return parseFloat(e);if("boolean"==typeof(0,v.getValue)(this.fields.value?this.fields.value:"value",t.item)||"boolean"===t.typeof)return"true"===e||""+e=="true"}return e},t.prototype.setEnableRtl=function(){(0,v.isNullOrUndefined)(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?(0,v.addClass)(this.enableRtlElements,A.rtl):(0,v.removeClass)(this.enableRtlElements,A.rtl))},t.prototype.initialize=function(e){if(this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var t=E.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(t,this.fields)}else if("SELECT"===this.element.tagName){(this.dataSource instanceof Array?this.dataSource.length>0:!(0,v.isNullOrUndefined)(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect()}else this.setListData(this.dataSource,this.fields,this.query,e)},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.updateDataAttribute=function(e){for(var t=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],i={},s=0;s<this.element.attributes.length;s++)-1!==t.indexOf(this.element.attributes[s].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[s].name||(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));(0,v.extend)(i,e,i),this.setProperties({htmlAttributes:i},!0)},t.prototype.renderItemsBySelect=function(){var e,t=this.element,i=t.querySelectorAll("select>optgroup"),s="multiselect"===this.getModuleName()&&this.isGroupChecking&&i.length>0;e=s?{value:"value",text:"text",groupBy:"categeory"}:e={value:"value",text:"text"};var l=[],n=t.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,e),i.length){for(var a=0;a<i.length;a++){var o=i[a],r={};r[e.text]=o.label,r.isHeader=!0;var h=o.querySelectorAll("option");s?this.getJSONfromOption(l,h,e,o.label):(l.push(r),this.getJSONfromOption(l,h,e))}t.querySelectorAll("select>option")}this.updateFields(e.text,e.value,s?e.groupBy:this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,e)},t.prototype.updateFields=function(e,t,i,s,l,n){var a={fields:{text:e,value:t,groupBy:(0,v.isNullOrUndefined)(i)?this.fields&&this.fields.groupBy:i,htmlAttributes:(0,v.isNullOrUndefined)(s)?this.fields&&this.fields.htmlAttributes:s,iconCss:(0,v.isNullOrUndefined)(l)?this.fields&&this.fields.iconCss:l,disabled:(0,v.isNullOrUndefined)(n)?this.fields&&this.fields.disabled:n}};this.setProperties(a,!0)},t.prototype.getJSONfromOption=function(e,t,i,s){void 0===s&&(s=null);for(var l=0,n=t;l<n.length;l++){var a=n[l],o={};o[i.text]=a.innerText,o[i.value]=(0,v.isNullOrUndefined)(a.getAttribute(i.value))?a.innerText:a.getAttribute(i.value),(0,v.isNullOrUndefined)(s)||(o[i.groupBy]=s),e.push(o)}},t.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},t.prototype.setListData=function(e,t,i,s){var l,n=this;t=t||this.fields,this.isActive=!0;var a={cancel:!1,data:e,query:i};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",a,(function(i){if(!i.cancel)if(n.isRequesting=!0,n.showSpinner(),e instanceof g.DataManager){n.isRequested=!0;var a=!1;if(n.isDataFetched)return void n.emptyDataRequest(t);i.data.executeQuery(n.getQuery(i.query)).then((function(e){n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange;var s=!0;if(!n.virtualSelectAll){for(var o=n.getQuery(i.query),r=0;r<o.queries.length;r++)"onWhere"===o.queries[r].fn&&(a=!0);if(n.isVirtualizationEnabled&&0!==e.count&&e.count<2*n.itemCount){if(o)for(r=0;r<o.queries.length;r++)"onTake"===o.queries[r].fn&&(o.queries[r].e.nos=e.count),"multiselect"!==n.getModuleName()||"or"!==o.queries[r].e.condition&&"equal"!==o.queries[r].e.operator||n.isCustomFiltering||(s=!1)}else if(n.isVirtualTrackHeight=!1,o)for(r=0;r<o.queries.length;r++)"multiselect"===n.getModuleName()&&(o.queries[r].e&&"or"===o.queries[r].e.condition||o.queries[r].e&&"equal"===o.queries[r].e.operator)&&(s=!1)}s&&(n.dataCount=n.totalItemCount=e.count),n.trigger("actionComplete",e,(function(e){if(!e.cancel){n.isRequesting=!1,n.isCustomFiltering=!1;var i=e.result;if(n.isIncrementalRequest)return void(l=n.renderItems(i,t));if((!n.isVirtualizationEnabled&&0===i.length||n.isVirtualizationEnabled&&0===i.length&&!a)&&(n.isDataFetched=!0),a||(n.remoteDataCount=e.count),n.dataCount=n.virtualSelectAll?n.dataCount:e.count,n.totalItemCount=n.virtualSelectAll?n.totalItemCount:e.count,l=n.renderItems(i,t),n.appendUncheckList=!1,n.onActionComplete(l,i,e),n.groupTemplate&&n.renderGroupTemplate(l),n.isRequested=!1,n.bindChildItems(i,l,t,e),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);n.isVirtualizationEnabled&&n.setCurrentView&&n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),null!=n.keyboardEvent&&n.handleVirtualKeyboardActions(n.keyboardEvent,n.pageCount),n.isVirtualizationEnabled&&(n.getFilteringSkeletonCount(),n.updatePopupPosition()),n.virtualSelectAll&&n.virtualSelectAllData&&(n.virtualSelectionAll(n.virtualSelectAllState,n.liCollections,n.CurrentEvent),n.virtualSelectAllState=!1,n.CurrentEvent=null,n.virtualSelectAll=!1)}}))})).catch((function(e){n.isRequested=!1,n.isRequesting=!1,n.onActionFailure(e),n.hideSpinner()}))}else{n.isRequesting=!1;var o=!0,r=void 0;if(n.isVirtualizationEnabled&&!n.virtualGroupDataSource&&n.fields.groupBy){var h=new g.DataManager(n.dataSource).executeLocal((new g.Query).group(n.fields.groupBy));n.virtualGroupDataSource=h.records}var u=n.isVirtualizationEnabled&&n.virtualGroupDataSource&&!n.isCustomDataUpdated?new g.DataManager(n.virtualGroupDataSource):new g.DataManager(i.data);if(r=n.getQuery(i.query).executeLocal(u),!n.virtualSelectAll){var p=n.getQuery(i.query);if(n.isVirtualizationEnabled&&0!==r.count&&r.count<2*n.itemCount){if(p){for(var d=0;d<p.queries.length;d++)"onTake"===p.queries[d].fn&&(p.queries[d].e.nos=r.count,r=p.executeLocal(u)),"multiselect"!==n.getModuleName()||"or"!==p.queries[d].e.condition&&"equal"!==p.queries[d].e.operator||n.isCustomFiltering||(o=!1);o&&(r=p.executeLocal(u),n.isVirtualTrackHeight=!(n.dataSource instanceof g.DataManager||n.isCustomDataUpdated))}}else if(n.isVirtualTrackHeight=!1,p)for(d=0;d<p.queries.length;d++)"multiselect"===n.getModuleName()&&(p.queries[d].e&&"or"===p.queries[d].e.condition||p.queries[d].e&&"equal"===p.queries[d].e.operator)&&(o=!1)}!o||n.dataSource instanceof g.DataManager||n.isCustomDataUpdated||n.virtualSelectAll||(n.dataCount=n.totalItemCount=n.virtualSelectAll?r.length:r.count);var c={cancel:!1,result:r=n.isVirtualizationEnabled?r.result:r};n.isPreventChange=!(!n.isAngular||!n.preventChange)||n.isPreventChange,n.trigger("actionComplete",c,(function(e){if(n.isCustomFiltering=!1,n.isIncrementalRequest)l=n.renderItems(e.result,t);else if(!e.cancel){if(l=n.renderItems(e.result,t),n.onActionComplete(l,e.result,s),n.groupTemplate&&n.renderGroupTemplate(l),n.bindChildItems(e.result,l,t),n.getInitialData)return n.getInitialData=!1,void(n.preventPopupOpen=!1);setTimeout((function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&l.childElementCount>0&&(l.children[0].childElementCount>0||n.fields.groupBy&&l.children[1]&&l.children[1].childElementCount>0)&&n.updateDataList()}))}}))}}))},t.prototype.handleVirtualKeyboardActions=function(e,t){},t.prototype.updatePopupState=function(){},t.prototype.updatePopupPosition=function(){},t.prototype.virtualSelectionAll=function(e,t,i){},t.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},t.prototype.bindChildItems=function(e,t,i,s){var l=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout((function(){var n=l.remainingItems(l.sortedData,i);(0,v.append)(n,t),l.liCollections=l.list.querySelectorAll("."+A.li),l.updateListValues(),l.raiseDataBound(e,s)}),0):this.raiseDataBound(e,s)},t.prototype.isObjectInArray=function(e,t){return t.some((function(t){return Object.keys(e).every((function(i){return Object.prototype.hasOwnProperty.call(t,i)&&t[i]===e[i]}))}))},t.prototype.updateListValues=function(){},t.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var n=[].slice.call(e.querySelectorAll(t)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},t.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},t.prototype.remainingItems=function(e,t){var i=new g.DataManager(e).executeLocal((new g.Query).skip(100));if(this.itemTemplate){var s=this.templateListItem(i,t);return[].slice.call(s.childNodes)}var l=this.typeOfData(i).typeof;return"string"===l||"number"===l||"boolean"===l?E.ListBase.createListItemFromArray(this.createElement,i,!0,this.listOption(i,t),this):E.ListBase.createListItemFromJson(this.createElement,i,this.listOption(i,t),1,!0,this)},t.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},t.prototype.showSpinner=function(){},t.prototype.hideSpinner=function(){},t.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),(0,v.isNullOrUndefined)(this.list)||(0,v.addClass)([this.list],A.noData)},t.prototype.onActionComplete=function(e,t,i){if(this.listData=t,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(var s=0;s<e.childElementCount;s++)e.children[s].classList.contains("e-list-group-item")&&((0,v.isNullOrUndefined)(e.children[s].innerHTML)||""===e.children[s].innerHTML)&&(0,v.addClass)([e.children[s]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&(0,v.setStyleAttribute)(e.children[1],{zIndex:11});(0,v.isNullOrUndefined)(this.list)||this.isVirtualizationEnabled||(this.list.innerHTML="",this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,t,this.bindEvent))},t.prototype.postRender=function(e,t,i){if(this.fields.disabled)for(var s=e.querySelectorAll("."+A.li),l=0;l<s.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.disabled])if((0,v.isNullOrUndefined)(this.fields.groupBy))this.disableListItem(s[l]);else{var n=this.listData[l],a=(0,v.getValue)(this.fields.value?this.fields.value:"value",n),o=e.querySelector('li[data-value="'+a+'"]');(0,v.isNullOrUndefined)(o)||this.disableListItem(o)}var r=this.fields.disabled?e.querySelector("."+A.li+":not(.e-disabled"):e.querySelector("."+A.li),h=e.querySelector("."+A.selected);if(r&&!h){if(this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex){var u=this.ulElement.querySelectorAll("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)");r=u&&u.length>0?u[2]:r}r&&r.classList.add(A.focus)}t.length<=0?(this.l10nUpdate(),(0,v.addClass)([e],A.noData)):e.classList.remove(A.noData)},t.prototype.getQuery=function(e){return e||(this.query?this.query:new g.Query)},t.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},t.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+A.group)){var t=this.dataSource,i={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},s=e.querySelectorAll("."+A.group),l=this.templateCompiler(this.groupTemplate);if("function"!=typeof this.groupTemplate&&l){var n=(0,v.select)(this.groupTemplate,document).innerHTML.trim(),a=E.ListBase.renderGroupTemplate(n,t,this.fields.properties,s,i,this);if(this.isGroupChecking)for(var o=0;o<a.length;o++)this.notify("addItem",{module:"CheckBoxSelection",item:a[o]})}else{a=E.ListBase.renderGroupTemplate(this.groupTemplate,t,this.fields.properties,s,i,this);if(this.isGroupChecking)for(o=0;o<a.length;o++)this.notify("addItem",{module:"CheckBoxSelection",item:a[o]})}this.renderReactTemplates()}},t.prototype.createListItems=function(e,t){if(e){t.groupBy||this.element.querySelector("optgroup")?(t.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=this.element.querySelector("optgroup")&&this.isGroupChecking&&"multiselect"===this.getModuleName()?E.ListBase.groupDataSource(e,t,this.sortOrder):E.ListBase.groupDataSource(e,t.properties,this.sortOrder)),(0,v.addClass)([this.list],A.grouping)):("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(e=this.getSortedDataSource(e));var i=this.listOption(e,t),s=e.length>100?new g.DataManager(e).executeLocal((new g.Query).take(100)):e;return this.sortedData=e,E.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?s:e,i,!0,this)}return null},t.prototype.listOption=function(e,t){var i=!(0,v.isNullOrUndefined)(t.iconCss),s=(0,v.isNullOrUndefined)(t.properties)?t:t.properties,l=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return(0,v.extend)({},l,t,!0)},t.prototype.setFloatingHeader=function(e){(0,v.isNullOrUndefined)(this.list)||this.list.classList.contains(A.noData)||((0,v.isNullOrUndefined)(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:A.fixedHead}),(0,v.isNullOrUndefined)(this.list)||this.list.querySelector("li").classList.contains(A.group)||(this.fixedHeaderElement.style.display="none"),(0,v.isNullOrUndefined)(this.fixedHeaderElement)||(0,v.isNullOrUndefined)(this.list)||(0,v.prepend)([this.fixedHeaderElement],this.list),this.setFixedHeader()),(0,v.isNullOrUndefined)(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},t.prototype.scrollStop=function(e,t){for(var i=(0,v.isNullOrUndefined)(e)?this.list:e.target,s=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),l=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),n=parseInt(l,10),a="multiselect"===this.getModuleName()?parseFloat(s):parseInt(s,10),o=Math.round(i.scrollTop/(a+n)),r=this.list.querySelectorAll("li:not(.e-hide-listitem)"),h=this.list.querySelectorAll(".e-virtual-list").length,u=!1,p=o;p>-1;p--){var d=this.isVirtualizationEnabled?p+h:p;if(this.isVirtualizationEnabled){if(u&&0,this.fixedHeaderElement&&this.updateGroupHeader(d,r,i))break;t&&(!(0,v.isNullOrUndefined)(r[d])&&r[d].classList.contains(A.selected)&&"autocomplete"!==this.getModuleName()||!(0,v.isNullOrUndefined)(r[d])&&r[d].classList.contains(A.focus)&&"autocomplete"===this.getModuleName())&&(u=!0)}else if(this.updateGroupHeader(d,r,i))break}},t.prototype.getPageCount=function(e){if(this.list){var t=this.list.classList.contains(A.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),i=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10));return e?i:Math.round(i)}return 0},t.prototype.updateGroupHeader=function(e,t,i){return!(0,v.isNullOrUndefined)(t[e])&&t[e].classList.contains(A.group)?(this.updateGroupFixedHeader(t[e],i),!0):(this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none",!1)},t.prototype.updateGroupFixedHeader=function(e,t){this.fixedHeaderElement&&((0,v.isNullOrUndefined)(e.innerHTML)||(this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},t.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},t.prototype.renderItems=function(e,t,i){var s;if(this.itemTemplate&&e){"multiselect"===this.getModuleName()&&this.virtualSelectAll&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex));var l=e;l&&t.groupBy?("None"!==this.sortOrder&&(l=this.getSortedDataSource(l)),l=E.ListBase.groupDataSource(l,t.properties,this.sortOrder)):("listbox"!==this.getModuleName()||"listbox"===this.getModuleName()&&!this.preventDefActionFilter)&&(l=this.getSortedDataSource(l)),this.sortedData=l;var n=l.length>100?new g.DataManager(l).executeLocal((new g.Query).take(100)):l;if(s=this.templateListItem("autocomplete"===this.getModuleName()?n:l,t),this.isIncrementalRequest)return this.incrementalLiCollections=s.querySelectorAll("."+A.li),this.incrementalUlElement=s,this.incrementalListData=e,s;if(this.isVirtualizationEnabled){var a=this.list.querySelector(".e-list-parent"),o=this.list.querySelector(".e-virtual-ddl-content");if(e.length>=this.virtualizedItemsCount&&a&&o||a&&o&&this.isAllowFiltering||a&&o&&"autocomplete"===this.getModuleName()){"multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(o.appendChild(s),i=!0):o.replaceChild(s,a);var r=this.list.querySelectorAll(".e-reorder");this.list.querySelector(".e-virtual-ddl-content")&&r&&r.length>0&&!i&&this.list.querySelector(".e-virtual-ddl-content").removeChild(r[0]),this.updateListElements(e)}else o||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(s),this.updateListElements(e))}}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&(this.virtualSelectAllData=e,e=e.slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),s=this.createListItems(e,t),this.isIncrementalRequest)return this.incrementalLiCollections=s.querySelectorAll("."+A.li),this.incrementalUlElement=s,this.incrementalListData=e,s;if(this.isVirtualizationEnabled){a=this.list.querySelector(".e-list-parent:not(.e-reorder)"),o=this.list.querySelector(".e-virtual-ddl-content");!a&&this.list.querySelector(".e-list-parent.e-reorder")&&(a=this.list.querySelector(".e-list-parent.e-reorder")),e.length>=this.virtualizedItemsCount&&a&&o||a&&o&&this.isAllowFiltering||a&&o&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(this.appendUncheckList?o.appendChild(s):o.replaceChild(s,a),this.updateListElements(e)):o&&o.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(s),this.updateListElements(e))}}return s},t.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},t.prototype.updateListElements=function(e){this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"),this.listData=e,this.postRender(this.list,e,this.bindEvent)},t.prototype.templateListItem=function(e,t){var i=this.listOption(e,t);i.templateID=this.itemTemplateId,i.isStringTemplate=this.isStringTemplate;var s,l=this.templateCompiler(this.itemTemplate);if("function"!=typeof this.itemTemplate&&l){var n=(0,v.select)(this.itemTemplate,document).innerHTML.trim();return s=E.ListBase.renderContentTemplate(this.createElement,n,e,t.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),s}return s=E.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,t.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),s},t.prototype.typeOfData=function(e){for(var t={typeof:null,item:null},i=0;!(0,v.isNullOrUndefined)(e)&&i<e.length;i++){if(!(0,v.isNullOrUndefined)(e[i]))if(!("string"==typeof e[i]||"number"==typeof e[i]||"boolean"==typeof e[i]?(0,v.isNullOrUndefined)(e[i]):(0,v.isNullOrUndefined)((0,v.getValue)(this.fields.value?this.fields.value:"value",e[i]))))return{typeof:typeof e[i],item:e[i]}}return t},t.prototype.setFixedHeader=function(){(0,v.isNullOrUndefined)(this.list)||(this.list.parentElement.style.display="block");var e=0;this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e)&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10)));if(!(0,v.isNullOrUndefined)(this.liCollections)){var t=this.getValidLi().offsetWidth-e;this.fixedHeaderElement.style.width=t.toString()+"px"}(0,v.setStyleAttribute)(this.fixedHeaderElement,{zIndex:10});var i=this.ulElement.querySelector("."+A.group+":not(.e-hide-listitem)");this.fixedHeaderElement.innerHTML=i.innerHTML},t.prototype.getSortedDataSource=function(e){if(e&&"None"!==this.sortOrder){var t=this.fields.text?this.fields.text:"text";"string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=E.ListBase.getDataSource(e,E.ListBase.addSorting(this.sortOrder,t))}return e},t.prototype.getIndexByValue=function(e){var t,i=[];i=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems();for(var s=0;s<i.length;s++)if(!(0,v.isNullOrUndefined)(e)&&i[s].getAttribute("data-value")===e.toString()){t=s;break}return t},t.prototype.getIndexByValueFilter=function(e,t){var i;if(!t)return null;var s=t.querySelectorAll("li:not(.e-list-group-item)");if(s)for(var l=0;l<s.length;l++)if(!(0,v.isNullOrUndefined)(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},t.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e&&e.dispatchEvent(i)},t.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||(this.isPrimitiveData=!0,this.updateFields("text","text"))},t.prototype.resetList=function(e,t,i,s){if(this.list){if("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)!(e instanceof Array?e.length>0:!(0,v.isNullOrUndefined)(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData);e="combobox"===this.getModuleName()&&this.selectData&&e instanceof Array&&e.length<this.selectData.length&&this.addedNewItem?this.selectData:e,this.addedNewItem=!1,this.setListData(e,t,i,s)}},t.prototype.updateSelectElementData=function(e){(e||this.isVirtualizationEnabled)&&(0,v.isNullOrUndefined)(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},t.prototype.updateSelection=function(){},t.prototype.renderList=function(){this.render()},t.prototype.updateDataSource=function(e,t){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof g.DataManager?this.dataSource.dataSource.json.length:0},t.prototype.setUpdateInitial=function(e,t,i){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var s={},l=0;e.length>l;l++)t[e[l]]&&"fields"===e[l]?(this.setFields(),s[e[l]]=t[e[l]]):t[e[l]]&&(s[e[l]]=t[e[l]]);Object.keys(s).length>0&&(-1===Object.keys(s).indexOf("dataSource")&&(s.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||(0,v.isNullOrUndefined)(t.dataSource)&&(0,v.isNullOrUndefined)(t.sortOrder))||this.updateDataSource(s,i):(this.isDynamicData=!0,this.updateDataSource(s,i)))},t.prototype.onPropertyChanged=function(e,t){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var l=this.ulElement.querySelector("."+A.group);this.fixedHeaderElement.innerHTML=l.innerHTML}break;case"locale":this.list&&!(0,v.isNullOrUndefined)(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}}},t.prototype.render=function(e,t){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:A.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:A.content}),this.list.classList.add(A.root),this.setFields();var i={duration:300,selector:"."+A.li};this.rippleFun=(0,v.rippleEffect)(this.list,i);var s=this.element.querySelector("select>optgroup");if(!this.fields.groupBy&&(0,v.isNullOrUndefined)(s)||this.isGroupChecking||(v.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),v.EventHandler.add(document,"scroll",this.updateGroupFixedHeader,this)),"dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),(0,v.removeClass)([this.element],A.root),this.element.style.display="none";var l=this.createElement("div");this.element.parentElement.insertBefore(l,this.element),l.appendChild(this.element),l.appendChild(this.list)}this.setEnableRtl(),t||this.initialize(e)},t.prototype.removeScrollEvent=function(){this.list&&v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)},t.prototype.getModuleName=function(){return"dropdownbase"},t.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+A.li)},t.prototype.addItem=function(e,t){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&(0,v.isNullOrUndefined)(t)){var i=[].slice.call(this.listData);i.push(e),i=this.getSortedDataSource(i),t=this.fields.groupBy?(i=E.ListBase.groupDataSource(i,this.fields.properties,this.sortOrder)).indexOf(e):i.indexOf(e)}var s,l=this.getItems().length,n=0===l,a=this.list.querySelector("."+A.selected);e=e instanceof Array?e:[e],s=(0,v.isNullOrUndefined)(t)||t<0||t>l-1?l:t;var o=this.fields;e&&o.groupBy&&(e=E.ListBase.groupDataSource(e,o.properties));for(var r=[],h=0;h<e.length;h++){var u=e[h],p=u.isHeader,d=this.createElement("li",{className:p?A.group:A.li,id:"option-add-"+h}),c=u instanceof Object?(0,v.getValue)(o.text,u):u;if(p&&(d.innerText=c),this.itemTemplate&&!p){var m=this.templateCompiler(this.itemTemplate),f=("function"!=typeof this.itemTemplate&&m?(0,v.compile)((0,v.select)(this.itemTemplate,document).innerHTML.trim()):(0,v.compile)(this.itemTemplate))(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d);f&&(0,v.append)(f,d)}else p||d.appendChild(document.createTextNode(c));d.setAttribute("data-value",u instanceof Object?(0,v.getValue)(o.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),r.push(d),"listbox"===this.getModuleName()?(this.listData.splice(n?this.listData.length:s,0,u),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(u),"None"===this.sortOrder&&(0,v.isNullOrUndefined)(t)&&0===s&&(s=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(d,u,n?null:s+h):this.updateActionCompleteData(d,u,s),this.trigger("beforeItemRender",{element:d,item:u})}if(0===l&&(0,v.isNullOrUndefined)(this.list.querySelector("ul")))(0,v.isNullOrUndefined)(this.list)||(this.list.innerHTML="",this.list.classList.remove(A.noData),this.isAddNewItemTemplate=!0,(0,v.isNullOrUndefined)(this.ulElement)||this.list.appendChild(this.ulElement)),this.liCollections=r,(0,v.isNullOrUndefined)(r)||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.append)(r,this.ulElement),this.updateAddItemList(this.list,l);else{"listbox"===this.getModuleName()&&0===l&&(this.ulElement.innerHTML="");var g=[];for(h=0;h<e.length;h++){for(var y=this.ulElement.querySelectorAll(".e-list-group-item"),C=0;C<y.length;C++)g[C]=y[C].innerText;if(g.indexOf(r[h].innerText)>-1&&o.groupBy){for(C=0;C<y.length;C++)if(g[C]===r[h].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(r[h+1],y[C+1]):this.ulElement.insertBefore(r[h+1],this.ulElement.childNodes[t]),h+=1;break}}else this.liCollections[s]&&this.liCollections[s].parentNode?this.liCollections[s].parentNode.insertBefore(r[h],this.liCollections[s]):t&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(r[h],this.ulElement.childNodes[t+h]):this.ulElement.appendChild(r[h]);var b=[].slice.call(this.liCollections);b.splice(s,0,r[h]),this.liCollections=b,s+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),(a||0===t)&&this.updateSelection(),this.addedNewItem=!0},t.prototype.isDisabledElement=function(e){return!(!e||!e.classList.contains("e-disabled"))},t.prototype.isDisabledItemByIndex=function(e){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[e])},t.prototype.disableListItem=function(e){e.classList.add("e-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")},t.prototype.validationAttribute=function(e,t){var i=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",i),e.removeAttribute("name");for(var s=["required","aria-required","form"],l=0;l<s.length;l++)if(e.getAttribute(s[l])){var n=e.getAttribute(s[l]);t.setAttribute(s[l],n),e.removeAttribute(s[l])}},t.prototype.setZIndex=function(){},t.prototype.updateActionCompleteData=function(e,t,i){},t.prototype.updateAddItemList=function(e,t){},t.prototype.updateDataList=function(){},t.prototype.getDataByValue=function(e){if(!(0,v.isNullOrUndefined)(this.listData)){var t=this.typeOfData(this.listData).typeof;if("string"===t||"number"===t||"boolean"===t)for(var i=0,s=this.listData;i<s.length;i++){var l=s[i];if(!(0,v.isNullOrUndefined)(l)&&l===e)return l}else for(var n=0,a=this.listData;n<a.length;n++){l=a[n];if(!(0,v.isNullOrUndefined)(l)&&(0,v.getValue)(this.fields.value?this.fields.value:"value",l)===e)return l}}return null},t.prototype.destroy=function(){document&&(v.EventHandler.remove(document,"scroll",this.updateGroupFixedHeader),document.body.contains(this.list)&&(v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),(0,v.isNullOrUndefined)(this.rippleFun)||this.rippleFun(),(0,v.detach)(this.list))),this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.rippleFun=null,e.prototype.destroy.call(this)},w([(0,v.Complex)({text:null,value:null,iconCss:null,groupBy:null,disabled:null},O)],t.prototype,"fields",void 0),w([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),w([(0,v.Property)(null)],t.prototype,"groupTemplate",void 0),w([(0,v.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),w([(0,v.Property)("Request failed")],t.prototype,"actionFailureTemplate",void 0),w([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),w([(0,v.Property)([])],t.prototype,"dataSource",void 0),w([(0,v.Property)(null)],t.prototype,"query",void 0),w([(0,v.Property)("StartsWith")],t.prototype,"filterType",void 0),w([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),w([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),w([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),w([(0,v.Property)()],t.prototype,"locale",void 0),w([(0,v.Event)()],t.prototype,"actionBegin",void 0),w([(0,v.Event)()],t.prototype,"actionComplete",void 0),w([(0,v.Event)()],t.prototype,"actionFailure",void 0),w([(0,v.Event)()],t.prototype,"select",void 0),w([(0,v.Event)()],t.prototype,"dataBound",void 0),w([(0,v.Event)()],t.prototype,"created",void 0),w([(0,v.Event)()],t.prototype,"destroyed",void 0),t=w([v.NotifyPropertyChanges],t)}(v.Component),k=u(197),N=u(323),L=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),B=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},T={root:"e-dropdownlist",hover:A.hover,selected:A.selected,rtl:A.rtl,li:A.li,disable:A.disabled,base:A.root,focus:A.focus,content:A.content,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",resizeIcon:"e-resizer-right e-icons",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden",virtualList:"e-list-item e-virtual-list"},V={container:null,buttons:[]},P=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isListSearched=!1,s.preventChange=!1,s.isTouched=!1,s.isFocused=!1,s.autoFill=!1,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isReactTemplateUpdate=!1,s}return L(t,e),t.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},t.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},t.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},t.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),e},t.prototype.renderList=function(t,i){e.prototype.render.call(this,t,i),this.dataSource instanceof g.DataManager||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},t.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");""!==this.inputElement.value||this.isInteracted?(0,v.classList)(e,["e-label-top"],["e-label-bottom"]):(0,v.classList)(e,["e-label-bottom"],["e-label-top"])}},t.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},t.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!(0,v.isNullOrUndefined)(this.ulElement)){var e=this.fields.disabled?this.ulElement.querySelector("."+T.li+":not(.e-disabled)"):this.ulElement.querySelector("."+T.li);this.enableVirtualization&&(e=this.liCollections[this.skeletonCount]),e&&e.classList.add(T.focus)}},t.prototype.clearAll=function(e,t){this.previousItemData=(0,v.isNullOrUndefined)(this.itemData)?null:this.itemData,!(0,v.isNullOrUndefined)(t)&&((0,v.isNullOrUndefined)(t)||!(0,v.isNullOrUndefined)(t.dataSource)&&(t.dataSource instanceof g.DataManager||0!==t.dataSource.length))||(this.isActive=!0,this.resetSelection(t));var i=this.getItemData();if(!this.allowObjectBinding&&this.previousValue===i.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value?this.value:i:i.value?this.getDataByValue(i.value):i]))return this.checkAndResetCache(),void(this.enableVirtualization&&this.list&&this.updateInitialData());this.onChangeEvent(e),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData()},t.prototype.resetSelection=function(e){this.list&&((0,v.isNullOrUndefined)(e)||!(0,v.isNullOrUndefined)(e.dataSource)&&(e.dataSource instanceof g.DataManager||0!==e.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!(0,v.isNullOrUndefined)(this.actionCompleteData.ulElement)&&!(0,v.isNullOrUndefined)(this.actionCompleteData.list)&&this.actionCompleteData.list.length>0&&this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),(0,v.isNullOrUndefined)(this.hiddenElement)||(this.hiddenElement.innerHTML=""),(0,v.isNullOrUndefined)(this.inputElement)||(this.inputElement.value=""),this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&((0,v.detach)(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},t.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];if("class"===i){var s=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==s&&(0,v.addClass)([this.inputWrapper.container],s.split(" "))}else if("disabled"===i&&"disabled"===this.htmlAttributes[""+i])this.enabled=!1,this.setEnable();else if("readonly"!==i||(0,v.isNullOrUndefined)(this.htmlAttributes[""+i]))if("style"===i)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+i]);else if("aria-label"===i)"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+i]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+i]);else{var l=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||l.push("tabindex"),["name","required"].indexOf(i)>-1||0===i.indexOf("data")?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):l.indexOf(i)>-1?"placeholder"===i?N.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputElement):this.inputElement.setAttribute(i,this.htmlAttributes[""+i]):this.inputWrapper.container.setAttribute(i,this.htmlAttributes[""+i])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},t.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},t.prototype.setEnableRtl=function(){(0,v.isNullOrUndefined)(this.inputElement)||(0,v.isNullOrUndefined)(this.inputElement.parentElement)||N.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},t.prototype.setEnable=function(){N.Input.setEnabled(this.enabled,this.inputElement),this.enabled?((0,v.removeClass)([this.inputWrapper.container],T.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),(0,v.addClass)([this.inputWrapper.container],T.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getLocaleName=function(){return"drop-down-list"},t.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},t.prototype.targetElement=function(){return(0,v.isNullOrUndefined)(this.inputWrapper)?null:this.inputWrapper.container},t.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},t.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},t.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},t.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof g.DataManager?this.initialRemoteRender=!0:this.updateValues()},t.prototype.isDisableItemValue=function(e){if("object"==typeof e){var t=JSON.parse(JSON.stringify(e))[this.fields.value];return this.isDisabledItemByIndex(this.getIndexByValue(t))}return this.isDisabledItemByIndex(this.getIndexByValue(e))},t.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),this.selectedValueInfo=this.viewPortInfo,(0,v.isNullOrUndefined)(this.value))if(this.text&&(0,v.isNullOrUndefined)(this.value)){var e=this.getElementByText(this.text);if((0,v.isNullOrUndefined)(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{var t=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.setSelection(this.getElementByValue(t),null)}this.setHiddenValue(),N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.onBlurHandler=function(e){if(this.enabled){var t=e.relatedTarget,i=e.target,s=this.isPreventBlur;this.isPreventBlur=!1,!s||this.isDocumentClick||!this.isPopupOpen||(0,v.isNullOrUndefined)(i)&&(this.isFilterLayout()||!(0,v.isNullOrUndefined)(t))?this.isDocumentClick||!(0,v.isNullOrUndefined)(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(T.mobileFilter)?this.beforePopupOpen||(this.isDocumentClick=!1):(("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&t!==this.inputElement&&(document.activeElement!==t||document.activeElement===t&&i.classList.contains(T.inputFocus))||(0,v.isNullOrUndefined)(t)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&i!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(t)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1):"dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus()}},t.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut(e)},t.prototype.onFocusOut=function(e){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&(0,v.addClass)([this.inputWrapper.clearButton],T.clearIconHide),this.trigger("blur"))},t.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}this.updateIconState(),this.isFocused=!0},t.prototype.resizingWireEvent=function(){v.EventHandler.add(document,"mousemove",this.resizePopup,this),v.EventHandler.add(document,"mouseup",this.stopResizing,this),v.EventHandler.add(document,"touchmove",this.resizePopup,this),v.EventHandler.add(document,"touchend",this.stopResizing,this)},t.prototype.resizingUnWireEvent=function(){v.EventHandler.remove(document,"mousemove",this.resizePopup),v.EventHandler.remove(document,"mouseup",this.stopResizing),v.EventHandler.remove(document,"touchmove",this.resizePopup),v.EventHandler.remove(document,"touchend",this.stopResizing)},t.prototype.resetValueHandler=function(e){var t=(0,v.closest)(this.inputElement,"form");if(t&&e.target===t){var i=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=i}},t.prototype.wireEvent=function(){v.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),v.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),v.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),v.EventHandler.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},t.prototype.bindCommonEvent=function(){v.EventHandler.add(this.targetElement(),"blur",this.onBlurHandler,this);var e=(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.add(e,"reset",this.resetValueHandler,this),v.Browser.isDevice?this.keyboardModule=new v.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new v.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},t.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},t.prototype.bindClearEvent=function(){this.showClearButton&&v.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.unBindCommonEvent=function(){!(0,v.isNullOrUndefined)(this.inputWrapper)&&this.targetElement()&&v.EventHandler.remove(this.targetElement(),"blur",this.onBlurHandler);var e=this.inputElement&&(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.remove(e,"reset",this.resetValueHandler),v.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&v.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},t.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?(0,v.addClass)([this.inputWrapper.clearButton],T.clearIconHide):(0,v.removeClass)([this.inputWrapper.clearButton],T.clearIconHide))},t.prototype.wireListEvents=function(){(0,v.isNullOrUndefined)(this.list)||(v.EventHandler.add(this.list,"click",this.onMouseClick,this),v.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),v.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},t.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},t.prototype.onServerIncrementalSearch=function(e){this.isRequested||(0,v.isNullOrUndefined)(this.list)||(0,v.isNullOrUndefined)(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},t.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},t.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},t.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},t.prototype.onMouseClick=function(e){var t=e.target;this.keyboardEvent=null;var i=(0,v.closest)(t,"."+A.li);if(this.isValidLI(i)&&!this.isDisabledElement(i))if(this.setSelection(i,e),v.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100,e)}},t.prototype.onMouseOver=function(e){var t=(0,v.closest)(e.target,"."+A.li);this.setHover(t)},t.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(A.hover)&&(this.removeHover(),(0,v.addClass)([e],A.hover))},t.prototype.onMouseLeave=function(){this.removeHover()},t.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+A.hover);e&&e.length&&(0,v.removeClass)(e,A.hover)}},t.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},t.prototype.updateIncrementalItemIndex=function(e,t){this.incrementalStartIndex=e,this.incrementalEndIndex=t},t.prototype.incrementalSearch=function(e){if(this.liCollections.length>0)if(this.enableVirtualization){var t=!1,i=!1,s=this.ulElement.getElementsByClassName("e-active")[0],l=s?s.textContent:null;""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(e.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(e.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?i=!0:this.incrementalQueryString=String.fromCharCode(e.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(t=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0),(0!==this.viewPortInfo.startIndex||t)&&this.updateIncrementalView(0,this.itemCount);for(var n=a(e.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,i,l,!0);(0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,(0!==this.viewPortInfo.startIndex||t)&&this.updateIncrementalView(0,this.itemCount),n=a(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0),(0,v.isNullOrUndefined)(n));)if((0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100);break}(0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,100>this.totalItemCount?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,(0!==this.viewPortInfo.startIndex||t)&&this.updateIncrementalView(0,this.itemCount),n=a(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0));var o=n&&this.getIndexByValue(n.getAttribute("data-value"));if(o)o-=this.skeletonCount;else for(var r=0;r<this.incrementalLiCollections.length;r++)if(!(0,v.isNullOrUndefined)(n)&&!(0,v.isNullOrUndefined)(n.getAttribute("data-value"))&&this.incrementalLiCollections[r].getAttribute("data-value")===n.getAttribute("data-value").toString()){o=r,o=this.incrementalStartIndex+o;break}if(o&&!(this.viewPortInfo.startIndex>=o&&o>=this.viewPortInfo.endIndex)){var h=o-(this.itemCount/2-2)>0?o-(this.itemCount/2-2):0,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(h,u)}if((0,v.isNullOrUndefined)(n))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(n.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(h,u)}if(n=this.getElementByValue(n.getAttribute("data-value")),this.setSelection(n,e),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var p=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.list.scrollTop=p-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}this.incrementalPreQueryString=this.incrementalQueryString}}else{n=void 0;if(this.fields.disabled){var d=this.list.querySelectorAll("."+A.li+":not(.e-disabled)");n=a(e.charCode,d,this.activeIndex,!0,this.element.id)}else n=a(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id);(0,v.isNullOrUndefined)(n)||(this.setSelection(n,e),this.setScrollPosition())}},t.prototype.hideSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||((0,k.hideSpinner)(this.spinnerElement),(0,v.removeClass)([this.spinnerElement],T.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},t.prototype.showSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)&&(this.spinnerElement=v.Browser.isDevice&&!(0,v.isNullOrUndefined)(this.filterInputObj)&&this.filterInputObj.buttons[1]||!(0,v.isNullOrUndefined)(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],(0,v.addClass)([this.spinnerElement],T.disableIcon),(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,k.showSpinner)(this.spinnerElement))},t.prototype.keyActionHandler=function(e){if(this.enabled){this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault();var t="pageUp"===e.action||"pageDown"===e.action,i="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var s="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||t||i)||this.isPopupOpen)&&!this.readonly){var l="tab"===e.action||"close"===e.action;if(!(0,v.isNullOrUndefined)(this.list)||this.isRequested||l||"escape"===e.action||(this.searchKeyEvent=e,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode)||(this.renderList(e),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"))),(0,v.isNullOrUndefined)(this.list)||!(0,v.isNullOrUndefined)(this.liCollections)&&s&&0===this.liCollections.length||this.isRequested)return;switch((l&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!s&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||(this.showPopup(),e.preventDefault()));break;case"open":this.showPopup(e);break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},t.prototype.updateUpDownAction=function(e,t){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var i=this.getItemData().value;(0,v.isNullOrUndefined)(i)&&(i="null");var s=this.getIndexByValue(i);(0,v.isNullOrUndefined)(s)||(this.activeIndex=s)}var l,n=this.list.querySelector("."+T.focus);if(this.isSelectFocusItem(n)&&!t){if(this.setSelection(n,e),this.enableVirtualization){var a=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;this.fields.groupBy&&(a=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-a:a-this.selectedLI.offsetHeight),this.list.scrollTop=a-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}else if(!(0,v.isNullOrUndefined)(this.liCollections)){var o=this.activeIndex,r="down"===e.action?this.activeIndex+1:this.activeIndex-1;r=t?o:r;var h=0;"autocomplete"===this.getModuleName()&&(h="down"===e.action&&(0,v.isNullOrUndefined)(this.activeIndex)?0:this.liCollections.length-1,r=r<0?this.liCollections.length-1:r===this.liCollections.length?0:r);var u=void 0;if("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)if(this.enableVirtualization)if(t)if("autocomplete"===this.getModuleName()){i=this.getFormattedValue(this.selectedLI.getAttribute("data-value"));u=this.getElementByValue(i)}else u=this.getElementByValue(this.getItemData().value);else u=(0,v.isNullOrUndefined)(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[r],u=(0,v.isNullOrUndefined)(u)||u.classList.contains("e-virtual-list")?null:u;else u=(0,v.isNullOrUndefined)(this.activeIndex)?this.liCollections[h]:this.liCollections[r];if((0,v.isNullOrUndefined)(u)){if(this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===e.action||0!==this.viewPortInfo.startIndex&&"up"===e.action)){if("down"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;i="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null;(p=this.getDataByValue(i))&&(this.itemData=p)}else if("up"===e.action){this.viewPortInfo.startIndex=this.viewPortInfo.startIndex-this.itemCount>0?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter;var p;i="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null;(p=this.getDataByValue(i))&&(this.itemData=p)}this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(e,this.pageCount)}}else{var d=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus");if(this.setSelection(u,e),d&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!t){a=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop;a=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-a:a-this.selectedLI.offsetHeight,this.list.scrollTop=a-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight}}}if(this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){i=this.getItemData().value,s=this.getIndexByValueFilter(i,this.actionCompleteData.ulElement);(0,v.isNullOrUndefined)(s)||(this.activeIndex=s)}this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&((0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(r=0;r<this.liCollections.length;r++)if(this.liCollections[r].classList.contains(T.focus)||this.liCollections[r].classList.contains(T.selected)){l=r;break}null!=l&&this.isDisabledElement(this.liCollections[l])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===l&&"down"===e.action&&(e.action="up"),0===l&&"up"===e.action&&(e.action="down")),this.updateUpDownAction(e)),e.preventDefault()}},t.prototype.updateHomeEndAction=function(e,t){if("dropdownlist"===this.getModuleName()){var i=0;if("home"===e.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),e.preventDefault(),this.activeIndex===i)return void(t&&this.setSelection(this.liCollections[i],e));if(!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled"))return;this.setSelection(this.liCollections[i],e)}},t.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},t.prototype.mobileKeyActionHandler=function(e){if(this.enabled&&(!this.isEditTextBox()||this.isPopupOpen)&&!this.readonly){if(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),(0,v.isNullOrUndefined)(this.list)||!(0,v.isNullOrUndefined)(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},t.prototype.handleVirtualKeyboardActions=function(e,t){switch(e.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(e,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),e,!0),e.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection((0,v.isNullOrUndefined)(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),e,!0),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e,!0)}this.keyboardEvent=null},t.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+T.focus);if(this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(e),this.focusDropDown(e)}else this.showPopup()},t.prototype.isSelectFocusItem=function(e){return!(0,v.isNullOrUndefined)(e)},t.prototype.pageUpSelection=function(e,t,i){var s=e>=0?this.liCollections[e+1]:this.liCollections[0];if(!this.enableVirtualization&&s&&s.classList.contains("e-disabled"))for(var l=e>=0?e+1:0;l<this.liCollections.length&&(!(s=this.liCollections[l])||s.classList.contains("e-disabled"));)if(--l<0)return;this.enableVirtualization&&null==this.activeIndex&&(s=this.liCollections.length>=e&&e>=0?this.liCollections[e+this.skeletonCount+1]:this.liCollections[0]),!(0,v.isNullOrUndefined)(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(s,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&((0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},t.prototype.PageUpDownSelection=function(e,t){this.enableVirtualization&&((0,v.isNullOrUndefined)(e)||("autocomplete"===this.getModuleName()||e.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||e.classList.contains("e-item-focus")))||this.setSelection(e,t)},t.prototype.pageDownSelection=function(e,t,i){var s=this.getItems(),l=e<=s.length?this.liCollections[e-1]:this.liCollections[s.length-1];if(!this.enableVirtualization&&l&&l.classList.contains("e-disabled"))for(;e>=0&&e<this.liCollections.length&&(!(l=e<=s.length?this.liCollections[e-1]:this.liCollections[s.length-1])||l.classList.contains("e-disabled"));)e++;this.enableVirtualization&&this.skeletonCount>0&&(l=(e="dropdownlist"===this.getModuleName()&&this.allowFiltering?e+1:e)<s.length?this.liCollections[e]:this.liCollections[s.length-1]),this.enableVirtualization&&null==this.activeIndex&&(l=e<=s.length?this.liCollections[e+this.skeletonCount-1]:this.liCollections[s.length-1]),this.PageUpDownSelection(l,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&((0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},t.prototype.unWireEvent=function(){(0,v.isNullOrUndefined)(this.inputWrapper)||(v.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),v.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),v.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),v.EventHandler.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},t.prototype.unWireListEvents=function(){this.list&&(v.EventHandler.remove(this.list,"click",this.onMouseClick),v.EventHandler.remove(this.list,"mouseover",this.onMouseOver),v.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},t.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},t.prototype.onDocumentClick=function(e){var t=e.target;if(!(0,v.isNullOrUndefined)(this.popupObj)&&(0,v.closest)(t,this.checkSelector(this.popupObj.element.id))||(0,v.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.container.contains(e.target))t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&v.Browser.isDevice&&t===this.inputWrapper.buttons[0]||(this.isPreventBlur=(v.Browser.isIE||"edge"===v.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(T.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var i=this.isRequested;"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(e),this.isInteracted=!1,i||(this.onFocusOut(e),this.inputWrapper.container.classList.remove(T.inputFocus))}},t.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(T.inputFocus))},t.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},t.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&(this.keyboardEvent=null,!this.targetElement().classList.contains(T.disable)&&this.inputWrapper.clearButton!==e.target)){var t=e.target;if(t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen?(this.hidePopup(e),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup(e));var i=this,s=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout((function(){i.cloneElements(),i.isSecondClick=!0,i.isSecondClick=!(i.isReact&&i.isFiltering()&&i.dataSource instanceof g.DataManager&&!i.list.querySelector("ul"))}),s)}}},t.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},t.prototype.updateSelectedItem=function(e,t,i,s){var l=this;this.removeSelection(),e.classList.add(A.selected),this.removeHover();var n=null!==e.getAttribute("data-value")?this.getFormattedValue(e.getAttribute("data-value")):null,a=this.getDataByValue(n);if(this.initial||i||(0,v.isNullOrUndefined)(t))this.selectEventCallback(e,t,i,a,n),s&&this.setSelectOptions(e,t);else{var o=this.detachChanges(a);this.isSelected=!0;var r={e:t,item:e,itemData:o,isInteracted:!!t,cancel:!1};this.trigger("select",r,(function(o){o.cancel?e.classList.remove(A.selected):(l.selectEventCallback(e,t,i,a,n),s&&l.setSelectOptions(e,t))}))}},t.prototype.selectEventCallback=function(e,t,i,s,l){this.previousItemData=(0,v.isNullOrUndefined)(this.itemData)?null:this.itemData,this.itemData!==s&&(this.previousValue=(0,v.isNullOrUndefined)(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=e,this.itemData=s;var n=this.list.querySelector("."+A.focus);if(n&&(0,v.removeClass)([n],A.focus),e.setAttribute("aria-selected","true"),(0,v.isNullOrUndefined)(l)&&(l="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()){var a=this.getIndexByValueFilter(l,this.actionCompleteData.ulElement);(0,v.isNullOrUndefined)(a)?this.activeIndex=this.getIndexByValue(l):this.activeIndex=a}else this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof g.DataManager&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(l)},t.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(A.selected)&&(this.removeSelection(),e.classList.add(A.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},t.prototype.setValue=function(e){var t=this.getItemData();this.isTouched=!(0,v.isNullOrUndefined)(e),null===t.value?N.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):N.Input.setValue(t.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():(0,v.isNullOrUndefined)(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||((0,v.detach)(this.valueTempElement),this.inputElement.style.display="block"),(0,v.isNullOrUndefined)(t.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(t.value,this.actionCompleteData.ulElement));var i=T.clearIcon,s=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+i);return this.isFiltering()&&s&&s.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===t.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value?this.value:t:t.value?this.getDataByValue(t.value):t])?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},t.prototype.setSelection=function(e,t){if(this.isValidLI(e)&&(!e.classList.contains(A.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(A.selected)))this.updateSelectedItem(e,t,!1,!0);else if(this.setSelectOptions(e,t),this.enableVirtualization&&this.value){var i,s=this.isPrimitiveData?"":this.fields.value,l=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof g.DataManager){if((i=new g.DataManager(this.virtualGroupDataSource).executeLocal((new g.Query).where(new g.Predicate(s,"equal",l))))&&i.length>0){this.itemData=i[0];var n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value;(this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text?n.text.toString():n.text,value:a})}}else if((i=new g.DataManager(this.dataSource).executeLocal((new g.Query).where(new g.Predicate(s,"equal",l))))&&i.length>0){this.itemData=i[0];n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value;(this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text?n.text.toString():n.text,value:a})}}},t.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=(0,v.isNullOrUndefined)(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(t)||((!this.isPopupOpen&&!(0,v.isNullOrUndefined)(e)||this.isPopupOpen&&!(0,v.isNullOrUndefined)(t)&&("keydown"!==t.type||"keydown"===t.type&&"enter"===t.action))&&(this.isSelectCustom=!1,this.onChangeEvent(t)),!this.isPopupOpen||(0,v.isNullOrUndefined)(this.selectedLI)||null===this.itemData||t&&"click"===t.type||this.setScrollPosition(t),"mozilla"!==v.Browser.info.name&&this.targetElement()&&((0,v.attributes)(this.targetElement(),{"aria-describedby":""!==this.inputElement.id?this.inputElement.id:this.element.id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},t.prototype.dropdownCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},t.prototype.setValueTemplate=function(){this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement&&((0,v.detach)(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null)),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:T.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var e=this.dropdownCompiler(this.valueTemplate),t=("function"!=typeof this.valueTemplate&&e?(0,v.compile)(document.querySelector(this.valueTemplate).innerHTML.trim()):(0,v.compile)(this.valueTemplate))(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);t&&t.length>0&&(0,v.append)(t,this.valueTempElement),this.renderReactTemplates()},t.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+A.selected);e.length&&((0,v.removeClass)(e,A.selected),e[0].removeAttribute("aria-selected"))}},t.prototype.getItemData=function(){var e,t,i,s=this.fields;return e=this.itemData,(0,v.isNullOrUndefined)(e)||(t=(0,v.getValue)(s.value,e),i=(0,v.getValue)(s.text,e)),{value:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:t,text:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:i}},t.prototype.onChangeEvent=function(e,t){var i=this,s=this.getItemData(),l=this.isSelectCustom?null:this.activeIndex;if(this.enableVirtualization){var n=this.dataSource instanceof g.DataManager?this.virtualGroupDataSource:this.dataSource;if(s.value&&n&&n.length>0){var a=n.findIndex((function(e){return!(0,v.isNullOrUndefined)(s.value)&&(0,v.getValue)(i.fields.value,e)===s.value}));-1!==a&&(l=a)}}var o=this.allowObjectBinding?t?this.value:this.getDataByValue(s.value):s.value;this.setProperties({index:l,text:s.text?s.text.toString():s.text,value:o},!0),this.detachChangeEvent(e)},t.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},t.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=(0,v.isNullOrUndefined)(this.text)?"":this.text,!this.initial){var t=this.detachChanges(this.itemData),i=void 0;i="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue();var s={e,item:this.item,itemData:t,previousItem:this.previousSelectedLI,previousItemData:i,isInteracted:!!e,value:this.value,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",s)}!(0,v.isNullOrUndefined)(this.value)&&""!==this.value||"Always"===this.floatLabelType||(0,v.removeClass)([this.inputWrapper.container],"e-valid-input")},t.prototype.setHiddenValue=function(){if((0,v.isNullOrUndefined)(this.value))this.hiddenElement.innerHTML="";else{var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;if(this.hiddenElement.querySelector("option"))(t=this.hiddenElement.querySelector("option")).textContent=this.text,t.setAttribute("value",e.toString());else if(!(0,v.isNullOrUndefined)(this.hiddenElement)){var t,i=document.createElement("option");i.text=this.text,i.setAttribute("selected",""),this.hiddenElement.appendChild(i),(t=this.hiddenElement.querySelector("option")).setAttribute("value",e.toString())}}},t.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,this.filterArgs=e,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,"autocomplete"!==this.getModuleName()||(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])||(0,v.attributes)(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0||""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName()&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName()&&this.hidePopup())),e.preventDefault();break;default:this.isFiltering()&&"combobox"===this.getModuleName()&&(0,v.isNullOrUndefined)(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(e),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof g.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof g.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},t.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},t.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},t.prototype.getQuery=function(e){var t;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){t=e?e.clone():this.query?this.query.clone():new g.Query;var i=""===this.typedString?"contains":this.filterType,s=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==s)&&"number"!==s){if("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString){var l=this.fields.text?this.fields.text:"";t.where(l,i,this.typedString,this.ignoreCase,this.ignoreAccent)}}else t.where("",i,this.typedString,this.ignoreCase,this.ignoreAccent)}else t=this.enableVirtualization&&!(0,v.isNullOrUndefined)(this.customFilterQuery)?this.customFilterQuery.clone():e?e.clone():this.query?this.query.clone():new g.Query;if(this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var n=this.getTakeValue(),a=!1;if(t)for(var o=0;o<t.queries.length;o++)if("onSkip"===t.queries[o].fn){a=!0;break}var r=0,h=0;if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)"onSkip"===t.queries[o].fn&&(h=t.queries[o].e.nos),"onTake"===t.queries[o].fn&&(r=n<=t.queries[o].e.nos?t.queries[o].e.nos:n);if(r<=0&&this.query&&this.query.queries.length>0)for(o=0;o<this.query.queries.length;o++)"onTake"===this.query.queries[o].fn&&(r=n<=this.query.queries[o].e.nos?this.query.queries[o].e.nos:n);if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)"onSkip"!==t.queries[o].fn?"onTake"===t.queries[o].fn&&(r=t.queries[o].e.nos<=r?r:t.queries[o].e.nos,t.queries.splice(o,1),--o):(h=t.queries[o].e.nos,t.queries.splice(o,1),a=!1,--o);!this.allowFiltering&&this.isPopupOpen&&a||(h>0?t.skip(h):t.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?t.take(this.incrementalEndIndex):r>0?t.take(r):t.take(n),t.requiresCount()}return t},t.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},t.prototype.searchLists=function(e){var t=this;(this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+T.clearIcon))&&(this.filterInput.parentElement.querySelector("."+T.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible");if(this.isDataFetched=!1,this.isFiltering()){this.checkAndResetCache(),this.isRequesting=!1;var i={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,t.customFilterQuery=s?s.clone():s,t.filteringAction(e,s,l))},baseEventArgs:e,cancel:!1};this.trigger("filtering",i,(function(e){e.cancel||t.isCustomFilter||e.preventDefaultAction||t.filteringAction(t.dataSource,null,t.fields)}))}},t.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},t.prototype.filteringAction=function(e,t,i){if(!(0,v.isNullOrUndefined)(this.filterInput)){this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData);var s=this.list.classList.contains(A.noData);if(""!==this.filterInput.value.trim()||this.itemTemplate){if(this.isNotSearchList=!1,t=""===this.filterInput.value.trim()?null:t,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(A.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),(0,v.attributes)(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&s&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),!this.list.querySelector(".e-virtual-ddl"))){l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)}}else{if(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,!(0,v.isNullOrUndefined)(this.actionCompleteData.ulElement)&&!(0,v.isNullOrUndefined)(this.actionCompleteData.list)){if(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),s&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),!this.list.querySelector(".e-virtual-ddl")))){var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)}this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)}this.isTyped=!0,(0,v.isNullOrUndefined)(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0}this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements()}},t.prototype.setSearchBox=function(e){if(this.isFiltering()){var t=e.querySelector("."+T.filterParent)?e.querySelector("."+T.filterParent):this.createElement("span",{className:T.filterParent});this.filterInput=this.createElement("input",{attrs:{type:"text"},className:T.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var i=!1;return v.Browser.isDevice&&this.isDeviceFullScreen&&(i=!0),this.filterInputObj=N.Input.createInput({element:this.filterInput,buttons:i?[T.backIcon,T.filterBarClearIcon]:[T.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),(0,v.isNullOrUndefined)(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?(0,v.addClass)([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&(0,v.addClass)([this.filterInputObj.container],"e-filled")),(0,v.append)([this.filterInputObj.container],t),(0,v.prepend)([t],e),(0,v.attributes)(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+T.clearIcon),!v.Browser.isDevice&&this.clearIconElement&&(v.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),v.Browser.isDevice?this.searchKeyModule=new v.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new v.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),v.EventHandler.add(this.filterInput,"input",this.onInput,this),v.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),v.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),v.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),v.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return V},t.prototype.onInput=function(e){!(0,v.isNullOrUndefined)(e)&&!(0,v.isNullOrUndefined)(e.data)&&e.data.length>1&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=e.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),v.Browser.isDevice&&"mozilla"===v.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},t.prototype.pasteHandler=function(e){var t=this;setTimeout((function(){t.typedString=t.filterInput.value,"combobox"===t.getModuleName()&&t.isFiltering()&&(0,v.isNullOrUndefined)(t.list)&&t.renderList(),t.searchLists(e)}))},t.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},t.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&v.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},t.prototype.onActionComplete=function(t,i,s,l){var n=this;if(this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(s)&&!this.virtualGroupDataSource&&(this.totalItemCount=s.count),!this.isNotSearchList||this.enableVirtualization){if(this.getInitialData)return this.updateActionCompleteDataValues(t,i),this.getInitialData=!1,this.isReactTemplateUpdate=!0,void this.searchLists(this.filterArgs);var a=this.itemCount;if(this.isActive||!(0,v.isNullOrUndefined)(t)){var o=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,t,i,s),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!(0,v.isNullOrUndefined)(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!(0,v.isNullOrUndefined)(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),(0,v.isNullOrUndefined)(t)||(0,v.attributes)(t,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender){if(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,this.value&&this.dataSource instanceof g.DataManager){var r=(0,v.isNullOrUndefined)(this.fields.value)?this.fields.text:this.fields.value,h=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(r,this.value):this.value,u=this.fields.value.split("."),p=i.some((function(e){return(0,v.isNullOrUndefined)(e[r])&&u.length>1?n.checkFieldValue(e,u)===h:e[r]===h}));this.enableVirtualization&&this.virtualGroupDataSource&&(p=this.virtualGroupDataSource.some((function(e){return(0,v.isNullOrUndefined)(e[r])&&u.length>1?n.checkFieldValue(e,u)===h:e[r]===h}))),p?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new g.Predicate(r,"equal",h))).then((function(e){e.result.length>0?(n.addItem(e.result,i.length),n.updateValues()):n.updateValues()}))}else this.updateValues();this.initial=!1}else"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue();if("autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped){if((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||(0,v.isNullOrUndefined)(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof g.DataManager||!(0,v.isNullOrUndefined)(this.dataSource)&&!(0,v.isNullOrUndefined)(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout((function(){n.updateActionCompleteDataValues(t,i)}),0):this.updateActionCompleteDataValues(t,i)),this.isDynamicData){var d=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(d),this.selectedLI=this.getElementByValue(d),this.isDynamicData=!1}if((this.allowCustom||this.allowFiltering&&!this.isValueInList(i,this.value)&&this.dataSource instanceof g.DataManager)&&!this.enableVirtualization)this.addNewItem(i,o);else if((this.allowCustom||this.allowFiltering&&this.isValueInList(i,this.value))&&!this.enableVirtualization){var c=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;!(0,v.isNullOrUndefined)(this.value)&&o&&o.getAttribute("data-value")===c.toString()&&this.addNewItem(i,o)}(!(0,v.isNullOrUndefined)(this.itemData)||(0,v.isNullOrUndefined)(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(t,i)}else if(this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()){c=this.getItemData().value;this.activeIndex=this.getIndexByValue(c);var m=this.findListElement(this.list,"li","data-value",c);this.selectedLI=m}else this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount);this.beforePopupOpen&&(this.renderPopup(s),this.enableVirtualization&&(this.list.querySelector(".e-virtual-list")||(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"))),this.enableVirtualization&&a!==this.itemCount&&this.resetList(this.dataSource,this.fields))}}else this.isNotSearchList=!1},t.prototype.isValueInList=function(e,t){if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return!0}else if("object"==typeof e&&null!==e)for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===t)return!0;return!1},t.prototype.checkFieldValue=function(e,t){var i=e;return t.forEach((function(e){i=i[e]})),i},t.prototype.updateActionCompleteDataValues=function(e,t){this.actionCompleteData={ulElement:e.cloneNode(!0),list:t,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},t.prototype.addNewItem=function(e,t){var i=this;if(!(0,v.isNullOrUndefined)(this.itemData)&&!(0,v.isNullOrUndefined)(t)){var s=this.getItemData().value;e.some((function(e){return("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&e===s||(0,v.getValue)(i.fields.value,e)===s}))||this.addItem(this.itemData)}},t.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout((function(){s.actionCompleteDataUpdate(e,t,i)}),0):this.actionCompleteDataUpdate(e,t,i))},t.prototype.actionCompleteDataUpdate=function(e,t,i){null!==i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},t.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.enableVirtualization&&!(0,v.isNullOrUndefined)(e)||!this.enableVirtualization?this.getIndexByValue(e):this.activeIndex;var t=this.findListElement(this.list,"li","data-value",e);this.selectedLI=t,this.activeItem(t),this.enableVirtualization&&(0,v.isNullOrUndefined)(t)||this.removeFocus()},t.prototype.updateSelection=function(){var e=this.list.querySelector("."+A.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+A.li).classList.add(T.focus))},t.prototype.updateSelectionList=function(){if(!(this.list&&this.list.querySelector(".e-active"))&&!(0,v.isNullOrUndefined)(this.value)&&"autocomplete"!==this.getModuleName()){var e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,t=this.findListElement(this.list,"li","data-value",e);t&&t.classList.add("e-active")}},t.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+T.focus);e&&e.length&&(0,v.removeClass)(e,T.focus)},t.prototype.renderPopup=function(e){var t=this;if(this.popupObj&&document.body.contains(this.popupObj.element))this.refreshPopup();else{this.trigger("beforeOpen",{cancel:!1},(function(i){if(i.cancel)t.beforePopupOpen=!1;else{var s=t.createElement("div",{id:t.element.id+"_popup",className:"e-ddl e-popup "+(null!==t.cssClass?t.cssClass:"")});s.setAttribute("aria-label",t.element.id),s.setAttribute("role","dialog");var l=t.setSearchBox(s);if(t.listContainerHeight=t.allowFiltering&&"dropdownlist"===t.getModuleName()&&v.Browser.isDevice?(0,v.formatUnit)(Math.round(window.outerHeight).toString()+"px"):(0,v.formatUnit)(t.popupHeight),t.headerTemplate&&(t.setHeaderTemplate(s),t.isUpdateHeaderHeight=0!==t.header.offsetHeight),(0,v.append)([t.list],s),t.footerTemplate&&(t.setFooterTemplate(s),t.isUpdateFooterHeight=0!==t.footer.offsetHeight),document.body.appendChild(s),s.style.top="0px",t.enableVirtualization&&t.itemTemplate){var n=s.querySelectorAll("li.e-list-item:not(.e-virtual-list)");t.listItemHeight=n.length>0?Math.ceil(n[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(n[0]).marginBottom,10):0}if(t.enableVirtualization&&!t.list.classList.contains(A.noData))if(t.getSkeletonCount(),t.skeletonCount=t.totalItemCount<2*t.itemCount&&(!(t.dataSource instanceof g.DataManager)||t.dataSource instanceof g.DataManager&&t.totalItemCount<=t.itemCount)?0:t.skeletonCount,t.list.querySelector(".e-virtual-ddl-content")?t.list.getElementsByClassName("e-virtual-ddl-content")[0].style=t.getTransformValues():t.list.appendChild(t.createElement("div",{className:"e-virtual-ddl-content",styles:t.getTransformValues()})).appendChild(t.list.querySelector(".e-list-parent")),t.UpdateSkeleton(),t.liCollections=t.list.querySelectorAll("."+A.li),t.virtualItemCount=t.itemCount,t.list.querySelector(".e-virtual-ddl"))t.list.getElementsByClassName("e-virtual-ddl")[0].style=t.GetVirtualTrackHeight();else{var a=t.createElement("div",{id:t.element.id+"_popup",className:"e-virtual-ddl",styles:t.GetVirtualTrackHeight()});s.querySelector(".e-dropdownbase").appendChild(a)}if(s.style.visibility="hidden","auto"!==t.popupHeight){if(t.searchBoxHeight=0,(0,v.isNullOrUndefined)(l.container)||"combobox"===t.getModuleName()||"autocomplete"===t.getModuleName()||(t.searchBoxHeight=l.container.parentElement.getBoundingClientRect().height,t.listContainerHeight=(parseInt(t.listContainerHeight,10)-t.searchBoxHeight).toString()+"px"),t.headerTemplate){t.header=t.header?t.header:s.querySelector(".e-ddl-header");var o=Math.round(t.header.getBoundingClientRect().height);t.listContainerHeight=(parseInt(t.listContainerHeight,10)-(o+t.searchBoxHeight)).toString()+"px"}if(t.footerTemplate){t.footer=t.footer?t.footer:s.querySelector(".e-ddl-footer");o=Math.round(t.footer.getBoundingClientRect().height);t.listContainerHeight=(parseInt(t.listContainerHeight,10)-(o+t.searchBoxHeight)).toString()+"px"}t.list.style.maxHeight=(parseInt(t.listContainerHeight,10)-2).toString()+"px",s.style.maxHeight=(0,v.formatUnit)(t.popupHeight)}else s.style.height="auto";var r=0,h=void 0;if(t.isPreventScrollAction=!0,!(0,v.isNullOrUndefined)(t.selectedLI)&&!(0,v.isNullOrUndefined)(t.activeIndex)&&t.activeIndex>=0||t.enableVirtualization?t.setScrollPosition():t.list.scrollTop=0,v.Browser.isDevice&&t.isDeviceFullScreen&&!t.allowFiltering&&("dropdownlist"===t.getModuleName()||t.isDropDownClick&&"combobox"===t.getModuleName())){r=t.getOffsetValue(s);var u=t.isEmptyList()?t.list:t.liCollections[0];(0,v.isNullOrUndefined)(t.inputElement)||(h=-(parseInt(getComputedStyle(u).textIndent,10)-parseInt(getComputedStyle(t.inputElement).paddingLeft,10)+parseInt(getComputedStyle(t.inputElement.parentElement).borderLeftWidth,10)))}t.createPopup(s,r,h),t.popupContentElement=t.popupObj.element.querySelector(".e-content"),t.getFocusElement(),t.checkCollision(s),v.Browser.isDevice&&(parseInt(t.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==t.getModuleName()||!t.allowFiltering)&&t.popupObj.element.classList.add("e-wide-popup"),t.popupObj.element.classList.add(T.device),("dropdownlist"===t.getModuleName()||"combobox"===t.getModuleName()&&!t.allowFiltering&&t.isDropDownClick)&&(t.popupObj.collision={X:"fit",Y:"fit"}),t.isFilterLayout()&&t.isDeviceFullScreen&&(t.popupObj.element.classList.add(T.mobileFilter),t.popupObj.position={X:0,Y:0},t.popupObj.dataBind(),(0,v.attributes)(t.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),(0,v.addClass)([document.body,t.popupObj.element],T.popupFullScreen),t.setSearchBoxPosition(),t.backIconElement=l.container.querySelector(".e-back-icon"),t.clearIconElement=l.container.querySelector("."+T.clearIcon),v.EventHandler.add(t.backIconElement,"click",t.clickOnBackIcon,t),v.EventHandler.add(t.clearIconElement,"click",t.clearText,t))),s.style.visibility="visible",(0,v.addClass)([s],"e-popup-close");for(var p=0,d=t.popupObj.getScrollableParent(t.inputWrapper.container);p<d.length;p++){var c=d[p];v.EventHandler.add(c,"scroll",t.scrollHandler,t)}(0,v.isNullOrUndefined)(t.list)||(t.unWireListEvents(),t.wireListEvents()),t.selectedElementID=t.selectedLI?t.selectedLI.id:null,t.enableVirtualization&&(t.notify("bindScrollEvent",{module:"VirtualScroll",component:t.getModuleName(),enable:t.enableVirtualization}),setTimeout((function(){(t.value||t.list.querySelector(".e-active"))&&(t.updateSelectionList(),t.selectedValueInfo&&t.viewPortInfo&&t.viewPortInfo.offsets.top?t.list.scrollTop=t.viewPortInfo.offsets.top:t.scrollBottom(!0,!0))}),5)),(0,v.attributes)(t.targetElement(),{"aria-expanded":"true","aria-owns":t.element.id+"_popup","aria-controls":t.element.id}),"dropdownlist"!==t.getModuleName()&&t.list.classList.contains("e-nodata")&&((0,v.attributes)(t.targetElement(),{"aria-activedescendant":"no-record"}),t.popupContentElement.setAttribute("role","status"),t.popupContentElement.setAttribute("id","no-record")),t.inputElement.setAttribute("aria-expanded","true"),t.inputElement.setAttribute("aria-controls",t.element.id+"_popup");var m=t.isFiltering()?t.filterInput.parentElement:t.inputWrapper.container;(0,v.addClass)([m],[T.inputFocus]);t.beforePopupOpen=!0;var f={popup:t.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}};if(t.trigger("open",f,(function(e){e.cancel?(t.beforePopupOpen=!1,t.destroyPopup()):((0,v.isNullOrUndefined)(t.inputWrapper)||(0,v.addClass)([t.inputWrapper.container],[T.iconAnimation]),t.renderReactTemplates(),t.isReact&&t.isFiltering()&&t.dataSource instanceof g.DataManager&&t.list.querySelector("ul")&&!t.isSecondClick&&t.executeCloneElements(),(0,v.isNullOrUndefined)(t.popupObj)||t.popupObj.show(new v.Animation(e.animation),1e3===t.zIndex?t.element:null),t.isReact&&setTimeout((function(){if(t.popupHeight&&t.list&&"auto"!==t.popupHeight&&("dropdownlist"!==t.getModuleName()||!t.allowFiltering)){var e="string"==typeof t.popupHeight?parseInt(t.popupHeight,10):t.popupHeight;if(!t.isUpdateHeaderHeight&&t.headerTemplate&&t.header){var i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.header.offsetHeight).toString()+"px",t.isUpdateHeaderHeight=!0}if(!t.isUpdateFooterHeight&&t.footerTemplate&&t.footer){i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.footer.offsetHeight).toString()+"px",t.isUpdateFooterHeight=!0}}}),15))})),t.allowResize&&("dropdownlist"!==t.getModuleName()||!(v.Browser.isDevice&&t.isDeviceFullScreen&&t.allowFiltering))){t.resizer=t.createElement("div",{id:t.element.id+"_resize-popup",className:T.resizeIcon}),t.list&&t.list.parentElement&&(t.list.parentElement.classList.add("e-resize"),"auto"!==t.popupHeight.toString().toLowerCase()&&(t.list.parentElement.style.height="100%"),t.list.parentElement.style.paddingBottom="dropdownlist"===t.getModuleName()&&t.allowFiltering&&t.searchBoxHeight?(t.searchBoxHeight+16).toString()+"px":16..toString()+"px",(t.header||t.footer||t.itemTemplate)&&(t.list.parentElement.style.paddingBottom=(parseInt(t.list.parentElement.style.maxHeight,10)-parseInt(t.list.style.maxHeight,10)+16).toString()+"px"),t.list.parentElement.appendChild(t.resizer),t.list.parentElement.style.width=t.resizeWidth+"px",t.list.parentElement.style.height=t.resizeHeight+"px",t.list.parentElement.style.maxHeight=t.resizeHeight+"px",t.list.style.maxHeight=t.resizeHeight+"px"),v.EventHandler.add(t.resizer,"mousedown",t.startResizing,t),v.EventHandler.add(t.resizer,"touchstart",t.startResizing,t)}}}))}},t.prototype.checkCollision=function(e){(!v.Browser.isDevice||v.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&((0,k.isCollide)(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},t.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},t.prototype.createPopup=function(e,t,i){var s=this;this.popupObj=new k.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){s.isDocumentClick||s.focusDropDown(),s.isReact&&s.clearTemplate(["headerTemplate","footerTemplate"]),s.isNotSearchList=!1,s.isDocumentClick=!1,s.destroyPopup(),s.isFiltering()&&s.actionCompleteData.list&&s.actionCompleteData.list.length>0?(s.isActive=!0,s.isReactTemplateUpdate&&s.isReact&&s.itemTemplate&&!s.enableVirtualization&&(s.actionCompleteData.ulElement=s.renderItems(s.actionCompleteData.list,s.fields),s.isReactTemplateUpdate=!1),s.enableVirtualization?s.onActionComplete(s.ulElement,s.listData,null,!0):s.onActionComplete(s.actionCompleteData.ulElement,s.actionCompleteData.list,null,!0)):s.enableVirtualization&&s.focusIndexItem()},open:function(){v.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0;var e=s.actionCompleteData&&s.actionCompleteData.ulElement&&s.actionCompleteData.ulElement.querySelector("li"),t=s.list.querySelector("ul li");(0,v.isNullOrUndefined)(s.ulElement)||(0,v.isNullOrUndefined)(s.ulElement.getElementsByClassName("e-item-focus")[0])?(0,v.isNullOrUndefined)(s.ulElement)||(0,v.isNullOrUndefined)(s.ulElement.getElementsByClassName("e-active")[0])||(0,v.attributes)(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-active")[0].id}):(0,v.attributes)(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-item-focus")[0].id}),s.isFiltering()&&s.itemTemplate&&s.element.tagName===s.getNgDirective()&&e&&t&&e.textContent!==t.textContent&&"EJS-COMBOBOX"!==s.element.tagName&&s.cloneElements(),s.isFilterLayout()&&((0,v.removeClass)([s.inputWrapper.container],[T.inputFocus]),s.isFilterFocus=!0,s.filterInput.focus(),s.inputWrapper.clearButton&&(0,v.addClass)([s.inputWrapper.clearButton],T.clearIconHide)),s.activeStateChange()},targetExitViewport:function(){v.Browser.isDevice||s.hidePopup()}})},t.prototype.isEmptyList=function(){return!(0,v.isNullOrUndefined)(this.liCollections)&&0===this.liCollections.length},t.prototype.getFocusElement=function(){},t.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},t.prototype.scrollHandler=function(){v.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},t.prototype.isElementInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth},t.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height;this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px";var t=this.filterInput.parentElement.querySelector("."+T.clearIcon);(0,v.detach)(this.filterInput),t.parentElement.insertBefore(this.filterInput,t)},t.prototype.setPopupPosition=function(e){var t,i=e,s=this.list.querySelector("."+T.focus)||this.selectedLI,l=this.isEmptyList()?this.list:this.liCollections[0],n=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],a=l.getBoundingClientRect().height;this.listItemHeight=a+parseInt(window.getComputedStyle(l).marginBottom,10);var o=this.list.offsetHeight/2,r=(0,v.isNullOrUndefined)(s)?l.offsetTop:s.offsetTop;if(n.offsetTop-o<r&&!(0,v.isNullOrUndefined)(this.liCollections)&&this.liCollections.length>0&&!(0,v.isNullOrUndefined)(s)){var h=this.list.offsetHeight/a,u=parseInt(getComputedStyle(this.list).paddingBottom,10);t=(h-(this.liCollections.length-this.activeIndex))*a-i+u,this.list.scrollTop=s.offsetTop}else r>o&&!this.enableVirtualization?(t=o-a/2,this.list.scrollTop=r-o+a/2):t=r;return-(t=t+a+i-(a-this.inputWrapper.container.offsetHeight)/2)},t.prototype.setWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px");if(v.Browser.isDevice&&e.indexOf("px")>-1&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var t=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(t).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},t.prototype.scrollBottom=function(e,t,i){var s=this;if(void 0===t&&(t=!1),void 0===i&&(i=null),(0,v.isNullOrUndefined)(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+A.li),!(0,v.isNullOrUndefined)(this.selectedLI)&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount])),!(0,v.isNullOrUndefined)(this.selectedLI)){var l=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0;this.isUpwardScrolling=!1;var n=this.list.querySelectorAll(".e-virtual-list").length,a=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+l):this.selectedLI.offsetTop,r=this.list.offsetHeight,h=o-n*(this.selectedLI.offsetHeight+l)+(this.selectedLI.offsetHeight+l)-this.list.scrollTop,u=this.list.scrollTop+h-r,p=!1;u=e?u+2*parseInt(getComputedStyle(this.list).paddingTop,10):u+parseInt(getComputedStyle(this.list).paddingTop,10);var d=o-n*(this.selectedLI.offsetHeight+l)+(this.selectedLI.offsetHeight+l)-this.list.scrollTop;if(d=this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?d-this.fixedHeaderElement.offsetHeight:d,0!==this.activeIndex||this.enableVirtualization){if(h>r||!(d>0&&this.list.offsetHeight>d)){var c=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,m="pageDown"===i?this.getPageCount()-2:1;!this.enableVirtualization||this.isKeyBoardAction||t?this.isKeyBoardAction&&this.enableVirtualization&&a&&c===a&&"end"!==i&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=u:(this.enableVirtualization&&(m="pageDown"===i?this.getPageCount()+1:m),this.list.scrollTop+=(this.selectedLI.offsetHeight+l)*m),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===i?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=u):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?e&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,p=this.isKeyBoardAction}}else this.list.scrollTop=0,p=this.isKeyBoardAction;this.isKeyBoardAction=p,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===i&&setTimeout((function(){s.scrollStop(null,!0)}),100)}},t.prototype.scrollTop=function(e){if(void 0===e&&(e=null),!(0,v.isNullOrUndefined)(this.selectedLI)){var t=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,i=this.list.querySelectorAll(".e-virtual-list").length,s=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+t):this.selectedLI.offsetTop,l=s-i*(this.selectedLI.offsetHeight+t)-this.list.scrollTop,n=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;l=this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?l-this.fixedHeaderElement.offsetHeight:l;var a=s-i*(this.selectedLI.offsetHeight+t)+(this.selectedLI.offsetHeight+t)-this.list.scrollTop,o=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&l<=0;if(0!==this.activeIndex||this.enableVirtualization)if(l<0||o){var r=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,h="pageUp"===e?this.getPageCount()-2:1;this.enableVirtualization&&(h="pageUp"===e?this.getPageCount():h),this.enableVirtualization&&this.isKeyBoardAction&&n&&r===n&&"home"!==e&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+t)*h,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===e?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===e&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+l)}else a>0&&this.list.offsetHeight>a||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0}},t.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},t.prototype.isEditTextBox=function(){return!1},t.prototype.isFiltering=function(){return this.allowFiltering},t.prototype.isPopupButton=function(){return!0},t.prototype.setScrollPosition=function(e){if(this.isPreventScrollAction=!0,(0,v.isNullOrUndefined)(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,e.action);break;default:this.isKeyBoardAction="up"===e.action||"pageUp"===e.action||"open"===e.action,this.scrollTop(e.action)}this.isKeyBoardAction=!1},t.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},t.prototype.setEleWidth=function(e){(0,v.isNullOrUndefined)(e)||("number"==typeof e?this.inputWrapper.container.style.width=(0,v.formatUnit)(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:(0,v.formatUnit)(e)))},t.prototype.closePopup=function(e,t){var i=this,s=!(0,v.isNullOrUndefined)(this.filterInput)&&!(0,v.isNullOrUndefined)(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var l=0,n=this.popupObj.getScrollableParent(this.inputWrapper.container);l<n.length;l++){var a=n[l];v.EventHandler.remove(a,"scroll",this.scrollHandler)}v.Browser.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&(0,v.removeClass)([document.body,this.popupObj.element],T.popupFullScreen),this.isFilterLayout()&&(v.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&v.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(v.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),v.EventHandler.remove(this.clearIconElement,"click",this.clearText)),(0,v.isNullOrUndefined)(this.filterInput)||(v.EventHandler.remove(this.filterInput,"input",this.onInput),v.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),v.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),v.EventHandler.remove(this.filterInput,"blur",this.onBlurHandler),v.EventHandler.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),(0,v.attributes)(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(T.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&this.viewPortInfo.endIndex>0?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!(0,v.isNullOrUndefined)(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!(0,v.isNullOrUndefined)(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;var o,r={name:"FadeOut",duration:100,delay:e||0},h={popup:this.popupObj,cancel:!1,animation:r,event:t||null};this.trigger("close",h,(function(e){if("dropdownlist"===i.getModuleName()&&N.Input.destroy({element:i.filterInput,floatLabelType:i.floatLabelType,properties:{placeholder:i.filterBarPlaceholder},buttons:i.clearIconElement},i.clearIconElement),i.filterInputObj=null,!(0,v.isNullOrUndefined)(i.popupObj)&&!(0,v.isNullOrUndefined)(i.popupObj.element.querySelector(".e-fixed-head"))){var t=i.popupObj.element.querySelector(".e-fixed-head");t.parentNode.removeChild(t),i.fixedHeaderElement=null}e.cancel||("autocomplete"===i.getModuleName()&&i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new v.Animation(e.animation)):i.destroyPopup())})),v.Browser.isDevice&&!h.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup"),o=this.dataSource instanceof g.DataManager?this.virtualGroupDataSource&&this.virtualGroupDataSource.length?this.virtualGroupDataSource.length:0:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.enableVirtualization&&this.isFiltering()&&s&&this.totalItemCount!==o&&(this.updateInitialData(),this.checkAndResetCache())}},t.prototype.updateInitialData=function(){var e=this.selectData;if(!(0,v.isNullOrUndefined)(e)){var t=this.renderItems(e,this.fields);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof g.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement){var i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(i)}"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=e,this.updateActionCompleteDataValues(t,e),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}},t.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(v.EventHandler.remove(this.resizer,"mousedown",this.startResizing),v.EventHandler.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),(0,v.detach)(this.popupObj.element))},t.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},t.prototype.render=function(){this.preselectedIndex=(0,v.isNullOrUndefined)(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,(0,v.isNullOrUndefined)(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),(0,v.isNullOrUndefined)(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass;(0,v.isNullOrUndefined)(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!(0,v.isNullOrUndefined)((0,v.closest)(this.element,"fieldset"))&&(0,v.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=N.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[T.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:T.hiddenElement}}),(0,v.prepend)([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=(0,v.formatUnit)(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&N.Input.calculateWidth(this.inputElement,this.inputWrapper.container),!(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var t=this.element.getAttribute("id")?this.element.getAttribute("id"):(0,v.getUniqueID)("ej2_dropdownlist");if(this.element.id=t,this.hiddenElement.id=t+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||(0,v.attributes)(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),(0,v.attributes)(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text)this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index&&(this.activeIndex=this.index+this.skeletonCount)),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount);else if("SELECT"===this.element.tagName&&this.element.options[0]){var i=this.element;this.value=this.allowObjectBinding?this.getDataByValue(i.options[i.selectedIndex].value):i.options[i.selectedIndex].value,this.text=(0,v.isNullOrUndefined)(this.value)?null:i.options[i.selectedIndex].textContent,this.initValue()}this.setEnabled(),this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),(0,v.isNullOrUndefined)(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false");var s=this.inputWrapper.container.getElementsByClassName("e-float-text")[0];(0,v.isNullOrUndefined)(this.element.id)||""===this.element.id||(0,v.isNullOrUndefined)(s)||(s.id="label_"+this.element.id.replace(/ /g,"_"),(0,v.attributes)(this.inputElement,{"aria-labelledby":s.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount},t.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=(0,v.formatUnit)(this.popupHeight);e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var s=Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10);return e.remove(),s},t.prototype.setFooterTemplate=function(e){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),(0,v.addClass)([this.footer],T.footer));var t=this.dropdownCompiler(this.footerTemplate),i=("function"!=typeof this.footerTemplate&&t?(0,v.compile)((0,v.select)(this.footerTemplate,document).innerHTML.trim()):(0,v.compile)(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);i&&i.length>0&&(0,v.append)(i,this.footer),(0,v.append)([this.footer],e)},t.prototype.setHeaderTemplate=function(e){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),(0,v.addClass)([this.header],T.header));var t=this.dropdownCompiler(this.headerTemplate),i=("function"!=typeof this.headerTemplate&&t?(0,v.compile)((0,v.select)(this.headerTemplate,document).innerHTML.trim()):(0,v.compile)(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);i&&i.length&&(0,v.append)(i,this.header);var s=e.querySelector("div.e-content");e.insertBefore(this.header,s)},t.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},t.prototype.setOldText=function(e){this.text=e},t.prototype.setOldValue=function(e){this.value=e},t.prototype.refreshPopup=function(){(0,v.isNullOrUndefined)(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||v.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||((0,v.removeClass)([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},t.prototype.checkData=function(e){!e.dataSource||(0,v.isNullOrUndefined)(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof g.DataManager||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var t=-1!==Object.keys(e).indexOf("value")&&(0,v.isNullOrUndefined)(e.value),i=-1!==Object.keys(e).indexOf("text")&&(0,v.isNullOrUndefined)(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(t||i)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!(0,v.isNullOrUndefined)(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!(0,v.isNullOrUndefined)(Object.keys(e.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},t.prototype.updateDataSource=function(e,t){""===this.inputElement.value&&((0,v.isNullOrUndefined)(e)||!(0,v.isNullOrUndefined)(e.dataSource)&&(e.dataSource instanceof g.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),this.fields.groupBy&&e.fields&&!this.isGroupChecking&&this.list&&(v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),v.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this)),((0,v.isNullOrUndefined)(e)||!(0,v.isNullOrUndefined)(e.dataSource)&&(e.dataSource instanceof g.DataManager||0!==e.dataSource.length)||e.dataSource instanceof g.DataManager||!(0,v.isNullOrUndefined)(e)&&Array.isArray(e.dataSource)&&!(0,v.isNullOrUndefined)(t)&&Array.isArray(t.dataSource)&&e.dataSource.length!==t.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},t.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var t=this.getItemData(),i=this.allowObjectBinding?this.itemData:t.value,s=(0,v.isNullOrUndefined)(i)?null:this.index;(0,v.isNullOrUndefined)(s)&&e===i||this.isAngular?this.setProperties({text:t.text?t.text.toString():t.text,value:i}):this.setProperties({text:t.text?t.text.toString():t.text,index:s,value:i})},t.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.onPropertyChanged=function(t,i){var s=this;(0,v.isNullOrUndefined)(t.dataSource)||this.isTouched||!(0,v.isNullOrUndefined)(t.value)||!(0,v.isNullOrUndefined)(t.index)||(0,v.isNullOrUndefined)(this.preselectedIndex)||(0,v.isNullOrUndefined)(this.index)||(t.index=this.index),(0,v.isNullOrUndefined)(t.value)&&(0,v.isNullOrUndefined)(t.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(t),this.setUpdateInitial(["fields","query","dataSource"],t));for(var l=function(l){switch(l){case"query":case"dataSource":n.getSkeletonCount(),n.checkAndResetCache();break;case"htmlAttributes":n.setHTMLAttributes();break;case"width":n.setEleWidth(t.width),N.Input.calculateWidth(n.inputElement,n.inputWrapper.container);break;case"placeholder":N.Input.setPlaceholder(t.placeholder,n.inputElement);break;case"filterBarPlaceholder":n.filterInput&&N.Input.setPlaceholder(t.filterBarPlaceholder,n.filterInput);break;case"readonly":"dropdownlist"!==n.getModuleName()&&N.Input.setReadonly(t.readonly,n.inputElement),n.setReadOnly();break;case"cssClass":n.setCssClass(t.cssClass,i.cssClass),N.Input.calculateWidth(n.inputElement,n.inputWrapper.container);break;case"enableRtl":n.setEnableRtl();break;case"enabled":n.setEnable();break;case"text":if(n.fields.disabled&&(t.text=t.text&&!n.isDisabledItemByIndex(n.getIndexByValue(n.getValueByText(t.text)))?t.text:null),null===t.text){n.clearAll();break}if(n.enableVirtualization){n.updateValues(),n.updateInputFields(),n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"});break}if(n.list||(n.dataSource instanceof g.DataManager&&(n.initialRemoteRender=!0),n.renderList()),!n.initialRemoteRender){var a=n.getElementByText(t.text);if(!n.checkValidLi(a))if(n.liCollections&&100===n.liCollections.length&&"autocomplete"===n.getModuleName()&&n.listData.length>100)n.setSelectionData(t.text,i.text,"text");else if(t.text&&n.dataSource instanceof g.DataManager){var o=n.getItems().length,r=(0,v.isNullOrUndefined)(n.fields.text)?n.fields.value:n.fields.text;n.typedString="",n.dataSource.executeQuery(n.getQuery(n.query).where(new g.Predicate(r,"equal",t.text))).then((function(e){e.result.length>0?(s.addItem(e.result,o),s.updateValues()):s.setOldText(i.text)}))}else"autocomplete"===n.getModuleName()?n.setInputValue(t,i):n.setOldText(i.text);n.updateInputFields()}break;case"value":if(n.fields.disabled&&(t.value=null==t.value||n.isDisableItemValue(t.value)?null:t.value),null===t.value){n.clearAll();break}if(n.allowObjectBinding&&!(0,v.isNullOrUndefined)(t.value)&&!(0,v.isNullOrUndefined)(i.value)&&n.isObjectInArray(t.value,[i.value]))return{value:void 0};if(n.enableVirtualization){n.updateValues(),n.updateInputFields(),n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),n.preventChange=n.isAngular&&n.preventChange?!n.preventChange:n.preventChange;break}if(n.notify("beforeValueChange",{newProp:t}),n.list||(n.dataSource instanceof g.DataManager&&(n.initialRemoteRender=!0),n.renderList()),!n.initialRemoteRender){var h=n.allowObjectBinding&&!(0,v.isNullOrUndefined)(t.value)?(0,v.getValue)(n.fields.value?n.fields.value:"",t.value):t.value,u=n.getElementByValue(h);if(!n.checkValidLi(u))if(n.liCollections&&100===n.liCollections.length&&"autocomplete"===n.getModuleName()&&n.listData.length>100)n.setSelectionData(t.value,i.value,"value");else if(t.value&&n.dataSource instanceof g.DataManager){var p=n.getItems().length;r=(0,v.isNullOrUndefined)(n.fields.value)?n.fields.text:n.fields.value;n.typedString="";var d=n.allowObjectBinding&&!(0,v.isNullOrUndefined)(t.value)?(0,v.getValue)(r,t.value):t.value;n.dataSource.executeQuery(n.getQuery(n.query).where(new g.Predicate(r,"equal",d))).then((function(e){e.result.length>0?(s.addItem(e.result,p),s.updateValues()):s.setOldValue(i.value)}))}else"autocomplete"===n.getModuleName()?n.setInputValue(t,i):n.setOldValue(i.value);n.updateInputFields(),n.preventChange=n.isAngular&&n.preventChange?!n.preventChange:n.preventChange}break;case"index":if(n.fields.disabled&&(t.index=null==t.index||n.isDisabledItemByIndex(t.index)?null:t.index),null===t.index){n.clearAll();break}if(n.list||(n.dataSource instanceof g.DataManager&&(n.initialRemoteRender=!0),n.renderList()),!n.initialRemoteRender&&n.liCollections){var c=n.liCollections[t.index];n.checkValidLi(c)||(n.liCollections&&100===n.liCollections.length&&"autocomplete"===n.getModuleName()&&n.listData.length>100?n.setSelectionData(t.index,i.index,"index"):n.index=i.index),n.updateInputFields()}break;case"footerTemplate":n.popupObj&&n.setFooterTemplate(n.popupObj.element);break;case"headerTemplate":n.popupObj&&n.setHeaderTemplate(n.popupObj.element);break;case"valueTemplate":(0,v.isNullOrUndefined)(n.itemData)||null===n.valueTemplate||n.setValueTemplate();break;case"allowFiltering":n.allowFiltering&&(n.actionCompleteData={ulElement:n.ulElement,list:n.listData,isUpdated:!0},n.actionData=n.actionCompleteData,n.updateSelectElementData(n.allowFiltering));break;case"floatLabelType":N.Input.removeFloating(n.inputWrapper),N.Input.addFloating(n.inputElement,t.floatLabelType,n.placeholder,n.createElement),!(0,v.isNullOrUndefined)(n.inputWrapper.buttons[0])&&n.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==n.floatLabelType&&n.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":n.inputWrapper.clearButton||(N.Input.setClearButton(t.showClearButton,n.inputElement,n.inputWrapper,null,n.createElement),n.bindClearEvent());break;default:var m=n.getPropObject(l,t,i);e.prototype.onPropertyChanged.call(n,m.newProperty,m.oldProperty)}},n=this,a=0,o=Object.keys(t);a<o.length;a++){var r=l(o[a]);if("object"==typeof r)return r.value}},t.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},t.prototype.setSelectionData=function(e,t,i){var s,l=this;this.updateListValues=function(){if("text"===i)s=l.getElementByText(e),l.checkValidLi(s)||l.setOldText(t);else if("value"===i){var n=l.fields.value?l.fields.value:"";l.allowObjectBinding&&!(0,v.isNullOrUndefined)(e)&&(0,v.getValue)(n,e);s=l.getElementByValue(e),l.checkValidLi(s)||l.setOldValue(t)}else"index"===i&&(s=l.liCollections[e],l.checkValidLi(s)||(l.index=t))}},t.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},t.prototype.setReadOnly=function(){this.readonly?(0,v.addClass)([this.inputWrapper.container],["e-readonly"]):(0,v.removeClass)([this.inputWrapper.container],["e-readonly"])},t.prototype.setInputValue=function(e,t){},t.prototype.setCssClass=function(e,t){(0,v.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,v.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),N.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupObj&&N.Input.setCssClass(e,[this.popupObj.element],t)},t.prototype.getModuleName=function(){return"dropdownlist"},t.prototype.showPopup=function(e){this.enabled&&(this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof g.DataManager&&this.actionData.list!==this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):((0,v.isNullOrUndefined)(this.list)||!(0,v.isUndefined)(this.list)&&(this.list.classList.contains(A.noData)||this.list.querySelectorAll("."+A.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(e)),this.enableVirtualization&&this.listData&&this.listData.length&&((0,v.isNullOrUndefined)(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(e),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&this.selectedValueInfo.startIndex>0&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()))},t.prototype.executeCloneElements=function(){var e=this,t=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout((function(){e.cloneElements(),e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof g.DataManager&&!e.list.querySelector("ul"))}),t)},t.prototype.invokeRenderPopup=function(e){if(v.Browser.isDevice&&this.isFilterLayout()){var t=this;window.onpopstate=function(){t.hidePopup()},history.pushState({},"")}(0,v.isNullOrUndefined)(this.list)||(0,v.isNullOrUndefined)(this.list.children[0])&&!this.list.classList.contains(A.noData)||this.renderPopup(e)},t.prototype.renderHightSearch=function(){},t.prototype.hidePopup=function(e){if(this.isEscapeKey&&"dropdownlist"===this.getModuleName())if((0,v.isNullOrUndefined)(this.inputElement)||N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,(0,v.isNullOrUndefined)(this.index))this.resetSelection();else{var t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,i=this.findListElement(this.ulElement,"li","data-value",t);this.selectedLI=this.liCollections[this.index]||i,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,e);var s=this.getItemData(),l=!(0,v.isNullOrUndefined)(this.selectedLI);l&&this.enableVirtualization&&this.selectedLI.classList&&(l=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||l&&this.inputElement.value!==s.text)&&(this.isSelectCustom=!1,this.clearAll(e))},t.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(T.disable)){var t=!1;this.preventFocus&&v.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,t=!0),t||this.targetElement().focus(),(0,v.addClass)([this.inputWrapper.container],[T.inputFocus]),this.onFocus(e),"Never"!==this.floatLabelType&&N.Input.calculateWidth(this.inputElement,this.inputWrapper.container)}},t.prototype.focusOut=function(e){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),(0,v.removeClass)([this.inputWrapper.container],[T.inputFocus]),"Never"!==this.floatLabelType&&N.Input.calculateWidth(this.inputElement,this.inputWrapper.container))},t.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e)if(e instanceof HTMLLIElement){for(var i=0;i<this.liCollections.length;i++)if(this.liCollections[i]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else{var s=JSON.parse(JSON.stringify(e))[this.fields.value];for(i=0;i<this.listData.length;i++)if(JSON.parse(JSON.stringify(this.listData[i]))[this.fields.value]===s){t=this.getIndexByValue(s);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData,l.classList.contains(T.focus)&&this.removeFocus(),l.classList.contains(T.selected)&&this.clear()}}}}},t.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),h(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&this.popupObj.hide(),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var t=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],i=0;i<t.length;i++)this.inputElement.removeAttribute(t[i]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),N.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName===this.getNgDirective()||this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),(0,v.detach)(this.inputWrapper.container)),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!(0,v.isNullOrUndefined)(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!(0,v.isNullOrUndefined)(this.inputElement.onselect)&&(this.inputElement.onselect=null),N.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,e.prototype.destroy.call(this)}},t.prototype.getItems=function(){return this.list||(this.dataSource instanceof g.DataManager&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},t.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},t.prototype.clear=function(){this.value=null},B([(0,v.Property)(null)],t.prototype,"cssClass",void 0),B([(0,v.Property)("100%")],t.prototype,"width",void 0),B([(0,v.Property)(!0)],t.prototype,"enabled",void 0),B([(0,v.Property)(!1)],t.prototype,"enablePersistence",void 0),B([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),B([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),B([(0,v.Property)(null)],t.prototype,"placeholder",void 0),B([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),B([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),B([(0,v.Property)(null)],t.prototype,"query",void 0),B([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),B([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),B([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),B([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),B([(0,v.Property)(!0)],t.prototype,"isDeviceFullScreen",void 0),B([(0,v.Property)(!1)],t.prototype,"readonly",void 0),B([(0,v.Property)(!1)],t.prototype,"enableVirtualization",void 0),B([(0,v.Property)(!1)],t.prototype,"allowResize",void 0),B([(0,v.Property)(null)],t.prototype,"text",void 0),B([(0,v.Property)(null)],t.prototype,"value",void 0),B([(0,v.Property)(!1)],t.prototype,"allowObjectBinding",void 0),B([(0,v.Property)(null)],t.prototype,"index",void 0),B([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),B([(0,v.Property)(!1)],t.prototype,"showClearButton",void 0),B([(0,v.Event)()],t.prototype,"filtering",void 0),B([(0,v.Event)()],t.prototype,"change",void 0),B([(0,v.Event)()],t.prototype,"beforeOpen",void 0),B([(0,v.Event)()],t.prototype,"open",void 0),B([(0,v.Event)()],t.prototype,"close",void 0),B([(0,v.Event)()],t.prototype,"blur",void 0),B([(0,v.Event)()],t.prototype,"focus",void 0),B([(0,v.Event)()],t.prototype,"resizeStop",void 0),B([(0,v.Event)()],t.prototype,"resizing",void 0),B([(0,v.Event)()],t.prototype,"resizeStart",void 0),t=B([v.NotifyPropertyChanges],t)}(D),U=u(741),H=u(215),F=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),W=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},q="e-rtl",M="e-ddt-hidden",j="e-input-group-icon e-ddt-icon e-icons",R="e-show-chip",z="e-show-clear",K="e-show-dd-icon",_="e-chip-input",G="e-input-focus",Q="e-input-group",J="e-icon-anim",X="e-chips",Y="e-chipcontent",$="e-chips-close",Z="e-icon-hide",ee="e-ddt-icon-hide",te="e-list-parent",ie="e-dropdown",se="e-disabled",le="e-selectall-parent",ne="e-hide-selectall",ae="e-all-text",oe="e-frame",re="e-check",he="e-checkbox-wrapper",ue="e-filter-wrap",pe="e-ddt-icon",de="e-ddt-footer",ce="e-ddt-header",me="e-no-data",fe="e-remain",ve="e-overflow",ge="e-show-text",ye="e-total-count",Ce="e-wrap-count",be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),W([(0,v.Property)("child")],t.prototype,"child",void 0),W([(0,v.Property)([])],t.prototype,"dataSource",void 0),W([(0,v.Property)("expanded")],t.prototype,"expanded",void 0),W([(0,v.Property)("hasChildren")],t.prototype,"hasChildren",void 0),W([(0,v.Property)("htmlAttributes")],t.prototype,"htmlAttributes",void 0),W([(0,v.Property)("iconCss")],t.prototype,"iconCss",void 0),W([(0,v.Property)("imageUrl")],t.prototype,"imageUrl",void 0),W([(0,v.Property)("parentValue")],t.prototype,"parentValue",void 0),W([(0,v.Property)(null)],t.prototype,"query",void 0),W([(0,v.Property)("selectable")],t.prototype,"selectable",void 0),W([(0,v.Property)("selected")],t.prototype,"selected",void 0),W([(0,v.Property)(null)],t.prototype,"tableName",void 0),W([(0,v.Property)("text")],t.prototype,"text",void 0),W([(0,v.Property)("tooltip")],t.prototype,"tooltip",void 0),W([(0,v.Property)("value")],t.prototype,"value",void 0),t}(v.ChildProperty),Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),W([(0,v.Property)(!1)],t.prototype,"autoCheck",void 0),W([(0,v.Property)(!0)],t.prototype,"checkDisabledChildren",void 0),W([(0,v.Property)("Auto")],t.prototype,"expandOn",void 0),W([(0,v.Property)(!1)],t.prototype,"loadOnDemand",void 0),t}(v.ChildProperty),Ee=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.filterTimer=null,s.isFilteredData=!1,s.isFilterRestore=!1,s.selectedData=[],s.filterDelayTime=300,s.isClicked=!1,s.documentClickContext=s.onDocumentClick.bind(s),s.isCheckAllCalled=!1,s.isFromFilterChange=!1,s}return F(t,e),t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getLocaleName=function(){return"drop-down-tree"},t.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",ctrlA:"ctrl+A"}},t.prototype.render=function(){var e=(0,v.select)("#"+this.element.id+"_tree",document);if(e){var t=(0,v.select)("#"+this.element.id+"_options",document);(0,v.detach)(t||e.parentElement)}"INPUT"===this.element.tagName?(this.inputEle=this.element,(0,v.isNullOrUndefined)(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),(0,v.isNullOrUndefined)(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):((0,v.isNullOrUndefined)(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=N.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[j]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains(Q)||this.inputWrapper.classList.add(Q),this.showDropDownIcon&&this.inputWrapper.classList.add(K),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add(ie),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),(0,v.addClass)([this.popupDiv],ee),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof g.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:ve+" "+Z}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&(0,v.addClass)([this.overFlowWrapper],ge))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var i=(0,v.select)("."+te,this.treeObj.element);i&&i.getAttribute("aria-multiselectable")&&i.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},t.prototype.hideCheckAll=function(e){var t=(0,v.isNullOrUndefined)(this.popupEle)?null:this.popupEle.querySelector("."+le);(0,v.isNullOrUndefined)(t)||(e&&!t.classList.contains(ne)?(0,v.addClass)([t],ne):!e&&t.classList.contains(ne)&&(0,v.removeClass)([t],ne))},t.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:ue});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),(0,v.prepend)([this.filterContainer],this.popupEle),this.filterObj=new N.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new v.KeyboardEvents(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.filterKeyAction=function(e){var t,i=this,s={cancel:!1,event:e};this.trigger("keyPress",s,(function(s){if(!s.cancel)switch(e.action){case"altUp":i.isPopupOpen&&i.hidePopup();break;case"shiftTab":(0,v.addClass)([i.inputWrapper],[G]);break;case"moveDown":e.preventDefault(),i.filterObj.element.blur(),(t=i.treeObj.element.querySelector("li"))&&t.focus()}}))},t.prototype.filterChangeHandler=function(e){var t=this;(0,v.isNullOrUndefined)(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout((function(){t.filterHandler(e.value,e.event)}),this.filterDelayTime))},t.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},t.prototype.filterHandler=function(e,t){var i=this;this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData());var s=this.cloneFields(this.fields),l={cancel:!1,preventDefaultAction:!1,event:t,text:e.trim(),fields:s};this.trigger("filtering",l,(function(e){if(!e.cancel){var t=!1,s=void 0;if(i.isFilteredData=!0,""===e.text?(i.isFilteredData=!1,i.isFilterRestore=!0,s=i.cloneFields(i.fields),i.treeObj.element.classList.remove("e-filtering")):e.preventDefaultAction?(s=e.fields,i.treeObj.element.classList.add("e-filtering")):(1===i.treeDataType?s=i.selfReferencefilter(e.text,e.fields):i.fields.dataSource instanceof g.DataManager?((s=i.remoteDataFilter(e.text,e.fields)).child=i.fields.child,i.treeObj.fields=i.getTreeFields(e.fields),i.treeObj.dataBind(),t=!0):s=i.nestedFilter(e.text,e.fields),i.treeObj.element.classList.add("e-filtering")),i.hideCheckAll(i.isFilteredData),t)return;if(i.isRemoteData&&(i.isChildObject()?s.child=i.fields.child:s=e.fields),i.treeObj.fields=i.getTreeFields(s),i.treeObj.dataBind(),i.popupObj&&i.popupObj.refreshPosition(),i.hasTemplate&&i.portals&&i.treeObj.portals){for(var l=0;l<i.treeObj.portals.length;l++)-1===i.portals.indexOf(i.treeObj.portals[l])&&i.portals.push(i.treeObj.portals[l]);i.isReact&&i.renderReactTemplates()}}}))},t.prototype.remoteDataFilter=function(e,t){var i=this;return t.dataSource=this.treeData.map((function(t){return i.remoteChildFilter(e,t)})).filter((function(e){return!(0,v.isNullOrUndefined)(e)})),t},t.prototype.remoteChildFilter=function(e,t,i,s){var l=this.isChildObject()?t.child:t[this.fields.child];if((0,v.isNullOrUndefined)(l))return this.isMatchedNode(e,t,i,s)?t:null;for(var n=[],a=0;a<l.length;a++){var o=this.remoteChildFilter(e,l[a],!0,!0);(0,v.isNullOrUndefined)(o)||n.push(o)}var r=Object.assign({},t);return s=!1,0!==n.length?r.child=n:(r.child=null,r=this.isMatchedNode(e,r)?r:null),r},t.prototype.nestedFilter=function(e,t){for(var i=[],s=0;s<this.treeData.length;s++){var l=this.nestedChildFilter(e,this.treeData[parseInt(s.toString(),10)]);(0,v.isNullOrUndefined)(l)||i.push(l)}return t.dataSource=i,t},t.prototype.nestedChildFilter=function(e,t){var i=t[this.fields.child];if((0,v.isNullOrUndefined)(i))return this.isMatchedNode(e,t)?t:null;for(var s=[],l=0;l<i.length;l++){var n=this.nestedChildFilter(e,i[parseInt(l.toString(),10)]);(0,v.isNullOrUndefined)(n)||s.push(n)}var a=Object.assign({},t);return 0!==s.length?(a[this.fields.child]=s,a):(a[this.fields.child]=null,this.isMatchedNode(e,a)?a:null)},t.prototype.selfReferencefilter=function(e,t){for(var i=[],s=[],l=0;l<this.treeData.length;l++)this.isMatchedNode(e,this.treeData[l])&&i.push(this.treeData[l]);for(l=0;l<i.length;l++)if(-1===s.indexOf(i[l])){s.push(i[l]);for(var n=i[parseInt(l.toString(),10)][this.fields.parentValue];!(0,v.isNullOrUndefined)(n);){for(var a=null,o=0;o<this.treeData.length;o++){var r=this.treeData[parseInt(o.toString(),10)][this.fields.value];if(!(0,v.isNullOrUndefined)(r)&&r===n){a=this.treeData[o];break}}if((0,v.isNullOrUndefined)(a)||-1!==s.indexOf(a))break;s.push(a),n=a[this.fields.parentValue]}}return t.dataSource=s,t},t.prototype.isMatchedNode=function(e,t,i,s){var l;if(!(l=i&&s&&this.isChildObject()?t[this.fields.child.text]:t[this.fields.text])&&!(0,v.isNullOrUndefined)(this.fields.child.text)){for(var n=this.fields.child;!t[n.text];)n=n.child;l=t[n.text]}return this.ignoreCase&&(l=l.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(l=g.DataUtil.ignoreDiacritics(l),e=g.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?l.slice(0,e.length)===e:"EndsWith"===this.filterType?l.slice(-e.length)===e:-1!==l.indexOf(e)},t.prototype.wireEvents=function(){v.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),v.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),v.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),v.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),v.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),v.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),v.EventHandler.add(window,"resize",this.windowResize,this);var e=(0,v.closest)(this.inputWrapper,"form");e&&v.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new v.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.wireTreeEvents=function(){this.keyboardModule=new v.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new v.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},t.prototype.unWireEvents=function(){v.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),v.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),v.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),v.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),v.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),v.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),v.EventHandler.remove(window,"resize",this.windowResize);var e=(0,v.closest)(this.inputWrapper,"form");e&&v.EventHandler.remove(e,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&v.EventHandler.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},t.prototype.dropDownClick=function(e){this.enabled&&!this.readonly&&(this.isClearButtonClick?this.isClearButtonClick=!1:(this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()))},t.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},t.prototype.onMouseLeave=function(){this.inputFocus||((0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z))},t.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},t.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!v.Browser.isIE&&"edge"!==v.Browser.info.name||e.target!==this.inputWrapper)){var t=e.relatedTarget;t===this.inputEle||!(0,v.isNullOrUndefined)(t)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},t.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=(0,v.select)(".e-clear-icon",this.inputWrapper).offsetWidth,(0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z)),(0,v.removeClass)([this.inputWrapper],[G]),this.allowMultiSelection||this.showCheckBox){var t=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_)),t&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText&&t&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},t.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?(0,v.addClass)([this.inputWrapper,this.overFlowWrapper],ge):(0,v.addClass)([this.inputWrapper],R),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&(0,v.addClass)([this.chipWrapper],Z),(0,v.addClass)([this.inputEle],_),this.updateOverFlowView()),this.ensurePlaceHolder())},t.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.setOldValue()}},t.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return(null===e||0===e.length)&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},t.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,(0,v.addClass)([this.inputWrapper],[G]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&((0,v.removeClass)([this.chipWrapper],Z),(0,v.addClass)([this.inputEle],_),this.showOrHideValueTemplate(!1,!0)),(0,v.addClass)([this.inputWrapper],R),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&(0,v.addClass)([this.overFlowWrapper],Z),"Delimiter"===this.mode?((0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_),this.showOrHideValueTemplate(!0)):(0,v.addClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputWrapper],ge),this.ensurePlaceHolder()));var t={isInteracted:!!e,event:e};this.trigger("focus",t)}},t.prototype.treeAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,(function(i){if(i.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":t.inputWrapper.focus(),e.preventDefault(),t.isPopupOpen&&t.hidePopup();break;case"tab":t.isPopupOpen&&t.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":t.showCheckBox||(t.isValueChange=!0,t.keyEventArgs=e);break;case"space":t.isValueChange=!0,t.keyEventArgs=e;break;case"ctrlA":t.allowMultiSelection&&t.selectAll(!0)}}))},t.prototype.keyActionHandler=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,(function(i){if(!i.cancel)switch(e.action){case"escape":case"altUp":t.isPopupOpen&&t.hidePopup();break;case"shiftTab":t.isPopupOpen&&t.hidePopup(),t.inputFocus&&t.onFocusOut();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus();break;case"tab":!t.isPopupOpen&&t.inputFocus&&t.onFocusOut()}}))},t.prototype.checkAllAction=function(e){var t,i=this,s={cancel:!1,event:e};this.trigger("keyPress",s,(function(s){if(!s.cancel)switch(e.action){case"space":i.clickHandler(e);break;case"moveDown":e.preventDefault(),(t=i.treeObj.element.querySelector('li[tabindex="0"]')||i.treeObj.element.querySelector("li")).focus(),(0,v.addClass)([t],["e-node-focus"])}}))},t.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},t.prototype.resetValueHandler=function(e){var t=(0,v.closest)(this.inputWrapper,"form");t&&e.target===t&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},t.prototype.getAriaAttributes=function(){return{}},t.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove(ye),(0,v.removeClass)([this.overFlowWrapper],Z),this.value&&this.value.length){var e="",t=void 0,i=void 0,s=void 0,l=1,n=void 0,a=void 0,o=0;this.overFlowWrapper.innerHTML="";this.l10n=new v.L10n(this.getLocaleName(),{overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},this.locale);var r=this.l10n.getConstant("overflowCountTemplate"),h=this.l10n.getConstant("totalCountTemplate"),u=this.createElement("span",{className:fe});this.overFlowWrapper.appendChild(u),u.innerText=r.replace("${count}",this.value.length.toString());var p=u.offsetWidth;if((0,v.remove)(u),this.showDropDownIcon&&(o=(0,v.select)("."+pe,this.inputWrapper).offsetWidth),!(0,v.isNullOrUndefined)(this.value))if("Box"!==this.mode){if(this.valueTemplate)return a=this.updateChipAndValueTemplate(!1,o,p),this.checkRemainingTemplate(a,u,r,h),void this.updateDelimMode();for(var d=0;!(0,v.isNullOrUndefined)(this.value[d]);d++){if(e+=0===d?"":this.delimiterChar+" ",e+=i=this.getOverflowVal(d),i=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=v.SanitizeHtmlHelper.sanitize(e):this.overFlowWrapper.innerHTML=e,n=this.overFlowWrapper.offsetWidth,t=this.inputWrapper.offsetWidth,n+o+this.clearIconWidth>t){for(void 0!==s&&""!==s&&(i=s,d=l+1),this.overFlowWrapper.innerHTML=i,a=this.value.length-d,n=this.overFlowWrapper.offsetWidth;n+p+o+this.clearIconWidth>=t&&0!==n&&""!==this.overFlowWrapper.innerHTML;){var c=this.overFlowWrapper.innerHTML.split(this.delimiterChar);c.pop(),this.overFlowWrapper.innerHTML=c.join(this.delimiterChar),a++,n=this.overFlowWrapper.offsetWidth}break}n+p+o+this.clearIconWidth<=t?(s=e,l=d):0===d&&(s="",l=-1)}}else a=this.updateChipAndValueTemplate(!0,o,p);this.checkRemainingTemplate(a,u,r,h)}else this.overFlowWrapper.innerHTML="",(0,v.addClass)([this.overFlowWrapper],Z);this.updateDelimMode()},t.prototype.checkRemainingTemplate=function(e,t,i,s){e>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(t,e,i,s)),"Box"!==this.mode||this.overFlowWrapper.classList.contains(ye)||(0,v.addClass)([t],Ce)},t.prototype.updateChipAndValueTemplate=function(e,t,i){void 0===t&&(t=0);var s,l,n,a,o,r="",h=1;(0,v.addClass)([e?this.chipWrapper:this.valueTemplateContainer],Z);for(var u=(e?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0),p=e?(0,v.selectAll)("."+X,u):Array.prototype.slice.call(u.children),d=0;d<p.length;d++){if(l=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(p[d]),r=this.overFlowWrapper.innerHTML,a=this.overFlowWrapper.offsetWidth,s=this.inputWrapper.offsetWidth,a+t+this.clearIconWidth>s){for(void 0!==n&&""!==n&&(l=n,d=h+1),this.overFlowWrapper.innerHTML=l,o=this.value.length-d,a=this.overFlowWrapper.offsetWidth;a+i+t+this.clearIconWidth>=s&&0!==a&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),o++,a=this.overFlowWrapper.offsetWidth;break}a+i+t+this.clearIconWidth<=s?(n=r,h=d):0===d&&(n="",h=-1)}return o},t.prototype.updateRemainTemplate=function(e,t,i,s){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.innerText=this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?i.replace("${count}",t.toString()):s.replace("${count}",t.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?((0,v.addClass)([this.overFlowWrapper],ye),(0,v.removeClass)([this.overFlowWrapper],Ce)):(0,v.removeClass)([this.overFlowWrapper],ye),e},t.prototype.getOverflowVal=function(e){var t=this.getSelectedData(this.value[parseInt(e.toString(),10)]);return(0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.text:"text",t)},t.prototype.updateDelimMode=function(){"Box"!==this.mode?(0,v.select)("."+fe,this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains(ye)?((0,v.addClass)([this.overFlowWrapper],Ce),(0,v.addClass)([this.overFlowWrapper],ge)):(this.overFlowWrapper.classList.remove(Ce),(0,v.removeClass)([this.overFlowWrapper],Ce)):(0,v.select)("."+fe,this.overFlowWrapper)&&this.overFlowWrapper.classList.remove(Ce)},t.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:M,tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:M,"aria-label":this.getModuleName()}}),(0,v.prepend)([this.hiddenElement],this.inputWrapper),this.validationAttribute()},t.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),(0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},t.prototype.validationAttribute=function(){var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name");for(var t=["required","aria-required","form"],i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},t.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),(0,v.addClass)([this.inputWrapper],R),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?(0,v.addClass)([this.inputEle],_):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&(0,v.addClass)([this.chipWrapper],Z))},t.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},t.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:le,attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:ae}),this.selectAllSpan.textContent="";var e=(0,v.closest)(this.element,".e-bigger"),t=(0,v.isNullOrUndefined)(e)?"":"e-small";this.checkBoxElement=(0,U.createCheckBox)(this.createElement,!0,{cssClass:t}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),v.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},t.prototype.clickHandler=function(e){var t;if(t=e.currentTarget&&e.currentTarget.classList.contains(le)?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=(0,v.closest)(t,"."+he),!(0,v.isNullOrUndefined)(this.checkWrapper)){this.isClicked=!0;var i=(0,v.select)("."+oe,this.checkWrapper);this.changeState(this.checkWrapper,i.classList.contains(re)?"uncheck":"check",e),this.isClicked=!1}e.preventDefault()},t.prototype.changeState=function(e,t,i){var s,l=e.getElementsByClassName(oe)[0];"check"!==t||l.classList.contains(re)?"uncheck"===t&&l.classList.contains(re)&&(l.classList.remove(re),s="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(i)),this.setLocale(!1)):(l.classList.add(re),s="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(i)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),s="check"===t?"true":"false",(0,v.isNullOrUndefined)(s)||e.parentElement.setAttribute("aria-checked",s)},t.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var t=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var i=0,s=(0,v.compile)(t)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);i<s.length;i++){var l=s[i];this.selectAllSpan.textContent=l.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},t.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex","0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),(0,v.attributes)(this.inputWrapper,this.getAriaAttributes())},t.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];if("class"===i)this.inputWrapper.classList.add(this.htmlAttributes[""+i]);else if("disabled"===i)this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"===i)this.setProperties({readonly:!0},!0),this.dataBind();else if("style"===i)this.inputWrapper.setAttribute("style",this.htmlAttributes[""+i]);else{0===i.indexOf("data")||["name","required"].indexOf(i)>-1?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(i)>-1&&"placeholder"===i?N.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}}},t.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,t=["class","style","id","type"],i={},s=0;s<this.element.attributes.length;s++)-1===t.indexOf(this.element.attributes[s].name)&&"readonly"!==this.element.attributes[s].name&&(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));(0,v.extend)(i,e,i),this.setProperties({htmlAttributes:i},!0)},t.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&(this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?((0,v.removeClass)([this.overAllClear],Z),(0,v.addClass)([this.inputWrapper],z)):((0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z))))},t.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var t=this.value.length-1;t>=0;t--)e=this.treeObj.getTreeData(this.value[t])[0],(0,v.isNullOrUndefined)(e)&&this.value.splice(t,1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],(0,v.isNullOrUndefined)(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},t.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,t=[];if(this.showCheckBox||this.allowMultiSelection){for(var i=this.text.split(this.delimiterChar),s=0;s<i.length;s++)e=this.getItems(i[s]),(0,v.isNullOrUndefined)(e)||t.push(e[this.fields.value].toString());0!==t.length?(this.setOldValue(),this.setProperties({value:t},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),(0,v.isNullOrUndefined)(e)?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},t.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),this.treeObj.selectedNodes.length>0&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&this.treeObj.checkedNodes.length>0&&(this.setProperties({value:this.treeObj.checkedNodes},!0),(0,v.setValue)("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},t.prototype.setValueTemplate=function(){var e=this;if(this.valueTemplate){var t=this.initializeValueTemplate();this.getValueTemplateElement(this.value[0],t),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter((function(t){return!e.portals.includes(t)})))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.showOrHideValueTemplate(!0)}},t.prototype.getValueTemplateElement=function(e,t){var i=t(this.getNodeData(e,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);i&&(i=Array.prototype.slice.call(i),(0,v.append)(i,this.valueTemplateContainer))},t.prototype.setValidValue=function(){var e=this;if(this.showCheckBox||this.allowMultiSelection){if(this.showCheckBox)(this.value.length!==this.treeObj.checkedNodes.length||this.value.filter((function(t){return-1===e.treeObj.checkedNodes.indexOf(t)})).length>0||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect());else this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues();this.treeObj.dataBind()}else{N.Input.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate();var t=this.value[0].toString();this.treeObj.selectedNodes[0]!==t&&((0,v.setValue)("selectedNodes",[t],this.treeObj),this.fields.dataSource instanceof g.DataManager&&this.updateSelectedValues())}this.currentText=this.text,this.currentValue=this.value,!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&!(0,v.isNullOrUndefined)(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},t.prototype.getItems=function(e){var t;if(1===this.treeDataType)for(var i=0;i<this.treeItems.length;i++){var s=(0,v.getValue)(this.fields.text,this.treeItems[parseInt(i.toString(),10)]);if(!(0,v.isNullOrUndefined)(this.treeItems[i])&&!(0,v.isNullOrUndefined)(s)&&s===e){t=this.treeItems[i];break}}else t=this.getNestedItems(this.treeItems,this.fields,e);return t},t.prototype.getNestedItems=function(e,t,i){for(var s,l=0,n=e.length;l<n;l++){var a=(0,v.getValue)(this.fields.text,e[parseInt(l.toString(),10)]);if(e[l]&&a&&a.toString()===i)return e[l];if("string"!=typeof t.child||(0,v.isNullOrUndefined)((0,v.getValue)(t.child,e[l]))){if(this.fields.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)((0,v.getValue)("child",e[l]))){if(void 0!==(s=this.getNestedItems((0,v.getValue)("child",e[parseInt(l.toString(),10)]),this.getChildType(t),i)))break}}else{var o=(0,v.getValue)(t.child,e[parseInt(l.toString(),10)]);if(void 0!==(s=this.getNestedItems(o,this.getChildType(t),i)))break}}return s},t.prototype.getChildType=function(e){return"string"==typeof e.child||(0,v.isNullOrUndefined)(e.child)?e:e.child},t.prototype.renderTree=function(){this.treeObj=new H.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate,checkDisabledChildren:this.treeSettings.checkDisabledChildren}),this.treeObj.root=this.root?this.root:this,this.treeObj.appendTo(this.tree)},t.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var t=!1;this.trigger("beforeOpen",{cancel:!1},(function(i){if(i.cancel?t=!0:((0,v.addClass)([e.inputWrapper],[J]),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_options",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),e.popupEle.setAttribute("role","region"),e.popupEle.setAttribute("aria-label",e.element.id),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):(e.popupEle=e.popupObj.element,e.isReact&&e.isFilterRestore&&(e.treeObj.refresh(),e.isFilteredData=!0,e.popupEle.removeChild(e.filterContainer)))),(e.isFirstRender&&!t||e.isFilteredData)&&(e.isFilteredData=!1,(0,v.prepend)([e.popupDiv],e.popupEle),(0,v.removeClass)([e.popupDiv],ee),e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains(me)&&(e.createSelectAllWrapper(),e.popupEle.insertBefore(e.checkAllParent,e.popupDiv)),e.headerTemplate&&e.setHeaderTemplate(),e.footerTemplate&&e.setFooterTemplate(),e.isFirstRender=!1,e.hasTemplate&&e.portals&&(e.treeObj.portals&&(e.portals=e.portals.concat(e.treeObj.portals.filter((function(t){return!e.portals.includes(t)})))),e.isReact&&e.renderReactTemplates(e.reactCallBack))),!t){if((0,v.attributes)(e.inputEle,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),(0,v.removeClass)([e.popupEle],ee),e.updatePopupHeight(),e.popupObj.refreshPosition(),(!e.showCheckBox||!e.showSelectAll)&&!e.popupDiv.classList.contains(me)&&e.treeItems.length>0){var s=null!=e.value&&null!=e.text?e.treeObj.element.querySelector('[data-uid="'+e.value[0]+'"]'):null;if(s)e.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),s.setAttribute("tabindex","0");else{var l=e.treeObj.element.querySelector(".e-node-focus");s=e.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||e.treeObj.element.querySelector("li:not(.e-disable)"),l&&l!==s&&(l.setAttribute("tabindex","-1"),(0,v.removeClass)([l],"e-node-focus"))}(0,v.isNullOrUndefined)(s)||(e.allowFiltering||s.focus(),(0,v.addClass)([s],["e-node-focus"]))}if(e.treeObj.checkedNodes.length>0&&!e.isFilterRestore){var n=e.treeObj.element.querySelectorAll("li");if(e.treeObj.element.querySelectorAll("li[aria-checked=true]").length===n.length&&e.checkBoxElement){var a=(0,v.closest)(e.checkBoxElement,"."+he);e.changeState(a,"check"),e.checkSelectAll=!1}}e.allowFiltering&&((0,v.removeClass)([e.inputWrapper],[G]),e.filterObj.element.focus());var o={popup:e.popupObj};e.trigger("open",o)}}))},t.prototype.reactCallBack=function(){(0,v.isNullOrUndefined)(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},t.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){var t=Math.round(this.filterContainer.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}if(this.headerTemplate){t=Math.round(this.header.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}if(this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains(me)){t=Math.round(this.checkAllParent.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}if(this.footerTemplate){t=Math.round(this.footer.getBoundingClientRect().height);e=(0,v.formatUnit)(parseInt(e,10)-t+"px")}var i=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);i+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=(0,v.formatUnit)(parseInt(e,10)-i+"px"),this.popupDiv.style.maxHeight=e}},t.prototype.createPopup=function(e){var t=this;this.isFirstRender&&(this.popupObj=new k.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){t.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",t.documentClickContext),t.isPopupOpen=!0},targetExitViewport:function(){v.Browser.isDevice||t.hidePopup()}}))},t.prototype.setElementWidth=function(e){var t=this.inputWrapper;(0,v.isNullOrUndefined)(e)||("number"==typeof e?t.style.width=(0,v.formatUnit)(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:(0,v.formatUnit)(e)))},t.prototype.setWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);return e.indexOf("%")>-1?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},t.prototype.getHeight=function(){var e=(0,v.formatUnit)(this.popupHeight);return e.indexOf("%")>-1?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},t.prototype.onDocumentClick=function(e){var t=e.target,i=(0,v.closest)(t,"."+te),s=(0,v.closest)(t,"."+ue),l=(0,v.closest)(t,"."+ce),n=(0,v.closest)(t,"."+de),a=!!t.classList.contains(ie)||((0,v.matches)(t,".e-ddt .e-popup")||(0,v.matches)(t,".e-ddt .e-treeview"));this.isPopupOpen&&(!(0,v.isNullOrUndefined)(this.inputWrapper)&&this.inputWrapper.contains(t)||i||a||l||n)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&t.classList.contains($)||this.isPopupOpen&&(t.classList.contains(le)||t.classList.contains(ae)||t.classList.contains(oe)))?(this.isDocumentClick=!1,e.preventDefault()):(0,v.isNullOrUndefined)(this.inputWrapper)||this.inputWrapper.contains(t)||!this.inputFocus||s||this.focusOut(e)},t.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),(0,v.addClass)([this.popupDiv],me)},t.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),(0,v.addClass)([this.popupDiv],me),this.hideCheckAll(!0)):this.popupDiv.classList.contains(me)&&this.treeItems.length>=1&&((0,v.removeClass)([this.popupDiv],me),this.hideCheckAll(!1)),this.isFilteredData||(this.treeDataType=this.getTreeDataType(this.treeItems,this.fields)),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus(),this.isInitialized=!0);var t={data:e.data};this.trigger("dataBound",t),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},t.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value?this.value:[]:this.treeObj.selectedNodes=this.value?this.value:[]},t.prototype.setCssClass=function(e,t){var i=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];(0,v.isNullOrUndefined)(t)||""===t||(0,v.removeClass)(i,t.split(" ")),(0,v.isNullOrUndefined)(e)||""===e||(0,v.addClass)(i,e.split(" "))},t.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add(q):this.inputWrapper.classList.remove(q),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},t.prototype.setEnable=function(){N.Input.setEnabled(this.enabled,this.inputEle),this.enabled?((0,v.removeClass)([this.inputWrapper],se),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),(0,v.addClass)([this.inputWrapper],se),this.inputWrapper&&this.inputWrapper.classList.contains(G)&&(0,v.removeClass)([this.inputWrapper],[G]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},t.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},t.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},t.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selectable:e.selectable,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},t.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!(0,v.isNullOrUndefined)(e)){var t=e=this.getActualProperties(e);return e.value&&(t.id=e.value),e.parentValue&&(t.parentID=e.parentValue),e.child&&(t.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(t.isChecked=e.selected),t}return null},t.prototype.getTreeDataType=function(e,t){if(this.fields.dataSource instanceof g.DataManager){for(var i=0;i<e.length;i++)if("string"==typeof t.child&&(0,v.isNullOrUndefined)((0,v.getValue)(t.child,e[i])))return 1;return 2}(0,v.isNullOrUndefined)(this.fields.dataSource)&&(this.fields.dataSource=[]);i=0;for(var s=this.fields.dataSource.length;i<s;i++){if("string"==typeof t.child&&!(0,v.isNullOrUndefined)((0,v.getValue)(t.child,this.fields.dataSource[i])))return 2;if(!(0,v.isNullOrUndefined)((0,v.getValue)(t.parentValue,this.fields.dataSource[i]))||!(0,v.isNullOrUndefined)((0,v.getValue)(t.hasChildren,this.fields.dataSource[i])))return 1}return 1},t.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.treeObj.dataBind()},t.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:!!this.isClicked||e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},t.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.setOldValue(),null===this.value&&this.setProperties({value:[]},!0))},t.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},t.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var t,i=this.getEventArgs(e);if(this.trigger("select",i),e.isInteracted){var s=(0,v.getValue)("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[s]},!0),t=this.itemTemplate?(0,v.getValue)("text",this.treeObj.getNode(s)):(0,v.getValue)("text",e.nodeData).toString(),N.Input.setValue(t,this.inputEle,this.floatLabelType),this.setProperties({text:t},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&this.inputWrapper.setAttribute("aria-label",e.nodeData.text.toString()),(0,v.attributes)(this.inputWrapper,{"aria-describedby":this.element.id}),(0,v.attributes)(this.inputWrapper,{"aria-activedescendant":s.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},t.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&(this.isClicked=!0,"true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.isClicked=!1,this.setMultiSelect(),this.ensurePlaceHolder());this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},t.prototype.onNodeChecked=function(e){var t=this.getEventArgs(e);if(this.trigger("select",t),this.isFilteredData&&"uncheck"===e.action){var i=(0,v.getValue)("id",e.data[0]).toString();this.removeSelectedData(i,!0)}if((!this.isChipDelete&&e.isInteracted||!this.isFilteredData&&"check"===e.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var s=this.treeObj.element.querySelectorAll("li"),l=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),n=(0,v.closest)(this.checkBoxElement,"."+he);n&&"uncheck"===e.action&&(e.isInteracted||0===l.length||!(0,v.isNullOrUndefined)(e.data[0])&&"false"===e.data[0].isChecked)||!e.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(n,"uncheck"),this.isReverseUpdate=!1):n&&"check"===e.action&&l.length===s.length&&(e.isInteracted||this.isCheckAllCalled||!(0,v.isNullOrUndefined)(e.data[0])&&"true"===e.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(n,"check"),this.isReverseUpdate=!1)}this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},t.prototype.beforeCheck=function(e){e.isInteracted&&this.setOldValue()},t.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var e=0;e<this.treeObj.portals.length;e++)-1===this.portals.indexOf(this.treeObj.portals[e])&&this.portals.push(this.treeObj.portals[e]);this.renderReactTemplates()}},t.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?((0,v.removeClass)([this.overAllClear],Z),(0,v.addClass)([this.inputWrapper],z)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):((0,v.addClass)([this.overAllClear],Z),(0,v.removeClass)([this.inputWrapper],z)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var t=(0,v.selectAll)("."+$,this.chipWrapper),i=0;i<t.length;i++)e?(0,v.removeClass)([t[i]],Z):(0,v.addClass)([t[i]],Z)},t.prototype.updateDropDownIconState=function(e){var t=(0,v.select)("."+pe,this.inputWrapper);e?(t?(0,v.removeClass)([t],Z):N.Input.appendSpan(j,this.inputWrapper,this.createElement),(0,v.addClass)([this.inputWrapper],K)):((0,v.addClass)([t],Z),(0,v.removeClass)([this.inputWrapper],K))},t.prototype.updateMode=function(){if("Custom"!==this.mode)if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(Z)&&e?((0,v.removeClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!1,!0),(0,v.addClass)([this.inputWrapper],R)):e||((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R),this.showOrHideValueTemplate(!0));var t=null!==this.value&&0!==this.value.length;e&&t?(0,v.addClass)([this.inputEle],_):(0,v.removeClass)([this.inputEle],_)}else this.inputEle.classList.contains(_)&&((0,v.removeClass)([this.inputEle],_),this.chipWrapper&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R),this.showOrHideValueTemplate(!0)))},t.prototype.ensurePlaceHolder=function(){((0,v.isNullOrUndefined)(this.value)||null!==this.value&&0===this.value.length)&&((0,v.removeClass)([this.inputEle],_),this.chipWrapper&&((0,v.addClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!0)))},t.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},t.prototype.setMultiSelectValue=function(e){var t=this;if(this.isFilteredData){var i=(0,v.isNullOrUndefined)(this.value)?[]:this.value;i=i.filter((function(e){var i=t.treeObj.getTreeData(e);return!Array.isArray(i)||i.every((function(e){return e.selected}))}));for(var s=0;s<e.length;s++)((0,v.isNullOrUndefined)(this.value)||-1===this.value.indexOf(e[s]))&&i.push(e[s]);this.setProperties({value:i},!0)}else this.setProperties({value:this.isFromFilterChange&&e&&0===e.length?this.value:e},!0),this.isFromFilterChange=!1,!e||0===e.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},t.prototype.setMultiSelect=function(){if(this.showCheckBox&&!this.isDynamicChange)this.setMultiSelectValue(this.treeObj.checkedNodes.slice());else{var e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null;this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())}this.selectedText=[];var t=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!t&&((0,v.removeClass)([this.inputEle],_),(0,v.detach)(this.chipWrapper)),this.getValidMode()&&null!==this.value&&((0,v.addClass)([this.inputEle],_),this.chipWrapper&&((0,v.removeClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!1,!0)));var i=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!i&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputEle],_),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},t.prototype.getSelectedData=function(e){var t=null;if(this.isFilteredData)for(var i=0;i<this.selectedData.length;i++)if((0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[i]).toString()===e){t=this.selectedData[i];break}return(0,v.isNullOrUndefined)(t)&&(t=this.treeSettings.loadOnDemand?this.getNodeData(e,this.treeItems):this.treeObj.getNode(e),(0,v.isNullOrUndefined)(t)||this.selectedData.push(t)),t},t.prototype.getNodeData=function(e,t){var i;if((0,v.isNullOrUndefined)(e))return i;if(1!==this.treeDataType)return this.getChildNodeData(t,this.fields,e);for(var s=0,l=t.length;s<l;s++){var n=(0,v.getValue)(this.fields.value,t[s]);if(!(0,v.isNullOrUndefined)(t[s])&&!(0,v.isNullOrUndefined)(n)&&n.toString()===e)return t[s]}return i},t.prototype.getChildNodeData=function(e,t,i){var s;if((0,v.isNullOrUndefined)(e))return s;for(var l=0,n=e.length;l<n;l++){var a=(0,v.getValue)(t.value,e[l]);if(e[l]&&a&&a.toString()===i)return e[l];if("string"!=typeof t.child||(0,v.isNullOrUndefined)((0,v.getValue)(t.child,e[l]))){if(this.fields.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)((0,v.getValue)("child",e[l]))){if(void 0!==(s=this.getChildNodeData((0,v.getValue)("child",e[l]),this.getChildMapperFields(t),i)))break}}else{var o=(0,v.getValue)(t.child,e[l]);if(void 0!==(s=this.getChildNodeData(o,this.getChildMapperFields(t),i)))break}}return s},t.prototype.getChildMapperFields=function(e){return"string"==typeof e.child||(0,v.isNullOrUndefined)(e.child)?e:e.child},t.prototype.removeSelectedData=function(e,t){var i=(0,v.isNullOrUndefined)(this.value)?[]:this.value.slice();i.splice(i.indexOf(e),1),this.setProperties({value:i},t);for(var s=0;s<this.selectedData.length;s++)if((0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){this.selectedData.splice(s,1);break}},t.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);else this.valueTemplateContainer=this.createElement("span",{className:ve+" "+ge+" e-input-value "+Z});return this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},t.prototype.showOrHideValueTemplate=function(e,t){void 0===t&&(t=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(e?((0,v.removeClass)([this.valueTemplateContainer],Z),(0,v.addClass)([this.inputWrapper],R),(0,v.addClass)([this.inputEle],_)):((0,v.addClass)([this.valueTemplateContainer],Z),t||((0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_))))},t.prototype.updateSelectedValues=function(){var e,t,i=this;this.dataValue="";var s,l="";this.hiddenElement.innerHTML="";var n="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!(0,v.isNullOrUndefined)(this.value)){for(var a=this.initializeValueTemplate(),o=0,r=this.value.length;o<r;o++)s=this.getSelectedData(this.value[o]),t=(0,v.getValue)(this.treeSettings.loadOnDemand?this.fields.text:"text",s),this.selectedText.push(t),e=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+e,l+=","+e):(this.dataValue+=e,l+=e),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[o]),n+='<option selected value ="'+this.value[o]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[o],a);this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter((function(e){return!i.portals.includes(e)})))),this.isReact&&this.renderReactTemplates(this.reactCallBack)),this.selectedText.length>=1&&this.setProperties({text:l},!0),this.hiddenElement.innerHTML=n,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var h=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||h||(this.chipWrapper&&((0,v.addClass)([this.chipWrapper],Z),(0,v.removeClass)([this.inputWrapper],R)),this.showOrHideValueTemplate(!0)),N.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===l?this.setProperties({text:null},!0):this.setProperties({text:l},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&!(0,v.isNullOrUndefined)(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},t.prototype.setChipValues=function(e,t){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var i=this.createElement("span",{className:X,attrs:{"data-value":t}}),s=this.createElement("span",{className:Y}),l=this.createElement("span",{className:$+" e-icons"});this.enableHtmlSanitizer?s.innerText=v.SanitizeHtmlHelper.sanitize(e):s.innerHTML=e,i.appendChild(s),this.chipCollection.appendChild(i),this.showClearButton&&(i.appendChild(l),v.EventHandler.add(l,"mousedown",this.removeChip,this))},t.prototype.setTagValues=function(){if(null!==this.value&&null!=this.text&&0!==this.value.length){this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(R)||(0,v.addClass)([this.inputWrapper],R);var e=this.createElement("span",{className:X});this.inputEle.classList.contains(_)||(0,v.addClass)([this.inputEle],_),this.chipWrapper.classList.contains(Z)&&((0,v.removeClass)([this.chipWrapper],Z),this.showOrHideValueTemplate(!1,!0));var t=this.createElement("span",{className:Y}),i=this.customTemplate,s=this.customTemplateId,l=this.templateComplier(i)({value:this.value,text:this.text},this,"customTemplate",s,this.isStringTemplate,void 0,t);l&&(l=Array.prototype.slice.call(l),(0,v.append)(l,t)),e.appendChild(t),this.chipCollection.appendChild(e),this.isReact&&this.renderReactTemplates()}else this.inputWrapper.contains(this.chipWrapper)&&(0,v.addClass)([this.chipWrapper],Z)},t.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&((0,v.detach)(this.checkAllParent),this.checkAllParent=null))},t.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),(0,v.addClass)([this.header],ce));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),(0,v.append)(e,this.header)),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},t.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?(0,v.compile)(document.querySelector(e).innerHTML.trim()):(0,v.compile)(e)}catch(t){return(0,v.compile)(e)}return(0,v.compile)(e)},t.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),(0,v.addClass)([this.footer],de));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),(0,v.append)(e,this.footer)),(0,v.append)([this.footer],this.popupEle)},t.prototype.clearAll=function(e){this.enabled&&!this.readonly&&(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur||this.triggerChangeEvent(e))},t.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){var t=e.target.parentElement,i=t.getAttribute("data-value");this.chipCollection&&t&&(0,v.remove)(t),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(i,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([i]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},t.prototype.resetValue=function(e){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(N.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],(0,v.setValue)("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder()))},t.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},t.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},t.prototype.selectAllItems=function(e){if(this.showCheckBox)e?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=e;else if(this.allowMultiSelection)if(e){for(var t=(0,v.selectAll)("li",this.treeObj.element),i=void 0,s=[],l=0;l<t.length;l++)i=t[l].getAttribute("data-uid").toString(),s.push(i);this.treeObj.selectedNodes=s}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},t.prototype.updateTreeSettings=function(e){if("autoCheck"===e)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===e)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===e)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===e&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},t.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},t.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},t.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var t=e?this.actionFailureTemplate:this.noRecordsTemplate,i=e?this.actionFailureTemplateId:this.noRecordsTemplateId,s=e?"actionFailureTemplate":"noRecordsTemplate",l=this.templateComplier(t)({},this,s,i,this.isStringTemplate,void 0,this.noRecord);l&&(l=Array.prototype.slice.call(l),(0,v.append)(l,this.noRecord))}else{this.l10n=new v.L10n(this.getLocaleName(),{noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"},this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}(0,v.addClass)([this.noRecord],"e-ddt-nodata"),(0,v.prepend)([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},t.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},t.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:ve+" "+Z}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},t.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},t.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter())},t.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},t.prototype.updateValue=function(e){this.isDynamicChange=!0,(0,v.isNullOrUndefined)(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},t.prototype.updateText=function(e){(0,v.isNullOrUndefined)(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},t.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=(0,v.select)(".e-overflow:not(.e-input-value)",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),(0,v.addClass)([this.inputEle],_),"Box"===this.mode?(0,v.removeClass)([this.overFlowWrapper,this.inputWrapper],ge):(0,v.addClass)([this.overFlowWrapper,this.inputWrapper],ge))}},t.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},t.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":N.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,t.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":N.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":N.Input.removeFloating(this.inputObj),N.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":this.oldValue=t.value,this.updateValue(e.value);break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&(0,v.detach)(this.overFlowWrapper),this.chipWrapper&&(0,v.detach)(this.chipWrapper),this.setTagValues()):("Custom"===t.mode&&this.updateOverflowWrapper(this.wrapText),this.updateModelMode());break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":for(var l=0,n=Object.keys(e.treeSettings);l<n.length;l++){var a=n[l];this.updateTreeSettings(a)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?((0,v.addClass)([this.overFlowWrapper],Z),this.chipWrapper&&"Box"===this.mode?(0,v.removeClass)([this.chipWrapper],Z):((0,v.removeClass)([this.inputWrapper],R),(0,v.removeClass)([this.inputEle],_)),this.ensurePlaceHolder()):this.updateView()}}},t.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},t.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),(0,v.detach)(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),N.Input.setValue(null,this.inputEle,this.floatLabelType),(0,v.detach)(this.inputWrapper),(0,v.detach)(this.popupDiv),(0,v.detach)(this.hiddenElement),N.Input.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(_),(0,v.detach)(this.inputObj.container),this.inputObj.buttons.length&&(0,v.detach)(this.inputObj.buttons[0]),this.inputObj=null;this.hiddenElement.options.length>0;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var t=0,i=(0,v.selectAll)(".e-chips-close",this.chipCollection);t<i.length;t++){var s=i[t];v.EventHandler.remove(s,"mousedown",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,e.prototype.destroy.call(this),this.setProperties({value:[]},!0)},t.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),(0,v.detach)(this.filterObj.element),(0,v.detach)(this.filterContainer),this.filterObj=null)},t.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),(0,v.detach)(this.popupObj.element))},t.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},t.prototype.getData=function(e){return this.treeObj.getTreeData(e)},t.prototype.hidePopup=function(){var e={popup:this.popupObj,cancel:!1};this.trigger("close",e),e.cancel||(this.inputWrapper.classList.remove(J),this.popupEle&&(0,v.addClass)([this.popupEle],ee),(0,v.attributes)(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&(0,v.addClass)([this.inputWrapper],[G])),this.isFilteredData&&(this.treeObj.treeData=this.treeData),this.destroyPopupOnHide&&(this.isFirstRender=!0,this.destroyPopup())))},t.prototype.selectAll=function(e){this.selectAllItems(e)},t.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},t.prototype.getModuleName=function(){return"dropdowntree"},W([(0,v.Property)("The Request Failed")],t.prototype,"actionFailureTemplate",void 0),W([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),W([(0,v.Property)(!1)],t.prototype,"allowMultiSelection",void 0),W([(0,v.Property)(!0)],t.prototype,"changeOnBlur",void 0),W([(0,v.Property)("")],t.prototype,"cssClass",void 0),W([(0,v.Property)("${value.length} item(s) selected")],t.prototype,"customTemplate",void 0),W([(0,v.Property)(",")],t.prototype,"delimiterChar",void 0),W([(0,v.Property)(!0)],t.prototype,"enabled",void 0),W([(0,v.Complex)({},be)],t.prototype,"fields",void 0),W([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),W([(0,v.Property)("StartsWith")],t.prototype,"filterType",void 0),W([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),W([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),W([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),W([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),W([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),W([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),W([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),W([(0,v.Property)("Default")],t.prototype,"mode",void 0),W([(0,v.Property)("No Records Found")],t.prototype,"noRecordsTemplate",void 0),W([(0,v.Property)(null)],t.prototype,"placeholder",void 0),W([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),W([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),W([(0,v.Property)(!1)],t.prototype,"readonly",void 0),W([(0,v.Property)(!1)],t.prototype,"showSelectAll",void 0),W([(0,v.Property)("Select All")],t.prototype,"selectAllText",void 0),W([(0,v.Property)(!1)],t.prototype,"showCheckBox",void 0),W([(0,v.Property)(!0)],t.prototype,"destroyPopupOnHide",void 0),W([(0,v.Property)(!0)],t.prototype,"enableHtmlSanitizer",void 0),W([(0,v.Property)(!0)],t.prototype,"showClearButton",void 0),W([(0,v.Property)(!0)],t.prototype,"showDropDownIcon",void 0),W([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),W([(0,v.Property)(null)],t.prototype,"text",void 0),W([(0,v.Complex)({},Se)],t.prototype,"treeSettings",void 0),W([(0,v.Property)("Unselect All")],t.prototype,"unSelectAllText",void 0),W([(0,v.Property)(null)],t.prototype,"value",void 0),W([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),W([(0,v.Property)("100%")],t.prototype,"width",void 0),W([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),W([(0,v.Property)(!1)],t.prototype,"wrapText",void 0),W([(0,v.Event)()],t.prototype,"actionFailure",void 0),W([(0,v.Event)()],t.prototype,"beforeOpen",void 0),W([(0,v.Event)()],t.prototype,"change",void 0),W([(0,v.Event)()],t.prototype,"close",void 0),W([(0,v.Event)()],t.prototype,"blur",void 0),W([(0,v.Event)()],t.prototype,"created",void 0),W([(0,v.Event)()],t.prototype,"dataBound",void 0),W([(0,v.Event)()],t.prototype,"destroyed",void 0),W([(0,v.Event)()],t.prototype,"filtering",void 0),W([(0,v.Event)()],t.prototype,"focus",void 0),W([(0,v.Event)()],t.prototype,"keyPress",void 0),W([(0,v.Event)()],t.prototype,"open",void 0),W([(0,v.Event)()],t.prototype,"select",void 0),t=W([v.NotifyPropertyChanges],t)}(v.Component),xe=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ie=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},we="e-atc-spinner-icon";T.root="e-combobox";var Oe={container:null,buttons:[]},Ae=function(e){function t(t,i){return e.call(this,t,i)||this}return xe(t,e),t.prototype.preRender=function(){e.prototype.preRender.call(this)},t.prototype.getLocaleName=function(){return"combo-box"},t.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(v.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),v.EventHandler.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])||v.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),v.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(v.EventHandler.add(this.inputElement,"input",this.onInput,this),v.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),v.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),v.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this),v.EventHandler.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},t.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(T.input)||!v.Browser.isDevice)&&v.Browser.isDevice||e.preventDefault()},t.prototype.onBlurHandler=function(t){var i=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;(0,v.isNullOrUndefined)(this.listData)||(0,v.isNullOrUndefined)(i)||i===this.text||this.customValue(t),e.prototype.onBlurHandler.call(this,t)},t.prototype.targetElement=function(){return this.inputElement},t.prototype.setOldText=function(e){N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},t.prototype.setOldValue=function(e){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},t.prototype.valueMuteChange=function(e){e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(e)?(0,v.getValue)(this.fields.value?this.fields.value:"",e):e;var t=(0,v.isNullOrUndefined)(e)?null:e.toString();N.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton);var i={};if(this.allowObjectBinding&&(e=this.getDataByValue(e),(0,v.isNullOrUndefined)(e))){var s=this.fields,l=!1,n=!1;if(this.allowObjectBinding){var a=Object.keys(this.value);a.forEach((function(e){e!==s.value||(n=!0)})),a.forEach((function(e){e!==s.text||(l=!0)}))}i={text:n?l?(0,v.getValue)(s.text,this.value):(0,v.getValue)(s.value,this.value):null,value:n?this.value:null,index:null}}this.allowObjectBinding?this.setProperties(i,!0):this.setProperties({value:e,text:e?e.toString():e,index:null},!0),this.activeIndex=this.index;var o=this.fields,r={};r[o.text]=(0,v.isNullOrUndefined)(e)?null:e.toString(),r[o.value]=(0,v.isNullOrUndefined)(e)?null:e.toString(),this.itemData=r,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},t.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index)),(0,v.isNullOrUndefined)(this.value))if(this.text&&(0,v.isNullOrUndefined)(this.value)){(t=this.getElementByText(this.text))?this.setSelection(t,null):(N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue())}else this.setSelection(this.liCollections[this.activeIndex],null);else{var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,t=this.getElementByValue(e),i=!(0,v.isNullOrUndefined)(t);if(this.enableVirtualization&&this.value){var s,l=this.fields.value?this.fields.value:"",n=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;if(this.dataSource instanceof g.DataManager){if((s=new g.DataManager(this.virtualGroupDataSource).executeLocal((new g.Query).where(new g.Predicate(l,"equal",n))))&&s.length>0){this.itemData=s[0],i=!0;var a=this.getItemData(),o=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&this.setProperties({text:a.text?a.text.toString():a.text,value:o})}}else if((s=new g.DataManager(this.dataSource).executeLocal((new g.Query).where(new g.Predicate(l,"equal",n))))&&s.length>0){this.itemData=s[0],i=!0;a=this.getItemData(),o=this.allowObjectBinding?this.getDataByValue(a.value):a.value;(this.value===a.value&&this.text!==a.text||this.value!==a.value&&this.text===a.text)&&this.setProperties({text:a.text?a.text.toString():a.text,value:o})}}t?this.setSelection(t,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!i?this.valueMuteChange(this.value):(!this.enableVirtualization||this.enableVirtualization&&!i)&&this.valueMuteChange(null)}this.setHiddenValue(),N.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?(0,v.removeClass)([this.inputWrapper.clearButton],T.clearIconHide):(0,v.addClass)([this.inputWrapper.clearButton],T.clearIconHide))},t.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},t.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(e.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+T.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+T.li)),this.incrementalSearch(t))},t.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},t.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:Oe},t.prototype.onActionComplete=function(t,i,s,l){var n=this;e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout((function(){n.inlineSearch()}))},t.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),t=(0,v.isNullOrUndefined)(this.list)?this.list:this.list.querySelector("."+T.selected);if(e.text&&e.text.toString()===this.inputElement.value&&!(0,v.isNullOrUndefined)(t))return t;if((v.Browser.isDevice&&!this.isDropDownClick||!v.Browser.isDevice)&&!(0,v.isNullOrUndefined)(this.liCollections)&&this.liCollections.length>0){var i=this.inputElement.value,s=this.sortedData,l=this.typeOfData(s).typeof,n=o(i,this.liCollections,this.filterType,!0,s,this.fields,l,this.ignoreAccent);if(this.enableVirtualization&&""!==i&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var a=!1,r=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,h=0===this.incrementalEndIndex;for((r||h)&&(a=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=h?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0),(0!==this.viewPortInfo.startIndex||a)&&this.updateIncrementalView(0,this.itemCount),n=o(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l);(0,v.isNullOrUndefined)(n.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0,(0!==this.viewPortInfo.startIndex||a)&&this.updateIncrementalView(0,this.itemCount),n=o(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l),!(0,v.isNullOrUndefined)(n)){n.index=n.index+this.incrementalStartIndex;break}if((0,v.isNullOrUndefined)(n)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}}var u=n.index-(this.itemCount/2-2)>0?n.index-(this.itemCount/2-2):0,p=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;if(u!==this.viewPortInfo.startIndex&&this.updateIncrementalView(u,p),(0,v.isNullOrUndefined)(n.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{var d=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,c=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(d,c),n.item=this.getElementByValue(n.item.getAttribute("data-value"))}n&&n.item&&(n.item=this.getElementByValue(n.item.getAttribute("data-value")))}var m=n.item;if((0,v.isNullOrUndefined)(m))this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0));else{var f=this.getIndexByValue(m.getAttribute("data-value"))-1,g=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(g)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var y=this.fields.groupBy?this.liCollections[0].offsetHeight:0;if(this.enableVirtualization){if(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy){var C=m.offsetTop,b=this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0,S=m.offsetHeight,E=C+b*S,x=this.list.querySelectorAll(".e-virtual-list").length*S;this.list.scrollTop=E-x}}else this.list.scrollTop=f*g+y;(0,v.addClass)([m],T.focus)}}return m}return null},t.prototype.setValue=function(t){return(t&&"keydown"===t.type&&"enter"===t.action||t&&"click"===t.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):e.prototype.setValue.call(this,t)},t.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;this.itemData=this.getDataByValue(e);var t=this.getItemData(),i=this.allowObjectBinding?this.itemData:t.value;this.allowCustom&&(0,v.isNullOrUndefined)(t.value)&&(0,v.isNullOrUndefined)(t.text)||this.setProperties({value:i},!this.allowCustom)},t.prototype.showSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||N.Input.appendSpan("e-input-group-icon "+we,this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,(0,v.addClass)([this.spinnerElement],T.disableIcon),(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,k.showSpinner)(this.spinnerElement))},t.prototype.hideSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||((0,k.hideSpinner)(this.spinnerElement),(0,v.removeClass)([this.spinnerElement],T.disableIcon),this.spinnerElement.classList.contains(we)?(0,v.detach)(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},t.prototype.setAutoFill=function(e,t){if(t||this.setHoverList(e),this.autofill&&!this.preventAutoFill){var i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value"));"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==s||this.allowObjectBinding&&this.previousValue&&s&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(s)])?(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e.getAttribute("data-value"))):this.getFormattedValue(e.getAttribute("data-value"))):this.updateSelectedItem(e,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,t)}},t.prototype.isAndroidAutoFill=function(e){if(v.Browser.isAndroid){var t=this.getSelectionPoints(),i=this.prevSelectPoints.end,s=t.end,l=this.prevSelectPoints.start,n=t.start;return 0!==i&&(i===e.length&&l===e.length||l>n&&i>s||i===s&&l===n)}return!1},t.prototype.clearAll=function(t,i){((0,v.isNullOrUndefined)(i)||!(0,v.isNullOrUndefined)(i)&&(0,v.isNullOrUndefined)(i.dataSource))&&e.prototype.clearAll.call(this,t),this.isFiltering()&&!(0,v.isNullOrUndefined)(t)&&t.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(t))},t.prototype.isSelectFocusItem=function(e){return!(0,v.isNullOrUndefined)(e)},t.prototype.inlineSearch=function(e){var t=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),i=t?this.liCollections[this.activeIndex]:this.getFocusElement();if((0,v.isNullOrUndefined)(i)){if((0,v.isNullOrUndefined)(this.inputElement)||""!==this.inputElement.value)this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length>0&&!this.isCustomFilter&&this.removeFocus();else if(this.activeIndex=null,!(0,v.isNullOrUndefined)(this.list)){this.enableVirtualization||(this.list.scrollTop=0);var s=this.list.querySelector("."+T.li);this.setHoverList(s)}}else{if(!t){var l=this.getFormattedValue(i.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l),this.activeIndex=(0,v.isNullOrUndefined)(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(i,t)}},t.prototype.incrementalSearch=function(e){this.showPopup(e),(0,v.isNullOrUndefined)(this.listData)||(this.inlineSearch(e),e.preventDefault())},t.prototype.setAutoFillSelection=function(e,t){void 0===t&&(t=!1);var i=this.getSelectionPoints(),s=this.inputElement.value.substr(0,i.start);if(s&&s.toLowerCase()===e.substr(0,i.start).toLowerCase()){var l=s+e.substr(s.length,e.length);N.Input.setValue(l,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)}else t&&(N.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},t.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,!0,this.ignoreAccent)},t.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(v.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),v.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])||v.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(v.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(v.EventHandler.remove(this.inputElement,"input",this.onInput),v.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),v.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),v.EventHandler.remove(this.inputElement,"paste",this.pasteHandler),v.EventHandler.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},t.prototype.setSelection=function(t,i){e.prototype.setSelection.call(this,t,i),(0,v.isNullOrUndefined)(t)||this.autofill||this.isDropDownClick||this.removeFocus()},t.prototype.selectCurrentItem=function(e){var t;if(this.isPopupOpen){if(t=this.isSelected?this.list.querySelector("."+T.selected):this.list.querySelector("."+T.focus),this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))}"enter"===e.action&&""===this.inputElement.value?this.clearAll(e):this.isTyped&&!this.isSelected&&(0,v.isNullOrUndefined)(t)&&this.customValue(e),this.hidePopup(e)},t.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(T.selected)&&(this.removeFocus(),e.classList.add(T.focus))},t.prototype.targetFocus=function(e){v.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e),N.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},t.prototype.dropDownClick=function(t){t.preventDefault(),v.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,t)},t.prototype.customValue=function(e){var t=this,i=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value){var s=this.value;if((0,v.isNullOrUndefined)(i)){var l=""===this.inputElement.value?null:this.inputElement.value,n={text:l,item:{}};this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(l,n,s):this.trigger("customValueSpecifier",n,(function(i){t.updateCustomValueCallback(l,i,s,e)}))}else this.isSelectCustom=!1,i=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:i}),(!this.allowObjectBinding&&s!==this.value||this.allowObjectBinding&&s&&this.value&&!this.isObjectInArray(s,[this.value]))&&this.onChangeEvent(e)}else this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0);else{var a=this.previousValue,o=this.value;i=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:i}),(0,v.isNullOrUndefined)(this.value)&&N.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&a===this.value||this.allowObjectBinding&&a&&this.isObjectInArray(a,[this.value]))&&(!this.allowObjectBinding&&o!==this.value||this.allowObjectBinding&&o&&!this.isObjectInArray(o,[this.value]))&&this.onChangeEvent(null)}},t.prototype.updateCustomValueCallback=function(e,t,i,s){var l=this,n=this.fields,a=t.item,o={};a&&(0,v.getValue)(n.text,a)&&(0,v.getValue)(n.value,a)?o=a:((0,v.setValue)(n.text,e,o),(0,v.setValue)(n.value,e,o)),this.itemData=o;var r={};if(this.allowObjectBinding){var h=this.listData&&this.listData.length>0?Object.keys(this.listData[0]):Object.keys(this.itemData);this.listData&&this.listData.length>0||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)||(h=this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)),h.forEach((function(e){r[e]=e===n.value||e===n.text?(0,v.getValue)(n.value,l.itemData):null}))}var u={text:(0,v.getValue)(n.text,this.itemData),value:this.allowObjectBinding?r:(0,v.getValue)(n.value,this.itemData),index:null};this.setProperties(u,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&(null==i&&null!==this.value||i&&!this.isObjectInArray(i,[this.value])))&&this.onChangeEvent(s,!0)},t.prototype.onPropertyChanged=function(t,i){"combobox"===this.getModuleName()&&(this.checkData(t),this.setUpdateInitial(["fields","query","dataSource"],t,i));for(var s=0,l=Object.keys(t);s<l.length;s++){var n=l[s];switch(n){case"readonly":N.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(v.EventHandler.remove(this.inputElement,"input",this.onInput),v.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),v.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(v.EventHandler.add(this.inputElement,"input",this.onInput,this),v.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),v.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&(0,v.isNullOrUndefined)(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var a=this.getPropObject(n,t,i);e.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty),this.isFiltering()&&"dataSource"===n&&(0,v.isNullOrUndefined)(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},t.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},t.prototype.getModuleName=function(){return"combobox"},t.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},t.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},t.prototype.showPopup=function(t){e.prototype.showPopup.call(this,t)},t.prototype.hidePopup=function(t){var i=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!(0,v.isNullOrUndefined)(this.listData)){var s=this.isEscapeKey;this.isEscapeKey&&(N.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var l=this.isSelectCustom?{text:""}:this.getItemData(),n=(0,v.isNullOrUndefined)(this.list)?null:this.list.querySelector("."+T.selected);if(this.inputElement&&l.text===this.inputElement.value&&!(0,v.isNullOrUndefined)(n))return this.isSelected&&(this.onChangeEvent(t),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,t);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var a=this.sortedData,r=this.typeOfData(a).typeof,h=o(this.inputElement.value,this.liCollections,"Equal",!0,a,this.fields,r);this.selectedLI=h.item,(0,v.isNullOrUndefined)(h.index)&&(h.index=o(this.inputElement.value,this.liCollections,"StartsWith",!0,a,this.fields,r).index),this.activeIndex=h.index,(0,v.isNullOrUndefined)(this.selectedLI)?s&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(t)}var u=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value;(0,v.isNullOrUndefined)(this.listData)&&this.allowCustom&&!(0,v.isNullOrUndefined)(i)&&i!==u&&this.customValue(),e.prototype.hidePopup.call(this,t)},t.prototype.focusIn=function(){this.enabled&&(v.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},t.prototype.clear=function(){this.value=null},t.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},t.prototype.getItems=function(){return e.prototype.getItems.call(this)},t.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},t.prototype.renderHightSearch=function(){},Ie([(0,v.Property)(!1)],t.prototype,"autofill",void 0),Ie([(0,v.Property)(!0)],t.prototype,"allowCustom",void 0),Ie([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),Ie([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),Ie([(0,v.Property)(!0)],t.prototype,"isDeviceFullScreen",void 0),Ie([(0,v.Property)(null)],t.prototype,"query",void 0),Ie([(0,v.Property)(null)],t.prototype,"index",void 0),Ie([(0,v.Property)(!0)],t.prototype,"showClearButton",void 0),Ie([(0,v.Property)(!1)],t.prototype,"enableRtl",void 0),Ie([(0,v.Event)()],t.prototype,"customValueSpecifier",void 0),Ie([(0,v.Event)()],t.prototype,"filtering",void 0),Ie([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),Ie([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),Ie([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),Ie([(0,v.Property)(null)],t.prototype,"cssClass",void 0),Ie([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),Ie([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),Ie([(0,v.Property)(null)],t.prototype,"placeholder",void 0),Ie([(0,v.Property)("100%")],t.prototype,"width",void 0),Ie([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),Ie([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),Ie([(0,v.Property)(!1)],t.prototype,"readonly",void 0),Ie([(0,v.Property)(null)],t.prototype,"text",void 0),Ie([(0,v.Property)(null)],t.prototype,"value",void 0),Ie([(0,v.Property)(!1)],t.prototype,"allowObjectBinding",void 0),t=Ie([v.NotifyPropertyChanges],t)}(P),De=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ke=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};T.root="e-autocomplete",T.icon="e-input-group-icon e-ddl-icon e-search-icon";var Ne=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return De(t,e),t.prototype.preRender=function(){e.prototype.preRender.call(this)},t.prototype.getLocaleName=function(){return"auto-complete"},t.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query,i=this.allowObjectBinding&&!(0,v.isNullOrUndefined)(this.value)?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value):this.value,s=""!==this.queryString||(0,v.isNullOrUndefined)(i)?this.filterType:"equal",l=""!==this.queryString||(0,v.isNullOrUndefined)(i)?this.queryString:i;if(this.isFiltered)if(this.enableVirtualization&&!(0,v.isNullOrUndefined)(this.customFilterQuery))t=this.customFilterQuery.clone();else if(!this.enableVirtualization)return t;if(null!==this.queryString&&""!==this.queryString){var n=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==n)&&"number"!==n){var a=(0,v.isNullOrUndefined)(this.fields.value)?"":this.fields.value;t.where(a,s,l,this.ignoreCase,this.ignoreAccent)}else t.where("",s,l,this.ignoreCase,this.ignoreAccent)}if(!(0,v.isNullOrUndefined)(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(var o=0;o<t.queries.length;o++)"onTake"===t.queries[o].fn&&t.queries.splice(o,1);t.take(this.suggestionCount)}if(this.enableVirtualization){var r=0,h=0,u=this.getTakeValue();if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)"onSkip"===t.queries[o].fn&&(h=t.queries[o].e.nos),"onTake"===t.queries[o].fn&&(r=u<=t.queries[o].e.nos?t.queries[o].e.nos:u);if(r<=0&&this.query&&this.query.queries.length>0)for(o=0;o<this.query.queries.length;o++)if("onTake"===this.query.queries[o].fn){var p=this.query.queries[o].e.nos;r=u<=p?p:u}if(t&&t.queries.length>0)for(o=0;o<t.queries.length;o++)if("onSkip"!==t.queries[o].fn){if("onTake"===t.queries[o].fn){var d=t.queries[o].e.nos;r=d<=r?r:d,t.queries.splice(o,1),--o}}else h=t.queries[o].e.nos,t.queries.splice(o,1),--o;h>0&&this.virtualItemStartIndex<=h?t.skip(h):t.skip(this.virtualItemStartIndex),r>0&&u<=r?t.take(r):t.take(u),t.requiresCount()}return t},t.prototype.searchLists=function(t){var i=this;if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,this.checkAndResetCache(),(0,v.isNullOrUndefined)(this.list)&&e.prototype.renderList.call(this,t,!0),this.queryString=this.filterInput.value,"mousedown"!==t.type&&(40===t.keyCode||38===t.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields,null,t);this.isSelected=!1,this.activeIndex=null,this.isRequesting=!1;var s={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,t,l){s.cancel||(i.isFiltered=!0,i.customFilterQuery=t,i.filterAction(e,t,l))},cancel:!1};this.trigger("filtering",s,(function(e){e.cancel||i.isFiltered||e.preventDefaultAction||(i.searchList=!0,i.filterAction(i.dataSource,null,i.fields,t))}))},t.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},t.prototype.filterAction=function(e,t,i,s){this.beforePopupOpen=!0;var l=this.list.classList.contains("e-nodata");if(""!==this.queryString&&this.queryString.length>=this.minLength){if(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t,s),l=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!l){if(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")){var n=this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()});this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))}if(!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement){n=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.list.parentElement.querySelector(".e-dropdownbase").appendChild(n)}}("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof g.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof g.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}else this.hidePopup(s),this.beforePopupOpen=!1;this.renderReactTemplates()},t.prototype.clearAll=function(t,i){((0,v.isNullOrUndefined)(i)||!(0,v.isNullOrUndefined)(i)&&(0,v.isNullOrUndefined)(i.dataSource))&&(e.prototype.clearAll.call(this,t),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},t.prototype.onActionComplete=function(t,i,s,l){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof g.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof g.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),e.prototype.onActionComplete.call(this,t,i,s);var n=this.list.querySelector("."+T.li);(0,v.isNullOrUndefined)(n)||(0,v.removeClass)([n],T.focus),(0,v.isNullOrUndefined)(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},t.prototype.postBackAction=function(){if(this.autofill&&!(0,v.isNullOrUndefined)(this.liCollections[0])&&this.searchList){var t=[this.liCollections[0]],i=this.listData,s=this.typeOfData(i).typeof,l=o(this.inputElement.value,t,"StartsWith",this.ignoreCase,i,this.fields,s);this.searchList=!1,(0,v.isNullOrUndefined)(l.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},t.prototype.setSelection=function(t,i){if(this.isValidLI(t))if(!(0,v.isNullOrUndefined)(i)&&"keydown"===i.type&&"enter"!==i.action&&"tab"!==i.action&&this.isValidLI(t)){var s=this.getFormattedValue(t.getAttribute("data-value"));if(this.activeIndex=this.getIndexByValue(s),this.setHoverList(t),this.selectedLI=t,this.setScrollPosition(i),this.autofill&&this.isPopupOpen){this.preventAutoFill=!1;var l=i&&"down"===i.action||"up"===i.action||"home"===i.action||"end"===i.action||"pageUp"===i.action||"pageDown"===i.action;e.prototype.setAutoFill.call(this,t,l)}}else e.prototype.setSelection.call(this,t,i),this.isFiltered=!1;else this.selectedLI=t},t.prototype.listOption=function(t,i){var s=this,l=e.prototype.listOption.call(this,t,i);if((0,v.isNullOrUndefined)(l.itemCreated))l.itemCreated=function(e){s.highlight&&(s.element.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout((function(){d(e.item,s.queryString,s.ignoreCase,s.filterType)}),0):d(e.item,s.queryString,s.ignoreCase,s.filterType))};else{var n=l.itemCreated;l.itemCreated=function(e){s.highlight&&d(e.item,s.queryString,s.ignoreCase,s.filterType),n.apply(s,[e])}}return l},t.prototype.isFiltering=function(){return!0},t.prototype.renderPopup=function(t){this.enableVirtualization||(this.list.scrollTop=0),e.prototype.renderPopup.call(this,t)},t.prototype.isEditTextBox=function(){return!1},t.prototype.isPopupButton=function(){return this.showPopupButton},t.prototype.isSelectFocusItem=function(e){return!1},t.prototype.setInputValue=function(e,t){var i=t&&t.text?t.text:t?t.value:t,s=e&&e.text?e.text:e&&e.value?e.value:this.value;if(this.allowObjectBinding&&(i=(0,v.isNullOrUndefined)(i)?i:(0,v.getValue)(this.fields.value?this.fields.value:"",i),s=(0,v.isNullOrUndefined)(s)?s:(0,v.getValue)(this.fields.value?this.fields.value:"",s)),!s||""!==this.typedString||this.allowCustom||this.dataSource instanceof g.DataManager)e&&(e.text?this.setOldText(i):this.setOldValue(i));else{var l="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,n=this.getItems().length,a=new g.Query,o=this;new g.DataManager(this.dataSource).executeQuery(a.where(new g.Predicate(l,"equal",s))).then((function(t){t.result.length>0?(o.value=""!==l?o.allowObjectBinding?t.result[0]:t.result[0][o.fields.value].toString():t.result[0].toString(),o.addItem(t.result,n),o.updateValues()):e&&e.text?o.setOldText(i):e&&e.value?o.setOldValue(i):o.updateValues()}))}},t.prototype.showPopup=function(e){this.enabled&&(this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.preventAutoFill=!0,(0,v.isNullOrUndefined)(this.list)?this.renderList(e):this.resetList(this.dataSource,this.fields,null,e)))},t.prototype.hidePopup=function(t){e.prototype.hidePopup.call(this,t),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},t.prototype.onPropertyChanged=function(t,i){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],t);for(var s=0,l=Object.keys(t);s<l.length;s++){var n=l[s];if("showPopupButton"===n)if(this.showPopupButton){var a=N.Input.appendSpan(T.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=a,N.Input.calculateWidth(this.inputElement,this.inputWrapper.container),(0,v.isNullOrUndefined)(this.inputWrapper.buttons[0])||(0,v.isNullOrUndefined)(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&v.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else(0,v.detach)(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null;else{var o=this.getPropObject(n,t,i);e.prototype.onPropertyChanged.call(this,o.newProperty,o.oldProperty)}}},t.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++){var t=this.ulElement.querySelector(".e-active");t||(m(this.liCollections[e]),d(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType)),t=null}},t.prototype.getModuleName=function(){return"autocomplete"},t.prototype.render=function(){e.prototype.render.call(this)},ke([(0,v.Complex)({value:null,iconCss:null,groupBy:null,disabled:null},O)],t.prototype,"fields",void 0),ke([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),ke([(0,v.Property)(!1)],t.prototype,"showPopupButton",void 0),ke([(0,v.Property)(!1)],t.prototype,"highlight",void 0),ke([(0,v.Property)(20)],t.prototype,"suggestionCount",void 0),ke([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),ke([(0,v.Property)(null)],t.prototype,"query",void 0),ke([(0,v.Property)(1)],t.prototype,"minLength",void 0),ke([(0,v.Property)("Contains")],t.prototype,"filterType",void 0),ke([(0,v.Event)()],t.prototype,"filtering",void 0),ke([(0,v.Property)(null)],t.prototype,"index",void 0),ke([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),ke([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),ke([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),ke([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),ke([(0,v.Property)(null)],t.prototype,"text",void 0),t=ke([v.NotifyPropertyChanges],t)}(Ae),Le="e-float-line",Be="e-float-text",Te="e-label-top",Ve="e-label-bottom";function Pe(e,t,i,s,l,n,a){var o=(0,v.createElement)("span",{className:Le}),r=(0,v.createElement)("label",{className:Be}),h=i.getAttribute("id")?i.getAttribute("id"):(0,v.getUniqueID)("ej2_multiselect");i.id=h,(0,v.isNullOrUndefined)(i.id)||""===i.id||(r.id="label_"+i.id.replace(/ /g,"_"),r.setAttribute("for",i.id),(0,v.attributes)(s,{"aria-labelledby":r.id})),(0,v.isNullOrUndefined)(s.placeholder)||""===s.placeholder||(r.innerText=Me(s.placeholder),s.removeAttribute("placeholder")),r.innerText=Me(a),t.appendChild(o),t.appendChild(r),e.classList.add("e-float-input"),Ue(l,r),"Always"===n&&(r.classList.contains(Ve)&&(0,v.removeClass)([r],Ve),(0,v.addClass)([r],Te))}function Ue(e,t){e&&e.length>0?((0,v.addClass)([t],Te),(0,v.removeClass)([t],Ve)):((0,v.removeClass)([t],Te),(0,v.addClass)([t],Ve))}function He(e,t,i,s,l,n,a){var o,r=t.querySelector("."+Be),h=t.querySelector("."+Le);(0,v.isNullOrUndefined)(r)?Fe(l,s,o=null!==a?a:""):(o=r.innerText,(0,v.detach)(i.querySelector("."+Be)),Fe(l,s,o),(0,v.isNullOrUndefined)(h)||(0,v.detach)(i.querySelector("."+Le))),e.classList.remove("e-float-input")}function Fe(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function We(e,t){e.classList.add("e-input-focus");var i=t.querySelector("."+Be);(0,v.isNullOrUndefined)(i)||((0,v.addClass)([i],Te),i.classList.contains(Ve)&&(0,v.removeClass)([i],Ve))}function qe(e,t,i,s,l){e.classList.remove("e-input-focus");var n=t.querySelector("."+Be);i&&i.length<=0&&"Auto"===s&&!(0,v.isNullOrUndefined)(n)&&(n.classList.contains(Te)&&(0,v.removeClass)([n],Te),(0,v.addClass)([n],Ve))}function Me(e){var t="";if(!(0,v.isNullOrUndefined)(e)&&""!==e){var i=document.createElement("span");i.innerHTML='<input placeholder="'+e+'"/>',t=i.children[0].placeholder}return t}var je=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Re=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ze="e-input-focus",Ke="e-disabled",_e="e-hide-listitem",Ge="e-chips",Qe="e-chips-close",Je="e-chip-selected",Xe="e-delimiter",Ye="e-zero-size",$e="e-chips-close e-close-hooker",Ze="e-delim-values",et="e-rtl",tt="e-close-icon-hide",it="e-ddl-disable-icon",st="e-ms-spinner-icon",lt="e-input-group-icon e-ddl-icon",nt="e-icon-anim",at="e-delim-total",ot="e-search-custom-width",rt="e-input-filter",ht=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.previousFilterText="",s.storedSelectAllHeight=0,s.isUpdateHeaderHeight=!1,s.isUpdateFooterHeight=!1,s.isBlurDispatching=!1,s.isFilterPrevented=!1,s.isFilteringAction=!1,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.preventSetCurrentData=!1,s.isSelectAllLoop=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return je(t,e),t.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add(et):this.overAllWrapper.classList.remove(et),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},t.prototype.requiredModules=function(){var e=[];if(this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode){if(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t}this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})}return e},t.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];switch(i){case"class":var s=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==s&&((0,v.addClass)([this.overAllWrapper],s.split(" ")),(0,v.addClass)([this.popupWrapper],s.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(i,this.htmlAttributes[""+i]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:["id"].indexOf(i)>-1?this.element.setAttribute(i,this.htmlAttributes[""+i]):0===i.indexOf("data")||["name","required","aria-required","form"].indexOf(i)>-1?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):["title","role","style","class"].indexOf(i)>-1?this.overAllWrapper.setAttribute(i,this.htmlAttributes[""+i]):"size"===i||(0,v.isNullOrUndefined)(this.inputElement)||this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}}},t.prototype.updateReadonly=function(e){(0,v.isNullOrUndefined)(this.inputElement)||(e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},t.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove(tt)):(this.overAllClear.style.display="none",this.componentWrapper.classList.add(tt))},t.prototype.updateCssClass=function(){if(!(0,v.isNullOrUndefined)(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&((0,v.addClass)([this.overAllWrapper],e.split(" ")),(0,v.addClass)([this.popupWrapper],e.split(" ")))}},t.prototype.updateOldPropCssClass=function(e){(0,v.isNullOrUndefined)(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&((0,v.removeClass)([this.overAllWrapper],e.split(" ")),(0,v.removeClass)([this.popupWrapper],e.split(" ")))},t.prototype.onPopupShown=function(e){var t=this;if(v.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var i=this;window.onpopstate=function(){i.hidePopup(),i.inputElement.focus()},history.pushState({},"")}var s={popup:this.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}};this.trigger("open",s,(function(e){e.cancel||(t.focusAtFirstListItem(!0),t.popupObj&&document.body.appendChild(t.popupObj.element),"CheckBox"===t.mode&&t.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(t.fields.groupBy)&&t.updateListItems(t.list.querySelectorAll("li.e-list-item"),t.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===t.mode||t.showDropDownIcon)&&(0,v.addClass)([t.overAllWrapper],[nt]),t.refreshPopup(),t.renderReactTemplates(),t.popupObj&&t.popupObj.show(e.animation,1e3===t.zIndex?t.element:null),t.isReact&&setTimeout((function(){if(t.popupHeight&&t.list&&"auto"!==t.popupHeight){var e="string"==typeof t.popupHeight?parseInt(t.popupHeight,10):t.popupHeight;if(!t.isUpdateHeaderHeight&&t.headerTemplate&&t.header){var i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.header.offsetHeight).toString()+"px",t.isUpdateHeaderHeight=!0}if(!t.isUpdateFooterHeight&&t.footerTemplate&&t.footer){i=""===t.list.style.maxHeight?e:parseInt(t.list.style.maxHeight,10);t.list.style.maxHeight=(i-t.footer.offsetHeight).toString()+"px",t.isUpdateFooterHeight=!0}}}),15),(0,v.attributes)(t.inputElement,{"aria-expanded":"true","aria-owns":t.element.id+"_popup","aria-controls":t.element.id}),t.updateAriaActiveDescendant(),t.isFirstClick&&(t.enableVirtualization||t.loadTemplate()),"CheckBox"===t.mode&&t.showSelectAll&&v.EventHandler.add(t.popupObj.element,"click",t.clickHandler,t))}))},t.prototype.updateVirtualReOrderList=function(e){var t=this.getForQuery(this.value,!0).clone();if(this.enableVirtualization&&this.dataSource instanceof g.DataManager?this.resetList(this.selectedListData,this.fields,t):this.resetList(this.dataSource,this.fields,t),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(i)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),e&&this.loadTemplate()},t.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},t.prototype.loadTemplate=function(){if(this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode){var e=this.list.querySelectorAll(".e-reorder")[0];this.list.querySelector(".e-virtual-ddl-content")&&e&&this.list.querySelector(".e-virtual-ddl-content").removeChild(e)}"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},t.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0){var e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],t=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",e);(0,v.isNullOrUndefined)(t)||this.scrollBottom(t,void 0,!1,null,!0)}if(this.enableVirtualization){var i=this.list.querySelector("."+A.focus);this.isKeyBoardAction=!1,this.scrollBottom(i,void 0,!1,null,!0)}},t.prototype.focusAtFirstListItem=function(e){if(this.ulElement&&this.ulElement.querySelector("li."+A.li)){var t,i=void 0;if("CheckBox"===this.mode)return void this.removeFocus();this.enableVirtualization?this.fields.disabled?(i=this.ulElement.querySelector("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem):not(."+Ke+")"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(i=(t=this.ulElement.querySelectorAll("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&t.length>0?t[2]:i)):(i=this.ulElement.querySelector("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(i=(t=this.ulElement.querySelectorAll("li."+A.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&t.length>0?t[2]:i)):i=this.fields.disabled?this.ulElement.querySelector("li."+A.li+":not(."+_e+"):not(."+Ke+")"):this.ulElement.querySelector("li."+A.li+":not(."+_e+")"),null!==i&&(this.removeFocus(),this.addListFocus(i))}},t.prototype.focusAtLastListItem=function(e){var t;e?t=o(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?o(this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null;t&&null!==t.item&&(this.addListFocus(t.item),((this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(t.item,t.index))},t.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},t.prototype.updateListARIA=function(){(0,v.isNullOrUndefined)(this.ulElement)||(0,v.attributes)(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var e=!((0,v.isNullOrUndefined)(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||(0,v.isNullOrUndefined)(this.inputElement)||(0,v.attributes)(this.inputElement,this.getAriaAttributes()),e&&(0,v.attributes)(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},t.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var t=this.htmlAttributes;(0,v.extend)(t,{"aria-disabled":e},t),this.setProperties({htmlAttributes:t},!0)}},t.prototype.removelastSelection=function(e){if(null===this.chipCollectionWrapper.querySelector("span."+Je)){var t=this.chipCollectionWrapper.querySelectorAll("span."+Ge),i=t[t.length-1].getAttribute("data-value");(0,v.isNullOrUndefined)(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice()));var s=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i);this.allowCustomValue&&("false"!==i&&!1===s||!(0,v.isNullOrUndefined)(s)&&"NaN"===s.toString())&&(s=i),this.removeValue(s,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()}else this.removeSelectedChip(e)},t.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},t.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement.value},t.prototype.getForQuery=function(e,t){var i,s=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&e){if(t){for(var l=0;l<e.length;l++){var n=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e[l]):e[l];i=0===l?new g.Predicate(s,"equal",n):i.or(s,"equal",n)}return(new g.Query).where(i)}for(l=0;l<e.length;l++){n=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e[l]):e[l];i=0===l?new g.Predicate(s,"notequal",n):i.and(s,"notequal",n)}return(new g.Query).where(i)}for(l=0;l<e.length;l++)i=0===l?new g.Predicate(s,"equal",e[l]):i.or(s,"equal",e[l]);return this.dataSource instanceof g.DataManager&&this.dataSource.adaptor instanceof g.JsonAdaptor?(new g.Query).where(i):this.getQuery(this.query).clone().where(i)},t.prototype.onActionComplete=function(t,i,s,l){var n=this;if(this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(s)&&!this.virtualGroupDataSource&&(this.totalItemCount=s.count),this.value&&i&&i.length>0&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction){var a=i.every((function(e){var t=(0,v.getValue)(n.fields.value?n.fields.value:"",e);return n.value.some((function(e){var i=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",e):e;return t===i}))}));a&&(t.innerHTML="",i=[])}e.prototype.onActionComplete.call(this,t,i,s),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);if(!(0,v.isNullOrUndefined)(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&this.listData.length>0)for(var o=0;o<this.value.length;o++){var r=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[o]):this.value[o];this.findListElement(this.allowFiltering&&!(0,v.isNullOrUndefined)(this.mainList)?this.mainList:t,"li","data-value",r)||this.dataSource instanceof g.DataManager||(this.value.splice(o,1),o-=1)}var h=[];if((0,v.isNullOrUndefined)(this.value)||(h=this.presentItemValue(this.ulElement)),h.length>0&&this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(this.value)&&null!=this.listData&&!this.enableVirtualization?this.addNonPresentItems(h,this.ulElement,this.listData):this.updateActionList(t,i,s),this.dataSource instanceof g.DataManager&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value){var u=new g.Query;u=this.allowFiltering?u.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):u,this.checkForCustomValue(u,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue}"CheckBox"!==this.mode||!this.enableGroupCheckBox||(0,v.isNullOrUndefined)(this.fields.groupBy)||(0,v.isNullOrUndefined)(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof g.DataManager&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},t.prototype.updateActionList=function(e,t,i,s){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?((0,v.isNullOrUndefined)(this.mainData)||0===this.mainData.length)&&(this.mainData=t):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=t,this.mainListCollection=this.liCollections),(this.remoteCustomValue||t.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!(0,v.isNullOrUndefined)(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof g.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),(0,v.isNullOrUndefined)(this.setInitialValue)||this.setInitialValue(),(0,v.isNullOrUndefined)(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&((0,v.isNullOrUndefined)(this.text)||!(0,v.isNullOrUndefined)(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof g.DataManager)?this.initialValueUpdate(this.listData,!0):this.initialValueUpdate(),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,this.value,null)),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown(i)))},t.prototype.refreshSelection=function(){var e,t,i=this.hideSelectedItem?_e:A.selected;if(!(0,v.isNullOrUndefined)(this.value))for(var s=0;!(0,v.isNullOrUndefined)(this.value[s]);s++)if(e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[s]):this.value[s],t=this.findListElement(this.list,"li","data-value",e)){if((0,v.addClass)([t],i),this.hideSelectedItem&&t.previousSibling&&t.previousElementSibling.classList.contains(A.group)&&(!t.nextElementSibling||t.nextElementSibling.classList.contains(A.group))&&(0,v.addClass)([t.previousElementSibling],i),this.hideSelectedItem&&this.fields.groupBy&&!t.previousElementSibling.classList.contains(_e)&&this.hideGroupItem(e),this.hideSelectedItem&&t.classList.contains(A.focus)){(0,v.removeClass)([t],A.focus);var l=t.parentElement.querySelectorAll("."+A.li+":not(."+_e+"):not(."+Ke+")");l.length>0?((0,v.addClass)([l[0]],A.focus),this.updateAriaActiveDescendant()):this.list&&this.list.querySelectorAll("."+A.li).length>0||(this.l10nUpdate(),(0,v.addClass)([this.list],A.noData))}if(t.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&t.classList.contains("e-active"))if(0===t.getElementsByClassName("e-check").length){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:t,e:null};this.notify("updatelist",n)}}this.checkSelectAll(),this.checkMaxSelection()},t.prototype.hideGroupItem=function(e){var t,i,s=this.hideSelectedItem?_e:A.selected;i=t=this.findListElement(this.ulElement,"li","data-value",e);var l=0,n=0,a=!0,o=!0;do{t&&t.previousElementSibling&&!t.previousElementSibling.classList.contains(_e)&&t.previousElementSibling.classList.contains(A.li)&&(a=!1),!a||!t||t.previousElementSibling&&t.previousElementSibling.classList.contains(A.group)?l=10:t=t.previousElementSibling,i&&i.nextElementSibling&&!i.nextElementSibling.classList.contains(_e)&&i.nextElementSibling.classList.contains(A.li)&&(o=!1),!o||!i||i.nextElementSibling&&i.nextElementSibling.classList.contains(A.group)?n=10:i=i.nextElementSibling}while(l<10||n<10);a&&o&&!t.previousElementSibling.classList.contains(_e)?(0,v.addClass)([t.previousElementSibling],s):a&&o&&t.previousElementSibling.classList.contains(_e)&&(0,v.removeClass)([t.previousElementSibling],s)},t.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+A.li+":not(."+_e+")");return(0,v.isNullOrUndefined)(e)?this.liCollections[0]:e},t.prototype.checkSelectAll=function(){var e=(0,v.isNullOrUndefined)(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active").length:this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)").length,t=this.list.querySelectorAll("li.e-list-item"),i=this.enableVirtualization?this.list.querySelectorAll("li."+A.li+":not(.e-virtual-list)").length:(0,v.isNullOrUndefined)(this.fields.disabled)?this.list.querySelectorAll("li."+A.li).length:this.list.querySelectorAll("li."+A.li+":not(.e-disabled)").length,s=this.list.querySelectorAll("li."+A.selected).length;if(this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(s-=e),!this.enableVirtualization&&(i===s||s===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.virtualSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):i!==s&&"CheckBox"===this.mode&&this.showSelectAll&&(!this.enableVirtualization||this.enableVirtualization&&!this.virtualSelectAll)&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var l=0;l<t.length;l++)this.findGroupStart(t[l]);this.deselectHeader()}},t.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(e)},t.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var t=String.fromCharCode(e.keyCode).match(/\w/);(0,v.isNullOrUndefined)(t)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},t.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query;if(this.isFiltered){if(this.enableVirtualization&&!(0,v.isNullOrUndefined)(this.customFilterQuery))return t=this.customFilterQuery.clone(),this.virtualFilterQuery(t);if(!this.enableVirtualization)return t}if(this.filterAction){if(null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim()){var i=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==i)&&"number"!==i){if(this.enableVirtualization&&""!==this.targetElement()&&!this.isClearAllAction||!this.enableVirtualization){var s=this.fields;t.where((0,v.isNullOrUndefined)(s.text)?"":s.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}}else t.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(t):this.virtualSelectAll?e?e.take(this.maximumSelectionLength).requiresCount():this.query?this.query.take(this.maximumSelectionLength).requiresCount():(new g.Query).take(this.maximumSelectionLength).requiresCount():t}return this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(t):this.virtualSelectAll?e?e.take(this.maximumSelectionLength).requiresCount():this.query?this.query.take(this.maximumSelectionLength).requiresCount():(new g.Query).take(this.maximumSelectionLength).requiresCount():e||(this.query?this.query:new g.Query)},t.prototype.virtualFilterQuery=function(e){for(var t=this.getTakeValue(),i=!0,s=!0,l=0;l<e.queries.length;l++)"multiselect"===this.getModuleName()&&(e.queries[l].e&&"or"===e.queries[l].e.condition||e.queries[l].e&&"equal"===e.queries[l].e.operator)&&(i=!1),"onSkip"===e.queries[l].fn&&(s=!1),"onTake"===e.queries[l].fn&&!1;var n=0;if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=t<=e.queries[l].e.nos?e.queries[l].e.nos:t);if(n<=0&&this.query&&this.query.queries.length>0)for(l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=t<=this.query.queries[l].e.nos?this.query.queries[l].e.nos:t);if(e&&e.queries.length>0)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=e.queries[l].e.nos<=n?n:e.queries[l].e.nos,e.queries.splice(l,1),--l);return(this.allowFiltering&&s||!i||!this.allowFiltering&&s)&&(i?e.skip(this.virtualItemStartIndex):e.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):n>0?e.take(n):e.take(t),e.requiresCount(),e},t.prototype.getTakeValue=function(){return this.allowFiltering&&v.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},t.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;var s=this.list.classList.contains(A.noData);if(""===this.targetElement().trim()){var l=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&this.value.length>0){this.remoteCustomValue=!1;var n=!1;if(this.allowCustomValue&&0===l.querySelectorAll("li").length&&this.mainData.length>0&&(this.mainData=[]),this.enableVirtualization)if(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&this.value.length>0&&"CheckBox"===this.mode)this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),n=!0;else if(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),(s||this.allowCustomValue)&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),!this.list.querySelector(".e-virtual-ddl"))){var a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)}this.onActionComplete(l,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),n||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this})}}else{if(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder")&&this.list.querySelector(".e-list-parent.e-reorder").remove()),this.resetList(e,i,t),this.enableVirtualization&&(s||this.allowCustomValue)&&!this.list.classList.contains(A.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),!this.list.querySelector(".e-virtual-ddl"))){a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)}this.allowCustomValue&&(e instanceof g.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,i))}this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},t.prototype.checkForCustomValue=function(e,t){var i=!this.getValueByText(this.inputElement.value,this.ignoreCase),s=t||this.fields;if(this.allowCustomValue&&i){var l=this.inputElement.value,n=!(0,v.isNullOrUndefined)(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if(n&&"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n){var a={};(0,v.setValue)(s.text,l,a),"number"==typeof(0,v.getValue)(this.fields.value?this.fields.value:"value",n)&&this.fields.value!==this.fields.text?(0,v.setValue)(s.value,Math.random(),a):(0,v.setValue)(s.value,l,a);var r={};if(this.allowObjectBinding)(this.listData&&this.listData.length>0?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(a)).forEach((function(e){r[e]=e===t.value||e===t.text?(0,v.getValue)(t.value,a):null}));if(a=this.allowObjectBinding?r:a,this.enableVirtualization){this.virtualCustomData=a;var h=this.dataSource instanceof g.DataManager?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource));this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&h.concat(this.virtualCustomSelectData),h.splice(0,0,a),this.isCustomDataUpdated=!0;var u=this.totalItemCount;this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(h,s,e),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof g.DataManager?u:this.totalItemCount}else{this.dataSource instanceof g.DataManager&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(h=JSON.parse(JSON.stringify(this.listData))).splice(0,0,a),this.resetList(h,s,e)}}else if(this.listData){(h=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),h[0]="number"!=typeof n||isNaN(parseFloat(h[0]))?h[0]:parseFloat(h[0]),h[0]="boolean"==typeof n?"true"===h[0]||"false"!==h[0]&&h[0]:h[0],this.resetList(h,s)}}else if(this.listData&&this.mainData&&!i&&this.allowCustomValue)if(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue)this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,s,e);else if(!this.allowFiltering&&this.list){var p=this.list.querySelectorAll("li."+A.li+":not(.e-hide-listitem)"),d=o(this.targetElement(),p,"StartsWith",this.ignoreCase);d&&null!==d.item&&this.addListFocus(d.item)}this.value&&this.value.length&&this.refreshSelection()},t.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},t.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled)if(e.target!==this.overAllClear){if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf(Qe))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&e.target.className===lt)?this.showPopup(e):(this.hidePopup(e),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(ze)||this.overAllWrapper.classList.add(ze)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}else e.preventDefault()},t.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove(Ke),this.inputElement.removeAttribute("disabled"),(0,v.attributes)(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add(Ke),this.inputElement.setAttribute("disabled","true"),(0,v.attributes)(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},t.prototype.onBlurHandler=function(e,t){var i;if(this.isBlurDispatching&&this.isAngular)this.isBlurDispatching=!1;else if((0,v.isNullOrUndefined)(e)||(i=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(i))"CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&(0,v.addClass)([this.overAllWrapper],"e-valid-input");else{if("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&(0,v.removeClass)([this.overAllWrapper],"e-valid-input"),"CheckBox"===this.mode&&v.Browser.isIE&&!(0,v.isNullOrUndefined)(e)&&!t)return this.inputFocus=!1,void this.overAllWrapper.classList.remove(ze);if(this.scrollFocusStatus)return(0,v.isNullOrUndefined)(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1);if(this.inputFocus=!1,this.overAllWrapper.classList.remove(ze),this.addTagOnBlur){var s=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),l=this.findListElement(this.list,"li","data-value",s),n=this.hideSelectedItem?_e:A.selected;!(!l||l.classList.contains(n))&&(this.updateListSelection(l,e),"Delimiter"===this.mode&&this.updateDelimeter(this.delimiterChar))}this.updateDataList(),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&this.hidePopup(e),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,v.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),qe(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!(0,v.isNullOrUndefined)(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")}},t.prototype.calculateWidth=function(){var e;if(this.overAllWrapper){if(!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top"))e=this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10);else{var t=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10);e=this.overAllWrapper.clientWidth-(t+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))}"Never"!==this.floatLabelType&&N.Input.calculateWidth(e,this.overAllWrapper,this.getModuleName())}},t.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else(0,v.isNullOrUndefined)(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},t.prototype.setPlaceholderSize=function(e){(0,v.isNullOrUndefined)(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":(0,v.addClass)([this.searchWrapper],ot):(0,v.isNullOrUndefined)(this.value)||(this.searchWrapper.removeAttribute("style"),(0,v.removeClass)([this.searchWrapper],ot))},t.prototype.refreshInputHight=function(){(0,v.isNullOrUndefined)(this.searchWrapper)||(this.value&&this.value.length||!(0,v.isNullOrUndefined)(this.text)&&""!==this.text?this.searchWrapper.classList.add(Ye):this.searchWrapper.classList.remove(Ye))},t.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},t.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var n={e,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,t),isInteracted:!!e,element:this.element,event:e};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}this.selectedValueInfo=this.viewPortInfo},t.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},t.prototype.updateAriaActiveDescendant=function(){(0,v.isNullOrUndefined)(this.ulElement)||(0,v.isNullOrUndefined)(this.ulElement.getElementsByClassName("e-item-focus")[0])||(0,v.attributes)(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},t.prototype.pageUpSelection=function(e,t){var i=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)"),s=e>=0?i[e+1]:i[0];if(this.fields.disabled&&s&&!this.enableVirtualization){for(;s&&(s.classList.contains("e-disabled")||s.classList.contains(_e)||s.classList.contains(".e-reorder-hide")||s.classList.contains("e-list-group-item"));)s=s.previousElementSibling;if(!s)return}this.enableVirtualization&&t&&(s=this.liCollections.length>=e&&e>=0?this.liCollections[e]:this.liCollections[this.skeletonCount]),!(0,v.isNullOrUndefined)(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.enableVirtualization?((0,v.isNullOrUndefined)(s)||s.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=s):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode))},t.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)"),l=e<=s.length?s[e-1]:s[s.length-1];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(_e)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.nextElementSibling;if(!l)return}this.enableVirtualization&&this.skeletonCount>0&&(l=e<i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&t&&(l=e<=i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.isKeyBoardAction=!0,this.addListFocus(l),this.previousFocusItem=l,this.scrollBottom(l,this.getIndexByValue(l.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},t.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+A.li).length>0?this.ulElement.querySelectorAll("."+A.li+":not(."+_e+")"):[]},t.prototype.focusInHandler=function(e){var t=this;if(this.enabled){if(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode&&(this.viewWrapper.style.display="none")),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove(Ye),this.checkPlaceholderSize(),this.focused){var i={isInteracted:!!e,event:e};this.trigger("focus",i),this.focused=!1}return this.overAllWrapper.classList.contains(ze)||this.overAllWrapper.classList.add(ze),We(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout((function(){t.calculateWidth()}),150),!0}return!1},t.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add(Xe)},t.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove(Xe)},t.prototype.expandTextbox=function(){var e=5;if(this.placeholder){var t=this.placeholder.charCodeAt(0),i=44032<=t&&t<=55215?1.5:19968<=t&&t<=40959?2:1;e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length*i}this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},t.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},t.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},t.prototype.checkTextLength=function(){return this.targetElement().length<1},t.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(e),e.preventDefault())}},t.prototype.updatePopupPosition=function(){this.refreshPopup()},t.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+A.focus);if(!(0,v.isNullOrUndefined)(e))if(this.inputElement.setAttribute("aria-activedescendant",e.id),this.allowFiltering){var t=this.popupWrapper.querySelector("."+rt);t&&t.setAttribute("aria-activedescendant",e.id)}else"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",e.id)},t.prototype.homeNavigation=function(e,t){if(this.removeFocus(),this.enableVirtualization)if(e)this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query));else if(this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&this.value.length>0&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)){this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex();var i=(new g.Query).clone();this.value&&this.value.length>0&&(i=(i=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,i)}this.UpdateSkeleton();var s=this.ulElement.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)");if(s.length>0){var l=s[e?0:s.length-1];this.enableVirtualization&&e&&(l=s[this.skeletonCount]),this.removeFocus(),l.classList.add(A.focus),this.enableVirtualization&&e?this.scrollTop(l,void 0,this.keyboardEvent.keyCode):t||this.scrollBottom(l,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant()}},t.prototype.updateSelectionList=function(){if(!(0,v.isNullOrUndefined)(this.value)&&this.value.length)for(var e=0;e<this.value.length;e++){var t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[e]):this.value[e],i=this.getElementByValue(t);i&&!i.classList.contains(A.selected)&&i.classList.add("e-active")}},t.prototype.handleVirtualKeyboardActions=function(e,t){var i,s=this.list.querySelector("."+A.focus);switch(this.isKeyBoardAction=!0,e.keyCode){case 40:this.arrowDown(e,!0);break;case 38:this.arrowUp(e,!0);break;case 33:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===e.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},t.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault(),this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124)))if(e.altKey)this.popupKeyActions(e);else{if(this.isPopupOpen()){var t=this.list.querySelector("."+A.focus),i=void 0;switch(e.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(e);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(e);break;case 27:return e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return e.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(e),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(e),void(this.isKeyBoardAction=!1);case 9:e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),this.inputElement.focus(),this.overAllWrapper.classList.add(ze)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&(this.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(e)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&this.setResize(),this.isKeyBoardAction=!1}},t.prototype.arrowDown=function(e,t){e.preventDefault(),this.moveByList(1,t),this.keyAction=!0,(document.activeElement.classList.contains(rt)||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&v.EventHandler.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},t.prototype.arrowUp=function(e,t){e.preventDefault(),this.keyAction=!0;var i=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+A.li+",li."+A.group+":not(."+_e+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+A.focus);this.focusFirstListItem=!(0,v.isNullOrUndefined)(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),Array.prototype.slice.call(i).indexOf(s)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,t),this.updateAriaAttribute()},t.prototype.spaceKeySelection=function(e){if("CheckBox"===this.mode){var t=this.list.querySelector("li."+A.focus),i=document.getElementsByClassName("e-selectall-parent")[0];if((!(0,v.isNullOrUndefined)(t)||i&&i.classList.contains("e-item-focus"))&&(e.preventDefault(),this.keyAction=!0),this.selectByKey(e),this.keyAction){var s=this.list.querySelector("li."+A.focus);!(0,v.isNullOrUndefined)(s)&&i&&i.classList.contains("e-item-focus")&&s.classList.remove("e-item-focus")}}this.checkPlaceholderSize()},t.prototype.checkBackCommand=function(e){(8===e.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},t.prototype.keyNavigation=function(e){if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else if(8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length){e.preventDefault();var t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1];this.removeValue(this.value[this.value.length-1],e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t)}},t.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},t.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(e=this.tempValues?this.tempValues.slice():[]),this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},t.prototype.scrollBottom=function(e,t,i,s,l){void 0===i&&(i=!1),void 0===s&&(s=null),void 0===l&&(l=!1),(!(0,v.isNullOrUndefined)(e)&&e.classList.contains("e-virtual-list")||this.enableVirtualization&&(0,v.isNullOrUndefined)(e))&&(e=this.liCollections[this.skeletonCount]);var n=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0;this.isUpwardScrolling=!1;var a=this.list.querySelectorAll(".e-virtual-list").length,o=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,r=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+n):e.offsetTop,h=this.list.offsetHeight,u=r-a*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop,p=this.list.scrollTop+u-h,d=!1,c=r-a*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop;if(c=this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?c-this.fixedHeaderElement.offsetHeight:c,0!==t||this.enableVirtualization){if(u>h||!(c>0&&this.list.offsetHeight>c)){var m=e?e.getAttribute("data-value"):null,f=34===s?this.getPageCount()-1:1;!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&o&&m===o&&35!==s&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(e.offsetHeight+n)*f,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===s?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?l&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,d=this.isKeyBoardAction}}else this.list.scrollTop=0;this.isKeyBoardAction=d},t.prototype.scrollTop=function(e,t,i){void 0===i&&(i=null);var s=this.list.querySelectorAll(".e-virtual-list").length,l=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,n=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+l):e.offsetTop,a=n-s*(e.offsetHeight+l)-this.list.scrollTop,o=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null;a=this.fields.groupBy&&!(0,v.isUndefined)(this.fixedHeaderElement)?a-this.fixedHeaderElement.offsetHeight:a;var r=n-s*(e.offsetHeight+l)+(e.offsetHeight+l)-this.list.scrollTop,h=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&a<=0;if(0!==t||this.enableVirtualization)if(a<0||h){var u=e?e.getAttribute("data-value"):null,p=33===i?this.getPageCount()-2:1;this.enableVirtualization&&this.isKeyBoardAction&&o&&u===o&&36!==i&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(e.offsetHeight+l)*p,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===i?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+a)}else r>0&&this.list.offsetHeight>r||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0));else this.list.scrollTop=0},t.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},t.prototype.selectListByKey=function(e){var t,i=this.list.querySelector("li."+A.focus),s=this.value&&this.value.length?this.value.length:0;if(null!==i){if(e.preventDefault(),i.classList.contains("e-active")&&(s-=1),this.isValidLI(i)&&s<this.maximumSelectionLength){this.updateListSelection(i,e),this.addListFocus(i),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(t=i.firstElementChild.lastElementChild,this.findGroupStart(t),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e);var l=""!==this.targetElement().trim();this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(i.textContent,l),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()}else!this.isValidLI(i)&&s<this.maximumSelectionLength&&((t=i.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,i):this.selectAllItem(!0,e,i));this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup(e)}var n=document.getElementsByClassName("e-selectall-parent")[0];if(n&&n.classList.contains("e-item-focus")){var a=n.childNodes[0];if(a.classList.contains("e-check")){a.classList.remove("e-check");o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!1,e,i)}else{a.classList.add("e-check");var o={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"};this.notify("checkSelectAll",o),this.selectAllItem(!0,e,i)}}this.refreshPlaceHolder()},t.prototype.refreshListItems=function(e,t){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;if(this.enableVirtualization)if(this.allowCustomValue&&this.virtualCustomData&&null==e&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount)this.virtualCustomData=null,this.renderItems(this.mainData,this.fields);else if(this.allowFiltering&&t){if(this.updateInitialData(),this.onActionComplete(i,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(s)}}else this.onActionComplete(this.list,this.listData);else this.onActionComplete(i,this.mainData);this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}else!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},t.prototype.removeSelectedChip=function(e){var t,i=this.chipCollectionWrapper.querySelector("span."+Je);if(null!==i){(0,v.isNullOrUndefined)(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(t=i.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(t,e));var s=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i.getAttribute("data-value"))):i.getAttribute("data-value");this.removeValue(s,e),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty()}this.closePopupOnSelect&&this.hidePopup(e),this.checkPlaceholderSize()},t.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+A.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},t.prototype.clickHandler=function(e){var t=e.target.className,i=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==t&&"e-input-group e-control-wrapper e-input-focus"!==t||!i.classList.contains("e-item-focus")||i.classList.remove("e-item-focus")},t.prototype.moveByList=function(e,t){if(this.list){var i=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+A.li+",li."+A.group+":not(."+_e+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+A.focus);this.enableVirtualization&&t&&!(0,v.isNullOrUndefined)(this.currentFocuedListElement)&&(s=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value"))));var l=-1,n=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===e&&!(0,v.isNullOrUndefined)(n)&&!n.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&this.liCollections.length>1)!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):n.classList.contains("e-item-focus")||n.classList.add("e-item-focus");else if(i.length){"CheckBox"===this.mode&&this.showSelectAll&&!(0,v.isNullOrUndefined)(n&&-1===e)&&(!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):this.focusFirstListItem&&!n.classList.contains("e-item-focus")&&n.classList.add("e-item-focus"));for(var a=0;a<i.length;a++)if(i[a]===s){l=a;break}if(e>0)l<i.length-1&&(this.removeFocus(),this.enableVirtualization&&t?this.addListFocus(i[l]):this.enableVirtualization&&i[l+1].classList.contains("e-virtual-list")?this.addListFocus(i[this.skeletonCount]):this.addListFocus(i[++l]),l>-1&&(this.updateCheck(i[l]),this.scrollBottom(i[l],l),this.currentFocuedListElement=i[l]));else if(l>0)if(this.enableVirtualization){var o=i[l-1].classList.contains("e-virtual-list"),r=t?l:l-1;!t&&o||this.removeFocus(),!t&&o||(this.addListFocus(i[r]),this.updateCheck(i[r]),this.scrollTop(i[r],l),this.currentFocuedListElement=i[r])}else this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l)}}var h=this.list?this.list.querySelector(".e-item-focus"):null;if(this.isDisabledElement(h)){if(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&h===this.list.querySelector("li.e-list-group-item"))return void this.removeFocus();0===(a=this.getIndexByValue(h.getAttribute("data-value")))&&(e=1),a===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(e=-1),this.moveByList(e)}},t.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},t.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},t.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span."+Ge),l=this.chipCollectionWrapper.querySelector("span."+Je);null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},t.prototype.chipClick=function(e){if(this.enabled){var t=(0,v.closest)(e.target,"."+Ge);this.removeChipSelection(),this.addChipSelection(t,e)}},t.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},t.prototype.addChipSelection=function(e,t){(0,v.addClass)([e],Je),this.trigger("chipSelection",t)},t.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var t=e.target.parentElement.getAttribute("data-value"),i=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(t)):this.getFormattedValue(t);if(this.allowCustomValue&&("false"!==t&&!1===i||!(0,v.isNullOrUndefined)(i)&&"NaN"===i.toString())&&(i=t),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(e),this.inputFocus||this.inputElement.focus(),this.removeValue(i,e),i=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",i):i,(0,v.isNullOrUndefined)(this.findListElement(this.list,"li","data-value",i))&&this.mainList&&this.listData){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(s,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},t.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},t.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!(0,v.isNullOrUndefined)(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=Me(this.placeholder):this.setFloatLabelType(),this.expandTextbox()},t.prototype.removeAllItems=function(e,t,i,s,l){var n=this.allowObjectBinding?this.indexOfObjectInArray(e,this.value):this.value.indexOf(e),a=this.value.slice(0);a.splice(n,1),this.setProperties({value:[].concat([],a)},!0),s.setAttribute("aria-selected","false");var o=this.hideSelectedItem?_e:A.selected;(0,v.removeClass)([s],o),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:s,e:this,index:n}),this.invokeCheckboxSelection(s,t,i);var r=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e):e;this.updateMainList(!0,r,l),this.updateChipStatus()},t.prototype.invokeCheckboxSelection=function(e,t,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:t}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},t.prototype.removeValue=function(t,i,s,l){var n=this,a=this.allowObjectBinding?this.indexOfObjectInArray(t,this.value):this.value.indexOf(this.getFormattedValue(t));-1===a&&this.allowCustomValue&&!(0,v.isNullOrUndefined)(t)&&(a=this.allowObjectBinding?this.indexOfObjectInArray(t,this.value):this.value.indexOf(t.toString()));var o=i&&i.target;l=!!(l||o&&o.classList.contains("e-close-hooker"))||null;var r=this.hideSelectedItem?_e:A.selected;if(-1!==a){var h=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",t):t,u=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",h),p=this.allowObjectBinding?t:this.getDataByValue(t),d={e:i,item:u,itemData:p,isInteracted:!!i,cancel:!1};this.trigger("removing",d,(function(o){if(o.cancel)n.removeIndex++;else{n.isRemoveSelection=!!n.enableVirtualization||n.isRemoveSelection,n.currentRemoveValue=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",t):t,n.virtualSelectAll=!1;var h=n.value.slice(0);if(h.splice(a,1),n.enableVirtualization&&"CheckBox"===n.mode&&n.selectedListData.splice(a,1),n.setProperties({value:[].concat([],h)},!0),n.enableVirtualization){var d=0===a&&n.text.split(n.delimiterChar)&&1===n.text.split(n.delimiterChar).length?n.text.replace(n.text.split(n.delimiterChar)[a],""):0===a?n.text.replace(n.text.split(n.delimiterChar)[a]+n.delimiterChar,""):n.text.replace(n.delimiterChar+n.text.split(n.delimiterChar)[a],"");n.setProperties({text:d.toString()},!0)}if(null!==u){var c=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",t):t,m=n.findListElement(n.mainList,"li","data-value",c);u.setAttribute("aria-selected","false"),(0,v.removeClass)([u],r),m&&(m.setAttribute("aria-selected","false"),(0,v.removeClass)([u,m],r)),n.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===n.mode,li:u,e:n,index:a}),n.invokeCheckboxSelection(u,i,l)}var f=n.allowObjectBinding?(0,v.getValue)(n.fields.value?n.fields.value:"",t):t;if(n.hideSelectedItem&&n.fields.groupBy&&u&&n.hideGroupItem(f),n.hideSelectedItem&&n.fixedHeaderElement&&n.fields.groupBy&&"CheckBox"!==n.mode&&n.isPopupOpen()&&e.prototype.scrollStop.call(n),n.updateMainList(!0,f),n.removeChip(f,l),n.updateChipStatus(),(n.value&&n.value.length?n.value.length:0)<n.maximumSelectionLength){var g=n.list.querySelectorAll("li."+A.li+":not(.e-active)");(0,v.removeClass)(g,"e-disable")}n.trigger("removed",o);var y=i&&i.currentTarget,C=!(!y||!y.classList.contains("e-selectall-parent"))||null;if(!n.changeOnBlur&&!l&&i&&s&&!C&&n.isSelectAllTarget&&n.updateValueState(i,n.value,n.tempValues),s&&(n.selectAllEventData.push(p),n.selectAllEventEle.push(u)),1===s){n.changeOnBlur||n.updateValueState(i,n.value,n.tempValues);var b={event:i,items:n.selectAllEventEle,itemData:n.selectAllEventData,isInteracted:!!i,isChecked:!1};n.trigger("selectedAll",b),n.selectAllEventData=[],n.selectAllEventEle=[]}!l||1!==s&&null!==s||n.clearAllCallback(i,l),n.isPopupOpen()&&u&&u.parentElement.classList.contains("e-reorder")&&(n.hideSelectedItem&&n.value&&Array.isArray(n.value)&&n.value.length>0&&n.totalItemsCount(),n.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}))}}))}},t.prototype.updateMainList=function(e,t,i){if(this.allowFiltering||"CheckBox"===this.mode){var s=i||this.findListElement(this.mainList,"li","data-value",t);s&&(e?(s.setAttribute("aria-selected","false"),(0,v.removeClass)([s],this.hideSelectedItem?_e:A.selected),"CheckBox"===this.mode&&(0,v.removeClass)([s.firstElementChild.lastElementChild],"e-check")):(s.setAttribute("aria-selected","true"),(0,v.addClass)([s],this.hideSelectedItem?_e:A.selected),"CheckBox"===this.mode&&(0,v.addClass)([s.firstElementChild.lastElementChild],"e-check")))}},t.prototype.removeChip=function(e,t){if(this.chipCollectionWrapper&&(!this.enableVirtualization||!t)){var i=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);i&&(0,v.remove)(i)}},t.prototype.setWidth=function(e){(0,v.isNullOrUndefined)(e)||("number"==typeof e?this.overAllWrapper.style.width=(0,v.formatUnit)(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:(0,v.formatUnit)(e)))},t.prototype.updateChipStatus=function(){this.value&&this.value.length?((0,v.isNullOrUndefined)(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):((0,v.isNullOrUndefined)(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),(0,v.isNullOrUndefined)(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},t.prototype.indexOfObjectInArray=function(e,t){for(var i=function(i){var s=t[i];if(Object.keys(e).every((function(t){return s.hasOwnProperty(t)&&s[t]===e[t]})))return{value:i}},s=0;s<t.length;s++){var l=i(s);if("object"==typeof l)return l.value}return-1},t.prototype.addValue=function(e,t,i){this.value||(this.value=[]);var s=this.allowObjectBinding?this.getDataByValue(e):e;if(this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(e),this.value)||!this.allowObjectBinding&&this.value.indexOf(s)<0){if(this.setProperties({value:[].concat([],this.value,[s])},!0),this.enableVirtualization&&!this.isSelectAllLoop){var l=this.viewWrapper.innerHTML,n=void 0;l+=1===this.value.length?"":this.delimiterChar+" ",l+=n=this.getOverflowVal(this.value.length-1),n=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,l)}if(this.enableVirtualization&&"CheckBox"===this.mode){var a=[],o=(this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[this.value.length-1]):this.value[this.value.length-1],n=t,null!=this.text&&""!==this.text?this.text+this.delimiterChar+n:n);a.push(o),this.setProperties({text:a.toString()},!0)}}var r=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),r&&(this.addListFocus(r),this.addListSelection(r)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},t.prototype.checkMaxSelection=function(){var e=this.value&&this.value.length?this.value.length:0;if(e===this.maximumSelectionLength){var t=this.list.querySelectorAll("li."+A.li+".e-active");(0,v.removeClass)(t,"e-disable");var i=this.list.querySelectorAll("li."+A.li+":not(.e-active)");(0,v.addClass)(i,"e-disable")}if(e<this.maximumSelectionLength){var s=this.list.querySelectorAll("li."+A.li);(0,v.removeClass)(s,"e-disable")}},t.prototype.dispatchSelect=function(t,i,s,l,n,a,o){var r=this,h=this.listData;if(this.initStatus&&!l){t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",t):t;var u=a||this.getDataByValue(t),p={e:i,item:s,itemData:u,isInteracted:!!i,cancel:!1};this.trigger("select",p,(function(l){if(!l.cancel){if(n&&(r.selectAllEventData.push(u),r.selectAllEventEle.push(s)),1===n){var p={event:i,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!i,isChecked:!0};r.trigger("selectedAll",p),r.selectAllEventData=[]}r.allowCustomValue&&r.isServerRendered&&r.listData!==h&&(r.listData=h),t=r.allowObjectBinding?r.getDataByValue(t):t,r.enableVirtualization&&((0,v.isNullOrUndefined)(r.selectedListData)?r.selectedListData=[r.getDataByValue(t)]:a?Array.isArray(r.selectedListData)?r.selectedListData.push(a):r.selectedListData=[r.selectedListData,a]:Array.isArray(r.selectedListData)?r.selectedListData.push(r.getDataByValue(t)):r.selectedListData=[r.selectedListData,r.getDataByValue(t)]),(r.enableVirtualization&&t||!r.enableVirtualization)&&r.updateListSelectEventCallback(t,s,i,o),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&e.prototype.scrollStop.call(r)}}))}},t.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},t.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span."+Ge+"."+Je);if((0,v.removeClass)(e,Je),v.Browser.isDevice)for(var t=this.chipCollectionWrapper.querySelectorAll("span."+Qe.split(" ")[0]),i=0;i<t.length;i++)t[i].style.display="none"},t.prototype.onMobileChipInteraction=function(e){var t=(0,v.closest)(e.target,"."+Ge),i=t.querySelector("span."+Qe.split(" ")[0]);this.enabled&&!this.readonly&&(t.classList.contains(Je)||(this.removeChipFocus(),i.style.display="",t.classList.add(Je)),this.refreshPopup(),e.preventDefault())},t.prototype.multiCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!(0,v.selectAll)(e,document).length}catch(e){t=!1}return t},t.prototype.encodeHtmlEntities=function(e){return e.replace(/[\u00A0-\u9999<>&]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}))},t.prototype.getChip=function(e,t,i){var s=this,l={text:t,value:t},n=this.createElement("span",{className:Ge,attrs:{"data-value":t,title:e}}),a=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:Qe});if(this.mainData&&(l=this.getDataByValue(t)),this.valueTemplate&&!(0,v.isNullOrUndefined)(l)){var r=this.multiCompiler(this.valueTemplate),h=("function"!=typeof this.valueTemplate&&r?(0,v.compile)((0,v.select)(this.valueTemplate,document).innerHTML.trim()):(0,v.compile)(this.valueTemplate))(l,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a);h&&h.length>0&&(0,v.append)(h,a),this.renderReactTemplates()}else this.enableHtmlSanitizer?a.innerText=e:a.innerHTML=this.encodeHtmlEntities(e.toString());n.appendChild(a);var u={isInteracted:!!i,itemData:l,e:i,setClass:function(e){(0,v.addClass)([n],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",u,(function(e){e.cancel||(v.Browser.isDevice?(n.classList.add("e-mob-chip"),(0,v.append)([o],n),o.style.display="none",v.EventHandler.add(n,"click",s.onMobileChipInteraction,s)):(v.EventHandler.add(n,"mousedown",s.chipClick,s),s.showClearButton&&n.appendChild(o)),v.EventHandler.add(o,"mousedown",s.onChipRemove,s),s.chipCollectionWrapper.appendChild(n),!s.changeOnBlur&&i&&s.updateValueState(i,s.value,s.tempValues))}))},t.prototype.calcPopupWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px");return e},t.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},t.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},t.prototype.listOption=function(e,t){var i=!(0,v.isNullOrUndefined)(t.iconCss),s=(0,v.isNullOrUndefined)(t.properties)?t:t.properties;return this.listCurrentOptions=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},(0,v.extend)(this.listCurrentOptions,this.listCurrentOptions,t,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:s}),this.listCurrentOptions},t.prototype.renderPopup=function(){var t=this;if(this.list||e.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering)this.refreshPopup();else if(!this.popupObj&&!(0,v.isNullOrUndefined)(this.popupWrapper)){document.body.appendChild(this.popupWrapper);var i=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&i&&this.filterParent&&(i.remove(),this.filterParent=null);var s=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),s-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),(0,v.append)([this.list],this.popupWrapper),!this.list.classList.contains(A.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(A.noData))if(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")?this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")):this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(l)}if(this.footerTemplate&&(this.setFooterTemplate(),s-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),s-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),s=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(s-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(s-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),s=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",n),s-=this.searchBoxHeight),(0,v.addClass)([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=(0,v.formatUnit)(s),this.popupWrapper.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):this.list.style.maxHeight=(0,v.formatUnit)(this.popupHeight),this.popupObj=new k.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){if(t.popupObj.element.parentElement){t.popupObj.unwireScrollEvents();var e=t.popupWrapper.querySelector("."+rt);"CheckBox"===t.mode&&e&&document.activeElement===e&&e.blur(),(0,v.detach)(t.popupObj.element)}},open:function(){if(t.popupObj.resolveCollision(),!t.isFirstClick){var e=t.list.querySelector("ul");e&&("CheckBox"!==t.mode&&(t.allowFiltering||t.allowCustomValue)&&""!==t.targetElement().trim()||(t.mainList=e.cloneNode?e.cloneNode(!0):e)),t.isFirstClick=!0}t.popupObj.wireScrollEvents(),"CheckBox"!==t.mode&&(t.allowFiltering||t.allowCustomValue)&&""!==t.targetElement().trim()||t.enableVirtualization||(t.loadTemplate(),t.enableVirtualization&&"CheckBox"===t.mode&&t.UpdateSkeleton()),t.isPreventScrollAction=!0,t.setScrollPosition(),!t.list.classList.contains(A.noData)&&t.getItems()[1]&&0!==t.getItems()[1].offsetHeight&&(t.listItemHeight=t.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(t.getItems()[1]).marginBottom,10),t.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(t.list.getElementsByClassName("e-virtual-ddl-content")[0].style=t.getTransformValues())),t.allowFiltering&&t.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===t.mode,value:"focus"}),t.enableVirtualization&&(t.notify("bindScrollEvent",{module:"VirtualScroll",component:t.getModuleName(),enable:t.enableVirtualization}),setTimeout((function(){t.value?t.updateSelectionList():t.viewPortInfo&&t.viewPortInfo.offsets.top&&(t.list.scrollTop=t.viewPortInfo.offsets.top)}),5))},targetExitViewport:function(){v.Browser.isDevice||t.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&v.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility=""}},t.prototype.checkCollision=function(e){"CheckBox"===this.mode&&v.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||((0,k.isCollide)(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},t.prototype.setHeaderTemplate=function(){this.header&&this.header.remove(),this.header=this.createElement("div"),(0,v.addClass)([this.header],"e-ddl-header");var e=this.multiCompiler(this.headerTemplate),t=("function"!=typeof this.headerTemplate&&e?(0,v.compile)((0,v.select)(this.headerTemplate,document).innerHTML.trim()):(0,v.compile)(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);t&&t.length>0&&(0,v.append)(t,this.header),"CheckBox"===this.mode&&this.showSelectAll?(0,v.prepend)([this.header],this.popupWrapper):(0,v.append)([this.header],this.popupWrapper),v.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},t.prototype.setFooterTemplate=function(){this.footer&&this.footer.remove(),this.footer=this.createElement("div"),(0,v.addClass)([this.footer],"e-ddl-footer");var e=this.multiCompiler(this.footerTemplate),t=("function"!=typeof this.footerTemplate&&e?(0,v.compile)((0,v.select)(this.footerTemplate,document).innerHTML.trim()):(0,v.compile)(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);t&&t.length>0&&(0,v.append)(t,this.footer),(0,v.append)([this.footer],this.popupWrapper),v.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},t.prototype.updateInitialData=function(){var e=this.selectData;this.renderItems(e,this.fields);if(this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof g.DataManager?this.remoteDataCount>=0?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0])this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else if(!this.list.querySelector(".e-virtual-ddl")&&this.skeletonCount>0){var t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)}this.listData=e,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},t.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var t=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&this.value.length>0){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode&&this.targetInputElement&&(this.targetInputElement.value=""));var i=this.list&&this.list.querySelectorAll("li.e-list-item");if(i&&i.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,t=this.value[this.removeIndex];this.removeIndex<this.value.length;t=this.value[this.removeIndex])this.removeValue(t,e,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(e);this.checkAndResetCache(),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,v.EventHandler.add(document,"mouseup",this.preventSelection,this)},t.prototype.preventSelection=function(e){this.isClearAllItem&&e.stopPropagation(),this.isClearAllItem=!1,v.EventHandler.remove(document,"mouseup",this.preventSelection)},t.prototype.clearAllCallback=function(e,t){var i=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(s,this.mainData)}this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,i),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&t&&((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!t||!(0,v.isNullOrUndefined)(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},t.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},t.prototype.resetValueHandler=function(e){if(!(0,v.isNullOrUndefined)(this.inputElement)){var t=(0,v.closest)(this.inputElement,"form");if(t&&e.target===t){var i=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=i}}},t.prototype.wireEvent=function(){v.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),v.EventHandler.add(window,"resize",this.windowResize,this),v.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),v.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),v.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&v.EventHandler.add(this.inputElement,"input",this.onInput,this),v.EventHandler.add(this.inputElement,"blur",this.onBlurHandler,this),v.EventHandler.add(this.componentWrapper,"mouseover",this.mouseIn,this);var e=(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.add(e,"reset",this.resetValueHandler,this),v.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),v.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),v.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},t.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,v.Browser.isDevice&&"mozilla"===v.Browser.info.name&&this.search(e)},t.prototype.pasteHandler=function(e){var t=this;setTimeout((function(){t.expandTextbox(),t.search(e)}))},t.prototype.search=function(e){var t=this;if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null,(0,v.isNullOrUndefined)(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(e),this.openClick(e),!this.checkTextLength()||this.allowFiltering||(0,v.isNullOrUndefined)(e)||8===e.keyCode){var i=this.targetElement();if(this.allowFiltering){this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache(),this.isRequesting=!1;var s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,i,l){s.cancel||(t.isFiltered=!0,t.customFilterQuery=i,t.remoteFilterAction=!0,t.isCustomFiltering=!0,t.dataUpdater(e,i,l))},event:e,cancel:!1};this.trigger("filtering",s,(function(e){t.isFilterPrevented=e.cancel,e.cancel||t.isFiltered||e.preventDefaultAction||(t.filterAction=!0,t.isFilteringAction=!0,t.dataSource instanceof g.DataManager&&t.allowCustomValue&&(t.isCustomRendered=!1),t.dataUpdater(t.dataSource,null,t.fields),t.isFilteringAction=!1)}))}else if(this.allowCustomValue){var l=new g.Query;l=this.allowFiltering&&""!==i?l.where(this.fields.text,"startswith",i,this.ignoreCase,this.ignoreAccent):l,this.enableVirtualization?this.dataUpdater(this.dataSource,l,this.fields):this.dataUpdater(this.mainData,l,this.fields),this.UpdateSkeleton()}else{var n=this.list.querySelectorAll("li."+A.li+":not(.e-hide-listitem)"),a=this.typeOfData(this.listData).typeof,r=o(this.targetElement(),n,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var h=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(h=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),h=!1),(0!==this.viewPortInfo.startIndex||h)&&this.updateIncrementalView(0,this.itemCount),r=o(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a);(0,v.isNullOrUndefined)(r)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),h=!0,(0!==this.viewPortInfo.startIndex||h)&&this.updateIncrementalView(0,this.itemCount),r=o(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,a),(0,v.isNullOrUndefined)(r));)if((0,v.isNullOrUndefined)(r)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=100>this.totalItemCount?this.totalItemCount:100;break}if(r.index&&!(this.viewPortInfo.startIndex>=r.index&&r.index>=this.viewPortInfo.endIndex)){var u=(p=r.index-(this.itemCount/2-2)>0?r.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:p+this.itemCount;p!==this.viewPortInfo.startIndex&&this.updateIncrementalView(p,u)}if((0,v.isNullOrUndefined)(r.item))this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0;else{if(this.getIndexByValue(r.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2){var p=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount;u=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;this.updateIncrementalView(p,u)}r.item=this.getElementByValue(r.item.getAttribute("data-value"))}r&&r.item&&(r.item=this.getElementByValue(r.item.getAttribute("data-value")))}r&&r.item?(this.addListFocus(r.item),this.list.scrollTop=r.item.offsetHeight*r.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},t.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},t.prototype.getLocaleName=function(){return"multi-select"},t.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.filterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},t.prototype.updateData=function(e,t,i){var s,l="",n="Delimiter"===this.mode||"CheckBox"===this.mode,a=[],o=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),(0,v.isNullOrUndefined)(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!(0,v.isNullOrUndefined)(this.value)){for(var r,h=this.value.length,u="",p=function(o){var p=d.allowObjectBinding?(0,v.getValue)(d.fields.value?d.fields.value:"",d.value[o]):d.value[o],c=d.findListElement((0,v.isNullOrUndefined)(d.mainList)?d.ulElement:d.mainList,"li","data-value",p);if(d.enableVirtualization&&(c=d.findListElement((0,v.isNullOrUndefined)(d.list)?d.ulElement:d.list,"li","data-value",p)),(0,v.isNullOrUndefined)(c)&&!d.allowCustomValue&&!d.enableVirtualization&&d.listData&&d.listData.length>0)d.value.splice(o,1),o-=1,h-=1;else{if(d.listData){if(d.enableVirtualization){n&&!d.isDynamicRemoteVirtualData&&(l=d.delimiterWrapper&&""===d.delimiterWrapper.innerHTML?l:d.delimiterWrapper.innerHTML);var m=d.allowObjectBinding?(0,v.getValue)(d.fields.value?d.fields.value:"",d.value[d.value.length-1]):d.value[d.value.length-1];if(d.isRemoveSelection)l=d.text.replace(/,/g,e+" ")+e+" ",a=d.text.split(e);else{s=i&&n?d.text:d.getTextByValue(m);var f=d.isDynamicRemoteVirtualData&&null!=m&&""!==m?d.getTextByValue(m):i?d.text:d.text&&""!==d.text?d.text+d.delimiterChar+s:s;l+=s+e+" ",a.push(f),u=d.hiddenElement.innerHTML}if(t&&t.currentTarget&&t.currentTarget.classList.contains("e-chips-close")||t&&"Backspace"===t.key){var g=t.target.parentElement.getAttribute("data-value");if("Backspace"===t.key){var y=d.hiddenElement.lastChild;y&&d.hiddenElement.removeChild(y)}else d.hiddenElement.childNodes.forEach((function(e){e.value===g&&e.parentNode.removeChild(e)}));u=d.hiddenElement.innerHTML}else u+="<option selected value='"+m+"'>"+o+"</option>";return r=o,"break"}s=d.getTextByValue(p)}else s=p;l+=s+e+" ",a.push(s)}u+='<option selected value="'+p+'">'+o+"</option>",r=o},d=this,c=0;c<h;c++){var m=p(c);if(c=r,"break"===m)break}(0,v.isNullOrUndefined)(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=u)}var f=t&&t.target&&t.target.classList.contains("e-chips-close");(!this.enableVirtualization||this.enableVirtualization&&"CheckBox"!==this.mode&&!f)&&this.setProperties({text:a.toString()},!0),n&&(this.updateWrapperText(this.delimiterWrapper,l),this.delimiterWrapper.setAttribute("id",(0,v.getUniqueID)("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id));var g=t&&t.target,y=!(!g||!g.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&t&&!y||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(t,this.value,this.tempValues)),this.listData=o,this.addValidInputClass()},t.prototype.initialTextUpdate=function(){if((0,v.isNullOrUndefined)(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),t=[],i=0;e.length>i;i++){var s=this.getValueByText(e[i]);(0,v.isNullOrUndefined)(s)?this.allowCustomValue&&t.push(e[i]):t.push(s)}if(t&&t.length){var l=this.allowObjectBinding?this.getDataByValue(t):t;this.setProperties({value:l},!0)}}},t.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),e.prototype.render.call(this,null,t),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},t.prototype.initialValueUpdate=function(e,t){if(this.list){var i=void 0,s=void 0,l=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!(0,v.isNullOrUndefined)(this.value))for(var n=0;!(0,v.isNullOrUndefined)(this.value[n]);n++){l=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[n]):this.value[n],s=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",l);var a=!1;if(this.enableVirtualization){if(i=null,null!=e&&e.length>0)for(var o=0;o<e.length;o++)if(this.isPrimitiveData&&e[o]===l||!this.isPrimitiveData&&(0,v.getValue)(this.fields.value?this.fields.value:"value",e[o])===l){i=this.isPrimitiveData?e[o]:(0,v.getValue)(this.fields.text,e[o]),this.enableVirtualization&&((0,v.isNullOrUndefined)(this.selectedListData)?this.selectedListData=[e[o]]:Array.isArray(this.selectedListData)?this.selectedListData.push(e[o]):this.selectedListData=[this.selectedListData,e[o]]);break}(0,v.isNullOrUndefined)(i)&&this.allowCustomValue&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&t)&&(i=this.getTextByValue(l),a=!0)}else i=this.getTextByValue(l);if(s&&"true"!==s.getAttribute("aria-selected")||s&&"true"===s.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=l&&null!=i&&!a){var r=[],h=this.isDynamicRemoteVirtualData&&null!=i&&""!==i?i:null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i;r.push(h),this.setProperties({text:r.toString()},!0),this.addChip(i,l),this.addListSelection(s)}else if(!this.enableVirtualization&&l&&this.allowCustomValue||this.enableVirtualization&&l&&this.allowCustomValue&&(!(this.dataSource instanceof g.DataManager)||this.dataSource instanceof g.DataManager&&t)){var u=this.listData.length,p={};(0,v.setValue)(this.fields.text,l,p),(0,v.setValue)(this.fields.value,l,p);var d=this.popupWrapper.querySelector("."+A.noData);this.enableVirtualization||this.addItem(p,u),this.enableVirtualization&&(this.virtualCustomSelectData&&this.virtualCustomSelectData.length>=0?this.virtualCustomSelectData.push(p):this.virtualCustomSelectData=[p]),s=s||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",l),this.popupWrapper.contains(d)&&(this.list.setAttribute("style",d.getAttribute("style")),this.popupWrapper.replaceChild(this.list,d),this.wireListEvents());r=[],h=null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i;r.push(h),this.setProperties({text:r.toString()},!0),this.addChip(i,l),this.addListSelection(s)}}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,t),"CheckBox"!==this.mode||!this.showSelectAll||!(0,v.isNullOrUndefined)(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},t.prototype.updateActionCompleteData=function(e,t){this.value&&(!this.allowObjectBinding&&this.value.indexOf(e.getAttribute("data-value"))>-1||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(e.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem&&(0,v.addClass)([e],_e))},t.prototype.updateAddItemList=function(e,t){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+A.noData)&&e?(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),(0,v.remove)(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"))},t.prototype.updateDataList=function(){if(this.mainList&&this.ulElement&&!(this.isFiltered||this.filterAction||this.targetElement().trim())){var e=this.mainList.childElementCount<this.ulElement.childElementCount,t=this.ulElement.childElementCount>0&&this.ulElement.children[0].childElementCount>0&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&this.ulElement.childElementCount>0&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(this.ulElement.children[0].childElementCount>0||this.fields.groupBy&&this.ulElement.children[1]&&this.ulElement.children[1].childElementCount>0);(e||t||i)&&(this.mainList=this.ulElement)}},t.prototype.isValidLI=function(e){return e&&!e.classList.contains(A.disabled)&&!e.classList.contains(A.group)&&e.classList.contains(A.li)},t.prototype.updateListSelection=function(e,t,i){var s=e.getAttribute("data-value"),l=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(s)):this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!(0,v.isNullOrUndefined)(l)&&"NaN"===l.toString())&&(l=s),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(l)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(l,this.value)?this.dispatchSelect(l,t,e,"true"===e.getAttribute("aria-selected"),i):this.removeValue(l,t,i)},t.prototype.updateListSelectEventCallback=function(e,t,i,s){var l=this;e=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",e):e;var n=s||this.getTextByValue(e);if((this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",e)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)){var a=t?t.cloneNode(!0):t,o=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof(0,v.getValue)(o,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var r=this.getDataByValue(e),h={newData:r,cancel:!1};this.trigger("customValueSelection",h,(function(t){t.cancel||(l.enableVirtualization&&l.virtualCustomData?(l.virtualCustomSelectData&&l.virtualCustomSelectData.length>=0?l.virtualCustomSelectData.push(r):l.virtualCustomSelectData=[r],l.remoteCustomValue=!1,l.addValue(e,n,i)):((0,v.append)([a],l.mainList),l.mainData.push(r),l.remoteCustomValue=!1,l.addValue(e,n,i)))}))}else this.remoteCustomValue=!1,this.addValue(e,n,i)},t.prototype.removeListSelection=function(){var e=this.hideSelectedItem?_e:A.selected,t=this.list.querySelectorAll("."+e),i=t.length;if(t&&t.length)for((0,v.removeClass)(t,e);i>0;)t[i-1].setAttribute("aria-selected","false"),i--;if(!(0,v.isNullOrUndefined)(this.mainList)){var s=this.mainList.querySelectorAll("."+e),l=s.length;if(s&&s.length)for((0,v.removeClass)(s,e);l>0;)s[l-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(t&&t.length>l-1&&(0,v.removeClass)([t[l-1].firstElementChild.lastElementChild],"e-check"),(0,v.removeClass)([s[l-1].firstElementChild.lastElementChild],"e-check")),l--}},t.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+A.hover);e&&e.length&&(0,v.removeClass)(e,A.hover)},t.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+A.focus),t=this.mainList.querySelectorAll("."+A.focus);e&&e.length&&((0,v.removeClass)(e,A.focus),(0,v.removeClass)(t,A.focus))}},t.prototype.addListHover=function(e){(this.enabled&&this.isValidLI(e)||null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy))&&(this.removeHover(),(0,v.addClass)([e],A.hover))},t.prototype.addListFocus=function(e){this.enabled&&(this.isValidLI(e)||this.fields.disabled&&this.isDisabledElement(e))?(this.removeFocus(),(0,v.addClass)([e],A.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&((0,v.addClass)([e],A.focus),this.updateAriaActiveDescendant())},t.prototype.addListSelection=function(e,t){var i=this.hideSelectedItem?_e:A.selected;if(this.isValidLI(e)&&!e.classList.contains(A.hover)){if((0,v.addClass)([e],i),this.updateMainList(!1,e.getAttribute("data-value"),t),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&e.classList.contains("e-active"))0===e.getElementsByClassName("e-check").length&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this});this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),this.selectedElementID=e.id}},t.prototype.updateDelimeter=function(e,t,i){this.updateData(e,t,i)},t.prototype.onMouseClick=function(e){var t=this;if(!this.isClearAllItem){this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null;var i=e.target,s=(0,v.closest)(i,"."+A.li);if(this.enableVirtualization&&s&&s.classList.contains("e-virtual-list"))return;if((0,v.closest)(i,"."+A.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(i=i.classList.contains("e-list-group-item")?i.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),i.classList.remove("e-check"),i.classList.remove("e-stop"),(0,v.closest)(i,".e-list-group-item").classList.remove("e-active"),i.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),i.classList.remove("e-stop"),i.classList.add("e-check"),(0,v.closest)(i,".e-list-group-item").classList.add("e-active"),i.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(s)){var l=this.value&&this.value.length?this.value.length:0;s.classList.contains("e-active")&&(l-=1),l<this.maximumSelectionLength&&(this.updateListSelection(s,e),this.checkPlaceholderSize(),this.addListFocus(s),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(s.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout((function(){t.updateDelimeter(t.delimiterChar,e)}),0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(e):e.preventDefault();var n=""!==this.targetElement().trim();this.makeTextBoxEmpty(),this.findGroupStart(i),"CheckBox"!==this.mode&&this.refreshListItems((0,v.isNullOrUndefined)(s)?null:s.textContent,n)}else e.preventDefault();if(this.enableVirtualization&&this.hideSelectedItem){var a=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide):not(.e-virtual-list)");if(a.length){var o=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(a.length<o+2){var r=this.getForQuery(this.value).clone();if(r=r.skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,r),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+A.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl"))this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight();else{var h=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()});this.popupWrapper.querySelector(".e-dropdownbase").appendChild(h)}this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())}}}this.refreshPlaceHolder(),this.deselectHeader()}}},t.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)){var t=void 0;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),t=this.findGroupAttrtibutes(e,0,0,0,0),t=this.findGroupAttrtibutes(e,t[0],t[1],t[2],1);!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),null!=(e=e.previousElementSibling)););this.updateCheckBox(e,t[0],t[1],t[2])}},t.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(e)||(e.classList.contains("e-list-icon")&&(e=e.parentElement),e.getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++),null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},t.prototype.updateCheckBox=function(e,t,i,s){if(null!==e&&((0,v.isNullOrUndefined)(this.fields.disabled)||0!==s)){var l=e.getElementsByClassName("e-frame")[0];s===t?(l.classList.remove("e-stop"),l.classList.add("e-check"),(0,v.closest)(l,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):s===i?(l.classList.remove("e-check"),l.classList.remove("e-stop"),(0,v.closest)(l,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===t-1?(l.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),(0,v.closest)(l,".e-list-group-item").classList.add("e-active"),l.classList.add("e-check")):(l.classList.remove("e-check"),l.classList.add("e-stop"),(0,v.closest)(l,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},t.prototype.disableGroupHeader=function(){var e=this.list.querySelectorAll("li.e-list-group-item");if(e)for(var t=0;t<e.length;t++){for(var i=!0,s=e[t].nextElementSibling;!s.classList.contains("e-list-group-item");){if(!this.isDisabledElement(s)){i=!1;break}if(null==(s=s.nextElementSibling))break}i&&this.disableListItem(e[t])}},t.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,t=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&(0,v.removeClass)(t,"e-disable"),e===this.maximumSelectionLength&&(0,v.addClass)(t,"e-disable")},t.prototype.onMouseOver=function(e){var t=(0,v.closest)(e.target,"."+A.li);null===t&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.enableGroupCheckBox&&(t=(0,v.closest)(e.target,"."+A.group)),this.addListHover(t)},t.prototype.onMouseLeave=function(){this.removeHover()},t.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},t.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var t=e.target;!(0,v.isNullOrUndefined)(this.popupObj)&&(0,v.closest)(t,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(v.Browser.isIE||"edge"===v.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},t.prototype.wireListEvents=function(){(0,v.isNullOrUndefined)(this.list)||(v.EventHandler.add(document,"mousedown",this.onDocumentClick,this),v.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),v.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),v.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),v.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},t.prototype.unwireListEvents=function(){v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(v.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),v.EventHandler.remove(this.list,"mouseup",this.onMouseClick),v.EventHandler.remove(this.list,"mouseover",this.onMouseOver),v.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},t.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},t.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},t.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},t.prototype.showSpinner=function(){if((0,v.isNullOrUndefined)(this.spinnerElement)){var e=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons");"none"!==this.overAllClear.style.display||e?this.spinnerElement=e||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:$e+" "+st}),this.componentWrapper.appendChild(this.spinnerElement)),(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,v.addClass)([this.spinnerElement],it),(0,k.showSpinner)(this.spinnerElement)}},t.prototype.hideSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||((0,k.hideSpinner)(this.spinnerElement),(0,v.removeClass)([this.spinnerElement],it),this.spinnerElement.classList.contains(st)?(0,v.detach)(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},t.prototype.updateWrapperText=function(e,t){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=this.encodeHtmlEntities(t):e.innerText=t},t.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),(0,v.isNullOrUndefined)(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove(at)),this.value&&this.value.length){var e="",t=void 0,i=void 0,s=1,l=void 0,n=void 0,a=0,o=void 0;this.enableVirtualization||this.updateWrapperText(this.viewWrapper,e);var r={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},h=new v.L10n(this.getLocaleName(),r,this.locale);""===h.getConstant("actionFailureTemplate")&&(h=new v.L10n("dropdowns",r,this.locale)),""===h.getConstant("noRecordsTemplate")&&(h=new v.L10n("dropdowns",r,this.locale));var u=h.getConstant("overflowCountTemplate"),p=h.getConstant("totalCountTemplate"),d=this.createElement("span",{className:"e-remain"}),c=u.replace("${count}",this.value.length.toString());d.innerText=c,this.viewWrapper.appendChild(d),this.renderReactTemplates();var m=d.offsetWidth;if((0,v.remove)(d),this.showDropDownIcon&&(a=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!(0,v.isNullOrUndefined)(this.value)&&(this.allowCustomValue||this.listData&&this.listData.length>0))for(var f=0;!(0,v.isNullOrUndefined)(this.value[f]);f++){var g=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?g&&(e+=0===f?"":this.delimiterChar+" ",e+=t=g[f],t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)):(e+=0===f?"":this.delimiterChar+" ",e+=t=this.getOverflowVal(f),t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)),l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),l+a+this.clearIconWidth>o){for(void 0!==i&&""!==i&&(t=i,f=s+1),this.updateWrapperText(this.viewWrapper,t),n=this.value.length-f,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);l+m+a+this.clearIconWidth>o&&0!==l&&""!==this.viewWrapper.innerHTML;){this.viewWrapper.innerHTML=[].join(this.delimiterChar),n=this.value.length,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)}break}l+m+a+this.clearIconWidth<=o?(i=e,s=f):0===f&&(i="",s=-1)}if(n>0){var y=o-a-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(d,this.viewWrapper,n,u,p,y)),this.updateRemainWidth(this.viewWrapper,y),this.updateRemainingText(d,a,n,u,p)}}else(0,v.isNullOrUndefined)(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},t.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},t.prototype.updateRemainWidth=function(e,t){e.classList.contains(at)&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},t.prototype.updateRemainTemplate=function(e,t,i,s,l,n){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var a=s.replace("${count}",i.toString()),o=l.replace("${count}",i.toString());return e.innerText=t.firstChild&&3===t.firstChild.nodeType?a:o,t.firstChild&&3===t.firstChild.nodeType?t.classList.remove(at):(t.classList.add(at),this.updateRemainWidth(t,n)),e},t.prototype.updateRemainingText=function(e,t,i,s,l){var n=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),a=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(a+t>=n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;a+t>n&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var o=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);o.pop(),this.viewWrapper.firstChild.nodeValue=o.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,a=this.viewWrapper.offsetWidth}var r=n-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,r)}},t.prototype.getOverflowVal=function(e){var t;if(this.mainData&&this.mainData.length){var i=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];if("CheckBox"===this.mode){var s=this.listData;this.listData=this.mainData,t=this.getTextByValue(i),this.listData=s}else t=this.getTextByValue(i)}else t=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[e]):this.value[e];return t},t.prototype.unWireEvent=function(){if((0,v.isNullOrUndefined)(this.componentWrapper)||v.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),v.EventHandler.remove(window,"resize",this.windowResize),!(0,v.isNullOrUndefined)(this.inputElement)){v.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),v.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&v.EventHandler.remove(this.inputElement,"input",this.onInput),v.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=(0,v.closest)(this.inputElement,"form");e&&v.EventHandler.remove(e,"reset",this.resetValueHandler),v.EventHandler.remove(this.inputElement,"blur",this.onBlurHandler)}(0,v.isNullOrUndefined)(this.componentWrapper)||(v.EventHandler.remove(this.componentWrapper,"mouseover",this.mouseIn),v.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut)),(0,v.isNullOrUndefined)(this.overAllClear)||v.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),(0,v.isNullOrUndefined)(this.inputElement)||v.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},t.prototype.resizingWireEvent=function(){v.EventHandler.add(document,"mousemove",this.resizePopup,this),v.EventHandler.add(document,"mouseup",this.stopResizing,this),v.EventHandler.add(document,"touchmove",this.resizePopup,this),v.EventHandler.add(document,"touchend",this.stopResizing,this)},t.prototype.resizingUnWireEvent=function(){v.EventHandler.remove(document,"mousemove",this.resizePopup),v.EventHandler.remove(document,"mouseup",this.stopResizing),v.EventHandler.remove(document,"touchmove",this.resizePopup),v.EventHandler.remove(document,"touchend",this.stopResizing)},t.prototype.selectAllItem=function(e,t,i){var s;if((0,v.isNullOrUndefined)(this.list)||(s=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&t&&t.target&&(0,v.closest)(t.target,".e-close-hooker")&&this.allowFiltering&&(s=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!(0,v.isNullOrUndefined)(this.fields.groupBy)){var l=t?this.groupTemplate?(0,v.closest)(t.target,".e-list-group-item"):t.target:null;if((l=(l=t&&32===t.keyCode?i:l)&&l.classList.contains("e-frame")?l.parentElement.parentElement:l)&&l.classList.contains("e-list-group-item")){var n=l.nextElementSibling;if((0,v.isNullOrUndefined)(n))return;for(;n.classList.contains("e-list-item");){if(!this.fields.disabled||!this.isDisabledElement(n))if(e){if(!n.firstElementChild.lastElementChild.classList.contains("e-check")){var a=this.value&&this.value.length?this.value.length:0;n.classList.contains("e-active")&&(a-=1),a<this.maximumSelectionLength&&this.updateListSelection(n,t)}}else n.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(n,t);if(null==(n=n.nextElementSibling))break}if(l.classList.contains("e-list-group-item")){var o=this.list.getElementsByClassName("e-item-focus")[0];o&&o.classList.remove("e-item-focus"),e?l.classList.add("e-active"):l.classList.remove("e-active"),l.classList.add("e-item-focus"),this.updateAriaActiveDescendant()}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&t&&this.updateValueState(t,this.value,this.tempValues)}else this.updateValue(t,s,e)}else this.updateValue(t,s,e);this.addValidInputClass()},t.prototype.virtualSelectionAll=function(e,t,i){var s=this,l=0,n=t.length,a=this.maximumSelectionLength;if(e){this.virtualSelectAll=!0,n=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:n,this.listData=this.virtualSelectAllData;var o=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),r=document.createDocumentFragment();o.forEach((function(e){r.appendChild(e.cloneNode(!0))})),t.forEach((function(e){r.appendChild(e.cloneNode(!0))}));var h=r.childNodes;if(this.virtualSelectAllData instanceof Array){for(;l<n&&l<=50&&l<a;){if(this.isSelectAllTarget=n===l+1,h[l]){var u=this.allowObjectBinding?this.getDataByValue(h[l].getAttribute("data-value")):this.getFormattedValue(h[l].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&this.value.indexOf(u)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(u,this.value)>=0){l++;continue}this.updateListSelection(h[l],i,n-l)}else{u=(0,v.getValue)(this.fields.value?this.fields.value:"",this.virtualSelectAllData[l]);if(u=this.allowObjectBinding?this.getDataByValue(u):u,!this.allowObjectBinding&&this.value&&this.value.indexOf(u)>=0||this.allowObjectBinding&&this.indexOfObjectInArray(u,this.value)>=0){l++;continue}this.value&&null!=u&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(u)<0||this.allowObjectBinding&&!this.isObjectInArray(u,this.value))&&this.dispatchSelect(u,i,null,!1,n)}l++}n>50&&setTimeout((function(){if(s.virtualSelectAllData&&s.virtualSelectAllData.length>0&&s.virtualSelectAllData.map((function(e){if(s.value&&null!=e[s.fields.value]&&Array.isArray(s.value)&&(!s.allowObjectBinding&&s.value.indexOf(e[s.fields.value])<0||s.allowObjectBinding&&!s.isObjectInArray(e[s.fields.value],s.value))){var t=e[s.fields.value],l=e[s.fields.text].toString();s.dispatchSelect(t,i,null,!1,n,e,l)}})),s.updatedataValueItems(i),s.isSelectAllLoop=!1,s.changeOnBlur||(s.updateValueState(i,s.value,s.tempValues),s.isSelectAll=s.isSelectAll?!s.isSelectAll:s.isSelectAll),s.updateHiddenElement(!0),s.popupWrapper&&t[l-1]&&t[l-1].classList.contains("e-item-focus")){var e=document.getElementsByClassName("e-selectall-parent")[0];e&&e.classList.contains("e-item-focus")&&t[l-1].classList.remove("e-item-focus")}}),0)}}else this.virtualSelectAllData&&this.virtualSelectAllData.length>0&&this.virtualSelectAllData.map((function(e){s.virtualSelectAll=!0,s.removeValue(s.value[l],i,s.value.length-l)})),this.updatedataValueItems(i),this.changeOnBlur||(this.updateValueState(i,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.virtualSelectAll=!1,(0,v.isNullOrUndefined)(this.viewPortInfo.startIndex)||(0,v.isNullOrUndefined)(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});var p=this.list.getElementsByClassName("e-virtual-ddl")[0];p&&(p.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton();var d=this.list.getElementsByClassName("e-virtual-ddl-content")[0];d&&(d.style=this.getTransformValues())},t.prototype.updateValue=function(e,t,i){var s=this,l=t.length,n={event:e,items:i?t:[],itemData:i?this.listData:[],isInteracted:!!e,isChecked:i,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",n),t&&t.length||this.enableVirtualization&&!i){var a=0,o=0;if(o=this.enableGroupCheckBox?i?this.maximumSelectionLength-(this.value?this.value.length:0):t.length:i?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength,n.preventSelectEvent){for(var r=0;r<t.length&&r<o;r++){this.removeHover();var h=t[r].getAttribute("data-value"),u=this.getFormattedValue(h);u=this.allowObjectBinding?this.getDataByValue(u):u;var p=this.mainList?this.mainList.querySelectorAll(i?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[r]:null;i?(this.value=this.value?this.value:[],(!this.allowObjectBinding&&this.value.indexOf(u)<0||this.allowObjectBinding&&!this.isObjectInArray(u,this.value))&&this.setProperties({value:[].concat([],this.value,[u])},!0),this.removeFocus(),this.addListSelection(t[r],p),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(u,e,!1,t[r],p),this.enableGroupCheckBox&&this.findGroupStart(t[r])}if(!i)if((this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength){var d=this.list.querySelectorAll("li."+A.li+":not(.e-active)");(0,v.removeClass)(d,"e-disable")}var c={event:e,items:i?t:[],itemData:i?this.listData:[],isInteracted:!!e,isChecked:i};this.trigger("selectedAll",c)}else if(this.enableVirtualization)this.virtualSelectAllState=i,this.virtualSelectAll=!0,this.CurrentEvent=e,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new g.Query),this.virtualSelectAllData&&this.virtualSelectionAll(i,t,e);else{for(;a<l&&a<=50&&a<o;)this.isSelectAllTarget=l===a+1,this.updateListSelection(t[a],e,l-a),this.enableGroupCheckBox&&this.findGroupStart(t[a]),a++;l>50&&setTimeout((function(){for(;a<l&&a<o;)s.isSelectAllTarget=l===a+1,s.updateListSelection(t[a],e,l-a),s.enableGroupCheckBox&&s.findGroupStart(t[a]),a++;if(s.updatedataValueItems(e),s.changeOnBlur||(s.updateValueState(e,s.value,s.tempValues),s.isSelectAll=s.isSelectAll?!s.isSelectAll:s.isSelectAll),s.updateHiddenElement(),s.popupWrapper&&t[a-1].classList.contains("e-item-focus")){var i=document.getElementsByClassName("e-selectall-parent")[0];i&&i.classList.contains("e-item-focus")&&t[a-1].classList.remove("e-item-focus")}}),0)}}this.updatedataValueItems(e),this.checkPlaceholderSize(),l<=50&&!n.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),(this.enableVirtualization&&this.value&&this.value.length>0||!this.enableVirtualization)&&this.updateHiddenElement())},t.prototype.updateHiddenElement=function(e){var t=this,i="",s="",l="",n=[];"CheckBox"===this.mode&&(this.value.map((function(a,o){i+='<option selected value ="'+a+'">'+o+"</option>",e||(l=t.listData?t.getTextByValue(a):a,s+=l+t.delimiterChar+" ",n.push(l))})),this.hiddenElement.innerHTML=i,e||(this.updateWrapperText(this.delimiterWrapper,s),this.setProperties({text:n.toString()},!0)),this.delimiterWrapper.setAttribute("id",(0,v.getUniqueID)("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},t.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},t.prototype.textboxValueUpdate=function(e){var t=e&&e.target&&((0,v.closest)(e.target,".e-selectall-parent")||(0,v.closest)(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||t)?this.searchWrapper.classList.remove(Ye):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!t&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},t.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},t.prototype.updateDataSource=function(e){(0,v.isNullOrUndefined)(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},t.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},t.prototype.selectAllItems=function(t,i){var s=this;if((0,v.isNullOrUndefined)(this.list))this.selectAllAction=function(){if("CheckBox"===s.mode&&s.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===s.mode,value:t?"check":"uncheck"};s.notify("checkSelectAll",e)}s.selectAllItem(t,i),s.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var l={value:t?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",l)}this.selectAllItem(t,i)}this.dataSource instanceof g.DataManager&&!(this.dataSource instanceof g.DataManager&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(t,i){(t.dataSource&&!(0,v.isNullOrUndefined)(Object.keys(t.dataSource))||t.query&&!(0,v.isNullOrUndefined)(Object.keys(t.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],t));for(var s=0,l=Object.keys(t);s<l.length;s++){var n=l[s];switch(n){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&((0,v.isNullOrUndefined)(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(t.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":if(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,i.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")){var a=this.list.querySelectorAll("li."+A.li+".e-active.e-disable");(0,v.removeClass)(a,"e-disable")}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(t.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:t.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(t.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(i.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(t.enableRtl),e.prototype.onPropertyChanged.call(this,t,i);break;case"allowResize":if(this.allowResize=t.allowResize,!this.allowResize&&this.popupObj){var o=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=(0,v.formatUnit)(o),this.popupWrapper.style.height=(0,v.formatUnit)(this.popupHeight),this.popupWrapper.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):this.list.style.maxHeight=(0,v.formatUnit)(this.popupHeight)}break;case"readonly":this.updateReadonly(t.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(t.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass(),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":if(this.popupObj){o=parseInt(this.popupHeight,10);"auto"!==this.popupHeight?(this.list.style.maxHeight=(0,v.formatUnit)(o),this.popupWrapper.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):this.list.style.maxHeight=(0,v.formatUnit)(this.popupHeight)}break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.removeScrollEvent();break;default:var r=this.getPropObject(n,t,i);e.prototype.onPropertyChanged.call(this,r.newProperty,r.oldProperty)}}},t.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},t.prototype.totalItemsCount=function(){var e;if(this.dataSource instanceof g.DataManager?this.remoteDataCount>=0?e=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):e=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==e?e:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==e&&this.value?e-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0)for(var t=0;t<this.virtualCustomSelectData.length;t++)for(var i=0;i<this.value.length;i++){(this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[i]):this.value[i])===(0,v.getValue)(this.fields.value?this.fields.value:"",this.virtualCustomSelectData[t])&&(this.totalItemCount+=1)}}else this.totalItemCount=0!==e?e:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&this.virtualCustomSelectData.length>0&&(this.totalItemCount+=this.virtualCustomSelectData.length)},t.prototype.presentItemValue=function(e){for(var t=[],i=0;i<this.value.length;i++){var s=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[i]):this.value[i];if(!this.findListElement(this.allowFiltering&&!(0,v.isNullOrUndefined)(this.mainList)?this.mainList:e,"li","data-value",s)){var l=this.allowObjectBinding?this.getDataByValue(this.value[i]):this.value[i];t.push(l)}}return t},t.prototype.addNonPresentItems=function(e,t,i,s){var l=this;this.dataSource.executeQuery(this.getForQuery(e)).then((function(e){e.result.length>0&&l.addItem(e.result,i.length),l.updateActionList(t,i,s)}))},t.prototype.updateVal=function(e,t,i){if(this.list)if(!(this.dataSource instanceof g.DataManager)||this.listData&&this.mainList&&this.mainData){var s=[];if((0,v.isNullOrUndefined)(this.value)||this.allowCustomValue||(s=this.presentItemValue(this.ulElement)),"value"===i&&s.length>0&&this.dataSource instanceof g.DataManager&&!(0,v.isNullOrUndefined)(this.value)&&null!=this.listData&&!this.enableVirtualization)this.mainData=null,this.setDynValue=!0,this.addNonPresentItems(s,this.ulElement,this.listData);else{if("text"===i&&(this.initialTextUpdate(),e=this.value),((0,v.isNullOrUndefined)(this.value)||0===this.value.length)&&(this.tempValues=t),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof g.DataManager)?this.isInitRemoteVirtualData||(this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()):this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,t),this.checkPlaceholderSize()}}else this.onLoadSelect();else this.onLoadSelect();this.changeOnBlur||this.updateValueState(null,e,t)},t.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},t.prototype.hidePopup=function(e){var t=this;if(this.isPopupOpen()){var i={name:"FadeOut",duration:100,delay:100};this.customFilterQuery=null;var s={popup:this.popupObj,cancel:!1,animation:i,event:e||null};this.trigger("close",s,(function(e){if(!e.cancel){t.fields.groupBy&&"CheckBox"!==t.mode&&t.fixedHeaderElement&&((0,v.remove)(t.fixedHeaderElement),t.fixedHeaderElement=null),t.beforePopupOpen=!1,t.overAllWrapper.classList.remove(nt);var i="CheckBox"===t.mode?t.targetElement():null;if(t.popupObj.hide(new v.Animation(e.animation)),(0,v.attributes)(t.inputElement,{"aria-expanded":"false"}),t.inputElement.removeAttribute("aria-owns"),t.inputElement.removeAttribute("aria-activedescendant"),t.allowFiltering&&t.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===t.mode,value:"clear"}),t.popupObj.hide(),(0,v.removeClass)([document.body,t.popupObj.element],"e-popup-full-page"),v.EventHandler.remove(t.list,"keydown",t.onKeyDown),"CheckBox"===t.mode&&t.showSelectAll&&v.EventHandler.remove(t.popupObj.element,"click",t.clickHandler),t.list&&t.list.parentElement&&t.allowResize){t.resizer&&t.list.parentElement.contains(t.resizer)&&t.list.parentElement.removeChild(t.resizer),t.list.parentElement.classList.contains("e-resize")&&t.list.parentElement.classList.remove("e-resize"),t.list.parentElement.style.boxSizing="",t.list.parentElement.style.paddingBottom="";var s=parseInt(t.popupHeight,10);t.list.style.maxHeight=(0,v.formatUnit)(s),t.list.parentElement.style.height=(0,v.formatUnit)(t.popupHeight),t.list.parentElement.style.maxHeight=(0,v.formatUnit)(t.popupHeight)}t.resizer&&(v.EventHandler.remove(t.resizer,"mousedown",t.startResizing),t.resizer.remove()),t.enableVirtualization&&"CheckBox"===t.mode&&t.value&&t.value.length>0&&t.enableSelectionOrder&&(t.viewPortInfo.startIndex=t.virtualItemStartIndex=0,t.viewPortInfo.endIndex=t.virtualItemEndIndex=t.viewPortInfo.startIndex>0?t.viewPortInfo.endIndex:t.itemCount,t.virtualListInfo=t.viewPortInfo,t.previousStartIndex=0,t.previousEndIndex=t.itemCount);var l=void 0;t.dataSource instanceof g.DataManager?t.remoteDataCount>=0?t.totalItemCount=t.dataCount=t.remoteDataCount:t.resetList(t.dataSource):l=t.dataSource&&t.dataSource.length?t.dataSource.length:0,t.enableVirtualization&&(t.allowFiltering||t.allowCustomValue)&&(t.targetElement()||i)&&t.totalItemCount!==l&&(t.checkAndResetCache(),t.updateInitialData()),t.virtualCustomData&&t.viewPortInfo&&0===t.viewPortInfo.startIndex&&t.viewPortInfo.endIndex===t.itemCount&&t.renderItems(t.mainData,t.fields),t.virtualCustomData=null,t.isVirtualTrackHeight=!1}}))}},t.prototype.showPopup=function(t){var i=this;if(this.enabled){this.firstItem=this.dataSource&&this.dataSource.length>0?this.dataSource[0]:null;this.trigger("beforeOpen",{cancel:!1},(function(s){if(!s.cancel){if(!i.ulElement)return i.beforePopupOpen=!0,"CheckBox"===i.mode&&v.Browser.isDevice&&i.allowFiltering&&i.isDeviceFullScreen&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode}),void e.prototype.render.call(i,t);"CheckBox"===i.mode&&v.Browser.isDevice&&i.allowFiltering&&i.isDeviceFullScreen&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode});var l=i.ulElement.querySelectorAll("li.e-list-item").length,n=i.ulElement.querySelectorAll("li."+A.li+"."+_e).length;if(l>0&&l===n&&n===i.mainData.length&&(""===i.targetElement()||!i.allowCustomValue))return void(i.beforePopupOpen=!1);if(i.onPopupShown(t),i.enableVirtualization&&i.listData&&i.listData.length&&((0,v.isNullOrUndefined)(i.value)||"dropdownlist"!==i.getModuleName()&&"combobox"!==i.getModuleName()||i.removeHover(),i.beforePopupOpen||(i.hideSelectedItem&&i.value&&Array.isArray(i.value)&&i.value.length>0&&i.totalItemsCount(),i.preventSetCurrentData||(0,v.isNullOrUndefined)(i.viewPortInfo.startIndex)||(0,v.isNullOrUndefined)(i.viewPortInfo.endIndex)||i.notify("setCurrentViewDataAsync",{component:i.getModuleName(),module:"VirtualScroll"}))),i.enableVirtualization&&!i.allowFiltering&&null!=i.selectedValueInfo&&i.selectedValueInfo.startIndex>0&&null!=i.value&&i.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),i.enableVirtualization)i.updatevirtualizationList();else if(i.value&&i.value.length)for(var a=void 0,o=(i.getItems(),0),r=i.value;o<r.length;o++){var h=r[o],u=i.allowObjectBinding?(0,v.getValue)(i.fields.value?i.fields.value:"",h):h;(a=i.getElementByValue(u))&&i.addListSelection(a)}i.allowResize&&i.setResize(),i.preventSetCurrentData=!0}}))}},t.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},t.prototype.getModuleName=function(){return"multiselect"},t.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout((function(){e.setProperties({value:null},!0)}),0):this.setProperties({value:null},!0)},t.prototype.render=function(){!(0,v.isNullOrUndefined)(this.value)&&this.value.length>0&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view "+Ze,styles:"display:none;"}),this.overAllClear=this.createElement("span",{className:$e,styles:"display:none;"}),this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&(0,v.addClass)([this.overAllWrapper],"e-checkbox"),v.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:Ze,styles:"display:none"}),this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection",styles:"display:none"}),"Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",(0,v.getUniqueID)("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",(0,v.getUniqueID)("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!v.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add(tt),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),(0,v.isNullOrUndefined)(this.inputElement)||((0,v.attributes)(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName())),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?Pe(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):(0,v.getUniqueID)("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),!(0,v.isNullOrUndefined)((0,v.closest)(this.element,"fieldset"))&&(0,v.closest)(this.element,"fieldset").disabled&&(this.enabled=!1),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.viewPortInfo.startIndex>0?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),N.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),(0,v.isNullOrUndefined)(this.overAllWrapper)||(0,v.isNullOrUndefined)(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},t.prototype.setResize=function(){if(this.list&&this.list.parentElement&&(0,v.isNullOrUndefined)(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement){this.list.parentElement.classList.add("e-resize"),"auto"!==this.popupHeight.toString().toLowerCase()&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box";var e="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16;this.list.parentElement.style.paddingBottom=e+"px",this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px"}this.resizer&&(v.EventHandler.add(this.resizer,"mousedown",this.startResizing,this),v.EventHandler.add(this.resizer,"touchstart",this.startResizing,this))},t.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},t.prototype.resizePopup=function(e){if(this.isResizing){this.trigger("resizing",e);var t=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,i=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,s=t-this.originalMouseX,l=i-this.originalMouseY;if(this.resizeWidth=Math.max(this.originalWidth+s,100),this.resizeHeight=Math.max(this.originalHeight+l,130),this.list&&this.list.parentElement){var n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10),a=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10);n=n||100,a=a||120,this.resizeWidth=Math.max(this.originalWidth+s,n),this.resizeHeight=Math.max(this.originalHeight+l,a),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px")}e&&e.preventDefault()}},t.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},t.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=(0,v.formatUnit)(this.popupHeight);e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height;var s=Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10);return e.remove(),s},t.prototype.removeDisabledItemsValue=function(e){if(e){for(var t=[],i=0,s=0;s<e.length;s++){var l=e[s];"object"==typeof l&&(l=JSON.parse(JSON.stringify(l))[this.fields.value]),null==l||this.isDisabledItemByIndex(this.getIndexByValue(l))||(t[i++]=e[s])}this.value=t.length>0?t:null}},t.prototype.checkInitialValue=function(){var t=this;this.fields.disabled&&this.removeDisabledItemsValue(this.value);var i=this.dataSource instanceof Array?this.dataSource.length>0:!(0,v.isNullOrUndefined)(this.dataSource);if((!this.value||!this.value.length)&&(0,v.isNullOrUndefined)(this.text)&&!i&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var s=this.element.options,l=[],n="",a=0,o=s.length;a<o;a++){var r=s[a];if(!(0,v.isNullOrUndefined)(r.getAttribute("selected")))if(r.getAttribute("value")){var h=this.allowObjectBinding?this.getDataByValue(r.getAttribute("value")):r.getAttribute("value");l.push(h)}else n+=r.text+this.delimiterChar}l.length>0?this.setProperties({value:l},!0):""!==n&&this.setProperties({text:n},!0),(l.length>0||""!==n)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if((this.value&&this.value.length||!(0,v.isNullOrUndefined)(this.text))&&(this.list||e.prototype.render.call(this)),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),(0,v.isNullOrUndefined)(this.text)||!(0,v.isNullOrUndefined)(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){var u;if(this.enableVirtualization){for(var p=this.isPrimitiveData?"":this.fields.value,d=void 0,c=0;c<this.value.length;c++){h=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",this.value[c]):this.value[c];d=0===c?new g.Predicate(p,"equal",h):d.or(p,"equal",h)}this.dataSource instanceof g.DataManager?this.dataSource.executeQuery((new g.Query).where(d)).then((function(e){e.result.length>0&&(u=e.result,t.initStatus=!1,t.isInitRemoteVirtualData=!0,setTimeout((function(){t.initialValueUpdate(u,!0),t.initialUpdate(),t.isInitRemoteVirtualData=!1}),100),t.initStatus=!0)})):u=new g.DataManager(this.dataSource).executeLocal((new g.Query).where(d))}this.dataSource instanceof g.DataManager?this.setInitialValue=function(){t.initStatus=!1,t.enableVirtualization&&(!t.enableVirtualization||t.dataSource instanceof g.DataManager)||t.initialValueUpdate(u),t.initialUpdate(),t.setInitialValue=null,t.initStatus=!0}:(this.initialValueUpdate(u,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),(0,v.isNullOrUndefined)(this.text)||this.element.setAttribute("data-initial-value",this.text)},t.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},t.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var e=void 0,t=0,i=this.value;t<i.length;t++){var s=i[t],l=this.allowObjectBinding?(0,v.getValue)(this.fields.value?this.fields.value:"",s):s;(e=this.getElementByValue(l))&&this.addListSelection(e)}if(this.enableVirtualization&&this.hideSelectedItem){var n=this.list.querySelectorAll("li."+A.li+":not(."+_e+"):not(.e-reorder-hide):not(.e-virtual-list)");if(n.length){var a=this.virtualListHeight>0?Math.floor(this.virtualListHeight/this.listItemHeight):0;if(n.length<a+2){var o=this.getForQuery(this.value).clone();o=o.skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,o)}}}}},t.prototype.setFloatLabelType=function(){He(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&Pe(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},t.prototype.addValidInputClass=function(){(0,v.isNullOrUndefined)(this.overAllWrapper)||(!(0,v.isNullOrUndefined)(this.value)&&this.value.length||"Always"===this.floatLabelType?(0,v.addClass)([this.overAllWrapper],"e-valid-input"):(0,v.removeClass)([this.overAllWrapper],"e-valid-input"))},t.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:lt}),this.componentWrapper.appendChild(this.dropIcon),(0,v.addClass)([this.componentWrapper],["e-down-icon"])):(0,v.isNullOrUndefined)(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),(0,v.removeClass)([this.componentWrapper],["e-down-icon"]))},t.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},t.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e)if(e instanceof HTMLLIElement){for(var i=0;i<this.liCollections.length;i++)if(this.liCollections[i]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else{var s=JSON.parse(JSON.stringify(e))[this.fields.value];for(i=0;i<this.listData.length;i++)if(JSON.parse(JSON.stringify(this.listData[i]))[this.fields.value]===s){t=this.getIndexByValue(s);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));if(n[this.fields.disabled]=!0,this.listData[t]=n,l.classList.contains(A.focus)&&this.removeFocus(),l.classList.contains(_e)||l.classList.contains(A.selected)){var a=this.value;this.removeDisabledItemsValue(this.value),this.updateVal(this.value,a,"value")}"CheckBox"===this.mode&&this.enableGroupCheckBox&&!(0,v.isNullOrUndefined)(this.fields.groupBy)&&this.disableGroupHeader()}}}}},t.prototype.destroy=function(){this.isReact&&this.clearTemplate(),(0,v.isNullOrUndefined)(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var t=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],i=t.length;if(!(0,v.isNullOrUndefined)(this.inputElement))for(;i>0;)this.inputElement.removeAttribute(t[i-1]),i--;for((0,v.isNullOrUndefined)(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()||this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),(0,v.remove)(this.overAllWrapper)),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var s=this.overAllWrapper.querySelector("select.e-multi-hidden");for(s&&s.parentElement&&s.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var l=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],n=0;n<l.length;n++)this.inputElement.removeAttribute(l[n]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,e.prototype.destroy.call(this)},Re([(0,v.Complex)({text:null,value:null,iconCss:null,groupBy:null,disabled:null},O)],t.prototype,"fields",void 0),Re([(0,v.Property)(!1)],t.prototype,"enablePersistence",void 0),Re([(0,v.Property)(null)],t.prototype,"groupTemplate",void 0),Re([(0,v.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),Re([(0,v.Property)("Request failed")],t.prototype,"actionFailureTemplate",void 0),Re([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),Re([(0,v.Property)(!0)],t.prototype,"enabled",void 0),Re([(0,v.Property)(!0)],t.prototype,"enableHtmlSanitizer",void 0),Re([(0,v.Property)(!1)],t.prototype,"enableVirtualization",void 0),Re([(0,v.Property)([])],t.prototype,"dataSource",void 0),Re([(0,v.Property)(null)],t.prototype,"query",void 0),Re([(0,v.Property)("StartsWith")],t.prototype,"filterType",void 0),Re([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),Re([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),Re([(0,v.Property)()],t.prototype,"locale",void 0),Re([(0,v.Property)(!1)],t.prototype,"enableGroupCheckBox",void 0),Re([(0,v.Property)(null)],t.prototype,"cssClass",void 0),Re([(0,v.Property)("100%")],t.prototype,"width",void 0),Re([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),Re([(0,v.Property)("100%")],t.prototype,"popupWidth",void 0),Re([(0,v.Property)(null)],t.prototype,"placeholder",void 0),Re([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),Re([(0,v.Property)({})],t.prototype,"htmlAttributes",void 0),Re([(0,v.Property)(null)],t.prototype,"valueTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"headerTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"footerTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),Re([(0,v.Property)(null)],t.prototype,"allowFiltering",void 0),Re([(0,v.Property)(!0)],t.prototype,"isDeviceFullScreen",void 0),Re([(0,v.Property)(!0)],t.prototype,"changeOnBlur",void 0),Re([(0,v.Property)(!1)],t.prototype,"allowCustomValue",void 0),Re([(0,v.Property)(!0)],t.prototype,"showClearButton",void 0),Re([(0,v.Property)(1e3)],t.prototype,"maximumSelectionLength",void 0),Re([(0,v.Property)(!1)],t.prototype,"readonly",void 0),Re([(0,v.Property)(!1)],t.prototype,"allowResize",void 0),Re([(0,v.Property)(null)],t.prototype,"text",void 0),Re([(0,v.Property)(null)],t.prototype,"value",void 0),Re([(0,v.Property)(!1)],t.prototype,"allowObjectBinding",void 0),Re([(0,v.Property)(!0)],t.prototype,"hideSelectedItem",void 0),Re([(0,v.Property)(!0)],t.prototype,"closePopupOnSelect",void 0),Re([(0,v.Property)("Default")],t.prototype,"mode",void 0),Re([(0,v.Property)(",")],t.prototype,"delimiterChar",void 0),Re([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),Re([(0,v.Property)(!1)],t.prototype,"showDropDownIcon",void 0),Re([(0,v.Property)("Never")],t.prototype,"floatLabelType",void 0),Re([(0,v.Property)(!1)],t.prototype,"showSelectAll",void 0),Re([(0,v.Property)("Select All")],t.prototype,"selectAllText",void 0),Re([(0,v.Property)("Unselect All")],t.prototype,"unSelectAllText",void 0),Re([(0,v.Property)(!0)],t.prototype,"enableSelectionOrder",void 0),Re([(0,v.Property)(!0)],t.prototype,"openOnClick",void 0),Re([(0,v.Property)(!1)],t.prototype,"addTagOnBlur",void 0),Re([(0,v.Event)()],t.prototype,"change",void 0),Re([(0,v.Event)()],t.prototype,"removing",void 0),Re([(0,v.Event)()],t.prototype,"removed",void 0),Re([(0,v.Event)()],t.prototype,"beforeSelectAll",void 0),Re([(0,v.Event)()],t.prototype,"selectedAll",void 0),Re([(0,v.Event)()],t.prototype,"beforeOpen",void 0),Re([(0,v.Event)()],t.prototype,"open",void 0),Re([(0,v.Event)()],t.prototype,"close",void 0),Re([(0,v.Event)()],t.prototype,"blur",void 0),Re([(0,v.Event)()],t.prototype,"focus",void 0),Re([(0,v.Event)()],t.prototype,"chipSelection",void 0),Re([(0,v.Event)()],t.prototype,"resizeStop",void 0),Re([(0,v.Event)()],t.prototype,"resizing",void 0),Re([(0,v.Event)()],t.prototype,"resizeStart",void 0),Re([(0,v.Event)()],t.prototype,"filtering",void 0),Re([(0,v.Event)()],t.prototype,"tagging",void 0),Re([(0,v.Event)()],t.prototype,"customValueSelection",void 0),t=Re([v.NotifyPropertyChanges],t)}(D),ut="e-frame",pt="e-check",dt="e-checkbox-wrapper",ct="e-stop",mt="e-input-group-icon e-clear-icon e-icons",ft="e-clear-icon",vt="e-popup-full-page",gt="e-input-focus",yt=function(){function e(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"CheckBoxSelection"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlurHandler,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),v.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlurHandler),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},e.prototype.listOption=function(e){var t=this;if((0,v.isNullOrUndefined)(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){t.checboxCreate(e)};else{var i=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){t.checboxCreate(e),i.apply(t,[e])}}},e.prototype.setPlaceholder=function(e){N.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var t;if(t=(0,v.isNullOrUndefined)(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==t.className&&"e-list-group-item"!==t.className){var i=(0,U.createCheckBox)(this.parent.createElement,!0),s=(0,v.select)("div.e-icons",t);return t.insertBefore(i,t.childNodes[(0,v.isNullOrUndefined)(s)?0:1]),(0,v.select)("."+ut,i),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),t}return t},e.prototype.setSelectAll=function(){this.parent.showSelectAll?((0,v.isNullOrUndefined)(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&((0,v.isNullOrUndefined)(this.parent.filterParent)?(0,v.append)([this.checkAllParent],this.parent.popupWrapper):(0,v.append)([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||((0,v.isNullOrUndefined)(this.parent.filterParent)?(0,v.prepend)([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),v.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):(0,v.isNullOrUndefined)(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},e.prototype.listSelection=function(e){var t;if((0,v.isNullOrUndefined)(e.e)){var i=e.li.querySelector(".e-checkbox-wrapper");t=i?i.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{e.li.querySelector(".e-checkbox-wrapper .e-frame");t=(0,v.isNullOrUndefined)(e.e.target)?e.li.querySelector(".e-checkbox-wrapper").childNodes[1]:e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(t=e.li.firstElementChild.childNodes[1]),(0,v.isNullOrUndefined)(t)||(this.checkWrapper=(0,v.closest)(t,"."+dt)),!(0,v.isNullOrUndefined)(this.checkWrapper)){var s=(0,v.select)("."+ut,this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains(pt),e.li,e.e,!1)}},e.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},e.prototype.clickHandler=function(e){var t;t=e.currentTarget.classList.contains(this.checkAllParent.className)||e.currentTarget.classList.value===this.checkAllParent.className?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=(0,v.closest)(t,"."+dt);if(!(0,v.isNullOrUndefined)(this.checkWrapper)){var i=(0,v.select)("."+ut,this.checkWrapper);this.validateCheckNode(this.checkWrapper,i.classList.contains(pt),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,t,i,s,l){var n=e.getElementsByClassName(ut)[0];"check"!==t||n.classList.contains(pt)?"uncheck"===t&&(n.classList.contains(pt)||n.classList.contains(ct))?((0,v.removeClass)([n],[pt,ct]),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):"indeterminate"!==t||n.classList.contains(ct)||((0,v.removeClass)([n],[pt]),n.classList.add(ct),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):(n.classList.remove(ct),n.classList.add(pt),l&&(this.parent.selectAllItems(!0,i),this.setLocale(!0)))},e.prototype.setSearchBox=function(e){if((0,v.isNullOrUndefined)(this.parent.filterParent)){this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element);var t=!1;return v.Browser.isDevice&&this.parent.isDeviceFullScreen&&(t=!0,this.parent.mobFilter=!1),this.filterInputObj=N.Input.createInput({element:this.filterInput,buttons:t?["e-input-group-icon e-back-icon e-icons",mt]:[mt],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),(0,v.isNullOrUndefined)(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?(0,v.addClass)([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&(0,v.addClass)([this.filterInputObj.container],"e-filled")),(0,v.append)([this.filterInputObj.container],this.parent.filterParent),(0,v.prepend)([this.parent.filterParent],e.popupElement),(0,v.attributes)(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":e.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+ft),!v.Browser.isDevice&&this.clearIconElement&&(v.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),v.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),v.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),v.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),v.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),v.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj}},e.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),(0,v.removeClass)([document.body,this.parent.popupObj.element],vt),this.parent.inputElement.focus()},e.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&((0,v.isNullOrUndefined)(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(e),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),e.preventDefault()},e.prototype.preventListSelection=function(e){e.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},e.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector("."+ft),this.clearIconElement.style.visibility="hidden",v.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),v.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,t=0,i=0,s=0;this.checkAllParent&&(t=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(s=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(i=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-t-s-i+"px",this.parent.list.style.height=window.innerHeight-e-t-s-i+"px";var l=this.filterInput.parentElement.querySelector("."+ft);(0,v.detach)(this.filterInput),l.parentElement.insertBefore(this.filterInput,l)},e.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&((0,v.attributes)(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),(0,v.addClass)([document.body,this.parent.popupObj.element],vt),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},e.prototype.targetElement=function(){return(0,v.isNullOrUndefined)(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlurHandler=function(e){if(!this.parent.element.classList.contains("e-listbox")){var t=void 0;if(this.parent.keyAction)return;if(v.Browser.isIE&&(t=!(0,v.isNullOrUndefined)(e)&&e.target),v.Browser.isIE||(t=!(0,v.isNullOrUndefined)(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(t)&&!v.Browser.isIE&&this.filterInput)return void this.filterInput.focus();if(this.parent.scrollFocusStatus&&this.filterInput)return e.preventDefault(),this.filterInput.focus(),void(this.parent.scrollFocusStatus=!1);this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove(gt),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!v.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var t=e.target;!(0,v.isNullOrUndefined)(this.parent.popupObj)&&(0,v.closest)(t,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!(0,v.isNullOrUndefined)(this.parent.popupObj)&&(0,v.closest)(t,'[id="'+this.parent.popupObj.element.id+'"]')||(0,v.isNullOrUndefined)(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(v.Browser.isIE||"edge"===v.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(A.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(e,!0),this.parent.focused=!0),(0,v.isNullOrUndefined)(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(v.Browser.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(e)),this.filterInput===t&&this.filterInput.focus()}},e.prototype.getFocus=function(e){this.parent.overAllWrapper.classList.remove(gt),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value?this.parent.keyAction=!1:("focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),v.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden"))},e.prototype.checkSelectAll=function(e){"check"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},e.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var t=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var i=e?"unSelectAllText":"selectAllText",s=0,l=(0,v.compile)(t)({},this.parent,i,null,!this.parent.isStringTemplate);s<l.length;s++){var n=l[s];this.selectAllSpan.textContent=n.textContent}}else{var a=new v.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===a.getConstant("selectAllText")&&(a=new v.L10n("dropdowns",{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.parent.locale)),(0,v.isNullOrUndefined)(this.selectAllSpan)||(this.selectAllSpan.textContent=e?a.getConstant("unSelectAllText"):a.getConstant("selectAllText"))}},e.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},e.prototype.setReorder=function(e){if(this.parent.enableSelectionOrder&&!(0,v.isNullOrUndefined)(this.parent.value)){var t=this.parent.ulElement.querySelectorAll("li.e-active").length,i=void 0,s=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});if(t>0)if(this.parent.ulElement.querySelectorAll("li.e-active").forEach((function(e){s.appendChild(e)})),i=this.parent.ulElement.querySelectorAll("li.e-active"),(0,v.addClass)(i,"e-reorder-hide"),this.parent.enableVirtualization){var l=this.parent.list.querySelector(".e-virtual-ddl-content");(0,v.prepend)([s],l)}else(0,v.prepend)([s],this.parent.list);this.parent.focusAtFirstListItem()}},e}(),Ct=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),bt=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},St=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ct(t,e),bt([(0,v.Property)("Multiple")],t.prototype,"mode",void 0),bt([(0,v.Property)(!1)],t.prototype,"showCheckbox",void 0),bt([(0,v.Property)(!1)],t.prototype,"showSelectAll",void 0),bt([(0,v.Property)("Left")],t.prototype,"checkboxPosition",void 0),t}(v.ChildProperty),Et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ct(t,e),bt([(0,v.Property)([])],t.prototype,"items",void 0),bt([(0,v.Property)("Right")],t.prototype,"position",void 0),t}(v.ChildProperty),xt=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isBackSpace=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}var i;return Ct(t,e),i=t,t.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new g.Query,this.fields)},t.prototype.render=function(){if(this.isAngular&&this.allowFiltering){var t=this.element,i=t.cloneNode(!0);t.parentNode.replaceChild(i,t),this.element=i,(0,v.setValue)("ej2_instances",[this],this.element)}this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),e.prototype.render.call(this),this.setEnabled(),this.renderComplete()},t.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});e.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation");for(var t=this.list.querySelectorAll(".e-list-group-item"),i=0;i<t.length;i++)t[i].removeAttribute("tabindex"),t[i].setAttribute("role","option");this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(A.focus),this.itemTemplate&&this.renderReactTemplates(),(0,v.removeClass)([this.list],[A.content,A.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),(0,v.attributes)(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},t.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new v.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{})}},t.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new E.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return e.createElement("span",{className:"e-placeholder"})},helper:function(t){var i=e.list.cloneNode(),s=t.sender.cloneNode(!0);i.appendChild(s);var l=e.getItems()[0];return i.style.width=l.offsetWidth+"px",i.style.height=l.offsetHeight+"px",(e.value&&e.value.length)>1&&e.isSelected(s)&&s.appendChild(e.createElement("span",{className:"e-list-badge",innerHTML:e.value.length+""})),i.style.zIndex=(0,k.getZindexPartial)(e.element)+"",i}})},t.prototype.updateActionCompleteData=function(e,t,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,t)},t.prototype.initToolbar=function(){var e=this.toolbarSettings.position,t=this.element.getAttribute("data-value");if(this.toolbarSettings.items=(0,v.isNullOrUndefined)(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length){var i=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),s=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(s,this.list),s.appendChild("Right"===e?this.list:i),s.appendChild("Right"===e?i:this.list),this.createButtons(i),this.element.id||(this.element.id=(0,v.getUniqueID)("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var l=this.element.getAttribute("data-value");t&&l&&t!==l?(this.tBListBox=(0,v.getComponent)(document.getElementById(t),this.getModuleName()),this.tBListBox.updateToolBarState()):l&&(this.tBListBox=(0,v.getComponent)(document.getElementById(l),this.getModuleName()),this.tBListBox.updateToolBarState())},t.prototype.createButtons=function(e){var t,i,s=this,l=new v.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach((function(n){i=l.getConstant(n),t=s.createElement("button",{attrs:{type:"button","data-value":n,title:i,"aria-label":i}}),e.appendChild(t),new U.Button({iconCss:"e-icons e-"+n.toLowerCase()},t).createElement=s.createElement}))},t.prototype.validationAttribute=function(t,i){this.inputFormName&&t.setAttribute("name",this.inputFormName),e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},t.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=(0,v.formatUnit)(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?(0,v.addClass)([this.list],"e-filter-list"):(0,v.removeClass)([this.list],"e-filter-list")},t.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&(0,v.addClass)([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&(0,v.addClass)([this.list],"e-rtl")},t.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?(0,v.removeClass)([e],E.cssClass.disabled):(0,v.addClass)([e],E.cssClass.disabled)},t.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=(0,v.formatUnit)(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),(0,k.createSpinner)({target:this.spinner},this.createElement),(0,k.showSpinner)(this.spinner)},t.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&(0,k.hideSpinner)(this.spinner),this.spinner.parentElement&&(0,v.detach)(this.spinner)},t.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},t.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},t.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+It.clearIcon)&&(this.filterInput.parentElement.querySelector("."+It.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},t.prototype.onActionComplete=function(t,i,s){var l,n,a,o=this;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(l=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===i.length){var r=t.childNodes[0];r&&t.removeChild(r)}if(this.allowFiltering&&(n=this.list.getElementsByClassName("e-input-filter")[0])&&(a=n.selectionStart),e.prototype.onActionComplete.call(this,t,i,s),this.allowFiltering&&!(0,v.isNullOrUndefined)(l)){this.list.insertBefore(l,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(l);var h=l.querySelector(".e-input-filter");h&&(h.addEventListener("focus",(function(){l.childNodes[0].classList.contains("e-input-focus")||l.childNodes[0].classList.add("e-input-focus")})),h.addEventListener("blur",(function(){l.childNodes[0].classList.contains("e-input-focus")&&l.childNodes[0].classList.remove("e-input-focus")})))}if(this.initWrapper(),this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],(0,v.extend)(this.jsonData,i,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],(0,v.extend)(this.jsonData,i,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(n=this.list.getElementsByClassName("e-input-filter")[0],(0,v.isNullOrUndefined)(n))return;n.selectionStart=a,n.selectionEnd=a,(""!==n.value||""===n.value&&this.isBackSpace)&&(n.focus(),setTimeout((function(){o.isBackSpace=!1})))}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!(0,v.isNullOrUndefined)(s)){var u=this.scope.replace("#","");(0,v.getComponent)(document.getElementById(u),this.getModuleName()).initToolbar()}this.initLoad=!1},t.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},t.prototype.triggerDragStart=function(e){var t,i=this,s=(0,v.extend)(this.getDragArgs(e),{dragSelected:!0},{cancel:!1});v.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",s,(function(s){i.allowDragAll=s.dragSelected,i.allowDragAll||(t=i.ulElement.getElementsByClassName("e-list-badge")[0])&&(0,v.detach)(t),s.cancel&&(e.cancel=!0)}))},t.prototype.triggerDrag=function(e){var t,i,s=this,l=10;if(this.itemTemplate&&e.target)if(e.target&&e.target.closest(".e-list-item"))l=e.target.closest(".e-list-item").scrollHeight;else{var n=e.element.querySelector(".e-list-item");n&&(l=n.scrollHeight)}var a,o=e.event;this.stopTimer(),e.target&&(e.target.classList.contains("e-listbox-wrapper")||e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item"))&&(a=e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item")?e.target.closest(".e-listbox-wrapper"):e.target,(t=this.allowFiltering?a.querySelector(".e-list-parent"):a)&&((i=t.getBoundingClientRect()).y+t.offsetHeight-(o.clientY+36)<1?this.timer=window.setInterval((function(){s.setScrollDown(t,l,!0)}),70):o.clientY-36-i.y<1&&(this.timer=window.setInterval((function(){s.setScrollDown(t,l,!1)}),70)))),null!==e.target&&this.trigger("drag",this.getDragArgs(e))},t.prototype.setScrollDown=function(e,t,i){e.scrollTop=i?e.scrollTop+t:e.scrollTop-t},t.prototype.stopTimer=function(){window.clearInterval(this.timer)},t.prototype.beforeDragEnd=function(e){this.stopTimer();var t=[];this.dragValue=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),this.value.indexOf(this.dragValue)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([this.dragValue]),(0,v.extend)(t,e.items),this.trigger("beforeDrop",e),JSON.stringify(e.items)!==JSON.stringify(t)&&(this.customDraggedItem=e.items)},t.prototype.dragEnd=function(e){var t,i,s,l,n,a,o=this,r=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),h=this.getComponent(e.droppedElement),u=this.getDragArgs({target:e.droppedElement},!0),p={previousData:this.dataSource},d={previousData:h.dataSource},c=(0,v.extend)({},u,{target:e.target,source:{previousData:this.dataSource},previousIndex:e.previousIndex,currentIndex:e.currentIndex});if(h!==this){var m=(0,v.extend)(p,{currentData:this.listData});c=(0,v.extend)(c,{source:m,destination:d})}v.Browser.isIos&&(this.list.style.overflow="");var f=this.getComponent(e.target);if(f&&0===f.listData.length){var g=f.ulElement.childNodes[0];g&&f.ulElement.removeChild(g)}if(h===this){var y=this.ulElement;t=[].slice.call(this.listData),i=[].slice.call(this.liCollections),s=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData);var C=e.currentIndex,b=e.currentIndex=this.getCurIdx(this,e.currentIndex),S=t.indexOf(this.getDataByValue(r)),E=s.indexOf(this.getDataByValue(r)),x=a.indexOf(this.getDataByValue(r));t.splice(b,0,t.splice(S,1)[0]),a.splice(C,0,a.splice(x,1)[0]),s.splice(b,0,s.splice(E,1)[0]),i.splice(b,0,i.splice(S,1)[0]),this.allowDragAll&&(n=this.value&&Array.prototype.indexOf.call(this.value,r)>-1?this.value:[r],(0,v.isNullOrUndefined)(this.customDraggedItem)||(n=[],this.customDraggedItem.forEach((function(e){n.push((0,v.getValue)(o.fields.value,e))}))),n.forEach((function(e){if(e!==r){var l=t.indexOf(o.getDataByValue(e)),n=s.indexOf(o.getDataByValue(e)),h=a.indexOf(o.getDataByValue(e));l>b&&b++,s.splice(b,0,s.splice(n,1)[0]),t.splice(b,0,t.splice(l,1)[0]),a.splice(C,0,a.splice(h,1)[0]),i.splice(b,0,i.splice(l,1)[0]),y.insertBefore(o.getItems()[o.getIndexByValue(e)],y.getElementsByClassName("e-placeholder")[0])}}))),this.listData=t,this.jsonData=s,this.sortedData=a,this.liCollections=i}else{var I,w=[].slice.call(this.liCollections),O=e.currentIndex=this.getCurIdx(h,e.currentIndex),A=h.ulElement;t=[].slice.call(h.listData),i=[].slice.call(h.liCollections),s=[].slice.call(h.jsonData),a=[].slice.call(h.sortedData),n=this.value&&Array.prototype.indexOf.call(this.value,r)>-1&&this.allowDragAll?this.value:[r],(0,v.isNullOrUndefined)(this.customDraggedItem)||(n=[],this.customDraggedItem.forEach((function(e){n.push((0,v.getValue)(o.fields.value,e))})));var D=[].slice.call(this.listData),k=[].slice.call(this.sortedData);if(n.forEach((function(n){l=o.getDataByValue(n);var h=o.listData.indexOf(l),u=o.jsonData.indexOf(l),p=o.sortedData.indexOf(l);D.splice(h,1),o.jsonData.splice(u,1),k.splice(p,1),o.listData=D,o.sortedData=k;var d=n===r?e.currentIndex:O;if(t.splice(d,0,l),s.splice(d,0,l),a.splice(d,0,l),i.splice(d,0,w.splice(h,1)[0]),n)I=o.getItems()[o.getIndexByValue(n)];else for(var c=o.getItems(),m=0;m<c.length;m++)if(null===c[m].getAttribute("data-value")&&c[m].classList.contains("e-list-item")){I=c[m];break}I||(I=e.helper),o.removeSelected(o,n===r?[e.droppedElement]:[I]),A.insertBefore(I,A.getElementsByClassName("e-placeholder")[0]),O++})),this.fields.groupBy){var N=this.renderItems(this.listData,this.fields);this.updateListItems(N,this.ulElement),this.setSelection()}if("None"!==h.sortOrder||this.selectionSettings.showCheckbox!==h.selectionSettings.showCheckbox||h.fields.groupBy||h.itemTemplate||this.itemTemplate){var L=(0,v.getComponent)(A,"sortable");N=h.renderItems(t,h.fields);h.updateListItems(N,A),this.setSelection(),L.placeHolderElement&&A.appendChild(L.placeHolderElement),A.appendChild(e.helper),h.setSelection()}this.liCollections=w,h.liCollections=i,h.jsonData=(0,v.extend)([],[],s,!1),h.listData=(0,v.extend)([],[],t,!1),"None"===h.sortOrder&&(h.sortedData=(0,v.extend)([],[],a,!1)),0===this.listData.length&&this.l10nUpdate()}if(this===h){m=(0,v.extend)(p,{currentData:t});c=(0,v.extend)(c,{source:m})}else{var B=(0,v.extend)(d,{currentData:t});c=(0,v.extend)(c,{destination:B})}(0,v.isNullOrUndefined)(this.customDraggedItem)||(c.items=this.customDraggedItem),this.trigger("drop",c);var T=c.elements;if(T.length)for(var V=0;V<T.length;V++)T[V].classList.remove("e-grabbed");this.toolbarSettings.items.length>0?this.updateToolBarState():this.tBListBox&&this.tBListBox.toolbarSettings.items.length>0&&this.tBListBox.updateToolBarState()},t.prototype.updateListItems=function(e,t){t.innerHTML="",t.append.apply(t,e.childNodes)},t.prototype.removeSelected=function(e,t){e.selectionSettings.showCheckbox?t.forEach((function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")})):(0,v.removeClass)(t,E.cssClass.selected)},t.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter((function(e){return e.classList.contains(E.cssClass.group)})).length),t},t.prototype.getComponent=function(e){var t,i="EJS-LISTBOX"===this.element.tagName?(0,v.closest)(e,".e-listbox"):(0,v.closest)(e,".e-listbox-wrapper")&&(0,v.closest)(e,".e-listbox-wrapper").querySelector(".e-listbox");return i&&(t=(0,v.getComponent)(i,this.getModuleName())),t},t.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},t.prototype.listOption=function(t,i){return this.listCurrentOptions=e.prototype.listOption.call(this,t,i),this.listCurrentOptions=(0,v.extend)({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},t.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},t.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},t.prototype.enableItems=function(e,t,i){var s,l=this;if(void 0===t&&(t=!0),e.forEach((function(e){var n=e;(s=l.findListElement(l.list,"li","data-value",i?n:l.getValueByText(n)))&&(t?((0,v.removeClass)([s],E.cssClass.disabled),s.removeAttribute("aria-disabled")):((0,v.addClass)([s],E.cssClass.disabled),s.setAttribute("aria-disabled","true")))})),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&this.toolbarSettings.items.length>0){var n=!1;if(this.ulElement.childNodes.forEach((function(e){e.classList.contains("e-disabled")||(n=!0)})),!n)this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0}},t.prototype.selectItems=function(e,t,i){void 0===t&&(t=!0),t&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach((function(e){e.classList.remove("e-active"),e.removeAttribute("aria-selected"),(0,v.removeClass)([e],E.cssClass.selected)})),this.setSelection(e,t,!i),this.updateSelectedOptions();for(var s=[],l=0;l<e.length;l++)for(var n=this.list.querySelectorAll('[aria-selected="true"]'),a=0;a<n.length;a++)e[l]===this.getFormattedValue(n[a].getAttribute("data-value"))&&s.push(n[a]);this.triggerChange(s,null)},t.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},t.prototype.addItems=function(t,i){e.prototype.addItem.call(this,t,i),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new g.Query,this.fields)},t.prototype.removeItems=function(e,t){this.removeItem(e,t)},t.prototype.removeItem=function(e,t){var i=this,s=[],l=this.list.querySelectorAll("."+A.li);if(e){e=e instanceof Array?e:[e];var n=this.fields,a=void 0,o={},r=[];(0,v.extend)(r,[],this.jsonData);for(var h=[],u=[],p=0;p<r.length;p++){o[r[p]instanceof Object?r[p][n.value]:r[p].toString()]=p}for(var d=0;d<e.length;d++)if(a=e[d]instanceof Object?e[d][n.value]:e[d].toString(),Object.prototype.hasOwnProperty.call(o,a)){var c=o[a];s.push(l[c]),h.push(c),u.push(c)}h.sort((function(e,t){return t-e})).forEach((function(e){i.listData.splice(e,1),i.jsonData.splice(e,1)}));for(var m=u.length-1;m>=0;m--)this.updateLiCollection(u[m])}else t=t||0,s.push(l[t]),this.listData.splice(t,1),this.jsonData.splice(t,1),this.updateLiCollection(t);for(p=0;p<s.length;p++)this.ulElement.removeChild(s[p]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},t.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},t.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},t.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},t.prototype.moveTop=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(null,!1,t,!0)},t.prototype.moveBottom=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t,!1,!0)},t.prototype.moveTo=function(e,t,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),n=s?(0,v.getComponent)(s,i):this.getScopedListBox();this.moveData(this,n,!1,l,t)},t.prototype.moveAllTo=function(e,t){if(this.toolbarAction="moveAllTo",this.listData.length>0){var s=e?(0,v.getComponent)(e,i):this.getScopedListBox();this.moveAllData(this,s,!1,t)}},t.prototype.getDataList=function(){return this.jsonData},t.prototype.getSortedList=function(){var e,t;if(e=t=this.sortedData,this.fields.groupBy){e=[];for(var i=0;i<t.length;i++)t[i].isHeader||e.push(t[i])}return e},t.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},t.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},t.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach((function(t){if(!t.classList.contains(E.cssClass.disabled))if(i.selectionSettings.showCheckbox){var s=t.getElementsByClassName("e-check")[0];(!s&&e||s&&!e)&&(i.notify("updatelist",{li:t,module:"listbox"}),i.maximumSelectionLength>=i.list.querySelectorAll(".e-list-item span.e-check").length&&i.checkMaxSelection())}else e?t.classList.add(E.cssClass.selected):t.classList.remove(E.cssClass.selected)})),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var s=this.list.getElementsByTagName("li"),l=0;if(e){var n=function(){var e=a.getFormattedValue(s[l].getAttribute("data-value"));a.value.some((function(t){return t===e}))||a.value.push(a.getFormattedValue(s[l].getAttribute("data-value")))},a=this;for(l=0;l<s.length;l++)n()}else{var o=function(){var e=r.getFormattedValue(s[l].getAttribute("data-value"));r.value=r.value.filter((function(t){return t!==e}))},r=this;for(l=0;l<s.length;l++)o()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},t.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||document.querySelectorAll("ul").length>1||i!==s)for(var l=0,n=0,a=0;l<i;){if(this.value)for(;n<this.value.length;n++)e[l].getAttribute("data-value")===this.value[n]&&a++;!a&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&a&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,a=0,n=0}},t.prototype.wireEvents=function(){var e=(0,v.closest)(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;v.EventHandler.add(this.list,"click",this.clickHandler,this),v.EventHandler.add(t,"keydown",this.keyDownHandler,this),v.EventHandler.add(t,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&v.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&v.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&v.EventHandler.add(e,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},t.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&v.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},t.prototype.unwireEvents=function(){var e=(0,v.closest)(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;v.EventHandler.remove(this.list,"click",this.clickHandler),v.EventHandler.remove(t,"keydown",this.keyDownHandler),v.EventHandler.remove(t,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&v.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&v.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&v.EventHandler.remove(e,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},t.prototype.clickHandler=function(e){var t=(0,v.closest)(e.target,".e-list-item");(0,v.isNullOrUndefined)(t)||this.selectHandler(e)},t.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+A.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query;if(this.allowFiltering){var i=""===this.inputString?"contains":this.filterType,s=this.typeOfData(this.dataSource).typeof;if(null===s&&(s=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof g.DataManager||"string"!==s)&&"number"!==s){var l=this.fields.text?this.fields.text:"";t.where(l,i,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",i,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new g.Query);return t},t.prototype.setFiltering=function(){var e;if(this.initLoad||(0,v.isNullOrUndefined)(this.filterParent))return this.filterParent=this.createElement("span",{className:It.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:It.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=N.Input.createInput({element:this.filterInput,buttons:[It.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),(0,v.append)([e.container],this.filterParent),(0,v.prepend)([this.filterParent],this.list),(0,v.attributes)(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?(0,v.addClass)([this.list],"e-filter-list"):this.height.toString().indexOf("%")>0&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important"),e},t.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+It.clearIcon),this.clearFilterIconElem&&(v.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),v.EventHandler.add(this.filterInput,"input",this.onInput,this),v.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),v.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},t.prototype.selectHandler=function(e,t){var i,s=!0,l=(0,v.closest)(e.target,".e-list-item"),n=[l];if(l&&l.parentElement){if(i=[].slice.call(l.parentElement.children).indexOf(l),this.selectionSettings.showCheckbox?s=!l.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||e.metaKey||v.Browser.isDevice)&&this.isSelected(l)?(l.classList.remove(E.cssClass.selected),l.removeAttribute("aria-selected"),s=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||e.metaKey||v.Browser.isDevice)||(this.getSelectedItems().forEach((function(e){e.removeAttribute("aria-selected")})),(0,v.removeClass)(this.getSelectedItems(),E.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?n=[].slice.call(l.parentElement.children).slice(Math.min(i,this.prevSelIdx),Math.max(i,this.prevSelIdx)+1).filter((function(e){return e.classList.contains("e-list-item")})):this.prevSelIdx=[].slice.call(l.parentElement.children).indexOf(l),s?(this.selectionSettings.showCheckbox||(0,v.addClass)(n,E.cssClass.selected),n.forEach((function(e){e.setAttribute("aria-selected","true")})),this.list.setAttribute("aria-activedescendant",l.id)):n.forEach((function(e){e.setAttribute("aria-selected","false")})),t||!(this.maximumSelectionLength>(this.value&&this.value.length))&&s||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&s||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:l,e,module:"listbox"}),this.allowFiltering&&!t){var a=this.getFormattedValue(l.getAttribute("data-value"));if(s){var o=[];(0,v.extend)(o,this.value),o.push(a),this.value=o}else this.value=this.value.filter((function(e){return e!==a}));document.querySelectorAll("ul").length<2&&this.updateMainList()}this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.list&&this.checkMaxSelection()}},t.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},t.prototype.getDataByElems=function(e){for(var t=[],i=e.length,s=0;s<i;s++){var l=e[s].getAttribute("data-value"),n=this.getFormattedValue(l);t.push(this.getDataByValue(n))}return t},t.prototype.getDataByElements=function(e){var t,i=[],s=0;if(!(0,v.isNullOrUndefined)(this.listData)){var l=this.typeOfData(this.listData).typeof;if("string"===l||"number"===l||"boolean"===l)for(var n=0,a=this.listData;n<a.length;n++){for(var o=a[n],r=s,h=e.length;r<h;r++)if(t=this.getFormattedValue(e[r].getAttribute("data-value")),!(0,v.isNullOrUndefined)(o)&&o===t){s=r,i.push(o);break}if(e.length===i.length)break}else for(var u=0,p=this.listData;u<p.length;u++){for(o=p[u],r=s,h=e.length;r<h;r++)if(t=this.getFormattedValue(e[r].getAttribute("data-value")),!(0,v.isNullOrUndefined)(o)&&(0,v.getValue)(this.fields.value?this.fields.value:"value",o)===t){s=r,i.push(o);break}if(e.length===i.length)break}return i}return null},t.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox)for(var t=0,i=this.list.getElementsByClassName("e-list-item");t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))},t.prototype.toolbarClickHandler=function(e){var t=(0,v.closest)(e.target,"button");if(t){if(this.toolbarAction=t.getAttribute("data-value"),t.disabled)return;switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}}},t.prototype.moveUpDown=function(e,t,i,s,l){var n=this,a=this.getSelectedItems();if(i&&(a=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var o=this.getDataByElems(a),r={cancel:!1,items:o,eventName:this.toolbarAction};this.trigger("actionBegin",r),r.cancel||((e?a:a.reverse()).forEach((function(t){var i=Array.prototype.indexOf.call(n.ulElement.querySelectorAll(".e-list-item"),t),a=Array.prototype.indexOf.call(n.ulElement.children,t);s?((0,E.moveTo)(n.ulElement,n.ulElement,[a],0),n.changeData(a,0,i,t)):l?((0,E.moveTo)(n.ulElement,n.ulElement,[a],n.ulElement.querySelectorAll(".e-list-item").length),n.changeData(a,n.ulElement.querySelectorAll(".e-list-item").length,i,t)):((0,E.moveTo)(n.ulElement,n.ulElement,[a],e?a-1:a+2),n.changeData(a,e?a-1:a+1,e?i-1:i+1,t))})),this.trigger("actionComplete",{items:o,eventName:this.toolbarAction}),a[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},t.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},t.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},t.prototype.moveData=function(e,t,i,s,l){var n=[],a=[],o=[],r=[],h=[].slice.call(e.listData),u=[].slice.call(t.listData),p=[].slice.call(e.sortedData),d=[].slice.call(t.sortedData),c=[].slice.call(e.liCollections),m=[],f=[].slice.call(t.liCollections),g=[],y=[],C=e.getSelectedItems();s&&(C=s);var b="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate;if(e.value=[],C.length){this.removeSelected(e,C);var S,x=Array.prototype.slice.call(e.ulElement.children),I=Array.prototype.slice.call(e.ulElement.querySelectorAll(".e-list-item")),w=e.listData,O=e.sortedData,A=e.jsonData,D={};if(C.length>199)for(var k=0,N=e.listData;k<N.length;k++){var L=N[k];if(!(0,v.isNullOrUndefined)(L)){var B=e.getFormattedValue((0,v.getValue)(e.fields.value?e.fields.value:"value",L));D[B]=L}}C.forEach((function(t){if(C.length<200)S=e.getDataByElems([t])[0];else{var i=t.getAttribute("data-value"),s=e.getFormattedValue(i);S=D[s]}n.push(x.indexOf(t)),m.push(I.indexOf(t)),a.push(w.indexOf(S)),r.push(O.indexOf(S)),o.push(A.indexOf(S))})),"None"!==this.sortOrder?r.forEach((function(t){g.push(e.sortedData[t])})):o.forEach((function(t){g.push(e.jsonData[t])}));var T={cancel:!1,items:g,eventName:this.toolbarAction};if(e.trigger("actionBegin",T),T.cancel)return;var V=[];if(m.sort((function(e,t){return e-t})).reverse().forEach((function(e){V.push(c.splice(e,1)[0])})),e.liCollections=c,l){var P=f.splice(0,l);t.liCollections=P.concat(V.reverse()).concat(f)}else t.liCollections=f.concat(V.reverse());if(0===t.listData.length){var U=t.ulElement.childNodes[0];U&&t.ulElement.removeChild(U)}if(a.sort((function(e,t){return t-e})).forEach((function(e){h.splice(e,1)[0]})),r.sort((function(e,t){return t-e})).forEach((function(e){p.splice(e,1)[0]})),o.slice().reverse().forEach((function(t){y.push(e.jsonData.splice(t,1)[0])})),b)if(e.fields.groupBy){var H=e.renderItems(h,e.fields);e.updateListItems(H,e.ulElement)}else C.forEach((function(e){(0,v.detach)(e)}));else(0,E.moveTo)(e.ulElement,t.ulElement,n,l),e.trigger("actionComplete",{items:g,eventName:this.toolbarAction});t.mainList.childElementCount!==t.jsonData.length&&(t.mainList=t.ulElement);var F=[].slice.call(t.jsonData);d=[].slice.call(t.sortedData),this.selectNextList(C,m,a,e),i&&this.list.focus(),e.listData=h,e.sortedData=p,l=l||u.length;for(var W=g.length-1;W>=0;W--)u.splice(l,0,g[W]),F.splice(l,0,g[W]),d.splice(l,0,g[W]);if(t.listData=u,t.jsonData=F,t.sortedData=d,b){H=t.renderItems(u,t.fields);t.updateListItems(H,t.ulElement),t.setSelection(),e.trigger("actionComplete",{items:g,eventName:this.toolbarAction})}e.updateSelectedOptions(),0===e.listData.length&&e.l10nUpdate()}if(1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value"))),e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction){var q=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],M="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo";if(q)q.querySelector('[data-value="'+M+'"]').disabled=!0}},t.prototype.selectNextList=function(e,t,i,s){var l,n,a=s.ulElement.querySelectorAll(".e-list-item").length,o=-1;1===e.length&&a&&!s.selectionSettings.showCheckbox&&(n=a<=t[0]?a-1:t[0],l=s.ulElement.querySelectorAll(".e-list-item")[n],(o=s.getValidIndex(l,n,a===i[0]?38:40))>-1&&s.ulElement.querySelectorAll(".e-list-item")[o].classList.add(E.cssClass.selected))},t.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},t.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},t.prototype.moveAllData=function(e,t,i,s){var l=[].slice.call(t.listData),n=[].slice.call(t.jsonData),a="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate,o=[],r=[],h=[];this.removeSelected(e,e.getSelectedItems());var u=[].slice.call(e.listData),p={cancel:!1,items:u,eventName:this.toolbarAction};if(e.trigger("actionBegin",p),!p.cancel){if(0===t.listData.length){var d=t.ulElement.childNodes[0];d&&t.ulElement.removeChild(d)}e.listData.length>0&&(h=Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number));for(var c=e.ulElement.childNodes,m=e.ulElement.childElementCount,f=[],v=0;v<m;v++){var g=c[v];g.classList.contains("e-disabled")?(o.push(g),null!=this.sortOrder?r.push(e.sortedData[v]):r.push(e.listData[v])):f.push(v)}h=f,(0,E.moveTo)(e.ulElement,t.ulElement,h,s),e.trigger("actionComplete",{items:u,eventName:this.toolbarAction}),i&&this.list.focus(),s=s||l.length;for(v=0;v<h.length;v++)null!=this.sortOrder?l.splice(s+v,0,e.sortedData[h[v]]):l.splice(s+v,0,e.listData[h[v]]);for(v=0;v<h.length;v++)n.splice(s+v,0,e.jsonData[h[v]]);var y=[];o.length>0?(e.liCollections=o,y=[].slice.call(e.liCollections)):(y=[].slice.call(e.liCollections),e.liCollections=[]);var C=[].slice.call(t.liCollections);if(s){var b=C.splice(0,s);t.liCollections=b.concat(y).concat(C)}else t.liCollections=C.concat(y);e.value=[];var S=(l=(l=l.filter((function(e){return void 0!==e}))).filter((function(e){return!0!==e.isHeader}))).filter((function(e){return-1===t.jsonData.indexOf(e)}));for(v=0;v<S.length;v++)t.jsonData.splice(s+v,0,S[v]);if(t.listData=l,e.listData.length===e.jsonData.length)e.listData=e.sortedData=e.jsonData=r;else if(e.allowFiltering){var x=[];if(o.length>0){for(v=0;v<o.length;v++)x.push(e.getDataByValue(o[v].getAttribute("data-value")));e.listData=e.listData.filter((function(e){return!x.some((function(t){return e===t}))}))}for(v=0;v<e.listData.length;v++)for(var I=0;I<e.jsonData.length;I++)e.listData[v]===e.jsonData[I]&&e.jsonData.splice(I,1);o.length>0?(e.listData=x,e.sortedData=[]):e.listData=e.sortedData=[]}if(a){var w=t.renderItems(l,t.fields);t.updateListItems(w,t.ulElement)}else t.sortedData=l;if(e.updateSelectedOptions(),o.length>0)this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0;0===e.listData.length&&0===o.length&&e.l10nUpdate()}},t.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),n=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData),o=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),r=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),n.splice(i,0,n.splice(o,1)[0]),a.splice(t,0,a.splice(r,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=n,this.liCollections=h,this.sortedData=a},t.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach((function(t){e.push((0,v.closest)(t,".e-list-item"))})):e=[].slice.call(this.ulElement.getElementsByClassName(E.cssClass.selected)),e},t.prototype.getScopedListBox=function(){var e,t=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach((function(i){(0,v.getComponent)(i,t.getModuleName())&&(e=(0,v.getComponent)(i,t.getModuleName()))})),e},t.prototype.getGrabbedItems=function(e){for(var t=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(e.target.getAttribute("data-value"))){t=!0;break}if(t)for(i=0;i<this.value.length;i++)for(var s=this.list.querySelectorAll('[aria-selected="true"]'),l=0;l<s.length;l++)this.value[i]===this.getFormattedValue(s[l].getAttribute("data-value"))&&s[l].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},t.prototype.getDragArgs=function(e,t){var i=this.getGrabbedItems(e);return i.length?t&&i.push(e.target):i=[e.target],{elements:i,event:e.event,items:this.getDataByElems(i)}},t.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},t.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&(!this.allowFiltering||this.allowFiltering&&e.target!==this.filterInput)){if(e.target&&e.target.className.indexOf("e-edit-template")>-1)return;if(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length)this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey});else if(65===e.keyCode&&e.ctrlKey&&"Multiple"===this.selectionSettings.mode)this.selectAll();else if((38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey)this.moveUpDown(38===e.keyCode,!0);else if(!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey)37!==e.keyCode&&39!==e.keyCode&&"KeyA"!==e.code&&this.upDownKeyHandler(e);else{var t=this.tBListBox||this.getScopedListBox();39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0)}}else this.allowFiltering&&(40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e))},t.prototype.upDownKeyHandler=function(e){var t=this.ulElement,i=40===e.keyCode||36===e.keyCode?0:t.childElementCount-1,s=t.getElementsByClassName("e-focused")[0]||t.getElementsByClassName(E.cssClass.selected)[0];if(s){if(35!==e.keyCode&&36!==e.keyCode&&(i=Array.prototype.indexOf.call(t.children,s),40===e.keyCode?i++:i--,i<0||i>t.childElementCount-1))return;(0,v.removeClass)([s],"e-focused")}var l=t.children[i];if(l){if(-1===(i=this.getValidIndex(l,i,e.keyCode)))return void(0,v.addClass)([s],"e-focused");if(t.children[i].focus(),t.children[i].classList.add("e-focused"),e.ctrlKey&&(this.selectionSettings.showCheckbox||!e.shiftKey||36!==e.keyCode&&35!==e.keyCode)||this.selectHandler({target:t.children[i],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0),this.selectionSettings.showCheckbox&&e.ctrlKey&&e.shiftKey&&(36===e.keyCode||35===e.keyCode))for(var n=Array.prototype.indexOf.call(t.children,s),a="Home"===e.code?0:n,o="Home"===e.code?n:t.children.length-1,r=a;r<=o;r++){var h=t.children[r];this.notify("updatelist",{li:h,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},module:"listbox"})}}},t.prototype.KeyUp=function(e){var t=this;if(this.allowFiltering&&e.ctrlKey&&65===e.keyCode)e.preventDefault();else{var i=String.fromCharCode(e.keyCode).match(/\w/);if((0,v.isNullOrUndefined)(i)||(this.isValidKey=!0),this.isBackSpace=8===e.keyCode,this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,i,l){s.cancel||(t.isFiltered=!0,t.remoteFilterAction=!0,t.preventDefActionFilter=s.preventDefaultAction,t.dataUpdater(e,i,l),t.preventDefActionFilter=!1)},event:e,cancel:!1};this.trigger("filtering",s,(function(e){t.isDataFetched=!1,e.cancel||""!==t.filterInput.value&&t.isFiltered||(t.preventDefActionFilter=!1,e.cancel||t.isCustomFiltering||e.preventDefaultAction||(t.inputString=t.filterInput.value,t.filteringAction(t.jsonData,new g.Query,t.fields),t.toolbarSettings.items.length>0&&t.updateToolBarState()),t.isFiltered||t.isCustomFiltering||e.preventDefaultAction||t.dataUpdater(t.jsonData,new g.Query,t.fields))}))}}},t.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},t.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},t.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],(0,v.isNullOrUndefined)(this.targetInputElement)?null:this.targetInputElement.value},t.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;if(this.targetElement()&&""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(s=this.renderItems(this.listData,i)),this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},t.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},t.prototype.resizeHandler=function(){!this.list||this.cssClass&&this.cssClass.indexOf("e-horizontal-listbox")>-1||this.list.getElementsByClassName("e-filter-parent").length>0&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},t.prototype.getValidIndex=function(e,t,i){var s=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(E.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===s.childElementCount?-1:(((e=s.childNodes[t]).classList.contains("e-disabled")||e.classList.contains(E.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},t.prototype.updateSelectedOptions=function(){var e=this,t=[],i=[];if((0,v.extend)(i,this.value),this.getSelectedItems().forEach((function(i){i.classList.contains("e-grabbed")||t.push(e.getFormattedValue(i.getAttribute("data-value")))})),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var s=0;s<t.length;s++)i.indexOf(t[s])>-1||i.push(t[s]);this.setProperties({value:i},!0)}else this.setProperties({value:t},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},t.prototype.clearSelection=function(e){var t,i=this;(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox)&&this.getSelectedItems().forEach((function(s){t=i.getFormattedValue(s.getAttribute("data-value")),e.indexOf(t)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.removeAttribute("aria-selected"))}))},t.prototype.setSelection=function(e,t,i,s){var l,n,a=this;void 0===e&&(e=this.value),void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===s&&(s=!0),e&&e.forEach((function(e){var o;"string"==typeof(o=i?a.getValueByText(e):e)?(o=o.split("\\").join("\\\\"),l=a.list.querySelector('[data-value="'+o.replace(/"/g,'\\"')+'"]')):l=a.list.querySelector('[data-value="'+o+'"]'),l&&(n=a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?l.getElementsByClassName("e-frame")[0].classList.contains("e-check"):l.classList.contains("e-selected"),(!t&&n||t&&!n&&l)&&(a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?(a.notify("updatelist",{li:l,module:"listbox"}),s&&l.focus()):t&&!l.classList.contains("e-disabled")?(l.classList.add(E.cssClass.selected),l.setAttribute("aria-selected","true"),s&&l.focus()):(l.classList.remove(E.cssClass.selected),l.removeAttribute("aria-selected"))))})),this.updateSelectTag()},t.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(!(0,v.isNullOrUndefined)(e)){if(e.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)t+="<option selected>"+this.value[i]+"</option>";e.innerHTML+=t;for(i=0,s=e.childNodes.length;i<s;i++)e.childNodes[i].setAttribute("value",this.value[i].toString())}this.checkSelectAll()}},t.prototype.checkDisabledState=function(e){return(0,v.isNullOrUndefined)(e.ulElement)?!(!(0,v.isNullOrUndefined)(this.dataSource)&&(0,v.isNullOrUndefined)(this.dataSource.length)):e.ulElement.querySelectorAll(".e-disabled").length>0?e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length:0===e.ulElement.querySelectorAll("."+E.cssClass.li).length},t.prototype.updateToolBarState=function(){var e=this;if(this.toolbarSettings.items.length){var t=this.getScopedListBox(),i=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0];this.toolbarSettings.items.forEach((function(s){var l=i.querySelector('[data-value="'+s+'"]');switch(s){case"moveAllTo":l.disabled=e.checkDisabledState(e);break;case"moveAllFrom":l.disabled=e.checkDisabledState(t);break;case"moveFrom":l.disabled=!t.value||!t.value.length;break;case"moveUp":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[0]));break;case"moveDown":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[e.ulElement.childElementCount-1]));break;default:l.disabled=!e.value||!e.value.length}}))}},t.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},t.prototype.showCheckbox=function(e){var t=0,i=this.list.lastElementChild.querySelectorAll("li"),s=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]){var l=new v.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=l.getConstant("selectAllText"),this.unSelectAllText=l.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]);t<s;t++)i[t].classList.contains("e-list-item")&&i[t].removeChild(i[t].getElementsByClassName("e-checkbox-wrapper")[0]),i[t].hasAttribute("aria-selected")&&i[t].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},t.prototype.isSelected=function(e){return!(0,v.isNullOrUndefined)(e)&&(e.classList.contains(E.cssClass.selected)||null!==e.querySelector(".e-check"))},t.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},t.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},t.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},t.prototype.getModuleName=function(){return"listbox"},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.getLocaleName=function(){return"listbox"},t.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),(0,v.detach)(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),e.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},t.prototype.onPropertyChanged=function(t,i){var s=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,t,i),this.setUpdateInitial(["fields","query","dataSource"],t);for(var l=0,n=Object.keys(t);l<n.length;l++){switch(n[l]){case"cssClass":i.cssClass&&(0,v.removeClass)([s],i.cssClass.split(" ")),t.cssClass&&(0,v.addClass)([s],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":(0,v.removeClass)(this.list.querySelectorAll("."+E.cssClass.selected),E.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":t.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&(0,v.getComponent)(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,(0,v.removeClass)([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&N.Input.setPlaceholder(t.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&((0,v.getComponent)(this.ulElement,"sortable").scope=t.scope),this.toolbarSettings.items.length&&(i.scope&&((0,v.getComponent)(document.querySelector(i.scope),this.getModuleName()).tBListBox=null),t.scope&&((0,v.getComponent)(document.querySelector(t.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var a=void 0,o=t.toolbarSettings.position,r=this.getToolElem();o&&((0,v.removeClass)([s],["e-right","e-left"]),s.classList.add("e-"+o.toLowerCase()),"Left"===o?s.insertBefore(r,this.list):s.appendChild(r)),t.toolbarSettings.items&&(i.toolbarSettings.items=(0,v.isNullOrUndefined)(i.toolbarSettings.items)?[]:i.toolbarSettings.items,i.toolbarSettings&&i.toolbarSettings.items.length&&((a=this.list.parentElement).parentElement.insertBefore(this.list,a),(0,v.detach)(a)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var h=t.selectionSettings.showSelectAll,u=t.selectionSettings.showCheckbox;if(!(0,v.isNullOrUndefined)(h)){if(this.showSelectAll=h,this.showSelectAll){var p=new v.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=p.getConstant("selectAllText"),this.unSelectAllText=p.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}(0,v.isNullOrUndefined)(u)||this.showCheckbox(u),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}}},bt([(0,v.Property)("")],t.prototype,"cssClass",void 0),bt([(0,v.Property)([])],t.prototype,"value",void 0),bt([(0,v.Property)("")],t.prototype,"height",void 0),bt([(0,v.Property)(!0)],t.prototype,"enabled",void 0),bt([(0,v.Property)(!1)],t.prototype,"enablePersistence",void 0),bt([(0,v.Property)(!1)],t.prototype,"allowDragAndDrop",void 0),bt([(0,v.Property)(1e3)],t.prototype,"maximumSelectionLength",void 0),bt([(0,v.Property)(!1)],t.prototype,"allowFiltering",void 0),bt([(0,v.Property)("")],t.prototype,"scope",void 0),bt([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),bt([(0,v.Property)(null)],t.prototype,"filterBarPlaceholder",void 0),bt([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),bt([(0,v.Event)()],t.prototype,"beforeItemRender",void 0),bt([(0,v.Event)()],t.prototype,"filtering",void 0),bt([(0,v.Event)()],t.prototype,"select",void 0),bt([(0,v.Event)()],t.prototype,"change",void 0),bt([(0,v.Event)()],t.prototype,"beforeDrop",void 0),bt([(0,v.Event)()],t.prototype,"dragStart",void 0),bt([(0,v.Event)()],t.prototype,"drag",void 0),bt([(0,v.Event)()],t.prototype,"drop",void 0),bt([(0,v.Event)()],t.prototype,"dataBound",void 0),bt([(0,v.Property)(null)],t.prototype,"groupTemplate",void 0),bt([(0,v.Property)("Request failed")],t.prototype,"actionFailureTemplate",void 0),bt([(0,v.Property)(1e3)],t.prototype,"zIndex",void 0),bt([(0,v.Property)(!1)],t.prototype,"ignoreAccent",void 0),bt([(0,v.Complex)({},Et)],t.prototype,"toolbarSettings",void 0),bt([(0,v.Complex)({},St)],t.prototype,"selectionSettings",void 0),t=i=bt([v.NotifyPropertyChanges],t)}(D),It={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"},wt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ot=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(l=e[o])&&(a=(n<3?l(a):n>3?l(t,i,a):l(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},At=function(e){function t(t,i){return e.call(this,t,i)||this}return wt(t,e),t.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"minLength":this.minLength=e.minLength;break;case"suffixText":this.suffixText=e.suffixText;break;case"allowSpaces":this.allowSpaces=e.allowSpaces;break;case"mentionChar":this.mentionChar=e.mentionChar;break;case"showMentionChar":this.showMentionChar=e.showMentionChar;break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass)}}},t.prototype.updateCssClass=function(e,t){(0,v.isNullOrUndefined)(t)||(t=t.replace(/\s+/g," ").trim()),(0,v.isNullOrUndefined)(e)||(e=e.replace(/\s+/g," ").trim()),this.setCssClass(e,[this.inputElement],t),this.popupObj&&this.setCssClass(e,[this.popupObj.element],t)},t.prototype.setCssClass=function(e,t,i){(0,v.isNullOrUndefined)(i)||""===i||(0,v.removeClass)(t,i.split(" ")),(0,v.isNullOrUndefined)(e)||""===e||(0,v.addClass)(t,e.split(" "))},t.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},t.prototype.preRender=function(){this.initializeData(),e.prototype.preRender.call(this)},t.prototype.render=function(){var e="string"==typeof this.target;this.inputElement=(0,v.isNullOrUndefined)(this.target)?this.element:this.checkAndUpdateInternalComponent(e?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),(0,v.addClass)([this.inputElement],["e-mention"]),(0,v.isNullOrUndefined)(this.target)&&(0,v.addClass)([this.inputElement],["e-editable-element"])),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},t.prototype.wireEvent=function(){v.EventHandler.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},t.prototype.unWireEvent=function(){v.EventHandler.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},t.prototype.bindCommonEvent=function(){v.Browser.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},t.prototype.hideSpinner=function(){this.hideWaitingSpinner()},t.prototype.hideWaitingSpinner=function(){(0,v.isNullOrUndefined)(this.spinnerElement)||(0,k.hideSpinner)(this.spinnerElement),(0,v.isNullOrUndefined)(this.spinnerTemplate)||(0,v.isNullOrUndefined)(this.spinnerTemplateElement)||(0,v.detach)(this.spinnerTemplateElement)},t.prototype.checkAndUpdateInternalComponent=function(e){if(!this.isVue&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===e.nodeName&&e.classList.contains("e-rte-hidden")){var t=e.parentElement;if(t&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content")}return e&&e.parentElement&&e.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),e},t.prototype.showWaitingSpinner=function(){(0,v.isNullOrUndefined)(this.popupObj)||((0,v.isNullOrUndefined)(this.spinnerTemplate)&&(0,v.isNullOrUndefined)(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,(0,k.createSpinner)({target:this.spinnerElement,width:v.Browser.isDevice?"16px":"14px"},this.createElement),(0,k.showSpinner)(this.spinnerElement)),(0,v.isNullOrUndefined)(this.spinnerTemplate)||this.setSpinnerTemplate())},t.prototype.keyDownHandler=function(e){var t=!0;switch(e.keyCode){case 38:e.action=e.altKey?"hide":"up";break;case 40:e.action=e.altKey?"open":"down";break;case 33:e.action="pageUp";break;case 34:e.action="pageDown";break;case 36:e.action="home";break;case 35:e.action="end";break;case 9:e.action=e.shiftKey?"close":"tab";break;case 27:e.action="escape";break;case 32:e.action="space";break;case 13:e.action="enter";break;default:t=!1}t&&this.keyActionHandler(e)},t.prototype.keyActionHandler=function(e){var t="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action,i="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||i||"escape"===e.action||"space"===e.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!((0,v.isNullOrUndefined)(this.list)||!(0,v.isNullOrUndefined)(this.liCollections)&&t&&0===this.liCollections.length||this.isRequested))switch("escape"===e.action&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,e.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(e);break;case"tab":if(this.isPopupOpen){e.preventDefault();var s=this.list.querySelector("."+A.selected);s&&(this.isSelected=!0,this.setSelection(s,e)),this.isPopupOpen&&this.hidePopup(e)}break;case"enter":this.isPopupOpen&&(e.preventDefault(),this.popupObj&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,e,!1,!0));break;case"escape":this.isPopupOpen&&this.hidePopup(e)}},t.prototype.updateUpDownAction=function(e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var t,i=this.list.querySelector("."+A.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else if(!(0,v.isNullOrUndefined)(this.liCollections)){var s=this.list.querySelector("."+A.selected);if(!(0,v.isNullOrUndefined)(s)){var l=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l)}var n,a="down"===e.action?this.activeIndex+1:this.activeIndex-1;n="down"===e.action&&(0,v.isNullOrUndefined)(this.activeIndex)?0:this.liCollections.length-1,a=a<0?this.liCollections.length-1:a===this.liCollections.length?0:a;var o=(0,v.isNullOrUndefined)(this.activeIndex)?this.liCollections[n]:this.liCollections[a];(0,v.isNullOrUndefined)(o)||this.setSelection(o,e)}for(a=0;a<this.liCollections.length;a++)if(this.liCollections[a].classList.contains(A.focus)||this.liCollections[a].classList.contains(A.selected)){t=a;break}null!=t&&this.isDisabledElement(this.liCollections[t])&&this.updateUpDownAction(e),this.isPopupOpen&&e.preventDefault()}},t.prototype.isSelectFocusItem=function(e){return!(0,v.isNullOrUndefined)(e)},t.prototype.unBindCommonEvent=function(){v.Browser.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},t.prototype.onKeyUp=function(e){var t;if(this.isUpDownKey&&this.isPopupOpen&&229===e.keyCode)this.isUpDownKey=!1;else{this.isTyped="Enter"!==e.code&&"Space"!==e.code&&"ArrowDown"!==e.code&&"ArrowUp"!==e.code;var i=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image"));document.activeElement===this.inputElement||i||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),t=this.range.startContainer.textContent.split(""));var s=this.getTextRange(),l=this.getLastLetter(s),n=this.mentionChar.toString()+this.mentionChar.toString(),a=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),o=new RegExp("[a-zA-Z]","g");"Shift"!==e.key&&37!==e.keyCode&&39!==e.keyCode&&(this.beforePopupOpen&&this.isPopupOpen&&l===n?this.hidePopup():!s||!l||"Enter"===e.code||27===e.keyCode||l.match(a)&&l.match(a).length>1||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&this.range.startContainer.textContent.split("").length>0&&(1===t.length||-1===t[t.length-2].indexOf("")||1===this.range.startContainer.nodeType)?this.isPopupOpen&&this.allowSpaces&&s&&""!==s.trim()&&o.test(s)&&-1!==s.indexOf(this.mentionChar)&&!this.isMatchedText()&&s.length>1&&" "!==s.replace(/\u00A0/g," ").charAt(s.length-2)&&this.list&&this.list.querySelectorAll("ul").length>0&&"Enter"!==e.code?(this.queryString=s.substring(s.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):!this.isPopupOpen||this.allowSpaces&&l||"ArrowDown"===e.code||"ArrowUp"===e.code?"Backspace"!==e.key&&"Delete"!==e.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0):(l.includes(this.mentionChar)&&(this.queryString=l.replace(this.mentionChar,"")),this.mentionChar.charCodeAt(0)!==l.charCodeAt(0)||""===this.queryString||38===e.keyCode||40===e.keyCode||this.lineBreak?0===l.indexOf(this.mentionChar)&&!this.isPopupOpen&&8!==e.keyCode&&(!this.popupObj||(0,v.isNullOrUndefined)(this.target)&&!document.body.contains(this.popupObj.element)||!(0,v.isNullOrUndefined)(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(e),this.resetList(this.dataSource,this.fields),(0,v.isNullOrUndefined)(this.list)&&this.initValue(),!this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&s&&""!==s.trim()&&s.replace(" "," ").lastIndexOf(" ")<s.length-1&&38!==e.keyCode&&40!==e.keyCode&&8!==e.keyCode&&(this.mentionChar.charCodeAt(0)===l.charCodeAt(0)||this.liCollections&&this.liCollections.length>0)?(this.queryString=s.substring(s.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):""===this.queryString&&this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.mentionChar.charCodeAt(0)===l.charCodeAt(0)&&(this.searchLists(e),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(e),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(this.isContentEditable(this.inputElement)?this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==e.keyCode&&this.showPopup():this.showPopup())),this.isListResetted=!1))}},t.prototype.isMatchedText=function(){for(var e=!1,t=0;t<(this.liCollections&&this.liCollections.length);t++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[t].getAttribute("data-value").toLowerCase()&&(e=!0);return e},t.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},t.prototype.searchLists=function(t){var i=this;if(this.isDataFetched=!1,(0,v.isNullOrUndefined)(this.list)&&(e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"!==t.type&&(40===t.keyCode||38===t.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields);this.isSelected=!1,this.activeIndex=null;var s={preventDefaultAction:!1,text:this.queryString,updateData:function(e,t,l){s.cancel||(i.isFiltered=!0,i.filterAction(e,t,l))},cancel:!1};this.trigger("filtering",s,(function(e){e.cancel||i.isFiltered||e.preventDefaultAction||i.filterAction(i.dataSource,null,i.fields)}))},t.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(e,i,t),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},t.prototype.onActionComplete=function(t,i,s,l){if(e.prototype.onActionComplete.call(this,t,i,s),this.isActive){if(!(0,v.isNullOrUndefined)(t))(0,v.attributes)(t,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&this.cssClass.indexOf("e-slash-menu")>-1&&(t.id=this.inputElement.id+"_slash_menu_options");var n=this.fields.disabled?t.querySelector("."+A.li+":not(.e-disabled)"):t.querySelector("."+A.li);if(n){n.classList.add(A.selected),this.selectedLI=n;var a=this.getFormattedValue(n.getAttribute("data-value"));this.selectEventCallback(n,this.getDataByValue(a),a,!0)}this.beforePopupOpen&&this.isPopupOpen&&((0,v.isNullOrUndefined)(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())}},t.prototype.setDataIndex=function(){for(var e=0;this.liCollections&&e<this.liCollections.length;e++)this.liCollections[e].setAttribute("data-index",e.toString())},t.prototype.listOption=function(t,i){var s=this,l=e.prototype.listOption.call(this,t,i);if((0,v.isNullOrUndefined)(l.itemCreated))l.itemCreated=function(e){s.highlight&&(s.inputElement.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout((function(){d(e.item,s.queryString,s.ignoreCase,s.filterType)}),0):d(e.item,s.queryString,s.ignoreCase,s.filterType))};else{var n=l.itemCreated;l.itemCreated=function(e){s.highlight&&d(e.item,s.queryString,s.ignoreCase,s.filterType),n.apply(s,[e])}}return l},t.prototype.elementValue=function(){return this.isContentEditable(this.inputElement)?this.inputElement.textContent.replace(this.mentionChar,""):this.inputElement.value.replace(this.mentionChar,"")},t.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new g.Query,i=""!==this.queryString||(0,v.isNullOrUndefined)(this.elementValue())?this.filterType:"equal",s=""!==this.queryString||(0,v.isNullOrUndefined)(this.elementValue())?this.queryString:this.elementValue();if(this.isFiltered)return t;if(null!==this.queryString&&""!==this.queryString){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof g.DataManager||"string"!==l)&&"number"!==l){var n=(0,v.isNullOrUndefined)(this.fields.text)?"":this.fields.text;t.where(n,i,s,this.ignoreCase,this.ignoreAccent)}else t.where("",i,s,this.ignoreCase,this.ignoreAccent)}if(!(0,v.isNullOrUndefined)(this.suggestionCount)){if(25!==this.suggestionCount)for(var a=0;a<t.queries.length;a++)"onTake"===t.queries[a].fn&&t.queries.splice(a,1);t.take(this.suggestionCount)}return t},t.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++){this.ulElement.querySelector(".e-active")||(m(this.liCollections[e]),d(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType))}},t.prototype.getTextRange=function(){var e;if(this.isContentEditable(this.inputElement)){if(this.range){var t=this.range.startContainer;if(!(0,v.isNullOrUndefined)(t)){var i=t.textContent,s=this.range.startOffset;i&&s>=0&&(e=i.substring(0,s))}}}else{var l=this.inputElement;if(!(0,v.isNullOrUndefined)(l)){var n=l.selectionStart;l.value&&n>=0&&(e=l.value.substring(0,n))}}return e},t.prototype.getLastLetter=function(e){if((0,v.isNullOrUndefined)(e))return"";var t=(e.indexOf("​")>-1?e.replace(/\u200B/g,"").replace(/\u00A0/g," "):e.replace(/\u00A0/g," ")).split(/\s+/);return t[t.length-1].trim()},t.prototype.isContentEditable=function(e){return e&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName},t.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),(0,v.isNullOrUndefined)(this.list)&&this.initValue(),this.renderPopup(),(0,v.attributes)(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},t.prototype.hidePopup=function(e){this.removeSelection(),this.closePopup(0,e)},t.prototype.closePopup=function(e,t){var i=this;if(this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){v.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1;var s={name:"FadeOut",duration:100,delay:e||0},l={popup:this.popupObj,cancel:!1,animation:s,event:t||null};this.trigger("closed",l,(function(e){!e.cancel&&i.popupObj&&(i.isPopupOpen?i.popupObj.hide(new v.Animation(e.animation)):i.destroyPopup())}))}},t.prototype.renderPopup=function(){var e=this;this.trigger("beforeOpen",{cancel:!1},(function(t){if(t.cancel)e.beforePopupOpen=!1;else{var i,s;if((0,v.isNullOrUndefined)(e.target)?i=e.createElement("div",{id:e.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=e.cssClass?e.cssClass:"")}):(i=e.element,null!=e.cssClass&&(0,v.addClass)([i],e.cssClass.split(" "))),e.isRTE&&e.cssClass&&e.cssClass.indexOf("e-slash-menu")>-1?i.id=e.inputElement.id+"_slash_menu_popup":(0,v.isNullOrUndefined)(e.target)||(i.id=e.inputElement.id+"_popup"),e.listHeight=(0,v.formatUnit)(e.popupHeight),!(0,v.isNullOrUndefined)(e.list.querySelector("li"))&&!e.initRemoteRender){var l=e.list.querySelector("."+A.focus);if(!(0,v.isNullOrUndefined)(l)){e.selectedLI=l;var n=e.getFormattedValue(l.getAttribute("data-value"));e.selectEventCallback(l,e.getDataByValue(n),n,!0)}}if((0,v.append)([e.list],i),e.inputElement.parentElement){var a=e.inputElement.parentElement.closest(".e-richtexteditor");a&&i.firstElementChild&&i.firstElementChild.childElementCount>0&&(i.firstElementChild.setAttribute("aria-owns",a.id),(0,v.addClass)([i],"e-rte-elements"))}e.popupObj&&document.body.contains(e.popupObj.element)&&(document.contains(i)||!(0,v.isNullOrUndefined)(e.target))||document.body.appendChild(i),i.style.visibility="hidden",e.setHeight(i);e.initializePopup(i,0,0),e.checkCollision(i),i.style.visibility="visible";var o=i.parentElement.offsetWidth-i.offsetWidth,r=i.offsetHeight;(0,v.addClass)([i],["e-mention","e-popup","e-popup-close"]),(0,v.isNullOrUndefined)(e.list)||(e.unWireListEvents(),e.wireListEvents()),e.selectedElementID=e.selectedLI?e.selectedLI.id:null,(0,v.attributes)(e.inputElement,{"aria-owns":e.inputElement.id+"_options","aria-activedescendant":e.selectedElementID}),null==e.selectedElementID&&e.inputElement.removeAttribute("aria-activedescendant");e.beforePopupOpen=!0;var h={popup:e.popupObj,cancel:!1,animation:{name:"FadeIn",duration:100}};e.trigger("opened",h,(function(t){if(t.cancel)e.beforePopupOpen=!1,e.destroyPopup();else{if(e.renderReactTemplates(),e.popupObj&&e.popupObj.show(new v.Animation(t.animation),1e3===e.zIndex?e.inputElement:null),(0,v.isNullOrUndefined)(e.getTriggerCharPosition()))return;s=e.getCoordinates(e.inputElement,e.getTriggerCharPosition()),e.isCollided?(e.collision.length>0&&e.collision.indexOf("right")>-1&&-1===e.collision.indexOf("bottom")?i.style.cssText="top: ".concat(s.top.toString(),"px;\n left: ").concat(o.toString(),"px;\nposition: absolute;\n display: block;"):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&-1===e.collision.indexOf("right")?(i.style.left=(0,v.formatUnit)(s.left),i.style.top=(0,v.formatUnit)(s.top-parseInt(r.toString(),10))):e.collision&&e.collision.length>0&&e.collision.indexOf("bottom")>-1&&e.collision.indexOf("right")>-1?(i.style.left=(0,v.formatUnit)(o),i.style.top=(0,v.formatUnit)(s.top-parseInt(r.toString(),10))):(i.style.left=(0,v.formatUnit)(s.left),i.style.top=(0,v.formatUnit)(s.top-parseInt(e.popupHeight.toString(),10))),e.isCollided=!1,e.collision=[]):i.style.cssText="top: ".concat(s.top.toString(),"px;\n left: ").concat(s.left.toString(),"px;\nposition: absolute;\n display: block;"),i.style.width="100%"===e.popupWidth||(0,v.isNullOrUndefined)(e.popupWidth)?"auto":(0,v.formatUnit)(e.popupWidth),e.setHeight(i),i.style.zIndex=1e3===e.zIndex?(0,k.getZindexPartial)(i).toString():e.zIndex.toString()}}))}}))},t.prototype.setHeight=function(e){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",e.style.maxHeight=(0,v.formatUnit)(this.popupHeight)):e.style.height="auto"},t.prototype.checkCollision=function(e){if(!v.Browser.isDevice||v.Browser.isDevice&&"mention"!==this.getModuleName()){var t=this.getCoordinates(this.inputElement,this.getTriggerCharPosition());this.collision=(0,k.isCollide)(e,null,t.left,t.top),this.collision.length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision()}},t.prototype.getTriggerCharPosition=function(){var e,t=this.getTextRange();if(null!=t){e=0;var i=t.lastIndexOf(this.mentionChar);i>=e&&(e=i)}return e||0},t.prototype.initializePopup=function(e,t,i){var s=this;this.popupObj=new k.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){s.destroyPopup()},open:function(){v.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0,s.setDataIndex()}})},t.prototype.setWidth=function(){var e=(0,v.formatUnit)(this.popupWidth);e.indexOf("%")>-1&&(e=(this.inputElement.offsetWidth*parseFloat(e)/100).toString()+"px");return e},t.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),(0,v.isNullOrUndefined)(this.target)?(0,v.detach)(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},t.prototype.onDocumentClick=function(e){var t=e.target;!(0,v.isNullOrUndefined)(this.popupObj)&&(0,v.closest)(t,"#"+this.popupObj.element.id)||this.hidePopup(e)},t.prototype.getCoordinates=function(e,t){var i,s,l,n,a,o,r;if(this.isContentEditable(this.inputElement)){var h=this.getTriggerCharPosition();n=this.range,l=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(l.setStart(n.startContainer,h),l.setEnd(n.startContainer,h)):(l.setStart(n.startContainer,n.startOffset),l.setEnd(n.startContainer,n.endOffset)),this.isTyped=!1,l.collapse(!1),r=0===l.getBoundingClientRect().top?l.startContainer.getClientRects()[0]:l.getBoundingClientRect()}else i=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(i),o=getComputedStyle(e),i.style.position="absolute",i.style.visibility="hidden",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"].forEach((function(e){i.style[e]=o[e]})),i.textContent=e.value.substring(0,t),"INPUT"===this.inputElement.nodeName&&(i.textContent=i.textContent.replace(/\s/g," ")),(s=this.createElement("span")).textContent=e.value.substring(t)||".",i.appendChild(s),r=e.getBoundingClientRect();var u=r.top,p=r.left,d=document.querySelectorAll("iframe");if(d.length>0)for(var c=0;c<d.length;c++){var m=d[c];if(m.contentDocument&&m.contentDocument.contains(e)){var f=m.getBoundingClientRect();u+=f.top,p+=f.left}}var g=document.documentElement,y=(window.pageXOffset||g.scrollLeft)-(g.clientLeft||0),C=(window.pageYOffset||g.scrollTop)-(g.clientTop||0),b=0;if(!(0,v.isNullOrUndefined)(l)&&0===l.getBoundingClientRect().top)for(c=0;c<this.range.startContainer.childNodes.length;c++)if(this.range.startContainer.childNodes[c].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[c].textContent.trim())b+=this.range.startContainer.childNodes[c].getClientRects()[0].width;else if(""!==this.range.startContainer.childNodes[c].textContent){var S=document.createElement("span");S.innerHTML=this.range.startContainer.childNodes[c].nodeValue,document.body.appendChild(S);var E=S.offsetWidth;document.body.removeChild(S),b+=E}return this.isContentEditable(this.inputElement)?a=this.collision&&this.collision.length>0&&this.collision.indexOf("right")>-1&&-1===this.collision.indexOf("bottom")?{top:u+C+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:p+y+b}:{top:u+C+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:p+y+b}:(a={top:u+C+s.offsetTop+parseInt(o.borderTopWidth,10)+parseInt(o.fontSize,10)+3-e.scrollTop-(this.isCollided?10:0),left:p+y+s.offsetLeft+parseInt(o.borderLeftWidth,10)},document.body.removeChild(i)),a},t.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof g.DataManager?this.initRemoteRender=!0:this.updateValues()},t.prototype.updateValues=function(){var e=this.list.querySelector("."+A.focus);(0,v.isNullOrUndefined)(e)||this.setSelection(e,null)},t.prototype.renderList=function(){e.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},t.prototype.wireListEvents=function(){v.EventHandler.add(this.list,this.keyEventName,this.onMouseClick,this),v.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),v.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},t.prototype.unWireListEvents=function(){v.EventHandler.remove(this.list,this.keyEventName,this.onMouseClick),v.EventHandler.remove(this.list,"mouseover",this.onMouseOver),v.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},t.prototype.onMouseClick=function(e){var t=e.target,i=(0,v.closest)(t,"."+A.li);if(this.isValidLI(i)&&!this.isDisabledElement(i)){this.isSelected=!0,this.setSelection(i,e);this.closePopup(100,e),this.inputElement.focus(),this.isRTE||e.preventDefault()}},t.prototype.updateSelectedItem=function(e,t,i,s){var l=this;this.removeSelection(),e.classList.add(A.selected),this.removeHover();var n=this.getFormattedValue(e.getAttribute("data-value")),a=this.getDataByValue(n);if(i||(0,v.isNullOrUndefined)(t)||"down"===t.action||"up"===t.action)this.selectEventCallback(e,a,n),s&&this.setSelectOptions(e,t);else{var o=this.detachChanges(a);this.isSelected=!0;var r={e:t,item:e,itemData:o,isInteracted:!!t,cancel:!1};this.trigger("select",r,(function(i){i.cancel?(e.classList.remove(A.selected),l.isSelected=!1,l.isSelectCancel=!0):(l.selectEventCallback(e,a,n),s&&l.setSelectOptions(e,t))}))}},t.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(A.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(A.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},t.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=(0,v.isNullOrUndefined)(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.isPopupOpen&&!(0,v.isNullOrUndefined)(this.selectedLI)&&this.setScrollPosition(t),(!t||38!==t.keyCode&&40!==t.keyCode)&&!(0,v.isNullOrUndefined)(t)&&this.setValue(t)},t.prototype.setScrollPosition=function(e){if((0,v.isNullOrUndefined)(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},t.prototype.scrollBottom=function(e){if(!(0,v.isNullOrUndefined)(this.selectedLI)){var t=this.list.offsetHeight,i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,s=this.list.scrollTop+i-t;s=e?s+2*parseInt(getComputedStyle(this.list).paddingTop,10):s;var l=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:(i>t||!(l>0&&this.list.offsetHeight>l))&&(this.list.scrollTop=s)}},t.prototype.scrollTop=function(){if(!(0,v.isNullOrUndefined)(this.selectedLI)){var e=(0,v.isNullOrUndefined)(this.fields.groupBy)||(0,v.isNullOrUndefined)(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight);e=this.fields.groupBy&&e;var t=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:t>0&&this.list.offsetHeight>t||(this.list.scrollTop=this.selectedLI.offsetTop)}},t.prototype.selectEventCallback=function(e,t,i,s){this.previousItemData=(0,v.isNullOrUndefined)(this.itemData)?null:this.itemData,this.item=e,this.itemData=t;var l=this.list.querySelector("."+A.focus);l&&(0,v.removeClass)([l],A.focus),s&&(0,v.addClass)([e],A.selected),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(i)},t.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},t.prototype.setValue=function(e){return this.isReact?((0,v.isNullOrUndefined)(this.displayTemplate)?this.updateMentionValue(e):this.setDisplayTemplate(e),!0):((0,v.isNullOrUndefined)(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(e),!0)},t.prototype.updateMentionValue=function(e){var t,i,s,l,n=this.getItemData(),a="string"==typeof this.suffixText?this.suffixText:"",o=this.inputElement.ownerDocument.getSelection(),r=this.getTriggerCharPosition();if(this.isSelectCancel)this.isSelectCancel=!1;else if(null!==n.text&&(t=this.mentionVal(n.text)),this.isContentEditable(this.inputElement)){i=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(i=this.range.endOffset),l=this.range,s=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(s.setStart(l.startContainer,r),s.setEnd(l.startContainer,i)):""!==l.commonAncestorContainer.textContent.trim()&&!(0,v.isNullOrUndefined)(l.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(s.setStart(l.startContainer,l.startOffset-1),s.setEnd(l.startContainer,l.endOffset-1)):(s.setStart(l.startContainer,l.startOffset),s.setEnd(l.startContainer,l.endOffset)),this.isTyped=!1,s.deleteContents(),s.startContainer.parentElement.normalize();var h=this.createElement("div");h.innerHTML=t;for(var u=document.createDocumentFragment(),p=void 0,d=void 0;p=h.firstChild;)d=u.appendChild(p);if(s.insertNode(u),d&&(s=s.cloneRange(),this.isRTE?(s.setStart(d,0),s.setEnd(d,d.textContent.length)):s.setStartAfter(d),s.collapse(!0),o.removeAllRanges(),o.addRange(s)),this.isPopupOpen&&this.hidePopup(),!(0,v.isNullOrUndefined)(e.pointerType)&&"mouse"===e.pointerType){var c=new CustomEvent("content-changed",{detail:{click:!0}});this.inputElement.dispatchEvent(c)}this.onChangeEvent(e)}else{var m=this.inputElement,f=this.getTextRange().substring(r+this.mentionChar.length,this.getTextRange().length);t+=a,i=r+this.mentionChar.length,i+=f.length,m.value=m.value.substring(0,r)+t+m.value.substring(i,m.value.length),m.selectionStart=r+t.length,m.selectionEnd=r+t.length,this.isPopupOpen&&this.hidePopup(),this.onChangeEvent(e)}},t.prototype.mentionVal=function(e){var t=this.showMentionChar?this.mentionChar:"";return(0,v.isNullOrUndefined)(this.displayTemplate)||(0,v.isNullOrUndefined)(this.displayTempElement)||(e=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?v.Browser.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):'<span contenteditable="false" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):t+e},t.prototype.setDisplayTemplate=function(e){var t=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement&&((0,v.detach)(this.displayTempElement),this.displayTempElement=null)),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var i=(0,v.compile)(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);i&&i.length>0&&(0,v.append)(i,this.displayTempElement),this.isReact?this.renderTemplates((function(){t.updateMentionValue(e)})):this.renderTemplates()},t.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},t.prototype.setSpinnerTemplate=function(){var e=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement&&((0,v.detach)(this.spinnerTemplateElement),this.spinnerTemplateElement=null)),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var t=(0,v.compile)(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(t&&t.length>0)for(var i=0;i<t.length;i++)this.spinnerTemplateElement.appendChild(t[i]);this.isReact?this.renderTemplates((function(){e.popupObj.element.appendChild(e.spinnerTemplateElement)})):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},t.prototype.onChangeEvent=function(e){this.isSelected=!1;var t,i=this.detachMentionChanges(this.itemData);t="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData;var s={e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:t,isInteracted:!!e,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",s)},t.prototype.detachMentionChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},t.prototype.getItemData=function(){var e,t,i,s=this.fields;return e=this.itemData,(0,v.isNullOrUndefined)(e)||(t=(0,v.getValue)(s.value,e),i=(0,v.getValue)(s.text,e)),{value:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:t,text:(0,v.isNullOrUndefined)(e)||(0,v.isUndefined)(t)?e:i}},t.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+A.selected);e.length&&((0,v.removeClass)(e,A.selected),e[0].removeAttribute("aria-selected"))}},t.prototype.onMouseOver=function(e){var t=(0,v.closest)(e.target,"."+A.li);this.setHover(t)},t.prototype.setHover=function(e){this.isValidLI(e)&&!e.classList.contains(A.hover)&&(this.removeHover(),(0,v.addClass)([e],A.hover))},t.prototype.removeHover=function(){if(this.list){var e=this.list.querySelectorAll("."+A.hover);e&&e.length&&(0,v.removeClass)(e,A.hover)}},t.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},t.prototype.onMouseLeave=function(){this.removeHover()},t.prototype.search=function(e,t,i){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var s=this.getTextRange(),l=this.getLastLetter(s);this.ignoreCase&&(e===l||e===l.toLowerCase())||!this.ignoreCase&&e===l?(this.resetList(this.dataSource,this.fields),(0,v.isNullOrUndefined)(this.list)?(this.renderList(),this.renderPopup()):this.showPopup(),this.popupObj.element.style.left=(0,v.formatUnit)(t),this.popupObj.element.style.top=(0,v.formatUnit)(i)):this.isPopupOpen&&this.hidePopup()},t.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t=-1;if(this.liCollections&&this.liCollections.length>0&&this.listData&&this.fields.disabled){if("string"==typeof e)t=this.getIndexByValue(e);else if("object"==typeof e)if(e instanceof HTMLLIElement){for(var i=0;i<this.liCollections.length;i++)if(this.liCollections[i]===e){t=this.getIndexByValue(e.getAttribute("data-value"));break}}else{var s=JSON.parse(JSON.stringify(e))[this.fields.value];for(i=0;i<this.listData.length;i++)if(JSON.parse(JSON.stringify(this.listData[i]))[this.fields.value]===s){t=this.getIndexByValue(s);break}}else t=e;if(t<this.liCollections.length&&t>-1&&!JSON.parse(JSON.stringify(this.listData[t]))[this.fields.disabled]){var l=this.liCollections[t];if(l){this.disableListItem(l);var n=JSON.parse(JSON.stringify(this.listData[t]));n[this.fields.disabled]=!0,this.listData[t]=n,this.dataSource=this.listData}}}}},t.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,e.prototype.destroy.call(this))},t.prototype.getLocaleName=function(){return"mention"},t.prototype.getNgDirective=function(){return"EJS-MENTION"},t.prototype.getModuleName=function(){return"mention"},Ot([(0,v.Property)(null)],t.prototype,"cssClass",void 0),Ot([(0,v.Property)("@")],t.prototype,"mentionChar",void 0),Ot([(0,v.Property)(!1)],t.prototype,"showMentionChar",void 0),Ot([(0,v.Property)(!1)],t.prototype,"allowSpaces",void 0),Ot([(0,v.Property)(null)],t.prototype,"suffixText",void 0),Ot([(0,v.Property)(25)],t.prototype,"suggestionCount",void 0),Ot([(0,v.Property)(0)],t.prototype,"minLength",void 0),Ot([(0,v.Property)("None")],t.prototype,"sortOrder",void 0),Ot([(0,v.Property)(!0)],t.prototype,"ignoreCase",void 0),Ot([(0,v.Property)(!1)],t.prototype,"highlight",void 0),Ot([(0,v.Property)()],t.prototype,"locale",void 0),Ot([(0,v.Property)("auto")],t.prototype,"popupWidth",void 0),Ot([(0,v.Property)("300px")],t.prototype,"popupHeight",void 0),Ot([(0,v.Property)(null)],t.prototype,"displayTemplate",void 0),Ot([(0,v.Property)(null)],t.prototype,"itemTemplate",void 0),Ot([(0,v.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),Ot([(0,v.Property)(null)],t.prototype,"spinnerTemplate",void 0),Ot([(0,v.Property)()],t.prototype,"target",void 0),Ot([(0,v.Property)([])],t.prototype,"dataSource",void 0),Ot([(0,v.Property)(null)],t.prototype,"query",void 0),Ot([(0,v.Property)("Contains")],t.prototype,"filterType",void 0),Ot([(0,v.Complex)({text:null,value:null,iconCss:null,groupBy:null},O)],t.prototype,"fields",void 0),Ot([(0,v.Event)()],t.prototype,"actionBegin",void 0),Ot([(0,v.Event)()],t.prototype,"actionComplete",void 0),Ot([(0,v.Event)()],t.prototype,"actionFailure",void 0),Ot([(0,v.Event)()],t.prototype,"change",void 0),Ot([(0,v.Event)()],t.prototype,"beforeOpen",void 0),Ot([(0,v.Event)()],t.prototype,"opened",void 0),Ot([(0,v.Event)()],t.prototype,"closed",void 0),Ot([(0,v.Event)()],t.prototype,"select",void 0),Ot([(0,v.Event)()],t.prototype,"filtering",void 0),Ot([(0,v.Event)()],t.prototype,"created",void 0),Ot([(0,v.Event)()],t.prototype,"destroyed",void 0),t=Ot([v.NotifyPropertyChanges],t)}(D)})(),p})()));