12345678910 |
- /*!
- * filename: ej2-dropdowns.min.js
- * version : 19.1.57
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.dropdowns=function(e,t,i,s,l,o,r,n){"use strict";function a(e,t,i,s,l,o){C+=String.fromCharCode(e),setTimeout(function(){C=""},1e3);var r;if(C=s?C.toLowerCase():C,x===l&&b===C){for(p=0;p<S.length;p++)if(S[p].classList.contains(E)){r=p;break}return r+=1,S[r]}var n=t,a=C.length,h=void 0,p=i=i?i+1:0;S=[];do{p===n.length&&(p=-1),h=n[r=-1===p?0:p],(o?s?h.textContent.trim().toLowerCase():h.textContent.trim():s?h.innerText.toLowerCase():h.innerText).substr(0,a)===C&&S.push(n[r]),p++}while(p!==i);return b=C,x=l,S[0]}function h(e,t,i,s){var l=t;s=void 0===s||null===s||s;var o={item:null,index:null};if(e&&e.length){for(var r=e.length,n=s?e.toLocaleLowerCase():e,a=0,h=l;a<h.length;a++){var p=h[a],u=(s?p.textContent.toLocaleLowerCase():p.textContent).replace(/^\s+|\s+$/g,"");if("Equal"===i&&u===n||"StartsWith"===i&&u.substr(0,r)===n)return o.item=p,o.index=a,{item:p,index:a}}return o}return o}function p(e,t,i,s,l){if(""!==t){var o=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var r="StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")";u(e,new RegExp(r,o),l)}}function u(e,t,i){for(var s=0;e.childNodes&&s<e.childNodes.length;s++){if(3===e.childNodes[s].nodeType&&""!==e.childNodes[s].textContent.trim()){if(e=i&&e.classList.contains("e-highlight")?e.parentElement:e,i&&e.getAttribute("data-value"))e.innerHTML=e.getAttribute("data-value").replace(t,'<span class="e-highlight">$1</span>');else{var l=e.childNodes[s].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[s].nodeValue="",e.innerHTML=e.innerHTML.trim()+l}break}u(e.childNodes[s],t,i)}}function c(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])}}function d(e,i,s,l,o,r,n){var a=t.createElement("span",{className:ee}),h=t.createElement("label",{className:te});t.isNullOrUndefined(s.id)||""===s.id||(h.id="label_"+s.id.replace(/ /g,"_"),t.attributes(s,{"aria-labelledby":h.id})),t.isNullOrUndefined(l.placeholder)||""===l.placeholder||(h.innerText=t.SanitizeHtmlHelper.sanitize(l.placeholder),l.removeAttribute("placeholder")),h.innerText=t.SanitizeHtmlHelper.sanitize(n),i.appendChild(a),i.appendChild(h),e.classList.add("e-float-input"),m(o,h),"Always"===r&&(h.classList.contains(se)&&t.removeClass([h],se),t.addClass([h],ie))}function m(e,i){e&&e.length>0?(t.addClass([i],ie),t.removeClass([i],se)):(t.removeClass([i],ie),t.addClass([i],se))}function f(e,i,s,l,o,r,n){var a,h=i.querySelector("."+te),p=i.querySelector("."+ee);t.isNullOrUndefined(h)?v(o,l,a=null!==n?n:""):(a=h.innerText,t.detach(s.querySelector("."+te)),v(o,l,a),t.isNullOrUndefined(p)||t.detach(s.querySelector("."+ee))),e.classList.remove("e-float-input")}function v(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function y(e,i){e.classList.add("e-input-focus");var s=i.querySelector("."+te);t.isNullOrUndefined(s)||(t.addClass([s],ie),s.classList.contains(se)&&t.removeClass([s],se))}function g(e,i,s,l,o){e.classList.remove("e-input-focus");var r=i.querySelector("."+te);s&&s.length<=0&&"Auto"===l&&!t.isNullOrUndefined(r)&&(r.classList.contains(ie)&&t.removeClass([r],ie),t.addClass([r],se))}var C="",b="",S=[],E="e-active",x="",w=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])})(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)}}(),O=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return w(i,e),O([t.Property()],i.prototype,"text",void 0),O([t.Property()],i.prototype,"value",void 0),O([t.Property()],i.prototype,"iconCss",void 0),O([t.Property()],i.prototype,"groupBy",void 0),O([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),k={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"},B=function(e){function l(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isAngular=!1,s.isPreventChange=!1,s}return w(l,e),l.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,o=function(e){return e};s[o(e)]=t[o(e)],l[o(e)]=i[o(e)];var r=new Object;return r.newProperty=s,r.oldProperty=l,r},l.prototype.getValueByText=function(e,i,s){var l=null;return t.isNullOrUndefined(this.listData)||(l=i?this.checkValueCase(e,!0,s):this.checkValueCase(e,!1,s)),l},l.prototype.checkValueCase=function(e,i,s,l){var o=this,r=null;l&&(r=e);var n=this.listData,a=this.fields,h=this.typeOfData(n).typeof;if("string"===h||"number"===h||"boolean"===h)for(var p=0,u=n;p<u.length;p++){var c=u[p];t.isNullOrUndefined(c)||(s?r=this.checkingAccent(String(c),e,i):i?this.checkIgnoreCase(String(c),e)&&(r=this.getItemValue(String(c),e,i)):this.checkNonIgnoreCase(String(c),e)&&(r=this.getItemValue(String(c),e,i,l)))}else i?n.filter(function(i){var s=t.getValue(a.value,i);!t.isNullOrUndefined(s)&&o.checkIgnoreCase(t.getValue(a.text,i).toString(),e)&&(r=t.getValue(a.value,i))}):l?n.filter(function(e){var i=t.getValue(a.value,e);t.isNullOrUndefined(i)||t.isNullOrUndefined(r)||i.toString()!==r.toString()||(r=t.getValue(a.text,e))}):n.filter(function(i){o.checkNonIgnoreCase(t.getValue(a.text,i),e)&&(r=t.getValue(a.value,i))});return r},l.prototype.checkingAccent=function(e,t,s){var l=i.DataUtil.ignoreDiacritics(String(e)),o=i.DataUtil.ignoreDiacritics(t.toString()),r=null;return s?this.checkIgnoreCase(l,o)&&(r=this.getItemValue(String(e),t,s)):this.checkNonIgnoreCase(String(e),t)&&(r=this.getItemValue(String(e),t,s)),r},l.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},l.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},l.prototype.getItemValue=function(e,t,i,s){var l=this.listData,o=this.typeOfData(l).typeof;return s?e.toString():i?"string"===o?String(e):this.getFormattedValue(String(e)):"string"===o?t:this.getFormattedValue(t)},l.prototype.templateCompiler=function(e){var i=!1;if(e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},l.prototype.l10nUpdate=function(e){var i="listbox"===this.getModuleName()?this.ulElement:this.list;if("No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){this.DropDownBaseresetBlazorTemplates(!1,!1,!0,!0);var s=e?this.actionFailureTemplate:this.noRecordsTemplate,l=void 0,o=e?this.actionFailureTemplateId:this.noRecordsTemplateId;i.innerHTML="";var r=(l=this.templateCompiler(s)?t.compile(t.select(s,document).innerHTML.trim()):t.compile(s))({},this,e?"actionFailureTemplate":"noRecordsTemplate",o,this.isStringTemplate,null,i);if(r&&r.length>0)for(var n=0;n<r.length;n++)i.appendChild(r[n]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!e,e,!1,!1,!1,!1)}else{var a={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},h=new t.L10n(this.getLocaleName(),{},this.locale);""!==h.getConstant("actionFailureTemplate")?this.l10n=h:this.l10n=new t.L10n("listbox"===this.getModuleName()?"listbox":"dropdowns",a,this.locale);var p=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName()){var u=this.createElement("li");u.textContent=p,i.appendChild(u),u.classList.add("e-list-nrt")}else i.innerHTML=p}},l.prototype.getLocaleName=function(){return"drop-down-base"},l.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},l.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var i=this.typeOfData(this.listData);if(t.isBlazor()&&t.isNullOrUndefined(e)||"null"===e)return null;if("number"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"number"===i.typeof)return parseFloat(e);if("boolean"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"boolean"===i.typeof)return"true"===e||""+e=="true"}return e},l.prototype.setEnableRtl=function(){this.list&&this.enableRtlElements.push(this.list),this.enableRtl?t.addClass(this.enableRtlElements,k.rtl):t.removeClass(this.enableRtlElements,k.rtl)},l.prototype.initialize=function(){if(this.bindEvent=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var e=s.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(e,this.fields)}else"SELECT"===this.element.tagName?(this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource))||this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query)},l.prototype.DropDownBaseupdateBlazorTemplates=function(e,i,s,l,o,r,n,a){this.isStringTemplate||(this.itemTemplate&&e&&t.updateBlazorTemplate(this.itemTemplateId,"ItemTemplate",this,a),this.groupTemplate&&i&&t.updateBlazorTemplate(this.groupTemplateId,"GroupTemplate",this,a),this.noRecordsTemplate&&s&&t.updateBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate",this,a),this.actionFailureTemplate&&l&&t.updateBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate",this,a),o&&t.updateBlazorTemplate(this.valueTemplateId,"ValueTemplate",this,a),r&&t.updateBlazorTemplate(this.headerTemplateId,"HeaderTemplate",this),n&&t.updateBlazorTemplate(this.footerTemplateId,"FooterTemplate",this))},l.prototype.DropDownBaseresetBlazorTemplates=function(e,i,s,l,o,r,n){this.isStringTemplate||(this.itemTemplate&&e&&t.resetBlazorTemplate(this.itemTemplateId,"ItemTemplate"),this.groupTemplate&&i&&t.resetBlazorTemplate(this.groupTemplateId,"GroupTemplate"),this.noRecordsTemplate&&s&&t.resetBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate"),this.actionFailureTemplate&&l&&t.resetBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate"),o&&t.resetBlazorTemplate(this.valueTemplateId,"ValueTemplate"),r&&t.resetBlazorTemplate(this.headerTemplateId,"HeaderTemplate"),n&&t.resetBlazorTemplate(this.footerTemplateId,"FooterTemplate"))},l.prototype.getPersistData=function(){return this.addOnPersist([])},l.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},l.prototype.updateDataAttribute=function(e){for(var i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1!==i.indexOf(this.element.attributes[l].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[l].name||(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},l.prototype.renderItemsBySelect=function(){var e=this.element,t={value:"value",text:"text"},i=[],s=e.querySelectorAll("select>optgroup"),l=e.querySelectorAll("select>option");if(this.getJSONfromOption(i,l,t),s.length){for(var o=0;o<s.length;o++){var r=s[o],n={};n[t.text]=r.label,n.isHeader=!0;var a=r.querySelectorAll("option");i.push(n),this.getJSONfromOption(i,a,t)}e.querySelectorAll("select>option")}this.updateFields(t.text,t.value,this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss),this.resetList(i,t)},l.prototype.updateFields=function(e,i,s,l,o){var r={fields:{text:e,value:i,groupBy:t.isNullOrUndefined(s)?this.fields&&this.fields.groupBy:s,htmlAttributes:t.isNullOrUndefined(l)?this.fields&&this.fields.htmlAttributes:l,iconCss:t.isNullOrUndefined(o)?this.fields&&this.fields.iconCss:o}};this.setProperties(r,!0)},l.prototype.getJSONfromOption=function(e,i,s){for(var l=0,o=i;l<o.length;l++){var r=o[l],n={};n[s.text]=r.innerText,n[s.value]=t.isNullOrUndefined(r.getAttribute(s.value))?r.innerText:r.getAttribute(s.value),e.push(n)}},l.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",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"},l.prototype.setListData=function(e,t,s){var l=this;t=t||this.fields;var o;this.isActive=!0;var r={cancel:!1,data:e,query:s};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.trigger("actionBegin",r,function(s){if(!s.cancel)if(l.showSpinner(),e instanceof i.DataManager){if(l.isRequested=!0,l.isDataFetched)return void l.emptyDataRequest(t);s.data.executeQuery(l.getQuery(s.query)).then(function(e){l.isPreventChange=!(!l.isAngular||!l.preventChange)||l.isPreventChange,l.trigger("actionComplete",e,function(e){if(!e.cancel){var i=e.result;0===i.length&&(l.isDataFetched=!0),o=l.renderItems(i,t),l.onActionComplete(o,i,e),l.groupTemplate&&l.renderGroupTemplate(o),l.isRequested=!1,l.bindChildItems(i,o,t,e)}})}).catch(function(e){l.isRequested=!1,l.onActionFailure(e),l.hideSpinner()})}else{var r=new i.DataManager(s.data),n={cancel:!1,result:l.getQuery(s.query).executeLocal(r)};l.isPreventChange=!(!l.isAngular||!l.preventChange)||l.isPreventChange,l.trigger("actionComplete",n,function(e){e.cancel||(o=l.renderItems(e.result,t),l.onActionComplete(o,e.result),l.groupTemplate&&l.renderGroupTemplate(o),l.bindChildItems(e.result,o,t))})}})},l.prototype.bindChildItems=function(e,i,s,l){var o=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout(function(){var r=o.remainingItems(o.sortedData,s);t.append(r,i),o.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1),o.liCollections=o.list.querySelectorAll("."+k.li),o.updateListValues(),o.raiseDataBound(e,l)},0):this.raiseDataBound(e,l)},l.prototype.updateListValues=function(){},l.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var o=[].slice.call(e.querySelectorAll(t)),r=0;r<o.length;r++)if(o[r].getAttribute(i)===s+""){l=o[r];break}return l},l.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},l.prototype.remainingItems=function(e,t){var l=new i.DataManager(e).executeLocal((new i.Query).skip(100));if(this.itemTemplate){var o=this.templateListItem(l,t);return[].slice.call(o.childNodes)}var r=this.typeOfData(l).typeof;return"string"===r||"number"===r||"boolean"===r?s.ListBase.createListItemFromArray(this.createElement,l,!0,this.listOption(l,t),this):s.ListBase.createListItemFromJson(this.createElement,l,this.listOption(l,t),1,!0,this)},l.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.hideSpinner()},l.prototype.showSpinner=function(){},l.prototype.hideSpinner=function(){},l.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.list],k.noData)},l.prototype.onActionComplete=function(e,i,s){this.listData=i,t.isBlazor()&&this.isServerRendered&&"listbox"===this.getModuleName()?(t.remove(this.list.querySelector(".e-list-parent")),t.remove(this.list.querySelector(".e-hidden-select"))):(this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.list.innerHTML=""),this.fixedHeaderElement=t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null,this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+k.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,i,this.bindEvent)},l.prototype.postRender=function(e,i,s){var l=e.querySelector("."+k.li),o=e.querySelector("."+k.selected);l&&!o&&l.classList.add(k.focus),i.length<=0?(this.l10nUpdate(),t.addClass([e],k.noData)):e.classList.remove(k.noData)},l.prototype.getQuery=function(e){return e||(this.query?this.query:new i.Query)},l.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+k.group)){var i=this.dataSource,l={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},o=e.querySelectorAll("."+k.group);if(this.templateCompiler(this.groupTemplate)){var r=t.select(this.groupTemplate,document).innerHTML.trim();s.ListBase.renderGroupTemplate(r,i,this.fields.properties,o,l,this)}else s.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,o,l,this);this.DropDownBaseupdateBlazorTemplates(!1,!0,!1,!1,!1,!1,!1,!1)}},l.prototype.createListItems=function(e,l){e&&l.groupBy||this.element.querySelector("optgroup")?(l.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=s.ListBase.groupDataSource(e,l.properties,this.sortOrder)),t.addClass([this.list],k.grouping)):e=this.getSortedDataSource(e);var o=this.listOption(e,l),r=e.length>100?new i.DataManager(e).executeLocal((new i.Query).take(100)):e;return this.sortedData=e,s.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?r:e,o,!0,this)},l.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties,o=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return t.extend({},o,i,!0)},l.prototype.setFloatingHeader=function(e){t.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:k.fixedHead}),this.list.querySelector("li").classList.contains(k.group)||(this.fixedHeaderElement.style.display="none"),t.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),t.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e)},l.prototype.scrollStop=function(e){for(var i=e.target,s=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10),l=Math.round(i.scrollTop/s),o=this.list.querySelectorAll("li"),r=l;r>-1;r--){if(!t.isNullOrUndefined(o[r])&&o[r].classList.contains(k.group)){var n=o[r];this.fixedHeaderElement.innerHTML=n.innerHTML,this.fixedHeaderElement.style.top=e.target.scrollTop+"px",this.fixedHeaderElement.style.display="block";break}this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none"}},l.prototype.renderItems=function(e,t){var l;if(this.itemTemplate&&e){var o=e;o&&t.groupBy?("None"!==this.sortOrder&&(o=this.getSortedDataSource(o)),o=s.ListBase.groupDataSource(o,t.properties,this.sortOrder)):o=this.getSortedDataSource(o),this.sortedData=o;var r=o.length>100?new i.DataManager(o).executeLocal((new i.Query).take(100)):o;l=this.templateListItem("autocomplete"===this.getModuleName()?r:o,t);var n="listbox"===this.getModuleName();this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1,!1,!1,!1,n)}else l=this.createListItems(e,t);return l},l.prototype.templateListItem=function(e,i){this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1);var l=this.listOption(e,i);if(l.templateID=this.itemTemplateId,l.isStringTemplate=this.isStringTemplate,this.templateCompiler(this.itemTemplate)){var o=t.select(this.itemTemplate,document).innerHTML.trim();return s.ListBase.renderContentTemplate(this.createElement,o,e,i.properties,l,this)}return s.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,i.properties,l,this)},l.prototype.typeOfData=function(e){for(var i={typeof:null,item:null},s=0;!t.isNullOrUndefined(e)&&s<e.length;s++)if(!t.isNullOrUndefined(e[s])&&!("string"==typeof e[s]||"number"==typeof e[s]||"boolean"==typeof e[s]?t.isNullOrUndefined(e[s]):t.isNullOrUndefined(t.getValue(this.fields.value?this.fields.value:"value",e[s]))))return i={typeof:typeof e[s],item:e[s]};return i},l.prototype.setFixedHeader=function(){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));var i=this.liCollections[0].offsetWidth-e;this.fixedHeaderElement.style.width=i.toString()+"px",t.setStyleAttribute(this.fixedHeaderElement,{zIndex:10});var s=this.ulElement.querySelector("."+k.group);this.fixedHeaderElement.innerHTML=s.innerHTML},l.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=s.ListBase.getDataSource(e,s.ListBase.addSorting(this.sortOrder,t))}return e},l.prototype.getIndexByValue=function(e){for(var i,s=this.getItems(),l=0;l<s.length;l++)if(!t.isNullOrUndefined(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},l.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i)},l.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.updateFields("text","text")},l.prototype.resetList=function(e,i,s){this.list&&(("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)&&!(e instanceof Array?e.length>0:!t.isNullOrUndefined(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData),this.setListData(e,i,s))},l.prototype.updateSelectElementData=function(e){e&&t.isNullOrUndefined(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},l.prototype.updateSelection=function(){},l.prototype.renderList=function(){this.render()},l.prototype.updateDataSource=function(e){this.resetList(this.dataSource)},l.prototype.setUpdateInitial=function(e,t){this.isDataFetched=!1;for(var i={},s=0;e.length>s;s++)t[e[s]]&&"fields"===e[s]?(this.setFields(),i[e[s]]=t[e[s]]):t[e[s]]&&(i[e[s]]=t[e[s]]);Object.keys(i).length>0&&(-1===Object.keys(i).indexOf("dataSource")&&(i.dataSource=this.dataSource),this.updateDataSource(i))},l.prototype.onPropertyChanged=function(e,i){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"enabled":this.setEnabled();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var o=this.ulElement.querySelector("."+k.group);this.fixedHeaderElement.innerHTML=o.innerHTML}break;case"locale":this.list&&!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},l.prototype.render=function(e){this.list=this.createElement("div",{className:k.content,attrs:{tabindex:"0"}}),this.list.classList.add(k.root),this.setFields();var i={duration:300,selector:"."+k.li};this.rippleFun=t.rippleEffect(this.list,i);var s=this.element.querySelector("select>optgroup");if(!this.fields.groupBy&&t.isNullOrUndefined(s)||this.isGroupChecking||t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),"dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),t.removeClass([this.element],k.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(),this.setEnabled(),e||this.initialize()},l.prototype.getModuleName=function(){return"dropdownbase"},l.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+k.li)},l.prototype.addItem=function(e,i){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&t.isNullOrUndefined(i)){var l=[].slice.call(this.listData);l.push(e),l=this.getSortedDataSource(l),i=this.fields.groupBy?(l=s.ListBase.groupDataSource(l,this.fields.properties,this.sortOrder)).indexOf(e):l.indexOf(e)}this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1);var o=this.getItems().length,r=this.list.querySelector("."+k.selected);e=e instanceof Array?e:[e];var n;n=t.isNullOrUndefined(i)||i<0||i>o-1?o:i;var a=this.fields;e&&a.groupBy&&(e=s.ListBase.groupDataSource(e,a.properties));for(var h=[],p=0;p<e.length;p++){var u=e[p],c=u.isHeader,d=this.createElement("li",{className:c?k.group:k.li,id:"option-add-"+p}),m=u instanceof Object?t.getValue(a.text,u):u;if(c&&(d.innerText=m),this.itemTemplate&&!c){var f=t.compile(this.itemTemplate)(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d);f&&t.append(f,d),this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1)}else c||d.appendChild(document.createTextNode(m));d.setAttribute("data-value",u instanceof Object?t.getValue(a.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),h.push(d),this.listData.push(u),"None"===this.sortOrder&&t.isNullOrUndefined(i)&&0===n&&(n=null),this.updateActionCompleteData(d,u,n),this.trigger("beforeItemRender",{element:d,item:u})}if(0===o&&t.isNullOrUndefined(this.list.querySelector("ul")))this.list.innerHTML="",this.list.classList.remove(k.noData),this.list.appendChild(this.ulElement),this.liCollections=h,t.append(h,this.ulElement),this.updateAddItemList(this.list,o);else{"listbox"===this.getModuleName()&&0===o&&(this.ulElement.innerHTML="");for(var v=[],p=0;p<e.length;p++){for(var y=this.ulElement.querySelectorAll(".e-list-group-item"),g=0;g<y.length;g++)v[g]=y[g].innerText;if(v.indexOf(h[p].innerText)>-1&&a.groupBy){for(g=0;g<y.length;g++)if(v[g]===h[p].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(h[p+1],y[g+1]):this.ulElement.insertBefore(h[p+1],this.ulElement.childNodes[i]),p+=1;break}}else this.liCollections[n]?this.liCollections[n].parentNode.insertBefore(h[p],this.liCollections[n]):this.ulElement.appendChild(h[p]);var C=[].slice.call(this.liCollections);C.splice(n,0,h[p]),this.liCollections=C,n+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}(r||0===i)&&this.updateSelection()},l.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 o=e.getAttribute(s[l]);t.setAttribute(s[l],o),e.removeAttribute(s[l])}},l.prototype.setZIndex=function(){},l.prototype.updateActionCompleteData=function(e,t,i){},l.prototype.updateAddItemList=function(e,t){},l.prototype.updateDataList=function(){},l.prototype.getDataByValue=function(e){if(!t.isNullOrUndefined(this.listData)){var i=this.typeOfData(this.listData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.listData;s<l.length;s++){n=l[s];if(!t.isNullOrUndefined(n)&&n===e)return n}else for(var o=0,r=this.listData;o<r.length;o++){var n=r[o];if(!t.isNullOrUndefined(n)&&t.getValue(this.fields.value?this.fields.value:"value",n)===e)return n}}return null},l.prototype.destroy=function(){document.body.contains(this.list)&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.isNullOrUndefined(this.rippleFun)||this.rippleFun(),t.detach(this.list)),e.prototype.destroy.call(this)},O([t.Complex({text:null,value:null,iconCss:null,groupBy:null},A)],l.prototype,"fields",void 0),O([t.Property(!1)],l.prototype,"enablePersistence",void 0),O([t.Property(null)],l.prototype,"itemTemplate",void 0),O([t.Property(null)],l.prototype,"groupTemplate",void 0),O([t.Property("No records found")],l.prototype,"noRecordsTemplate",void 0),O([t.Property("Request failed")],l.prototype,"actionFailureTemplate",void 0),O([t.Property("None")],l.prototype,"sortOrder",void 0),O([t.Property(!0)],l.prototype,"enabled",void 0),O([t.Property([])],l.prototype,"dataSource",void 0),O([t.Property(null)],l.prototype,"query",void 0),O([t.Property("StartsWith")],l.prototype,"filterType",void 0),O([t.Property(!0)],l.prototype,"ignoreCase",void 0),O([t.Property(1e3)],l.prototype,"zIndex",void 0),O([t.Property(!1)],l.prototype,"ignoreAccent",void 0),O([t.Property()],l.prototype,"locale",void 0),O([t.Event()],l.prototype,"actionBegin",void 0),O([t.Event()],l.prototype,"actionComplete",void 0),O([t.Event()],l.prototype,"actionFailure",void 0),O([t.Event()],l.prototype,"select",void 0),O([t.Event()],l.prototype,"dataBound",void 0),O([t.Event()],l.prototype,"created",void 0),O([t.Event()],l.prototype,"destroyed",void 0),l=O([t.NotifyPropertyChanges],l)}(t.Component),D=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])})(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)}}(),T=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},I={root:"e-dropdownlist",hover:k.hover,selected:k.selected,rtl:k.rtl,li:k.li,disable:k.disabled,base:k.root,focus:k.focus,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",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"},L={container:null,buttons:[]},N=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.previousValue=null,s.isListSearched=!1,s.preventChange=!1,s.isAngular=!1,s}return D(s,e),s.prototype.preRender=function(){var i=t.isBlazor()&&this.isServerRendered;this.isServerBlazor=!!i,this.valueTempElement=null,this.isServerBlazor?this.initializeData():(this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this)),this.activeIndex=this.index,this.queryString=""},s.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initRemoteRender=!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.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,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"}},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.renderList=function(t){this.isServerBlazor?this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!1):(e.prototype.render.call(this,t),this.unWireListEvents(),this.wireListEvents())},s.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");""!==this.inputElement.value||this.isInteracted?t.classList(e,["e-label-top"],["e-label-bottom"]):t.classList(e,["e-label-bottom"],["e-label-top"])}},s.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e)},s.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.ulElement)){var e=this.ulElement.querySelector("."+I.li);e&&e.classList.add(I.focus)}},s.prototype.clearAll=function(e,s){!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s.dataSource)&&(s.dataSource instanceof i.DataManager||0!==s.dataSource.length))||(this.isActive=!0,this.resetSelection(s));var l=this.getItemData();this.previousValue!==l.value&&this.onChangeEvent(e)},s.prototype.resetSelection=function(e){this.list&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)?(!this.allowFiltering||"autocomplete"===this.getModuleName()||t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||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))),this.isServerBlazor||(this.hiddenElement.innerHTML=""),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&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s){var l=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==l&&t.addClass([this.inputWrapper.container],l.split(" "))}else if("disabled"===s&&"disabled"===this.htmlAttributes[s])this.enabled=!1,this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[s]))if("style"===s)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[s]);else{var r=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],n=["name","required"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||r.push("tabindex"),n.indexOf(s)>-1||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):r.indexOf(s)>-1?"placeholder"===s?o.Input.setPlaceholder(this.htmlAttributes[s],this.inputElement):this.inputElement.setAttribute(s,this.htmlAttributes[s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-haspopup":"true","aria-expanded":"false","aria-activedescendant":"null","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},s.prototype.setEnableRtl=function(){o.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},s.prototype.setEnable=function(){o.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(t.removeClass([this.inputWrapper.container],I.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex)):(this.hidePopup(),t.addClass([this.inputWrapper.container],I.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.getLocaleName=function(){return"drop-down-list"},s.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},s.prototype.targetElement=function(){return this.inputWrapper.container},s.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},s.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},s.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},s.prototype.initValue=function(){this.renderList(),this.dataSource instanceof i.DataManager?this.initRemoteRender=!0:this.updateValues()},s.prototype.updateValues=function(){if(t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);if(t.isNullOrUndefined(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else this.setSelection(this.getElementByValue(this.value),null);this.setHiddenValue(),o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onBlur=function(e){if(this.enabled){var i=e.relatedTarget,s=e.target,l=this.isPreventBlur;if(this.isPreventBlur=!1,l&&!this.isDocumentClick&&this.isPopupOpen&&(!t.isNullOrUndefined(s)||!this.isFilterLayout()&&t.isNullOrUndefined(i)))return void("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus());if(this.isDocumentClick||!t.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(I.mobileFilter))return void(this.beforePopupOpen||(this.isDocumentClick=!1));("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&i!==this.inputElement&&(document.activeElement!==i||document.activeElement===i&&s.classList.contains(I.inputFocus))||t.isNullOrUndefined(i)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&s!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(i)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1)}},s.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut()},s.prototype.onFocusOut=function(){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(null)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&t.addClass([this.inputWrapper.clearButton],I.clearIconHide),this.trigger("blur"))},s.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}this.updateIconState()},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),this.bindCommonEvent()},s.prototype.bindCommonEvent=function(){t.EventHandler.add(this.targetElement(),"blur",this.onBlur,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.Browser.isDevice?this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},s.prototype.unBindCommonEvent=function(){this.targetElement()&&t.EventHandler.remove(this.targetElement(),"blur",this.onBlur);var e=this.inputElement&&t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},s.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?t.addClass([this.inputWrapper.clearButton],I.clearIconHide):t.removeClass([this.inputWrapper.clearButton],I.clearIconHide))},s.prototype.wireListEvents=function(){t.EventHandler.add(this.list,"click",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&(this.isServerBlazor?(this.isServerIncrementalSearch=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1)):this.renderList()),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},s.prototype.onServerIncrementalSearch=function(e){this.isRequested||t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},s.prototype.onMouseClick=function(e){var i=e.target,s=t.closest(i,"."+k.li);if(this.isValidLI(s))if(this.setSelection(s,e),t.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100)}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+k.li);this.setHover(i)},s.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(k.hover)&&(this.removeHover(),t.addClass([e],k.hover))},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.removeHover=function(){if(this.list){var e=this.isServerBlazor&&this.popupObj&&this.popupObj.element?this.popupObj.element.querySelectorAll("."+k.hover):this.list.querySelectorAll("."+k.hover);e&&e.length&&t.removeClass(e,k.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.incrementalSearch=function(e){if(this.liCollections.length>0){var i=a(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id,this.isServerBlazor);t.isNullOrUndefined(i)||(this.setSelection(i,e),this.setScrollPosition())}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],I.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=t.Browser.isDevice&&!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],t.addClass([this.spinnerElement],I.disableIcon),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),l.showSpinner(this.spinnerElement))},s.prototype.keyActionHandler=function(e){if(this.enabled){var i="pageUp"===e.action||"pageDown"===e.action,s="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var l="down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action,o="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||i||s)||this.isPopupOpen)&&!this.readonly){var r="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||r||"escape"===e.action||(this.searchKeyEvent=e,this.renderList()),((!this.isServerBlazor||"open"!==e.action&&"space"!==e.action)&&t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&o&&0===this.liCollections.length||this.isRequested)&&(!this.isServerBlazor||!l))return;switch((r&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!o&&"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.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||this.showPopup());break;case"open":this.showPopup();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))}}}},s.prototype.updateUpDownAction=function(e){if(this.isServerBlazor&&t.isNullOrUndefined(this.list))this.isServerNavigation=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1);else{this.isServerNavigation=!1;var i=this.list.querySelector("."+I.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else{var s="down"===e.action?this.activeIndex+1:this.activeIndex-1,l=0;"autocomplete"===this.getModuleName()&&(l="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,s=s<0?this.liCollections.length-1:s===this.liCollections.length?0:s);var o=t.isNullOrUndefined(this.activeIndex)?this.liCollections[l]:this.liCollections[s];t.isNullOrUndefined(o)||this.setSelection(o,e)}e.preventDefault()}},s.prototype.updateHomeEndAction=function(e){if("dropdownlist"===this.getModuleName())if(this.isServerBlazor&&t.isNullOrUndefined(this.list))this.isServerNavigation=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1);else{this.isServerNavigation=!1;var i=0;if(i="home"===e.action?0:this.getItems().length-1,e.preventDefault(),this.activeIndex===i)return;this.setSelection(this.liCollections[i],e)}},s.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},s.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()),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},s.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+I.focus);t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(),this.focusDropDown(e)}else this.showPopup()},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.getPageCount=function(){var e=this.list.classList.contains(k.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height");return Math.round(this.list.getBoundingClientRect().height/parseInt(e,10))},s.prototype.pageUpSelection=function(e,t){var i=e>=0?this.liCollections[e+1]:this.liCollections[0];this.setSelection(i,t)},s.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=e<=i.length?this.liCollections[e-1]:this.liCollections[i.length-1];this.setSelection(s,t)},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),t.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),t.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),this.unBindCommonEvent()},s.prototype.unWireListEvents=function(){t.EventHandler.remove(this.list,"click",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},s.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},s.prototype.onDocumentClick=function(e){var i=e.target;if(!t.isNullOrUndefined(this.popupObj)&&t.closest(i,this.checkSelector(this.popupObj.element.id))||this.inputWrapper.container.contains(e.target))i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&t.Browser.isDevice&&i===this.inputWrapper.buttons[0]||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(I.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var s=this.isRequested;this.isInteracted=!1,this.hidePopup(e),s||(this.onFocusOut(),this.inputWrapper.container.classList.remove(I.inputFocus))}},s.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(I.inputFocus))},s.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},s.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&!this.targetElement().classList.contains(I.disable)&&this.inputWrapper.clearButton!==e.target){var i=e.target;if(i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen?(this.hidePopup(),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());var s=this,l=t.isBlazor()?1e3:this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout(function(){s.cloneElements(),s.isSecondClick=!0},l)}}},s.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},s.prototype.updateSelectedItem=function(e,i,s,l){var o=this;this.removeSelection(),e.classList.add(k.selected),this.removeHover();var r=this.getFormattedValue(e.getAttribute("data-value")),n=this.getDataByValue(r);if(this.initial||s||t.isNullOrUndefined(i))this.selectEventCallback(e,i,s,n,r),this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("OnServerItemData",this.itemData),l&&this.setSelectOptions(e,i);else{var a=this.detachChanges(n);this.isSelected=!0;var h={e:i,item:e,itemData:a,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?e.classList.remove(k.selected):(o.selectEventCallback(e,i,s,n,r),o.isServerBlazor&&o.interopAdaptor.invokeMethodAsync("OnServerItemData",o.itemData),l&&o.setSelectOptions(e,i))})}},s.prototype.selectEventCallback=function(e,i,s,l,o){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=e,this.itemData=l;var r=this.list.querySelector("."+k.focus);r&&t.removeClass([r],k.focus),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(o)},s.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(k.selected)&&(this.removeSelection(),e.classList.add(k.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},s.prototype.setValue=function(e){var i=this.getItemData();return null===i.value?t.isBlazor()&&null!==i.text||""!==i.text?o.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton):o.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):o.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("OnServerValueTemplate",i),this.valueTemplate&&null!==this.itemData&&!this.isServerBlazor?(this.DropDownBaseresetBlazorTemplates(!1,!1,!1,!1,!0),this.setValueTemplate()):this.inputElement.previousSibling===this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block"),this.previousValue===i.value?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},s.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(k.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(k.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(i)||(this.isPopupOpen&&(t.attributes(this.targetElement(),{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null}),this.isFilterLayout()&&this.filterInput&&t.attributes(this.filterInput,{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})),(!this.isPopupOpen&&!t.isNullOrUndefined(e)||this.isPopupOpen&&!t.isNullOrUndefined(i)&&("keydown"!==i.type||"keydown"===i.type&&"enter"===i.action))&&(this.isSelectCustom=!1,this.onChangeEvent(i)),!this.isPopupOpen||t.isNullOrUndefined(this.selectedLI)||null===this.itemData||i&&"click"===i.type||this.setScrollPosition(i),"mozilla"!==t.Browser.info.name&&(t.attributes(this.inputElement,{"aria-label":this.inputElement.value}),t.attributes(this.targetElement(),{"aria-describedby":this.inputElement.id}),this.targetElement().removeAttribute("aria-live")))},s.prototype.dropdownCompiler=function(e){var t=!1;if(e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},s.prototype.setValueTemplate=function(){var e;this.isReact&&this.clearTemplate(["valueTemplate"]),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:I.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.valueTempElement.innerHTML="";var i=t.isBlazor()?JSON.parse(JSON.stringify(this.itemData)):this.itemData,s=(e=this.dropdownCompiler(this.valueTemplate)?t.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):t.compile(this.valueTemplate))(i,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);if(s&&s.length>0)for(var l=0;l<s.length;l++)this.valueTempElement.appendChild(s[l]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!0,!0,!0)},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+k.selected);e.length&&(t.removeClass(e,k.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.onChangeEvent=function(e){var t=this.getItemData(),i=this.isSelectCustom?null:this.activeIndex;this.setProperties({index:i,text:t.text,value:t.value},!0),this.detachChangeEvent(e)},s.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},s.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.index,this.typedString=t.isNullOrUndefined(this.text)?"":this.text,!this.initial){var i=this.detachChanges(this.itemData),s=void 0;s="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 l={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:s,isInteracted:!!e,value:this.value,element:this.element};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",l),this.isServerBlazor&&this.enablePersistence&&this.interopAdaptor.invokeMethodAsync("ServerChange")}!t.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||t.removeClass([this.inputWrapper.container],"e-valid-input")},s.prototype.setHiddenValue=function(){if(t.isNullOrUndefined(this.value))this.isServerBlazor||(this.hiddenElement.innerHTML="");else if(this.isServerBlazor&&this.hiddenElement.querySelector("option"))(e=this.hiddenElement.querySelector("option")).textContent=this.text,e.setAttribute("value",this.value.toString());else if(!this.isServerBlazor){this.hiddenElement.innerHTML="<option selected>"+this.text+"</option>";var e=this.hiddenElement.querySelector("option");e.setAttribute("value",this.value.toString())}},s.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,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,e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"autocomplete"===this.getModuleName()&&this.hidePopup()),e.preventDefault();break;default:this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.searchLists(e)}},s.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}},s.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},s.prototype.getQuery=function(e){var t;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){t=e?e.clone():this.query?this.query.clone():new i.Query;var s=""===this.typedString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields.text?this.fields.text:"";t.where(o,s,this.typedString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.typedString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new i.Query);return t},s.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},s.prototype.searchLists=function(e){var t=this;if(this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+I.clearIcon)&&(this.filterInput.parentElement.querySelector("."+I.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering())if(this.isServerBlazor)this.beforePopupOpen="combobox"===this.getModuleName()&&this.isFiltering()&&!this.beforePopupOpen?!this.beforePopupOpen:this.beforePopupOpen,""===this.filterInput.value&&"dropdownlist"!==this.getModuleName()?this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!1):this.interopAdaptor.invokeMethodAsync("OnServerFilter",this.filterInput.value);else{var i={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,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)})}},s.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},s.prototype.filteringAction=function(e,i,s){t.isNullOrUndefined(this.filterInput)||(this.beforePopupOpen=!0,""!==this.filterInput.value.trim()||this.itemTemplate?(this.isNotSearchList=!1,i=""===this.filterInput.value.trim()?null:i,this.resetList(e,s,i)):(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list),this.isTyped=!0,t.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0),this.renderReactTemplates())},s.prototype.setSearchBox=function(e){if(this.isFiltering()){var i=e.querySelector("."+I.filterParent)?e.querySelector("."+I.filterParent):this.createElement("span",{className:I.filterParent});this.isServerBlazor&&(i.innerHTML=""),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:I.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var s=!1;return t.Browser.isDevice&&(s=!0),this.filterInputObj=o.Input.createInput({element:this.filterInput,buttons:s?[I.backIcon,I.filterBarClearIcon]:[I.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],i),t.prepend([i],e),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-activedescendant":this.selectedLI?this.selectedLI.id:null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+I.clearIcon),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.Browser.isDevice?this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),t.EventHandler.add(this.filterInput,"blur",this.onBlur,this),t.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return L},s.prototype.onInput=function(e){this.isValidKey=!0,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.typedString=t.filterInput.value,t.searchLists(e)})},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},s.prototype.onActionComplete=function(s,l,o,r){var n=this;if(this.isNotSearchList)return void(this.isNotSearchList=!1);if(this.isActive){var a=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,s,l,o),this.updateSelectElementData(this.allowFiltering),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.list.scrollTop=0,t.isNullOrUndefined(s)||t.attributes(s,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false"}),this.initRemoteRender&&(this.initial=!0,this.activeIndex=this.index,this.updateValues(),this.initRemoteRender=!1,this.initial=!1,this.value&&this.dataSource instanceof i.DataManager)){var h=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value;l.some(function(e){return e[h]===n.value})||this.dataSource.executeQuery(this.getQuery(this.query).where(new i.Predicate(h,"equal",this.value))).then(function(e){e.result.length>0&&(n.addItem(e.result,l.length),n.updateValues())})}"autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped&&((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||t.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof i.DataManager||!t.isNullOrUndefined(this.dataSource)&&!t.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){n.actionCompleteData={ulElement:s.cloneNode(!0),list:l,isUpdated:!0}},0):this.actionCompleteData={ulElement:s.cloneNode(!0),list:l,isUpdated:!0}),this.addNewItem(l,a),t.isNullOrUndefined(this.itemData)||this.focusIndexItem()),this.beforePopupOpen&&this.renderPopup()}},s.prototype.addNewItem=function(e,i){var s=this;if(!t.isNullOrUndefined(this.itemData)&&!t.isNullOrUndefined(i)){var l=this.getItemData().value;e.some(function(e){return("string"==typeof e||"number"==typeof e)&&e===l||t.getValue(s.fields.value,e)===l})||this.addItem(this.itemData)}},s.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))},s.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.indexOf(t)<0&&this.actionCompleteData.list.push(t)},s.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.getIndexByValue(e);var t=this.findListElement(this.list,"li","data-value",e);this.selectedLI=t,this.activeItem(t),this.removeFocus()},s.prototype.updateSelection=function(){var e=this.list.querySelector("."+k.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+k.li).classList.add(I.focus))},s.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+I.focus);e&&e.length&&t.removeClass(e,I.focus)},s.prototype.renderPopup=function(){var e=this;if(this.popupObj&&document.body.contains(this.popupObj.element))return void this.refreshPopup();var i={cancel:!1};this.trigger("beforeOpen",i,function(i){if(i.cancel)e.beforePopupOpen=!1;else{var s=e.serverPopupEle?e.serverPopupEle:e.createElement("div",{id:e.element.id+"_popup",className:"e-ddl e-popup "+(null!=e.cssClass?e.cssClass:"")}),l=e.setSearchBox(s);if(e.listHeight=t.formatUnit(e.popupHeight),e.headerTemplate&&!e.isServerBlazor&&e.setHeaderTemplate(s),t.append([e.list],s),e.footerTemplate&&!e.isServerBlazor&&e.setFooterTemplate(s),e.isServerRendered&&s&&s.querySelector(".e-ddl-footer")&&s.appendChild(s.querySelector(".e-ddl-footer")),document.body.appendChild(s),e.updateServerPopup(s),s.style.visibility="hidden","auto"!==e.popupHeight){if(e.searchBoxHeight=0,t.isNullOrUndefined(l.container)||(e.searchBoxHeight=l.container.parentElement.getBoundingClientRect().height,e.listHeight=(parseInt(e.listHeight,10)-e.searchBoxHeight).toString()+"px"),e.headerTemplate||e.isServerRendered&&s&&s.querySelector(".e-ddl-header")){e.header=e.header?e.header:s.querySelector(".e-ddl-header");o=Math.round(e.header.getBoundingClientRect().height);e.listHeight=(parseInt(e.listHeight,10)-(o+e.searchBoxHeight)).toString()+"px"}if(e.footerTemplate||e.isServerRendered&&s&&s.querySelector(".e-ddl-footer")){e.footer=e.footer?e.footer:s.querySelector(".e-ddl-footer");var o=Math.round(e.footer.getBoundingClientRect().height);e.listHeight=(parseInt(e.listHeight,10)-(o+e.searchBoxHeight)).toString()+"px"}e.list.style.maxHeight=(parseInt(e.listHeight,10)-2).toString()+"px",s.style.maxHeight=t.formatUnit(e.popupHeight)}else s.style.height="auto";var r=0,n=void 0;if(!t.isNullOrUndefined(e.selectedLI)&&!t.isNullOrUndefined(e.activeIndex)&&e.activeIndex>=0?e.setScrollPosition():e.list.scrollTop=0,t.Browser.isDevice&&!e.allowFiltering&&("dropdownlist"===e.getModuleName()||e.isDropDownClick&&"combobox"===e.getModuleName())){r=e.getOffsetValue(s);var a=e.isEmptyList()?e.list:e.liCollections[0];n=-(parseInt(getComputedStyle(a).textIndent,10)-parseInt(getComputedStyle(e.inputElement).paddingLeft,10)+parseInt(getComputedStyle(e.inputElement.parentElement).borderLeftWidth,10))}e.getFocusElement(),e.createPopup(s,r,n),e.checkCollision(s),t.Browser.isDevice&&(e.popupObj.element.classList.add(I.device),("dropdownlist"===e.getModuleName()||"combobox"===e.getModuleName()&&!e.allowFiltering&&e.isDropDownClick)&&(e.popupObj.collision={X:"fit",Y:"fit"}),e.isFilterLayout()&&(e.popupObj.element.classList.add(I.mobileFilter),e.popupObj.position={X:0,Y:0},e.popupObj.dataBind(),t.attributes(e.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,e.popupObj.element],I.popupFullScreen),e.setSearchBoxPosition(),e.backIconElement=l.container.querySelector(".e-back-icon"),e.clearIconElement=l.container.querySelector("."+I.clearIcon),t.EventHandler.add(e.backIconElement,"click",e.clickOnBackIcon,e),t.EventHandler.add(e.clearIconElement,"click",e.clearText,e))),s.style.visibility="visible",t.addClass([s],"e-popup-close");for(var h=0,p=e.popupObj.getScrollableParent(e.inputWrapper.container);h<p.length;h++){var u=p[h];t.EventHandler.add(u,"scroll",e.scrollHandler,e)}t.Browser.isDevice&&e.isFilterLayout()&&t.EventHandler.add(e.list,"scroll",e.listScroll,e),t.isNullOrUndefined(e.list)||(e.unWireListEvents(),e.wireListEvents()),t.attributes(e.targetElement(),{"aria-expanded":"true"});var c=e.isFiltering()?e.filterInput.parentElement:e.inputWrapper.container;t.addClass([c],[I.inputFocus]);var d={name:"FadeIn",duration:100};e.beforePopupOpen=!0;var m={popup:t.isBlazor()&&e.isServerRendered?null:e.popupObj,cancel:!1,animation:d};e.trigger("open",m,function(i){i.cancel?(e.beforePopupOpen=!1,e.destroyPopup()):(e.serverBlazorUpdateSelection(),e.bindServerScrollEvent(),t.addClass([e.inputWrapper.container],[I.iconAnimation]),e.renderReactTemplates(),e.popupObj.show(new t.Animation(i.animation),1e3===e.zIndex?e.element:null))})}})},s.prototype.checkCollision=function(e){(!t.Browser.isDevice||t.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&(l.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.serverBlazorUpdateSelection=function(){(this.isServerBlazor&&(null!==this.value||null!==this.index||null!==this.text)||"dropdownlist"!==this.getModuleName()&&!this.isTyped)&&("dropdownlist"===this.getModuleName()&&(this.removeSelection(),this.removeFocus(),this.removeHover(),this.updateValues()),"combobox"===this.getModuleName()&&this.ulElement&&this.findListElement(this.ulElement,"li","data-value",this.value)&&!this.isTyped&&this.updateValues(),this.isServerBlazor&&"dropdownlist"!==this.getModuleName()&&(""===this.text||null===this.text)&&this.ulElement&&(this.ulElement.querySelector("li").classList.contains(k.hover)||t.addClass([this.ulElement.querySelector("li")],k.hover)))},s.prototype.bindServerScrollEvent=function(){this.isServerBlazor&&this.list&&this.fields.groupBy&&!this.isGroupChecking&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this))},s.prototype.updateServerPopup=function(e){this.isServerBlazor&&(e&&e.querySelector("li")&&t.removeClass([e.querySelector(".e-content")],["e-nodata"]),this.initial=!1,e.removeAttribute("style"))},s.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},s.prototype.createPopup=function(e,i,s){var o=this;this.popupObj=new l.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){o.isDocumentClick||o.focusDropDown(),o.isReact&&o.clearTemplate(["headerTemplate","footerTemplate"]);var e="autocomplete"===o.getModuleName();o.DropDownBaseresetBlazorTemplates(e,e,!0,!0,!1,!0,!0),o.isNotSearchList=!1,o.isDocumentClick=!1,o.destroyPopup(),o.isFiltering()&&o.actionCompleteData.list&&o.actionCompleteData.list[0]&&(o.isActive=!0,o.onActionComplete(o.actionCompleteData.ulElement,o.actionCompleteData.list,null,!0))},open:function(){t.EventHandler.add(document,"mousedown",o.onDocumentClick,o),o.isPopupOpen=!0;var e=o.actionCompleteData&&o.actionCompleteData.ulElement&&o.actionCompleteData.ulElement.querySelector("li"),i=o.list.querySelector("ul li");o.isFiltering()&&o.itemTemplate&&o.element.tagName===o.getNgDirective()&&e&&i&&e.textContent!==i.textContent&&"EJS-COMBOBOX"!==o.element.tagName&&o.cloneElements(),o.isFilterLayout()&&(t.removeClass([o.inputWrapper.container],[I.inputFocus]),o.isFilterFocus=!0,o.filterInput.focus(),o.inputWrapper.clearButton&&t.addClass([o.inputWrapper.clearButton],I.clearIconHide)),o.activeStateChange()},targetExitViewport:function(){t.Browser.isDevice||o.hidePopup()}})},s.prototype.isEmptyList=function(){return!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},s.prototype.getFocusElement=function(){},s.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},s.prototype.scrollHandler=function(){t.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.hidePopup()},s.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 i=this.filterInput.parentElement.querySelector("."+I.clearIcon);t.detach(this.filterInput),i.parentElement.insertBefore(this.filterInput,i)},s.prototype.setPopupPosition=function(e){var i,s=e,l=this.list.querySelector("."+I.focus)||this.selectedLI,o=this.isEmptyList()?this.list:this.liCollections[0],r=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],n=o.getBoundingClientRect().height,a=this.list.offsetHeight/2,h=t.isNullOrUndefined(l)?o.offsetTop:l.offsetTop;if(r.offsetTop-a<h&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0&&!t.isNullOrUndefined(l)){var p=this.list.offsetHeight/n,u=parseInt(getComputedStyle(this.list).paddingBottom,10);i=(p-(this.liCollections.length-this.activeIndex))*n-s+u,this.list.scrollTop=l.offsetTop}else h>a?(i=a-n/2,this.list.scrollTop=h-a+n/2):i=h;return-(i=i+n+s-(n-this.inputWrapper.container.offsetHeight)/2)},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);if(e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px"),t.Browser.isDevice&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var i=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(i).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},s.prototype.scrollBottom=function(e){if(!t.isNullOrUndefined(this.selectedLI)){var i=this.list.offsetHeight,s=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,l=this.list.scrollTop+s-i;l=e?l+2*parseInt(getComputedStyle(this.list).paddingTop,10):l;var o=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;o=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?o-this.fixedHeaderElement.offsetHeight:o,0===this.activeIndex?this.list.scrollTop=0:(s>i||!(o>0&&this.list.offsetHeight>o))&&(this.list.scrollTop=l)}},s.prototype.scrollTop=function(){if(!t.isNullOrUndefined(this.selectedLI)){var e=this.selectedLI.offsetTop-this.list.scrollTop;e=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?e-this.fixedHeaderElement.offsetHeight:e;var i=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:i>0&&this.list.offsetHeight>i||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0))}},s.prototype.isEditTextBox=function(){return!1},s.prototype.isFiltering=function(){return this.allowFiltering},s.prototype.isPopupButton=function(){return!0},s.prototype.setScrollPosition=function(e){if(t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},s.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null)},s.prototype.listScroll=function(){this.filterInput.blur()},s.prototype.setEleWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.inputWrapper.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.closePopup=function(e){var i=this;if(this.isTyped=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.filterInputObj=null,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var s=0,l=this.popupObj.getScrollableParent(this.inputWrapper.container);s<l.length;s++){var o=l[s];t.EventHandler.remove(o,"scroll",this.scrollHandler)}t.Browser.isDevice&&this.isFilterLayout()&&(t.removeClass([document.body,this.popupObj.element],I.popupFullScreen),t.EventHandler.remove(this.list,"scroll",this.listScroll)),this.isFilterLayout()&&(t.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(t.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),t.EventHandler.remove(this.filterInput,"input",this.onInput),t.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),t.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),t.EventHandler.remove(this.filterInput,"blur",this.onBlur),t.EventHandler.remove(this.filterInput,"paste",this.pasteHandler),this.filterInput=null),t.attributes(this.targetElement(),{"aria-expanded":"false","aria-activedescendant":null}),this.inputWrapper.container.classList.remove(I.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.beforePopupOpen=!1;var r={name:"FadeOut",duration:100,delay:e||0},n={popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,cancel:!1,animation:r};this.trigger("close",n,function(e){if(!t.isNullOrUndefined(i.popupObj)&&!t.isNullOrUndefined(i.popupObj.element.querySelector(".e-fixed-head"))){var s=i.popupObj.element.querySelector(".e-fixed-head");s.parentNode.removeChild(s),i.fixedHeaderElement=null}e.cancel||("autocomplete"!==i.getModuleName()||i.isServerBlazor||i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new t.Animation(e.animation)):i.destroyPopup())})}},s.prototype.destroyPopup=function(){var e=t.select("#"+this.element.id+"_popup_holder",document);this.isServerBlazor&&this.serverPopupEle&&e&&(e.appendChild(this.serverPopupEle),this.interopAdaptor.invokeMethodAsync("OnServerClosePopup")),this.isPopupOpen=!1,this.isFilterFocus=!1,this.popupObj.destroy(),t.detach(this.popupObj.element)},s.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},s.prototype.render=function(){if(this.isServerBlazor)this.inputElement=this.element,this.inputWrapper={container:this.element.parentElement},this.hiddenElement=this.inputWrapper.container.querySelector("select"),this.inputWrapper.buttons=[this.inputWrapper.container.querySelector(".e-input-group-icon.e-ddl-icon")],this.showClearButton&&(this.inputWrapper.clearButton=this.inputWrapper.container.querySelector(".e-clear-icon"),o.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)),"Auto"===this.floatLabelType&&o.Input.wireFloatingEvents(this.element),o.Input.bindInitialEvent({element:this.element,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties}),this.setFields(),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.enabled||(this.targetElement().tabIndex=-1),this.element.hasAttribute("autofocus")&&this.focusIn(),this.initial=!1;else{"INPUT"===this.element.tagName?(this.inputElement=this.element,t.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","textbox"),t.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text")):(this.inputElement=this.createElement("input",{attrs:{role:"textbox",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;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=o.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[I.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:I.hiddenElement}}),t.prepend([this.hiddenElement],this.inputWrapper.container),this.validationAttribute(this.element,this.hiddenElement),this.setFields(),this.inputWrapper.container.style.width=t.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var i=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");if(this.element.id=i,this.hiddenElement.id=i+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),t.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),null!==this.value||null!==this.activeIndex||null!==this.text)this.initValue();else if("SELECT"===this.element.tagName&&this.element.options[0]){var s=this.element;this.value=s.options[s.selectedIndex].value,this.text=t.isNullOrUndefined(this.value)?null:s.options[s.selectedIndex].textContent,this.initValue()}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(),t.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text)}this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},s.prototype.setFooterTemplate=function(e){var i;this.footer?this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],I.footer));var s=(i=this.dropdownCompiler(this.footerTemplate)?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);if(s&&s.length>0)for(var l=0;l<s.length;l++)this.footer.appendChild(s[l]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!1,!0),t.append([this.footer],e)},s.prototype.setHeaderTemplate=function(e){var i;this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],I.header));var s=(i=this.dropdownCompiler(this.headerTemplate)?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);if(s&&s.length)for(var l=0;l<s.length;l++)this.header.appendChild(s[l]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!0,!1);var o=e.querySelector("div.e-content");e.insertBefore(this.header,o)},s.prototype.setOldText=function(e){this.text=e},s.prototype.setOldValue=function(e){this.value=e},s.prototype.refreshPopup=function(){t.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||t.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(t.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},s.prototype.checkData=function(e){!e.dataSource||t.isNullOrUndefined(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof i.DataManager||(this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var s=-1!==Object.keys(e).indexOf("value")&&t.isNullOrUndefined(e.value),l=-1!==Object.keys(e).indexOf("text")&&t.isNullOrUndefined(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(s||l)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!t.isNullOrUndefined(Object.keys(e.dataSource))&&(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1})},s.prototype.updateDataSource=function(e){""===this.inputElement.value&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)||e.dataSource!==[])&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},s.prototype.checkCustomValue=function(){this.itemData=this.getDataByValue(this.value);var e=this.getItemData();this.setProperties({value:e.value,text:e.text})},s.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onPropertyChanged=function(s,l){"dropdownlist"===this.getModuleName()&&(this.isServerBlazor||(this.checkData(s),this.setUpdateInitial(["fields","query","dataSource"],s)));for(var r=0,n=Object.keys(s);r<n.length;r++){var a=n[r];switch(a){case"query":case"dataSource":break;case"htmlAttributes":this.setHTMLAttributes();break;case"width":this.setEleWidth(s.width);break;case"placeholder":o.Input.setPlaceholder(s.placeholder,this.inputElement);break;case"filterBarPlaceholder":this.filterInput&&o.Input.setPlaceholder(s.filterBarPlaceholder,this.filterInput);break;case"readonly":"dropdownlist"!==this.getModuleName()&&o.Input.setReadonly(s.readonly,this.inputElement);break;case"cssClass":this.setCssClass(s.cssClass,l.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"enabled":this.setEnable();break;case"text":if(null===s.text){this.clearAll();break}if(this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender){var h=this.getElementByText(s.text);this.checkValidLi(h)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.text,l.text,"text"):this.isServerBlazor||this.setOldText(l.text)),this.updateInputFields()}break;case"value":if(null===s.value){this.clearAll();break}if(this.notify("beforeValueChange",{newProp:s}),this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender){var p=this.getElementByValue(s.value);this.checkValidLi(p)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.value,l.value,"value"):this.isServerBlazor||this.setOldValue(l.value)),this.updateInputFields(),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange}break;case"index":if(null===s.index){this.clearAll();break}if(this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender&&this.liCollections){var u=this.liCollections[s.index];this.checkValidLi(u)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.index,l.index,"index"):this.isServerBlazor||(this.index=l.index)),this.updateInputFields()}break;case"footerTemplate":this.popupObj&&this.setFooterTemplate(this.popupObj.element);break;case"headerTemplate":this.popupObj&&this.setHeaderTemplate(this.popupObj.element);break;case"valueTemplate":t.isNullOrUndefined(this.itemData)||null==this.valueTemplate||this.setValueTemplate();break;case"allowFiltering":this.allowFiltering&&(this.actionCompleteData={ulElement:this.ulElement,list:this.listData,isUpdated:!0},this.updateSelectElementData(this.allowFiltering));break;case"floatLabelType":o.Input.removeFloating(this.inputWrapper),o.Input.addFloating(this.inputElement,s.floatLabelType,this.placeholder,this.createElement);break;case"showClearButton":o.Input.setClearButton(s.showClearButton,this.inputElement,this.inputWrapper,null,this.createElement),this.bindClearEvent();break;default:var c=this.getPropObject(a,s,l);e.prototype.onPropertyChanged.call(this,c.newProperty,c.oldProperty)}}},s.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},s.prototype.setSelectionData=function(e,t,i){var s,l=this;this.updateListValues=function(){"text"===i?(s=l.getElementByText(e),l.checkValidLi(s)||l.setOldText(t)):"value"===i?(s=l.getElementByValue(e),l.checkValidLi(s)||l.setOldValue(t)):"index"===i&&(s=l.liCollections[e],l.checkValidLi(s)||(l.index=t))}},s.prototype.setCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),o.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupObj&&o.Input.setCssClass(e,[this.popupObj.element],i)},s.prototype.getModuleName=function(){return"dropdownlist"},s.prototype.showPopup=function(){if(this.enabled){if(t.isBlazor()&&this.itemTemplate&&this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1),this.beforePopupOpen)return void 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)):t.isNullOrUndefined(this.list)||!t.isUndefined(this.list)&&(this.list.classList.contains(k.noData)||this.list.querySelectorAll("."+k.li).length<=0)?this.renderList():this.isFiltering()&&this.isServerBlazor&&this.renderList(),this.isServerBlazor||this.invokeRenderPopup();var e=!this.isFiltering()||t.select("#"+this.element.id+"_popup_holder",document),i="dropdownlist"===this.getModuleName()||!this.isFiltering();this.isServerBlazor&&e&&!t.isNullOrUndefined(this.list)&&i&&this.invokeRenderPopup()}},s.prototype.invokeRenderPopup=function(){if(t.Browser.isDevice&&this.isFilterLayout()){var e=this;window.onpopstate=function(){e.hidePopup()},history.pushState({},"")}t.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(k.noData)||this.renderPopup(),t.attributes(this.targetElement(),{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})},s.prototype.clientRenderPopup=function(e,i){i?(this.serverPopupEle=i,this.list=i.querySelector(".e-dropdownbase.e-content")?i.querySelector(".e-dropdownbase.e-content"):this.list,this.ulElement=this.list.querySelector("ul"),t.isNullOrUndefined(this.ulElement)&&!this.list.classList.contains(k.noData)&&t.addClass([this.list],[k.noData]),this.liCollections=this.ulElement?this.ulElement.querySelectorAll("."+k.li):[],this.listData=e,"autocomplete"===this.getModuleName()&&this.liCollections.length>0&&this.renderHightSearch(),this.initRemoteRender=!1,this.isPopupOpen||this.serverBlazorUpdateSelection(),this.unWireListEvents(),this.wireListEvents(),this.isServerIncrementalSearch&&this.searchKeyEvent&&(this.isServerIncrementalSearch=!1,this.initial=!1,this.onServerIncrementalSearch(this.searchKeyEvent)),this.isServerNavigation&&this.searchKeyEvent&&("down"===this.searchKeyEvent.action||"up"===this.searchKeyEvent.action?(this.isServerNavigation=!1,this.updateUpDownAction(this.searchKeyEvent)):"home"!==this.searchKeyEvent.action&&"end"!==this.searchKeyEvent.action||(this.isServerNavigation=!1,this.updateHomeEndAction(this.searchKeyEvent))),this.beforePopupOpen&&this.invokeRenderPopup(),"dropdownlist"!==this.getModuleName()&&this.onActionComplete(this.ulElement,this.listData)):null!=e&&this.listData!==e&&(this.listData=e,this.initRemoteRender=!1)},s.prototype.renderHightSearch=function(){},s.prototype.updateclientItemData=function(e){this.listData=e},s.prototype.initValueItemData=function(e){this.itemData=e,this.previousValue=this.value,this.initial=!1},s.prototype.serverUpdateListElement=function(e,t){this.listData=e,this.ulElement&&(this.liCollections=this.ulElement.querySelectorAll("."+k.li))},s.prototype.hidePopup=function(e){var i=!!this.headerTemplate,s=!!this.headerTemplate;if(this.DropDownBaseresetBlazorTemplates(!1,!1,!1,!1,!1,i,s),this.isEscapeKey&&"dropdownlist"===this.getModuleName())if(o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,t.isNullOrUndefined(this.index))this.resetSelection();else{var l=this.findListElement(this.ulElement,"li","data-value",this.value);this.selectedLI=this.liCollections[this.index]||l,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.closePopup();var r=this.getItemData(),n=this.isServerBlazor?!t.isNullOrUndefined(this.value):!t.isNullOrUndefined(this.selectedLI);this.inputElement&&""===this.inputElement.value.trim()&&!this.isInteracted&&(this.isSelectCustom||n&&this.inputElement.value!==r.text)&&(this.isSelectCustom=!1,this.clearAll(e))},s.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(I.disable)){var i=!1;this.preventFocus&&t.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,i=!0),i||this.targetElement().focus(),t.addClass([this.inputWrapper.container],[I.inputFocus]),this.onFocus(e)}},s.prototype.focusOut=function(e){this.enabled&&(this.isTyped=!0,this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),t.removeClass([this.inputWrapper.container],[I.inputFocus]))},s.prototype.destroy=function(){if(this.isActive=!1,this.isReact&&this.clearTemplate(),(!this.isServerBlazor||this.popupObj&&document.body.contains(this.popupObj.element))&&this.hidePopup(),this.unWireEvent(),this.list&&(this.unWireListEvents(),this.isServerBlazor&&this.fields.groupBy&&!this.isGroupChecking&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)),!this.isServerBlazor){if(this.element&&!this.element.classList.contains("e-"+this.getModuleName()))return;if(this.inputElement){for(var i=["readonly","aria-disabled","aria-placeholder","placeholder","aria-owns","aria-labelledby","aria-haspopup","aria-expanded","aria-activedescendant","autocomplete","aria-readonly","autocorrect","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],s=0;s<i.length;s++)this.inputElement.removeAttribute(i[s]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),o.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container.parentElement.tagName===this.getNgDirective()?t.detach(this.inputWrapper.container):(this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),t.detach(this.inputWrapper.container)),e.prototype.destroy.call(this)}},s.prototype.getItems=function(){return this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.clear=function(){this.value=null},T([t.Property(null)],s.prototype,"cssClass",void 0),T([t.Property("100%")],s.prototype,"width",void 0),T([t.Property("300px")],s.prototype,"popupHeight",void 0),T([t.Property("100%")],s.prototype,"popupWidth",void 0),T([t.Property(null)],s.prototype,"placeholder",void 0),T([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),T([t.Property({})],s.prototype,"htmlAttributes",void 0),T([t.Property(null)],s.prototype,"query",void 0),T([t.Property(null)],s.prototype,"valueTemplate",void 0),T([t.Property(null)],s.prototype,"headerTemplate",void 0),T([t.Property(null)],s.prototype,"footerTemplate",void 0),T([t.Property(!1)],s.prototype,"allowFiltering",void 0),T([t.Property(!1)],s.prototype,"readonly",void 0),T([t.Property(null)],s.prototype,"text",void 0),T([t.Property(null)],s.prototype,"value",void 0),T([t.Property(null)],s.prototype,"index",void 0),T([t.Property("Never")],s.prototype,"floatLabelType",void 0),T([t.Property(!1)],s.prototype,"showClearButton",void 0),T([t.Event()],s.prototype,"filtering",void 0),T([t.Event()],s.prototype,"change",void 0),T([t.Event()],s.prototype,"beforeOpen",void 0),T([t.Event()],s.prototype,"open",void 0),T([t.Event()],s.prototype,"close",void 0),T([t.Event()],s.prototype,"blur",void 0),T([t.Event()],s.prototype,"focus",void 0),s=T([t.NotifyPropertyChanges],s)}(B),P=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])})(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)}}(),F=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},W="e-input-group-icon e-ddt-icon e-icons",H="e-show-chip",V="e-show-clear",U="e-chip-input",M="e-input-focus",j="e-icon-hide",R="e-check",q="e-no-data",z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),F([t.Property("child")],i.prototype,"child",void 0),F([t.Property([])],i.prototype,"dataSource",void 0),F([t.Property("expanded")],i.prototype,"expanded",void 0),F([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),F([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),F([t.Property("iconCss")],i.prototype,"iconCss",void 0),F([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),F([t.Property("parentValue")],i.prototype,"parentValue",void 0),F([t.Property(null)],i.prototype,"query",void 0),F([t.Property("selected")],i.prototype,"selected",void 0),F([t.Property(null)],i.prototype,"tableName",void 0),F([t.Property("text")],i.prototype,"text",void 0),F([t.Property("tooltip")],i.prototype,"tooltip",void 0),F([t.Property("value")],i.prototype,"value",void 0),i}(t.ChildProperty),K=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),F([t.Property(!1)],i.prototype,"autoCheck",void 0),F([t.Property("Auto")],i.prototype,"expandOn",void 0),F([t.Property(!1)],i.prototype,"loadOnDemand",void 0),i}(t.ChildProperty),_=function(e){function s(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}return P(s,e),s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.getLocaleName=function(){return"drop-down-tree"},s.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.isBlazorPlatForm=t.isBlazor(),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.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"}},s.prototype.render=function(){this.ensureAutoCheck(),"INPUT"===this.element.tagName?(this.inputEle=this.element,t.isNullOrUndefined(this.inputEle.getAttribute("role"))&&this.inputEle.setAttribute("role","textbox"),t.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=o.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[W]: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("e-input-group")||this.inputWrapper.classList.add("e-input-group"),this.showDropDownIcon&&this.inputWrapper.classList.add("e-show-dd-icon"),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.setAttributes(),this.updateDataAttribute(),this.setHTMLAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content",attrs:{tabindex:"0"}}),this.popupDiv.classList.add("e-dropdown"),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),document.body.appendChild(this.popupDiv),this.wireTreeEvents(),this.popupDiv.style.display="none",this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof i.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+j}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&t.addClass([this.overFlowWrapper],"e-show-text"))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var e=t.select(".e-list-parent",this.treeObj.element);e&&e.getAttribute("aria-multiselectable")&&e.removeAttribute("aria-multiselectable"),this.oldValue=this.value,this.isInitialized=!0,this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate,this.renderComplete()},s.prototype.ensureAutoCheck=function(){this.allowFiltering&&this.treeSettings.autoCheck&&this.setProperties({treeSettings:{autoCheck:!1}},!0)},s.prototype.hideCheckAll=function(e){var i=t.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector(".e-selectall-parent");t.isNullOrUndefined(i)||(e&&!i.classList.contains("e-hide-selectall")?t.addClass([i],"e-hide-selectall"):!e&&i.classList.contains("e-hide-selectall")&&t.removeClass([i],"e-hide-selectall"))},s.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:"e-filter-wrap"});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),t.prepend([this.filterContainer],this.popupEle),this.filterObj=new o.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter")},s.prototype.filterChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){i.filterHandler(e.value,e.event)},this.filterDelayTime))},s.prototype.filterHandler=function(e,t){var s=this;this.isFilteredData||(this.treeData=this.treeObj.getTreeData());var l=this.cloneFields(this.fields),o={cancel:!1,preventDefaultAction:!1,event:t,text:e,fields:l};this.trigger("filtering",o,function(t){if(!t.cancel){var l=!1,o=void 0;if(s.isFilteredData=!0,""===e?(s.isFilteredData=!1,s.isFilterRestore=!0,o=s.cloneFields(s.fields)):t.preventDefaultAction?o=t.fields:1===s.treeDataType?o=s.selfReferencefilter(e,t.fields):s.fields.dataSource instanceof i.DataManager?l=!0:o=s.nestedFilter(e,t.fields),s.hideCheckAll(s.isFilteredData),l)return;s.treeObj.fields=s.getTreeFields(o),s.treeObj.dataBind()}})},s.prototype.nestedFilter=function(e,i){for(var s=[],l=0;l<this.treeData.length;l++){var o=this.nestedChildFilter(e,this.treeData[l]);t.isNullOrUndefined(o)||s.push(o)}return i.dataSource=s,i},s.prototype.nestedChildFilter=function(e,i){var s=i[this.fields.child];if(t.isNullOrUndefined(s))return this.isMatchedNode(e,i)?i:null;for(var l=[],o=0;o<s.length;o++){var r=this.nestedChildFilter(e,s[o]);t.isNullOrUndefined(r)||l.push(r)}return 0!==l.length?(i[this.fields.child]=l,i):(i[this.fields.child]=null,this.isMatchedNode(e,i)?i:null)},s.prototype.selfReferencefilter=function(e,i){for(var s=[],l=[],o=0;o<this.treeData.length;o++)this.isMatchedNode(e,this.treeData[o])&&s.push(this.treeData[o]);for(o=0;o<s.length;o++)if(-1===l.indexOf(s[o])){l.push(s[o]);for(var r=s[o][this.fields.parentValue];!t.isNullOrUndefined(r);){for(var n=null,a=0;a<this.treeData.length;a++){var h=this.treeData[a][this.fields.value];if(!t.isNullOrUndefined(h)&&h===r){n=this.treeData[a];break}}if(t.isNullOrUndefined(n)||-1!==l.indexOf(n))break;l.push(n),r=n[this.fields.parentValue]}}return i.dataSource=l,i},s.prototype.isMatchedNode=function(e,t){var s=t[this.fields.text];return this.ignoreCase&&(s=s.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(s=i.DataUtil.ignoreDiacritics(s),e=i.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?s.slice(0,e.length)===e:"EndsWith"===this.filterType?s.slice(-e.length)===e:-1!==s.indexOf(e)},s.prototype.wireEvents=function(){t.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),t.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),t.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(window,"resize",this.windowResize,this);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new t.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireTreeEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),t.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),t.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),t.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(window,"resize",this.windowResize);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler)},s.prototype.dropDownClick=function(e){if(this.enabled&&!this.readonly){if(this.isClearButtonClick)return void(this.isClearButtonClick=!1);!this.wrapText&&e.target.classList.contains("e-chips-close")&&this.removeChip(e),this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()}},s.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},s.prototype.onMouseLeave=function(){this.inputFocus||(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V))},s.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},s.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!t.Browser.isIE&&"edge"!==t.Browser.info.name||e.target!==this.inputWrapper)){var i=e.relatedTarget;i===this.inputEle||!t.isNullOrUndefined(i)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},s.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=t.select(".e-clear-icon",this.inputWrapper).offsetWidth,t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)),t.removeClass([this.inputWrapper],[M]),this.allowMultiSelection||this.showCheckBox){var i=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)),!this.wrapText&&i&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.oldValue=this.value,this.trigger("blur")},s.prototype.updateView=function(){(this.showCheckBox||this.allowMultiSelection)&&("Box"!==this.mode?t.addClass([this.inputWrapper,this.overFlowWrapper],"e-show-text"):t.addClass([this.inputWrapper],H),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],j),t.addClass([this.inputEle],U),this.updateOverFlowView(),this.ensurePlaceHolder()))},s.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.oldValue=this.value}},s.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return null===e?t===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},s.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,t.addClass([this.inputWrapper],[M]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(t.removeClass([this.chipWrapper],j),t.addClass([this.inputEle],U)),t.addClass([this.inputWrapper],H),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||(this.inputWrapper.contains(this.overFlowWrapper)&&t.addClass([this.overFlowWrapper],j),"Delimiter"===this.mode?(t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)):t.addClass([this.inputWrapper],H),t.removeClass([this.inputWrapper],"e-show-text"),this.ensurePlaceHolder()));var i={isInteracted:!!e,event:e};this.trigger("focus",i)}},s.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":case"shiftTab":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)}})},s.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":case"shiftTab":case"tab":t.isPopupOpen&&t.hidePopup();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus()}})},s.prototype.checkAllAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"space":t.clickHandler(e);break;case"moveDown":t.treeObj.element.focus()}})},s.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputWrapper,"form");i&&e.target===i&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},s.prototype.getAriaAttributes=function(){return{"aria-disabled":this.enabled?"false":"true","aria-owns":this.element.id+"_options",role:"listbox","aria-haspopup":"true","aria-expanded":"false","aria-activedescendant":"null","aria-labelledby":this.hiddenElement.id}},s.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove("e-total-count"),t.removeClass([this.overFlowWrapper],j),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=void 0,o=1,r=void 0,n=void 0,a=0;this.overFlowWrapper.innerHTML="";var h={overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"};this.l10n=new t.L10n(this.getLocaleName(),h,this.locale);var p=this.l10n.getConstant("overflowCountTemplate"),u=this.createElement("span",{className:"e-remain"}),c=t.compile(p),d=t.compile(this.l10n.getConstant("totalCountTemplate"));u.appendChild(c({count:this.value.length},this,"overflowCountTemplate",null,!this.isStringTemplate)[0]),this.overFlowWrapper.appendChild(u);var m=u.offsetWidth;if(t.remove(u),this.showDropDownIcon&&(a=t.select(".e-ddt-icon",this.inputWrapper).offsetWidth),!t.isNullOrUndefined(this.value))if("Box"!==this.mode)for(var f=0;!t.isNullOrUndefined(this.value[f]);f++){if(e+=0===f?"":this.delimiterChar+" ",s=this.getOverflowVal(f),e+=s,s=this.overFlowWrapper.innerHTML,this.overFlowWrapper.innerHTML=e,r=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,f=o+1),this.overFlowWrapper.innerHTML=s,n=this.value.length-f,r=this.overFlowWrapper.offsetWidth;r+m+a+this.clearIconWidth>=i&&0!==r&&""!==this.overFlowWrapper.innerHTML;){var v=this.overFlowWrapper.innerHTML.split(this.delimiterChar);v.pop(),this.overFlowWrapper.innerHTML=v.join(this.delimiterChar),n++,r=this.overFlowWrapper.offsetWidth}break}r+m+a+this.clearIconWidth<=i?(l=e,o=f):0===f&&(l="",o=-1)}else{t.addClass([this.chipWrapper],j);for(var y=this.chipWrapper.cloneNode(!0),g=t.selectAll(".e-chips",y),C=0;C<g.length;C++){if(s=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(g[C]),e=this.overFlowWrapper.innerHTML,r=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,C=o+1),this.overFlowWrapper.innerHTML=s,n=this.value.length-C,r=this.overFlowWrapper.offsetWidth;r+m+a+this.clearIconWidth>=i&&0!==r&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),n++,r=this.overFlowWrapper.offsetWidth;break}r+m+a+this.clearIconWidth<=i?(l=e,o=C):0===C&&(l="",o=-1)}}n>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(u,n,c,d)),"Box"!==this.mode||this.overFlowWrapper.classList.contains("e-total-count")||t.addClass([u],"e-wrap-count")}else this.overFlowWrapper.innerHTML="",t.addClass([this.overFlowWrapper],j);this.updateDelimMode()},s.prototype.updateRemainTemplate=function(e,i,s,l){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.appendChild(!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?l({count:i},this,"totalCountTemplate",null,!this.isStringTemplate)[0]:s({count:i},this,"overflowCountTemplate",null,!this.isStringTemplate)[0]),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(t.addClass([this.overFlowWrapper],"e-total-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.removeClass([this.overFlowWrapper],"e-total-count"),e},s.prototype.getOverflowVal=function(e){var i=this.getSelectedData(this.value[e]);return t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",i)},s.prototype.updateDelimMode=function(){"Box"!==this.mode?t.select(".e-remain",this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains("e-total-count")?(t.addClass([this.overFlowWrapper],"e-wrap-count"),t.addClass([this.overFlowWrapper],"e-show-text")):(this.overFlowWrapper.classList.remove("e-wrap-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.select(".e-remain",this.overFlowWrapper)&&this.overFlowWrapper.classList.remove("e-wrap-count")},s.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-ddt-hidden",tabindex:"-1",multiple:""}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:"e-ddt-hidden"}}),t.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},s.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.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]))}},s.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),t.addClass([this.inputWrapper],H),this.getValidMode()&&null!==this.value?t.addClass([this.inputEle],U):null===this.value&&t.addClass([this.chipWrapper],j))},s.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},s.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:"e-selectall-parent",attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="";var e=t.closest(this.element,".e-bigger"),i=t.isNullOrUndefined(e)?"":"e-small";this.checkBoxElement=r.createCheckBox(this.createElement,!0,{cssClass:i}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),t.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},s.prototype.clickHandler=function(e){var i;if(i=e.currentTarget&&e.currentTarget.classList.contains("e-selectall-parent")?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=t.closest(i,".e-checkbox-wrapper"),!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.changeState(this.checkWrapper,s.classList.contains(R)?"uncheck":"check",e)}e.preventDefault()},s.prototype.changeState=function(e,i,s){var l,o=e.getElementsByClassName("e-frame")[0];"check"!==i||o.classList.contains(R)?"uncheck"===i&&o.classList.contains(R)&&(o.classList.remove(R),l="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!1)):(o.classList.add(R),l="true",this.isReverseUpdate||(this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),l="check"===i?"true":"false",t.isNullOrUndefined(l)||e.setAttribute("aria-checked",l)},s.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var i=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var s=0,l=t.compile(i)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);s<l.length;s++){var o=l[s];this.selectAllSpan.textContent=o.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},s.prototype.setAttributes=function(){this.element.removeAttribute("tabindex");var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex","0"),t.attributes(this.inputWrapper,this.getAriaAttributes())},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s)this.inputWrapper.classList.add(this.htmlAttributes[s]);else if("disabled"===s&&"disabled"===this.htmlAttributes[s])this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[s]))if("style"===s)this.inputWrapper.setAttribute("style",this.htmlAttributes[s]);else{var l=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],r=["name","required"];0===s.indexOf("data")||r.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):l.indexOf(s)>-1?"placeholder"===s?o.Input.setPlaceholder(this.htmlAttributes[s],this.inputEle):this.inputEle.setAttribute(s,this.htmlAttributes[s]):this.inputWrapper.setAttribute(s,this.htmlAttributes[s])}else this.setProperties({readonly:!0},!0),this.dataBind()}},s.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1===i.indexOf(this.element.attributes[l].name)&&"readonly"!==this.element.attributes[l].name&&(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},s.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(t.removeClass([this.overAllClear],j),t.addClass([this.inputWrapper],V)):(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)))},s.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var i=0;i<this.value.length;i++)e=this.treeObj.getTreeData(this.value[i])[0],t.isNullOrUndefined(e)&&this.value.splice(this.value.indexOf(this.value[i]),1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],t.isNullOrUndefined(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},s.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,i=[];if(this.showCheckBox||this.allowMultiSelection){for(var s=this.text.split(this.delimiterChar),l=0;l<s.length;l++)e=this.getItems(s[l]),t.isNullOrUndefined(e)||i.push(e[this.fields.value].toString());0!==i.length?(this.oldValue=this.value,this.setProperties({value:i},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),t.isNullOrUndefined(e)?this.setProperties({text:this.currentText},!0):(this.oldValue=this.value,this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},s.prototype.setSelectedValue=function(){null==this.value&&(this.isInitialized||(this.oldValue=this.value,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),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value))},s.prototype.setValidValue=function(){if(this.showCheckBox||this.allowMultiSelection)this.showCheckBox?(this.treeObj.checkedNodes=this.value.slice(),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind();else{o.Input.setValue(this.text,this.inputEle,this.floatLabelType);var e=this.value[0].toString();this.treeObj.selectedNodes[0]!==e&&t.setValue("selectedNodes",[e],this.treeObj)}this.currentText=this.text,this.currentValue=this.value,this.isInitialized&&this.triggerChangeEvent()},s.prototype.getItems=function(e){var i;if(1===this.treeDataType)for(var s=0;s<this.treeItems.length;s++){var l=t.getValue(this.fields.text,this.treeItems[s]);if(!t.isNullOrUndefined(this.treeItems[s])&&!t.isNullOrUndefined(l)&&l===e){i=this.treeItems[s];break}}else i=this.getNestedItems(this.treeItems,this.fields,e);return i},s.prototype.getNestedItems=function(e,s,l){for(var o,r=0,n=e.length;r<n;r++){var a=t.getValue(this.fields.text,e[r]);if(e[r]&&a&&a.toString()===l)return e[r];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[r]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){if(void 0!==(o=this.getNestedItems(t.getValue("child",e[r]),this.getChildType(s),l)))break}}else{var h=t.getValue(s.child,e[r]);if(void 0!==(o=this.getNestedItems(h,this.getChildType(s),l)))break}}return o},s.prototype.getChildType=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.renderTree=function(){this.treeObj=new n.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,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}),this.treeObj.appendTo("#"+this.tree.id)},s.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var i=!1,s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(s.cancel?i=!0:(t.addClass([e.inputWrapper],["e-icon-anim"]),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_popup",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):e.popupEle=e.popupObj.element),e.isFirstRender&&!i&&(t.prepend([e.popupDiv],e.popupEle),e.popupDiv.style.display="block",e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains(q)&&(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.portals=e.portals.concat(e.treeObj.portals),e.renderReactTemplates())),!i){if(t.attributes(e.inputWrapper,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),e.popupEle.style.display="block",e.updatePopupHeight(),e.popupObj.refreshPosition(),e.showCheckBox&&e.showSelectAll||e.popupDiv.classList.contains(q)||!(e.treeItems.length>0)||e.treeObj.element.focus(),e.checkSelectAll&&e.checkBoxElement){var l=t.closest(e.checkBoxElement,".e-checkbox-wrapper");e.changeState(l,"check"),e.checkSelectAll=!1}e.allowFiltering&&(t.removeClass([e.inputWrapper],[M]),e.filterObj.element.focus());var o={popup:e.popupObj};e.trigger("open",o)}})},s.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){i=Math.round(this.filterContainer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.headerTemplate){i=Math.round(this.header.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.showCheckBox&&this.showSelectAll){i=Math.round(this.checkAllParent.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.footerTemplate){var i=Math.round(this.footer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}var s=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);s+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=t.formatUnit(parseInt(e,10)-s+"px"),this.popupDiv.style.maxHeight=e}},s.prototype.createPopup=function(e){var i=this;this.isFirstRender&&(this.popupObj=new l.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(){i.isPopupOpen=!1},open:function(){t.EventHandler.add(document,"mousedown",i.onDocumentClick,i),i.isPopupOpen=!0},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}))},s.prototype.setElementWidth=function(e){var i=this.inputWrapper;t.isNullOrUndefined(e)||("number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setWidth=function(){var e=t.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},s.prototype.getHeight=function(){var e=t.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},s.prototype.onDocumentClick=function(e){var i=e.target,s=t.closest(i,".e-list-parent"),l=t.closest(i,".e-filter-wrap"),o=!!i.classList.contains("e-dropdown")||(t.matches(i,".e-ddt .e-popup")||t.matches(i,".e-ddt .e-treeview"));this.isPopupOpen&&(this.inputWrapper.contains(i)||s||l||o)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&i.classList.contains("e-chips-close")||this.isPopupOpen&&(i.classList.contains("e-selectall-parent")||i.classList.contains("e-all-text")||i.classList.contains("e-frame")))?(this.isDocumentClick=!1,e.preventDefault()):!this.inputWrapper.contains(i)&&this.inputFocus&&this.focusOut(e)},s.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.popupDiv],q)},s.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),t.addClass([this.popupDiv],q),this.hideCheckAll(!0)):this.popupDiv.classList.contains(q)&&this.treeItems.length>=1&&(t.removeClass([this.popupDiv],q),this.hideCheckAll(!1)),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());var i={data:e.data};this.trigger("dataBound",i),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.isFilterRestore=!1)},s.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value?this.value:[]:this.treeObj.selectedNodes=this.value?this.value:[]},s.prototype.setCssClass=function(e,i){var s=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];t.isNullOrUndefined(i)||""===i||t.removeClass(s,i.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(s,e.split(" "))},s.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add("e-rtl"):this.inputWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},s.prototype.setEnable=function(){o.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(t.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),t.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains(M)&&t.removeClass([this.inputWrapper],[M]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},s.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,tableName:e.tableName,tooltip:e.tooltip}},s.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,tableName:e.tableName,tooltip:e.tooltip}},s.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,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!t.isNullOrUndefined(e)){var i=e=this.getActualProperties(e);return e.value&&(i.id=e.value),e.parentValue&&(i.parentID=e.parentValue),e.child&&(i.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(i.isChecked=e.selected),i}return null},s.prototype.getTreeDataType=function(e,s){if(this.fields.dataSource instanceof i.DataManager){for(l=0;l<e.length;l++)if("string"==typeof s.child&&t.isNullOrUndefined(t.getValue(s.child,e[l])))return 1;return 2}for(var l=0,o=e.length;l<o;l++){if("string"==typeof s.child&&!t.isNullOrUndefined(t.getValue(s.child,e[l])))return 2;if(!t.isNullOrUndefined(t.getValue(s.parentValue,e[l]))||!t.isNullOrUndefined(t.getValue(s.hasChildren,e[l])))return 1}return 1},s.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.treeObj.dataBind()},s.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:e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},s.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.oldValue=this.value?this.value.slice():this.value,null===this.value&&this.setProperties({value:[]},!0))},s.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="")},s.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var i;if(e.isInteracted){var s=t.getValue("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[s]},!0),i=this.itemTemplate?t.getValue("text",this.treeObj.getNode(s)):t.getValue("text",e.nodeData).toString(),o.Input.setValue(i,this.inputEle,this.floatLabelType),this.setProperties({text:i},!0),this.currentText=this.text,this.currentValue=this.value,t.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),t.attributes(this.inputWrapper,{"aria-activedescendant":s.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}var l=this.getEventArgs(e);this.trigger("select",l),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},s.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&&("true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},s.prototype.onNodeChecked=function(e){var i=this.getEventArgs(e);if(this.trigger("select",i),this.isFilteredData&&"uncheck"===e.action){var s=t.getValue("id",e.data[0]).toString();this.removeSelectedData(s,!0)}if(!this.isChipDelete&&e.isInteracted&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var l=this.treeObj.element.querySelectorAll("li"),o=this.treeObj.element.querySelectorAll("li .e-checkbox-wrapper[aria-checked=true]"),r=t.closest(this.checkBoxElement,".e-checkbox-wrapper");r&&"uncheck"===e.action?(this.isReverseUpdate=!0,this.changeState(r,"uncheck"),this.isReverseUpdate=!1):r&&"check"===e.action&&o.length===l.length&&(this.isReverseUpdate=!0,this.changeState(r,"check"),this.isReverseUpdate=!1)}},s.prototype.beforeCheck=function(e){e.isInteracted&&(this.oldValue=this.value?this.value.slice():this.value)},s.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(t.removeClass([this.overAllClear],j),t.addClass([this.inputWrapper],V)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var i=t.selectAll(".e-chips-close",this.chipWrapper),s=0;s<i.length;s++)e?t.removeClass([i[s]],j):t.addClass([i[s]],j)},s.prototype.updateDropDownIconState=function(e){var i=t.select(".e-ddt-icon",this.inputWrapper);e?(i?t.removeClass([i],j):o.Input.appendSpan(W,this.inputWrapper,this.createElement),t.addClass([this.inputWrapper],"e-show-dd-icon")):(t.addClass([i],j),t.removeClass([this.inputWrapper],"e-show-dd-icon"))},s.prototype.updateMode=function(){if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(j)&&e?(t.removeClass([this.chipWrapper],j),t.addClass([this.inputWrapper],H)):e||(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H));var i=null!==this.value&&0!==this.value.length;e&&i?t.addClass([this.inputEle],U):t.removeClass([this.inputEle],U)}else this.inputEle.classList.contains(U)&&(t.removeClass([this.inputEle],U),this.chipWrapper&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H)))},s.prototype.ensurePlaceHolder=function(){this.value&&0===this.value.length&&(t.removeClass([this.inputEle],U),this.chipWrapper&&t.addClass([this.chipWrapper],j))},s.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.setMultiSelectValue=function(e){if(this.isFilteredData){for(var i=t.isNullOrUndefined(this.value)?[]:this.value,s=0;s<e.length;s++)(t.isNullOrUndefined(this.value)||-1===this.value.indexOf(e[s]))&&i.push(e[s]);this.setProperties({value:i},!0)}else this.setProperties({value:e},!0),e&&0!==e.length&&!this.showCheckBox&&(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},s.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 i=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!i&&(t.removeClass([this.inputEle],U),t.detach(this.chipWrapper)),this.getValidMode()&&null!==this.value&&(t.addClass([this.inputEle],U),this.chipWrapper&&t.removeClass([this.chipWrapper],j));var s=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!s&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputEle],U)),this.updateSelectedValues()},s.prototype.getSelectedData=function(e){var i=null;if(this.isFilteredData)for(var s=0;s<this.selectedData.length;s++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){i=this.selectedData[s];break}return t.isNullOrUndefined(i)&&(i=this.treeSettings.loadOnDemand?this.treeObj.getTreeData(e)[0]:this.treeObj.getNode(e),t.isNullOrUndefined(i)||this.selectedData.push(i)),i},s.prototype.removeSelectedData=function(e,i){var s=t.isNullOrUndefined(this.value)?[]:this.value.slice();s.splice(s.indexOf(e),1),this.setProperties({value:s},i);for(var l=0;l<this.selectedData.length;l++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[l]).toString()===e){this.selectedData.splice(l,1);break}},s.prototype.updateSelectedValues=function(){this.dataValue="";var e,i,s,l="";if(this.hiddenElement.innerHTML="",this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!t.isNullOrUndefined(this.value))for(var r=0,n=this.value.length;r<n;r++)s=this.getSelectedData(this.value[r]),i=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",s),this.selectedText.push(i),e=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+e,l+=","+e,this.setProperties({text:l},!0)):(this.dataValue+=e,l+=e),"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[r]),this.hiddenElement.innerHTML+='<option selected value ="'+this.value[r]+'">'+this.selectedText[this.selectedText.length-1]+"</option>";var a=this.getValidMode();"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||a||this.chipWrapper&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H)),o.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},s.prototype.setChipValues=function(e,i){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var s=this.createElement("span",{className:"e-chips",attrs:{"data-value":i}}),l=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:"e-chips-close e-icons"});l.innerHTML=e,s.appendChild(l),this.chipCollection.appendChild(s),this.showClearButton&&(s.appendChild(o),t.EventHandler.add(o,"mousedown",this.removeChip,this))},s.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)&&(t.detach(this.checkAllParent),this.checkAllParent=null))},s.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],"e-ddt-header"));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),t.append(e,this.header)),this.ddtupdateBlazorTemplates(!1,!1,!0,!1),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},s.prototype.templateComplier=function(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}return t.compile(e)},s.prototype.setFooterTemplate=function(){this.footer?this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddt-footer"));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),t.append(e,this.footer)),this.ddtupdateBlazorTemplates(!1,!1,!1,!0),t.append([this.footer],this.popupEle)},s.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))},s.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){var i=e.target.parentElement,s=i.getAttribute("data-value");this.chipCollection&&i&&t.remove(i),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(s,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([s]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},s.prototype.resetValue=function(e){o.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.oldValue=this.value,this.setProperties({value:[]},!0)),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],t.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())},s.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},s.prototype.selectAllItems=function(e){if(this.showCheckBox)e?this.treeObj.checkAll():this.treeObj.uncheckAll(),this.checkSelectAll=!0;else if(this.allowMultiSelection)if(e){for(var i=t.selectAll("li",this.treeObj.element),s=void 0,l=[],o=0;o<i.length;o++)s=i[o].getAttribute("data-uid").toString(),l.push(s);this.treeObj.selectedNodes=l}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},s.prototype.updateTreeSettings=function(e){var t=Object.keys(e.treeSettings)[0];if("autoCheck"===t)this.ensureAutoCheck(),this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===t)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else if("expandOn"===t)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},s.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},s.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},s.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":(this.noRecord=this.createElement("div"),t.addClass([this.noRecord],"e-ddt-nodata"),t.prepend([this.noRecord],this.popupDiv)),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=e?this.actionFailureTemplateId:this.noRecordsTemplateId,l=e?"actionFailureTemplate":"noRecordsTemplate",o=this.templateComplier(i)({},this,l,s,this.isStringTemplate,void 0,this.noRecord);o&&(o=Array.prototype.slice.call(o),t.append(o,this.noRecord)),this.ddtupdateBlazorTemplates(!e,e)}else{var r={noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"};this.l10n=new t.L10n(this.getLocaleName(),r,this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}},s.prototype.ddtupdateBlazorTemplates=function(e,i,s,l,o){this.isStringTemplate||(this.noRecordsTemplate&&e&&t.updateBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate",this,o),this.actionFailureTemplate&&i&&t.updateBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate",this,o),s&&t.updateBlazorTemplate(this.headerTemplateId,"HeaderTemplate",this),l&&t.updateBlazorTemplate(this.footerTemplateId,"FooterTemplate",this))},s.prototype.ddtresetBlazorTemplates=function(e,i,s,l){this.isStringTemplate||(this.noRecordsTemplate&&e&&t.resetBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate"),this.actionFailureTemplate&&i&&t.resetBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate"),s&&t.resetBlazorTemplate(this.headerTemplateId,"HeaderTemplate"),l&&t.resetBlazorTemplate(this.footerTemplateId,"FooterTemplate"))},s.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},s.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:"e-overflow "+j}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},s.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},s.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter()),this.ensureAutoCheck()},s.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},s.prototype.updateValue=function(e){this.isDynamicChange=!0,t.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},s.prototype.updateText=function(e){t.isNullOrUndefined(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},s.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=t.select(".e-overflow",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),t.addClass([this.inputEle],U),"Box"===this.mode?t.removeClass([this.overFlowWrapper,this.inputWrapper],"e-show-text"):t.addClass([this.overFlowWrapper,this.inputWrapper],"e-show-text"))}},s.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","")},s.prototype.onPropertyChanged=function(e,i){for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":o.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,i.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":o.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":o.Input.removeFloating(this.inputObj),o.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=i.value,this.updateValue(e.value);break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":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":this.updateTreeSettings(e);break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.updateValue(this.value),this.treeObj.dataBind();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?(t.addClass([this.overFlowWrapper],j),this.chipWrapper&&"Box"===this.mode?t.removeClass([this.chipWrapper],j):(t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)),this.ensurePlaceHolder()):this.updateView()}},s.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},s.prototype.destroy=function(){this.ddtresetBlazorTemplates(!0,!0,!0,!0),this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.resetValue(),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),t.detach(this.inputWrapper),t.detach(this.popupDiv),this.element.classList.remove("e-input"),e.prototype.destroy.call(this)},s.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),t.detach(this.filterObj.element),t.detach(this.filterContainer),this.filterObj=null)},s.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},s.prototype.getData=function(e){return this.treeObj.getTreeData(e)},s.prototype.hidePopup=function(){var e={popup:this.popupObj};this.inputWrapper.classList.remove("e-icon-anim"),this.popupEle&&(this.popupEle.style.display="none"),t.attributes(this.inputWrapper,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&t.addClass([this.inputWrapper],[M])),this.trigger("close",e))},s.prototype.selectAll=function(e){this.selectAllItems(e)},s.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},s.prototype.getModuleName=function(){return"dropdowntree"},F([t.Property("The Request Failed")],s.prototype,"actionFailureTemplate",void 0),F([t.Property(!1)],s.prototype,"allowFiltering",void 0),F([t.Property(!1)],s.prototype,"allowMultiSelection",void 0),F([t.Property(!0)],s.prototype,"changeOnBlur",void 0),F([t.Property("")],s.prototype,"cssClass",void 0),F([t.Property(",")],s.prototype,"delimiterChar",void 0),F([t.Property(!0)],s.prototype,"enabled",void 0),F([t.Complex({},z)],s.prototype,"fields",void 0),F([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),F([t.Property("StartsWith")],s.prototype,"filterType",void 0),F([t.Property("Never")],s.prototype,"floatLabelType",void 0),F([t.Property(null)],s.prototype,"footerTemplate",void 0),F([t.Property(!1)],s.prototype,"ignoreAccent",void 0),F([t.Property(!0)],s.prototype,"ignoreCase",void 0),F([t.Property(null)],s.prototype,"headerTemplate",void 0),F([t.Property({})],s.prototype,"htmlAttributes",void 0),F([t.Property(null)],s.prototype,"itemTemplate",void 0),F([t.Property("Default")],s.prototype,"mode",void 0),F([t.Property("No Records Found")],s.prototype,"noRecordsTemplate",void 0),F([t.Property(null)],s.prototype,"placeholder",void 0),F([t.Property("300px")],s.prototype,"popupHeight",void 0),F([t.Property("100%")],s.prototype,"popupWidth",void 0),F([t.Property(!1)],s.prototype,"readonly",void 0),F([t.Property(!1)],s.prototype,"showSelectAll",void 0),F([t.Property("Select All")],s.prototype,"selectAllText",void 0),F([t.Property(!1)],s.prototype,"showCheckBox",void 0),F([t.Property(!0)],s.prototype,"showClearButton",void 0),F([t.Property(!0)],s.prototype,"showDropDownIcon",void 0),F([t.Property("None")],s.prototype,"sortOrder",void 0),F([t.Property(null)],s.prototype,"text",void 0),F([t.Complex({},K)],s.prototype,"treeSettings",void 0),F([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),F([t.Property(null)],s.prototype,"value",void 0),F([t.Property("100%")],s.prototype,"width",void 0),F([t.Property(1e3)],s.prototype,"zIndex",void 0),F([t.Property(!1)],s.prototype,"wrapText",void 0),F([t.Event()],s.prototype,"actionFailure",void 0),F([t.Event()],s.prototype,"beforeOpen",void 0),F([t.Event()],s.prototype,"change",void 0),F([t.Event()],s.prototype,"close",void 0),F([t.Event()],s.prototype,"blur",void 0),F([t.Event()],s.prototype,"created",void 0),F([t.Event()],s.prototype,"dataBound",void 0),F([t.Event()],s.prototype,"destroyed",void 0),F([t.Event()],s.prototype,"filtering",void 0),F([t.Event()],s.prototype,"focus",void 0),F([t.Event()],s.prototype,"keyPress",void 0),F([t.Event()],s.prototype,"open",void 0),F([t.Event()],s.prototype,"select",void 0),s=F([t.NotifyPropertyChanges],s)}(t.Component),G=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])})(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)}}(),Q=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};I.root="e-combobox";var J={container:null,buttons:[]},X=function(e){function i(t,i){return e.call(this,t,i)||this}return G(i,e),i.prototype.preRender=function(){e.prototype.preRender.call(this)},i.prototype.getLocaleName=function(){return"combo-box"},i.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),t.EventHandler.add(this.inputWrapper.container,"blur",this.onBlur,this)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)),this.bindCommonEvent()},i.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(I.input)||!t.Browser.isDevice)&&t.Browser.isDevice||e.preventDefault()},i.prototype.onBlur=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;t.isNullOrUndefined(this.listData)||t.isNullOrUndefined(s)||s===this.text||this.customValue(i),e.prototype.onBlur.call(this,i)},i.prototype.targetElement=function(){return this.inputElement},i.prototype.setOldText=function(e){o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},i.prototype.setOldValue=function(e){this.allowCustom?this.valueMuteChange(this.value):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},i.prototype.valueMuteChange=function(e){var i=t.isNullOrUndefined(e)?null:e.toString();o.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:e,text:e,index:null},!0),this.activeIndex=this.index;var s=this.fields,l={};l[s.text]=t.isNullOrUndefined(e)?null:e.toString(),l[s.value]=t.isNullOrUndefined(e)?null:e.toString(),this.itemData=l,this.item=null,this.previousValue!==this.value&&this.detachChangeEvent(null)},i.prototype.updateValues=function(){if(t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);e?this.setSelection(e,null):(o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue())}else this.setSelection(this.liCollections[this.activeIndex],null);else(e=this.getElementByValue(this.value))?this.setSelection(e,null):this.allowCustom?this.valueMuteChange(this.value):this.valueMuteChange(null);this.setHiddenValue(),o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},i.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?t.removeClass([this.inputWrapper.clearButton],I.clearIconHide):t.addClass([this.inputWrapper.clearButton],I.clearIconHide))},i.prototype.getAriaAttributes=function(){return{"aria-owns":this.element.id+"_options",role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-hasPopup":"true","aria-expanded":"false","aria-readonly":this.readonly.toString(),autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}},i.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("."+I.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+I.li)),this.incrementalSearch(t))},i.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},i.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()?this.inputWrapper:J},i.prototype.onActionComplete=function(t,i,s,l){this.isServerBlazor||e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),!this.preventAutoFill&&"combobox"===this.getModuleName()&&this.isTyped&&this.inlineSearch()},i.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),i=this.list.querySelector("."+I.selected);if(e.text===this.inputElement.value&&!t.isNullOrUndefined(i))return i;if((t.Browser.isDevice&&!this.isDropDownClick||!t.Browser.isDevice)&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0){var s=h(this.inputElement.value,this.liCollections,"StartsWith",!0).item;if(t.isNullOrUndefined(s))this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.list.scrollTop=0);else{var l=this.getIndexByValue(s.getAttribute("data-value"))-1,o=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(o)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var r=this.fields.groupBy?this.liCollections[0].offsetHeight:0;this.list.scrollTop=l*o+r,t.addClass([s],I.focus)}}return s}return null},i.prototype.setValue=function(t){return t&&"keydown"===t.type&&"enter"===t.action&&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)},i.prototype.checkCustomValue=function(){this.itemData=this.getDataByValue(this.value);var e=this.getItemData();this.allowCustom&&t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(e.text)||this.setProperties({value:e.value,text:e.text},!this.allowCustom)},i.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||o.Input.appendSpan("e-input-group-icon e-atc-spinner-icon",this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,t.addClass([this.spinnerElement],I.disableIcon),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),l.showSpinner(this.spinnerElement))},i.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],I.disableIcon),this.spinnerElement.classList.contains("e-atc-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},i.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.previousValue===s?this.updateSelectedItem(e,null,!0):(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.getFormattedValue(e.getAttribute("data-value")))),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i)}},i.prototype.isAndroidAutoFill=function(e){if(t.Browser.isAndroid){var i=this.getSelectionPoints(),s=this.prevSelectPoints.end,l=i.end,o=this.prevSelectPoints.start,r=i.start;return 0!==s&&(s===e.length&&o===e.length||o>r&&s>l||s===l&&o===r)}return!1},i.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&(e.prototype.clearAll.call(this,i),this.isServerBlazor&&this.isFiltering()&&this.isPopupOpen&&i&&this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!0))},i.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},i.prototype.inlineSearch=function(e){var i=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),s=i?this.liCollections[this.activeIndex]:this.getFocusElement();if(t.isNullOrUndefined(s))if(""===this.inputElement.value){this.activeIndex=null,this.list.scrollTop=0;var l=this.list.querySelector("."+I.li);this.setHoverList(l)}else this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length<0&&this.removeFocus();else{if(!i){var o=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(o),this.activeIndex=t.isNullOrUndefined(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(s,i)}},i.prototype.incrementalSearch=function(e){this.showPopup(),t.isNullOrUndefined(this.listData)||(this.inlineSearch(e),e.preventDefault())},i.prototype.setAutoFillSelection=function(e){var t=this.getSelectionPoints(),i=this.inputElement.value.substr(0,t.start);if(i&&i.toLowerCase()===e.substr(0,t.start).toLowerCase()){var s=i+e.substr(i.length,e.length);o.Input.setValue(s,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(t.start,this.inputElement.value.length)}else o.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length)},i.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,!0,this.ignoreAccent)},i.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),t.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlur)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(t.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler))),this.unBindCommonEvent()},i.prototype.setSelection=function(i,s){e.prototype.setSelection.call(this,i,s),t.isNullOrUndefined(i)||this.autofill||this.isDropDownClick||this.removeFocus()},i.prototype.selectCurrentItem=function(e){var i;this.isPopupOpen&&((i=this.isSelected?this.list.querySelector("."+I.selected):this.list.querySelector("."+I.focus))&&(this.setSelection(i,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))),"enter"===e.action&&""===this.inputElement.value.trim()?this.clearAll(e):this.isTyped&&!this.isSelected&&t.isNullOrUndefined(i)&&this.customValue(e),this.hidePopup()},i.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(I.selected)&&(this.removeFocus(),e.classList.add(I.focus))},i.prototype.targetFocus=function(e){t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e)},i.prototype.dropDownClick=function(i){i.preventDefault(),t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,i)},i.prototype.customValue=function(e){var i=this,s=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value.trim()){var l=this.value;if(t.isNullOrUndefined(s)){var r=""===this.inputElement.value?null:this.inputElement.value,n={text:r,item:{}};this.initial?this.updateCustomValueCallback(r,n,l):this.trigger("customValueSpecifier",n,function(t){i.updateCustomValueCallback(r,t,l,e)})}else this.isSelectCustom=!1,this.setProperties({value:s}),l!==this.value&&this.onChangeEvent(e)}else this.allowCustom&&(this.isSelectCustom=!0);else{var a=this.previousValue,h=this.value;this.setProperties({value:s}),t.isNullOrUndefined(this.value)&&o.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&a===this.value&&h!==this.value&&this.onChangeEvent(null)}},i.prototype.updateCustomValueCallback=function(e,i,s,l){var o=this.fields,r=i.item,n={};r&&t.getValue(o.text,r)&&t.getValue(o.value,r)?n=r:(t.setValue(o.text,e,n),t.setValue(o.value,e,n)),this.itemData=n;var a={text:t.getValue(o.text,this.itemData),value:t.getValue(o.value,this.itemData),index:null};this.setProperties(a,!0),this.setSelection(null,null),this.isSelectCustom=!0,s!==this.value&&this.onChangeEvent(l)},i.prototype.onPropertyChanged=function(i,s){"combobox"===this.getModuleName()&&(this.checkData(i),this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,r=Object.keys(i);l<r.length;l++){var n=r[l];switch(n){case"readonly":o.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this));break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var a=this.getPropObject(n,i,s);e.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty),this.isFiltering()&&"dataSource"===n&&t.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},i.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this),this.renderComplete()},i.prototype.getModuleName=function(){return"combobox"},i.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},i.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},i.prototype.showPopup=function(){e.prototype.showPopup.call(this)},i.prototype.hidePopup=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!t.isNullOrUndefined(this.listData)){var l=this.isEscapeKey;this.isEscapeKey&&(o.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var r=this.isSelectCustom?{text:""}:this.getItemData(),n=this.list.querySelector("."+I.selected);if(this.inputElement&&r.text===this.inputElement.value&&!t.isNullOrUndefined(n))return this.isSelected&&(this.onChangeEvent(i),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,i);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var a=h(this.inputElement.value,this.liCollections,"Equal",!0);this.selectedLI=a.item,t.isNullOrUndefined(a.index)&&(a.index=h(this.inputElement.value,this.liCollections,"StartsWith",!0).index),this.activeIndex=a.index,t.isNullOrUndefined(this.selectedLI)?l&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(i)}t.isNullOrUndefined(this.listData)&&this.allowCustom&&!t.isNullOrUndefined(s)&&s!==this.value&&this.customValue(),e.prototype.hidePopup.call(this,i)},i.prototype.focusIn=function(){this.enabled&&(t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},i.prototype.clear=function(){this.value=null},i.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},i.prototype.getItems=function(){return e.prototype.getItems.call(this)},i.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},i.prototype.renderHightSearch=function(){},Q([t.Property(!1)],i.prototype,"autofill",void 0),Q([t.Property(!0)],i.prototype,"allowCustom",void 0),Q([t.Property({})],i.prototype,"htmlAttributes",void 0),Q([t.Property(!1)],i.prototype,"allowFiltering",void 0),Q([t.Property(null)],i.prototype,"query",void 0),Q([t.Property(null)],i.prototype,"index",void 0),Q([t.Property(!0)],i.prototype,"showClearButton",void 0),Q([t.Property(!1)],i.prototype,"enableRtl",void 0),Q([t.Event()],i.prototype,"customValueSpecifier",void 0),Q([t.Event()],i.prototype,"filtering",void 0),Q([t.Property(null)],i.prototype,"valueTemplate",void 0),Q([t.Property("Never")],i.prototype,"floatLabelType",void 0),Q([t.Property(null)],i.prototype,"filterBarPlaceholder",void 0),Q([t.Property(null)],i.prototype,"cssClass",void 0),Q([t.Property(null)],i.prototype,"headerTemplate",void 0),Q([t.Property(null)],i.prototype,"footerTemplate",void 0),Q([t.Property(null)],i.prototype,"placeholder",void 0),Q([t.Property("100%")],i.prototype,"width",void 0),Q([t.Property("300px")],i.prototype,"popupHeight",void 0),Q([t.Property("100%")],i.prototype,"popupWidth",void 0),Q([t.Property(!1)],i.prototype,"readonly",void 0),Q([t.Property(null)],i.prototype,"text",void 0),Q([t.Property(null)],i.prototype,"value",void 0),i=Q([t.NotifyPropertyChanges],i)}(N),$=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])})(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)}}(),Y=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};I.root="e-autocomplete",I.icon="e-input-group-icon e-ddl-icon e-search-icon";var Z=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return $(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"auto-complete"},s.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=""!==this.queryString||t.isNullOrUndefined(this.value)?this.filterType:"equal",o=""!==this.queryString||t.isNullOrUndefined(this.value)?this.queryString:this.value;if(this.isFiltered)return s;if(null!==this.queryString&&""!==this.queryString){var r=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==r)&&"number"!==r){var n=t.isNullOrUndefined(this.fields.value)?"":this.fields.value;s.where(n,l,o,this.ignoreCase,this.ignoreAccent)}else s.where("",l,o,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)){if(20!==this.suggestionCount)for(var a=0;a<s.queries.length;a++)"onTake"===s.queries[a].fn&&s.queries.splice(a,1);s.take(this.suggestionCount)}return s},s.prototype.searchLists=function(i){var s=this;if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.isServerBlazor)this.beforePopupOpen=this.isFiltering()&&!this.beforePopupOpen?!this.beforePopupOpen:this.beforePopupOpen,this.queryString=this.filterInput.value,""!==this.queryString&&this.queryString.length>=this.minLength?this.interopAdaptor.invokeMethodAsync("OnServerFilter",this.filterInput.value):this.hidePopup();else{if(t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this,!0),this.queryString=this.filterInput.value,40===i.keyCode||38===i.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 l={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,t,i){l.cancel||(s.isFiltered=!0,s.filterAction(e,t,i))},cancel:!1};this.trigger("filtering",l,function(e){e.cancel||s.isFiltered||e.preventDefaultAction||(s.searchList=!0,s.filterAction(s.dataSource,null,s.fields))})}},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},s.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,""!==this.queryString&&this.queryString.length>=this.minLength?this.resetList(e,i,t):this.hidePopup(),this.renderReactTemplates()},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&e.prototype.clearAll.call(this,i),this.beforePopupOpen&&this.hidePopup()},s.prototype.onActionComplete=function(i,s,l,o){this.fixedHeaderElement=null,e.prototype.onActionComplete.call(this,i,s,l);var r=this.list.querySelector("."+I.li);t.isNullOrUndefined(r)||t.removeClass([r],I.focus),this.postBackAction()},s.prototype.postBackAction=function(){if(this.autofill&&!t.isNullOrUndefined(this.liCollections[0])&&this.searchList){var i=[this.liCollections[0]],s=h(this.inputElement.value,i,"StartsWith",this.ignoreCase);this.searchList=!1,t.isNullOrUndefined(s.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},s.prototype.setSelection=function(i,s){if(this.isValidLI(i))if(!t.isNullOrUndefined(s)&&"keydown"===s.type&&"enter"!==s.action&&"tab"!==s.action&&this.isValidLI(i)){var l=this.getFormattedValue(i.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l),this.isServerBlazor&&this.removeHover(),this.setHoverList(i),this.selectedLI=i,this.setScrollPosition(s),this.autofill&&this.isPopupOpen&&(this.preventAutoFill=!1,e.prototype.setAutoFill.call(this,i)),t.attributes(this.inputElement,{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})}else e.prototype.setSelection.call(this,i,s)},s.prototype.listOption=function(i,s){var l=this,o=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(o.itemCreated))o.itemCreated=function(e){l.highlight&&(l.element.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){p(e.item,l.queryString,l.ignoreCase,l.filterType)},0):p(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var r=o.itemCreated;o.itemCreated=function(e){l.highlight&&p(e.item,l.queryString,l.ignoreCase,l.filterType),r.apply(l,[e])}}return o},s.prototype.isFiltering=function(){return!0},s.prototype.renderPopup=function(){this.list.scrollTop=0,e.prototype.renderPopup.call(this)},s.prototype.isEditTextBox=function(){return""!==this.inputElement.value.trim()},s.prototype.isPopupButton=function(){return this.showPopupButton},s.prototype.isSelectFocusItem=function(e){return!1},s.prototype.showPopup=function(){if(this.enabled){if(this.beforePopupOpen&&!this.isServerBlazor)return void this.refreshPopup();this.beforePopupOpen=!0,this.preventAutoFill=!0,t.isNullOrUndefined(this.list)||this.isServerBlazor?this.renderList():this.resetList(this.dataSource,this.fields)}},s.prototype.hidePopup=function(){this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1),e.prototype.hidePopup.call(this),this.activeIndex=-1},s.prototype.onPropertyChanged=function(i,s){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],i);for(var l=0,r=Object.keys(i);l<r.length;l++){var n=r[l];switch(n){case"showPopupButton":if(this.showPopupButton){if(this.isServerBlazor){if(this.inputWrapper&&this.inputWrapper.container){a=this.inputWrapper.container.querySelector(".e-input-group-icon.e-ddl-icon");this.inputWrapper.buttons[0]=a}}else{var a=o.Input.appendSpan(I.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=a}this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&t.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else this.isServerBlazor||(t.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null);break;default:var h=this.getPropObject(n,i,s);e.prototype.onPropertyChanged.call(this,h.newProperty,h.oldProperty)}}},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(c(this.liCollections[e]),p(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType,this.isServerBlazor))},s.prototype.getModuleName=function(){return"autocomplete"},s.prototype.render=function(){e.prototype.render.call(this)},Y([t.Complex({value:null,iconCss:null,groupBy:null},A)],s.prototype,"fields",void 0),Y([t.Property(!0)],s.prototype,"ignoreCase",void 0),Y([t.Property(!1)],s.prototype,"showPopupButton",void 0),Y([t.Property(!1)],s.prototype,"highlight",void 0),Y([t.Property(20)],s.prototype,"suggestionCount",void 0),Y([t.Property({})],s.prototype,"htmlAttributes",void 0),Y([t.Property(null)],s.prototype,"query",void 0),Y([t.Property(1)],s.prototype,"minLength",void 0),Y([t.Property("Contains")],s.prototype,"filterType",void 0),Y([t.Event()],s.prototype,"filtering",void 0),Y([t.Property(null)],s.prototype,"index",void 0),Y([t.Property("Never")],s.prototype,"floatLabelType",void 0),Y([t.Property(null)],s.prototype,"valueTemplate",void 0),Y([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),Y([t.Property(!1)],s.prototype,"allowFiltering",void 0),Y([t.Property(null)],s.prototype,"text",void 0),s=Y([t.NotifyPropertyChanges],s)}(X),ee="e-float-line",te="e-float-text",ie="e-label-top",se="e-label-bottom",le=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])})(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)}}(),oe=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},re="e-input-focus",ne="e-hide-listitem",ae="e-chips",he=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.isDynamicDataChange=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return le(s,e),s.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},s.prototype.requiredModules=function(){var e=[];if("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},s.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];switch(s){case"class":var l=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==l&&(t.addClass([this.overAllWrapper],l.split(" ")),t.addClass([this.popupWrapper],l.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(s,this.htmlAttributes[s]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:var o=["name","required","aria-required","form"],r=["title","role","style","class"];["id"].indexOf(s)>-1?this.element.setAttribute(s,this.htmlAttributes[s]):0===s.indexOf("data")||o.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):r.indexOf(s)>-1?this.overAllWrapper.setAttribute(s,this.htmlAttributes[s]):this.inputElement.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.updateReadonly=function(e){e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly")},s.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove("e-close-icon-hide")):(this.overAllClear.style.display="none",this.componentWrapper.classList.add("e-close-icon-hide"))},s.prototype.updateCssClass=function(){if(!t.isNullOrUndefined(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(t.addClass([this.overAllWrapper],e.split(" ")),t.addClass([this.popupWrapper],e.split(" ")))}},s.prototype.updateOldPropCssClass=function(e){t.isNullOrUndefined(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(t.removeClass([this.overAllWrapper],e.split(" ")),t.removeClass([this.popupWrapper],e.split(" ")))},s.prototype.onPopupShown=function(){var e=this;if(t.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var i=this;window.onpopstate=function(){i.hidePopup(),i.inputElement.focus()},history.pushState({},"")}var s={name:"FadeIn",duration:100},l={popup:this.popupObj,cancel:!1,animation:s};this.trigger("open",l,function(i){i.cancel||(e.focusAtFirstListItem(),document.body.appendChild(e.popupObj.element),"CheckBox"===e.mode&&e.enableGroupCheckBox&&!t.isNullOrUndefined(e.fields.groupBy)&&e.updateListItems(e.list.querySelectorAll("li.e-list-item"),e.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===e.mode||e.showDropDownIcon)&&t.addClass([e.overAllWrapper],["e-icon-anim"]),e.refreshPopup(),e.renderReactTemplates(),e.popupObj.show(i.animation,1e3===e.zIndex?e.element:null),t.attributes(e.inputElement,{"aria-expanded":"true"}),e.isFirstClick&&e.loadTemplate())})},s.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},s.prototype.loadTemplate=function(){var e=this;"CheckBox"===this.mode&&this.itemTemplate&&t.isBlazor()&&this.isServerRendered&&this.mainData&&this.mainData.length>0?setTimeout(function(){e.refreshListItems(null),"CheckBox"===e.mode&&e.removeFocus(),e.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===e.mode,e:e})},this.mainData.length<100?100:this.mainData.length):(this.refreshListItems(null),"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))},s.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!t.isNullOrUndefined(this.value)&&this.value.length>0){var e=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",this.value[this.value.length-1]);t.isNullOrUndefined(e)||this.scrollBottom(e)}},s.prototype.focusAtFirstListItem=function(){if(this.ulElement&&this.ulElement.querySelector("li."+k.li)){var e=void 0;if("CheckBox"===this.mode)return void this.removeFocus();null!==(e=this.ulElement.querySelector("li."+k.li+":not(."+ne+")"))&&(this.removeFocus(),this.addListFocus(e))}},s.prototype.focusAtLastListItem=function(e){var t;e?t=h(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?h(this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null,t&&null!==t.item&&(this.addListFocus(t.item),this.scrollBottom(t.item,t.index))},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-multiselectable":"true","aria-activedescendant":"null","aria-haspopup":"true","aria-expanded":"false"}},s.prototype.updateListARIA=function(){t.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false"});var e=!!this.inputElement.disabled;t.attributes(this.inputElement,this.getAriaAttributes()),e&&t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},s.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var i=this.htmlAttributes;t.extend(i,{"aria-disabled":e},i),this.setProperties({htmlAttributes:i},!0)}},s.prototype.removelastSelection=function(e){var i=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),s=i[i.length-1].getAttribute("data-value");t.isNullOrUndefined(this.value)||(this.tempValues=this.value.slice());var l=this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!t.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeValue(l,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},s.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},s.prototype.getForQuery=function(e){for(var s,l=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,o=0;o<e.length;o++)s=0===o?new i.Predicate(l,"equal",e[o]):s.or(l,"equal",e[o]);return this.getQuery(this.query).where(s)},s.prototype.onActionComplete=function(s,l,o,r){e.prototype.onActionComplete.call(this,s,l,o),this.updateSelectElementData(this.allowFiltering);var n=this;if(t.isBlazor()&&this.isServerRendered&&this.isDynamicDataChange&&null!==this.value&&this.value.length>0){for(var a=[],h=0;h<this.value.length;h++){var p=this.getDataByValue(this.value[h]);p&&a.push(p[this.fields.value])}0===a.length&&this.setProperties({value:null})}if(!t.isNullOrUndefined(this.value)&&!this.allowCustomValue)for(var u=0;u<this.value.length;u++)this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:s,"li","data-value",n.value[u])||(this.value.splice(u,1),u-=1);this.updateActionList(s,l,o),t.isBlazor()&&this.isServerRendered&&this.allowFiltering&&"CheckBox"===this.mode&&this.removeFocus(),t.isBlazor()&&this.isServerRendered&&this.isDynamicDataChange&&this.value&&this.value.length>0&&(this.updateVal(this.value,null,"value"),this.addValidInputClass(),this.isDynamicDataChange=!1),!(this.dataSource instanceof i.DataManager&&"CheckBox"===this.mode&&this.allowFiltering)||t.isBlazor()&&this.isServerRendered||this.removeFocus()},s.prototype.updateActionList=function(e,s,l,o){if("CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?t.isNullOrUndefined(this.mainData)||0!==this.mainData.length||(this.mainData=s):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=s,this.mainListCollection=this.liCollections),(this.remoteCustomValue||s.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value)return void this.checkForCustomValue(this.tempQuery,this.fields);this.value&&this.value.length&&("CheckBox"!==this.mode&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof i.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),t.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),t.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),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())},s.prototype.refreshSelection=function(){var e,i,s=this.hideSelectedItem?ne:k.selected;if(!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(e=this.value[l],i=this.findListElement(this.list,"li","data-value",e)){if(t.addClass([i],s),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(k.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(k.group))&&t.addClass([i.previousElementSibling],s),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(ne)&&this.hideGroupItem(e),this.hideSelectedItem&&i.classList.contains(k.focus)){t.removeClass([i],k.focus);var o=i.parentElement.querySelectorAll("."+k.li+":not(."+ne+")");o.length>0?t.addClass([o[0]],k.focus):(this.ulElement=this.ulElement.cloneNode?this.ulElement.cloneNode(!0):this.ulElement,this.l10nUpdate(),t.addClass([this.list],k.noData))}if(i.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&i.classList.contains("e-active")){var r=i.firstElementChild.getAttribute("aria-checked");if(t.isNullOrUndefined(r)||"false"===r){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null};this.notify("updatelist",n)}}}this.checkSelectAll(),this.checkMaxSelection()},s.prototype.hideGroupItem=function(e){var i,s,l=this.hideSelectedItem?ne:k.selected;s=i=this.findListElement(this.ulElement,"li","data-value",e);var o=0,r=0,n=!0,a=!0;do{i&&i.previousElementSibling&&!i.previousElementSibling.classList.contains(ne)&&i.previousElementSibling.classList.contains(k.li)&&(n=!1),!n||!i||i.previousElementSibling&&i.previousElementSibling.classList.contains(k.group)?o=10:i=i.previousElementSibling,s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(ne)&&s.nextElementSibling.classList.contains(k.li)&&(a=!1),!a||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(k.group)?r=10:s=s.nextElementSibling}while(o<10||r<10);n&&a&&!i.previousElementSibling.classList.contains(ne)?t.addClass([i.previousElementSibling],l):n&&a&&i.previousElementSibling.classList.contains(ne)&&t.removeClass([i.previousElementSibling],l)},s.prototype.checkSelectAll=function(){var e=this.list.querySelectorAll("li.e-list-group-item.e-active").length,i=this.list.querySelectorAll("li.e-list-item"),s=this.list.querySelectorAll("li."+k.li).length,l=this.list.querySelectorAll("li."+k.selected).length;if(this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(l-=e),s!==l&&l!==this.maximumSelectionLength||"CheckBox"!==this.mode||!this.showSelectAll?s!==l&&"CheckBox"===this.mode&&this.showSelectAll&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}):this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var o=0;o<i.length;o++)this.findGroupStart(i[o]);this.deselectHeader()}},s.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup()},s.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var i=String.fromCharCode(e.keyCode).match(/\w/);t.isNullOrUndefined(i)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query;if(this.filterAction){if(null!==this.targetElement()){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields;s.where(t.isNullOrUndefined(o.text)?"":o.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}else s.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return s}return e||(this.query?this.query:new i.Query)},s.prototype.dataUpdater=function(e,t,s){if(this.isDataFetched=!1,""===this.targetElement().trim()){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.backCommand&&(this.remoteCustomValue=!1,this.onActionComplete(l,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))}else this.resetList(e,s,t),this.allowCustomValue&&(e instanceof i.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,s));this.refreshPopup(),"CheckBox"===this.mode&&this.removeFocus()},s.prototype.checkForCustomValue=function(e,i){var s=!this.getValueByText(this.inputElement.value,this.ignoreCase);if(this.allowCustomValue&&s){var l=this.inputElement.value,o=i||this.fields,r=!t.isNullOrUndefined(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r){var n={};t.setValue(o.text,l,n),"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)?t.setValue(o.value,Math.random(),n):t.setValue(o.value,l,n),(a=JSON.parse(JSON.stringify(this.listData))).splice(0,0,n),this.resetList(a,o,e)}else{var a=[this.inputElement.value];a[0]="number"!=typeof r||isNaN(parseFloat(a[0]))?a[0]:parseFloat(a[0]),a[0]="boolean"==typeof r?"true"===a[0]||"false"!==a[0]&&a[0]:a[0],this.resetList(a,o)}}this.value&&this.value.length&&this.refreshSelection()},s.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},s.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.enabled){if(e.target===this.overAllClear)return void e.preventDefault();if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf("e-chips-close"))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&"e-input-group-icon e-ddl-icon"===e.target.className)?this.showPopup():(this.hidePopup(),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(re)||this.overAllWrapper.classList.add(re)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}},s.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove("e-disabled"),this.inputElement.removeAttribute("disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add("e-disabled"),this.inputElement.setAttribute("disabled","true"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},s.prototype.onBlur=function(e,i){var s;return t.isNullOrUndefined(e)||(s=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(s)?void("CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&t.addClass([this.overAllWrapper],"e-valid-input")):("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&t.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"!==this.mode||!t.Browser.isIE||t.isNullOrUndefined(e)||i?this.scrollFocusStatus?(t.isNullOrUndefined(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1)):(this.inputFocus=!1,this.overAllWrapper.classList.remove(re),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.DropDownBaseresetBlazorTemplates(!1,!1,!0,!0,!1,!0,!0),this.hidePopup()),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,t.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),g(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!t.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),void this.checkPlaceholderSize()):(this.inputFocus=!1,void this.overAllWrapper.classList.remove(re)))},s.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else t.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},s.prototype.setPlaceholderSize=function(e){t.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":t.addClass([this.searchWrapper],"e-search-custom-width"):t.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),t.removeClass([this.searchWrapper],"e-search-custom-width"))},s.prototype.refreshInputHight=function(){this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add("e-zero-size"):this.searchWrapper.classList.remove("e-zero-size")},s.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},s.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var o={e:e,oldValue:i,value:t,isInteracted:!!e,element:this.element};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",o),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}},s.prototype.updateTempValue=function(){this.value?this.tempValues=this.value.slice():this.tempValues=this.value},s.prototype.getPagingCount=function(){var e=this.list.classList.contains(k.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height");return Math.round(this.list.offsetHeight/parseInt(e,10))},s.prototype.pageUpSelection=function(e){var t=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)"),i=e>=0?t[e+1]:t[0];this.addListFocus(i),this.scrollBottom(i,this.getIndexByValue(i.getAttribute("data-value")))},s.prototype.pageDownSelection=function(e){this.getItems();var t=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)"),i=e<=t.length?t[e-1]:t[t.length-1];this.addListFocus(i),this.scrollBottom(i,this.getIndexByValue(i.getAttribute("data-value")))},s.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+k.li).length>0?this.ulElement.querySelectorAll("."+k.li+":not(."+ne+")"):[]},s.prototype.focusInHandler=function(e){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("e-zero-size"),this.checkPlaceholderSize(),this.focused){var t={isInteracted:!!e,event:e};this.trigger("focus",t),this.focused=!1}return this.overAllWrapper.classList.contains(re)||this.overAllWrapper.classList.add(re),y(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),!0}return!1},s.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add("e-delimiter")},s.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove("e-delimiter")},s.prototype.expandTextbox=function(){var e=5;this.placeholder&&(e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length),this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},s.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},s.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},s.prototype.checkTextLength=function(){return this.targetElement().length<1},s.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(),e.preventDefault())}},s.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+k.focus);t.isNullOrUndefined(e)||this.inputElement.setAttribute("aria-activedescendant",e.id)},s.prototype.homeNavigation=function(e){this.removeFocus();var t=this.ulElement.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");if(t.length>0){var i=t[e?0:t.length-1];i.classList.add(k.focus),this.scrollBottom(i)}},s.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124))){if(e.altKey)return void this.popupKeyActions(e);if(this.isPopupOpen()){var t=this.list.querySelector("."+k.focus);switch(e.keyCode){case 36:case 35:this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(void 0-this.getPagingCount()),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(void 0+this.getPagingCount()),this.updateAriaAttribute()));case 38:this.arrowUp(e);break;case 40:this.arrowDown(e);break;case 27:return e.preventDefault(),this.hidePopup(),void("CheckBox"===this.mode&&this.inputElement.focus());case 13:return e.preventDefault(),"CheckBox"!==this.mode&&this.selectByKey(e),void this.checkPlaceholderSize();case 32:return void this.spaceKeySelection(e);case 9:e.preventDefault(),this.hidePopup(),this.inputElement.focus(),this.overAllWrapper.classList.add(re)}}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.checkBackCommand(e),this.expandTextbox(),this.refreshPopup()}},s.prototype.arrowDown=function(e){e.preventDefault(),this.moveByList(1),this.keyAction=!0,(document.activeElement.classList.contains("e-input-filter")||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&(this.list.focus(),t.EventHandler.add(this.list,"keydown",this.onKeyDown,this)),this.updateAriaAttribute()},s.prototype.arrowUp=function(e){e.preventDefault(),this.keyAction=!0;var i=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+k.li+",li."+k.group+":not(."+ne+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+k.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),this.updateAriaAttribute()},s.prototype.spaceKeySelection=function(e){"CheckBox"===this.mode&&(document.activeElement.classList.contains("e-input-filter")||(e.preventDefault(),this.keyAction=!0,this.list.focus()),this.selectByKey(e)),this.checkPlaceholderSize()},s.prototype.checkBackCommand=function(e){8===e.keyCode&&""===this.targetElement()?this.backCommand=!1:this.backCommand=!0},s.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.value[this.value.length-1];this.removeValue(t,e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t)}},s.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},s.prototype.escapeAction=function(){var 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()},s.prototype.scrollBottom=function(e,i){var s=this.list.offsetHeight,l=e.offsetTop+e.offsetHeight-this.list.scrollTop,o=this.list.scrollTop+l-s,r=e.offsetTop+e.offsetHeight-this.list.scrollTop;r=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r,0===i?this.list.scrollTop=0:l>s?this.list.scrollTop=o:r>0&&this.list.offsetHeight>r||(this.list.scrollTop=o)},s.prototype.scrollTop=function(e,i){var s=e.offsetTop-this.list.scrollTop;s=this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?s-this.fixedHeaderElement.offsetHeight:s;var l=e.offsetTop+e.offsetHeight-this.list.scrollTop;0===i?this.list.scrollTop=0:s<0?this.list.scrollTop=this.list.scrollTop+s:l>0&&this.list.offsetHeight>l||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0))},s.prototype.selectListByKey=function(e){var i,s=this.list.querySelector("li."+k.focus),l=this.value&&this.value.length?this.value.length:0;null!==s&&(s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength?(this.updateListSelection(s,e),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=s.firstElementChild.lastElementChild,this.findGroupStart(i),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()):!this.isValidLI(s)&&l<this.maximumSelectionLength&&((i=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,s):this.selectAllItem(!0,e,s)),this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup()),this.refreshPlaceHolder()},s.prototype.refreshListItems=function(e){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var t=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(t,this.mainData),this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}},s.prototype.removeSelectedChip=function(e){var i,s=this.chipCollectionWrapper.querySelector("span.e-chip-selected");null!==s&&(t.isNullOrUndefined(this.value)||(this.tempValues=this.value.slice()),null!==(i=s.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,e)),this.removeValue(s.getAttribute("data-value"),e),this.makeTextBoxEmpty()),this.closePopupOnSelect&&this.hidePopup(),this.checkPlaceholderSize()},s.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+k.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},s.prototype.moveByList=function(e){if(this.list){var i=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+k.li+",li."+k.group+":not(."+ne+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+k.focus),l=-1;if(i.length){for(var o=0;o<i.length;o++)if(i[o]===s){l=o;break}e>0?l<i.length-1&&(this.removeFocus(),this.addListFocus(i[++l]),this.updateCheck(i[l]),this.scrollBottom(i[l],l)):l>0&&(this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l))}}},s.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},s.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),l=this.chipCollectionWrapper.querySelector("span.e-chip-selected");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))},s.prototype.chipClick=function(e){if(this.enabled){var i=t.closest(e.target,".e-chips");this.removeChipSelection(),this.addChipSelection(i,e)}},s.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},s.prototype.addChipSelection=function(e,i){t.addClass([e],"e-chip-selected"),this.trigger("chipSelection",i)},s.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var i=e.target.parentElement.getAttribute("data-value"),s=this.getFormattedValue(i);if(this.allowCustomValue&&("false"!==i&&!1===s||!t.isNullOrUndefined(s)&&"NaN"===s.toString())&&(s=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(),this.inputFocus||this.inputElement.focus(),this.removeValue(s,e),t.isNullOrUndefined(this.findListElement(this.list,"li","data-value",s))&&this.mainList&&this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},s.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},s.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=this.placeholder:this.setFloatLabelType(),this.expandTextbox()},s.prototype.removeValue=function(e,i,s,l){var o=this,r=this.value.indexOf(this.getFormattedValue(e));-1===r&&this.allowCustomValue&&!t.isNullOrUndefined(e)&&(r=this.value.indexOf(e.toString()));var n=i&&i.target;l=!!(l||n&&n.classList.contains("e-close-hooker"))||null;var a=this.hideSelectedItem?ne:k.selected;if(-1!==r){var h=this.findListElement(this.list,"li","data-value",e),p=this.getDataByValue(e),u={e:i,item:h,itemData:p,isInteracted:!!i,cancel:!1};this.trigger("removing",u,function(n){if(n.cancel)o.removeIndex++;else{var u=o.value.slice(0);if(u.splice(r,1),t.isBlazor()&&o.isServerRendered){var c=[].concat([],u);o.setProperties({value:0===c.length?null:c},!0)}else o.setProperties({value:[].concat([],u)},!0);if(null!==h){var d=o.findListElement(o.mainList,"li","data-value",e);h.setAttribute("aria-selected","false"),t.removeClass([h],a),d&&(d.setAttribute("aria-selected","false"),t.removeClass([h,d],a)),o.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===o.mode,li:h,e:o,index:r}),o.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===o.mode,li:h,e:i}),t.attributes(o.inputElement,{"aria-activedescendant":h.id}),o.value&&o.value.length!==o.mainData.length&&"CheckBox"===o.mode&&o.showSelectAll&&!o.isSelectAll&&!l&&o.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===o.mode,value:"uncheck"})}if(o.hideSelectedItem&&o.fields.groupBy&&o.hideGroupItem(e),o.updateMainList(!0,e),o.removeChip(e),o.updateChipStatus(),(o.value&&o.value.length?o.value.length:0)<o.maximumSelectionLength){var m=o.list.querySelectorAll("li."+k.li+":not(.e-active)");t.removeClass(m,"e-disable")}o.trigger("removed",n);var f=i&&i.currentTarget,v=!(!f||!f.classList.contains("e-selectall-parent"))||null;if(o.changeOnBlur||l||!i||!s||v||o.updateValueState(i,o.value,o.tempValues),s&&(o.selectAllEventData.push(p),o.selectAllEventEle.push(h)),1===s){o.changeOnBlur||o.updateValueState(i,o.value,o.tempValues);var y={event:i,items:o.selectAllEventEle,itemData:o.selectAllEventData,isInteracted:!!i,isChecked:!1};o.trigger("selectedAll",y),o.selectAllEventData=[],o.selectAllEventEle=[]}!l||1!==s&&null!==s||o.clearAllCallback(i,l),t.isBlazor()&&o.isServerRendered&&(t.isNullOrUndefined(o.value)||0===o.value.length)&&o.updatedataValueItems(i)}})}},s.prototype.updateMainList=function(e,i){if(this.allowFiltering||"CheckBox"===this.mode){var s=this.findListElement(this.mainList,"li","data-value",i);s&&(e?(s.setAttribute("aria-selected","false"),t.removeClass([s],this.hideSelectedItem?ne:k.selected),"CheckBox"===this.mode&&(s.firstElementChild.setAttribute("aria-checked","false"),t.removeClass([s.firstElementChild.lastElementChild],"e-check"))):(s.setAttribute("aria-selected","true"),t.addClass([s],this.hideSelectedItem?ne:k.selected),"CheckBox"===this.mode&&(s.firstElementChild.setAttribute("aria-checked","true"),t.addClass([s.firstElementChild.lastElementChild],"e-check"))))}},s.prototype.removeChip=function(e){if(this.chipCollectionWrapper){var i=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);i&&t.remove(i)}},s.prototype.setWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.overAllWrapper.style.width=t.formatUnit(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.updateChipStatus=function(){this.value&&this.value.length?(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},s.prototype.addValue=function(e,t,i){this.value||(this.value=[]),this.value.indexOf(e)<0&&this.setProperties({value:[].concat([],this.value,[e])},!0);var s=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),s&&(this.addListFocus(s),this.addListSelection(s)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},s.prototype.checkMaxSelection=function(){if((this.value&&this.value.length?this.value.length:0)===this.maximumSelectionLength){var e=this.list.querySelectorAll("li."+k.li+":not(.e-active)");t.addClass(e,"e-disable")}},s.prototype.dispatchSelect=function(e,t,i,s,l){var o=this,r=this.listData;if(this.initStatus&&!s){var n=this.getDataByValue(e),a={e:t,item:i,itemData:n,isInteracted:!!t,cancel:!1};this.trigger("select",a,function(s){if(!s.cancel){if(l&&(o.selectAllEventData.push(n),o.selectAllEventEle.push(i)),1===l){var a={event:t,items:o.selectAllEventEle,itemData:o.selectAllEventData,isInteracted:!!t,isChecked:!0};o.trigger("selectedAll",a),o.selectAllEventData=[]}o.allowCustomValue&&o.isServerRendered&&o.listData!==r&&(o.listData=r),o.updateListSelectEventCallback(e,i,t)}})}},s.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},s.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),i=this.chipCollectionWrapper.querySelectorAll("span."+"e-chips-close".split(" ")[0]);if(t.removeClass(e,"e-chip-selected"),t.Browser.isDevice)for(var s=0;s<i.length;s++)i[s].style.display="none"},s.prototype.onMobileChipInteraction=function(e){var i=t.closest(e.target,".e-chips"),s=i.querySelector("span."+"e-chips-close".split(" ")[0]);this.enabled&&!this.readonly&&(i.classList.contains("e-chip-selected")||(this.removeChipFocus(),s.style.display="",i.classList.add("e-chip-selected")),this.refreshPopup(),e.preventDefault())},s.prototype.multiCompiler=function(e){var i=!1;if(e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},s.prototype.getChip=function(e,i,s){var l,o=this,r={text:i,value:i},n=this.createElement("span",{className:ae,attrs:{"data-value":i,title:e}}),a=this.createElement("span",{className:"e-chipcontent"}),h=this.createElement("span",{className:"e-chips-close"});if(this.mainData&&(r=t.isBlazor()&&this.isServerRendered?JSON.parse(JSON.stringify(this.getDataByValue(i))):this.getDataByValue(i)),this.valueTemplate&&!t.isNullOrUndefined(r)){var p=(l=this.multiCompiler(this.valueTemplate)?t.compile(t.select(this.valueTemplate,document).innerHTML.trim()):t.compile(this.valueTemplate))(r,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a);if(p&&p.length>0)for(var u=0;u<p.length;u++)a.appendChild(p[u]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!0,!1,!1,!1)}else this.enableHtmlSanitizer?a.innerText=e:a.innerHTML=e;n.appendChild(a);var c={isInteracted:!!s,itemData:r,e:s,setClass:function(e){t.addClass([n],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",c,function(e){e.cancel||(e.setClass&&"string"==typeof e.setClass&&t.isBlazor()&&o.isServerRendered&&t.addClass([n],e.setClass),t.Browser.isDevice?(n.classList.add("e-mob-chip"),t.append([h],n),h.style.display="none",t.EventHandler.add(n,"click",o.onMobileChipInteraction,o)):(t.EventHandler.add(n,"mousedown",o.chipClick,o),o.showClearButton&&n.appendChild(h)),t.EventHandler.add(h,"mousedown",o.onChipRemove,o),o.chipCollectionWrapper.appendChild(n),!o.changeOnBlur&&s&&o.updateValueState(s,o.value,o.tempValues))})},s.prototype.calcPopupWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px"),e},s.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},s.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},s.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties;return this.listCurrentOptions=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},t.extend(this.listCurrentOptions,this.listCurrentOptions,i,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:l}),this.listCurrentOptions},s.prototype.renderPopup=function(){var i=this;if(this.list||e.prototype.render.call(this),!this.popupObj){document.body.appendChild(this.popupWrapper);var s=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&s&&this.filterParent&&(s.remove(),this.filterParent=null);var o=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),o-=this.header.offsetHeight),t.append([this.list],this.popupWrapper),this.footerTemplate&&(this.setFooterTemplate(),o-=this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o-=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}),o=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(o-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(o-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var r={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",r),o-=this.searchBoxHeight),t.addClass([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(o),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight),this.popupObj=new l.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){i.popupObj.element.parentElement&&(i.popupObj.unwireScrollEvents(),t.detach(i.popupObj.element))},open:function(){if(i.popupObj.resolveCollision(),!i.isFirstClick){var e=i.list.querySelector("ul");e&&(i.itemTemplate&&t.isBlazor()&&i.isServerRendered?setTimeout(function(){i.mainList=i.ulElement},0):"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||(i.mainList=e.cloneNode?e.cloneNode(!0):e)),i.isFirstClick=!0}i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||i.loadTemplate(),i.setScrollPosition(),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"})},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}),"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.popupObj.close(),this.popupWrapper.style.visibility=""}},s.prototype.setHeaderTemplate=function(){var e;this.header&&this.header.remove(),this.header=this.createElement("div"),t.addClass([this.header],"e-ddl-header");var i=(e=this.multiCompiler(this.headerTemplate)?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.header.appendChild(i[s]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!0,!1),"CheckBox"===this.mode&&this.showSelectAll?t.prepend([this.header],this.popupWrapper):t.append([this.header],this.popupWrapper),t.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},s.prototype.setFooterTemplate=function(){var e;this.footer&&this.footer.remove(),this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddl-footer");var i=(e=this.multiCompiler(this.footerTemplate)?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.footer.appendChild(i[s]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!1,!0),t.append([this.footer],this.popupWrapper),t.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},s.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var i=void 0;if(this.value&&this.value.length>0){var s=this.list&&this.list.querySelectorAll("li.e-list-item");if(s&&s.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,i=this.value[this.removeIndex];this.removeIndex<this.value.length&&(this.removeValue(i,e,null,!0),null!==this.value||!t.isBlazor()||!this.isServerRendered);i=this.value[this.removeIndex]);}else this.clearAllCallback(e)}},s.prototype.clearAllCallback=function(e,i){var s=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,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.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&i&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!i||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},s.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),t.EventHandler.add(window,"resize",this.windowResize,this),t.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),t.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),t.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"blur",this.onBlur,this),t.EventHandler.add(this.componentWrapper,"mousemove",this.mouseIn,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),t.EventHandler.add(this.overAllClear,"mouseup",this.clearAll,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},s.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&this.search(e)},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.search(e)})},s.prototype.search=function(e){var s=this;if(t.isNullOrUndefined(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(),this.openClick(e),!this.checkTextLength()||this.allowFiltering||t.isNullOrUndefined(e)||8===e.keyCode){var l=this.targetElement();if(this.allowFiltering){var o={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){e.cancel||s.isFiltered||e.preventDefaultAction||(s.filterAction=!0,s.dataUpdater(s.dataSource,null,s.fields))})}else if(this.allowCustomValue){var r=new i.Query;r=""!==l?r.where(this.fields.text,"startswith",l,this.ignoreCase,this.ignoreAccent):r,this.dataUpdater(this.mainData,r,this.fields)}else{var n=this.list.querySelectorAll("li."+k.li+":not(.e-hide-listitem)"),a=h(this.targetElement(),n,"StartsWith",this.ignoreCase);a&&null!==a.item?(this.addListFocus(a.item),this.list.scrollTop=a.item.offsetHeight*a.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem()},s.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"multi-select"},s.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},s.prototype.updateData=function(e,i){var s,l="",o="Delimiter"===this.mode||"CheckBox"===this.mode,r=[],n=this.listData;if(this.listData=this.mainData,this.hiddenElement.innerHTML="",!t.isNullOrUndefined(this.value))for(var a=0;!t.isNullOrUndefined(this.value[a]);a++){var h=this.findListElement(t.isNullOrUndefined(this.mainList)?this.ulElement:this.mainList,"li","data-value",this.value[a]);t.isBlazor()&&this.isServerRendered||!t.isNullOrUndefined(h)||this.allowCustomValue?(l+=(s=this.listData?this.getTextByValue(this.value[a]):this.value[a])+e+" ",r.push(s)):(this.value.splice(a,1),a-=1),this.hiddenElement.innerHTML+='<option selected value ="'+this.value[a]+'">'+a+"</option>"}this.setProperties({text:r.toString()},!0),o&&(this.updateWrapperText(this.delimiterWrapper,l),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id));var p=i&&i.target,u=!(!p||!p.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&i&&!u||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(i,this.value,this.tempValues)),this.listData=n,this.addValidInputClass()},s.prototype.initialTextUpdate=function(){if(t.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),i=[],s=0;e.length>s;s++){var l=this.getValueByText(e[s]);t.isNullOrUndefined(l)?this.allowCustomValue&&i.push(e[s]):i.push(l)}i&&i.length&&this.setProperties({value:i},!0)}},s.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,t),this.unwireListEvents(),this.wireListEvents()},s.prototype.initialValueUpdate=function(){if(this.list){var e=void 0,i=void 0,s=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(s=this.value[l],i=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",s),e=this.getTextByValue(s),i&&"true"!==i.getAttribute("aria-selected")||i&&"true"===i.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode))this.addChip(e,s),this.addListSelection(i);else if(s&&this.allowCustomValue){var o=this.listData.length,r={};t.setValue(this.fields.text,s,r),t.setValue(this.fields.value,s,r);var n=this.popupWrapper.querySelector("."+k.noData);this.addItem(r,o),this.popupWrapper.contains(n)&&(this.list.setAttribute("style",n.getAttribute("style")),this.popupWrapper.replaceChild(this.list,n),this.wireListEvents()),this.addChip(e,s),this.addListSelection(i)}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar),"CheckBox"!==this.mode||!this.showSelectAll||!t.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()}},s.prototype.updateActionCompleteData=function(e,i){this.value&&this.value.indexOf(e.getAttribute("data-value"))>-1&&(this.mainList=this.ulElement,t.addClass([e],ne))},s.prototype.updateAddItemList=function(e,i){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+k.noData)&&e&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),t.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup())},s.prototype.updateDataList=function(){this.mainList&&this.ulElement&&this.mainList.childElementCount<this.ulElement.childElementCount&&(this.mainList=this.ulElement.cloneNode?this.ulElement.cloneNode(!0):this.ulElement)},s.prototype.isValidLI=function(e){return e&&!e.classList.contains(k.disabled)&&!e.classList.contains(k.group)&&e.classList.contains(k.li)},s.prototype.updateListSelection=function(e,i,s){var l=e.getAttribute("data-value"),o=this.getFormattedValue(l);this.allowCustomValue&&("false"!==l&&!1===o||!t.isNullOrUndefined(o)&&"NaN"===o.toString())&&(o=l),this.removeHover(),this.value&&-1!==this.value.indexOf(o)?this.removeValue(o,i,s):this.dispatchSelect(o,i,e,"true"===e.getAttribute("aria-selected"),s)},s.prototype.updateListSelectEventCallback=function(e,i,s){var l=this,o=this.getTextByValue(e);if(!this.allowCustomValue&&!this.allowFiltering||this.findListElement(this.mainList,"li","data-value",e))this.remoteCustomValue=!1,this.addValue(e,o,s);else{var r=i.cloneNode(!0),n=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof t.getValue(n,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var a=this.getDataByValue(e),h={newData:a,cancel:!1};this.trigger("customValueSelection",h,function(i){i.cancel||(t.append([r],l.mainList),l.mainData.push(a),l.remoteCustomValue=!1,l.addValue(e,o,s),t.isBlazor()&&l.isServerRendered&&(l.checkPlaceholderSize(),l.makeTextBoxEmpty()))})}t.isBlazor()&&this.isServerRendered&&this.value&&this.list&&(this.value.length===this.list.querySelectorAll("li.e-list-item").length||this.value.length===this.maximumSelectionLength)&&(this.updatedataValueItems(s),this.checkPlaceholderSize()),t.isBlazor()&&this.isServerRendered&&(this.checkPlaceholderSize(),this.makeTextBoxEmpty())},s.prototype.removeListSelection=function(){var e=this.hideSelectedItem?ne:k.selected,i=this.list.querySelectorAll("."+e),s=i.length;if(i&&i.length)for(t.removeClass(i,e);s>0;)i[s-1].setAttribute("aria-selected","false"),s--;if(!t.isNullOrUndefined(this.mainList)){var l=this.mainList.querySelectorAll("."+e),o=l.length;if(l&&l.length)for(t.removeClass(l,e);o>0;)l[o-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(i&&i.length>o-1&&(i[o-1].firstElementChild.setAttribute("aria-checked","false"),t.removeClass([i[o-1].firstElementChild.lastElementChild],"e-check")),l[o-1].firstElementChild.setAttribute("aria-checked","false"),t.removeClass([l[o-1].firstElementChild.lastElementChild],"e-check")),o--}},s.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+k.hover);e&&e.length&&t.removeClass(e,k.hover)},s.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+k.focus),i=this.mainList.querySelectorAll("."+k.focus);e&&e.length&&(t.removeClass(e,k.focus),t.removeClass(i,k.focus))}},s.prototype.addListHover=function(e){this.enabled&&this.isValidLI(e)?(this.removeHover(),t.addClass([e],k.hover)):null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(this.removeHover(),t.addClass([e],k.hover))},s.prototype.addListFocus=function(e){this.enabled&&this.isValidLI(e)?(this.removeFocus(),t.addClass([e],k.focus)):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&t.addClass([e],k.focus)},s.prototype.addListSelection=function(e){var i=this.hideSelectedItem?ne:k.selected;if(this.isValidLI(e)&&!e.classList.contains(k.hover)){if(t.addClass([e],i),this.updateMainList(!1,e.getAttribute("data-value")),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode){var s=e.firstElementChild.getAttribute("aria-checked");("false"===s||t.isNullOrUndefined(s))&&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(),t.attributes(this.inputElement,{"aria-activedescendant":e.id})}},s.prototype.updateDelimeter=function(e,t){this.updateData(e,t)},s.prototype.onMouseClick=function(e){var i=this;this.keyCode=null,this.scrollFocusStatus=!1;var s=e.target,l=t.closest(s,"."+k.li);if(t.closest(s,"."+k.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(s=s.classList.contains("e-list-group-item")?s.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),s.classList.remove("e-check"),s.classList.remove("e-stop"),t.closest(s,".e-list-group-item").classList.remove("e-active"),s.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),s.classList.remove("e-stop"),s.classList.add("e-check"),t.closest(s,".e-list-group-item").classList.add("e-active"),s.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(l)){var o=this.value&&this.value.length?this.value.length:0;l.classList.contains("e-active")&&(o-=1),o<this.maximumSelectionLength&&(this.updateListSelection(l,e),this.checkPlaceholderSize(),this.addListFocus(l),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(l.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout(function(){i.updateDelimeter(i.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup():e.preventDefault(),this.makeTextBoxEmpty(),this.findGroupStart(s)}else e.preventDefault();"CheckBox"!==this.mode&&this.refreshListItems(t.isNullOrUndefined(l)?null:l.textContent),this.refreshPlaceHolder(),this.deselectHeader()}},s.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var i=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),i=this.findGroupAttrtibutes(e,0,0,0,0),i=this.findGroupAttrtibutes(e,i[0],i[1],i[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,i[0],i[1],i[2])}},s.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(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]},s.prototype.updateCheckBox=function(e,i,s,l){if(null!==e){var o=e.getElementsByClassName("e-frame")[0];l===i?(o.classList.remove("e-stop"),o.classList.add("e-check"),t.closest(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):l===s?(o.classList.remove("e-check"),o.classList.remove("e-stop"),t.closest(o,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===i-1?(o.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),t.closest(o,".e-list-group-item").classList.add("e-active"),o.classList.add("e-check")):(o.classList.remove("e-check"),o.classList.add("e-stop"),t.closest(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},s.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,i=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&t.removeClass(i,"e-disable"),e===this.maximumSelectionLength&&t.addClass(i,"e-disable")},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+k.li);null===i&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(i=t.closest(e.target,"."+k.group)),this.addListHover(i)},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},s.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},s.prototype.wireListEvents=function(){t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),t.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),t.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.unwireListEvents=function(){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(t.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),t.EventHandler.remove(this.list,"mouseup",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},s.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"},s.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&("none"!==this.overAllClear.style.display?this.spinnerElement=this.overAllClear:(this.spinnerElement=this.createElement("span",{className:"e-chips-close e-close-hooker e-ms-spinner-icon"}),this.componentWrapper.appendChild(this.spinnerElement)),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),t.addClass([this.spinnerElement],"e-ddl-disable-icon"),l.showSpinner(this.spinnerElement))},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],"e-ddl-disable-icon"),this.spinnerElement.classList.contains("e-ms-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.updateWrapperText=function(e,i){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=i:e.innerText=t.SanitizeHtmlHelper.sanitize(i)},s.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove("e-delim-total"),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=1,o=void 0,r=void 0,n=0,a=void 0;this.updateWrapperText(this.viewWrapper,e);var h={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},p=new t.L10n(this.getLocaleName(),h,this.locale);""===p.getConstant("actionFailureTemplate")&&(p=new t.L10n("dropdowns",h,this.locale)),""===p.getConstant("noRecordsTemplate")&&(p=new t.L10n("dropdowns",h,this.locale));var u=p.getConstant("overflowCountTemplate"),c=this.createElement("span",{className:"e-remain"}),d=t.compile(u),m=t.compile(p.getConstant("totalCountTemplate")),f=d({count:this.value.length},this,"overflowCountTemplate",null,!this.isStringTemplate,null,c);f&&f.length>0&&c.appendChild(f[0]),this.viewWrapper.appendChild(c),this.renderReactTemplates();var v=c.offsetWidth;if(t.remove(c),this.showDropDownIcon&&(n=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!t.isNullOrUndefined(this.value))for(var y=0;!t.isNullOrUndefined(this.value[y]);y++){if(e+=0===y?"":this.delimiterChar+" ",i=this.getOverflowVal(y),e+=i,i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e),o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),a=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),o+n+this.clearIconWidth>a){for(void 0!==s&&""!==s&&(i=s,y=l+1),this.updateWrapperText(this.viewWrapper,i),r=this.value.length-y,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);o+v+n+this.clearIconWidth>a&&0!==o&&""!==this.viewWrapper.innerHTML;){var g=this.viewWrapper.innerHTML.split(this.delimiterChar);g.pop(),this.viewWrapper.innerHTML=g.join(this.delimiterChar),r++,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)}break}o+v+n+this.clearIconWidth<=a?(s=e,l=y):0===y&&(s="",l=-1)}if(r>0){var C=a-n-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(c,this.viewWrapper,r,d,m,C)),this.updateRemainWidth(this.viewWrapper,C),this.updateRemainingText(c,n,r,d,m)}}else this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none"},s.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},s.prototype.updateRemainWidth=function(e,t){e.classList.contains("e-delim-total")&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},s.prototype.updateRemainTemplate=function(e,t,i,s,l,o){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var r=s({count:i},this,"overflowCountTemplate",null,!this.isStringTemplate,null,e),n=l({count:i},this,"totalCountTemplate",null,!this.isStringTemplate,null,e);return e.appendChild(t.firstChild&&3===t.firstChild.nodeType?r&&r[0]:n&&n[0]),t.firstChild&&3===t.firstChild.nodeType?t.classList.remove("e-delim-total"):(t.classList.add("e-delim-total"),this.updateRemainWidth(t,o)),e},s.prototype.updateRemainingText=function(e,t,i,s,l){var o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),r=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(r+t>=o&&0!==r&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;r+t>o&&0!==r&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var n=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);n.pop(),this.viewWrapper.firstChild.nodeValue=n.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,r=this.viewWrapper.offsetWidth}var a=o-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,a)}},s.prototype.getOverflowVal=function(e){var t;if(this.mainData&&this.mainData.length)if("CheckBox"===this.mode){var i=this.listData;this.listData=this.mainData,t=this.getTextByValue(this.value[e]),this.listData=i}else t=this.getTextByValue(this.value[e]);else t=this.value[e];return t},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),t.EventHandler.remove(window,"resize",this.windowResize),t.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),t.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.EventHandler.remove(this.inputElement,"blur",this.onBlur),t.EventHandler.remove(this.componentWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},s.prototype.selectAllItem=function(e,i,s){var l;if(l=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)'),this.value&&this.value.length&&this.isPopupOpen()&&i&&i.target&&t.closest(i.target,".e-close-hooker")&&this.allowFiltering&&(l=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var o=i?i.target:null;if(o=i&&32===i.keyCode?s:o,(o=o&&o.classList.contains("e-frame")?o.parentElement.parentElement:o)&&o.classList.contains("e-list-group-item")){var r=o.nextElementSibling;if(t.isNullOrUndefined(r))return;for(;r.classList.contains("e-list-item");){if(e){if(!r.firstElementChild.lastElementChild.classList.contains("e-check")){var n=this.value&&this.value.length?this.value.length:0;r.classList.contains("e-active")&&(n-=1),n<this.maximumSelectionLength&&this.updateListSelection(r,i)}}else r.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(r,i);if(null==(r=r.nextElementSibling))break}if(o.classList.contains("e-list-group-item")){var a=this.list.getElementsByClassName("e-item-focus")[0];a&&a.classList.remove("e-item-focus"),e?o.classList.add("e-active"):o.classList.remove("e-active"),o.classList.add("e-item-focus")}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&i&&this.updateValueState(i,this.value,this.tempValues)}else this.updateValue(i,l,e)}else this.updateValue(i,l,e)},s.prototype.updateValue=function(e,i,s){var l=this,o=i.length;if(i&&i.length){var r=0,n=0;for(n=this.enableGroupCheckBox?s?this.maximumSelectionLength-(this.value?this.value.length:0):i.length:s?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength;r<o&&r<=50&&r<n;)this.updateListSelection(i[r],e,o-r),this.enableGroupCheckBox&&this.findGroupStart(i[r]),r++;o>50&&setTimeout(function(){for(;r<o&&r<n;)l.updateListSelection(i[r],e,o-r),l.enableGroupCheckBox&&l.findGroupStart(i[r]),r++;t.isBlazor()&&l.isServerRendered||(l.updatedataValueItems(e),l.changeOnBlur||(l.updateValueState(e,l.value,l.tempValues),l.isSelectAll=l.isSelectAll?!l.isSelectAll:l.isSelectAll),l.updateHiddenElement())},0)}t.isBlazor()&&this.isServerRendered||(this.updatedataValueItems(e),this.checkPlaceholderSize(),o<=50&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement()))},s.prototype.updateHiddenElement=function(){var e=this,i="",s="",l="",o=[];"CheckBox"===this.mode&&(this.value.map(function(t,r){i+='<option selected value ="'+t+'">'+r+"</option>",l=e.listData?e.getTextByValue(t):t,s+=l+e.delimiterChar+" ",o.push(l)}),this.hiddenElement.innerHTML=i,this.updateWrapperText(this.delimiterWrapper,s),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.setProperties({text:o.toString()},!0),this.refreshInputHight(),this.refreshPlaceHolder())},s.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},s.prototype.textboxValueUpdate=function(e){var i=e&&e.target&&(t.closest(e.target,".e-selectall-parent")||t.closest(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||i)?this.searchWrapper.classList.remove("e-zero-size"):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),i||this.isSelectAll||this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.updateDataSource=function(e){t.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),!this.value||!this.value.length||t.isBlazor()&&this.isServerRendered||(this.setProperties({value:this.value}),this.refreshSelection())},s.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},s.prototype.selectAllItems=function(i,s){var l=this;if(t.isNullOrUndefined(this.list))this.selectAllAction=function(){if("CheckBox"===l.mode&&l.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===l.mode,value:i?"check":"uncheck"};l.notify("checkSelectAll",e)}l.selectAllItem(i,s),l.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var o={value:i?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",o)}this.selectAllItem(i,s)}},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){(i.dataSource&&!t.isNullOrUndefined(Object.keys(i.dataSource))||i.query&&!t.isNullOrUndefined(Object.keys(i.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,o=Object.keys(i);l<o.length;l++){var r=o[l];switch(r){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(t.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(i.showClearButton);break;case"text":this.updateVal(this.value,this.value,"text");break;case"value":this.updateVal(this.value,s.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(i.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:i.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(i.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(s.cssClass),this.updateCssClass();break;case"enableRtl":this.enableRTL(i.enableRtl),e.prototype.onPropertyChanged.call(this,i,s);break;case"readonly":this.updateReadonly(i.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(i.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();break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;default:var n=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,n.newProperty,n.oldProperty)}}},s.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},s.prototype.updateVal=function(e,s,l){this.list&&(!(this.dataSource instanceof i.DataManager)||this.listData&&this.mainList&&this.mainData)?("text"===l&&(this.initialTextUpdate(),e=this.value),(t.isNullOrUndefined(this.value)||0===this.value.length)&&(this.tempValues=s),this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,s),this.checkPlaceholderSize()):this.onLoadSelect(),this.changeOnBlur||this.updateValueState(null,e,s)},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.hidePopup=function(){var e=this;if(this.isPopupOpen()){var i={name:"FadeOut",duration:100,delay:100},s={popup:this.popupObj,cancel:!1,animation:i};this.trigger("close",s,function(i){i.cancel||(e.beforePopupOpen=!1,e.overAllWrapper.classList.remove("e-icon-anim"),e.popupObj.hide(new t.Animation(i.animation)),t.attributes(e.inputElement,{"aria-expanded":"false"}),e.allowFiltering&&e.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===e.mode,value:"clear"}),e.popupObj.hide(),t.removeClass([document.body,e.popupObj.element],"e-popup-full-page"),t.EventHandler.remove(e.list,"keydown",e.onKeyDown))})}},s.prototype.showPopup=function(){var i=this;if(this.enabled){var s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(!s.cancel){if(t.isBlazor()&&i.isServerRendered&&i.itemTemplate&&(i.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1,!1,!1,!1,!1),"CheckBox"!==i.mode&&i.list&&i.refreshSelection()),!i.ulElement)return i.beforePopupOpen=!0,e.prototype.render.call(i),void("CheckBox"===i.mode&&t.Browser.isDevice&&i.allowFiltering&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode}));"CheckBox"===i.mode&&t.Browser.isDevice&&i.allowFiltering&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode});var l=i.ulElement.querySelectorAll("li.e-list-item").length,o=i.ulElement.querySelectorAll("li."+k.li+"."+ne).length;if(l>0&&l===o&&o===i.mainData.length)return void(i.beforePopupOpen=!1);i.onPopupShown()}})}},s.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},s.prototype.getModuleName=function(){return"multiselect"},s.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)},s.prototype.render=function(){this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view e-delim-values",styles:"display:none;"}),this.overAllClear=this.createElement("span",{className:"e-chips-close e-close-hooker",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&&t.addClass([this.overAllWrapper],"e-checkbox"),t.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"}),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:"e-delim-values",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",t.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!t.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add("e-close-icon-hide"),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),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?d(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"):t.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(),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},s.prototype.checkInitialValue=function(){var e=this,s=this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource);if((!this.value||!this.value.length)&&t.isNullOrUndefined(this.text)&&!s&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var l=this.element.options,o=[],r="",n=0,a=l.length;n<a;n++){var h=l[n];t.isNullOrUndefined(h.getAttribute("selected"))||(h.getAttribute("value")?o.push(h.getAttribute("value")):r+=h.text+this.delimiterChar)}o.length>0?this.setProperties({value:o},!0):""!==r&&this.setProperties({text:r},!0),(o.length>0||""!==r)&&(this.refreshInputHight(),this.refreshPlaceHolder())}(this.value&&this.value.length||!t.isNullOrUndefined(this.text))&&this.renderPopup(),t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length?(this.dataSource instanceof i.DataManager?this.setInitialValue=function(){e.initStatus=!1,e.initialValueUpdate(),e.initialUpdate(),e.setInitialValue=null,e.initStatus=!0}:(this.initialValueUpdate(),this.initialUpdate()),this.updateTempValue()):this.initialUpdate(),this.initStatus=!0,this.checkAutoFocus(),t.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},s.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},s.prototype.setFloatLabelType=function(){f(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&d(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},s.prototype.addValidInputClass=function(){!t.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?t.addClass([this.overAllWrapper],"e-valid-input"):t.removeClass([this.overAllWrapper],"e-valid-input")},s.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:"e-input-group-icon e-ddl-icon"}),this.componentWrapper.appendChild(this.dropIcon),t.addClass([this.componentWrapper],["e-down-icon"])):t.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),t.removeClass([this.componentWrapper],["e-down-icon"]))},s.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},s.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.popupObj&&this.popupObj.hide(),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent(),this.list=null,this.popupObj=null,this.mainList=null,this.mainData=null,this.filterParent=null,this.ulElement=null,e.prototype.destroy.call(this);for(var i=["readonly","aria-disabled","aria-placeholder","placeholder"],s=i.length;s>0;)this.inputElement.removeAttribute(i[s-1]),s--;this.element.removeAttribute("data-initial-value"),this.element.style.display="block",this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()?t.remove(this.overAllWrapper):(this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),t.remove(this.overAllWrapper)))},oe([t.Complex({text:null,value:null,iconCss:null,groupBy:null},A)],s.prototype,"fields",void 0),oe([t.Property(!1)],s.prototype,"enablePersistence",void 0),oe([t.Property(null)],s.prototype,"groupTemplate",void 0),oe([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),oe([t.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),oe([t.Property("None")],s.prototype,"sortOrder",void 0),oe([t.Property(!0)],s.prototype,"enabled",void 0),oe([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),oe([t.Property([])],s.prototype,"dataSource",void 0),oe([t.Property(null)],s.prototype,"query",void 0),oe([t.Property("StartsWith")],s.prototype,"filterType",void 0),oe([t.Property(1e3)],s.prototype,"zIndex",void 0),oe([t.Property(!1)],s.prototype,"ignoreAccent",void 0),oe([t.Property()],s.prototype,"locale",void 0),oe([t.Property(!1)],s.prototype,"enableGroupCheckBox",void 0),oe([t.Property(null)],s.prototype,"cssClass",void 0),oe([t.Property("100%")],s.prototype,"width",void 0),oe([t.Property("300px")],s.prototype,"popupHeight",void 0),oe([t.Property("100%")],s.prototype,"popupWidth",void 0),oe([t.Property(null)],s.prototype,"placeholder",void 0),oe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),oe([t.Property({})],s.prototype,"htmlAttributes",void 0),oe([t.Property(null)],s.prototype,"valueTemplate",void 0),oe([t.Property(null)],s.prototype,"headerTemplate",void 0),oe([t.Property(null)],s.prototype,"footerTemplate",void 0),oe([t.Property(null)],s.prototype,"itemTemplate",void 0),oe([t.Property(null)],s.prototype,"allowFiltering",void 0),oe([t.Property(!0)],s.prototype,"changeOnBlur",void 0),oe([t.Property(!1)],s.prototype,"allowCustomValue",void 0),oe([t.Property(!0)],s.prototype,"showClearButton",void 0),oe([t.Property(1e3)],s.prototype,"maximumSelectionLength",void 0),oe([t.Property(!1)],s.prototype,"readonly",void 0),oe([t.Property(null)],s.prototype,"text",void 0),oe([t.Property(null)],s.prototype,"value",void 0),oe([t.Property(!0)],s.prototype,"hideSelectedItem",void 0),oe([t.Property(!0)],s.prototype,"closePopupOnSelect",void 0),oe([t.Property("Default")],s.prototype,"mode",void 0),oe([t.Property(",")],s.prototype,"delimiterChar",void 0),oe([t.Property(!0)],s.prototype,"ignoreCase",void 0),oe([t.Property(!1)],s.prototype,"showDropDownIcon",void 0),oe([t.Property("Never")],s.prototype,"floatLabelType",void 0),oe([t.Property(!1)],s.prototype,"showSelectAll",void 0),oe([t.Property("Select All")],s.prototype,"selectAllText",void 0),oe([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),oe([t.Property(!0)],s.prototype,"enableSelectionOrder",void 0),oe([t.Property(!0)],s.prototype,"openOnClick",void 0),oe([t.Event()],s.prototype,"change",void 0),oe([t.Event()],s.prototype,"removing",void 0),oe([t.Event()],s.prototype,"removed",void 0),oe([t.Event()],s.prototype,"selectedAll",void 0),oe([t.Event()],s.prototype,"beforeOpen",void 0),oe([t.Event()],s.prototype,"open",void 0),oe([t.Event()],s.prototype,"close",void 0),oe([t.Event()],s.prototype,"blur",void 0),oe([t.Event()],s.prototype,"focus",void 0),oe([t.Event()],s.prototype,"chipSelection",void 0),oe([t.Event()],s.prototype,"filtering",void 0),oe([t.Event()],s.prototype,"tagging",void 0),oe([t.Event()],s.prototype,"customValueSelection",void 0),s=oe([t.NotifyPropertyChanges],s)}(B),pe=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.onBlur,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),t.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.onBlur),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 i=this;if(t.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)};else{var s=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),s.apply(i,[e])}}},e.prototype.setPlaceholder=function(e){o.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var i;if(i=t.isNullOrUndefined(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==i.className&&"e-list-group-item"!==i.className){var s=r.createCheckBox(this.parent.createElement,!0),l=t.select("div.e-icons",i);return i.insertBefore(s,i.childNodes[t.isNullOrUndefined(l)?0:1]),t.select(".e-frame",s),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),i}return i},e.prototype.setSelectAll=function(){this.parent.showSelectAll?(t.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&&(t.isNullOrUndefined(this.parent.filterParent)?t.append([this.checkAllParent],this.parent.popupWrapper):t.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(t.isNullOrUndefined(this.parent.filterParent)?t.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),t.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.isDynamicDataChange||!t.isBlazor())||this.parent.isDynamicDataChange&&!t.isNullOrUndefined(this.parent.value)&&this.parent.value.length<=1&&t.isBlazor()?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):t.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),t.EventHandler.remove(document,"mousedown",this.onDocumentClick)},e.prototype.listSelection=function(e){var i,s=t.isBlazor()&&e.module&&"listbox"===e.module;if(t.isNullOrUndefined(e.e)){var l=e.li.querySelector(".e-checkbox-wrapper");i=l?s?l.querySelector(".e-frame"):l.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{var o=e.li.querySelector(".e-checkbox-wrapper .e-frame");i=t.isNullOrUndefined(e.e.target)?s?o: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:s?o:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(i=e.li.firstElementChild.childNodes[1]),t.isNullOrUndefined(i)||(this.checkWrapper=t.closest(i,".e-checkbox-wrapper")),!t.isNullOrUndefined(this.checkWrapper)){var r=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,r.classList.contains("e-check"),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 i;i=e.currentTarget.classList.contains(this.checkAllParent.className)?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=t.closest(i,".e-checkbox-wrapper");if(!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains("e-check"),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,i,s,l,o){var r,n=e.getElementsByClassName("e-frame")[0];"check"!==i||n.classList.contains("e-check")?"uncheck"===i&&(n.classList.contains("e-check")||n.classList.contains("e-stop"))?(t.removeClass([n],["e-check","e-stop"]),r="false",o&&(this.parent.selectAllItems(!1,s),this.setLocale())):"indeterminate"!==i||n.classList.contains("e-stop")||(t.removeClass([n],["e-check"]),n.classList.add("e-stop"),r="false",o&&(this.parent.selectAllItems(!1,s),this.setLocale())):(n.classList.remove("e-stop"),n.classList.add("e-check"),r="true",o&&(this.parent.selectAllItems(!0,s),this.setLocale(!0))),r="check"===i?"true":"uncheck"===i?"false":r,t.isNullOrUndefined(r)||e.setAttribute("aria-checked",r)},e.prototype.setSearchBox=function(e){if(t.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 i=!1;return t.Browser.isDevice&&(i=!0,this.parent.mobFilter=!1),this.filterInputObj=o.Input.createInput({element:this.filterInput,buttons:i?["e-input-group-icon e-back-icon e-icons","e-input-group-icon e-clear-icon e-icons"]:["e-input-group-icon e-clear-icon e-icons"],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),t.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],this.parent.filterParent),t.prepend([this.parent.filterParent],e.popupElement),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.parent.element.id+"_options",role:"listbox","aria-activedescendant":null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector(".e-clear-icon"),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),t.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),t.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),t.EventHandler.add(this.filterInput,"blur",this.onBlur,this),t.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(),t.removeClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),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.refreshPopup(),this.parent.refreshListItems(null),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),this.setReorder(e),e.preventDefault()},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(".e-clear-icon"),this.clearIconElement.style.visibility="hidden",t.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),t.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,i=0;this.checkAllParent&&(i=this.checkAllParent.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-i+"px",this.parent.list.style.height=window.innerHeight-e-i+"px";var s=this.filterInput.parentElement.querySelector(".e-clear-icon");t.detach(this.filterInput),s.parentElement.insertBefore(this.filterInput,s)},e.prototype.setPopupFullScreen=function(){t.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%"},e.prototype.targetElement=function(){return t.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlur=function(e){if(!this.parent.element.classList.contains("e-listbox")){var i=void 0;if(this.parent.keyAction)return;if(t.Browser.isIE&&(i=!t.isNullOrUndefined(e)&&e.target),t.Browser.isIE||(i=!t.isNullOrUndefined(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(i)&&!t.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("e-input-focus"),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")&&!t.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var i=e.target;!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(k.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlur(e,!0),this.parent.focused=!0),this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(t.Browser.isIE?this.parent.onBlur():this.parent.onBlur(e)),this.filterInput===i&&this.filterInput.focus()}},e.prototype.getFocus=function(e){if(this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value)return void(this.parent.keyAction=!1);"focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),t.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&&"true"!==this.checkAllParent.getAttribute("aria-checked")&&(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 i=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var s=t.compile(i),l=e?"unSelectAllText":"selectAllText",o=0,r=s({},this.parent,l,null,!this.parent.isStringTemplate);o<r.length;o++){var n=r[o];this.selectAllSpan.textContent=n.textContent}}else{var a={selectAllText:"Select All",unSelectAllText:"Unselect All"},h=new t.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===h.getConstant("selectAllText")&&(h=new t.L10n("dropdowns",a,this.parent.locale)),this.selectAllSpan.textContent=e?h.getConstant("unSelectAllText"):h.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&&!t.isNullOrUndefined(this.parent.value)){var i=this.parent.ulElement.querySelectorAll("li.e-active").length,s=void 0,l=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});i>0&&(t.append(this.parent.ulElement.querySelectorAll("li.e-active"),l),s=this.parent.ulElement.querySelectorAll("li.e-active"),t.addClass(s,"e-reorder-hide"),t.prepend([l],this.parent.list)),this.parent.focusAtFirstListItem()}},e}(),ue=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])})(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)}}(),ce=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property("Multiple")],i.prototype,"mode",void 0),ce([t.Property(!1)],i.prototype,"showCheckbox",void 0),ce([t.Property(!1)],i.prototype,"showSelectAll",void 0),ce([t.Property("Left")],i.prototype,"checkboxPosition",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property([])],i.prototype,"items",void 0),ce([t.Property("Right")],i.prototype,"position",void 0),i}(t.ChildProperty),fe=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}ue(n,e),a=n,n.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},n.prototype.render=function(){this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,t.isBlazor()&&this.isServerRendered?(this.list=this.element.parentElement,this.liCollections=this.list.querySelectorAll("."+s.cssClass.li),this.mainList=this.ulElement=this.list.querySelector("ul"),this.setSelection(this.value),this.allowFiltering&&this.setFiltering(),this.initToolbarAndStyles(),this.updateSelectionSettings(),this.wireEvents(),this.initDraggable(),this.initLoad=!1):e.prototype.render.call(this),this.renderComplete()},n.prototype.updateBlazorListData=function(e,i,l){i&&(this.liCollections=this.list.querySelectorAll("."+s.cssClass.li),this.mainList=this.ulElement=this.list.querySelector("ul"),this.allowDragAndDrop&&!this.ulElement.classList.contains("e-sortable")&&this.initDraggable(),l&&this.selectItems(this.listData,!1)),t.isNullOrUndefined(e)||(this.sortedData=this.jsonData=this.listData=e)},n.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});this.list.classList.add("e-listbox-wrapper"),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.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(k.focus),this.itemTemplate&&this.renderReactTemplates(),t.removeClass([this.list],[k.content,k.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),t.attributes(this.list,{role:"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},n.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new t.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",{})}},n.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new s.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",dragStart: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 o=e.getItems()[0];return i.style.width=o.offsetWidth+"px",i.style.height=o.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=l.getZindexPartial(e.element)+"",i}})},n.prototype.updateActionCompleteData=function(e,t){this.jsonData.push(t)},n.prototype.initToolbar=function(){var e=this.toolbarSettings.position,i=this.element.getAttribute("data-value");if(this.toolbarSettings.items.length){var s=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),l=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(l,this.list),l.appendChild("Right"===e?this.list:s),l.appendChild("Right"===e?s:this.list),this.createButtons(s),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var o=this.element.getAttribute("data-value");i&&o&&i!==o?(this.tBListBox=t.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):o&&(this.tBListBox=t.getComponent(document.getElementById(o),this.getModuleName()),this.tBListBox.updateToolBarState())},n.prototype.createButtons=function(e){var i,s,l,o=this,n=new t.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(t){l=n.getConstant(t),s=o.createElement("button",{attrs:{type:"button","data-value":t,title:l,"aria-label":l}}),e.appendChild(s),(i=new r.Button({iconCss:"e-icons e-"+t.toLowerCase()},s)).createElement=o.createElement})},n.prototype.validationAttribute=function(t,i){e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},n.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=t.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?t.addClass([this.list],"e-filter-list"):t.removeClass([this.list],"e-filter-list")},n.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.enableRtl&&t.addClass([e],"e-rtl")},n.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?t.removeClass([e],s.cssClass.disabled):(t.addClass([e],s.cssClass.disabled),t.isBlazor()&&this.isServerRendered&&this.toolbarSettings.items.length&&t.removeClass([this.list],s.cssClass.disabled))},n.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=t.formatUnit(this.height),this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),l.createSpinner({target:this.spinner},this.createElement),l.showSpinner(this.spinner)},n.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&l.hideSpinner(this.spinner),this.spinner.parentElement&&t.detach(this.spinner)},n.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},n.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},n.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+ve.clearIcon)&&(this.filterInput.parentElement.querySelector("."+ve.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},n.prototype.onActionComplete=function(i,s,l){var o;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(o=t.isBlazor()&&this.isServerRendered?this.list.getElementsByClassName("e-filter-parent")[0]:this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===s.length){var r=i.getElementsByClassName("e-list-nrt")[0];r&&i.removeChild(r)}if(e.prototype.onActionComplete.call(this,i,s,l),this.allowFiltering&&!t.isNullOrUndefined(o)&&(this.list.insertBefore(o,this.list.firstElementChild),t.isBlazor()||this.isServerRendered||(this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(o))),this.initWrapper(),this.setSelection(),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],t.extend(this.jsonData,s,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],t.extend(this.jsonData,s,[]),this.isDataSourceUpdate=!1),this.allowFiltering){var n=this.list.getElementsByClassName("e-input-filter")[0],a=this.filterInput.value.length;n.selectionStart=a,n.selectionEnd=a,n.focus()}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!t.isNullOrUndefined(l)){var h=this.scope.replace("#","");t.getComponent(document.getElementById(h),this.getModuleName()).initToolbar()}this.initLoad=!1},n.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},n.prototype.triggerDragStart=function(e){var i,s=this;e=t.extend(this.getDragArgs(e),{dragSelected:!0}),t.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",e,function(l){s.allowDragAll=l.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&t.detach(i),t.isBlazor()&&e.bindEvents(e.dragElement)})},n.prototype.triggerDrag=function(e){this.trigger("drag",this.getDragArgs(e));var t=this.getComponent(e.target);if(t&&0===t.listData.length){var i=t.ulElement.getElementsByClassName("e-list-nrt")[0];i&&t.ulElement.removeChild(i)}},n.prototype.beforeDragEnd=function(e){var t=this.getFormattedValue(e.droppedElement.getAttribute("data-value"));this.value.indexOf(t)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([t]),this.trigger("beforeDrop",e)},n.prototype.dragEnd=function(e){var i,l,o,r,n,a,h=this,p=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),u=this.getComponent(e.droppedElement),c=this.getDragArgs({target:e.droppedElement},!0),d={previousData:this.dataSource},m={previousData:u.dataSource},f=t.extend({},c,{target:e.target,source:{previousData:this.dataSource}});if(u!==this){T=t.extend(d,{currentData:this.listData});f=t.extend(f,{source:T,destination:m})}if(t.Browser.isIos&&(this.list.style.overflow=""),u===this){var v=this.ulElement;i=[].slice.call(this.listData),l=[].slice.call(this.liCollections),o=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData);var y=e.currentIndex,g=e.currentIndex=this.getCurIdx(this,e.currentIndex),C=i.indexOf(this.getDataByValue(p)),b=o.indexOf(this.getDataByValue(p)),S=a.indexOf(this.getDataByValue(p));if(i.splice(g,0,i.splice(C,1)[0]),a.splice(y,0,a.splice(S,1)[0]),o.splice(g,0,o.splice(b,1)[0]),t.isBlazor()||l.splice(g,0,l.splice(C,1)[0]),this.allowDragAll&&(n=this.value&&Array.prototype.indexOf.call(this.value,p)>-1?this.value:[p]).forEach(function(r){if(r!==p){var n=i.indexOf(h.getDataByValue(r)),u=o.indexOf(h.getDataByValue(r)),c=a.indexOf(h.getDataByValue(r));n>g&&g++,o.splice(g,0,o.splice(u,1)[0]),i.splice(g,0,i.splice(n,1)[0]),a.splice(y,0,a.splice(c,1)[0]),t.isBlazor()||(l.splice(g,0,l.splice(n,1)[0]),v.insertBefore(h.getItems()[h.getIndexByValue(r)],v.getElementsByClassName("e-placeholder")[0]))}else if(t.isBlazor()){var d=[].slice.call(h.ulElement.getElementsByClassName(s.cssClass.li)),m=h.ulElement.removeChild(d[e.currentIndex]);d.splice(e.currentIndex,1),h.ulElement.insertBefore(m,d[e.previousIndex])}}),this.listData=i,this.jsonData=o,this.sortedData=a,this.liCollections=l,t.isBlazor()){var E=this.value;this.interopAdaptor.invokeMethodAsync("UpdateListData",this.listData).then(function(){h.updateBlazorListData(null,!0),h.selectItems(h.listData,!1),h.selectItems(E)})}}else{var x,w=[].slice.call(this.liCollections),O=e.currentIndex=this.getCurIdx(u,e.currentIndex),A=u.ulElement;i=[].slice.call(u.listData),l=[].slice.call(u.liCollections),o=[].slice.call(u.jsonData),a=[].slice.call(u.sortedData),n=this.value&&Array.prototype.indexOf.call(this.value,p)>-1&&this.allowDragAll?this.value:[p];var k=[].slice.call(this.listData),B=[].slice.call(this.sortedData);if(n.forEach(function(n,u){r=h.getDataByValue(n);var c=h.listData.indexOf(r),d=h.jsonData.indexOf(r),m=h.sortedData.indexOf(r);k.splice(c,1),h.jsonData.splice(d,1),B.splice(m,1),h.listData=k,h.sortedData=B;var f=n===p?e.currentIndex:O;if(i.splice(f,0,r),o.splice(f,0,r),a.splice(f,0,r),t.isBlazor()||l.splice(f,0,w.splice(c,1)[0]),n)x=h.getItems()[h.getIndexByValue(n)];else for(var v=h.getItems(),y=0;y<v.length;y++)if(null===v[y].getAttribute("data-value")&&v[y].classList.contains("e-list-item")){x=v[y];break}x||(x=e.helper),h.removeSelected(h,n===p?[e.droppedElement]:[x]),t.isBlazor()?0===u&&h.ulElement.insertBefore(A.getElementsByClassName(s.cssClass.li)[e.currentIndex],h.ulElement.getElementsByClassName(s.cssClass.li)[e.previousIndex]):A.insertBefore(x,A.getElementsByClassName("e-placeholder")[0]),O++}),t.isBlazor())this.interopAdaptor.invokeMethodAsync("UpdateListData",this.listData).then(function(){h.updateSelectedOptions(),h.fields.groupBy&&h.setSelection(),h.updateBlazorListData(null,!0,null==h.value||!h.value.length)}),u.interopAdaptor.invokeMethodAsync("UpdateListData",i).then(function(){("None"!==u.sortOrder||h.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy)&&u.setSelection(),u.updateBlazorListData(null,!0,null==u.value||!u.value.length)});else{if(this.fields.groupBy&&(this.ulElement.innerHTML=this.renderItems(this.listData,this.fields).innerHTML,this.setSelection()),"None"!==u.sortOrder||this.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy||u.itemTemplate||this.itemTemplate){var D=t.getComponent(A,"sortable");A.innerHTML=u.renderItems(i,u.fields).innerHTML,D.placeHolderElement&&A.appendChild(D.placeHolderElement),A.appendChild(e.helper),u.setSelection()}this.liCollections=w,u.liCollections=l}u.jsonData=t.extend([],[],o,!1),u.listData=t.extend([],[],i,!1),u.sortedData=t.extend([],[],a,!1),0===this.listData.length&&this.l10nUpdate()}if(this===u){var T=t.extend(d,{currentData:i});f=t.extend(f,{source:T})}else{var I=t.extend(m,{currentData:i});f=t.extend(f,{destination:I})}this.trigger("drop",f)},n.prototype.removeSelected=function(e,i){e.selectionSettings.showCheckbox?i.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):t.removeClass(i,s.cssClass.selected)},n.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(s.cssClass.group)}).length),t},n.prototype.getComponent=function(e){var i,s="EJS-LISTBOX"===this.element.tagName?t.closest(e,".e-listbox"):t.closest(e,".e-listbox-wrapper")&&t.closest(e,".e-listbox-wrapper").querySelector(".e-listbox");return s&&(i=t.getComponent(s,this.getModuleName())),i},n.prototype.listOption=function(i,s){return this.listCurrentOptions=e.prototype.listOption.call(this,i,s),this.listCurrentOptions=t.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},n.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},n.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},n.prototype.enableItems=function(e,i,l){var o=this;void 0===i&&(i=!0);var r;e.forEach(function(e){var n;if(t.isBlazor()&&"object"==typeof e){if(n=t.getValue(l?o.fields.value:o.fields.text,e),t.isNullOrUndefined(n))return}else n=e;(r=o.findListElement(o.list,"li","data-value",l?n:o.getValueByText(n)))&&(i?(t.removeClass([r],s.cssClass.disabled),r.removeAttribute("aria-disabled")):(t.addClass([r],s.cssClass.disabled),r.setAttribute("aria-disabled","true")))})},n.prototype.selectItems=function(e,t,i){void 0===t&&(t=!0),this.setSelection(e,t,!i),this.updateSelectedOptions()},n.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},n.prototype.addItems=function(t,i){e.prototype.addItem.call(this,t,i)},n.prototype.removeItems=function(e,t){this.removeItem(e,t)},n.prototype.removeItem=function(e,i){var s=[],l=this.list.querySelectorAll("."+k.li);if(e){e=e instanceof Array?e:[e];var o=this.fields,r=void 0,n=[],a=void 0;t.extend(n,[],this.listData);for(var h=[],p=[],u=0;u<e.length;u++){r=e[u]instanceof Object?t.getValue(o.value,e[u]):e[u].toString();for(var c=0,d=n.length;c<d;c++)(n[c]instanceof Object?t.getValue(o.value,n[c]):n[c].toString())===r&&(a=this.getIndexByValue(r),s.push(l[a]),h.push(c),p.push(a))}for(m=h.length-1;m>=0;m--)this.listData.splice(h[m],1);for(var m=p.length-1;m>=0;m--)this.updateLiCollection(p[m])}else i=i||0,s.push(l[i]),this.listData.splice(i,1),this.updateLiCollection(i);for(c=0;c<s.length;c++)this.ulElement.removeChild(s[c]);0===this.listData.length&&this.l10nUpdate()},n.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},n.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},n.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},n.prototype.moveTo=function(e,i,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),o=s?t.getComponent(s,a):this.getScopedListBox();this.moveData(this,o,!1,l,i)},n.prototype.moveAllTo=function(e,i){if(this.listData.length>0){var s=e?t.getComponent(e,a):this.getScopedListBox();this.moveAllData(this,s,!1,i)}},n.prototype.getDataList=function(){return this.jsonData},n.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},n.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},n.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},n.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach(function(t){if(!t.classList.contains(s.cssClass.disabled))if(i.selectionSettings.showCheckbox){var l=t.getElementsByClassName("e-check")[0];(!l&&e||l&&!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(s.cssClass.selected):t.classList.remove(s.cssClass.selected)}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),o=0;if(e){var r=this;for(o=0;o<l.length;o++)!function(){var e=r.getFormattedValue(l[o].getAttribute("data-value"));r.value.some(function(t){return t===e})||r.value.push(r.getFormattedValue(l[o].getAttribute("data-value")))}()}else{var n=this;for(o=0;o<l.length;o++)!function(){var e=n.getFormattedValue(l[o].getAttribute("data-value"));n.value=n.value.filter(function(t){return t!==e})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},n.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){var l=0,o=0,r=0;for(l;l<i;){if(this.value)for(o;o<this.value.length;o++)e[l].getAttribute("data-value")===this.value[o]&&r++;!r&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&r&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,r=0,o=0}}},n.prototype.wireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.add(this.list,"click",this.clickHandler,this),t.EventHandler.add(i,"keydown",this.keyDownHandler,this),t.EventHandler.add(i,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&t.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&t.EventHandler.add(e,"reset",this.formResetHandler,this)},n.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&t.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},n.prototype.unwireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.remove(this.list,"click",this.clickHandler),t.EventHandler.remove(i,"keydown",this.keyDownHandler),t.EventHandler.remove(i,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&t.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&t.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&t.EventHandler.remove(e,"reset",this.formResetHandler)},n.prototype.clickHandler=function(e){this.selectHandler(e)},n.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+k.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"})},n.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new i.Query;if(this.allowFiltering){var s=""===this.inputString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields.text?this.fields.text:"";t.where(o,s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new i.Query);return t},n.prototype.setFiltering=function(){var e;if(this.initLoad||t.isNullOrUndefined(this.filterParent))return t.isBlazor()&&this.isServerRendered?(this.filterParent=this.list.querySelector(".e-filter-parent"),this.filterInput=this.list.querySelector(".e-input-filter")):(this.filterParent=this.createElement("span",{className:ve.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:ve.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),t.Browser.isDevice,e=o.Input.createInput({element:this.filterInput,buttons:[ve.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.append([e.container],this.filterParent),t.prepend([this.filterParent],this.list),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-activedescendant":null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"})),this.height.toString().indexOf("%")<0&&t.addClass([this.list],"e-filter-list"),this.inputString=this.filterInput.value,this.filterWireEvents(),e},n.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+ve.clearIcon),this.clearFilterIconElem&&(t.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},n.prototype.selectHandler=function(e,i){var l,o=!0,r=t.closest(e.target,".e-list-item"),n=[r];if(r&&r.parentElement){if(l=[].slice.call(r.parentElement.children).indexOf(r),this.selectionSettings.showCheckbox?o=!r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||t.Browser.isDevice)&&this.isSelected(r)?(r.classList.remove(s.cssClass.selected),r.removeAttribute("aria-selected"),o=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||t.Browser.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),t.removeClass(this.getSelectedItems(),s.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?n=[].slice.call(r.parentElement.children).slice(Math.min(l,this.prevSelIdx),Math.max(l,this.prevSelIdx)+1).filter(function(e){return e.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(r.parentElement.children).indexOf(r),o&&(this.selectionSettings.showCheckbox||t.addClass(n,s.cssClass.selected),n.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",r.id)),i||!(this.maximumSelectionLength>(this.value&&this.value.length))&&o||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&o||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:r,e:e,module:"listbox"}),this.allowFiltering&&!i){var a=this.getFormattedValue(r.getAttribute("data-value"));if(o){var h=[];t.extend(h,this.value),h.push(a),this.value=h}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.checkMaxSelection()}},n.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},n.prototype.getDataByElems=function(e){for(var t=[],i=0,s=e.length;i<s;i++)t.push(this.getDataByValue(this.getFormattedValue(e[i].getAttribute("data-value"))));return t},n.prototype.getDataByElements=function(e){var i,s=[],l=0;if(!t.isNullOrUndefined(this.listData)){var o=this.typeOfData(this.listData).typeof;if("string"===o||"number"===o||"boolean"===o)for(var r=0,n=this.listData;r<n.length;r++){for(var a=n[r],h=l,p=e.length;h<p;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(a)&&a===i){l=h,s.push(a);break}if(e.length===s.length)break}else for(var u=0,c=this.listData;u<c.length;u++){for(var a=c[u],h=l,p=e.length;h<p;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(a)&&t.getValue(this.fields.value?this.fields.value:"value",a)===i){l=h,s.push(a);break}if(e.length===s.length)break}return s}return null},n.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox){var t=0,i=this.list.getElementsByClassName("e-list-item");for(t;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"))}},n.prototype.toolbarClickHandler=function(e){var i=t.closest(e.target,"button");if(i){if(this.toolbarAction=i.getAttribute("data-value"),i.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})}}},n.prototype.moveUpDown=function(e,t,i){var l=this,o=this.getSelectedItems();if(i&&(o=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var r=this.getDataByElems(o),n={cancel:!1,items:r,eventName:this.toolbarAction};this.trigger("actionBegin",n),n.cancel||((e?o:o.reverse()).forEach(function(t){var i=Array.prototype.indexOf.call(l.ulElement.querySelectorAll(".e-list-item"),t),o=Array.prototype.indexOf.call(l.ulElement.children,t);s.moveTo(l.ulElement,l.ulElement,[o],e?o-1:o+2),l.changeData(o,e?o-1:o+1,e?i-1:i+1,t)}),this.trigger("actionComplete",{items:r,eventName:this.toolbarAction}),o[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},n.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},n.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},n.prototype.moveData=function(e,i,l,o,r){var n=this,a=[],h=[],p=[],u=[],c=[].slice.call(e.listData),d=[].slice.call(i.listData),m=[].slice.call(e.sortedData),f=[].slice.call(i.sortedData),v=[].slice.call(e.liCollections),y=[],g=[].slice.call(i.liCollections),C=[],b=[],S=e.getSelectedItems();o&&(S=o);var E="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;if(e.value=[],S.length){this.removeSelected(e,S),S.forEach(function(t,i){a.push(Array.prototype.indexOf.call(e.ulElement.children,t)),y.push(Array.prototype.indexOf.call(e.ulElement.querySelectorAll(".e-list-item"),t)),h.push(Array.prototype.indexOf.call(e.listData,e.getDataByElems([t])[0])),u.push(Array.prototype.indexOf.call(e.sortedData,e.getDataByElems([t])[0])),p.push(Array.prototype.indexOf.call(e.jsonData,e.getDataByElems([t])[0]))}),"None"!==this.sortOrder?u.forEach(function(t){C.push(e.sortedData[t])}):p.forEach(function(t){C.push(e.jsonData[t])});var x={cancel:!1,items:C,eventName:this.toolbarAction};if(e.trigger("actionBegin",x),x.cancel)return;if(!t.isBlazor()){var w=[];if(y.sort(function(e,t){return e-t}).reverse().forEach(function(e){w.push(v.splice(e,1)[0])}),e.liCollections=v,r){var O=g.splice(0,r);i.liCollections=O.concat(w.reverse()).concat(g)}else i.liCollections=g.concat(w.reverse());if(0===i.listData.length){var A=i.ulElement.getElementsByClassName("e-list-nrt")[0];A&&i.ulElement.removeChild(A)}}h.sort(function(e,t){return t-e}).forEach(function(e){c.splice(e,1)[0]}),u.sort(function(e,t){return t-e}).forEach(function(e){m.splice(e,1)[0]}),p.slice().reverse().forEach(function(t){b.push(e.jsonData.splice(t,1)[0])}),t.isBlazor()||(E?e.fields.groupBy?e.ulElement.innerHTML=e.renderItems(c,e.fields).innerHTML:S.forEach(function(e){t.detach(e)}):(s.moveTo(e.ulElement,i.ulElement,a,r),e.trigger("actionComplete",{items:C,eventName:this.toolbarAction})),i.mainList.childElementCount!==i.jsonData.length&&(i.mainList=i.ulElement),e.updateMainList());var k=[].slice.call(i.jsonData);f=[].slice.call(i.sortedData),t.isBlazor()||this.selectNextList(S,y,h,e),l&&this.list.focus(),e.listData=c,e.sortedData=m,r=r||d.length;for(var B=C.length-1;B>=0;B--)d.splice(r,0,C[B]),k.splice(r,0,C[B]),f.splice(r,0,C[B]);i.listData=d,i.jsonData=k,i.sortedData=f,t.isBlazor()?(e.interopAdaptor.invokeMethodAsync("UpdateListData",e.listData).then(function(){e.updateBlazorListData(null,!0),n.selectNextList(S,y,h,e),e.updateSelectedOptions()}),i.interopAdaptor.invokeMethodAsync("UpdateListData",i.listData).then(function(){E&&i.setSelection(),i.updateBlazorListData(null,!0),e.trigger("actionComplete",{items:C,eventName:n.toolbarAction})})):(E&&(i.ulElement.innerHTML=i.renderItems(d,i.fields).innerHTML,i.setSelection(),e.trigger("actionComplete",{items:C,eventName:this.toolbarAction})),e.updateSelectedOptions()),0===e.listData.length&&e.l10nUpdate()}1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value")))},n.prototype.selectNextList=function(e,t,i,l){var o,r,n=l.ulElement.querySelectorAll(".e-list-item").length,a=-1;1===e.length&&n&&!l.selectionSettings.showCheckbox&&(r=n<=t[0]?n-1:t[0],o=l.ulElement.querySelectorAll(".e-list-item")[r],(a=l.getValidIndex(o,r,n===i[0]?38:40))>-1&&l.ulElement.querySelectorAll(".e-list-item")[a].classList.add(s.cssClass.selected))},n.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},n.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},n.prototype.moveAllData=function(e,i,l,o){var r=this,n=[].slice.call(i.listData),a=[].slice.call(i.jsonData),h="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;this.removeSelected(e,e.getSelectedItems());var p=[].slice.call(e.jsonData),u={cancel:!1,items:p,eventName:this.toolbarAction};if(e.trigger("actionBegin",u),!u.cancel){if(!t.isBlazor()){if(0===i.listData.length&&(c=i.ulElement.getElementsByClassName("e-list-nrt")[0])&&i.ulElement.removeChild(c),h){var c=e.ulElement.getElementsByClassName("e-list-nrt")[0];c&&e.ulElement.removeChild(c)}s.moveTo(e.ulElement,i.ulElement,Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number),o),this.trigger("actionComplete",{items:p,eventName:this.toolbarAction})}l&&this.list.focus(),o=o||n.length;for(d=0;d<e.listData.length;d++)n.splice(o+d,0,e.listData[d]);for(var d=0;d<e.jsonData.length;d++)a.splice(o+d,0,e.jsonData[d]);if(!t.isBlazor()){var m=[].slice.call(e.liCollections),f=[].slice.call(i.liCollections);if(e.liCollections=[],o){var v=f.splice(0,o);i.liCollections=v.concat(m).concat(f)}else i.liCollections=f.concat(m)}e.value=[],n=n.filter(function(e){return!0!==e.isHeader}),i.listData=n,i.jsonData=a,e.listData=e.sortedData=e.jsonData=[],t.isBlazor()?(h||(i.sortedData=n),e.interopAdaptor.invokeMethodAsync("UpdateListData",e.listData).then(function(){e.updateBlazorListData(null,!0),e.updateSelectedOptions()}),i.interopAdaptor.invokeMethodAsync("UpdateListData",i.listData).then(function(){i.updateBlazorListData(null,!0),e.updateSelectedOptions(),e.trigger("actionComplete",{items:p,eventName:r.toolbarAction})})):(h?(i.ulElement.innerHTML=i.renderItems(n,i.fields).innerHTML,this.trigger("actionComplete",{items:p,eventName:this.toolbarAction})):i.sortedData=n,e.updateSelectedOptions()),0===e.listData.length&&e.l10nUpdate()}},n.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),o=[].slice.call(this.jsonData),r=[].slice.call(this.sortedData),n=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),a=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),o.splice(i,0,o.splice(n,1)[0]),r.splice(t,0,r.splice(a,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=o,this.liCollections=h,this.sortedData=r},n.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(i){e.push(t.closest(i,".e-list-item"))}):e=[].slice.call(this.ulElement.getElementsByClassName(s.cssClass.selected)),e},n.prototype.getScopedListBox=function(){var e,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(s){t.getComponent(s,i.getModuleName())&&(e=t.getComponent(s,i.getModuleName()))}),e},n.prototype.getGrabbedItems=function(){return Array.prototype.slice.call(this.element.querySelectorAll(".e-grabbed"))},n.prototype.getDragArgs=function(e,i){var s=this.getGrabbedItems();return s.length?i&&s.push(e.target):s=[e.target],t.isBlazor()?{elements:s,items:this.getDataByElems(s),bindEvents:e.bindEvents,dragElement:e.dragElement}:{elements:s,items:this.getDataByElems(s)}},n.prototype.onKeyDown=function(e){this.keyDownHandler(e),event.stopPropagation()},n.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&!this.allowFiltering){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)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&&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))},n.prototype.upDownKeyHandler=function(e){var i=this.ulElement,l=40===e.keyCode||36===e.keyCode?0:i.childElementCount-1,o=i.getElementsByClassName("e-focused")[0]||i.getElementsByClassName(s.cssClass.selected)[0];if(o){if(35!==e.keyCode&&36!==e.keyCode&&(l=Array.prototype.indexOf.call(i.children,o),40===e.keyCode?l++:l--,l<0||l>i.childElementCount-1))return;t.removeClass([o],"e-focused")}var r=i.children[l];if(r){if(-1===(l=this.getValidIndex(r,l,e.keyCode)))return void t.addClass([o],"e-focused");i.children[l].focus(),i.children[l].classList.add("e-focused"),e.ctrlKey||this.selectHandler({target:i.children[l],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0)}},n.prototype.KeyUp=function(e){var s=this,l=(this.targetElement(),e.keyCode,String.fromCharCode(e.keyCode).match(/\w/));if(t.isNullOrUndefined(l)||(this.isValidKey=!0),this.isValidKey=8===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var o={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){s.isDataFetched=!1,o.cancel||""!==s.filterInput.value&&s.isFiltered||(o.cancel||s.isCustomFiltering||o.preventDefaultAction||(s.inputString=s.filterInput.value,s.filteringAction(s.jsonData,new i.Query,s.fields)),s.isFiltered||s.isCustomFiltering||o.preventDefaultAction||s.dataUpdater(s.jsonData,new i.Query,s.fields))})}},n.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},n.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},n.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],this.targetInputElement.value},n.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;if(""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},n.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},n.prototype.getValidIndex=function(e,t,i){var l=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===l.childElementCount?-1:(((e=l.querySelectorAll(".e-list-item")[t]).classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},n.prototype.updateSelectedOptions=function(){var e=this,i=[],s=[];if(t.extend(s,this.value),this.getSelectedItems().forEach(function(t){t.classList.contains("e-grabbed")||i.push(e.getFormattedValue(t.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var l=0;l<i.length;l++)s.indexOf(i[l])>-1||s.push(i[l]);this.setProperties({value:s},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},n.prototype.clearSelection=function(e){var t=this;if(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox){var i;this.getSelectedItems().forEach(function(s){i=t.getFormattedValue(s.getAttribute("data-value")),e.indexOf(i)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.getElementsByClassName("e-checkbox-wrapper")[0].removeAttribute("aria-checked"),s.removeAttribute("aria-selected"))})}},n.prototype.setSelection=function(e,i,l){var o=this;void 0===e&&(e=this.value),void 0===i&&(i=!0),void 0===l&&(l=!1);var r,n;e&&e.forEach(function(e){var a;if(l)if(t.isBlazor()&&"object"==typeof e){if(a=e[o.fields.text||"text"],t.isNullOrUndefined(a))return;a=o.getValueByText(a)}else a=o.getValueByText(e);else a=e;(r=o.list.querySelector('[data-value="'+a+'"]'))&&(n=o.selectionSettings.showCheckbox?r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):r.classList.contains("e-selected"),(!i&&n||i&&!n&&r)&&(o.selectionSettings.showCheckbox?o.notify("updatelist",{li:r,module:"listbox"}):i?(r.classList.add(s.cssClass.selected),r.setAttribute("aria-selected","true")):(r.classList.remove(s.cssClass.selected),r.removeAttribute("aria-selected"))))}),this.updateSelectTag()},n.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(e.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)t+='<option selected value="'+this.value[i]+'"></option>';e.innerHTML+=t}this.checkSelectAll()},n.prototype.checkDisabledState=function(e){return 0===e.ulElement.querySelectorAll("."+s.cssClass.li).length},n.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}})}},n.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")},n.prototype.showCheckbox=function(e){var i=0,s=this.list.lastElementChild.querySelectorAll("li"),l=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(t.isBlazor()||(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 o=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=o.getConstant("selectAllText"),this.unSelectAllText=o.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else if(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]),!t.isBlazor()){for(i;i<l;i++)s[i].classList.contains("e-list-item")&&s[i].removeChild(s[i].getElementsByClassName("e-checkbox-wrapper")[0]),s[i].hasAttribute("aria-selected")&&s[i].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},n.prototype.isSelected=function(e){return!t.isNullOrUndefined(e)&&(e.classList.contains(s.cssClass.selected)||null!==e.querySelector(".e-check"))},n.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},n.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},n.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},n.prototype.getModuleName=function(){return"listbox"},n.prototype.getPersistData=function(){return this.addOnPersist(["value"])},n.prototype.getLocaleName=function(){return"listbox"},n.prototype.destroy=function(){this.itemTemplate&&t.resetBlazorTemplate(this.element.id+"ItemTemplate","ItemTemplate"),this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered)&&(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),t.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered)&&e.prototype.destroy.call(this),this.itemTemplate&&this.clearTemplate()},n.prototype.onPropertyChanged=function(i,l){var r=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,i,l),this.setUpdateInitial(["fields","query","dataSource"],i);for(var n=0,a=Object.keys(i);n<a.length;n++)switch(a[n]){case"cssClass":l.cssClass&&t.removeClass([r],l.cssClass.split(" ")),i.cssClass&&t.addClass([r],i.cssClass.split(" "));break;case"enableRtl":i.enableRtl?r.classList.add("e-rtl"):r.classList.remove("e-rtl");break;case"value":t.removeClass(this.list.querySelectorAll("."+s.cssClass.selected),s.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":i.allowDragAndDrop?this.initDraggable():t.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,t.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&o.Input.setPlaceholder(i.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(t.getComponent(this.ulElement,"sortable").scope=i.scope),this.toolbarSettings.items.length&&(l.scope&&(t.getComponent(document.querySelector(l.scope),this.getModuleName()).tBListBox=null),i.scope&&(t.getComponent(document.querySelector(i.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var h=void 0,p=i.toolbarSettings.position,u=this.getToolElem();p&&(t.removeClass([r],["e-right","e-left"]),r.classList.add("e-"+p.toLowerCase()),"Left"===p?r.insertBefore(u,this.list):r.appendChild(u)),i.toolbarSettings.items&&(l.toolbarSettings.items.length&&((h=this.list.parentElement).parentElement.insertBefore(this.list,h),t.detach(h)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var c=i.selectionSettings.showSelectAll,d=i.selectionSettings.showCheckbox;if(!t.isNullOrUndefined(c)){if(this.showSelectAll=c,this.showSelectAll){var m=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=m.getConstant("selectAllText"),this.unSelectAllText=m.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}t.isNullOrUndefined(d)||this.showCheckbox(d),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}};var a;return ce([t.Property("")],n.prototype,"cssClass",void 0),ce([t.Property([])],n.prototype,"value",void 0),ce([t.Property("")],n.prototype,"height",void 0),ce([t.Property(!1)],n.prototype,"allowDragAndDrop",void 0),ce([t.Property(1e3)],n.prototype,"maximumSelectionLength",void 0),ce([t.Property(!1)],n.prototype,"allowFiltering",void 0),ce([t.Property("")],n.prototype,"scope",void 0),ce([t.Property(!0)],n.prototype,"ignoreCase",void 0),ce([t.Property(null)],n.prototype,"filterBarPlaceholder",void 0),ce([t.Event()],n.prototype,"beforeItemRender",void 0),ce([t.Event()],n.prototype,"filtering",void 0),ce([t.Event()],n.prototype,"select",void 0),ce([t.Event()],n.prototype,"change",void 0),ce([t.Event()],n.prototype,"beforeDrop",void 0),ce([t.Event()],n.prototype,"dragStart",void 0),ce([t.Event()],n.prototype,"drag",void 0),ce([t.Event()],n.prototype,"drop",void 0),ce([t.Event()],n.prototype,"dataBound",void 0),ce([t.Property(null)],n.prototype,"groupTemplate",void 0),ce([t.Property("No records found")],n.prototype,"noRecordsTemplate",void 0),ce([t.Property("Request failed")],n.prototype,"actionFailureTemplate",void 0),ce([t.Property(1e3)],n.prototype,"zIndex",void 0),ce([t.Property(!1)],n.prototype,"ignoreAccent",void 0),ce([t.Complex({},me)],n.prototype,"toolbarSettings",void 0),ce([t.Complex({},de)],n.prototype,"selectionSettings",void 0),n=a=ce([t.NotifyPropertyChanges],n)}(B),ve={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"};return he.Inject(pe),fe.Inject(pe),e.incrementalSearch=a,e.Search=h,e.highlightSearch=p,e.revertHighlightSearch=c,e.FieldSettings=A,e.dropDownBaseClasses=k,e.DropDownBase=B,e.dropDownListClasses=I,e.DropDownList=N,e.Fields=z,e.TreeSettings=K,e.DropDownTree=_,e.ComboBox=X,e.AutoComplete=Z,e.MultiSelect=he,e.CheckBoxSelection=pe,e.createFloatLabel=d,e.updateFloatLabelState=m,e.removeFloating=f,e.setPlaceHolder=v,e.floatLabelFocus=y,e.floatLabelBlur=g,e.SelectionSettings=de,e.ToolbarSettings=me,e.ListBox=fe,e}({},ej.base,ej.data,ej.lists,ej.popups,ej.inputs,ej.buttons,ej.navigations),this.ejs=ej;
|